Skip to content

Commit

Permalink
Merge pull request FEX-Emu#3688 from catfella/extend_bextr_tests
Browse files Browse the repository at this point in the history
unittests/bextr: add SrcSize tests
  • Loading branch information
Sonicadvance1 authored Jun 10, 2024
2 parents 55bfd63 + 99a4328 commit 033b1ce
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions unittests/ASM/VEX/bextr.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"RBX": "0",
"RDX": "0xFF",
"RSI": "0",
"R8" : "0xDEADBEEFDEADBEEF",
"R9" : "0xDEADBEEF",
"R14": "0x7F",
"R15": "0x838"
},
Expand All @@ -21,6 +23,11 @@ mov rbx, -1
mov rcx, 0
bextr rbx, rbx, rcx

; Extraction with 'SrcSize' bits should get the unchanged register
mov r8, 0xDEADBEEFDEADBEEF
mov r9, 16384 ; Start at 0 extract 64 bits
bextr r8, r8, r9 ; r8 should stay the same

; Same tests as above but with 32-bit registers

; General extraction
Expand All @@ -33,4 +40,9 @@ mov rsi, -1
mov rdi, 0
bextr esi, esi, edi

; Extraction with 'SrcSize' bits should get the unchanged register
mov r9, 0xDEADBEEFDEADBEEF
mov r10, 8192 ; Start at 0 extract 32 bits
bextr r9d, r9d, r10d ; r9 should become 0xDEADBEEF (and r9d stays the same)

hlt

0 comments on commit 033b1ce

Please sign in to comment.