25#define CASE_SSE_INS_COMMON(Inst, src) \
28#define CASE_AVX_INS_COMMON(Inst, Suffix, src) \
29 case X86::V##Inst##Suffix##src:
31#define CASE_MASK_INS_COMMON(Inst, Suffix, src) \
32 case X86::V##Inst##Suffix##src##k:
34#define CASE_MASKZ_INS_COMMON(Inst, Suffix, src) \
35 case X86::V##Inst##Suffix##src##kz:
37#define CASE_AVX512_INS_COMMON(Inst, Suffix, src) \
38 CASE_AVX_INS_COMMON(Inst, Suffix, src) \
39 CASE_MASK_INS_COMMON(Inst, Suffix, src) \
40 CASE_MASKZ_INS_COMMON(Inst, Suffix, src)
42#define CASE_MOVDUP(Inst, src) \
43 CASE_AVX512_INS_COMMON(Inst, Z, r##src) \
44 CASE_AVX512_INS_COMMON(Inst, Z256, r##src) \
45 CASE_AVX512_INS_COMMON(Inst, Z128, r##src) \
46 CASE_AVX_INS_COMMON(Inst, , r##src) \
47 CASE_AVX_INS_COMMON(Inst, Y, r##src) \
48 CASE_SSE_INS_COMMON(Inst, r##src)
50#define CASE_MASK_MOVDUP(Inst, src) \
51 CASE_MASK_INS_COMMON(Inst, Z, r##src) \
52 CASE_MASK_INS_COMMON(Inst, Z256, r##src) \
53 CASE_MASK_INS_COMMON(Inst, Z128, r##src)
55#define CASE_MASKZ_MOVDUP(Inst, src) \
56 CASE_MASKZ_INS_COMMON(Inst, Z, r##src) \
57 CASE_MASKZ_INS_COMMON(Inst, Z256, r##src) \
58 CASE_MASKZ_INS_COMMON(Inst, Z128, r##src)
60#define CASE_PMOVZX(Inst, src) \
61 CASE_AVX512_INS_COMMON(Inst, Z, r##src) \
62 CASE_AVX512_INS_COMMON(Inst, Z256, r##src) \
63 CASE_AVX512_INS_COMMON(Inst, Z128, r##src) \
64 CASE_AVX_INS_COMMON(Inst, , r##src) \
65 CASE_AVX_INS_COMMON(Inst, Y, r##src) \
66 CASE_SSE_INS_COMMON(Inst, r##src)
68#define CASE_UNPCK(Inst, src) \
69 CASE_AVX512_INS_COMMON(Inst, Z, r##src) \
70 CASE_AVX512_INS_COMMON(Inst, Z256, r##src) \
71 CASE_AVX512_INS_COMMON(Inst, Z128, r##src) \
72 CASE_AVX_INS_COMMON(Inst, , r##src) \
73 CASE_AVX_INS_COMMON(Inst, Y, r##src) \
74 CASE_SSE_INS_COMMON(Inst, r##src)
76#define CASE_MASK_UNPCK(Inst, src) \
77 CASE_MASK_INS_COMMON(Inst, Z, r##src) \
78 CASE_MASK_INS_COMMON(Inst, Z256, r##src) \
79 CASE_MASK_INS_COMMON(Inst, Z128, r##src)
81#define CASE_MASKZ_UNPCK(Inst, src) \
82 CASE_MASKZ_INS_COMMON(Inst, Z, r##src) \
83 CASE_MASKZ_INS_COMMON(Inst, Z256, r##src) \
84 CASE_MASKZ_INS_COMMON(Inst, Z128, r##src)
86#define CASE_SHUF(Inst, suf) \
87 CASE_AVX512_INS_COMMON(Inst, Z, suf) \
88 CASE_AVX512_INS_COMMON(Inst, Z256, suf) \
89 CASE_AVX512_INS_COMMON(Inst, Z128, suf) \
90 CASE_AVX_INS_COMMON(Inst, , suf) \
91 CASE_AVX_INS_COMMON(Inst, Y, suf) \
92 CASE_SSE_INS_COMMON(Inst, suf)
94#define CASE_MASK_SHUF(Inst, src) \
95 CASE_MASK_INS_COMMON(Inst, Z, r##src##i) \
96 CASE_MASK_INS_COMMON(Inst, Z256, r##src##i) \
97 CASE_MASK_INS_COMMON(Inst, Z128, r##src##i)
99#define CASE_MASKZ_SHUF(Inst, src) \
100 CASE_MASKZ_INS_COMMON(Inst, Z, r##src##i) \
101 CASE_MASKZ_INS_COMMON(Inst, Z256, r##src##i) \
102 CASE_MASKZ_INS_COMMON(Inst, Z128, r##src##i)
104#define CASE_VPERMILPI(Inst, src) \
105 CASE_AVX512_INS_COMMON(Inst, Z, src##i) \
106 CASE_AVX512_INS_COMMON(Inst, Z256, src##i) \
107 CASE_AVX512_INS_COMMON(Inst, Z128, src##i) \
108 CASE_AVX_INS_COMMON(Inst, , src##i) \
109 CASE_AVX_INS_COMMON(Inst, Y, src##i)
111#define CASE_MASK_VPERMILPI(Inst, src) \
112 CASE_MASK_INS_COMMON(Inst, Z, src##i) \
113 CASE_MASK_INS_COMMON(Inst, Z256, src##i) \
114 CASE_MASK_INS_COMMON(Inst, Z128, src##i)
116#define CASE_MASKZ_VPERMILPI(Inst, src) \
117 CASE_MASKZ_INS_COMMON(Inst, Z, src##i) \
118 CASE_MASKZ_INS_COMMON(Inst, Z256, src##i) \
119 CASE_MASKZ_INS_COMMON(Inst, Z128, src##i)
121#define CASE_VPERM(Inst, src) \
122 CASE_AVX512_INS_COMMON(Inst, Z, src##i) \
123 CASE_AVX512_INS_COMMON(Inst, Z256, src##i) \
124 CASE_AVX_INS_COMMON(Inst, Y, src##i)
126#define CASE_MASK_VPERM(Inst, src) \
127 CASE_MASK_INS_COMMON(Inst, Z, src##i) \
128 CASE_MASK_INS_COMMON(Inst, Z256, src##i)
130#define CASE_MASKZ_VPERM(Inst, src) \
131 CASE_MASKZ_INS_COMMON(Inst, Z, src##i) \
132 CASE_MASKZ_INS_COMMON(Inst, Z256, src##i)
134#define CASE_VSHUF(Inst, src) \
135 CASE_AVX512_INS_COMMON(SHUFF##Inst, Z, r##src##i) \
136 CASE_AVX512_INS_COMMON(SHUFI##Inst, Z, r##src##i) \
137 CASE_AVX512_INS_COMMON(SHUFF##Inst, Z256, r##src##i) \
138 CASE_AVX512_INS_COMMON(SHUFI##Inst, Z256, r##src##i)
140#define CASE_MASK_VSHUF(Inst, src) \
141 CASE_MASK_INS_COMMON(SHUFF##Inst, Z, r##src##i) \
142 CASE_MASK_INS_COMMON(SHUFI##Inst, Z, r##src##i) \
143 CASE_MASK_INS_COMMON(SHUFF##Inst, Z256, r##src##i) \
144 CASE_MASK_INS_COMMON(SHUFI##Inst, Z256, r##src##i)
146#define CASE_MASKZ_VSHUF(Inst, src) \
147 CASE_MASKZ_INS_COMMON(SHUFF##Inst, Z, r##src##i) \
148 CASE_MASKZ_INS_COMMON(SHUFI##Inst, Z, r##src##i) \
149 CASE_MASKZ_INS_COMMON(SHUFF##Inst, Z256, r##src##i) \
150 CASE_MASKZ_INS_COMMON(SHUFI##Inst, Z256, r##src##i)
152#define CASE_AVX512_FMA(Inst, suf) \
153 CASE_AVX512_INS_COMMON(Inst, Z, suf) \
154 CASE_AVX512_INS_COMMON(Inst, Z256, suf) \
155 CASE_AVX512_INS_COMMON(Inst, Z128, suf)
157#define CASE_FMA(Inst, suf) \
158 CASE_AVX512_FMA(Inst, suf) \
159 CASE_AVX_INS_COMMON(Inst, , suf) \
160 CASE_AVX_INS_COMMON(Inst, Y, suf)
162#define CASE_FMA_PACKED_REG(Inst) \
163 CASE_FMA(Inst##PD, r) \
164 CASE_FMA(Inst##PS, r)
166#define CASE_FMA_PACKED_MEM(Inst) \
167 CASE_FMA(Inst##PD, m) \
168 CASE_FMA(Inst##PS, m) \
169 CASE_AVX512_FMA(Inst##PD, mb) \
170 CASE_AVX512_FMA(Inst##PS, mb)
172#define CASE_FMA_SCALAR_REG(Inst) \
173 CASE_AVX_INS_COMMON(Inst##SD, , r) \
174 CASE_AVX_INS_COMMON(Inst##SS, , r) \
175 CASE_AVX_INS_COMMON(Inst##SD, , r_Int) \
176 CASE_AVX_INS_COMMON(Inst##SS, , r_Int) \
177 CASE_AVX_INS_COMMON(Inst##SD, Z, r) \
178 CASE_AVX_INS_COMMON(Inst##SS, Z, r) \
179 CASE_AVX512_INS_COMMON(Inst##SD, Z, r_Int) \
180 CASE_AVX512_INS_COMMON(Inst##SS, Z, r_Int)
182#define CASE_FMA_SCALAR_MEM(Inst) \
183 CASE_AVX_INS_COMMON(Inst##SD, , m) \
184 CASE_AVX_INS_COMMON(Inst##SS, , m) \
185 CASE_AVX_INS_COMMON(Inst##SD, , m_Int) \
186 CASE_AVX_INS_COMMON(Inst##SS, , m_Int) \
187 CASE_AVX_INS_COMMON(Inst##SD, Z, m) \
188 CASE_AVX_INS_COMMON(Inst##SS, Z, m) \
189 CASE_AVX512_INS_COMMON(Inst##SD, Z, m_Int) \
190 CASE_AVX512_INS_COMMON(Inst##SS, Z, m_Int)
192#define CASE_FMA4(Inst, suf) \
193 CASE_AVX_INS_COMMON(Inst, 4, suf) \
194 CASE_AVX_INS_COMMON(Inst, 4Y, suf)
196#define CASE_FMA4_PACKED_RR(Inst) \
197 CASE_FMA4(Inst##PD, rr) \
198 CASE_FMA4(Inst##PS, rr)
200#define CASE_FMA4_PACKED_RM(Inst) \
201 CASE_FMA4(Inst##PD, rm) \
202 CASE_FMA4(Inst##PS, rm)
204#define CASE_FMA4_PACKED_MR(Inst) \
205 CASE_FMA4(Inst##PD, mr) \
206 CASE_FMA4(Inst##PS, mr)
208#define CASE_FMA4_SCALAR_RR(Inst) \
209 CASE_AVX_INS_COMMON(Inst##SD4, , rr) \
210 CASE_AVX_INS_COMMON(Inst##SS4, , rr) \
211 CASE_AVX_INS_COMMON(Inst##SD4, , rr_Int) \
212 CASE_AVX_INS_COMMON(Inst##SS4, , rr_Int)
214#define CASE_FMA4_SCALAR_RM(Inst) \
215 CASE_AVX_INS_COMMON(Inst##SD4, , rm) \
216 CASE_AVX_INS_COMMON(Inst##SS4, , rm) \
217 CASE_AVX_INS_COMMON(Inst##SD4, , rm_Int) \
218 CASE_AVX_INS_COMMON(Inst##SS4, , rm_Int)
220#define CASE_FMA4_SCALAR_MR(Inst) \
221 CASE_AVX_INS_COMMON(Inst##SD4, , mr) \
222 CASE_AVX_INS_COMMON(Inst##SS4, , mr) \
223 CASE_AVX_INS_COMMON(Inst##SD4, , mr_Int) \
224 CASE_AVX_INS_COMMON(Inst##SS4, , mr_Int)
233 if (X86::MM0 <= RegNo && RegNo <= X86::MM7)
240 unsigned OperandIndex) {
241 unsigned OpReg =
MI->getOperand(OperandIndex).getReg();
259 unsigned MaskOp =
Desc.getNumDefs();
264 const char *MaskRegName =
getRegName(
MI->getOperand(MaskOp).getReg());
267 OS <<
" {%" << MaskRegName <<
"}";
276 const char *Mul1Name =
nullptr, *Mul2Name =
nullptr, *AccName =
nullptr;
277 unsigned NumOperands =
MI->getNumOperands();
278 bool RegForm =
false;
296 switch (
MI->getOpcode()) {
302 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
311 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
317 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
327 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
334 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
344 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
351 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
362 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
369 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
377 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
383 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
391 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
398 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
403 AccName =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
409 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
414 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
420 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
425 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
431 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
436 AccName =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
443 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
448 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
455 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
460 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
467 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
472 AccName =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
479 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
484 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
491 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
496 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
503 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
508 AccName =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
516 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
521 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
529 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
534 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
541 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
545 AccName =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
551 AccName =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
555 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
561 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
565 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
571 Mul2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
575 AccName =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
581 AccName =
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 Mul1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
601 const char *DestName =
getRegName(
MI->getOperand(0).getReg());
603 if (!Mul1Name) Mul1Name =
"mem";
604 if (!Mul2Name) Mul2Name =
"mem";
605 if (!AccName) AccName =
"mem";
614 OS <<
'(' << Mul1Name <<
" * " << Mul2Name <<
") " << AccStr <<
' '
632 const char *DestName =
nullptr, *Src1Name =
nullptr, *Src2Name =
nullptr;
633 unsigned NumOperands =
MI->getNumOperands();
634 bool RegForm =
false;
639 switch (
MI->getOpcode()) {
644 case X86::BLENDPDrri:
645 case X86::VBLENDPDrri:
646 case X86::VBLENDPDYrri:
649 case X86::BLENDPDrmi:
650 case X86::VBLENDPDrmi:
651 case X86::VBLENDPDYrmi:
652 if (
MI->getOperand(NumOperands - 1).isImm())
654 MI->getOperand(NumOperands - 1).getImm(),
660 case X86::BLENDPSrri:
661 case X86::VBLENDPSrri:
662 case X86::VBLENDPSYrri:
665 case X86::BLENDPSrmi:
666 case X86::VBLENDPSrmi:
667 case X86::VBLENDPSYrmi:
668 if (
MI->getOperand(NumOperands - 1).isImm())
670 MI->getOperand(NumOperands - 1).getImm(),
676 case X86::PBLENDWrri:
677 case X86::VPBLENDWrri:
678 case X86::VPBLENDWYrri:
681 case X86::PBLENDWrmi:
682 case X86::VPBLENDWrmi:
683 case X86::VPBLENDWYrmi:
684 if (
MI->getOperand(NumOperands - 1).isImm())
686 MI->getOperand(NumOperands - 1).getImm(),
692 case X86::VPBLENDDrri:
693 case X86::VPBLENDDYrri:
696 case X86::VPBLENDDrmi:
697 case X86::VPBLENDDYrmi:
698 if (
MI->getOperand(NumOperands - 1).isImm())
700 MI->getOperand(NumOperands - 1).getImm(),
706 case X86::INSERTPSrr:
707 case X86::VINSERTPSrr:
708 case X86::VINSERTPSZrr:
711 case X86::INSERTPSrm:
712 case X86::VINSERTPSrm:
713 case X86::VINSERTPSZrm:
716 if (
MI->getOperand(NumOperands - 1).isImm())
722 case X86::VMOVLHPSrr:
723 case X86::VMOVLHPSZrr:
731 case X86::VMOVHLPSrr:
732 case X86::VMOVHLPSZrr:
741 case X86::VMOVHPDZ128rm:
749 case X86::VMOVHPSZ128rm:
757 case X86::VMOVLPDZ128rm:
765 case X86::VMOVLPSZ128rm:
772 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
781 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
790 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
800 case X86::VPSLLDQYri:
801 case X86::VPSLLDQZ128ri:
802 case X86::VPSLLDQZ256ri:
803 case X86::VPSLLDQZri:
806 case X86::VPSLLDQZ128mi:
807 case X86::VPSLLDQZ256mi:
808 case X86::VPSLLDQZmi:
810 if (
MI->getOperand(NumOperands - 1).isImm())
812 MI->getOperand(NumOperands - 1).getImm(),
818 case X86::VPSRLDQYri:
819 case X86::VPSRLDQZ128ri:
820 case X86::VPSRLDQZ256ri:
821 case X86::VPSRLDQZri:
824 case X86::VPSRLDQZ128mi:
825 case X86::VPSRLDQZ256mi:
826 case X86::VPSRLDQZmi:
828 if (
MI->getOperand(NumOperands - 1).isImm())
830 MI->getOperand(NumOperands - 1).getImm(),
835 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
840 Src2Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?3:7)).getReg());
842 if (
MI->getOperand(NumOperands - 1).isImm())
844 MI->getOperand(NumOperands - 1).getImm(),
851 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
858 Src2Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?3:7)).getReg());
860 if (
MI->getOperand(NumOperands - 1).isImm())
862 MI->getOperand(NumOperands - 1).getImm(),
869 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
876 Src2Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?3:7)).getReg());
878 if (
MI->getOperand(NumOperands - 1).isImm())
880 MI->getOperand(NumOperands - 1).getImm(),
885 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
890 if (
MI->getOperand(NumOperands - 1).isImm())
892 MI->getOperand(NumOperands - 1).getImm(),
897 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
902 if (
MI->getOperand(NumOperands - 1).isImm())
904 MI->getOperand(NumOperands - 1).getImm(),
909 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
914 if (
MI->getOperand(NumOperands - 1).isImm())
916 MI->getOperand(NumOperands - 1).getImm(),
920 case X86::MMX_PSHUFWri:
924 case X86::MMX_PSHUFWmi:
926 if (
MI->getOperand(NumOperands - 1).isImm())
941 case X86::MMX_PUNPCKHBWrr:
942 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
947 case X86::MMX_PUNPCKHBWrm:
948 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
954 case X86::MMX_PUNPCKHWDrr:
955 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
960 case X86::MMX_PUNPCKHWDrm:
961 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
967 case X86::MMX_PUNPCKHDQrr:
968 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
973 case X86::MMX_PUNPCKHDQrm:
974 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
980 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
985 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
991 case X86::MMX_PUNPCKLBWrr:
992 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
997 case X86::MMX_PUNPCKLBWrm:
998 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1004 case X86::MMX_PUNPCKLWDrr:
1005 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1010 case X86::MMX_PUNPCKLWDrm:
1011 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1017 case X86::MMX_PUNPCKLDQrr:
1018 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1023 case X86::MMX_PUNPCKLDQrm:
1024 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1030 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1035 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1041 Src2Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1046 if (
MI->getOperand(NumOperands - 1).isImm())
1048 MI->getOperand(NumOperands - 1).getImm(), ShuffleMask);
1049 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?3:7)).getReg());
1054 Src2Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1059 if (
MI->getOperand(NumOperands - 1).isImm())
1061 MI->getOperand(NumOperands - 1).getImm(),
1063 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?3:7)).getReg());
1068 Src2Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1074 MI->getOperand(NumOperands - 1).getImm(),
1076 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?3:7)).getReg());
1081 Src2Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1087 MI->getOperand(NumOperands - 1).getImm(),
1089 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?3:7)).getReg());
1094 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1100 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1105 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1111 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1116 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1122 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1127 Src2Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1133 Src1Name =
getRegName(
MI->getOperand(NumOperands-(RegForm?2:6)).getReg());
1138 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1142 if (
MI->getOperand(NumOperands - 1).isImm())
1144 MI->getOperand(NumOperands - 1).getImm(),
1150 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1154 if (
MI->getOperand(NumOperands - 1).isImm())
1156 MI->getOperand(NumOperands - 1).getImm(),
1161 case X86::VPERM2F128rr:
1162 case X86::VPERM2I128rr:
1166 case X86::VPERM2F128rm:
1167 case X86::VPERM2I128rm:
1169 if (
MI->getOperand(NumOperands - 1).isImm())
1177 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1181 if (
MI->getOperand(NumOperands - 1).isImm())
1183 MI->getOperand(NumOperands - 1).getImm(),
1189 Src1Name =
getRegName(
MI->getOperand(NumOperands - 2).getReg());
1193 if (
MI->getOperand(NumOperands - 1).isImm())
1195 MI->getOperand(NumOperands - 1).getImm(),
1202 case X86::VMOVSDZrr:
1211 case X86::VMOVSSZrr:
1218 case X86::MOVPQI2QIrr:
1219 case X86::MOVZPQILo2PQIrr:
1220 case X86::VMOVPQI2QIrr:
1221 case X86::VMOVPQI2QIZrr:
1222 case X86::VMOVZPQILo2PQIrr:
1223 case X86::VMOVZPQILo2PQIZrr:
1230 if (
MI->getOperand(2).isImm() &&
1231 MI->getOperand(3).isImm())
1233 MI->getOperand(3).getImm(), ShuffleMask);
1240 if (
MI->getOperand(3).isImm() &&
1241 MI->getOperand(4).isImm())
1243 MI->getOperand(4).getImm(), ShuffleMask);
1250 case X86::VBROADCASTF128rm:
1251 case X86::VBROADCASTI128rm:
1283 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1291 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1300 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1309 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1316 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1323 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1330 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1337 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1344 Src1Name =
getRegName(
MI->getOperand(NumOperands - 1).getReg());
1353 if (ShuffleMask.
empty())
1356 if (!DestName) DestName = Src1Name;
1367 if (Src1Name == Src2Name) {
1368 for (
unsigned i = 0, e = ShuffleMask.
size(); i != e; ++i) {
1369 if ((
int)ShuffleMask[i] >= 0 &&
1370 ShuffleMask[i] >= (
int)e)
1371 ShuffleMask[i] -= e;
1378 for (
unsigned i = 0, e = ShuffleMask.
size(); i != e; ++i) {
1388 bool isSrc1 = ShuffleMask[i] < (int)ShuffleMask.
size();
1389 const char *SrcName = isSrc1 ? Src1Name : Src2Name;
1390 OS << (SrcName ? SrcName :
"mem") <<
'[';
1391 bool IsFirst =
true;
1393 (ShuffleMask[i] < (int)ShuffleMask.
size()) == isSrc1) {
1401 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.
StringRef - Represent a constant reference to a string, i.e.
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 isXMMReg(unsigned RegNo)
bool isZMMReg(unsigned RegNo)
bool isYMMReg(unsigned RegNo)
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 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 DecodeINSERTPSMask(unsigned Imm, SmallVectorImpl< int > &ShuffleMask)
Decode a 128-bit INSERTPS instruction as a v4f32 shuffle mask.
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.