mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-25 02:00:45 +02:00
CMPXCHG8B/16B unit tests
This commit is contained in:
1 parent
eed4ff8b69
commit
39b11cfc2e
4 files changed
+170
No files matched your search
@@ -0,0 +1,40 @@
|
||||
%ifdef CONFIG
|
||||
{
|
||||
"RegData": {
|
||||
"RAX": "0x80000000",
|
||||
"RDX": "0xFFFFFFFF",
|
||||
"RBX": "0x41424344",
|
||||
"RCX": "0x51525354",
|
||||
"R13": "0x5152535441424344",
|
||||
"R14": "0x1"
|
||||
},
|
||||
"MemoryRegions": {
|
||||
"0x100000000": "4096"
|
||||
}
|
||||
}
|
||||
%endif
|
||||
|
||||
mov r15, 0xe0000000
|
||||
|
||||
mov rax, 0xFFFFFFFF80000000
|
||||
mov [r15 + 8 * 0], rax
|
||||
|
||||
mov r14, 0
|
||||
; Expected
|
||||
mov eax, 0x80000000
|
||||
mov edx, 0xFFFFFFFF
|
||||
|
||||
; Desired
|
||||
mov ebx, 0x41424344
|
||||
mov ecx, 0x51525354
|
||||
|
||||
cmpxchg8b [r15]
|
||||
|
||||
; Set r14 to 1 if if the memory location was expected
|
||||
setz r14b
|
||||
|
||||
; edx and eax will now contain the memory's data
|
||||
|
||||
; Check memory location to ensure it contains what we want
|
||||
mov r13, [r15 + 8 * 0]
|
||||
hlt
|
||||
@@ -0,0 +1,40 @@
|
||||
%ifdef CONFIG
|
||||
{
|
||||
"RegData": {
|
||||
"RAX": "0x80000000",
|
||||
"RDX": "0xFFFFFFFF",
|
||||
"RBX": "0x41424344",
|
||||
"RCX": "0x51525354",
|
||||
"R13": "0xFFFFFFFF80000000",
|
||||
"R14": "0x0"
|
||||
},
|
||||
"MemoryRegions": {
|
||||
"0x100000000": "4096"
|
||||
}
|
||||
}
|
||||
%endif
|
||||
|
||||
mov r15, 0xe0000000
|
||||
|
||||
mov rax, 0xFFFFFFFF80000000
|
||||
mov [r15 + 8 * 0], rax
|
||||
|
||||
mov r14, 0
|
||||
; Expected
|
||||
mov eax, 0xFFFFFFFF
|
||||
mov edx, 0xFFFFFFFF
|
||||
|
||||
; Desired
|
||||
mov ebx, 0x41424344
|
||||
mov ecx, 0x51525354
|
||||
|
||||
cmpxchg8b [r15]
|
||||
|
||||
; Set r14 to 1 if if the memory location was expected
|
||||
setz r14b
|
||||
|
||||
; edx and eax will now contain the memory's data
|
||||
|
||||
; Check memory location to ensure it contains what we want
|
||||
mov r13, [r15 + 8 * 0]
|
||||
hlt
|
||||
@@ -0,0 +1,45 @@
|
||||
%ifdef CONFIG
|
||||
{
|
||||
"RegData": {
|
||||
"RAX": "0x4142434445464748",
|
||||
"RDX": "0x5152535455565758",
|
||||
"RBX": "0x6162636465666768",
|
||||
"RCX": "0x7172737475767778",
|
||||
"R12": "0x6162636465666768",
|
||||
"R13": "0x7172737475767778",
|
||||
"R14": "0x1"
|
||||
},
|
||||
"MemoryRegions": {
|
||||
"0x100000000": "4096"
|
||||
}
|
||||
}
|
||||
%endif
|
||||
|
||||
mov r15, 0xe0000000
|
||||
|
||||
mov rax, 0x4142434445464748
|
||||
mov [r15 + 8 * 0], rax
|
||||
mov rax, 0x5152535455565758
|
||||
mov [r15 + 8 * 1], rax
|
||||
|
||||
mov r14, 0
|
||||
; Expected
|
||||
mov rax, 0x4142434445464748
|
||||
mov rdx, 0x5152535455565758
|
||||
|
||||
; Desired
|
||||
mov rbx, 0x6162636465666768
|
||||
mov rcx, 0x7172737475767778
|
||||
|
||||
cmpxchg16b [r15]
|
||||
|
||||
; Set r14 to 1 if if the memory location was expected
|
||||
setz r14b
|
||||
|
||||
; rdx and rax will now contain the memory's data
|
||||
|
||||
; Check memory location to ensure it contains what we want
|
||||
mov r12, [r15 + 8 * 0]
|
||||
mov r13, [r15 + 8 * 1]
|
||||
|
||||
hlt
|
||||
@@ -0,0 +1,45 @@
|
||||
%ifdef CONFIG
|
||||
{
|
||||
"RegData": {
|
||||
"RAX": "0x4142434445464748",
|
||||
"RDX": "0x5152535455565758",
|
||||
"RBX": "0x6162636465666768",
|
||||
"RCX": "0x7172737475767778",
|
||||
"R12": "0x4142434445464748",
|
||||
"R13": "0x5152535455565758",
|
||||
"R14": "0x0"
|
||||
},
|
||||
"MemoryRegions": {
|
||||
"0x100000000": "4096"
|
||||
}
|
||||
}
|
||||
%endif
|
||||
|
||||
mov r15, 0xe0000000
|
||||
|
||||
mov rax, 0x4142434445464748
|
||||
mov [r15 + 8 * 0], rax
|
||||
mov rax, 0x5152535455565758
|
||||
mov [r15 + 8 * 1], rax
|
||||
|
||||
mov r14, 0
|
||||
; Expected
|
||||
mov rax, 0x41424344FFFFFFFF
|
||||
mov rdx, 0x5152535455565758
|
||||
|
||||
; Desired
|
||||
mov rbx, 0x6162636465666768
|
||||
mov rcx, 0x7172737475767778
|
||||
|
||||
cmpxchg16b [r15]
|
||||
|
||||
; Set r14 to 1 if if the memory location was expected
|
||||
setz r14b
|
||||
|
||||
; rdx and rax will now contain the memory's data
|
||||
|
||||
; Check memory location to ensure it contains what we want
|
||||
mov r12, [r15 + 8 * 0]
|
||||
mov r13, [r15 + 8 * 1]
|
||||
|
||||
hlt
|
||||
Reference in new issue
Block a user