26 #define CASE_SSE_INS_COMMON(Inst, src) \ 29 #define CASE_AVX_INS_COMMON(Inst, Suffix, src) \ 30 case X86::V##Inst##Suffix##src: 32 #define CASE_MASK_INS_COMMON(Inst, Suffix, src) \ 33 case X86::V##Inst##Suffix##src##k: 35 #define CASE_MASKZ_INS_COMMON(Inst, Suffix, src) \ 36 case X86::V##Inst##Suffix##src##kz: 38 #define CASE_AVX512_INS_COMMON(Inst, Suffix, src) \ 39 CASE_AVX_INS_COMMON(Inst, Suffix, src) \ 40 CASE_MASK_INS_COMMON(Inst, Suffix, src) \ 41 CASE_MASKZ_INS_COMMON(Inst, Suffix, src) 43 #define CASE_MOVDUP(Inst, src) \ 44 CASE_AVX512_INS_COMMON(Inst, Z, r##src) \ 45 CASE_AVX512_INS_COMMON(Inst, Z256, r##src) \ 46 CASE_AVX512_INS_COMMON(Inst, Z128, r##src) \ 47 CASE_AVX_INS_COMMON(Inst, , r##src) \ 48 CASE_AVX_INS_COMMON(Inst, Y, r##src) \ 49 CASE_SSE_INS_COMMON(Inst, r##src) 51 #define CASE_MASK_MOVDUP(Inst, src) \ 52 CASE_MASK_INS_COMMON(Inst, Z, r##src) \ 53 CASE_MASK_INS_COMMON(Inst, Z256, r##src) \ 54 CASE_MASK_INS_COMMON(Inst, Z128, r##src) 56 #define CASE_MASKZ_MOVDUP(Inst, src) \ 57 CASE_MASKZ_INS_COMMON(Inst, Z, r##src) \ 58 CASE_MASKZ_INS_COMMON(Inst, Z256, r##src) \ 59 CASE_MASKZ_INS_COMMON(Inst, Z128, r##src) 61 #define CASE_PMOVZX(Inst, src) \ 62 CASE_AVX512_INS_COMMON(Inst, Z, r##src) \ 63 CASE_AVX512_INS_COMMON(Inst, Z256, r##src) \ 64 CASE_AVX512_INS_COMMON(Inst, Z128, r##src) \ 65 CASE_AVX_INS_COMMON(Inst, , r##src) \ 66 CASE_AVX_INS_COMMON(Inst, Y, r##src) \ 67 CASE_SSE_INS_COMMON(Inst, r##src) 69 #define CASE_MASK_PMOVZX(Inst, src) \ 70 CASE_MASK_INS_COMMON(Inst, Z, r##src) \ 71 CASE_MASK_INS_COMMON(Inst, Z256, r##src) \ 72 CASE_MASK_INS_COMMON(Inst, Z128, r##src) 74 #define CASE_MASKZ_PMOVZX(Inst, src) \ 75 CASE_MASKZ_INS_COMMON(Inst, Z, r##src) \ 76 CASE_MASKZ_INS_COMMON(Inst, Z256, r##src) \ 77 CASE_MASKZ_INS_COMMON(Inst, Z128, r##src) 79 #define CASE_UNPCK(Inst, src) \ 80 CASE_AVX512_INS_COMMON(Inst, Z, r##src) \ 81 CASE_AVX512_INS_COMMON(Inst, Z256, r##src) \ 82 CASE_AVX512_INS_COMMON(Inst, Z128, r##src) \ 83 CASE_AVX_INS_COMMON(Inst, , r##src) \ 84 CASE_AVX_INS_COMMON(Inst, Y, r##src) \ 85 CASE_SSE_INS_COMMON(Inst, r##src) 87 #define CASE_MASK_UNPCK(Inst, src) \ 88 CASE_MASK_INS_COMMON(Inst, Z, r##src) \ 89 CASE_MASK_INS_COMMON(Inst, Z256, r##src) \ 90 CASE_MASK_INS_COMMON(Inst, Z128, r##src) 92 #define CASE_MASKZ_UNPCK(Inst, src) \ 93 CASE_MASKZ_INS_COMMON(Inst, Z, r##src) \ 94 CASE_MASKZ_INS_COMMON(Inst, Z256, r##src) \ 95 CASE_MASKZ_INS_COMMON(Inst, Z128, r##src) 97 #define CASE_SHUF(Inst, suf) \ 98 CASE_AVX512_INS_COMMON(Inst, Z, suf) \ 99 CASE_AVX512_INS_COMMON(Inst, Z256, suf) \ 100 CASE_AVX512_INS_COMMON(Inst, Z128, suf) \ 101 CASE_AVX_INS_COMMON(Inst, , suf) \ 102 CASE_AVX_INS_COMMON(Inst, Y, suf) \ 103 CASE_SSE_INS_COMMON(Inst, suf) 105 #define CASE_MASK_SHUF(Inst, src) \ 106 CASE_MASK_INS_COMMON(Inst, Z, r##src##i) \ 107 CASE_MASK_INS_COMMON(Inst, Z256, r##src##i) \ 108 CASE_MASK_INS_COMMON(Inst, Z128, r##src##i) 110 #define CASE_MASKZ_SHUF(Inst, src) \ 111 CASE_MASKZ_INS_COMMON(Inst, Z, r##src##i) \ 112 CASE_MASKZ_INS_COMMON(Inst, Z256, r##src##i) \ 113 CASE_MASKZ_INS_COMMON(Inst, Z128, r##src##i) 115 #define CASE_VPERMILPI(Inst, src) \ 116 CASE_AVX512_INS_COMMON(Inst, Z, src##i) \ 117 CASE_AVX512_INS_COMMON(Inst, Z256, src##i) \ 118 CASE_AVX512_INS_COMMON(Inst, Z128, src##i) \ 119 CASE_AVX_INS_COMMON(Inst, , src##i) \ 120 CASE_AVX_INS_COMMON(Inst, Y, src##i) 122 #define CASE_MASK_VPERMILPI(Inst, src) \ 123 CASE_MASK_INS_COMMON(Inst, Z, src##i) \ 124 CASE_MASK_INS_COMMON(Inst, Z256, src##i) \ 125 CASE_MASK_INS_COMMON(Inst, Z128, src##i) 127 #define CASE_MASKZ_VPERMILPI(Inst, src) \ 128 CASE_MASKZ_INS_COMMON(Inst, Z, src##i) \ 129 CASE_MASKZ_INS_COMMON(Inst, Z256, src##i) \ 130 CASE_MASKZ_INS_COMMON(Inst, Z128, src##i) 132 #define CASE_VPERM(Inst, src) \ 133 CASE_AVX512_INS_COMMON(Inst, Z, src##i) \ 134 CASE_AVX512_INS_COMMON(Inst, Z256, src##i) \ 135 CASE_AVX_INS_COMMON(Inst, Y, src##i) 137 #define CASE_MASK_VPERM(Inst, src) \ 138 CASE_MASK_INS_COMMON(Inst, Z, src##i) \ 139 CASE_MASK_INS_COMMON(Inst, Z256, src##i) 141 #define CASE_MASKZ_VPERM(Inst, src) \ 142 CASE_MASKZ_INS_COMMON(Inst, Z, src##i) \ 143 CASE_MASKZ_INS_COMMON(Inst, Z256, src##i) 145 #define CASE_VSHUF(Inst, src) \ 146 CASE_AVX512_INS_COMMON(SHUFF##Inst, Z, r##src##i) \ 147 CASE_AVX512_INS_COMMON(SHUFI##Inst, Z, r##src##i) \ 148 CASE_AVX512_INS_COMMON(SHUFF##Inst, Z256, r##src##i) \ 149 CASE_AVX512_INS_COMMON(SHUFI##Inst, Z256, r##src##i) 151 #define CASE_MASK_VSHUF(Inst, src) \ 152 CASE_MASK_INS_COMMON(SHUFF##Inst, Z, r##src##i) \ 153 CASE_MASK_INS_COMMON(SHUFI##Inst, Z, r##src##i) \ 154 CASE_MASK_INS_COMMON(SHUFF##Inst, Z256, r##src##i) \ 155 CASE_MASK_INS_COMMON(SHUFI##Inst, Z256, r##src##i) 157 #define CASE_MASKZ_VSHUF(Inst, src) \ 158 CASE_MASKZ_INS_COMMON(SHUFF##Inst, Z, r##src##i) \ 159 CASE_MASKZ_INS_COMMON(SHUFI##Inst, Z, r##src##i) \ 160 CASE_MASKZ_INS_COMMON(SHUFF##Inst, Z256, r##src##i) \ 161 CASE_MASKZ_INS_COMMON(SHUFI##Inst, Z256, r##src##i) 163 #define CASE_AVX512_FMA(Inst, suf) \ 164 CASE_AVX512_INS_COMMON(Inst, Z, suf) \ 165 CASE_AVX512_INS_COMMON(Inst, Z256, suf) \ 166 CASE_AVX512_INS_COMMON(Inst, Z128, suf) 168 #define CASE_FMA(Inst, suf) \ 169 CASE_AVX512_FMA(Inst, suf) \ 170 CASE_AVX_INS_COMMON(Inst, , suf) \ 171 CASE_AVX_INS_COMMON(Inst, Y, suf) 173 #define CASE_FMA_PACKED_REG(Inst) \ 174 CASE_FMA(Inst##PD, r) \ 175 CASE_FMA(Inst##PS, r) 177 #define CASE_FMA_PACKED_MEM(Inst) \ 178 CASE_FMA(Inst##PD, m) \ 179 CASE_FMA(Inst##PS, m) \ 180 CASE_AVX512_FMA(Inst##PD, mb) \ 181 CASE_AVX512_FMA(Inst##PS, mb) 183 #define CASE_FMA_SCALAR_REG(Inst) \ 184 CASE_AVX_INS_COMMON(Inst##SD, , r) \ 185 CASE_AVX_INS_COMMON(Inst##SS, , r) \ 186 CASE_AVX_INS_COMMON(Inst##SD, , r_Int) \ 187 CASE_AVX_INS_COMMON(Inst##SS, , r_Int) \ 188 CASE_AVX_INS_COMMON(Inst##SD, Z, r) \ 189 CASE_AVX_INS_COMMON(Inst##SS, Z, r) \ 190 CASE_AVX512_INS_COMMON(Inst##SD, Z, r_Int) \ 191 CASE_AVX512_INS_COMMON(Inst##SS, Z, r_Int) 193 #define CASE_FMA_SCALAR_MEM(Inst) \ 194 CASE_AVX_INS_COMMON(Inst##SD, , m) \ 195 CASE_AVX_INS_COMMON(Inst##SS, , m) \ 196 CASE_AVX_INS_COMMON(Inst##SD, , m_Int) \ 197 CASE_AVX_INS_COMMON(Inst##SS, , m_Int) \ 198 CASE_AVX_INS_COMMON(Inst##SD, Z, m) \ 199 CASE_AVX_INS_COMMON(Inst##SS, Z, m) \ 200 CASE_AVX512_INS_COMMON(Inst##SD, Z, m_Int) \ 201 CASE_AVX512_INS_COMMON(Inst##SS, Z, m_Int) 204 if (X86::ZMM0 <= RegNo && RegNo <= X86::ZMM31)
206 if (X86::YMM0 <= RegNo && RegNo <= X86::YMM31)
208 if (X86::XMM0 <= RegNo && RegNo <= X86::XMM31)
210 if (X86::MM0 <= RegNo && RegNo <= X86::MM7)
217 unsigned OperandIndex) {
230 uint64_t TSFlags = Desc.
TSFlags;
244 OS <<
" {%" << MaskRegName <<
"}";
252 const char *Mul1Name =
nullptr, *Mul2Name =
nullptr, *AccName =
nullptr;
254 bool RegForm =
false;
476 if (!Mul1Name) Mul1Name =
"mem";
477 if (!Mul2Name) Mul2Name =
"mem";
478 if (!AccName) AccName =
"mem";
480 OS << DestName <<
" = ";
486 OS <<
'(' << Mul1Name <<
" * " << Mul2Name <<
") " << AccStr <<
' ' 504 const char *DestName =
nullptr, *Src1Name =
nullptr, *Src2Name =
nullptr;
506 bool RegForm =
false;
516 case X86::BLENDPDrri:
517 case X86::VBLENDPDrri:
518 case X86::VBLENDPDYrri:
521 case X86::BLENDPDrmi:
522 case X86::VBLENDPDrmi:
523 case X86::VBLENDPDYrmi:
532 case X86::BLENDPSrri:
533 case X86::VBLENDPSrri:
534 case X86::VBLENDPSYrri:
537 case X86::BLENDPSrmi:
538 case X86::VBLENDPSrmi:
539 case X86::VBLENDPSYrmi:
548 case X86::PBLENDWrri:
549 case X86::VPBLENDWrri:
550 case X86::VPBLENDWYrri:
553 case X86::PBLENDWrmi:
554 case X86::VPBLENDWrmi:
555 case X86::VPBLENDWYrmi:
564 case X86::VPBLENDDrri:
565 case X86::VPBLENDDYrri:
568 case X86::VPBLENDDrmi:
569 case X86::VPBLENDDYrmi:
578 case X86::INSERTPSrr:
579 case X86::VINSERTPSrr:
580 case X86::VINSERTPSZrr:
583 case X86::INSERTPSrm:
584 case X86::VINSERTPSrm:
585 case X86::VINSERTPSZrm:
594 case X86::VMOVLHPSrr:
595 case X86::VMOVLHPSZrr:
603 case X86::VMOVHLPSrr:
604 case X86::VMOVHLPSZrr:
613 case X86::VMOVHPDZ128rm:
621 case X86::VMOVHPSZ128rm:
629 case X86::VMOVLPDZ128rm:
637 case X86::VMOVLPSZ128rm:
672 case X86::VPSLLDQYri:
673 case X86::VPSLLDQZ128rr:
674 case X86::VPSLLDQZ256rr:
675 case X86::VPSLLDQZrr:
678 case X86::VPSLLDQZ128rm:
679 case X86::VPSLLDQZ256rm:
680 case X86::VPSLLDQZrm:
690 case X86::VPSRLDQYri:
691 case X86::VPSRLDQZ128rr:
692 case X86::VPSRLDQZ256rr:
693 case X86::VPSRLDQZrr:
696 case X86::VPSRLDQZ128rm:
697 case X86::VPSRLDQZ256rm:
698 case X86::VPSRLDQZrm:
792 case X86::MMX_PSHUFWri:
796 case X86::MMX_PSHUFWmi:
813 case X86::MMX_PUNPCKHBWirr:
819 case X86::MMX_PUNPCKHBWirm:
826 case X86::MMX_PUNPCKHWDirr:
832 case X86::MMX_PUNPCKHWDirm:
839 case X86::MMX_PUNPCKHDQirr:
845 case X86::MMX_PUNPCKHDQirm:
863 case X86::MMX_PUNPCKLBWirr:
869 case X86::MMX_PUNPCKLBWirm:
876 case X86::MMX_PUNPCKLWDirr:
882 case X86::MMX_PUNPCKLWDirm:
889 case X86::MMX_PUNPCKLDQirr:
895 case X86::MMX_PUNPCKLDQirm:
1033 case X86::VPERM2F128rr:
1034 case X86::VPERM2I128rr:
1038 case X86::VPERM2F128rm:
1039 case X86::VPERM2I128rm:
1074 case X86::VMOVSDZrr:
1081 case X86::VMOVSDZrm:
1088 case X86::VMOVSSZrr:
1095 case X86::VMOVSSZrm:
1100 case X86::MOVPQI2QIrr:
1101 case X86::MOVZPQILo2PQIrr:
1102 case X86::VMOVPQI2QIrr:
1103 case X86::VMOVPQI2QIZrr:
1104 case X86::VMOVZPQILo2PQIrr:
1105 case X86::VMOVZPQILo2PQIZrr:
1109 case X86::MOVQI2PQIrm:
1110 case X86::VMOVQI2PQIrm:
1111 case X86::VMOVQI2PQIZrm:
1116 case X86::MOVDI2PDIrm:
1117 case X86::VMOVDI2PDIrm:
1118 case X86::VMOVDI2PDIZrm:
1144 case X86::VBROADCASTF128:
1145 case X86::VBROADCASTI128:
1253 if (ShuffleMask.
empty())
1256 if (!DestName) DestName = Src1Name;
1267 if (Src1Name == Src2Name) {
1268 for (
unsigned i = 0, e = ShuffleMask.
size(); i != e; ++i) {
1269 if ((
int)ShuffleMask[i] >= 0 &&
1270 ShuffleMask[i] >= (int)e)
1271 ShuffleMask[i] -= e;
1278 for (
unsigned i = 0, e = ShuffleMask.
size(); i != e; ++i) {
1288 bool isSrc1 = ShuffleMask[i] < (int)ShuffleMask.
size();
1289 const char *SrcName = isSrc1 ? Src1Name : Src2Name;
1290 OS << (SrcName ? SrcName :
"mem") <<
'[';
1291 bool IsFirst =
true;
1293 (ShuffleMask[i] < (int)ShuffleMask.
size()) == isSrc1) {
1301 OS << ShuffleMask[i] % ShuffleMask.
size();
static const char * getRegisterName(unsigned RegNo)
This class represents lattice values for constants.
Describe properties that are true of each instruction in the target description file.
SSE4A Extraction and Insertion.
void DecodePSLLDQMask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
void DecodePSHUFMask(unsigned NumElts, unsigned ScalarBits, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
DecodePSHUFMask - This decodes the shuffle masks for pshufw, pshufd, and vpermilp*.
void DecodeZeroMoveLowMask(unsigned NumElts, SmallVectorImpl< int > &ShuffleMask)
Decode a move lower and zero upper instruction as a shuffle mask.
void DecodeUNPCKHMask(unsigned NumElts, unsigned ScalarBits, SmallVectorImpl< int > &ShuffleMask)
DecodeUNPCKHMask - This decodes the shuffle masks for unpckhps/unpckhpd and punpckh*.
void DecodeMOVDDUPMask(unsigned NumElts, SmallVectorImpl< int > &ShuffleMask)
void DecodeVPERM2X128Mask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
void DecodeEXTRQIMask(unsigned NumElts, unsigned EltSize, int Len, int Idx, SmallVectorImpl< int > &ShuffleMask)
Decode a SSE4A EXTRQ instruction as a shuffle mask.
unsigned getReg() const
Returns the register number.
bool EmitAnyX86InstComments(const MCInst *MI, raw_ostream &OS, const MCInstrInfo &MCII)
EmitAnyX86InstComments - This function decodes x86 instructions and prints newline terminated strings...
void DecodeMOVSHDUPMask(unsigned NumElts, SmallVectorImpl< int > &ShuffleMask)
void DecodeVALIGNMask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
void DecodePSHUFLWMask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
Decodes the shuffle masks for pshuflw.
Instances of this class represent a single low-level machine instruction.
void DecodeUNPCKLMask(unsigned NumElts, unsigned ScalarBits, SmallVectorImpl< int > &ShuffleMask)
DecodeUNPCKLMask - This decodes the shuffle masks for unpcklps/unpcklpd and punpckl*.
void DecodeMOVLHPSMask(unsigned NElts, SmallVectorImpl< int > &ShuffleMask)
Decode a MOVLHPS instruction as a v2f64/v4f32 shuffle mask.
void DecodeZeroExtendMask(unsigned SrcScalarBits, unsigned DstScalarBits, unsigned NumDstElts, SmallVectorImpl< int > &Mask)
Decode a zero extension instruction as a shuffle mask.
Interface to description of machine instruction set.
void DecodeINSERTPSMask(unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
Decode a 128-bit INSERTPS instruction as a v4f32 shuffle mask.
void DecodeBLENDMask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
Decode a BLEND immediate mask into a shuffle mask.
unsigned getNumOperands() const
void decodeVSHUF64x2FamilyMask(unsigned NumElts, unsigned ScalarSize, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
Decode a shuffle packed values at 128-bit granularity (SHUFF32x4/SHUFF64x2/SHUFI32x4/SHUFI64x2) immed...
void DecodeMOVSLDUPMask(unsigned NumElts, SmallVectorImpl< int > &ShuffleMask)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void DecodeINSERTQIMask(unsigned NumElts, unsigned EltSize, int Len, int Idx, SmallVectorImpl< int > &ShuffleMask)
Decode a SSE4A INSERTQ instruction as a shuffle mask.
int getOperandConstraint(unsigned OpNum, MCOI::OperandConstraint Constraint) const
Returns the value of the specific constraint if it is set.
const MCOperand & getOperand(unsigned i) const
unsigned getNumDefs() const
Return the number of MachineOperands that are register definitions.
void DecodeVPERMMask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
DecodeVPERMMask - this decodes the shuffle masks for VPERMQ/VPERMPD.
void DecodePSHUFHWMask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
Decodes the shuffle masks for pshufhw.
void DecodeScalarMoveMask(unsigned NumElts, bool IsLoad, SmallVectorImpl< int > &Mask)
Decode a scalar float move instruction as a shuffle mask.
void DecodePSRLDQMask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
LLVM_NODISCARD bool empty() const
void DecodeSHUFPMask(unsigned NumElts, unsigned ScalarBits, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
DecodeSHUFPMask - This decodes the shuffle masks for shufp*.
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
void DecodeInsertElementMask(unsigned NumElts, unsigned Idx, unsigned Len, SmallVectorImpl< int > &ShuffleMask)
void DecodePSWAPMask(unsigned NumElts, SmallVectorImpl< int > &ShuffleMask)
Decodes a PSWAPD 3DNow! instruction.
This class implements an extremely fast bulk output stream that can only output to a stream...
void DecodeSubVectorBroadcast(unsigned DstNumElts, unsigned SrcNumElts, SmallVectorImpl< int > &ShuffleMask)
Decodes a broadcast of a subvector to a larger vector type.
StringRef - Represent a constant reference to a string, i.e.
void DecodePALIGNRMask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
void DecodeMOVHLPSMask(unsigned NElts, SmallVectorImpl< int > &ShuffleMask)
Decode a MOVHLPS instruction as a v2f64/v4f32 shuffle mask.
unsigned getOpcode() const