When writing inline assembly, is there a way to force the use of the rex.W prefix?
So instead of
"psllq $12, %%xmm1n"
generating 66 0f 73 f1 0c
, I want 66 48 0f 73 f1 0c
, with the extra 0x48 rex.W prefix.
1
You can just add the rex.W
prefix:
rex.W psllq $12, %xmm1
This is exactly how GNU binutils will disassemble the opcode bytes you have given. From a file psllq.s with the contents
.byte 0x66, 0x48, 0x0f, 0x73, 0xf1, 0x0c
we can run as psllq.s -o psllq.o && objdump -d psllq.o
to obtain:
psllq.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <.text>:
0: 66 48 0f 73 f1 0c rex.W psllq $0xc,%xmm1