r600g: Compute support for Cayman
[mesa.git] / src / gallium / drivers / radeon / AMDILMultiClass.td
1 //===-- AMDILMultiClass.td - AMDIL Multiclass defs ---*- tablegen -*-------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //==-----------------------------------------------------------------------===//
9 // Multiclass that handles branch instructions
10 multiclass BranchConditional<SDNode Op> {
11 def _i8 : ILFormat<IL_OP_IFC, (outs),
12 (ins brtarget:$target, GPRI8:$src0),
13 "; i32 Pseudo branch instruction",
14 [(Op bb:$target, GPRI8:$src0)]>;
15 def _i16 : ILFormat<IL_OP_IFC, (outs),
16 (ins brtarget:$target, GPRI16:$src0),
17 "; i32 Pseudo branch instruction",
18 [(Op bb:$target, GPRI16:$src0)]>;
19 def _i32 : ILFormat<IL_OP_IFC, (outs),
20 (ins brtarget:$target, GPRI32:$src0),
21 "; i32 Pseudo branch instruction",
22 [(Op bb:$target, GPRI32:$src0)]>;
23 def _f32 : ILFormat<IL_OP_IFC, (outs),
24 (ins brtarget:$target, GPRF32:$src0),
25 "; f32 Pseudo branch instruction",
26 [(Op bb:$target, GPRF32:$src0)]>;
27 def _i64 : ILFormat<IL_OP_IFC, (outs),
28 (ins brtarget:$target, GPRI64:$src0),
29 "; f64 Pseudo branch instruction",
30 [(Op bb:$target, (i64 GPRI64:$src0))]>;
31 def _f64 : ILFormat<IL_OP_IFC, (outs),
32 (ins brtarget:$target, GPRF64:$src0),
33 "; f64 Pseudo branch instruction",
34 [(Op bb:$target, (f64 GPRF64:$src0))]>;
35 }
36 // Multiclass that handles compare instructions
37 // When a definition is added here, a corrosponding defition
38 // needs to be added at:
39 // AMDILISelLowering.cpp@EmitInstrWithCustomInserter
40 multiclass Compare<string asm> {
41 def _i8 : ILFormat<IL_OP_CMP, (outs GPRI8:$dst),
42 (ins i32imm:$cc, GPRI8:$src0, GPRI8:$src1),
43 !strconcat("; i8 ", asm),
44 [(set GPRI8:$dst, (IL_cmp imm:$cc, GPRI8:$src0, GPRI8:$src1))]>;
45 def _i16 : ILFormat<IL_OP_CMP, (outs GPRI16:$dst),
46 (ins i32imm:$cc, GPRI16:$src0, GPRI16:$src1),
47 !strconcat("; i16 ", asm),
48 [(set GPRI16:$dst, (IL_cmp imm:$cc, GPRI16:$src0, GPRI16:$src1))]>;
49 def _i32 : ILFormat<IL_OP_CMP, (outs GPRI32:$dst),
50 (ins i32imm:$cc, GPRI32:$src0, GPRI32:$src1),
51 !strconcat("; i32 ", asm),
52 [(set GPRI32:$dst, (IL_cmp imm:$cc, GPRI32:$src0, GPRI32:$src1))]>;
53 def _i64 : ILFormat<IL_OP_CMP, (outs GPRI64:$dst),
54 (ins i32imm:$cc, GPRI64:$src0, GPRI64:$src1),
55 !strconcat("; i64 ", asm),
56 [(set GPRI64:$dst, (IL_cmp imm:$cc, GPRI64:$src0, GPRI64:$src1))]>;
57 def _f32 : ILFormat<IL_OP_CMP, (outs GPRF32:$dst),
58 (ins i32imm:$cc, GPRF32:$src0, GPRF32:$src1),
59 !strconcat("; f32 ", asm),
60 [(set GPRF32:$dst, (IL_cmp imm:$cc, GPRF32:$src0, GPRF32:$src1))]>;
61 def _f64 : ILFormat<IL_OP_CMP, (outs GPRF64:$dst),
62 (ins i32imm:$cc, GPRF64:$src0, GPRF64:$src1),
63 !strconcat("; f64 ", asm),
64 [(set GPRF64:$dst, (IL_cmp imm:$cc, GPRF64:$src0, GPRF64:$src1))]>;
65 def _v2i8 : ILFormat<IL_OP_CMP, (outs GPRV2I8:$dst),
66 (ins i32imm:$cc, GPRV2I8:$src0, GPRV2I8:$src1),
67 !strconcat("; i8 ", asm),
68 [(set GPRV2I8:$dst, (IL_cmp imm:$cc, GPRV2I8:$src0, GPRV2I8:$src1))]>;
69 def _v2i16 : ILFormat<IL_OP_CMP, (outs GPRV2I16:$dst),
70 (ins i32imm:$cc, GPRV2I16:$src0, GPRV2I16:$src1),
71 !strconcat("; i16 ", asm),
72 [(set GPRV2I16:$dst, (IL_cmp imm:$cc, GPRV2I16:$src0, GPRV2I16:$src1))]>;
73 def _v2i32 : ILFormat<IL_OP_CMP, (outs GPRV2I32:$dst),
74 (ins i32imm:$cc, GPRV2I32:$src0, GPRV2I32:$src1),
75 !strconcat("; i32 ", asm),
76 [(set GPRV2I32:$dst, (IL_cmp imm:$cc, GPRV2I32:$src0, GPRV2I32:$src1))]>;
77 def _v2i64 : ILFormat<IL_OP_CMP, (outs GPRV2I64:$dst),
78 (ins i32imm:$cc, GPRV2I64:$src0, GPRV2I64:$src1),
79 !strconcat("; i64 ", asm),
80 [(set GPRV2I64:$dst, (IL_cmp imm:$cc, GPRV2I64:$src0, GPRV2I64:$src1))]>;
81 def _v2f32 : ILFormat<IL_OP_CMP, (outs GPRV2F32:$dst),
82 (ins i32imm:$cc, GPRV2F32:$src0, GPRV2F32:$src1),
83 !strconcat("; f32 ", asm),
84 [(set GPRV2F32:$dst, (IL_cmp imm:$cc, GPRV2F32:$src0, GPRV2F32:$src1))]>;
85 def _v2f64 : ILFormat<IL_OP_CMP, (outs GPRV2F64:$dst),
86 (ins i32imm:$cc, GPRV2F64:$src0, GPRV2F64:$src1),
87 !strconcat("; f64 ", asm),
88 [(set GPRV2F64:$dst, (IL_cmp imm:$cc, GPRV2F64:$src0, GPRV2F64:$src1))]>;
89 def _v4i8 : ILFormat<IL_OP_CMP, (outs GPRV4I8:$dst),
90 (ins i32imm:$cc, GPRV4I8:$src0, GPRV4I8:$src1),
91 !strconcat("; i8 ", asm),
92 [(set GPRV4I8:$dst, (IL_cmp imm:$cc, GPRV4I8:$src0, GPRV4I8:$src1))]>;
93 def _v4i16 : ILFormat<IL_OP_CMP, (outs GPRV4I16:$dst),
94 (ins i32imm:$cc, GPRV4I16:$src0, GPRV4I16:$src1),
95 !strconcat("; i16 ", asm),
96 [(set GPRV4I16:$dst, (IL_cmp imm:$cc, GPRV4I16:$src0, GPRV4I16:$src1))]>;
97 def _v4i32 : ILFormat<IL_OP_CMP, (outs GPRV4I32:$dst),
98 (ins i32imm:$cc, GPRV4I32:$src0, GPRV4I32:$src1),
99 !strconcat("; i32 ", asm),
100 [(set GPRV4I32:$dst, (IL_cmp imm:$cc, GPRV4I32:$src0, GPRV4I32:$src1))]>;
101 def _v4f32 : ILFormat<IL_OP_CMP, (outs GPRV4F32:$dst),
102 (ins i32imm:$cc, GPRV4F32:$src0, GPRV4F32:$src1),
103 !strconcat("; f32 ", asm),
104 [(set GPRV4F32:$dst, (IL_cmp imm:$cc, GPRV4F32:$src0, GPRV4F32:$src1))]>;
105 }
106
107 // Multiclass that handles constant values
108 multiclass ILConstant<string asm> {
109 def _i8 : ILFormat<IL_OP_MOV, (outs GPRI8:$dst),
110 (ins i8imm:$val),
111 asm, [(set GPRI8:$dst, imm:$val)]>;
112
113 // def _v2i8 : ILFormat<IL_OP_MOV, (outs GPRV2I8:$dst),
114 // (ins i8imm:$val),
115 // asm, [(set GPRV2I8:$dst, GPRV2I8:$val)]>;
116
117 //def _v4i8 : ILFormat<IL_OP_MOV, (outs GPRV4I8:$dst),
118 //(ins i8imm:$val),
119 //asm, [(set GPRV4I8:$dst, GPRV4I8:$val)]>;
120
121 def _i16 : ILFormat<IL_OP_MOV, (outs GPRI16:$dst),
122 (ins i16imm:$val),
123 asm, [(set GPRI16:$dst, imm:$val)]>;
124
125 // def _v2i16 : ILFormat<IL_OP_MOV, (outs GPRV2I16:$dst),
126 // (ins i16imm:$val),
127 // asm, [(set GPRV2I16:$dst, GPRV2I16:$val)]>;
128
129 // def _v4i16 : ILFormat<IL_OP_MOV, (outs GPRV4I16:$dst),
130 // (ins i16imm:$val),
131 // asm, [(set GPRV4I16:$dst, GPRV4I16:$val)]>;
132
133 def _i32 : ILFormat<IL_OP_MOV, (outs GPRI32:$dst),
134 (ins i32imm:$val),
135 asm, [(set GPRI32:$dst, imm:$val)]>;
136
137 // def _v2i32 : ILFormat<IL_OP_MOV, (outs GPRV2I32:$dst),
138 // (ins i32imm:$val),
139 // asm, [(set GPRV2I32:$dst, GPRV2I32:$val)]>;
140
141 // def _v4i32 : ILFormat<IL_OP_MOV, (outs GPRV4I32:$dst),
142 // (ins GPRV4I32:$val),
143 // asm, [(set GPRV4I32:$dst, GPRV4I32:$val)]>;
144
145 def _i64 : ILFormat<IL_OP_MOV, (outs GPRI64:$dst),
146 (ins i64imm:$val),
147 asm, [(set GPRI64:$dst, imm:$val)]>;
148
149 // def _v2i64 : ILFormat<IL_OP_MOV, (outs GPRV2I64:$dst),
150 // (ins i64imm:$val),
151 // asm, [(set GPRV2I64:$dst, GPRV2I64:$val)]>;
152
153 def _f32 : ILFormat<IL_OP_MOV, (outs GPRF32:$dst),
154 (ins f32imm:$val),
155 asm, [(set GPRF32:$dst, fpimm:$val)]>;
156
157 // def _v2f32 : ILFormat<IL_OP_MOV, (outs GPRV2F32:$dst),
158 // (ins f32imm:$val),
159 // asm, [(set GPRV2F32:$dst, GPRV2F32:$val)]>;
160
161 // def _v4f32 : ILFormat<IL_OP_MOV, (outs GPRV4F32:$dst),
162 // (ins f32imm:$val),
163 // asm, [(set GPRV4F32:$dst, GPRV4F32:$val)]>;
164
165 def _f64 : ILFormat<IL_OP_MOV, (outs GPRF64:$dst),
166 (ins f64imm:$val),
167 asm, [(set GPRF64:$dst, fpimm:$val)]>;
168
169 // def _v2f64 : ILFormat<IL_OP_MOV, (outs GPRV2F64:$dst),
170 // (ins f64imm:$val),
171 // asm, [(set GPRV2F64:$dst, GPRV2F64:$val)]>;
172
173 }
174
175 // Multiclass that handles memory store operations
176 multiclass GTRUNCSTORE<string asm> {
177 def _i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI32:$ptr),
178 !strconcat(asm, " $val $ptr"),
179 [(global_i8trunc_store GPRI16:$val, ADDR:$ptr)]>;
180 def _i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
181 !strconcat(asm, " $val $ptr"),
182 [(global_i8trunc_store GPRI32:$val, ADDR:$ptr)]>;
183 def _i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
184 !strconcat(asm, " $val $ptr"),
185 [(global_i8trunc_store GPRI64:$val, ADDR:$ptr)]>;
186 def _i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
187 !strconcat(asm, " $val $ptr"),
188 [(global_i16trunc_store GPRI32:$val, ADDR:$ptr)]>;
189 def _i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
190 !strconcat(asm, " $val $ptr"),
191 [(global_i16trunc_store GPRI64:$val, ADDR:$ptr)]>;
192 def _i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
193 !strconcat(asm, " $val $ptr"),
194 [(global_i32trunc_store GPRI64:$val, ADDR:$ptr)]>;
195 def _f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI32:$ptr),
196 !strconcat(asm, " $val $ptr"),
197 [(global_f32trunc_store GPRF64:$val, ADDR:$ptr)]>;
198 def _v2i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
199 !strconcat(asm, " $val $ptr"),
200 [(global_v2i8trunc_store GPRV2I32:$val, ADDR:$ptr)]>;
201 def _v4i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
202 !strconcat(asm, " $val $ptr"),
203 [(global_v4i8trunc_store GPRV4I32:$val, ADDR:$ptr)]>;
204 def _v2i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI32:$ptr),
205 !strconcat(asm, " $val $ptr"),
206 [(global_v2i8trunc_store GPRV2I16:$val, ADDR:$ptr)]>;
207 def _v4i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI32:$ptr),
208 !strconcat(asm, " $val $ptr"),
209 [(global_v4i8trunc_store GPRV4I16:$val, ADDR:$ptr)]>;
210 def _v2i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
211 !strconcat(asm, " $val $ptr"),
212 [(global_v2i16trunc_store GPRV2I32:$val, ADDR:$ptr)]>;
213 def _v4i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
214 !strconcat(asm, " $val $ptr"),
215 [(global_v4i16trunc_store GPRV4I32:$val, ADDR:$ptr)]>;
216 def _v2f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI32:$ptr),
217 !strconcat(asm, " $val $ptr"),
218 [(global_v2f32trunc_store GPRV2F64:$val, ADDR:$ptr)]>;
219 def _v2i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
220 !strconcat(asm, " $val $ptr"),
221 [(global_v2i8trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
222 def _v2i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
223 !strconcat(asm, " $val $ptr"),
224 [(global_v2i16trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
225 def _v2i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
226 !strconcat(asm, " $val $ptr"),
227 [(global_v2i32trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
228 }
229
230 // Multiclass that handles memory store operations
231 multiclass LTRUNCSTORE<string asm> {
232 def _i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI32:$ptr),
233 !strconcat(asm, " $val $ptr"),
234 [(local_i8trunc_store GPRI16:$val, ADDR:$ptr)]>;
235 def _i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
236 !strconcat(asm, " $val $ptr"),
237 [(local_i8trunc_store GPRI32:$val, ADDR:$ptr)]>;
238 def _i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
239 !strconcat(asm, " $val $ptr"),
240 [(local_i8trunc_store GPRI64:$val, ADDR:$ptr)]>;
241 def _i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
242 !strconcat(asm, " $val $ptr"),
243 [(local_i16trunc_store GPRI32:$val, ADDR:$ptr)]>;
244 def _i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
245 !strconcat(asm, " $val $ptr"),
246 [(local_i16trunc_store GPRI64:$val, ADDR:$ptr)]>;
247 def _i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
248 !strconcat(asm, " $val $ptr"),
249 [(local_i32trunc_store GPRI64:$val, ADDR:$ptr)]>;
250 def _f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI32:$ptr),
251 !strconcat(asm, " $val $ptr"),
252 [(local_f32trunc_store GPRF64:$val, ADDR:$ptr)]>;
253 def _v2i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
254 !strconcat(asm, " $val $ptr"),
255 [(local_v2i8trunc_store GPRV2I32:$val, ADDR:$ptr)]>;
256 def _v4i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
257 !strconcat(asm, " $val $ptr"),
258 [(local_v4i8trunc_store GPRV4I32:$val, ADDR:$ptr)]>;
259 def _v2i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI32:$ptr),
260 !strconcat(asm, " $val $ptr"),
261 [(local_v2i8trunc_store GPRV2I16:$val, ADDR:$ptr)]>;
262 def _v4i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI32:$ptr),
263 !strconcat(asm, " $val $ptr"),
264 [(local_v4i8trunc_store GPRV4I16:$val, ADDR:$ptr)]>;
265 def _v2i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
266 !strconcat(asm, " $val $ptr"),
267 [(local_v2i16trunc_store GPRV2I32:$val, ADDR:$ptr)]>;
268 def _v4i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
269 !strconcat(asm, " $val $ptr"),
270 [(local_v4i16trunc_store GPRV4I32:$val, ADDR:$ptr)]>;
271 def _v2f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI32:$ptr),
272 !strconcat(asm, " $val $ptr"),
273 [(local_v2f32trunc_store GPRV2F64:$val, ADDR:$ptr)]>;
274 def _v2i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
275 !strconcat(asm, " $val $ptr"),
276 [(local_v2i8trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
277 def _v2i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
278 !strconcat(asm, " $val $ptr"),
279 [(local_v2i16trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
280 def _v2i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
281 !strconcat(asm, " $val $ptr"),
282 [(local_v2i32trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
283 }
284
285 // Multiclass that handles memory store operations
286 multiclass PTRUNCSTORE<string asm> {
287 def _i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI32:$ptr),
288 !strconcat(asm, " $val $ptr"),
289 [(private_i8trunc_store GPRI16:$val, ADDR:$ptr)]>;
290 def _i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
291 !strconcat(asm, " $val $ptr"),
292 [(private_i8trunc_store GPRI32:$val, ADDR:$ptr)]>;
293 def _i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
294 !strconcat(asm, " $val $ptr"),
295 [(private_i8trunc_store GPRI64:$val, ADDR:$ptr)]>;
296 def _i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
297 !strconcat(asm, " $val $ptr"),
298 [(private_i16trunc_store GPRI32:$val, ADDR:$ptr)]>;
299 def _i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
300 !strconcat(asm, " $val $ptr"),
301 [(private_i16trunc_store GPRI64:$val, ADDR:$ptr)]>;
302 def _i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
303 !strconcat(asm, " $val $ptr"),
304 [(private_i32trunc_store GPRI64:$val, ADDR:$ptr)]>;
305 def _f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI32:$ptr),
306 !strconcat(asm, " $val $ptr"),
307 [(private_f32trunc_store GPRF64:$val, ADDR:$ptr)]>;
308 def _v2i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
309 !strconcat(asm, " $val $ptr"),
310 [(private_v2i8trunc_store GPRV2I32:$val, ADDR:$ptr)]>;
311 def _v4i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
312 !strconcat(asm, " $val $ptr"),
313 [(private_v4i8trunc_store GPRV4I32:$val, ADDR:$ptr)]>;
314 def _v2i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI32:$ptr),
315 !strconcat(asm, " $val $ptr"),
316 [(private_v2i8trunc_store GPRV2I16:$val, ADDR:$ptr)]>;
317 def _v4i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI32:$ptr),
318 !strconcat(asm, " $val $ptr"),
319 [(private_v4i8trunc_store GPRV4I16:$val, ADDR:$ptr)]>;
320 def _v2i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
321 !strconcat(asm, " $val $ptr"),
322 [(private_v2i16trunc_store GPRV2I32:$val, ADDR:$ptr)]>;
323 def _v4i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
324 !strconcat(asm, " $val $ptr"),
325 [(private_v4i16trunc_store GPRV4I32:$val, ADDR:$ptr)]>;
326 def _v2f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI32:$ptr),
327 !strconcat(asm, " $val $ptr"),
328 [(private_v2f32trunc_store GPRV2F64:$val, ADDR:$ptr)]>;
329 def _v2i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
330 !strconcat(asm, " $val $ptr"),
331 [(private_v2i8trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
332 def _v2i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
333 !strconcat(asm, " $val $ptr"),
334 [(private_v2i16trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
335 def _v2i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
336 !strconcat(asm, " $val $ptr"),
337 [(private_v2i32trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
338 }
339
340 // Multiclass that handles memory store operations
341 multiclass RTRUNCSTORE<string asm> {
342 def _i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI32:$ptr),
343 !strconcat(asm, " $val $ptr"),
344 [(region_i8trunc_store GPRI16:$val, ADDR:$ptr)]>;
345 def _i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
346 !strconcat(asm, " $val $ptr"),
347 [(region_i8trunc_store GPRI32:$val, ADDR:$ptr)]>;
348 def _i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
349 !strconcat(asm, " $val $ptr"),
350 [(region_i8trunc_store GPRI64:$val, ADDR:$ptr)]>;
351 def _i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
352 !strconcat(asm, " $val $ptr"),
353 [(region_i16trunc_store GPRI32:$val, ADDR:$ptr)]>;
354 def _i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
355 !strconcat(asm, " $val $ptr"),
356 [(region_i16trunc_store GPRI64:$val, ADDR:$ptr)]>;
357 def _i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
358 !strconcat(asm, " $val $ptr"),
359 [(region_i32trunc_store GPRI64:$val, ADDR:$ptr)]>;
360 def _f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI32:$ptr),
361 !strconcat(asm, " $val $ptr"),
362 [(region_f32trunc_store GPRF64:$val, ADDR:$ptr)]>;
363 def _v2i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
364 !strconcat(asm, " $val $ptr"),
365 [(region_v2i8trunc_store GPRV2I32:$val, ADDR:$ptr)]>;
366 def _v4i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
367 !strconcat(asm, " $val $ptr"),
368 [(region_v4i8trunc_store GPRV4I32:$val, ADDR:$ptr)]>;
369 def _v2i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI32:$ptr),
370 !strconcat(asm, " $val $ptr"),
371 [(region_v2i8trunc_store GPRV2I16:$val, ADDR:$ptr)]>;
372 def _v4i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI32:$ptr),
373 !strconcat(asm, " $val $ptr"),
374 [(region_v4i8trunc_store GPRV4I16:$val, ADDR:$ptr)]>;
375 def _v2i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
376 !strconcat(asm, " $val $ptr"),
377 [(region_v2i16trunc_store GPRV2I32:$val, ADDR:$ptr)]>;
378 def _v4i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
379 !strconcat(asm, " $val $ptr"),
380 [(region_v4i16trunc_store GPRV4I32:$val, ADDR:$ptr)]>;
381 def _v2f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI32:$ptr),
382 !strconcat(asm, " $val $ptr"),
383 [(region_v2f32trunc_store GPRV2F64:$val, ADDR:$ptr)]>;
384 def _v2i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
385 !strconcat(asm, " $val $ptr"),
386 [(region_v2i8trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
387 def _v2i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
388 !strconcat(asm, " $val $ptr"),
389 [(region_v2i16trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
390 def _v2i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
391 !strconcat(asm, " $val $ptr"),
392 [(region_v2i32trunc_store GPRV2I64:$val, ADDR:$ptr)]>;
393 }
394
395
396 // Multiclass that handles memory store operations
397 multiclass STORE<string asm, PatFrag OpNode> {
398 def _i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI8:$val, MEMI32:$ptr),
399 !strconcat(asm, " $val $ptr"),
400 [(OpNode GPRI8:$val, ADDR:$ptr)]>;
401 def _i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI32:$ptr),
402 !strconcat(asm, " $val $ptr"),
403 [(OpNode GPRI16:$val, ADDR:$ptr)]>;
404 def _i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI32:$ptr),
405 !strconcat(asm, " $val $ptr"),
406 [(OpNode GPRI32:$val, ADDR:$ptr)]>;
407 def _f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF32:$val, MEMI32:$ptr),
408 !strconcat(asm, " $val $ptr"),
409 [(OpNode GPRF32:$val, ADDR:$ptr)]>;
410 def _i64 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI32:$ptr),
411 !strconcat(asm, " $val $ptr"),
412 [(OpNode GPRI64:$val, ADDR:$ptr)]>;
413 def _f64 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI32:$ptr),
414 !strconcat(asm, " $val $ptr"),
415 [(OpNode GPRF64:$val, ADDR:$ptr)]>;
416 def _v4f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4F32:$val, MEMI32:$ptr),
417 !strconcat(asm, " $val $ptr"),
418 [(OpNode GPRV4F32:$val, ADDR:$ptr)]>;
419 def _v2f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F32:$val, MEMI32:$ptr),
420 !strconcat(asm, " $val $ptr"),
421 [(OpNode GPRV2F32:$val, ADDR:$ptr)]>;
422 def _v4i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI32:$ptr),
423 !strconcat(asm, " $val $ptr"),
424 [(OpNode GPRV4I32:$val, ADDR:$ptr)]>;
425 def _v2i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I8:$val, MEMI32:$ptr),
426 !strconcat(asm, " $val $ptr"),
427 [(OpNode GPRV2I8:$val, ADDR:$ptr)]>;
428 def _v2i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI32:$ptr),
429 !strconcat(asm, " $val $ptr"),
430 [(OpNode GPRV2I16:$val, ADDR:$ptr)]>;
431 def _v4i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I8:$val, MEMI32:$ptr),
432 !strconcat(asm, " $val $ptr"),
433 [(OpNode GPRV4I8:$val, ADDR:$ptr)]>;
434 def _v4i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI32:$ptr),
435 !strconcat(asm, " $val $ptr"),
436 [(OpNode GPRV4I16:$val, ADDR:$ptr)]>;
437 def _v2i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI32:$ptr),
438 !strconcat(asm, " $val $ptr"),
439 [(OpNode GPRV2I32:$val, ADDR:$ptr)]>;
440 def _v2f64 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI32:$ptr),
441 !strconcat(asm, " $val $ptr"),
442 [(OpNode GPRV2F64:$val, ADDR:$ptr)]>;
443 def _v2i64 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI32:$ptr),
444 !strconcat(asm, " $val $ptr"),
445 [(OpNode GPRV2I64:$val, ADDR:$ptr)]>;
446 }
447
448 // Multiclass that handles load operations
449 multiclass LOAD<string asm, PatFrag OpNode> {
450 def _i8 : OneInOneOut<IL_OP_MOV, (outs GPRI8:$dst), (ins MEMI32:$ptr),
451 !strconcat(asm, " $dst $ptr"),
452 [(set GPRI8:$dst, (OpNode ADDR:$ptr))]>;
453 def _i16 : OneInOneOut<IL_OP_MOV, (outs GPRI16:$dst), (ins MEMI32:$ptr),
454 !strconcat(asm, " $dst $ptr"),
455 [(set GPRI16:$dst, (OpNode ADDR:$ptr))]>;
456 def _i32 : OneInOneOut<IL_OP_MOV, (outs GPRI32:$dst), (ins MEMI32:$ptr),
457 !strconcat(asm, " $dst $ptr"),
458 [(set GPRI32:$dst, (OpNode ADDR:$ptr))]>;
459 def _f32 : OneInOneOut<IL_OP_MOV, (outs GPRF32:$dst), (ins MEMI32:$ptr),
460 !strconcat(asm, " $dst $ptr"),
461 [(set GPRF32:$dst, (OpNode ADDR:$ptr))]>;
462 def _i64 : OneInOneOut<IL_OP_MOV, (outs GPRI64:$dst), (ins MEMI32:$ptr),
463 !strconcat(asm, " $dst $ptr"),
464 [(set GPRI64:$dst, (OpNode ADDR:$ptr))]>;
465 def _f64 : OneInOneOut<IL_OP_MOV, (outs GPRF64:$dst), (ins MEMI32:$ptr),
466 !strconcat(asm, " $dst $ptr"),
467 [(set GPRF64:$dst, (OpNode ADDR:$ptr))]>;
468 def _v4f32 : OneInOneOut<IL_OP_MOV, (outs GPRV4F32:$dst), (ins MEMI32:$ptr),
469 !strconcat(asm, " $dst $ptr"),
470 [(set GPRV4F32:$dst, (OpNode ADDR:$ptr))]>;
471 def _v2f32 : OneInOneOut<IL_OP_MOV, (outs GPRV2F32:$dst), (ins MEMI32:$ptr),
472 !strconcat(asm, " $dst $ptr"),
473 [(set GPRV2F32:$dst, (OpNode ADDR:$ptr))]>;
474 def _v2f64 : OneInOneOut<IL_OP_MOV, (outs GPRV2F64:$dst), (ins MEMI32:$ptr),
475 !strconcat(asm, " $dst $ptr"),
476 [(set GPRV2F64:$dst, (OpNode ADDR:$ptr))]>;
477 def _v4i32 : OneInOneOut<IL_OP_MOV, (outs GPRV4I32:$dst), (ins MEMI32:$ptr),
478 !strconcat(asm, " $dst $ptr"),
479 [(set GPRV4I32:$dst, (OpNode ADDR:$ptr))]>;
480 def _v2i8 : OneInOneOut<IL_OP_MOV, (outs GPRV2I8:$dst), (ins MEMI32:$ptr),
481 !strconcat(asm, " $dst $ptr"),
482 [(set GPRV2I8:$dst, (OpNode ADDR:$ptr))]>;
483 def _v2i16 : OneInOneOut<IL_OP_MOV, (outs GPRV2I16:$dst), (ins MEMI32:$ptr),
484 !strconcat(asm, " $dst $ptr"),
485 [(set GPRV2I16:$dst, (OpNode ADDR:$ptr))]>;
486 def _v4i8 : OneInOneOut<IL_OP_MOV, (outs GPRV4I8:$dst), (ins MEMI32:$ptr),
487 !strconcat(asm, " $dst $ptr"),
488 [(set GPRV4I8:$dst, (OpNode ADDR:$ptr))]>;
489 def _v4i16 : OneInOneOut<IL_OP_MOV, (outs GPRV4I16:$dst), (ins MEMI32:$ptr),
490 !strconcat(asm, " $dst $ptr"),
491 [(set GPRV4I16:$dst, (OpNode ADDR:$ptr))]>;
492 def _v2i32 : OneInOneOut<IL_OP_MOV, (outs GPRV2I32:$dst), (ins MEMI32:$ptr),
493 !strconcat(asm, " $dst $ptr"),
494 [(set GPRV2I32:$dst, (OpNode ADDR:$ptr))]>;
495 def _v2i64 : OneInOneOut<IL_OP_MOV, (outs GPRV2I64:$dst), (ins MEMI32:$ptr),
496 !strconcat(asm, " $dst $ptr"),
497 [(set GPRV2I64:$dst, (OpNode ADDR:$ptr))]>;
498 }
499
500 // Multiclass that handles memory store operations
501 multiclass GTRUNCSTORE64<string asm> {
502 def _i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI64:$ptr),
503 !strconcat(asm, " $val $ptr"),
504 [(global_i8trunc_store GPRI16:$val, ADDR64:$ptr)]>;
505 def _i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
506 !strconcat(asm, " $val $ptr"),
507 [(global_i8trunc_store GPRI32:$val, ADDR64:$ptr)]>;
508 def _i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
509 !strconcat(asm, " $val $ptr"),
510 [(global_i8trunc_store GPRI64:$val, ADDR64:$ptr)]>;
511 def _i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
512 !strconcat(asm, " $val $ptr"),
513 [(global_i16trunc_store GPRI32:$val, ADDR64:$ptr)]>;
514 def _i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
515 !strconcat(asm, " $val $ptr"),
516 [(global_i16trunc_store GPRI64:$val, ADDR64:$ptr)]>;
517 def _i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
518 !strconcat(asm, " $val $ptr"),
519 [(global_i32trunc_store GPRI64:$val, ADDR64:$ptr)]>;
520 def _f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI64:$ptr),
521 !strconcat(asm, " $val $ptr"),
522 [(global_f32trunc_store GPRF64:$val, ADDR64:$ptr)]>;
523 def _v2i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
524 !strconcat(asm, " $val $ptr"),
525 [(global_v2i8trunc_store GPRV2I32:$val, ADDR64:$ptr)]>;
526 def _v4i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
527 !strconcat(asm, " $val $ptr"),
528 [(global_v4i8trunc_store GPRV4I32:$val, ADDR64:$ptr)]>;
529 def _v2i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI64:$ptr),
530 !strconcat(asm, " $val $ptr"),
531 [(global_v2i8trunc_store GPRV2I16:$val, ADDR64:$ptr)]>;
532 def _v4i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI64:$ptr),
533 !strconcat(asm, " $val $ptr"),
534 [(global_v4i8trunc_store GPRV4I16:$val, ADDR64:$ptr)]>;
535 def _v2i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
536 !strconcat(asm, " $val $ptr"),
537 [(global_v2i16trunc_store GPRV2I32:$val, ADDR64:$ptr)]>;
538 def _v4i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
539 !strconcat(asm, " $val $ptr"),
540 [(global_v4i16trunc_store GPRV4I32:$val, ADDR64:$ptr)]>;
541 def _v2f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI64:$ptr),
542 !strconcat(asm, " $val $ptr"),
543 [(global_v2f32trunc_store GPRV2F64:$val, ADDR64:$ptr)]>;
544 def _v2i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
545 !strconcat(asm, " $val $ptr"),
546 [(global_v2i8trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
547 def _v2i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
548 !strconcat(asm, " $val $ptr"),
549 [(global_v2i16trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
550 def _v2i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
551 !strconcat(asm, " $val $ptr"),
552 [(global_v2i32trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
553 }
554
555 // Multiclass that handles memory store operations
556 multiclass LTRUNCSTORE64<string asm> {
557 def _i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI64:$ptr),
558 !strconcat(asm, " $val $ptr"),
559 [(local_i8trunc_store GPRI16:$val, ADDR64:$ptr)]>;
560 def _i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
561 !strconcat(asm, " $val $ptr"),
562 [(local_i8trunc_store GPRI32:$val, ADDR64:$ptr)]>;
563 def _i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
564 !strconcat(asm, " $val $ptr"),
565 [(local_i8trunc_store GPRI64:$val, ADDR64:$ptr)]>;
566 def _i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
567 !strconcat(asm, " $val $ptr"),
568 [(local_i16trunc_store GPRI32:$val, ADDR64:$ptr)]>;
569 def _i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
570 !strconcat(asm, " $val $ptr"),
571 [(local_i16trunc_store GPRI64:$val, ADDR64:$ptr)]>;
572 def _i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
573 !strconcat(asm, " $val $ptr"),
574 [(local_i32trunc_store GPRI64:$val, ADDR64:$ptr)]>;
575 def _f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI64:$ptr),
576 !strconcat(asm, " $val $ptr"),
577 [(local_f32trunc_store GPRF64:$val, ADDR64:$ptr)]>;
578 def _v2i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
579 !strconcat(asm, " $val $ptr"),
580 [(local_v2i8trunc_store GPRV2I32:$val, ADDR64:$ptr)]>;
581 def _v4i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
582 !strconcat(asm, " $val $ptr"),
583 [(local_v4i8trunc_store GPRV4I32:$val, ADDR64:$ptr)]>;
584 def _v2i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI64:$ptr),
585 !strconcat(asm, " $val $ptr"),
586 [(local_v2i8trunc_store GPRV2I16:$val, ADDR64:$ptr)]>;
587 def _v4i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI64:$ptr),
588 !strconcat(asm, " $val $ptr"),
589 [(local_v4i8trunc_store GPRV4I16:$val, ADDR64:$ptr)]>;
590 def _v2i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
591 !strconcat(asm, " $val $ptr"),
592 [(local_v2i16trunc_store GPRV2I32:$val, ADDR64:$ptr)]>;
593 def _v4i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
594 !strconcat(asm, " $val $ptr"),
595 [(local_v4i16trunc_store GPRV4I32:$val, ADDR64:$ptr)]>;
596 def _v2f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI64:$ptr),
597 !strconcat(asm, " $val $ptr"),
598 [(local_v2f32trunc_store GPRV2F64:$val, ADDR64:$ptr)]>;
599 def _v2i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
600 !strconcat(asm, " $val $ptr"),
601 [(local_v2i8trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
602 def _v2i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
603 !strconcat(asm, " $val $ptr"),
604 [(local_v2i16trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
605 def _v2i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
606 !strconcat(asm, " $val $ptr"),
607 [(local_v2i32trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
608 }
609
610 // Multiclass that handles memory store operations
611 multiclass PTRUNCSTORE64<string asm> {
612 def _i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI64:$ptr),
613 !strconcat(asm, " $val $ptr"),
614 [(private_i8trunc_store GPRI16:$val, ADDR64:$ptr)]>;
615 def _i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
616 !strconcat(asm, " $val $ptr"),
617 [(private_i8trunc_store GPRI32:$val, ADDR64:$ptr)]>;
618 def _i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
619 !strconcat(asm, " $val $ptr"),
620 [(private_i8trunc_store GPRI64:$val, ADDR64:$ptr)]>;
621 def _i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
622 !strconcat(asm, " $val $ptr"),
623 [(private_i16trunc_store GPRI32:$val, ADDR64:$ptr)]>;
624 def _i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
625 !strconcat(asm, " $val $ptr"),
626 [(private_i16trunc_store GPRI64:$val, ADDR64:$ptr)]>;
627 def _i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
628 !strconcat(asm, " $val $ptr"),
629 [(private_i32trunc_store GPRI64:$val, ADDR64:$ptr)]>;
630 def _f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI64:$ptr),
631 !strconcat(asm, " $val $ptr"),
632 [(private_f32trunc_store GPRF64:$val, ADDR64:$ptr)]>;
633 def _v2i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
634 !strconcat(asm, " $val $ptr"),
635 [(private_v2i8trunc_store GPRV2I32:$val, ADDR64:$ptr)]>;
636 def _v4i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
637 !strconcat(asm, " $val $ptr"),
638 [(private_v4i8trunc_store GPRV4I32:$val, ADDR64:$ptr)]>;
639 def _v2i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI64:$ptr),
640 !strconcat(asm, " $val $ptr"),
641 [(private_v2i8trunc_store GPRV2I16:$val, ADDR64:$ptr)]>;
642 def _v4i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI64:$ptr),
643 !strconcat(asm, " $val $ptr"),
644 [(private_v4i8trunc_store GPRV4I16:$val, ADDR64:$ptr)]>;
645 def _v2i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
646 !strconcat(asm, " $val $ptr"),
647 [(private_v2i16trunc_store GPRV2I32:$val, ADDR64:$ptr)]>;
648 def _v4i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
649 !strconcat(asm, " $val $ptr"),
650 [(private_v4i16trunc_store GPRV4I32:$val, ADDR64:$ptr)]>;
651 def _v2f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI64:$ptr),
652 !strconcat(asm, " $val $ptr"),
653 [(private_v2f32trunc_store GPRV2F64:$val, ADDR64:$ptr)]>;
654 def _v2i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
655 !strconcat(asm, " $val $ptr"),
656 [(private_v2i8trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
657 def _v2i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
658 !strconcat(asm, " $val $ptr"),
659 [(private_v2i16trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
660 def _v2i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
661 !strconcat(asm, " $val $ptr"),
662 [(private_v2i32trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
663 }
664
665 // Multiclass that handles memory store operations
666 multiclass RTRUNCSTORE64<string asm> {
667 def _i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI64:$ptr),
668 !strconcat(asm, " $val $ptr"),
669 [(region_i8trunc_store GPRI16:$val, ADDR64:$ptr)]>;
670 def _i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
671 !strconcat(asm, " $val $ptr"),
672 [(region_i8trunc_store GPRI32:$val, ADDR64:$ptr)]>;
673 def _i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
674 !strconcat(asm, " $val $ptr"),
675 [(region_i8trunc_store GPRI64:$val, ADDR64:$ptr)]>;
676 def _i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
677 !strconcat(asm, " $val $ptr"),
678 [(region_i16trunc_store GPRI32:$val, ADDR64:$ptr)]>;
679 def _i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
680 !strconcat(asm, " $val $ptr"),
681 [(region_i16trunc_store GPRI64:$val, ADDR64:$ptr)]>;
682 def _i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
683 !strconcat(asm, " $val $ptr"),
684 [(region_i32trunc_store GPRI64:$val, ADDR64:$ptr)]>;
685 def _f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI64:$ptr),
686 !strconcat(asm, " $val $ptr"),
687 [(region_f32trunc_store GPRF64:$val, ADDR64:$ptr)]>;
688 def _v2i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
689 !strconcat(asm, " $val $ptr"),
690 [(region_v2i8trunc_store GPRV2I32:$val, ADDR64:$ptr)]>;
691 def _v4i32i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
692 !strconcat(asm, " $val $ptr"),
693 [(region_v4i8trunc_store GPRV4I32:$val, ADDR64:$ptr)]>;
694 def _v2i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI64:$ptr),
695 !strconcat(asm, " $val $ptr"),
696 [(region_v2i8trunc_store GPRV2I16:$val, ADDR64:$ptr)]>;
697 def _v4i16i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI64:$ptr),
698 !strconcat(asm, " $val $ptr"),
699 [(region_v4i8trunc_store GPRV4I16:$val, ADDR64:$ptr)]>;
700 def _v2i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
701 !strconcat(asm, " $val $ptr"),
702 [(region_v2i16trunc_store GPRV2I32:$val, ADDR64:$ptr)]>;
703 def _v4i32i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
704 !strconcat(asm, " $val $ptr"),
705 [(region_v4i16trunc_store GPRV4I32:$val, ADDR64:$ptr)]>;
706 def _v2f64f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI64:$ptr),
707 !strconcat(asm, " $val $ptr"),
708 [(region_v2f32trunc_store GPRV2F64:$val, ADDR64:$ptr)]>;
709 def _v2i64i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
710 !strconcat(asm, " $val $ptr"),
711 [(region_v2i8trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
712 def _v2i64i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
713 !strconcat(asm, " $val $ptr"),
714 [(region_v2i16trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
715 def _v2i64i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
716 !strconcat(asm, " $val $ptr"),
717 [(region_v2i32trunc_store GPRV2I64:$val, ADDR64:$ptr)]>;
718 }
719
720
721 // Multiclass that handles memory store operations
722 multiclass STORE64<string asm, PatFrag OpNode> {
723 def _i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI8:$val, MEMI64:$ptr),
724 !strconcat(asm, " $val $ptr"),
725 [(OpNode GPRI8:$val, ADDR64:$ptr)]>;
726 def _i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI16:$val, MEMI64:$ptr),
727 !strconcat(asm, " $val $ptr"),
728 [(OpNode GPRI16:$val, ADDR64:$ptr)]>;
729 def _i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI32:$val, MEMI64:$ptr),
730 !strconcat(asm, " $val $ptr"),
731 [(OpNode GPRI32:$val, ADDR64:$ptr)]>;
732 def _f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF32:$val, MEMI64:$ptr),
733 !strconcat(asm, " $val $ptr"),
734 [(OpNode GPRF32:$val, ADDR64:$ptr)]>;
735 def _i64 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRI64:$val, MEMI64:$ptr),
736 !strconcat(asm, " $val $ptr"),
737 [(OpNode GPRI64:$val, ADDR64:$ptr)]>;
738 def _f64 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRF64:$val, MEMI64:$ptr),
739 !strconcat(asm, " $val $ptr"),
740 [(OpNode GPRF64:$val, ADDR64:$ptr)]>;
741 def _v4f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4F32:$val, MEMI64:$ptr),
742 !strconcat(asm, " $val $ptr"),
743 [(OpNode GPRV4F32:$val, ADDR64:$ptr)]>;
744 def _v2f32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F32:$val, MEMI64:$ptr),
745 !strconcat(asm, " $val $ptr"),
746 [(OpNode GPRV2F32:$val, ADDR64:$ptr)]>;
747 def _v4i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I32:$val, MEMI64:$ptr),
748 !strconcat(asm, " $val $ptr"),
749 [(OpNode GPRV4I32:$val, ADDR64:$ptr)]>;
750 def _v2i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I8:$val, MEMI64:$ptr),
751 !strconcat(asm, " $val $ptr"),
752 [(OpNode GPRV2I8:$val, ADDR64:$ptr)]>;
753 def _v2i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I16:$val, MEMI64:$ptr),
754 !strconcat(asm, " $val $ptr"),
755 [(OpNode GPRV2I16:$val, ADDR64:$ptr)]>;
756 def _v4i8 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I8:$val, MEMI64:$ptr),
757 !strconcat(asm, " $val $ptr"),
758 [(OpNode GPRV4I8:$val, ADDR64:$ptr)]>;
759 def _v4i16 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV4I16:$val, MEMI64:$ptr),
760 !strconcat(asm, " $val $ptr"),
761 [(OpNode GPRV4I16:$val, ADDR64:$ptr)]>;
762 def _v2i32 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I32:$val, MEMI64:$ptr),
763 !strconcat(asm, " $val $ptr"),
764 [(OpNode GPRV2I32:$val, ADDR64:$ptr)]>;
765 def _v2f64 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2F64:$val, MEMI64:$ptr),
766 !strconcat(asm, " $val $ptr"),
767 [(OpNode GPRV2F64:$val, ADDR64:$ptr)]>;
768 def _v2i64 : OneInOneOut<IL_OP_MOV, (outs), (ins GPRV2I64:$val, MEMI64:$ptr),
769 !strconcat(asm, " $val $ptr"),
770 [(OpNode GPRV2I64:$val, ADDR64:$ptr)]>;
771 }
772
773 // Multiclass that handles load operations
774 multiclass LOAD64<string asm, PatFrag OpNode> {
775 def _i8 : OneInOneOut<IL_OP_MOV, (outs GPRI8:$dst), (ins MEMI64:$ptr),
776 !strconcat(asm, " $dst $ptr"),
777 [(set GPRI8:$dst, (OpNode ADDR64:$ptr))]>;
778 def _i16 : OneInOneOut<IL_OP_MOV, (outs GPRI16:$dst), (ins MEMI64:$ptr),
779 !strconcat(asm, " $dst $ptr"),
780 [(set GPRI16:$dst, (OpNode ADDR64:$ptr))]>;
781 def _i32 : OneInOneOut<IL_OP_MOV, (outs GPRI32:$dst), (ins MEMI64:$ptr),
782 !strconcat(asm, " $dst $ptr"),
783 [(set GPRI32:$dst, (OpNode ADDR64:$ptr))]>;
784 def _f32 : OneInOneOut<IL_OP_MOV, (outs GPRF32:$dst), (ins MEMI64:$ptr),
785 !strconcat(asm, " $dst $ptr"),
786 [(set GPRF32:$dst, (OpNode ADDR64:$ptr))]>;
787 def _i64 : OneInOneOut<IL_OP_MOV, (outs GPRI64:$dst), (ins MEMI64:$ptr),
788 !strconcat(asm, " $dst $ptr"),
789 [(set GPRI64:$dst, (OpNode ADDR64:$ptr))]>;
790 def _f64 : OneInOneOut<IL_OP_MOV, (outs GPRF64:$dst), (ins MEMI64:$ptr),
791 !strconcat(asm, " $dst $ptr"),
792 [(set GPRF64:$dst, (OpNode ADDR64:$ptr))]>;
793 def _v4f32 : OneInOneOut<IL_OP_MOV, (outs GPRV4F32:$dst), (ins MEMI64:$ptr),
794 !strconcat(asm, " $dst $ptr"),
795 [(set GPRV4F32:$dst, (OpNode ADDR64:$ptr))]>;
796 def _v2f32 : OneInOneOut<IL_OP_MOV, (outs GPRV2F32:$dst), (ins MEMI64:$ptr),
797 !strconcat(asm, " $dst $ptr"),
798 [(set GPRV2F32:$dst, (OpNode ADDR64:$ptr))]>;
799 def _v2f64 : OneInOneOut<IL_OP_MOV, (outs GPRV2F64:$dst), (ins MEMI64:$ptr),
800 !strconcat(asm, " $dst $ptr"),
801 [(set GPRV2F64:$dst, (OpNode ADDR64:$ptr))]>;
802 def _v4i32 : OneInOneOut<IL_OP_MOV, (outs GPRV4I32:$dst), (ins MEMI64:$ptr),
803 !strconcat(asm, " $dst $ptr"),
804 [(set GPRV4I32:$dst, (OpNode ADDR64:$ptr))]>;
805 def _v2i8 : OneInOneOut<IL_OP_MOV, (outs GPRV2I8:$dst), (ins MEMI64:$ptr),
806 !strconcat(asm, " $dst $ptr"),
807 [(set GPRV2I8:$dst, (OpNode ADDR64:$ptr))]>;
808 def _v2i16 : OneInOneOut<IL_OP_MOV, (outs GPRV2I16:$dst), (ins MEMI64:$ptr),
809 !strconcat(asm, " $dst $ptr"),
810 [(set GPRV2I16:$dst, (OpNode ADDR64:$ptr))]>;
811 def _v4i8 : OneInOneOut<IL_OP_MOV, (outs GPRV4I8:$dst), (ins MEMI64:$ptr),
812 !strconcat(asm, " $dst $ptr"),
813 [(set GPRV4I8:$dst, (OpNode ADDR64:$ptr))]>;
814 def _v4i16 : OneInOneOut<IL_OP_MOV, (outs GPRV4I16:$dst), (ins MEMI64:$ptr),
815 !strconcat(asm, " $dst $ptr"),
816 [(set GPRV4I16:$dst, (OpNode ADDR64:$ptr))]>;
817 def _v2i32 : OneInOneOut<IL_OP_MOV, (outs GPRV2I32:$dst), (ins MEMI64:$ptr),
818 !strconcat(asm, " $dst $ptr"),
819 [(set GPRV2I32:$dst, (OpNode ADDR64:$ptr))]>;
820 def _v2i64 : OneInOneOut<IL_OP_MOV, (outs GPRV2I64:$dst), (ins MEMI64:$ptr),
821 !strconcat(asm, " $dst $ptr"),
822 [(set GPRV2I64:$dst, (OpNode ADDR64:$ptr))]>;
823 }
824
825 // Only scalar types should generate flow control
826 multiclass BranchInstr<ILOpCode opc> {
827 def _i8 : UnaryOpNoRet<opc, (outs), (ins GPRI8:$src),
828 !strconcat(opc.Text, " $src"), []>;
829 def _i16 : UnaryOpNoRet<opc, (outs), (ins GPRI16:$src),
830 !strconcat(opc.Text, " $src"), []>;
831 def _i32 : UnaryOpNoRet<opc, (outs), (ins GPRI32:$src),
832 !strconcat(opc.Text, " $src"), []>;
833 def _i64 : UnaryOpNoRet<opc, (outs), (ins GPRI64:$src),
834 !strconcat(opc.Text, " $src"), []>;
835 def _f32 : UnaryOpNoRet<opc, (outs), (ins GPRF32:$src),
836 !strconcat(opc.Text, " $src"), []>;
837 def _f64 : UnaryOpNoRet<opc, (outs), (ins GPRF64:$src),
838 !strconcat(opc.Text, " $src"), []>;
839 }
840 // Only scalar types should generate flow control
841 multiclass BranchInstr2<ILOpCode opc> {
842 def _i8 : BinaryOpNoRet<opc, (outs), (ins GPRI8:$src0, GPRI8:$src1),
843 !strconcat(opc.Text, " $src0, $src1"), []>;
844 def _i16 : BinaryOpNoRet<opc, (outs), (ins GPRI16:$src0, GPRI16:$src1),
845 !strconcat(opc.Text, " $src0, $src1"), []>;
846 def _i32 : BinaryOpNoRet<opc, (outs), (ins GPRI32:$src0, GPRI32:$src1),
847 !strconcat(opc.Text, " $src0, $src1"), []>;
848 def _i64 : BinaryOpNoRet<opc, (outs), (ins GPRI64:$src0, GPRI64:$src1),
849 !strconcat(opc.Text, " $src0, $src1"), []>;
850 def _f32 : BinaryOpNoRet<opc, (outs), (ins GPRF32:$src0, GPRF32:$src1),
851 !strconcat(opc.Text, " $src0, $src1"), []>;
852 def _f64 : BinaryOpNoRet<opc, (outs), (ins GPRF64:$src0, GPRF64:$src1),
853 !strconcat(opc.Text, " $src0, $src1"), []>;
854 }
855
856 // Class that handles the various vector extract patterns
857 multiclass VectorExtract<SDNode OpNode> {
858 def _v2f64 : ExtractVectorClass<GPRF64, GPRV2F64, OpNode>;
859 def _v4f32: ExtractVectorClass<GPRF32, GPRV4F32, OpNode>;
860 def _v2f32 : ExtractVectorClass<GPRF32, GPRV2F32, OpNode>;
861 def _v2i64 : ExtractVectorClass<GPRI64, GPRV2I64, OpNode>;
862 def _v4i8 : ExtractVectorClass<GPRI8, GPRV4I8, OpNode>;
863 def _v4i16 : ExtractVectorClass<GPRI16, GPRV4I16, OpNode>;
864 def _v4i32 : ExtractVectorClass<GPRI32, GPRV4I32, OpNode>;
865 def _v2i8 : ExtractVectorClass<GPRI8, GPRV2I8, OpNode>;
866 def _v2i16 : ExtractVectorClass<GPRI16, GPRV2I16, OpNode>;
867 def _v2i32 : ExtractVectorClass<GPRI32, GPRV2I32, OpNode>;
868 }
869
870 multiclass VectorConcat<SDNode OpNode> {
871 def _v2f64 : VectorConcatClass<GPRV2F64, GPRF64, OpNode>;
872 def _v2i64 : VectorConcatClass<GPRV2F64, GPRI64, OpNode>;
873 def _v4f32 : VectorConcatClass<GPRV4F32, GPRV2F32, OpNode>;
874 def _v4i32 : VectorConcatClass<GPRV4I32, GPRV2I32, OpNode>;
875 def _v4i16 : VectorConcatClass<GPRV4I16, GPRV2I16, OpNode>;
876 def _v4i8 : VectorConcatClass<GPRV4I8, GPRV2I8, OpNode>;
877 def _v2f32 : VectorConcatClass<GPRV2F32, GPRF32, OpNode>;
878 def _v2i32 : VectorConcatClass<GPRV2I32, GPRI32, OpNode>;
879 def _v2i16 : VectorConcatClass<GPRV2I16, GPRI16, OpNode>;
880 def _v2i8 : VectorConcatClass<GPRV2I8, GPRI8, OpNode>;
881 }
882
883 // Class that handles the various vector insert patterns
884 multiclass VectorInsert<SDNode OpNode> {
885 def _v2f64 : InsertVectorClass<IL_OP_I_ADD, GPRV2F64,
886 GPRF64, OpNode, "iadd">;
887 def _v4f32: InsertVectorClass<IL_OP_I_ADD, GPRV4F32,
888 GPRF32, OpNode, "iadd">;
889 def _v2f32 : InsertVectorClass<IL_OP_I_ADD, GPRV2F32,
890 GPRF32, OpNode, "iadd">;
891 def _v2i64 : InsertVectorClass<IL_OP_I_ADD, GPRV2I64,
892 GPRI64, OpNode, "iadd">;
893 def _v4i8 : InsertVectorClass<IL_OP_I_ADD, GPRV4I8,
894 GPRI8, OpNode, "iadd">;
895 def _v4i16 : InsertVectorClass<IL_OP_I_ADD, GPRV4I16,
896 GPRI16, OpNode, "iadd">;
897 def _v4i32 : InsertVectorClass<IL_OP_I_ADD, GPRV4I32,
898 GPRI32, OpNode, "iadd">;
899 def _v2i8 : InsertVectorClass<IL_OP_I_ADD, GPRV2I8,
900 GPRI8, OpNode, "iadd">;
901 def _v2i16 : InsertVectorClass<IL_OP_I_ADD, GPRV2I16,
902 GPRI16, OpNode, "iadd">;
903 def _v2i32 : InsertVectorClass<IL_OP_I_ADD, GPRV2I32,
904 GPRI32, OpNode, "iadd">;
905 }
906
907 // generic class that handles math instruction for OneInOneOut instruction
908 // patterns
909 multiclass UnaryOpMC<ILOpCode OpCode, SDNode OpNode> {
910 def _i8 : UnaryOp<OpCode, OpNode, GPRI8, GPRI8>;
911 def _i16 : UnaryOp<OpCode, OpNode, GPRI16, GPRI16>;
912 def _i32 : UnaryOp<OpCode, OpNode, GPRI32, GPRI32>;
913 def _f32 : UnaryOp<OpCode, OpNode, GPRF32, GPRF32>;
914 def _f64 : UnaryOp<OpCode, OpNode, GPRF64, GPRF64>;
915 def _i64 : UnaryOp<OpCode, OpNode, GPRI64, GPRI64>;
916 def _v4f32: UnaryOp<OpCode, OpNode, GPRV4F32, GPRV4F32>;
917 def _v4i16 : UnaryOp<OpCode, OpNode, GPRV4I16, GPRV4I16>;
918 def _v4i8 : UnaryOp<OpCode, OpNode, GPRV4I8, GPRV4I8>;
919 def _v4i32 : UnaryOp<OpCode, OpNode, GPRV4I32, GPRV4I32>;
920 def _v2f32 : UnaryOp<OpCode, OpNode, GPRV2F32, GPRV2F32>;
921 def _v2i16 : UnaryOp<OpCode, OpNode, GPRV2I16, GPRV2I16>;
922 def _v2i8 : UnaryOp<OpCode, OpNode, GPRV2I8, GPRV2I8>;
923 def _v2i32 : UnaryOp<OpCode, OpNode, GPRV2I32, GPRV2I32>;
924 def _v2f64 : UnaryOp<OpCode, OpNode, GPRV2F64, GPRV2F64>;
925 def _v2i64 : UnaryOp<OpCode, OpNode, GPRV2I64, GPRV2I64>;
926 }
927 multiclass UnaryOpMCVec<ILOpCode OpCode, SDNode OpNode> {
928 def _v4f32: UnaryOp<OpCode, OpNode, GPRV4F32, GPRF32>;
929 def _v4i16 : UnaryOp<OpCode, OpNode, GPRV4I16, GPRI16>;
930 def _v4i8 : UnaryOp<OpCode, OpNode, GPRV4I8, GPRI8>;
931 def _v4i32 : UnaryOp<OpCode, OpNode, GPRV4I32, GPRI32>;
932 def _v2f32 : UnaryOp<OpCode, OpNode, GPRV2F32, GPRF32>;
933 def _v2i16 : UnaryOp<OpCode, OpNode, GPRV2I16, GPRI16>;
934 def _v2i8 : UnaryOp<OpCode, OpNode, GPRV2I8, GPRI8>;
935 def _v2i32 : UnaryOp<OpCode, OpNode, GPRV2I32, GPRI32>;
936 def _v2f64 : UnaryOp<OpCode, OpNode, GPRV2F64, GPRF64>;
937 def _v2i64 : UnaryOp<OpCode, OpNode, GPRV2I64, GPRI64>;
938 }
939
940 multiclass UnaryOpMCf32<
941 ILOpCode f32OpCode,
942 SDNode OpNode> {
943 def _f32 : UnaryOp<f32OpCode, OpNode, GPRF32, GPRF32>;
944 def _v4f32: UnaryOp<f32OpCode, OpNode, GPRV4F32, GPRV4F32>;
945 def _v2f32 : UnaryOp<f32OpCode, OpNode, GPRV2F32, GPRV2F32>;
946 }
947
948 multiclass UnaryOpMCi32<
949 ILOpCode i32OpCode,
950 SDNode OpNode> {
951 def _i8 : UnaryOp<i32OpCode, OpNode, GPRI8, GPRI8>;
952 def _i16 : UnaryOp<i32OpCode, OpNode, GPRI16, GPRI16>;
953 def _i32 : UnaryOp<i32OpCode, OpNode, GPRI32, GPRI32>;
954 def _v4i16 : UnaryOp<i32OpCode, OpNode, GPRV4I16, GPRV4I16>;
955 def _v4i8 : UnaryOp<i32OpCode, OpNode, GPRV4I8, GPRV4I8>;
956 def _v4i32 : UnaryOp<i32OpCode, OpNode, GPRV4I32, GPRV4I32>;
957 def _v2i16 : UnaryOp<i32OpCode, OpNode, GPRV2I16, GPRV2I16>;
958 def _v2i8 : UnaryOp<i32OpCode, OpNode, GPRV2I8, GPRV2I8>;
959 def _v2i32 : UnaryOp<i32OpCode, OpNode, GPRV2I32, GPRV2I32>;
960 }
961
962
963 multiclass BinaryOpMC<ILOpCode OpCode, SDNode OpNode> {
964 def _i8 : BinaryOp<OpCode, OpNode, GPRI8, GPRI8, GPRI8>;
965
966 def _i16 : BinaryOp<OpCode, OpNode, GPRI16, GPRI16, GPRI16>;
967 def _i32 : BinaryOp<OpCode, OpNode, GPRI32, GPRI32, GPRI32>;
968 def _f32 : BinaryOp<OpCode, OpNode, GPRF32, GPRF32, GPRF32>;
969 def _f64 : BinaryOp<OpCode, OpNode, GPRF64, GPRF64, GPRF64>;
970 def _i64 : BinaryOp<OpCode, OpNode, GPRI64, GPRI64, GPRI64>;
971 def _v4f32: BinaryOp<OpCode, OpNode, GPRV4F32, GPRV4F32, GPRV4F32>;
972 def _v4i16 : BinaryOp<OpCode, OpNode, GPRV4I16, GPRV4I16, GPRV4I16>;
973 def _v4i8 : BinaryOp<OpCode, OpNode, GPRV4I8, GPRV4I8, GPRV4I8>;
974 def _v4i32 : BinaryOp<OpCode, OpNode, GPRV4I32, GPRV4I32, GPRV4I32>;
975 def _v2f32 : BinaryOp<OpCode, OpNode, GPRV2F32, GPRV2F32, GPRV2F32>;
976 def _v2i16 : BinaryOp<OpCode, OpNode, GPRV2I16, GPRV2I16, GPRV2I16>;
977 def _v2i8 : BinaryOp<OpCode, OpNode, GPRV2I8, GPRV2I8, GPRV2I8>;
978 def _v2i32 : BinaryOp<OpCode, OpNode, GPRV2I32, GPRV2I32, GPRV2I32>;
979 def _v2f64 : BinaryOp<OpCode, OpNode, GPRV2F64, GPRV2F64, GPRV2F64>;
980 def _v2i64 : BinaryOp<OpCode, OpNode, GPRV2I64, GPRV2I64, GPRV2I64>;
981 }
982
983 multiclass BinaryOpMCInt<ILOpCode OpCode, SDNode OpNode> {
984 def _i8 : BinaryOp<OpCode, OpNode, GPRI8, GPRI8, GPRI8>;
985
986 def _i16 : BinaryOp<OpCode, OpNode, GPRI16, GPRI16, GPRI16>;
987 def _i32 : BinaryOp<OpCode, OpNode, GPRI32, GPRI32, GPRI32>;
988 def _i64 : BinaryOp<OpCode, OpNode, GPRI64, GPRI64, GPRI64>;
989 def _v4i16 : BinaryOp<OpCode, OpNode, GPRV4I16, GPRV4I16, GPRV4I16>;
990 def _v4i8 : BinaryOp<OpCode, OpNode, GPRV4I8, GPRV4I8, GPRV4I8>;
991 def _v4i32 : BinaryOp<OpCode, OpNode, GPRV4I32, GPRV4I32, GPRV4I32>;
992 def _v2i16 : BinaryOp<OpCode, OpNode, GPRV2I16, GPRV2I16, GPRV2I16>;
993 def _v2i8 : BinaryOp<OpCode, OpNode, GPRV2I8, GPRV2I8, GPRV2I8>;
994 def _v2i32 : BinaryOp<OpCode, OpNode, GPRV2I32, GPRV2I32, GPRV2I32>;
995 def _v2i64 : BinaryOp<OpCode, OpNode, GPRV2I64, GPRV2I64, GPRV2I64>;
996 }
997
998 // generic class that handles math instruction for ThreeInOneOut
999 // instruction patterns
1000 multiclass TernaryOpMC<ILOpCode OpCode, SDNode OpNode> {
1001 def _i8 : TernaryOp<OpCode, OpNode, GPRI8, GPRI8, GPRI8, GPRI8>;
1002 def _i16 : TernaryOp<OpCode, OpNode, GPRI16, GPRI16, GPRI16, GPRI16>;
1003 def _i32 : TernaryOp<OpCode, OpNode, GPRI32, GPRI32, GPRI32, GPRI32>;
1004 def _f32 : TernaryOp<OpCode, OpNode, GPRF32, GPRF32, GPRF32, GPRF32>;
1005 def _f64 : TernaryOp<OpCode, OpNode, GPRF64, GPRF64, GPRF64, GPRF64>;
1006 def _i64 : TernaryOp<OpCode, OpNode, GPRI64, GPRI64, GPRI64, GPRI64>;
1007 def _v4f32: TernaryOp<OpCode, OpNode, GPRV4F32, GPRV4F32,
1008 GPRV4F32, GPRV4F32>;
1009 def _v4i8 : TernaryOp<OpCode, OpNode, GPRV4I8, GPRV4I8,
1010 GPRV4I8, GPRV4I8>;
1011 def _v4i16 : TernaryOp<OpCode, OpNode, GPRV4I16, GPRV4I16,
1012 GPRV4I16, GPRV4I16>;
1013 def _v4i32 : TernaryOp<OpCode, OpNode, GPRV4I32, GPRV4I32,
1014 GPRV4I32, GPRV4I32>;
1015 def _v2f32 : TernaryOp<OpCode, OpNode, GPRV2F32, GPRV2F32,
1016 GPRV2F32, GPRV2F32>;
1017 def _v2i8 : TernaryOp<OpCode, OpNode, GPRV2I8, GPRV2I8,
1018 GPRV2I8, GPRV2I8>;
1019 def _v2i16 : TernaryOp<OpCode, OpNode, GPRV2I16, GPRV2I16,
1020 GPRV2I16, GPRV2I16>;
1021 def _v2i32 : TernaryOp<OpCode, OpNode, GPRV2I32, GPRV2I32,
1022 GPRV2I32, GPRV2I32>;
1023 def _v2f64 : TernaryOp<OpCode, OpNode, GPRV2F64, GPRV2F64,
1024 GPRV2F64, GPRV2F64>;
1025 def _v2i64 : TernaryOp<OpCode, OpNode, GPRV2I64, GPRV2I64,
1026 GPRV2I64, GPRV2I64>;
1027 }
1028 multiclass BinaryOpMCi32<ILOpCode i32OpCode, SDNode OpNode> {
1029 def _i8 : BinaryOp<i32OpCode, OpNode, GPRI8, GPRI8, GPRI8>;
1030 def _i16 : BinaryOp<i32OpCode, OpNode, GPRI16, GPRI16, GPRI16>;
1031 def _i32 : BinaryOp<i32OpCode, OpNode, GPRI32, GPRI32, GPRI32>;
1032 def _v4i16 : BinaryOp<i32OpCode, OpNode, GPRV4I16,
1033 GPRV4I16, GPRV4I16>;
1034 def _v4i8 : BinaryOp<i32OpCode, OpNode, GPRV4I8,
1035 GPRV4I8, GPRV4I8>;
1036 def _v4i32 : BinaryOp<i32OpCode, OpNode, GPRV4I32,
1037 GPRV4I32, GPRV4I32>;
1038 def _v2i16 : BinaryOp<i32OpCode, OpNode, GPRV2I16,
1039 GPRV2I16, GPRV2I16>;
1040 def _v2i8 : BinaryOp<i32OpCode, OpNode, GPRV2I8,
1041 GPRV2I8, GPRV2I8>;
1042 def _v2i32 : BinaryOp<i32OpCode, OpNode, GPRV2I32,
1043 GPRV2I32, GPRV2I32>;
1044 }
1045 multiclass BinaryOpMCi64<ILOpCode i64OpCode, SDNode OpNode> {
1046 def _i64 : BinaryOp<i64OpCode, OpNode, GPRI64, GPRI64, GPRI64>;
1047 def _v2i64 : BinaryOp<i64OpCode, OpNode, GPRV2I64,
1048 GPRV2I64, GPRV2I64>;
1049 }
1050 multiclass BinaryOpMCi32Const<ILOpCode i32OpCode, SDNode OpNode> {
1051 def _i8 : BinaryOp<i32OpCode, OpNode, GPRI8, GPRI8, GPRI32>;
1052 def _i16 : BinaryOp<i32OpCode, OpNode, GPRI16, GPRI16, GPRI32>;
1053 def _i32 : BinaryOp<i32OpCode, OpNode, GPRI32, GPRI32, GPRI32>;
1054 def _v4i16 : BinaryOp<i32OpCode, OpNode, GPRV4I32,
1055 GPRV4I32, GPRI32>;
1056 def _v4i8 : BinaryOp<i32OpCode, OpNode, GPRV4I32,
1057 GPRV4I32, GPRI32>;
1058 def _v4i32 : BinaryOp<i32OpCode, OpNode, GPRV4I32,
1059 GPRV4I32, GPRI32>;
1060 def _v2i16 : BinaryOp<i32OpCode, OpNode, GPRV2I32,
1061 GPRV2I32, GPRI32>;
1062 def _v2i8 : BinaryOp<i32OpCode, OpNode, GPRV2I32,
1063 GPRV2I32, GPRI32>;
1064 def _v2i32 : BinaryOp<i32OpCode, OpNode, GPRV2I32,
1065 GPRV2I32, GPRI32>;
1066 }
1067 multiclass BinaryOpMCf32<ILOpCode f32OpCode, SDNode OpNode> {
1068 def _f32 : BinaryOp<f32OpCode, OpNode, GPRF32,
1069 GPRF32, GPRF32>;
1070 def _v4f32: BinaryOp<f32OpCode, OpNode, GPRV4F32,
1071 GPRV4F32, GPRV4F32>;
1072 def _v2f32 : BinaryOp<f32OpCode, OpNode, GPRV2F32,
1073 GPRV2F32, GPRV2F32>;
1074 }
1075
1076 multiclass TernaryOpMCf64<ILOpCode f64OpCode, SDNode OpNode> {
1077 def _f64 : TernaryOp<f64OpCode, OpNode, GPRF64,
1078 GPRF64, GPRF64, GPRF64>;
1079 }
1080
1081 multiclass TernaryOpMCf32<ILOpCode f32OpCode, SDNode OpNode> {
1082 def _f32 : TernaryOp<f32OpCode, OpNode, GPRF32,
1083 GPRF32, GPRF32, GPRF32>;
1084 def _v4f32: TernaryOp<f32OpCode, OpNode, GPRV4F32,
1085 GPRV4F32, GPRV4F32, GPRV4F32>;
1086 def _v2f32 : TernaryOp<f32OpCode, OpNode, GPRV2F32,
1087 GPRV2F32, GPRV2F32, GPRV2F32>;
1088 }
1089 multiclass BinaryOpMCFloat<ILOpCode f32OpCode, ILOpCode f64OpCode,
1090 SDNode OpNode> {
1091 def _f64 : BinaryOp<f64OpCode, OpNode, GPRF64,
1092 GPRF64, GPRF64>;
1093 def _v2f64 : BinaryOp<f64OpCode, OpNode, GPRV2F64,
1094 GPRV2F64, GPRV2F64>;
1095 def _f32 : BinaryOp<f32OpCode, OpNode, GPRF32,
1096 GPRF32, GPRF32>;
1097 def _v2f32 : BinaryOp<f32OpCode, OpNode, GPRV2F32,
1098 GPRV2F32, GPRV2F32>;
1099 def _v4f32: BinaryOp<f32OpCode, OpNode, GPRV4F32,
1100 GPRV4F32, GPRV4F32>;
1101 }
1102
1103 multiclass TernaryOpMCScalar<ILOpCode opcode, SDNode node>
1104 {
1105 def _i8: TernaryOp<opcode, node, GPRI8, GPRI8, GPRI8, GPRI8>;
1106 def _i16: TernaryOp<opcode, node, GPRI16, GPRI8, GPRI16, GPRI16>;
1107 def _i32: TernaryOp<opcode, node, GPRI32, GPRI8, GPRI32, GPRI32>;
1108 def _i64: TernaryOp<opcode, node, GPRI64, GPRI8, GPRI64, GPRI64>;
1109 def _f32: TernaryOp<opcode, node, GPRF32, GPRI8, GPRF32, GPRF32>;
1110 def _f64: TernaryOp<opcode, node, GPRF64, GPRI8, GPRF64, GPRF64>;
1111 }
1112
1113
1114 multiclass BitConversion<ILOpCode opcode, RegisterClass Regs, SDNode OpNode>
1115 {
1116 def _i8 : UnaryOp<opcode, OpNode, Regs, GPRI8>;
1117 def _i16 : UnaryOp<opcode, OpNode, Regs, GPRI16>;
1118 def _i32 : UnaryOp<opcode, OpNode, Regs, GPRI32>;
1119 def _f32 : UnaryOp<opcode, OpNode, Regs, GPRF32>;
1120 def _i64 : UnaryOp<opcode, OpNode, Regs, GPRI64>;
1121 def _f64 : UnaryOp<opcode, OpNode, Regs, GPRF64>;
1122 def _v2i8 : UnaryOp<opcode, OpNode, Regs, GPRV2I8>;
1123 def _v2i16 : UnaryOp<opcode, OpNode, Regs, GPRV2I16>;
1124 def _v2i32 : UnaryOp<opcode, OpNode, Regs, GPRV2I32>;
1125 def _v2f32 : UnaryOp<opcode, OpNode, Regs, GPRV2F32>;
1126 def _v2i64 : UnaryOp<opcode, OpNode, Regs, GPRV2I64>;
1127 def _v2f64 : UnaryOp<opcode, OpNode, Regs, GPRV2F64>;
1128 def _v4i8 : UnaryOp<opcode, OpNode, Regs, GPRV4I8>;
1129 def _v4i16 : UnaryOp<opcode, OpNode, Regs, GPRV4I16>;
1130 def _v4i32 : UnaryOp<opcode, OpNode, Regs, GPRV4I32>;
1131 def _v4f32 : UnaryOp<opcode, OpNode, Regs, GPRV4F32>;
1132 }
1133
1134
1135 multiclass UnaryIntrinsicInt<ILOpCode opcode, Intrinsic intr>
1136 {
1137 def _i32 : OneInOneOut<opcode, (outs GPRI32:$dst),
1138 (ins GPRI32:$src),
1139 !strconcat(opcode.Text, " $dst, $src"),
1140 [(set GPRI32:$dst, (intr GPRI32:$src))]>;
1141 def _v2i32 : OneInOneOut<opcode, (outs GPRV2I32:$dst),
1142 (ins GPRV2I32:$src),
1143 !strconcat(opcode.Text, " $dst, $src"),
1144 [(set GPRV2I32:$dst, (intr GPRV2I32:$src))]>;
1145 def _v4i32 : OneInOneOut<opcode, (outs GPRV4I32:$dst),
1146 (ins GPRV4I32:$src),
1147 !strconcat(opcode.Text, " $dst, $src"),
1148 [(set GPRV4I32:$dst, (intr GPRV4I32:$src))]>;
1149 }
1150
1151 multiclass IntrConvertF32TOF16<ILOpCode opcode, Intrinsic intr>
1152 {
1153 def _i16 : OneInOneOut<opcode, (outs GPRI16:$dst),
1154 (ins GPRF32:$src),
1155 !strconcat(opcode.Text, " $dst, $src"),
1156 [(set GPRI16:$dst, (intr GPRF32:$src))]>;
1157 def _v2i16 : OneInOneOut<opcode, (outs GPRV2I16:$dst),
1158 (ins GPRV2F32:$src),
1159 !strconcat(opcode.Text, " $dst, $src"),
1160 [(set GPRV2I16:$dst, (intr GPRV2F32:$src))]>;
1161 def _v4i16 : OneInOneOut<opcode, (outs GPRV4I16:$dst),
1162 (ins GPRV4F32:$src),
1163 !strconcat(opcode.Text, " $dst, $src"),
1164 [(set GPRV4I16:$dst, (intr GPRV4F32:$src))]>;
1165 }
1166
1167
1168 multiclass IntrConvertF32TOI32<ILOpCode opcode, Intrinsic intr>
1169 {
1170 def _i32 : OneInOneOut<opcode, (outs GPRI32:$dst),
1171 (ins GPRF32:$src),
1172 !strconcat(opcode.Text, " $dst, $src"),
1173 [(set GPRI32:$dst, (intr GPRF32:$src))]>;
1174 def _v2i32 : OneInOneOut<opcode, (outs GPRV2I32:$dst),
1175 (ins GPRV2F32:$src),
1176 !strconcat(opcode.Text, " $dst, $src"),
1177 [(set GPRV2I32:$dst, (intr GPRV2F32:$src))]>;
1178 def _v4i32 : OneInOneOut<opcode, (outs GPRV4I32:$dst),
1179 (ins GPRV4F32:$src),
1180 !strconcat(opcode.Text, " $dst, $src"),
1181 [(set GPRV4I32:$dst, (intr GPRV4F32:$src))]>;
1182 }
1183
1184 multiclass IntrConvertF64TOI32<ILOpCode opcode, Intrinsic intr>
1185 {
1186 def _i32 : OneInOneOut<opcode, (outs GPRI32:$dst),
1187 (ins GPRF64:$src),
1188 !strconcat(opcode.Text, " $dst, $src"),
1189 [(set GPRI32:$dst, (intr GPRF64:$src))]>;
1190 def _v2i32 : OneInOneOut<opcode, (outs GPRV2I32:$dst),
1191 (ins GPRV2F64:$src),
1192 !strconcat(opcode.Text, " $dst, $src"),
1193 [(set GPRV2I32:$dst, (intr GPRV2F64:$src))]>;
1194 }
1195
1196 multiclass IntrConvertF16TOF32<ILOpCode opcode, Intrinsic intr>
1197 {
1198 def _f32 : OneInOneOut<opcode, (outs GPRF32:$dst),
1199 (ins GPRI16:$src),
1200 !strconcat(opcode.Text, " $dst, $src"),
1201 [(set GPRF32:$dst, (intr GPRI16:$src))]>;
1202 def _v2f32 : OneInOneOut<opcode, (outs GPRV2F32:$dst),
1203 (ins GPRV2I16:$src),
1204 !strconcat(opcode.Text, " $dst, $src"),
1205 [(set GPRV2F32:$dst, (intr GPRV2I16:$src))]>;
1206 def _v4f32 : OneInOneOut<opcode, (outs GPRV4F32:$dst),
1207 (ins GPRV4I16:$src),
1208 !strconcat(opcode.Text, " $dst, $src"),
1209 [(set GPRV4F32:$dst, (intr GPRV4I16:$src))]>;
1210 }
1211
1212
1213 multiclass IntrConvertI32TOF32<ILOpCode opcode, Intrinsic intr>
1214 {
1215 def _f32 : OneInOneOut<opcode, (outs GPRF32:$dst),
1216 (ins GPRI32:$src),
1217 !strconcat(opcode.Text, " $dst, $src"),
1218 [(set GPRF32:$dst, (intr GPRI32:$src))]>;
1219 def _v2f32 : OneInOneOut<opcode, (outs GPRV2F32:$dst),
1220 (ins GPRV2I32:$src),
1221 !strconcat(opcode.Text, " $dst, $src"),
1222 [(set GPRV2F32:$dst, (intr GPRV2I32:$src))]>;
1223 def _v4f32 : OneInOneOut<opcode, (outs GPRV4F32:$dst),
1224 (ins GPRV4I32:$src),
1225 !strconcat(opcode.Text, " $dst, $src"),
1226 [(set GPRV4F32:$dst, (intr GPRV4I32:$src))]>;
1227 }
1228
1229 multiclass BinaryIntrinsicLong<ILOpCode opcode, Intrinsic intr>
1230 {
1231 def _i64 : TwoInOneOut<opcode, (outs GPRI64:$dst),
1232 (ins GPRI64:$src, GPRI64:$src2),
1233 !strconcat(opcode.Text, " $dst, $src, $src2"),
1234 [(set GPRI64:$dst,
1235 (intr GPRI64:$src, GPRI64:$src2))]>;
1236 }
1237
1238
1239 multiclass BinaryIntrinsicInt<ILOpCode opcode, Intrinsic intr>
1240 {
1241 def _i32 : TwoInOneOut<opcode, (outs GPRI32:$dst),
1242 (ins GPRI32:$src, GPRI32:$src2),
1243 !strconcat(opcode.Text, " $dst, $src, $src2"),
1244 [(set GPRI32:$dst,
1245 (intr GPRI32:$src, GPRI32:$src2))]>;
1246 def _v2i32 : TwoInOneOut<opcode, (outs GPRV2I32:$dst),
1247 (ins GPRV2I32:$src, GPRV2I32:$src2),
1248 !strconcat(opcode.Text, " $dst, $src, $src2"),
1249 [(set GPRV2I32:$dst,
1250 (intr GPRV2I32:$src, GPRV2I32:$src2))]>;
1251 def _v4i32 : TwoInOneOut<opcode, (outs GPRV4I32:$dst),
1252 (ins GPRV4I32:$src, GPRV4I32:$src2),
1253 !strconcat(opcode.Text, " $dst, $src, $src2"),
1254 [(set GPRV4I32:$dst,
1255 (intr GPRV4I32:$src, GPRV4I32:$src2))]>;
1256 }
1257
1258 multiclass TernaryIntrinsicInt<ILOpCode opcode, Intrinsic intr>
1259 {
1260 def _i32 : ThreeInOneOut<opcode, (outs GPRI32:$dst),
1261 (ins GPRI32:$src, GPRI32:$src2, GPRI32:$src3),
1262 !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
1263 [(set GPRI32:$dst,
1264 (intr GPRI32:$src, GPRI32:$src2, GPRI32:$src3))]>;
1265 def _v2i32 : ThreeInOneOut<opcode, (outs GPRV2I32:$dst),
1266 (ins GPRV2I32:$src, GPRV2I32:$src2, GPRV2I32:$src3),
1267 !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
1268 [(set GPRV2I32:$dst,
1269 (intr GPRV2I32:$src, GPRV2I32:$src2, GPRV2I32:$src3))]>;
1270 def _v4i32 : ThreeInOneOut<opcode, (outs GPRV4I32:$dst),
1271 (ins GPRV4I32:$src, GPRV4I32:$src2, GPRV4I32:$src3),
1272 !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
1273 [(set GPRV4I32:$dst,
1274 (intr GPRV4I32:$src, GPRV4I32:$src2, GPRV4I32:$src3))]>;
1275 }
1276
1277 multiclass TernaryIntrinsicFloat<ILOpCode opcode, Intrinsic intr>
1278 {
1279 def _f32 : ThreeInOneOut<opcode, (outs GPRF32:$dst),
1280 (ins GPRF32:$src, GPRF32:$src2, GPRF32:$src3),
1281 !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
1282 [(set GPRF32:$dst,
1283 (intr GPRF32:$src, GPRF32:$src2, GPRF32:$src3))]>;
1284 def _v2f32 : ThreeInOneOut<opcode, (outs GPRV2F32:$dst),
1285 (ins GPRV2F32:$src, GPRV2F32:$src2, GPRV2F32:$src3),
1286 !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
1287 [(set GPRV2F32:$dst,
1288 (intr GPRV2F32:$src, GPRV2F32:$src2, GPRV2F32:$src3))]>;
1289 def _v4f32 : ThreeInOneOut<opcode, (outs GPRV4F32:$dst),
1290 (ins GPRV4F32:$src, GPRV4F32:$src2, GPRV4F32:$src3),
1291 !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
1292 [(set GPRV4F32:$dst,
1293 (intr GPRV4F32:$src, GPRV4F32:$src2, GPRV4F32:$src3))]>;
1294 }
1295
1296 multiclass BinaryIntrinsicDoubleScalar<ILOpCode opcode, Intrinsic intr>
1297 {
1298 def _f64 : ThreeInOneOut<opcode, (outs GPRF64:$dst),
1299 (ins GPRF64:$src, GPRF64:$src2),
1300 !strconcat(opcode.Text, " $dst, $src, $src2"),
1301 [(set GPRF64:$dst,
1302 (intr GPRF64:$src, GPRF64:$src2))]>;
1303 }
1304
1305 multiclass TernaryIntrinsicDoubleScalar<ILOpCode opcode, Intrinsic intr>
1306 {
1307 def _f64 : ThreeInOneOut<opcode, (outs GPRF64:$dst),
1308 (ins GPRF64:$src, GPRF64:$src2, GPRF64:$src3),
1309 !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
1310 [(set GPRF64:$dst,
1311 (intr GPRF64:$src, GPRF64:$src2, GPRF64:$src3))]>;
1312 }
1313
1314
1315 multiclass TernaryIntrinsicLongScalar<ILOpCode opcode, Intrinsic intr>
1316 {
1317 def _i64 : ThreeInOneOut<opcode, (outs GPRI64:$dst),
1318 (ins GPRI64:$src, GPRI64:$src2, GPRI64:$src3),
1319 !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
1320 [(set GPRI64:$dst,
1321 (intr GPRI64:$src, GPRI64:$src2, GPRI64:$src3))]>;
1322 }
1323
1324 multiclass QuaternaryIntrinsicInt<ILOpCode opcode, Intrinsic intr>
1325 {
1326 def _i32 : FourInOneOut<opcode, (outs GPRI32:$dst),
1327 (ins GPRI32:$src, GPRI32:$src2, GPRI32:$src3, GPRI32:$src4),
1328 !strconcat(opcode.Text, " $dst, $src, $src2, $src3, $src4"),
1329 [(set GPRI32:$dst,
1330 (intr GPRI32:$src, GPRI32:$src2, GPRI32:$src3, GPRI32:$src4))]>;
1331 def _v2i32 : FourInOneOut<opcode, (outs GPRV2I32:$dst),
1332 (ins GPRV2I32:$src, GPRV2I32:$src2, GPRV2I32:$src3, GPRV2I32:$src4),
1333 !strconcat(opcode.Text, " $dst, $src, $src2, $src3, $src4"),
1334 [(set GPRV2I32:$dst,
1335 (intr GPRV2I32:$src, GPRV2I32:$src2, GPRV2I32:$src3, GPRV2I32:$src4))]>;
1336 def _v4i32 : FourInOneOut<opcode, (outs GPRV4I32:$dst),
1337 (ins GPRV4I32:$src, GPRV4I32:$src2, GPRV4I32:$src3, GPRV4I32:$src4),
1338 !strconcat(opcode.Text, " $dst, $src, $src2, $src3, $src4"),
1339 [(set GPRV4I32:$dst,
1340 (intr GPRV4I32:$src, GPRV4I32:$src2, GPRV4I32:$src3, GPRV4I32:$src4))]>;
1341 }
1342
1343 multiclass UnaryIntrinsicFloatScalar<ILOpCode opcode, Intrinsic intr>
1344 {
1345 def _f32 : OneInOneOut<opcode, (outs GPRF32:$dst),
1346 (ins GPRF32:$src),
1347 !strconcat(opcode.Text, " $dst, $src"),
1348 [(set GPRF32:$dst, (intr GPRF32:$src))]>;
1349 }
1350
1351 multiclass UnaryIntrinsicFloat<ILOpCode opcode, Intrinsic intr>
1352 {
1353 def _f32 : OneInOneOut<opcode, (outs GPRF32:$dst),
1354 (ins GPRF32:$src),
1355 !strconcat(opcode.Text, " $dst, $src"),
1356 [(set GPRF32:$dst, (intr GPRF32:$src))]>;
1357 def _v2f32 : OneInOneOut<opcode, (outs GPRV2F32:$dst),
1358 (ins GPRV2F32:$src),
1359 !strconcat(opcode.Text, " $dst, $src"),
1360 [(set GPRV2F32:$dst, (intr GPRV2F32:$src))]>;
1361 def _v4f32 : OneInOneOut<opcode, (outs GPRV4F32:$dst),
1362 (ins GPRV4F32:$src),
1363 !strconcat(opcode.Text, " $dst, $src"),
1364 [(set GPRV4F32:$dst, (intr GPRV4F32:$src))]>;
1365 }
1366
1367 multiclass BinaryIntrinsicFloatScalar<ILOpCode opcode, Intrinsic intr>
1368 {
1369 def _f32 : TwoInOneOut<opcode, (outs GPRF32:$dst),
1370 (ins GPRF32:$src, GPRF32:$src2),
1371 !strconcat(opcode.Text, " $dst, $src, $src2"),
1372 [(set GPRF32:$dst,
1373 (intr GPRF32:$src, GPRF32:$src2))]>;
1374 }
1375 multiclass BinaryIntrinsicFloat<ILOpCode opcode, Intrinsic intr>
1376 {
1377 def _f32 : TwoInOneOut<opcode, (outs GPRF32:$dst),
1378 (ins GPRF32:$src, GPRF32:$src2),
1379 !strconcat(opcode.Text, " $dst, $src, $src2"),
1380 [(set GPRF32:$dst,
1381 (intr GPRF32:$src, GPRF32:$src2))]>;
1382 def _v2f32 : TwoInOneOut<opcode, (outs GPRV2F32:$dst),
1383 (ins GPRV2F32:$src, GPRV2F32:$src2),
1384 !strconcat(opcode.Text, " $dst, $src, $src2"),
1385 [(set GPRV2F32:$dst,
1386 (intr GPRV2F32:$src, GPRV2F32:$src2))]>;
1387 def _v4f32 : TwoInOneOut<opcode, (outs GPRV4F32:$dst),
1388 (ins GPRV4F32:$src, GPRV4F32:$src2),
1389 !strconcat(opcode.Text, " $dst, $src, $src2"),
1390 [(set GPRV4F32:$dst,
1391 (intr GPRV4F32:$src, GPRV4F32:$src2))]>;
1392 }
1393
1394 multiclass UnaryIntrinsicDoubleScalar<ILOpCode opcode, Intrinsic intr>
1395 {
1396 def _f64 : OneInOneOut<opcode, (outs GPRF64:$dst),
1397 (ins GPRF64:$src),
1398 !strconcat(opcode.Text, " $dst, $src"),
1399 [(set GPRF64:$dst, (intr GPRF64:$src))]>;
1400 }
1401
1402 multiclass UnaryIntrinsicDouble<ILOpCode opcode, Intrinsic intr>
1403 {
1404 def _f64 : OneInOneOut<opcode, (outs GPRF64:$dst),
1405 (ins GPRF64:$src),
1406 !strconcat(opcode.Text, " $dst, $src"),
1407 [(set GPRF64:$dst, (intr GPRF64:$src))]>;
1408 def _v2f64 : OneInOneOut<opcode, (outs GPRV2F64:$dst),
1409 (ins GPRV2F64:$src),
1410 !strconcat(opcode.Text, " $dst, $src"),
1411 [(set GPRV2F64:$dst, (intr GPRV2F64:$src))]>;
1412 }
1413
1414 multiclass BinaryIntrinsicDouble<ILOpCode opcode, Intrinsic intr>
1415 {
1416 def _f64 : TwoInOneOut<opcode, (outs GPRF64:$dst),
1417 (ins GPRF64:$src, GPRF64:$src2),
1418 !strconcat(opcode.Text, " $dst, $src, $src2"),
1419 [(set GPRF64:$dst,
1420 (intr GPRF64:$src, GPRF64:$src2))]>;
1421 def _v2f64 : TwoInOneOut<opcode, (outs GPRV2F64:$dst),
1422 (ins GPRV2F64:$src, GPRV2F64:$src2),
1423 !strconcat(opcode.Text, " $dst, $src, $src2"),
1424 [(set GPRV2F64:$dst,
1425 (intr GPRV2F64:$src, GPRV2F64:$src2))]>;
1426 }
1427
1428 multiclass TernaryIntrinsicDouble<ILOpCode opcode, Intrinsic intr>
1429 {
1430 def _f64 : TwoInOneOut<opcode, (outs GPRF64:$dst),
1431 (ins GPRF64:$src, GPRF64:$src2, GPRF64:$src3),
1432 !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
1433 [(set GPRF64:$dst,
1434 (intr GPRF64:$src, GPRF64:$src2, GPRF64:$src3))]>;
1435 def _v2f64 : TwoInOneOut<opcode, (outs GPRV2F64:$dst),
1436 (ins GPRV2F64:$src, GPRV2F64:$src2, GPRV2F64:$src3),
1437 !strconcat(opcode.Text, " $dst, $src, $src2, $src3"),
1438 [(set GPRV2F64:$dst,
1439 (intr GPRV2F64:$src, GPRV2F64:$src2, GPRV2F64:$src3))]>;
1440 }