-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unittests/ASM: Adds missing unaligned atomic tests
Fixes #2670 Walked through all the unaligned atomic tests to find which ones were missing. Turns out it was only ADC, NEG, NOT, and SBB.
- Loading branch information
1 parent
5026bf8
commit 4f03044
Showing
13 changed files
with
588 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
%ifdef CONFIG | ||
{ | ||
"RegData": { | ||
"RAX": "0x4242434446464848", | ||
"RBX": "0x4242434445464748", | ||
"RCX": "0x4142434445464748", | ||
"RDX": "0x4142434445464748", | ||
"RSI": "0x4242434445464748", | ||
"RDI": "0x4142434445464748" | ||
} | ||
} | ||
%endif | ||
|
||
mov r15, 0xe0000000 | ||
|
||
mov rax, 0x4142434445464748 | ||
mov [r15 + 8 * 0], rax | ||
mov [r15 + 8 * 1], rax | ||
mov [r15 + 8 * 2], rax | ||
mov [r15 + 8 * 3], rax | ||
mov [r15 + 8 * 4], rax | ||
mov [r15 + 8 * 5], rax | ||
mov [r15 + 8 * 6], rax | ||
mov [r15 + 8 * 7], rax | ||
mov [r15 + 8 * 8], rax | ||
mov [r15 + 8 * 9], rax | ||
|
||
mov rax, 1 | ||
|
||
; Test 1 byte offset within 4byte boundary | ||
lock adc word [r15 + 8 * 0 + 1], ax | ||
|
||
; Test 3 byte offset across 4byte boundary | ||
lock adc word [r15 + 8 * 0 + 3], ax | ||
|
||
; Test 7 byte offset across 8byte boundary | ||
lock adc word [r15 + 8 * 0 + 7], ax | ||
|
||
; Test 15 byte offset across 16byte boundary | ||
lock adc word [r15 + 8 * 0 + 15], ax | ||
|
||
; Test 63 byte offset across cacheline boundary | ||
lock adc word [r15 + 8 * 0 + 63], ax | ||
|
||
mov rax, qword [r15 + 8 * 0] | ||
mov rbx, qword [r15 + 8 * 1] | ||
mov rcx, qword [r15 + 8 * 2] | ||
mov rdx, qword [r15 + 8 * 3] | ||
mov rsi, qword [r15 + 8 * 7] | ||
mov rdi, qword [r15 + 8 * 8] | ||
|
||
hlt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
%ifdef CONFIG | ||
{ | ||
"RegData": { | ||
"RAX": "0x4242434446464748", | ||
"RBX": "0x4242434445464748", | ||
"RCX": "0x4142434445464748", | ||
"RDX": "0x4142434445464748", | ||
"RSI": "0x4242434445464748", | ||
"RDI": "0x4142434445464748" | ||
} | ||
} | ||
%endif | ||
|
||
mov r15, 0xe0000000 | ||
|
||
mov rax, 0x4142434445464748 | ||
mov [r15 + 8 * 0], rax | ||
mov [r15 + 8 * 1], rax | ||
mov [r15 + 8 * 2], rax | ||
mov [r15 + 8 * 3], rax | ||
mov [r15 + 8 * 4], rax | ||
mov [r15 + 8 * 5], rax | ||
mov [r15 + 8 * 6], rax | ||
mov [r15 + 8 * 7], rax | ||
mov [r15 + 8 * 8], rax | ||
mov [r15 + 8 * 9], rax | ||
|
||
mov rax, 1 | ||
|
||
; Test 3 byte offset across 4byte boundary | ||
lock adc dword [r15 + 8 * 0 + 3], eax | ||
|
||
; Test 7 byte offset across 8byte boundary | ||
lock adc dword [r15 + 8 * 0 + 7], eax | ||
|
||
; Test 15 byte offset across 16byte boundary | ||
lock adc dword [r15 + 8 * 0 + 15], eax | ||
|
||
; Test 63 byte offset across cacheline boundary | ||
lock adc dword [r15 + 8 * 0 + 63], eax | ||
|
||
mov rax, qword [r15 + 8 * 0] | ||
mov rbx, qword [r15 + 8 * 1] | ||
mov rcx, qword [r15 + 8 * 2] | ||
mov rdx, qword [r15 + 8 * 3] | ||
mov rsi, qword [r15 + 8 * 7] | ||
mov rdi, qword [r15 + 8 * 8] | ||
|
||
hlt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
%ifdef CONFIG | ||
{ | ||
"RegData": { | ||
"RAX": "0x4242434445464748", | ||
"RBX": "0x4242434445464748", | ||
"RCX": "0x4142434445464748", | ||
"RDX": "0x4142434445464748", | ||
"RSI": "0x4242434445464748", | ||
"RDI": "0x4142434445464748" | ||
} | ||
} | ||
%endif | ||
|
||
mov r15, 0xe0000000 | ||
|
||
mov rax, 0x4142434445464748 | ||
mov [r15 + 8 * 0], rax | ||
mov [r15 + 8 * 1], rax | ||
mov [r15 + 8 * 2], rax | ||
mov [r15 + 8 * 3], rax | ||
mov [r15 + 8 * 4], rax | ||
mov [r15 + 8 * 5], rax | ||
mov [r15 + 8 * 6], rax | ||
mov [r15 + 8 * 7], rax | ||
mov [r15 + 8 * 8], rax | ||
mov [r15 + 8 * 9], rax | ||
|
||
mov rax, 1 | ||
|
||
; Test 7 byte offset across 8byte boundary | ||
lock adc qword [r15 + 8 * 0 + 7], rax | ||
|
||
; Test 15 byte offset across 16byte boundary | ||
lock adc qword [r15 + 8 * 0 + 15], rax | ||
|
||
; Test 63 byte offset across cacheline boundary | ||
lock adc qword [r15 + 8 * 0 + 63], rax | ||
|
||
mov rax, qword [r15 + 8 * 0] | ||
mov rbx, qword [r15 + 8 * 1] | ||
mov rcx, qword [r15 + 8 * 2] | ||
mov rdx, qword [r15 + 8 * 3] | ||
mov rsi, qword [r15 + 8 * 7] | ||
mov rdi, qword [r15 + 8 * 8] | ||
|
||
hlt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
%ifdef CONFIG | ||
{ | ||
"RegData": { | ||
"RAX": "0xbf4243bbbbb9b948", | ||
"RBX": "0xbf424344454647b7", | ||
"RCX": "0x41424344454647b7", | ||
"RDX": "0x4142434445464748", | ||
"RSI": "0xbf42434445464748", | ||
"RDI": "0x41424344454647b7" | ||
} | ||
} | ||
%endif | ||
|
||
mov r15, 0xe0000000 | ||
|
||
mov rax, 0x4142434445464748 | ||
mov [r15 + 8 * 0], rax | ||
mov [r15 + 8 * 1], rax | ||
mov [r15 + 8 * 2], rax | ||
mov [r15 + 8 * 3], rax | ||
mov [r15 + 8 * 4], rax | ||
mov [r15 + 8 * 5], rax | ||
mov [r15 + 8 * 6], rax | ||
mov [r15 + 8 * 7], rax | ||
mov [r15 + 8 * 8], rax | ||
mov [r15 + 8 * 9], rax | ||
|
||
; Test 1 byte offset within 4byte boundary | ||
lock neg word [r15 + 8 * 0 + 1] | ||
|
||
; Test 3 byte offset across 4byte boundary | ||
lock neg word [r15 + 8 * 0 + 3] | ||
|
||
; Test 7 byte offset across 8byte boundary | ||
lock neg word [r15 + 8 * 0 + 7] | ||
|
||
; Test 15 byte offset across 16byte boundary | ||
lock neg word [r15 + 8 * 0 + 15] | ||
|
||
; Test 63 byte offset across cacheline boundary | ||
lock neg word [r15 + 8 * 0 + 63] | ||
|
||
mov rax, qword [r15 + 8 * 0] | ||
mov rbx, qword [r15 + 8 * 1] | ||
mov rcx, qword [r15 + 8 * 2] | ||
mov rdx, qword [r15 + 8 * 3] | ||
mov rsi, qword [r15 + 8 * 7] | ||
mov rdi, qword [r15 + 8 * 8] | ||
|
||
hlt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
%ifdef CONFIG | ||
{ | ||
"RegData": { | ||
"RAX": "0xbfbdbcbbbb464748", | ||
"RBX": "0xbf42434445b9b8b7", | ||
"RCX": "0x4142434445b9b8b7", | ||
"RDX": "0x4142434445464748", | ||
"RSI": "0xbf42434445464748", | ||
"RDI": "0x4142434445b9b8b7" | ||
} | ||
} | ||
%endif | ||
|
||
mov r15, 0xe0000000 | ||
|
||
mov rax, 0x4142434445464748 | ||
mov [r15 + 8 * 0], rax | ||
mov [r15 + 8 * 1], rax | ||
mov [r15 + 8 * 2], rax | ||
mov [r15 + 8 * 3], rax | ||
mov [r15 + 8 * 4], rax | ||
mov [r15 + 8 * 5], rax | ||
mov [r15 + 8 * 6], rax | ||
mov [r15 + 8 * 7], rax | ||
mov [r15 + 8 * 8], rax | ||
mov [r15 + 8 * 9], rax | ||
|
||
; Test 3 byte offset across 4byte boundary | ||
lock neg dword [r15 + 8 * 0 + 3] | ||
|
||
; Test 7 byte offset across 8byte boundary | ||
lock neg dword [r15 + 8 * 0 + 7] | ||
|
||
; Test 15 byte offset across 16byte boundary | ||
lock neg dword [r15 + 8 * 0 + 15] | ||
|
||
; Test 63 byte offset across cacheline boundary | ||
lock neg dword [r15 + 8 * 0 + 63] | ||
|
||
mov rax, qword [r15 + 8 * 0] | ||
mov rbx, qword [r15 + 8 * 1] | ||
mov rcx, qword [r15 + 8 * 2] | ||
mov rdx, qword [r15 + 8 * 3] | ||
mov rsi, qword [r15 + 8 * 7] | ||
mov rdi, qword [r15 + 8 * 8] | ||
|
||
hlt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
%ifdef CONFIG | ||
{ | ||
"RegData": { | ||
"RAX": "0xbf42434445464748", | ||
"RBX": "0xbfbdbcbbbab9b8b7", | ||
"RCX": "0x41bdbcbbbab9b8b7", | ||
"RDX": "0x4142434445464748", | ||
"RSI": "0xbf42434445464748", | ||
"RDI": "0x41bdbcbbbab9b8b7" | ||
} | ||
} | ||
%endif | ||
|
||
mov r15, 0xe0000000 | ||
|
||
mov rax, 0x4142434445464748 | ||
mov [r15 + 8 * 0], rax | ||
mov [r15 + 8 * 1], rax | ||
mov [r15 + 8 * 2], rax | ||
mov [r15 + 8 * 3], rax | ||
mov [r15 + 8 * 4], rax | ||
mov [r15 + 8 * 5], rax | ||
mov [r15 + 8 * 6], rax | ||
mov [r15 + 8 * 7], rax | ||
mov [r15 + 8 * 8], rax | ||
mov [r15 + 8 * 9], rax | ||
|
||
; Test 7 byte offset across 8byte boundary | ||
lock neg qword [r15 + 8 * 0 + 7] | ||
|
||
; Test 15 byte offset across 16byte boundary | ||
lock neg qword [r15 + 8 * 0 + 15] | ||
|
||
; Test 63 byte offset across cacheline boundary | ||
lock neg qword [r15 + 8 * 0 + 63] | ||
|
||
mov rax, qword [r15 + 8 * 0] | ||
mov rbx, qword [r15 + 8 * 1] | ||
mov rcx, qword [r15 + 8 * 2] | ||
mov rdx, qword [r15 + 8 * 3] | ||
mov rsi, qword [r15 + 8 * 7] | ||
mov rdi, qword [r15 + 8 * 8] | ||
|
||
hlt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
%ifdef CONFIG | ||
{ | ||
"RegData": { | ||
"RAX": "0xbe4243bbbab9b848", | ||
"RBX": "0xbe424344454647b7", | ||
"RCX": "0x41424344454647b7", | ||
"RDX": "0x4142434445464748", | ||
"RSI": "0xbe42434445464748", | ||
"RDI": "0x41424344454647b7" | ||
} | ||
} | ||
%endif | ||
|
||
mov r15, 0xe0000000 | ||
|
||
mov rax, 0x4142434445464748 | ||
mov [r15 + 8 * 0], rax | ||
mov [r15 + 8 * 1], rax | ||
mov [r15 + 8 * 2], rax | ||
mov [r15 + 8 * 3], rax | ||
mov [r15 + 8 * 4], rax | ||
mov [r15 + 8 * 5], rax | ||
mov [r15 + 8 * 6], rax | ||
mov [r15 + 8 * 7], rax | ||
mov [r15 + 8 * 8], rax | ||
mov [r15 + 8 * 9], rax | ||
|
||
; Test 1 byte offset within 4byte boundary | ||
lock not word [r15 + 8 * 0 + 1] | ||
|
||
; Test 3 byte offset across 4byte boundary | ||
lock not word [r15 + 8 * 0 + 3] | ||
|
||
; Test 7 byte offset across 8byte boundary | ||
lock not word [r15 + 8 * 0 + 7] | ||
|
||
; Test 15 byte offset across 16byte boundary | ||
lock not word [r15 + 8 * 0 + 15] | ||
|
||
; Test 63 byte offset across cacheline boundary | ||
lock not word [r15 + 8 * 0 + 63] | ||
|
||
mov rax, qword [r15 + 8 * 0] | ||
mov rbx, qword [r15 + 8 * 1] | ||
mov rcx, qword [r15 + 8 * 2] | ||
mov rdx, qword [r15 + 8 * 3] | ||
mov rsi, qword [r15 + 8 * 7] | ||
mov rdi, qword [r15 + 8 * 8] | ||
|
||
hlt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
%ifdef CONFIG | ||
{ | ||
"RegData": { | ||
"RAX": "0xbebdbcbbba464748", | ||
"RBX": "0xbe42434445b9b8b7", | ||
"RCX": "0x4142434445b9b8b7", | ||
"RDX": "0x4142434445464748", | ||
"RSI": "0xbe42434445464748", | ||
"RDI": "0x4142434445b9b8b7" | ||
} | ||
} | ||
%endif | ||
|
||
mov r15, 0xe0000000 | ||
|
||
mov rax, 0x4142434445464748 | ||
mov [r15 + 8 * 0], rax | ||
mov [r15 + 8 * 1], rax | ||
mov [r15 + 8 * 2], rax | ||
mov [r15 + 8 * 3], rax | ||
mov [r15 + 8 * 4], rax | ||
mov [r15 + 8 * 5], rax | ||
mov [r15 + 8 * 6], rax | ||
mov [r15 + 8 * 7], rax | ||
mov [r15 + 8 * 8], rax | ||
mov [r15 + 8 * 9], rax | ||
|
||
; Test 3 byte offset across 4byte boundary | ||
lock not dword [r15 + 8 * 0 + 3] | ||
|
||
; Test 7 byte offset across 8byte boundary | ||
lock not dword [r15 + 8 * 0 + 7] | ||
|
||
; Test 15 byte offset across 16byte boundary | ||
lock not dword [r15 + 8 * 0 + 15] | ||
|
||
; Test 63 byte offset across cacheline boundary | ||
lock not dword [r15 + 8 * 0 + 63] | ||
|
||
mov rax, qword [r15 + 8 * 0] | ||
mov rbx, qword [r15 + 8 * 1] | ||
mov rcx, qword [r15 + 8 * 2] | ||
mov rdx, qword [r15 + 8 * 3] | ||
mov rsi, qword [r15 + 8 * 7] | ||
mov rdi, qword [r15 + 8 * 8] | ||
|
||
hlt |
Oops, something went wrong.