Skip to content

Commit

Permalink
unittests: Add a test for constprop size bugs
Browse files Browse the repository at this point in the history
fails on main, fixed by this PR.
  • Loading branch information
bylaws authored and alyssarosenzweig committed Dec 13, 2024
1 parent 29405f2 commit 766fbe3
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 766fbe3

Please sign in to comment.