Instruction options.
Instruction options complement instruction identifier and attributes.
Constant | Description |
---|
kNone | No options.
|
kReserved | Used internally by emitters for handling errors and rare cases.
|
kUnfollow | Prevents following a jump during compilation (Compiler).
|
kOverwrite | Overwrite the destination operand(s) (Compiler).
Hint that is important for register liveness analysis. It tells the compiler that the destination operand will be overwritten now or by adjacent instructions. Compiler knows when a register is completely overwritten by a single instruction, for example you don't have to mark "movaps" or "pxor x, x", however, if a pair of instructions is used and the first of them doesn't completely overwrite the content of the destination, Compiler fails to mark that register as dead.
X86 Specific
- All instructions that always overwrite at least the size of the register the virtual-register uses, for example "mov", "movq", "movaps" don't need the overwrite option to be used - conversion, shuffle, and other miscellaneous instructions included.
- All instructions that clear the destination register if all operands are the same, for example "xor x, x", "pcmpeqb x x", etc...
- Consecutive instructions that partially overwrite the variable until there is no old content require
BaseCompiler::overwrite() to be used. Some examples (not always the best use cases thought):
movlps xmm0, ? followed by movhps xmm0, ? and vice versa
movlpd xmm0, ? followed by movhpd xmm0, ? and vice versa
mov al, ? followed by and ax, 0xFF
mov al, ? followed by mov ah, al
pinsrq xmm0, ?, 0 followed by pinsrq xmm0, ?, 1
- If the allocated virtual register is used temporarily for scalar operations. For example if you allocate a full vector like
x86::Compiler::new_xmm() and then use that vector for scalar operations you should use overwrite() directive:
sqrtss x, y - only LO element of x is changed, if you don't use HI elements, use compiler.overwrite().sqrtss(x, y) .
|
kShortForm | Emit short-form of the instruction.
|
kLongForm | Emit long-form of the instruction.
|
kTaken | Conditional jump is likely to be taken.
|
kNotTaken | Conditional jump is unlikely to be taken.
|
kX86_ModMR | Use ModMR instead of ModRM if applicable.
|
kX86_ModRM | Use ModRM instead of ModMR if applicable.
|
kX86_Vex3 | Use 3-byte VEX prefix if possible (AVX) (must be 0x00000400).
|
kX86_Vex | Use VEX prefix when both VEX|EVEX prefixes are available (HINT: AVX_VNNI).
|
kX86_Evex | Use 4-byte EVEX prefix if possible (AVX-512) (must be 0x00001000).
|
kX86_Lock | LOCK prefix (lock-enabled instructions only).
|
kX86_Rep | REP prefix (string instructions only).
|
kX86_Repne | REPNE prefix (string instructions only).
|
kX86_XAcquire | XACQUIRE prefix (only allowed instructions).
|
kX86_XRelease | XRELEASE prefix (only allowed instructions).
|
kX86_ER | AVX-512: embedded-rounding {er} and implicit {sae}.
|
kX86_SAE | AVX-512: suppress-all-exceptions {sae}.
|
kX86_RN_SAE | AVX-512: round-to-nearest (even) {rn-sae} (bits 00).
|
kX86_RD_SAE | AVX-512: round-down (toward -inf) {rd-sae} (bits 01).
|
kX86_RU_SAE | AVX-512: round-up (toward +inf) {ru-sae} (bits 10).
|
kX86_RZ_SAE | AVX-512: round-toward-zero (truncate) {rz-sae} (bits 11).
|
kX86_ZMask | AVX-512: Use zeroing {k}{z} instead of merging {k}.
|
kX86_ERMask | AVX-512: Mask to get embedded rounding bits (2 bits).
|
kX86_AVX512Mask | AVX-512: Mask of all possible AVX-512 options except EVEX prefix flag.
|
kX86_OpCodeB | Force REX.B and/or VEX.B field (X64 only, used internally).
|
kX86_OpCodeX | Force REX.X and/or VEX.X field (X64 only, used internally).
|
kX86_OpCodeR | Force REX.R and/or VEX.R field (X64 only, used internally).
|
kX86_OpCodeW | Force REX.W and/or VEX.W field (X64 only, used internally).
|
kX86_Rex | Force REX prefix (X64 only).
|
kX86_InvalidRex | Invalid REX prefix (set by X86 or when AH|BH|CH|DH regs are used on X64).
|