Skip to content

Commit

Permalink
Adds a unittest for a bug from FEX-Emu#3421
Browse files Browse the repository at this point in the history
When the source arguments for LoadMem/StoreMem have bit 31 set then they
are incorrectly sign extending in some instances.

Detected this when testing FEX-Emu#3421 but I don't have a proper fix for it.
  • Loading branch information
Sonicadvance1 committed Feb 26, 2024
1 parent 0ef72bf commit 2400f72
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions unittests/32Bit_ASM/FEX_bugs/SignExtendBug.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
%ifdef CONFIG
{
"RegData": {
"RAX": "0x41424344"
},
"MemoryRegions": {
"0xf0000000": "4096"
},
"MemoryData": {
"0xf0000000": "0x41424344"
},
"Mode": "32BIT"
}
%endif

; Ensures that zero extension of addresses are adhered to.
lea eax, [0xf000_0000]
mov eax, [gs:eax]

hlt

0 comments on commit 2400f72

Please sign in to comment.