mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-02-06 06:28:19 +00:00
unittests: Adds ptest unit test to ensure correct flag setting
ptest wasn't correctly setting OF, SF, AF, and PF to zero until now. Do a unit test to ensure correct behaviour here
This commit is contained in:
parent
c87e11cee9
commit
4e2220c27f
32
unittests/ASM/H0F38/66_17_2.asm
Normal file
32
unittests/ASM/H0F38/66_17_2.asm
Normal file
@ -0,0 +1,32 @@
|
||||
%ifdef CONFIG
|
||||
{
|
||||
"RegData": {
|
||||
"RAX": "0xFFFFFFFFFFFF43FF",
|
||||
"RBX": "0"
|
||||
}
|
||||
}
|
||||
%endif
|
||||
|
||||
; Set EFLAGS to known value with sahf
|
||||
mov rax, -1
|
||||
sahf
|
||||
|
||||
movups xmm0, [rel .data]
|
||||
; Tests a bug that FEX had where ptest would not set OF, SF, AF, PF to zero
|
||||
ptest xmm0, xmm0
|
||||
|
||||
; Now load back
|
||||
; ZF = 1
|
||||
; CF = 1
|
||||
; OF, SF, AF, PF should be zero
|
||||
lahf
|
||||
|
||||
; lahf doesn't get OF, get it with seto
|
||||
mov rbx, 0
|
||||
seto bl
|
||||
|
||||
hlt
|
||||
|
||||
.data:
|
||||
dq 0
|
||||
dq 0
|
Loading…
x
Reference in New Issue
Block a user