1 //===- X86ReplaceableInstrs.def
----------------------------------*- C
++ -*-==//
3 // Part of the LLVM Project
, under the Apache License v2.0 with LLVM Exceptions.
4 // See https
://llvm.org
/LICENSE.txt for license information.
5 // SPDX
-License
-Identifier
: Apache
-2.0 WITH LLVM
-exception
7 //===----------------------------------------------------------------------===//
9 // These are the replaceable SSE instructions. Some of these have Int variants
10 // that we don
't include here. We don't want to replace instructions selected
13 #define
ENTRY(A
, B
, C
) {X86
::A
, X86
::B
, X86
::C
},
14 static const uint16_t ReplaceableInstrs
[][3] = {
15 // PackedSingle
, PackedDouble
, PackedInt
16 ENTRY(MOVAPSmr
, MOVAPDmr
, MOVDQAmr
)
17 ENTRY(MOVAPSrm
, MOVAPDrm
, MOVDQArm
)
18 ENTRY(MOVAPSrr
, MOVAPDrr
, MOVDQArr
)
19 ENTRY(MOVUPSmr
, MOVUPDmr
, MOVDQUmr
)
20 ENTRY(MOVUPSrm
, MOVUPDrm
, MOVDQUrm
)
21 ENTRY(MOVLPSmr
, MOVLPDmr
, MOVPQI2QImr
)
22 ENTRY(MOVSDmr
, MOVSDmr
, MOVPQI2QImr
)
23 ENTRY(MOVSSmr
, MOVSSmr
, MOVPDI2DImr
)
24 ENTRY(MOVSDrm
, MOVSDrm
, MOVQI2PQIrm
)
25 ENTRY(MOVSDrm_alt
, MOVSDrm_alt
, MOVQI2PQIrm
)
26 ENTRY(MOVSSrm
, MOVSSrm
, MOVDI2PDIrm
)
27 ENTRY(MOVSSrm_alt
, MOVSSrm_alt
, MOVDI2PDIrm
)
28 ENTRY(MOVNTPSmr
, MOVNTPDmr
, MOVNTDQmr
)
29 ENTRY(ANDNPSrm
, ANDNPDrm
, PANDNrm
)
30 ENTRY(ANDNPSrr
, ANDNPDrr
, PANDNrr
)
31 ENTRY(ANDPSrm
, ANDPDrm
, PANDrm
)
32 ENTRY(ANDPSrr
, ANDPDrr
, PANDrr
)
33 ENTRY(ORPSrm
, ORPDrm
, PORrm
)
34 ENTRY(ORPSrr
, ORPDrr
, PORrr
)
35 ENTRY(XORPSrm
, XORPDrm
, PXORrm
)
36 ENTRY(XORPSrr
, XORPDrr
, PXORrr
)
37 ENTRY(UNPCKLPDrm
, UNPCKLPDrm
, PUNPCKLQDQrm
)
38 ENTRY(MOVLHPSrr
, UNPCKLPDrr
, PUNPCKLQDQrr
)
39 ENTRY(UNPCKHPDrm
, UNPCKHPDrm
, PUNPCKHQDQrm
)
40 ENTRY(UNPCKHPDrr
, UNPCKHPDrr
, PUNPCKHQDQrr
)
41 ENTRY(UNPCKLPSrm
, UNPCKLPSrm
, PUNPCKLDQrm
)
42 ENTRY(UNPCKLPSrr
, UNPCKLPSrr
, PUNPCKLDQrr
)
43 ENTRY(UNPCKHPSrm
, UNPCKHPSrm
, PUNPCKHDQrm
)
44 ENTRY(UNPCKHPSrr
, UNPCKHPSrr
, PUNPCKHDQrr
)
45 ENTRY(EXTRACTPSmri
, EXTRACTPSmri
, PEXTRDmri
)
46 ENTRY(EXTRACTPSrri
, EXTRACTPSrri
, PEXTRDrri
)
47 // AVX
128-bit support
48 ENTRY(VMOVAPSmr
, VMOVAPDmr
, VMOVDQAmr
)
49 ENTRY(VMOVAPSrm
, VMOVAPDrm
, VMOVDQArm
)
50 ENTRY(VMOVAPSrr
, VMOVAPDrr
, VMOVDQArr
)
51 ENTRY(VMOVUPSmr
, VMOVUPDmr
, VMOVDQUmr
)
52 ENTRY(VMOVUPSrm
, VMOVUPDrm
, VMOVDQUrm
)
53 ENTRY(VMOVLPSmr
, VMOVLPDmr
, VMOVPQI2QImr
)
54 ENTRY(VMOVSDmr
, VMOVSDmr
, VMOVPQI2QImr
)
55 ENTRY(VMOVSSmr
, VMOVSSmr
, VMOVPDI2DImr
)
56 ENTRY(VMOVSDrm
, VMOVSDrm
, VMOVQI2PQIrm
)
57 ENTRY(VMOVSDrm_alt
, VMOVSDrm_alt
, VMOVQI2PQIrm
)
58 ENTRY(VMOVSSrm
, VMOVSSrm
, VMOVDI2PDIrm
)
59 ENTRY(VMOVSSrm_alt
, VMOVSSrm_alt
, VMOVDI2PDIrm
)
60 ENTRY(VMOVNTPSmr
, VMOVNTPDmr
, VMOVNTDQmr
)
61 ENTRY(VANDNPSrm
, VANDNPDrm
, VPANDNrm
)
62 ENTRY(VANDNPSrr
, VANDNPDrr
, VPANDNrr
)
63 ENTRY(VANDPSrm
, VANDPDrm
, VPANDrm
)
64 ENTRY(VANDPSrr
, VANDPDrr
, VPANDrr
)
65 ENTRY(VORPSrm
, VORPDrm
, VPORrm
)
66 ENTRY(VORPSrr
, VORPDrr
, VPORrr
)
67 ENTRY(VXORPSrm
, VXORPDrm
, VPXORrm
)
68 ENTRY(VXORPSrr
, VXORPDrr
, VPXORrr
)
69 ENTRY(VUNPCKLPDrm
, VUNPCKLPDrm
, VPUNPCKLQDQrm
)
70 ENTRY(VMOVLHPSrr
, VUNPCKLPDrr
, VPUNPCKLQDQrr
)
71 ENTRY(VUNPCKHPDrm
, VUNPCKHPDrm
, VPUNPCKHQDQrm
)
72 ENTRY(VUNPCKHPDrr
, VUNPCKHPDrr
, VPUNPCKHQDQrr
)
73 ENTRY(VUNPCKLPSrm
, VUNPCKLPSrm
, VPUNPCKLDQrm
)
74 ENTRY(VUNPCKLPSrr
, VUNPCKLPSrr
, VPUNPCKLDQrr
)
75 ENTRY(VUNPCKHPSrm
, VUNPCKHPSrm
, VPUNPCKHDQrm
)
76 ENTRY(VUNPCKHPSrr
, VUNPCKHPSrr
, VPUNPCKHDQrr
)
77 ENTRY(VEXTRACTPSmri
, VEXTRACTPSmri
, VPEXTRDmri
)
78 ENTRY(VEXTRACTPSrri
, VEXTRACTPSrri
, VPEXTRDrri
)
79 // AVX
256-bit support
80 ENTRY(VMOVAPSYmr
, VMOVAPDYmr
, VMOVDQAYmr
)
81 ENTRY(VMOVAPSYrm
, VMOVAPDYrm
, VMOVDQAYrm
)
82 ENTRY(VMOVAPSYrr
, VMOVAPDYrr
, VMOVDQAYrr
)
83 ENTRY(VMOVUPSYmr
, VMOVUPDYmr
, VMOVDQUYmr
)
84 ENTRY(VMOVUPSYrm
, VMOVUPDYrm
, VMOVDQUYrm
)
85 ENTRY(VMOVNTPSYmr
, VMOVNTPDYmr
, VMOVNTDQYmr
)
86 ENTRY(VPERMPSYrm
, VPERMPSYrm
, VPERMDYrm
)
87 ENTRY(VPERMPSYrr
, VPERMPSYrr
, VPERMDYrr
)
88 ENTRY(VPERMPDYmi
, VPERMPDYmi
, VPERMQYmi
)
89 ENTRY(VPERMPDYri
, VPERMPDYri
, VPERMQYri
)
91 ENTRY(VMOVLPSZ128mr
, VMOVLPDZ128mr
, VMOVPQI2QIZmr
)
92 ENTRY(VMOVNTPSZ128mr
, VMOVNTPDZ128mr
, VMOVNTDQZ128mr
)
93 ENTRY(VMOVNTPSZ256mr
, VMOVNTPDZ256mr
, VMOVNTDQZ256mr
)
94 ENTRY(VMOVNTPSZmr
, VMOVNTPDZmr
, VMOVNTDQZmr
)
95 ENTRY(VMOVSDZmr
, VMOVSDZmr
, VMOVPQI2QIZmr
)
96 ENTRY(VMOVSSZmr
, VMOVSSZmr
, VMOVPDI2DIZmr
)
97 ENTRY(VMOVSDZrm
, VMOVSDZrm
, VMOVQI2PQIZrm
)
98 ENTRY(VMOVSDZrm_alt
, VMOVSDZrm_alt
, VMOVQI2PQIZrm
)
99 ENTRY(VMOVSSZrm
, VMOVSSZrm
, VMOVDI2PDIZrm
)
100 ENTRY(VMOVSSZrm_alt
, VMOVSSZrm_alt
, VMOVDI2PDIZrm
)
101 ENTRY(VBROADCASTSSZ128rr
, VBROADCASTSSZ128rr
, VPBROADCASTDZ128rr
)
102 ENTRY(VBROADCASTSSZ128rm
, VBROADCASTSSZ128rm
, VPBROADCASTDZ128rm
)
103 ENTRY(VBROADCASTSSZ256rr
, VBROADCASTSSZ256rr
, VPBROADCASTDZ256rr
)
104 ENTRY(VBROADCASTSSZ256rm
, VBROADCASTSSZ256rm
, VPBROADCASTDZ256rm
)
105 ENTRY(VBROADCASTSSZrr
, VBROADCASTSSZrr
, VPBROADCASTDZrr
)
106 ENTRY(VBROADCASTSSZrm
, VBROADCASTSSZrm
, VPBROADCASTDZrm
)
107 ENTRY(VMOVDDUPZ128rr
, VMOVDDUPZ128rr
, VPBROADCASTQZ128rr
)
108 ENTRY(VMOVDDUPZ128rm
, VMOVDDUPZ128rm
, VPBROADCASTQZ128rm
)
109 ENTRY(VBROADCASTSDZ256rr
, VBROADCASTSDZ256rr
, VPBROADCASTQZ256rr
)
110 ENTRY(VBROADCASTSDZ256rm
, VBROADCASTSDZ256rm
, VPBROADCASTQZ256rm
)
111 ENTRY(VBROADCASTSDZrr
, VBROADCASTSDZrr
, VPBROADCASTQZrr
)
112 ENTRY(VBROADCASTSDZrm
, VBROADCASTSDZrm
, VPBROADCASTQZrm
)
113 ENTRY(VINSERTF32X4Zrri
, VINSERTF32X4Zrri
, VINSERTI32X4Zrri
)
114 ENTRY(VINSERTF32X4Zrmi
, VINSERTF32X4Zrmi
, VINSERTI32X4Zrmi
)
115 ENTRY(VINSERTF32X8Zrri
, VINSERTF32X8Zrri
, VINSERTI32X8Zrri
)
116 ENTRY(VINSERTF32X8Zrmi
, VINSERTF32X8Zrmi
, VINSERTI32X8Zrmi
)
117 ENTRY(VINSERTF64X2Zrri
, VINSERTF64X2Zrri
, VINSERTI64X2Zrri
)
118 ENTRY(VINSERTF64X2Zrmi
, VINSERTF64X2Zrmi
, VINSERTI64X2Zrmi
)
119 ENTRY(VINSERTF64X4Zrri
, VINSERTF64X4Zrri
, VINSERTI64X4Zrri
)
120 ENTRY(VINSERTF64X4Zrmi
, VINSERTF64X4Zrmi
, VINSERTI64X4Zrmi
)
121 ENTRY(VINSERTF32X4Z256rri
, VINSERTF32X4Z256rri
, VINSERTI32X4Z256rri
)
122 ENTRY(VINSERTF32X4Z256rmi
, VINSERTF32X4Z256rmi
, VINSERTI32X4Z256rmi
)
123 ENTRY(VINSERTF64X2Z256rri
, VINSERTF64X2Z256rri
, VINSERTI64X2Z256rri
)
124 ENTRY(VINSERTF64X2Z256rmi
, VINSERTF64X2Z256rmi
, VINSERTI64X2Z256rmi
)
125 ENTRY(VEXTRACTF32X4Zrri
, VEXTRACTF32X4Zrri
, VEXTRACTI32X4Zrri
)
126 ENTRY(VEXTRACTF32X4Zmri
, VEXTRACTF32X4Zmri
, VEXTRACTI32X4Zmri
)
127 ENTRY(VEXTRACTF32X8Zrri
, VEXTRACTF32X8Zrri
, VEXTRACTI32X8Zrri
)
128 ENTRY(VEXTRACTF32X8Zmri
, VEXTRACTF32X8Zmri
, VEXTRACTI32X8Zmri
)
129 ENTRY(VEXTRACTF64X2Zrri
, VEXTRACTF64X2Zrri
, VEXTRACTI64X2Zrri
)
130 ENTRY(VEXTRACTF64X2Zmri
, VEXTRACTF64X2Zmri
, VEXTRACTI64X2Zmri
)
131 ENTRY(VEXTRACTF64X4Zrri
, VEXTRACTF64X4Zrri
, VEXTRACTI64X4Zrri
)
132 ENTRY(VEXTRACTF64X4Zmri
, VEXTRACTF64X4Zmri
, VEXTRACTI64X4Zmri
)
133 ENTRY(VEXTRACTF32X4Z256rri
, VEXTRACTF32X4Z256rri
, VEXTRACTI32X4Z256rri
)
134 ENTRY(VEXTRACTF32X4Z256mri
, VEXTRACTF32X4Z256mri
, VEXTRACTI32X4Z256mri
)
135 ENTRY(VEXTRACTF64X2Z256rri
, VEXTRACTF64X2Z256rri
, VEXTRACTI64X2Z256rri
)
136 ENTRY(VEXTRACTF64X2Z256mri
, VEXTRACTF64X2Z256mri
, VEXTRACTI64X2Z256mri
)
137 ENTRY(VPERMILPSmi
, VPERMILPSmi
, VPSHUFDmi
)
138 ENTRY(VPERMILPSri
, VPERMILPSri
, VPSHUFDri
)
139 ENTRY(VPERMILPSZ128mi
, VPERMILPSZ128mi
, VPSHUFDZ128mi
)
140 ENTRY(VPERMILPSZ128ri
, VPERMILPSZ128ri
, VPSHUFDZ128ri
)
141 ENTRY(VPERMILPSZ256mi
, VPERMILPSZ256mi
, VPSHUFDZ256mi
)
142 ENTRY(VPERMILPSZ256ri
, VPERMILPSZ256ri
, VPSHUFDZ256ri
)
143 ENTRY(VPERMILPSZmi
, VPERMILPSZmi
, VPSHUFDZmi
)
144 ENTRY(VPERMILPSZri
, VPERMILPSZri
, VPSHUFDZri
)
145 ENTRY(VPERMPSZ256rm
, VPERMPSZ256rm
, VPERMDZ256rm
)
146 ENTRY(VPERMPSZ256rr
, VPERMPSZ256rr
, VPERMDZ256rr
)
147 ENTRY(VPERMPDZ256mi
, VPERMPDZ256mi
, VPERMQZ256mi
)
148 ENTRY(VPERMPDZ256ri
, VPERMPDZ256ri
, VPERMQZ256ri
)
149 ENTRY(VPERMPDZ256rm
, VPERMPDZ256rm
, VPERMQZ256rm
)
150 ENTRY(VPERMPDZ256rr
, VPERMPDZ256rr
, VPERMQZ256rr
)
151 ENTRY(VPERMPSZrm
, VPERMPSZrm
, VPERMDZrm
)
152 ENTRY(VPERMPSZrr
, VPERMPSZrr
, VPERMDZrr
)
153 ENTRY(VPERMPDZmi
, VPERMPDZmi
, VPERMQZmi
)
154 ENTRY(VPERMPDZri
, VPERMPDZri
, VPERMQZri
)
155 ENTRY(VPERMPDZrm
, VPERMPDZrm
, VPERMQZrm
)
156 ENTRY(VPERMPDZrr
, VPERMPDZrr
, VPERMQZrr
)
157 ENTRY(VUNPCKLPDZ256rm
, VUNPCKLPDZ256rm
, VPUNPCKLQDQZ256rm
)
158 ENTRY(VUNPCKLPDZ256rr
, VUNPCKLPDZ256rr
, VPUNPCKLQDQZ256rr
)
159 ENTRY(VUNPCKHPDZ256rm
, VUNPCKHPDZ256rm
, VPUNPCKHQDQZ256rm
)
160 ENTRY(VUNPCKHPDZ256rr
, VUNPCKHPDZ256rr
, VPUNPCKHQDQZ256rr
)
161 ENTRY(VUNPCKLPSZ256rm
, VUNPCKLPSZ256rm
, VPUNPCKLDQZ256rm
)
162 ENTRY(VUNPCKLPSZ256rr
, VUNPCKLPSZ256rr
, VPUNPCKLDQZ256rr
)
163 ENTRY(VUNPCKHPSZ256rm
, VUNPCKHPSZ256rm
, VPUNPCKHDQZ256rm
)
164 ENTRY(VUNPCKHPSZ256rr
, VUNPCKHPSZ256rr
, VPUNPCKHDQZ256rr
)
165 ENTRY(VUNPCKLPDZ128rm
, VUNPCKLPDZ128rm
, VPUNPCKLQDQZ128rm
)
166 ENTRY(VMOVLHPSZrr
, VUNPCKLPDZ128rr
, VPUNPCKLQDQZ128rr
)
167 ENTRY(VUNPCKHPDZ128rm
, VUNPCKHPDZ128rm
, VPUNPCKHQDQZ128rm
)
168 ENTRY(VUNPCKHPDZ128rr
, VUNPCKHPDZ128rr
, VPUNPCKHQDQZ128rr
)
169 ENTRY(VUNPCKLPSZ128rm
, VUNPCKLPSZ128rm
, VPUNPCKLDQZ128rm
)
170 ENTRY(VUNPCKLPSZ128rr
, VUNPCKLPSZ128rr
, VPUNPCKLDQZ128rr
)
171 ENTRY(VUNPCKHPSZ128rm
, VUNPCKHPSZ128rm
, VPUNPCKHDQZ128rm
)
172 ENTRY(VUNPCKHPSZ128rr
, VUNPCKHPSZ128rr
, VPUNPCKHDQZ128rr
)
173 ENTRY(VUNPCKLPDZrm
, VUNPCKLPDZrm
, VPUNPCKLQDQZrm
)
174 ENTRY(VUNPCKLPDZrr
, VUNPCKLPDZrr
, VPUNPCKLQDQZrr
)
175 ENTRY(VUNPCKHPDZrm
, VUNPCKHPDZrm
, VPUNPCKHQDQZrm
)
176 ENTRY(VUNPCKHPDZrr
, VUNPCKHPDZrr
, VPUNPCKHQDQZrr
)
177 ENTRY(VUNPCKLPSZrm
, VUNPCKLPSZrm
, VPUNPCKLDQZrm
)
178 ENTRY(VUNPCKLPSZrr
, VUNPCKLPSZrr
, VPUNPCKLDQZrr
)
179 ENTRY(VUNPCKHPSZrm
, VUNPCKHPSZrm
, VPUNPCKHDQZrm
)
180 ENTRY(VUNPCKHPSZrr
, VUNPCKHPSZrr
, VPUNPCKHDQZrr
)
181 ENTRY(VEXTRACTPSZmri
, VEXTRACTPSZmri
, VPEXTRDZmri
)
182 ENTRY(VEXTRACTPSZrri
, VEXTRACTPSZrri
, VPEXTRDZrri
)
185 static const uint16_t ReplaceableInstrsAVX2
[][3] = {
186 // PackedSingle
, PackedDouble
, PackedInt
187 ENTRY(VANDNPSYrm
, VANDNPDYrm
, VPANDNYrm
)
188 ENTRY(VANDNPSYrr
, VANDNPDYrr
, VPANDNYrr
)
189 ENTRY(VANDPSYrm
, VANDPDYrm
, VPANDYrm
)
190 ENTRY(VANDPSYrr
, VANDPDYrr
, VPANDYrr
)
191 ENTRY(VORPSYrm
, VORPDYrm
, VPORYrm
)
192 ENTRY(VORPSYrr
, VORPDYrr
, VPORYrr
)
193 ENTRY(VXORPSYrm
, VXORPDYrm
, VPXORYrm
)
194 ENTRY(VXORPSYrr
, VXORPDYrr
, VPXORYrr
)
195 ENTRY(VPERM2F128rmi
, VPERM2F128rmi
, VPERM2I128rmi
)
196 ENTRY(VPERM2F128rri
, VPERM2F128rri
, VPERM2I128rri
)
197 ENTRY(VBROADCASTSSrm
, VBROADCASTSSrm
, VPBROADCASTDrm
)
198 ENTRY(VBROADCASTSSrr
, VBROADCASTSSrr
, VPBROADCASTDrr
)
199 ENTRY(VMOVDDUPrm
, VMOVDDUPrm
, VPBROADCASTQrm
)
200 ENTRY(VMOVDDUPrr
, VMOVDDUPrr
, VPBROADCASTQrr
)
201 ENTRY(VBROADCASTSSYrr
, VBROADCASTSSYrr
, VPBROADCASTDYrr
)
202 ENTRY(VBROADCASTSSYrm
, VBROADCASTSSYrm
, VPBROADCASTDYrm
)
203 ENTRY(VBROADCASTSDYrr
, VBROADCASTSDYrr
, VPBROADCASTQYrr
)
204 ENTRY(VBROADCASTSDYrm
, VBROADCASTSDYrm
, VPBROADCASTQYrm
)
205 ENTRY(VBROADCASTF128rm
, VBROADCASTF128rm
, VBROADCASTI128rm
)
206 ENTRY(VBLENDPSYrri
, VBLENDPSYrri
, VPBLENDDYrri
)
207 ENTRY(VBLENDPSYrmi
, VBLENDPSYrmi
, VPBLENDDYrmi
)
208 ENTRY(VPERMILPSYmi
, VPERMILPSYmi
, VPSHUFDYmi
)
209 ENTRY(VPERMILPSYri
, VPERMILPSYri
, VPSHUFDYri
)
210 ENTRY(VUNPCKLPDYrm
, VUNPCKLPDYrm
, VPUNPCKLQDQYrm
)
211 ENTRY(VUNPCKLPDYrr
, VUNPCKLPDYrr
, VPUNPCKLQDQYrr
)
212 ENTRY(VUNPCKHPDYrm
, VUNPCKHPDYrm
, VPUNPCKHQDQYrm
)
213 ENTRY(VUNPCKHPDYrr
, VUNPCKHPDYrr
, VPUNPCKHQDQYrr
)
214 ENTRY(VUNPCKLPSYrm
, VUNPCKLPSYrm
, VPUNPCKLDQYrm
)
215 ENTRY(VUNPCKLPSYrr
, VUNPCKLPSYrr
, VPUNPCKLDQYrr
)
216 ENTRY(VUNPCKHPSYrm
, VUNPCKHPSYrm
, VPUNPCKHDQYrm
)
217 ENTRY(VUNPCKHPSYrr
, VUNPCKHPSYrr
, VPUNPCKHDQYrr
)
220 static const uint16_t ReplaceableInstrsFP
[][3] = {
221 // PackedSingle
, PackedDouble
222 ENTRY(MOVLPSrm
, MOVLPDrm
, INSTRUCTION_LIST_END
)
223 ENTRY(MOVHPSrm
, MOVHPDrm
, INSTRUCTION_LIST_END
)
224 ENTRY(MOVHPSmr
, MOVHPDmr
, INSTRUCTION_LIST_END
)
225 ENTRY(VMOVLPSrm
, VMOVLPDrm
, INSTRUCTION_LIST_END
)
226 ENTRY(VMOVHPSrm
, VMOVHPDrm
, INSTRUCTION_LIST_END
)
227 ENTRY(VMOVHPSmr
, VMOVHPDmr
, INSTRUCTION_LIST_END
)
228 ENTRY(VMOVLPSZ128rm
, VMOVLPDZ128rm
, INSTRUCTION_LIST_END
)
229 ENTRY(VMOVHPSZ128rm
, VMOVHPDZ128rm
, INSTRUCTION_LIST_END
)
230 ENTRY(VMOVHPSZ128mr
, VMOVHPDZ128mr
, INSTRUCTION_LIST_END
)
233 static const uint16_t ReplaceableInstrsAVX2InsertExtract
[][3] = {
234 // PackedSingle
, PackedDouble
, PackedInt
235 ENTRY(VEXTRACTF128mri
, VEXTRACTF128mri
, VEXTRACTI128mri
)
236 ENTRY(VEXTRACTF128rri
, VEXTRACTF128rri
, VEXTRACTI128rri
)
237 ENTRY(VINSERTF128rmi
, VINSERTF128rmi
, VINSERTI128rmi
)
238 ENTRY(VINSERTF128rri
, VINSERTF128rri
, VINSERTI128rri
)
241 // NOTE
: These should only be used by the custom domain methods.
242 static const uint16_t ReplaceableBlendInstrs
[][3] = {
243 //PackedSingle
, PackedDouble
, PackedInt
244 ENTRY(BLENDPSrmi
, BLENDPDrmi
, PBLENDWrmi
)
245 ENTRY(BLENDPSrri
, BLENDPDrri
, PBLENDWrri
)
246 ENTRY(VBLENDPSrmi
, VBLENDPDrmi
, VPBLENDWrmi
)
247 ENTRY(VBLENDPSrri
, VBLENDPDrri
, VPBLENDWrri
)
248 ENTRY(VBLENDPSYrmi
, VBLENDPDYrmi
, VPBLENDWYrmi
)
249 ENTRY(VBLENDPSYrri
, VBLENDPDYrri
, VPBLENDWYrri
)
252 static const uint16_t ReplaceableBlendAVX2Instrs
[][3] = {
253 // PackedSingle
, PackedDouble
, PackedInt
254 ENTRY(VBLENDPSrmi
, VBLENDPDrmi
, VPBLENDDrmi
)
255 ENTRY(VBLENDPSrri
, VBLENDPDrri
, VPBLENDDrri
)
256 ENTRY(VBLENDPSYrmi
, VBLENDPDYrmi
, VPBLENDDYrmi
)
257 ENTRY(VBLENDPSYrri
, VBLENDPDYrri
, VPBLENDDYrri
)
261 #define
ENTRY(A
, B
, C
, D
) {X86
::A
, X86
::B
, X86
::C
, X86
::D
},
262 static const uint16_t ReplaceableInstrsAVX512
[][4] = {
263 // Two integer columns for
64-bit and
32-bit elements.
264 //PackedSingle
, PackedDouble
, PackedInt
, PackedInt
265 ENTRY(VMOVAPSZ128mr
, VMOVAPDZ128mr
, VMOVDQA64Z128mr
, VMOVDQA32Z128mr
)
266 ENTRY(VMOVAPSZ128rm
, VMOVAPDZ128rm
, VMOVDQA64Z128rm
, VMOVDQA32Z128rm
)
267 ENTRY(VMOVAPSZ128rr
, VMOVAPDZ128rr
, VMOVDQA64Z128rr
, VMOVDQA32Z128rr
)
268 ENTRY(VMOVUPSZ128mr
, VMOVUPDZ128mr
, VMOVDQU64Z128mr
, VMOVDQU32Z128mr
)
269 ENTRY(VMOVUPSZ128rm
, VMOVUPDZ128rm
, VMOVDQU64Z128rm
, VMOVDQU32Z128rm
)
270 ENTRY(VMOVAPSZ256mr
, VMOVAPDZ256mr
, VMOVDQA64Z256mr
, VMOVDQA32Z256mr
)
271 ENTRY(VMOVAPSZ256rm
, VMOVAPDZ256rm
, VMOVDQA64Z256rm
, VMOVDQA32Z256rm
)
272 ENTRY(VMOVAPSZ256rr
, VMOVAPDZ256rr
, VMOVDQA64Z256rr
, VMOVDQA32Z256rr
)
273 ENTRY(VMOVUPSZ256mr
, VMOVUPDZ256mr
, VMOVDQU64Z256mr
, VMOVDQU32Z256mr
)
274 ENTRY(VMOVUPSZ256rm
, VMOVUPDZ256rm
, VMOVDQU64Z256rm
, VMOVDQU32Z256rm
)
275 ENTRY(VMOVAPSZmr
, VMOVAPDZmr
, VMOVDQA64Zmr
, VMOVDQA32Zmr
)
276 ENTRY(VMOVAPSZrm
, VMOVAPDZrm
, VMOVDQA64Zrm
, VMOVDQA32Zrm
)
277 ENTRY(VMOVAPSZrr
, VMOVAPDZrr
, VMOVDQA64Zrr
, VMOVDQA32Zrr
)
278 ENTRY(VMOVUPSZmr
, VMOVUPDZmr
, VMOVDQU64Zmr
, VMOVDQU32Zmr
)
279 ENTRY(VMOVUPSZrm
, VMOVUPDZrm
, VMOVDQU64Zrm
, VMOVDQU32Zrm
)
282 static const uint16_t ReplaceableInstrsAVX512DQ
[][4] = {
283 // Two integer columns for
64-bit and
32-bit elements.
284 // PackedSingle
, PackedDouble
, PackedInt
, PackedInt
285 ENTRY(VANDNPSZ128rm
, VANDNPDZ128rm
, VPANDNQZ128rm
, VPANDNDZ128rm
)
286 ENTRY(VANDNPSZ128rr
, VANDNPDZ128rr
, VPANDNQZ128rr
, VPANDNDZ128rr
)
287 ENTRY(VANDPSZ128rm
, VANDPDZ128rm
, VPANDQZ128rm
, VPANDDZ128rm
)
288 ENTRY(VANDPSZ128rr
, VANDPDZ128rr
, VPANDQZ128rr
, VPANDDZ128rr
)
289 ENTRY(VORPSZ128rm
, VORPDZ128rm
, VPORQZ128rm
, VPORDZ128rm
)
290 ENTRY(VORPSZ128rr
, VORPDZ128rr
, VPORQZ128rr
, VPORDZ128rr
)
291 ENTRY(VXORPSZ128rm
, VXORPDZ128rm
, VPXORQZ128rm
, VPXORDZ128rm
)
292 ENTRY(VXORPSZ128rr
, VXORPDZ128rr
, VPXORQZ128rr
, VPXORDZ128rr
)
293 ENTRY(VANDNPSZ256rm
, VANDNPDZ256rm
, VPANDNQZ256rm
, VPANDNDZ256rm
)
294 ENTRY(VANDNPSZ256rr
, VANDNPDZ256rr
, VPANDNQZ256rr
, VPANDNDZ256rr
)
295 ENTRY(VANDPSZ256rm
, VANDPDZ256rm
, VPANDQZ256rm
, VPANDDZ256rm
)
296 ENTRY(VANDPSZ256rr
, VANDPDZ256rr
, VPANDQZ256rr
, VPANDDZ256rr
)
297 ENTRY(VORPSZ256rm
, VORPDZ256rm
, VPORQZ256rm
, VPORDZ256rm
)
298 ENTRY(VORPSZ256rr
, VORPDZ256rr
, VPORQZ256rr
, VPORDZ256rr
)
299 ENTRY(VXORPSZ256rm
, VXORPDZ256rm
, VPXORQZ256rm
, VPXORDZ256rm
)
300 ENTRY(VXORPSZ256rr
, VXORPDZ256rr
, VPXORQZ256rr
, VPXORDZ256rr
)
301 ENTRY(VANDNPSZrm
, VANDNPDZrm
, VPANDNQZrm
, VPANDNDZrm
)
302 ENTRY(VANDNPSZrr
, VANDNPDZrr
, VPANDNQZrr
, VPANDNDZrr
)
303 ENTRY(VANDPSZrm
, VANDPDZrm
, VPANDQZrm
, VPANDDZrm
)
304 ENTRY(VANDPSZrr
, VANDPDZrr
, VPANDQZrr
, VPANDDZrr
)
305 ENTRY(VORPSZrm
, VORPDZrm
, VPORQZrm
, VPORDZrm
)
306 ENTRY(VORPSZrr
, VORPDZrr
, VPORQZrr
, VPORDZrr
)
307 ENTRY(VXORPSZrm
, VXORPDZrm
, VPXORQZrm
, VPXORDZrm
)
308 ENTRY(VXORPSZrr
, VXORPDZrr
, VPXORQZrr
, VPXORDZrr
)
311 static const uint16_t ReplaceableInstrsAVX512DQMasked
[][4] = {
312 // Two integer columns for
64-bit and
32-bit elements.
313 // PackedSingle
, PackedDouble
, PackedInt
, PackedInt
314 ENTRY(VANDNPSZ128rmk
, VANDNPDZ128rmk
, VPANDNQZ128rmk
, VPANDNDZ128rmk
)
315 ENTRY(VANDNPSZ128rmkz
, VANDNPDZ128rmkz
, VPANDNQZ128rmkz
, VPANDNDZ128rmkz
)
316 ENTRY(VANDNPSZ128rrk
, VANDNPDZ128rrk
, VPANDNQZ128rrk
, VPANDNDZ128rrk
)
317 ENTRY(VANDNPSZ128rrkz
, VANDNPDZ128rrkz
, VPANDNQZ128rrkz
, VPANDNDZ128rrkz
)
318 ENTRY(VANDPSZ128rmk
, VANDPDZ128rmk
, VPANDQZ128rmk
, VPANDDZ128rmk
)
319 ENTRY(VANDPSZ128rmkz
, VANDPDZ128rmkz
, VPANDQZ128rmkz
, VPANDDZ128rmkz
)
320 ENTRY(VANDPSZ128rrk
, VANDPDZ128rrk
, VPANDQZ128rrk
, VPANDDZ128rrk
)
321 ENTRY(VANDPSZ128rrkz
, VANDPDZ128rrkz
, VPANDQZ128rrkz
, VPANDDZ128rrkz
)
322 ENTRY(VORPSZ128rmk
, VORPDZ128rmk
, VPORQZ128rmk
, VPORDZ128rmk
)
323 ENTRY(VORPSZ128rmkz
, VORPDZ128rmkz
, VPORQZ128rmkz
, VPORDZ128rmkz
)
324 ENTRY(VORPSZ128rrk
, VORPDZ128rrk
, VPORQZ128rrk
, VPORDZ128rrk
)
325 ENTRY(VORPSZ128rrkz
, VORPDZ128rrkz
, VPORQZ128rrkz
, VPORDZ128rrkz
)
326 ENTRY(VXORPSZ128rmk
, VXORPDZ128rmk
, VPXORQZ128rmk
, VPXORDZ128rmk
)
327 ENTRY(VXORPSZ128rmkz
, VXORPDZ128rmkz
, VPXORQZ128rmkz
, VPXORDZ128rmkz
)
328 ENTRY(VXORPSZ128rrk
, VXORPDZ128rrk
, VPXORQZ128rrk
, VPXORDZ128rrk
)
329 ENTRY(VXORPSZ128rrkz
, VXORPDZ128rrkz
, VPXORQZ128rrkz
, VPXORDZ128rrkz
)
330 ENTRY(VANDNPSZ256rmk
, VANDNPDZ256rmk
, VPANDNQZ256rmk
, VPANDNDZ256rmk
)
331 ENTRY(VANDNPSZ256rmkz
, VANDNPDZ256rmkz
, VPANDNQZ256rmkz
, VPANDNDZ256rmkz
)
332 ENTRY(VANDNPSZ256rrk
, VANDNPDZ256rrk
, VPANDNQZ256rrk
, VPANDNDZ256rrk
)
333 ENTRY(VANDNPSZ256rrkz
, VANDNPDZ256rrkz
, VPANDNQZ256rrkz
, VPANDNDZ256rrkz
)
334 ENTRY(VANDPSZ256rmk
, VANDPDZ256rmk
, VPANDQZ256rmk
, VPANDDZ256rmk
)
335 ENTRY(VANDPSZ256rmkz
, VANDPDZ256rmkz
, VPANDQZ256rmkz
, VPANDDZ256rmkz
)
336 ENTRY(VANDPSZ256rrk
, VANDPDZ256rrk
, VPANDQZ256rrk
, VPANDDZ256rrk
)
337 ENTRY(VANDPSZ256rrkz
, VANDPDZ256rrkz
, VPANDQZ256rrkz
, VPANDDZ256rrkz
)
338 ENTRY(VORPSZ256rmk
, VORPDZ256rmk
, VPORQZ256rmk
, VPORDZ256rmk
)
339 ENTRY(VORPSZ256rmkz
, VORPDZ256rmkz
, VPORQZ256rmkz
, VPORDZ256rmkz
)
340 ENTRY(VORPSZ256rrk
, VORPDZ256rrk
, VPORQZ256rrk
, VPORDZ256rrk
)
341 ENTRY(VORPSZ256rrkz
, VORPDZ256rrkz
, VPORQZ256rrkz
, VPORDZ256rrkz
)
342 ENTRY(VXORPSZ256rmk
, VXORPDZ256rmk
, VPXORQZ256rmk
, VPXORDZ256rmk
)
343 ENTRY(VXORPSZ256rmkz
, VXORPDZ256rmkz
, VPXORQZ256rmkz
, VPXORDZ256rmkz
)
344 ENTRY(VXORPSZ256rrk
, VXORPDZ256rrk
, VPXORQZ256rrk
, VPXORDZ256rrk
)
345 ENTRY(VXORPSZ256rrkz
, VXORPDZ256rrkz
, VPXORQZ256rrkz
, VPXORDZ256rrkz
)
346 ENTRY(VANDNPSZrmk
, VANDNPDZrmk
, VPANDNQZrmk
, VPANDNDZrmk
)
347 ENTRY(VANDNPSZrmkz
, VANDNPDZrmkz
, VPANDNQZrmkz
, VPANDNDZrmkz
)
348 ENTRY(VANDNPSZrrk
, VANDNPDZrrk
, VPANDNQZrrk
, VPANDNDZrrk
)
349 ENTRY(VANDNPSZrrkz
, VANDNPDZrrkz
, VPANDNQZrrkz
, VPANDNDZrrkz
)
350 ENTRY(VANDPSZrmk
, VANDPDZrmk
, VPANDQZrmk
, VPANDDZrmk
)
351 ENTRY(VANDPSZrmkz
, VANDPDZrmkz
, VPANDQZrmkz
, VPANDDZrmkz
)
352 ENTRY(VANDPSZrrk
, VANDPDZrrk
, VPANDQZrrk
, VPANDDZrrk
)
353 ENTRY(VANDPSZrrkz
, VANDPDZrrkz
, VPANDQZrrkz
, VPANDDZrrkz
)
354 ENTRY(VORPSZrmk
, VORPDZrmk
, VPORQZrmk
, VPORDZrmk
)
355 ENTRY(VORPSZrmkz
, VORPDZrmkz
, VPORQZrmkz
, VPORDZrmkz
)
356 ENTRY(VORPSZrrk
, VORPDZrrk
, VPORQZrrk
, VPORDZrrk
)
357 ENTRY(VORPSZrrkz
, VORPDZrrkz
, VPORQZrrkz
, VPORDZrrkz
)
358 ENTRY(VXORPSZrmk
, VXORPDZrmk
, VPXORQZrmk
, VPXORDZrmk
)
359 ENTRY(VXORPSZrmkz
, VXORPDZrmkz
, VPXORQZrmkz
, VPXORDZrmkz
)
360 ENTRY(VXORPSZrrk
, VXORPDZrrk
, VPXORQZrrk
, VPXORDZrrk
)
361 ENTRY(VXORPSZrrkz
, VXORPDZrrkz
, VPXORQZrrkz
, VPXORDZrrkz
)
362 // Broadcast loads can be handled the same as masked operations to avoid
363 // changing element size.
364 ENTRY(VANDNPSZ128rmb
, VANDNPDZ128rmb
, VPANDNQZ128rmb
, VPANDNDZ128rmb
)
365 ENTRY(VANDPSZ128rmb
, VANDPDZ128rmb
, VPANDQZ128rmb
, VPANDDZ128rmb
)
366 ENTRY(VORPSZ128rmb
, VORPDZ128rmb
, VPORQZ128rmb
, VPORDZ128rmb
)
367 ENTRY(VXORPSZ128rmb
, VXORPDZ128rmb
, VPXORQZ128rmb
, VPXORDZ128rmb
)
368 ENTRY(VANDNPSZ256rmb
, VANDNPDZ256rmb
, VPANDNQZ256rmb
, VPANDNDZ256rmb
)
369 ENTRY(VANDPSZ256rmb
, VANDPDZ256rmb
, VPANDQZ256rmb
, VPANDDZ256rmb
)
370 ENTRY(VORPSZ256rmb
, VORPDZ256rmb
, VPORQZ256rmb
, VPORDZ256rmb
)
371 ENTRY(VXORPSZ256rmb
, VXORPDZ256rmb
, VPXORQZ256rmb
, VPXORDZ256rmb
)
372 ENTRY(VANDNPSZrmb
, VANDNPDZrmb
, VPANDNQZrmb
, VPANDNDZrmb
)
373 ENTRY(VANDPSZrmb
, VANDPDZrmb
, VPANDQZrmb
, VPANDDZrmb
)
374 ENTRY(VANDPSZrmb
, VANDPDZrmb
, VPANDQZrmb
, VPANDDZrmb
)
375 ENTRY(VORPSZrmb
, VORPDZrmb
, VPORQZrmb
, VPORDZrmb
)
376 ENTRY(VXORPSZrmb
, VXORPDZrmb
, VPXORQZrmb
, VPXORDZrmb
)
377 ENTRY(VANDNPSZ128rmbk
, VANDNPDZ128rmbk
, VPANDNQZ128rmbk
, VPANDNDZ128rmbk
)
378 ENTRY(VANDPSZ128rmbk
, VANDPDZ128rmbk
, VPANDQZ128rmbk
, VPANDDZ128rmbk
)
379 ENTRY(VORPSZ128rmbk
, VORPDZ128rmbk
, VPORQZ128rmbk
, VPORDZ128rmbk
)
380 ENTRY(VXORPSZ128rmbk
, VXORPDZ128rmbk
, VPXORQZ128rmbk
, VPXORDZ128rmbk
)
381 ENTRY(VANDNPSZ256rmbk
, VANDNPDZ256rmbk
, VPANDNQZ256rmbk
, VPANDNDZ256rmbk
)
382 ENTRY(VANDPSZ256rmbk
, VANDPDZ256rmbk
, VPANDQZ256rmbk
, VPANDDZ256rmbk
)
383 ENTRY(VORPSZ256rmbk
, VORPDZ256rmbk
, VPORQZ256rmbk
, VPORDZ256rmbk
)
384 ENTRY(VXORPSZ256rmbk
, VXORPDZ256rmbk
, VPXORQZ256rmbk
, VPXORDZ256rmbk
)
385 ENTRY(VANDNPSZrmbk
, VANDNPDZrmbk
, VPANDNQZrmbk
, VPANDNDZrmbk
)
386 ENTRY(VANDPSZrmbk
, VANDPDZrmbk
, VPANDQZrmbk
, VPANDDZrmbk
)
387 ENTRY(VANDPSZrmbk
, VANDPDZrmbk
, VPANDQZrmbk
, VPANDDZrmbk
)
388 ENTRY(VORPSZrmbk
, VORPDZrmbk
, VPORQZrmbk
, VPORDZrmbk
)
389 ENTRY(VXORPSZrmbk
, VXORPDZrmbk
, VPXORQZrmbk
, VPXORDZrmbk
)
390 ENTRY(VANDNPSZ128rmbkz
, VANDNPDZ128rmbkz
, VPANDNQZ128rmbkz
, VPANDNDZ128rmbkz
)
391 ENTRY(VANDPSZ128rmbkz
, VANDPDZ128rmbkz
, VPANDQZ128rmbkz
, VPANDDZ128rmbkz
)
392 ENTRY(VORPSZ128rmbkz
, VORPDZ128rmbkz
, VPORQZ128rmbkz
, VPORDZ128rmbkz
)
393 ENTRY(VXORPSZ128rmbkz
, VXORPDZ128rmbkz
, VPXORQZ128rmbkz
, VPXORDZ128rmbkz
)
394 ENTRY(VANDNPSZ256rmbkz
, VANDNPDZ256rmbkz
, VPANDNQZ256rmbkz
, VPANDNDZ256rmbkz
)
395 ENTRY(VANDPSZ256rmbkz
, VANDPDZ256rmbkz
, VPANDQZ256rmbkz
, VPANDDZ256rmbkz
)
396 ENTRY(VORPSZ256rmbkz
, VORPDZ256rmbkz
, VPORQZ256rmbkz
, VPORDZ256rmbkz
)
397 ENTRY(VXORPSZ256rmbkz
, VXORPDZ256rmbkz
, VPXORQZ256rmbkz
, VPXORDZ256rmbkz
)
398 ENTRY(VANDNPSZrmbkz
, VANDNPDZrmbkz
, VPANDNQZrmbkz
, VPANDNDZrmbkz
)
399 ENTRY(VANDPSZrmbkz
, VANDPDZrmbkz
, VPANDQZrmbkz
, VPANDDZrmbkz
)
400 ENTRY(VANDPSZrmbkz
, VANDPDZrmbkz
, VPANDQZrmbkz
, VPANDDZrmbkz
)
401 ENTRY(VORPSZrmbkz
, VORPDZrmbkz
, VPORQZrmbkz
, VPORDZrmbkz
)
402 ENTRY(VXORPSZrmbkz
, VXORPDZrmbkz
, VPXORQZrmbkz
, VPXORDZrmbkz
)
405 // Special table for changing EVEX logic instructions to VEX.
406 // TODO
: Should we run EVEX
->VEX earlier?
407 static const uint16_t ReplaceableCustomAVX512LogicInstrs
[][4] = {
408 // Two integer columns for
64-bit and
32-bit elements.
409 // PackedSingle
, PackedDouble
, PackedInt
, PackedInt
410 ENTRY(VANDNPSrm
, VANDNPDrm
, VPANDNQZ128rm
, VPANDNDZ128rm
)
411 ENTRY(VANDNPSrr
, VANDNPDrr
, VPANDNQZ128rr
, VPANDNDZ128rr
)
412 ENTRY(VANDPSrm
, VANDPDrm
, VPANDQZ128rm
, VPANDDZ128rm
)
413 ENTRY(VANDPSrr
, VANDPDrr
, VPANDQZ128rr
, VPANDDZ128rr
)
414 ENTRY(VORPSrm
, VORPDrm
, VPORQZ128rm
, VPORDZ128rm
)
415 ENTRY(VORPSrr
, VORPDrr
, VPORQZ128rr
, VPORDZ128rr
)
416 ENTRY(VXORPSrm
, VXORPDrm
, VPXORQZ128rm
, VPXORDZ128rm
)
417 ENTRY(VXORPSrr
, VXORPDrr
, VPXORQZ128rr
, VPXORDZ128rr
)
418 ENTRY(VANDNPSYrm
, VANDNPDYrm
, VPANDNQZ256rm
, VPANDNDZ256rm
)
419 ENTRY(VANDNPSYrr
, VANDNPDYrr
, VPANDNQZ256rr
, VPANDNDZ256rr
)
420 ENTRY(VANDPSYrm
, VANDPDYrm
, VPANDQZ256rm
, VPANDDZ256rm
)
421 ENTRY(VANDPSYrr
, VANDPDYrr
, VPANDQZ256rr
, VPANDDZ256rr
)
422 ENTRY(VORPSYrm
, VORPDYrm
, VPORQZ256rm
, VPORDZ256rm
)
423 ENTRY(VORPSYrr
, VORPDYrr
, VPORQZ256rr
, VPORDZ256rr
)
424 ENTRY(VXORPSYrm
, VXORPDYrm
, VPXORQZ256rm
, VPXORDZ256rm
)
425 ENTRY(VXORPSYrr
, VXORPDYrr
, VPXORQZ256rr
, VPXORDZ256rr
)