I'm using this guide to the VEX prefix: http://wiki.osdev.org/X86-64_Instruction_Encoding#REX_prefix
I'm lost on how to encode actual VEX instructions though. The ADDPD instruction (Intel x64 page 459) Opcode looks like this: VEX.NDS.128.66.0F.WIG 58 /r
Ummm what?? The VEX guide doesn't say anything about 'NDS' or 'WIG'. What am I missing?
Best How To :
You're missing section 220.127.116.11 "Opcode Column in the Instruction Summary Table (Instructions with VEX prefix)" (page 64 in the manual I have on my PC, probably slightly different in other versions)
For this instance, the important parts are:
VEX (obviously) means there is a VEX prefix.
NDS, the VEX.vvvv field specifies a register (it doesn't always, sometimes it is unused and must be set to all ones) and that it is a read-only first source operand.
128 fairly obvious, it's the 128bit wide version
55, it doesn't say that, it says
66 or at least it should. Other choices are F2, F3, and "nothing". Indicates what the values of the VEX.pp field should be, corresponds to mandatory prefix in the old encoding.
0F, opcode map specifier, corresponds to 0F prefix in the old encoding (there are also 0F3A and 0F38)
WIG (other options are
W0), means the VEX.W field is ignored (
W1 mean the
W bit must be respectively 0 or 1)