// no prefix.
//
OpPrefixShift = AdSizeShift + 2,
- OpPrefixMask = 0x7 << OpPrefixShift,
+ OpPrefixMask = 0x3 << OpPrefixShift,
- // PS, PD - Prefix code for packed single and double precision vector
- // floating point operations performed in the SSE registers.
- PS = 1 << OpPrefixShift, PD = 2 << OpPrefixShift,
+ // PD - Prefix code for packed double precision vector floating point
+ // operations performed in the SSE registers.
+ PD = 1 << OpPrefixShift,
// XS, XD - These prefix codes are for single and double precision scalar
// floating point operations performed in the SSE registers.
- XS = 3 << OpPrefixShift, XD = 4 << OpPrefixShift,
+ XS = 2 << OpPrefixShift, XD = 3 << OpPrefixShift,
//===------------------------------------------------------------------===//
// OpMap - This field determines which opcode map this instruction
// belongs to. i.e. one-byte, two-byte, 0x0f 0x38, 0x0f 0x3a, etc.
//
- OpMapShift = OpPrefixShift + 3,
+ OpMapShift = OpPrefixShift + 2,
OpMapMask = 0x7 << OpMapShift,
// OB - OneByte - Set if this instruction has a one byte opcode.
bits<3> Value = val;
}
def NoPrfx : Prefix<0>;
-def PS : Prefix<1>;
-def PD : Prefix<2>;
-def XS : Prefix<3>;
-def XD : Prefix<4>;
+def PD : Prefix<1>;
+def XS : Prefix<2>;
+def XD : Prefix<3>;
+def PS : Prefix<4>; // Similar to NoPrfx, but disassembler uses this to know
+ // that other instructions with this opcode use PD/XS/XD
+ // and if any of those is not supported they shouldn't
+ // decode to this instruction. e.g. ANDSS/ANDSD don't
+ // exist, but the 0xf2/0xf3 encoding shouldn't
+ // disable to ANDPS.
// Class specifying the opcode map.
class Map<bits<3> val> {
let TSFlags{6-0} = FormBits;
let TSFlags{8-7} = OpSizeBits;
let TSFlags{10-9} = AdSizeBits;
- let TSFlags{13-11} = OpPrefixBits;
- let TSFlags{16-14} = OpMapBits;
- let TSFlags{17} = hasREX_WPrefix;
- let TSFlags{21-18} = ImmT.Value;
- let TSFlags{24-22} = FPForm.Value;
- let TSFlags{25} = hasLockPrefix;
- let TSFlags{26} = hasREPPrefix;
- let TSFlags{28-27} = ExeDomain.Value;
- let TSFlags{30-29} = OpEncBits;
- let TSFlags{38-31} = Opcode;
+ // No need for 3rd bit, we don't need to distinguish NoPrfx from PS.
+ let TSFlags{12-11} = OpPrefixBits{1-0};
+ let TSFlags{15-13} = OpMapBits;
+ let TSFlags{16} = hasREX_WPrefix;
+ let TSFlags{20-17} = ImmT.Value;
+ let TSFlags{23-21} = FPForm.Value;
+ let TSFlags{24} = hasLockPrefix;
+ let TSFlags{25} = hasREPPrefix;
+ let TSFlags{27-26} = ExeDomain.Value;
+ let TSFlags{29-28} = OpEncBits;
+ let TSFlags{37-30} = Opcode;
// Currently no need for second bit in TSFlags - W Ignore is equivalent to 0.
- let TSFlags{39} = VEX_WPrefix{0};
- let TSFlags{40} = hasVEX_4V;
- let TSFlags{41} = hasVEX_L;
- let TSFlags{42} = hasEVEX_K;
- let TSFlags{43} = hasEVEX_Z;
- let TSFlags{44} = hasEVEX_L2;
- let TSFlags{45} = hasEVEX_B;
+ let TSFlags{38} = VEX_WPrefix{0};
+ let TSFlags{39} = hasVEX_4V;
+ let TSFlags{40} = hasVEX_L;
+ let TSFlags{41} = hasEVEX_K;
+ let TSFlags{42} = hasEVEX_Z;
+ let TSFlags{43} = hasEVEX_L2;
+ let TSFlags{44} = hasEVEX_B;
// If we run out of TSFlags bits, it's possible to encode this in 3 bits.
- let TSFlags{52-46} = CD8_Scale;
- let TSFlags{53} = hasEVEX_RC;
- let TSFlags{54} = hasNoTrackPrefix;
+ let TSFlags{51-45} = CD8_Scale;
+ let TSFlags{52} = hasEVEX_RC;
+ let TSFlags{53} = hasNoTrackPrefix;
}
class PseudoI<dag oops, dag iops, list<dag> pattern,