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_FPCLASS_PACKED(Inst, src) \
44 CASE_AVX_INS_COMMON(Inst, Z, src##i) \
45 CASE_AVX_INS_COMMON(Inst, Z256, src##i) \
46 CASE_AVX_INS_COMMON(Inst, Z128, src##i) \
47 CASE_MASK_INS_COMMON(Inst, Z, src##i)
49#define CASE_FPCLASS_PACKED_MEM(Inst) \
50 CASE_FPCLASS_PACKED(Inst, m) \
51 CASE_FPCLASS_PACKED(Inst, mb)
53#define CASE_FPCLASS_SCALAR(Inst, src) \
54 CASE_AVX_INS_COMMON(Inst, Z, src##i) \
55 CASE_MASK_INS_COMMON(Inst, Z, src##i)
57#define CASE_PTERNLOG(Inst, src) \
58 CASE_AVX512_INS_COMMON(Inst, Z, r##src##i) \
59 CASE_AVX512_INS_COMMON(Inst, Z256, r##src##i) \
60 CASE_AVX512_INS_COMMON(Inst, Z128, r##src##i)
62#define CASE_MOVDUP(Inst, src) \
63 CASE_AVX512_INS_COMMON(Inst, Z, r##src) \
64 CASE_AVX512_INS_COMMON(Inst, Z256, r##src) \
65 CASE_AVX512_INS_COMMON(Inst, Z128, r##src) \
66 CASE_AVX_INS_COMMON(Inst, , r##src) \
67 CASE_AVX_INS_COMMON(Inst, Y, r##src) \
68 CASE_SSE_INS_COMMON(Inst, r##src)
70#define CASE_MASK_MOVDUP(Inst, src) \
71 CASE_MASK_INS_COMMON(Inst, Z, r##src) \
72 CASE_MASK_INS_COMMON(Inst, Z256, r##src) \
73 CASE_MASK_INS_COMMON(Inst, Z128, r##src)
75#define CASE_MASKZ_MOVDUP(Inst, src) \
76 CASE_MASKZ_INS_COMMON(Inst, Z, r##src) \
77 CASE_MASKZ_INS_COMMON(Inst, Z256, r##src) \
78 CASE_MASKZ_INS_COMMON(Inst, Z128, r##src)
80#define CASE_PMOVZX(Inst, src) \
81 CASE_AVX512_INS_COMMON(Inst, Z, r##src) \
82 CASE_AVX512_INS_COMMON(Inst, Z256, r##src) \
83 CASE_AVX512_INS_COMMON(Inst, Z128, r##src) \
84 CASE_AVX_INS_COMMON(Inst, , r##src) \
85 CASE_AVX_INS_COMMON(Inst, Y, r##src) \
86 CASE_SSE_INS_COMMON(Inst, r##src)
88#define CASE_UNPCK(Inst, src) \
89 CASE_AVX512_INS_COMMON(Inst, Z, r##src) \
90 CASE_AVX512_INS_COMMON(Inst, Z256, r##src) \
91 CASE_AVX512_INS_COMMON(Inst, Z128, r##src) \
92 CASE_AVX_INS_COMMON(Inst, , r##src) \
93 CASE_AVX_INS_COMMON(Inst, Y, r##src) \
94 CASE_SSE_INS_COMMON(Inst, r##src)
96#define CASE_MASK_UNPCK(Inst, src) \
97 CASE_MASK_INS_COMMON(Inst, Z, r##src) \
98 CASE_MASK_INS_COMMON(Inst, Z256, r##src) \
99 CASE_MASK_INS_COMMON(Inst, Z128, r##src)
101#define CASE_MASKZ_UNPCK(Inst, src) \
102 CASE_MASKZ_INS_COMMON(Inst, Z, r##src) \
103 CASE_MASKZ_INS_COMMON(Inst, Z256, r##src) \
104 CASE_MASKZ_INS_COMMON(Inst, Z128, r##src)
106#define CASE_SHUF(Inst, suf) \
107 CASE_AVX512_INS_COMMON(Inst, Z, suf) \
108 CASE_AVX512_INS_COMMON(Inst, Z256, suf) \
109 CASE_AVX512_INS_COMMON(Inst, Z128, suf) \
110 CASE_AVX_INS_COMMON(Inst, , suf) \
111 CASE_AVX_INS_COMMON(Inst, Y, suf) \
112 CASE_SSE_INS_COMMON(Inst, suf)
114#define CASE_MASK_SHUF(Inst, src) \
115 CASE_MASK_INS_COMMON(Inst, Z, r##src##i) \
116 CASE_MASK_INS_COMMON(Inst, Z256, r##src##i) \
117 CASE_MASK_INS_COMMON(Inst, Z128, r##src##i)
119#define CASE_MASKZ_SHUF(Inst, src) \
120 CASE_MASKZ_INS_COMMON(Inst, Z, r##src##i) \
121 CASE_MASKZ_INS_COMMON(Inst, Z256, r##src##i) \
122 CASE_MASKZ_INS_COMMON(Inst, Z128, r##src##i)
124#define CASE_VPERMILPI(Inst, src) \
125 CASE_AVX512_INS_COMMON(Inst, Z, src##i) \
126 CASE_AVX512_INS_COMMON(Inst, Z256, src##i) \
127 CASE_AVX512_INS_COMMON(Inst, Z128, src##i) \
128 CASE_AVX_INS_COMMON(Inst, , src##i) \
129 CASE_AVX_INS_COMMON(Inst, Y, src##i)
131#define CASE_MASK_VPERMILPI(Inst, src) \
132 CASE_MASK_INS_COMMON(Inst, Z, src##i) \
133 CASE_MASK_INS_COMMON(Inst, Z256, src##i) \
134 CASE_MASK_INS_COMMON(Inst, Z128, src##i)
136#define CASE_MASKZ_VPERMILPI(Inst, src) \
137 CASE_MASKZ_INS_COMMON(Inst, Z, src##i) \
138 CASE_MASKZ_INS_COMMON(Inst, Z256, src##i) \
139 CASE_MASKZ_INS_COMMON(Inst, Z128, src##i)
141#define CASE_VPERM(Inst, src) \
142 CASE_AVX512_INS_COMMON(Inst, Z, src##i) \
143 CASE_AVX512_INS_COMMON(Inst, Z256, src##i) \
144 CASE_AVX_INS_COMMON(Inst, Y, src##i)
146#define CASE_MASK_VPERM(Inst, src) \
147 CASE_MASK_INS_COMMON(Inst, Z, src##i) \
148 CASE_MASK_INS_COMMON(Inst, Z256, src##i)
150#define CASE_MASKZ_VPERM(Inst, src) \
151 CASE_MASKZ_INS_COMMON(Inst, Z, src##i) \
152 CASE_MASKZ_INS_COMMON(Inst, Z256, src##i)
154#define CASE_VSHUF(Inst, src) \
155 CASE_AVX512_INS_COMMON(SHUFF##Inst, Z, r##src##i) \
156 CASE_AVX512_INS_COMMON(SHUFI##Inst, Z, r##src##i) \
157 CASE_AVX512_INS_COMMON(SHUFF##Inst, Z256, r##src##i) \
158 CASE_AVX512_INS_COMMON(SHUFI##Inst, Z256, r##src##i)
160#define CASE_MASK_VSHUF(Inst, src) \
161 CASE_MASK_INS_COMMON(SHUFF##Inst, Z, r##src##i) \
162 CASE_MASK_INS_COMMON(SHUFI##Inst, Z, r##src##i) \
163 CASE_MASK_INS_COMMON(SHUFF##Inst, Z256, r##src##i) \
164 CASE_MASK_INS_COMMON(SHUFI##Inst, Z256, r##src##i)
166#define CASE_MASKZ_VSHUF(Inst, src) \
167 CASE_MASKZ_INS_COMMON(SHUFF##Inst, Z, r##src##i) \
168 CASE_MASKZ_INS_COMMON(SHUFI##Inst, Z, r##src##i) \
169 CASE_MASKZ_INS_COMMON(SHUFF##Inst, Z256, r##src##i) \
170 CASE_MASKZ_INS_COMMON(SHUFI##Inst, Z256, r##src##i)
172#define CASE_AVX512_FMA(Inst, suf) \
173 CASE_AVX512_INS_COMMON(Inst, Z, suf) \
174 CASE_AVX512_INS_COMMON(Inst, Z256, suf) \
175 CASE_AVX512_INS_COMMON(Inst, Z128, suf)
177#define CASE_FMA(Inst, suf) \
178 CASE_AVX512_FMA(Inst, suf) \
179 CASE_AVX_INS_COMMON(Inst, , suf) \
180 CASE_AVX_INS_COMMON(Inst, Y, suf)
182#define CASE_FMA_PACKED_REG(Inst) \
183 CASE_FMA(Inst##PD, r) \
184 CASE_FMA(Inst##PS, r)
186#define CASE_FMA_PACKED_MEM(Inst) \
187 CASE_FMA(Inst##PD, m) \
188 CASE_FMA(Inst##PS, m) \
189 CASE_AVX512_FMA(Inst##PD, mb) \
190 CASE_AVX512_FMA(Inst##PS, mb)
192#define CASE_FMA_SCALAR_REG(Inst) \
193 CASE_AVX_INS_COMMON(Inst##SD, , r) \
194 CASE_AVX_INS_COMMON(Inst##SS, , r) \
195 CASE_AVX_INS_COMMON(Inst##SD, , r_Int) \
196 CASE_AVX_INS_COMMON(Inst##SS, , r_Int) \
197 CASE_AVX_INS_COMMON(Inst##SD, Z, r) \
198 CASE_AVX_INS_COMMON(Inst##SS, Z, r) \
199 CASE_AVX512_INS_COMMON(Inst##SD, Z, r_Int) \
200 CASE_AVX512_INS_COMMON(Inst##SS, Z, r_Int)
202#define CASE_FMA_SCALAR_MEM(Inst) \
203 CASE_AVX_INS_COMMON(Inst##SD, , m) \
204 CASE_AVX_INS_COMMON(Inst##SS, , m) \
205 CASE_AVX_INS_COMMON(Inst##SD, , m_Int) \
206 CASE_AVX_INS_COMMON(Inst##SS, , m_Int) \
207 CASE_AVX_INS_COMMON(Inst##SD, Z, m) \
208 CASE_AVX_INS_COMMON(Inst##SS, Z, m) \
209 CASE_AVX512_INS_COMMON(Inst##SD, Z, m_Int) \
210 CASE_AVX512_INS_COMMON(Inst##SS, Z, m_Int)
212#define CASE_FMA4(Inst, suf) \
213 CASE_AVX_INS_COMMON(Inst, 4, suf) \
214 CASE_AVX_INS_COMMON(Inst, 4Y, suf)
216#define CASE_FMA4_PACKED_RR(Inst) \
217 CASE_FMA4(Inst##PD, rr) \
218 CASE_FMA4(Inst##PS, rr)
220#define CASE_FMA4_PACKED_RM(Inst) \
221 CASE_FMA4(Inst##PD, rm) \
222 CASE_FMA4(Inst##PS, rm)
224#define CASE_FMA4_PACKED_MR(Inst) \
225 CASE_FMA4(Inst##PD, mr) \
226 CASE_FMA4(Inst##PS, mr)
228#define CASE_FMA4_SCALAR_RR(Inst) \
229 CASE_AVX_INS_COMMON(Inst##SD4, , rr) \
230 CASE_AVX_INS_COMMON(Inst##SS4, , rr) \
231 CASE_AVX_INS_COMMON(Inst##SD4, , rr_Int) \
232 CASE_AVX_INS_COMMON(Inst##SS4, , rr_Int)
234#define CASE_FMA4_SCALAR_RM(Inst) \
235 CASE_AVX_INS_COMMON(Inst##SD4, , rm) \
236 CASE_AVX_INS_COMMON(Inst##SS4, , rm) \
237 CASE_AVX_INS_COMMON(Inst##SD4, , rm_Int) \
238 CASE_AVX_INS_COMMON(Inst##SS4, , rm_Int)
240#define CASE_FMA4_SCALAR_MR(Inst) \
241 CASE_AVX_INS_COMMON(Inst##SD4, , mr) \
242 CASE_AVX_INS_COMMON(Inst##SS4, , mr) \
243 CASE_AVX_INS_COMMON(Inst##SD4, , mr_Int) \
244 CASE_AVX_INS_COMMON(Inst##SS4, , mr_Int)
253 if (Reg >= X86::MM0 && Reg <= X86::MM7)
260 unsigned OperandIndex) {
261 MCRegister OpReg =
MI->getOperand(OperandIndex).getReg();
279 unsigned MaskOp =
Desc.getNumDefs();
284 const char *MaskRegName =
getRegName(
MI->getOperand(MaskOp).getReg());
287 OS <<
" {%" << MaskRegName <<
"}";
296 const char *Mul1Name =
nullptr, *Mul2Name =
nullptr, *AccName =
nullptr;
297 unsigned NumOperands =
MI->getNumOperands();
298 bool RegForm =
false;
316 switch (
MI->getOpcode()) {
322 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
331 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
337 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
347 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
354 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
364 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
371 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
382 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
389 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
397 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
403 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
411 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
418 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
423 AccName =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
429 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
434 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
440 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
445 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
451 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
456 AccName =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
463 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
468 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
475 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
480 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
487 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
492 AccName =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
499 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
504 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
511 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
516 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
523 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
528 AccName =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
536 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
541 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
549 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
554 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
561 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
565 AccName =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
571 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
575 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
581 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
585 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
591 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
595 AccName =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
601 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
605 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
611 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
615 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
621 const char *DestName =
getRegName(
MI->getOperand(0).getReg());
623 if (!Mul1Name) Mul1Name =
"mem";
624 if (!Mul2Name) Mul2Name =
"mem";
625 if (!AccName) AccName =
"mem";
634 OS <<
'(' << Mul1Name <<
" * " << Mul2Name <<
") " << AccStr <<
' '
668 "a ^ ((a & b) | (b ^ c))",
669 "(a & (b ^ c)) ^ ~(b & c)",
671 "~((a & b) | (b ^ c))",
673 "(a & c) ^ (c | ~b)",
675 "(a & b) ^ (b | ~c)",
683 "~((a & b) | (a ^ c))",
685 "(b & c) ^ (c | ~a)",
687 "(a | b) ^ ((a & b) | ~c)",
689 "(c & (a ^ b)) | ~(a | b)",
699 "(a & b) ^ (a | ~c)",
707 "~(a | c) | (a ^ b)",
708 "(c & ~a) | (a ^ b)",
713 "~((a & c) | (a ^ b))",
717 "(b & c) ^ (b | ~a)",
719 "(a | c) ^ ((a & c) | ~b)",
723 "(b & (a ^ c)) | ~(a | c)",
729 "(a & c) ^ (a | ~b)",
737 "~(a | b) | (a ^ c)",
740 "(b & ~a) | (a ^ c)",
743 "~(b ^ c) ^ (a | (b & c))",
749 "~(a | b) | (b ^ c)",
750 "(a | b) & (c ^ (a & b))",
753 "~(a | b) | (c ^ (a & b))",
755 "~(a | c) | (b ^ (a & c))",
756 "(b & ~a) | (b ^ c)",
759 "(a & (b ^ c)) | ~(b | c)",
764 "(a & ~b) | (b ^ c)",
767 "~(b | c) | (a ^ (b & c))",
768 "(a & ~b) | (a ^ c)",
770 "(a & ~c) | (a ^ b)",
775 "~((a ^ b) | (a ^ c))",
777 "~(a ^ b) & (c | ~a)",
779 "~(a ^ c) & (b | ~a)",
780 "(b | c) & (a ^ b ^ c)",
783 "~(b ^ c) & (b | ~a)",
785 "~((b & c) ^ (a | b))",
787 "~((b & c) ^ (a | c))",
788 "a ^ ((a ^ b) | (a ^ c))",
791 "~(b ^ c) & (a | ~b)",
792 "(a | c) & (a ^ b ^ c)",
794 "(a | b) & (a ^ b ^ c)",
797 "~(a | b) | (a ^ b ^ c)",
798 "~(b ^ c) & (a | b)",
801 "~((a | b) & (b ^ c))",
803 "~((a | c) & (b ^ c))",
804 "(b & c) | (a ^ (b | c))",
807 "~(a ^ c) & (a | ~b)",
809 "~((a & c) ^ (a | b))",
810 "~(a ^ c) & (a | b)",
813 "~((a | b) & (a ^ c))",
819 "(b & c) | ~(a ^ c)",
823 "~((a & c) ^ (b | c))",
824 "a ^ ((a ^ c) & (b ^ c))",
827 "~((b | c) & (a ^ c))",
828 "(a & c) | (a ^ b ^ c)",
831 "(a & c) | ~(b ^ c)",
835 "~((a ^ c) & (b ^ c))",
839 "~(a ^ b) & (a | ~c)",
840 "~(a ^ b) & (a | c)",
843 "~((a & b) ^ (a | c))",
845 "~((a | c) & (a ^ b))",
849 "(b & c) | ~(a ^ b)",
855 "~((a & b) ^ (b | c))",
857 "~((b | c) & (a ^ b))",
858 "a ^ ((a ^ b) & (b ^ c))",
860 "(a & b) | (a ^ b ^ c)",
863 "(a & b) | ~(b ^ c)",
865 "~((a ^ b) & (b ^ c))",
873 "(a & c) | ~(a ^ b)",
875 "(a & b) | ~(a ^ c)",
877 "~((a ^ b) & (a ^ c))",
878 "(a | b) & ((a & b) | c)",
879 "(a & b) | (b ^ c ^ ~a)",
906 unsigned NumOperands =
MI->getNumOperands();
910 switch (
MI->getOpcode()) {
915 Src2Idx = NumOperands - 3;
916 Src3Idx = NumOperands - 2;
925 Src2Idx = NumOperands - 7;
936 Src3Idx != -1 ?
getRegName(
MI->getOperand(Src3Idx).getReg()) :
"mem";
937 uint8_t TruthTable =
MI->getOperand(NumOperands - 1).getImm();
939 StringRef SrcNames[] = {Src1Name, Src2Name, Src3Name};
948 while (!BooleanFunction.empty()) {
951 OS << BooleanFunction.substr(0, SymbolOffset);
952 if (SymbolOffset == std::string_view::npos) {
957 char Symbol = BooleanFunction[SymbolOffset];
958 OS << SrcNames[Symbol -
'a'];
960 BooleanFunction.remove_prefix(SymbolOffset + 1);
968 unsigned NumOperands =
MI->getNumOperands();
970 switch (
MI->getOpcode()) {
978 SrcIdx = NumOperands - 2;
996 SrcIdx != -1 ?
getRegName(
MI->getOperand(SrcIdx).getReg()) :
"mem";
1002 uint8_t Categories =
MI->getOperand(NumOperands - 1).getImm();
1003 if (Categories == 0) {
1016 bool Conjoin =
false;
1017 for (
size_t I = 0, E = std::size(CategoryNames);
I != E; ++
I) {
1018 if (Categories & (1 <<
I)) {
1022 OS <<
"is" << CategoryNames[
I] <<
'(' << SrcName <<
')';
1041 const char *DestName =
nullptr, *Src1Name =
nullptr, *Src2Name =
nullptr;
1042 unsigned NumOperands =
MI->getNumOperands();
1043 bool RegForm =
false;
1054 switch (
MI->getOpcode()) {
1059 case X86::BLENDPDrri:
1060 case X86::VBLENDPDrri:
1061 case X86::VBLENDPDYrri:
1064 case X86::BLENDPDrmi:
1065 case X86::VBLENDPDrmi:
1066 case X86::VBLENDPDYrmi:
1067 if (
MI->getOperand(NumOperands - 1).isImm())
1069 MI->getOperand(NumOperands - 1).getImm(),
1075 case X86::BLENDPSrri:
1076 case X86::VBLENDPSrri:
1077 case X86::VBLENDPSYrri:
1080 case X86::BLENDPSrmi:
1081 case X86::VBLENDPSrmi:
1082 case X86::VBLENDPSYrmi:
1083 if (
MI->getOperand(NumOperands - 1).isImm())
1085 MI->getOperand(NumOperands - 1).getImm(),
1091 case X86::PBLENDWrri:
1092 case X86::VPBLENDWrri:
1093 case X86::VPBLENDWYrri:
1096 case X86::PBLENDWrmi:
1097 case X86::VPBLENDWrmi:
1098 case X86::VPBLENDWYrmi:
1099 if (
MI->getOperand(NumOperands - 1).isImm())
1101 MI->getOperand(NumOperands - 1).getImm(),
1107 case X86::VPBLENDDrri:
1108 case X86::VPBLENDDYrri:
1111 case X86::VPBLENDDrmi:
1112 case X86::VPBLENDDYrmi:
1113 if (
MI->getOperand(NumOperands - 1).isImm())
1115 MI->getOperand(NumOperands - 1).getImm(),
1121 case X86::INSERTPSrri:
1122 case X86::VINSERTPSrri:
1123 case X86::VINSERTPSZrri:
1127 if (
MI->getOperand(NumOperands - 1).isImm())
1132 case X86::INSERTPSrmi:
1133 case X86::VINSERTPSrmi:
1134 case X86::VINSERTPSZrmi:
1137 if (
MI->getOperand(NumOperands - 1).isImm())
1142 case X86::MOVLHPSrr:
1143 case X86::VMOVLHPSrr:
1144 case X86::VMOVLHPSZrr:
1151 case X86::MOVHLPSrr:
1152 case X86::VMOVHLPSrr:
1153 case X86::VMOVHLPSZrr:
1161 case X86::VMOVHPDrm:
1162 case X86::VMOVHPDZ128rm:
1169 case X86::VMOVHPSrm:
1170 case X86::VMOVHPSZ128rm:
1177 case X86::VMOVLPDrm:
1178 case X86::VMOVLPDZ128rm:
1185 case X86::VMOVLPSrm:
1186 case X86::VMOVLPSZ128rm:
1193 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1202 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1211 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1220 case X86::VPSLLDQri:
1221 case X86::VPSLLDQYri:
1222 case X86::VPSLLDQZ128ri:
1223 case X86::VPSLLDQZ256ri:
1224 case X86::VPSLLDQZri:
1227 case X86::VPSLLDQZ128mi:
1228 case X86::VPSLLDQZ256mi:
1229 case X86::VPSLLDQZmi:
1231 if (
MI->getOperand(NumOperands - 1).isImm())
1233 MI->getOperand(NumOperands - 1).getImm(),
1238 case X86::VPSRLDQri:
1239 case X86::VPSRLDQYri:
1240 case X86::VPSRLDQZ128ri:
1241 case X86::VPSRLDQZ256ri:
1242 case X86::VPSRLDQZri:
1245 case X86::VPSRLDQZ128mi:
1246 case X86::VPSRLDQZ256mi:
1247 case X86::VPSRLDQZmi:
1249 if (
MI->getOperand(NumOperands - 1).isImm())
1251 MI->getOperand(NumOperands - 1).getImm(),
1256 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1261 Src2Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?3:7)).getReg());
1263 if (
MI->getOperand(NumOperands - 1).isImm())
1265 MI->getOperand(NumOperands - 1).getImm(),
1272 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1279 Src2Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?3:7)).getReg());
1281 if (
MI->getOperand(NumOperands - 1).isImm())
1283 MI->getOperand(NumOperands - 1).getImm(),
1290 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1297 Src2Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?3:7)).getReg());
1299 if (
MI->getOperand(NumOperands - 1).isImm())
1301 MI->getOperand(NumOperands - 1).getImm(),
1306 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1311 if (
MI->getOperand(NumOperands - 1).isImm())
1313 MI->getOperand(NumOperands - 1).getImm(),
1318 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1323 if (
MI->getOperand(NumOperands - 1).isImm())
1325 MI->getOperand(NumOperands - 1).getImm(),
1330 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1335 if (
MI->getOperand(NumOperands - 1).isImm())
1337 MI->getOperand(NumOperands - 1).getImm(),
1341 case X86::MMX_PSHUFWri:
1345 case X86::MMX_PSHUFWmi:
1347 if (
MI->getOperand(NumOperands - 1).isImm())
1362 case X86::MMX_PUNPCKHBWrr:
1363 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1368 case X86::MMX_PUNPCKHBWrm:
1369 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1375 case X86::MMX_PUNPCKHWDrr:
1376 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1381 case X86::MMX_PUNPCKHWDrm:
1382 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1388 case X86::MMX_PUNPCKHDQrr:
1389 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1394 case X86::MMX_PUNPCKHDQrm:
1395 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1401 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1406 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1412 case X86::MMX_PUNPCKLBWrr:
1413 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1418 case X86::MMX_PUNPCKLBWrm:
1419 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1425 case X86::MMX_PUNPCKLWDrr:
1426 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1431 case X86::MMX_PUNPCKLWDrm:
1432 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1438 case X86::MMX_PUNPCKLDQrr:
1439 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1444 case X86::MMX_PUNPCKLDQrm:
1445 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1451 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1456 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1462 Src2Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1467 if (
MI->getOperand(NumOperands - 1).isImm())
1469 MI->getOperand(NumOperands - 1).getImm(), ShuffleMask);
1470 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?3:7)).getReg());
1475 Src2Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1480 if (
MI->getOperand(NumOperands - 1).isImm())
1482 MI->getOperand(NumOperands - 1).getImm(),
1484 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?3:7)).getReg());
1489 Src2Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1495 MI->getOperand(NumOperands - 1).getImm(),
1497 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?3:7)).getReg());
1502 Src2Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1508 MI->getOperand(NumOperands - 1).getImm(),
1510 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?3:7)).getReg());
1515 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1521 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1526 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1532 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1537 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1543 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1548 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1554 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1559 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1563 if (
MI->getOperand(NumOperands - 1).isImm())
1565 MI->getOperand(NumOperands - 1).getImm(),
1571 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1575 if (
MI->getOperand(NumOperands - 1).isImm())
1577 MI->getOperand(NumOperands - 1).getImm(),
1582 case X86::VPERM2F128rri:
1583 case X86::VPERM2I128rri:
1587 case X86::VPERM2F128rmi:
1588 case X86::VPERM2I128rmi:
1590 if (
MI->getOperand(NumOperands - 1).isImm())
1598 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1602 if (
MI->getOperand(NumOperands - 1).isImm())
1604 MI->getOperand(NumOperands - 1).getImm(),
1610 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1614 if (
MI->getOperand(NumOperands - 1).isImm())
1616 MI->getOperand(NumOperands - 1).getImm(),
1623 case X86::VMOVSDZrr:
1632 case X86::VMOVSSZrr:
1639 case X86::MOVPQI2QIrr:
1640 case X86::MOVZPQILo2PQIrr:
1641 case X86::VMOVPQI2QIrr:
1642 case X86::VMOVPQI2QIZrr:
1643 case X86::VMOVZPQILo2PQIrr:
1644 case X86::VMOVZPQILo2PQIZrr:
1651 if (
MI->getOperand(2).isImm() &&
1652 MI->getOperand(3).isImm())
1654 MI->getOperand(3).getImm(), ShuffleMask);
1661 if (
MI->getOperand(3).isImm() &&
1662 MI->getOperand(4).isImm())
1664 MI->getOperand(4).getImm(), ShuffleMask);
1671 case X86::VBROADCASTF128rm:
1672 case X86::VBROADCASTI128rm:
1704 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1712 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1721 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1730 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1737 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1744 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1751 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1758 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1765 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1774 if (ShuffleMask.
empty())
1777 if (!DestName) DestName = Src1Name;
1788 if (Src1Name == Src2Name) {
1789 for (
unsigned i = 0, e = ShuffleMask.
size(); i != e; ++i) {
1790 if ((
int)ShuffleMask[i] >= 0 &&
1791 ShuffleMask[i] >= (
int)e)
1792 ShuffleMask[i] -= e;
1799 for (
unsigned i = 0, e = ShuffleMask.
size(); i != e; ++i) {
1809 bool isSrc1 = ShuffleMask[i] < (int)ShuffleMask.
size();
1810 const char *SrcName = isSrc1 ? Src1Name : Src2Name;
1811 OS << (SrcName ? SrcName :
"mem") <<
'[';
1812 bool IsFirst =
true;
1814 (ShuffleMask[i] < (int)ShuffleMask.
size()) == isSrc1) {
1822 OS << ShuffleMask[i] % ShuffleMask.
size();
Instances of this class represent a single low-level machine instruction.
Describe properties that are true of each instruction in the target description file.
Interface to description of machine instruction set.
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode.
Wrapper class representing physical registers. Should be passed by value.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
StringRef - Represent a constant reference to a string, i.e.
size_t find_first_of(char C, size_t From=0) const
Find the first character in the string that is C, or npos if not found.
static const char * getRegisterName(MCRegister Reg)
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
bool isZMMReg(MCRegister Reg)
bool isXMMReg(MCRegister Reg)
bool isYMMReg(MCRegister Reg)
This is an optimization pass for GlobalISel generic memory operations.
void DecodeZeroExtendMask(unsigned SrcScalarBits, unsigned DstScalarBits, unsigned NumDstElts, bool IsAnyExtend, SmallVectorImpl< int > &ShuffleMask)
Decode a zero extension instruction as a shuffle mask.
bool EmitAnyX86InstComments(const MCInst *MI, raw_ostream &OS, const MCInstrInfo &MCII)
EmitAnyX86InstComments - This function decodes x86 instructions and prints newline terminated strings...
void DecodeMOVHLPSMask(unsigned NElts, SmallVectorImpl< int > &ShuffleMask)
Decode a MOVHLPS instruction as a v2f64/v4f32 shuffle mask.
void DecodeZeroMoveLowMask(unsigned NumElts, SmallVectorImpl< int > &ShuffleMask)
Decode a move lower and zero upper instruction as a shuffle mask.
void DecodeInsertElementMask(unsigned NumElts, unsigned Idx, unsigned Len, SmallVectorImpl< int > &ShuffleMask)
void DecodePSHUFLWMask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
Decodes the shuffle masks for pshuflw.
void DecodeBLENDMask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
Decode a BLEND immediate mask into a shuffle mask.
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 DecodeVPERMMask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
Decodes the shuffle masks for VPERMQ/VPERMPD.
void DecodeEXTRQIMask(unsigned NumElts, unsigned EltSize, int Len, int Idx, SmallVectorImpl< int > &ShuffleMask)
Decode a SSE4A EXTRQ instruction as a shuffle mask.
void DecodePSRLDQMask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
void DecodeINSERTPSMask(unsigned Imm, SmallVectorImpl< int > &ShuffleMask, bool SrcIsMem)
Decode a 128-bit INSERTPS instruction as a v4f32 shuffle mask.
void DecodeVPERM2X128Mask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
void DecodeMOVLHPSMask(unsigned NElts, SmallVectorImpl< int > &ShuffleMask)
Decode a MOVLHPS instruction as a v2f64/v4f32 shuffle mask.
void DecodePSWAPMask(unsigned NumElts, SmallVectorImpl< int > &ShuffleMask)
Decodes a PSWAPD 3DNow! instruction.
void DecodeINSERTQIMask(unsigned NumElts, unsigned EltSize, int Len, int Idx, SmallVectorImpl< int > &ShuffleMask)
Decode a SSE4A INSERTQ instruction as a shuffle mask.
void DecodeVALIGNMask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
void DecodeScalarMoveMask(unsigned NumElts, bool IsLoad, SmallVectorImpl< int > &ShuffleMask)
Decode a scalar float move instruction as a shuffle mask.
void DecodePALIGNRMask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
void DecodeMOVSLDUPMask(unsigned NumElts, SmallVectorImpl< int > &ShuffleMask)
void DecodeSubVectorBroadcast(unsigned DstNumElts, unsigned SrcNumElts, SmallVectorImpl< int > &ShuffleMask)
Decodes a broadcast of a subvector to a larger vector type.
void DecodeUNPCKLMask(unsigned NumElts, unsigned ScalarBits, SmallVectorImpl< int > &ShuffleMask)
Decodes the shuffle masks for unpcklps/unpcklpd and punpckl*.
void DecodePSLLDQMask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
void DecodeUNPCKHMask(unsigned NumElts, unsigned ScalarBits, SmallVectorImpl< int > &ShuffleMask)
Decodes the shuffle masks for unpckhps/unpckhpd and punpckh*.
void DecodePSHUFMask(unsigned NumElts, unsigned ScalarBits, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
Decodes the shuffle masks for pshufd/pshufw/vpermilpd/vpermilps.
void DecodeMOVDDUPMask(unsigned NumElts, SmallVectorImpl< int > &ShuffleMask)
void DecodeSHUFPMask(unsigned NumElts, unsigned ScalarBits, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
Decodes the shuffle masks for shufp*.
void DecodePSHUFHWMask(unsigned NumElts, unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
Decodes the shuffle masks for pshufhw.
void DecodeMOVSHDUPMask(unsigned NumElts, SmallVectorImpl< int > &ShuffleMask)
Description of the encoding of one expression Op.