Skip to content

Commit

Permalink
unittests: Add a test for constprop size bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
bylaws committed Dec 10, 2024
1 parent bdae4f6 commit 46f7d3e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions unittests/ASM/FEX_bugs/OptSizeConfusion.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
%ifdef CONFIG
{
"RegData": {
"RAX": "0x000000000f0f0f0f",
"RBX": "0x000000000f0f0f0f",
"RCX": "0x000000000f0f0f0f",
"RDX": "0x00000000ffffffff",
"R9": "0x000000000f0f0f0f"
}
}
%endif

; FEX had several bugs in its constprop pass where 32->64 bit truncation behaviour wasn't accounted for leading
; to incorrectly inserting instead.

mov rax, 0x0f0f0f0f0f0f0f0f
mov rbx, 0x0f0f0f0f0f0f0f0f
mov rcx, 0x0f0f0f0f0f0f0f0f
mov rdx, 1
mov r9, 0x0f0f0f0f0f0f0f0f
xor eax, 0
and ebx, ebx
shr ecx, 0
neg edx
shl r9d, 0
hlt

0 comments on commit 46f7d3e

Please sign in to comment.