blob: 405a441aa9eee7c28f978257be7de87b6d6bf278 [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 Wilson6a209cd2009-08-06 18:47:44 +0000364
365def VST4d8 : VST4D<"vst4.8">;
366def VST4d16 : VST4D<"vst4.16">;
367def VST4d32 : VST4D<"vst4.32">;
Bob Wilsonc2d65852009-09-01 18:51:56 +0000368
369// VST2LN : Vector Store (single 2-element structure from one lane)
370class VST2LND<string OpcodeStr>
371 : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src1, DPR:$src2, nohash_imm:$lane),
David Goodwin78caa122009-09-23 21:38:08 +0000372 IIC_VST,
Bob Wilsonc2d65852009-09-01 18:51:56 +0000373 !strconcat(OpcodeStr, "\t\\{$src1[$lane],$src2[$lane]\\}, $addr"),
374 "", []>;
375
376def VST2LNd8 : VST2LND<"vst2.8">;
377def VST2LNd16 : VST2LND<"vst2.16">;
378def VST2LNd32 : VST2LND<"vst2.32">;
379
380// VST3LN : Vector Store (single 3-element structure from one lane)
381class VST3LND<string OpcodeStr>
382 : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3,
David Goodwin78caa122009-09-23 21:38:08 +0000383 nohash_imm:$lane), IIC_VST,
Bob Wilsonc2d65852009-09-01 18:51:56 +0000384 !strconcat(OpcodeStr,
385 "\t\\{$src1[$lane],$src2[$lane],$src3[$lane]\\}, $addr"), "", []>;
386
387def VST3LNd8 : VST3LND<"vst3.8">;
388def VST3LNd16 : VST3LND<"vst3.16">;
389def VST3LNd32 : VST3LND<"vst3.32">;
390
391// VST4LN : Vector Store (single 4-element structure from one lane)
392class VST4LND<string OpcodeStr>
393 : NLdSt<(outs), (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3,
David Goodwin78caa122009-09-23 21:38:08 +0000394 DPR:$src4, nohash_imm:$lane), IIC_VST,
Bob Wilsonc2d65852009-09-01 18:51:56 +0000395 !strconcat(OpcodeStr,
396 "\t\\{$src1[$lane],$src2[$lane],$src3[$lane],$src4[$lane]\\}, $addr"),
397 "", []>;
398
399def VST4LNd8 : VST4LND<"vst4.8">;
400def VST4LNd16 : VST4LND<"vst4.16">;
401def VST4LNd32 : VST4LND<"vst4.32">;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +0000402} // mayStore = 1, hasExtraSrcRegAllocReq = 1
Bob Wilson6a209cd2009-08-06 18:47:44 +0000403
Bob Wilsoned592c02009-07-08 18:11:30 +0000404
Bob Wilsone60fee02009-06-22 23:27:02 +0000405//===----------------------------------------------------------------------===//
406// NEON pattern fragments
407//===----------------------------------------------------------------------===//
408
409// Extract D sub-registers of Q registers.
410// (arm_dsubreg_0 is 5; arm_dsubreg_1 is 6)
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000411def DSubReg_i8_reg : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000412 return CurDAG->getTargetConstant(5 + N->getZExtValue() / 8, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000413}]>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000414def DSubReg_i16_reg : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000415 return CurDAG->getTargetConstant(5 + N->getZExtValue() / 4, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000416}]>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000417def DSubReg_i32_reg : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000418 return CurDAG->getTargetConstant(5 + N->getZExtValue() / 2, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000419}]>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000420def DSubReg_f64_reg : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000421 return CurDAG->getTargetConstant(5 + N->getZExtValue(), MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000422}]>;
Anton Korobeynikovb261a192009-09-02 21:21:28 +0000423def DSubReg_f64_other_reg : SDNodeXForm<imm, [{
424 return CurDAG->getTargetConstant(5 + (1 - N->getZExtValue()), MVT::i32);
425}]>;
Bob Wilsone60fee02009-06-22 23:27:02 +0000426
Anton Korobeynikov44e0a6c2009-08-28 23:41:26 +0000427// Extract S sub-registers of Q/D registers.
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000428// (arm_ssubreg_0 is 1; arm_ssubreg_1 is 2; etc.)
429def SSubReg_f32_reg : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000430 return CurDAG->getTargetConstant(1 + N->getZExtValue(), MVT::i32);
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000431}]>;
432
Bob Wilsone60fee02009-06-22 23:27:02 +0000433// Translate lane numbers from Q registers to D subregs.
434def SubReg_i8_lane : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000435 return CurDAG->getTargetConstant(N->getZExtValue() & 7, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000436}]>;
437def SubReg_i16_lane : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000438 return CurDAG->getTargetConstant(N->getZExtValue() & 3, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000439}]>;
440def SubReg_i32_lane : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000441 return CurDAG->getTargetConstant(N->getZExtValue() & 1, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000442}]>;
443
444//===----------------------------------------------------------------------===//
445// Instruction Classes
446//===----------------------------------------------------------------------===//
447
448// Basic 2-register operations, both double- and quad-register.
449class N2VD<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
450 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
451 ValueType ResTy, ValueType OpTy, SDNode OpNode>
452 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +0000453 (ins DPR:$src), IIC_VUNAD, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000454 [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src))))]>;
455class N2VQ<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
456 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
457 ValueType ResTy, ValueType OpTy, SDNode OpNode>
458 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +0000459 (ins QPR:$src), IIC_VUNAQ, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000460 [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src))))]>;
461
David Goodwin4b358db2009-08-10 22:17:39 +0000462// Basic 2-register operations, scalar single-precision.
463class N2VDs<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
464 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
465 ValueType ResTy, ValueType OpTy, SDNode OpNode>
466 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
467 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src),
David Goodwin78caa122009-09-23 21:38:08 +0000468 IIC_VUNAD, !strconcat(OpcodeStr, "\t$dst, $src"), "", []>;
David Goodwin4b358db2009-08-10 22:17:39 +0000469
470class N2VDsPat<SDNode OpNode, ValueType ResTy, ValueType OpTy, NeonI Inst>
471 : NEONFPPat<(ResTy (OpNode SPR:$a)),
472 (EXTRACT_SUBREG
473 (Inst (INSERT_SUBREG (OpTy (IMPLICIT_DEF)), SPR:$a, arm_ssubreg_0)),
474 arm_ssubreg_0)>;
475
Bob Wilsone60fee02009-06-22 23:27:02 +0000476// Basic 2-register intrinsics, both double- and quad-register.
477class N2VDInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
David Goodwin78caa122009-09-23 21:38:08 +0000478 bits<2> op17_16, bits<5> op11_7, bit op4,
479 InstrItinClass itin, string OpcodeStr,
Bob Wilsone60fee02009-06-22 23:27:02 +0000480 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
481 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +0000482 (ins DPR:$src), itin, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000483 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src))))]>;
484class N2VQInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
David Goodwin78caa122009-09-23 21:38:08 +0000485 bits<2> op17_16, bits<5> op11_7, bit op4,
486 InstrItinClass itin, string OpcodeStr,
Bob Wilsone60fee02009-06-22 23:27:02 +0000487 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
488 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +0000489 (ins QPR:$src), itin, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000490 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src))))]>;
491
David Goodwin4b358db2009-08-10 22:17:39 +0000492// Basic 2-register intrinsics, scalar single-precision
Evan Cheng46961d82009-08-07 19:30:41 +0000493class N2VDInts<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
David Goodwin78caa122009-09-23 21:38:08 +0000494 bits<2> op17_16, bits<5> op11_7, bit op4,
495 InstrItinClass itin, string OpcodeStr,
Evan Cheng46961d82009-08-07 19:30:41 +0000496 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
497 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
David Goodwin78caa122009-09-23 21:38:08 +0000498 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), itin,
Evan Cheng46961d82009-08-07 19:30:41 +0000499 !strconcat(OpcodeStr, "\t$dst, $src"), "", []>;
500
501class N2VDIntsPat<SDNode OpNode, NeonI Inst>
David Goodwinbc7c05e2009-08-04 20:39:05 +0000502 : NEONFPPat<(f32 (OpNode SPR:$a)),
Evan Cheng46961d82009-08-07 19:30:41 +0000503 (EXTRACT_SUBREG
504 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$a, arm_ssubreg_0)),
505 arm_ssubreg_0)>;
David Goodwinbc7c05e2009-08-04 20:39:05 +0000506
Bob Wilsone60fee02009-06-22 23:27:02 +0000507// Narrow 2-register intrinsics.
508class N2VNInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
509 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
David Goodwin78caa122009-09-23 21:38:08 +0000510 InstrItinClass itin, string OpcodeStr,
511 ValueType TyD, ValueType TyQ, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +0000512 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +0000513 (ins QPR:$src), itin, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000514 [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src))))]>;
515
516// Long 2-register intrinsics. (This is currently only used for VMOVL and is
517// derived from N2VImm instead of N2V because of the way the size is encoded.)
518class N2VLInt<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
David Goodwin78caa122009-09-23 21:38:08 +0000519 bit op6, bit op4, InstrItinClass itin, string OpcodeStr,
520 ValueType TyQ, ValueType TyD, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +0000521 : N2VImm<op24, op23, op21_16, op11_8, op7, op6, op4, (outs QPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +0000522 (ins DPR:$src), itin, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000523 [(set QPR:$dst, (TyQ (IntOp (TyD DPR:$src))))]>;
524
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +0000525// 2-register shuffles (VTRN/VZIP/VUZP), both double- and quad-register.
526class N2VDShuffle<bits<2> op19_18, bits<5> op11_7, string OpcodeStr>
527 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 0, 0, (outs DPR:$dst1, DPR:$dst2),
David Goodwin78caa122009-09-23 21:38:08 +0000528 (ins DPR:$src1, DPR:$src2), IIC_VPERMD,
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +0000529 !strconcat(OpcodeStr, "\t$dst1, $dst2"),
530 "$src1 = $dst1, $src2 = $dst2", []>;
David Goodwin78caa122009-09-23 21:38:08 +0000531class N2VQShuffle<bits<2> op19_18, bits<5> op11_7,
532 InstrItinClass itin, string OpcodeStr>
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +0000533 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 1, 0, (outs QPR:$dst1, QPR:$dst2),
David Goodwin78caa122009-09-23 21:38:08 +0000534 (ins QPR:$src1, QPR:$src2), itin,
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +0000535 !strconcat(OpcodeStr, "\t$dst1, $dst2"),
536 "$src1 = $dst1, $src2 = $dst2", []>;
537
Bob Wilsone60fee02009-06-22 23:27:02 +0000538// Basic 3-register operations, both double- and quad-register.
539class N3VD<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin78caa122009-09-23 21:38:08 +0000540 InstrItinClass itin, string OpcodeStr, ValueType ResTy, ValueType OpTy,
Bob Wilsone60fee02009-06-22 23:27:02 +0000541 SDNode OpNode, bit Commutable>
542 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin78caa122009-09-23 21:38:08 +0000543 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000544 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
545 [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src1), (OpTy DPR:$src2))))]> {
546 let isCommutable = Commutable;
547}
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000548class N3VDSL<bits<2> op21_20, bits<4> op11_8,
David Goodwin36bff0c2009-09-25 18:38:29 +0000549 InstrItinClass itin, string OpcodeStr, ValueType Ty, SDNode ShOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000550 : N3V<0, 1, op21_20, op11_8, 1, 0,
551 (outs DPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000552 itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000553 [(set (Ty DPR:$dst),
554 (Ty (ShOp (Ty DPR:$src1),
555 (Ty (NEONvduplane (Ty DPR_VFP2:$src2),
556 imm:$lane)))))]> {
557 let isCommutable = 0;
558}
559class N3VDSL16<bits<2> op21_20, bits<4> op11_8,
560 string OpcodeStr, ValueType Ty, SDNode ShOp>
561 : N3V<0, 1, op21_20, op11_8, 1, 0,
562 (outs DPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000563 IIC_VMULi16D,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000564 !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
565 [(set (Ty DPR:$dst),
566 (Ty (ShOp (Ty DPR:$src1),
567 (Ty (NEONvduplane (Ty DPR_8:$src2),
568 imm:$lane)))))]> {
569 let isCommutable = 0;
570}
571
Bob Wilsone60fee02009-06-22 23:27:02 +0000572class N3VQ<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin78caa122009-09-23 21:38:08 +0000573 InstrItinClass itin, string OpcodeStr, ValueType ResTy, ValueType OpTy,
Bob Wilsone60fee02009-06-22 23:27:02 +0000574 SDNode OpNode, bit Commutable>
575 : N3V<op24, op23, op21_20, op11_8, 1, op4,
David Goodwin78caa122009-09-23 21:38:08 +0000576 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000577 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
578 [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src1), (OpTy QPR:$src2))))]> {
579 let isCommutable = Commutable;
580}
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000581class N3VQSL<bits<2> op21_20, bits<4> op11_8,
David Goodwin36bff0c2009-09-25 18:38:29 +0000582 InstrItinClass itin, string OpcodeStr,
583 ValueType ResTy, ValueType OpTy, SDNode ShOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000584 : N3V<1, 1, op21_20, op11_8, 1, 0,
585 (outs QPR:$dst), (ins QPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000586 itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000587 [(set (ResTy QPR:$dst),
588 (ResTy (ShOp (ResTy QPR:$src1),
589 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src2),
590 imm:$lane)))))]> {
591 let isCommutable = 0;
592}
593class N3VQSL16<bits<2> op21_20, bits<4> op11_8,
594 string OpcodeStr, ValueType ResTy, ValueType OpTy, SDNode ShOp>
595 : N3V<1, 1, op21_20, op11_8, 1, 0,
596 (outs QPR:$dst), (ins QPR:$src1, DPR_8:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000597 IIC_VMULi16Q,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000598 !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
599 [(set (ResTy QPR:$dst),
600 (ResTy (ShOp (ResTy QPR:$src1),
601 (ResTy (NEONvduplane (OpTy DPR_8:$src2),
602 imm:$lane)))))]> {
603 let isCommutable = 0;
604}
Bob Wilsone60fee02009-06-22 23:27:02 +0000605
David Goodwindd19ce42009-08-04 17:53:06 +0000606// Basic 3-register operations, scalar single-precision
Evan Cheng46961d82009-08-07 19:30:41 +0000607class N3VDs<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
608 string OpcodeStr, ValueType ResTy, ValueType OpTy,
609 SDNode OpNode, bit Commutable>
610 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000611 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src1, DPR_VFP2:$src2), IIC_VBIND,
Evan Cheng46961d82009-08-07 19:30:41 +0000612 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "", []> {
613 let isCommutable = Commutable;
614}
615class N3VDsPat<SDNode OpNode, NeonI Inst>
David Goodwindd19ce42009-08-04 17:53:06 +0000616 : NEONFPPat<(f32 (OpNode SPR:$a, SPR:$b)),
Evan Cheng46961d82009-08-07 19:30:41 +0000617 (EXTRACT_SUBREG
618 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$a, arm_ssubreg_0),
619 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$b, arm_ssubreg_0)),
620 arm_ssubreg_0)>;
David Goodwindd19ce42009-08-04 17:53:06 +0000621
Bob Wilsone60fee02009-06-22 23:27:02 +0000622// Basic 3-register intrinsics, both double- and quad-register.
623class N3VDInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000624 InstrItinClass itin, string OpcodeStr, ValueType ResTy, ValueType OpTy,
Bob Wilsone60fee02009-06-22 23:27:02 +0000625 Intrinsic IntOp, bit Commutable>
626 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000627 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000628 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
629 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src1), (OpTy DPR:$src2))))]> {
630 let isCommutable = Commutable;
631}
David Goodwin36bff0c2009-09-25 18:38:29 +0000632class N3VDIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000633 string OpcodeStr, ValueType Ty, Intrinsic IntOp>
634 : N3V<0, 1, op21_20, op11_8, 1, 0,
635 (outs DPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000636 itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000637 [(set (Ty DPR:$dst),
638 (Ty (IntOp (Ty DPR:$src1),
639 (Ty (NEONvduplane (Ty DPR_VFP2:$src2),
640 imm:$lane)))))]> {
641 let isCommutable = 0;
642}
David Goodwin36bff0c2009-09-25 18:38:29 +0000643class N3VDIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000644 string OpcodeStr, ValueType Ty, Intrinsic IntOp>
645 : N3V<0, 1, op21_20, op11_8, 1, 0,
646 (outs DPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000647 itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000648 [(set (Ty DPR:$dst),
649 (Ty (IntOp (Ty DPR:$src1),
650 (Ty (NEONvduplane (Ty DPR_8:$src2),
651 imm:$lane)))))]> {
652 let isCommutable = 0;
653}
654
Bob Wilsone60fee02009-06-22 23:27:02 +0000655class N3VQInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000656 InstrItinClass itin, string OpcodeStr, ValueType ResTy, ValueType OpTy,
Bob Wilsone60fee02009-06-22 23:27:02 +0000657 Intrinsic IntOp, bit Commutable>
658 : N3V<op24, op23, op21_20, op11_8, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000659 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000660 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
661 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src1), (OpTy QPR:$src2))))]> {
662 let isCommutable = Commutable;
663}
David Goodwin36bff0c2009-09-25 18:38:29 +0000664class N3VQIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000665 string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
666 : N3V<1, 1, op21_20, op11_8, 1, 0,
667 (outs QPR:$dst), (ins QPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000668 itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000669 [(set (ResTy QPR:$dst),
670 (ResTy (IntOp (ResTy QPR:$src1),
671 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src2),
672 imm:$lane)))))]> {
673 let isCommutable = 0;
674}
David Goodwin36bff0c2009-09-25 18:38:29 +0000675class N3VQIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000676 string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
677 : N3V<1, 1, op21_20, op11_8, 1, 0,
678 (outs QPR:$dst), (ins QPR:$src1, DPR_8:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000679 itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000680 [(set (ResTy QPR:$dst),
681 (ResTy (IntOp (ResTy QPR:$src1),
682 (ResTy (NEONvduplane (OpTy DPR_8:$src2),
683 imm:$lane)))))]> {
684 let isCommutable = 0;
685}
Bob Wilsone60fee02009-06-22 23:27:02 +0000686
687// Multiply-Add/Sub operations, both double- and quad-register.
688class N3VDMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000689 InstrItinClass itin, string OpcodeStr,
690 ValueType Ty, SDNode MulOp, SDNode OpNode>
Bob Wilsone60fee02009-06-22 23:27:02 +0000691 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000692 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000693 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst",
694 [(set DPR:$dst, (Ty (OpNode DPR:$src1,
695 (Ty (MulOp DPR:$src2, DPR:$src3)))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000696class N3VDMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000697 string OpcodeStr, ValueType Ty, SDNode MulOp, SDNode ShOp>
698 : N3V<0, 1, op21_20, op11_8, 1, 0,
699 (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000700 (ins DPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane), itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000701 !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst",
702 [(set (Ty DPR:$dst),
703 (Ty (ShOp (Ty DPR:$src1),
704 (Ty (MulOp DPR:$src2,
705 (Ty (NEONvduplane (Ty DPR_VFP2:$src3),
706 imm:$lane)))))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000707class N3VDMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000708 string OpcodeStr, ValueType Ty, SDNode MulOp, SDNode ShOp>
709 : N3V<0, 1, op21_20, op11_8, 1, 0,
710 (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000711 (ins DPR:$src1, DPR:$src2, DPR_8:$src3, nohash_imm:$lane), itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000712 !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst",
713 [(set (Ty DPR:$dst),
714 (Ty (ShOp (Ty DPR:$src1),
715 (Ty (MulOp DPR:$src2,
716 (Ty (NEONvduplane (Ty DPR_8:$src3),
717 imm:$lane)))))))]>;
718
Bob Wilsone60fee02009-06-22 23:27:02 +0000719class N3VQMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000720 InstrItinClass itin, string OpcodeStr, ValueType Ty,
721 SDNode MulOp, SDNode OpNode>
Bob Wilsone60fee02009-06-22 23:27:02 +0000722 : N3V<op24, op23, op21_20, op11_8, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000723 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000724 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst",
725 [(set QPR:$dst, (Ty (OpNode QPR:$src1,
726 (Ty (MulOp QPR:$src2, QPR:$src3)))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000727class N3VQMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000728 string OpcodeStr, ValueType ResTy, ValueType OpTy,
729 SDNode MulOp, SDNode ShOp>
730 : N3V<1, 1, op21_20, op11_8, 1, 0,
731 (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000732 (ins QPR:$src1, QPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane), itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000733 !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst",
734 [(set (ResTy QPR:$dst),
735 (ResTy (ShOp (ResTy QPR:$src1),
736 (ResTy (MulOp QPR:$src2,
737 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src3),
738 imm:$lane)))))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000739class N3VQMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000740 string OpcodeStr, ValueType ResTy, ValueType OpTy,
741 SDNode MulOp, SDNode ShOp>
742 : N3V<1, 1, op21_20, op11_8, 1, 0,
743 (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000744 (ins QPR:$src1, QPR:$src2, DPR_8:$src3, nohash_imm:$lane), itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000745 !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst",
746 [(set (ResTy QPR:$dst),
747 (ResTy (ShOp (ResTy QPR:$src1),
748 (ResTy (MulOp QPR:$src2,
749 (ResTy (NEONvduplane (OpTy DPR_8:$src3),
750 imm:$lane)))))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +0000751
David Goodwindd19ce42009-08-04 17:53:06 +0000752// Multiply-Add/Sub operations, scalar single-precision
Evan Cheng46961d82009-08-07 19:30:41 +0000753class N3VDMulOps<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000754 InstrItinClass itin, string OpcodeStr,
755 ValueType Ty, SDNode MulOp, SDNode OpNode>
Evan Cheng46961d82009-08-07 19:30:41 +0000756 : N3V<op24, op23, op21_20, op11_8, 0, op4,
757 (outs DPR_VFP2:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000758 (ins DPR_VFP2:$src1, DPR_VFP2:$src2, DPR_VFP2:$src3), itin,
Evan Cheng46961d82009-08-07 19:30:41 +0000759 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst", []>;
760
761class N3VDMulOpsPat<SDNode MulNode, SDNode OpNode, NeonI Inst>
762 : NEONFPPat<(f32 (OpNode SPR:$acc, (f32 (MulNode SPR:$a, SPR:$b)))),
763 (EXTRACT_SUBREG
764 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$acc, arm_ssubreg_0),
765 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$a, arm_ssubreg_0),
766 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$b, arm_ssubreg_0)),
767 arm_ssubreg_0)>;
David Goodwindd19ce42009-08-04 17:53:06 +0000768
Bob Wilsone60fee02009-06-22 23:27:02 +0000769// Neon 3-argument intrinsics, both double- and quad-register.
770// The destination register is also used as the first source operand register.
771class N3VDInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000772 InstrItinClass itin, string OpcodeStr,
773 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +0000774 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000775 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000776 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst",
777 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src1),
778 (OpTy DPR:$src2), (OpTy DPR:$src3))))]>;
779class N3VQInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000780 InstrItinClass itin, string OpcodeStr,
781 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +0000782 : N3V<op24, op23, op21_20, op11_8, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000783 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000784 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst",
785 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src1),
786 (OpTy QPR:$src2), (OpTy QPR:$src3))))]>;
787
788// Neon Long 3-argument intrinsic. The destination register is
789// a quad-register and is also used as the first source operand register.
790class N3VLInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000791 InstrItinClass itin, string OpcodeStr,
792 ValueType TyQ, ValueType TyD, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +0000793 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000794 (outs QPR:$dst), (ins QPR:$src1, DPR:$src2, DPR:$src3), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000795 !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst",
796 [(set QPR:$dst,
797 (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$src2), (TyD DPR:$src3))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000798class N3VLInt3SL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000799 string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
800 : N3V<op24, 1, op21_20, op11_8, 1, 0,
801 (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000802 (ins QPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane), itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000803 !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst",
804 [(set (ResTy QPR:$dst),
805 (ResTy (IntOp (ResTy QPR:$src1),
806 (OpTy DPR:$src2),
807 (OpTy (NEONvduplane (OpTy DPR_VFP2:$src3),
808 imm:$lane)))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000809class N3VLInt3SL16<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000810 string OpcodeStr, ValueType ResTy, ValueType OpTy,
811 Intrinsic IntOp>
812 : N3V<op24, 1, op21_20, op11_8, 1, 0,
813 (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000814 (ins QPR:$src1, DPR:$src2, DPR_8:$src3, nohash_imm:$lane), itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000815 !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst",
816 [(set (ResTy QPR:$dst),
817 (ResTy (IntOp (ResTy QPR:$src1),
818 (OpTy DPR:$src2),
819 (OpTy (NEONvduplane (OpTy DPR_8:$src3),
820 imm:$lane)))))]>;
821
Bob Wilsone60fee02009-06-22 23:27:02 +0000822
823// Narrowing 3-register intrinsics.
824class N3VNInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
825 string OpcodeStr, ValueType TyD, ValueType TyQ,
826 Intrinsic IntOp, bit Commutable>
827 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000828 (outs DPR:$dst), (ins QPR:$src1, QPR:$src2), IIC_VBINi4D,
Bob Wilsone60fee02009-06-22 23:27:02 +0000829 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
830 [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src1), (TyQ QPR:$src2))))]> {
831 let isCommutable = Commutable;
832}
833
834// Long 3-register intrinsics.
835class N3VLInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000836 InstrItinClass itin, string OpcodeStr, ValueType TyQ, ValueType TyD,
Bob Wilsone60fee02009-06-22 23:27:02 +0000837 Intrinsic IntOp, bit Commutable>
838 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000839 (outs QPR:$dst), (ins DPR:$src1, DPR:$src2), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000840 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
841 [(set QPR:$dst, (TyQ (IntOp (TyD DPR:$src1), (TyD DPR:$src2))))]> {
842 let isCommutable = Commutable;
843}
David Goodwin36bff0c2009-09-25 18:38:29 +0000844class N3VLIntSL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000845 string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
846 : N3V<op24, 1, op21_20, op11_8, 1, 0,
847 (outs QPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000848 itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000849 [(set (ResTy QPR:$dst),
850 (ResTy (IntOp (OpTy DPR:$src1),
851 (OpTy (NEONvduplane (OpTy DPR_VFP2:$src2),
852 imm:$lane)))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000853class N3VLIntSL16<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000854 string OpcodeStr, ValueType ResTy, ValueType OpTy,
855 Intrinsic IntOp>
856 : N3V<op24, 1, op21_20, op11_8, 1, 0,
857 (outs QPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +0000858 itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000859 [(set (ResTy QPR:$dst),
860 (ResTy (IntOp (OpTy DPR:$src1),
861 (OpTy (NEONvduplane (OpTy DPR_8:$src2),
862 imm:$lane)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +0000863
864// Wide 3-register intrinsics.
865class N3VWInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
866 string OpcodeStr, ValueType TyQ, ValueType TyD,
867 Intrinsic IntOp, bit Commutable>
868 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000869 (outs QPR:$dst), (ins QPR:$src1, DPR:$src2), IIC_VSUBiD,
Bob Wilsone60fee02009-06-22 23:27:02 +0000870 !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "",
871 [(set QPR:$dst, (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$src2))))]> {
872 let isCommutable = Commutable;
873}
874
875// Pairwise long 2-register intrinsics, both double- and quad-register.
876class N2VDPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
877 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
878 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
879 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000880 (ins DPR:$src), IIC_VSHLiD, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000881 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src))))]>;
882class N2VQPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
883 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
884 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
885 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000886 (ins QPR:$src), IIC_VSHLiD, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000887 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src))))]>;
888
889// Pairwise long 2-register accumulate intrinsics,
890// both double- and quad-register.
891// The destination register is also used as the first source operand register.
892class N2VDPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
893 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
894 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
895 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000896 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), IIC_VPALiD,
Bob Wilsone60fee02009-06-22 23:27:02 +0000897 !strconcat(OpcodeStr, "\t$dst, $src2"), "$src1 = $dst",
898 [(set DPR:$dst, (ResTy (IntOp (ResTy DPR:$src1), (OpTy DPR:$src2))))]>;
899class N2VQPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
900 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
901 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
902 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000903 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), IIC_VPALiQ,
Bob Wilsone60fee02009-06-22 23:27:02 +0000904 !strconcat(OpcodeStr, "\t$dst, $src2"), "$src1 = $dst",
905 [(set QPR:$dst, (ResTy (IntOp (ResTy QPR:$src1), (OpTy QPR:$src2))))]>;
906
907// Shift by immediate,
908// both double- and quad-register.
909class N2VDSh<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
David Goodwin36bff0c2009-09-25 18:38:29 +0000910 bit op4, InstrItinClass itin, string OpcodeStr,
911 ValueType Ty, SDNode OpNode>
Bob Wilsone60fee02009-06-22 23:27:02 +0000912 : N2VImm<op24, op23, op21_16, op11_8, op7, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000913 (outs DPR:$dst), (ins DPR:$src, i32imm:$SIMM), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000914 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
915 [(set DPR:$dst, (Ty (OpNode (Ty DPR:$src), (i32 imm:$SIMM))))]>;
916class N2VQSh<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
David Goodwin36bff0c2009-09-25 18:38:29 +0000917 bit op4, InstrItinClass itin, string OpcodeStr,
918 ValueType Ty, SDNode OpNode>
Bob Wilsone60fee02009-06-22 23:27:02 +0000919 : N2VImm<op24, op23, op21_16, op11_8, op7, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000920 (outs QPR:$dst), (ins QPR:$src, i32imm:$SIMM), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000921 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
922 [(set QPR:$dst, (Ty (OpNode (Ty QPR:$src), (i32 imm:$SIMM))))]>;
923
924// Long shift by immediate.
925class N2VLSh<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
926 bit op6, bit op4, string OpcodeStr, ValueType ResTy,
927 ValueType OpTy, SDNode OpNode>
928 : N2VImm<op24, op23, op21_16, op11_8, op7, op6, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000929 (outs QPR:$dst), (ins DPR:$src, i32imm:$SIMM), IIC_VSHLiD,
Bob Wilsone60fee02009-06-22 23:27:02 +0000930 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
931 [(set QPR:$dst, (ResTy (OpNode (OpTy DPR:$src),
932 (i32 imm:$SIMM))))]>;
933
934// Narrow shift by immediate.
935class N2VNSh<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
David Goodwin36bff0c2009-09-25 18:38:29 +0000936 bit op6, bit op4, InstrItinClass itin, string OpcodeStr,
937 ValueType ResTy, ValueType OpTy, SDNode OpNode>
Bob Wilsone60fee02009-06-22 23:27:02 +0000938 : N2VImm<op24, op23, op21_16, op11_8, op7, op6, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000939 (outs DPR:$dst), (ins QPR:$src, i32imm:$SIMM), itin,
Bob Wilsone60fee02009-06-22 23:27:02 +0000940 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
941 [(set DPR:$dst, (ResTy (OpNode (OpTy QPR:$src),
942 (i32 imm:$SIMM))))]>;
943
944// Shift right by immediate and accumulate,
945// both double- and quad-register.
946class N2VDShAdd<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
947 bit op4, string OpcodeStr, ValueType Ty, SDNode ShOp>
948 : N2VImm<op24, op23, op21_16, op11_8, op7, 0, op4,
949 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, i32imm:$SIMM),
David Goodwin36bff0c2009-09-25 18:38:29 +0000950 IIC_VPALiD,
Bob Wilsone60fee02009-06-22 23:27:02 +0000951 !strconcat(OpcodeStr, "\t$dst, $src2, $SIMM"), "$src1 = $dst",
952 [(set DPR:$dst, (Ty (add DPR:$src1,
953 (Ty (ShOp DPR:$src2, (i32 imm:$SIMM))))))]>;
954class N2VQShAdd<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
955 bit op4, string OpcodeStr, ValueType Ty, SDNode ShOp>
956 : N2VImm<op24, op23, op21_16, op11_8, op7, 1, op4,
957 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, i32imm:$SIMM),
David Goodwin36bff0c2009-09-25 18:38:29 +0000958 IIC_VPALiD,
Bob Wilsone60fee02009-06-22 23:27:02 +0000959 !strconcat(OpcodeStr, "\t$dst, $src2, $SIMM"), "$src1 = $dst",
960 [(set QPR:$dst, (Ty (add QPR:$src1,
961 (Ty (ShOp QPR:$src2, (i32 imm:$SIMM))))))]>;
962
963// Shift by immediate and insert,
964// both double- and quad-register.
965class N2VDShIns<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
966 bit op4, string OpcodeStr, ValueType Ty, SDNode ShOp>
967 : N2VImm<op24, op23, op21_16, op11_8, op7, 0, op4,
968 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, i32imm:$SIMM),
David Goodwin36bff0c2009-09-25 18:38:29 +0000969 IIC_VSHLiD,
Bob Wilsone60fee02009-06-22 23:27:02 +0000970 !strconcat(OpcodeStr, "\t$dst, $src2, $SIMM"), "$src1 = $dst",
971 [(set DPR:$dst, (Ty (ShOp DPR:$src1, DPR:$src2, (i32 imm:$SIMM))))]>;
972class N2VQShIns<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
973 bit op4, string OpcodeStr, ValueType Ty, SDNode ShOp>
974 : N2VImm<op24, op23, op21_16, op11_8, op7, 1, op4,
975 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, i32imm:$SIMM),
David Goodwin36bff0c2009-09-25 18:38:29 +0000976 IIC_VSHLiQ,
Bob Wilsone60fee02009-06-22 23:27:02 +0000977 !strconcat(OpcodeStr, "\t$dst, $src2, $SIMM"), "$src1 = $dst",
978 [(set QPR:$dst, (Ty (ShOp QPR:$src1, QPR:$src2, (i32 imm:$SIMM))))]>;
979
980// Convert, with fractional bits immediate,
981// both double- and quad-register.
982class N2VCvtD<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
983 bit op4, string OpcodeStr, ValueType ResTy, ValueType OpTy,
984 Intrinsic IntOp>
985 : N2VImm<op24, op23, op21_16, op11_8, op7, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000986 (outs DPR:$dst), (ins DPR:$src, i32imm:$SIMM), IIC_VUNAD,
Bob Wilsone60fee02009-06-22 23:27:02 +0000987 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
988 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src), (i32 imm:$SIMM))))]>;
989class N2VCvtQ<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
990 bit op4, string OpcodeStr, ValueType ResTy, ValueType OpTy,
991 Intrinsic IntOp>
992 : N2VImm<op24, op23, op21_16, op11_8, op7, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000993 (outs QPR:$dst), (ins QPR:$src, i32imm:$SIMM), IIC_VUNAQ,
Bob Wilsone60fee02009-06-22 23:27:02 +0000994 !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "",
995 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src), (i32 imm:$SIMM))))]>;
996
997//===----------------------------------------------------------------------===//
998// Multiclasses
999//===----------------------------------------------------------------------===//
1000
Bob Wilson8af7b532009-10-03 04:44:16 +00001001// Abbreviations used in multiclass suffixes:
1002// Q = quarter int (8 bit) elements
1003// H = half int (16 bit) elements
1004// S = single int (32 bit) elements
1005// D = double int (64 bit) elements
1006
Bob Wilsone60fee02009-06-22 23:27:02 +00001007// Neon 3-register vector operations.
1008
1009// First with only element sizes of 8, 16 and 32 bits:
1010multiclass N3V_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin78caa122009-09-23 21:38:08 +00001011 InstrItinClass itinD16, InstrItinClass itinD32,
1012 InstrItinClass itinQ16, InstrItinClass itinQ32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001013 string OpcodeStr, SDNode OpNode, bit Commutable = 0> {
1014 // 64-bit vector types.
David Goodwin78caa122009-09-23 21:38:08 +00001015 def v8i8 : N3VD<op24, op23, 0b00, op11_8, op4, itinD16,
1016 !strconcat(OpcodeStr, "8"), v8i8, v8i8, OpNode, Commutable>;
1017 def v4i16 : N3VD<op24, op23, 0b01, op11_8, op4, itinD16,
1018 !strconcat(OpcodeStr, "16"), v4i16, v4i16, OpNode, Commutable>;
1019 def v2i32 : N3VD<op24, op23, 0b10, op11_8, op4, itinD32,
1020 !strconcat(OpcodeStr, "32"), v2i32, v2i32, OpNode, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001021
1022 // 128-bit vector types.
David Goodwin78caa122009-09-23 21:38:08 +00001023 def v16i8 : N3VQ<op24, op23, 0b00, op11_8, op4, itinQ16,
1024 !strconcat(OpcodeStr, "8"), v16i8, v16i8, OpNode, Commutable>;
1025 def v8i16 : N3VQ<op24, op23, 0b01, op11_8, op4, itinQ16,
1026 !strconcat(OpcodeStr, "16"), v8i16, v8i16, OpNode, Commutable>;
1027 def v4i32 : N3VQ<op24, op23, 0b10, op11_8, op4, itinQ32,
1028 !strconcat(OpcodeStr, "32"), v4i32, v4i32, OpNode, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001029}
1030
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001031multiclass N3VSL_HS<bits<4> op11_8, string OpcodeStr, SDNode ShOp> {
1032 def v4i16 : N3VDSL16<0b01, op11_8, !strconcat(OpcodeStr, "16"), v4i16, ShOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001033 def v2i32 : N3VDSL<0b10, op11_8, IIC_VMULi32D, !strconcat(OpcodeStr, "32"), v2i32, ShOp>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001034 def v8i16 : N3VQSL16<0b01, op11_8, !strconcat(OpcodeStr, "16"), v8i16, v4i16, ShOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001035 def v4i32 : N3VQSL<0b10, op11_8, IIC_VMULi32Q, !strconcat(OpcodeStr, "32"), v4i32, v2i32, ShOp>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001036}
1037
Bob Wilsone60fee02009-06-22 23:27:02 +00001038// ....then also with element size 64 bits:
1039multiclass N3V_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin78caa122009-09-23 21:38:08 +00001040 InstrItinClass itinD, InstrItinClass itinQ,
Bob Wilsone60fee02009-06-22 23:27:02 +00001041 string OpcodeStr, SDNode OpNode, bit Commutable = 0>
David Goodwin78caa122009-09-23 21:38:08 +00001042 : N3V_QHS<op24, op23, op11_8, op4, itinD, itinD, itinQ, itinQ,
1043 OpcodeStr, OpNode, Commutable> {
1044 def v1i64 : N3VD<op24, op23, 0b11, op11_8, op4, itinD,
1045 !strconcat(OpcodeStr, "64"), v1i64, v1i64, OpNode, Commutable>;
1046 def v2i64 : N3VQ<op24, op23, 0b11, op11_8, op4, itinQ,
1047 !strconcat(OpcodeStr, "64"), v2i64, v2i64, OpNode, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001048}
1049
1050
1051// Neon Narrowing 2-register vector intrinsics,
1052// source operand element sizes of 16, 32 and 64 bits:
1053multiclass N2VNInt_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
David Goodwin78caa122009-09-23 21:38:08 +00001054 bits<5> op11_7, bit op6, bit op4,
1055 InstrItinClass itin, string OpcodeStr,
Bob Wilsone60fee02009-06-22 23:27:02 +00001056 Intrinsic IntOp> {
1057 def v8i8 : N2VNInt<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001058 itin, !strconcat(OpcodeStr, "16"), v8i8, v8i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001059 def v4i16 : N2VNInt<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001060 itin, !strconcat(OpcodeStr, "32"), v4i16, v4i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001061 def v2i32 : N2VNInt<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001062 itin, !strconcat(OpcodeStr, "64"), v2i32, v2i64, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001063}
1064
1065
1066// Neon Lengthening 2-register vector intrinsic (currently specific to VMOVL).
1067// source operand element sizes of 16, 32 and 64 bits:
1068multiclass N2VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
1069 bit op4, string OpcodeStr, Intrinsic IntOp> {
1070 def v8i16 : N2VLInt<op24, op23, 0b001000, op11_8, op7, op6, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001071 IIC_VQUNAiD, !strconcat(OpcodeStr, "8"), v8i16, v8i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001072 def v4i32 : N2VLInt<op24, op23, 0b010000, op11_8, op7, op6, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001073 IIC_VQUNAiD, !strconcat(OpcodeStr, "16"), v4i32, v4i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001074 def v2i64 : N2VLInt<op24, op23, 0b100000, op11_8, op7, op6, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001075 IIC_VQUNAiD, !strconcat(OpcodeStr, "32"), v2i64, v2i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001076}
1077
1078
1079// Neon 3-register vector intrinsics.
1080
1081// First with only element sizes of 16 and 32 bits:
1082multiclass N3VInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001083 InstrItinClass itinD16, InstrItinClass itinD32,
1084 InstrItinClass itinQ16, InstrItinClass itinQ32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001085 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> {
1086 // 64-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001087 def v4i16 : N3VDInt<op24, op23, 0b01, op11_8, op4, itinD16, !strconcat(OpcodeStr,"16"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001088 v4i16, v4i16, IntOp, Commutable>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001089 def v2i32 : N3VDInt<op24, op23, 0b10, op11_8, op4, itinD32, !strconcat(OpcodeStr,"32"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001090 v2i32, v2i32, IntOp, Commutable>;
1091
1092 // 128-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001093 def v8i16 : N3VQInt<op24, op23, 0b01, op11_8, op4, itinQ16, !strconcat(OpcodeStr,"16"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001094 v8i16, v8i16, IntOp, Commutable>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001095 def v4i32 : N3VQInt<op24, op23, 0b10, op11_8, op4, itinQ32, !strconcat(OpcodeStr,"32"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001096 v4i32, v4i32, IntOp, Commutable>;
1097}
1098
David Goodwin36bff0c2009-09-25 18:38:29 +00001099multiclass N3VIntSL_HS<bits<4> op11_8,
1100 InstrItinClass itinD16, InstrItinClass itinD32,
1101 InstrItinClass itinQ16, InstrItinClass itinQ32,
1102 string OpcodeStr, Intrinsic IntOp> {
1103 def v4i16 : N3VDIntSL16<0b01, op11_8, itinD16, !strconcat(OpcodeStr, "16"), v4i16, IntOp>;
1104 def v2i32 : N3VDIntSL<0b10, op11_8, itinD32, !strconcat(OpcodeStr, "32"), v2i32, IntOp>;
1105 def v8i16 : N3VQIntSL16<0b01, op11_8, itinQ16, !strconcat(OpcodeStr, "16"), v8i16, v4i16, IntOp>;
1106 def v4i32 : N3VQIntSL<0b10, op11_8, itinQ32, !strconcat(OpcodeStr, "32"), v4i32, v2i32, IntOp>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001107}
1108
Bob Wilsone60fee02009-06-22 23:27:02 +00001109// ....then also with element size of 8 bits:
1110multiclass N3VInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001111 InstrItinClass itinD16, InstrItinClass itinD32,
1112 InstrItinClass itinQ16, InstrItinClass itinQ32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001113 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0>
David Goodwin36bff0c2009-09-25 18:38:29 +00001114 : N3VInt_HS<op24, op23, op11_8, op4, itinD16, itinD32, itinQ16, itinQ32,
1115 OpcodeStr, IntOp, Commutable> {
1116 def v8i8 : N3VDInt<op24, op23, 0b00, op11_8, op4, itinD16,
1117 !strconcat(OpcodeStr, "8"), v8i8, v8i8, IntOp, Commutable>;
1118 def v16i8 : N3VQInt<op24, op23, 0b00, op11_8, op4, itinQ16,
1119 !strconcat(OpcodeStr, "8"), v16i8, v16i8, IntOp, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001120}
1121
1122// ....then also with element size of 64 bits:
1123multiclass N3VInt_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001124 InstrItinClass itinD16, InstrItinClass itinD32,
1125 InstrItinClass itinQ16, InstrItinClass itinQ32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001126 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0>
David Goodwin36bff0c2009-09-25 18:38:29 +00001127 : N3VInt_QHS<op24, op23, op11_8, op4, itinD16, itinD32, itinQ16, itinQ32,
1128 OpcodeStr, IntOp, Commutable> {
1129 def v1i64 : N3VDInt<op24, op23, 0b11, op11_8, op4, itinD32,
1130 !strconcat(OpcodeStr,"64"), v1i64, v1i64, IntOp, Commutable>;
1131 def v2i64 : N3VQInt<op24, op23, 0b11, op11_8, op4, itinQ32,
1132 !strconcat(OpcodeStr,"64"), v2i64, v2i64, IntOp, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001133}
1134
1135
1136// Neon Narrowing 3-register vector intrinsics,
1137// source operand element sizes of 16, 32 and 64 bits:
1138multiclass N3VNInt_HSD<bit op24, bit op23, bits<4> op11_8, bit op4,
1139 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> {
1140 def v8i8 : N3VNInt<op24, op23, 0b00, op11_8, op4, !strconcat(OpcodeStr,"16"),
1141 v8i8, v8i16, IntOp, Commutable>;
1142 def v4i16 : N3VNInt<op24, op23, 0b01, op11_8, op4, !strconcat(OpcodeStr,"32"),
1143 v4i16, v4i32, IntOp, Commutable>;
1144 def v2i32 : N3VNInt<op24, op23, 0b10, op11_8, op4, !strconcat(OpcodeStr,"64"),
1145 v2i32, v2i64, IntOp, Commutable>;
1146}
1147
1148
1149// Neon Long 3-register vector intrinsics.
1150
1151// First with only element sizes of 16 and 32 bits:
1152multiclass N3VLInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001153 InstrItinClass itin, string OpcodeStr,
1154 Intrinsic IntOp, bit Commutable = 0> {
1155 def v4i32 : N3VLInt<op24, op23, 0b01, op11_8, op4, itin,
1156 !strconcat(OpcodeStr,"16"), v4i32, v4i16, IntOp, Commutable>;
1157 def v2i64 : N3VLInt<op24, op23, 0b10, op11_8, op4, itin,
1158 !strconcat(OpcodeStr,"32"), v2i64, v2i32, IntOp, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001159}
1160
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001161multiclass N3VLIntSL_HS<bit op24, bits<4> op11_8,
David Goodwin36bff0c2009-09-25 18:38:29 +00001162 InstrItinClass itin, string OpcodeStr, Intrinsic IntOp> {
1163 def v4i16 : N3VLIntSL16<op24, 0b01, op11_8, itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001164 !strconcat(OpcodeStr, "16"), v4i32, v4i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001165 def v2i32 : N3VLIntSL<op24, 0b10, op11_8, itin,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001166 !strconcat(OpcodeStr, "32"), v2i64, v2i32, IntOp>;
1167}
1168
Bob Wilsone60fee02009-06-22 23:27:02 +00001169// ....then also with element size of 8 bits:
1170multiclass N3VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001171 InstrItinClass itin, string OpcodeStr,
1172 Intrinsic IntOp, bit Commutable = 0>
1173 : N3VLInt_HS<op24, op23, op11_8, op4, itin, OpcodeStr, IntOp, Commutable> {
1174 def v8i16 : N3VLInt<op24, op23, 0b00, op11_8, op4, itin,
1175 !strconcat(OpcodeStr, "8"), v8i16, v8i8, IntOp, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001176}
1177
1178
1179// Neon Wide 3-register vector intrinsics,
1180// source operand element sizes of 8, 16 and 32 bits:
1181multiclass N3VWInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
1182 string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> {
1183 def v8i16 : N3VWInt<op24, op23, 0b00, op11_8, op4, !strconcat(OpcodeStr, "8"),
1184 v8i16, v8i8, IntOp, Commutable>;
1185 def v4i32 : N3VWInt<op24, op23, 0b01, op11_8, op4, !strconcat(OpcodeStr,"16"),
1186 v4i32, v4i16, IntOp, Commutable>;
1187 def v2i64 : N3VWInt<op24, op23, 0b10, op11_8, op4, !strconcat(OpcodeStr,"32"),
1188 v2i64, v2i32, IntOp, Commutable>;
1189}
1190
1191
1192// Neon Multiply-Op vector operations,
1193// element sizes of 8, 16 and 32 bits:
1194multiclass N3VMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001195 InstrItinClass itinD16, InstrItinClass itinD32,
1196 InstrItinClass itinQ16, InstrItinClass itinQ32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001197 string OpcodeStr, SDNode OpNode> {
1198 // 64-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001199 def v8i8 : N3VDMulOp<op24, op23, 0b00, op11_8, op4, itinD16,
Bob Wilsone60fee02009-06-22 23:27:02 +00001200 !strconcat(OpcodeStr, "8"), v8i8, mul, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001201 def v4i16 : N3VDMulOp<op24, op23, 0b01, op11_8, op4, itinD16,
Bob Wilsone60fee02009-06-22 23:27:02 +00001202 !strconcat(OpcodeStr, "16"), v4i16, mul, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001203 def v2i32 : N3VDMulOp<op24, op23, 0b10, op11_8, op4, itinD32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001204 !strconcat(OpcodeStr, "32"), v2i32, mul, OpNode>;
1205
1206 // 128-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001207 def v16i8 : N3VQMulOp<op24, op23, 0b00, op11_8, op4, itinQ16,
Bob Wilsone60fee02009-06-22 23:27:02 +00001208 !strconcat(OpcodeStr, "8"), v16i8, mul, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001209 def v8i16 : N3VQMulOp<op24, op23, 0b01, op11_8, op4, itinQ16,
Bob Wilsone60fee02009-06-22 23:27:02 +00001210 !strconcat(OpcodeStr, "16"), v8i16, mul, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001211 def v4i32 : N3VQMulOp<op24, op23, 0b10, op11_8, op4, itinQ32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001212 !strconcat(OpcodeStr, "32"), v4i32, mul, OpNode>;
1213}
1214
David Goodwin36bff0c2009-09-25 18:38:29 +00001215multiclass N3VMulOpSL_HS<bits<4> op11_8,
1216 InstrItinClass itinD16, InstrItinClass itinD32,
1217 InstrItinClass itinQ16, InstrItinClass itinQ32,
1218 string OpcodeStr, SDNode ShOp> {
1219 def v4i16 : N3VDMulOpSL16<0b01, op11_8, itinD16,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001220 !strconcat(OpcodeStr, "16"), v4i16, mul, ShOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001221 def v2i32 : N3VDMulOpSL<0b10, op11_8, itinD32,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001222 !strconcat(OpcodeStr, "32"), v2i32, mul, ShOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001223 def v8i16 : N3VQMulOpSL16<0b01, op11_8, itinQ16,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001224 !strconcat(OpcodeStr, "16"), v8i16, v4i16, mul, ShOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001225 def v4i32 : N3VQMulOpSL<0b10, op11_8, itinQ32,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001226 !strconcat(OpcodeStr, "32"), v4i32, v2i32, mul, ShOp>;
1227}
Bob Wilsone60fee02009-06-22 23:27:02 +00001228
1229// Neon 3-argument intrinsics,
1230// element sizes of 8, 16 and 32 bits:
1231multiclass N3VInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
1232 string OpcodeStr, Intrinsic IntOp> {
1233 // 64-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001234 def v8i8 : N3VDInt3<op24, op23, 0b00, op11_8, op4, IIC_VMACi16D,
Bob Wilsone60fee02009-06-22 23:27:02 +00001235 !strconcat(OpcodeStr, "8"), v8i8, v8i8, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001236 def v4i16 : N3VDInt3<op24, op23, 0b01, op11_8, op4, IIC_VMACi16D,
Bob Wilsone60fee02009-06-22 23:27:02 +00001237 !strconcat(OpcodeStr, "16"), v4i16, v4i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001238 def v2i32 : N3VDInt3<op24, op23, 0b10, op11_8, op4, IIC_VMACi32D,
Bob Wilsone60fee02009-06-22 23:27:02 +00001239 !strconcat(OpcodeStr, "32"), v2i32, v2i32, IntOp>;
1240
1241 // 128-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001242 def v16i8 : N3VQInt3<op24, op23, 0b00, op11_8, op4, IIC_VMACi16Q,
Bob Wilsone60fee02009-06-22 23:27:02 +00001243 !strconcat(OpcodeStr, "8"), v16i8, v16i8, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001244 def v8i16 : N3VQInt3<op24, op23, 0b01, op11_8, op4, IIC_VMACi16Q,
Bob Wilsone60fee02009-06-22 23:27:02 +00001245 !strconcat(OpcodeStr, "16"), v8i16, v8i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001246 def v4i32 : N3VQInt3<op24, op23, 0b10, op11_8, op4, IIC_VMACi32Q,
Bob Wilsone60fee02009-06-22 23:27:02 +00001247 !strconcat(OpcodeStr, "32"), v4i32, v4i32, IntOp>;
1248}
1249
1250
1251// Neon Long 3-argument intrinsics.
1252
1253// First with only element sizes of 16 and 32 bits:
1254multiclass N3VLInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
1255 string OpcodeStr, Intrinsic IntOp> {
David Goodwin36bff0c2009-09-25 18:38:29 +00001256 def v4i32 : N3VLInt3<op24, op23, 0b01, op11_8, op4, IIC_VMACi16D,
Bob Wilsone60fee02009-06-22 23:27:02 +00001257 !strconcat(OpcodeStr, "16"), v4i32, v4i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001258 def v2i64 : N3VLInt3<op24, op23, 0b10, op11_8, op4, IIC_VMACi16D,
Bob Wilsone60fee02009-06-22 23:27:02 +00001259 !strconcat(OpcodeStr, "32"), v2i64, v2i32, IntOp>;
1260}
1261
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001262multiclass N3VLInt3SL_HS<bit op24, bits<4> op11_8,
1263 string OpcodeStr, Intrinsic IntOp> {
David Goodwin36bff0c2009-09-25 18:38:29 +00001264 def v4i16 : N3VLInt3SL16<op24, 0b01, op11_8, IIC_VMACi16D,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001265 !strconcat(OpcodeStr, "16"), v4i32, v4i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001266 def v2i32 : N3VLInt3SL<op24, 0b10, op11_8, IIC_VMACi32D,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001267 !strconcat(OpcodeStr, "32"), v2i64, v2i32, IntOp>;
1268}
1269
Bob Wilsone60fee02009-06-22 23:27:02 +00001270// ....then also with element size of 8 bits:
1271multiclass N3VLInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
1272 string OpcodeStr, Intrinsic IntOp>
1273 : N3VLInt3_HS<op24, op23, op11_8, op4, OpcodeStr, IntOp> {
David Goodwin36bff0c2009-09-25 18:38:29 +00001274 def v8i16 : N3VLInt3<op24, op23, 0b01, op11_8, op4, IIC_VMACi16D,
Bob Wilsone60fee02009-06-22 23:27:02 +00001275 !strconcat(OpcodeStr, "8"), v8i16, v8i8, IntOp>;
1276}
1277
1278
1279// Neon 2-register vector intrinsics,
1280// element sizes of 8, 16 and 32 bits:
1281multiclass N2VInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
David Goodwin78caa122009-09-23 21:38:08 +00001282 bits<5> op11_7, bit op4,
1283 InstrItinClass itinD, InstrItinClass itinQ,
1284 string OpcodeStr, Intrinsic IntOp> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001285 // 64-bit vector types.
1286 def v8i8 : N2VDInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001287 itinD, !strconcat(OpcodeStr, "8"), v8i8, v8i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001288 def v4i16 : N2VDInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001289 itinD, !strconcat(OpcodeStr, "16"), v4i16, v4i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001290 def v2i32 : N2VDInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001291 itinD, !strconcat(OpcodeStr, "32"), v2i32, v2i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001292
1293 // 128-bit vector types.
1294 def v16i8 : N2VQInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001295 itinQ, !strconcat(OpcodeStr, "8"), v16i8, v16i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001296 def v8i16 : N2VQInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001297 itinQ, !strconcat(OpcodeStr, "16"), v8i16, v8i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001298 def v4i32 : N2VQInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
David Goodwin78caa122009-09-23 21:38:08 +00001299 itinQ, !strconcat(OpcodeStr, "32"), v4i32, v4i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001300}
1301
1302
1303// Neon Pairwise long 2-register intrinsics,
1304// element sizes of 8, 16 and 32 bits:
1305multiclass N2VPLInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
1306 bits<5> op11_7, bit op4,
1307 string OpcodeStr, Intrinsic IntOp> {
1308 // 64-bit vector types.
1309 def v8i8 : N2VDPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
1310 !strconcat(OpcodeStr, "8"), v4i16, v8i8, IntOp>;
1311 def v4i16 : N2VDPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
1312 !strconcat(OpcodeStr, "16"), v2i32, v4i16, IntOp>;
1313 def v2i32 : N2VDPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
1314 !strconcat(OpcodeStr, "32"), v1i64, v2i32, IntOp>;
1315
1316 // 128-bit vector types.
1317 def v16i8 : N2VQPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
1318 !strconcat(OpcodeStr, "8"), v8i16, v16i8, IntOp>;
1319 def v8i16 : N2VQPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
1320 !strconcat(OpcodeStr, "16"), v4i32, v8i16, IntOp>;
1321 def v4i32 : N2VQPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
1322 !strconcat(OpcodeStr, "32"), v2i64, v4i32, IntOp>;
1323}
1324
1325
1326// Neon Pairwise long 2-register accumulate intrinsics,
1327// element sizes of 8, 16 and 32 bits:
1328multiclass N2VPLInt2_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
1329 bits<5> op11_7, bit op4,
1330 string OpcodeStr, Intrinsic IntOp> {
1331 // 64-bit vector types.
1332 def v8i8 : N2VDPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
1333 !strconcat(OpcodeStr, "8"), v4i16, v8i8, IntOp>;
1334 def v4i16 : N2VDPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
1335 !strconcat(OpcodeStr, "16"), v2i32, v4i16, IntOp>;
1336 def v2i32 : N2VDPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
1337 !strconcat(OpcodeStr, "32"), v1i64, v2i32, IntOp>;
1338
1339 // 128-bit vector types.
1340 def v16i8 : N2VQPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
1341 !strconcat(OpcodeStr, "8"), v8i16, v16i8, IntOp>;
1342 def v8i16 : N2VQPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
1343 !strconcat(OpcodeStr, "16"), v4i32, v8i16, IntOp>;
1344 def v4i32 : N2VQPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
1345 !strconcat(OpcodeStr, "32"), v2i64, v4i32, IntOp>;
1346}
1347
1348
1349// Neon 2-register vector shift by immediate,
1350// element sizes of 8, 16, 32 and 64 bits:
1351multiclass N2VSh_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001352 InstrItinClass itin, string OpcodeStr, SDNode OpNode> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001353 // 64-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001354 def v8i8 : N2VDSh<op24, op23, 0b001000, op11_8, 0, op4, itin,
Bob Wilsone60fee02009-06-22 23:27:02 +00001355 !strconcat(OpcodeStr, "8"), v8i8, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001356 def v4i16 : N2VDSh<op24, op23, 0b010000, op11_8, 0, op4, itin,
Bob Wilsone60fee02009-06-22 23:27:02 +00001357 !strconcat(OpcodeStr, "16"), v4i16, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001358 def v2i32 : N2VDSh<op24, op23, 0b100000, op11_8, 0, op4, itin,
Bob Wilsone60fee02009-06-22 23:27:02 +00001359 !strconcat(OpcodeStr, "32"), v2i32, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001360 def v1i64 : N2VDSh<op24, op23, 0b000000, op11_8, 1, op4, itin,
Bob Wilsone60fee02009-06-22 23:27:02 +00001361 !strconcat(OpcodeStr, "64"), v1i64, OpNode>;
1362
1363 // 128-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001364 def v16i8 : N2VQSh<op24, op23, 0b001000, op11_8, 0, op4, itin,
Bob Wilsone60fee02009-06-22 23:27:02 +00001365 !strconcat(OpcodeStr, "8"), v16i8, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001366 def v8i16 : N2VQSh<op24, op23, 0b010000, op11_8, 0, op4, itin,
Bob Wilsone60fee02009-06-22 23:27:02 +00001367 !strconcat(OpcodeStr, "16"), v8i16, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001368 def v4i32 : N2VQSh<op24, op23, 0b100000, op11_8, 0, op4, itin,
Bob Wilsone60fee02009-06-22 23:27:02 +00001369 !strconcat(OpcodeStr, "32"), v4i32, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001370 def v2i64 : N2VQSh<op24, op23, 0b000000, op11_8, 1, op4, itin,
Bob Wilsone60fee02009-06-22 23:27:02 +00001371 !strconcat(OpcodeStr, "64"), v2i64, OpNode>;
1372}
1373
1374
1375// Neon Shift-Accumulate vector operations,
1376// element sizes of 8, 16, 32 and 64 bits:
1377multiclass N2VShAdd_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
1378 string OpcodeStr, SDNode ShOp> {
1379 // 64-bit vector types.
1380 def v8i8 : N2VDShAdd<op24, op23, 0b001000, op11_8, 0, op4,
1381 !strconcat(OpcodeStr, "8"), v8i8, ShOp>;
1382 def v4i16 : N2VDShAdd<op24, op23, 0b010000, op11_8, 0, op4,
1383 !strconcat(OpcodeStr, "16"), v4i16, ShOp>;
1384 def v2i32 : N2VDShAdd<op24, op23, 0b100000, op11_8, 0, op4,
1385 !strconcat(OpcodeStr, "32"), v2i32, ShOp>;
1386 def v1i64 : N2VDShAdd<op24, op23, 0b000000, op11_8, 1, op4,
1387 !strconcat(OpcodeStr, "64"), v1i64, ShOp>;
1388
1389 // 128-bit vector types.
1390 def v16i8 : N2VQShAdd<op24, op23, 0b001000, op11_8, 0, op4,
1391 !strconcat(OpcodeStr, "8"), v16i8, ShOp>;
1392 def v8i16 : N2VQShAdd<op24, op23, 0b010000, op11_8, 0, op4,
1393 !strconcat(OpcodeStr, "16"), v8i16, ShOp>;
1394 def v4i32 : N2VQShAdd<op24, op23, 0b100000, op11_8, 0, op4,
1395 !strconcat(OpcodeStr, "32"), v4i32, ShOp>;
1396 def v2i64 : N2VQShAdd<op24, op23, 0b000000, op11_8, 1, op4,
1397 !strconcat(OpcodeStr, "64"), v2i64, ShOp>;
1398}
1399
1400
1401// Neon Shift-Insert vector operations,
1402// element sizes of 8, 16, 32 and 64 bits:
1403multiclass N2VShIns_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
1404 string OpcodeStr, SDNode ShOp> {
1405 // 64-bit vector types.
1406 def v8i8 : N2VDShIns<op24, op23, 0b001000, op11_8, 0, op4,
1407 !strconcat(OpcodeStr, "8"), v8i8, ShOp>;
1408 def v4i16 : N2VDShIns<op24, op23, 0b010000, op11_8, 0, op4,
1409 !strconcat(OpcodeStr, "16"), v4i16, ShOp>;
1410 def v2i32 : N2VDShIns<op24, op23, 0b100000, op11_8, 0, op4,
1411 !strconcat(OpcodeStr, "32"), v2i32, ShOp>;
1412 def v1i64 : N2VDShIns<op24, op23, 0b000000, op11_8, 1, op4,
1413 !strconcat(OpcodeStr, "64"), v1i64, ShOp>;
1414
1415 // 128-bit vector types.
1416 def v16i8 : N2VQShIns<op24, op23, 0b001000, op11_8, 0, op4,
1417 !strconcat(OpcodeStr, "8"), v16i8, ShOp>;
1418 def v8i16 : N2VQShIns<op24, op23, 0b010000, op11_8, 0, op4,
1419 !strconcat(OpcodeStr, "16"), v8i16, ShOp>;
1420 def v4i32 : N2VQShIns<op24, op23, 0b100000, op11_8, 0, op4,
1421 !strconcat(OpcodeStr, "32"), v4i32, ShOp>;
1422 def v2i64 : N2VQShIns<op24, op23, 0b000000, op11_8, 1, op4,
1423 !strconcat(OpcodeStr, "64"), v2i64, ShOp>;
1424}
1425
1426//===----------------------------------------------------------------------===//
1427// Instruction Definitions.
1428//===----------------------------------------------------------------------===//
1429
1430// Vector Add Operations.
1431
1432// VADD : Vector Add (integer and floating-point)
David Goodwin78caa122009-09-23 21:38:08 +00001433defm VADD : N3V_QHSD<0, 0, 0b1000, 0, IIC_VBINiD, IIC_VBINiQ, "vadd.i", add, 1>;
1434def VADDfd : N3VD<0, 0, 0b00, 0b1101, 0, IIC_VBIND, "vadd.f32", v2f32, v2f32, fadd, 1>;
1435def VADDfq : N3VQ<0, 0, 0b00, 0b1101, 0, IIC_VBINQ, "vadd.f32", v4f32, v4f32, fadd, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001436// VADDL : Vector Add Long (Q = D + D)
David Goodwin36bff0c2009-09-25 18:38:29 +00001437defm VADDLs : N3VLInt_QHS<0,1,0b0000,0, IIC_VSHLiD, "vaddl.s", int_arm_neon_vaddls, 1>;
1438defm VADDLu : N3VLInt_QHS<1,1,0b0000,0, IIC_VSHLiD, "vaddl.u", int_arm_neon_vaddlu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001439// VADDW : Vector Add Wide (Q = Q + D)
1440defm VADDWs : N3VWInt_QHS<0,1,0b0001,0, "vaddw.s", int_arm_neon_vaddws, 0>;
1441defm VADDWu : N3VWInt_QHS<1,1,0b0001,0, "vaddw.u", int_arm_neon_vaddwu, 0>;
1442// VHADD : Vector Halving Add
David Goodwin36bff0c2009-09-25 18:38:29 +00001443defm VHADDs : N3VInt_QHS<0,0,0b0000,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1444 IIC_VBINi4Q, "vhadd.s", int_arm_neon_vhadds, 1>;
1445defm VHADDu : N3VInt_QHS<1,0,0b0000,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1446 IIC_VBINi4Q, "vhadd.u", int_arm_neon_vhaddu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001447// VRHADD : Vector Rounding Halving Add
David Goodwin36bff0c2009-09-25 18:38:29 +00001448defm VRHADDs : N3VInt_QHS<0,0,0b0001,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1449 IIC_VBINi4Q, "vrhadd.s", int_arm_neon_vrhadds, 1>;
1450defm VRHADDu : N3VInt_QHS<1,0,0b0001,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1451 IIC_VBINi4Q, "vrhadd.u", int_arm_neon_vrhaddu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001452// VQADD : Vector Saturating Add
David Goodwin36bff0c2009-09-25 18:38:29 +00001453defm VQADDs : N3VInt_QHSD<0,0,0b0000,1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1454 IIC_VBINi4Q, "vqadd.s", int_arm_neon_vqadds, 1>;
1455defm VQADDu : N3VInt_QHSD<1,0,0b0000,1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1456 IIC_VBINi4Q, "vqadd.u", int_arm_neon_vqaddu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001457// VADDHN : Vector Add and Narrow Returning High Half (D = Q + Q)
1458defm VADDHN : N3VNInt_HSD<0,1,0b0100,0, "vaddhn.i", int_arm_neon_vaddhn, 1>;
1459// VRADDHN : Vector Rounding Add and Narrow Returning High Half (D = Q + Q)
1460defm VRADDHN : N3VNInt_HSD<1,1,0b0100,0, "vraddhn.i", int_arm_neon_vraddhn, 1>;
1461
1462// Vector Multiply Operations.
1463
1464// VMUL : Vector Multiply (integer, polynomial and floating-point)
David Goodwin78caa122009-09-23 21:38:08 +00001465defm VMUL : N3V_QHS<0, 0, 0b1001, 1, IIC_VMULi16D, IIC_VMULi32D, IIC_VMULi16Q,
1466 IIC_VMULi32Q, "vmul.i", mul, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001467def VMULpd : N3VDInt<1, 0, 0b00, 0b1001, 1, IIC_VMULi16D, "vmul.p8", v8i8, v8i8,
Bob Wilsone60fee02009-06-22 23:27:02 +00001468 int_arm_neon_vmulp, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001469def VMULpq : N3VQInt<1, 0, 0b00, 0b1001, 1, IIC_VMULi16Q, "vmul.p8", v16i8, v16i8,
Bob Wilsone60fee02009-06-22 23:27:02 +00001470 int_arm_neon_vmulp, 1>;
David Goodwin78caa122009-09-23 21:38:08 +00001471def VMULfd : N3VD<1, 0, 0b00, 0b1101, 1, IIC_VBIND, "vmul.f32", v2f32, v2f32, fmul, 1>;
1472def VMULfq : N3VQ<1, 0, 0b00, 0b1101, 1, IIC_VBINQ, "vmul.f32", v4f32, v4f32, fmul, 1>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001473defm VMULsl : N3VSL_HS<0b1000, "vmul.i", mul>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001474def VMULslfd : N3VDSL<0b10, 0b1001, IIC_VBIND, "vmul.f32", v2f32, fmul>;
1475def VMULslfq : N3VQSL<0b10, 0b1001, IIC_VBINQ, "vmul.f32", v4f32, v2f32, fmul>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001476def : Pat<(v8i16 (mul (v8i16 QPR:$src1),
1477 (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))),
1478 (v8i16 (VMULslv8i16 (v8i16 QPR:$src1),
1479 (v4i16 (EXTRACT_SUBREG QPR:$src2,
1480 (DSubReg_i16_reg imm:$lane))),
1481 (SubReg_i16_lane imm:$lane)))>;
1482def : Pat<(v4i32 (mul (v4i32 QPR:$src1),
1483 (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))),
1484 (v4i32 (VMULslv4i32 (v4i32 QPR:$src1),
1485 (v2i32 (EXTRACT_SUBREG QPR:$src2,
1486 (DSubReg_i32_reg imm:$lane))),
1487 (SubReg_i32_lane imm:$lane)))>;
1488def : Pat<(v4f32 (fmul (v4f32 QPR:$src1),
1489 (v4f32 (NEONvduplane (v4f32 QPR:$src2), imm:$lane)))),
1490 (v4f32 (VMULslfq (v4f32 QPR:$src1),
1491 (v2f32 (EXTRACT_SUBREG QPR:$src2,
1492 (DSubReg_i32_reg imm:$lane))),
1493 (SubReg_i32_lane imm:$lane)))>;
1494
Bob Wilsone60fee02009-06-22 23:27:02 +00001495// VQDMULH : Vector Saturating Doubling Multiply Returning High Half
David Goodwin36bff0c2009-09-25 18:38:29 +00001496defm VQDMULH : N3VInt_HS<0, 0, 0b1011, 0, IIC_VMULi16D, IIC_VMULi32D,
1497 IIC_VMULi16Q, IIC_VMULi32Q,
1498 "vqdmulh.s", int_arm_neon_vqdmulh, 1>;
1499defm VQDMULHsl: N3VIntSL_HS<0b1100, IIC_VMULi16D, IIC_VMULi32D,
1500 IIC_VMULi16Q, IIC_VMULi32Q,
1501 "vqdmulh.s", int_arm_neon_vqdmulh>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001502def : Pat<(v8i16 (int_arm_neon_vqdmulh (v8i16 QPR:$src1),
1503 (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))),
1504 (v8i16 (VQDMULHslv8i16 (v8i16 QPR:$src1),
1505 (v4i16 (EXTRACT_SUBREG QPR:$src2,
1506 (DSubReg_i16_reg imm:$lane))),
1507 (SubReg_i16_lane imm:$lane)))>;
1508def : Pat<(v4i32 (int_arm_neon_vqdmulh (v4i32 QPR:$src1),
1509 (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))),
1510 (v4i32 (VQDMULHslv4i32 (v4i32 QPR:$src1),
1511 (v2i32 (EXTRACT_SUBREG QPR:$src2,
1512 (DSubReg_i32_reg imm:$lane))),
1513 (SubReg_i32_lane imm:$lane)))>;
1514
Bob Wilsone60fee02009-06-22 23:27:02 +00001515// VQRDMULH : Vector Rounding Saturating Doubling Multiply Returning High Half
David Goodwin36bff0c2009-09-25 18:38:29 +00001516defm VQRDMULH : N3VInt_HS<1, 0, 0b1011, 0, IIC_VMULi16D, IIC_VMULi32D,
1517 IIC_VMULi16Q, IIC_VMULi32Q,
1518 "vqrdmulh.s", int_arm_neon_vqrdmulh, 1>;
1519defm VQRDMULHsl : N3VIntSL_HS<0b1101, IIC_VMULi16D, IIC_VMULi32D,
1520 IIC_VMULi16Q, IIC_VMULi32Q,
1521 "vqrdmulh.s", int_arm_neon_vqrdmulh>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001522def : Pat<(v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$src1),
1523 (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))),
1524 (v8i16 (VQRDMULHslv8i16 (v8i16 QPR:$src1),
1525 (v4i16 (EXTRACT_SUBREG QPR:$src2,
1526 (DSubReg_i16_reg imm:$lane))),
1527 (SubReg_i16_lane imm:$lane)))>;
1528def : Pat<(v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$src1),
1529 (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))),
1530 (v4i32 (VQRDMULHslv4i32 (v4i32 QPR:$src1),
1531 (v2i32 (EXTRACT_SUBREG QPR:$src2,
1532 (DSubReg_i32_reg imm:$lane))),
1533 (SubReg_i32_lane imm:$lane)))>;
1534
Bob Wilsone60fee02009-06-22 23:27:02 +00001535// VMULL : Vector Multiply Long (integer and polynomial) (Q = D * D)
David Goodwin36bff0c2009-09-25 18:38:29 +00001536defm VMULLs : N3VLInt_QHS<0,1,0b1100,0, IIC_VMULi16D, "vmull.s", int_arm_neon_vmulls, 1>;
1537defm VMULLu : N3VLInt_QHS<1,1,0b1100,0, IIC_VMULi16D, "vmull.u", int_arm_neon_vmullu, 1>;
1538def VMULLp : N3VLInt<0, 1, 0b00, 0b1110, 0, IIC_VMULi16D, "vmull.p8", v8i16, v8i8,
Bob Wilsone60fee02009-06-22 23:27:02 +00001539 int_arm_neon_vmullp, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001540defm VMULLsls : N3VLIntSL_HS<0, 0b1010, IIC_VMULi16D, "vmull.s", int_arm_neon_vmulls>;
1541defm VMULLslu : N3VLIntSL_HS<1, 0b1010, IIC_VMULi16D, "vmull.u", int_arm_neon_vmullu>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001542
Bob Wilsone60fee02009-06-22 23:27:02 +00001543// VQDMULL : Vector Saturating Doubling Multiply Long (Q = D * D)
David Goodwin36bff0c2009-09-25 18:38:29 +00001544defm VQDMULL : N3VLInt_HS<0,1,0b1101,0, IIC_VMULi16D, "vqdmull.s", int_arm_neon_vqdmull, 1>;
1545defm VQDMULLsl: N3VLIntSL_HS<0, 0b1011, IIC_VMULi16D, "vqdmull.s", int_arm_neon_vqdmull>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001546
1547// Vector Multiply-Accumulate and Multiply-Subtract Operations.
1548
1549// VMLA : Vector Multiply Accumulate (integer and floating-point)
David Goodwin36bff0c2009-09-25 18:38:29 +00001550defm VMLA : N3VMulOp_QHS<0, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
1551 IIC_VMACi16Q, IIC_VMACi32Q, "vmla.i", add>;
1552def VMLAfd : N3VDMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla.f32", v2f32, fmul, fadd>;
1553def VMLAfq : N3VQMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACQ, "vmla.f32", v4f32, fmul, fadd>;
1554defm VMLAsl : N3VMulOpSL_HS<0b0000, IIC_VMACi16D, IIC_VMACi32D,
1555 IIC_VMACi16Q, IIC_VMACi32Q, "vmla.i", add>;
1556def VMLAslfd : N3VDMulOpSL<0b10, 0b0001, IIC_VMACD, "vmla.f32", v2f32, fmul, fadd>;
1557def VMLAslfq : N3VQMulOpSL<0b10, 0b0001, IIC_VMACQ, "vmla.f32", v4f32, v2f32, fmul, fadd>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001558
1559def : Pat<(v8i16 (add (v8i16 QPR:$src1),
1560 (mul (v8i16 QPR:$src2),
1561 (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))),
1562 (v8i16 (VMLAslv8i16 (v8i16 QPR:$src1),
1563 (v8i16 QPR:$src2),
1564 (v4i16 (EXTRACT_SUBREG QPR:$src3,
1565 (DSubReg_i16_reg imm:$lane))),
1566 (SubReg_i16_lane imm:$lane)))>;
1567
1568def : Pat<(v4i32 (add (v4i32 QPR:$src1),
1569 (mul (v4i32 QPR:$src2),
1570 (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))),
1571 (v4i32 (VMLAslv4i32 (v4i32 QPR:$src1),
1572 (v4i32 QPR:$src2),
1573 (v2i32 (EXTRACT_SUBREG QPR:$src3,
1574 (DSubReg_i32_reg imm:$lane))),
1575 (SubReg_i32_lane imm:$lane)))>;
1576
1577def : Pat<(v4f32 (fadd (v4f32 QPR:$src1),
1578 (fmul (v4f32 QPR:$src2),
1579 (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))),
1580 (v4f32 (VMLAslfq (v4f32 QPR:$src1),
1581 (v4f32 QPR:$src2),
1582 (v2f32 (EXTRACT_SUBREG QPR:$src3,
1583 (DSubReg_i32_reg imm:$lane))),
1584 (SubReg_i32_lane imm:$lane)))>;
1585
Bob Wilsone60fee02009-06-22 23:27:02 +00001586// VMLAL : Vector Multiply Accumulate Long (Q += D * D)
1587defm VMLALs : N3VLInt3_QHS<0,1,0b1000,0, "vmlal.s", int_arm_neon_vmlals>;
1588defm VMLALu : N3VLInt3_QHS<1,1,0b1000,0, "vmlal.u", int_arm_neon_vmlalu>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001589
1590defm VMLALsls : N3VLInt3SL_HS<0, 0b0010, "vmlal.s", int_arm_neon_vmlals>;
1591defm VMLALslu : N3VLInt3SL_HS<1, 0b0010, "vmlal.u", int_arm_neon_vmlalu>;
1592
Bob Wilsone60fee02009-06-22 23:27:02 +00001593// VQDMLAL : Vector Saturating Doubling Multiply Accumulate Long (Q += D * D)
1594defm VQDMLAL : N3VLInt3_HS<0, 1, 0b1001, 0, "vqdmlal.s", int_arm_neon_vqdmlal>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001595defm VQDMLALsl: N3VLInt3SL_HS<0, 0b0011, "vqdmlal.s", int_arm_neon_vqdmlal>;
1596
Bob Wilsone60fee02009-06-22 23:27:02 +00001597// VMLS : Vector Multiply Subtract (integer and floating-point)
Bob Wilson64c60912009-10-03 04:41:21 +00001598defm VMLS : N3VMulOp_QHS<1, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
David Goodwin36bff0c2009-09-25 18:38:29 +00001599 IIC_VMACi16Q, IIC_VMACi32Q, "vmls.i", sub>;
1600def VMLSfd : N3VDMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls.f32", v2f32, fmul, fsub>;
1601def VMLSfq : N3VQMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACQ, "vmls.f32", v4f32, fmul, fsub>;
1602defm VMLSsl : N3VMulOpSL_HS<0b0100, IIC_VMACi16D, IIC_VMACi32D,
1603 IIC_VMACi16Q, IIC_VMACi32Q, "vmls.i", sub>;
1604def VMLSslfd : N3VDMulOpSL<0b10, 0b0101, IIC_VMACD, "vmls.f32", v2f32, fmul, fsub>;
1605def VMLSslfq : N3VQMulOpSL<0b10, 0b0101, IIC_VMACQ, "vmls.f32", v4f32, v2f32, fmul, fsub>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001606
1607def : Pat<(v8i16 (sub (v8i16 QPR:$src1),
1608 (mul (v8i16 QPR:$src2),
1609 (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))),
1610 (v8i16 (VMLSslv8i16 (v8i16 QPR:$src1),
1611 (v8i16 QPR:$src2),
1612 (v4i16 (EXTRACT_SUBREG QPR:$src3,
1613 (DSubReg_i16_reg imm:$lane))),
1614 (SubReg_i16_lane imm:$lane)))>;
1615
1616def : Pat<(v4i32 (sub (v4i32 QPR:$src1),
1617 (mul (v4i32 QPR:$src2),
1618 (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))),
1619 (v4i32 (VMLSslv4i32 (v4i32 QPR:$src1),
1620 (v4i32 QPR:$src2),
1621 (v2i32 (EXTRACT_SUBREG QPR:$src3,
1622 (DSubReg_i32_reg imm:$lane))),
1623 (SubReg_i32_lane imm:$lane)))>;
1624
1625def : Pat<(v4f32 (fsub (v4f32 QPR:$src1),
1626 (fmul (v4f32 QPR:$src2),
1627 (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))),
1628 (v4f32 (VMLSslfq (v4f32 QPR:$src1),
1629 (v4f32 QPR:$src2),
1630 (v2f32 (EXTRACT_SUBREG QPR:$src3,
1631 (DSubReg_i32_reg imm:$lane))),
1632 (SubReg_i32_lane imm:$lane)))>;
1633
Bob Wilsone60fee02009-06-22 23:27:02 +00001634// VMLSL : Vector Multiply Subtract Long (Q -= D * D)
1635defm VMLSLs : N3VLInt3_QHS<0,1,0b1010,0, "vmlsl.s", int_arm_neon_vmlsls>;
1636defm VMLSLu : N3VLInt3_QHS<1,1,0b1010,0, "vmlsl.u", int_arm_neon_vmlslu>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001637
1638defm VMLSLsls : N3VLInt3SL_HS<0, 0b0110, "vmlsl.s", int_arm_neon_vmlsls>;
1639defm VMLSLslu : N3VLInt3SL_HS<1, 0b0110, "vmlsl.u", int_arm_neon_vmlslu>;
1640
Bob Wilsone60fee02009-06-22 23:27:02 +00001641// VQDMLSL : Vector Saturating Doubling Multiply Subtract Long (Q -= D * D)
1642defm VQDMLSL : N3VLInt3_HS<0, 1, 0b1011, 0, "vqdmlsl.s", int_arm_neon_vqdmlsl>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001643defm VQDMLSLsl: N3VLInt3SL_HS<0, 0b111, "vqdmlsl.s", int_arm_neon_vqdmlsl>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001644
1645// Vector Subtract Operations.
1646
1647// VSUB : Vector Subtract (integer and floating-point)
David Goodwin78caa122009-09-23 21:38:08 +00001648defm VSUB : N3V_QHSD<1, 0, 0b1000, 0, IIC_VSUBiD, IIC_VSUBiQ, "vsub.i", sub, 0>;
1649def VSUBfd : N3VD<0, 0, 0b10, 0b1101, 0, IIC_VBIND, "vsub.f32", v2f32, v2f32, fsub, 0>;
1650def VSUBfq : N3VQ<0, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vsub.f32", v4f32, v4f32, fsub, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001651// VSUBL : Vector Subtract Long (Q = D - D)
David Goodwin36bff0c2009-09-25 18:38:29 +00001652defm VSUBLs : N3VLInt_QHS<0,1,0b0010,0, IIC_VSHLiD, "vsubl.s", int_arm_neon_vsubls, 1>;
1653defm VSUBLu : N3VLInt_QHS<1,1,0b0010,0, IIC_VSHLiD, "vsubl.u", int_arm_neon_vsublu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001654// VSUBW : Vector Subtract Wide (Q = Q - D)
1655defm VSUBWs : N3VWInt_QHS<0,1,0b0011,0, "vsubw.s", int_arm_neon_vsubws, 0>;
1656defm VSUBWu : N3VWInt_QHS<1,1,0b0011,0, "vsubw.u", int_arm_neon_vsubwu, 0>;
1657// VHSUB : Vector Halving Subtract
David Goodwin36bff0c2009-09-25 18:38:29 +00001658defm VHSUBs : N3VInt_QHS<0, 0, 0b0010, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1659 IIC_VBINi4Q, "vhsub.s", int_arm_neon_vhsubs, 0>;
1660defm VHSUBu : N3VInt_QHS<1, 0, 0b0010, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1661 IIC_VBINi4Q, "vhsub.u", int_arm_neon_vhsubu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001662// VQSUB : Vector Saturing Subtract
David Goodwin36bff0c2009-09-25 18:38:29 +00001663defm VQSUBs : N3VInt_QHSD<0, 0, 0b0010, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1664 IIC_VBINi4Q, "vqsub.s", int_arm_neon_vqsubs, 0>;
1665defm VQSUBu : N3VInt_QHSD<1, 0, 0b0010, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1666 IIC_VBINi4Q, "vqsub.u", int_arm_neon_vqsubu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001667// VSUBHN : Vector Subtract and Narrow Returning High Half (D = Q - Q)
1668defm VSUBHN : N3VNInt_HSD<0,1,0b0110,0, "vsubhn.i", int_arm_neon_vsubhn, 0>;
1669// VRSUBHN : Vector Rounding Subtract and Narrow Returning High Half (D=Q-Q)
1670defm VRSUBHN : N3VNInt_HSD<1,1,0b0110,0, "vrsubhn.i", int_arm_neon_vrsubhn, 0>;
1671
1672// Vector Comparisons.
1673
1674// VCEQ : Vector Compare Equal
David Goodwin78caa122009-09-23 21:38:08 +00001675defm VCEQ : N3V_QHS<1, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1676 IIC_VBINi4Q, "vceq.i", NEONvceq, 1>;
1677def VCEQfd : N3VD<0,0,0b00,0b1110,0, IIC_VBIND, "vceq.f32", v2i32, v2f32, NEONvceq, 1>;
1678def VCEQfq : N3VQ<0,0,0b00,0b1110,0, IIC_VBINQ, "vceq.f32", v4i32, v4f32, NEONvceq, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001679// VCGE : Vector Compare Greater Than or Equal
David Goodwin78caa122009-09-23 21:38:08 +00001680defm VCGEs : N3V_QHS<0, 0, 0b0011, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1681 IIC_VBINi4Q, "vcge.s", NEONvcge, 0>;
1682defm VCGEu : N3V_QHS<1, 0, 0b0011, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1683 IIC_VBINi4Q, "vcge.u", NEONvcgeu, 0>;
1684def VCGEfd : N3VD<1,0,0b00,0b1110,0, IIC_VBIND, "vcge.f32", v2i32, v2f32, NEONvcge, 0>;
1685def VCGEfq : N3VQ<1,0,0b00,0b1110,0, IIC_VBINQ, "vcge.f32", v4i32, v4f32, NEONvcge, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001686// VCGT : Vector Compare Greater Than
David Goodwin78caa122009-09-23 21:38:08 +00001687defm VCGTs : N3V_QHS<0, 0, 0b0011, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1688 IIC_VBINi4Q, "vcgt.s", NEONvcgt, 0>;
1689defm VCGTu : N3V_QHS<1, 0, 0b0011, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1690 IIC_VBINi4Q, "vcgt.u", NEONvcgtu, 0>;
1691def VCGTfd : N3VD<1,0,0b10,0b1110,0, IIC_VBIND, "vcgt.f32", v2i32, v2f32, NEONvcgt, 0>;
1692def VCGTfq : N3VQ<1,0,0b10,0b1110,0, IIC_VBINQ, "vcgt.f32", v4i32, v4f32, NEONvcgt, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001693// VACGE : Vector Absolute Compare Greater Than or Equal (aka VCAGE)
David Goodwin36bff0c2009-09-25 18:38:29 +00001694def VACGEd : N3VDInt<1, 0, 0b00, 0b1110, 1, IIC_VBIND, "vacge.f32", v2i32, v2f32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001695 int_arm_neon_vacged, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001696def VACGEq : N3VQInt<1, 0, 0b00, 0b1110, 1, IIC_VBINQ, "vacge.f32", v4i32, v4f32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001697 int_arm_neon_vacgeq, 0>;
1698// VACGT : Vector Absolute Compare Greater Than (aka VCAGT)
David Goodwin36bff0c2009-09-25 18:38:29 +00001699def VACGTd : N3VDInt<1, 0, 0b10, 0b1110, 1, IIC_VBIND, "vacgt.f32", v2i32, v2f32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001700 int_arm_neon_vacgtd, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001701def VACGTq : N3VQInt<1, 0, 0b10, 0b1110, 1, IIC_VBINQ, "vacgt.f32", v4i32, v4f32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001702 int_arm_neon_vacgtq, 0>;
1703// VTST : Vector Test Bits
David Goodwin78caa122009-09-23 21:38:08 +00001704defm VTST : N3V_QHS<0, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1705 IIC_VBINi4Q, "vtst.i", NEONvtst, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001706
1707// Vector Bitwise Operations.
1708
1709// VAND : Vector Bitwise AND
David Goodwin78caa122009-09-23 21:38:08 +00001710def VANDd : N3VD<0, 0, 0b00, 0b0001, 1, IIC_VBINiD, "vand", v2i32, v2i32, and, 1>;
1711def VANDq : N3VQ<0, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "vand", v4i32, v4i32, and, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001712
1713// VEOR : Vector Bitwise Exclusive OR
David Goodwin78caa122009-09-23 21:38:08 +00001714def VEORd : N3VD<1, 0, 0b00, 0b0001, 1, IIC_VBINiD, "veor", v2i32, v2i32, xor, 1>;
1715def VEORq : N3VQ<1, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "veor", v4i32, v4i32, xor, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001716
1717// VORR : Vector Bitwise OR
David Goodwin78caa122009-09-23 21:38:08 +00001718def VORRd : N3VD<0, 0, 0b10, 0b0001, 1, IIC_VBINiD, "vorr", v2i32, v2i32, or, 1>;
1719def VORRq : N3VQ<0, 0, 0b10, 0b0001, 1, IIC_VBINiQ, "vorr", v4i32, v4i32, or, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001720
1721// VBIC : Vector Bitwise Bit Clear (AND NOT)
1722def VBICd : N3V<0, 0, 0b01, 0b0001, 0, 1, (outs DPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +00001723 (ins DPR:$src1, DPR:$src2), IIC_VBINiD,
David Goodwincfd67652009-08-06 16:52:47 +00001724 "vbic\t$dst, $src1, $src2", "",
Anton Korobeynikov14636a52009-09-08 22:51:43 +00001725 [(set DPR:$dst, (v2i32 (and DPR:$src1,
1726 (vnot_conv DPR:$src2))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001727def VBICq : N3V<0, 0, 0b01, 0b0001, 1, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00001728 (ins QPR:$src1, QPR:$src2), IIC_VBINiQ,
David Goodwincfd67652009-08-06 16:52:47 +00001729 "vbic\t$dst, $src1, $src2", "",
Anton Korobeynikov14636a52009-09-08 22:51:43 +00001730 [(set QPR:$dst, (v4i32 (and QPR:$src1,
1731 (vnot_conv QPR:$src2))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001732
1733// VORN : Vector Bitwise OR NOT
1734def VORNd : N3V<0, 0, 0b11, 0b0001, 0, 1, (outs DPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +00001735 (ins DPR:$src1, DPR:$src2), IIC_VBINiD,
David Goodwincfd67652009-08-06 16:52:47 +00001736 "vorn\t$dst, $src1, $src2", "",
Anton Korobeynikov14636a52009-09-08 22:51:43 +00001737 [(set DPR:$dst, (v2i32 (or DPR:$src1,
1738 (vnot_conv DPR:$src2))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001739def VORNq : N3V<0, 0, 0b11, 0b0001, 1, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00001740 (ins QPR:$src1, QPR:$src2), IIC_VBINiQ,
David Goodwincfd67652009-08-06 16:52:47 +00001741 "vorn\t$dst, $src1, $src2", "",
Anton Korobeynikov14636a52009-09-08 22:51:43 +00001742 [(set QPR:$dst, (v4i32 (or QPR:$src1,
1743 (vnot_conv QPR:$src2))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001744
1745// VMVN : Vector Bitwise NOT
1746def VMVNd : N2V<0b11, 0b11, 0b00, 0b00, 0b01011, 0, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00001747 (outs DPR:$dst), (ins DPR:$src), IIC_VSHLiD,
David Goodwincfd67652009-08-06 16:52:47 +00001748 "vmvn\t$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001749 [(set DPR:$dst, (v2i32 (vnot DPR:$src)))]>;
1750def VMVNq : N2V<0b11, 0b11, 0b00, 0b00, 0b01011, 1, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00001751 (outs QPR:$dst), (ins QPR:$src), IIC_VSHLiD,
David Goodwincfd67652009-08-06 16:52:47 +00001752 "vmvn\t$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001753 [(set QPR:$dst, (v4i32 (vnot QPR:$src)))]>;
1754def : Pat<(v2i32 (vnot_conv DPR:$src)), (VMVNd DPR:$src)>;
1755def : Pat<(v4i32 (vnot_conv QPR:$src)), (VMVNq QPR:$src)>;
1756
1757// VBSL : Vector Bitwise Select
1758def VBSLd : N3V<1, 0, 0b01, 0b0001, 0, 1, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00001759 (ins DPR:$src1, DPR:$src2, DPR:$src3), IIC_VCNTiD,
Bob Wilsone60fee02009-06-22 23:27:02 +00001760 "vbsl\t$dst, $src2, $src3", "$src1 = $dst",
1761 [(set DPR:$dst,
1762 (v2i32 (or (and DPR:$src2, DPR:$src1),
Anton Korobeynikov14636a52009-09-08 22:51:43 +00001763 (and DPR:$src3, (vnot_conv DPR:$src1)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001764def VBSLq : N3V<1, 0, 0b01, 0b0001, 1, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00001765 (ins QPR:$src1, QPR:$src2, QPR:$src3), IIC_VCNTiQ,
Bob Wilsone60fee02009-06-22 23:27:02 +00001766 "vbsl\t$dst, $src2, $src3", "$src1 = $dst",
1767 [(set QPR:$dst,
1768 (v4i32 (or (and QPR:$src2, QPR:$src1),
Anton Korobeynikov14636a52009-09-08 22:51:43 +00001769 (and QPR:$src3, (vnot_conv QPR:$src1)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001770
1771// VBIF : Vector Bitwise Insert if False
1772// like VBSL but with: "vbif\t$dst, $src3, $src1", "$src2 = $dst",
1773// VBIT : Vector Bitwise Insert if True
1774// like VBSL but with: "vbit\t$dst, $src2, $src1", "$src3 = $dst",
1775// These are not yet implemented. The TwoAddress pass will not go looking
1776// for equivalent operations with different register constraints; it just
1777// inserts copies.
1778
1779// Vector Absolute Differences.
1780
1781// VABD : Vector Absolute Difference
David Goodwin36bff0c2009-09-25 18:38:29 +00001782defm VABDs : N3VInt_QHS<0, 0, 0b0111, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1783 IIC_VBINi4Q, "vabd.s", int_arm_neon_vabds, 0>;
1784defm VABDu : N3VInt_QHS<1, 0, 0b0111, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1785 IIC_VBINi4Q, "vabd.u", int_arm_neon_vabdu, 0>;
1786def VABDfd : N3VDInt<1, 0, 0b10, 0b1101, 0, IIC_VBIND, "vabd.f32", v2f32, v2f32,
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001787 int_arm_neon_vabds, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001788def VABDfq : N3VQInt<1, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vabd.f32", v4f32, v4f32,
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001789 int_arm_neon_vabds, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001790
1791// VABDL : Vector Absolute Difference Long (Q = | D - D |)
David Goodwin36bff0c2009-09-25 18:38:29 +00001792defm VABDLs : N3VLInt_QHS<0,1,0b0111,0, IIC_VBINi4Q, "vabdl.s", int_arm_neon_vabdls, 0>;
1793defm VABDLu : N3VLInt_QHS<1,1,0b0111,0, IIC_VBINi4Q, "vabdl.u", int_arm_neon_vabdlu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001794
1795// VABA : Vector Absolute Difference and Accumulate
1796defm VABAs : N3VInt3_QHS<0,1,0b0101,0, "vaba.s", int_arm_neon_vabas>;
1797defm VABAu : N3VInt3_QHS<1,1,0b0101,0, "vaba.u", int_arm_neon_vabau>;
1798
1799// VABAL : Vector Absolute Difference and Accumulate Long (Q += | D - D |)
1800defm VABALs : N3VLInt3_QHS<0,1,0b0101,0, "vabal.s", int_arm_neon_vabals>;
1801defm VABALu : N3VLInt3_QHS<1,1,0b0101,0, "vabal.u", int_arm_neon_vabalu>;
1802
1803// Vector Maximum and Minimum.
1804
1805// VMAX : Vector Maximum
David Goodwin36bff0c2009-09-25 18:38:29 +00001806defm VMAXs : N3VInt_QHS<0, 0, 0b0110, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1807 IIC_VBINi4Q, "vmax.s", int_arm_neon_vmaxs, 1>;
1808defm VMAXu : N3VInt_QHS<1, 0, 0b0110, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1809 IIC_VBINi4Q, "vmax.u", int_arm_neon_vmaxu, 1>;
1810def VMAXfd : N3VDInt<0, 0, 0b00, 0b1111, 0, IIC_VBIND, "vmax.f32", v2f32, v2f32,
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001811 int_arm_neon_vmaxs, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001812def VMAXfq : N3VQInt<0, 0, 0b00, 0b1111, 0, IIC_VBINQ, "vmax.f32", v4f32, v4f32,
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001813 int_arm_neon_vmaxs, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001814
1815// VMIN : Vector Minimum
David Goodwin36bff0c2009-09-25 18:38:29 +00001816defm VMINs : N3VInt_QHS<0, 0, 0b0110, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1817 IIC_VBINi4Q, "vmin.s", int_arm_neon_vmins, 1>;
1818defm VMINu : N3VInt_QHS<1, 0, 0b0110, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
1819 IIC_VBINi4Q, "vmin.u", int_arm_neon_vminu, 1>;
1820def VMINfd : N3VDInt<0, 0, 0b10, 0b1111, 0, IIC_VBIND, "vmin.f32", v2f32, v2f32,
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001821 int_arm_neon_vmins, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001822def VMINfq : N3VQInt<0, 0, 0b10, 0b1111, 0, IIC_VBINQ, "vmin.f32", v4f32, v4f32,
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001823 int_arm_neon_vmins, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001824
1825// Vector Pairwise Operations.
1826
1827// VPADD : Vector Pairwise Add
David Goodwin36bff0c2009-09-25 18:38:29 +00001828def VPADDi8 : N3VDInt<0, 0, 0b00, 0b1011, 1, IIC_VBINiD, "vpadd.i8", v8i8, v8i8,
Bob Wilson1c2660e2009-08-11 01:15:26 +00001829 int_arm_neon_vpadd, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001830def VPADDi16 : N3VDInt<0, 0, 0b01, 0b1011, 1, IIC_VBINiD, "vpadd.i16", v4i16, v4i16,
Bob Wilson1c2660e2009-08-11 01:15:26 +00001831 int_arm_neon_vpadd, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001832def VPADDi32 : N3VDInt<0, 0, 0b10, 0b1011, 1, IIC_VBINiD, "vpadd.i32", v2i32, v2i32,
Bob Wilson1c2660e2009-08-11 01:15:26 +00001833 int_arm_neon_vpadd, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001834def VPADDf : N3VDInt<1, 0, 0b00, 0b1101, 0, IIC_VBIND, "vpadd.f32", v2f32, v2f32,
Bob Wilson1c2660e2009-08-11 01:15:26 +00001835 int_arm_neon_vpadd, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001836
1837// VPADDL : Vector Pairwise Add Long
1838defm VPADDLs : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpaddl.s",
1839 int_arm_neon_vpaddls>;
1840defm VPADDLu : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpaddl.u",
1841 int_arm_neon_vpaddlu>;
1842
1843// VPADAL : Vector Pairwise Add and Accumulate Long
1844defm VPADALs : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpadal.s",
1845 int_arm_neon_vpadals>;
1846defm VPADALu : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpadal.u",
1847 int_arm_neon_vpadalu>;
1848
1849// VPMAX : Vector Pairwise Maximum
David Goodwin36bff0c2009-09-25 18:38:29 +00001850def VPMAXs8 : N3VDInt<0, 0, 0b00, 0b1010, 0, IIC_VBINi4D, "vpmax.s8", v8i8, v8i8,
Bob Wilsone60fee02009-06-22 23:27:02 +00001851 int_arm_neon_vpmaxs, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001852def VPMAXs16 : N3VDInt<0, 0, 0b01, 0b1010, 0, IIC_VBINi4D, "vpmax.s16", v4i16, v4i16,
Bob Wilsone60fee02009-06-22 23:27:02 +00001853 int_arm_neon_vpmaxs, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001854def VPMAXs32 : N3VDInt<0, 0, 0b10, 0b1010, 0, IIC_VBINi4D, "vpmax.s32", v2i32, v2i32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001855 int_arm_neon_vpmaxs, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001856def VPMAXu8 : N3VDInt<1, 0, 0b00, 0b1010, 0, IIC_VBINi4D, "vpmax.u8", v8i8, v8i8,
Bob Wilsone60fee02009-06-22 23:27:02 +00001857 int_arm_neon_vpmaxu, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001858def VPMAXu16 : N3VDInt<1, 0, 0b01, 0b1010, 0, IIC_VBINi4D, "vpmax.u16", v4i16, v4i16,
Bob Wilsone60fee02009-06-22 23:27:02 +00001859 int_arm_neon_vpmaxu, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001860def VPMAXu32 : N3VDInt<1, 0, 0b10, 0b1010, 0, IIC_VBINi4D, "vpmax.u32", v2i32, v2i32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001861 int_arm_neon_vpmaxu, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001862def VPMAXf : N3VDInt<1, 0, 0b00, 0b1111, 0, IIC_VBINi4D, "vpmax.f32", v2f32, v2f32,
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001863 int_arm_neon_vpmaxs, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001864
1865// VPMIN : Vector Pairwise Minimum
David Goodwin36bff0c2009-09-25 18:38:29 +00001866def VPMINs8 : N3VDInt<0, 0, 0b00, 0b1010, 1, IIC_VBINi4D, "vpmin.s8", v8i8, v8i8,
Bob Wilsone60fee02009-06-22 23:27:02 +00001867 int_arm_neon_vpmins, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001868def VPMINs16 : N3VDInt<0, 0, 0b01, 0b1010, 1, IIC_VBINi4D, "vpmin.s16", v4i16, v4i16,
Bob Wilsone60fee02009-06-22 23:27:02 +00001869 int_arm_neon_vpmins, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001870def VPMINs32 : N3VDInt<0, 0, 0b10, 0b1010, 1, IIC_VBINi4D, "vpmin.s32", v2i32, v2i32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001871 int_arm_neon_vpmins, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001872def VPMINu8 : N3VDInt<1, 0, 0b00, 0b1010, 1, IIC_VBINi4D, "vpmin.u8", v8i8, v8i8,
Bob Wilsone60fee02009-06-22 23:27:02 +00001873 int_arm_neon_vpminu, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001874def VPMINu16 : N3VDInt<1, 0, 0b01, 0b1010, 1, IIC_VBINi4D, "vpmin.u16", v4i16, v4i16,
Bob Wilsone60fee02009-06-22 23:27:02 +00001875 int_arm_neon_vpminu, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001876def VPMINu32 : N3VDInt<1, 0, 0b10, 0b1010, 1, IIC_VBINi4D, "vpmin.u32", v2i32, v2i32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001877 int_arm_neon_vpminu, 0>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001878def VPMINf : N3VDInt<1, 0, 0b10, 0b1111, 0, IIC_VBINi4D, "vpmin.f32", v2f32, v2f32,
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001879 int_arm_neon_vpmins, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001880
1881// Vector Reciprocal and Reciprocal Square Root Estimate and Step.
1882
1883// VRECPE : Vector Reciprocal Estimate
David Goodwin78caa122009-09-23 21:38:08 +00001884def VRECPEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
1885 IIC_VUNAD, "vrecpe.u32",
Bob Wilsone60fee02009-06-22 23:27:02 +00001886 v2i32, v2i32, int_arm_neon_vrecpe>;
David Goodwin78caa122009-09-23 21:38:08 +00001887def VRECPEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
1888 IIC_VUNAQ, "vrecpe.u32",
Bob Wilsone60fee02009-06-22 23:27:02 +00001889 v4i32, v4i32, int_arm_neon_vrecpe>;
David Goodwin78caa122009-09-23 21:38:08 +00001890def VRECPEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
1891 IIC_VUNAD, "vrecpe.f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001892 v2f32, v2f32, int_arm_neon_vrecpe>;
David Goodwin78caa122009-09-23 21:38:08 +00001893def VRECPEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
1894 IIC_VUNAQ, "vrecpe.f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00001895 v4f32, v4f32, int_arm_neon_vrecpe>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001896
1897// VRECPS : Vector Reciprocal Step
David Goodwin36bff0c2009-09-25 18:38:29 +00001898def VRECPSfd : N3VDInt<0, 0, 0b00, 0b1111, 1, IIC_VRECSD, "vrecps.f32", v2f32, v2f32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001899 int_arm_neon_vrecps, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001900def VRECPSfq : N3VQInt<0, 0, 0b00, 0b1111, 1, IIC_VRECSQ, "vrecps.f32", v4f32, v4f32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001901 int_arm_neon_vrecps, 1>;
1902
1903// VRSQRTE : Vector Reciprocal Square Root Estimate
David Goodwin78caa122009-09-23 21:38:08 +00001904def VRSQRTEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
1905 IIC_VUNAD, "vrsqrte.u32",
1906 v2i32, v2i32, int_arm_neon_vrsqrte>;
1907def VRSQRTEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
1908 IIC_VUNAQ, "vrsqrte.u32",
1909 v4i32, v4i32, int_arm_neon_vrsqrte>;
1910def VRSQRTEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
1911 IIC_VUNAD, "vrsqrte.f32",
1912 v2f32, v2f32, int_arm_neon_vrsqrte>;
1913def VRSQRTEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
1914 IIC_VUNAQ, "vrsqrte.f32",
1915 v4f32, v4f32, int_arm_neon_vrsqrte>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001916
1917// VRSQRTS : Vector Reciprocal Square Root Step
David Goodwin36bff0c2009-09-25 18:38:29 +00001918def VRSQRTSfd : N3VDInt<0, 0, 0b10, 0b1111, 1, IIC_VRECSD, "vrsqrts.f32", v2f32, v2f32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001919 int_arm_neon_vrsqrts, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001920def VRSQRTSfq : N3VQInt<0, 0, 0b10, 0b1111, 1, IIC_VRECSQ, "vrsqrts.f32", v4f32, v4f32,
Bob Wilsone60fee02009-06-22 23:27:02 +00001921 int_arm_neon_vrsqrts, 1>;
1922
1923// Vector Shifts.
1924
1925// VSHL : Vector Shift
David Goodwin36bff0c2009-09-25 18:38:29 +00001926defm VSHLs : N3VInt_QHSD<0, 0, 0b0100, 0, IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ,
1927 IIC_VSHLiQ, "vshl.s", int_arm_neon_vshifts, 0>;
1928defm VSHLu : N3VInt_QHSD<1, 0, 0b0100, 0, IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ,
1929 IIC_VSHLiQ, "vshl.u", int_arm_neon_vshiftu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001930// VSHL : Vector Shift Left (Immediate)
David Goodwin36bff0c2009-09-25 18:38:29 +00001931defm VSHLi : N2VSh_QHSD<0, 1, 0b0111, 1, IIC_VSHLiD, "vshl.i", NEONvshl>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001932// VSHR : Vector Shift Right (Immediate)
David Goodwin36bff0c2009-09-25 18:38:29 +00001933defm VSHRs : N2VSh_QHSD<0, 1, 0b0000, 1, IIC_VSHLiD, "vshr.s", NEONvshrs>;
1934defm VSHRu : N2VSh_QHSD<1, 1, 0b0000, 1, IIC_VSHLiD, "vshr.u", NEONvshru>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001935
1936// VSHLL : Vector Shift Left Long
1937def VSHLLs8 : N2VLSh<0, 1, 0b001000, 0b1010, 0, 0, 1, "vshll.s8",
1938 v8i16, v8i8, NEONvshlls>;
1939def VSHLLs16 : N2VLSh<0, 1, 0b010000, 0b1010, 0, 0, 1, "vshll.s16",
1940 v4i32, v4i16, NEONvshlls>;
1941def VSHLLs32 : N2VLSh<0, 1, 0b100000, 0b1010, 0, 0, 1, "vshll.s32",
1942 v2i64, v2i32, NEONvshlls>;
1943def VSHLLu8 : N2VLSh<1, 1, 0b001000, 0b1010, 0, 0, 1, "vshll.u8",
1944 v8i16, v8i8, NEONvshllu>;
1945def VSHLLu16 : N2VLSh<1, 1, 0b010000, 0b1010, 0, 0, 1, "vshll.u16",
1946 v4i32, v4i16, NEONvshllu>;
1947def VSHLLu32 : N2VLSh<1, 1, 0b100000, 0b1010, 0, 0, 1, "vshll.u32",
1948 v2i64, v2i32, NEONvshllu>;
1949
1950// VSHLL : Vector Shift Left Long (with maximum shift count)
1951def VSHLLi8 : N2VLSh<1, 1, 0b110010, 0b0011, 0, 0, 0, "vshll.i8",
1952 v8i16, v8i8, NEONvshlli>;
1953def VSHLLi16 : N2VLSh<1, 1, 0b110110, 0b0011, 0, 0, 0, "vshll.i16",
1954 v4i32, v4i16, NEONvshlli>;
1955def VSHLLi32 : N2VLSh<1, 1, 0b111010, 0b0011, 0, 0, 0, "vshll.i32",
1956 v2i64, v2i32, NEONvshlli>;
1957
1958// VSHRN : Vector Shift Right and Narrow
David Goodwin36bff0c2009-09-25 18:38:29 +00001959def VSHRN16 : N2VNSh<0, 1, 0b001000, 0b1000, 0, 0, 1,
1960 IIC_VSHLiD, "vshrn.i16", v8i8, v8i16, NEONvshrn>;
1961def VSHRN32 : N2VNSh<0, 1, 0b010000, 0b1000, 0, 0, 1,
1962 IIC_VSHLiD, "vshrn.i32", v4i16, v4i32, NEONvshrn>;
1963def VSHRN64 : N2VNSh<0, 1, 0b100000, 0b1000, 0, 0, 1,
1964 IIC_VSHLiD, "vshrn.i64", v2i32, v2i64, NEONvshrn>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001965
1966// VRSHL : Vector Rounding Shift
David Goodwin36bff0c2009-09-25 18:38:29 +00001967defm VRSHLs : N3VInt_QHSD<0,0,0b0101,0, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
1968 IIC_VSHLi4Q, "vrshl.s", int_arm_neon_vrshifts, 0>;
1969defm VRSHLu : N3VInt_QHSD<1,0,0b0101,0, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
1970 IIC_VSHLi4Q, "vrshl.u", int_arm_neon_vrshiftu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001971// VRSHR : Vector Rounding Shift Right
David Goodwin36bff0c2009-09-25 18:38:29 +00001972defm VRSHRs : N2VSh_QHSD<0, 1, 0b0010, 1, IIC_VSHLi4D, "vrshr.s", NEONvrshrs>;
1973defm VRSHRu : N2VSh_QHSD<1, 1, 0b0010, 1, IIC_VSHLi4D, "vrshr.u", NEONvrshru>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001974
1975// VRSHRN : Vector Rounding Shift Right and Narrow
David Goodwin36bff0c2009-09-25 18:38:29 +00001976def VRSHRN16 : N2VNSh<0, 1, 0b001000, 0b1000, 0, 1, 1,
1977 IIC_VSHLi4D, "vrshrn.i16", v8i8, v8i16, NEONvrshrn>;
1978def VRSHRN32 : N2VNSh<0, 1, 0b010000, 0b1000, 0, 1, 1,
1979 IIC_VSHLi4D, "vrshrn.i32", v4i16, v4i32, NEONvrshrn>;
1980def VRSHRN64 : N2VNSh<0, 1, 0b100000, 0b1000, 0, 1, 1,
1981 IIC_VSHLi4D, "vrshrn.i64", v2i32, v2i64, NEONvrshrn>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001982
1983// VQSHL : Vector Saturating Shift
David Goodwin36bff0c2009-09-25 18:38:29 +00001984defm VQSHLs : N3VInt_QHSD<0,0,0b0100,1, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
1985 IIC_VSHLi4Q, "vqshl.s", int_arm_neon_vqshifts, 0>;
1986defm VQSHLu : N3VInt_QHSD<1,0,0b0100,1, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
1987 IIC_VSHLi4Q, "vqshl.u", int_arm_neon_vqshiftu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001988// VQSHL : Vector Saturating Shift Left (Immediate)
David Goodwin36bff0c2009-09-25 18:38:29 +00001989defm VQSHLsi : N2VSh_QHSD<0, 1, 0b0111, 1, IIC_VSHLi4D, "vqshl.s", NEONvqshls>;
1990defm VQSHLui : N2VSh_QHSD<1, 1, 0b0111, 1, IIC_VSHLi4D, "vqshl.u", NEONvqshlu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001991// VQSHLU : Vector Saturating Shift Left (Immediate, Unsigned)
David Goodwin36bff0c2009-09-25 18:38:29 +00001992defm VQSHLsu : N2VSh_QHSD<1, 1, 0b0110, 1, IIC_VSHLi4D, "vqshlu.s", NEONvqshlsu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001993
1994// VQSHRN : Vector Saturating Shift Right and Narrow
David Goodwin36bff0c2009-09-25 18:38:29 +00001995def VQSHRNs16 : N2VNSh<0, 1, 0b001000, 0b1001, 0, 0, 1,
1996 IIC_VSHLi4D, "vqshrn.s16", v8i8, v8i16, NEONvqshrns>;
1997def VQSHRNs32 : N2VNSh<0, 1, 0b010000, 0b1001, 0, 0, 1,
1998 IIC_VSHLi4D, "vqshrn.s32", v4i16, v4i32, NEONvqshrns>;
1999def VQSHRNs64 : N2VNSh<0, 1, 0b100000, 0b1001, 0, 0, 1,
2000 IIC_VSHLi4D, "vqshrn.s64", v2i32, v2i64, NEONvqshrns>;
2001def VQSHRNu16 : N2VNSh<1, 1, 0b001000, 0b1001, 0, 0, 1,
2002 IIC_VSHLi4D, "vqshrn.u16", v8i8, v8i16, NEONvqshrnu>;
2003def VQSHRNu32 : N2VNSh<1, 1, 0b010000, 0b1001, 0, 0, 1,
2004 IIC_VSHLi4D, "vqshrn.u32", v4i16, v4i32, NEONvqshrnu>;
2005def VQSHRNu64 : N2VNSh<1, 1, 0b100000, 0b1001, 0, 0, 1,
2006 IIC_VSHLi4D, "vqshrn.u64", v2i32, v2i64, NEONvqshrnu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002007
2008// VQSHRUN : Vector Saturating Shift Right and Narrow (Unsigned)
David Goodwin36bff0c2009-09-25 18:38:29 +00002009def VQSHRUN16 : N2VNSh<1, 1, 0b001000, 0b1000, 0, 0, 1,
2010 IIC_VSHLi4D, "vqshrun.s16", v8i8, v8i16, NEONvqshrnsu>;
2011def VQSHRUN32 : N2VNSh<1, 1, 0b010000, 0b1000, 0, 0, 1,
2012 IIC_VSHLi4D, "vqshrun.s32", v4i16, v4i32, NEONvqshrnsu>;
2013def VQSHRUN64 : N2VNSh<1, 1, 0b100000, 0b1000, 0, 0, 1,
2014 IIC_VSHLi4D, "vqshrun.s64", v2i32, v2i64, NEONvqshrnsu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002015
2016// VQRSHL : Vector Saturating Rounding Shift
David Goodwin36bff0c2009-09-25 18:38:29 +00002017defm VQRSHLs : N3VInt_QHSD<0, 0, 0b0101, 1, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
2018 IIC_VSHLi4Q, "vqrshl.s", int_arm_neon_vqrshifts, 0>;
2019defm VQRSHLu : N3VInt_QHSD<1, 0, 0b0101, 1, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
2020 IIC_VSHLi4Q, "vqrshl.u", int_arm_neon_vqrshiftu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002021
2022// VQRSHRN : Vector Saturating Rounding Shift Right and Narrow
David Goodwin36bff0c2009-09-25 18:38:29 +00002023def VQRSHRNs16: N2VNSh<0, 1, 0b001000, 0b1001, 0, 1, 1,
2024 IIC_VSHLi4D, "vqrshrn.s16", v8i8, v8i16, NEONvqrshrns>;
2025def VQRSHRNs32: N2VNSh<0, 1, 0b010000, 0b1001, 0, 1, 1,
2026 IIC_VSHLi4D, "vqrshrn.s32", v4i16, v4i32, NEONvqrshrns>;
2027def VQRSHRNs64: N2VNSh<0, 1, 0b100000, 0b1001, 0, 1, 1,
2028 IIC_VSHLi4D, "vqrshrn.s64", v2i32, v2i64, NEONvqrshrns>;
2029def VQRSHRNu16: N2VNSh<1, 1, 0b001000, 0b1001, 0, 1, 1,
2030 IIC_VSHLi4D, "vqrshrn.u16", v8i8, v8i16, NEONvqrshrnu>;
2031def VQRSHRNu32: N2VNSh<1, 1, 0b010000, 0b1001, 0, 1, 1,
2032 IIC_VSHLi4D, "vqrshrn.u32", v4i16, v4i32, NEONvqrshrnu>;
2033def VQRSHRNu64: N2VNSh<1, 1, 0b100000, 0b1001, 0, 1, 1,
2034 IIC_VSHLi4D, "vqrshrn.u64", v2i32, v2i64, NEONvqrshrnu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002035
2036// VQRSHRUN : Vector Saturating Rounding Shift Right and Narrow (Unsigned)
David Goodwin36bff0c2009-09-25 18:38:29 +00002037def VQRSHRUN16: N2VNSh<1, 1, 0b001000, 0b1000, 0, 1, 1,
2038 IIC_VSHLi4D, "vqrshrun.s16", v8i8, v8i16, NEONvqrshrnsu>;
2039def VQRSHRUN32: N2VNSh<1, 1, 0b010000, 0b1000, 0, 1, 1,
2040 IIC_VSHLi4D, "vqrshrun.s32", v4i16, v4i32, NEONvqrshrnsu>;
2041def VQRSHRUN64: N2VNSh<1, 1, 0b100000, 0b1000, 0, 1, 1,
2042 IIC_VSHLi4D, "vqrshrun.s64", v2i32, v2i64, NEONvqrshrnsu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002043
2044// VSRA : Vector Shift Right and Accumulate
2045defm VSRAs : N2VShAdd_QHSD<0, 1, 0b0001, 1, "vsra.s", NEONvshrs>;
2046defm VSRAu : N2VShAdd_QHSD<1, 1, 0b0001, 1, "vsra.u", NEONvshru>;
2047// VRSRA : Vector Rounding Shift Right and Accumulate
2048defm VRSRAs : N2VShAdd_QHSD<0, 1, 0b0011, 1, "vrsra.s", NEONvrshrs>;
2049defm VRSRAu : N2VShAdd_QHSD<1, 1, 0b0011, 1, "vrsra.u", NEONvrshru>;
2050
2051// VSLI : Vector Shift Left and Insert
2052defm VSLI : N2VShIns_QHSD<1, 1, 0b0101, 1, "vsli.", NEONvsli>;
2053// VSRI : Vector Shift Right and Insert
2054defm VSRI : N2VShIns_QHSD<1, 1, 0b0100, 1, "vsri.", NEONvsri>;
2055
2056// Vector Absolute and Saturating Absolute.
2057
2058// VABS : Vector Absolute Value
David Goodwin78caa122009-09-23 21:38:08 +00002059defm VABS : N2VInt_QHS<0b11, 0b11, 0b01, 0b00110, 0,
2060 IIC_VUNAiD, IIC_VUNAiQ, "vabs.s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002061 int_arm_neon_vabs>;
David Goodwin78caa122009-09-23 21:38:08 +00002062def VABSfd : N2VDInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
2063 IIC_VUNAD, "vabs.f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00002064 v2f32, v2f32, int_arm_neon_vabs>;
David Goodwin78caa122009-09-23 21:38:08 +00002065def VABSfq : N2VQInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
2066 IIC_VUNAQ, "vabs.f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00002067 v4f32, v4f32, int_arm_neon_vabs>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002068
2069// VQABS : Vector Saturating Absolute Value
David Goodwin78caa122009-09-23 21:38:08 +00002070defm VQABS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01110, 0,
2071 IIC_VQUNAiD, IIC_VQUNAiQ, "vqabs.s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002072 int_arm_neon_vqabs>;
2073
2074// Vector Negate.
2075
2076def vneg : PatFrag<(ops node:$in), (sub immAllZerosV, node:$in)>;
2077def vneg_conv : PatFrag<(ops node:$in), (sub immAllZerosV_bc, node:$in)>;
2078
2079class VNEGD<bits<2> size, string OpcodeStr, ValueType Ty>
2080 : N2V<0b11, 0b11, size, 0b01, 0b00111, 0, 0, (outs DPR:$dst), (ins DPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002081 IIC_VSHLiD, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002082 [(set DPR:$dst, (Ty (vneg DPR:$src)))]>;
2083class VNEGQ<bits<2> size, string OpcodeStr, ValueType Ty>
2084 : N2V<0b11, 0b11, size, 0b01, 0b00111, 1, 0, (outs QPR:$dst), (ins QPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002085 IIC_VSHLiD, !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002086 [(set QPR:$dst, (Ty (vneg QPR:$src)))]>;
2087
2088// VNEG : Vector Negate
2089def VNEGs8d : VNEGD<0b00, "vneg.s8", v8i8>;
2090def VNEGs16d : VNEGD<0b01, "vneg.s16", v4i16>;
2091def VNEGs32d : VNEGD<0b10, "vneg.s32", v2i32>;
2092def VNEGs8q : VNEGQ<0b00, "vneg.s8", v16i8>;
2093def VNEGs16q : VNEGQ<0b01, "vneg.s16", v8i16>;
2094def VNEGs32q : VNEGQ<0b10, "vneg.s32", v4i32>;
2095
2096// VNEG : Vector Negate (floating-point)
2097def VNEGf32d : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00002098 (outs DPR:$dst), (ins DPR:$src), IIC_VUNAD,
David Goodwincfd67652009-08-06 16:52:47 +00002099 "vneg.f32\t$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002100 [(set DPR:$dst, (v2f32 (fneg DPR:$src)))]>;
2101def VNEGf32q : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 1, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00002102 (outs QPR:$dst), (ins QPR:$src), IIC_VUNAQ,
David Goodwincfd67652009-08-06 16:52:47 +00002103 "vneg.f32\t$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002104 [(set QPR:$dst, (v4f32 (fneg QPR:$src)))]>;
2105
2106def : Pat<(v8i8 (vneg_conv DPR:$src)), (VNEGs8d DPR:$src)>;
2107def : Pat<(v4i16 (vneg_conv DPR:$src)), (VNEGs16d DPR:$src)>;
2108def : Pat<(v2i32 (vneg_conv DPR:$src)), (VNEGs32d DPR:$src)>;
2109def : Pat<(v16i8 (vneg_conv QPR:$src)), (VNEGs8q QPR:$src)>;
2110def : Pat<(v8i16 (vneg_conv QPR:$src)), (VNEGs16q QPR:$src)>;
2111def : Pat<(v4i32 (vneg_conv QPR:$src)), (VNEGs32q QPR:$src)>;
2112
2113// VQNEG : Vector Saturating Negate
David Goodwin78caa122009-09-23 21:38:08 +00002114defm VQNEG : N2VInt_QHS<0b11, 0b11, 0b00, 0b01111, 0,
2115 IIC_VQUNAiD, IIC_VQUNAiQ, "vqneg.s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002116 int_arm_neon_vqneg>;
2117
2118// Vector Bit Counting Operations.
2119
2120// VCLS : Vector Count Leading Sign Bits
David Goodwin78caa122009-09-23 21:38:08 +00002121defm VCLS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01000, 0,
2122 IIC_VCNTiD, IIC_VCNTiQ, "vcls.s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002123 int_arm_neon_vcls>;
2124// VCLZ : Vector Count Leading Zeros
David Goodwin78caa122009-09-23 21:38:08 +00002125defm VCLZ : N2VInt_QHS<0b11, 0b11, 0b00, 0b01001, 0,
2126 IIC_VCNTiD, IIC_VCNTiQ, "vclz.i",
Bob Wilsone60fee02009-06-22 23:27:02 +00002127 int_arm_neon_vclz>;
2128// VCNT : Vector Count One Bits
David Goodwin78caa122009-09-23 21:38:08 +00002129def VCNTd : N2VDInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
2130 IIC_VCNTiD, "vcnt.8",
Bob Wilsone60fee02009-06-22 23:27:02 +00002131 v8i8, v8i8, int_arm_neon_vcnt>;
David Goodwin78caa122009-09-23 21:38:08 +00002132def VCNTq : N2VQInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
2133 IIC_VCNTiQ, "vcnt.8",
Bob Wilsone60fee02009-06-22 23:27:02 +00002134 v16i8, v16i8, int_arm_neon_vcnt>;
2135
2136// Vector Move Operations.
2137
2138// VMOV : Vector Move (Register)
2139
2140def VMOVD : N3V<0, 0, 0b10, 0b0001, 0, 1, (outs DPR:$dst), (ins DPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002141 IIC_VMOVD, "vmov\t$dst, $src", "", []>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002142def VMOVQ : N3V<0, 0, 0b10, 0b0001, 1, 1, (outs QPR:$dst), (ins QPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002143 IIC_VMOVD, "vmov\t$dst, $src", "", []>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002144
2145// VMOV : Vector Move (Immediate)
2146
2147// VMOV_get_imm8 xform function: convert build_vector to VMOV.i8 imm.
2148def VMOV_get_imm8 : SDNodeXForm<build_vector, [{
2149 return ARM::getVMOVImm(N, 1, *CurDAG);
2150}]>;
2151def vmovImm8 : PatLeaf<(build_vector), [{
2152 return ARM::getVMOVImm(N, 1, *CurDAG).getNode() != 0;
2153}], VMOV_get_imm8>;
2154
2155// VMOV_get_imm16 xform function: convert build_vector to VMOV.i16 imm.
2156def VMOV_get_imm16 : SDNodeXForm<build_vector, [{
2157 return ARM::getVMOVImm(N, 2, *CurDAG);
2158}]>;
2159def vmovImm16 : PatLeaf<(build_vector), [{
2160 return ARM::getVMOVImm(N, 2, *CurDAG).getNode() != 0;
2161}], VMOV_get_imm16>;
2162
2163// VMOV_get_imm32 xform function: convert build_vector to VMOV.i32 imm.
2164def VMOV_get_imm32 : SDNodeXForm<build_vector, [{
2165 return ARM::getVMOVImm(N, 4, *CurDAG);
2166}]>;
2167def vmovImm32 : PatLeaf<(build_vector), [{
2168 return ARM::getVMOVImm(N, 4, *CurDAG).getNode() != 0;
2169}], VMOV_get_imm32>;
2170
2171// VMOV_get_imm64 xform function: convert build_vector to VMOV.i64 imm.
2172def VMOV_get_imm64 : SDNodeXForm<build_vector, [{
2173 return ARM::getVMOVImm(N, 8, *CurDAG);
2174}]>;
2175def vmovImm64 : PatLeaf<(build_vector), [{
2176 return ARM::getVMOVImm(N, 8, *CurDAG).getNode() != 0;
2177}], VMOV_get_imm64>;
2178
2179// Note: Some of the cmode bits in the following VMOV instructions need to
2180// be encoded based on the immed values.
2181
2182def VMOVv8i8 : N1ModImm<1, 0b000, 0b1110, 0, 0, 0, 1, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002183 (ins i8imm:$SIMM), IIC_VMOVImm,
David Goodwincfd67652009-08-06 16:52:47 +00002184 "vmov.i8\t$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002185 [(set DPR:$dst, (v8i8 vmovImm8:$SIMM))]>;
2186def VMOVv16i8 : N1ModImm<1, 0b000, 0b1110, 0, 1, 0, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002187 (ins i8imm:$SIMM), IIC_VMOVImm,
David Goodwincfd67652009-08-06 16:52:47 +00002188 "vmov.i8\t$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002189 [(set QPR:$dst, (v16i8 vmovImm8:$SIMM))]>;
2190
2191def VMOVv4i16 : N1ModImm<1, 0b000, 0b1000, 0, 0, 0, 1, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002192 (ins i16imm:$SIMM), IIC_VMOVImm,
David Goodwincfd67652009-08-06 16:52:47 +00002193 "vmov.i16\t$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002194 [(set DPR:$dst, (v4i16 vmovImm16:$SIMM))]>;
2195def VMOVv8i16 : N1ModImm<1, 0b000, 0b1000, 0, 1, 0, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002196 (ins i16imm:$SIMM), IIC_VMOVImm,
David Goodwincfd67652009-08-06 16:52:47 +00002197 "vmov.i16\t$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002198 [(set QPR:$dst, (v8i16 vmovImm16:$SIMM))]>;
2199
2200def VMOVv2i32 : N1ModImm<1, 0b000, 0b0000, 0, 0, 0, 1, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002201 (ins i32imm:$SIMM), IIC_VMOVImm,
David Goodwincfd67652009-08-06 16:52:47 +00002202 "vmov.i32\t$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002203 [(set DPR:$dst, (v2i32 vmovImm32:$SIMM))]>;
2204def VMOVv4i32 : N1ModImm<1, 0b000, 0b0000, 0, 1, 0, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002205 (ins i32imm:$SIMM), IIC_VMOVImm,
David Goodwincfd67652009-08-06 16:52:47 +00002206 "vmov.i32\t$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002207 [(set QPR:$dst, (v4i32 vmovImm32:$SIMM))]>;
2208
2209def VMOVv1i64 : N1ModImm<1, 0b000, 0b1110, 0, 0, 1, 1, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002210 (ins i64imm:$SIMM), IIC_VMOVImm,
David Goodwincfd67652009-08-06 16:52:47 +00002211 "vmov.i64\t$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002212 [(set DPR:$dst, (v1i64 vmovImm64:$SIMM))]>;
2213def VMOVv2i64 : N1ModImm<1, 0b000, 0b1110, 0, 1, 1, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002214 (ins i64imm:$SIMM), IIC_VMOVImm,
David Goodwincfd67652009-08-06 16:52:47 +00002215 "vmov.i64\t$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002216 [(set QPR:$dst, (v2i64 vmovImm64:$SIMM))]>;
2217
2218// VMOV : Vector Get Lane (move scalar to ARM core register)
2219
2220def VGETLNs8 : NVGetLane<0b11100101, 0b1011, 0b00,
Bob Wilson30ff4492009-08-21 21:58:55 +00002221 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +00002222 IIC_VMOVSI, "vmov", ".s8\t$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002223 [(set GPR:$dst, (NEONvgetlanes (v8i8 DPR:$src),
2224 imm:$lane))]>;
2225def VGETLNs16 : NVGetLane<0b11100001, 0b1011, 0b01,
Bob Wilson30ff4492009-08-21 21:58:55 +00002226 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +00002227 IIC_VMOVSI, "vmov", ".s16\t$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002228 [(set GPR:$dst, (NEONvgetlanes (v4i16 DPR:$src),
2229 imm:$lane))]>;
2230def VGETLNu8 : NVGetLane<0b11101101, 0b1011, 0b00,
Bob Wilson30ff4492009-08-21 21:58:55 +00002231 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +00002232 IIC_VMOVSI, "vmov", ".u8\t$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002233 [(set GPR:$dst, (NEONvgetlaneu (v8i8 DPR:$src),
2234 imm:$lane))]>;
2235def VGETLNu16 : NVGetLane<0b11101001, 0b1011, 0b01,
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", ".u16\t$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002238 [(set GPR:$dst, (NEONvgetlaneu (v4i16 DPR:$src),
2239 imm:$lane))]>;
2240def VGETLNi32 : NVGetLane<0b11100001, 0b1011, 0b00,
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", ".32\t$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002243 [(set GPR:$dst, (extractelt (v2i32 DPR:$src),
2244 imm:$lane))]>;
2245// def VGETLNf32: see FMRDH and FMRDL in ARMInstrVFP.td
2246def : Pat<(NEONvgetlanes (v16i8 QPR:$src), imm:$lane),
2247 (VGETLNs8 (v8i8 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002248 (DSubReg_i8_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002249 (SubReg_i8_lane imm:$lane))>;
2250def : Pat<(NEONvgetlanes (v8i16 QPR:$src), imm:$lane),
2251 (VGETLNs16 (v4i16 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002252 (DSubReg_i16_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002253 (SubReg_i16_lane imm:$lane))>;
2254def : Pat<(NEONvgetlaneu (v16i8 QPR:$src), imm:$lane),
2255 (VGETLNu8 (v8i8 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002256 (DSubReg_i8_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002257 (SubReg_i8_lane imm:$lane))>;
2258def : Pat<(NEONvgetlaneu (v8i16 QPR:$src), imm:$lane),
2259 (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002260 (DSubReg_i16_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002261 (SubReg_i16_lane imm:$lane))>;
2262def : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
2263 (VGETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002264 (DSubReg_i32_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002265 (SubReg_i32_lane imm:$lane))>;
Anton Korobeynikov44e0a6c2009-08-28 23:41:26 +00002266def : Pat<(extractelt (v2f32 DPR:$src1), imm:$src2),
Anton Korobeynikov3600d162009-09-12 22:21:08 +00002267 (EXTRACT_SUBREG (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2),
2268 (SSubReg_f32_reg imm:$src2))>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002269def : Pat<(extractelt (v4f32 QPR:$src1), imm:$src2),
Anton Korobeynikov3600d162009-09-12 22:21:08 +00002270 (EXTRACT_SUBREG (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2),
2271 (SSubReg_f32_reg imm:$src2))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002272//def : Pat<(extractelt (v2i64 QPR:$src1), imm:$src2),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002273// (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002274def : Pat<(extractelt (v2f64 QPR:$src1), imm:$src2),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002275 (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002276
2277
2278// VMOV : Vector Set Lane (move ARM core register to scalar)
2279
2280let Constraints = "$src1 = $dst" in {
2281def VSETLNi8 : NVSetLane<0b11100100, 0b1011, 0b00, (outs DPR:$dst),
Bob Wilson30ff4492009-08-21 21:58:55 +00002282 (ins DPR:$src1, GPR:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +00002283 IIC_VMOVISL, "vmov", ".8\t$dst[$lane], $src2",
Bob Wilsone60fee02009-06-22 23:27:02 +00002284 [(set DPR:$dst, (vector_insert (v8i8 DPR:$src1),
2285 GPR:$src2, imm:$lane))]>;
2286def VSETLNi16 : NVSetLane<0b11100000, 0b1011, 0b01, (outs DPR:$dst),
Bob Wilson30ff4492009-08-21 21:58:55 +00002287 (ins DPR:$src1, GPR:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +00002288 IIC_VMOVISL, "vmov", ".16\t$dst[$lane], $src2",
Bob Wilsone60fee02009-06-22 23:27:02 +00002289 [(set DPR:$dst, (vector_insert (v4i16 DPR:$src1),
2290 GPR:$src2, imm:$lane))]>;
2291def VSETLNi32 : NVSetLane<0b11100000, 0b1011, 0b00, (outs DPR:$dst),
Bob Wilson30ff4492009-08-21 21:58:55 +00002292 (ins DPR:$src1, GPR:$src2, nohash_imm:$lane),
David Goodwin36bff0c2009-09-25 18:38:29 +00002293 IIC_VMOVISL, "vmov", ".32\t$dst[$lane], $src2",
Bob Wilsone60fee02009-06-22 23:27:02 +00002294 [(set DPR:$dst, (insertelt (v2i32 DPR:$src1),
2295 GPR:$src2, imm:$lane))]>;
2296}
2297def : Pat<(vector_insert (v16i8 QPR:$src1), GPR:$src2, imm:$lane),
2298 (v16i8 (INSERT_SUBREG QPR:$src1,
2299 (VSETLNi8 (v8i8 (EXTRACT_SUBREG QPR:$src1,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002300 (DSubReg_i8_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002301 GPR:$src2, (SubReg_i8_lane imm:$lane)),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002302 (DSubReg_i8_reg imm:$lane)))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002303def : Pat<(vector_insert (v8i16 QPR:$src1), GPR:$src2, imm:$lane),
2304 (v8i16 (INSERT_SUBREG QPR:$src1,
2305 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002306 (DSubReg_i16_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002307 GPR:$src2, (SubReg_i16_lane imm:$lane)),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002308 (DSubReg_i16_reg imm:$lane)))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002309def : Pat<(insertelt (v4i32 QPR:$src1), GPR:$src2, imm:$lane),
2310 (v4i32 (INSERT_SUBREG QPR:$src1,
2311 (VSETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src1,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002312 (DSubReg_i32_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002313 GPR:$src2, (SubReg_i32_lane imm:$lane)),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002314 (DSubReg_i32_reg imm:$lane)))>;
2315
Anton Korobeynikovd3352772009-08-30 19:06:39 +00002316def : Pat<(v2f32 (insertelt DPR:$src1, SPR:$src2, imm:$src3)),
Anton Korobeynikov3600d162009-09-12 22:21:08 +00002317 (INSERT_SUBREG (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2),
2318 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002319def : Pat<(v4f32 (insertelt QPR:$src1, SPR:$src2, imm:$src3)),
Anton Korobeynikov3600d162009-09-12 22:21:08 +00002320 (INSERT_SUBREG (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2),
2321 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002322
2323//def : Pat<(v2i64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002324// (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002325def : Pat<(v2f64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002326 (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002327
Anton Korobeynikovbaee7b22009-08-27 14:38:44 +00002328def : Pat<(v2f32 (scalar_to_vector SPR:$src)),
2329 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$src, arm_ssubreg_0)>;
2330def : Pat<(v2f64 (scalar_to_vector DPR:$src)),
2331 (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), DPR:$src, arm_dsubreg_0)>;
2332def : Pat<(v4f32 (scalar_to_vector SPR:$src)),
2333 (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), SPR:$src, arm_ssubreg_0)>;
2334
Anton Korobeynikov872393c2009-08-27 16:10:17 +00002335def : Pat<(v8i8 (scalar_to_vector GPR:$src)),
2336 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
2337def : Pat<(v4i16 (scalar_to_vector GPR:$src)),
2338 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
2339def : Pat<(v2i32 (scalar_to_vector GPR:$src)),
2340 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
2341
2342def : Pat<(v16i8 (scalar_to_vector GPR:$src)),
2343 (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)),
2344 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
2345 arm_dsubreg_0)>;
2346def : Pat<(v8i16 (scalar_to_vector GPR:$src)),
2347 (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)),
2348 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
2349 arm_dsubreg_0)>;
2350def : Pat<(v4i32 (scalar_to_vector GPR:$src)),
2351 (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)),
2352 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
2353 arm_dsubreg_0)>;
2354
Bob Wilsone60fee02009-06-22 23:27:02 +00002355// VDUP : Vector Duplicate (from ARM core register to all elements)
2356
Bob Wilsone60fee02009-06-22 23:27:02 +00002357class VDUPD<bits<8> opcod1, bits<2> opcod3, string asmSize, ValueType Ty>
2358 : NVDup<opcod1, 0b1011, opcod3, (outs DPR:$dst), (ins GPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002359 IIC_VMOVIS, "vdup", !strconcat(asmSize, "\t$dst, $src"),
Bob Wilsonf4f1a272009-08-14 05:13:08 +00002360 [(set DPR:$dst, (Ty (NEONvdup (i32 GPR:$src))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002361class VDUPQ<bits<8> opcod1, bits<2> opcod3, string asmSize, ValueType Ty>
2362 : NVDup<opcod1, 0b1011, opcod3, (outs QPR:$dst), (ins GPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002363 IIC_VMOVIS, "vdup", !strconcat(asmSize, "\t$dst, $src"),
Bob Wilsonf4f1a272009-08-14 05:13:08 +00002364 [(set QPR:$dst, (Ty (NEONvdup (i32 GPR:$src))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002365
2366def VDUP8d : VDUPD<0b11101100, 0b00, ".8", v8i8>;
2367def VDUP16d : VDUPD<0b11101000, 0b01, ".16", v4i16>;
2368def VDUP32d : VDUPD<0b11101000, 0b00, ".32", v2i32>;
2369def VDUP8q : VDUPQ<0b11101110, 0b00, ".8", v16i8>;
2370def VDUP16q : VDUPQ<0b11101010, 0b01, ".16", v8i16>;
2371def VDUP32q : VDUPQ<0b11101010, 0b00, ".32", v4i32>;
2372
2373def VDUPfd : NVDup<0b11101000, 0b1011, 0b00, (outs DPR:$dst), (ins GPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002374 IIC_VMOVIS, "vdup", ".32\t$dst, $src",
Bob Wilsonf4f1a272009-08-14 05:13:08 +00002375 [(set DPR:$dst, (v2f32 (NEONvdup
2376 (f32 (bitconvert GPR:$src)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002377def VDUPfq : NVDup<0b11101010, 0b1011, 0b00, (outs QPR:$dst), (ins GPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002378 IIC_VMOVIS, "vdup", ".32\t$dst, $src",
Bob Wilsonf4f1a272009-08-14 05:13:08 +00002379 [(set QPR:$dst, (v4f32 (NEONvdup
2380 (f32 (bitconvert GPR:$src)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002381
2382// VDUP : Vector Duplicate Lane (from scalar to all elements)
2383
Bob Wilsone60fee02009-06-22 23:27:02 +00002384class VDUPLND<bits<2> op19_18, bits<2> op17_16, string OpcodeStr, ValueType Ty>
2385 : N2V<0b11, 0b11, op19_18, op17_16, 0b11000, 0, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00002386 (outs DPR:$dst), (ins DPR:$src, nohash_imm:$lane), IIC_VMOVD,
Anton Korobeynikove2be3382009-08-08 23:10:41 +00002387 !strconcat(OpcodeStr, "\t$dst, $src[$lane]"), "",
Bob Wilson206f6c42009-08-14 05:08:32 +00002388 [(set DPR:$dst, (Ty (NEONvduplane (Ty DPR:$src), imm:$lane)))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002389
Bob Wilsone60fee02009-06-22 23:27:02 +00002390class VDUPLNQ<bits<2> op19_18, bits<2> op17_16, string OpcodeStr,
2391 ValueType ResTy, ValueType OpTy>
2392 : N2V<0b11, 0b11, op19_18, op17_16, 0b11000, 1, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00002393 (outs QPR:$dst), (ins DPR:$src, nohash_imm:$lane), IIC_VMOVD,
Anton Korobeynikove2be3382009-08-08 23:10:41 +00002394 !strconcat(OpcodeStr, "\t$dst, $src[$lane]"), "",
Bob Wilson206f6c42009-08-14 05:08:32 +00002395 [(set QPR:$dst, (ResTy (NEONvduplane (OpTy DPR:$src), imm:$lane)))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002396
2397def VDUPLN8d : VDUPLND<0b00, 0b01, "vdup.8", v8i8>;
2398def VDUPLN16d : VDUPLND<0b00, 0b10, "vdup.16", v4i16>;
2399def VDUPLN32d : VDUPLND<0b01, 0b00, "vdup.32", v2i32>;
2400def VDUPLNfd : VDUPLND<0b01, 0b00, "vdup.32", v2f32>;
2401def VDUPLN8q : VDUPLNQ<0b00, 0b01, "vdup.8", v16i8, v8i8>;
2402def VDUPLN16q : VDUPLNQ<0b00, 0b10, "vdup.16", v8i16, v4i16>;
2403def VDUPLN32q : VDUPLNQ<0b01, 0b00, "vdup.32", v4i32, v2i32>;
2404def VDUPLNfq : VDUPLNQ<0b01, 0b00, "vdup.32", v4f32, v2f32>;
2405
Bob Wilson206f6c42009-08-14 05:08:32 +00002406def : Pat<(v16i8 (NEONvduplane (v16i8 QPR:$src), imm:$lane)),
2407 (v16i8 (VDUPLN8q (v8i8 (EXTRACT_SUBREG QPR:$src,
2408 (DSubReg_i8_reg imm:$lane))),
2409 (SubReg_i8_lane imm:$lane)))>;
2410def : Pat<(v8i16 (NEONvduplane (v8i16 QPR:$src), imm:$lane)),
2411 (v8i16 (VDUPLN16q (v4i16 (EXTRACT_SUBREG QPR:$src,
2412 (DSubReg_i16_reg imm:$lane))),
2413 (SubReg_i16_lane imm:$lane)))>;
2414def : Pat<(v4i32 (NEONvduplane (v4i32 QPR:$src), imm:$lane)),
2415 (v4i32 (VDUPLN32q (v2i32 (EXTRACT_SUBREG QPR:$src,
2416 (DSubReg_i32_reg imm:$lane))),
2417 (SubReg_i32_lane imm:$lane)))>;
2418def : Pat<(v4f32 (NEONvduplane (v4f32 QPR:$src), imm:$lane)),
2419 (v4f32 (VDUPLNfq (v2f32 (EXTRACT_SUBREG QPR:$src,
2420 (DSubReg_i32_reg imm:$lane))),
2421 (SubReg_i32_lane imm:$lane)))>;
2422
Anton Korobeynikov9c913fb2009-08-07 22:36:50 +00002423def VDUPfdf : N2V<0b11, 0b11, 0b01, 0b00, 0b11000, 0, 0,
2424 (outs DPR:$dst), (ins SPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002425 IIC_VMOVD, "vdup.32\t$dst, ${src:lane}", "",
Bob Wilsonf4f1a272009-08-14 05:13:08 +00002426 [(set DPR:$dst, (v2f32 (NEONvdup (f32 SPR:$src))))]>;
Anton Korobeynikov9c913fb2009-08-07 22:36:50 +00002427
2428def VDUPfqf : N2V<0b11, 0b11, 0b01, 0b00, 0b11000, 1, 0,
2429 (outs QPR:$dst), (ins SPR:$src),
David Goodwin36bff0c2009-09-25 18:38:29 +00002430 IIC_VMOVD, "vdup.32\t$dst, ${src:lane}", "",
Bob Wilsonf4f1a272009-08-14 05:13:08 +00002431 [(set QPR:$dst, (v4f32 (NEONvdup (f32 SPR:$src))))]>;
Anton Korobeynikov9c913fb2009-08-07 22:36:50 +00002432
Anton Korobeynikovb261a192009-09-02 21:21:28 +00002433def : Pat<(v2i64 (NEONvduplane (v2i64 QPR:$src), imm:$lane)),
2434 (INSERT_SUBREG QPR:$src,
2435 (i64 (EXTRACT_SUBREG QPR:$src, (DSubReg_f64_reg imm:$lane))),
2436 (DSubReg_f64_other_reg imm:$lane))>;
2437def : Pat<(v2f64 (NEONvduplane (v2f64 QPR:$src), imm:$lane)),
2438 (INSERT_SUBREG QPR:$src,
2439 (f64 (EXTRACT_SUBREG QPR:$src, (DSubReg_f64_reg imm:$lane))),
2440 (DSubReg_f64_other_reg imm:$lane))>;
2441
Bob Wilsone60fee02009-06-22 23:27:02 +00002442// VMOVN : Vector Narrowing Move
David Goodwin78caa122009-09-23 21:38:08 +00002443defm VMOVN : N2VNInt_HSD<0b11,0b11,0b10,0b00100,0,0, IIC_VMOVD, "vmovn.i",
Bob Wilsone60fee02009-06-22 23:27:02 +00002444 int_arm_neon_vmovn>;
2445// VQMOVN : Vector Saturating Narrowing Move
David Goodwin78caa122009-09-23 21:38:08 +00002446defm VQMOVNs : N2VNInt_HSD<0b11,0b11,0b10,0b00101,0,0, IIC_VQUNAiD, "vqmovn.s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002447 int_arm_neon_vqmovns>;
David Goodwin78caa122009-09-23 21:38:08 +00002448defm VQMOVNu : N2VNInt_HSD<0b11,0b11,0b10,0b00101,1,0, IIC_VQUNAiD, "vqmovn.u",
Bob Wilsone60fee02009-06-22 23:27:02 +00002449 int_arm_neon_vqmovnu>;
David Goodwin78caa122009-09-23 21:38:08 +00002450defm VQMOVNsu : N2VNInt_HSD<0b11,0b11,0b10,0b00100,1,0, IIC_VQUNAiD, "vqmovun.s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002451 int_arm_neon_vqmovnsu>;
2452// VMOVL : Vector Lengthening Move
2453defm VMOVLs : N2VLInt_QHS<0,1,0b1010,0,0,1, "vmovl.s", int_arm_neon_vmovls>;
2454defm VMOVLu : N2VLInt_QHS<1,1,0b1010,0,0,1, "vmovl.u", int_arm_neon_vmovlu>;
2455
2456// Vector Conversions.
2457
2458// VCVT : Vector Convert Between Floating-Point and Integers
2459def VCVTf2sd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt.s32.f32",
2460 v2i32, v2f32, fp_to_sint>;
2461def VCVTf2ud : N2VD<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt.u32.f32",
2462 v2i32, v2f32, fp_to_uint>;
2463def VCVTs2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt.f32.s32",
2464 v2f32, v2i32, sint_to_fp>;
2465def VCVTu2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt.f32.u32",
2466 v2f32, v2i32, uint_to_fp>;
2467
2468def VCVTf2sq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt.s32.f32",
2469 v4i32, v4f32, fp_to_sint>;
2470def VCVTf2uq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt.u32.f32",
2471 v4i32, v4f32, fp_to_uint>;
2472def VCVTs2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt.f32.s32",
2473 v4f32, v4i32, sint_to_fp>;
2474def VCVTu2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt.f32.u32",
2475 v4f32, v4i32, uint_to_fp>;
2476
2477// VCVT : Vector Convert Between Floating-Point and Fixed-Point.
2478// Note: Some of the opcode bits in the following VCVT instructions need to
2479// be encoded based on the immed values.
2480def VCVTf2xsd : N2VCvtD<0, 1, 0b000000, 0b1111, 0, 1, "vcvt.s32.f32",
2481 v2i32, v2f32, int_arm_neon_vcvtfp2fxs>;
2482def VCVTf2xud : N2VCvtD<1, 1, 0b000000, 0b1111, 0, 1, "vcvt.u32.f32",
2483 v2i32, v2f32, int_arm_neon_vcvtfp2fxu>;
2484def VCVTxs2fd : N2VCvtD<0, 1, 0b000000, 0b1110, 0, 1, "vcvt.f32.s32",
2485 v2f32, v2i32, int_arm_neon_vcvtfxs2fp>;
2486def VCVTxu2fd : N2VCvtD<1, 1, 0b000000, 0b1110, 0, 1, "vcvt.f32.u32",
2487 v2f32, v2i32, int_arm_neon_vcvtfxu2fp>;
2488
2489def VCVTf2xsq : N2VCvtQ<0, 1, 0b000000, 0b1111, 0, 1, "vcvt.s32.f32",
2490 v4i32, v4f32, int_arm_neon_vcvtfp2fxs>;
2491def VCVTf2xuq : N2VCvtQ<1, 1, 0b000000, 0b1111, 0, 1, "vcvt.u32.f32",
2492 v4i32, v4f32, int_arm_neon_vcvtfp2fxu>;
2493def VCVTxs2fq : N2VCvtQ<0, 1, 0b000000, 0b1110, 0, 1, "vcvt.f32.s32",
2494 v4f32, v4i32, int_arm_neon_vcvtfxs2fp>;
2495def VCVTxu2fq : N2VCvtQ<1, 1, 0b000000, 0b1110, 0, 1, "vcvt.f32.u32",
2496 v4f32, v4i32, int_arm_neon_vcvtfxu2fp>;
2497
Bob Wilson08479272009-08-12 22:31:50 +00002498// Vector Reverse.
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002499
2500// VREV64 : Vector Reverse elements within 64-bit doublewords
2501
2502class VREV64D<bits<2> op19_18, string OpcodeStr, ValueType Ty>
2503 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 0, 0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002504 (ins DPR:$src), IIC_VMOVD,
David Goodwincfd67652009-08-06 16:52:47 +00002505 !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilson08479272009-08-12 22:31:50 +00002506 [(set DPR:$dst, (Ty (NEONvrev64 (Ty DPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002507class VREV64Q<bits<2> op19_18, string OpcodeStr, ValueType Ty>
2508 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 1, 0, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002509 (ins QPR:$src), IIC_VMOVD,
David Goodwincfd67652009-08-06 16:52:47 +00002510 !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilson08479272009-08-12 22:31:50 +00002511 [(set QPR:$dst, (Ty (NEONvrev64 (Ty QPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002512
2513def VREV64d8 : VREV64D<0b00, "vrev64.8", v8i8>;
2514def VREV64d16 : VREV64D<0b01, "vrev64.16", v4i16>;
2515def VREV64d32 : VREV64D<0b10, "vrev64.32", v2i32>;
2516def VREV64df : VREV64D<0b10, "vrev64.32", v2f32>;
2517
2518def VREV64q8 : VREV64Q<0b00, "vrev64.8", v16i8>;
2519def VREV64q16 : VREV64Q<0b01, "vrev64.16", v8i16>;
2520def VREV64q32 : VREV64Q<0b10, "vrev64.32", v4i32>;
2521def VREV64qf : VREV64Q<0b10, "vrev64.32", v4f32>;
2522
2523// VREV32 : Vector Reverse elements within 32-bit words
2524
2525class VREV32D<bits<2> op19_18, string OpcodeStr, ValueType Ty>
2526 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 0, 0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002527 (ins DPR:$src), IIC_VMOVD,
David Goodwincfd67652009-08-06 16:52:47 +00002528 !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilson08479272009-08-12 22:31:50 +00002529 [(set DPR:$dst, (Ty (NEONvrev32 (Ty DPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002530class VREV32Q<bits<2> op19_18, string OpcodeStr, ValueType Ty>
2531 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 1, 0, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002532 (ins QPR:$src), IIC_VMOVD,
David Goodwincfd67652009-08-06 16:52:47 +00002533 !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilson08479272009-08-12 22:31:50 +00002534 [(set QPR:$dst, (Ty (NEONvrev32 (Ty QPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002535
2536def VREV32d8 : VREV32D<0b00, "vrev32.8", v8i8>;
2537def VREV32d16 : VREV32D<0b01, "vrev32.16", v4i16>;
2538
2539def VREV32q8 : VREV32Q<0b00, "vrev32.8", v16i8>;
2540def VREV32q16 : VREV32Q<0b01, "vrev32.16", v8i16>;
2541
2542// VREV16 : Vector Reverse elements within 16-bit halfwords
2543
2544class VREV16D<bits<2> op19_18, string OpcodeStr, ValueType Ty>
2545 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 0, 0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002546 (ins DPR:$src), IIC_VMOVD,
David Goodwincfd67652009-08-06 16:52:47 +00002547 !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilson08479272009-08-12 22:31:50 +00002548 [(set DPR:$dst, (Ty (NEONvrev16 (Ty DPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002549class VREV16Q<bits<2> op19_18, string OpcodeStr, ValueType Ty>
2550 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 1, 0, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002551 (ins QPR:$src), IIC_VMOVD,
David Goodwincfd67652009-08-06 16:52:47 +00002552 !strconcat(OpcodeStr, "\t$dst, $src"), "",
Bob Wilson08479272009-08-12 22:31:50 +00002553 [(set QPR:$dst, (Ty (NEONvrev16 (Ty QPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002554
2555def VREV16d8 : VREV16D<0b00, "vrev16.8", v8i8>;
2556def VREV16q8 : VREV16Q<0b00, "vrev16.8", v16i8>;
2557
Bob Wilson3ac39132009-08-19 17:03:43 +00002558// Other Vector Shuffles.
2559
2560// VEXT : Vector Extract
2561
Anton Korobeynikov6c28c002009-08-21 12:40:21 +00002562class VEXTd<string OpcodeStr, ValueType Ty>
2563 : N3V<0,1,0b11,0b0000,0,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002564 (ins DPR:$lhs, DPR:$rhs, i32imm:$index), IIC_VEXTD,
Anton Korobeynikov6c28c002009-08-21 12:40:21 +00002565 !strconcat(OpcodeStr, "\t$dst, $lhs, $rhs, $index"), "",
2566 [(set DPR:$dst, (Ty (NEONvext (Ty DPR:$lhs),
2567 (Ty DPR:$rhs), imm:$index)))]>;
2568
2569class VEXTq<string OpcodeStr, ValueType Ty>
2570 : N3V<0,1,0b11,0b0000,1,0, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002571 (ins QPR:$lhs, QPR:$rhs, i32imm:$index), IIC_VEXTQ,
Anton Korobeynikov6c28c002009-08-21 12:40:21 +00002572 !strconcat(OpcodeStr, "\t$dst, $lhs, $rhs, $index"), "",
2573 [(set QPR:$dst, (Ty (NEONvext (Ty QPR:$lhs),
2574 (Ty QPR:$rhs), imm:$index)))]>;
2575
2576def VEXTd8 : VEXTd<"vext.8", v8i8>;
2577def VEXTd16 : VEXTd<"vext.16", v4i16>;
2578def VEXTd32 : VEXTd<"vext.32", v2i32>;
2579def VEXTdf : VEXTd<"vext.32", v2f32>;
2580
2581def VEXTq8 : VEXTq<"vext.8", v16i8>;
2582def VEXTq16 : VEXTq<"vext.16", v8i16>;
2583def VEXTq32 : VEXTq<"vext.32", v4i32>;
2584def VEXTqf : VEXTq<"vext.32", v4f32>;
Bob Wilson3ac39132009-08-19 17:03:43 +00002585
Bob Wilson3b169332009-08-08 05:53:00 +00002586// VTRN : Vector Transpose
2587
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +00002588def VTRNd8 : N2VDShuffle<0b00, 0b00001, "vtrn.8">;
2589def VTRNd16 : N2VDShuffle<0b01, 0b00001, "vtrn.16">;
2590def VTRNd32 : N2VDShuffle<0b10, 0b00001, "vtrn.32">;
Bob Wilson3b169332009-08-08 05:53:00 +00002591
David Goodwin78caa122009-09-23 21:38:08 +00002592def VTRNq8 : N2VQShuffle<0b00, 0b00001, IIC_VPERMQ, "vtrn.8">;
2593def VTRNq16 : N2VQShuffle<0b01, 0b00001, IIC_VPERMQ, "vtrn.16">;
2594def VTRNq32 : N2VQShuffle<0b10, 0b00001, IIC_VPERMQ, "vtrn.32">;
Bob Wilson3b169332009-08-08 05:53:00 +00002595
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +00002596// VUZP : Vector Unzip (Deinterleave)
2597
2598def VUZPd8 : N2VDShuffle<0b00, 0b00010, "vuzp.8">;
2599def VUZPd16 : N2VDShuffle<0b01, 0b00010, "vuzp.16">;
2600def VUZPd32 : N2VDShuffle<0b10, 0b00010, "vuzp.32">;
2601
David Goodwin78caa122009-09-23 21:38:08 +00002602def VUZPq8 : N2VQShuffle<0b00, 0b00010, IIC_VPERMQ3, "vuzp.8">;
2603def VUZPq16 : N2VQShuffle<0b01, 0b00010, IIC_VPERMQ3, "vuzp.16">;
2604def VUZPq32 : N2VQShuffle<0b10, 0b00010, IIC_VPERMQ3, "vuzp.32">;
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +00002605
2606// VZIP : Vector Zip (Interleave)
2607
2608def VZIPd8 : N2VDShuffle<0b00, 0b00011, "vzip.8">;
2609def VZIPd16 : N2VDShuffle<0b01, 0b00011, "vzip.16">;
2610def VZIPd32 : N2VDShuffle<0b10, 0b00011, "vzip.32">;
2611
David Goodwin78caa122009-09-23 21:38:08 +00002612def VZIPq8 : N2VQShuffle<0b00, 0b00011, IIC_VPERMQ3, "vzip.8">;
2613def VZIPq16 : N2VQShuffle<0b01, 0b00011, IIC_VPERMQ3, "vzip.16">;
2614def VZIPq32 : N2VQShuffle<0b10, 0b00011, IIC_VPERMQ3, "vzip.32">;
Bob Wilson3b169332009-08-08 05:53:00 +00002615
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002616// Vector Table Lookup and Table Extension.
2617
2618// VTBL : Vector Table Lookup
2619def VTBL1
2620 : N3V<1,1,0b11,0b1000,0,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002621 (ins DPR:$tbl1, DPR:$src), IIC_VTB1,
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002622 "vtbl.8\t$dst, \\{$tbl1\\}, $src", "",
2623 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl1 DPR:$tbl1, DPR:$src)))]>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +00002624let hasExtraSrcRegAllocReq = 1 in {
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002625def VTBL2
2626 : N3V<1,1,0b11,0b1001,0,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002627 (ins DPR:$tbl1, DPR:$tbl2, DPR:$src), IIC_VTB2,
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002628 "vtbl.8\t$dst, \\{$tbl1,$tbl2\\}, $src", "",
2629 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl2
2630 DPR:$tbl1, DPR:$tbl2, DPR:$src)))]>;
2631def VTBL3
2632 : N3V<1,1,0b11,0b1010,0,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002633 (ins DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src), IIC_VTB3,
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002634 "vtbl.8\t$dst, \\{$tbl1,$tbl2,$tbl3\\}, $src", "",
2635 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl3
2636 DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src)))]>;
2637def VTBL4
2638 : N3V<1,1,0b11,0b1011,0,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002639 (ins DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src), IIC_VTB4,
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002640 "vtbl.8\t$dst, \\{$tbl1,$tbl2,$tbl3,$tbl4\\}, $src", "",
2641 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl4 DPR:$tbl1, DPR:$tbl2,
2642 DPR:$tbl3, DPR:$tbl4, DPR:$src)))]>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +00002643} // hasExtraSrcRegAllocReq = 1
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002644
2645// VTBX : Vector Table Extension
2646def VTBX1
2647 : N3V<1,1,0b11,0b1000,1,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002648 (ins DPR:$orig, DPR:$tbl1, DPR:$src), IIC_VTBX1,
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002649 "vtbx.8\t$dst, \\{$tbl1\\}, $src", "$orig = $dst",
2650 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx1
2651 DPR:$orig, DPR:$tbl1, DPR:$src)))]>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +00002652let hasExtraSrcRegAllocReq = 1 in {
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002653def VTBX2
2654 : N3V<1,1,0b11,0b1001,1,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002655 (ins DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$src), IIC_VTBX2,
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002656 "vtbx.8\t$dst, \\{$tbl1,$tbl2\\}, $src", "$orig = $dst",
2657 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx2
2658 DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$src)))]>;
2659def VTBX3
2660 : N3V<1,1,0b11,0b1010,1,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002661 (ins DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src), IIC_VTBX3,
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002662 "vtbx.8\t$dst, \\{$tbl1,$tbl2,$tbl3\\}, $src", "$orig = $dst",
2663 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx3 DPR:$orig, DPR:$tbl1,
2664 DPR:$tbl2, DPR:$tbl3, DPR:$src)))]>;
2665def VTBX4
2666 : N3V<1,1,0b11,0b1011,1,0, (outs DPR:$dst), (ins DPR:$orig, DPR:$tbl1,
David Goodwin36bff0c2009-09-25 18:38:29 +00002667 DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src), IIC_VTBX4,
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002668 "vtbx.8\t$dst, \\{$tbl1,$tbl2,$tbl3,$tbl4\\}, $src", "$orig = $dst",
2669 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx4 DPR:$orig, DPR:$tbl1,
2670 DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src)))]>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +00002671} // hasExtraSrcRegAllocReq = 1
Bob Wilson5ef42ed2009-08-12 20:51:55 +00002672
Bob Wilsone60fee02009-06-22 23:27:02 +00002673//===----------------------------------------------------------------------===//
Evan Cheng46961d82009-08-07 19:30:41 +00002674// NEON instructions for single-precision FP math
2675//===----------------------------------------------------------------------===//
2676
2677// These need separate instructions because they must use DPR_VFP2 register
2678// class which have SPR sub-registers.
2679
2680// Vector Add Operations used for single-precision FP
2681let neverHasSideEffects = 1 in
2682def VADDfd_sfp : N3VDs<0, 0, 0b00, 0b1101, 0, "vadd.f32", v2f32, v2f32, fadd,1>;
2683def : N3VDsPat<fadd, VADDfd_sfp>;
2684
David Goodwin4b358db2009-08-10 22:17:39 +00002685// Vector Sub Operations used for single-precision FP
2686let neverHasSideEffects = 1 in
2687def VSUBfd_sfp : N3VDs<0, 0, 0b10, 0b1101, 0, "vsub.f32", v2f32, v2f32, fsub,0>;
2688def : N3VDsPat<fsub, VSUBfd_sfp>;
2689
Evan Cheng46961d82009-08-07 19:30:41 +00002690// Vector Multiply Operations used for single-precision FP
2691let neverHasSideEffects = 1 in
2692def VMULfd_sfp : N3VDs<1, 0, 0b00, 0b1101, 1, "vmul.f32", v2f32, v2f32, fmul,1>;
2693def : N3VDsPat<fmul, VMULfd_sfp>;
2694
2695// Vector Multiply-Accumulate/Subtract used for single-precision FP
2696let neverHasSideEffects = 1 in
David Goodwin36bff0c2009-09-25 18:38:29 +00002697def VMLAfd_sfp : N3VDMulOps<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla.f32", v2f32,fmul,fadd>;
David Goodwin4b358db2009-08-10 22:17:39 +00002698def : N3VDMulOpsPat<fmul, fadd, VMLAfd_sfp>;
Evan Cheng46961d82009-08-07 19:30:41 +00002699
2700let neverHasSideEffects = 1 in
David Goodwin36bff0c2009-09-25 18:38:29 +00002701def VMLSfd_sfp : N3VDMulOps<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls.f32", v2f32,fmul,fsub>;
David Goodwin4b358db2009-08-10 22:17:39 +00002702def : N3VDMulOpsPat<fmul, fsub, VMLSfd_sfp>;
Evan Cheng46961d82009-08-07 19:30:41 +00002703
David Goodwin4b358db2009-08-10 22:17:39 +00002704// Vector Absolute used for single-precision FP
Evan Cheng46961d82009-08-07 19:30:41 +00002705let neverHasSideEffects = 1 in
David Goodwin78caa122009-09-23 21:38:08 +00002706def VABSfd_sfp : N2VDInts<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
2707 IIC_VUNAD, "vabs.f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00002708 v2f32, v2f32, int_arm_neon_vabs>;
Evan Cheng46961d82009-08-07 19:30:41 +00002709def : N2VDIntsPat<fabs, VABSfd_sfp>;
2710
David Goodwin4b358db2009-08-10 22:17:39 +00002711// Vector Negate used for single-precision FP
Evan Cheng46961d82009-08-07 19:30:41 +00002712let neverHasSideEffects = 1 in
2713def VNEGf32d_sfp : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
David Goodwin78caa122009-09-23 21:38:08 +00002714 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), IIC_VUNAD,
David Goodwin4b358db2009-08-10 22:17:39 +00002715 "vneg.f32\t$dst, $src", "", []>;
Evan Cheng46961d82009-08-07 19:30:41 +00002716def : N2VDIntsPat<fneg, VNEGf32d_sfp>;
2717
David Goodwin4b358db2009-08-10 22:17:39 +00002718// Vector Convert between single-precision FP and integer
2719let neverHasSideEffects = 1 in
2720def VCVTf2sd_sfp : N2VDs<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt.s32.f32",
2721 v2i32, v2f32, fp_to_sint>;
2722def : N2VDsPat<arm_ftosi, f32, v2f32, VCVTf2sd_sfp>;
2723
2724let neverHasSideEffects = 1 in
2725def VCVTf2ud_sfp : N2VDs<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt.u32.f32",
2726 v2i32, v2f32, fp_to_uint>;
2727def : N2VDsPat<arm_ftoui, f32, v2f32, VCVTf2ud_sfp>;
2728
2729let neverHasSideEffects = 1 in
David Goodwin2dc81462009-08-11 01:07:38 +00002730def VCVTs2fd_sfp : N2VDs<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt.f32.s32",
2731 v2f32, v2i32, sint_to_fp>;
David Goodwin4b358db2009-08-10 22:17:39 +00002732def : N2VDsPat<arm_sitof, f32, v2i32, VCVTs2fd_sfp>;
2733
2734let neverHasSideEffects = 1 in
David Goodwin2dc81462009-08-11 01:07:38 +00002735def VCVTu2fd_sfp : N2VDs<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt.f32.u32",
2736 v2f32, v2i32, uint_to_fp>;
David Goodwin4b358db2009-08-10 22:17:39 +00002737def : N2VDsPat<arm_uitof, f32, v2i32, VCVTu2fd_sfp>;
2738
Evan Cheng46961d82009-08-07 19:30:41 +00002739//===----------------------------------------------------------------------===//
Bob Wilsone60fee02009-06-22 23:27:02 +00002740// Non-Instruction Patterns
2741//===----------------------------------------------------------------------===//
2742
2743// bit_convert
2744def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (v1i64 DPR:$src)>;
2745def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (v1i64 DPR:$src)>;
2746def : Pat<(v1i64 (bitconvert (v8i8 DPR:$src))), (v1i64 DPR:$src)>;
2747def : Pat<(v1i64 (bitconvert (f64 DPR:$src))), (v1i64 DPR:$src)>;
2748def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (v1i64 DPR:$src)>;
2749def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (v2i32 DPR:$src)>;
2750def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (v2i32 DPR:$src)>;
2751def : Pat<(v2i32 (bitconvert (v8i8 DPR:$src))), (v2i32 DPR:$src)>;
2752def : Pat<(v2i32 (bitconvert (f64 DPR:$src))), (v2i32 DPR:$src)>;
2753def : Pat<(v2i32 (bitconvert (v2f32 DPR:$src))), (v2i32 DPR:$src)>;
2754def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (v4i16 DPR:$src)>;
2755def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (v4i16 DPR:$src)>;
2756def : Pat<(v4i16 (bitconvert (v8i8 DPR:$src))), (v4i16 DPR:$src)>;
2757def : Pat<(v4i16 (bitconvert (f64 DPR:$src))), (v4i16 DPR:$src)>;
2758def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (v4i16 DPR:$src)>;
2759def : Pat<(v8i8 (bitconvert (v1i64 DPR:$src))), (v8i8 DPR:$src)>;
2760def : Pat<(v8i8 (bitconvert (v2i32 DPR:$src))), (v8i8 DPR:$src)>;
2761def : Pat<(v8i8 (bitconvert (v4i16 DPR:$src))), (v8i8 DPR:$src)>;
2762def : Pat<(v8i8 (bitconvert (f64 DPR:$src))), (v8i8 DPR:$src)>;
2763def : Pat<(v8i8 (bitconvert (v2f32 DPR:$src))), (v8i8 DPR:$src)>;
2764def : Pat<(f64 (bitconvert (v1i64 DPR:$src))), (f64 DPR:$src)>;
2765def : Pat<(f64 (bitconvert (v2i32 DPR:$src))), (f64 DPR:$src)>;
2766def : Pat<(f64 (bitconvert (v4i16 DPR:$src))), (f64 DPR:$src)>;
2767def : Pat<(f64 (bitconvert (v8i8 DPR:$src))), (f64 DPR:$src)>;
2768def : Pat<(f64 (bitconvert (v2f32 DPR:$src))), (f64 DPR:$src)>;
2769def : Pat<(v2f32 (bitconvert (f64 DPR:$src))), (v2f32 DPR:$src)>;
2770def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (v2f32 DPR:$src)>;
2771def : Pat<(v2f32 (bitconvert (v2i32 DPR:$src))), (v2f32 DPR:$src)>;
2772def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (v2f32 DPR:$src)>;
2773def : Pat<(v2f32 (bitconvert (v8i8 DPR:$src))), (v2f32 DPR:$src)>;
2774
2775def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (v2i64 QPR:$src)>;
2776def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (v2i64 QPR:$src)>;
2777def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (v2i64 QPR:$src)>;
2778def : Pat<(v2i64 (bitconvert (v2f64 QPR:$src))), (v2i64 QPR:$src)>;
2779def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (v2i64 QPR:$src)>;
2780def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (v4i32 QPR:$src)>;
2781def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (v4i32 QPR:$src)>;
2782def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (v4i32 QPR:$src)>;
2783def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (v4i32 QPR:$src)>;
2784def : Pat<(v4i32 (bitconvert (v4f32 QPR:$src))), (v4i32 QPR:$src)>;
2785def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (v8i16 QPR:$src)>;
2786def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (v8i16 QPR:$src)>;
2787def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (v8i16 QPR:$src)>;
2788def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (v8i16 QPR:$src)>;
2789def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (v8i16 QPR:$src)>;
2790def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (v16i8 QPR:$src)>;
2791def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (v16i8 QPR:$src)>;
2792def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (v16i8 QPR:$src)>;
2793def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (v16i8 QPR:$src)>;
2794def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (v16i8 QPR:$src)>;
2795def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (v4f32 QPR:$src)>;
2796def : Pat<(v4f32 (bitconvert (v4i32 QPR:$src))), (v4f32 QPR:$src)>;
2797def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (v4f32 QPR:$src)>;
2798def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (v4f32 QPR:$src)>;
2799def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (v4f32 QPR:$src)>;
2800def : Pat<(v2f64 (bitconvert (v2i64 QPR:$src))), (v2f64 QPR:$src)>;
2801def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (v2f64 QPR:$src)>;
2802def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (v2f64 QPR:$src)>;
2803def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (v2f64 QPR:$src)>;
2804def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (v2f64 QPR:$src)>;