blob: 73691324cc67c2713f001e2fe99bffa813c87264 [file] [log] [blame]
Bob Wilsone60fee02009-06-22 23:27:02 +00001//===- ARMInstrNEON.td - NEON support for ARM -----------------------------===//
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//
10// This file describes the ARM NEON instruction set.
11//
12//===----------------------------------------------------------------------===//
13
14//===----------------------------------------------------------------------===//
15// NEON-specific DAG Nodes.
16//===----------------------------------------------------------------------===//
17
18def SDTARMVCMP : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisSameAs<1, 2>]>;
19
20def NEONvceq : SDNode<"ARMISD::VCEQ", SDTARMVCMP>;
21def NEONvcge : SDNode<"ARMISD::VCGE", SDTARMVCMP>;
22def NEONvcgeu : SDNode<"ARMISD::VCGEU", SDTARMVCMP>;
23def NEONvcgt : SDNode<"ARMISD::VCGT", SDTARMVCMP>;
24def NEONvcgtu : SDNode<"ARMISD::VCGTU", SDTARMVCMP>;
25def NEONvtst : SDNode<"ARMISD::VTST", SDTARMVCMP>;
26
27// Types for vector shift by immediates. The "SHX" version is for long and
28// narrow operations where the source and destination vectors have different
29// types. The "SHINS" version is for shift and insert operations.
30def SDTARMVSH : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisSameAs<0, 1>,
31 SDTCisVT<2, i32>]>;
32def SDTARMVSHX : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisInt<1>,
33 SDTCisVT<2, i32>]>;
34def SDTARMVSHINS : SDTypeProfile<1, 3, [SDTCisInt<0>, SDTCisSameAs<0, 1>,
35 SDTCisSameAs<0, 2>, SDTCisVT<3, i32>]>;
36
37def NEONvshl : SDNode<"ARMISD::VSHL", SDTARMVSH>;
38def NEONvshrs : SDNode<"ARMISD::VSHRs", SDTARMVSH>;
39def NEONvshru : SDNode<"ARMISD::VSHRu", SDTARMVSH>;
40def NEONvshlls : SDNode<"ARMISD::VSHLLs", SDTARMVSHX>;
41def NEONvshllu : SDNode<"ARMISD::VSHLLu", SDTARMVSHX>;
42def NEONvshlli : SDNode<"ARMISD::VSHLLi", SDTARMVSHX>;
43def NEONvshrn : SDNode<"ARMISD::VSHRN", SDTARMVSHX>;
44
45def NEONvrshrs : SDNode<"ARMISD::VRSHRs", SDTARMVSH>;
46def NEONvrshru : SDNode<"ARMISD::VRSHRu", SDTARMVSH>;
47def NEONvrshrn : SDNode<"ARMISD::VRSHRN", SDTARMVSHX>;
48
49def NEONvqshls : SDNode<"ARMISD::VQSHLs", SDTARMVSH>;
50def NEONvqshlu : SDNode<"ARMISD::VQSHLu", SDTARMVSH>;
51def NEONvqshlsu : SDNode<"ARMISD::VQSHLsu", SDTARMVSH>;
52def NEONvqshrns : SDNode<"ARMISD::VQSHRNs", SDTARMVSHX>;
53def NEONvqshrnu : SDNode<"ARMISD::VQSHRNu", SDTARMVSHX>;
54def NEONvqshrnsu : SDNode<"ARMISD::VQSHRNsu", SDTARMVSHX>;
55
56def NEONvqrshrns : SDNode<"ARMISD::VQRSHRNs", SDTARMVSHX>;
57def NEONvqrshrnu : SDNode<"ARMISD::VQRSHRNu", SDTARMVSHX>;
58def NEONvqrshrnsu : SDNode<"ARMISD::VQRSHRNsu", SDTARMVSHX>;
59
60def NEONvsli : SDNode<"ARMISD::VSLI", SDTARMVSHINS>;
61def NEONvsri : SDNode<"ARMISD::VSRI", SDTARMVSHINS>;
62
63def SDTARMVGETLN : SDTypeProfile<1, 2, [SDTCisVT<0, i32>, SDTCisInt<1>,
64 SDTCisVT<2, i32>]>;
65def NEONvgetlaneu : SDNode<"ARMISD::VGETLANEu", SDTARMVGETLN>;
66def NEONvgetlanes : SDNode<"ARMISD::VGETLANEs", SDTARMVGETLN>;
67
Bob Wilsonf4f1a272009-08-14 05:13:08 +000068def NEONvdup : SDNode<"ARMISD::VDUP", SDTypeProfile<1, 1, [SDTCisVec<0>]>>;
69
Bob Wilson206f6c42009-08-14 05:08:32 +000070// VDUPLANE can produce a quad-register result from a double-register source,
71// so the result is not constrained to match the source.
72def NEONvduplane : SDNode<"ARMISD::VDUPLANE",
73 SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisVec<1>,
74 SDTCisVT<2, i32>]>>;
Bob Wilsone60fee02009-06-22 23:27:02 +000075
Bob Wilson3ac39132009-08-19 17:03:43 +000076def SDTARMVEXT : SDTypeProfile<1, 3, [SDTCisVec<0>, SDTCisSameAs<0, 1>,
77 SDTCisSameAs<0, 2>, SDTCisVT<3, i32>]>;
78def NEONvext : SDNode<"ARMISD::VEXT", SDTARMVEXT>;
79
Bob Wilson08479272009-08-12 22:31:50 +000080def SDTARMVSHUF : SDTypeProfile<1, 1, [SDTCisVec<0>, SDTCisSameAs<0, 1>]>;
81def NEONvrev64 : SDNode<"ARMISD::VREV64", SDTARMVSHUF>;
82def NEONvrev32 : SDNode<"ARMISD::VREV32", SDTARMVSHUF>;
83def NEONvrev16 : SDNode<"ARMISD::VREV16", SDTARMVSHUF>;
84
Anton Korobeynikovbe262ae2009-08-21 12:40:50 +000085def SDTARMVSHUF2 : SDTypeProfile<2, 2, [SDTCisVec<0>, SDTCisSameAs<0, 1>,
86 SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>]>;
Anton Korobeynikov394bbb82009-08-21 12:41:42 +000087def NEONzip : SDNode<"ARMISD::VZIP", SDTARMVSHUF2>;
88def NEONuzp : SDNode<"ARMISD::VUZP", SDTARMVSHUF2>;
89def NEONtrn : SDNode<"ARMISD::VTRN", SDTARMVSHUF2>;
Anton Korobeynikovbe262ae2009-08-21 12:40:50 +000090
Bob Wilsone60fee02009-06-22 23:27:02 +000091//===----------------------------------------------------------------------===//
92// NEON operand definitions
93//===----------------------------------------------------------------------===//
94
95// addrmode_neonldstm := reg
96//
97/* TODO: Take advantage of vldm.
98def addrmode_neonldstm : Operand<i32>,
99 ComplexPattern<i32, 2, "SelectAddrModeNeonLdStM", []> {
100 let PrintMethod = "printAddrNeonLdStMOperand";
101 let MIOperandInfo = (ops GPR, i32imm);
102}
103*/
104
105//===----------------------------------------------------------------------===//
106// NEON load / store instructions
107//===----------------------------------------------------------------------===//
108
Bob Wilsonee27bec2009-08-12 00:49:01 +0000109/* TODO: Take advantage of vldm.
Evan Cheng7c8d5ea2009-10-01 08:22:27 +0000110let mayLoad = 1, hasExtraDefRegAllocReq = 1 in {
Bob Wilsone60fee02009-06-22 23:27:02 +0000111def VLDMD : NI<(outs),
112 (ins addrmode_neonldstm:$addr, reglist:$dst1, variable_ops),
David Goodwin78caa122009-09-23 21:38:08 +0000113 IIC_fpLoadm,
Bob Wilsone60fee02009-06-22 23:27:02 +0000114 "vldm${addr:submode} ${addr:base}, $dst1",
Evan Chengdabc6c02009-07-08 22:51:32 +0000115 []> {
116 let Inst{27-25} = 0b110;
117 let Inst{20} = 1;
118 let Inst{11-9} = 0b101;
119}
Bob Wilsone60fee02009-06-22 23:27:02 +0000120
121def VLDMS : NI<(outs),
122 (ins addrmode_neonldstm:$addr, reglist:$dst1, variable_ops),
David Goodwin78caa122009-09-23 21:38:08 +0000123 IIC_fpLoadm,
Bob Wilsone60fee02009-06-22 23:27:02 +0000124 "vldm${addr:submode} ${addr:base}, $dst1",
Evan Chengdabc6c02009-07-08 22:51:32 +0000125 []> {
126 let Inst{27-25} = 0b110;
127 let Inst{20} = 1;
128 let Inst{11-9} = 0b101;
129}
Bob Wilson66b34002009-08-12 17:04:56 +0000130}
Bob Wilsone60fee02009-06-22 23:27:02 +0000131*/
132
133// Use vldmia to load a Q register as a D register pair.
Anton Korobeynikov3f087662009-08-08 13:35:48 +0000134def VLDRQ : NI4<(outs QPR:$dst), (ins addrmode4:$addr),
David Goodwin78caa122009-09-23 21:38:08 +0000135 IIC_fpLoadm,
Bob Wilsone60fee02009-06-22 23:27:02 +0000136 "vldmia $addr, ${dst:dregpair}",
Anton Korobeynikov3f087662009-08-08 13:35:48 +0000137 [(set QPR:$dst, (v2f64 (load addrmode4:$addr)))]> {
Evan Chengdabc6c02009-07-08 22:51:32 +0000138 let Inst{27-25} = 0b110;
139 let Inst{24} = 0; // P bit
140 let Inst{23} = 1; // U bit
141 let Inst{20} = 1;
142 let Inst{11-9} = 0b101;
143}
Bob Wilsone60fee02009-06-22 23:27:02 +0000144
Bob Wilson66b34002009-08-12 17:04:56 +0000145// Use vstmia to store a Q register as a D register pair.
146def VSTRQ : NI4<(outs), (ins QPR:$src, addrmode4:$addr),
David Goodwin78caa122009-09-23 21:38:08 +0000147 IIC_fpStorem,
Bob Wilson66b34002009-08-12 17:04:56 +0000148 "vstmia $addr, ${src:dregpair}",
149 [(store (v2f64 QPR:$src), addrmode4:$addr)]> {
150 let Inst{27-25} = 0b110;
151 let Inst{24} = 0; // P bit
152 let Inst{23} = 1; // U bit
153 let Inst{20} = 0;
154 let Inst{11-9} = 0b101;
155}
156
Bob Wilsoned592c02009-07-08 18:11:30 +0000157// VLD1 : Vector Load (multiple single elements)
158class VLD1D<string OpcodeStr, ValueType Ty, Intrinsic IntOp>
David Goodwin78caa122009-09-23 21:38:08 +0000159 : NLdSt<(outs DPR:$dst), (ins addrmode6:$addr), IIC_VLD1,
Bob Wilson316062a2009-08-25 17:46:06 +0000160 !strconcat(OpcodeStr, "\t\\{$dst\\}, $addr"), "",
Bob Wilsond3902f72009-07-29 16:39:22 +0000161 [(set DPR:$dst, (Ty (IntOp addrmode6:$addr)))]>;
Bob Wilsoned592c02009-07-08 18:11:30 +0000162class VLD1Q<string OpcodeStr, ValueType Ty, Intrinsic IntOp>
David Goodwin78caa122009-09-23 21:38:08 +0000163 : NLdSt<(outs QPR:$dst), (ins addrmode6:$addr), IIC_VLD1,
Bob Wilson316062a2009-08-25 17:46:06 +0000164 !strconcat(OpcodeStr, "\t${dst:dregpair}, $addr"), "",
Bob Wilsond3902f72009-07-29 16:39:22 +0000165 [(set QPR:$dst, (Ty (IntOp addrmode6:$addr)))]>;
Bob Wilsoned592c02009-07-08 18:11:30 +0000166
Bob Wilson8f10b3f2009-08-11 05:39:44 +0000167def VLD1d8 : VLD1D<"vld1.8", v8i8, int_arm_neon_vld1>;
168def VLD1d16 : VLD1D<"vld1.16", v4i16, int_arm_neon_vld1>;
169def VLD1d32 : VLD1D<"vld1.32", v2i32, int_arm_neon_vld1>;
170def VLD1df : VLD1D<"vld1.32", v2f32, int_arm_neon_vld1>;
171def VLD1d64 : VLD1D<"vld1.64", v1i64, int_arm_neon_vld1>;
Bob Wilsoned592c02009-07-08 18:11:30 +0000172
Bob Wilson8f10b3f2009-08-11 05:39:44 +0000173def VLD1q8 : VLD1Q<"vld1.8", v16i8, int_arm_neon_vld1>;
174def VLD1q16 : VLD1Q<"vld1.16", v8i16, int_arm_neon_vld1>;
175def VLD1q32 : VLD1Q<"vld1.32", v4i32, int_arm_neon_vld1>;
176def VLD1qf : VLD1Q<"vld1.32", v4f32, int_arm_neon_vld1>;
177def VLD1q64 : VLD1Q<"vld1.64", v2i64, int_arm_neon_vld1>;
Bob Wilsoned592c02009-07-08 18:11:30 +0000178
Evan Cheng7c8d5ea2009-10-01 08:22:27 +0000179let mayLoad = 1, hasExtraDefRegAllocReq = 1 in {
Bob Wilson66b34002009-08-12 17:04:56 +0000180
Bob Wilson055a90d2009-08-05 00:49:09 +0000181// VLD2 : Vector Load (multiple 2-element structures)
182class VLD2D<string OpcodeStr>
David Goodwin78caa122009-09-23 21:38:08 +0000183 : NLdSt<(outs DPR:$dst1, DPR:$dst2), (ins addrmode6:$addr), IIC_VLD2,
Bob Wilson316062a2009-08-25 17:46:06 +0000184 !strconcat(OpcodeStr, "\t\\{$dst1,$dst2\\}, $addr"), "", []>;
Bob Wilsone9829ca2009-10-06 22:01:59 +0000185class VLD2Q<string OpcodeStr>
186 : NLdSt<(outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4),
187 (ins addrmode6:$addr), IIC_VLD2,
188 !strconcat(OpcodeStr, "\t\\{$dst1,$dst2,$dst3,$dst4\\}, $addr"),
189 "", []>;
Bob Wilson055a90d2009-08-05 00:49:09 +0000190
191def VLD2d8 : VLD2D<"vld2.8">;
192def VLD2d16 : VLD2D<"vld2.16">;
193def VLD2d32 : VLD2D<"vld2.32">;
Bob Wilson055a90d2009-08-05 00:49:09 +0000194
Bob Wilsone9829ca2009-10-06 22:01:59 +0000195def VLD2q8 : VLD2Q<"vld2.8">;
196def VLD2q16 : VLD2Q<"vld2.16">;
197def VLD2q32 : VLD2Q<"vld2.32">;
198
Bob Wilson055a90d2009-08-05 00:49:09 +0000199// VLD3 : Vector Load (multiple 3-element structures)
200class VLD3D<string OpcodeStr>
201 : NLdSt<(outs DPR:$dst1, DPR:$dst2, DPR:$dst3), (ins addrmode6:$addr),
David Goodwin78caa122009-09-23 21:38:08 +0000202 IIC_VLD3,
Bob Wilson316062a2009-08-25 17:46:06 +0000203 !strconcat(OpcodeStr, "\t\\{$dst1,$dst2,$dst3\\}, $addr"), "", []>;
Bob Wilsona8b43622009-10-07 17:24:55 +0000204class VLD3WB<string OpcodeStr>
205 : NLdSt<(outs DPR:$dst1, DPR:$dst2, DPR:$dst3, GPR:$wb),
206 (ins addrmode6:$addr), IIC_VLD3,
207 !strconcat(OpcodeStr, "\t\\{$dst1,$dst2,$dst3\\}, $addr"),
208 "$addr.addr = $wb", []>;
Bob Wilson055a90d2009-08-05 00:49:09 +0000209
210def VLD3d8 : VLD3D<"vld3.8">;
211def VLD3d16 : VLD3D<"vld3.16">;
212def VLD3d32 : VLD3D<"vld3.32">;
Bob Wilson055a90d2009-08-05 00:49:09 +0000213
Bob Wilsona8b43622009-10-07 17:24:55 +0000214// vld3 to double-spaced even registers.
215def VLD3q8a : VLD3WB<"vld3.8">;
216def VLD3q16a : VLD3WB<"vld3.16">;
217def VLD3q32a : VLD3WB<"vld3.32">;
218
219// vld3 to double-spaced odd registers.
220def VLD3q8b : VLD3WB<"vld3.8">;
221def VLD3q16b : VLD3WB<"vld3.16">;
222def VLD3q32b : VLD3WB<"vld3.32">;
223
Bob Wilson055a90d2009-08-05 00:49:09 +0000224// VLD4 : Vector Load (multiple 4-element structures)
225class VLD4D<string OpcodeStr>
226 : NLdSt<(outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4),
David Goodwin78caa122009-09-23 21:38:08 +0000227 (ins addrmode6:$addr), IIC_VLD4,
Bob Wilson316062a2009-08-25 17:46:06 +0000228 !strconcat(OpcodeStr, "\t\\{$dst1,$dst2,$dst3,$dst4\\}, $addr"),
229 "", []>;
Bob Wilson004a2e12009-10-07 18:09:32 +0000230class VLD4WB<string OpcodeStr>
231 : NLdSt<(outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
232 (ins addrmode6:$addr), IIC_VLD4,
233 !strconcat(OpcodeStr, "\t\\{$dst1,$dst2,$dst3,$dst4\\}, $addr"),
234 "$addr.addr = $wb", []>;
Bob Wilson055a90d2009-08-05 00:49:09 +0000235
236def VLD4d8 : VLD4D<"vld4.8">;
237def VLD4d16 : VLD4D<"vld4.16">;
238def VLD4d32 : VLD4D<"vld4.32">;
Bob Wilsond14b8b62009-09-01 04:26:28 +0000239
Bob Wilson004a2e12009-10-07 18:09:32 +0000240// vld4 to double-spaced even registers.
241def VLD4q8a : VLD4WB<"vld4.8">;
242def VLD4q16a : VLD4WB<"vld4.16">;
243def VLD4q32a : VLD4WB<"vld4.32">;
244
245// vld4 to double-spaced odd registers.
246def VLD4q8b : VLD4WB<"vld4.8">;
247def VLD4q16b : VLD4WB<"vld4.16">;
248def VLD4q32b : VLD4WB<"vld4.32">;
249
Bob Wilsond14b8b62009-09-01 04:26:28 +0000250// VLD2LN : Vector Load (single 2-element structure to one lane)
251class VLD2LND<string OpcodeStr>
252 : NLdSt<(outs DPR:$dst1, DPR:$dst2),
253 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, nohash_imm:$lane),
David Goodwin78caa122009-09-23 21:38:08 +0000254 IIC_VLD2,
Bob Wilsond14b8b62009-09-01 04:26:28 +0000255 !strconcat(OpcodeStr, "\t\\{$dst1[$lane],$dst2[$lane]\\}, $addr"),
256 "$src1 = $dst1, $src2 = $dst2", []>;
257
258def VLD2LNd8 : VLD2LND<"vld2.8">;
259def VLD2LNd16 : VLD2LND<"vld2.16">;
260def VLD2LNd32 : VLD2LND<"vld2.32">;
261
262// VLD3LN : Vector Load (single 3-element structure to one lane)
263class VLD3LND<string OpcodeStr>
264 : NLdSt<(outs DPR:$dst1, DPR:$dst2, DPR:$dst3),
265 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3,
David Goodwin78caa122009-09-23 21:38:08 +0000266 nohash_imm:$lane), IIC_VLD3,
Bob Wilsond14b8b62009-09-01 04:26:28 +0000267 !strconcat(OpcodeStr,
268 "\t\\{$dst1[$lane],$dst2[$lane],$dst3[$lane]\\}, $addr"),
269 "$src1 = $dst1, $src2 = $dst2, $src3 = $dst3", []>;
270
271def VLD3LNd8 : VLD3LND<"vld3.8">;
272def VLD3LNd16 : VLD3LND<"vld3.16">;
273def VLD3LNd32 : VLD3LND<"vld3.32">;
274
275// VLD4LN : Vector Load (single 4-element structure to one lane)
276class VLD4LND<string OpcodeStr>
277 : NLdSt<(outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4),
278 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4,
David Goodwin78caa122009-09-23 21:38:08 +0000279 nohash_imm:$lane), IIC_VLD4,
Bob Wilsond14b8b62009-09-01 04:26:28 +0000280 !strconcat(OpcodeStr,
281 "\t\\{$dst1[$lane],$dst2[$lane],$dst3[$lane],$dst4[$lane]\\}, $addr"),
282 "$src1 = $dst1, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4", []>;
283
284def VLD4LNd8 : VLD4LND<"vld4.8">;
285def VLD4LNd16 : VLD4LND<"vld4.16">;
286def VLD4LNd32 : VLD4LND<"vld4.32">;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +0000287} // mayLoad = 1, hasExtraDefRegAllocReq = 1
Bob Wilsonee27bec2009-08-12 00:49:01 +0000288
Bob Wilson6a209cd2009-08-06 18:47:44 +0000289// VST1 : Vector Store (multiple single elements)
290class VST1D<string OpcodeStr, ValueType Ty, Intrinsic IntOp>
David Goodwin78caa122009-09-23 21:38:08 +0000291 : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src), IIC_VST,
Bob Wilson316062a2009-08-25 17:46:06 +0000292 !strconcat(OpcodeStr, "\t\\{$src\\}, $addr"), "",
Bob Wilson6a209cd2009-08-06 18:47:44 +0000293 [(IntOp addrmode6:$addr, (Ty DPR:$src))]>;
294class VST1Q<string OpcodeStr, ValueType Ty, Intrinsic IntOp>
David Goodwin78caa122009-09-23 21:38:08 +0000295 : NLdSt<(outs), (ins addrmode6:$addr, QPR:$src), IIC_VST,
Bob Wilson316062a2009-08-25 17:46:06 +0000296 !strconcat(OpcodeStr, "\t${src:dregpair}, $addr"), "",
Bob Wilson6a209cd2009-08-06 18:47:44 +0000297 [(IntOp addrmode6:$addr, (Ty QPR:$src))]>;
298
Evan Cheng7c8d5ea2009-10-01 08:22:27 +0000299let hasExtraSrcRegAllocReq = 1 in {
Bob Wilson8f10b3f2009-08-11 05:39:44 +0000300def VST1d8 : VST1D<"vst1.8", v8i8, int_arm_neon_vst1>;
301def VST1d16 : VST1D<"vst1.16", v4i16, int_arm_neon_vst1>;
302def VST1d32 : VST1D<"vst1.32", v2i32, int_arm_neon_vst1>;
303def VST1df : VST1D<"vst1.32", v2f32, int_arm_neon_vst1>;
304def VST1d64 : VST1D<"vst1.64", v1i64, int_arm_neon_vst1>;
Bob Wilson6a209cd2009-08-06 18:47:44 +0000305
Bob Wilson8f10b3f2009-08-11 05:39:44 +0000306def VST1q8 : VST1Q<"vst1.8", v16i8, int_arm_neon_vst1>;
307def VST1q16 : VST1Q<"vst1.16", v8i16, int_arm_neon_vst1>;
308def VST1q32 : VST1Q<"vst1.32", v4i32, int_arm_neon_vst1>;
309def VST1qf : VST1Q<"vst1.32", v4f32, int_arm_neon_vst1>;
310def VST1q64 : VST1Q<"vst1.64", v2i64, int_arm_neon_vst1>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +0000311} // hasExtraSrcRegAllocReq
Bob Wilson6a209cd2009-08-06 18:47:44 +0000312
Evan Cheng7c8d5ea2009-10-01 08:22:27 +0000313let mayStore = 1, hasExtraSrcRegAllocReq = 1 in {
Bob Wilson66b34002009-08-12 17:04:56 +0000314
Bob Wilson6a209cd2009-08-06 18:47:44 +0000315// VST2 : Vector Store (multiple 2-element structures)
316class VST2D<string OpcodeStr>
David Goodwin78caa122009-09-23 21:38:08 +0000317 : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src1, DPR:$src2), IIC_VST,
Bob Wilson316062a2009-08-25 17:46:06 +0000318 !strconcat(OpcodeStr, "\t\\{$src1,$src2\\}, $addr"), "", []>;
Bob Wilson5fa67d352009-10-07 18:47:39 +0000319class VST2Q<string OpcodeStr>
320 : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3,
321 DPR:$src4), IIC_VST,
322 !strconcat(OpcodeStr, "\t\\{$src1,$src2,$src3,$src4\\}, $addr"),
323 "", []>;
Bob Wilson6a209cd2009-08-06 18:47:44 +0000324
325def VST2d8 : VST2D<"vst2.8">;
326def VST2d16 : VST2D<"vst2.16">;
327def VST2d32 : VST2D<"vst2.32">;
328
Bob Wilson5fa67d352009-10-07 18:47:39 +0000329def VST2q8 : VST2Q<"vst2.8">;
330def VST2q16 : VST2Q<"vst2.16">;
331def VST2q32 : VST2Q<"vst2.32">;
332
Bob Wilson6a209cd2009-08-06 18:47:44 +0000333// VST3 : Vector Store (multiple 3-element structures)
334class VST3D<string OpcodeStr>
335 : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3),
David Goodwin78caa122009-09-23 21:38:08 +0000336 IIC_VST,
Bob Wilson316062a2009-08-25 17:46:06 +0000337 !strconcat(OpcodeStr, "\t\\{$src1,$src2,$src3\\}, $addr"), "", []>;
Bob Wilson2a85bd12009-10-07 20:30:08 +0000338class VST3WB<string OpcodeStr>
339 : NLdSt<(outs GPR:$wb), (ins addrmode6:$addr, DPR:$src1, DPR:$src2,
340 DPR:$src3), IIC_VST,
341 !strconcat(OpcodeStr, "\t\\{$src1,$src2,$src3\\}, $addr"),
342 "$addr.addr = $wb", []>;
Bob Wilson6a209cd2009-08-06 18:47:44 +0000343
344def VST3d8 : VST3D<"vst3.8">;
345def VST3d16 : VST3D<"vst3.16">;
346def VST3d32 : VST3D<"vst3.32">;
347
Bob Wilson2a85bd12009-10-07 20:30:08 +0000348// vst3 to double-spaced even registers.
349def VST3q8a : VST3WB<"vst3.8">;
350def VST3q16a : VST3WB<"vst3.16">;
351def VST3q32a : VST3WB<"vst3.32">;
352
353// vst3 to double-spaced odd registers.
354def VST3q8b : VST3WB<"vst3.8">;
355def VST3q16b : VST3WB<"vst3.16">;
356def VST3q32b : VST3WB<"vst3.32">;
357
Bob Wilson6a209cd2009-08-06 18:47:44 +0000358// VST4 : Vector Store (multiple 4-element structures)
359class VST4D<string OpcodeStr>
360 : NLdSt<(outs), (ins addrmode6:$addr,
David Goodwin78caa122009-09-23 21:38:08 +0000361 DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST,
Bob Wilson316062a2009-08-25 17:46:06 +0000362 !strconcat(OpcodeStr, "\t\\{$src1,$src2,$src3,$src4\\}, $addr"),
363 "", []>;
Bob Wilson931c76b2009-10-07 20:49:18 +0000364class VST4WB<string OpcodeStr>
365 : NLdSt<(outs GPR:$wb), (ins addrmode6:$addr, DPR:$src1, DPR:$src2,
366 DPR:$src3, DPR:$src4), IIC_VST,
367 !strconcat(OpcodeStr, "\t\\{$src1,$src2,$src3,$src4\\}, $addr"),
368 "$addr.addr = $wb", []>;
Bob Wilson6a209cd2009-08-06 18:47:44 +0000369
370def VST4d8 : VST4D<"vst4.8">;
371def VST4d16 : VST4D<"vst4.16">;
372def VST4d32 : VST4D<"vst4.32">;
Bob Wilsonc2d65852009-09-01 18:51:56 +0000373
Bob Wilson931c76b2009-10-07 20:49:18 +0000374// vst4 to double-spaced even registers.
375def VST4q8a : VST4WB<"vst4.8">;
376def VST4q16a : VST4WB<"vst4.16">;
377def VST4q32a : VST4WB<"vst4.32">;
378
379// vst4 to double-spaced odd registers.
380def VST4q8b : VST4WB<"vst4.8">;
381def VST4q16b : VST4WB<"vst4.16">;
382def VST4q32b : VST4WB<"vst4.32">;
383
Bob Wilsonc2d65852009-09-01 18:51:56 +0000384// VST2LN : Vector Store (single 2-element structure from one lane)
385class VST2LND<string OpcodeStr>
386 : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src1, DPR:$src2, nohash_imm:$lane),
David Goodwin78caa122009-09-23 21:38:08 +0000387 IIC_VST,
Bob Wilsonc2d65852009-09-01 18:51:56 +0000388 !strconcat(OpcodeStr, "\t\\{$src1[$lane],$src2[$lane]\\}, $addr"),
389 "", []>;
390
391def VST2LNd8 : VST2LND<"vst2.8">;
392def VST2LNd16 : VST2LND<"vst2.16">;
393def VST2LNd32 : VST2LND<"vst2.32">;
394
395// VST3LN : Vector Store (single 3-element structure from one lane)
396class VST3LND<string OpcodeStr>
397 : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3,
David Goodwin78caa122009-09-23 21:38:08 +0000398 nohash_imm:$lane), IIC_VST,
Bob Wilsonc2d65852009-09-01 18:51:56 +0000399 !strconcat(OpcodeStr,
400 "\t\\{$src1[$lane],$src2[$lane],$src3[$lane]\\}, $addr"), "", []>;
401
402def VST3LNd8 : VST3LND<"vst3.8">;
403def VST3LNd16 : VST3LND<"vst3.16">;
404def VST3LNd32 : VST3LND<"vst3.32">;
405
406// VST4LN : Vector Store (single 4-element structure from one lane)
407class VST4LND<string OpcodeStr>
408 : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3,
David Goodwin78caa122009-09-23 21:38:08 +0000409 DPR:$src4, nohash_imm:$lane), IIC_VST,
Bob Wilsonc2d65852009-09-01 18:51:56 +0000410 !strconcat(OpcodeStr,
411 "\t\\{$src1[$lane],$src2[$lane],$src3[$lane],$src4[$lane]\\}, $addr"),
412 "", []>;
413
414def VST4LNd8 : VST4LND<"vst4.8">;
415def VST4LNd16 : VST4LND<"vst4.16">;
416def VST4LNd32 : VST4LND<"vst4.32">;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +0000417} // mayStore = 1, hasExtraSrcRegAllocReq = 1
Bob Wilson6a209cd2009-08-06 18:47:44 +0000418
Bob Wilsoned592c02009-07-08 18:11:30 +0000419
Bob Wilsone60fee02009-06-22 23:27:02 +0000420//===----------------------------------------------------------------------===//
421// NEON pattern fragments
422//===----------------------------------------------------------------------===//
423
424// Extract D sub-registers of Q registers.
425// (arm_dsubreg_0 is 5; arm_dsubreg_1 is 6)
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000426def DSubReg_i8_reg : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000427 return CurDAG->getTargetConstant(5 + N->getZExtValue() / 8, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000428}]>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000429def DSubReg_i16_reg : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000430 return CurDAG->getTargetConstant(5 + N->getZExtValue() / 4, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000431}]>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000432def DSubReg_i32_reg : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000433 return CurDAG->getTargetConstant(5 + N->getZExtValue() / 2, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000434}]>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000435def DSubReg_f64_reg : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000436 return CurDAG->getTargetConstant(5 + N->getZExtValue(), MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000437}]>;
Anton Korobeynikovb261a192009-09-02 21:21:28 +0000438def DSubReg_f64_other_reg : SDNodeXForm<imm, [{
439 return CurDAG->getTargetConstant(5 + (1 - N->getZExtValue()), MVT::i32);
440}]>;
Bob Wilsone60fee02009-06-22 23:27:02 +0000441
Anton Korobeynikov44e0a6c2009-08-28 23:41:26 +0000442// Extract S sub-registers of Q/D registers.
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000443// (arm_ssubreg_0 is 1; arm_ssubreg_1 is 2; etc.)
444def SSubReg_f32_reg : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000445 return CurDAG->getTargetConstant(1 + N->getZExtValue(), MVT::i32);
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000446}]>;
447
Bob Wilsone60fee02009-06-22 23:27:02 +0000448// Translate lane numbers from Q registers to D subregs.
449def SubReg_i8_lane : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000450 return CurDAG->getTargetConstant(N->getZExtValue() & 7, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000451}]>;
452def SubReg_i16_lane : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000453 return CurDAG->getTargetConstant(N->getZExtValue() & 3, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000454}]>;
455def SubReg_i32_lane : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000456 return CurDAG->getTargetConstant(N->getZExtValue() & 1, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000457}]>;
458
459//===----------------------------------------------------------------------===//
460// Instruction Classes
461//===----------------------------------------------------------------------===//
462
463// Basic 2-register operations, both double- and quad-register.
464class N2VD<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
465 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
466 ValueType ResTy, ValueType OpTy, SDNode OpNode>
467 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +0000468 (ins DPR:$src), IIC_VUNAD, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000469 [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src))))]>;
470class N2VQ<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
471 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
472 ValueType ResTy, ValueType OpTy, SDNode OpNode>
473 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +0000474 (ins QPR:$src), IIC_VUNAQ, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000475 [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src))))]>;
476
David Goodwin4b358db2009-08-10 22:17:39 +0000477// Basic 2-register operations, scalar single-precision.
478class N2VDs<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
479 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
480 ValueType ResTy, ValueType OpTy, SDNode OpNode>
481 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
482 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src),
David Goodwin78caa122009-09-23 21:38:08 +0000483 IIC_VUNAD, !strconcat(OpcodeStr, "\t$dst, $src"), "", []>;
David Goodwin4b358db2009-08-10 22:17:39 +0000484
485class N2VDsPat<SDNode OpNode, ValueType ResTy, ValueType OpTy, NeonI Inst>
486 : NEONFPPat<(ResTy (OpNode SPR:$a)),
487 (EXTRACT_SUBREG
488 (Inst (INSERT_SUBREG (OpTy (IMPLICIT_DEF)), SPR:$a, arm_ssubreg_0)),
489 arm_ssubreg_0)>;
490
Bob Wilsone60fee02009-06-22 23:27:02 +0000491// Basic 2-register intrinsics, both double- and quad-register.
492class N2VDInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
David Goodwin78caa122009-09-23 21:38:08 +0000493 bits<2> op17_16, bits<5> op11_7, bit op4,
494 InstrItinClass itin, string OpcodeStr,
Bob Wilsone60fee02009-06-22 23:27:02 +0000495 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
496 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +0000497 (ins DPR:$src), itin, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000498 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src))))]>;
499class N2VQInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
David Goodwin78caa122009-09-23 21:38:08 +0000500 bits<2> op17_16, bits<5> op11_7, bit op4,
501 InstrItinClass itin, string OpcodeStr,
Bob Wilsone60fee02009-06-22 23:27:02 +0000502 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
503 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +0000504 (ins QPR:$src), itin, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000505 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src))))]>;
506
David Goodwin4b358db2009-08-10 22:17:39 +0000507// Basic 2-register intrinsics, scalar single-precision
Evan Cheng46961d82009-08-07 19:30:41 +0000508class N2VDInts<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
David Goodwin78caa122009-09-23 21:38:08 +0000509 bits<2> op17_16, bits<5> op11_7, bit op4,
510 InstrItinClass itin, string OpcodeStr,
Evan Cheng46961d82009-08-07 19:30:41 +0000511 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
512 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
David Goodwin78caa122009-09-23 21:38:08 +0000513 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), itin,
Evan Cheng46961d82009-08-07 19:30:41 +0000514 !strconcat(OpcodeStr, "\t$dst, $src"), "", []>;
515
516class N2VDIntsPat<SDNode OpNode, NeonI Inst>
David Goodwinbc7c05e2009-08-04 20:39:05 +0000517 : NEONFPPat<(f32 (OpNode SPR:$a)),
Evan Cheng46961d82009-08-07 19:30:41 +0000518 (EXTRACT_SUBREG
519 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$a, arm_ssubreg_0)),
520 arm_ssubreg_0)>;
David Goodwinbc7c05e2009-08-04 20:39:05 +0000521
Bob Wilsone60fee02009-06-22 23:27:02 +0000522// Narrow 2-register intrinsics.
523class N2VNInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
524 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
David Goodwin78caa122009-09-23 21:38:08 +0000525 InstrItinClass itin, string OpcodeStr,
526 ValueType TyD, ValueType TyQ, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +0000527 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +0000528 (ins QPR:$src), itin, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000529 [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src))))]>;
530
531// Long 2-register intrinsics. (This is currently only used for VMOVL and is
532// derived from N2VImm instead of N2V because of the way the size is encoded.)
533class N2VLInt<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
David Goodwin78caa122009-09-23 21:38:08 +0000534 bit op6, bit op4, InstrItinClass itin, string OpcodeStr,
535 ValueType TyQ, ValueType TyD, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +0000536 : N2VImm<op24, op23, op21_16, op11_8, op7, op6, op4, (outs QPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +0000537 (ins DPR:$src), itin, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000538 [(set QPR:$dst, (TyQ (IntOp (TyD DPR:$src))))]>;
539
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +0000540// 2-register shuffles (VTRN/VZIP/VUZP), both double- and quad-register.
541class N2VDShuffle<bits<2> op19_18, bits<5> op11_7, string OpcodeStr>
542 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 0, 0, (outs DPR:$dst1, DPR:$dst2),
David Goodwin78caa122009-09-23 21:38:08 +0000543 (ins DPR:$src1, DPR:$src2), IIC_VPERMD,
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +0000544 !strconcat(OpcodeStr, "\t$dst1, $dst2"),
545 "$src1 = $dst1, $src2 = $dst2", []>;
David Goodwin78caa122009-09-23 21:38:08 +0000546class N2VQShuffle<bits<2> op19_18, bits<5> op11_7,
547 InstrItinClass itin, string OpcodeStr>
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +0000548 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 1, 0, (outs QPR:$dst1, QPR:$dst2),
David Goodwin78caa122009-09-23 21:38:08 +0000549 (ins QPR:$src1, QPR:$src2), itin,
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +0000550 !strconcat(OpcodeStr, "\t$dst1, $dst2"),
551 "$src1 = $dst1, $src2 = $dst2", []>;
552
Bob Wilsone60fee02009-06-22 23:27:02 +0000553// Basic 3-register operations, both double- and quad-register.
554class N3VD<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin78caa122009-09-23 21:38:08 +0000555 InstrItinClass itin, string OpcodeStr, ValueType ResTy, ValueType OpTy,
Bob Wilsone60fee02009-06-22 23:27:02 +0000556 SDNode OpNode, bit Commutable>
557 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin78caa122009-09-23 21:38:08 +0000558 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000559 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
560 [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src1), (OpTy DPR:$src2))))]> {
561 let isCommutable = Commutable;
562}
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000563class N3VDSL<bits<2> op21_20, bits<4> op11_8,
David Goodwin36bff0c2009-09-25 18:38:29 +0000564 InstrItinClass itin, string OpcodeStr, ValueType Ty, SDNode ShOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000565 : N3V<0, 1, op21_20, op11_8, 1, 0,
566 (outs DPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000567 itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000568 [(set (Ty DPR:$dst),
569 (Ty (ShOp (Ty DPR:$src1),
570 (Ty (NEONvduplane (Ty DPR_VFP2:$src2),
571 imm:$lane)))))]> {
572 let isCommutable = 0;
573}
574class N3VDSL16<bits<2> op21_20, bits<4> op11_8,
575 string OpcodeStr, ValueType Ty, SDNode ShOp>
576 : N3V<0, 1, op21_20, op11_8, 1, 0,
577 (outs DPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000578 IIC_VMULi16D,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000579 !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
580 [(set (Ty DPR:$dst),
581 (Ty (ShOp (Ty DPR:$src1),
582 (Ty (NEONvduplane (Ty DPR_8:$src2),
583 imm:$lane)))))]> {
584 let isCommutable = 0;
585}
586
Bob Wilsone60fee02009-06-22 23:27:02 +0000587class N3VQ<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin78caa122009-09-23 21:38:08 +0000588 InstrItinClass itin, string OpcodeStr, ValueType ResTy, ValueType OpTy,
Bob Wilsone60fee02009-06-22 23:27:02 +0000589 SDNode OpNode, bit Commutable>
590 : N3V<op24, op23, op21_20, op11_8, 1, op4,
David Goodwin78caa122009-09-23 21:38:08 +0000591 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000592 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
593 [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src1), (OpTy QPR:$src2))))]> {
594 let isCommutable = Commutable;
595}
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000596class N3VQSL<bits<2> op21_20, bits<4> op11_8,
David Goodwin36bff0c2009-09-25 18:38:29 +0000597 InstrItinClass itin, string OpcodeStr,
598 ValueType ResTy, ValueType OpTy, SDNode ShOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000599 : N3V<1, 1, op21_20, op11_8, 1, 0,
600 (outs QPR:$dst), (ins QPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000601 itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000602 [(set (ResTy QPR:$dst),
603 (ResTy (ShOp (ResTy QPR:$src1),
604 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src2),
605 imm:$lane)))))]> {
606 let isCommutable = 0;
607}
608class N3VQSL16<bits<2> op21_20, bits<4> op11_8,
609 string OpcodeStr, ValueType ResTy, ValueType OpTy, SDNode ShOp>
610 : N3V<1, 1, op21_20, op11_8, 1, 0,
611 (outs QPR:$dst), (ins QPR:$src1, DPR_8:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000612 IIC_VMULi16Q,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000613 !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
614 [(set (ResTy QPR:$dst),
615 (ResTy (ShOp (ResTy QPR:$src1),
616 (ResTy (NEONvduplane (OpTy DPR_8:$src2),
617 imm:$lane)))))]> {
618 let isCommutable = 0;
619}
Bob Wilsone60fee02009-06-22 23:27:02 +0000620
David Goodwindd19ce42009-08-04 17:53:06 +0000621// Basic 3-register operations, scalar single-precision
Evan Cheng46961d82009-08-07 19:30:41 +0000622class N3VDs<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
623 string OpcodeStr, ValueType ResTy, ValueType OpTy,
624 SDNode OpNode, bit Commutable>
625 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000626 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src1, DPR_VFP2:$src2), IIC_VBIND,
Evan Cheng46961d82009-08-07 19:30:41 +0000627 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "", []> {
628 let isCommutable = Commutable;
629}
630class N3VDsPat<SDNode OpNode, NeonI Inst>
David Goodwindd19ce42009-08-04 17:53:06 +0000631 : NEONFPPat<(f32 (OpNode SPR:$a, SPR:$b)),
Evan Cheng46961d82009-08-07 19:30:41 +0000632 (EXTRACT_SUBREG
633 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$a, arm_ssubreg_0),
634 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$b, arm_ssubreg_0)),
635 arm_ssubreg_0)>;
David Goodwindd19ce42009-08-04 17:53:06 +0000636
Bob Wilsone60fee02009-06-22 23:27:02 +0000637// Basic 3-register intrinsics, both double- and quad-register.
638class N3VDInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000639 InstrItinClass itin, string OpcodeStr, ValueType ResTy, ValueType OpTy,
Bob Wilsone60fee02009-06-22 23:27:02 +0000640 Intrinsic IntOp, bit Commutable>
641 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000642 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000643 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
644 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src1), (OpTy DPR:$src2))))]> {
645 let isCommutable = Commutable;
646}
David Goodwin36bff0c2009-09-25 18:38:29 +0000647class N3VDIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000648 string OpcodeStr, ValueType Ty, Intrinsic IntOp>
649 : N3V<0, 1, op21_20, op11_8, 1, 0,
650 (outs DPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000651 itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000652 [(set (Ty DPR:$dst),
653 (Ty (IntOp (Ty DPR:$src1),
654 (Ty (NEONvduplane (Ty DPR_VFP2:$src2),
655 imm:$lane)))))]> {
656 let isCommutable = 0;
657}
David Goodwin36bff0c2009-09-25 18:38:29 +0000658class N3VDIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000659 string OpcodeStr, ValueType Ty, Intrinsic IntOp>
660 : N3V<0, 1, op21_20, op11_8, 1, 0,
661 (outs DPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000662 itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000663 [(set (Ty DPR:$dst),
664 (Ty (IntOp (Ty DPR:$src1),
665 (Ty (NEONvduplane (Ty DPR_8:$src2),
666 imm:$lane)))))]> {
667 let isCommutable = 0;
668}
669
Bob Wilsone60fee02009-06-22 23:27:02 +0000670class N3VQInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000671 InstrItinClass itin, string OpcodeStr, ValueType ResTy, ValueType OpTy,
Bob Wilsone60fee02009-06-22 23:27:02 +0000672 Intrinsic IntOp, bit Commutable>
673 : N3V<op24, op23, op21_20, op11_8, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000674 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000675 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
676 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src1), (OpTy QPR:$src2))))]> {
677 let isCommutable = Commutable;
678}
David Goodwin36bff0c2009-09-25 18:38:29 +0000679class N3VQIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000680 string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
681 : N3V<1, 1, op21_20, op11_8, 1, 0,
682 (outs QPR:$dst), (ins QPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000683 itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000684 [(set (ResTy QPR:$dst),
685 (ResTy (IntOp (ResTy QPR:$src1),
686 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src2),
687 imm:$lane)))))]> {
688 let isCommutable = 0;
689}
David Goodwin36bff0c2009-09-25 18:38:29 +0000690class N3VQIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000691 string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
692 : N3V<1, 1, op21_20, op11_8, 1, 0,
693 (outs QPR:$dst), (ins QPR:$src1, DPR_8:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000694 itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000695 [(set (ResTy QPR:$dst),
696 (ResTy (IntOp (ResTy QPR:$src1),
697 (ResTy (NEONvduplane (OpTy DPR_8:$src2),
698 imm:$lane)))))]> {
699 let isCommutable = 0;
700}
Bob Wilsone60fee02009-06-22 23:27:02 +0000701
702// Multiply-Add/Sub operations, both double- and quad-register.
703class N3VDMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000704 InstrItinClass itin, string OpcodeStr,
705 ValueType Ty, SDNode MulOp, SDNode OpNode>
Bob Wilsone60fee02009-06-22 23:27:02 +0000706 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000707 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000708 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst",
709 [(set DPR:$dst, (Ty (OpNode DPR:$src1,
710 (Ty (MulOp DPR:$src2, DPR:$src3)))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000711class N3VDMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000712 string OpcodeStr, ValueType Ty, SDNode MulOp, SDNode ShOp>
713 : N3V<0, 1, op21_20, op11_8, 1, 0,
714 (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000715 (ins DPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane), itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000716 !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst",
717 [(set (Ty DPR:$dst),
718 (Ty (ShOp (Ty DPR:$src1),
719 (Ty (MulOp DPR:$src2,
720 (Ty (NEONvduplane (Ty DPR_VFP2:$src3),
721 imm:$lane)))))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000722class N3VDMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000723 string OpcodeStr, ValueType Ty, SDNode MulOp, SDNode ShOp>
724 : N3V<0, 1, op21_20, op11_8, 1, 0,
725 (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000726 (ins DPR:$src1, DPR:$src2, DPR_8:$src3, nohash_imm:$lane), itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000727 !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst",
728 [(set (Ty DPR:$dst),
729 (Ty (ShOp (Ty DPR:$src1),
730 (Ty (MulOp DPR:$src2,
731 (Ty (NEONvduplane (Ty DPR_8:$src3),
732 imm:$lane)))))))]>;
733
Bob Wilsone60fee02009-06-22 23:27:02 +0000734class N3VQMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000735 InstrItinClass itin, string OpcodeStr, ValueType Ty,
736 SDNode MulOp, SDNode OpNode>
Bob Wilsone60fee02009-06-22 23:27:02 +0000737 : N3V<op24, op23, op21_20, op11_8, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000738 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000739 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst",
740 [(set QPR:$dst, (Ty (OpNode QPR:$src1,
741 (Ty (MulOp QPR:$src2, QPR:$src3)))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000742class N3VQMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000743 string OpcodeStr, ValueType ResTy, ValueType OpTy,
744 SDNode MulOp, SDNode ShOp>
745 : N3V<1, 1, op21_20, op11_8, 1, 0,
746 (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000747 (ins QPR:$src1, QPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane), itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000748 !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst",
749 [(set (ResTy QPR:$dst),
750 (ResTy (ShOp (ResTy QPR:$src1),
751 (ResTy (MulOp QPR:$src2,
752 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src3),
753 imm:$lane)))))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000754class N3VQMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000755 string OpcodeStr, ValueType ResTy, ValueType OpTy,
756 SDNode MulOp, SDNode ShOp>
757 : N3V<1, 1, op21_20, op11_8, 1, 0,
758 (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000759 (ins QPR:$src1, QPR:$src2, DPR_8:$src3, nohash_imm:$lane), itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000760 !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst",
761 [(set (ResTy QPR:$dst),
762 (ResTy (ShOp (ResTy QPR:$src1),
763 (ResTy (MulOp QPR:$src2,
764 (ResTy (NEONvduplane (OpTy DPR_8:$src3),
765 imm:$lane)))))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +0000766
David Goodwindd19ce42009-08-04 17:53:06 +0000767// Multiply-Add/Sub operations, scalar single-precision
Evan Cheng46961d82009-08-07 19:30:41 +0000768class N3VDMulOps<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000769 InstrItinClass itin, string OpcodeStr,
770 ValueType Ty, SDNode MulOp, SDNode OpNode>
Evan Cheng46961d82009-08-07 19:30:41 +0000771 : N3V<op24, op23, op21_20, op11_8, 0, op4,
772 (outs DPR_VFP2:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000773 (ins DPR_VFP2:$src1, DPR_VFP2:$src2, DPR_VFP2:$src3), itin,
Evan Cheng46961d82009-08-07 19:30:41 +0000774 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst", []>;
775
776class N3VDMulOpsPat<SDNode MulNode, SDNode OpNode, NeonI Inst>
777 : NEONFPPat<(f32 (OpNode SPR:$acc, (f32 (MulNode SPR:$a, SPR:$b)))),
778 (EXTRACT_SUBREG
779 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$acc, arm_ssubreg_0),
780 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$a, arm_ssubreg_0),
781 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$b, arm_ssubreg_0)),
782 arm_ssubreg_0)>;
David Goodwindd19ce42009-08-04 17:53:06 +0000783
Bob Wilsone60fee02009-06-22 23:27:02 +0000784// Neon 3-argument intrinsics, both double- and quad-register.
785// The destination register is also used as the first source operand register.
786class N3VDInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000787 InstrItinClass itin, string OpcodeStr,
788 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +0000789 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000790 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000791 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst",
792 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src1),
793 (OpTy DPR:$src2), (OpTy DPR:$src3))))]>;
794class N3VQInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000795 InstrItinClass itin, string OpcodeStr,
796 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +0000797 : N3V<op24, op23, op21_20, op11_8, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000798 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000799 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst",
800 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src1),
801 (OpTy QPR:$src2), (OpTy QPR:$src3))))]>;
802
803// Neon Long 3-argument intrinsic. The destination register is
804// a quad-register and is also used as the first source operand register.
805class N3VLInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000806 InstrItinClass itin, string OpcodeStr,
807 ValueType TyQ, ValueType TyD, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +0000808 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000809 (outs QPR:$dst), (ins QPR:$src1, DPR:$src2, DPR:$src3), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000810 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst",
811 [(set QPR:$dst,
812 (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$src2), (TyD DPR:$src3))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000813class N3VLInt3SL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000814 string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
815 : N3V<op24, 1, op21_20, op11_8, 1, 0,
816 (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000817 (ins QPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane), itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000818 !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst",
819 [(set (ResTy QPR:$dst),
820 (ResTy (IntOp (ResTy QPR:$src1),
821 (OpTy DPR:$src2),
822 (OpTy (NEONvduplane (OpTy DPR_VFP2:$src3),
823 imm:$lane)))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000824class N3VLInt3SL16<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000825 string OpcodeStr, ValueType ResTy, ValueType OpTy,
826 Intrinsic IntOp>
827 : N3V<op24, 1, op21_20, op11_8, 1, 0,
828 (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000829 (ins QPR:$src1, DPR:$src2, DPR_8:$src3, nohash_imm:$lane), itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000830 !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst",
831 [(set (ResTy QPR:$dst),
832 (ResTy (IntOp (ResTy QPR:$src1),
833 (OpTy DPR:$src2),
834 (OpTy (NEONvduplane (OpTy DPR_8:$src3),
835 imm:$lane)))))]>;
836
Bob Wilsone60fee02009-06-22 23:27:02 +0000837
838// Narrowing 3-register intrinsics.
839class N3VNInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
840 string OpcodeStr, ValueType TyD, ValueType TyQ,
841 Intrinsic IntOp, bit Commutable>
842 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000843 (outs DPR:$dst), (ins QPR:$src1, QPR:$src2), IIC_VBINi4D,
Bob Wilsone60fee02009-06-22 23:27:02 +0000844 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
845 [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src1), (TyQ QPR:$src2))))]> {
846 let isCommutable = Commutable;
847}
848
849// Long 3-register intrinsics.
850class N3VLInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000851 InstrItinClass itin, string OpcodeStr, ValueType TyQ, ValueType TyD,
Bob Wilsone60fee02009-06-22 23:27:02 +0000852 Intrinsic IntOp, bit Commutable>
853 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000854 (outs QPR:$dst), (ins DPR:$src1, DPR:$src2), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000855 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
856 [(set QPR:$dst, (TyQ (IntOp (TyD DPR:$src1), (TyD DPR:$src2))))]> {
857 let isCommutable = Commutable;
858}
David Goodwin36bff0c2009-09-25 18:38:29 +0000859class N3VLIntSL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000860 string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
861 : N3V<op24, 1, op21_20, op11_8, 1, 0,
862 (outs QPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000863 itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000864 [(set (ResTy QPR:$dst),
865 (ResTy (IntOp (OpTy DPR:$src1),
866 (OpTy (NEONvduplane (OpTy DPR_VFP2:$src2),
867 imm:$lane)))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000868class N3VLIntSL16<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000869 string OpcodeStr, ValueType ResTy, ValueType OpTy,
870 Intrinsic IntOp>
871 : N3V<op24, 1, op21_20, op11_8, 1, 0,
872 (outs QPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000873 itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000874 [(set (ResTy QPR:$dst),
875 (ResTy (IntOp (OpTy DPR:$src1),
876 (OpTy (NEONvduplane (OpTy DPR_8:$src2),
877 imm:$lane)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +0000878
879// Wide 3-register intrinsics.
880class N3VWInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
881 string OpcodeStr, ValueType TyQ, ValueType TyD,
882 Intrinsic IntOp, bit Commutable>
883 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000884 (outs QPR:$dst), (ins QPR:$src1, DPR:$src2), IIC_VSUBiD,
Bob Wilsone60fee02009-06-22 23:27:02 +0000885 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
886 [(set QPR:$dst, (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$src2))))]> {
887 let isCommutable = Commutable;
888}
889
890// Pairwise long 2-register intrinsics, both double- and quad-register.
891class N2VDPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
892 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
893 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
894 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000895 (ins DPR:$src), IIC_VSHLiD, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000896 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src))))]>;
897class N2VQPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
898 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
899 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
900 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000901 (ins QPR:$src), IIC_VSHLiD, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000902 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src))))]>;
903
904// Pairwise long 2-register accumulate intrinsics,
905// both double- and quad-register.
906// The destination register is also used as the first source operand register.
907class N2VDPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
908 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
909 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
910 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000911 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), IIC_VPALiD,
Bob Wilsone60fee02009-06-22 23:27:02 +0000912 !strconcat(OpcodeStr, "\t$dst, $src2"), "$src1 = $dst",
913 [(set DPR:$dst, (ResTy (IntOp (ResTy DPR:$src1), (OpTy DPR:$src2))))]>;
914class N2VQPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
915 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
916 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
917 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000918 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), IIC_VPALiQ,
Bob Wilsone60fee02009-06-22 23:27:02 +0000919 !strconcat(OpcodeStr, "\t$dst, $src2"), "$src1 = $dst",
920 [(set QPR:$dst, (ResTy (IntOp (ResTy QPR:$src1), (OpTy QPR:$src2))))]>;
921
922// Shift by immediate,
923// both double- and quad-register.
924class N2VDSh<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
David Goodwin36bff0c2009-09-25 18:38:29 +0000925 bit op4, InstrItinClass itin, string OpcodeStr,
926 ValueType Ty, SDNode OpNode>
Bob Wilsone60fee02009-06-22 23:27:02 +0000927 : N2VImm<op24, op23, op21_16, op11_8, op7, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000928 (outs DPR:$dst), (ins DPR:$src, i32imm:$SIMM), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000929 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
930 [(set DPR:$dst, (Ty (OpNode (Ty DPR:$src), (i32 imm:$SIMM))))]>;
931class N2VQSh<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
David Goodwin36bff0c2009-09-25 18:38:29 +0000932 bit op4, InstrItinClass itin, string OpcodeStr,
933 ValueType Ty, SDNode OpNode>
Bob Wilsone60fee02009-06-22 23:27:02 +0000934 : N2VImm<op24, op23, op21_16, op11_8, op7, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000935 (outs QPR:$dst), (ins QPR:$src, i32imm:$SIMM), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000936 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
937 [(set QPR:$dst, (Ty (OpNode (Ty QPR:$src), (i32 imm:$SIMM))))]>;
938
939// Long shift by immediate.
940class N2VLSh<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
941 bit op6, bit op4, string OpcodeStr, ValueType ResTy,
942 ValueType OpTy, SDNode OpNode>
943 : N2VImm<op24, op23, op21_16, op11_8, op7, op6, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000944 (outs QPR:$dst), (ins DPR:$src, i32imm:$SIMM), IIC_VSHLiD,
Bob Wilsone60fee02009-06-22 23:27:02 +0000945 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
946 [(set QPR:$dst, (ResTy (OpNode (OpTy DPR:$src),
947 (i32 imm:$SIMM))))]>;
948
949// Narrow shift by immediate.
950class N2VNSh<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
David Goodwin36bff0c2009-09-25 18:38:29 +0000951 bit op6, bit op4, InstrItinClass itin, string OpcodeStr,
952 ValueType ResTy, ValueType OpTy, SDNode OpNode>
Bob Wilsone60fee02009-06-22 23:27:02 +0000953 : N2VImm<op24, op23, op21_16, op11_8, op7, op6, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000954 (outs DPR:$dst), (ins QPR:$src, i32imm:$SIMM), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000955 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
956 [(set DPR:$dst, (ResTy (OpNode (OpTy QPR:$src),
957 (i32 imm:$SIMM))))]>;
958
959// Shift right by immediate and accumulate,
960// both double- and quad-register.
961class N2VDShAdd<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
962 bit op4, string OpcodeStr, ValueType Ty, SDNode ShOp>
963 : N2VImm<op24, op23, op21_16, op11_8, op7, 0, op4,
964 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, i32imm:$SIMM),
David Goodwin36bff0c2009-09-25 18:38:29 +0000965 IIC_VPALiD,
Bob Wilsone60fee02009-06-22 23:27:02 +0000966 !strconcat(OpcodeStr, "\t$dst, $src2, $SIMM"), "$src1 = $dst",
967 [(set DPR:$dst, (Ty (add DPR:$src1,
968 (Ty (ShOp DPR:$src2, (i32 imm:$SIMM))))))]>;
969class N2VQShAdd<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
970 bit op4, string OpcodeStr, ValueType Ty, SDNode ShOp>
971 : N2VImm<op24, op23, op21_16, op11_8, op7, 1, op4,
972 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, i32imm:$SIMM),
David Goodwin36bff0c2009-09-25 18:38:29 +0000973 IIC_VPALiD,
Bob Wilsone60fee02009-06-22 23:27:02 +0000974 !strconcat(OpcodeStr, "\t$dst, $src2, $SIMM"), "$src1 = $dst",
975 [(set QPR:$dst, (Ty (add QPR:$src1,
976 (Ty (ShOp QPR:$src2, (i32 imm:$SIMM))))))]>;
977
978// Shift by immediate and insert,
979// both double- and quad-register.
980class N2VDShIns<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
981 bit op4, string OpcodeStr, ValueType Ty, SDNode ShOp>
982 : N2VImm<op24, op23, op21_16, op11_8, op7, 0, op4,
983 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, i32imm:$SIMM),
David Goodwin36bff0c2009-09-25 18:38:29 +0000984 IIC_VSHLiD,
Bob Wilsone60fee02009-06-22 23:27:02 +0000985 !strconcat(OpcodeStr, "\t$dst, $src2, $SIMM"), "$src1 = $dst",
986 [(set DPR:$dst, (Ty (ShOp DPR:$src1, DPR:$src2, (i32 imm:$SIMM))))]>;
987class N2VQShIns<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
988 bit op4, string OpcodeStr, ValueType Ty, SDNode ShOp>
989 : N2VImm<op24, op23, op21_16, op11_8, op7, 1, op4,
990 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, i32imm:$SIMM),
David Goodwin36bff0c2009-09-25 18:38:29 +0000991 IIC_VSHLiQ,
Bob Wilsone60fee02009-06-22 23:27:02 +0000992 !strconcat(OpcodeStr, "\t$dst, $src2, $SIMM"), "$src1 = $dst",
993 [(set QPR:$dst, (Ty (ShOp QPR:$src1, QPR:$src2, (i32 imm:$SIMM))))]>;
994
995// Convert, with fractional bits immediate,
996// both double- and quad-register.
997class N2VCvtD<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
998 bit op4, string OpcodeStr, ValueType ResTy, ValueType OpTy,
999 Intrinsic IntOp>
1000 : N2VImm<op24, op23, op21_16, op11_8, op7, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001001 (outs DPR:$dst), (ins DPR:$src, i32imm:$SIMM), IIC_VUNAD,
Bob Wilsone60fee02009-06-22 23:27:02 +00001002 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
1003 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src), (i32 imm:$SIMM))))]>;
1004class N2VCvtQ<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
1005 bit op4, string OpcodeStr, ValueType ResTy, ValueType OpTy,
1006 Intrinsic IntOp>
1007 : N2VImm<op24, op23, op21_16, op11_8, op7, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001008 (outs QPR:$dst), (ins QPR:$src, i32imm:$SIMM), IIC_VUNAQ,
Bob Wilsone60fee02009-06-22 23:27:02 +00001009 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
1010 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src), (i32 imm:$SIMM))))]>;
1011
1012//===----------------------------------------------------------------------===//
1013// Multiclasses
1014//===----------------------------------------------------------------------===//
1015
Bob Wilson8af7b532009-10-03 04:44:16 +00001016// Abbreviations used in multiclass suffixes:
1017// Q = quarter int (8 bit) elements
1018// H = half int (16 bit) elements
1019// S = single int (32 bit) elements
1020// D = double int (64 bit) elements
1021
Bob Wilsone60fee02009-06-22 23:27:02 +00001022// Neon 3-register vector operations.
1023
1024// First with only element sizes of 8, 16 and 32 bits:
1025multiclass N3V_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin78caa122009-09-23 21:38:08 +00001026 InstrItinClass itinD16, InstrItinClass itinD32,
1027 InstrItinClass itinQ16, InstrItinClass itinQ32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001028 string OpcodeStr, SDNode OpNode, bit Commutable = 0> {
1029 // 64-bit vector types.
David Goodwin78caa122009-09-23 21:38:08 +00001030 def v8i8 : N3VD<op24, op23, 0b00, op11_8, op4, itinD16,
1031 !strconcat(OpcodeStr, "8"), v8i8, v8i8, OpNode, Commutable>;
1032 def v4i16 : N3VD<op24, op23, 0b01, op11_8, op4, itinD16,
1033 !strconcat(OpcodeStr, "16"), v4i16, v4i16, OpNode, Commutable>;
1034 def v2i32 : N3VD<op24, op23, 0b10, op11_8, op4, itinD32,
1035 !strconcat(OpcodeStr, "32"), v2i32, v2i32, OpNode, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001036
1037 // 128-bit vector types.
David Goodwin78caa122009-09-23 21:38:08 +00001038 def v16i8 : N3VQ<op24, op23, 0b00, op11_8, op4, itinQ16,
1039 !strconcat(OpcodeStr, "8"), v16i8, v16i8, OpNode, Commutable>;
1040 def v8i16 : N3VQ<op24, op23, 0b01, op11_8, op4, itinQ16,
1041 !strconcat(OpcodeStr, "16"), v8i16, v8i16, OpNode, Commutable>;
1042 def v4i32 : N3VQ<op24, op23, 0b10, op11_8, op4, itinQ32,
1043 !strconcat(OpcodeStr, "32"), v4i32, v4i32, OpNode, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001044}
1045
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001046multiclass N3VSL_HS<bits<4> op11_8, string OpcodeStr, SDNode ShOp> {
1047 def v4i16 : N3VDSL16<0b01, op11_8, !strconcat(OpcodeStr, "16"), v4i16, ShOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001048 def v2i32 : N3VDSL<0b10, op11_8, IIC_VMULi32D, !strconcat(OpcodeStr, "32"), v2i32, ShOp>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001049 def v8i16 : N3VQSL16<0b01, op11_8, !strconcat(OpcodeStr, "16"), v8i16, v4i16, ShOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001050 def v4i32 : N3VQSL<0b10, op11_8, IIC_VMULi32Q, !strconcat(OpcodeStr, "32"), v4i32, v2i32, ShOp>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001051}
1052
Bob Wilsone60fee02009-06-22 23:27:02 +00001053// ....then also with element size 64 bits:
1054multiclass N3V_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin78caa122009-09-23 21:38:08 +00001055 InstrItinClass itinD, InstrItinClass itinQ,
Bob Wilsone60fee02009-06-22 23:27:02 +00001056 string OpcodeStr, SDNode OpNode, bit Commutable = 0>
David Goodwin78caa122009-09-23 21:38:08 +00001057 : N3V_QHS<op24, op23, op11_8, op4, itinD, itinD, itinQ, itinQ,
1058 OpcodeStr, OpNode, Commutable> {
1059 def v1i64 : N3VD<op24, op23, 0b11, op11_8, op4, itinD,
1060 !strconcat(OpcodeStr, "64"), v1i64, v1i64, OpNode, Commutable>;
1061 def v2i64 : N3VQ<op24, op23, 0b11, op11_8, op4, itinQ,
1062 !strconcat(OpcodeStr, "64"), v2i64, v2i64, OpNode, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001063}
1064
1065
1066// Neon Narrowing 2-register vector intrinsics,
1067// source operand element sizes of 16, 32 and 64 bits:
1068multiclass N2VNInt_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
David Goodwin78caa122009-09-23 21:38:08 +00001069 bits<5> op11_7, bit op6, bit op4,
1070 InstrItinClass itin, string OpcodeStr,
Bob Wilsone60fee02009-06-22 23:27:02 +00001071 Intrinsic IntOp> {
1072 def v8i8 : N2VNInt<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001073 itin, !strconcat(OpcodeStr, "16"), v8i8, v8i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001074 def v4i16 : N2VNInt<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001075 itin, !strconcat(OpcodeStr, "32"), v4i16, v4i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001076 def v2i32 : N2VNInt<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001077 itin, !strconcat(OpcodeStr, "64"), v2i32, v2i64, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001078}
1079
1080
1081// Neon Lengthening 2-register vector intrinsic (currently specific to VMOVL).
1082// source operand element sizes of 16, 32 and 64 bits:
1083multiclass N2VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
1084 bit op4, string OpcodeStr, Intrinsic IntOp> {
1085 def v8i16 : N2VLInt<op24, op23, 0b001000, op11_8, op7, op6, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001086 IIC_VQUNAiD, !strconcat(OpcodeStr, "8"), v8i16, v8i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001087 def v4i32 : N2VLInt<op24, op23, 0b010000, op11_8, op7, op6, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001088 IIC_VQUNAiD, !strconcat(OpcodeStr, "16"), v4i32, v4i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001089 def v2i64 : N2VLInt<op24, op23, 0b100000, op11_8, op7, op6, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001090 IIC_VQUNAiD, !strconcat(OpcodeStr, "32"), v2i64, v2i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001091}
1092
1093
1094// Neon 3-register vector intrinsics.
1095
1096// First with only element sizes of 16 and 32 bits:
1097multiclass N3VInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001098 InstrItinClass itinD16, InstrItinClass itinD32,
1099 InstrItinClass itinQ16, InstrItinClass itinQ32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001100 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> {
1101 // 64-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001102 def v4i16 : N3VDInt<op24, op23, 0b01, op11_8, op4, itinD16, !strconcat(OpcodeStr,"16"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001103 v4i16, v4i16, IntOp, Commutable>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001104 def v2i32 : N3VDInt<op24, op23, 0b10, op11_8, op4, itinD32, !strconcat(OpcodeStr,"32"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001105 v2i32, v2i32, IntOp, Commutable>;
1106
1107 // 128-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001108 def v8i16 : N3VQInt<op24, op23, 0b01, op11_8, op4, itinQ16, !strconcat(OpcodeStr,"16"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001109 v8i16, v8i16, IntOp, Commutable>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001110 def v4i32 : N3VQInt<op24, op23, 0b10, op11_8, op4, itinQ32, !strconcat(OpcodeStr,"32"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001111 v4i32, v4i32, IntOp, Commutable>;
1112}
1113
David Goodwin36bff0c2009-09-25 18:38:29 +00001114multiclass N3VIntSL_HS<bits<4> op11_8,
1115 InstrItinClass itinD16, InstrItinClass itinD32,
1116 InstrItinClass itinQ16, InstrItinClass itinQ32,
1117 string OpcodeStr, Intrinsic IntOp> {
1118 def v4i16 : N3VDIntSL16<0b01, op11_8, itinD16, !strconcat(OpcodeStr, "16"), v4i16, IntOp>;
1119 def v2i32 : N3VDIntSL<0b10, op11_8, itinD32, !strconcat(OpcodeStr, "32"), v2i32, IntOp>;
1120 def v8i16 : N3VQIntSL16<0b01, op11_8, itinQ16, !strconcat(OpcodeStr, "16"), v8i16, v4i16, IntOp>;
1121 def v4i32 : N3VQIntSL<0b10, op11_8, itinQ32, !strconcat(OpcodeStr, "32"), v4i32, v2i32, IntOp>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001122}
1123
Bob Wilsone60fee02009-06-22 23:27:02 +00001124// ....then also with element size of 8 bits:
1125multiclass N3VInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001126 InstrItinClass itinD16, InstrItinClass itinD32,
1127 InstrItinClass itinQ16, InstrItinClass itinQ32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001128 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0>
David Goodwin36bff0c2009-09-25 18:38:29 +00001129 : N3VInt_HS<op24, op23, op11_8, op4, itinD16, itinD32, itinQ16, itinQ32,
1130 OpcodeStr, IntOp, Commutable> {
1131 def v8i8 : N3VDInt<op24, op23, 0b00, op11_8, op4, itinD16,
1132 !strconcat(OpcodeStr, "8"), v8i8, v8i8, IntOp, Commutable>;
1133 def v16i8 : N3VQInt<op24, op23, 0b00, op11_8, op4, itinQ16,
1134 !strconcat(OpcodeStr, "8"), v16i8, v16i8, IntOp, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001135}
1136
1137// ....then also with element size of 64 bits:
1138multiclass N3VInt_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001139 InstrItinClass itinD16, InstrItinClass itinD32,
1140 InstrItinClass itinQ16, InstrItinClass itinQ32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001141 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0>
David Goodwin36bff0c2009-09-25 18:38:29 +00001142 : N3VInt_QHS<op24, op23, op11_8, op4, itinD16, itinD32, itinQ16, itinQ32,
1143 OpcodeStr, IntOp, Commutable> {
1144 def v1i64 : N3VDInt<op24, op23, 0b11, op11_8, op4, itinD32,
1145 !strconcat(OpcodeStr,"64"), v1i64, v1i64, IntOp, Commutable>;
1146 def v2i64 : N3VQInt<op24, op23, 0b11, op11_8, op4, itinQ32,
1147 !strconcat(OpcodeStr,"64"), v2i64, v2i64, IntOp, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001148}
1149
1150
1151// Neon Narrowing 3-register vector intrinsics,
1152// source operand element sizes of 16, 32 and 64 bits:
1153multiclass N3VNInt_HSD<bit op24, bit op23, bits<4> op11_8, bit op4,
1154 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> {
1155 def v8i8 : N3VNInt<op24, op23, 0b00, op11_8, op4, !strconcat(OpcodeStr,"16"),
1156 v8i8, v8i16, IntOp, Commutable>;
1157 def v4i16 : N3VNInt<op24, op23, 0b01, op11_8, op4, !strconcat(OpcodeStr,"32"),
1158 v4i16, v4i32, IntOp, Commutable>;
1159 def v2i32 : N3VNInt<op24, op23, 0b10, op11_8, op4, !strconcat(OpcodeStr,"64"),
1160 v2i32, v2i64, IntOp, Commutable>;
1161}
1162
1163
1164// Neon Long 3-register vector intrinsics.
1165
1166// First with only element sizes of 16 and 32 bits:
1167multiclass N3VLInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001168 InstrItinClass itin, string OpcodeStr,
1169 Intrinsic IntOp, bit Commutable = 0> {
1170 def v4i32 : N3VLInt<op24, op23, 0b01, op11_8, op4, itin,
1171 !strconcat(OpcodeStr,"16"), v4i32, v4i16, IntOp, Commutable>;
1172 def v2i64 : N3VLInt<op24, op23, 0b10, op11_8, op4, itin,
1173 !strconcat(OpcodeStr,"32"), v2i64, v2i32, IntOp, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001174}
1175
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001176multiclass N3VLIntSL_HS<bit op24, bits<4> op11_8,
David Goodwin36bff0c2009-09-25 18:38:29 +00001177 InstrItinClass itin, string OpcodeStr, Intrinsic IntOp> {
1178 def v4i16 : N3VLIntSL16<op24, 0b01, op11_8, itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001179 !strconcat(OpcodeStr, "16"), v4i32, v4i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001180 def v2i32 : N3VLIntSL<op24, 0b10, op11_8, itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001181 !strconcat(OpcodeStr, "32"), v2i64, v2i32, IntOp>;
1182}
1183
Bob Wilsone60fee02009-06-22 23:27:02 +00001184// ....then also with element size of 8 bits:
1185multiclass N3VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001186 InstrItinClass itin, string OpcodeStr,
1187 Intrinsic IntOp, bit Commutable = 0>
1188 : N3VLInt_HS<op24, op23, op11_8, op4, itin, OpcodeStr, IntOp, Commutable> {
1189 def v8i16 : N3VLInt<op24, op23, 0b00, op11_8, op4, itin,
1190 !strconcat(OpcodeStr, "8"), v8i16, v8i8, IntOp, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001191}
1192
1193
1194// Neon Wide 3-register vector intrinsics,
1195// source operand element sizes of 8, 16 and 32 bits:
1196multiclass N3VWInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
1197 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> {
1198 def v8i16 : N3VWInt<op24, op23, 0b00, op11_8, op4, !strconcat(OpcodeStr, "8"),
1199 v8i16, v8i8, IntOp, Commutable>;
1200 def v4i32 : N3VWInt<op24, op23, 0b01, op11_8, op4, !strconcat(OpcodeStr,"16"),
1201 v4i32, v4i16, IntOp, Commutable>;
1202 def v2i64 : N3VWInt<op24, op23, 0b10, op11_8, op4, !strconcat(OpcodeStr,"32"),
1203 v2i64, v2i32, IntOp, Commutable>;
1204}
1205
1206
1207// Neon Multiply-Op vector operations,
1208// element sizes of 8, 16 and 32 bits:
1209multiclass N3VMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001210 InstrItinClass itinD16, InstrItinClass itinD32,
1211 InstrItinClass itinQ16, InstrItinClass itinQ32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001212 string OpcodeStr, SDNode OpNode> {
1213 // 64-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001214 def v8i8 : N3VDMulOp<op24, op23, 0b00, op11_8, op4, itinD16,
Bob Wilsone60fee02009-06-22 23:27:02 +00001215 !strconcat(OpcodeStr, "8"), v8i8, mul, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001216 def v4i16 : N3VDMulOp<op24, op23, 0b01, op11_8, op4, itinD16,
Bob Wilsone60fee02009-06-22 23:27:02 +00001217 !strconcat(OpcodeStr, "16"), v4i16, mul, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001218 def v2i32 : N3VDMulOp<op24, op23, 0b10, op11_8, op4, itinD32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001219 !strconcat(OpcodeStr, "32"), v2i32, mul, OpNode>;
1220
1221 // 128-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001222 def v16i8 : N3VQMulOp<op24, op23, 0b00, op11_8, op4, itinQ16,
Bob Wilsone60fee02009-06-22 23:27:02 +00001223 !strconcat(OpcodeStr, "8"), v16i8, mul, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001224 def v8i16 : N3VQMulOp<op24, op23, 0b01, op11_8, op4, itinQ16,
Bob Wilsone60fee02009-06-22 23:27:02 +00001225 !strconcat(OpcodeStr, "16"), v8i16, mul, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001226 def v4i32 : N3VQMulOp<op24, op23, 0b10, op11_8, op4, itinQ32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001227 !strconcat(OpcodeStr, "32"), v4i32, mul, OpNode>;
1228}
1229
David Goodwin36bff0c2009-09-25 18:38:29 +00001230multiclass N3VMulOpSL_HS<bits<4> op11_8,
1231 InstrItinClass itinD16, InstrItinClass itinD32,
1232 InstrItinClass itinQ16, InstrItinClass itinQ32,
1233 string OpcodeStr, SDNode ShOp> {
1234 def v4i16 : N3VDMulOpSL16<0b01, op11_8, itinD16,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001235 !strconcat(OpcodeStr, "16"), v4i16, mul, ShOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001236 def v2i32 : N3VDMulOpSL<0b10, op11_8, itinD32,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001237 !strconcat(OpcodeStr, "32"), v2i32, mul, ShOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001238 def v8i16 : N3VQMulOpSL16<0b01, op11_8, itinQ16,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001239 !strconcat(OpcodeStr, "16"), v8i16, v4i16, mul, ShOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001240 def v4i32 : N3VQMulOpSL<0b10, op11_8, itinQ32,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001241 !strconcat(OpcodeStr, "32"), v4i32, v2i32, mul, ShOp>;
1242}
Bob Wilsone60fee02009-06-22 23:27:02 +00001243
1244// Neon 3-argument intrinsics,
1245// element sizes of 8, 16 and 32 bits:
1246multiclass N3VInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
1247 string OpcodeStr, Intrinsic IntOp> {
1248 // 64-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001249 def v8i8 : N3VDInt3<op24, op23, 0b00, op11_8, op4, IIC_VMACi16D,
Bob Wilsone60fee02009-06-22 23:27:02 +00001250 !strconcat(OpcodeStr, "8"), v8i8, v8i8, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001251 def v4i16 : N3VDInt3<op24, op23, 0b01, op11_8, op4, IIC_VMACi16D,
Bob Wilsone60fee02009-06-22 23:27:02 +00001252 !strconcat(OpcodeStr, "16"), v4i16, v4i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001253 def v2i32 : N3VDInt3<op24, op23, 0b10, op11_8, op4, IIC_VMACi32D,
Bob Wilsone60fee02009-06-22 23:27:02 +00001254 !strconcat(OpcodeStr, "32"), v2i32, v2i32, IntOp>;
1255
1256 // 128-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001257 def v16i8 : N3VQInt3<op24, op23, 0b00, op11_8, op4, IIC_VMACi16Q,
Bob Wilsone60fee02009-06-22 23:27:02 +00001258 !strconcat(OpcodeStr, "8"), v16i8, v16i8, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001259 def v8i16 : N3VQInt3<op24, op23, 0b01, op11_8, op4, IIC_VMACi16Q,
Bob Wilsone60fee02009-06-22 23:27:02 +00001260 !strconcat(OpcodeStr, "16"), v8i16, v8i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001261 def v4i32 : N3VQInt3<op24, op23, 0b10, op11_8, op4, IIC_VMACi32Q,
Bob Wilsone60fee02009-06-22 23:27:02 +00001262 !strconcat(OpcodeStr, "32"), v4i32, v4i32, IntOp>;
1263}
1264
1265
1266// Neon Long 3-argument intrinsics.
1267
1268// First with only element sizes of 16 and 32 bits:
1269multiclass N3VLInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
1270 string OpcodeStr, Intrinsic IntOp> {
David Goodwin36bff0c2009-09-25 18:38:29 +00001271 def v4i32 : N3VLInt3<op24, op23, 0b01, op11_8, op4, IIC_VMACi16D,
Bob Wilsone60fee02009-06-22 23:27:02 +00001272 !strconcat(OpcodeStr, "16"), v4i32, v4i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001273 def v2i64 : N3VLInt3<op24, op23, 0b10, op11_8, op4, IIC_VMACi16D,
Bob Wilsone60fee02009-06-22 23:27:02 +00001274 !strconcat(OpcodeStr, "32"), v2i64, v2i32, IntOp>;
1275}
1276
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001277multiclass N3VLInt3SL_HS<bit op24, bits<4> op11_8,
1278 string OpcodeStr, Intrinsic IntOp> {
David Goodwin36bff0c2009-09-25 18:38:29 +00001279 def v4i16 : N3VLInt3SL16<op24, 0b01, op11_8, IIC_VMACi16D,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001280 !strconcat(OpcodeStr, "16"), v4i32, v4i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001281 def v2i32 : N3VLInt3SL<op24, 0b10, op11_8, IIC_VMACi32D,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001282 !strconcat(OpcodeStr, "32"), v2i64, v2i32, IntOp>;
1283}
1284
Bob Wilsone60fee02009-06-22 23:27:02 +00001285// ....then also with element size of 8 bits:
1286multiclass N3VLInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
1287 string OpcodeStr, Intrinsic IntOp>
1288 : N3VLInt3_HS<op24, op23, op11_8, op4, OpcodeStr, IntOp> {
David Goodwin36bff0c2009-09-25 18:38:29 +00001289 def v8i16 : N3VLInt3<op24, op23, 0b01, op11_8, op4, IIC_VMACi16D,
Bob Wilsone60fee02009-06-22 23:27:02 +00001290 !strconcat(OpcodeStr, "8"), v8i16, v8i8, IntOp>;
1291}
1292
1293
1294// Neon 2-register vector intrinsics,
1295// element sizes of 8, 16 and 32 bits:
1296multiclass N2VInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
David Goodwin78caa122009-09-23 21:38:08 +00001297 bits<5> op11_7, bit op4,
1298 InstrItinClass itinD, InstrItinClass itinQ,
1299 string OpcodeStr, Intrinsic IntOp> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001300 // 64-bit vector types.
1301 def v8i8 : N2VDInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001302 itinD, !strconcat(OpcodeStr, "8"), v8i8, v8i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001303 def v4i16 : N2VDInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001304 itinD, !strconcat(OpcodeStr, "16"), v4i16, v4i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001305 def v2i32 : N2VDInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001306 itinD, !strconcat(OpcodeStr, "32"), v2i32, v2i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001307
1308 // 128-bit vector types.
1309 def v16i8 : N2VQInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001310 itinQ, !strconcat(OpcodeStr, "8"), v16i8, v16i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001311 def v8i16 : N2VQInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001312 itinQ, !strconcat(OpcodeStr, "16"), v8i16, v8i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001313 def v4i32 : N2VQInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001314 itinQ, !strconcat(OpcodeStr, "32"), v4i32, v4i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001315}
1316
1317
1318// Neon Pairwise long 2-register intrinsics,
1319// element sizes of 8, 16 and 32 bits:
1320multiclass N2VPLInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
1321 bits<5> op11_7, bit op4,
1322 string OpcodeStr, Intrinsic IntOp> {
1323 // 64-bit vector types.
1324 def v8i8 : N2VDPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
1325 !strconcat(OpcodeStr, "8"), v4i16, v8i8, IntOp>;
1326 def v4i16 : N2VDPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
1327 !strconcat(OpcodeStr, "16"), v2i32, v4i16, IntOp>;
1328 def v2i32 : N2VDPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
1329 !strconcat(OpcodeStr, "32"), v1i64, v2i32, IntOp>;
1330
1331 // 128-bit vector types.
1332 def v16i8 : N2VQPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
1333 !strconcat(OpcodeStr, "8"), v8i16, v16i8, IntOp>;
1334 def v8i16 : N2VQPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
1335 !strconcat(OpcodeStr, "16"), v4i32, v8i16, IntOp>;
1336 def v4i32 : N2VQPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
1337 !strconcat(OpcodeStr, "32"), v2i64, v4i32, IntOp>;
1338}
1339
1340
1341// Neon Pairwise long 2-register accumulate intrinsics,
1342// element sizes of 8, 16 and 32 bits:
1343multiclass N2VPLInt2_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
1344 bits<5> op11_7, bit op4,
1345 string OpcodeStr, Intrinsic IntOp> {
1346 // 64-bit vector types.
1347 def v8i8 : N2VDPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
1348 !strconcat(OpcodeStr, "8"), v4i16, v8i8, IntOp>;
1349 def v4i16 : N2VDPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
1350 !strconcat(OpcodeStr, "16"), v2i32, v4i16, IntOp>;
1351 def v2i32 : N2VDPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
1352 !strconcat(OpcodeStr, "32"), v1i64, v2i32, IntOp>;
1353
1354 // 128-bit vector types.
1355 def v16i8 : N2VQPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
1356 !strconcat(OpcodeStr, "8"), v8i16, v16i8, IntOp>;
1357 def v8i16 : N2VQPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
1358 !strconcat(OpcodeStr, "16"), v4i32, v8i16, IntOp>;
1359 def v4i32 : N2VQPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
1360 !strconcat(OpcodeStr, "32"), v2i64, v4i32, IntOp>;
1361}
1362
1363
1364// Neon 2-register vector shift by immediate,
1365// element sizes of 8, 16, 32 and 64 bits:
1366multiclass N2VSh_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001367 InstrItinClass itin, string OpcodeStr, SDNode OpNode> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001368 // 64-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001369 def v8i8 : N2VDSh<op24, op23, 0b001000, op11_8, 0, op4, itin,
Bob Wilsone60fee02009-06-22 23:27:02 +00001370 !strconcat(OpcodeStr, "8"), v8i8, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001371 def v4i16 : N2VDSh<op24, op23, 0b010000, op11_8, 0, op4, itin,
Bob Wilsone60fee02009-06-22 23:27:02 +00001372 !strconcat(OpcodeStr, "16"), v4i16, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001373 def v2i32 : N2VDSh<op24, op23, 0b100000, op11_8, 0, op4, itin,
Bob Wilsone60fee02009-06-22 23:27:02 +00001374 !strconcat(OpcodeStr, "32"), v2i32, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001375 def v1i64 : N2VDSh<op24, op23, 0b000000, op11_8, 1, op4, itin,
Bob Wilsone60fee02009-06-22 23:27:02 +00001376 !strconcat(OpcodeStr, "64"), v1i64, OpNode>;
1377
1378 // 128-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001379 def v16i8 : N2VQSh<op24, op23, 0b001000, op11_8, 0, op4, itin,
Bob Wilsone60fee02009-06-22 23:27:02 +00001380 !strconcat(OpcodeStr, "8"), v16i8, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001381 def v8i16 : N2VQSh<op24, op23, 0b010000, op11_8, 0, op4, itin,
Bob Wilsone60fee02009-06-22 23:27:02 +00001382 !strconcat(OpcodeStr, "16"), v8i16, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001383 def v4i32 : N2VQSh<op24, op23, 0b100000, op11_8, 0, op4, itin,
Bob Wilsone60fee02009-06-22 23:27:02 +00001384 !strconcat(OpcodeStr, "32"), v4i32, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001385 def v2i64 : N2VQSh<op24, op23, 0b000000, op11_8, 1, op4, itin,
Bob Wilsone60fee02009-06-22 23:27:02 +00001386 !strconcat(OpcodeStr, "64"), v2i64, OpNode>;
1387}
1388
1389
1390// Neon Shift-Accumulate vector operations,
1391// element sizes of 8, 16, 32 and 64 bits:
1392multiclass N2VShAdd_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
1393 string OpcodeStr, SDNode ShOp> {
1394 // 64-bit vector types.
1395 def v8i8 : N2VDShAdd<op24, op23, 0b001000, op11_8, 0, op4,
1396 !strconcat(OpcodeStr, "8"), v8i8, ShOp>;
1397 def v4i16 : N2VDShAdd<op24, op23, 0b010000, op11_8, 0, op4,
1398 !strconcat(OpcodeStr, "16"), v4i16, ShOp>;
1399 def v2i32 : N2VDShAdd<op24, op23, 0b100000, op11_8, 0, op4,
1400 !strconcat(OpcodeStr, "32"), v2i32, ShOp>;
1401 def v1i64 : N2VDShAdd<op24, op23, 0b000000, op11_8, 1, op4,
1402 !strconcat(OpcodeStr, "64"), v1i64, ShOp>;
1403
1404 // 128-bit vector types.
1405 def v16i8 : N2VQShAdd<op24, op23, 0b001000, op11_8, 0, op4,
1406 !strconcat(OpcodeStr, "8"), v16i8, ShOp>;
1407 def v8i16 : N2VQShAdd<op24, op23, 0b010000, op11_8, 0, op4,
1408 !strconcat(OpcodeStr, "16"), v8i16, ShOp>;
1409 def v4i32 : N2VQShAdd<op24, op23, 0b100000, op11_8, 0, op4,
1410 !strconcat(OpcodeStr, "32"), v4i32, ShOp>;
1411 def v2i64 : N2VQShAdd<op24, op23, 0b000000, op11_8, 1, op4,
1412 !strconcat(OpcodeStr, "64"), v2i64, ShOp>;
1413}
1414
1415
1416// Neon Shift-Insert vector operations,
1417// element sizes of 8, 16, 32 and 64 bits:
1418multiclass N2VShIns_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
1419 string OpcodeStr, SDNode ShOp> {
1420 // 64-bit vector types.
1421 def v8i8 : N2VDShIns<op24, op23, 0b001000, op11_8, 0, op4,
1422 !strconcat(OpcodeStr, "8"), v8i8, ShOp>;
1423 def v4i16 : N2VDShIns<op24, op23, 0b010000, op11_8, 0, op4,
1424 !strconcat(OpcodeStr, "16"), v4i16, ShOp>;
1425 def v2i32 : N2VDShIns<op24, op23, 0b100000, op11_8, 0, op4,
1426 !strconcat(OpcodeStr, "32"), v2i32, ShOp>;
1427 def v1i64 : N2VDShIns<op24, op23, 0b000000, op11_8, 1, op4,
1428 !strconcat(OpcodeStr, "64"), v1i64, ShOp>;
1429
1430 // 128-bit vector types.
1431 def v16i8 : N2VQShIns<op24, op23, 0b001000, op11_8, 0, op4,
1432 !strconcat(OpcodeStr, "8"), v16i8, ShOp>;
1433 def v8i16 : N2VQShIns<op24, op23, 0b010000, op11_8, 0, op4,
1434 !strconcat(OpcodeStr, "16"), v8i16, ShOp>;
1435 def v4i32 : N2VQShIns<op24, op23, 0b100000, op11_8, 0, op4,
1436 !strconcat(OpcodeStr, "32"), v4i32, ShOp>;
1437 def v2i64 : N2VQShIns<op24, op23, 0b000000, op11_8, 1, op4,
1438 !strconcat(OpcodeStr, "64"), v2i64, ShOp>;
1439}
1440
1441//===----------------------------------------------------------------------===//
1442// Instruction Definitions.
1443//===----------------------------------------------------------------------===//
1444
1445// Vector Add Operations.
1446
1447// VADD : Vector Add (integer and floating-point)
David Goodwin78caa122009-09-23 21:38:08 +00001448defm VADD : N3V_QHSD<0, 0, 0b1000, 0, IIC_VBINiD, IIC_VBINiQ, "vadd.i", add, 1>;
1449def VADDfd : N3VD<0, 0, 0b00, 0b1101, 0, IIC_VBIND, "vadd.f32", v2f32, v2f32, fadd, 1>;
1450def VADDfq : N3VQ<0, 0, 0b00, 0b1101, 0, IIC_VBINQ, "vadd.f32", v4f32, v4f32, fadd, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001451// VADDL : Vector Add Long (Q = D + D)
David Goodwin36bff0c2009-09-25 18:38:29 +00001452defm VADDLs : N3VLInt_QHS<0,1,0b0000,0, IIC_VSHLiD, "vaddl.s", int_arm_neon_vaddls, 1>;
1453defm VADDLu : N3VLInt_QHS<1,1,0b0000,0, IIC_VSHLiD, "vaddl.u", int_arm_neon_vaddlu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001454// VADDW : Vector Add Wide (Q = Q + D)
1455defm VADDWs : N3VWInt_QHS<0,1,0b0001,0, "vaddw.s", int_arm_neon_vaddws, 0>;
1456defm VADDWu : N3VWInt_QHS<1,1,0b0001,0, "vaddw.u", int_arm_neon_vaddwu, 0>;
1457// VHADD : Vector Halving Add
David Goodwin36bff0c2009-09-25 18:38:29 +00001458defm VHADDs : N3VInt_QHS<0,0,0b0000,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1459 IIC_VBINi4Q, "vhadd.s", int_arm_neon_vhadds, 1>;
1460defm VHADDu : N3VInt_QHS<1,0,0b0000,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1461 IIC_VBINi4Q, "vhadd.u", int_arm_neon_vhaddu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001462// VRHADD : Vector Rounding Halving Add
David Goodwin36bff0c2009-09-25 18:38:29 +00001463defm VRHADDs : N3VInt_QHS<0,0,0b0001,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1464 IIC_VBINi4Q, "vrhadd.s", int_arm_neon_vrhadds, 1>;
1465defm VRHADDu : N3VInt_QHS<1,0,0b0001,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1466 IIC_VBINi4Q, "vrhadd.u", int_arm_neon_vrhaddu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001467// VQADD : Vector Saturating Add
David Goodwin36bff0c2009-09-25 18:38:29 +00001468defm VQADDs : N3VInt_QHSD<0,0,0b0000,1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1469 IIC_VBINi4Q, "vqadd.s", int_arm_neon_vqadds, 1>;
1470defm VQADDu : N3VInt_QHSD<1,0,0b0000,1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1471 IIC_VBINi4Q, "vqadd.u", int_arm_neon_vqaddu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001472// VADDHN : Vector Add and Narrow Returning High Half (D = Q + Q)
1473defm VADDHN : N3VNInt_HSD<0,1,0b0100,0, "vaddhn.i", int_arm_neon_vaddhn, 1>;
1474// VRADDHN : Vector Rounding Add and Narrow Returning High Half (D = Q + Q)
1475defm VRADDHN : N3VNInt_HSD<1,1,0b0100,0, "vraddhn.i", int_arm_neon_vraddhn, 1>;
1476
1477// Vector Multiply Operations.
1478
1479// VMUL : Vector Multiply (integer, polynomial and floating-point)
David Goodwin78caa122009-09-23 21:38:08 +00001480defm VMUL : N3V_QHS<0, 0, 0b1001, 1, IIC_VMULi16D, IIC_VMULi32D, IIC_VMULi16Q,
1481 IIC_VMULi32Q, "vmul.i", mul, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001482def VMULpd : N3VDInt<1, 0, 0b00, 0b1001, 1, IIC_VMULi16D, "vmul.p8", v8i8, v8i8,
Bob Wilsone60fee02009-06-22 23:27:02 +00001483 int_arm_neon_vmulp, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001484def VMULpq : N3VQInt<1, 0, 0b00, 0b1001, 1, IIC_VMULi16Q, "vmul.p8", v16i8, v16i8,
Bob Wilsone60fee02009-06-22 23:27:02 +00001485 int_arm_neon_vmulp, 1>;
David Goodwin78caa122009-09-23 21:38:08 +00001486def VMULfd : N3VD<1, 0, 0b00, 0b1101, 1, IIC_VBIND, "vmul.f32", v2f32, v2f32, fmul, 1>;
1487def VMULfq : N3VQ<1, 0, 0b00, 0b1101, 1, IIC_VBINQ, "vmul.f32", v4f32, v4f32, fmul, 1>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001488defm VMULsl : N3VSL_HS<0b1000, "vmul.i", mul>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001489def VMULslfd : N3VDSL<0b10, 0b1001, IIC_VBIND, "vmul.f32", v2f32, fmul>;
1490def VMULslfq : N3VQSL<0b10, 0b1001, IIC_VBINQ, "vmul.f32", v4f32, v2f32, fmul>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001491def : Pat<(v8i16 (mul (v8i16 QPR:$src1),
1492 (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))),
1493 (v8i16 (VMULslv8i16 (v8i16 QPR:$src1),
1494 (v4i16 (EXTRACT_SUBREG QPR:$src2,
1495 (DSubReg_i16_reg imm:$lane))),
1496 (SubReg_i16_lane imm:$lane)))>;
1497def : Pat<(v4i32 (mul (v4i32 QPR:$src1),
1498 (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))),
1499 (v4i32 (VMULslv4i32 (v4i32 QPR:$src1),
1500 (v2i32 (EXTRACT_SUBREG QPR:$src2,
1501 (DSubReg_i32_reg imm:$lane))),
1502 (SubReg_i32_lane imm:$lane)))>;
1503def : Pat<(v4f32 (fmul (v4f32 QPR:$src1),
1504 (v4f32 (NEONvduplane (v4f32 QPR:$src2), imm:$lane)))),
1505 (v4f32 (VMULslfq (v4f32 QPR:$src1),
1506 (v2f32 (EXTRACT_SUBREG QPR:$src2,
1507 (DSubReg_i32_reg imm:$lane))),
1508 (SubReg_i32_lane imm:$lane)))>;
1509
Bob Wilsone60fee02009-06-22 23:27:02 +00001510// VQDMULH : Vector Saturating Doubling Multiply Returning High Half
David Goodwin36bff0c2009-09-25 18:38:29 +00001511defm VQDMULH : N3VInt_HS<0, 0, 0b1011, 0, IIC_VMULi16D, IIC_VMULi32D,
1512 IIC_VMULi16Q, IIC_VMULi32Q,
1513 "vqdmulh.s", int_arm_neon_vqdmulh, 1>;
1514defm VQDMULHsl: N3VIntSL_HS<0b1100, IIC_VMULi16D, IIC_VMULi32D,
1515 IIC_VMULi16Q, IIC_VMULi32Q,
1516 "vqdmulh.s", int_arm_neon_vqdmulh>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001517def : Pat<(v8i16 (int_arm_neon_vqdmulh (v8i16 QPR:$src1),
1518 (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))),
1519 (v8i16 (VQDMULHslv8i16 (v8i16 QPR:$src1),
1520 (v4i16 (EXTRACT_SUBREG QPR:$src2,
1521 (DSubReg_i16_reg imm:$lane))),
1522 (SubReg_i16_lane imm:$lane)))>;
1523def : Pat<(v4i32 (int_arm_neon_vqdmulh (v4i32 QPR:$src1),
1524 (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))),
1525 (v4i32 (VQDMULHslv4i32 (v4i32 QPR:$src1),
1526 (v2i32 (EXTRACT_SUBREG QPR:$src2,
1527 (DSubReg_i32_reg imm:$lane))),
1528 (SubReg_i32_lane imm:$lane)))>;
1529
Bob Wilsone60fee02009-06-22 23:27:02 +00001530// VQRDMULH : Vector Rounding Saturating Doubling Multiply Returning High Half
David Goodwin36bff0c2009-09-25 18:38:29 +00001531defm VQRDMULH : N3VInt_HS<1, 0, 0b1011, 0, IIC_VMULi16D, IIC_VMULi32D,
1532 IIC_VMULi16Q, IIC_VMULi32Q,
1533 "vqrdmulh.s", int_arm_neon_vqrdmulh, 1>;
1534defm VQRDMULHsl : N3VIntSL_HS<0b1101, IIC_VMULi16D, IIC_VMULi32D,
1535 IIC_VMULi16Q, IIC_VMULi32Q,
1536 "vqrdmulh.s", int_arm_neon_vqrdmulh>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001537def : Pat<(v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$src1),
1538 (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))),
1539 (v8i16 (VQRDMULHslv8i16 (v8i16 QPR:$src1),
1540 (v4i16 (EXTRACT_SUBREG QPR:$src2,
1541 (DSubReg_i16_reg imm:$lane))),
1542 (SubReg_i16_lane imm:$lane)))>;
1543def : Pat<(v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$src1),
1544 (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))),
1545 (v4i32 (VQRDMULHslv4i32 (v4i32 QPR:$src1),
1546 (v2i32 (EXTRACT_SUBREG QPR:$src2,
1547 (DSubReg_i32_reg imm:$lane))),
1548 (SubReg_i32_lane imm:$lane)))>;
1549
Bob Wilsone60fee02009-06-22 23:27:02 +00001550// VMULL : Vector Multiply Long (integer and polynomial) (Q = D * D)
David Goodwin36bff0c2009-09-25 18:38:29 +00001551defm VMULLs : N3VLInt_QHS<0,1,0b1100,0, IIC_VMULi16D, "vmull.s", int_arm_neon_vmulls, 1>;
1552defm VMULLu : N3VLInt_QHS<1,1,0b1100,0, IIC_VMULi16D, "vmull.u", int_arm_neon_vmullu, 1>;
1553def VMULLp : N3VLInt<0, 1, 0b00, 0b1110, 0, IIC_VMULi16D, "vmull.p8", v8i16, v8i8,
Bob Wilsone60fee02009-06-22 23:27:02 +00001554 int_arm_neon_vmullp, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001555defm VMULLsls : N3VLIntSL_HS<0, 0b1010, IIC_VMULi16D, "vmull.s", int_arm_neon_vmulls>;
1556defm VMULLslu : N3VLIntSL_HS<1, 0b1010, IIC_VMULi16D, "vmull.u", int_arm_neon_vmullu>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001557
Bob Wilsone60fee02009-06-22 23:27:02 +00001558// VQDMULL : Vector Saturating Doubling Multiply Long (Q = D * D)
David Goodwin36bff0c2009-09-25 18:38:29 +00001559defm VQDMULL : N3VLInt_HS<0,1,0b1101,0, IIC_VMULi16D, "vqdmull.s", int_arm_neon_vqdmull, 1>;
1560defm VQDMULLsl: N3VLIntSL_HS<0, 0b1011, IIC_VMULi16D, "vqdmull.s", int_arm_neon_vqdmull>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001561
1562// Vector Multiply-Accumulate and Multiply-Subtract Operations.
1563
1564// VMLA : Vector Multiply Accumulate (integer and floating-point)
David Goodwin36bff0c2009-09-25 18:38:29 +00001565defm VMLA : N3VMulOp_QHS<0, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
1566 IIC_VMACi16Q, IIC_VMACi32Q, "vmla.i", add>;
1567def VMLAfd : N3VDMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla.f32", v2f32, fmul, fadd>;
1568def VMLAfq : N3VQMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACQ, "vmla.f32", v4f32, fmul, fadd>;
1569defm VMLAsl : N3VMulOpSL_HS<0b0000, IIC_VMACi16D, IIC_VMACi32D,
1570 IIC_VMACi16Q, IIC_VMACi32Q, "vmla.i", add>;
1571def VMLAslfd : N3VDMulOpSL<0b10, 0b0001, IIC_VMACD, "vmla.f32", v2f32, fmul, fadd>;
1572def VMLAslfq : N3VQMulOpSL<0b10, 0b0001, IIC_VMACQ, "vmla.f32", v4f32, v2f32, fmul, fadd>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001573
1574def : Pat<(v8i16 (add (v8i16 QPR:$src1),
1575 (mul (v8i16 QPR:$src2),
1576 (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))),
1577 (v8i16 (VMLAslv8i16 (v8i16 QPR:$src1),
1578 (v8i16 QPR:$src2),
1579 (v4i16 (EXTRACT_SUBREG QPR:$src3,
1580 (DSubReg_i16_reg imm:$lane))),
1581 (SubReg_i16_lane imm:$lane)))>;
1582
1583def : Pat<(v4i32 (add (v4i32 QPR:$src1),
1584 (mul (v4i32 QPR:$src2),
1585 (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))),
1586 (v4i32 (VMLAslv4i32 (v4i32 QPR:$src1),
1587 (v4i32 QPR:$src2),
1588 (v2i32 (EXTRACT_SUBREG QPR:$src3,
1589 (DSubReg_i32_reg imm:$lane))),
1590 (SubReg_i32_lane imm:$lane)))>;
1591
1592def : Pat<(v4f32 (fadd (v4f32 QPR:$src1),
1593 (fmul (v4f32 QPR:$src2),
1594 (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))),
1595 (v4f32 (VMLAslfq (v4f32 QPR:$src1),
1596 (v4f32 QPR:$src2),
1597 (v2f32 (EXTRACT_SUBREG QPR:$src3,
1598 (DSubReg_i32_reg imm:$lane))),
1599 (SubReg_i32_lane imm:$lane)))>;
1600
Bob Wilsone60fee02009-06-22 23:27:02 +00001601// VMLAL : Vector Multiply Accumulate Long (Q += D * D)
1602defm VMLALs : N3VLInt3_QHS<0,1,0b1000,0, "vmlal.s", int_arm_neon_vmlals>;
1603defm VMLALu : N3VLInt3_QHS<1,1,0b1000,0, "vmlal.u", int_arm_neon_vmlalu>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001604
1605defm VMLALsls : N3VLInt3SL_HS<0, 0b0010, "vmlal.s", int_arm_neon_vmlals>;
1606defm VMLALslu : N3VLInt3SL_HS<1, 0b0010, "vmlal.u", int_arm_neon_vmlalu>;
1607
Bob Wilsone60fee02009-06-22 23:27:02 +00001608// VQDMLAL : Vector Saturating Doubling Multiply Accumulate Long (Q += D * D)
1609defm VQDMLAL : N3VLInt3_HS<0, 1, 0b1001, 0, "vqdmlal.s", int_arm_neon_vqdmlal>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001610defm VQDMLALsl: N3VLInt3SL_HS<0, 0b0011, "vqdmlal.s", int_arm_neon_vqdmlal>;
1611
Bob Wilsone60fee02009-06-22 23:27:02 +00001612// VMLS : Vector Multiply Subtract (integer and floating-point)
Bob Wilson64c60912009-10-03 04:41:21 +00001613defm VMLS : N3VMulOp_QHS<1, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
David Goodwin36bff0c2009-09-25 18:38:29 +00001614 IIC_VMACi16Q, IIC_VMACi32Q, "vmls.i", sub>;
1615def VMLSfd : N3VDMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls.f32", v2f32, fmul, fsub>;
1616def VMLSfq : N3VQMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACQ, "vmls.f32", v4f32, fmul, fsub>;
1617defm VMLSsl : N3VMulOpSL_HS<0b0100, IIC_VMACi16D, IIC_VMACi32D,
1618 IIC_VMACi16Q, IIC_VMACi32Q, "vmls.i", sub>;
1619def VMLSslfd : N3VDMulOpSL<0b10, 0b0101, IIC_VMACD, "vmls.f32", v2f32, fmul, fsub>;
1620def VMLSslfq : N3VQMulOpSL<0b10, 0b0101, IIC_VMACQ, "vmls.f32", v4f32, v2f32, fmul, fsub>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001621
1622def : Pat<(v8i16 (sub (v8i16 QPR:$src1),
1623 (mul (v8i16 QPR:$src2),
1624 (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))),
1625 (v8i16 (VMLSslv8i16 (v8i16 QPR:$src1),
1626 (v8i16 QPR:$src2),
1627 (v4i16 (EXTRACT_SUBREG QPR:$src3,
1628 (DSubReg_i16_reg imm:$lane))),
1629 (SubReg_i16_lane imm:$lane)))>;
1630
1631def : Pat<(v4i32 (sub (v4i32 QPR:$src1),
1632 (mul (v4i32 QPR:$src2),
1633 (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))),
1634 (v4i32 (VMLSslv4i32 (v4i32 QPR:$src1),
1635 (v4i32 QPR:$src2),
1636 (v2i32 (EXTRACT_SUBREG QPR:$src3,
1637 (DSubReg_i32_reg imm:$lane))),
1638 (SubReg_i32_lane imm:$lane)))>;
1639
1640def : Pat<(v4f32 (fsub (v4f32 QPR:$src1),
1641 (fmul (v4f32 QPR:$src2),
1642 (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))),
1643 (v4f32 (VMLSslfq (v4f32 QPR:$src1),
1644 (v4f32 QPR:$src2),
1645 (v2f32 (EXTRACT_SUBREG QPR:$src3,
1646 (DSubReg_i32_reg imm:$lane))),
1647 (SubReg_i32_lane imm:$lane)))>;
1648
Bob Wilsone60fee02009-06-22 23:27:02 +00001649// VMLSL : Vector Multiply Subtract Long (Q -= D * D)
1650defm VMLSLs : N3VLInt3_QHS<0,1,0b1010,0, "vmlsl.s", int_arm_neon_vmlsls>;
1651defm VMLSLu : N3VLInt3_QHS<1,1,0b1010,0, "vmlsl.u", int_arm_neon_vmlslu>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001652
1653defm VMLSLsls : N3VLInt3SL_HS<0, 0b0110, "vmlsl.s", int_arm_neon_vmlsls>;
1654defm VMLSLslu : N3VLInt3SL_HS<1, 0b0110, "vmlsl.u", int_arm_neon_vmlslu>;
1655
Bob Wilsone60fee02009-06-22 23:27:02 +00001656// VQDMLSL : Vector Saturating Doubling Multiply Subtract Long (Q -= D * D)
1657defm VQDMLSL : N3VLInt3_HS<0, 1, 0b1011, 0, "vqdmlsl.s", int_arm_neon_vqdmlsl>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001658defm VQDMLSLsl: N3VLInt3SL_HS<0, 0b111, "vqdmlsl.s", int_arm_neon_vqdmlsl>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001659
1660// Vector Subtract Operations.
1661
1662// VSUB : Vector Subtract (integer and floating-point)
David Goodwin78caa122009-09-23 21:38:08 +00001663defm VSUB : N3V_QHSD<1, 0, 0b1000, 0, IIC_VSUBiD, IIC_VSUBiQ, "vsub.i", sub, 0>;
1664def VSUBfd : N3VD<0, 0, 0b10, 0b1101, 0, IIC_VBIND, "vsub.f32", v2f32, v2f32, fsub, 0>;
1665def VSUBfq : N3VQ<0, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vsub.f32", v4f32, v4f32, fsub, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001666// VSUBL : Vector Subtract Long (Q = D - D)
David Goodwin36bff0c2009-09-25 18:38:29 +00001667defm VSUBLs : N3VLInt_QHS<0,1,0b0010,0, IIC_VSHLiD, "vsubl.s", int_arm_neon_vsubls, 1>;
1668defm VSUBLu : N3VLInt_QHS<1,1,0b0010,0, IIC_VSHLiD, "vsubl.u", int_arm_neon_vsublu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001669// VSUBW : Vector Subtract Wide (Q = Q - D)
1670defm VSUBWs : N3VWInt_QHS<0,1,0b0011,0, "vsubw.s", int_arm_neon_vsubws, 0>;
1671defm VSUBWu : N3VWInt_QHS<1,1,0b0011,0, "vsubw.u", int_arm_neon_vsubwu, 0>;
1672// VHSUB : Vector Halving Subtract
David Goodwin36bff0c2009-09-25 18:38:29 +00001673defm VHSUBs : N3VInt_QHS<0, 0, 0b0010, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1674 IIC_VBINi4Q, "vhsub.s", int_arm_neon_vhsubs, 0>;
1675defm VHSUBu : N3VInt_QHS<1, 0, 0b0010, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1676 IIC_VBINi4Q, "vhsub.u", int_arm_neon_vhsubu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001677// VQSUB : Vector Saturing Subtract
David Goodwin36bff0c2009-09-25 18:38:29 +00001678defm VQSUBs : N3VInt_QHSD<0, 0, 0b0010, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1679 IIC_VBINi4Q, "vqsub.s", int_arm_neon_vqsubs, 0>;
1680defm VQSUBu : N3VInt_QHSD<1, 0, 0b0010, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1681 IIC_VBINi4Q, "vqsub.u", int_arm_neon_vqsubu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001682// VSUBHN : Vector Subtract and Narrow Returning High Half (D = Q - Q)
1683defm VSUBHN : N3VNInt_HSD<0,1,0b0110,0, "vsubhn.i", int_arm_neon_vsubhn, 0>;
1684// VRSUBHN : Vector Rounding Subtract and Narrow Returning High Half (D=Q-Q)
1685defm VRSUBHN : N3VNInt_HSD<1,1,0b0110,0, "vrsubhn.i", int_arm_neon_vrsubhn, 0>;
1686
1687// Vector Comparisons.
1688
1689// VCEQ : Vector Compare Equal
David Goodwin78caa122009-09-23 21:38:08 +00001690defm VCEQ : N3V_QHS<1, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1691 IIC_VBINi4Q, "vceq.i", NEONvceq, 1>;
1692def VCEQfd : N3VD<0,0,0b00,0b1110,0, IIC_VBIND, "vceq.f32", v2i32, v2f32, NEONvceq, 1>;
1693def VCEQfq : N3VQ<0,0,0b00,0b1110,0, IIC_VBINQ, "vceq.f32", v4i32, v4f32, NEONvceq, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001694// VCGE : Vector Compare Greater Than or Equal
David Goodwin78caa122009-09-23 21:38:08 +00001695defm VCGEs : N3V_QHS<0, 0, 0b0011, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1696 IIC_VBINi4Q, "vcge.s", NEONvcge, 0>;
1697defm VCGEu : N3V_QHS<1, 0, 0b0011, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1698 IIC_VBINi4Q, "vcge.u", NEONvcgeu, 0>;
1699def VCGEfd : N3VD<1,0,0b00,0b1110,0, IIC_VBIND, "vcge.f32", v2i32, v2f32, NEONvcge, 0>;
1700def VCGEfq : N3VQ<1,0,0b00,0b1110,0, IIC_VBINQ, "vcge.f32", v4i32, v4f32, NEONvcge, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001701// VCGT : Vector Compare Greater Than
David Goodwin78caa122009-09-23 21:38:08 +00001702defm VCGTs : N3V_QHS<0, 0, 0b0011, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1703 IIC_VBINi4Q, "vcgt.s", NEONvcgt, 0>;
1704defm VCGTu : N3V_QHS<1, 0, 0b0011, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1705 IIC_VBINi4Q, "vcgt.u", NEONvcgtu, 0>;
1706def VCGTfd : N3VD<1,0,0b10,0b1110,0, IIC_VBIND, "vcgt.f32", v2i32, v2f32, NEONvcgt, 0>;
1707def VCGTfq : N3VQ<1,0,0b10,0b1110,0, IIC_VBINQ, "vcgt.f32", v4i32, v4f32, NEONvcgt, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001708// VACGE : Vector Absolute Compare Greater Than or Equal (aka VCAGE)
David Goodwin36bff0c2009-09-25 18:38:29 +00001709def VACGEd : N3VDInt<1, 0, 0b00, 0b1110, 1, IIC_VBIND, "vacge.f32", v2i32, v2f32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001710 int_arm_neon_vacged, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001711def VACGEq : N3VQInt<1, 0, 0b00, 0b1110, 1, IIC_VBINQ, "vacge.f32", v4i32, v4f32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001712 int_arm_neon_vacgeq, 0>;
1713// VACGT : Vector Absolute Compare Greater Than (aka VCAGT)
David Goodwin36bff0c2009-09-25 18:38:29 +00001714def VACGTd : N3VDInt<1, 0, 0b10, 0b1110, 1, IIC_VBIND, "vacgt.f32", v2i32, v2f32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001715 int_arm_neon_vacgtd, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001716def VACGTq : N3VQInt<1, 0, 0b10, 0b1110, 1, IIC_VBINQ, "vacgt.f32", v4i32, v4f32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001717 int_arm_neon_vacgtq, 0>;
1718// VTST : Vector Test Bits
David Goodwin78caa122009-09-23 21:38:08 +00001719defm VTST : N3V_QHS<0, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1720 IIC_VBINi4Q, "vtst.i", NEONvtst, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001721
1722// Vector Bitwise Operations.
1723
1724// VAND : Vector Bitwise AND
David Goodwin78caa122009-09-23 21:38:08 +00001725def VANDd : N3VD<0, 0, 0b00, 0b0001, 1, IIC_VBINiD, "vand", v2i32, v2i32, and, 1>;
1726def VANDq : N3VQ<0, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "vand", v4i32, v4i32, and, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001727
1728// VEOR : Vector Bitwise Exclusive OR
David Goodwin78caa122009-09-23 21:38:08 +00001729def VEORd : N3VD<1, 0, 0b00, 0b0001, 1, IIC_VBINiD, "veor", v2i32, v2i32, xor, 1>;
1730def VEORq : N3VQ<1, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "veor", v4i32, v4i32, xor, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001731
1732// VORR : Vector Bitwise OR
David Goodwin78caa122009-09-23 21:38:08 +00001733def VORRd : N3VD<0, 0, 0b10, 0b0001, 1, IIC_VBINiD, "vorr", v2i32, v2i32, or, 1>;
1734def VORRq : N3VQ<0, 0, 0b10, 0b0001, 1, IIC_VBINiQ, "vorr", v4i32, v4i32, or, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001735
1736// VBIC : Vector Bitwise Bit Clear (AND NOT)
1737def VBICd : N3V<0, 0, 0b01, 0b0001, 0, 1, (outs DPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +00001738 (ins DPR:$src1, DPR:$src2), IIC_VBINiD,
David Goodwincfd67652009-08-06 16:52:47 +00001739 "vbic\t$dst, $src1, $src2", "",
Anton Korobeynikov14636a52009-09-08 22:51:43 +00001740 [(set DPR:$dst, (v2i32 (and DPR:$src1,
1741 (vnot_conv DPR:$src2))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001742def VBICq : N3V<0, 0, 0b01, 0b0001, 1, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00001743 (ins QPR:$src1, QPR:$src2), IIC_VBINiQ,
David Goodwincfd67652009-08-06 16:52:47 +00001744 "vbic\t$dst, $src1, $src2", "",
Anton Korobeynikov14636a52009-09-08 22:51:43 +00001745 [(set QPR:$dst, (v4i32 (and QPR:$src1,
1746 (vnot_conv QPR:$src2))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001747
1748// VORN : Vector Bitwise OR NOT
1749def VORNd : N3V<0, 0, 0b11, 0b0001, 0, 1, (outs DPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +00001750 (ins DPR:$src1, DPR:$src2), IIC_VBINiD,
David Goodwincfd67652009-08-06 16:52:47 +00001751 "vorn\t$dst, $src1, $src2", "",
Anton Korobeynikov14636a52009-09-08 22:51:43 +00001752 [(set DPR:$dst, (v2i32 (or DPR:$src1,
1753 (vnot_conv DPR:$src2))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001754def VORNq : N3V<0, 0, 0b11, 0b0001, 1, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00001755 (ins QPR:$src1, QPR:$src2), IIC_VBINiQ,
David Goodwincfd67652009-08-06 16:52:47 +00001756 "vorn\t$dst, $src1, $src2", "",
Anton Korobeynikov14636a52009-09-08 22:51:43 +00001757 [(set QPR:$dst, (v4i32 (or QPR:$src1,
1758 (vnot_conv QPR:$src2))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001759
1760// VMVN : Vector Bitwise NOT
1761def VMVNd : N2V<0b11, 0b11, 0b00, 0b00, 0b01011, 0, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00001762 (outs DPR:$dst), (ins DPR:$src), IIC_VSHLiD,
David Goodwincfd67652009-08-06 16:52:47 +00001763 "vmvn\t$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001764 [(set DPR:$dst, (v2i32 (vnot DPR:$src)))]>;
1765def VMVNq : N2V<0b11, 0b11, 0b00, 0b00, 0b01011, 1, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00001766 (outs QPR:$dst), (ins QPR:$src), IIC_VSHLiD,
David Goodwincfd67652009-08-06 16:52:47 +00001767 "vmvn\t$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001768 [(set QPR:$dst, (v4i32 (vnot QPR:$src)))]>;
1769def : Pat<(v2i32 (vnot_conv DPR:$src)), (VMVNd DPR:$src)>;
1770def : Pat<(v4i32 (vnot_conv QPR:$src)), (VMVNq QPR:$src)>;
1771
1772// VBSL : Vector Bitwise Select
1773def VBSLd : N3V<1, 0, 0b01, 0b0001, 0, 1, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00001774 (ins DPR:$src1, DPR:$src2, DPR:$src3), IIC_VCNTiD,
Bob Wilsone60fee02009-06-22 23:27:02 +00001775 "vbsl\t$dst, $src2, $src3", "$src1 = $dst",
1776 [(set DPR:$dst,
1777 (v2i32 (or (and DPR:$src2, DPR:$src1),
Anton Korobeynikov14636a52009-09-08 22:51:43 +00001778 (and DPR:$src3, (vnot_conv DPR:$src1)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001779def VBSLq : N3V<1, 0, 0b01, 0b0001, 1, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00001780 (ins QPR:$src1, QPR:$src2, QPR:$src3), IIC_VCNTiQ,
Bob Wilsone60fee02009-06-22 23:27:02 +00001781 "vbsl\t$dst, $src2, $src3", "$src1 = $dst",
1782 [(set QPR:$dst,
1783 (v4i32 (or (and QPR:$src2, QPR:$src1),
Anton Korobeynikov14636a52009-09-08 22:51:43 +00001784 (and QPR:$src3, (vnot_conv QPR:$src1)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001785
1786// VBIF : Vector Bitwise Insert if False
1787// like VBSL but with: "vbif\t$dst, $src3, $src1", "$src2 = $dst",
1788// VBIT : Vector Bitwise Insert if True
1789// like VBSL but with: "vbit\t$dst, $src2, $src1", "$src3 = $dst",
1790// These are not yet implemented. The TwoAddress pass will not go looking
1791// for equivalent operations with different register constraints; it just
1792// inserts copies.
1793
1794// Vector Absolute Differences.
1795
1796// VABD : Vector Absolute Difference
David Goodwin36bff0c2009-09-25 18:38:29 +00001797defm VABDs : N3VInt_QHS<0, 0, 0b0111, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1798 IIC_VBINi4Q, "vabd.s", int_arm_neon_vabds, 0>;
1799defm VABDu : N3VInt_QHS<1, 0, 0b0111, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1800 IIC_VBINi4Q, "vabd.u", int_arm_neon_vabdu, 0>;
1801def VABDfd : N3VDInt<1, 0, 0b10, 0b1101, 0, IIC_VBIND, "vabd.f32", v2f32, v2f32,
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001802 int_arm_neon_vabds, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001803def VABDfq : N3VQInt<1, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vabd.f32", v4f32, v4f32,
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001804 int_arm_neon_vabds, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001805
1806// VABDL : Vector Absolute Difference Long (Q = | D - D |)
David Goodwin36bff0c2009-09-25 18:38:29 +00001807defm VABDLs : N3VLInt_QHS<0,1,0b0111,0, IIC_VBINi4Q, "vabdl.s", int_arm_neon_vabdls, 0>;
1808defm VABDLu : N3VLInt_QHS<1,1,0b0111,0, IIC_VBINi4Q, "vabdl.u", int_arm_neon_vabdlu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001809
1810// VABA : Vector Absolute Difference and Accumulate
1811defm VABAs : N3VInt3_QHS<0,1,0b0101,0, "vaba.s", int_arm_neon_vabas>;
1812defm VABAu : N3VInt3_QHS<1,1,0b0101,0, "vaba.u", int_arm_neon_vabau>;
1813
1814// VABAL : Vector Absolute Difference and Accumulate Long (Q += | D - D |)
1815defm VABALs : N3VLInt3_QHS<0,1,0b0101,0, "vabal.s", int_arm_neon_vabals>;
1816defm VABALu : N3VLInt3_QHS<1,1,0b0101,0, "vabal.u", int_arm_neon_vabalu>;
1817
1818// Vector Maximum and Minimum.
1819
1820// VMAX : Vector Maximum
David Goodwin36bff0c2009-09-25 18:38:29 +00001821defm VMAXs : N3VInt_QHS<0, 0, 0b0110, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1822 IIC_VBINi4Q, "vmax.s", int_arm_neon_vmaxs, 1>;
1823defm VMAXu : N3VInt_QHS<1, 0, 0b0110, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1824 IIC_VBINi4Q, "vmax.u", int_arm_neon_vmaxu, 1>;
1825def VMAXfd : N3VDInt<0, 0, 0b00, 0b1111, 0, IIC_VBIND, "vmax.f32", v2f32, v2f32,
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001826 int_arm_neon_vmaxs, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001827def VMAXfq : N3VQInt<0, 0, 0b00, 0b1111, 0, IIC_VBINQ, "vmax.f32", v4f32, v4f32,
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001828 int_arm_neon_vmaxs, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001829
1830// VMIN : Vector Minimum
David Goodwin36bff0c2009-09-25 18:38:29 +00001831defm VMINs : N3VInt_QHS<0, 0, 0b0110, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1832 IIC_VBINi4Q, "vmin.s", int_arm_neon_vmins, 1>;
1833defm VMINu : N3VInt_QHS<1, 0, 0b0110, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1834 IIC_VBINi4Q, "vmin.u", int_arm_neon_vminu, 1>;
1835def VMINfd : N3VDInt<0, 0, 0b10, 0b1111, 0, IIC_VBIND, "vmin.f32", v2f32, v2f32,
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001836 int_arm_neon_vmins, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001837def VMINfq : N3VQInt<0, 0, 0b10, 0b1111, 0, IIC_VBINQ, "vmin.f32", v4f32, v4f32,
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001838 int_arm_neon_vmins, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001839
1840// Vector Pairwise Operations.
1841
1842// VPADD : Vector Pairwise Add
David Goodwin36bff0c2009-09-25 18:38:29 +00001843def VPADDi8 : N3VDInt<0, 0, 0b00, 0b1011, 1, IIC_VBINiD, "vpadd.i8", v8i8, v8i8,
Bob Wilson1c2660e2009-08-11 01:15:26 +00001844 int_arm_neon_vpadd, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001845def VPADDi16 : N3VDInt<0, 0, 0b01, 0b1011, 1, IIC_VBINiD, "vpadd.i16", v4i16, v4i16,
Bob Wilson1c2660e2009-08-11 01:15:26 +00001846 int_arm_neon_vpadd, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001847def VPADDi32 : N3VDInt<0, 0, 0b10, 0b1011, 1, IIC_VBINiD, "vpadd.i32", v2i32, v2i32,
Bob Wilson1c2660e2009-08-11 01:15:26 +00001848 int_arm_neon_vpadd, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001849def VPADDf : N3VDInt<1, 0, 0b00, 0b1101, 0, IIC_VBIND, "vpadd.f32", v2f32, v2f32,
Bob Wilson1c2660e2009-08-11 01:15:26 +00001850 int_arm_neon_vpadd, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001851
1852// VPADDL : Vector Pairwise Add Long
1853defm VPADDLs : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpaddl.s",
1854 int_arm_neon_vpaddls>;
1855defm VPADDLu : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpaddl.u",
1856 int_arm_neon_vpaddlu>;
1857
1858// VPADAL : Vector Pairwise Add and Accumulate Long
1859defm VPADALs : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpadal.s",
1860 int_arm_neon_vpadals>;
1861defm VPADALu : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpadal.u",
1862 int_arm_neon_vpadalu>;
1863
1864// VPMAX : Vector Pairwise Maximum
David Goodwin36bff0c2009-09-25 18:38:29 +00001865def VPMAXs8 : N3VDInt<0, 0, 0b00, 0b1010, 0, IIC_VBINi4D, "vpmax.s8", v8i8, v8i8,
Bob Wilsone60fee02009-06-22 23:27:02 +00001866 int_arm_neon_vpmaxs, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001867def VPMAXs16 : N3VDInt<0, 0, 0b01, 0b1010, 0, IIC_VBINi4D, "vpmax.s16", v4i16, v4i16,
Bob Wilsone60fee02009-06-22 23:27:02 +00001868 int_arm_neon_vpmaxs, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001869def VPMAXs32 : N3VDInt<0, 0, 0b10, 0b1010, 0, IIC_VBINi4D, "vpmax.s32", v2i32, v2i32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001870 int_arm_neon_vpmaxs, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001871def VPMAXu8 : N3VDInt<1, 0, 0b00, 0b1010, 0, IIC_VBINi4D, "vpmax.u8", v8i8, v8i8,
Bob Wilsone60fee02009-06-22 23:27:02 +00001872 int_arm_neon_vpmaxu, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001873def VPMAXu16 : N3VDInt<1, 0, 0b01, 0b1010, 0, IIC_VBINi4D, "vpmax.u16", v4i16, v4i16,
Bob Wilsone60fee02009-06-22 23:27:02 +00001874 int_arm_neon_vpmaxu, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001875def VPMAXu32 : N3VDInt<1, 0, 0b10, 0b1010, 0, IIC_VBINi4D, "vpmax.u32", v2i32, v2i32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001876 int_arm_neon_vpmaxu, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001877def VPMAXf : N3VDInt<1, 0, 0b00, 0b1111, 0, IIC_VBINi4D, "vpmax.f32", v2f32, v2f32,
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001878 int_arm_neon_vpmaxs, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001879
1880// VPMIN : Vector Pairwise Minimum
David Goodwin36bff0c2009-09-25 18:38:29 +00001881def VPMINs8 : N3VDInt<0, 0, 0b00, 0b1010, 1, IIC_VBINi4D, "vpmin.s8", v8i8, v8i8,
Bob Wilsone60fee02009-06-22 23:27:02 +00001882 int_arm_neon_vpmins, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001883def VPMINs16 : N3VDInt<0, 0, 0b01, 0b1010, 1, IIC_VBINi4D, "vpmin.s16", v4i16, v4i16,
Bob Wilsone60fee02009-06-22 23:27:02 +00001884 int_arm_neon_vpmins, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001885def VPMINs32 : N3VDInt<0, 0, 0b10, 0b1010, 1, IIC_VBINi4D, "vpmin.s32", v2i32, v2i32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001886 int_arm_neon_vpmins, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001887def VPMINu8 : N3VDInt<1, 0, 0b00, 0b1010, 1, IIC_VBINi4D, "vpmin.u8", v8i8, v8i8,
Bob Wilsone60fee02009-06-22 23:27:02 +00001888 int_arm_neon_vpminu, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001889def VPMINu16 : N3VDInt<1, 0, 0b01, 0b1010, 1, IIC_VBINi4D, "vpmin.u16", v4i16, v4i16,
Bob Wilsone60fee02009-06-22 23:27:02 +00001890 int_arm_neon_vpminu, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001891def VPMINu32 : N3VDInt<1, 0, 0b10, 0b1010, 1, IIC_VBINi4D, "vpmin.u32", v2i32, v2i32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001892 int_arm_neon_vpminu, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001893def VPMINf : N3VDInt<1, 0, 0b10, 0b1111, 0, IIC_VBINi4D, "vpmin.f32", v2f32, v2f32,
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001894 int_arm_neon_vpmins, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001895
1896// Vector Reciprocal and Reciprocal Square Root Estimate and Step.
1897
1898// VRECPE : Vector Reciprocal Estimate
David Goodwin78caa122009-09-23 21:38:08 +00001899def VRECPEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
1900 IIC_VUNAD, "vrecpe.u32",
Bob Wilsone60fee02009-06-22 23:27:02 +00001901 v2i32, v2i32, int_arm_neon_vrecpe>;
David Goodwin78caa122009-09-23 21:38:08 +00001902def VRECPEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
1903 IIC_VUNAQ, "vrecpe.u32",
Bob Wilsone60fee02009-06-22 23:27:02 +00001904 v4i32, v4i32, int_arm_neon_vrecpe>;
David Goodwin78caa122009-09-23 21:38:08 +00001905def VRECPEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
1906 IIC_VUNAD, "vrecpe.f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001907 v2f32, v2f32, int_arm_neon_vrecpe>;
David Goodwin78caa122009-09-23 21:38:08 +00001908def VRECPEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
1909 IIC_VUNAQ, "vrecpe.f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001910 v4f32, v4f32, int_arm_neon_vrecpe>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001911
1912// VRECPS : Vector Reciprocal Step
David Goodwin36bff0c2009-09-25 18:38:29 +00001913def VRECPSfd : N3VDInt<0, 0, 0b00, 0b1111, 1, IIC_VRECSD, "vrecps.f32", v2f32, v2f32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001914 int_arm_neon_vrecps, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001915def VRECPSfq : N3VQInt<0, 0, 0b00, 0b1111, 1, IIC_VRECSQ, "vrecps.f32", v4f32, v4f32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001916 int_arm_neon_vrecps, 1>;
1917
1918// VRSQRTE : Vector Reciprocal Square Root Estimate
David Goodwin78caa122009-09-23 21:38:08 +00001919def VRSQRTEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
1920 IIC_VUNAD, "vrsqrte.u32",
1921 v2i32, v2i32, int_arm_neon_vrsqrte>;
1922def VRSQRTEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
1923 IIC_VUNAQ, "vrsqrte.u32",
1924 v4i32, v4i32, int_arm_neon_vrsqrte>;
1925def VRSQRTEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
1926 IIC_VUNAD, "vrsqrte.f32",
1927 v2f32, v2f32, int_arm_neon_vrsqrte>;
1928def VRSQRTEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
1929 IIC_VUNAQ, "vrsqrte.f32",
1930 v4f32, v4f32, int_arm_neon_vrsqrte>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001931
1932// VRSQRTS : Vector Reciprocal Square Root Step
David Goodwin36bff0c2009-09-25 18:38:29 +00001933def VRSQRTSfd : N3VDInt<0, 0, 0b10, 0b1111, 1, IIC_VRECSD, "vrsqrts.f32", v2f32, v2f32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001934 int_arm_neon_vrsqrts, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001935def VRSQRTSfq : N3VQInt<0, 0, 0b10, 0b1111, 1, IIC_VRECSQ, "vrsqrts.f32", v4f32, v4f32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001936 int_arm_neon_vrsqrts, 1>;
1937
1938// Vector Shifts.
1939
1940// VSHL : Vector Shift
David Goodwin36bff0c2009-09-25 18:38:29 +00001941defm VSHLs : N3VInt_QHSD<0, 0, 0b0100, 0, IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ,
1942 IIC_VSHLiQ, "vshl.s", int_arm_neon_vshifts, 0>;
1943defm VSHLu : N3VInt_QHSD<1, 0, 0b0100, 0, IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ,
1944 IIC_VSHLiQ, "vshl.u", int_arm_neon_vshiftu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001945// VSHL : Vector Shift Left (Immediate)
David Goodwin36bff0c2009-09-25 18:38:29 +00001946defm VSHLi : N2VSh_QHSD<0, 1, 0b0111, 1, IIC_VSHLiD, "vshl.i", NEONvshl>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001947// VSHR : Vector Shift Right (Immediate)
David Goodwin36bff0c2009-09-25 18:38:29 +00001948defm VSHRs : N2VSh_QHSD<0, 1, 0b0000, 1, IIC_VSHLiD, "vshr.s", NEONvshrs>;
1949defm VSHRu : N2VSh_QHSD<1, 1, 0b0000, 1, IIC_VSHLiD, "vshr.u", NEONvshru>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001950
1951// VSHLL : Vector Shift Left Long
1952def VSHLLs8 : N2VLSh<0, 1, 0b001000, 0b1010, 0, 0, 1, "vshll.s8",
1953 v8i16, v8i8, NEONvshlls>;
1954def VSHLLs16 : N2VLSh<0, 1, 0b010000, 0b1010, 0, 0, 1, "vshll.s16",
1955 v4i32, v4i16, NEONvshlls>;
1956def VSHLLs32 : N2VLSh<0, 1, 0b100000, 0b1010, 0, 0, 1, "vshll.s32",
1957 v2i64, v2i32, NEONvshlls>;
1958def VSHLLu8 : N2VLSh<1, 1, 0b001000, 0b1010, 0, 0, 1, "vshll.u8",
1959 v8i16, v8i8, NEONvshllu>;
1960def VSHLLu16 : N2VLSh<1, 1, 0b010000, 0b1010, 0, 0, 1, "vshll.u16",
1961 v4i32, v4i16, NEONvshllu>;
1962def VSHLLu32 : N2VLSh<1, 1, 0b100000, 0b1010, 0, 0, 1, "vshll.u32",
1963 v2i64, v2i32, NEONvshllu>;
1964
1965// VSHLL : Vector Shift Left Long (with maximum shift count)
1966def VSHLLi8 : N2VLSh<1, 1, 0b110010, 0b0011, 0, 0, 0, "vshll.i8",
1967 v8i16, v8i8, NEONvshlli>;
1968def VSHLLi16 : N2VLSh<1, 1, 0b110110, 0b0011, 0, 0, 0, "vshll.i16",
1969 v4i32, v4i16, NEONvshlli>;
1970def VSHLLi32 : N2VLSh<1, 1, 0b111010, 0b0011, 0, 0, 0, "vshll.i32",
1971 v2i64, v2i32, NEONvshlli>;
1972
1973// VSHRN : Vector Shift Right and Narrow
David Goodwin36bff0c2009-09-25 18:38:29 +00001974def VSHRN16 : N2VNSh<0, 1, 0b001000, 0b1000, 0, 0, 1,
1975 IIC_VSHLiD, "vshrn.i16", v8i8, v8i16, NEONvshrn>;
1976def VSHRN32 : N2VNSh<0, 1, 0b010000, 0b1000, 0, 0, 1,
1977 IIC_VSHLiD, "vshrn.i32", v4i16, v4i32, NEONvshrn>;
1978def VSHRN64 : N2VNSh<0, 1, 0b100000, 0b1000, 0, 0, 1,
1979 IIC_VSHLiD, "vshrn.i64", v2i32, v2i64, NEONvshrn>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001980
1981// VRSHL : Vector Rounding Shift
David Goodwin36bff0c2009-09-25 18:38:29 +00001982defm VRSHLs : N3VInt_QHSD<0,0,0b0101,0, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
1983 IIC_VSHLi4Q, "vrshl.s", int_arm_neon_vrshifts, 0>;
1984defm VRSHLu : N3VInt_QHSD<1,0,0b0101,0, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
1985 IIC_VSHLi4Q, "vrshl.u", int_arm_neon_vrshiftu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001986// VRSHR : Vector Rounding Shift Right
David Goodwin36bff0c2009-09-25 18:38:29 +00001987defm VRSHRs : N2VSh_QHSD<0, 1, 0b0010, 1, IIC_VSHLi4D, "vrshr.s", NEONvrshrs>;
1988defm VRSHRu : N2VSh_QHSD<1, 1, 0b0010, 1, IIC_VSHLi4D, "vrshr.u", NEONvrshru>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001989
1990// VRSHRN : Vector Rounding Shift Right and Narrow
David Goodwin36bff0c2009-09-25 18:38:29 +00001991def VRSHRN16 : N2VNSh<0, 1, 0b001000, 0b1000, 0, 1, 1,
1992 IIC_VSHLi4D, "vrshrn.i16", v8i8, v8i16, NEONvrshrn>;
1993def VRSHRN32 : N2VNSh<0, 1, 0b010000, 0b1000, 0, 1, 1,
1994 IIC_VSHLi4D, "vrshrn.i32", v4i16, v4i32, NEONvrshrn>;
1995def VRSHRN64 : N2VNSh<0, 1, 0b100000, 0b1000, 0, 1, 1,
1996 IIC_VSHLi4D, "vrshrn.i64", v2i32, v2i64, NEONvrshrn>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001997
1998// VQSHL : Vector Saturating Shift
David Goodwin36bff0c2009-09-25 18:38:29 +00001999defm VQSHLs : N3VInt_QHSD<0,0,0b0100,1, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
2000 IIC_VSHLi4Q, "vqshl.s", int_arm_neon_vqshifts, 0>;
2001defm VQSHLu : N3VInt_QHSD<1,0,0b0100,1, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
2002 IIC_VSHLi4Q, "vqshl.u", int_arm_neon_vqshiftu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002003// VQSHL : Vector Saturating Shift Left (Immediate)
David Goodwin36bff0c2009-09-25 18:38:29 +00002004defm VQSHLsi : N2VSh_QHSD<0, 1, 0b0111, 1, IIC_VSHLi4D, "vqshl.s", NEONvqshls>;
2005defm VQSHLui : N2VSh_QHSD<1, 1, 0b0111, 1, IIC_VSHLi4D, "vqshl.u", NEONvqshlu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002006// VQSHLU : Vector Saturating Shift Left (Immediate, Unsigned)
David Goodwin36bff0c2009-09-25 18:38:29 +00002007defm VQSHLsu : N2VSh_QHSD<1, 1, 0b0110, 1, IIC_VSHLi4D, "vqshlu.s", NEONvqshlsu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002008
2009// VQSHRN : Vector Saturating Shift Right and Narrow
David Goodwin36bff0c2009-09-25 18:38:29 +00002010def VQSHRNs16 : N2VNSh<0, 1, 0b001000, 0b1001, 0, 0, 1,
2011 IIC_VSHLi4D, "vqshrn.s16", v8i8, v8i16, NEONvqshrns>;
2012def VQSHRNs32 : N2VNSh<0, 1, 0b010000, 0b1001, 0, 0, 1,
2013 IIC_VSHLi4D, "vqshrn.s32", v4i16, v4i32, NEONvqshrns>;
2014def VQSHRNs64 : N2VNSh<0, 1, 0b100000, 0b1001, 0, 0, 1,
2015 IIC_VSHLi4D, "vqshrn.s64", v2i32, v2i64, NEONvqshrns>;
2016def VQSHRNu16 : N2VNSh<1, 1, 0b001000, 0b1001, 0, 0, 1,
2017 IIC_VSHLi4D, "vqshrn.u16", v8i8, v8i16, NEONvqshrnu>;
2018def VQSHRNu32 : N2VNSh<1, 1, 0b010000, 0b1001, 0, 0, 1,
2019 IIC_VSHLi4D, "vqshrn.u32", v4i16, v4i32, NEONvqshrnu>;
2020def VQSHRNu64 : N2VNSh<1, 1, 0b100000, 0b1001, 0, 0, 1,
2021 IIC_VSHLi4D, "vqshrn.u64", v2i32, v2i64, NEONvqshrnu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002022
2023// VQSHRUN : Vector Saturating Shift Right and Narrow (Unsigned)
David Goodwin36bff0c2009-09-25 18:38:29 +00002024def VQSHRUN16 : N2VNSh<1, 1, 0b001000, 0b1000, 0, 0, 1,
2025 IIC_VSHLi4D, "vqshrun.s16", v8i8, v8i16, NEONvqshrnsu>;
2026def VQSHRUN32 : N2VNSh<1, 1, 0b010000, 0b1000, 0, 0, 1,
2027 IIC_VSHLi4D, "vqshrun.s32", v4i16, v4i32, NEONvqshrnsu>;
2028def VQSHRUN64 : N2VNSh<1, 1, 0b100000, 0b1000, 0, 0, 1,
2029 IIC_VSHLi4D, "vqshrun.s64", v2i32, v2i64, NEONvqshrnsu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002030
2031// VQRSHL : Vector Saturating Rounding Shift
David Goodwin36bff0c2009-09-25 18:38:29 +00002032defm VQRSHLs : N3VInt_QHSD<0, 0, 0b0101, 1, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
2033 IIC_VSHLi4Q, "vqrshl.s", int_arm_neon_vqrshifts, 0>;
2034defm VQRSHLu : N3VInt_QHSD<1, 0, 0b0101, 1, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
2035 IIC_VSHLi4Q, "vqrshl.u", int_arm_neon_vqrshiftu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002036
2037// VQRSHRN : Vector Saturating Rounding Shift Right and Narrow
David Goodwin36bff0c2009-09-25 18:38:29 +00002038def VQRSHRNs16: N2VNSh<0, 1, 0b001000, 0b1001, 0, 1, 1,
2039 IIC_VSHLi4D, "vqrshrn.s16", v8i8, v8i16, NEONvqrshrns>;
2040def VQRSHRNs32: N2VNSh<0, 1, 0b010000, 0b1001, 0, 1, 1,
2041 IIC_VSHLi4D, "vqrshrn.s32", v4i16, v4i32, NEONvqrshrns>;
2042def VQRSHRNs64: N2VNSh<0, 1, 0b100000, 0b1001, 0, 1, 1,
2043 IIC_VSHLi4D, "vqrshrn.s64", v2i32, v2i64, NEONvqrshrns>;
2044def VQRSHRNu16: N2VNSh<1, 1, 0b001000, 0b1001, 0, 1, 1,
2045 IIC_VSHLi4D, "vqrshrn.u16", v8i8, v8i16, NEONvqrshrnu>;
2046def VQRSHRNu32: N2VNSh<1, 1, 0b010000, 0b1001, 0, 1, 1,
2047 IIC_VSHLi4D, "vqrshrn.u32", v4i16, v4i32, NEONvqrshrnu>;
2048def VQRSHRNu64: N2VNSh<1, 1, 0b100000, 0b1001, 0, 1, 1,
2049 IIC_VSHLi4D, "vqrshrn.u64", v2i32, v2i64, NEONvqrshrnu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002050
2051// VQRSHRUN : Vector Saturating Rounding Shift Right and Narrow (Unsigned)
David Goodwin36bff0c2009-09-25 18:38:29 +00002052def VQRSHRUN16: N2VNSh<1, 1, 0b001000, 0b1000, 0, 1, 1,
2053 IIC_VSHLi4D, "vqrshrun.s16", v8i8, v8i16, NEONvqrshrnsu>;
2054def VQRSHRUN32: N2VNSh<1, 1, 0b010000, 0b1000, 0, 1, 1,
2055 IIC_VSHLi4D, "vqrshrun.s32", v4i16, v4i32, NEONvqrshrnsu>;
2056def VQRSHRUN64: N2VNSh<1, 1, 0b100000, 0b1000, 0, 1, 1,
2057 IIC_VSHLi4D, "vqrshrun.s64", v2i32, v2i64, NEONvqrshrnsu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002058
2059// VSRA : Vector Shift Right and Accumulate
2060defm VSRAs : N2VShAdd_QHSD<0, 1, 0b0001, 1, "vsra.s", NEONvshrs>;
2061defm VSRAu : N2VShAdd_QHSD<1, 1, 0b0001, 1, "vsra.u", NEONvshru>;
2062// VRSRA : Vector Rounding Shift Right and Accumulate
2063defm VRSRAs : N2VShAdd_QHSD<0, 1, 0b0011, 1, "vrsra.s", NEONvrshrs>;
2064defm VRSRAu : N2VShAdd_QHSD<1, 1, 0b0011, 1, "vrsra.u", NEONvrshru>;
2065
2066// VSLI : Vector Shift Left and Insert
2067defm VSLI : N2VShIns_QHSD<1, 1, 0b0101, 1, "vsli.", NEONvsli>;
2068// VSRI : Vector Shift Right and Insert
2069defm VSRI : N2VShIns_QHSD<1, 1, 0b0100, 1, "vsri.", NEONvsri>;
2070
2071// Vector Absolute and Saturating Absolute.
2072
2073// VABS : Vector Absolute Value
David Goodwin78caa122009-09-23 21:38:08 +00002074defm VABS : N2VInt_QHS<0b11, 0b11, 0b01, 0b00110, 0,
2075 IIC_VUNAiD, IIC_VUNAiQ, "vabs.s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002076 int_arm_neon_vabs>;
David Goodwin78caa122009-09-23 21:38:08 +00002077def VABSfd : N2VDInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
2078 IIC_VUNAD, "vabs.f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00002079 v2f32, v2f32, int_arm_neon_vabs>;
David Goodwin78caa122009-09-23 21:38:08 +00002080def VABSfq : N2VQInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
2081 IIC_VUNAQ, "vabs.f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00002082 v4f32, v4f32, int_arm_neon_vabs>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002083
2084// VQABS : Vector Saturating Absolute Value
David Goodwin78caa122009-09-23 21:38:08 +00002085defm VQABS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01110, 0,
2086 IIC_VQUNAiD, IIC_VQUNAiQ, "vqabs.s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002087 int_arm_neon_vqabs>;
2088
2089// Vector Negate.
2090
2091def vneg : PatFrag<(ops node:$in), (sub immAllZerosV, node:$in)>;
2092def vneg_conv : PatFrag<(ops node:$in), (sub immAllZerosV_bc, node:$in)>;
2093
2094class VNEGD<bits<2> size, string OpcodeStr, ValueType Ty>
2095 : N2V<0b11, 0b11, size, 0b01, 0b00111, 0, 0, (outs DPR:$dst), (ins DPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002096 IIC_VSHLiD, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002097 [(set DPR:$dst, (Ty (vneg DPR:$src)))]>;
2098class VNEGQ<bits<2> size, string OpcodeStr, ValueType Ty>
2099 : N2V<0b11, 0b11, size, 0b01, 0b00111, 1, 0, (outs QPR:$dst), (ins QPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002100 IIC_VSHLiD, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002101 [(set QPR:$dst, (Ty (vneg QPR:$src)))]>;
2102
2103// VNEG : Vector Negate
2104def VNEGs8d : VNEGD<0b00, "vneg.s8", v8i8>;
2105def VNEGs16d : VNEGD<0b01, "vneg.s16", v4i16>;
2106def VNEGs32d : VNEGD<0b10, "vneg.s32", v2i32>;
2107def VNEGs8q : VNEGQ<0b00, "vneg.s8", v16i8>;
2108def VNEGs16q : VNEGQ<0b01, "vneg.s16", v8i16>;
2109def VNEGs32q : VNEGQ<0b10, "vneg.s32", v4i32>;
2110
2111// VNEG : Vector Negate (floating-point)
2112def VNEGf32d : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00002113 (outs DPR:$dst), (ins DPR:$src), IIC_VUNAD,
David Goodwincfd67652009-08-06 16:52:47 +00002114 "vneg.f32\t$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002115 [(set DPR:$dst, (v2f32 (fneg DPR:$src)))]>;
2116def VNEGf32q : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 1, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00002117 (outs QPR:$dst), (ins QPR:$src), IIC_VUNAQ,
David Goodwincfd67652009-08-06 16:52:47 +00002118 "vneg.f32\t$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002119 [(set QPR:$dst, (v4f32 (fneg QPR:$src)))]>;
2120
2121def : Pat<(v8i8 (vneg_conv DPR:$src)), (VNEGs8d DPR:$src)>;
2122def : Pat<(v4i16 (vneg_conv DPR:$src)), (VNEGs16d DPR:$src)>;
2123def : Pat<(v2i32 (vneg_conv DPR:$src)), (VNEGs32d DPR:$src)>;
2124def : Pat<(v16i8 (vneg_conv QPR:$src)), (VNEGs8q QPR:$src)>;
2125def : Pat<(v8i16 (vneg_conv QPR:$src)), (VNEGs16q QPR:$src)>;
2126def : Pat<(v4i32 (vneg_conv QPR:$src)), (VNEGs32q QPR:$src)>;
2127
2128// VQNEG : Vector Saturating Negate
David Goodwin78caa122009-09-23 21:38:08 +00002129defm VQNEG : N2VInt_QHS<0b11, 0b11, 0b00, 0b01111, 0,
2130 IIC_VQUNAiD, IIC_VQUNAiQ, "vqneg.s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002131 int_arm_neon_vqneg>;
2132
2133// Vector Bit Counting Operations.
2134
2135// VCLS : Vector Count Leading Sign Bits
David Goodwin78caa122009-09-23 21:38:08 +00002136defm VCLS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01000, 0,
2137 IIC_VCNTiD, IIC_VCNTiQ, "vcls.s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002138 int_arm_neon_vcls>;
2139// VCLZ : Vector Count Leading Zeros
David Goodwin78caa122009-09-23 21:38:08 +00002140defm VCLZ : N2VInt_QHS<0b11, 0b11, 0b00, 0b01001, 0,
2141 IIC_VCNTiD, IIC_VCNTiQ, "vclz.i",
Bob Wilsone60fee02009-06-22 23:27:02 +00002142 int_arm_neon_vclz>;
2143// VCNT : Vector Count One Bits
David Goodwin78caa122009-09-23 21:38:08 +00002144def VCNTd : N2VDInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
2145 IIC_VCNTiD, "vcnt.8",
Bob Wilsone60fee02009-06-22 23:27:02 +00002146 v8i8, v8i8, int_arm_neon_vcnt>;
David Goodwin78caa122009-09-23 21:38:08 +00002147def VCNTq : N2VQInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
2148 IIC_VCNTiQ, "vcnt.8",
Bob Wilsone60fee02009-06-22 23:27:02 +00002149 v16i8, v16i8, int_arm_neon_vcnt>;
2150
2151// Vector Move Operations.
2152
2153// VMOV : Vector Move (Register)
2154
2155def VMOVD : N3V<0, 0, 0b10, 0b0001, 0, 1, (outs DPR:$dst), (ins DPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002156 IIC_VMOVD, "vmov\t$dst, $src", "", []>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002157def VMOVQ : N3V<0, 0, 0b10, 0b0001, 1, 1, (outs QPR:$dst), (ins QPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002158 IIC_VMOVD, "vmov\t$dst, $src", "", []>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002159
2160// VMOV : Vector Move (Immediate)
2161
2162// VMOV_get_imm8 xform function: convert build_vector to VMOV.i8 imm.
2163def VMOV_get_imm8 : SDNodeXForm<build_vector, [{
2164 return ARM::getVMOVImm(N, 1, *CurDAG);
2165}]>;
2166def vmovImm8 : PatLeaf<(build_vector), [{
2167 return ARM::getVMOVImm(N, 1, *CurDAG).getNode() != 0;
2168}], VMOV_get_imm8>;
2169
2170// VMOV_get_imm16 xform function: convert build_vector to VMOV.i16 imm.
2171def VMOV_get_imm16 : SDNodeXForm<build_vector, [{
2172 return ARM::getVMOVImm(N, 2, *CurDAG);
2173}]>;
2174def vmovImm16 : PatLeaf<(build_vector), [{
2175 return ARM::getVMOVImm(N, 2, *CurDAG).getNode() != 0;
2176}], VMOV_get_imm16>;
2177
2178// VMOV_get_imm32 xform function: convert build_vector to VMOV.i32 imm.
2179def VMOV_get_imm32 : SDNodeXForm<build_vector, [{
2180 return ARM::getVMOVImm(N, 4, *CurDAG);
2181}]>;
2182def vmovImm32 : PatLeaf<(build_vector), [{
2183 return ARM::getVMOVImm(N, 4, *CurDAG).getNode() != 0;
2184}], VMOV_get_imm32>;
2185
2186// VMOV_get_imm64 xform function: convert build_vector to VMOV.i64 imm.
2187def VMOV_get_imm64 : SDNodeXForm<build_vector, [{
2188 return ARM::getVMOVImm(N, 8, *CurDAG);
2189}]>;
2190def vmovImm64 : PatLeaf<(build_vector), [{
2191 return ARM::getVMOVImm(N, 8, *CurDAG).getNode() != 0;
2192}], VMOV_get_imm64>;
2193
2194// Note: Some of the cmode bits in the following VMOV instructions need to
2195// be encoded based on the immed values.
2196
2197def VMOVv8i8 : N1ModImm<1, 0b000, 0b1110, 0, 0, 0, 1, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002198 (ins i8imm:$SIMM), IIC_VMOVImm,
David Goodwincfd67652009-08-06 16:52:47 +00002199 "vmov.i8\t$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002200 [(set DPR:$dst, (v8i8 vmovImm8:$SIMM))]>;
2201def VMOVv16i8 : N1ModImm<1, 0b000, 0b1110, 0, 1, 0, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002202 (ins i8imm:$SIMM), IIC_VMOVImm,
David Goodwincfd67652009-08-06 16:52:47 +00002203 "vmov.i8\t$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002204 [(set QPR:$dst, (v16i8 vmovImm8:$SIMM))]>;
2205
2206def VMOVv4i16 : N1ModImm<1, 0b000, 0b1000, 0, 0, 0, 1, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002207 (ins i16imm:$SIMM), IIC_VMOVImm,
David Goodwincfd67652009-08-06 16:52:47 +00002208 "vmov.i16\t$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002209 [(set DPR:$dst, (v4i16 vmovImm16:$SIMM))]>;
2210def VMOVv8i16 : N1ModImm<1, 0b000, 0b1000, 0, 1, 0, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002211 (ins i16imm:$SIMM), IIC_VMOVImm,
David Goodwincfd67652009-08-06 16:52:47 +00002212 "vmov.i16\t$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002213 [(set QPR:$dst, (v8i16 vmovImm16:$SIMM))]>;
2214
2215def VMOVv2i32 : N1ModImm<1, 0b000, 0b0000, 0, 0, 0, 1, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002216 (ins i32imm:$SIMM), IIC_VMOVImm,
David Goodwincfd67652009-08-06 16:52:47 +00002217 "vmov.i32\t$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002218 [(set DPR:$dst, (v2i32 vmovImm32:$SIMM))]>;
2219def VMOVv4i32 : N1ModImm<1, 0b000, 0b0000, 0, 1, 0, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002220 (ins i32imm:$SIMM), IIC_VMOVImm,
David Goodwincfd67652009-08-06 16:52:47 +00002221 "vmov.i32\t$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002222 [(set QPR:$dst, (v4i32 vmovImm32:$SIMM))]>;
2223
2224def VMOVv1i64 : N1ModImm<1, 0b000, 0b1110, 0, 0, 1, 1, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002225 (ins i64imm:$SIMM), IIC_VMOVImm,
David Goodwincfd67652009-08-06 16:52:47 +00002226 "vmov.i64\t$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002227 [(set DPR:$dst, (v1i64 vmovImm64:$SIMM))]>;
2228def VMOVv2i64 : N1ModImm<1, 0b000, 0b1110, 0, 1, 1, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002229 (ins i64imm:$SIMM), IIC_VMOVImm,
David Goodwincfd67652009-08-06 16:52:47 +00002230 "vmov.i64\t$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002231 [(set QPR:$dst, (v2i64 vmovImm64:$SIMM))]>;
2232
2233// VMOV : Vector Get Lane (move scalar to ARM core register)
2234
2235def VGETLNs8 : NVGetLane<0b11100101, 0b1011, 0b00,
Bob Wilson30ff4492009-08-21 21:58:55 +00002236 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +00002237 IIC_VMOVSI, "vmov", ".s8\t$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002238 [(set GPR:$dst, (NEONvgetlanes (v8i8 DPR:$src),
2239 imm:$lane))]>;
2240def VGETLNs16 : NVGetLane<0b11100001, 0b1011, 0b01,
Bob Wilson30ff4492009-08-21 21:58:55 +00002241 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +00002242 IIC_VMOVSI, "vmov", ".s16\t$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002243 [(set GPR:$dst, (NEONvgetlanes (v4i16 DPR:$src),
2244 imm:$lane))]>;
2245def VGETLNu8 : NVGetLane<0b11101101, 0b1011, 0b00,
Bob Wilson30ff4492009-08-21 21:58:55 +00002246 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +00002247 IIC_VMOVSI, "vmov", ".u8\t$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002248 [(set GPR:$dst, (NEONvgetlaneu (v8i8 DPR:$src),
2249 imm:$lane))]>;
2250def VGETLNu16 : NVGetLane<0b11101001, 0b1011, 0b01,
Bob Wilson30ff4492009-08-21 21:58:55 +00002251 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +00002252 IIC_VMOVSI, "vmov", ".u16\t$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002253 [(set GPR:$dst, (NEONvgetlaneu (v4i16 DPR:$src),
2254 imm:$lane))]>;
2255def VGETLNi32 : NVGetLane<0b11100001, 0b1011, 0b00,
Bob Wilson30ff4492009-08-21 21:58:55 +00002256 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +00002257 IIC_VMOVSI, "vmov", ".32\t$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002258 [(set GPR:$dst, (extractelt (v2i32 DPR:$src),
2259 imm:$lane))]>;
2260// def VGETLNf32: see FMRDH and FMRDL in ARMInstrVFP.td
2261def : Pat<(NEONvgetlanes (v16i8 QPR:$src), imm:$lane),
2262 (VGETLNs8 (v8i8 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002263 (DSubReg_i8_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002264 (SubReg_i8_lane imm:$lane))>;
2265def : Pat<(NEONvgetlanes (v8i16 QPR:$src), imm:$lane),
2266 (VGETLNs16 (v4i16 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002267 (DSubReg_i16_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002268 (SubReg_i16_lane imm:$lane))>;
2269def : Pat<(NEONvgetlaneu (v16i8 QPR:$src), imm:$lane),
2270 (VGETLNu8 (v8i8 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002271 (DSubReg_i8_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002272 (SubReg_i8_lane imm:$lane))>;
2273def : Pat<(NEONvgetlaneu (v8i16 QPR:$src), imm:$lane),
2274 (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002275 (DSubReg_i16_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002276 (SubReg_i16_lane imm:$lane))>;
2277def : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
2278 (VGETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002279 (DSubReg_i32_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002280 (SubReg_i32_lane imm:$lane))>;
Anton Korobeynikov44e0a6c2009-08-28 23:41:26 +00002281def : Pat<(extractelt (v2f32 DPR:$src1), imm:$src2),
Anton Korobeynikov3600d162009-09-12 22:21:08 +00002282 (EXTRACT_SUBREG (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2),
2283 (SSubReg_f32_reg imm:$src2))>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002284def : Pat<(extractelt (v4f32 QPR:$src1), imm:$src2),
Anton Korobeynikov3600d162009-09-12 22:21:08 +00002285 (EXTRACT_SUBREG (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2),
2286 (SSubReg_f32_reg imm:$src2))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002287//def : Pat<(extractelt (v2i64 QPR:$src1), imm:$src2),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002288// (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002289def : Pat<(extractelt (v2f64 QPR:$src1), imm:$src2),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002290 (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002291
2292
2293// VMOV : Vector Set Lane (move ARM core register to scalar)
2294
2295let Constraints = "$src1 = $dst" in {
2296def VSETLNi8 : NVSetLane<0b11100100, 0b1011, 0b00, (outs DPR:$dst),
Bob Wilson30ff4492009-08-21 21:58:55 +00002297 (ins DPR:$src1, GPR:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +00002298 IIC_VMOVISL, "vmov", ".8\t$dst[$lane], $src2",
Bob Wilsone60fee02009-06-22 23:27:02 +00002299 [(set DPR:$dst, (vector_insert (v8i8 DPR:$src1),
2300 GPR:$src2, imm:$lane))]>;
2301def VSETLNi16 : NVSetLane<0b11100000, 0b1011, 0b01, (outs DPR:$dst),
Bob Wilson30ff4492009-08-21 21:58:55 +00002302 (ins DPR:$src1, GPR:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +00002303 IIC_VMOVISL, "vmov", ".16\t$dst[$lane], $src2",
Bob Wilsone60fee02009-06-22 23:27:02 +00002304 [(set DPR:$dst, (vector_insert (v4i16 DPR:$src1),
2305 GPR:$src2, imm:$lane))]>;
2306def VSETLNi32 : NVSetLane<0b11100000, 0b1011, 0b00, (outs DPR:$dst),
Bob Wilson30ff4492009-08-21 21:58:55 +00002307 (ins DPR:$src1, GPR:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +00002308 IIC_VMOVISL, "vmov", ".32\t$dst[$lane], $src2",
Bob Wilsone60fee02009-06-22 23:27:02 +00002309 [(set DPR:$dst, (insertelt (v2i32 DPR:$src1),
2310 GPR:$src2, imm:$lane))]>;
2311}
2312def : Pat<(vector_insert (v16i8 QPR:$src1), GPR:$src2, imm:$lane),
2313 (v16i8 (INSERT_SUBREG QPR:$src1,
2314 (VSETLNi8 (v8i8 (EXTRACT_SUBREG QPR:$src1,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002315 (DSubReg_i8_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002316 GPR:$src2, (SubReg_i8_lane imm:$lane)),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002317 (DSubReg_i8_reg imm:$lane)))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002318def : Pat<(vector_insert (v8i16 QPR:$src1), GPR:$src2, imm:$lane),
2319 (v8i16 (INSERT_SUBREG QPR:$src1,
2320 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002321 (DSubReg_i16_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002322 GPR:$src2, (SubReg_i16_lane imm:$lane)),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002323 (DSubReg_i16_reg imm:$lane)))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002324def : Pat<(insertelt (v4i32 QPR:$src1), GPR:$src2, imm:$lane),
2325 (v4i32 (INSERT_SUBREG QPR:$src1,
2326 (VSETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src1,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002327 (DSubReg_i32_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002328 GPR:$src2, (SubReg_i32_lane imm:$lane)),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002329 (DSubReg_i32_reg imm:$lane)))>;
2330
Anton Korobeynikovd3352772009-08-30 19:06:39 +00002331def : Pat<(v2f32 (insertelt DPR:$src1, SPR:$src2, imm:$src3)),
Anton Korobeynikov3600d162009-09-12 22:21:08 +00002332 (INSERT_SUBREG (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2),
2333 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002334def : Pat<(v4f32 (insertelt QPR:$src1, SPR:$src2, imm:$src3)),
Anton Korobeynikov3600d162009-09-12 22:21:08 +00002335 (INSERT_SUBREG (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2),
2336 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002337
2338//def : Pat<(v2i64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002339// (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002340def : Pat<(v2f64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002341 (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002342
Anton Korobeynikovbaee7b22009-08-27 14:38:44 +00002343def : Pat<(v2f32 (scalar_to_vector SPR:$src)),
2344 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$src, arm_ssubreg_0)>;
2345def : Pat<(v2f64 (scalar_to_vector DPR:$src)),
2346 (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), DPR:$src, arm_dsubreg_0)>;
2347def : Pat<(v4f32 (scalar_to_vector SPR:$src)),
2348 (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), SPR:$src, arm_ssubreg_0)>;
2349
Anton Korobeynikov872393c2009-08-27 16:10:17 +00002350def : Pat<(v8i8 (scalar_to_vector GPR:$src)),
2351 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
2352def : Pat<(v4i16 (scalar_to_vector GPR:$src)),
2353 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
2354def : Pat<(v2i32 (scalar_to_vector GPR:$src)),
2355 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
2356
2357def : Pat<(v16i8 (scalar_to_vector GPR:$src)),
2358 (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)),
2359 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
2360 arm_dsubreg_0)>;
2361def : Pat<(v8i16 (scalar_to_vector GPR:$src)),
2362 (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)),
2363 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
2364 arm_dsubreg_0)>;
2365def : Pat<(v4i32 (scalar_to_vector GPR:$src)),
2366 (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)),
2367 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
2368 arm_dsubreg_0)>;
2369
Bob Wilsone60fee02009-06-22 23:27:02 +00002370// VDUP : Vector Duplicate (from ARM core register to all elements)
2371
Bob Wilsone60fee02009-06-22 23:27:02 +00002372class VDUPD<bits<8> opcod1, bits<2> opcod3, string asmSize, ValueType Ty>
2373 : NVDup<opcod1, 0b1011, opcod3, (outs DPR:$dst), (ins GPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002374 IIC_VMOVIS, "vdup", !strconcat(asmSize, "\t$dst, $src"),
Bob Wilsonf4f1a272009-08-14 05:13:08 +00002375 [(set DPR:$dst, (Ty (NEONvdup (i32 GPR:$src))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002376class VDUPQ<bits<8> opcod1, bits<2> opcod3, string asmSize, ValueType Ty>
2377 : NVDup<opcod1, 0b1011, opcod3, (outs QPR:$dst), (ins GPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002378 IIC_VMOVIS, "vdup", !strconcat(asmSize, "\t$dst, $src"),
Bob Wilsonf4f1a272009-08-14 05:13:08 +00002379 [(set QPR:$dst, (Ty (NEONvdup (i32 GPR:$src))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002380
2381def VDUP8d : VDUPD<0b11101100, 0b00, ".8", v8i8>;
2382def VDUP16d : VDUPD<0b11101000, 0b01, ".16", v4i16>;
2383def VDUP32d : VDUPD<0b11101000, 0b00, ".32", v2i32>;
2384def VDUP8q : VDUPQ<0b11101110, 0b00, ".8", v16i8>;
2385def VDUP16q : VDUPQ<0b11101010, 0b01, ".16", v8i16>;
2386def VDUP32q : VDUPQ<0b11101010, 0b00, ".32", v4i32>;
2387
2388def VDUPfd : NVDup<0b11101000, 0b1011, 0b00, (outs DPR:$dst), (ins GPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002389 IIC_VMOVIS, "vdup", ".32\t$dst, $src",
Bob Wilsonf4f1a272009-08-14 05:13:08 +00002390 [(set DPR:$dst, (v2f32 (NEONvdup
2391 (f32 (bitconvert GPR:$src)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002392def VDUPfq : NVDup<0b11101010, 0b1011, 0b00, (outs QPR:$dst), (ins GPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002393 IIC_VMOVIS, "vdup", ".32\t$dst, $src",
Bob Wilsonf4f1a272009-08-14 05:13:08 +00002394 [(set QPR:$dst, (v4f32 (NEONvdup
2395 (f32 (bitconvert GPR:$src)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002396
2397// VDUP : Vector Duplicate Lane (from scalar to all elements)
2398
Bob Wilsone60fee02009-06-22 23:27:02 +00002399class VDUPLND<bits<2> op19_18, bits<2> op17_16, string OpcodeStr, ValueType Ty>
2400 : N2V<0b11, 0b11, op19_18, op17_16, 0b11000, 0, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00002401 (outs DPR:$dst), (ins DPR:$src, nohash_imm:$lane), IIC_VMOVD,
Anton Korobeynikove2be3382009-08-08 23:10:41 +00002402 !strconcat(OpcodeStr, "\t$dst, $src[$lane]"), "",
Bob Wilson206f6c42009-08-14 05:08:32 +00002403 [(set DPR:$dst, (Ty (NEONvduplane (Ty DPR:$src), imm:$lane)))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002404
Bob Wilsone60fee02009-06-22 23:27:02 +00002405class VDUPLNQ<bits<2> op19_18, bits<2> op17_16, string OpcodeStr,
2406 ValueType ResTy, ValueType OpTy>
2407 : N2V<0b11, 0b11, op19_18, op17_16, 0b11000, 1, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00002408 (outs QPR:$dst), (ins DPR:$src, nohash_imm:$lane), IIC_VMOVD,
Anton Korobeynikove2be3382009-08-08 23:10:41 +00002409 !strconcat(OpcodeStr, "\t$dst, $src[$lane]"), "",
Bob Wilson206f6c42009-08-14 05:08:32 +00002410 [(set QPR:$dst, (ResTy (NEONvduplane (OpTy DPR:$src), imm:$lane)))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002411
2412def VDUPLN8d : VDUPLND<0b00, 0b01, "vdup.8", v8i8>;
2413def VDUPLN16d : VDUPLND<0b00, 0b10, "vdup.16", v4i16>;
2414def VDUPLN32d : VDUPLND<0b01, 0b00, "vdup.32", v2i32>;
2415def VDUPLNfd : VDUPLND<0b01, 0b00, "vdup.32", v2f32>;
2416def VDUPLN8q : VDUPLNQ<0b00, 0b01, "vdup.8", v16i8, v8i8>;
2417def VDUPLN16q : VDUPLNQ<0b00, 0b10, "vdup.16", v8i16, v4i16>;
2418def VDUPLN32q : VDUPLNQ<0b01, 0b00, "vdup.32", v4i32, v2i32>;
2419def VDUPLNfq : VDUPLNQ<0b01, 0b00, "vdup.32", v4f32, v2f32>;
2420
Bob Wilson206f6c42009-08-14 05:08:32 +00002421def : Pat<(v16i8 (NEONvduplane (v16i8 QPR:$src), imm:$lane)),
2422 (v16i8 (VDUPLN8q (v8i8 (EXTRACT_SUBREG QPR:$src,
2423 (DSubReg_i8_reg imm:$lane))),
2424 (SubReg_i8_lane imm:$lane)))>;
2425def : Pat<(v8i16 (NEONvduplane (v8i16 QPR:$src), imm:$lane)),
2426 (v8i16 (VDUPLN16q (v4i16 (EXTRACT_SUBREG QPR:$src,
2427 (DSubReg_i16_reg imm:$lane))),
2428 (SubReg_i16_lane imm:$lane)))>;
2429def : Pat<(v4i32 (NEONvduplane (v4i32 QPR:$src), imm:$lane)),
2430 (v4i32 (VDUPLN32q (v2i32 (EXTRACT_SUBREG QPR:$src,
2431 (DSubReg_i32_reg imm:$lane))),
2432 (SubReg_i32_lane imm:$lane)))>;
2433def : Pat<(v4f32 (NEONvduplane (v4f32 QPR:$src), imm:$lane)),
2434 (v4f32 (VDUPLNfq (v2f32 (EXTRACT_SUBREG QPR:$src,
2435 (DSubReg_i32_reg imm:$lane))),
2436 (SubReg_i32_lane imm:$lane)))>;
2437
Anton Korobeynikov9c913fb2009-08-07 22:36:50 +00002438def VDUPfdf : N2V<0b11, 0b11, 0b01, 0b00, 0b11000, 0, 0,
2439 (outs DPR:$dst), (ins SPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002440 IIC_VMOVD, "vdup.32\t$dst, ${src:lane}", "",
Bob Wilsonf4f1a272009-08-14 05:13:08 +00002441 [(set DPR:$dst, (v2f32 (NEONvdup (f32 SPR:$src))))]>;
Anton Korobeynikov9c913fb2009-08-07 22:36:50 +00002442
2443def VDUPfqf : N2V<0b11, 0b11, 0b01, 0b00, 0b11000, 1, 0,
2444 (outs QPR:$dst), (ins SPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002445 IIC_VMOVD, "vdup.32\t$dst, ${src:lane}", "",
Bob Wilsonf4f1a272009-08-14 05:13:08 +00002446 [(set QPR:$dst, (v4f32 (NEONvdup (f32 SPR:$src))))]>;
Anton Korobeynikov9c913fb2009-08-07 22:36:50 +00002447
Anton Korobeynikovb261a192009-09-02 21:21:28 +00002448def : Pat<(v2i64 (NEONvduplane (v2i64 QPR:$src), imm:$lane)),
2449 (INSERT_SUBREG QPR:$src,
2450 (i64 (EXTRACT_SUBREG QPR:$src, (DSubReg_f64_reg imm:$lane))),
2451 (DSubReg_f64_other_reg imm:$lane))>;
2452def : Pat<(v2f64 (NEONvduplane (v2f64 QPR:$src), imm:$lane)),
2453 (INSERT_SUBREG QPR:$src,
2454 (f64 (EXTRACT_SUBREG QPR:$src, (DSubReg_f64_reg imm:$lane))),
2455 (DSubReg_f64_other_reg imm:$lane))>;
2456
Bob Wilsone60fee02009-06-22 23:27:02 +00002457// VMOVN : Vector Narrowing Move
David Goodwin78caa122009-09-23 21:38:08 +00002458defm VMOVN : N2VNInt_HSD<0b11,0b11,0b10,0b00100,0,0, IIC_VMOVD, "vmovn.i",
Bob Wilsone60fee02009-06-22 23:27:02 +00002459 int_arm_neon_vmovn>;
2460// VQMOVN : Vector Saturating Narrowing Move
David Goodwin78caa122009-09-23 21:38:08 +00002461defm VQMOVNs : N2VNInt_HSD<0b11,0b11,0b10,0b00101,0,0, IIC_VQUNAiD, "vqmovn.s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002462 int_arm_neon_vqmovns>;
David Goodwin78caa122009-09-23 21:38:08 +00002463defm VQMOVNu : N2VNInt_HSD<0b11,0b11,0b10,0b00101,1,0, IIC_VQUNAiD, "vqmovn.u",
Bob Wilsone60fee02009-06-22 23:27:02 +00002464 int_arm_neon_vqmovnu>;
David Goodwin78caa122009-09-23 21:38:08 +00002465defm VQMOVNsu : N2VNInt_HSD<0b11,0b11,0b10,0b00100,1,0, IIC_VQUNAiD, "vqmovun.s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002466 int_arm_neon_vqmovnsu>;
2467// VMOVL : Vector Lengthening Move
2468defm VMOVLs : N2VLInt_QHS<0,1,0b1010,0,0,1, "vmovl.s", int_arm_neon_vmovls>;
2469defm VMOVLu : N2VLInt_QHS<1,1,0b1010,0,0,1, "vmovl.u", int_arm_neon_vmovlu>;
2470
2471// Vector Conversions.
2472
2473// VCVT : Vector Convert Between Floating-Point and Integers
2474def VCVTf2sd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt.s32.f32",
2475 v2i32, v2f32, fp_to_sint>;
2476def VCVTf2ud : N2VD<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt.u32.f32",
2477 v2i32, v2f32, fp_to_uint>;
2478def VCVTs2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt.f32.s32",
2479 v2f32, v2i32, sint_to_fp>;
2480def VCVTu2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt.f32.u32",
2481 v2f32, v2i32, uint_to_fp>;
2482
2483def VCVTf2sq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt.s32.f32",
2484 v4i32, v4f32, fp_to_sint>;
2485def VCVTf2uq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt.u32.f32",
2486 v4i32, v4f32, fp_to_uint>;
2487def VCVTs2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt.f32.s32",
2488 v4f32, v4i32, sint_to_fp>;
2489def VCVTu2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt.f32.u32",
2490 v4f32, v4i32, uint_to_fp>;
2491
2492// VCVT : Vector Convert Between Floating-Point and Fixed-Point.
2493// Note: Some of the opcode bits in the following VCVT instructions need to
2494// be encoded based on the immed values.
2495def VCVTf2xsd : N2VCvtD<0, 1, 0b000000, 0b1111, 0, 1, "vcvt.s32.f32",
2496 v2i32, v2f32, int_arm_neon_vcvtfp2fxs>;
2497def VCVTf2xud : N2VCvtD<1, 1, 0b000000, 0b1111, 0, 1, "vcvt.u32.f32",
2498 v2i32, v2f32, int_arm_neon_vcvtfp2fxu>;
2499def VCVTxs2fd : N2VCvtD<0, 1, 0b000000, 0b1110, 0, 1, "vcvt.f32.s32",
2500 v2f32, v2i32, int_arm_neon_vcvtfxs2fp>;
2501def VCVTxu2fd : N2VCvtD<1, 1, 0b000000, 0b1110, 0, 1, "vcvt.f32.u32",
2502 v2f32, v2i32, int_arm_neon_vcvtfxu2fp>;
2503
2504def VCVTf2xsq : N2VCvtQ<0, 1, 0b000000, 0b1111, 0, 1, "vcvt.s32.f32",
2505 v4i32, v4f32, int_arm_neon_vcvtfp2fxs>;
2506def VCVTf2xuq : N2VCvtQ<1, 1, 0b000000, 0b1111, 0, 1, "vcvt.u32.f32",
2507 v4i32, v4f32, int_arm_neon_vcvtfp2fxu>;
2508def VCVTxs2fq : N2VCvtQ<0, 1, 0b000000, 0b1110, 0, 1, "vcvt.f32.s32",
2509 v4f32, v4i32, int_arm_neon_vcvtfxs2fp>;
2510def VCVTxu2fq : N2VCvtQ<1, 1, 0b000000, 0b1110, 0, 1, "vcvt.f32.u32",
2511 v4f32, v4i32, int_arm_neon_vcvtfxu2fp>;
2512
Bob Wilson08479272009-08-12 22:31:50 +00002513// Vector Reverse.
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002514
2515// VREV64 : Vector Reverse elements within 64-bit doublewords
2516
2517class VREV64D<bits<2> op19_18, string OpcodeStr, ValueType Ty>
2518 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 0, 0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002519 (ins DPR:$src), IIC_VMOVD,
David Goodwincfd67652009-08-06 16:52:47 +00002520 !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilson08479272009-08-12 22:31:50 +00002521 [(set DPR:$dst, (Ty (NEONvrev64 (Ty DPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002522class VREV64Q<bits<2> op19_18, string OpcodeStr, ValueType Ty>
2523 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 1, 0, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002524 (ins QPR:$src), IIC_VMOVD,
David Goodwincfd67652009-08-06 16:52:47 +00002525 !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilson08479272009-08-12 22:31:50 +00002526 [(set QPR:$dst, (Ty (NEONvrev64 (Ty QPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002527
2528def VREV64d8 : VREV64D<0b00, "vrev64.8", v8i8>;
2529def VREV64d16 : VREV64D<0b01, "vrev64.16", v4i16>;
2530def VREV64d32 : VREV64D<0b10, "vrev64.32", v2i32>;
2531def VREV64df : VREV64D<0b10, "vrev64.32", v2f32>;
2532
2533def VREV64q8 : VREV64Q<0b00, "vrev64.8", v16i8>;
2534def VREV64q16 : VREV64Q<0b01, "vrev64.16", v8i16>;
2535def VREV64q32 : VREV64Q<0b10, "vrev64.32", v4i32>;
2536def VREV64qf : VREV64Q<0b10, "vrev64.32", v4f32>;
2537
2538// VREV32 : Vector Reverse elements within 32-bit words
2539
2540class VREV32D<bits<2> op19_18, string OpcodeStr, ValueType Ty>
2541 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 0, 0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002542 (ins DPR:$src), IIC_VMOVD,
David Goodwincfd67652009-08-06 16:52:47 +00002543 !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilson08479272009-08-12 22:31:50 +00002544 [(set DPR:$dst, (Ty (NEONvrev32 (Ty DPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002545class VREV32Q<bits<2> op19_18, string OpcodeStr, ValueType Ty>
2546 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 1, 0, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002547 (ins QPR:$src), IIC_VMOVD,
David Goodwincfd67652009-08-06 16:52:47 +00002548 !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilson08479272009-08-12 22:31:50 +00002549 [(set QPR:$dst, (Ty (NEONvrev32 (Ty QPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002550
2551def VREV32d8 : VREV32D<0b00, "vrev32.8", v8i8>;
2552def VREV32d16 : VREV32D<0b01, "vrev32.16", v4i16>;
2553
2554def VREV32q8 : VREV32Q<0b00, "vrev32.8", v16i8>;
2555def VREV32q16 : VREV32Q<0b01, "vrev32.16", v8i16>;
2556
2557// VREV16 : Vector Reverse elements within 16-bit halfwords
2558
2559class VREV16D<bits<2> op19_18, string OpcodeStr, ValueType Ty>
2560 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 0, 0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002561 (ins DPR:$src), IIC_VMOVD,
David Goodwincfd67652009-08-06 16:52:47 +00002562 !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilson08479272009-08-12 22:31:50 +00002563 [(set DPR:$dst, (Ty (NEONvrev16 (Ty DPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002564class VREV16Q<bits<2> op19_18, string OpcodeStr, ValueType Ty>
2565 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 1, 0, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002566 (ins QPR:$src), IIC_VMOVD,
David Goodwincfd67652009-08-06 16:52:47 +00002567 !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilson08479272009-08-12 22:31:50 +00002568 [(set QPR:$dst, (Ty (NEONvrev16 (Ty QPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002569
2570def VREV16d8 : VREV16D<0b00, "vrev16.8", v8i8>;
2571def VREV16q8 : VREV16Q<0b00, "vrev16.8", v16i8>;
2572
Bob Wilson3ac39132009-08-19 17:03:43 +00002573// Other Vector Shuffles.
2574
2575// VEXT : Vector Extract
2576
Anton Korobeynikov6c28c002009-08-21 12:40:21 +00002577class VEXTd<string OpcodeStr, ValueType Ty>
2578 : N3V<0,1,0b11,0b0000,0,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002579 (ins DPR:$lhs, DPR:$rhs, i32imm:$index), IIC_VEXTD,
Anton Korobeynikov6c28c002009-08-21 12:40:21 +00002580 !strconcat(OpcodeStr, "\t$dst, $lhs, $rhs, $index"), "",
2581 [(set DPR:$dst, (Ty (NEONvext (Ty DPR:$lhs),
2582 (Ty DPR:$rhs), imm:$index)))]>;
2583
2584class VEXTq<string OpcodeStr, ValueType Ty>
2585 : N3V<0,1,0b11,0b0000,1,0, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002586 (ins QPR:$lhs, QPR:$rhs, i32imm:$index), IIC_VEXTQ,
Anton Korobeynikov6c28c002009-08-21 12:40:21 +00002587 !strconcat(OpcodeStr, "\t$dst, $lhs, $rhs, $index"), "",
2588 [(set QPR:$dst, (Ty (NEONvext (Ty QPR:$lhs),
2589 (Ty QPR:$rhs), imm:$index)))]>;
2590
2591def VEXTd8 : VEXTd<"vext.8", v8i8>;
2592def VEXTd16 : VEXTd<"vext.16", v4i16>;
2593def VEXTd32 : VEXTd<"vext.32", v2i32>;
2594def VEXTdf : VEXTd<"vext.32", v2f32>;
2595
2596def VEXTq8 : VEXTq<"vext.8", v16i8>;
2597def VEXTq16 : VEXTq<"vext.16", v8i16>;
2598def VEXTq32 : VEXTq<"vext.32", v4i32>;
2599def VEXTqf : VEXTq<"vext.32", v4f32>;
Bob Wilson3ac39132009-08-19 17:03:43 +00002600
Bob Wilson3b169332009-08-08 05:53:00 +00002601// VTRN : Vector Transpose
2602
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +00002603def VTRNd8 : N2VDShuffle<0b00, 0b00001, "vtrn.8">;
2604def VTRNd16 : N2VDShuffle<0b01, 0b00001, "vtrn.16">;
2605def VTRNd32 : N2VDShuffle<0b10, 0b00001, "vtrn.32">;
Bob Wilson3b169332009-08-08 05:53:00 +00002606
David Goodwin78caa122009-09-23 21:38:08 +00002607def VTRNq8 : N2VQShuffle<0b00, 0b00001, IIC_VPERMQ, "vtrn.8">;
2608def VTRNq16 : N2VQShuffle<0b01, 0b00001, IIC_VPERMQ, "vtrn.16">;
2609def VTRNq32 : N2VQShuffle<0b10, 0b00001, IIC_VPERMQ, "vtrn.32">;
Bob Wilson3b169332009-08-08 05:53:00 +00002610
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +00002611// VUZP : Vector Unzip (Deinterleave)
2612
2613def VUZPd8 : N2VDShuffle<0b00, 0b00010, "vuzp.8">;
2614def VUZPd16 : N2VDShuffle<0b01, 0b00010, "vuzp.16">;
2615def VUZPd32 : N2VDShuffle<0b10, 0b00010, "vuzp.32">;
2616
David Goodwin78caa122009-09-23 21:38:08 +00002617def VUZPq8 : N2VQShuffle<0b00, 0b00010, IIC_VPERMQ3, "vuzp.8">;
2618def VUZPq16 : N2VQShuffle<0b01, 0b00010, IIC_VPERMQ3, "vuzp.16">;
2619def VUZPq32 : N2VQShuffle<0b10, 0b00010, IIC_VPERMQ3, "vuzp.32">;
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +00002620
2621// VZIP : Vector Zip (Interleave)
2622
2623def VZIPd8 : N2VDShuffle<0b00, 0b00011, "vzip.8">;
2624def VZIPd16 : N2VDShuffle<0b01, 0b00011, "vzip.16">;
2625def VZIPd32 : N2VDShuffle<0b10, 0b00011, "vzip.32">;
2626
David Goodwin78caa122009-09-23 21:38:08 +00002627def VZIPq8 : N2VQShuffle<0b00, 0b00011, IIC_VPERMQ3, "vzip.8">;
2628def VZIPq16 : N2VQShuffle<0b01, 0b00011, IIC_VPERMQ3, "vzip.16">;
2629def VZIPq32 : N2VQShuffle<0b10, 0b00011, IIC_VPERMQ3, "vzip.32">;
Bob Wilson3b169332009-08-08 05:53:00 +00002630
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002631// Vector Table Lookup and Table Extension.
2632
2633// VTBL : Vector Table Lookup
2634def VTBL1
2635 : N3V<1,1,0b11,0b1000,0,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002636 (ins DPR:$tbl1, DPR:$src), IIC_VTB1,
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002637 "vtbl.8\t$dst, \\{$tbl1\\}, $src", "",
2638 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl1 DPR:$tbl1, DPR:$src)))]>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +00002639let hasExtraSrcRegAllocReq = 1 in {
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002640def VTBL2
2641 : N3V<1,1,0b11,0b1001,0,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002642 (ins DPR:$tbl1, DPR:$tbl2, DPR:$src), IIC_VTB2,
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002643 "vtbl.8\t$dst, \\{$tbl1,$tbl2\\}, $src", "",
2644 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl2
2645 DPR:$tbl1, DPR:$tbl2, DPR:$src)))]>;
2646def VTBL3
2647 : N3V<1,1,0b11,0b1010,0,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002648 (ins DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src), IIC_VTB3,
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002649 "vtbl.8\t$dst, \\{$tbl1,$tbl2,$tbl3\\}, $src", "",
2650 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl3
2651 DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src)))]>;
2652def VTBL4
2653 : N3V<1,1,0b11,0b1011,0,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002654 (ins DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src), IIC_VTB4,
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002655 "vtbl.8\t$dst, \\{$tbl1,$tbl2,$tbl3,$tbl4\\}, $src", "",
2656 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl4 DPR:$tbl1, DPR:$tbl2,
2657 DPR:$tbl3, DPR:$tbl4, DPR:$src)))]>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +00002658} // hasExtraSrcRegAllocReq = 1
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002659
2660// VTBX : Vector Table Extension
2661def VTBX1
2662 : N3V<1,1,0b11,0b1000,1,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002663 (ins DPR:$orig, DPR:$tbl1, DPR:$src), IIC_VTBX1,
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002664 "vtbx.8\t$dst, \\{$tbl1\\}, $src", "$orig = $dst",
2665 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx1
2666 DPR:$orig, DPR:$tbl1, DPR:$src)))]>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +00002667let hasExtraSrcRegAllocReq = 1 in {
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002668def VTBX2
2669 : N3V<1,1,0b11,0b1001,1,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002670 (ins DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$src), IIC_VTBX2,
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002671 "vtbx.8\t$dst, \\{$tbl1,$tbl2\\}, $src", "$orig = $dst",
2672 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx2
2673 DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$src)))]>;
2674def VTBX3
2675 : N3V<1,1,0b11,0b1010,1,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002676 (ins DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src), IIC_VTBX3,
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002677 "vtbx.8\t$dst, \\{$tbl1,$tbl2,$tbl3\\}, $src", "$orig = $dst",
2678 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx3 DPR:$orig, DPR:$tbl1,
2679 DPR:$tbl2, DPR:$tbl3, DPR:$src)))]>;
2680def VTBX4
2681 : N3V<1,1,0b11,0b1011,1,0, (outs DPR:$dst), (ins DPR:$orig, DPR:$tbl1,
David Goodwin36bff0c2009-09-25 18:38:29 +00002682 DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src), IIC_VTBX4,
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002683 "vtbx.8\t$dst, \\{$tbl1,$tbl2,$tbl3,$tbl4\\}, $src", "$orig = $dst",
2684 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx4 DPR:$orig, DPR:$tbl1,
2685 DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src)))]>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +00002686} // hasExtraSrcRegAllocReq = 1
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002687
Bob Wilsone60fee02009-06-22 23:27:02 +00002688//===----------------------------------------------------------------------===//
Evan Cheng46961d82009-08-07 19:30:41 +00002689// NEON instructions for single-precision FP math
2690//===----------------------------------------------------------------------===//
2691
2692// These need separate instructions because they must use DPR_VFP2 register
2693// class which have SPR sub-registers.
2694
2695// Vector Add Operations used for single-precision FP
2696let neverHasSideEffects = 1 in
2697def VADDfd_sfp : N3VDs<0, 0, 0b00, 0b1101, 0, "vadd.f32", v2f32, v2f32, fadd,1>;
2698def : N3VDsPat<fadd, VADDfd_sfp>;
2699
David Goodwin4b358db2009-08-10 22:17:39 +00002700// Vector Sub Operations used for single-precision FP
2701let neverHasSideEffects = 1 in
2702def VSUBfd_sfp : N3VDs<0, 0, 0b10, 0b1101, 0, "vsub.f32", v2f32, v2f32, fsub,0>;
2703def : N3VDsPat<fsub, VSUBfd_sfp>;
2704
Evan Cheng46961d82009-08-07 19:30:41 +00002705// Vector Multiply Operations used for single-precision FP
2706let neverHasSideEffects = 1 in
2707def VMULfd_sfp : N3VDs<1, 0, 0b00, 0b1101, 1, "vmul.f32", v2f32, v2f32, fmul,1>;
2708def : N3VDsPat<fmul, VMULfd_sfp>;
2709
2710// Vector Multiply-Accumulate/Subtract used for single-precision FP
2711let neverHasSideEffects = 1 in
David Goodwin36bff0c2009-09-25 18:38:29 +00002712def VMLAfd_sfp : N3VDMulOps<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla.f32", v2f32,fmul,fadd>;
David Goodwin4b358db2009-08-10 22:17:39 +00002713def : N3VDMulOpsPat<fmul, fadd, VMLAfd_sfp>;
Evan Cheng46961d82009-08-07 19:30:41 +00002714
2715let neverHasSideEffects = 1 in
David Goodwin36bff0c2009-09-25 18:38:29 +00002716def VMLSfd_sfp : N3VDMulOps<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls.f32", v2f32,fmul,fsub>;
David Goodwin4b358db2009-08-10 22:17:39 +00002717def : N3VDMulOpsPat<fmul, fsub, VMLSfd_sfp>;
Evan Cheng46961d82009-08-07 19:30:41 +00002718
David Goodwin4b358db2009-08-10 22:17:39 +00002719// Vector Absolute used for single-precision FP
Evan Cheng46961d82009-08-07 19:30:41 +00002720let neverHasSideEffects = 1 in
David Goodwin78caa122009-09-23 21:38:08 +00002721def VABSfd_sfp : N2VDInts<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
2722 IIC_VUNAD, "vabs.f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00002723 v2f32, v2f32, int_arm_neon_vabs>;
Evan Cheng46961d82009-08-07 19:30:41 +00002724def : N2VDIntsPat<fabs, VABSfd_sfp>;
2725
David Goodwin4b358db2009-08-10 22:17:39 +00002726// Vector Negate used for single-precision FP
Evan Cheng46961d82009-08-07 19:30:41 +00002727let neverHasSideEffects = 1 in
2728def VNEGf32d_sfp : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
David Goodwin78caa122009-09-23 21:38:08 +00002729 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), IIC_VUNAD,
David Goodwin4b358db2009-08-10 22:17:39 +00002730 "vneg.f32\t$dst, $src", "", []>;
Evan Cheng46961d82009-08-07 19:30:41 +00002731def : N2VDIntsPat<fneg, VNEGf32d_sfp>;
2732
David Goodwin4b358db2009-08-10 22:17:39 +00002733// Vector Convert between single-precision FP and integer
2734let neverHasSideEffects = 1 in
2735def VCVTf2sd_sfp : N2VDs<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt.s32.f32",
2736 v2i32, v2f32, fp_to_sint>;
2737def : N2VDsPat<arm_ftosi, f32, v2f32, VCVTf2sd_sfp>;
2738
2739let neverHasSideEffects = 1 in
2740def VCVTf2ud_sfp : N2VDs<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt.u32.f32",
2741 v2i32, v2f32, fp_to_uint>;
2742def : N2VDsPat<arm_ftoui, f32, v2f32, VCVTf2ud_sfp>;
2743
2744let neverHasSideEffects = 1 in
David Goodwin2dc81462009-08-11 01:07:38 +00002745def VCVTs2fd_sfp : N2VDs<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt.f32.s32",
2746 v2f32, v2i32, sint_to_fp>;
David Goodwin4b358db2009-08-10 22:17:39 +00002747def : N2VDsPat<arm_sitof, f32, v2i32, VCVTs2fd_sfp>;
2748
2749let neverHasSideEffects = 1 in
David Goodwin2dc81462009-08-11 01:07:38 +00002750def VCVTu2fd_sfp : N2VDs<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt.f32.u32",
2751 v2f32, v2i32, uint_to_fp>;
David Goodwin4b358db2009-08-10 22:17:39 +00002752def : N2VDsPat<arm_uitof, f32, v2i32, VCVTu2fd_sfp>;
2753
Evan Cheng46961d82009-08-07 19:30:41 +00002754//===----------------------------------------------------------------------===//
Bob Wilsone60fee02009-06-22 23:27:02 +00002755// Non-Instruction Patterns
2756//===----------------------------------------------------------------------===//
2757
2758// bit_convert
2759def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (v1i64 DPR:$src)>;
2760def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (v1i64 DPR:$src)>;
2761def : Pat<(v1i64 (bitconvert (v8i8 DPR:$src))), (v1i64 DPR:$src)>;
2762def : Pat<(v1i64 (bitconvert (f64 DPR:$src))), (v1i64 DPR:$src)>;
2763def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (v1i64 DPR:$src)>;
2764def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (v2i32 DPR:$src)>;
2765def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (v2i32 DPR:$src)>;
2766def : Pat<(v2i32 (bitconvert (v8i8 DPR:$src))), (v2i32 DPR:$src)>;
2767def : Pat<(v2i32 (bitconvert (f64 DPR:$src))), (v2i32 DPR:$src)>;
2768def : Pat<(v2i32 (bitconvert (v2f32 DPR:$src))), (v2i32 DPR:$src)>;
2769def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (v4i16 DPR:$src)>;
2770def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (v4i16 DPR:$src)>;
2771def : Pat<(v4i16 (bitconvert (v8i8 DPR:$src))), (v4i16 DPR:$src)>;
2772def : Pat<(v4i16 (bitconvert (f64 DPR:$src))), (v4i16 DPR:$src)>;
2773def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (v4i16 DPR:$src)>;
2774def : Pat<(v8i8 (bitconvert (v1i64 DPR:$src))), (v8i8 DPR:$src)>;
2775def : Pat<(v8i8 (bitconvert (v2i32 DPR:$src))), (v8i8 DPR:$src)>;
2776def : Pat<(v8i8 (bitconvert (v4i16 DPR:$src))), (v8i8 DPR:$src)>;
2777def : Pat<(v8i8 (bitconvert (f64 DPR:$src))), (v8i8 DPR:$src)>;
2778def : Pat<(v8i8 (bitconvert (v2f32 DPR:$src))), (v8i8 DPR:$src)>;
2779def : Pat<(f64 (bitconvert (v1i64 DPR:$src))), (f64 DPR:$src)>;
2780def : Pat<(f64 (bitconvert (v2i32 DPR:$src))), (f64 DPR:$src)>;
2781def : Pat<(f64 (bitconvert (v4i16 DPR:$src))), (f64 DPR:$src)>;
2782def : Pat<(f64 (bitconvert (v8i8 DPR:$src))), (f64 DPR:$src)>;
2783def : Pat<(f64 (bitconvert (v2f32 DPR:$src))), (f64 DPR:$src)>;
2784def : Pat<(v2f32 (bitconvert (f64 DPR:$src))), (v2f32 DPR:$src)>;
2785def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (v2f32 DPR:$src)>;
2786def : Pat<(v2f32 (bitconvert (v2i32 DPR:$src))), (v2f32 DPR:$src)>;
2787def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (v2f32 DPR:$src)>;
2788def : Pat<(v2f32 (bitconvert (v8i8 DPR:$src))), (v2f32 DPR:$src)>;
2789
2790def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (v2i64 QPR:$src)>;
2791def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (v2i64 QPR:$src)>;
2792def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (v2i64 QPR:$src)>;
2793def : Pat<(v2i64 (bitconvert (v2f64 QPR:$src))), (v2i64 QPR:$src)>;
2794def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (v2i64 QPR:$src)>;
2795def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (v4i32 QPR:$src)>;
2796def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (v4i32 QPR:$src)>;
2797def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (v4i32 QPR:$src)>;
2798def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (v4i32 QPR:$src)>;
2799def : Pat<(v4i32 (bitconvert (v4f32 QPR:$src))), (v4i32 QPR:$src)>;
2800def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (v8i16 QPR:$src)>;
2801def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (v8i16 QPR:$src)>;
2802def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (v8i16 QPR:$src)>;
2803def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (v8i16 QPR:$src)>;
2804def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (v8i16 QPR:$src)>;
2805def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (v16i8 QPR:$src)>;
2806def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (v16i8 QPR:$src)>;
2807def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (v16i8 QPR:$src)>;
2808def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (v16i8 QPR:$src)>;
2809def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (v16i8 QPR:$src)>;
2810def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (v4f32 QPR:$src)>;
2811def : Pat<(v4f32 (bitconvert (v4i32 QPR:$src))), (v4f32 QPR:$src)>;
2812def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (v4f32 QPR:$src)>;
2813def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (v4f32 QPR:$src)>;
2814def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (v4f32 QPR:$src)>;
2815def : Pat<(v2f64 (bitconvert (v2i64 QPR:$src))), (v2f64 QPR:$src)>;
2816def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (v2f64 QPR:$src)>;
2817def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (v2f64 QPR:$src)>;
2818def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (v2f64 QPR:$src)>;
2819def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (v2f64 QPR:$src)>;