FEX/unittests/ASM/FEX_bugs/SHRD_OF.asm
Ryan Houdek 1d1bdfb96d OpcodeDispatcher: Fixes SHRD by immediate OF flag calculation
We were calculating this like the regular SHR instruction which isn't
correct.

With this resolved, Denuvo games get slightly farther.
2023-07-28 18:00:50 -07:00

27 lines
440 B
NASM

%ifdef CONFIG
{
"RegData": {
"RAX": "0x0000000000008601"
}
}
%endif
; FEX had a bug where OF for SHRD wasn't getting calculated correctly.
; OF with SHRD set if the sign bit has changed.
; FEX /previously/ calculated it like regular SHR, where it contained the original MSB.
mov edi, 0x35b292fc
mov ebp, 0x37d434ad
shrd edi, ebp, 1
mov rax, 0
lahf
; Load OF
seto al
; Mask out AF, SHRD leaves it undefined
and rax, 0xEFFF
hlt