blob: 159ffb7378460651ce8bb346a1f8770c19d9d17e [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>,
Bob Wilson1d2c4212010-02-17 00:31:29 +000086 SDTCisSameAs<0, 2>,
87 SDTCisSameAs<0, 3>]>;
Anton Korobeynikov394bbb82009-08-21 12:41:42 +000088def NEONzip : SDNode<"ARMISD::VZIP", SDTARMVSHUF2>;
89def NEONuzp : SDNode<"ARMISD::VUZP", SDTARMVSHUF2>;
90def NEONtrn : SDNode<"ARMISD::VTRN", SDTARMVSHUF2>;
Anton Korobeynikovbe262ae2009-08-21 12:40:50 +000091
Bob Wilsonbc1d2dc2010-02-18 06:05:53 +000092def SDTARMFMAX : SDTypeProfile<1, 2, [SDTCisVT<0, f32>, SDTCisSameAs<0, 1>,
93 SDTCisSameAs<0, 2>]>;
94def NEONfmax : SDNode<"ARMISD::FMAX", SDTARMFMAX>;
95def NEONfmin : SDNode<"ARMISD::FMIN", SDTARMFMAX>;
96
Bob Wilsone60fee02009-06-22 23:27:02 +000097//===----------------------------------------------------------------------===//
98// NEON operand definitions
99//===----------------------------------------------------------------------===//
100
Bob Wilson6a14a002009-11-06 23:33:28 +0000101def h8imm : Operand<i8> {
102 let PrintMethod = "printHex8ImmOperand";
103}
104def h16imm : Operand<i16> {
105 let PrintMethod = "printHex16ImmOperand";
106}
107def h32imm : Operand<i32> {
108 let PrintMethod = "printHex32ImmOperand";
109}
110def h64imm : Operand<i64> {
111 let PrintMethod = "printHex64ImmOperand";
112}
113
Bob Wilsone60fee02009-06-22 23:27:02 +0000114//===----------------------------------------------------------------------===//
115// NEON load / store instructions
116//===----------------------------------------------------------------------===//
117
Bob Wilsone60fee02009-06-22 23:27:02 +0000118// Use vldmia to load a Q register as a D register pair.
Bob Wilson1d2c4212010-02-17 00:31:29 +0000119def VLDRQ : NI4<(outs QPR:$dst), (ins addrmode4:$addr), IIC_fpLoadm,
120 "vldmia", "$addr, ${dst:dregpair}",
121 [(set QPR:$dst, (v2f64 (load addrmode4:$addr)))]> {
Evan Chengdabc6c02009-07-08 22:51:32 +0000122 let Inst{27-25} = 0b110;
123 let Inst{24} = 0; // P bit
124 let Inst{23} = 1; // U bit
125 let Inst{20} = 1;
Johnny Chen6e1b1ad2009-12-01 17:37:06 +0000126 let Inst{11-8} = 0b1011;
Evan Chengdabc6c02009-07-08 22:51:32 +0000127}
Bob Wilsone60fee02009-06-22 23:27:02 +0000128
Bob Wilson66b34002009-08-12 17:04:56 +0000129// Use vstmia to store a Q register as a D register pair.
Bob Wilson1d2c4212010-02-17 00:31:29 +0000130def VSTRQ : NI4<(outs), (ins QPR:$src, addrmode4:$addr), IIC_fpStorem,
131 "vstmia", "$addr, ${src:dregpair}",
132 [(store (v2f64 QPR:$src), addrmode4:$addr)]> {
Bob Wilson66b34002009-08-12 17:04:56 +0000133 let Inst{27-25} = 0b110;
134 let Inst{24} = 0; // P bit
135 let Inst{23} = 1; // U bit
136 let Inst{20} = 0;
Johnny Chen6e1b1ad2009-12-01 17:37:06 +0000137 let Inst{11-8} = 0b1011;
Bob Wilson66b34002009-08-12 17:04:56 +0000138}
139
Bob Wilsoned592c02009-07-08 18:11:30 +0000140// VLD1 : Vector Load (multiple single elements)
Bob Wilson70709822010-03-18 20:18:39 +0000141class VLD1D<bits<4> op7_4, string Dt, ValueType Ty>
Bob Wilsonb1721162009-10-07 21:53:04 +0000142 : NLdSt<0,0b10,0b0111,op7_4, (outs DPR:$dst), (ins addrmode6:$addr), IIC_VLD1,
Bob Wilson70709822010-03-18 20:18:39 +0000143 "vld1", Dt, "\\{$dst\\}, $addr", "",
144 [(set DPR:$dst, (Ty (int_arm_neon_vld1 addrmode6:$addr)))]>;
145class VLD1Q<bits<4> op7_4, string Dt, ValueType Ty>
Bob Wilsonb1721162009-10-07 21:53:04 +0000146 : NLdSt<0,0b10,0b1010,op7_4, (outs QPR:$dst), (ins addrmode6:$addr), IIC_VLD1,
Bob Wilson70709822010-03-18 20:18:39 +0000147 "vld1", Dt, "${dst:dregpair}, $addr", "",
148 [(set QPR:$dst, (Ty (int_arm_neon_vld1 addrmode6:$addr)))]>;
Bob Wilsoned592c02009-07-08 18:11:30 +0000149
Bob Wilson70709822010-03-18 20:18:39 +0000150def VLD1d8 : VLD1D<0b0000, "8", v8i8>;
151def VLD1d16 : VLD1D<0b0100, "16", v4i16>;
152def VLD1d32 : VLD1D<0b1000, "32", v2i32>;
153def VLD1df : VLD1D<0b1000, "32", v2f32>;
154def VLD1d64 : VLD1D<0b1100, "64", v1i64>;
Bob Wilsoned592c02009-07-08 18:11:30 +0000155
Bob Wilson70709822010-03-18 20:18:39 +0000156def VLD1q8 : VLD1Q<0b0000, "8", v16i8>;
157def VLD1q16 : VLD1Q<0b0100, "16", v8i16>;
158def VLD1q32 : VLD1Q<0b1000, "32", v4i32>;
159def VLD1qf : VLD1Q<0b1000, "32", v4f32>;
160def VLD1q64 : VLD1Q<0b1100, "64", v2i64>;
Bob Wilsoned592c02009-07-08 18:11:30 +0000161
Bob Wilson06ce5bf2010-03-20 17:59:03 +0000162let mayLoad = 1 in {
163
164// ...with address register writeback:
165class VLD1DWB<bits<4> op7_4, string Dt>
166 : NLdSt<0,0b10,0b0111,op7_4, (outs DPR:$dst, GPR:$wb),
167 (ins addrmode6:$addr), IIC_VLD1,
168 "vld1", Dt, "\\{$dst\\}, $addr",
169 "$addr.addr = $wb", []>;
170class VLD1QWB<bits<4> op7_4, string Dt>
171 : NLdSt<0,0b10,0b1010,op7_4, (outs QPR:$dst, GPR:$wb),
172 (ins addrmode6:$addr), IIC_VLD1,
173 "vld1", Dt, "${dst:dregpair}, $addr",
174 "$addr.addr = $wb", []>;
175
176def VLD1d8_UPD : VLD1DWB<0b0000, "8">;
177def VLD1d16_UPD : VLD1DWB<0b0100, "16">;
178def VLD1d32_UPD : VLD1DWB<0b1000, "32">;
179def VLD1d64_UPD : VLD1DWB<0b1100, "64">;
180
181def VLD1q8_UPD : VLD1QWB<0b0000, "8">;
182def VLD1q16_UPD : VLD1QWB<0b0100, "16">;
183def VLD1q32_UPD : VLD1QWB<0b1000, "32">;
184def VLD1q64_UPD : VLD1QWB<0b1100, "64">;
185} // mayLoad = 1
186
187let mayLoad = 1, hasExtraDefRegAllocReq = 1 in {
188
Johnny Chen39fb1242010-02-23 20:51:23 +0000189// These (dreg triple/quadruple) are for disassembly only.
Bob Wilson70709822010-03-18 20:18:39 +0000190class VLD1D3<bits<4> op7_4, string Dt>
Bob Wilson15b46a42010-03-20 19:57:03 +0000191 : NLdSt<0,0b10,0b0110,op7_4, (outs DPR:$dst1, DPR:$dst2, DPR:$dst3),
Bob Wilson70709822010-03-18 20:18:39 +0000192 (ins addrmode6:$addr), IIC_VLD1, "vld1", Dt,
Johnny Chen39fb1242010-02-23 20:51:23 +0000193 "\\{$dst1, $dst2, $dst3\\}, $addr", "",
194 [/* For disassembly only; pattern left blank */]>;
Bob Wilson70709822010-03-18 20:18:39 +0000195class VLD1D4<bits<4> op7_4, string Dt>
Johnny Chen39fb1242010-02-23 20:51:23 +0000196 : NLdSt<0,0b10,0b0010,op7_4,(outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4),
Bob Wilson70709822010-03-18 20:18:39 +0000197 (ins addrmode6:$addr), IIC_VLD1, "vld1", Dt,
Johnny Chen39fb1242010-02-23 20:51:23 +0000198 "\\{$dst1, $dst2, $dst3, $dst4\\}, $addr", "",
199 [/* For disassembly only; pattern left blank */]>;
200
Bob Wilson70709822010-03-18 20:18:39 +0000201def VLD1d8T : VLD1D3<0b0000, "8">;
202def VLD1d16T : VLD1D3<0b0100, "16">;
203def VLD1d32T : VLD1D3<0b1000, "32">;
Bob Wilson15b46a42010-03-20 19:57:03 +0000204// VLD1d64T : implemented as VLD3d64
Johnny Chen39fb1242010-02-23 20:51:23 +0000205
Bob Wilson70709822010-03-18 20:18:39 +0000206def VLD1d8Q : VLD1D4<0b0000, "8">;
207def VLD1d16Q : VLD1D4<0b0100, "16">;
208def VLD1d32Q : VLD1D4<0b1000, "32">;
Bob Wilson15b46a42010-03-20 19:57:03 +0000209// VLD1d64Q : implemented as VLD4d64
Johnny Chen39fb1242010-02-23 20:51:23 +0000210
Bob Wilson06ce5bf2010-03-20 17:59:03 +0000211// ...with address register writeback:
212class VLD1D3WB<bits<4> op7_4, string Dt>
213 : NLdSt<0,0b10,0b0110,op7_4, (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, GPR:$wb),
214 (ins addrmode6:$addr), IIC_VLD1, "vld1", Dt,
215 "\\{$dst1, $dst2, $dst3\\}, $addr", "$addr.addr = $wb",
216 [/* For disassembly only; pattern left blank */]>;
217class VLD1D4WB<bits<4> op7_4, string Dt>
218 : NLdSt<0,0b10,0b0010,op7_4,
219 (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
220 (ins addrmode6:$addr), IIC_VLD1, "vld1", Dt,
221 "\\{$dst1, $dst2, $dst3, $dst4\\}, $addr", "$addr.addr = $wb",
222 [/* For disassembly only; pattern left blank */]>;
Johnny Chen39fb1242010-02-23 20:51:23 +0000223
Bob Wilson06ce5bf2010-03-20 17:59:03 +0000224def VLD1d8T_UPD : VLD1D3WB<0b0000, "8">;
225def VLD1d16T_UPD : VLD1D3WB<0b0100, "16">;
226def VLD1d32T_UPD : VLD1D3WB<0b1000, "32">;
227// VLD1d64T_UPD : implemented as VLD3d64_UPD
228
229def VLD1d8Q_UPD : VLD1D4WB<0b0000, "8">;
230def VLD1d16Q_UPD : VLD1D4WB<0b0100, "16">;
231def VLD1d32Q_UPD : VLD1D4WB<0b1000, "32">;
232// VLD1d64Q_UPD : implemented as VLD4d64_UPD
Bob Wilson66b34002009-08-12 17:04:56 +0000233
Bob Wilson055a90d2009-08-05 00:49:09 +0000234// VLD2 : Vector Load (multiple 2-element structures)
Bob Wilson23406942010-03-20 18:14:26 +0000235class VLD2D<bits<4> op11_8, bits<4> op7_4, string Dt>
236 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$dst1, DPR:$dst2),
Bob Wilsonb1721162009-10-07 21:53:04 +0000237 (ins addrmode6:$addr), IIC_VLD2,
Bob Wilson70709822010-03-18 20:18:39 +0000238 "vld2", Dt, "\\{$dst1, $dst2\\}, $addr", "", []>;
239class VLD2Q<bits<4> op7_4, string Dt>
Bob Wilson23406942010-03-20 18:14:26 +0000240 : NLdSt<0, 0b10, 0b0011, op7_4,
Bob Wilsonb1721162009-10-07 21:53:04 +0000241 (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4),
Bob Wilsone9829ca2009-10-06 22:01:59 +0000242 (ins addrmode6:$addr), IIC_VLD2,
Bob Wilson70709822010-03-18 20:18:39 +0000243 "vld2", Dt, "\\{$dst1, $dst2, $dst3, $dst4\\}, $addr", "", []>;
Bob Wilson055a90d2009-08-05 00:49:09 +0000244
Bob Wilson23406942010-03-20 18:14:26 +0000245def VLD2d8 : VLD2D<0b1000, 0b0000, "8">;
246def VLD2d16 : VLD2D<0b1000, 0b0100, "16">;
247def VLD2d32 : VLD2D<0b1000, 0b1000, "32">;
Bob Wilson8c3be582009-10-07 22:57:01 +0000248def VLD2d64 : NLdSt<0,0b10,0b1010,0b1100, (outs DPR:$dst1, DPR:$dst2),
249 (ins addrmode6:$addr), IIC_VLD1,
Bob Wilson82dcfa32010-01-18 01:24:43 +0000250 "vld1", "64", "\\{$dst1, $dst2\\}, $addr", "", []>;
Bob Wilson055a90d2009-08-05 00:49:09 +0000251
Bob Wilson70709822010-03-18 20:18:39 +0000252def VLD2q8 : VLD2Q<0b0000, "8">;
253def VLD2q16 : VLD2Q<0b0100, "16">;
254def VLD2q32 : VLD2Q<0b1000, "32">;
Bob Wilsone9829ca2009-10-06 22:01:59 +0000255
Bob Wilson23406942010-03-20 18:14:26 +0000256// ...with double-spaced registers (for disassembly only):
257def VLD2b8 : VLD2D<0b1001, 0b0000, "8">;
258def VLD2b16 : VLD2D<0b1001, 0b0100, "16">;
259def VLD2b32 : VLD2D<0b1001, 0b1000, "32">;
Johnny Chen39fb1242010-02-23 20:51:23 +0000260
Bob Wilson055a90d2009-08-05 00:49:09 +0000261// VLD3 : Vector Load (multiple 3-element structures)
Bob Wilson23406942010-03-20 18:14:26 +0000262class VLD3D<bits<4> op11_8, bits<4> op7_4, string Dt>
263 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$dst1, DPR:$dst2, DPR:$dst3),
Bob Wilsonb1721162009-10-07 21:53:04 +0000264 (ins addrmode6:$addr), IIC_VLD3,
Bob Wilson70709822010-03-18 20:18:39 +0000265 "vld3", Dt, "\\{$dst1, $dst2, $dst3\\}, $addr", "", []>;
266class VLD3WB<bits<4> op7_4, string Dt>
Bob Wilsonb1721162009-10-07 21:53:04 +0000267 : NLdSt<0,0b10,0b0101,op7_4, (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, GPR:$wb),
Bob Wilsona8b43622009-10-07 17:24:55 +0000268 (ins addrmode6:$addr), IIC_VLD3,
Bob Wilson70709822010-03-18 20:18:39 +0000269 "vld3", Dt, "\\{$dst1, $dst2, $dst3\\}, $addr",
Johnny Chen7c3f3862010-03-17 23:26:50 +0000270 "$addr.addr = $wb", []>;
Bob Wilson055a90d2009-08-05 00:49:09 +0000271
Bob Wilson23406942010-03-20 18:14:26 +0000272def VLD3d8 : VLD3D<0b0100, 0b0000, "8">;
273def VLD3d16 : VLD3D<0b0100, 0b0100, "16">;
274def VLD3d32 : VLD3D<0b0100, 0b1000, "32">;
Bob Wilsonda8cacc2009-10-07 23:39:57 +0000275def VLD3d64 : NLdSt<0,0b10,0b0110,0b1100,
276 (outs DPR:$dst1, DPR:$dst2, DPR:$dst3),
277 (ins addrmode6:$addr), IIC_VLD1,
Bob Wilson82dcfa32010-01-18 01:24:43 +0000278 "vld1", "64", "\\{$dst1, $dst2, $dst3\\}, $addr", "", []>;
Bob Wilson055a90d2009-08-05 00:49:09 +0000279
Bob Wilson23406942010-03-20 18:14:26 +0000280// ...with double-spaced registers:
281def VLD3q8 : VLD3D<0b0101, 0b0000, "8">;
282def VLD3q16 : VLD3D<0b0101, 0b0100, "16">;
283def VLD3q32 : VLD3D<0b0101, 0b1000, "32">;
284
Bob Wilsona8b43622009-10-07 17:24:55 +0000285// vld3 to double-spaced even registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000286def VLD3q8_UPD : VLD3WB<0b0000, "8">;
287def VLD3q16_UPD : VLD3WB<0b0100, "16">;
288def VLD3q32_UPD : VLD3WB<0b1000, "32">;
Bob Wilsona8b43622009-10-07 17:24:55 +0000289
290// vld3 to double-spaced odd registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000291def VLD3q8odd_UPD : VLD3WB<0b0000, "8">;
292def VLD3q16odd_UPD : VLD3WB<0b0100, "16">;
293def VLD3q32odd_UPD : VLD3WB<0b1000, "32">;
Bob Wilsona8b43622009-10-07 17:24:55 +0000294
Bob Wilson055a90d2009-08-05 00:49:09 +0000295// VLD4 : Vector Load (multiple 4-element structures)
Bob Wilson23406942010-03-20 18:14:26 +0000296class VLD4D<bits<4> op11_8, bits<4> op7_4, string Dt>
297 : NLdSt<0, 0b10, op11_8, op7_4,
Bob Wilsonb1721162009-10-07 21:53:04 +0000298 (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4),
David Goodwin78caa122009-09-23 21:38:08 +0000299 (ins addrmode6:$addr), IIC_VLD4,
Bob Wilson70709822010-03-18 20:18:39 +0000300 "vld4", Dt, "\\{$dst1, $dst2, $dst3, $dst4\\}, $addr", "", []>;
301class VLD4WB<bits<4> op7_4, string Dt>
Bob Wilsonb1721162009-10-07 21:53:04 +0000302 : NLdSt<0,0b10,0b0001,op7_4,
303 (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
Bob Wilson004a2e12009-10-07 18:09:32 +0000304 (ins addrmode6:$addr), IIC_VLD4,
Bob Wilson70709822010-03-18 20:18:39 +0000305 "vld4", Dt, "\\{$dst1, $dst2, $dst3, $dst4\\}, $addr",
Johnny Chen7c3f3862010-03-17 23:26:50 +0000306 "$addr.addr = $wb", []>;
Bob Wilson055a90d2009-08-05 00:49:09 +0000307
Bob Wilson23406942010-03-20 18:14:26 +0000308def VLD4d8 : VLD4D<0b0000, 0b0000, "8">;
309def VLD4d16 : VLD4D<0b0000, 0b0100, "16">;
310def VLD4d32 : VLD4D<0b0000, 0b1000, "32">;
Bob Wilson7ce47502009-10-07 23:54:04 +0000311def VLD4d64 : NLdSt<0,0b10,0b0010,0b1100,
312 (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4),
313 (ins addrmode6:$addr), IIC_VLD1,
Bob Wilson82dcfa32010-01-18 01:24:43 +0000314 "vld1", "64", "\\{$dst1, $dst2, $dst3, $dst4\\}, $addr",
315 "", []>;
Bob Wilsond14b8b62009-09-01 04:26:28 +0000316
Bob Wilson23406942010-03-20 18:14:26 +0000317// ...with double-spaced registers:
318def VLD4q8 : VLD4D<0b0001, 0b0000, "8">;
319def VLD4q16 : VLD4D<0b0001, 0b0100, "16">;
320def VLD4q32 : VLD4D<0b0001, 0b1000, "32">;
321
Bob Wilson004a2e12009-10-07 18:09:32 +0000322// vld4 to double-spaced even registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000323def VLD4q8_UPD : VLD4WB<0b0000, "8">;
324def VLD4q16_UPD : VLD4WB<0b0100, "16">;
325def VLD4q32_UPD : VLD4WB<0b1000, "32">;
Bob Wilson004a2e12009-10-07 18:09:32 +0000326
327// vld4 to double-spaced odd registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000328def VLD4q8odd_UPD : VLD4WB<0b0000, "8">;
329def VLD4q16odd_UPD : VLD4WB<0b0100, "16">;
330def VLD4q32odd_UPD : VLD4WB<0b1000, "32">;
Bob Wilsonb1721162009-10-07 21:53:04 +0000331
332// VLD1LN : Vector Load (single element to one lane)
333// FIXME: Not yet implemented.
Bob Wilson004a2e12009-10-07 18:09:32 +0000334
Bob Wilsond14b8b62009-09-01 04:26:28 +0000335// VLD2LN : Vector Load (single 2-element structure to one lane)
Bob Wilson70709822010-03-18 20:18:39 +0000336class VLD2LN<bits<4> op11_8, string Dt>
Johnny Chen46f784e2009-11-23 18:16:16 +0000337 : NLdSt<1,0b10,op11_8,{?,?,?,?}, (outs DPR:$dst1, DPR:$dst2),
Evan Cheng09c61b32009-11-23 21:57:23 +0000338 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, nohash_imm:$lane),
Bob Wilson70709822010-03-18 20:18:39 +0000339 IIC_VLD2, "vld2", Dt, "\\{$dst1[$lane], $dst2[$lane]\\}, $addr",
Evan Cheng09c61b32009-11-23 21:57:23 +0000340 "$src1 = $dst1, $src2 = $dst2", []>;
Bob Wilsond14b8b62009-09-01 04:26:28 +0000341
Johnny Chen9a5dc8b2009-11-19 19:20:17 +0000342// vld2 to single-spaced registers.
Bob Wilson70709822010-03-18 20:18:39 +0000343def VLD2LNd8 : VLD2LN<0b0001, "8">;
344def VLD2LNd16 : VLD2LN<0b0101, "16"> { let Inst{5} = 0; }
345def VLD2LNd32 : VLD2LN<0b1001, "32"> { let Inst{6} = 0; }
Bob Wilson5687d8a2009-10-08 18:56:10 +0000346
347// vld2 to double-spaced even registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000348def VLD2LNq16 : VLD2LN<0b0101, "16"> { let Inst{5} = 1; }
349def VLD2LNq32 : VLD2LN<0b1001, "32"> { let Inst{6} = 1; }
Bob Wilson5687d8a2009-10-08 18:56:10 +0000350
351// vld2 to double-spaced odd registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000352def VLD2LNq16odd : VLD2LN<0b0101, "16"> { let Inst{5} = 1; }
353def VLD2LNq32odd : VLD2LN<0b1001, "32"> { let Inst{6} = 1; }
Bob Wilsond14b8b62009-09-01 04:26:28 +0000354
355// VLD3LN : Vector Load (single 3-element structure to one lane)
Bob Wilson70709822010-03-18 20:18:39 +0000356class VLD3LN<bits<4> op11_8, string Dt>
Johnny Chen46f784e2009-11-23 18:16:16 +0000357 : NLdSt<1,0b10,op11_8,{?,?,?,?}, (outs DPR:$dst1, DPR:$dst2, DPR:$dst3),
Evan Cheng09c61b32009-11-23 21:57:23 +0000358 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3,
Bob Wilson70709822010-03-18 20:18:39 +0000359 nohash_imm:$lane), IIC_VLD3, "vld3", Dt,
Bob Wilson82dcfa32010-01-18 01:24:43 +0000360 "\\{$dst1[$lane], $dst2[$lane], $dst3[$lane]\\}, $addr",
Evan Cheng09c61b32009-11-23 21:57:23 +0000361 "$src1 = $dst1, $src2 = $dst2, $src3 = $dst3", []>;
Bob Wilsond14b8b62009-09-01 04:26:28 +0000362
Johnny Chen9a5dc8b2009-11-19 19:20:17 +0000363// vld3 to single-spaced registers.
Bob Wilson70709822010-03-18 20:18:39 +0000364def VLD3LNd8 : VLD3LN<0b0010, "8"> { let Inst{4} = 0; }
365def VLD3LNd16 : VLD3LN<0b0110, "16"> { let Inst{5-4} = 0b00; }
366def VLD3LNd32 : VLD3LN<0b1010, "32"> { let Inst{6-4} = 0b000; }
Bob Wilson47a1ff62009-10-08 22:27:33 +0000367
368// vld3 to double-spaced even registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000369def VLD3LNq16 : VLD3LN<0b0110, "16"> { let Inst{5-4} = 0b10; }
370def VLD3LNq32 : VLD3LN<0b1010, "32"> { let Inst{6-4} = 0b100; }
Bob Wilson47a1ff62009-10-08 22:27:33 +0000371
372// vld3 to double-spaced odd registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000373def VLD3LNq16odd : VLD3LN<0b0110, "16"> { let Inst{5-4} = 0b10; }
374def VLD3LNq32odd : VLD3LN<0b1010, "32"> { let Inst{6-4} = 0b100; }
Bob Wilsond14b8b62009-09-01 04:26:28 +0000375
376// VLD4LN : Vector Load (single 4-element structure to one lane)
Bob Wilson70709822010-03-18 20:18:39 +0000377class VLD4LN<bits<4> op11_8, string Dt>
Johnny Chen46f784e2009-11-23 18:16:16 +0000378 : NLdSt<1,0b10,op11_8,{?,?,?,?},
Evan Cheng09c61b32009-11-23 21:57:23 +0000379 (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4),
380 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4,
Bob Wilson70709822010-03-18 20:18:39 +0000381 nohash_imm:$lane), IIC_VLD4, "vld4", Dt,
Bob Wilson82dcfa32010-01-18 01:24:43 +0000382 "\\{$dst1[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $addr",
Evan Cheng09c61b32009-11-23 21:57:23 +0000383 "$src1 = $dst1, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4", []>;
Bob Wilsond14b8b62009-09-01 04:26:28 +0000384
Johnny Chen9a5dc8b2009-11-19 19:20:17 +0000385// vld4 to single-spaced registers.
Bob Wilson70709822010-03-18 20:18:39 +0000386def VLD4LNd8 : VLD4LN<0b0011, "8">;
387def VLD4LNd16 : VLD4LN<0b0111, "16"> { let Inst{5} = 0; }
388def VLD4LNd32 : VLD4LN<0b1011, "32"> { let Inst{6} = 0; }
Bob Wilson7a8c6df2009-10-08 22:53:57 +0000389
390// vld4 to double-spaced even registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000391def VLD4LNq16 : VLD4LN<0b0111, "16"> { let Inst{5} = 1; }
392def VLD4LNq32 : VLD4LN<0b1011, "32"> { let Inst{6} = 1; }
Bob Wilson7a8c6df2009-10-08 22:53:57 +0000393
394// vld4 to double-spaced odd registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000395def VLD4LNq16odd : VLD4LN<0b0111, "16"> { let Inst{5} = 1; }
396def VLD4LNq32odd : VLD4LN<0b1011, "32"> { let Inst{6} = 1; }
Bob Wilsonb1721162009-10-07 21:53:04 +0000397
398// VLD1DUP : Vector Load (single element to all lanes)
399// VLD2DUP : Vector Load (single 2-element structure to all lanes)
400// VLD3DUP : Vector Load (single 3-element structure to all lanes)
401// VLD4DUP : Vector Load (single 4-element structure to all lanes)
402// FIXME: Not yet implemented.
Evan Cheng7c8d5ea2009-10-01 08:22:27 +0000403} // mayLoad = 1, hasExtraDefRegAllocReq = 1
Bob Wilsonee27bec2009-08-12 00:49:01 +0000404
Bob Wilson6a209cd2009-08-06 18:47:44 +0000405// VST1 : Vector Store (multiple single elements)
Bob Wilson70709822010-03-18 20:18:39 +0000406class VST1D<bits<4> op7_4, string Dt, ValueType Ty>
Bob Wilsonb1721162009-10-07 21:53:04 +0000407 : NLdSt<0,0b00,0b0111,op7_4, (outs), (ins addrmode6:$addr, DPR:$src), IIC_VST,
Bob Wilson70709822010-03-18 20:18:39 +0000408 "vst1", Dt, "\\{$src\\}, $addr", "",
409 [(int_arm_neon_vst1 addrmode6:$addr, (Ty DPR:$src))]>;
410class VST1Q<bits<4> op7_4, string Dt, ValueType Ty>
Bob Wilsonb1721162009-10-07 21:53:04 +0000411 : NLdSt<0,0b00,0b1010,op7_4, (outs), (ins addrmode6:$addr, QPR:$src), IIC_VST,
Bob Wilson70709822010-03-18 20:18:39 +0000412 "vst1", Dt, "${src:dregpair}, $addr", "",
413 [(int_arm_neon_vst1 addrmode6:$addr, (Ty QPR:$src))]>;
Bob Wilson6a209cd2009-08-06 18:47:44 +0000414
Evan Cheng7c8d5ea2009-10-01 08:22:27 +0000415let hasExtraSrcRegAllocReq = 1 in {
Bob Wilson70709822010-03-18 20:18:39 +0000416def VST1d8 : VST1D<0b0000, "8", v8i8>;
417def VST1d16 : VST1D<0b0100, "16", v4i16>;
418def VST1d32 : VST1D<0b1000, "32", v2i32>;
419def VST1df : VST1D<0b1000, "32", v2f32>;
420def VST1d64 : VST1D<0b1100, "64", v1i64>;
Bob Wilson6a209cd2009-08-06 18:47:44 +0000421
Bob Wilson70709822010-03-18 20:18:39 +0000422def VST1q8 : VST1Q<0b0000, "8", v16i8>;
423def VST1q16 : VST1Q<0b0100, "16", v8i16>;
424def VST1q32 : VST1Q<0b1000, "32", v4i32>;
425def VST1qf : VST1Q<0b1000, "32", v4f32>;
426def VST1q64 : VST1Q<0b1100, "64", v2i64>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +0000427} // hasExtraSrcRegAllocReq
Bob Wilson6a209cd2009-08-06 18:47:44 +0000428
Johnny Chen30c6aeb2010-02-24 02:57:20 +0000429// These (dreg triple/quadruple) are for disassembly only.
Bob Wilson70709822010-03-18 20:18:39 +0000430class VST1D3<bits<4> op7_4, string Dt>
Johnny Chen30c6aeb2010-02-24 02:57:20 +0000431 : NLdSt<0, 0b00, 0b0110, op7_4, (outs),
Bob Wilson15b46a42010-03-20 19:57:03 +0000432 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3),
433 IIC_VST, "vst1", Dt, "\\{$src1, $src2, $src3\\}, $addr", "",
Johnny Chen30c6aeb2010-02-24 02:57:20 +0000434 [/* For disassembly only; pattern left blank */]>;
Bob Wilson70709822010-03-18 20:18:39 +0000435class VST1D4<bits<4> op7_4, string Dt>
Johnny Chen30c6aeb2010-02-24 02:57:20 +0000436 : NLdSt<0, 0b00, 0b0010, op7_4, (outs),
437 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4),
Bob Wilson70709822010-03-18 20:18:39 +0000438 IIC_VST, "vst1", Dt, "\\{$src1, $src2, $src3, $src4\\}, $addr", "",
Johnny Chen30c6aeb2010-02-24 02:57:20 +0000439 [/* For disassembly only; pattern left blank */]>;
440
Bob Wilson70709822010-03-18 20:18:39 +0000441def VST1d8T : VST1D3<0b0000, "8">;
442def VST1d16T : VST1D3<0b0100, "16">;
443def VST1d32T : VST1D3<0b1000, "32">;
Bob Wilson15b46a42010-03-20 19:57:03 +0000444// VST1d64T : implemented as VST3d64
Johnny Chen30c6aeb2010-02-24 02:57:20 +0000445
Bob Wilson70709822010-03-18 20:18:39 +0000446def VST1d8Q : VST1D4<0b0000, "8">;
447def VST1d16Q : VST1D4<0b0100, "16">;
448def VST1d32Q : VST1D4<0b1000, "32">;
Bob Wilson15b46a42010-03-20 19:57:03 +0000449// VST1d64Q : implemented as VST4d64
Johnny Chen30c6aeb2010-02-24 02:57:20 +0000450
Evan Cheng7c8d5ea2009-10-01 08:22:27 +0000451let mayStore = 1, hasExtraSrcRegAllocReq = 1 in {
Bob Wilson66b34002009-08-12 17:04:56 +0000452
Bob Wilson6a209cd2009-08-06 18:47:44 +0000453// VST2 : Vector Store (multiple 2-element structures)
Bob Wilson70709822010-03-18 20:18:39 +0000454class VST2D<bits<4> op7_4, string Dt>
Bob Wilsonb1721162009-10-07 21:53:04 +0000455 : NLdSt<0,0b00,0b1000,op7_4, (outs),
456 (ins addrmode6:$addr, DPR:$src1, DPR:$src2), IIC_VST,
Bob Wilson70709822010-03-18 20:18:39 +0000457 "vst2", Dt, "\\{$src1, $src2\\}, $addr", "", []>;
458class VST2Q<bits<4> op7_4, string Dt>
Bob Wilsonb1721162009-10-07 21:53:04 +0000459 : NLdSt<0,0b00,0b0011,op7_4, (outs),
460 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4),
Bob Wilson70709822010-03-18 20:18:39 +0000461 IIC_VST, "vst2", Dt, "\\{$src1, $src2, $src3, $src4\\}, $addr",
Bob Wilson5fa67d352009-10-07 18:47:39 +0000462 "", []>;
Bob Wilson6a209cd2009-08-06 18:47:44 +0000463
Bob Wilson70709822010-03-18 20:18:39 +0000464def VST2d8 : VST2D<0b0000, "8">;
465def VST2d16 : VST2D<0b0100, "16">;
466def VST2d32 : VST2D<0b1000, "32">;
Bob Wilsondd43d1e2009-10-08 00:21:01 +0000467def VST2d64 : NLdSt<0,0b00,0b1010,0b1100, (outs),
468 (ins addrmode6:$addr, DPR:$src1, DPR:$src2), IIC_VST,
Bob Wilson82dcfa32010-01-18 01:24:43 +0000469 "vst1", "64", "\\{$src1, $src2\\}, $addr", "", []>;
Bob Wilson6a209cd2009-08-06 18:47:44 +0000470
Bob Wilson70709822010-03-18 20:18:39 +0000471def VST2q8 : VST2Q<0b0000, "8">;
472def VST2q16 : VST2Q<0b0100, "16">;
473def VST2q32 : VST2Q<0b1000, "32">;
Bob Wilson5fa67d352009-10-07 18:47:39 +0000474
Johnny Chen30c6aeb2010-02-24 02:57:20 +0000475// These (double-spaced dreg pair) are for disassembly only.
Bob Wilson70709822010-03-18 20:18:39 +0000476class VST2Ddbl<bits<4> op7_4, string Dt>
Johnny Chen30c6aeb2010-02-24 02:57:20 +0000477 : NLdSt<0, 0b00, 0b1001, op7_4, (outs),
478 (ins addrmode6:$addr, DPR:$src1, DPR:$src2), IIC_VST,
Bob Wilson70709822010-03-18 20:18:39 +0000479 "vst2", Dt, "\\{$src1, $src2\\}, $addr", "", []>;
Johnny Chen30c6aeb2010-02-24 02:57:20 +0000480
Bob Wilson70709822010-03-18 20:18:39 +0000481def VST2d8D : VST2Ddbl<0b0000, "8">;
482def VST2d16D : VST2Ddbl<0b0100, "16">;
483def VST2d32D : VST2Ddbl<0b1000, "32">;
Johnny Chen30c6aeb2010-02-24 02:57:20 +0000484
Bob Wilson6a209cd2009-08-06 18:47:44 +0000485// VST3 : Vector Store (multiple 3-element structures)
Bob Wilson70709822010-03-18 20:18:39 +0000486class VST3D<bits<4> op7_4, string Dt>
Bob Wilsonb1721162009-10-07 21:53:04 +0000487 : NLdSt<0,0b00,0b0100,op7_4, (outs),
488 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3), IIC_VST,
Bob Wilson70709822010-03-18 20:18:39 +0000489 "vst3", Dt, "\\{$src1, $src2, $src3\\}, $addr", "", []>;
490class VST3WB<bits<4> op7_4, string Dt>
Bob Wilsonb1721162009-10-07 21:53:04 +0000491 : NLdSt<0,0b00,0b0101,op7_4, (outs GPR:$wb),
492 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3), IIC_VST,
Bob Wilson70709822010-03-18 20:18:39 +0000493 "vst3", Dt, "\\{$src1, $src2, $src3\\}, $addr",
Johnny Chen7c3f3862010-03-17 23:26:50 +0000494 "$addr.addr = $wb", []>;
Bob Wilson6a209cd2009-08-06 18:47:44 +0000495
Bob Wilson70709822010-03-18 20:18:39 +0000496def VST3d8 : VST3D<0b0000, "8">;
497def VST3d16 : VST3D<0b0100, "16">;
498def VST3d32 : VST3D<0b1000, "32">;
Bob Wilson7200e5d2009-10-08 00:28:28 +0000499def VST3d64 : NLdSt<0,0b00,0b0110,0b1100, (outs),
500 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3),
501 IIC_VST,
Bob Wilson82dcfa32010-01-18 01:24:43 +0000502 "vst1", "64", "\\{$src1, $src2, $src3\\}, $addr", "", []>;
Bob Wilson6a209cd2009-08-06 18:47:44 +0000503
Bob Wilson2a85bd12009-10-07 20:30:08 +0000504// vst3 to double-spaced even registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000505def VST3q8_UPD : VST3WB<0b0000, "8">;
506def VST3q16_UPD : VST3WB<0b0100, "16">;
507def VST3q32_UPD : VST3WB<0b1000, "32">;
Bob Wilson2a85bd12009-10-07 20:30:08 +0000508
509// vst3 to double-spaced odd registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000510def VST3q8odd_UPD : VST3WB<0b0000, "8">;
511def VST3q16odd_UPD : VST3WB<0b0100, "16">;
512def VST3q32odd_UPD : VST3WB<0b1000, "32">;
Bob Wilson2a85bd12009-10-07 20:30:08 +0000513
Bob Wilson6a209cd2009-08-06 18:47:44 +0000514// VST4 : Vector Store (multiple 4-element structures)
Bob Wilson70709822010-03-18 20:18:39 +0000515class VST4D<bits<4> op7_4, string Dt>
Bob Wilsonb1721162009-10-07 21:53:04 +0000516 : NLdSt<0,0b00,0b0000,op7_4, (outs),
517 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4),
Bob Wilson70709822010-03-18 20:18:39 +0000518 IIC_VST, "vst4", Dt, "\\{$src1, $src2, $src3, $src4\\}, $addr",
Bob Wilson316062a2009-08-25 17:46:06 +0000519 "", []>;
Bob Wilson70709822010-03-18 20:18:39 +0000520class VST4WB<bits<4> op7_4, string Dt>
Bob Wilsonb1721162009-10-07 21:53:04 +0000521 : NLdSt<0,0b00,0b0001,op7_4, (outs GPR:$wb),
522 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4),
Bob Wilson70709822010-03-18 20:18:39 +0000523 IIC_VST, "vst4", Dt, "\\{$src1, $src2, $src3, $src4\\}, $addr",
Johnny Chen7c3f3862010-03-17 23:26:50 +0000524 "$addr.addr = $wb", []>;
Bob Wilson6a209cd2009-08-06 18:47:44 +0000525
Bob Wilson70709822010-03-18 20:18:39 +0000526def VST4d8 : VST4D<0b0000, "8">;
527def VST4d16 : VST4D<0b0100, "16">;
528def VST4d32 : VST4D<0b1000, "32">;
Bob Wilson94b5d432009-10-08 05:18:18 +0000529def VST4d64 : NLdSt<0,0b00,0b0010,0b1100, (outs),
530 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3,
531 DPR:$src4), IIC_VST,
Bob Wilson82dcfa32010-01-18 01:24:43 +0000532 "vst1", "64", "\\{$src1, $src2, $src3, $src4\\}, $addr",
533 "", []>;
Bob Wilsonc2d65852009-09-01 18:51:56 +0000534
Bob Wilson931c76b2009-10-07 20:49:18 +0000535// vst4 to double-spaced even registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000536def VST4q8_UPD : VST4WB<0b0000, "8">;
537def VST4q16_UPD : VST4WB<0b0100, "16">;
538def VST4q32_UPD : VST4WB<0b1000, "32">;
Bob Wilson931c76b2009-10-07 20:49:18 +0000539
540// vst4 to double-spaced odd registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000541def VST4q8odd_UPD : VST4WB<0b0000, "8">;
542def VST4q16odd_UPD : VST4WB<0b0100, "16">;
543def VST4q32odd_UPD : VST4WB<0b1000, "32">;
Bob Wilsonb1721162009-10-07 21:53:04 +0000544
545// VST1LN : Vector Store (single element from one lane)
546// FIXME: Not yet implemented.
Bob Wilson931c76b2009-10-07 20:49:18 +0000547
Bob Wilsonc2d65852009-09-01 18:51:56 +0000548// VST2LN : Vector Store (single 2-element structure from one lane)
Bob Wilson70709822010-03-18 20:18:39 +0000549class VST2LN<bits<4> op11_8, string Dt>
Johnny Chen46f784e2009-11-23 18:16:16 +0000550 : NLdSt<1,0b00,op11_8,{?,?,?,?}, (outs),
Bob Wilson1d2c4212010-02-17 00:31:29 +0000551 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, nohash_imm:$lane),
Bob Wilson70709822010-03-18 20:18:39 +0000552 IIC_VST, "vst2", Dt, "\\{$src1[$lane], $src2[$lane]\\}, $addr",
Bob Wilson1d2c4212010-02-17 00:31:29 +0000553 "", []>;
Bob Wilsonc2d65852009-09-01 18:51:56 +0000554
Johnny Chen9a5dc8b2009-11-19 19:20:17 +0000555// vst2 to single-spaced registers.
Bob Wilson70709822010-03-18 20:18:39 +0000556def VST2LNd8 : VST2LN<0b0001, "8">;
557def VST2LNd16 : VST2LN<0b0101, "16"> { let Inst{5} = 0; }
558def VST2LNd32 : VST2LN<0b1001, "32"> { let Inst{6} = 0; }
Bob Wilson18e94a72009-10-08 23:38:24 +0000559
560// vst2 to double-spaced even registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000561def VST2LNq16 : VST2LN<0b0101, "16"> { let Inst{5} = 1; }
562def VST2LNq32 : VST2LN<0b1001, "32"> { let Inst{6} = 1; }
Bob Wilson18e94a72009-10-08 23:38:24 +0000563
564// vst2 to double-spaced odd registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000565def VST2LNq16odd : VST2LN<0b0101, "16"> { let Inst{5} = 1; }
566def VST2LNq32odd : VST2LN<0b1001, "32"> { let Inst{6} = 1; }
Bob Wilsonc2d65852009-09-01 18:51:56 +0000567
568// VST3LN : Vector Store (single 3-element structure from one lane)
Bob Wilson70709822010-03-18 20:18:39 +0000569class VST3LN<bits<4> op11_8, string Dt>
Johnny Chen46f784e2009-11-23 18:16:16 +0000570 : NLdSt<1,0b00,op11_8,{?,?,?,?}, (outs),
Bob Wilson1d2c4212010-02-17 00:31:29 +0000571 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3,
Bob Wilson70709822010-03-18 20:18:39 +0000572 nohash_imm:$lane), IIC_VST, "vst3", Dt,
Bob Wilson1d2c4212010-02-17 00:31:29 +0000573 "\\{$src1[$lane], $src2[$lane], $src3[$lane]\\}, $addr", "", []>;
Bob Wilsonc2d65852009-09-01 18:51:56 +0000574
Johnny Chen9a5dc8b2009-11-19 19:20:17 +0000575// vst3 to single-spaced registers.
Bob Wilson70709822010-03-18 20:18:39 +0000576def VST3LNd8 : VST3LN<0b0010, "8"> { let Inst{4} = 0; }
577def VST3LNd16 : VST3LN<0b0110, "16"> { let Inst{5-4} = 0b00; }
578def VST3LNd32 : VST3LN<0b1010, "32"> { let Inst{6-4} = 0b000; }
Bob Wilsondbffb212009-10-08 23:51:31 +0000579
580// vst3 to double-spaced even registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000581def VST3LNq16 : VST3LN<0b0110, "16"> { let Inst{5-4} = 0b10; }
582def VST3LNq32 : VST3LN<0b1010, "32"> { let Inst{6-4} = 0b100; }
Bob Wilsondbffb212009-10-08 23:51:31 +0000583
584// vst3 to double-spaced odd registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000585def VST3LNq16odd : VST3LN<0b0110, "16"> { let Inst{5-4} = 0b10; }
586def VST3LNq32odd : VST3LN<0b1010, "32"> { let Inst{6-4} = 0b100; }
Bob Wilsonc2d65852009-09-01 18:51:56 +0000587
588// VST4LN : Vector Store (single 4-element structure from one lane)
Bob Wilson70709822010-03-18 20:18:39 +0000589class VST4LN<bits<4> op11_8, string Dt>
Johnny Chen46f784e2009-11-23 18:16:16 +0000590 : NLdSt<1,0b00,op11_8,{?,?,?,?}, (outs),
Bob Wilson1d2c4212010-02-17 00:31:29 +0000591 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4,
Bob Wilson70709822010-03-18 20:18:39 +0000592 nohash_imm:$lane), IIC_VST, "vst4", Dt,
Bob Wilson82dcfa32010-01-18 01:24:43 +0000593 "\\{$src1[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $addr",
Bob Wilson1d2c4212010-02-17 00:31:29 +0000594 "", []>;
Bob Wilsonc2d65852009-09-01 18:51:56 +0000595
Johnny Chen9a5dc8b2009-11-19 19:20:17 +0000596// vst4 to single-spaced registers.
Bob Wilson70709822010-03-18 20:18:39 +0000597def VST4LNd8 : VST4LN<0b0011, "8">;
598def VST4LNd16 : VST4LN<0b0111, "16"> { let Inst{5} = 0; }
599def VST4LNd32 : VST4LN<0b1011, "32"> { let Inst{6} = 0; }
Bob Wilsonc7692e02009-10-09 00:01:36 +0000600
601// vst4 to double-spaced even registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000602def VST4LNq16 : VST4LN<0b0111, "16"> { let Inst{5} = 1; }
603def VST4LNq32 : VST4LN<0b1011, "32"> { let Inst{6} = 1; }
Bob Wilsonc7692e02009-10-09 00:01:36 +0000604
605// vst4 to double-spaced odd registers.
Bob Wilson14e26b32010-03-20 18:35:24 +0000606def VST4LNq16odd : VST4LN<0b0111, "16"> { let Inst{5} = 1; }
607def VST4LNq32odd : VST4LN<0b1011, "32"> { let Inst{6} = 1; }
Bob Wilsonc7692e02009-10-09 00:01:36 +0000608
Evan Cheng7c8d5ea2009-10-01 08:22:27 +0000609} // mayStore = 1, hasExtraSrcRegAllocReq = 1
Bob Wilson6a209cd2009-08-06 18:47:44 +0000610
Bob Wilsoned592c02009-07-08 18:11:30 +0000611
Bob Wilsone60fee02009-06-22 23:27:02 +0000612//===----------------------------------------------------------------------===//
613// NEON pattern fragments
614//===----------------------------------------------------------------------===//
615
616// Extract D sub-registers of Q registers.
617// (arm_dsubreg_0 is 5; arm_dsubreg_1 is 6)
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000618def DSubReg_i8_reg : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000619 return CurDAG->getTargetConstant(5 + N->getZExtValue() / 8, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000620}]>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000621def DSubReg_i16_reg : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000622 return CurDAG->getTargetConstant(5 + N->getZExtValue() / 4, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000623}]>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000624def DSubReg_i32_reg : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000625 return CurDAG->getTargetConstant(5 + N->getZExtValue() / 2, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000626}]>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000627def DSubReg_f64_reg : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000628 return CurDAG->getTargetConstant(5 + N->getZExtValue(), MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000629}]>;
Anton Korobeynikovb261a192009-09-02 21:21:28 +0000630def DSubReg_f64_other_reg : SDNodeXForm<imm, [{
631 return CurDAG->getTargetConstant(5 + (1 - N->getZExtValue()), MVT::i32);
632}]>;
Bob Wilsone60fee02009-06-22 23:27:02 +0000633
Anton Korobeynikov44e0a6c2009-08-28 23:41:26 +0000634// Extract S sub-registers of Q/D registers.
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000635// (arm_ssubreg_0 is 1; arm_ssubreg_1 is 2; etc.)
636def SSubReg_f32_reg : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000637 return CurDAG->getTargetConstant(1 + N->getZExtValue(), MVT::i32);
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000638}]>;
639
Bob Wilsone60fee02009-06-22 23:27:02 +0000640// Translate lane numbers from Q registers to D subregs.
641def SubReg_i8_lane : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000642 return CurDAG->getTargetConstant(N->getZExtValue() & 7, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000643}]>;
644def SubReg_i16_lane : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000645 return CurDAG->getTargetConstant(N->getZExtValue() & 3, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000646}]>;
647def SubReg_i32_lane : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000648 return CurDAG->getTargetConstant(N->getZExtValue() & 1, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000649}]>;
650
651//===----------------------------------------------------------------------===//
652// Instruction Classes
653//===----------------------------------------------------------------------===//
654
Bob Wilson154999f2010-02-17 22:23:11 +0000655// Basic 2-register operations: single-, double- and quad-register.
656class N2VS<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
657 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
658 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
659 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
660 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src),
661 IIC_VUNAD, OpcodeStr, Dt, "$dst, $src", "", []>;
Bob Wilsone60fee02009-06-22 23:27:02 +0000662class N2VD<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
Bob Wilson154999f2010-02-17 22:23:11 +0000663 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
664 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
Bob Wilsone60fee02009-06-22 23:27:02 +0000665 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
Evan Cheng09c61b32009-11-23 21:57:23 +0000666 (ins DPR:$src), IIC_VUNAD, OpcodeStr, Dt, "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000667 [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src))))]>;
668class N2VQ<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
Bob Wilson154999f2010-02-17 22:23:11 +0000669 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
670 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
Bob Wilsone60fee02009-06-22 23:27:02 +0000671 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
Evan Cheng09c61b32009-11-23 21:57:23 +0000672 (ins QPR:$src), IIC_VUNAQ, OpcodeStr, Dt, "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000673 [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src))))]>;
674
Bob Wilson7c7fe6e2010-02-17 22:42:54 +0000675// Basic 2-register intrinsics, both double- and quad-register.
Bob Wilsone60fee02009-06-22 23:27:02 +0000676class N2VDInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
David Goodwin78caa122009-09-23 21:38:08 +0000677 bits<2> op17_16, bits<5> op11_7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000678 InstrItinClass itin, string OpcodeStr, string Dt,
Bob Wilsone60fee02009-06-22 23:27:02 +0000679 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
680 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
Evan Cheng09c61b32009-11-23 21:57:23 +0000681 (ins DPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000682 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src))))]>;
683class N2VQInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
David Goodwin78caa122009-09-23 21:38:08 +0000684 bits<2> op17_16, bits<5> op11_7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000685 InstrItinClass itin, string OpcodeStr, string Dt,
Bob Wilsone60fee02009-06-22 23:27:02 +0000686 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
687 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
Evan Cheng09c61b32009-11-23 21:57:23 +0000688 (ins QPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000689 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src))))]>;
690
691// Narrow 2-register intrinsics.
692class N2VNInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
693 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000694 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin78caa122009-09-23 21:38:08 +0000695 ValueType TyD, ValueType TyQ, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +0000696 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$dst),
Evan Cheng09c61b32009-11-23 21:57:23 +0000697 (ins QPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000698 [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src))))]>;
699
Bob Wilson52e0d9d2009-10-21 02:15:46 +0000700// Long 2-register intrinsics (currently only used for VMOVL).
701class N2VLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
702 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000703 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin78caa122009-09-23 21:38:08 +0000704 ValueType TyQ, ValueType TyD, Intrinsic IntOp>
Bob Wilson52e0d9d2009-10-21 02:15:46 +0000705 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$dst),
Evan Cheng09c61b32009-11-23 21:57:23 +0000706 (ins DPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000707 [(set QPR:$dst, (TyQ (IntOp (TyD DPR:$src))))]>;
708
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +0000709// 2-register shuffles (VTRN/VZIP/VUZP), both double- and quad-register.
Evan Cheng09c61b32009-11-23 21:57:23 +0000710class N2VDShuffle<bits<2> op19_18, bits<5> op11_7, string OpcodeStr, string Dt>
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +0000711 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 0, 0, (outs DPR:$dst1, DPR:$dst2),
David Goodwin78caa122009-09-23 21:38:08 +0000712 (ins DPR:$src1, DPR:$src2), IIC_VPERMD,
Evan Cheng09c61b32009-11-23 21:57:23 +0000713 OpcodeStr, Dt, "$dst1, $dst2",
Johnny Chen7c3f3862010-03-17 23:26:50 +0000714 "$src1 = $dst1, $src2 = $dst2", []>;
David Goodwin78caa122009-09-23 21:38:08 +0000715class N2VQShuffle<bits<2> op19_18, bits<5> op11_7,
Evan Cheng09c61b32009-11-23 21:57:23 +0000716 InstrItinClass itin, string OpcodeStr, string Dt>
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +0000717 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 1, 0, (outs QPR:$dst1, QPR:$dst2),
Bob Wilson1d2c4212010-02-17 00:31:29 +0000718 (ins QPR:$src1, QPR:$src2), itin, OpcodeStr, Dt, "$dst1, $dst2",
Johnny Chen7c3f3862010-03-17 23:26:50 +0000719 "$src1 = $dst1, $src2 = $dst2", []>;
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +0000720
Bob Wilson154999f2010-02-17 22:23:11 +0000721// Basic 3-register operations: single-, double- and quad-register.
722class N3VS<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
723 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
724 SDNode OpNode, bit Commutable>
725 : N3V<op24, op23, op21_20, op11_8, 0, op4,
726 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src1, DPR_VFP2:$src2), IIC_VBIND,
727 OpcodeStr, Dt, "$dst, $src1, $src2", "", []> {
728 let isCommutable = Commutable;
729}
730
Bob Wilsone60fee02009-06-22 23:27:02 +0000731class N3VD<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000732 InstrItinClass itin, string OpcodeStr, string Dt,
Bob Wilson1d2c4212010-02-17 00:31:29 +0000733 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
Bob Wilsone60fee02009-06-22 23:27:02 +0000734 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin78caa122009-09-23 21:38:08 +0000735 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000736 OpcodeStr, Dt, "$dst, $src1, $src2", "",
737 [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src1), (OpTy DPR:$src2))))]> {
738 let isCommutable = Commutable;
739}
740// Same as N3VD but no data type.
741class N3VDX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
742 InstrItinClass itin, string OpcodeStr,
743 ValueType ResTy, ValueType OpTy,
744 SDNode OpNode, bit Commutable>
745 : N3VX<op24, op23, op21_20, op11_8, 0, op4,
Bob Wilson1d2c4212010-02-17 00:31:29 +0000746 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), itin,
747 OpcodeStr, "$dst, $src1, $src2", "",
748 [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src1), (OpTy DPR:$src2))))]>{
Bob Wilsone60fee02009-06-22 23:27:02 +0000749 let isCommutable = Commutable;
750}
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000751class N3VDSL<bits<2> op21_20, bits<4> op11_8,
Evan Cheng09c61b32009-11-23 21:57:23 +0000752 InstrItinClass itin, string OpcodeStr, string Dt,
753 ValueType Ty, SDNode ShOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000754 : N3V<0, 1, op21_20, op11_8, 1, 0,
755 (outs DPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +0000756 itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000757 [(set (Ty DPR:$dst),
758 (Ty (ShOp (Ty DPR:$src1),
Bob Wilson1d2c4212010-02-17 00:31:29 +0000759 (Ty (NEONvduplane (Ty DPR_VFP2:$src2), imm:$lane)))))]>{
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000760 let isCommutable = 0;
761}
762class N3VDSL16<bits<2> op21_20, bits<4> op11_8,
Evan Cheng09c61b32009-11-23 21:57:23 +0000763 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000764 : N3V<0, 1, op21_20, op11_8, 1, 0,
765 (outs DPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
Bob Wilson1d2c4212010-02-17 00:31:29 +0000766 IIC_VMULi16D, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000767 [(set (Ty DPR:$dst),
768 (Ty (ShOp (Ty DPR:$src1),
Bob Wilson1d2c4212010-02-17 00:31:29 +0000769 (Ty (NEONvduplane (Ty DPR_8:$src2), imm:$lane)))))]> {
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000770 let isCommutable = 0;
771}
772
Bob Wilsone60fee02009-06-22 23:27:02 +0000773class N3VQ<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000774 InstrItinClass itin, string OpcodeStr, string Dt,
Bob Wilson1d2c4212010-02-17 00:31:29 +0000775 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
Bob Wilsone60fee02009-06-22 23:27:02 +0000776 : N3V<op24, op23, op21_20, op11_8, 1, op4,
David Goodwin78caa122009-09-23 21:38:08 +0000777 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000778 OpcodeStr, Dt, "$dst, $src1, $src2", "",
779 [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src1), (OpTy QPR:$src2))))]> {
780 let isCommutable = Commutable;
781}
782class N3VQX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
783 InstrItinClass itin, string OpcodeStr,
Bob Wilson1d2c4212010-02-17 00:31:29 +0000784 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
Evan Cheng09c61b32009-11-23 21:57:23 +0000785 : N3VX<op24, op23, op21_20, op11_8, 1, op4,
Bob Wilson1d2c4212010-02-17 00:31:29 +0000786 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), itin,
787 OpcodeStr, "$dst, $src1, $src2", "",
788 [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src1), (OpTy QPR:$src2))))]>{
Bob Wilsone60fee02009-06-22 23:27:02 +0000789 let isCommutable = Commutable;
790}
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000791class N3VQSL<bits<2> op21_20, bits<4> op11_8,
Evan Cheng09c61b32009-11-23 21:57:23 +0000792 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin36bff0c2009-09-25 18:38:29 +0000793 ValueType ResTy, ValueType OpTy, SDNode ShOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000794 : N3V<1, 1, op21_20, op11_8, 1, 0,
795 (outs QPR:$dst), (ins QPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +0000796 itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000797 [(set (ResTy QPR:$dst),
798 (ResTy (ShOp (ResTy QPR:$src1),
799 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src2),
800 imm:$lane)))))]> {
801 let isCommutable = 0;
802}
Bob Wilson1d2c4212010-02-17 00:31:29 +0000803class N3VQSL16<bits<2> op21_20, bits<4> op11_8, string OpcodeStr, string Dt,
Evan Cheng09c61b32009-11-23 21:57:23 +0000804 ValueType ResTy, ValueType OpTy, SDNode ShOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000805 : N3V<1, 1, op21_20, op11_8, 1, 0,
806 (outs QPR:$dst), (ins QPR:$src1, DPR_8:$src2, nohash_imm:$lane),
Bob Wilson1d2c4212010-02-17 00:31:29 +0000807 IIC_VMULi16Q, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000808 [(set (ResTy QPR:$dst),
809 (ResTy (ShOp (ResTy QPR:$src1),
810 (ResTy (NEONvduplane (OpTy DPR_8:$src2),
811 imm:$lane)))))]> {
812 let isCommutable = 0;
813}
Bob Wilsone60fee02009-06-22 23:27:02 +0000814
815// Basic 3-register intrinsics, both double- and quad-register.
816class N3VDInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000817 InstrItinClass itin, string OpcodeStr, string Dt,
Bob Wilson1d2c4212010-02-17 00:31:29 +0000818 ValueType ResTy, ValueType OpTy, Intrinsic IntOp, bit Commutable>
Bob Wilsone60fee02009-06-22 23:27:02 +0000819 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000820 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000821 OpcodeStr, Dt, "$dst, $src1, $src2", "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000822 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src1), (OpTy DPR:$src2))))]> {
823 let isCommutable = Commutable;
824}
David Goodwin36bff0c2009-09-25 18:38:29 +0000825class N3VDIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000826 string OpcodeStr, string Dt, ValueType Ty, Intrinsic IntOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000827 : N3V<0, 1, op21_20, op11_8, 1, 0,
828 (outs DPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +0000829 itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000830 [(set (Ty DPR:$dst),
831 (Ty (IntOp (Ty DPR:$src1),
832 (Ty (NEONvduplane (Ty DPR_VFP2:$src2),
833 imm:$lane)))))]> {
834 let isCommutable = 0;
835}
David Goodwin36bff0c2009-09-25 18:38:29 +0000836class N3VDIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000837 string OpcodeStr, string Dt, ValueType Ty, Intrinsic IntOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000838 : N3V<0, 1, op21_20, op11_8, 1, 0,
839 (outs DPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +0000840 itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000841 [(set (Ty DPR:$dst),
842 (Ty (IntOp (Ty DPR:$src1),
843 (Ty (NEONvduplane (Ty DPR_8:$src2),
844 imm:$lane)))))]> {
845 let isCommutable = 0;
846}
847
Bob Wilsone60fee02009-06-22 23:27:02 +0000848class N3VQInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000849 InstrItinClass itin, string OpcodeStr, string Dt,
Bob Wilson1d2c4212010-02-17 00:31:29 +0000850 ValueType ResTy, ValueType OpTy, Intrinsic IntOp, bit Commutable>
Bob Wilsone60fee02009-06-22 23:27:02 +0000851 : N3V<op24, op23, op21_20, op11_8, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000852 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000853 OpcodeStr, Dt, "$dst, $src1, $src2", "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000854 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src1), (OpTy QPR:$src2))))]> {
855 let isCommutable = Commutable;
856}
David Goodwin36bff0c2009-09-25 18:38:29 +0000857class N3VQIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000858 string OpcodeStr, string Dt,
859 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000860 : N3V<1, 1, op21_20, op11_8, 1, 0,
861 (outs QPR:$dst), (ins QPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +0000862 itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000863 [(set (ResTy QPR:$dst),
864 (ResTy (IntOp (ResTy QPR:$src1),
865 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src2),
866 imm:$lane)))))]> {
867 let isCommutable = 0;
868}
David Goodwin36bff0c2009-09-25 18:38:29 +0000869class N3VQIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000870 string OpcodeStr, string Dt,
871 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000872 : N3V<1, 1, op21_20, op11_8, 1, 0,
873 (outs QPR:$dst), (ins QPR:$src1, DPR_8:$src2, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +0000874 itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000875 [(set (ResTy QPR:$dst),
876 (ResTy (IntOp (ResTy QPR:$src1),
877 (ResTy (NEONvduplane (OpTy DPR_8:$src2),
878 imm:$lane)))))]> {
879 let isCommutable = 0;
880}
Bob Wilsone60fee02009-06-22 23:27:02 +0000881
Bob Wilson154999f2010-02-17 22:23:11 +0000882// Multiply-Add/Sub operations: single-, double- and quad-register.
883class N3VSMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
884 InstrItinClass itin, string OpcodeStr, string Dt,
885 ValueType Ty, SDNode MulOp, SDNode OpNode>
886 : N3V<op24, op23, op21_20, op11_8, 0, op4,
887 (outs DPR_VFP2:$dst),
888 (ins DPR_VFP2:$src1, DPR_VFP2:$src2, DPR_VFP2:$src3), itin,
889 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst", []>;
890
Bob Wilsone60fee02009-06-22 23:27:02 +0000891class N3VDMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000892 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin36bff0c2009-09-25 18:38:29 +0000893 ValueType Ty, SDNode MulOp, SDNode OpNode>
Bob Wilsone60fee02009-06-22 23:27:02 +0000894 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000895 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000896 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +0000897 [(set DPR:$dst, (Ty (OpNode DPR:$src1,
898 (Ty (MulOp DPR:$src2, DPR:$src3)))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000899class N3VDMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000900 string OpcodeStr, string Dt,
901 ValueType Ty, SDNode MulOp, SDNode ShOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000902 : N3V<0, 1, op21_20, op11_8, 1, 0,
903 (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000904 (ins DPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000905 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000906 [(set (Ty DPR:$dst),
907 (Ty (ShOp (Ty DPR:$src1),
908 (Ty (MulOp DPR:$src2,
909 (Ty (NEONvduplane (Ty DPR_VFP2:$src3),
Johnny Chen7c3f3862010-03-17 23:26:50 +0000910 imm:$lane)))))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000911class N3VDMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000912 string OpcodeStr, string Dt,
913 ValueType Ty, SDNode MulOp, SDNode ShOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000914 : N3V<0, 1, op21_20, op11_8, 1, 0,
915 (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000916 (ins DPR:$src1, DPR:$src2, DPR_8:$src3, nohash_imm:$lane), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000917 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000918 [(set (Ty DPR:$dst),
919 (Ty (ShOp (Ty DPR:$src1),
920 (Ty (MulOp DPR:$src2,
921 (Ty (NEONvduplane (Ty DPR_8:$src3),
Johnny Chen7c3f3862010-03-17 23:26:50 +0000922 imm:$lane)))))))]>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000923
Bob Wilsone60fee02009-06-22 23:27:02 +0000924class N3VQMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000925 InstrItinClass itin, string OpcodeStr, string Dt, ValueType Ty,
David Goodwin36bff0c2009-09-25 18:38:29 +0000926 SDNode MulOp, SDNode OpNode>
Bob Wilsone60fee02009-06-22 23:27:02 +0000927 : N3V<op24, op23, op21_20, op11_8, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000928 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000929 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +0000930 [(set QPR:$dst, (Ty (OpNode QPR:$src1,
931 (Ty (MulOp QPR:$src2, QPR:$src3)))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000932class N3VQMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000933 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000934 SDNode MulOp, SDNode ShOp>
935 : N3V<1, 1, op21_20, op11_8, 1, 0,
936 (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000937 (ins QPR:$src1, QPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000938 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000939 [(set (ResTy QPR:$dst),
940 (ResTy (ShOp (ResTy QPR:$src1),
941 (ResTy (MulOp QPR:$src2,
Bob Wilson1d2c4212010-02-17 00:31:29 +0000942 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src3),
Johnny Chen7c3f3862010-03-17 23:26:50 +0000943 imm:$lane)))))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000944class N3VQMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000945 string OpcodeStr, string Dt,
946 ValueType ResTy, ValueType OpTy,
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000947 SDNode MulOp, SDNode ShOp>
948 : N3V<1, 1, op21_20, op11_8, 1, 0,
949 (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000950 (ins QPR:$src1, QPR:$src2, DPR_8:$src3, nohash_imm:$lane), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000951 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000952 [(set (ResTy QPR:$dst),
953 (ResTy (ShOp (ResTy QPR:$src1),
954 (ResTy (MulOp QPR:$src2,
Bob Wilson1d2c4212010-02-17 00:31:29 +0000955 (ResTy (NEONvduplane (OpTy DPR_8:$src3),
Johnny Chen7c3f3862010-03-17 23:26:50 +0000956 imm:$lane)))))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +0000957
958// Neon 3-argument intrinsics, both double- and quad-register.
959// The destination register is also used as the first source operand register.
960class N3VDInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000961 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin36bff0c2009-09-25 18:38:29 +0000962 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +0000963 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000964 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000965 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +0000966 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src1),
967 (OpTy DPR:$src2), (OpTy DPR:$src3))))]>;
968class N3VQInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000969 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin36bff0c2009-09-25 18:38:29 +0000970 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +0000971 : N3V<op24, op23, op21_20, op11_8, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000972 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000973 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +0000974 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src1),
975 (OpTy QPR:$src2), (OpTy QPR:$src3))))]>;
976
977// Neon Long 3-argument intrinsic. The destination register is
978// a quad-register and is also used as the first source operand register.
979class N3VLInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000980 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin36bff0c2009-09-25 18:38:29 +0000981 ValueType TyQ, ValueType TyD, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +0000982 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +0000983 (outs QPR:$dst), (ins QPR:$src1, DPR:$src2, DPR:$src3), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000984 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +0000985 [(set QPR:$dst,
986 (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$src2), (TyD DPR:$src3))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +0000987class N3VLInt3SL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000988 string OpcodeStr, string Dt,
989 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000990 : N3V<op24, 1, op21_20, op11_8, 1, 0,
991 (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +0000992 (ins QPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000993 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000994 [(set (ResTy QPR:$dst),
995 (ResTy (IntOp (ResTy QPR:$src1),
996 (OpTy DPR:$src2),
997 (OpTy (NEONvduplane (OpTy DPR_VFP2:$src3),
998 imm:$lane)))))]>;
Bob Wilson1d2c4212010-02-17 00:31:29 +0000999class N3VLInt3SL16<bit op24, bits<2> op21_20, bits<4> op11_8,
1000 InstrItinClass itin, string OpcodeStr, string Dt,
1001 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001002 : N3V<op24, 1, op21_20, op11_8, 1, 0,
1003 (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00001004 (ins QPR:$src1, DPR:$src2, DPR_8:$src3, nohash_imm:$lane), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001005 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001006 [(set (ResTy QPR:$dst),
1007 (ResTy (IntOp (ResTy QPR:$src1),
1008 (OpTy DPR:$src2),
1009 (OpTy (NEONvduplane (OpTy DPR_8:$src3),
1010 imm:$lane)))))]>;
1011
Bob Wilsone60fee02009-06-22 23:27:02 +00001012// Narrowing 3-register intrinsics.
1013class N3VNInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001014 string OpcodeStr, string Dt, ValueType TyD, ValueType TyQ,
Bob Wilsone60fee02009-06-22 23:27:02 +00001015 Intrinsic IntOp, bit Commutable>
1016 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001017 (outs DPR:$dst), (ins QPR:$src1, QPR:$src2), IIC_VBINi4D,
Evan Cheng09c61b32009-11-23 21:57:23 +00001018 OpcodeStr, Dt, "$dst, $src1, $src2", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001019 [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src1), (TyQ QPR:$src2))))]> {
1020 let isCommutable = Commutable;
1021}
1022
1023// Long 3-register intrinsics.
1024class N3VLInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001025 InstrItinClass itin, string OpcodeStr, string Dt,
1026 ValueType TyQ, ValueType TyD, Intrinsic IntOp, bit Commutable>
Bob Wilsone60fee02009-06-22 23:27:02 +00001027 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001028 (outs QPR:$dst), (ins DPR:$src1, DPR:$src2), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001029 OpcodeStr, Dt, "$dst, $src1, $src2", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001030 [(set QPR:$dst, (TyQ (IntOp (TyD DPR:$src1), (TyD DPR:$src2))))]> {
1031 let isCommutable = Commutable;
1032}
David Goodwin36bff0c2009-09-25 18:38:29 +00001033class N3VLIntSL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001034 string OpcodeStr, string Dt,
1035 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001036 : N3V<op24, 1, op21_20, op11_8, 1, 0,
1037 (outs QPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00001038 itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001039 [(set (ResTy QPR:$dst),
1040 (ResTy (IntOp (OpTy DPR:$src1),
1041 (OpTy (NEONvduplane (OpTy DPR_VFP2:$src2),
Johnny Chen7c3f3862010-03-17 23:26:50 +00001042 imm:$lane)))))]>;
Bob Wilson1d2c4212010-02-17 00:31:29 +00001043class N3VLIntSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
1044 InstrItinClass itin, string OpcodeStr, string Dt,
1045 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001046 : N3V<op24, 1, op21_20, op11_8, 1, 0,
1047 (outs QPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00001048 itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001049 [(set (ResTy QPR:$dst),
1050 (ResTy (IntOp (OpTy DPR:$src1),
1051 (OpTy (NEONvduplane (OpTy DPR_8:$src2),
Johnny Chen7c3f3862010-03-17 23:26:50 +00001052 imm:$lane)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001053
1054// Wide 3-register intrinsics.
1055class N3VWInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001056 string OpcodeStr, string Dt, ValueType TyQ, ValueType TyD,
Bob Wilsone60fee02009-06-22 23:27:02 +00001057 Intrinsic IntOp, bit Commutable>
1058 : N3V<op24, op23, op21_20, op11_8, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001059 (outs QPR:$dst), (ins QPR:$src1, DPR:$src2), IIC_VSUBiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001060 OpcodeStr, Dt, "$dst, $src1, $src2", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001061 [(set QPR:$dst, (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$src2))))]> {
1062 let isCommutable = Commutable;
1063}
1064
1065// Pairwise long 2-register intrinsics, both double- and quad-register.
1066class N2VDPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
Evan Cheng09c61b32009-11-23 21:57:23 +00001067 bits<2> op17_16, bits<5> op11_7, bit op4,
1068 string OpcodeStr, string Dt,
Bob Wilsone60fee02009-06-22 23:27:02 +00001069 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1070 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
Evan Cheng09c61b32009-11-23 21:57:23 +00001071 (ins DPR:$src), IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001072 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src))))]>;
1073class N2VQPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
Evan Cheng09c61b32009-11-23 21:57:23 +00001074 bits<2> op17_16, bits<5> op11_7, bit op4,
1075 string OpcodeStr, string Dt,
Bob Wilsone60fee02009-06-22 23:27:02 +00001076 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1077 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
Evan Cheng09c61b32009-11-23 21:57:23 +00001078 (ins QPR:$src), IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001079 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src))))]>;
1080
1081// Pairwise long 2-register accumulate intrinsics,
1082// both double- and quad-register.
1083// The destination register is also used as the first source operand register.
1084class N2VDPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
Evan Cheng09c61b32009-11-23 21:57:23 +00001085 bits<2> op17_16, bits<5> op11_7, bit op4,
1086 string OpcodeStr, string Dt,
Bob Wilsone60fee02009-06-22 23:27:02 +00001087 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1088 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001089 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), IIC_VPALiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001090 OpcodeStr, Dt, "$dst, $src2", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001091 [(set DPR:$dst, (ResTy (IntOp (ResTy DPR:$src1), (OpTy DPR:$src2))))]>;
1092class N2VQPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
Evan Cheng09c61b32009-11-23 21:57:23 +00001093 bits<2> op17_16, bits<5> op11_7, bit op4,
1094 string OpcodeStr, string Dt,
Bob Wilsone60fee02009-06-22 23:27:02 +00001095 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1096 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001097 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), IIC_VPALiQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00001098 OpcodeStr, Dt, "$dst, $src2", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001099 [(set QPR:$dst, (ResTy (IntOp (ResTy QPR:$src1), (OpTy QPR:$src2))))]>;
1100
1101// Shift by immediate,
1102// both double- and quad-register.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001103class N2VDSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001104 InstrItinClass itin, string OpcodeStr, string Dt,
1105 ValueType Ty, SDNode OpNode>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001106 : N2VImm<op24, op23, op11_8, op7, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001107 (outs DPR:$dst), (ins DPR:$src, i32imm:$SIMM), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001108 OpcodeStr, Dt, "$dst, $src, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001109 [(set DPR:$dst, (Ty (OpNode (Ty DPR:$src), (i32 imm:$SIMM))))]>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001110class N2VQSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001111 InstrItinClass itin, string OpcodeStr, string Dt,
1112 ValueType Ty, SDNode OpNode>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001113 : N2VImm<op24, op23, op11_8, op7, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001114 (outs QPR:$dst), (ins QPR:$src, i32imm:$SIMM), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001115 OpcodeStr, Dt, "$dst, $src, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001116 [(set QPR:$dst, (Ty (OpNode (Ty QPR:$src), (i32 imm:$SIMM))))]>;
1117
Johnny Chen7c3f3862010-03-17 23:26:50 +00001118// Long shift by immediate.
1119class N2VLSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
1120 string OpcodeStr, string Dt,
1121 ValueType ResTy, ValueType OpTy, SDNode OpNode>
1122 : N2VImm<op24, op23, op11_8, op7, op6, op4,
1123 (outs QPR:$dst), (ins DPR:$src, i32imm:$SIMM), IIC_VSHLiD,
1124 OpcodeStr, Dt, "$dst, $src, $SIMM", "",
1125 [(set QPR:$dst, (ResTy (OpNode (OpTy DPR:$src),
1126 (i32 imm:$SIMM))))]>;
1127
Bob Wilsone60fee02009-06-22 23:27:02 +00001128// Narrow shift by immediate.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001129class N2VNSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001130 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin36bff0c2009-09-25 18:38:29 +00001131 ValueType ResTy, ValueType OpTy, SDNode OpNode>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001132 : N2VImm<op24, op23, op11_8, op7, op6, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001133 (outs DPR:$dst), (ins QPR:$src, i32imm:$SIMM), itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001134 OpcodeStr, Dt, "$dst, $src, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001135 [(set DPR:$dst, (ResTy (OpNode (OpTy QPR:$src),
1136 (i32 imm:$SIMM))))]>;
1137
1138// Shift right by immediate and accumulate,
1139// both double- and quad-register.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001140class N2VDShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001141 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001142 : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$dst),
1143 (ins DPR:$src1, DPR:$src2, i32imm:$SIMM), IIC_VPALiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001144 OpcodeStr, Dt, "$dst, $src2, $SIMM", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001145 [(set DPR:$dst, (Ty (add DPR:$src1,
1146 (Ty (ShOp DPR:$src2, (i32 imm:$SIMM))))))]>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001147class N2VQShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001148 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001149 : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$dst),
1150 (ins QPR:$src1, QPR:$src2, i32imm:$SIMM), IIC_VPALiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001151 OpcodeStr, Dt, "$dst, $src2, $SIMM", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001152 [(set QPR:$dst, (Ty (add QPR:$src1,
1153 (Ty (ShOp QPR:$src2, (i32 imm:$SIMM))))))]>;
1154
1155// Shift by immediate and insert,
1156// both double- and quad-register.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001157class N2VDShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001158 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001159 : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$dst),
1160 (ins DPR:$src1, DPR:$src2, i32imm:$SIMM), IIC_VSHLiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001161 OpcodeStr, Dt, "$dst, $src2, $SIMM", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001162 [(set DPR:$dst, (Ty (ShOp DPR:$src1, DPR:$src2, (i32 imm:$SIMM))))]>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001163class N2VQShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001164 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001165 : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$dst),
1166 (ins QPR:$src1, QPR:$src2, i32imm:$SIMM), IIC_VSHLiQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00001167 OpcodeStr, Dt, "$dst, $src2, $SIMM", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001168 [(set QPR:$dst, (Ty (ShOp QPR:$src1, QPR:$src2, (i32 imm:$SIMM))))]>;
1169
1170// Convert, with fractional bits immediate,
1171// both double- and quad-register.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001172class N2VCvtD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001173 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
Bob Wilsone60fee02009-06-22 23:27:02 +00001174 Intrinsic IntOp>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001175 : N2VImm<op24, op23, op11_8, op7, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001176 (outs DPR:$dst), (ins DPR:$src, i32imm:$SIMM), IIC_VUNAD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001177 OpcodeStr, Dt, "$dst, $src, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001178 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src), (i32 imm:$SIMM))))]>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001179class N2VCvtQ<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001180 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
Bob Wilsone60fee02009-06-22 23:27:02 +00001181 Intrinsic IntOp>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001182 : N2VImm<op24, op23, op11_8, op7, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001183 (outs QPR:$dst), (ins QPR:$src, i32imm:$SIMM), IIC_VUNAQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00001184 OpcodeStr, Dt, "$dst, $src, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001185 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src), (i32 imm:$SIMM))))]>;
1186
1187//===----------------------------------------------------------------------===//
1188// Multiclasses
1189//===----------------------------------------------------------------------===//
1190
Bob Wilson8af7b532009-10-03 04:44:16 +00001191// Abbreviations used in multiclass suffixes:
1192// Q = quarter int (8 bit) elements
1193// H = half int (16 bit) elements
1194// S = single int (32 bit) elements
1195// D = double int (64 bit) elements
1196
Johnny Chenfc9ef992010-02-23 00:33:12 +00001197// Neon 2-register vector operations -- for disassembly only.
1198
1199// First with only element sizes of 8, 16 and 32 bits:
Johnny Chenc2b70b52010-02-23 01:42:58 +00001200multiclass N2V_QHS_cmp<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
1201 bits<5> op11_7, bit op4, string opc, string Dt,
1202 string asm> {
Johnny Chenfc9ef992010-02-23 00:33:12 +00001203 // 64-bit vector types.
1204 def v8i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 0, op4,
1205 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
Johnny Chenc2b70b52010-02-23 01:42:58 +00001206 opc, !strconcat(Dt, "8"), asm, "", []>;
Johnny Chenfc9ef992010-02-23 00:33:12 +00001207 def v4i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 0, op4,
1208 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
Johnny Chenc2b70b52010-02-23 01:42:58 +00001209 opc, !strconcat(Dt, "16"), asm, "", []>;
Johnny Chenfc9ef992010-02-23 00:33:12 +00001210 def v2i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
1211 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
Johnny Chenc2b70b52010-02-23 01:42:58 +00001212 opc, !strconcat(Dt, "32"), asm, "", []>;
Johnny Chenfc9ef992010-02-23 00:33:12 +00001213 def v2f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
1214 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
1215 opc, "f32", asm, "", []> {
1216 let Inst{10} = 1; // overwrite F = 1
1217 }
1218
1219 // 128-bit vector types.
1220 def v16i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 1, op4,
1221 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
Johnny Chenc2b70b52010-02-23 01:42:58 +00001222 opc, !strconcat(Dt, "8"), asm, "", []>;
Johnny Chenfc9ef992010-02-23 00:33:12 +00001223 def v8i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 1, op4,
1224 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
Johnny Chenc2b70b52010-02-23 01:42:58 +00001225 opc, !strconcat(Dt, "16"), asm, "", []>;
Johnny Chenfc9ef992010-02-23 00:33:12 +00001226 def v4i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
1227 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
Johnny Chenc2b70b52010-02-23 01:42:58 +00001228 opc, !strconcat(Dt, "32"), asm, "", []>;
Johnny Chenfc9ef992010-02-23 00:33:12 +00001229 def v4f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
1230 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
1231 opc, "f32", asm, "", []> {
1232 let Inst{10} = 1; // overwrite F = 1
1233 }
1234}
1235
Bob Wilsone60fee02009-06-22 23:27:02 +00001236// Neon 3-register vector operations.
1237
1238// First with only element sizes of 8, 16 and 32 bits:
1239multiclass N3V_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin78caa122009-09-23 21:38:08 +00001240 InstrItinClass itinD16, InstrItinClass itinD32,
1241 InstrItinClass itinQ16, InstrItinClass itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001242 string OpcodeStr, string Dt,
1243 SDNode OpNode, bit Commutable = 0> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001244 // 64-bit vector types.
David Goodwin78caa122009-09-23 21:38:08 +00001245 def v8i8 : N3VD<op24, op23, 0b00, op11_8, op4, itinD16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001246 OpcodeStr, !strconcat(Dt, "8"),
1247 v8i8, v8i8, OpNode, Commutable>;
David Goodwin78caa122009-09-23 21:38:08 +00001248 def v4i16 : N3VD<op24, op23, 0b01, op11_8, op4, itinD16,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001249 OpcodeStr, !strconcat(Dt, "16"),
1250 v4i16, v4i16, OpNode, Commutable>;
David Goodwin78caa122009-09-23 21:38:08 +00001251 def v2i32 : N3VD<op24, op23, 0b10, op11_8, op4, itinD32,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001252 OpcodeStr, !strconcat(Dt, "32"),
1253 v2i32, v2i32, OpNode, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001254
1255 // 128-bit vector types.
David Goodwin78caa122009-09-23 21:38:08 +00001256 def v16i8 : N3VQ<op24, op23, 0b00, op11_8, op4, itinQ16,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001257 OpcodeStr, !strconcat(Dt, "8"),
1258 v16i8, v16i8, OpNode, Commutable>;
David Goodwin78caa122009-09-23 21:38:08 +00001259 def v8i16 : N3VQ<op24, op23, 0b01, op11_8, op4, itinQ16,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001260 OpcodeStr, !strconcat(Dt, "16"),
1261 v8i16, v8i16, OpNode, Commutable>;
David Goodwin78caa122009-09-23 21:38:08 +00001262 def v4i32 : N3VQ<op24, op23, 0b10, op11_8, op4, itinQ32,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001263 OpcodeStr, !strconcat(Dt, "32"),
1264 v4i32, v4i32, OpNode, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001265}
1266
Evan Cheng09c61b32009-11-23 21:57:23 +00001267multiclass N3VSL_HS<bits<4> op11_8, string OpcodeStr, string Dt, SDNode ShOp> {
1268 def v4i16 : N3VDSL16<0b01, op11_8, OpcodeStr, !strconcat(Dt, "16"),
1269 v4i16, ShOp>;
1270 def v2i32 : N3VDSL<0b10, op11_8, IIC_VMULi32D, OpcodeStr, !strconcat(Dt,"32"),
Evan Cheng67abcec2009-11-21 06:21:52 +00001271 v2i32, ShOp>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001272 def v8i16 : N3VQSL16<0b01, op11_8, OpcodeStr, !strconcat(Dt, "16"),
Evan Cheng67abcec2009-11-21 06:21:52 +00001273 v8i16, v4i16, ShOp>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001274 def v4i32 : N3VQSL<0b10, op11_8, IIC_VMULi32Q, OpcodeStr, !strconcat(Dt,"32"),
Evan Cheng67abcec2009-11-21 06:21:52 +00001275 v4i32, v2i32, ShOp>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001276}
1277
Bob Wilsone60fee02009-06-22 23:27:02 +00001278// ....then also with element size 64 bits:
1279multiclass N3V_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin78caa122009-09-23 21:38:08 +00001280 InstrItinClass itinD, InstrItinClass itinQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00001281 string OpcodeStr, string Dt,
1282 SDNode OpNode, bit Commutable = 0>
David Goodwin78caa122009-09-23 21:38:08 +00001283 : N3V_QHS<op24, op23, op11_8, op4, itinD, itinD, itinQ, itinQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00001284 OpcodeStr, Dt, OpNode, Commutable> {
David Goodwin78caa122009-09-23 21:38:08 +00001285 def v1i64 : N3VD<op24, op23, 0b11, op11_8, op4, itinD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001286 OpcodeStr, !strconcat(Dt, "64"),
1287 v1i64, v1i64, OpNode, Commutable>;
David Goodwin78caa122009-09-23 21:38:08 +00001288 def v2i64 : N3VQ<op24, op23, 0b11, op11_8, op4, itinQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00001289 OpcodeStr, !strconcat(Dt, "64"),
1290 v2i64, v2i64, OpNode, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001291}
1292
1293
1294// Neon Narrowing 2-register vector intrinsics,
1295// source operand element sizes of 16, 32 and 64 bits:
1296multiclass N2VNInt_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
David Goodwin78caa122009-09-23 21:38:08 +00001297 bits<5> op11_7, bit op6, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001298 InstrItinClass itin, string OpcodeStr, string Dt,
Bob Wilsone60fee02009-06-22 23:27:02 +00001299 Intrinsic IntOp> {
1300 def v8i8 : N2VNInt<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001301 itin, OpcodeStr, !strconcat(Dt, "16"),
1302 v8i8, v8i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001303 def v4i16 : N2VNInt<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001304 itin, OpcodeStr, !strconcat(Dt, "32"),
1305 v4i16, v4i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001306 def v2i32 : N2VNInt<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001307 itin, OpcodeStr, !strconcat(Dt, "64"),
1308 v2i32, v2i64, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001309}
1310
1311
1312// Neon Lengthening 2-register vector intrinsic (currently specific to VMOVL).
1313// source operand element sizes of 16, 32 and 64 bits:
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001314multiclass N2VLInt_QHS<bits<2> op24_23, bits<5> op11_7, bit op6, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001315 string OpcodeStr, string Dt, Intrinsic IntOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001316 def v8i16 : N2VLInt<op24_23, 0b00, 0b10, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001317 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, IntOp>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001318 def v4i32 : N2VLInt<op24_23, 0b01, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001319 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001320 def v2i64 : N2VLInt<op24_23, 0b10, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001321 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001322}
1323
1324
1325// Neon 3-register vector intrinsics.
1326
1327// First with only element sizes of 16 and 32 bits:
1328multiclass N3VInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001329 InstrItinClass itinD16, InstrItinClass itinD32,
1330 InstrItinClass itinQ16, InstrItinClass itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001331 string OpcodeStr, string Dt,
1332 Intrinsic IntOp, bit Commutable = 0> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001333 // 64-bit vector types.
Evan Cheng67abcec2009-11-21 06:21:52 +00001334 def v4i16 : N3VDInt<op24, op23, 0b01, op11_8, op4, itinD16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001335 OpcodeStr, !strconcat(Dt, "16"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001336 v4i16, v4i16, IntOp, Commutable>;
Evan Cheng67abcec2009-11-21 06:21:52 +00001337 def v2i32 : N3VDInt<op24, op23, 0b10, op11_8, op4, itinD32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001338 OpcodeStr, !strconcat(Dt, "32"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001339 v2i32, v2i32, IntOp, Commutable>;
1340
1341 // 128-bit vector types.
Evan Cheng67abcec2009-11-21 06:21:52 +00001342 def v8i16 : N3VQInt<op24, op23, 0b01, op11_8, op4, itinQ16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001343 OpcodeStr, !strconcat(Dt, "16"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001344 v8i16, v8i16, IntOp, Commutable>;
Evan Cheng67abcec2009-11-21 06:21:52 +00001345 def v4i32 : N3VQInt<op24, op23, 0b10, op11_8, op4, itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001346 OpcodeStr, !strconcat(Dt, "32"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001347 v4i32, v4i32, IntOp, Commutable>;
1348}
1349
David Goodwin36bff0c2009-09-25 18:38:29 +00001350multiclass N3VIntSL_HS<bits<4> op11_8,
1351 InstrItinClass itinD16, InstrItinClass itinD32,
1352 InstrItinClass itinQ16, InstrItinClass itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001353 string OpcodeStr, string Dt, Intrinsic IntOp> {
Evan Cheng67abcec2009-11-21 06:21:52 +00001354 def v4i16 : N3VDIntSL16<0b01, op11_8, itinD16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001355 OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp>;
Evan Cheng67abcec2009-11-21 06:21:52 +00001356 def v2i32 : N3VDIntSL<0b10, op11_8, itinD32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001357 OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp>;
Evan Cheng67abcec2009-11-21 06:21:52 +00001358 def v8i16 : N3VQIntSL16<0b01, op11_8, itinQ16,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001359 OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16, IntOp>;
Evan Cheng67abcec2009-11-21 06:21:52 +00001360 def v4i32 : N3VQIntSL<0b10, op11_8, itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001361 OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32, IntOp>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001362}
1363
Bob Wilsone60fee02009-06-22 23:27:02 +00001364// ....then also with element size of 8 bits:
1365multiclass N3VInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001366 InstrItinClass itinD16, InstrItinClass itinD32,
1367 InstrItinClass itinQ16, InstrItinClass itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001368 string OpcodeStr, string Dt,
1369 Intrinsic IntOp, bit Commutable = 0>
David Goodwin36bff0c2009-09-25 18:38:29 +00001370 : N3VInt_HS<op24, op23, op11_8, op4, itinD16, itinD32, itinQ16, itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001371 OpcodeStr, Dt, IntOp, Commutable> {
David Goodwin36bff0c2009-09-25 18:38:29 +00001372 def v8i8 : N3VDInt<op24, op23, 0b00, op11_8, op4, itinD16,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001373 OpcodeStr, !strconcat(Dt, "8"),
1374 v8i8, v8i8, IntOp, Commutable>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001375 def v16i8 : N3VQInt<op24, op23, 0b00, op11_8, op4, itinQ16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001376 OpcodeStr, !strconcat(Dt, "8"),
1377 v16i8, v16i8, IntOp, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001378}
1379
1380// ....then also with element size of 64 bits:
1381multiclass N3VInt_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001382 InstrItinClass itinD16, InstrItinClass itinD32,
1383 InstrItinClass itinQ16, InstrItinClass itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001384 string OpcodeStr, string Dt,
1385 Intrinsic IntOp, bit Commutable = 0>
David Goodwin36bff0c2009-09-25 18:38:29 +00001386 : N3VInt_QHS<op24, op23, op11_8, op4, itinD16, itinD32, itinQ16, itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001387 OpcodeStr, Dt, IntOp, Commutable> {
David Goodwin36bff0c2009-09-25 18:38:29 +00001388 def v1i64 : N3VDInt<op24, op23, 0b11, op11_8, op4, itinD32,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001389 OpcodeStr, !strconcat(Dt, "64"),
1390 v1i64, v1i64, IntOp, Commutable>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001391 def v2i64 : N3VQInt<op24, op23, 0b11, op11_8, op4, itinQ32,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001392 OpcodeStr, !strconcat(Dt, "64"),
1393 v2i64, v2i64, IntOp, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001394}
1395
1396
1397// Neon Narrowing 3-register vector intrinsics,
1398// source operand element sizes of 16, 32 and 64 bits:
1399multiclass N3VNInt_HSD<bit op24, bit op23, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001400 string OpcodeStr, string Dt,
1401 Intrinsic IntOp, bit Commutable = 0> {
1402 def v8i8 : N3VNInt<op24, op23, 0b00, op11_8, op4,
1403 OpcodeStr, !strconcat(Dt, "16"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001404 v8i8, v8i16, IntOp, Commutable>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001405 def v4i16 : N3VNInt<op24, op23, 0b01, op11_8, op4,
1406 OpcodeStr, !strconcat(Dt, "32"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001407 v4i16, v4i32, IntOp, Commutable>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001408 def v2i32 : N3VNInt<op24, op23, 0b10, op11_8, op4,
1409 OpcodeStr, !strconcat(Dt, "64"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001410 v2i32, v2i64, IntOp, Commutable>;
1411}
1412
1413
1414// Neon Long 3-register vector intrinsics.
1415
1416// First with only element sizes of 16 and 32 bits:
1417multiclass N3VLInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001418 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin36bff0c2009-09-25 18:38:29 +00001419 Intrinsic IntOp, bit Commutable = 0> {
1420 def v4i32 : N3VLInt<op24, op23, 0b01, op11_8, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001421 OpcodeStr, !strconcat(Dt, "16"),
1422 v4i32, v4i16, IntOp, Commutable>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001423 def v2i64 : N3VLInt<op24, op23, 0b10, op11_8, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001424 OpcodeStr, !strconcat(Dt, "32"),
1425 v2i64, v2i32, IntOp, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001426}
1427
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001428multiclass N3VLIntSL_HS<bit op24, bits<4> op11_8,
Evan Cheng09c61b32009-11-23 21:57:23 +00001429 InstrItinClass itin, string OpcodeStr, string Dt,
1430 Intrinsic IntOp> {
David Goodwin36bff0c2009-09-25 18:38:29 +00001431 def v4i16 : N3VLIntSL16<op24, 0b01, op11_8, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001432 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001433 def v2i32 : N3VLIntSL<op24, 0b10, op11_8, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001434 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001435}
1436
Bob Wilsone60fee02009-06-22 23:27:02 +00001437// ....then also with element size of 8 bits:
1438multiclass N3VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001439 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin36bff0c2009-09-25 18:38:29 +00001440 Intrinsic IntOp, bit Commutable = 0>
Evan Cheng09c61b32009-11-23 21:57:23 +00001441 : N3VLInt_HS<op24, op23, op11_8, op4, itin, OpcodeStr, Dt,
1442 IntOp, Commutable> {
David Goodwin36bff0c2009-09-25 18:38:29 +00001443 def v8i16 : N3VLInt<op24, op23, 0b00, op11_8, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001444 OpcodeStr, !strconcat(Dt, "8"),
1445 v8i16, v8i8, IntOp, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001446}
1447
1448
1449// Neon Wide 3-register vector intrinsics,
1450// source operand element sizes of 8, 16 and 32 bits:
1451multiclass N3VWInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001452 string OpcodeStr, string Dt,
1453 Intrinsic IntOp, bit Commutable = 0> {
1454 def v8i16 : N3VWInt<op24, op23, 0b00, op11_8, op4,
1455 OpcodeStr, !strconcat(Dt, "8"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001456 v8i16, v8i8, IntOp, Commutable>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001457 def v4i32 : N3VWInt<op24, op23, 0b01, op11_8, op4,
1458 OpcodeStr, !strconcat(Dt, "16"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001459 v4i32, v4i16, IntOp, Commutable>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001460 def v2i64 : N3VWInt<op24, op23, 0b10, op11_8, op4,
1461 OpcodeStr, !strconcat(Dt, "32"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001462 v2i64, v2i32, IntOp, Commutable>;
1463}
1464
1465
1466// Neon Multiply-Op vector operations,
1467// element sizes of 8, 16 and 32 bits:
1468multiclass N3VMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001469 InstrItinClass itinD16, InstrItinClass itinD32,
1470 InstrItinClass itinQ16, InstrItinClass itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001471 string OpcodeStr, string Dt, SDNode OpNode> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001472 // 64-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001473 def v8i8 : N3VDMulOp<op24, op23, 0b00, op11_8, op4, itinD16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001474 OpcodeStr, !strconcat(Dt, "8"), v8i8, mul, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001475 def v4i16 : N3VDMulOp<op24, op23, 0b01, op11_8, op4, itinD16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001476 OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001477 def v2i32 : N3VDMulOp<op24, op23, 0b10, op11_8, op4, itinD32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001478 OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, OpNode>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001479
1480 // 128-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001481 def v16i8 : N3VQMulOp<op24, op23, 0b00, op11_8, op4, itinQ16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001482 OpcodeStr, !strconcat(Dt, "8"), v16i8, mul, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001483 def v8i16 : N3VQMulOp<op24, op23, 0b01, op11_8, op4, itinQ16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001484 OpcodeStr, !strconcat(Dt, "16"), v8i16, mul, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001485 def v4i32 : N3VQMulOp<op24, op23, 0b10, op11_8, op4, itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001486 OpcodeStr, !strconcat(Dt, "32"), v4i32, mul, OpNode>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001487}
1488
David Goodwin36bff0c2009-09-25 18:38:29 +00001489multiclass N3VMulOpSL_HS<bits<4> op11_8,
1490 InstrItinClass itinD16, InstrItinClass itinD32,
1491 InstrItinClass itinQ16, InstrItinClass itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001492 string OpcodeStr, string Dt, SDNode ShOp> {
David Goodwin36bff0c2009-09-25 18:38:29 +00001493 def v4i16 : N3VDMulOpSL16<0b01, op11_8, itinD16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001494 OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, ShOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001495 def v2i32 : N3VDMulOpSL<0b10, op11_8, itinD32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001496 OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, ShOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001497 def v8i16 : N3VQMulOpSL16<0b01, op11_8, itinQ16,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001498 OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16,
1499 mul, ShOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001500 def v4i32 : N3VQMulOpSL<0b10, op11_8, itinQ32,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001501 OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32,
1502 mul, ShOp>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001503}
Bob Wilsone60fee02009-06-22 23:27:02 +00001504
1505// Neon 3-argument intrinsics,
1506// element sizes of 8, 16 and 32 bits:
1507multiclass N3VInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001508 string OpcodeStr, string Dt, Intrinsic IntOp> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001509 // 64-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001510 def v8i8 : N3VDInt3<op24, op23, 0b00, op11_8, op4, IIC_VMACi16D,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001511 OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001512 def v4i16 : N3VDInt3<op24, op23, 0b01, op11_8, op4, IIC_VMACi16D,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001513 OpcodeStr, !strconcat(Dt, "16"), v4i16, v4i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001514 def v2i32 : N3VDInt3<op24, op23, 0b10, op11_8, op4, IIC_VMACi32D,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001515 OpcodeStr, !strconcat(Dt, "32"), v2i32, v2i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001516
1517 // 128-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001518 def v16i8 : N3VQInt3<op24, op23, 0b00, op11_8, op4, IIC_VMACi16Q,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001519 OpcodeStr, !strconcat(Dt, "8"), v16i8, v16i8, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001520 def v8i16 : N3VQInt3<op24, op23, 0b01, op11_8, op4, IIC_VMACi16Q,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001521 OpcodeStr, !strconcat(Dt, "16"), v8i16, v8i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001522 def v4i32 : N3VQInt3<op24, op23, 0b10, op11_8, op4, IIC_VMACi32Q,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001523 OpcodeStr, !strconcat(Dt, "32"), v4i32, v4i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001524}
1525
1526
1527// Neon Long 3-argument intrinsics.
1528
1529// First with only element sizes of 16 and 32 bits:
1530multiclass N3VLInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001531 string OpcodeStr, string Dt, Intrinsic IntOp> {
David Goodwin36bff0c2009-09-25 18:38:29 +00001532 def v4i32 : N3VLInt3<op24, op23, 0b01, op11_8, op4, IIC_VMACi16D,
Evan Cheng09c61b32009-11-23 21:57:23 +00001533 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001534 def v2i64 : N3VLInt3<op24, op23, 0b10, op11_8, op4, IIC_VMACi16D,
Evan Cheng09c61b32009-11-23 21:57:23 +00001535 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001536}
1537
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001538multiclass N3VLInt3SL_HS<bit op24, bits<4> op11_8,
Evan Cheng09c61b32009-11-23 21:57:23 +00001539 string OpcodeStr, string Dt, Intrinsic IntOp> {
David Goodwin36bff0c2009-09-25 18:38:29 +00001540 def v4i16 : N3VLInt3SL16<op24, 0b01, op11_8, IIC_VMACi16D,
Evan Cheng09c61b32009-11-23 21:57:23 +00001541 OpcodeStr, !strconcat(Dt,"16"), v4i32, v4i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001542 def v2i32 : N3VLInt3SL<op24, 0b10, op11_8, IIC_VMACi32D,
Evan Cheng09c61b32009-11-23 21:57:23 +00001543 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001544}
1545
Bob Wilsone60fee02009-06-22 23:27:02 +00001546// ....then also with element size of 8 bits:
1547multiclass N3VLInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001548 string OpcodeStr, string Dt, Intrinsic IntOp>
1549 : N3VLInt3_HS<op24, op23, op11_8, op4, OpcodeStr, Dt, IntOp> {
Bob Wilson85f30d72009-10-15 21:57:47 +00001550 def v8i16 : N3VLInt3<op24, op23, 0b00, op11_8, op4, IIC_VMACi16D,
Evan Cheng09c61b32009-11-23 21:57:23 +00001551 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001552}
1553
1554
1555// Neon 2-register vector intrinsics,
1556// element sizes of 8, 16 and 32 bits:
1557multiclass N2VInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
David Goodwin78caa122009-09-23 21:38:08 +00001558 bits<5> op11_7, bit op4,
1559 InstrItinClass itinD, InstrItinClass itinQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00001560 string OpcodeStr, string Dt, Intrinsic IntOp> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001561 // 64-bit vector types.
1562 def v8i8 : N2VDInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001563 itinD, OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001564 def v4i16 : N2VDInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001565 itinD, OpcodeStr, !strconcat(Dt, "16"),v4i16,v4i16,IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001566 def v2i32 : N2VDInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001567 itinD, OpcodeStr, !strconcat(Dt, "32"),v2i32,v2i32,IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001568
1569 // 128-bit vector types.
1570 def v16i8 : N2VQInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001571 itinQ, OpcodeStr, !strconcat(Dt, "8"), v16i8,v16i8,IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001572 def v8i16 : N2VQInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001573 itinQ, OpcodeStr, !strconcat(Dt, "16"),v8i16,v8i16,IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001574 def v4i32 : N2VQInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001575 itinQ, OpcodeStr, !strconcat(Dt, "32"),v4i32,v4i32,IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001576}
1577
1578
1579// Neon Pairwise long 2-register intrinsics,
1580// element sizes of 8, 16 and 32 bits:
1581multiclass N2VPLInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
1582 bits<5> op11_7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001583 string OpcodeStr, string Dt, Intrinsic IntOp> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001584 // 64-bit vector types.
1585 def v8i8 : N2VDPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001586 OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001587 def v4i16 : N2VDPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001588 OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001589 def v2i32 : N2VDPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001590 OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001591
1592 // 128-bit vector types.
1593 def v16i8 : N2VQPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001594 OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001595 def v8i16 : N2VQPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001596 OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001597 def v4i32 : N2VQPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001598 OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001599}
1600
1601
1602// Neon Pairwise long 2-register accumulate intrinsics,
1603// element sizes of 8, 16 and 32 bits:
1604multiclass N2VPLInt2_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
1605 bits<5> op11_7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001606 string OpcodeStr, string Dt, Intrinsic IntOp> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001607 // 64-bit vector types.
1608 def v8i8 : N2VDPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001609 OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001610 def v4i16 : N2VDPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001611 OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001612 def v2i32 : N2VDPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001613 OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001614
1615 // 128-bit vector types.
1616 def v16i8 : N2VQPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001617 OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001618 def v8i16 : N2VQPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001619 OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001620 def v4i32 : N2VQPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001621 OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001622}
1623
1624
1625// Neon 2-register vector shift by immediate,
1626// element sizes of 8, 16, 32 and 64 bits:
1627multiclass N2VSh_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001628 InstrItinClass itin, string OpcodeStr, string Dt,
1629 SDNode OpNode> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001630 // 64-bit vector types.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001631 def v8i8 : N2VDSh<op24, op23, op11_8, 0, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001632 OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001633 let Inst{21-19} = 0b001; // imm6 = 001xxx
1634 }
1635 def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001636 OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001637 let Inst{21-20} = 0b01; // imm6 = 01xxxx
1638 }
1639 def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001640 OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001641 let Inst{21} = 0b1; // imm6 = 1xxxxx
1642 }
1643 def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001644 OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001645 // imm6 = xxxxxx
Bob Wilsone60fee02009-06-22 23:27:02 +00001646
1647 // 128-bit vector types.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001648 def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001649 OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001650 let Inst{21-19} = 0b001; // imm6 = 001xxx
1651 }
1652 def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001653 OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001654 let Inst{21-20} = 0b01; // imm6 = 01xxxx
1655 }
1656 def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001657 OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001658 let Inst{21} = 0b1; // imm6 = 1xxxxx
1659 }
1660 def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001661 OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001662 // imm6 = xxxxxx
Bob Wilsone60fee02009-06-22 23:27:02 +00001663}
1664
1665
1666// Neon Shift-Accumulate vector operations,
1667// element sizes of 8, 16, 32 and 64 bits:
1668multiclass N2VShAdd_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001669 string OpcodeStr, string Dt, SDNode ShOp> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001670 // 64-bit vector types.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001671 def v8i8 : N2VDShAdd<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001672 OpcodeStr, !strconcat(Dt, "8"), v8i8, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001673 let Inst{21-19} = 0b001; // imm6 = 001xxx
1674 }
1675 def v4i16 : N2VDShAdd<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001676 OpcodeStr, !strconcat(Dt, "16"), v4i16, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001677 let Inst{21-20} = 0b01; // imm6 = 01xxxx
1678 }
1679 def v2i32 : N2VDShAdd<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001680 OpcodeStr, !strconcat(Dt, "32"), v2i32, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001681 let Inst{21} = 0b1; // imm6 = 1xxxxx
1682 }
1683 def v1i64 : N2VDShAdd<op24, op23, op11_8, 1, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001684 OpcodeStr, !strconcat(Dt, "64"), v1i64, ShOp>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001685 // imm6 = xxxxxx
Bob Wilsone60fee02009-06-22 23:27:02 +00001686
1687 // 128-bit vector types.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001688 def v16i8 : N2VQShAdd<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001689 OpcodeStr, !strconcat(Dt, "8"), v16i8, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001690 let Inst{21-19} = 0b001; // imm6 = 001xxx
1691 }
1692 def v8i16 : N2VQShAdd<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001693 OpcodeStr, !strconcat(Dt, "16"), v8i16, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001694 let Inst{21-20} = 0b01; // imm6 = 01xxxx
1695 }
1696 def v4i32 : N2VQShAdd<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001697 OpcodeStr, !strconcat(Dt, "32"), v4i32, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001698 let Inst{21} = 0b1; // imm6 = 1xxxxx
1699 }
1700 def v2i64 : N2VQShAdd<op24, op23, op11_8, 1, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001701 OpcodeStr, !strconcat(Dt, "64"), v2i64, ShOp>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001702 // imm6 = xxxxxx
Bob Wilsone60fee02009-06-22 23:27:02 +00001703}
1704
1705
1706// Neon Shift-Insert vector operations,
1707// element sizes of 8, 16, 32 and 64 bits:
1708multiclass N2VShIns_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
1709 string OpcodeStr, SDNode ShOp> {
1710 // 64-bit vector types.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001711 def v8i8 : N2VDShIns<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001712 OpcodeStr, "8", v8i8, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001713 let Inst{21-19} = 0b001; // imm6 = 001xxx
1714 }
1715 def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001716 OpcodeStr, "16", v4i16, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001717 let Inst{21-20} = 0b01; // imm6 = 01xxxx
1718 }
1719 def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001720 OpcodeStr, "32", v2i32, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001721 let Inst{21} = 0b1; // imm6 = 1xxxxx
1722 }
1723 def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001724 OpcodeStr, "64", v1i64, ShOp>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001725 // imm6 = xxxxxx
Bob Wilsone60fee02009-06-22 23:27:02 +00001726
1727 // 128-bit vector types.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001728 def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001729 OpcodeStr, "8", v16i8, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001730 let Inst{21-19} = 0b001; // imm6 = 001xxx
1731 }
1732 def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001733 OpcodeStr, "16", v8i16, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001734 let Inst{21-20} = 0b01; // imm6 = 01xxxx
1735 }
1736 def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001737 OpcodeStr, "32", v4i32, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001738 let Inst{21} = 0b1; // imm6 = 1xxxxx
1739 }
1740 def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001741 OpcodeStr, "64", v2i64, ShOp>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001742 // imm6 = xxxxxx
1743}
1744
1745// Neon Shift Long operations,
1746// element sizes of 8, 16, 32 bits:
1747multiclass N2VLSh_QHS<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
Evan Cheng09c61b32009-11-23 21:57:23 +00001748 bit op4, string OpcodeStr, string Dt, SDNode OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001749 def v8i16 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001750 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001751 let Inst{21-19} = 0b001; // imm6 = 001xxx
1752 }
1753 def v4i32 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001754 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001755 let Inst{21-20} = 0b01; // imm6 = 01xxxx
1756 }
1757 def v2i64 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001758 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001759 let Inst{21} = 0b1; // imm6 = 1xxxxx
1760 }
1761}
1762
1763// Neon Shift Narrow operations,
1764// element sizes of 16, 32, 64 bits:
1765multiclass N2VNSh_HSD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
Evan Cheng09c61b32009-11-23 21:57:23 +00001766 bit op4, InstrItinClass itin, string OpcodeStr, string Dt,
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001767 SDNode OpNode> {
1768 def v8i8 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001769 OpcodeStr, !strconcat(Dt, "16"), v8i8, v8i16, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001770 let Inst{21-19} = 0b001; // imm6 = 001xxx
1771 }
1772 def v4i16 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001773 OpcodeStr, !strconcat(Dt, "32"), v4i16, v4i32, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001774 let Inst{21-20} = 0b01; // imm6 = 01xxxx
1775 }
1776 def v2i32 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001777 OpcodeStr, !strconcat(Dt, "64"), v2i32, v2i64, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001778 let Inst{21} = 0b1; // imm6 = 1xxxxx
1779 }
Bob Wilsone60fee02009-06-22 23:27:02 +00001780}
1781
1782//===----------------------------------------------------------------------===//
1783// Instruction Definitions.
1784//===----------------------------------------------------------------------===//
1785
1786// Vector Add Operations.
1787
1788// VADD : Vector Add (integer and floating-point)
Evan Cheng09c61b32009-11-23 21:57:23 +00001789defm VADD : N3V_QHSD<0, 0, 0b1000, 0, IIC_VBINiD, IIC_VBINiQ, "vadd", "i",
Evan Cheng67abcec2009-11-21 06:21:52 +00001790 add, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001791def VADDfd : N3VD<0, 0, 0b00, 0b1101, 0, IIC_VBIND, "vadd", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00001792 v2f32, v2f32, fadd, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001793def VADDfq : N3VQ<0, 0, 0b00, 0b1101, 0, IIC_VBINQ, "vadd", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00001794 v4f32, v4f32, fadd, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001795// VADDL : Vector Add Long (Q = D + D)
Evan Cheng09c61b32009-11-23 21:57:23 +00001796defm VADDLs : N3VLInt_QHS<0,1,0b0000,0, IIC_VSHLiD, "vaddl", "s",
Evan Cheng67abcec2009-11-21 06:21:52 +00001797 int_arm_neon_vaddls, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001798defm VADDLu : N3VLInt_QHS<1,1,0b0000,0, IIC_VSHLiD, "vaddl", "u",
Evan Cheng67abcec2009-11-21 06:21:52 +00001799 int_arm_neon_vaddlu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001800// VADDW : Vector Add Wide (Q = Q + D)
Evan Cheng09c61b32009-11-23 21:57:23 +00001801defm VADDWs : N3VWInt_QHS<0,1,0b0001,0, "vaddw", "s", int_arm_neon_vaddws, 0>;
1802defm VADDWu : N3VWInt_QHS<1,1,0b0001,0, "vaddw", "u", int_arm_neon_vaddwu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001803// VHADD : Vector Halving Add
David Goodwin36bff0c2009-09-25 18:38:29 +00001804defm VHADDs : N3VInt_QHS<0,0,0b0000,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00001805 IIC_VBINi4Q, "vhadd", "s", int_arm_neon_vhadds, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001806defm VHADDu : N3VInt_QHS<1,0,0b0000,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00001807 IIC_VBINi4Q, "vhadd", "u", int_arm_neon_vhaddu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001808// VRHADD : Vector Rounding Halving Add
David Goodwin36bff0c2009-09-25 18:38:29 +00001809defm VRHADDs : N3VInt_QHS<0,0,0b0001,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00001810 IIC_VBINi4Q, "vrhadd", "s", int_arm_neon_vrhadds, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001811defm VRHADDu : N3VInt_QHS<1,0,0b0001,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00001812 IIC_VBINi4Q, "vrhadd", "u", int_arm_neon_vrhaddu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001813// VQADD : Vector Saturating Add
David Goodwin36bff0c2009-09-25 18:38:29 +00001814defm VQADDs : N3VInt_QHSD<0,0,0b0000,1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00001815 IIC_VBINi4Q, "vqadd", "s", int_arm_neon_vqadds, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001816defm VQADDu : N3VInt_QHSD<1,0,0b0000,1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00001817 IIC_VBINi4Q, "vqadd", "u", int_arm_neon_vqaddu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001818// VADDHN : Vector Add and Narrow Returning High Half (D = Q + Q)
Evan Cheng09c61b32009-11-23 21:57:23 +00001819defm VADDHN : N3VNInt_HSD<0,1,0b0100,0, "vaddhn", "i",
1820 int_arm_neon_vaddhn, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001821// VRADDHN : Vector Rounding Add and Narrow Returning High Half (D = Q + Q)
Evan Cheng09c61b32009-11-23 21:57:23 +00001822defm VRADDHN : N3VNInt_HSD<1,1,0b0100,0, "vraddhn", "i",
1823 int_arm_neon_vraddhn, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001824
1825// Vector Multiply Operations.
1826
1827// VMUL : Vector Multiply (integer, polynomial and floating-point)
Evan Cheng67abcec2009-11-21 06:21:52 +00001828defm VMUL : N3V_QHS<0, 0, 0b1001, 1, IIC_VMULi16D, IIC_VMULi32D,
Evan Cheng09c61b32009-11-23 21:57:23 +00001829 IIC_VMULi16Q, IIC_VMULi32Q, "vmul", "i", mul, 1>;
1830def VMULpd : N3VDInt<1, 0, 0b00, 0b1001, 1, IIC_VMULi16D, "vmul", "p8",
Evan Cheng67abcec2009-11-21 06:21:52 +00001831 v8i8, v8i8, int_arm_neon_vmulp, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001832def VMULpq : N3VQInt<1, 0, 0b00, 0b1001, 1, IIC_VMULi16Q, "vmul", "p8",
Evan Cheng67abcec2009-11-21 06:21:52 +00001833 v16i8, v16i8, int_arm_neon_vmulp, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001834def VMULfd : N3VD<1, 0, 0b00, 0b1101, 1, IIC_VBIND, "vmul", "f32",
Bob Wilson1d2c4212010-02-17 00:31:29 +00001835 v2f32, v2f32, fmul, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001836def VMULfq : N3VQ<1, 0, 0b00, 0b1101, 1, IIC_VBINQ, "vmul", "f32",
Bob Wilson1d2c4212010-02-17 00:31:29 +00001837 v4f32, v4f32, fmul, 1>;
1838defm VMULsl : N3VSL_HS<0b1000, "vmul", "i", mul>;
1839def VMULslfd : N3VDSL<0b10, 0b1001, IIC_VBIND, "vmul", "f32", v2f32, fmul>;
1840def VMULslfq : N3VQSL<0b10, 0b1001, IIC_VBINQ, "vmul", "f32", v4f32,
1841 v2f32, fmul>;
1842
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001843def : Pat<(v8i16 (mul (v8i16 QPR:$src1),
1844 (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))),
1845 (v8i16 (VMULslv8i16 (v8i16 QPR:$src1),
1846 (v4i16 (EXTRACT_SUBREG QPR:$src2,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001847 (DSubReg_i16_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001848 (SubReg_i16_lane imm:$lane)))>;
1849def : Pat<(v4i32 (mul (v4i32 QPR:$src1),
1850 (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))),
1851 (v4i32 (VMULslv4i32 (v4i32 QPR:$src1),
1852 (v2i32 (EXTRACT_SUBREG QPR:$src2,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001853 (DSubReg_i32_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001854 (SubReg_i32_lane imm:$lane)))>;
1855def : Pat<(v4f32 (fmul (v4f32 QPR:$src1),
1856 (v4f32 (NEONvduplane (v4f32 QPR:$src2), imm:$lane)))),
1857 (v4f32 (VMULslfq (v4f32 QPR:$src1),
1858 (v2f32 (EXTRACT_SUBREG QPR:$src2,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001859 (DSubReg_i32_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001860 (SubReg_i32_lane imm:$lane)))>;
1861
Bob Wilsone60fee02009-06-22 23:27:02 +00001862// VQDMULH : Vector Saturating Doubling Multiply Returning High Half
David Goodwin36bff0c2009-09-25 18:38:29 +00001863defm VQDMULH : N3VInt_HS<0, 0, 0b1011, 0, IIC_VMULi16D, IIC_VMULi32D,
1864 IIC_VMULi16Q, IIC_VMULi32Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00001865 "vqdmulh", "s", int_arm_neon_vqdmulh, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001866defm VQDMULHsl: N3VIntSL_HS<0b1100, IIC_VMULi16D, IIC_VMULi32D,
1867 IIC_VMULi16Q, IIC_VMULi32Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00001868 "vqdmulh", "s", int_arm_neon_vqdmulh>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001869def : Pat<(v8i16 (int_arm_neon_vqdmulh (v8i16 QPR:$src1),
Evan Cheng67abcec2009-11-21 06:21:52 +00001870 (v8i16 (NEONvduplane (v8i16 QPR:$src2),
1871 imm:$lane)))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001872 (v8i16 (VQDMULHslv8i16 (v8i16 QPR:$src1),
1873 (v4i16 (EXTRACT_SUBREG QPR:$src2,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001874 (DSubReg_i16_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001875 (SubReg_i16_lane imm:$lane)))>;
1876def : Pat<(v4i32 (int_arm_neon_vqdmulh (v4i32 QPR:$src1),
Evan Cheng67abcec2009-11-21 06:21:52 +00001877 (v4i32 (NEONvduplane (v4i32 QPR:$src2),
1878 imm:$lane)))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001879 (v4i32 (VQDMULHslv4i32 (v4i32 QPR:$src1),
1880 (v2i32 (EXTRACT_SUBREG QPR:$src2,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001881 (DSubReg_i32_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001882 (SubReg_i32_lane imm:$lane)))>;
1883
Bob Wilsone60fee02009-06-22 23:27:02 +00001884// VQRDMULH : Vector Rounding Saturating Doubling Multiply Returning High Half
David Goodwin36bff0c2009-09-25 18:38:29 +00001885defm VQRDMULH : N3VInt_HS<1, 0, 0b1011, 0, IIC_VMULi16D, IIC_VMULi32D,
1886 IIC_VMULi16Q, IIC_VMULi32Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00001887 "vqrdmulh", "s", int_arm_neon_vqrdmulh, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001888defm VQRDMULHsl : N3VIntSL_HS<0b1101, IIC_VMULi16D, IIC_VMULi32D,
1889 IIC_VMULi16Q, IIC_VMULi32Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00001890 "vqrdmulh", "s", int_arm_neon_vqrdmulh>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001891def : Pat<(v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$src1),
Evan Cheng67abcec2009-11-21 06:21:52 +00001892 (v8i16 (NEONvduplane (v8i16 QPR:$src2),
1893 imm:$lane)))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001894 (v8i16 (VQRDMULHslv8i16 (v8i16 QPR:$src1),
1895 (v4i16 (EXTRACT_SUBREG QPR:$src2,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001896 (DSubReg_i16_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001897 (SubReg_i16_lane imm:$lane)))>;
1898def : Pat<(v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$src1),
Evan Cheng67abcec2009-11-21 06:21:52 +00001899 (v4i32 (NEONvduplane (v4i32 QPR:$src2),
1900 imm:$lane)))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001901 (v4i32 (VQRDMULHslv4i32 (v4i32 QPR:$src1),
1902 (v2i32 (EXTRACT_SUBREG QPR:$src2,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001903 (DSubReg_i32_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001904 (SubReg_i32_lane imm:$lane)))>;
1905
Bob Wilsone60fee02009-06-22 23:27:02 +00001906// VMULL : Vector Multiply Long (integer and polynomial) (Q = D * D)
Evan Cheng09c61b32009-11-23 21:57:23 +00001907defm VMULLs : N3VLInt_QHS<0,1,0b1100,0, IIC_VMULi16D, "vmull", "s",
Evan Cheng67abcec2009-11-21 06:21:52 +00001908 int_arm_neon_vmulls, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001909defm VMULLu : N3VLInt_QHS<1,1,0b1100,0, IIC_VMULi16D, "vmull", "u",
Evan Cheng67abcec2009-11-21 06:21:52 +00001910 int_arm_neon_vmullu, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001911def VMULLp : N3VLInt<0, 1, 0b00, 0b1110, 0, IIC_VMULi16D, "vmull", "p8",
Evan Cheng67abcec2009-11-21 06:21:52 +00001912 v8i16, v8i8, int_arm_neon_vmullp, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001913defm VMULLsls : N3VLIntSL_HS<0, 0b1010, IIC_VMULi16D, "vmull", "s",
Evan Cheng67abcec2009-11-21 06:21:52 +00001914 int_arm_neon_vmulls>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001915defm VMULLslu : N3VLIntSL_HS<1, 0b1010, IIC_VMULi16D, "vmull", "u",
Evan Cheng67abcec2009-11-21 06:21:52 +00001916 int_arm_neon_vmullu>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001917
Bob Wilsone60fee02009-06-22 23:27:02 +00001918// VQDMULL : Vector Saturating Doubling Multiply Long (Q = D * D)
Evan Cheng09c61b32009-11-23 21:57:23 +00001919defm VQDMULL : N3VLInt_HS<0,1,0b1101,0, IIC_VMULi16D, "vqdmull", "s",
Evan Cheng67abcec2009-11-21 06:21:52 +00001920 int_arm_neon_vqdmull, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001921defm VQDMULLsl: N3VLIntSL_HS<0, 0b1011, IIC_VMULi16D, "vqdmull", "s",
Evan Cheng67abcec2009-11-21 06:21:52 +00001922 int_arm_neon_vqdmull>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001923
1924// Vector Multiply-Accumulate and Multiply-Subtract Operations.
1925
1926// VMLA : Vector Multiply Accumulate (integer and floating-point)
David Goodwin36bff0c2009-09-25 18:38:29 +00001927defm VMLA : N3VMulOp_QHS<0, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
Evan Cheng09c61b32009-11-23 21:57:23 +00001928 IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
1929def VMLAfd : N3VDMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00001930 v2f32, fmul, fadd>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001931def VMLAfq : N3VQMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACQ, "vmla", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00001932 v4f32, fmul, fadd>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001933defm VMLAsl : N3VMulOpSL_HS<0b0000, IIC_VMACi16D, IIC_VMACi32D,
Evan Cheng09c61b32009-11-23 21:57:23 +00001934 IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
1935def VMLAslfd : N3VDMulOpSL<0b10, 0b0001, IIC_VMACD, "vmla", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00001936 v2f32, fmul, fadd>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001937def VMLAslfq : N3VQMulOpSL<0b10, 0b0001, IIC_VMACQ, "vmla", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00001938 v4f32, v2f32, fmul, fadd>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001939
1940def : Pat<(v8i16 (add (v8i16 QPR:$src1),
Bob Wilson1d2c4212010-02-17 00:31:29 +00001941 (mul (v8i16 QPR:$src2),
1942 (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))),
1943 (v8i16 (VMLAslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001944 (v4i16 (EXTRACT_SUBREG QPR:$src3,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001945 (DSubReg_i16_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001946 (SubReg_i16_lane imm:$lane)))>;
1947
1948def : Pat<(v4i32 (add (v4i32 QPR:$src1),
Bob Wilson1d2c4212010-02-17 00:31:29 +00001949 (mul (v4i32 QPR:$src2),
1950 (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))),
1951 (v4i32 (VMLAslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001952 (v2i32 (EXTRACT_SUBREG QPR:$src3,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001953 (DSubReg_i32_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001954 (SubReg_i32_lane imm:$lane)))>;
1955
1956def : Pat<(v4f32 (fadd (v4f32 QPR:$src1),
Bob Wilson1d2c4212010-02-17 00:31:29 +00001957 (fmul (v4f32 QPR:$src2),
1958 (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001959 (v4f32 (VMLAslfq (v4f32 QPR:$src1),
1960 (v4f32 QPR:$src2),
1961 (v2f32 (EXTRACT_SUBREG QPR:$src3,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001962 (DSubReg_i32_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001963 (SubReg_i32_lane imm:$lane)))>;
1964
Bob Wilsone60fee02009-06-22 23:27:02 +00001965// VMLAL : Vector Multiply Accumulate Long (Q += D * D)
Evan Cheng09c61b32009-11-23 21:57:23 +00001966defm VMLALs : N3VLInt3_QHS<0,1,0b1000,0, "vmlal", "s", int_arm_neon_vmlals>;
1967defm VMLALu : N3VLInt3_QHS<1,1,0b1000,0, "vmlal", "u", int_arm_neon_vmlalu>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001968
Evan Cheng09c61b32009-11-23 21:57:23 +00001969defm VMLALsls : N3VLInt3SL_HS<0, 0b0010, "vmlal", "s", int_arm_neon_vmlals>;
1970defm VMLALslu : N3VLInt3SL_HS<1, 0b0010, "vmlal", "u", int_arm_neon_vmlalu>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001971
Bob Wilsone60fee02009-06-22 23:27:02 +00001972// VQDMLAL : Vector Saturating Doubling Multiply Accumulate Long (Q += D * D)
Evan Cheng09c61b32009-11-23 21:57:23 +00001973defm VQDMLAL : N3VLInt3_HS<0, 1, 0b1001, 0, "vqdmlal", "s",
1974 int_arm_neon_vqdmlal>;
1975defm VQDMLALsl: N3VLInt3SL_HS<0, 0b0011, "vqdmlal", "s", int_arm_neon_vqdmlal>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001976
Bob Wilsone60fee02009-06-22 23:27:02 +00001977// VMLS : Vector Multiply Subtract (integer and floating-point)
Bob Wilson64c60912009-10-03 04:41:21 +00001978defm VMLS : N3VMulOp_QHS<1, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
Evan Cheng09c61b32009-11-23 21:57:23 +00001979 IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
1980def VMLSfd : N3VDMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00001981 v2f32, fmul, fsub>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001982def VMLSfq : N3VQMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACQ, "vmls", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00001983 v4f32, fmul, fsub>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001984defm VMLSsl : N3VMulOpSL_HS<0b0100, IIC_VMACi16D, IIC_VMACi32D,
Evan Cheng09c61b32009-11-23 21:57:23 +00001985 IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
1986def VMLSslfd : N3VDMulOpSL<0b10, 0b0101, IIC_VMACD, "vmls", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00001987 v2f32, fmul, fsub>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001988def VMLSslfq : N3VQMulOpSL<0b10, 0b0101, IIC_VMACQ, "vmls", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00001989 v4f32, v2f32, fmul, fsub>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001990
1991def : Pat<(v8i16 (sub (v8i16 QPR:$src1),
Bob Wilson1d2c4212010-02-17 00:31:29 +00001992 (mul (v8i16 QPR:$src2),
1993 (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))),
1994 (v8i16 (VMLSslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001995 (v4i16 (EXTRACT_SUBREG QPR:$src3,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001996 (DSubReg_i16_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001997 (SubReg_i16_lane imm:$lane)))>;
1998
1999def : Pat<(v4i32 (sub (v4i32 QPR:$src1),
Bob Wilson1d2c4212010-02-17 00:31:29 +00002000 (mul (v4i32 QPR:$src2),
2001 (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))),
2002 (v4i32 (VMLSslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002003 (v2i32 (EXTRACT_SUBREG QPR:$src3,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002004 (DSubReg_i32_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002005 (SubReg_i32_lane imm:$lane)))>;
2006
2007def : Pat<(v4f32 (fsub (v4f32 QPR:$src1),
Bob Wilson1d2c4212010-02-17 00:31:29 +00002008 (fmul (v4f32 QPR:$src2),
2009 (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))),
2010 (v4f32 (VMLSslfq (v4f32 QPR:$src1), (v4f32 QPR:$src2),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002011 (v2f32 (EXTRACT_SUBREG QPR:$src3,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002012 (DSubReg_i32_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002013 (SubReg_i32_lane imm:$lane)))>;
2014
Bob Wilsone60fee02009-06-22 23:27:02 +00002015// VMLSL : Vector Multiply Subtract Long (Q -= D * D)
Evan Cheng09c61b32009-11-23 21:57:23 +00002016defm VMLSLs : N3VLInt3_QHS<0,1,0b1010,0, "vmlsl", "s", int_arm_neon_vmlsls>;
2017defm VMLSLu : N3VLInt3_QHS<1,1,0b1010,0, "vmlsl", "u", int_arm_neon_vmlslu>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002018
Evan Cheng09c61b32009-11-23 21:57:23 +00002019defm VMLSLsls : N3VLInt3SL_HS<0, 0b0110, "vmlsl", "s", int_arm_neon_vmlsls>;
2020defm VMLSLslu : N3VLInt3SL_HS<1, 0b0110, "vmlsl", "u", int_arm_neon_vmlslu>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002021
Bob Wilsone60fee02009-06-22 23:27:02 +00002022// VQDMLSL : Vector Saturating Doubling Multiply Subtract Long (Q -= D * D)
Evan Cheng09c61b32009-11-23 21:57:23 +00002023defm VQDMLSL : N3VLInt3_HS<0, 1, 0b1011, 0, "vqdmlsl", "s",
2024 int_arm_neon_vqdmlsl>;
2025defm VQDMLSLsl: N3VLInt3SL_HS<0, 0b111, "vqdmlsl", "s", int_arm_neon_vqdmlsl>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002026
2027// Vector Subtract Operations.
2028
2029// VSUB : Vector Subtract (integer and floating-point)
Evan Cheng67abcec2009-11-21 06:21:52 +00002030defm VSUB : N3V_QHSD<1, 0, 0b1000, 0, IIC_VSUBiD, IIC_VSUBiQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00002031 "vsub", "i", sub, 0>;
2032def VSUBfd : N3VD<0, 0, 0b10, 0b1101, 0, IIC_VBIND, "vsub", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002033 v2f32, v2f32, fsub, 0>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002034def VSUBfq : N3VQ<0, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vsub", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002035 v4f32, v4f32, fsub, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002036// VSUBL : Vector Subtract Long (Q = D - D)
Evan Cheng09c61b32009-11-23 21:57:23 +00002037defm VSUBLs : N3VLInt_QHS<0,1,0b0010,0, IIC_VSHLiD, "vsubl", "s",
Evan Cheng67abcec2009-11-21 06:21:52 +00002038 int_arm_neon_vsubls, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002039defm VSUBLu : N3VLInt_QHS<1,1,0b0010,0, IIC_VSHLiD, "vsubl", "u",
Evan Cheng67abcec2009-11-21 06:21:52 +00002040 int_arm_neon_vsublu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002041// VSUBW : Vector Subtract Wide (Q = Q - D)
Evan Cheng09c61b32009-11-23 21:57:23 +00002042defm VSUBWs : N3VWInt_QHS<0,1,0b0011,0, "vsubw", "s", int_arm_neon_vsubws, 0>;
2043defm VSUBWu : N3VWInt_QHS<1,1,0b0011,0, "vsubw", "u", int_arm_neon_vsubwu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002044// VHSUB : Vector Halving Subtract
Evan Cheng67abcec2009-11-21 06:21:52 +00002045defm VHSUBs : N3VInt_QHS<0, 0, 0b0010, 0, IIC_VBINi4D, IIC_VBINi4D,
2046 IIC_VBINi4Q, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002047 "vhsub", "s", int_arm_neon_vhsubs, 0>;
Evan Cheng67abcec2009-11-21 06:21:52 +00002048defm VHSUBu : N3VInt_QHS<1, 0, 0b0010, 0, IIC_VBINi4D, IIC_VBINi4D,
2049 IIC_VBINi4Q, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002050 "vhsub", "u", int_arm_neon_vhsubu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002051// VQSUB : Vector Saturing Subtract
Evan Cheng67abcec2009-11-21 06:21:52 +00002052defm VQSUBs : N3VInt_QHSD<0, 0, 0b0010, 1, IIC_VBINi4D, IIC_VBINi4D,
2053 IIC_VBINi4Q, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002054 "vqsub", "s", int_arm_neon_vqsubs, 0>;
Evan Cheng67abcec2009-11-21 06:21:52 +00002055defm VQSUBu : N3VInt_QHSD<1, 0, 0b0010, 1, IIC_VBINi4D, IIC_VBINi4D,
2056 IIC_VBINi4Q, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002057 "vqsub", "u", int_arm_neon_vqsubu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002058// VSUBHN : Vector Subtract and Narrow Returning High Half (D = Q - Q)
Evan Cheng09c61b32009-11-23 21:57:23 +00002059defm VSUBHN : N3VNInt_HSD<0,1,0b0110,0, "vsubhn", "i",
2060 int_arm_neon_vsubhn, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002061// VRSUBHN : Vector Rounding Subtract and Narrow Returning High Half (D=Q-Q)
Evan Cheng09c61b32009-11-23 21:57:23 +00002062defm VRSUBHN : N3VNInt_HSD<1,1,0b0110,0, "vrsubhn", "i",
2063 int_arm_neon_vrsubhn, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002064
2065// Vector Comparisons.
2066
2067// VCEQ : Vector Compare Equal
David Goodwin78caa122009-09-23 21:38:08 +00002068defm VCEQ : N3V_QHS<1, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002069 IIC_VBINi4Q, "vceq", "i", NEONvceq, 1>;
2070def VCEQfd : N3VD<0,0,0b00,0b1110,0, IIC_VBIND, "vceq", "f32", v2i32, v2f32,
Evan Cheng67abcec2009-11-21 06:21:52 +00002071 NEONvceq, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002072def VCEQfq : N3VQ<0,0,0b00,0b1110,0, IIC_VBINQ, "vceq", "f32", v4i32, v4f32,
Evan Cheng67abcec2009-11-21 06:21:52 +00002073 NEONvceq, 1>;
Johnny Chenfc9ef992010-02-23 00:33:12 +00002074// For disassembly only.
Johnny Chenc2b70b52010-02-23 01:42:58 +00002075defm VCEQz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00010, 0, "vceq", "i",
2076 "$dst, $src, #0">;
Johnny Chenfc9ef992010-02-23 00:33:12 +00002077
Bob Wilsone60fee02009-06-22 23:27:02 +00002078// VCGE : Vector Compare Greater Than or Equal
David Goodwin78caa122009-09-23 21:38:08 +00002079defm VCGEs : N3V_QHS<0, 0, 0b0011, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002080 IIC_VBINi4Q, "vcge", "s", NEONvcge, 0>;
David Goodwin78caa122009-09-23 21:38:08 +00002081defm VCGEu : N3V_QHS<1, 0, 0b0011, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002082 IIC_VBINi4Q, "vcge", "u", NEONvcgeu, 0>;
2083def VCGEfd : N3VD<1,0,0b00,0b1110,0, IIC_VBIND, "vcge", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002084 v2i32, v2f32, NEONvcge, 0>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002085def VCGEfq : N3VQ<1,0,0b00,0b1110,0, IIC_VBINQ, "vcge", "f32", v4i32, v4f32,
Evan Cheng67abcec2009-11-21 06:21:52 +00002086 NEONvcge, 0>;
Johnny Chenc2b70b52010-02-23 01:42:58 +00002087// For disassembly only.
2088defm VCGEz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00001, 0, "vcge", "s",
2089 "$dst, $src, #0">;
2090// For disassembly only.
2091defm VCLEz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00011, 0, "vcle", "s",
2092 "$dst, $src, #0">;
2093
Bob Wilsone60fee02009-06-22 23:27:02 +00002094// VCGT : Vector Compare Greater Than
David Goodwin78caa122009-09-23 21:38:08 +00002095defm VCGTs : N3V_QHS<0, 0, 0b0011, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002096 IIC_VBINi4Q, "vcgt", "s", NEONvcgt, 0>;
David Goodwin78caa122009-09-23 21:38:08 +00002097defm VCGTu : N3V_QHS<1, 0, 0b0011, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002098 IIC_VBINi4Q, "vcgt", "u", NEONvcgtu, 0>;
2099def VCGTfd : N3VD<1,0,0b10,0b1110,0, IIC_VBIND, "vcgt", "f32", v2i32, v2f32,
Evan Cheng67abcec2009-11-21 06:21:52 +00002100 NEONvcgt, 0>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002101def VCGTfq : N3VQ<1,0,0b10,0b1110,0, IIC_VBINQ, "vcgt", "f32", v4i32, v4f32,
Evan Cheng67abcec2009-11-21 06:21:52 +00002102 NEONvcgt, 0>;
Johnny Chenc2b70b52010-02-23 01:42:58 +00002103// For disassembly only.
2104defm VCGTz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00000, 0, "vcgt", "s",
2105 "$dst, $src, #0">;
2106// For disassembly only.
2107defm VCLTz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00100, 0, "vclt", "s",
2108 "$dst, $src, #0">;
2109
Bob Wilsone60fee02009-06-22 23:27:02 +00002110// VACGE : Vector Absolute Compare Greater Than or Equal (aka VCAGE)
Evan Cheng09c61b32009-11-23 21:57:23 +00002111def VACGEd : N3VDInt<1, 0, 0b00, 0b1110, 1, IIC_VBIND, "vacge", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002112 v2i32, v2f32, int_arm_neon_vacged, 0>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002113def VACGEq : N3VQInt<1, 0, 0b00, 0b1110, 1, IIC_VBINQ, "vacge", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002114 v4i32, v4f32, int_arm_neon_vacgeq, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002115// VACGT : Vector Absolute Compare Greater Than (aka VCAGT)
Evan Cheng09c61b32009-11-23 21:57:23 +00002116def VACGTd : N3VDInt<1, 0, 0b10, 0b1110, 1, IIC_VBIND, "vacgt", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002117 v2i32, v2f32, int_arm_neon_vacgtd, 0>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002118def VACGTq : N3VQInt<1, 0, 0b10, 0b1110, 1, IIC_VBINQ, "vacgt", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002119 v4i32, v4f32, int_arm_neon_vacgtq, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002120// VTST : Vector Test Bits
David Goodwin78caa122009-09-23 21:38:08 +00002121defm VTST : N3V_QHS<0, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Bob Wilsona21a9cc2010-01-17 06:35:17 +00002122 IIC_VBINi4Q, "vtst", "", NEONvtst, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002123
2124// Vector Bitwise Operations.
2125
2126// VAND : Vector Bitwise AND
Evan Cheng09c61b32009-11-23 21:57:23 +00002127def VANDd : N3VDX<0, 0, 0b00, 0b0001, 1, IIC_VBINiD, "vand",
2128 v2i32, v2i32, and, 1>;
2129def VANDq : N3VQX<0, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "vand",
2130 v4i32, v4i32, and, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002131
2132// VEOR : Vector Bitwise Exclusive OR
Evan Cheng09c61b32009-11-23 21:57:23 +00002133def VEORd : N3VDX<1, 0, 0b00, 0b0001, 1, IIC_VBINiD, "veor",
2134 v2i32, v2i32, xor, 1>;
2135def VEORq : N3VQX<1, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "veor",
2136 v4i32, v4i32, xor, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002137
2138// VORR : Vector Bitwise OR
Evan Cheng09c61b32009-11-23 21:57:23 +00002139def VORRd : N3VDX<0, 0, 0b10, 0b0001, 1, IIC_VBINiD, "vorr",
2140 v2i32, v2i32, or, 1>;
2141def VORRq : N3VQX<0, 0, 0b10, 0b0001, 1, IIC_VBINiQ, "vorr",
2142 v4i32, v4i32, or, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002143
2144// VBIC : Vector Bitwise Bit Clear (AND NOT)
Evan Cheng09c61b32009-11-23 21:57:23 +00002145def VBICd : N3VX<0, 0, 0b01, 0b0001, 0, 1, (outs DPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +00002146 (ins DPR:$src1, DPR:$src2), IIC_VBINiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00002147 "vbic", "$dst, $src1, $src2", "",
Anton Korobeynikov14636a52009-09-08 22:51:43 +00002148 [(set DPR:$dst, (v2i32 (and DPR:$src1,
2149 (vnot_conv DPR:$src2))))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002150def VBICq : N3VX<0, 0, 0b01, 0b0001, 1, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002151 (ins QPR:$src1, QPR:$src2), IIC_VBINiQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00002152 "vbic", "$dst, $src1, $src2", "",
Anton Korobeynikov14636a52009-09-08 22:51:43 +00002153 [(set QPR:$dst, (v4i32 (and QPR:$src1,
2154 (vnot_conv QPR:$src2))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002155
2156// VORN : Vector Bitwise OR NOT
Evan Cheng09c61b32009-11-23 21:57:23 +00002157def VORNd : N3VX<0, 0, 0b11, 0b0001, 0, 1, (outs DPR:$dst),
David Goodwin78caa122009-09-23 21:38:08 +00002158 (ins DPR:$src1, DPR:$src2), IIC_VBINiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00002159 "vorn", "$dst, $src1, $src2", "",
Anton Korobeynikov14636a52009-09-08 22:51:43 +00002160 [(set DPR:$dst, (v2i32 (or DPR:$src1,
2161 (vnot_conv DPR:$src2))))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002162def VORNq : N3VX<0, 0, 0b11, 0b0001, 1, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002163 (ins QPR:$src1, QPR:$src2), IIC_VBINiQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00002164 "vorn", "$dst, $src1, $src2", "",
Anton Korobeynikov14636a52009-09-08 22:51:43 +00002165 [(set QPR:$dst, (v4i32 (or QPR:$src1,
2166 (vnot_conv QPR:$src2))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002167
2168// VMVN : Vector Bitwise NOT
Evan Cheng09c61b32009-11-23 21:57:23 +00002169def VMVNd : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 0, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00002170 (outs DPR:$dst), (ins DPR:$src), IIC_VSHLiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00002171 "vmvn", "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002172 [(set DPR:$dst, (v2i32 (vnot DPR:$src)))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002173def VMVNq : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 1, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00002174 (outs QPR:$dst), (ins QPR:$src), IIC_VSHLiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00002175 "vmvn", "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002176 [(set QPR:$dst, (v4i32 (vnot QPR:$src)))]>;
2177def : Pat<(v2i32 (vnot_conv DPR:$src)), (VMVNd DPR:$src)>;
2178def : Pat<(v4i32 (vnot_conv QPR:$src)), (VMVNq QPR:$src)>;
2179
2180// VBSL : Vector Bitwise Select
Evan Cheng09c61b32009-11-23 21:57:23 +00002181def VBSLd : N3VX<1, 0, 0b01, 0b0001, 0, 1, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002182 (ins DPR:$src1, DPR:$src2, DPR:$src3), IIC_VCNTiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00002183 "vbsl", "$dst, $src2, $src3", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00002184 [(set DPR:$dst,
2185 (v2i32 (or (and DPR:$src2, DPR:$src1),
Anton Korobeynikov14636a52009-09-08 22:51:43 +00002186 (and DPR:$src3, (vnot_conv DPR:$src1)))))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002187def VBSLq : N3VX<1, 0, 0b01, 0b0001, 1, 1, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002188 (ins QPR:$src1, QPR:$src2, QPR:$src3), IIC_VCNTiQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00002189 "vbsl", "$dst, $src2, $src3", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00002190 [(set QPR:$dst,
2191 (v4i32 (or (and QPR:$src2, QPR:$src1),
Anton Korobeynikov14636a52009-09-08 22:51:43 +00002192 (and QPR:$src3, (vnot_conv QPR:$src1)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002193
2194// VBIF : Vector Bitwise Insert if False
Evan Cheng09c61b32009-11-23 21:57:23 +00002195// like VBSL but with: "vbif $dst, $src3, $src1", "$src2 = $dst",
Johnny Chen7c313be2010-02-09 23:05:23 +00002196def VBIFd : N3VX<1, 0, 0b11, 0b0001, 0, 1,
2197 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3),
2198 IIC_VBINiD, "vbif", "$dst, $src2, $src3", "$src1 = $dst",
2199 [/* For disassembly only; pattern left blank */]>;
2200def VBIFq : N3VX<1, 0, 0b11, 0b0001, 1, 1,
2201 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3),
2202 IIC_VBINiQ, "vbif", "$dst, $src2, $src3", "$src1 = $dst",
2203 [/* For disassembly only; pattern left blank */]>;
2204
Bob Wilsone60fee02009-06-22 23:27:02 +00002205// VBIT : Vector Bitwise Insert if True
Evan Cheng09c61b32009-11-23 21:57:23 +00002206// like VBSL but with: "vbit $dst, $src2, $src1", "$src3 = $dst",
Johnny Chen7c313be2010-02-09 23:05:23 +00002207def VBITd : N3VX<1, 0, 0b10, 0b0001, 0, 1,
2208 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3),
2209 IIC_VBINiD, "vbit", "$dst, $src2, $src3", "$src1 = $dst",
2210 [/* For disassembly only; pattern left blank */]>;
2211def VBITq : N3VX<1, 0, 0b10, 0b0001, 1, 1,
2212 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3),
2213 IIC_VBINiQ, "vbit", "$dst, $src2, $src3", "$src1 = $dst",
2214 [/* For disassembly only; pattern left blank */]>;
2215
2216// VBIT/VBIF are not yet implemented. The TwoAddress pass will not go looking
Bob Wilsone60fee02009-06-22 23:27:02 +00002217// for equivalent operations with different register constraints; it just
2218// inserts copies.
2219
2220// Vector Absolute Differences.
2221
2222// VABD : Vector Absolute Difference
Evan Cheng67abcec2009-11-21 06:21:52 +00002223defm VABDs : N3VInt_QHS<0, 0, 0b0111, 0, IIC_VBINi4D, IIC_VBINi4D,
2224 IIC_VBINi4Q, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002225 "vabd", "s", int_arm_neon_vabds, 0>;
Evan Cheng67abcec2009-11-21 06:21:52 +00002226defm VABDu : N3VInt_QHS<1, 0, 0b0111, 0, IIC_VBINi4D, IIC_VBINi4D,
2227 IIC_VBINi4Q, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002228 "vabd", "u", int_arm_neon_vabdu, 0>;
Evan Cheng67abcec2009-11-21 06:21:52 +00002229def VABDfd : N3VDInt<1, 0, 0b10, 0b1101, 0, IIC_VBIND,
Evan Cheng09c61b32009-11-23 21:57:23 +00002230 "vabd", "f32", v2f32, v2f32, int_arm_neon_vabds, 0>;
Evan Cheng67abcec2009-11-21 06:21:52 +00002231def VABDfq : N3VQInt<1, 0, 0b10, 0b1101, 0, IIC_VBINQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00002232 "vabd", "f32", v4f32, v4f32, int_arm_neon_vabds, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002233
2234// VABDL : Vector Absolute Difference Long (Q = | D - D |)
Evan Cheng67abcec2009-11-21 06:21:52 +00002235defm VABDLs : N3VLInt_QHS<0,1,0b0111,0, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002236 "vabdl", "s", int_arm_neon_vabdls, 0>;
Evan Cheng67abcec2009-11-21 06:21:52 +00002237defm VABDLu : N3VLInt_QHS<1,1,0b0111,0, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002238 "vabdl", "u", int_arm_neon_vabdlu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002239
2240// VABA : Vector Absolute Difference and Accumulate
Evan Cheng09c61b32009-11-23 21:57:23 +00002241defm VABAs : N3VInt3_QHS<0,0,0b0111,1, "vaba", "s", int_arm_neon_vabas>;
2242defm VABAu : N3VInt3_QHS<1,0,0b0111,1, "vaba", "u", int_arm_neon_vabau>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002243
2244// VABAL : Vector Absolute Difference and Accumulate Long (Q += | D - D |)
Evan Cheng09c61b32009-11-23 21:57:23 +00002245defm VABALs : N3VLInt3_QHS<0,1,0b0101,0, "vabal", "s", int_arm_neon_vabals>;
2246defm VABALu : N3VLInt3_QHS<1,1,0b0101,0, "vabal", "u", int_arm_neon_vabalu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002247
2248// Vector Maximum and Minimum.
2249
2250// VMAX : Vector Maximum
Bob Wilson1d2c4212010-02-17 00:31:29 +00002251defm VMAXs : N3VInt_QHS<0,0,0b0110,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002252 IIC_VBINi4Q, "vmax", "s", int_arm_neon_vmaxs, 1>;
Bob Wilson1d2c4212010-02-17 00:31:29 +00002253defm VMAXu : N3VInt_QHS<1,0,0b0110,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002254 IIC_VBINi4Q, "vmax", "u", int_arm_neon_vmaxu, 1>;
2255def VMAXfd : N3VDInt<0, 0, 0b00, 0b1111, 0, IIC_VBIND, "vmax", "f32",
2256 v2f32, v2f32, int_arm_neon_vmaxs, 1>;
2257def VMAXfq : N3VQInt<0, 0, 0b00, 0b1111, 0, IIC_VBINQ, "vmax", "f32",
2258 v4f32, v4f32, int_arm_neon_vmaxs, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002259
2260// VMIN : Vector Minimum
Bob Wilson1d2c4212010-02-17 00:31:29 +00002261defm VMINs : N3VInt_QHS<0,0,0b0110,1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002262 IIC_VBINi4Q, "vmin", "s", int_arm_neon_vmins, 1>;
Bob Wilson1d2c4212010-02-17 00:31:29 +00002263defm VMINu : N3VInt_QHS<1,0,0b0110,1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002264 IIC_VBINi4Q, "vmin", "u", int_arm_neon_vminu, 1>;
2265def VMINfd : N3VDInt<0, 0, 0b10, 0b1111, 0, IIC_VBIND, "vmin", "f32",
2266 v2f32, v2f32, int_arm_neon_vmins, 1>;
2267def VMINfq : N3VQInt<0, 0, 0b10, 0b1111, 0, IIC_VBINQ, "vmin", "f32",
2268 v4f32, v4f32, int_arm_neon_vmins, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002269
2270// Vector Pairwise Operations.
2271
2272// VPADD : Vector Pairwise Add
Evan Cheng09c61b32009-11-23 21:57:23 +00002273def VPADDi8 : N3VDInt<0, 0, 0b00, 0b1011, 1, IIC_VBINiD, "vpadd", "i8",
2274 v8i8, v8i8, int_arm_neon_vpadd, 0>;
2275def VPADDi16 : N3VDInt<0, 0, 0b01, 0b1011, 1, IIC_VBINiD, "vpadd", "i16",
2276 v4i16, v4i16, int_arm_neon_vpadd, 0>;
2277def VPADDi32 : N3VDInt<0, 0, 0b10, 0b1011, 1, IIC_VBINiD, "vpadd", "i32",
2278 v2i32, v2i32, int_arm_neon_vpadd, 0>;
2279def VPADDf : N3VDInt<1, 0, 0b00, 0b1101, 0, IIC_VBIND, "vpadd", "f32",
2280 v2f32, v2f32, int_arm_neon_vpadd, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002281
2282// VPADDL : Vector Pairwise Add Long
Evan Cheng09c61b32009-11-23 21:57:23 +00002283defm VPADDLs : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpaddl", "s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002284 int_arm_neon_vpaddls>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002285defm VPADDLu : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpaddl", "u",
Bob Wilsone60fee02009-06-22 23:27:02 +00002286 int_arm_neon_vpaddlu>;
2287
2288// VPADAL : Vector Pairwise Add and Accumulate Long
Evan Cheng09c61b32009-11-23 21:57:23 +00002289defm VPADALs : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01100, 0, "vpadal", "s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002290 int_arm_neon_vpadals>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002291defm VPADALu : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01101, 0, "vpadal", "u",
Bob Wilsone60fee02009-06-22 23:27:02 +00002292 int_arm_neon_vpadalu>;
2293
2294// VPMAX : Vector Pairwise Maximum
Evan Cheng09c61b32009-11-23 21:57:23 +00002295def VPMAXs8 : N3VDInt<0, 0, 0b00, 0b1010, 0, IIC_VBINi4D, "vpmax", "s8",
2296 v8i8, v8i8, int_arm_neon_vpmaxs, 0>;
2297def VPMAXs16 : N3VDInt<0, 0, 0b01, 0b1010, 0, IIC_VBINi4D, "vpmax", "s16",
2298 v4i16, v4i16, int_arm_neon_vpmaxs, 0>;
2299def VPMAXs32 : N3VDInt<0, 0, 0b10, 0b1010, 0, IIC_VBINi4D, "vpmax", "s32",
2300 v2i32, v2i32, int_arm_neon_vpmaxs, 0>;
2301def VPMAXu8 : N3VDInt<1, 0, 0b00, 0b1010, 0, IIC_VBINi4D, "vpmax", "u8",
2302 v8i8, v8i8, int_arm_neon_vpmaxu, 0>;
2303def VPMAXu16 : N3VDInt<1, 0, 0b01, 0b1010, 0, IIC_VBINi4D, "vpmax", "u16",
2304 v4i16, v4i16, int_arm_neon_vpmaxu, 0>;
2305def VPMAXu32 : N3VDInt<1, 0, 0b10, 0b1010, 0, IIC_VBINi4D, "vpmax", "u32",
2306 v2i32, v2i32, int_arm_neon_vpmaxu, 0>;
2307def VPMAXf : N3VDInt<1, 0, 0b00, 0b1111, 0, IIC_VBINi4D, "vpmax", "f32",
2308 v2f32, v2f32, int_arm_neon_vpmaxs, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002309
2310// VPMIN : Vector Pairwise Minimum
Evan Cheng09c61b32009-11-23 21:57:23 +00002311def VPMINs8 : N3VDInt<0, 0, 0b00, 0b1010, 1, IIC_VBINi4D, "vpmin", "s8",
2312 v8i8, v8i8, int_arm_neon_vpmins, 0>;
2313def VPMINs16 : N3VDInt<0, 0, 0b01, 0b1010, 1, IIC_VBINi4D, "vpmin", "s16",
2314 v4i16, v4i16, int_arm_neon_vpmins, 0>;
2315def VPMINs32 : N3VDInt<0, 0, 0b10, 0b1010, 1, IIC_VBINi4D, "vpmin", "s32",
2316 v2i32, v2i32, int_arm_neon_vpmins, 0>;
2317def VPMINu8 : N3VDInt<1, 0, 0b00, 0b1010, 1, IIC_VBINi4D, "vpmin", "u8",
2318 v8i8, v8i8, int_arm_neon_vpminu, 0>;
2319def VPMINu16 : N3VDInt<1, 0, 0b01, 0b1010, 1, IIC_VBINi4D, "vpmin", "u16",
2320 v4i16, v4i16, int_arm_neon_vpminu, 0>;
2321def VPMINu32 : N3VDInt<1, 0, 0b10, 0b1010, 1, IIC_VBINi4D, "vpmin", "u32",
2322 v2i32, v2i32, int_arm_neon_vpminu, 0>;
2323def VPMINf : N3VDInt<1, 0, 0b10, 0b1111, 0, IIC_VBINi4D, "vpmin", "f32",
2324 v2f32, v2f32, int_arm_neon_vpmins, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002325
2326// Vector Reciprocal and Reciprocal Square Root Estimate and Step.
2327
2328// VRECPE : Vector Reciprocal Estimate
David Goodwin78caa122009-09-23 21:38:08 +00002329def VRECPEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002330 IIC_VUNAD, "vrecpe", "u32",
Bob Wilsone60fee02009-06-22 23:27:02 +00002331 v2i32, v2i32, int_arm_neon_vrecpe>;
David Goodwin78caa122009-09-23 21:38:08 +00002332def VRECPEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002333 IIC_VUNAQ, "vrecpe", "u32",
Bob Wilsone60fee02009-06-22 23:27:02 +00002334 v4i32, v4i32, int_arm_neon_vrecpe>;
David Goodwin78caa122009-09-23 21:38:08 +00002335def VRECPEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002336 IIC_VUNAD, "vrecpe", "f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00002337 v2f32, v2f32, int_arm_neon_vrecpe>;
David Goodwin78caa122009-09-23 21:38:08 +00002338def VRECPEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002339 IIC_VUNAQ, "vrecpe", "f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00002340 v4f32, v4f32, int_arm_neon_vrecpe>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002341
2342// VRECPS : Vector Reciprocal Step
Evan Cheng09c61b32009-11-23 21:57:23 +00002343def VRECPSfd : N3VDInt<0, 0, 0b00, 0b1111, 1,
2344 IIC_VRECSD, "vrecps", "f32",
2345 v2f32, v2f32, int_arm_neon_vrecps, 1>;
2346def VRECPSfq : N3VQInt<0, 0, 0b00, 0b1111, 1,
2347 IIC_VRECSQ, "vrecps", "f32",
2348 v4f32, v4f32, int_arm_neon_vrecps, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002349
2350// VRSQRTE : Vector Reciprocal Square Root Estimate
David Goodwin78caa122009-09-23 21:38:08 +00002351def VRSQRTEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002352 IIC_VUNAD, "vrsqrte", "u32",
David Goodwin78caa122009-09-23 21:38:08 +00002353 v2i32, v2i32, int_arm_neon_vrsqrte>;
2354def VRSQRTEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002355 IIC_VUNAQ, "vrsqrte", "u32",
David Goodwin78caa122009-09-23 21:38:08 +00002356 v4i32, v4i32, int_arm_neon_vrsqrte>;
2357def VRSQRTEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002358 IIC_VUNAD, "vrsqrte", "f32",
David Goodwin78caa122009-09-23 21:38:08 +00002359 v2f32, v2f32, int_arm_neon_vrsqrte>;
2360def VRSQRTEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002361 IIC_VUNAQ, "vrsqrte", "f32",
David Goodwin78caa122009-09-23 21:38:08 +00002362 v4f32, v4f32, int_arm_neon_vrsqrte>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002363
2364// VRSQRTS : Vector Reciprocal Square Root Step
Evan Cheng09c61b32009-11-23 21:57:23 +00002365def VRSQRTSfd : N3VDInt<0, 0, 0b10, 0b1111, 1,
2366 IIC_VRECSD, "vrsqrts", "f32",
2367 v2f32, v2f32, int_arm_neon_vrsqrts, 1>;
2368def VRSQRTSfq : N3VQInt<0, 0, 0b10, 0b1111, 1,
2369 IIC_VRECSQ, "vrsqrts", "f32",
2370 v4f32, v4f32, int_arm_neon_vrsqrts, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002371
2372// Vector Shifts.
2373
2374// VSHL : Vector Shift
Johnny Chen7c3f3862010-03-17 23:26:50 +00002375defm VSHLs : N3VInt_QHSD<0, 0, 0b0100, 0, IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ,
2376 IIC_VSHLiQ, "vshl", "s", int_arm_neon_vshifts, 0>;
2377defm VSHLu : N3VInt_QHSD<1, 0, 0b0100, 0, IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ,
2378 IIC_VSHLiQ, "vshl", "u", int_arm_neon_vshiftu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002379// VSHL : Vector Shift Left (Immediate)
Johnny Chen7c3f3862010-03-17 23:26:50 +00002380defm VSHLi : N2VSh_QHSD<0, 1, 0b0101, 1, IIC_VSHLiD, "vshl", "i", NEONvshl>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002381// VSHR : Vector Shift Right (Immediate)
Evan Cheng09c61b32009-11-23 21:57:23 +00002382defm VSHRs : N2VSh_QHSD<0, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "s", NEONvshrs>;
2383defm VSHRu : N2VSh_QHSD<1, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "u", NEONvshru>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002384
2385// VSHLL : Vector Shift Left Long
Evan Cheng09c61b32009-11-23 21:57:23 +00002386defm VSHLLs : N2VLSh_QHS<0, 1, 0b1010, 0, 0, 1, "vshll", "s", NEONvshlls>;
2387defm VSHLLu : N2VLSh_QHS<1, 1, 0b1010, 0, 0, 1, "vshll", "u", NEONvshllu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002388
2389// VSHLL : Vector Shift Left Long (with maximum shift count)
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002390class N2VLShMax<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
Evan Cheng09c61b32009-11-23 21:57:23 +00002391 bit op6, bit op4, string OpcodeStr, string Dt, ValueType ResTy,
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002392 ValueType OpTy, SDNode OpNode>
Evan Cheng09c61b32009-11-23 21:57:23 +00002393 : N2VLSh<op24, op23, op11_8, op7, op6, op4, OpcodeStr, Dt,
2394 ResTy, OpTy, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002395 let Inst{21-16} = op21_16;
2396}
Evan Cheng09c61b32009-11-23 21:57:23 +00002397def VSHLLi8 : N2VLShMax<1, 1, 0b110010, 0b0011, 0, 0, 0, "vshll", "i8",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002398 v8i16, v8i8, NEONvshlli>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002399def VSHLLi16 : N2VLShMax<1, 1, 0b110110, 0b0011, 0, 0, 0, "vshll", "i16",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002400 v4i32, v4i16, NEONvshlli>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002401def VSHLLi32 : N2VLShMax<1, 1, 0b111010, 0b0011, 0, 0, 0, "vshll", "i32",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002402 v2i64, v2i32, NEONvshlli>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002403
2404// VSHRN : Vector Shift Right and Narrow
Bob Wilson1d2c4212010-02-17 00:31:29 +00002405defm VSHRN : N2VNSh_HSD<0,1,0b1000,0,0,1, IIC_VSHLiD, "vshrn", "i",
2406 NEONvshrn>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002407
2408// VRSHL : Vector Rounding Shift
Johnny Chen7c3f3862010-03-17 23:26:50 +00002409defm VRSHLs : N3VInt_QHSD<0,0,0b0101,0, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
2410 IIC_VSHLi4Q, "vrshl", "s", int_arm_neon_vrshifts,0>;
2411defm VRSHLu : N3VInt_QHSD<1,0,0b0101,0, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
2412 IIC_VSHLi4Q, "vrshl", "u", int_arm_neon_vrshiftu,0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002413// VRSHR : Vector Rounding Shift Right
Bob Wilson1d2c4212010-02-17 00:31:29 +00002414defm VRSHRs : N2VSh_QHSD<0,1,0b0010,1, IIC_VSHLi4D, "vrshr", "s", NEONvrshrs>;
2415defm VRSHRu : N2VSh_QHSD<1,1,0b0010,1, IIC_VSHLi4D, "vrshr", "u", NEONvrshru>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002416
2417// VRSHRN : Vector Rounding Shift Right and Narrow
Evan Cheng09c61b32009-11-23 21:57:23 +00002418defm VRSHRN : N2VNSh_HSD<0, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vrshrn", "i",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002419 NEONvrshrn>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002420
2421// VQSHL : Vector Saturating Shift
Johnny Chen7c3f3862010-03-17 23:26:50 +00002422defm VQSHLs : N3VInt_QHSD<0,0,0b0100,1, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
2423 IIC_VSHLi4Q, "vqshl", "s", int_arm_neon_vqshifts,0>;
2424defm VQSHLu : N3VInt_QHSD<1,0,0b0100,1, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
2425 IIC_VSHLi4Q, "vqshl", "u", int_arm_neon_vqshiftu,0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002426// VQSHL : Vector Saturating Shift Left (Immediate)
Johnny Chen7c3f3862010-03-17 23:26:50 +00002427defm VQSHLsi : N2VSh_QHSD<0,1,0b0111,1, IIC_VSHLi4D, "vqshl", "s", NEONvqshls>;
2428defm VQSHLui : N2VSh_QHSD<1,1,0b0111,1, IIC_VSHLi4D, "vqshl", "u", NEONvqshlu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002429// VQSHLU : Vector Saturating Shift Left (Immediate, Unsigned)
Johnny Chen7c3f3862010-03-17 23:26:50 +00002430defm VQSHLsu : N2VSh_QHSD<1,1,0b0110,1, IIC_VSHLi4D, "vqshlu","s",NEONvqshlsu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002431
2432// VQSHRN : Vector Saturating Shift Right and Narrow
Evan Cheng09c61b32009-11-23 21:57:23 +00002433defm VQSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "s",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002434 NEONvqshrns>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002435defm VQSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "u",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002436 NEONvqshrnu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002437
2438// VQSHRUN : Vector Saturating Shift Right and Narrow (Unsigned)
Evan Cheng09c61b32009-11-23 21:57:23 +00002439defm VQSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 0, 1, IIC_VSHLi4D, "vqshrun", "s",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002440 NEONvqshrnsu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002441
2442// VQRSHL : Vector Saturating Rounding Shift
Johnny Chen7c3f3862010-03-17 23:26:50 +00002443defm VQRSHLs : N3VInt_QHSD<0,0,0b0101,1, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
2444 IIC_VSHLi4Q, "vqrshl", "s",
2445 int_arm_neon_vqrshifts, 0>;
2446defm VQRSHLu : N3VInt_QHSD<1,0,0b0101,1, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q,
2447 IIC_VSHLi4Q, "vqrshl", "u",
2448 int_arm_neon_vqrshiftu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002449
2450// VQRSHRN : Vector Saturating Rounding Shift Right and Narrow
Evan Cheng09c61b32009-11-23 21:57:23 +00002451defm VQRSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "s",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002452 NEONvqrshrns>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002453defm VQRSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "u",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002454 NEONvqrshrnu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002455
2456// VQRSHRUN : Vector Saturating Rounding Shift Right and Narrow (Unsigned)
Evan Cheng09c61b32009-11-23 21:57:23 +00002457defm VQRSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vqrshrun", "s",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002458 NEONvqrshrnsu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002459
2460// VSRA : Vector Shift Right and Accumulate
Evan Cheng09c61b32009-11-23 21:57:23 +00002461defm VSRAs : N2VShAdd_QHSD<0, 1, 0b0001, 1, "vsra", "s", NEONvshrs>;
2462defm VSRAu : N2VShAdd_QHSD<1, 1, 0b0001, 1, "vsra", "u", NEONvshru>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002463// VRSRA : Vector Rounding Shift Right and Accumulate
Evan Cheng09c61b32009-11-23 21:57:23 +00002464defm VRSRAs : N2VShAdd_QHSD<0, 1, 0b0011, 1, "vrsra", "s", NEONvrshrs>;
2465defm VRSRAu : N2VShAdd_QHSD<1, 1, 0b0011, 1, "vrsra", "u", NEONvrshru>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002466
2467// VSLI : Vector Shift Left and Insert
Johnny Chen7c3f3862010-03-17 23:26:50 +00002468defm VSLI : N2VShIns_QHSD<1, 1, 0b0101, 1, "vsli", NEONvsli>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002469// VSRI : Vector Shift Right and Insert
Evan Cheng09c61b32009-11-23 21:57:23 +00002470defm VSRI : N2VShIns_QHSD<1, 1, 0b0100, 1, "vsri", NEONvsri>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002471
2472// Vector Absolute and Saturating Absolute.
2473
2474// VABS : Vector Absolute Value
David Goodwin78caa122009-09-23 21:38:08 +00002475defm VABS : N2VInt_QHS<0b11, 0b11, 0b01, 0b00110, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002476 IIC_VUNAiD, IIC_VUNAiQ, "vabs", "s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002477 int_arm_neon_vabs>;
David Goodwin78caa122009-09-23 21:38:08 +00002478def VABSfd : N2VDInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002479 IIC_VUNAD, "vabs", "f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00002480 v2f32, v2f32, int_arm_neon_vabs>;
David Goodwin78caa122009-09-23 21:38:08 +00002481def VABSfq : N2VQInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002482 IIC_VUNAQ, "vabs", "f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00002483 v4f32, v4f32, int_arm_neon_vabs>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002484
2485// VQABS : Vector Saturating Absolute Value
David Goodwin78caa122009-09-23 21:38:08 +00002486defm VQABS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01110, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002487 IIC_VQUNAiD, IIC_VQUNAiQ, "vqabs", "s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002488 int_arm_neon_vqabs>;
2489
2490// Vector Negate.
2491
2492def vneg : PatFrag<(ops node:$in), (sub immAllZerosV, node:$in)>;
2493def vneg_conv : PatFrag<(ops node:$in), (sub immAllZerosV_bc, node:$in)>;
2494
Evan Cheng09c61b32009-11-23 21:57:23 +00002495class VNEGD<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
Bob Wilsone60fee02009-06-22 23:27:02 +00002496 : N2V<0b11, 0b11, size, 0b01, 0b00111, 0, 0, (outs DPR:$dst), (ins DPR:$src),
Evan Cheng09c61b32009-11-23 21:57:23 +00002497 IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002498 [(set DPR:$dst, (Ty (vneg DPR:$src)))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002499class VNEGQ<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
Bob Wilsone60fee02009-06-22 23:27:02 +00002500 : N2V<0b11, 0b11, size, 0b01, 0b00111, 1, 0, (outs QPR:$dst), (ins QPR:$src),
Evan Cheng09c61b32009-11-23 21:57:23 +00002501 IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002502 [(set QPR:$dst, (Ty (vneg QPR:$src)))]>;
2503
2504// VNEG : Vector Negate
Evan Cheng09c61b32009-11-23 21:57:23 +00002505def VNEGs8d : VNEGD<0b00, "vneg", "s8", v8i8>;
2506def VNEGs16d : VNEGD<0b01, "vneg", "s16", v4i16>;
2507def VNEGs32d : VNEGD<0b10, "vneg", "s32", v2i32>;
2508def VNEGs8q : VNEGQ<0b00, "vneg", "s8", v16i8>;
2509def VNEGs16q : VNEGQ<0b01, "vneg", "s16", v8i16>;
2510def VNEGs32q : VNEGQ<0b10, "vneg", "s32", v4i32>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002511
2512// VNEG : Vector Negate (floating-point)
Bob Wilson154999f2010-02-17 22:23:11 +00002513def VNEGfd : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00002514 (outs DPR:$dst), (ins DPR:$src), IIC_VUNAD,
Evan Cheng09c61b32009-11-23 21:57:23 +00002515 "vneg", "f32", "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002516 [(set DPR:$dst, (v2f32 (fneg DPR:$src)))]>;
2517def VNEGf32q : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 1, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00002518 (outs QPR:$dst), (ins QPR:$src), IIC_VUNAQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00002519 "vneg", "f32", "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002520 [(set QPR:$dst, (v4f32 (fneg QPR:$src)))]>;
2521
2522def : Pat<(v8i8 (vneg_conv DPR:$src)), (VNEGs8d DPR:$src)>;
2523def : Pat<(v4i16 (vneg_conv DPR:$src)), (VNEGs16d DPR:$src)>;
2524def : Pat<(v2i32 (vneg_conv DPR:$src)), (VNEGs32d DPR:$src)>;
2525def : Pat<(v16i8 (vneg_conv QPR:$src)), (VNEGs8q QPR:$src)>;
2526def : Pat<(v8i16 (vneg_conv QPR:$src)), (VNEGs16q QPR:$src)>;
2527def : Pat<(v4i32 (vneg_conv QPR:$src)), (VNEGs32q QPR:$src)>;
2528
2529// VQNEG : Vector Saturating Negate
David Goodwin78caa122009-09-23 21:38:08 +00002530defm VQNEG : N2VInt_QHS<0b11, 0b11, 0b00, 0b01111, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002531 IIC_VQUNAiD, IIC_VQUNAiQ, "vqneg", "s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002532 int_arm_neon_vqneg>;
2533
2534// Vector Bit Counting Operations.
2535
2536// VCLS : Vector Count Leading Sign Bits
David Goodwin78caa122009-09-23 21:38:08 +00002537defm VCLS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01000, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002538 IIC_VCNTiD, IIC_VCNTiQ, "vcls", "s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002539 int_arm_neon_vcls>;
2540// VCLZ : Vector Count Leading Zeros
David Goodwin78caa122009-09-23 21:38:08 +00002541defm VCLZ : N2VInt_QHS<0b11, 0b11, 0b00, 0b01001, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002542 IIC_VCNTiD, IIC_VCNTiQ, "vclz", "i",
Bob Wilsone60fee02009-06-22 23:27:02 +00002543 int_arm_neon_vclz>;
2544// VCNT : Vector Count One Bits
David Goodwin78caa122009-09-23 21:38:08 +00002545def VCNTd : N2VDInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002546 IIC_VCNTiD, "vcnt", "8",
Bob Wilsone60fee02009-06-22 23:27:02 +00002547 v8i8, v8i8, int_arm_neon_vcnt>;
David Goodwin78caa122009-09-23 21:38:08 +00002548def VCNTq : N2VQInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002549 IIC_VCNTiQ, "vcnt", "8",
Bob Wilsone60fee02009-06-22 23:27:02 +00002550 v16i8, v16i8, int_arm_neon_vcnt>;
2551
Johnny Chened5852c2010-02-24 20:06:07 +00002552// Vector Swap -- for disassembly only.
2553def VSWPd : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 0, 0,
2554 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
2555 "vswp", "$dst, $src", "", []>;
2556def VSWPq : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 1, 0,
2557 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
2558 "vswp", "$dst, $src", "", []>;
2559
Bob Wilsone60fee02009-06-22 23:27:02 +00002560// Vector Move Operations.
2561
2562// VMOV : Vector Move (Register)
2563
Evan Cheng09c61b32009-11-23 21:57:23 +00002564def VMOVDneon: N3VX<0, 0, 0b10, 0b0001, 0, 1, (outs DPR:$dst), (ins DPR:$src),
2565 IIC_VMOVD, "vmov", "$dst, $src", "", []>;
2566def VMOVQ : N3VX<0, 0, 0b10, 0b0001, 1, 1, (outs QPR:$dst), (ins QPR:$src),
2567 IIC_VMOVD, "vmov", "$dst, $src", "", []>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002568
2569// VMOV : Vector Move (Immediate)
2570
2571// VMOV_get_imm8 xform function: convert build_vector to VMOV.i8 imm.
2572def VMOV_get_imm8 : SDNodeXForm<build_vector, [{
2573 return ARM::getVMOVImm(N, 1, *CurDAG);
2574}]>;
2575def vmovImm8 : PatLeaf<(build_vector), [{
2576 return ARM::getVMOVImm(N, 1, *CurDAG).getNode() != 0;
2577}], VMOV_get_imm8>;
2578
2579// VMOV_get_imm16 xform function: convert build_vector to VMOV.i16 imm.
2580def VMOV_get_imm16 : SDNodeXForm<build_vector, [{
2581 return ARM::getVMOVImm(N, 2, *CurDAG);
2582}]>;
2583def vmovImm16 : PatLeaf<(build_vector), [{
2584 return ARM::getVMOVImm(N, 2, *CurDAG).getNode() != 0;
2585}], VMOV_get_imm16>;
2586
2587// VMOV_get_imm32 xform function: convert build_vector to VMOV.i32 imm.
2588def VMOV_get_imm32 : SDNodeXForm<build_vector, [{
2589 return ARM::getVMOVImm(N, 4, *CurDAG);
2590}]>;
2591def vmovImm32 : PatLeaf<(build_vector), [{
2592 return ARM::getVMOVImm(N, 4, *CurDAG).getNode() != 0;
2593}], VMOV_get_imm32>;
2594
2595// VMOV_get_imm64 xform function: convert build_vector to VMOV.i64 imm.
2596def VMOV_get_imm64 : SDNodeXForm<build_vector, [{
2597 return ARM::getVMOVImm(N, 8, *CurDAG);
2598}]>;
2599def vmovImm64 : PatLeaf<(build_vector), [{
2600 return ARM::getVMOVImm(N, 8, *CurDAG).getNode() != 0;
2601}], VMOV_get_imm64>;
2602
2603// Note: Some of the cmode bits in the following VMOV instructions need to
2604// be encoded based on the immed values.
2605
2606def VMOVv8i8 : N1ModImm<1, 0b000, 0b1110, 0, 0, 0, 1, (outs DPR:$dst),
Bob Wilson6a14a002009-11-06 23:33:28 +00002607 (ins h8imm:$SIMM), IIC_VMOVImm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002608 "vmov", "i8", "$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002609 [(set DPR:$dst, (v8i8 vmovImm8:$SIMM))]>;
2610def VMOVv16i8 : N1ModImm<1, 0b000, 0b1110, 0, 1, 0, 1, (outs QPR:$dst),
Bob Wilson6a14a002009-11-06 23:33:28 +00002611 (ins h8imm:$SIMM), IIC_VMOVImm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002612 "vmov", "i8", "$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002613 [(set QPR:$dst, (v16i8 vmovImm8:$SIMM))]>;
2614
Johnny Chencf4fad22009-12-01 00:02:02 +00002615def VMOVv4i16 : N1ModImm<1, 0b000, {1,0,?,?}, 0, 0, {?}, 1, (outs DPR:$dst),
Bob Wilson6a14a002009-11-06 23:33:28 +00002616 (ins h16imm:$SIMM), IIC_VMOVImm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002617 "vmov", "i16", "$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002618 [(set DPR:$dst, (v4i16 vmovImm16:$SIMM))]>;
Johnny Chencf4fad22009-12-01 00:02:02 +00002619def VMOVv8i16 : N1ModImm<1, 0b000, {1,0,?,?}, 0, 1, {?}, 1, (outs QPR:$dst),
Bob Wilson6a14a002009-11-06 23:33:28 +00002620 (ins h16imm:$SIMM), IIC_VMOVImm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002621 "vmov", "i16", "$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002622 [(set QPR:$dst, (v8i16 vmovImm16:$SIMM))]>;
2623
Johnny Chencf4fad22009-12-01 00:02:02 +00002624def VMOVv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, {?}, 1, (outs DPR:$dst),
Bob Wilson6a14a002009-11-06 23:33:28 +00002625 (ins h32imm:$SIMM), IIC_VMOVImm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002626 "vmov", "i32", "$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002627 [(set DPR:$dst, (v2i32 vmovImm32:$SIMM))]>;
Johnny Chencf4fad22009-12-01 00:02:02 +00002628def VMOVv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, {?}, 1, (outs QPR:$dst),
Bob Wilson6a14a002009-11-06 23:33:28 +00002629 (ins h32imm:$SIMM), IIC_VMOVImm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002630 "vmov", "i32", "$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002631 [(set QPR:$dst, (v4i32 vmovImm32:$SIMM))]>;
2632
2633def VMOVv1i64 : N1ModImm<1, 0b000, 0b1110, 0, 0, 1, 1, (outs DPR:$dst),
Bob Wilson6a14a002009-11-06 23:33:28 +00002634 (ins h64imm:$SIMM), IIC_VMOVImm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002635 "vmov", "i64", "$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002636 [(set DPR:$dst, (v1i64 vmovImm64:$SIMM))]>;
2637def VMOVv2i64 : N1ModImm<1, 0b000, 0b1110, 0, 1, 1, 1, (outs QPR:$dst),
Bob Wilson6a14a002009-11-06 23:33:28 +00002638 (ins h64imm:$SIMM), IIC_VMOVImm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002639 "vmov", "i64", "$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002640 [(set QPR:$dst, (v2i64 vmovImm64:$SIMM))]>;
2641
2642// VMOV : Vector Get Lane (move scalar to ARM core register)
2643
Johnny Chen0c1d2c12009-11-23 17:48:17 +00002644def VGETLNs8 : NVGetLane<{1,1,1,0,0,1,?,1}, 0b1011, {?,?},
Bob Wilson30ff4492009-08-21 21:58:55 +00002645 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00002646 IIC_VMOVSI, "vmov", "s8", "$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002647 [(set GPR:$dst, (NEONvgetlanes (v8i8 DPR:$src),
2648 imm:$lane))]>;
Johnny Chen0c1d2c12009-11-23 17:48:17 +00002649def VGETLNs16 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, {?,1},
Bob Wilson30ff4492009-08-21 21:58:55 +00002650 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00002651 IIC_VMOVSI, "vmov", "s16", "$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002652 [(set GPR:$dst, (NEONvgetlanes (v4i16 DPR:$src),
2653 imm:$lane))]>;
Johnny Chen0c1d2c12009-11-23 17:48:17 +00002654def VGETLNu8 : NVGetLane<{1,1,1,0,1,1,?,1}, 0b1011, {?,?},
Bob Wilson30ff4492009-08-21 21:58:55 +00002655 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00002656 IIC_VMOVSI, "vmov", "u8", "$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002657 [(set GPR:$dst, (NEONvgetlaneu (v8i8 DPR:$src),
2658 imm:$lane))]>;
Johnny Chen0c1d2c12009-11-23 17:48:17 +00002659def VGETLNu16 : NVGetLane<{1,1,1,0,1,0,?,1}, 0b1011, {?,1},
Bob Wilson30ff4492009-08-21 21:58:55 +00002660 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00002661 IIC_VMOVSI, "vmov", "u16", "$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002662 [(set GPR:$dst, (NEONvgetlaneu (v4i16 DPR:$src),
2663 imm:$lane))]>;
Johnny Chen0c1d2c12009-11-23 17:48:17 +00002664def VGETLNi32 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, 0b00,
Bob Wilson30ff4492009-08-21 21:58:55 +00002665 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00002666 IIC_VMOVSI, "vmov", "32", "$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002667 [(set GPR:$dst, (extractelt (v2i32 DPR:$src),
2668 imm:$lane))]>;
2669// def VGETLNf32: see FMRDH and FMRDL in ARMInstrVFP.td
2670def : Pat<(NEONvgetlanes (v16i8 QPR:$src), imm:$lane),
2671 (VGETLNs8 (v8i8 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002672 (DSubReg_i8_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002673 (SubReg_i8_lane imm:$lane))>;
2674def : Pat<(NEONvgetlanes (v8i16 QPR:$src), imm:$lane),
2675 (VGETLNs16 (v4i16 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002676 (DSubReg_i16_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002677 (SubReg_i16_lane imm:$lane))>;
2678def : Pat<(NEONvgetlaneu (v16i8 QPR:$src), imm:$lane),
2679 (VGETLNu8 (v8i8 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002680 (DSubReg_i8_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002681 (SubReg_i8_lane imm:$lane))>;
2682def : Pat<(NEONvgetlaneu (v8i16 QPR:$src), imm:$lane),
2683 (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002684 (DSubReg_i16_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002685 (SubReg_i16_lane imm:$lane))>;
2686def : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
2687 (VGETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002688 (DSubReg_i32_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002689 (SubReg_i32_lane imm:$lane))>;
Anton Korobeynikov44e0a6c2009-08-28 23:41:26 +00002690def : Pat<(extractelt (v2f32 DPR:$src1), imm:$src2),
Bob Wilson1d2c4212010-02-17 00:31:29 +00002691 (EXTRACT_SUBREG (v2f32 (COPY_TO_REGCLASS (v2f32 DPR:$src1),DPR_VFP2)),
Anton Korobeynikov3600d162009-09-12 22:21:08 +00002692 (SSubReg_f32_reg imm:$src2))>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002693def : Pat<(extractelt (v4f32 QPR:$src1), imm:$src2),
Bob Wilson1d2c4212010-02-17 00:31:29 +00002694 (EXTRACT_SUBREG (v4f32 (COPY_TO_REGCLASS (v4f32 QPR:$src1),QPR_VFP2)),
Anton Korobeynikov3600d162009-09-12 22:21:08 +00002695 (SSubReg_f32_reg imm:$src2))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002696//def : Pat<(extractelt (v2i64 QPR:$src1), imm:$src2),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002697// (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002698def : Pat<(extractelt (v2f64 QPR:$src1), imm:$src2),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002699 (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002700
2701
2702// VMOV : Vector Set Lane (move ARM core register to scalar)
2703
2704let Constraints = "$src1 = $dst" in {
Johnny Chen0c1d2c12009-11-23 17:48:17 +00002705def VSETLNi8 : NVSetLane<{1,1,1,0,0,1,?,0}, 0b1011, {?,?}, (outs DPR:$dst),
Bob Wilson30ff4492009-08-21 21:58:55 +00002706 (ins DPR:$src1, GPR:$src2, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00002707 IIC_VMOVISL, "vmov", "8", "$dst[$lane], $src2",
Bob Wilsone60fee02009-06-22 23:27:02 +00002708 [(set DPR:$dst, (vector_insert (v8i8 DPR:$src1),
2709 GPR:$src2, imm:$lane))]>;
Johnny Chen0c1d2c12009-11-23 17:48:17 +00002710def VSETLNi16 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, {?,1}, (outs DPR:$dst),
Bob Wilson30ff4492009-08-21 21:58:55 +00002711 (ins DPR:$src1, GPR:$src2, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00002712 IIC_VMOVISL, "vmov", "16", "$dst[$lane], $src2",
Bob Wilsone60fee02009-06-22 23:27:02 +00002713 [(set DPR:$dst, (vector_insert (v4i16 DPR:$src1),
2714 GPR:$src2, imm:$lane))]>;
Johnny Chen0c1d2c12009-11-23 17:48:17 +00002715def VSETLNi32 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, 0b00, (outs DPR:$dst),
Bob Wilson30ff4492009-08-21 21:58:55 +00002716 (ins DPR:$src1, GPR:$src2, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00002717 IIC_VMOVISL, "vmov", "32", "$dst[$lane], $src2",
Bob Wilsone60fee02009-06-22 23:27:02 +00002718 [(set DPR:$dst, (insertelt (v2i32 DPR:$src1),
2719 GPR:$src2, imm:$lane))]>;
2720}
2721def : Pat<(vector_insert (v16i8 QPR:$src1), GPR:$src2, imm:$lane),
2722 (v16i8 (INSERT_SUBREG QPR:$src1,
Chris Lattner4e624722010-03-08 18:51:21 +00002723 (v8i8 (VSETLNi8 (v8i8 (EXTRACT_SUBREG QPR:$src1,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002724 (DSubReg_i8_reg imm:$lane))),
Chris Lattner4e624722010-03-08 18:51:21 +00002725 GPR:$src2, (SubReg_i8_lane imm:$lane))),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002726 (DSubReg_i8_reg imm:$lane)))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002727def : Pat<(vector_insert (v8i16 QPR:$src1), GPR:$src2, imm:$lane),
2728 (v8i16 (INSERT_SUBREG QPR:$src1,
Chris Lattner4e624722010-03-08 18:51:21 +00002729 (v4i16 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002730 (DSubReg_i16_reg imm:$lane))),
Chris Lattner4e624722010-03-08 18:51:21 +00002731 GPR:$src2, (SubReg_i16_lane imm:$lane))),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002732 (DSubReg_i16_reg imm:$lane)))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002733def : Pat<(insertelt (v4i32 QPR:$src1), GPR:$src2, imm:$lane),
2734 (v4i32 (INSERT_SUBREG QPR:$src1,
Chris Lattner4e624722010-03-08 18:51:21 +00002735 (v2i32 (VSETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src1,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002736 (DSubReg_i32_reg imm:$lane))),
Chris Lattner4e624722010-03-08 18:51:21 +00002737 GPR:$src2, (SubReg_i32_lane imm:$lane))),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002738 (DSubReg_i32_reg imm:$lane)))>;
2739
Anton Korobeynikovd3352772009-08-30 19:06:39 +00002740def : Pat<(v2f32 (insertelt DPR:$src1, SPR:$src2, imm:$src3)),
Anton Korobeynikovd9331212009-11-02 00:11:39 +00002741 (INSERT_SUBREG (v2f32 (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2)),
2742 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002743def : Pat<(v4f32 (insertelt QPR:$src1, SPR:$src2, imm:$src3)),
Anton Korobeynikovd9331212009-11-02 00:11:39 +00002744 (INSERT_SUBREG (v4f32 (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2)),
2745 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002746
2747//def : Pat<(v2i64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002748// (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002749def : Pat<(v2f64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002750 (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002751
Anton Korobeynikovbaee7b22009-08-27 14:38:44 +00002752def : Pat<(v2f32 (scalar_to_vector SPR:$src)),
2753 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$src, arm_ssubreg_0)>;
Chris Lattnerc002b572010-03-15 00:52:43 +00002754def : Pat<(v2f64 (scalar_to_vector (f64 DPR:$src))),
Anton Korobeynikovbaee7b22009-08-27 14:38:44 +00002755 (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), DPR:$src, arm_dsubreg_0)>;
2756def : Pat<(v4f32 (scalar_to_vector SPR:$src)),
2757 (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), SPR:$src, arm_ssubreg_0)>;
2758
Anton Korobeynikov872393c2009-08-27 16:10:17 +00002759def : Pat<(v8i8 (scalar_to_vector GPR:$src)),
2760 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
2761def : Pat<(v4i16 (scalar_to_vector GPR:$src)),
2762 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
2763def : Pat<(v2i32 (scalar_to_vector GPR:$src)),
2764 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
2765
2766def : Pat<(v16i8 (scalar_to_vector GPR:$src)),
2767 (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)),
2768 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
2769 arm_dsubreg_0)>;
2770def : Pat<(v8i16 (scalar_to_vector GPR:$src)),
2771 (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)),
2772 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
2773 arm_dsubreg_0)>;
2774def : Pat<(v4i32 (scalar_to_vector GPR:$src)),
2775 (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)),
2776 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
2777 arm_dsubreg_0)>;
2778
Bob Wilsone60fee02009-06-22 23:27:02 +00002779// VDUP : Vector Duplicate (from ARM core register to all elements)
2780
Evan Cheng09c61b32009-11-23 21:57:23 +00002781class VDUPD<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
Bob Wilsone60fee02009-06-22 23:27:02 +00002782 : NVDup<opcod1, 0b1011, opcod3, (outs DPR:$dst), (ins GPR:$src),
Evan Cheng09c61b32009-11-23 21:57:23 +00002783 IIC_VMOVIS, "vdup", Dt, "$dst, $src",
Bob Wilsonf4f1a272009-08-14 05:13:08 +00002784 [(set DPR:$dst, (Ty (NEONvdup (i32 GPR:$src))))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002785class VDUPQ<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
Bob Wilsone60fee02009-06-22 23:27:02 +00002786 : NVDup<opcod1, 0b1011, opcod3, (outs QPR:$dst), (ins GPR:$src),
Evan Cheng09c61b32009-11-23 21:57:23 +00002787 IIC_VMOVIS, "vdup", Dt, "$dst, $src",
Bob Wilsonf4f1a272009-08-14 05:13:08 +00002788 [(set QPR:$dst, (Ty (NEONvdup (i32 GPR:$src))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002789
Evan Cheng09c61b32009-11-23 21:57:23 +00002790def VDUP8d : VDUPD<0b11101100, 0b00, "8", v8i8>;
2791def VDUP16d : VDUPD<0b11101000, 0b01, "16", v4i16>;
2792def VDUP32d : VDUPD<0b11101000, 0b00, "32", v2i32>;
2793def VDUP8q : VDUPQ<0b11101110, 0b00, "8", v16i8>;
2794def VDUP16q : VDUPQ<0b11101010, 0b01, "16", v8i16>;
2795def VDUP32q : VDUPQ<0b11101010, 0b00, "32", v4i32>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002796
2797def VDUPfd : NVDup<0b11101000, 0b1011, 0b00, (outs DPR:$dst), (ins GPR:$src),
Evan Cheng09c61b32009-11-23 21:57:23 +00002798 IIC_VMOVIS, "vdup", "32", "$dst, $src",
Bob Wilsonf4f1a272009-08-14 05:13:08 +00002799 [(set DPR:$dst, (v2f32 (NEONvdup
2800 (f32 (bitconvert GPR:$src)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002801def VDUPfq : NVDup<0b11101010, 0b1011, 0b00, (outs QPR:$dst), (ins GPR:$src),
Evan Cheng09c61b32009-11-23 21:57:23 +00002802 IIC_VMOVIS, "vdup", "32", "$dst, $src",
Bob Wilsonf4f1a272009-08-14 05:13:08 +00002803 [(set QPR:$dst, (v4f32 (NEONvdup
2804 (f32 (bitconvert GPR:$src)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002805
2806// VDUP : Vector Duplicate Lane (from scalar to all elements)
2807
Evan Cheng09c61b32009-11-23 21:57:23 +00002808class VDUPLND<bits<2> op19_18, bits<2> op17_16,
2809 string OpcodeStr, string Dt, ValueType Ty>
Johnny Chen9ee642f2009-11-23 21:00:43 +00002810 : N2V<0b11, 0b11, op19_18, op17_16, 0b11000, 0, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00002811 (outs DPR:$dst), (ins DPR:$src, nohash_imm:$lane), IIC_VMOVD,
Evan Cheng09c61b32009-11-23 21:57:23 +00002812 OpcodeStr, Dt, "$dst, $src[$lane]", "",
Bob Wilson206f6c42009-08-14 05:08:32 +00002813 [(set DPR:$dst, (Ty (NEONvduplane (Ty DPR:$src), imm:$lane)))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002814
Evan Cheng09c61b32009-11-23 21:57:23 +00002815class VDUPLNQ<bits<2> op19_18, bits<2> op17_16, string OpcodeStr, string Dt,
Johnny Chen9ee642f2009-11-23 21:00:43 +00002816 ValueType ResTy, ValueType OpTy>
2817 : N2V<0b11, 0b11, op19_18, op17_16, 0b11000, 1, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00002818 (outs QPR:$dst), (ins DPR:$src, nohash_imm:$lane), IIC_VMOVD,
Evan Cheng09c61b32009-11-23 21:57:23 +00002819 OpcodeStr, Dt, "$dst, $src[$lane]", "",
Bob Wilson206f6c42009-08-14 05:08:32 +00002820 [(set QPR:$dst, (ResTy (NEONvduplane (OpTy DPR:$src), imm:$lane)))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002821
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002822// Inst{19-16} is partially specified depending on the element size.
2823
Evan Cheng09c61b32009-11-23 21:57:23 +00002824def VDUPLN8d : VDUPLND<{?,?}, {?,1}, "vdup", "8", v8i8>;
2825def VDUPLN16d : VDUPLND<{?,?}, {1,0}, "vdup", "16", v4i16>;
2826def VDUPLN32d : VDUPLND<{?,1}, {0,0}, "vdup", "32", v2i32>;
2827def VDUPLNfd : VDUPLND<{?,1}, {0,0}, "vdup", "32", v2f32>;
2828def VDUPLN8q : VDUPLNQ<{?,?}, {?,1}, "vdup", "8", v16i8, v8i8>;
2829def VDUPLN16q : VDUPLNQ<{?,?}, {1,0}, "vdup", "16", v8i16, v4i16>;
2830def VDUPLN32q : VDUPLNQ<{?,1}, {0,0}, "vdup", "32", v4i32, v2i32>;
2831def VDUPLNfq : VDUPLNQ<{?,1}, {0,0}, "vdup", "32", v4f32, v2f32>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002832
Bob Wilson206f6c42009-08-14 05:08:32 +00002833def : Pat<(v16i8 (NEONvduplane (v16i8 QPR:$src), imm:$lane)),
2834 (v16i8 (VDUPLN8q (v8i8 (EXTRACT_SUBREG QPR:$src,
2835 (DSubReg_i8_reg imm:$lane))),
2836 (SubReg_i8_lane imm:$lane)))>;
2837def : Pat<(v8i16 (NEONvduplane (v8i16 QPR:$src), imm:$lane)),
2838 (v8i16 (VDUPLN16q (v4i16 (EXTRACT_SUBREG QPR:$src,
2839 (DSubReg_i16_reg imm:$lane))),
2840 (SubReg_i16_lane imm:$lane)))>;
2841def : Pat<(v4i32 (NEONvduplane (v4i32 QPR:$src), imm:$lane)),
2842 (v4i32 (VDUPLN32q (v2i32 (EXTRACT_SUBREG QPR:$src,
2843 (DSubReg_i32_reg imm:$lane))),
2844 (SubReg_i32_lane imm:$lane)))>;
2845def : Pat<(v4f32 (NEONvduplane (v4f32 QPR:$src), imm:$lane)),
2846 (v4f32 (VDUPLNfq (v2f32 (EXTRACT_SUBREG QPR:$src,
2847 (DSubReg_i32_reg imm:$lane))),
2848 (SubReg_i32_lane imm:$lane)))>;
2849
Johnny Chen9ee642f2009-11-23 21:00:43 +00002850def VDUPfdf : N2V<0b11, 0b11, {?,1}, {0,0}, 0b11000, 0, 0,
2851 (outs DPR:$dst), (ins SPR:$src),
Evan Cheng09c61b32009-11-23 21:57:23 +00002852 IIC_VMOVD, "vdup", "32", "$dst, ${src:lane}", "",
Johnny Chen9ee642f2009-11-23 21:00:43 +00002853 [(set DPR:$dst, (v2f32 (NEONvdup (f32 SPR:$src))))]>;
Anton Korobeynikov9c913fb2009-08-07 22:36:50 +00002854
Johnny Chen9ee642f2009-11-23 21:00:43 +00002855def VDUPfqf : N2V<0b11, 0b11, {?,1}, {0,0}, 0b11000, 1, 0,
2856 (outs QPR:$dst), (ins SPR:$src),
Evan Cheng09c61b32009-11-23 21:57:23 +00002857 IIC_VMOVD, "vdup", "32", "$dst, ${src:lane}", "",
Johnny Chen9ee642f2009-11-23 21:00:43 +00002858 [(set QPR:$dst, (v4f32 (NEONvdup (f32 SPR:$src))))]>;
Anton Korobeynikov9c913fb2009-08-07 22:36:50 +00002859
Anton Korobeynikovb261a192009-09-02 21:21:28 +00002860def : Pat<(v2i64 (NEONvduplane (v2i64 QPR:$src), imm:$lane)),
2861 (INSERT_SUBREG QPR:$src,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002862 (i64 (EXTRACT_SUBREG QPR:$src,
2863 (DSubReg_f64_reg imm:$lane))),
Anton Korobeynikovb261a192009-09-02 21:21:28 +00002864 (DSubReg_f64_other_reg imm:$lane))>;
2865def : Pat<(v2f64 (NEONvduplane (v2f64 QPR:$src), imm:$lane)),
2866 (INSERT_SUBREG QPR:$src,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002867 (f64 (EXTRACT_SUBREG QPR:$src,
2868 (DSubReg_f64_reg imm:$lane))),
Anton Korobeynikovb261a192009-09-02 21:21:28 +00002869 (DSubReg_f64_other_reg imm:$lane))>;
2870
Bob Wilsone60fee02009-06-22 23:27:02 +00002871// VMOVN : Vector Narrowing Move
Evan Cheng09c61b32009-11-23 21:57:23 +00002872defm VMOVN : N2VNInt_HSD<0b11,0b11,0b10,0b00100,0,0, IIC_VMOVD,
2873 "vmovn", "i", int_arm_neon_vmovn>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002874// VQMOVN : Vector Saturating Narrowing Move
Evan Cheng09c61b32009-11-23 21:57:23 +00002875defm VQMOVNs : N2VNInt_HSD<0b11,0b11,0b10,0b00101,0,0, IIC_VQUNAiD,
2876 "vqmovn", "s", int_arm_neon_vqmovns>;
2877defm VQMOVNu : N2VNInt_HSD<0b11,0b11,0b10,0b00101,1,0, IIC_VQUNAiD,
2878 "vqmovn", "u", int_arm_neon_vqmovnu>;
2879defm VQMOVNsu : N2VNInt_HSD<0b11,0b11,0b10,0b00100,1,0, IIC_VQUNAiD,
2880 "vqmovun", "s", int_arm_neon_vqmovnsu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002881// VMOVL : Vector Lengthening Move
Evan Cheng09c61b32009-11-23 21:57:23 +00002882defm VMOVLs : N2VLInt_QHS<0b01,0b10100,0,1, "vmovl", "s",
2883 int_arm_neon_vmovls>;
2884defm VMOVLu : N2VLInt_QHS<0b11,0b10100,0,1, "vmovl", "u",
2885 int_arm_neon_vmovlu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002886
2887// Vector Conversions.
2888
Johnny Chen09a43762010-03-17 17:52:21 +00002889// VCVT : Vector Convert Between Floating-Point and Integers
Johnny Chen7c3f3862010-03-17 23:26:50 +00002890def VCVTf2sd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
2891 v2i32, v2f32, fp_to_sint>;
2892def VCVTf2ud : N2VD<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
2893 v2i32, v2f32, fp_to_uint>;
2894def VCVTs2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
2895 v2f32, v2i32, sint_to_fp>;
2896def VCVTu2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
2897 v2f32, v2i32, uint_to_fp>;
Johnny Chen09a43762010-03-17 17:52:21 +00002898
Johnny Chen7c3f3862010-03-17 23:26:50 +00002899def VCVTf2sq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
2900 v4i32, v4f32, fp_to_sint>;
2901def VCVTf2uq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
2902 v4i32, v4f32, fp_to_uint>;
2903def VCVTs2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
2904 v4f32, v4i32, sint_to_fp>;
2905def VCVTu2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
2906 v4f32, v4i32, uint_to_fp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002907
2908// VCVT : Vector Convert Between Floating-Point and Fixed-Point.
Evan Cheng09c61b32009-11-23 21:57:23 +00002909def VCVTf2xsd : N2VCvtD<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
Bob Wilsone60fee02009-06-22 23:27:02 +00002910 v2i32, v2f32, int_arm_neon_vcvtfp2fxs>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002911def VCVTf2xud : N2VCvtD<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
Bob Wilsone60fee02009-06-22 23:27:02 +00002912 v2i32, v2f32, int_arm_neon_vcvtfp2fxu>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002913def VCVTxs2fd : N2VCvtD<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
Bob Wilsone60fee02009-06-22 23:27:02 +00002914 v2f32, v2i32, int_arm_neon_vcvtfxs2fp>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002915def VCVTxu2fd : N2VCvtD<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
Bob Wilsone60fee02009-06-22 23:27:02 +00002916 v2f32, v2i32, int_arm_neon_vcvtfxu2fp>;
2917
Evan Cheng09c61b32009-11-23 21:57:23 +00002918def VCVTf2xsq : N2VCvtQ<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
Bob Wilsone60fee02009-06-22 23:27:02 +00002919 v4i32, v4f32, int_arm_neon_vcvtfp2fxs>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002920def VCVTf2xuq : N2VCvtQ<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
Bob Wilsone60fee02009-06-22 23:27:02 +00002921 v4i32, v4f32, int_arm_neon_vcvtfp2fxu>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002922def VCVTxs2fq : N2VCvtQ<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
Bob Wilsone60fee02009-06-22 23:27:02 +00002923 v4f32, v4i32, int_arm_neon_vcvtfxs2fp>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002924def VCVTxu2fq : N2VCvtQ<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
Bob Wilsone60fee02009-06-22 23:27:02 +00002925 v4f32, v4i32, int_arm_neon_vcvtfxu2fp>;
2926
Bob Wilson08479272009-08-12 22:31:50 +00002927// Vector Reverse.
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002928
2929// VREV64 : Vector Reverse elements within 64-bit doublewords
2930
Evan Cheng09c61b32009-11-23 21:57:23 +00002931class VREV64D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002932 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 0, 0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002933 (ins DPR:$src), IIC_VMOVD,
Evan Cheng09c61b32009-11-23 21:57:23 +00002934 OpcodeStr, Dt, "$dst, $src", "",
Bob Wilson08479272009-08-12 22:31:50 +00002935 [(set DPR:$dst, (Ty (NEONvrev64 (Ty DPR:$src))))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002936class VREV64Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002937 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 1, 0, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002938 (ins QPR:$src), IIC_VMOVD,
Evan Cheng09c61b32009-11-23 21:57:23 +00002939 OpcodeStr, Dt, "$dst, $src", "",
Bob Wilson08479272009-08-12 22:31:50 +00002940 [(set QPR:$dst, (Ty (NEONvrev64 (Ty QPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002941
Evan Cheng09c61b32009-11-23 21:57:23 +00002942def VREV64d8 : VREV64D<0b00, "vrev64", "8", v8i8>;
2943def VREV64d16 : VREV64D<0b01, "vrev64", "16", v4i16>;
2944def VREV64d32 : VREV64D<0b10, "vrev64", "32", v2i32>;
2945def VREV64df : VREV64D<0b10, "vrev64", "32", v2f32>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002946
Evan Cheng09c61b32009-11-23 21:57:23 +00002947def VREV64q8 : VREV64Q<0b00, "vrev64", "8", v16i8>;
2948def VREV64q16 : VREV64Q<0b01, "vrev64", "16", v8i16>;
2949def VREV64q32 : VREV64Q<0b10, "vrev64", "32", v4i32>;
2950def VREV64qf : VREV64Q<0b10, "vrev64", "32", v4f32>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002951
2952// VREV32 : Vector Reverse elements within 32-bit words
2953
Evan Cheng09c61b32009-11-23 21:57:23 +00002954class VREV32D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002955 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 0, 0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002956 (ins DPR:$src), IIC_VMOVD,
Evan Cheng09c61b32009-11-23 21:57:23 +00002957 OpcodeStr, Dt, "$dst, $src", "",
Bob Wilson08479272009-08-12 22:31:50 +00002958 [(set DPR:$dst, (Ty (NEONvrev32 (Ty DPR:$src))))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002959class VREV32Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002960 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 1, 0, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002961 (ins QPR:$src), IIC_VMOVD,
Evan Cheng09c61b32009-11-23 21:57:23 +00002962 OpcodeStr, Dt, "$dst, $src", "",
Bob Wilson08479272009-08-12 22:31:50 +00002963 [(set QPR:$dst, (Ty (NEONvrev32 (Ty QPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002964
Evan Cheng09c61b32009-11-23 21:57:23 +00002965def VREV32d8 : VREV32D<0b00, "vrev32", "8", v8i8>;
2966def VREV32d16 : VREV32D<0b01, "vrev32", "16", v4i16>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002967
Evan Cheng09c61b32009-11-23 21:57:23 +00002968def VREV32q8 : VREV32Q<0b00, "vrev32", "8", v16i8>;
2969def VREV32q16 : VREV32Q<0b01, "vrev32", "16", v8i16>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002970
2971// VREV16 : Vector Reverse elements within 16-bit halfwords
2972
Evan Cheng09c61b32009-11-23 21:57:23 +00002973class VREV16D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002974 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 0, 0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002975 (ins DPR:$src), IIC_VMOVD,
Evan Cheng09c61b32009-11-23 21:57:23 +00002976 OpcodeStr, Dt, "$dst, $src", "",
Bob Wilson08479272009-08-12 22:31:50 +00002977 [(set DPR:$dst, (Ty (NEONvrev16 (Ty DPR:$src))))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002978class VREV16Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002979 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 1, 0, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00002980 (ins QPR:$src), IIC_VMOVD,
Evan Cheng09c61b32009-11-23 21:57:23 +00002981 OpcodeStr, Dt, "$dst, $src", "",
Bob Wilson08479272009-08-12 22:31:50 +00002982 [(set QPR:$dst, (Ty (NEONvrev16 (Ty QPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002983
Evan Cheng09c61b32009-11-23 21:57:23 +00002984def VREV16d8 : VREV16D<0b00, "vrev16", "8", v8i8>;
2985def VREV16q8 : VREV16Q<0b00, "vrev16", "8", v16i8>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00002986
Bob Wilson3ac39132009-08-19 17:03:43 +00002987// Other Vector Shuffles.
2988
2989// VEXT : Vector Extract
2990
Evan Cheng09c61b32009-11-23 21:57:23 +00002991class VEXTd<string OpcodeStr, string Dt, ValueType Ty>
Johnny Chen6c6fa9a2009-11-23 20:09:13 +00002992 : N3V<0,1,0b11,{?,?,?,?},0,0, (outs DPR:$dst),
2993 (ins DPR:$lhs, DPR:$rhs, i32imm:$index), IIC_VEXTD,
Evan Cheng09c61b32009-11-23 21:57:23 +00002994 OpcodeStr, Dt, "$dst, $lhs, $rhs, $index", "",
Johnny Chen6c6fa9a2009-11-23 20:09:13 +00002995 [(set DPR:$dst, (Ty (NEONvext (Ty DPR:$lhs),
2996 (Ty DPR:$rhs), imm:$index)))]>;
Anton Korobeynikov6c28c002009-08-21 12:40:21 +00002997
Evan Cheng09c61b32009-11-23 21:57:23 +00002998class VEXTq<string OpcodeStr, string Dt, ValueType Ty>
Johnny Chen6c6fa9a2009-11-23 20:09:13 +00002999 : N3V<0,1,0b11,{?,?,?,?},1,0, (outs QPR:$dst),
3000 (ins QPR:$lhs, QPR:$rhs, i32imm:$index), IIC_VEXTQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00003001 OpcodeStr, Dt, "$dst, $lhs, $rhs, $index", "",
Johnny Chen6c6fa9a2009-11-23 20:09:13 +00003002 [(set QPR:$dst, (Ty (NEONvext (Ty QPR:$lhs),
3003 (Ty QPR:$rhs), imm:$index)))]>;
Anton Korobeynikov6c28c002009-08-21 12:40:21 +00003004
Evan Cheng09c61b32009-11-23 21:57:23 +00003005def VEXTd8 : VEXTd<"vext", "8", v8i8>;
3006def VEXTd16 : VEXTd<"vext", "16", v4i16>;
3007def VEXTd32 : VEXTd<"vext", "32", v2i32>;
3008def VEXTdf : VEXTd<"vext", "32", v2f32>;
Anton Korobeynikov6c28c002009-08-21 12:40:21 +00003009
Evan Cheng09c61b32009-11-23 21:57:23 +00003010def VEXTq8 : VEXTq<"vext", "8", v16i8>;
3011def VEXTq16 : VEXTq<"vext", "16", v8i16>;
3012def VEXTq32 : VEXTq<"vext", "32", v4i32>;
3013def VEXTqf : VEXTq<"vext", "32", v4f32>;
Bob Wilson3ac39132009-08-19 17:03:43 +00003014
Bob Wilson3b169332009-08-08 05:53:00 +00003015// VTRN : Vector Transpose
3016
Evan Cheng09c61b32009-11-23 21:57:23 +00003017def VTRNd8 : N2VDShuffle<0b00, 0b00001, "vtrn", "8">;
3018def VTRNd16 : N2VDShuffle<0b01, 0b00001, "vtrn", "16">;
3019def VTRNd32 : N2VDShuffle<0b10, 0b00001, "vtrn", "32">;
Bob Wilson3b169332009-08-08 05:53:00 +00003020
Evan Cheng09c61b32009-11-23 21:57:23 +00003021def VTRNq8 : N2VQShuffle<0b00, 0b00001, IIC_VPERMQ, "vtrn", "8">;
3022def VTRNq16 : N2VQShuffle<0b01, 0b00001, IIC_VPERMQ, "vtrn", "16">;
3023def VTRNq32 : N2VQShuffle<0b10, 0b00001, IIC_VPERMQ, "vtrn", "32">;
Bob Wilson3b169332009-08-08 05:53:00 +00003024
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +00003025// VUZP : Vector Unzip (Deinterleave)
3026
Evan Cheng09c61b32009-11-23 21:57:23 +00003027def VUZPd8 : N2VDShuffle<0b00, 0b00010, "vuzp", "8">;
3028def VUZPd16 : N2VDShuffle<0b01, 0b00010, "vuzp", "16">;
3029def VUZPd32 : N2VDShuffle<0b10, 0b00010, "vuzp", "32">;
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +00003030
Evan Cheng09c61b32009-11-23 21:57:23 +00003031def VUZPq8 : N2VQShuffle<0b00, 0b00010, IIC_VPERMQ3, "vuzp", "8">;
3032def VUZPq16 : N2VQShuffle<0b01, 0b00010, IIC_VPERMQ3, "vuzp", "16">;
3033def VUZPq32 : N2VQShuffle<0b10, 0b00010, IIC_VPERMQ3, "vuzp", "32">;
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +00003034
3035// VZIP : Vector Zip (Interleave)
3036
Evan Cheng09c61b32009-11-23 21:57:23 +00003037def VZIPd8 : N2VDShuffle<0b00, 0b00011, "vzip", "8">;
3038def VZIPd16 : N2VDShuffle<0b01, 0b00011, "vzip", "16">;
3039def VZIPd32 : N2VDShuffle<0b10, 0b00011, "vzip", "32">;
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +00003040
Evan Cheng09c61b32009-11-23 21:57:23 +00003041def VZIPq8 : N2VQShuffle<0b00, 0b00011, IIC_VPERMQ3, "vzip", "8">;
3042def VZIPq16 : N2VQShuffle<0b01, 0b00011, IIC_VPERMQ3, "vzip", "16">;
3043def VZIPq32 : N2VQShuffle<0b10, 0b00011, IIC_VPERMQ3, "vzip", "32">;
Bob Wilson3b169332009-08-08 05:53:00 +00003044
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003045// Vector Table Lookup and Table Extension.
3046
3047// VTBL : Vector Table Lookup
3048def VTBL1
3049 : N3V<1,1,0b11,0b1000,0,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00003050 (ins DPR:$tbl1, DPR:$src), IIC_VTB1,
Evan Cheng09c61b32009-11-23 21:57:23 +00003051 "vtbl", "8", "$dst, \\{$tbl1\\}, $src", "",
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003052 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl1 DPR:$tbl1, DPR:$src)))]>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +00003053let hasExtraSrcRegAllocReq = 1 in {
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003054def VTBL2
3055 : N3V<1,1,0b11,0b1001,0,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00003056 (ins DPR:$tbl1, DPR:$tbl2, DPR:$src), IIC_VTB2,
Bob Wilson82dcfa32010-01-18 01:24:43 +00003057 "vtbl", "8", "$dst, \\{$tbl1, $tbl2\\}, $src", "",
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003058 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl2
3059 DPR:$tbl1, DPR:$tbl2, DPR:$src)))]>;
3060def VTBL3
3061 : N3V<1,1,0b11,0b1010,0,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00003062 (ins DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src), IIC_VTB3,
Bob Wilson82dcfa32010-01-18 01:24:43 +00003063 "vtbl", "8", "$dst, \\{$tbl1, $tbl2, $tbl3\\}, $src", "",
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003064 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl3
3065 DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src)))]>;
3066def VTBL4
3067 : N3V<1,1,0b11,0b1011,0,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00003068 (ins DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src), IIC_VTB4,
Bob Wilson82dcfa32010-01-18 01:24:43 +00003069 "vtbl", "8", "$dst, \\{$tbl1, $tbl2, $tbl3, $tbl4\\}, $src", "",
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003070 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl4 DPR:$tbl1, DPR:$tbl2,
3071 DPR:$tbl3, DPR:$tbl4, DPR:$src)))]>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +00003072} // hasExtraSrcRegAllocReq = 1
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003073
3074// VTBX : Vector Table Extension
3075def VTBX1
3076 : N3V<1,1,0b11,0b1000,1,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00003077 (ins DPR:$orig, DPR:$tbl1, DPR:$src), IIC_VTBX1,
Evan Cheng09c61b32009-11-23 21:57:23 +00003078 "vtbx", "8", "$dst, \\{$tbl1\\}, $src", "$orig = $dst",
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003079 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx1
3080 DPR:$orig, DPR:$tbl1, DPR:$src)))]>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +00003081let hasExtraSrcRegAllocReq = 1 in {
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003082def VTBX2
3083 : N3V<1,1,0b11,0b1001,1,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00003084 (ins DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$src), IIC_VTBX2,
Bob Wilson82dcfa32010-01-18 01:24:43 +00003085 "vtbx", "8", "$dst, \\{$tbl1, $tbl2\\}, $src", "$orig = $dst",
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003086 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx2
3087 DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$src)))]>;
3088def VTBX3
3089 : N3V<1,1,0b11,0b1010,1,0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00003090 (ins DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src), IIC_VTBX3,
Bob Wilson82dcfa32010-01-18 01:24:43 +00003091 "vtbx", "8", "$dst, \\{$tbl1, $tbl2, $tbl3\\}, $src", "$orig = $dst",
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003092 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx3 DPR:$orig, DPR:$tbl1,
3093 DPR:$tbl2, DPR:$tbl3, DPR:$src)))]>;
3094def VTBX4
3095 : N3V<1,1,0b11,0b1011,1,0, (outs DPR:$dst), (ins DPR:$orig, DPR:$tbl1,
David Goodwin36bff0c2009-09-25 18:38:29 +00003096 DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src), IIC_VTBX4,
Bob Wilson82dcfa32010-01-18 01:24:43 +00003097 "vtbx", "8", "$dst, \\{$tbl1, $tbl2, $tbl3, $tbl4\\}, $src",
3098 "$orig = $dst",
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003099 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx4 DPR:$orig, DPR:$tbl1,
3100 DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src)))]>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +00003101} // hasExtraSrcRegAllocReq = 1
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003102
Bob Wilsone60fee02009-06-22 23:27:02 +00003103//===----------------------------------------------------------------------===//
Evan Cheng46961d82009-08-07 19:30:41 +00003104// NEON instructions for single-precision FP math
3105//===----------------------------------------------------------------------===//
3106
Bob Wilson154999f2010-02-17 22:23:11 +00003107class N2VSPat<SDNode OpNode, ValueType ResTy, ValueType OpTy, NeonI Inst>
3108 : NEONFPPat<(ResTy (OpNode SPR:$a)),
Chris Lattner4e624722010-03-08 18:51:21 +00003109 (EXTRACT_SUBREG (OpTy (Inst (INSERT_SUBREG (OpTy (IMPLICIT_DEF)),
3110 SPR:$a, arm_ssubreg_0))),
Bob Wilson154999f2010-02-17 22:23:11 +00003111 arm_ssubreg_0)>;
3112
3113class N3VSPat<SDNode OpNode, NeonI Inst>
3114 : NEONFPPat<(f32 (OpNode SPR:$a, SPR:$b)),
Chris Lattner4e624722010-03-08 18:51:21 +00003115 (EXTRACT_SUBREG (v2f32
3116 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
3117 SPR:$a, arm_ssubreg_0),
3118 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
3119 SPR:$b, arm_ssubreg_0))),
Bob Wilson154999f2010-02-17 22:23:11 +00003120 arm_ssubreg_0)>;
3121
3122class N3VSMulOpPat<SDNode MulNode, SDNode OpNode, NeonI Inst>
3123 : NEONFPPat<(f32 (OpNode SPR:$acc, (f32 (MulNode SPR:$a, SPR:$b)))),
3124 (EXTRACT_SUBREG (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
3125 SPR:$acc, arm_ssubreg_0),
3126 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
3127 SPR:$a, arm_ssubreg_0),
3128 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
3129 SPR:$b, arm_ssubreg_0)),
3130 arm_ssubreg_0)>;
3131
Evan Cheng46961d82009-08-07 19:30:41 +00003132// These need separate instructions because they must use DPR_VFP2 register
3133// class which have SPR sub-registers.
3134
3135// Vector Add Operations used for single-precision FP
3136let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003137def VADDfd_sfp : N3VS<0,0,0b00,0b1101,0, "vadd", "f32", v2f32, v2f32, fadd, 1>;
3138def : N3VSPat<fadd, VADDfd_sfp>;
Evan Cheng46961d82009-08-07 19:30:41 +00003139
David Goodwin4b358db2009-08-10 22:17:39 +00003140// Vector Sub Operations used for single-precision FP
3141let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003142def VSUBfd_sfp : N3VS<0,0,0b10,0b1101,0, "vsub", "f32", v2f32, v2f32, fsub, 0>;
3143def : N3VSPat<fsub, VSUBfd_sfp>;
David Goodwin4b358db2009-08-10 22:17:39 +00003144
Evan Cheng46961d82009-08-07 19:30:41 +00003145// Vector Multiply Operations used for single-precision FP
3146let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003147def VMULfd_sfp : N3VS<1,0,0b00,0b1101,1, "vmul", "f32", v2f32, v2f32, fmul, 1>;
3148def : N3VSPat<fmul, VMULfd_sfp>;
Evan Cheng46961d82009-08-07 19:30:41 +00003149
3150// Vector Multiply-Accumulate/Subtract used for single-precision FP
Jim Grosbach67420bf2009-10-31 22:57:36 +00003151// vml[as].f32 can cause 4-8 cycle stalls in following ASIMD instructions, so
3152// we want to avoid them for now. e.g., alternating vmla/vadd instructions.
Evan Cheng46961d82009-08-07 19:30:41 +00003153
Jim Grosbach67420bf2009-10-31 22:57:36 +00003154//let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003155//def VMLAfd_sfp : N3VSMulOp<0,0,0b00,0b1101,1, IIC_VMACD, "vmla", "f32",
Bob Wilson1d2c4212010-02-17 00:31:29 +00003156// v2f32, fmul, fadd>;
Bob Wilson154999f2010-02-17 22:23:11 +00003157//def : N3VSMulOpPat<fmul, fadd, VMLAfd_sfp>;
Jim Grosbach67420bf2009-10-31 22:57:36 +00003158
3159//let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003160//def VMLSfd_sfp : N3VSMulOp<0,0,0b10,0b1101,1, IIC_VMACD, "vmls", "f32",
Bob Wilson1d2c4212010-02-17 00:31:29 +00003161// v2f32, fmul, fsub>;
Bob Wilson154999f2010-02-17 22:23:11 +00003162//def : N3VSMulOpPat<fmul, fsub, VMLSfd_sfp>;
Evan Cheng46961d82009-08-07 19:30:41 +00003163
David Goodwin4b358db2009-08-10 22:17:39 +00003164// Vector Absolute used for single-precision FP
Evan Cheng46961d82009-08-07 19:30:41 +00003165let neverHasSideEffects = 1 in
Bob Wilson7c7fe6e2010-02-17 22:42:54 +00003166def VABSfd_sfp : N2V<0b11, 0b11, 0b10, 0b01, 0b01110, 0, 0,
3167 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), IIC_VUNAD,
3168 "vabs", "f32", "$dst, $src", "", []>;
Bob Wilson154999f2010-02-17 22:23:11 +00003169def : N2VSPat<fabs, f32, v2f32, VABSfd_sfp>;
Evan Cheng46961d82009-08-07 19:30:41 +00003170
David Goodwin4b358db2009-08-10 22:17:39 +00003171// Vector Negate used for single-precision FP
Evan Cheng46961d82009-08-07 19:30:41 +00003172let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003173def VNEGfd_sfp : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
3174 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), IIC_VUNAD,
3175 "vneg", "f32", "$dst, $src", "", []>;
3176def : N2VSPat<fneg, f32, v2f32, VNEGfd_sfp>;
Evan Cheng46961d82009-08-07 19:30:41 +00003177
Bob Wilsonbc1d2dc2010-02-18 06:05:53 +00003178// Vector Maximum used for single-precision FP
3179let neverHasSideEffects = 1 in
3180def VMAXfd_sfp : N3V<0, 0, 0b00, 0b1111, 0, 0, (outs DPR_VFP2:$dst),
3181 (ins DPR_VFP2:$src1, DPR_VFP2:$src2), IIC_VBIND,
3182 "vmax", "f32", "$dst, $src1, $src2", "", []>;
3183def : N3VSPat<NEONfmax, VMAXfd_sfp>;
3184
3185// Vector Minimum used for single-precision FP
3186let neverHasSideEffects = 1 in
3187def VMINfd_sfp : N3V<0, 0, 0b00, 0b1111, 0, 0, (outs DPR_VFP2:$dst),
3188 (ins DPR_VFP2:$src1, DPR_VFP2:$src2), IIC_VBIND,
3189 "vmin", "f32", "$dst, $src1, $src2", "", []>;
3190def : N3VSPat<NEONfmin, VMINfd_sfp>;
3191
David Goodwin4b358db2009-08-10 22:17:39 +00003192// Vector Convert between single-precision FP and integer
3193let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003194def VCVTf2sd_sfp : N2VS<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
3195 v2i32, v2f32, fp_to_sint>;
Bob Wilson899588e2010-03-19 22:51:32 +00003196def : N2VSPat<arm_ftosi, f32, v2f32, VCVTf2sd_sfp>;
David Goodwin4b358db2009-08-10 22:17:39 +00003197
3198let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003199def VCVTf2ud_sfp : N2VS<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
3200 v2i32, v2f32, fp_to_uint>;
Bob Wilson899588e2010-03-19 22:51:32 +00003201def : N2VSPat<arm_ftoui, f32, v2f32, VCVTf2ud_sfp>;
David Goodwin4b358db2009-08-10 22:17:39 +00003202
3203let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003204def VCVTs2fd_sfp : N2VS<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
3205 v2f32, v2i32, sint_to_fp>;
Bob Wilson899588e2010-03-19 22:51:32 +00003206def : N2VSPat<arm_sitof, f32, v2i32, VCVTs2fd_sfp>;
David Goodwin4b358db2009-08-10 22:17:39 +00003207
3208let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003209def VCVTu2fd_sfp : N2VS<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
3210 v2f32, v2i32, uint_to_fp>;
Bob Wilson899588e2010-03-19 22:51:32 +00003211def : N2VSPat<arm_uitof, f32, v2i32, VCVTu2fd_sfp>;
David Goodwin4b358db2009-08-10 22:17:39 +00003212
Evan Cheng46961d82009-08-07 19:30:41 +00003213//===----------------------------------------------------------------------===//
Bob Wilsone60fee02009-06-22 23:27:02 +00003214// Non-Instruction Patterns
3215//===----------------------------------------------------------------------===//
3216
3217// bit_convert
3218def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (v1i64 DPR:$src)>;
3219def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (v1i64 DPR:$src)>;
3220def : Pat<(v1i64 (bitconvert (v8i8 DPR:$src))), (v1i64 DPR:$src)>;
3221def : Pat<(v1i64 (bitconvert (f64 DPR:$src))), (v1i64 DPR:$src)>;
3222def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (v1i64 DPR:$src)>;
3223def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (v2i32 DPR:$src)>;
3224def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (v2i32 DPR:$src)>;
3225def : Pat<(v2i32 (bitconvert (v8i8 DPR:$src))), (v2i32 DPR:$src)>;
3226def : Pat<(v2i32 (bitconvert (f64 DPR:$src))), (v2i32 DPR:$src)>;
3227def : Pat<(v2i32 (bitconvert (v2f32 DPR:$src))), (v2i32 DPR:$src)>;
3228def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (v4i16 DPR:$src)>;
3229def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (v4i16 DPR:$src)>;
3230def : Pat<(v4i16 (bitconvert (v8i8 DPR:$src))), (v4i16 DPR:$src)>;
3231def : Pat<(v4i16 (bitconvert (f64 DPR:$src))), (v4i16 DPR:$src)>;
3232def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (v4i16 DPR:$src)>;
3233def : Pat<(v8i8 (bitconvert (v1i64 DPR:$src))), (v8i8 DPR:$src)>;
3234def : Pat<(v8i8 (bitconvert (v2i32 DPR:$src))), (v8i8 DPR:$src)>;
3235def : Pat<(v8i8 (bitconvert (v4i16 DPR:$src))), (v8i8 DPR:$src)>;
3236def : Pat<(v8i8 (bitconvert (f64 DPR:$src))), (v8i8 DPR:$src)>;
3237def : Pat<(v8i8 (bitconvert (v2f32 DPR:$src))), (v8i8 DPR:$src)>;
3238def : Pat<(f64 (bitconvert (v1i64 DPR:$src))), (f64 DPR:$src)>;
3239def : Pat<(f64 (bitconvert (v2i32 DPR:$src))), (f64 DPR:$src)>;
3240def : Pat<(f64 (bitconvert (v4i16 DPR:$src))), (f64 DPR:$src)>;
3241def : Pat<(f64 (bitconvert (v8i8 DPR:$src))), (f64 DPR:$src)>;
3242def : Pat<(f64 (bitconvert (v2f32 DPR:$src))), (f64 DPR:$src)>;
3243def : Pat<(v2f32 (bitconvert (f64 DPR:$src))), (v2f32 DPR:$src)>;
3244def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (v2f32 DPR:$src)>;
3245def : Pat<(v2f32 (bitconvert (v2i32 DPR:$src))), (v2f32 DPR:$src)>;
3246def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (v2f32 DPR:$src)>;
3247def : Pat<(v2f32 (bitconvert (v8i8 DPR:$src))), (v2f32 DPR:$src)>;
3248
3249def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (v2i64 QPR:$src)>;
3250def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (v2i64 QPR:$src)>;
3251def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (v2i64 QPR:$src)>;
3252def : Pat<(v2i64 (bitconvert (v2f64 QPR:$src))), (v2i64 QPR:$src)>;
3253def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (v2i64 QPR:$src)>;
3254def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (v4i32 QPR:$src)>;
3255def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (v4i32 QPR:$src)>;
3256def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (v4i32 QPR:$src)>;
3257def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (v4i32 QPR:$src)>;
3258def : Pat<(v4i32 (bitconvert (v4f32 QPR:$src))), (v4i32 QPR:$src)>;
3259def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (v8i16 QPR:$src)>;
3260def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (v8i16 QPR:$src)>;
3261def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (v8i16 QPR:$src)>;
3262def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (v8i16 QPR:$src)>;
3263def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (v8i16 QPR:$src)>;
3264def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (v16i8 QPR:$src)>;
3265def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (v16i8 QPR:$src)>;
3266def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (v16i8 QPR:$src)>;
3267def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (v16i8 QPR:$src)>;
3268def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (v16i8 QPR:$src)>;
3269def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (v4f32 QPR:$src)>;
3270def : Pat<(v4f32 (bitconvert (v4i32 QPR:$src))), (v4f32 QPR:$src)>;
3271def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (v4f32 QPR:$src)>;
3272def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (v4f32 QPR:$src)>;
3273def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (v4f32 QPR:$src)>;
3274def : Pat<(v2f64 (bitconvert (v2i64 QPR:$src))), (v2f64 QPR:$src)>;
3275def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (v2f64 QPR:$src)>;
3276def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (v2f64 QPR:$src)>;
3277def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (v2f64 QPR:$src)>;
3278def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (v2f64 QPR:$src)>;