2021-11-01 14:58:01 -04:00
|
|
|
%ifdef CONFIG
|
|
|
|
{
|
|
|
|
"RegData": {
|
|
|
|
"RBX": "0",
|
|
|
|
"RDX": "0xFF",
|
2021-11-17 14:29:50 -05:00
|
|
|
"RSI": "0",
|
|
|
|
"R14": "0x7F",
|
|
|
|
"R15": "0x838"
|
2022-08-14 19:58:45 -07:00
|
|
|
},
|
|
|
|
"HostFeatures": ["BMI1"]
|
2021-11-01 14:58:01 -04:00
|
|
|
}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
; General extraction
|
2021-11-17 14:29:50 -05:00
|
|
|
mov r14, 0x7FFFFFFFFFFFFFFF
|
|
|
|
mov r15, 0x838 ; Start at bit 56 and extract 8 bits
|
|
|
|
bextr r14, r14, r15 ; This results in 0x7F being placed into RAX
|
2021-11-01 14:58:01 -04:00
|
|
|
|
|
|
|
; Extraction with 0 bits should clear the destination
|
|
|
|
mov rbx, -1
|
|
|
|
mov rcx, 0
|
|
|
|
bextr rbx, rbx, rcx
|
|
|
|
|
|
|
|
; Same tests as above but with 32-bit registers
|
|
|
|
|
|
|
|
; General extraction
|
|
|
|
mov rdx, 0x7FFFFFFFFFFFFFFF
|
|
|
|
mov rsi, 0x818 ; Start at bit 24 and extract 8 bits
|
|
|
|
bextr edx, edx, esi ; This results in 0xFF being placed into EDX
|
|
|
|
|
|
|
|
; Extraction with 0 bits should clear RSI to 0
|
|
|
|
mov rsi, -1
|
|
|
|
mov rdi, 0
|
|
|
|
bextr esi, esi, edi
|
|
|
|
|
2022-08-14 19:58:45 -07:00
|
|
|
hlt
|