Skip to content

Commit

Permalink
unittests: Adds a 3DNow! ModRM SIB encoding test
Browse files Browse the repository at this point in the history
Depends on #4239.

This codepath was unttested in our CI.
  • Loading branch information
Sonicadvance1 committed Dec 31, 2024
1 parent cd6722f commit e052c51
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions unittests/ASM/FEX_bugs/3DNow_ModRMSIBDecode.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
%ifdef CONFIG
{
"RegData": {
"MM0": "0x3f800000bf800000"
},
"HostFeatures": ["3DNOW"]
}
%endif

; FEX-Emu had a bug with 3DNow! ModRM decoding when the source was SIB encoded.
; This would result in a crash in the frontend instruction decoding.
; Generate a 3DNow! instruction that uses SIB encoding to ensure this code path is tested.
lea rax, [rel data1]
mov rbx, 0
pi2fw mm0, [rbx * 8 + rax + 0]

hlt

align 8
data1:
dw -1
dw 0xFF
dw 1
dw 0xFF

0 comments on commit e052c51

Please sign in to comment.