blob: 197ec16eedea66e8f3c7fd1525d2a0655e03f7b2 [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
Evan Chengb8e418a2010-05-19 06:07:03 +0000118let mayLoad = 1, neverHasSideEffects = 1 in {
Bob Wilson35b8d262010-03-23 18:54:46 +0000119// Use vldmia to load a Q register as a D register pair.
120// This is equivalent to VLDMD except that it has a Q register operand
121// instead of a pair of D registers.
122def VLDMQ
123 : AXDI5<(outs QPR:$dst), (ins addrmode5:$addr, pred:$p),
124 IndexModeNone, IIC_fpLoadm,
125 "vldm${addr:submode}${p}\t${addr:base}, ${dst:dregpair}", "", []>;
Evan Chengb4593012010-05-13 01:12:06 +0000126
127// Use vld1 to load a Q register as a D register pair.
128// This alternative to VLDMQ allows an alignment to be specified.
129// This is equivalent to VLD1q64 except that it has a Q register operand.
130def VLD1q
131 : NLdSt<0,0b10,0b1010,0b1100, (outs QPR:$dst), (ins addrmode6:$addr),
132 IIC_VLD1, "vld1", "64", "${dst:dregpair}, $addr", "", []>;
Evan Chengb8e418a2010-05-19 06:07:03 +0000133} // mayLoad = 1, neverHasSideEffects = 1
Bob Wilson93e7f562010-03-23 05:25:43 +0000134
Evan Chengb8e418a2010-05-19 06:07:03 +0000135let mayStore = 1, neverHasSideEffects = 1 in {
Bob Wilson35b8d262010-03-23 18:54:46 +0000136// Use vstmia to store a Q register as a D register pair.
137// This is equivalent to VSTMD except that it has a Q register operand
138// instead of a pair of D registers.
139def VSTMQ
140 : AXDI5<(outs), (ins QPR:$src, addrmode5:$addr, pred:$p),
141 IndexModeNone, IIC_fpStorem,
142 "vstm${addr:submode}${p}\t${addr:base}, ${src:dregpair}", "", []>;
Evan Chengb4593012010-05-13 01:12:06 +0000143
144// Use vst1 to store a Q register as a D register pair.
145// This alternative to VSTMQ allows an alignment to be specified.
146// This is equivalent to VST1q64 except that it has a Q register operand.
147def VST1q
148 : NLdSt<0,0b00,0b1010,0b1100, (outs), (ins addrmode6:$addr, QPR:$src),
149 IIC_VST, "vst1", "64", "${src:dregpair}, $addr", "", []>;
Evan Chengb8e418a2010-05-19 06:07:03 +0000150} // mayStore = 1, neverHasSideEffects = 1
Bob Wilsond0a74632010-03-23 06:20:33 +0000151
Evan Chengb8e418a2010-05-19 06:07:03 +0000152let mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1 in {
Bob Wilson93e7f562010-03-23 05:25:43 +0000153
Bob Wilsoned592c02009-07-08 18:11:30 +0000154// VLD1 : Vector Load (multiple single elements)
Bob Wilson93e7f562010-03-23 05:25:43 +0000155class VLD1D<bits<4> op7_4, string Dt>
156 : NLdSt<0,0b10,0b0111,op7_4, (outs DPR:$dst),
157 (ins addrmode6:$addr), IIC_VLD1,
158 "vld1", Dt, "\\{$dst\\}, $addr", "", []>;
159class VLD1Q<bits<4> op7_4, string Dt>
160 : NLdSt<0,0b10,0b1010,op7_4, (outs DPR:$dst1, DPR:$dst2),
161 (ins addrmode6:$addr), IIC_VLD1,
162 "vld1", Dt, "\\{$dst1, $dst2\\}, $addr", "", []>;
Bob Wilsoned592c02009-07-08 18:11:30 +0000163
Bob Wilson93e7f562010-03-23 05:25:43 +0000164def VLD1d8 : VLD1D<0b0000, "8">;
165def VLD1d16 : VLD1D<0b0100, "16">;
166def VLD1d32 : VLD1D<0b1000, "32">;
167def VLD1d64 : VLD1D<0b1100, "64">;
Bob Wilsoned592c02009-07-08 18:11:30 +0000168
Bob Wilson93e7f562010-03-23 05:25:43 +0000169def VLD1q8 : VLD1Q<0b0000, "8">;
170def VLD1q16 : VLD1Q<0b0100, "16">;
171def VLD1q32 : VLD1Q<0b1000, "32">;
172def VLD1q64 : VLD1Q<0b1100, "64">;
Bob Wilson06ce5bf2010-03-20 17:59:03 +0000173
174// ...with address register writeback:
175class VLD1DWB<bits<4> op7_4, string Dt>
176 : NLdSt<0,0b10,0b0111,op7_4, (outs DPR:$dst, GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000177 (ins addrmode6:$addr, am6offset:$offset), IIC_VLD1,
178 "vld1", Dt, "\\{$dst\\}, $addr$offset",
Bob Wilson06ce5bf2010-03-20 17:59:03 +0000179 "$addr.addr = $wb", []>;
180class VLD1QWB<bits<4> op7_4, string Dt>
181 : NLdSt<0,0b10,0b1010,op7_4, (outs QPR:$dst, GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000182 (ins addrmode6:$addr, am6offset:$offset), IIC_VLD1,
183 "vld1", Dt, "${dst:dregpair}, $addr$offset",
Bob Wilson06ce5bf2010-03-20 17:59:03 +0000184 "$addr.addr = $wb", []>;
185
186def VLD1d8_UPD : VLD1DWB<0b0000, "8">;
187def VLD1d16_UPD : VLD1DWB<0b0100, "16">;
188def VLD1d32_UPD : VLD1DWB<0b1000, "32">;
189def VLD1d64_UPD : VLD1DWB<0b1100, "64">;
190
191def VLD1q8_UPD : VLD1QWB<0b0000, "8">;
192def VLD1q16_UPD : VLD1QWB<0b0100, "16">;
193def VLD1q32_UPD : VLD1QWB<0b1000, "32">;
194def VLD1q64_UPD : VLD1QWB<0b1100, "64">;
Bob Wilson06ce5bf2010-03-20 17:59:03 +0000195
Bob Wilsonf2cc3782010-03-22 18:22:06 +0000196// ...with 3 registers (some of these are only for the disassembler):
Bob Wilson70709822010-03-18 20:18:39 +0000197class VLD1D3<bits<4> op7_4, string Dt>
Bob Wilson15b46a42010-03-20 19:57:03 +0000198 : NLdSt<0,0b10,0b0110,op7_4, (outs DPR:$dst1, DPR:$dst2, DPR:$dst3),
Bob Wilson70709822010-03-18 20:18:39 +0000199 (ins addrmode6:$addr), IIC_VLD1, "vld1", Dt,
Bob Wilson331cdff2010-03-22 18:02:38 +0000200 "\\{$dst1, $dst2, $dst3\\}, $addr", "", []>;
Bob Wilson06ce5bf2010-03-20 17:59:03 +0000201class VLD1D3WB<bits<4> op7_4, string Dt>
202 : NLdSt<0,0b10,0b0110,op7_4, (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000203 (ins addrmode6:$addr, am6offset:$offset), IIC_VLD1, "vld1", Dt,
Bob Wilson331cdff2010-03-22 18:02:38 +0000204 "\\{$dst1, $dst2, $dst3\\}, $addr$offset", "$addr.addr = $wb", []>;
Bob Wilsonf2cc3782010-03-22 18:22:06 +0000205
206def VLD1d8T : VLD1D3<0b0000, "8">;
207def VLD1d16T : VLD1D3<0b0100, "16">;
208def VLD1d32T : VLD1D3<0b1000, "32">;
209def VLD1d64T : VLD1D3<0b1100, "64">;
210
211def VLD1d8T_UPD : VLD1D3WB<0b0000, "8">;
212def VLD1d16T_UPD : VLD1D3WB<0b0100, "16">;
213def VLD1d32T_UPD : VLD1D3WB<0b1000, "32">;
Bob Wilsond9933102010-03-22 20:31:39 +0000214def VLD1d64T_UPD : VLD1D3WB<0b1100, "64">;
Bob Wilsonf2cc3782010-03-22 18:22:06 +0000215
216// ...with 4 registers (some of these are only for the disassembler):
217class VLD1D4<bits<4> op7_4, string Dt>
218 : NLdSt<0,0b10,0b0010,op7_4,(outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4),
219 (ins addrmode6:$addr), IIC_VLD1, "vld1", Dt,
220 "\\{$dst1, $dst2, $dst3, $dst4\\}, $addr", "", []>;
Bob Wilson06ce5bf2010-03-20 17:59:03 +0000221class VLD1D4WB<bits<4> op7_4, string Dt>
222 : NLdSt<0,0b10,0b0010,op7_4,
223 (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000224 (ins addrmode6:$addr, am6offset:$offset), IIC_VLD1, "vld1", Dt,
225 "\\{$dst1, $dst2, $dst3, $dst4\\}, $addr$offset", "$addr.addr = $wb",
Bob Wilson331cdff2010-03-22 18:02:38 +0000226 []>;
Johnny Chen39fb1242010-02-23 20:51:23 +0000227
Bob Wilsonf2cc3782010-03-22 18:22:06 +0000228def VLD1d8Q : VLD1D4<0b0000, "8">;
229def VLD1d16Q : VLD1D4<0b0100, "16">;
230def VLD1d32Q : VLD1D4<0b1000, "32">;
231def VLD1d64Q : VLD1D4<0b1100, "64">;
Bob Wilson06ce5bf2010-03-20 17:59:03 +0000232
233def VLD1d8Q_UPD : VLD1D4WB<0b0000, "8">;
234def VLD1d16Q_UPD : VLD1D4WB<0b0100, "16">;
235def VLD1d32Q_UPD : VLD1D4WB<0b1000, "32">;
Bob Wilson0ae84492010-03-22 18:13:18 +0000236def VLD1d64Q_UPD : VLD1D4WB<0b1100, "64">;
Bob Wilson66b34002009-08-12 17:04:56 +0000237
Bob Wilson055a90d2009-08-05 00:49:09 +0000238// VLD2 : Vector Load (multiple 2-element structures)
Bob Wilson23406942010-03-20 18:14:26 +0000239class VLD2D<bits<4> op11_8, bits<4> op7_4, string Dt>
240 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$dst1, DPR:$dst2),
Bob Wilsonb1721162009-10-07 21:53:04 +0000241 (ins addrmode6:$addr), IIC_VLD2,
Bob Wilson70709822010-03-18 20:18:39 +0000242 "vld2", Dt, "\\{$dst1, $dst2\\}, $addr", "", []>;
243class VLD2Q<bits<4> op7_4, string Dt>
Bob Wilson23406942010-03-20 18:14:26 +0000244 : NLdSt<0, 0b10, 0b0011, op7_4,
Bob Wilsonb1721162009-10-07 21:53:04 +0000245 (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4),
Bob Wilsone9829ca2009-10-06 22:01:59 +0000246 (ins addrmode6:$addr), IIC_VLD2,
Bob Wilson70709822010-03-18 20:18:39 +0000247 "vld2", Dt, "\\{$dst1, $dst2, $dst3, $dst4\\}, $addr", "", []>;
Bob Wilson055a90d2009-08-05 00:49:09 +0000248
Bob Wilson23406942010-03-20 18:14:26 +0000249def VLD2d8 : VLD2D<0b1000, 0b0000, "8">;
250def VLD2d16 : VLD2D<0b1000, 0b0100, "16">;
251def VLD2d32 : VLD2D<0b1000, 0b1000, "32">;
Bob Wilson055a90d2009-08-05 00:49:09 +0000252
Bob Wilson70709822010-03-18 20:18:39 +0000253def VLD2q8 : VLD2Q<0b0000, "8">;
254def VLD2q16 : VLD2Q<0b0100, "16">;
255def VLD2q32 : VLD2Q<0b1000, "32">;
Bob Wilsone9829ca2009-10-06 22:01:59 +0000256
Bob Wilsone5cc8602010-03-20 20:10:51 +0000257// ...with address register writeback:
258class VLD2DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
259 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$dst1, DPR:$dst2, GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000260 (ins addrmode6:$addr, am6offset:$offset), IIC_VLD2,
261 "vld2", Dt, "\\{$dst1, $dst2\\}, $addr$offset",
Bob Wilsone5cc8602010-03-20 20:10:51 +0000262 "$addr.addr = $wb", []>;
263class VLD2QWB<bits<4> op7_4, string Dt>
264 : NLdSt<0, 0b10, 0b0011, op7_4,
265 (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000266 (ins addrmode6:$addr, am6offset:$offset), IIC_VLD2,
267 "vld2", Dt, "\\{$dst1, $dst2, $dst3, $dst4\\}, $addr$offset",
Bob Wilsone5cc8602010-03-20 20:10:51 +0000268 "$addr.addr = $wb", []>;
269
270def VLD2d8_UPD : VLD2DWB<0b1000, 0b0000, "8">;
271def VLD2d16_UPD : VLD2DWB<0b1000, 0b0100, "16">;
272def VLD2d32_UPD : VLD2DWB<0b1000, 0b1000, "32">;
Bob Wilsone5cc8602010-03-20 20:10:51 +0000273
274def VLD2q8_UPD : VLD2QWB<0b0000, "8">;
275def VLD2q16_UPD : VLD2QWB<0b0100, "16">;
276def VLD2q32_UPD : VLD2QWB<0b1000, "32">;
277
Bob Wilson23406942010-03-20 18:14:26 +0000278// ...with double-spaced registers (for disassembly only):
279def VLD2b8 : VLD2D<0b1001, 0b0000, "8">;
280def VLD2b16 : VLD2D<0b1001, 0b0100, "16">;
281def VLD2b32 : VLD2D<0b1001, 0b1000, "32">;
Bob Wilsone5cc8602010-03-20 20:10:51 +0000282def VLD2b8_UPD : VLD2DWB<0b1001, 0b0000, "8">;
283def VLD2b16_UPD : VLD2DWB<0b1001, 0b0100, "16">;
284def VLD2b32_UPD : VLD2DWB<0b1001, 0b1000, "32">;
Johnny Chen39fb1242010-02-23 20:51:23 +0000285
Bob Wilson055a90d2009-08-05 00:49:09 +0000286// VLD3 : Vector Load (multiple 3-element structures)
Bob Wilson23406942010-03-20 18:14:26 +0000287class VLD3D<bits<4> op11_8, bits<4> op7_4, string Dt>
288 : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$dst1, DPR:$dst2, DPR:$dst3),
Bob Wilsonb1721162009-10-07 21:53:04 +0000289 (ins addrmode6:$addr), IIC_VLD3,
Bob Wilson70709822010-03-18 20:18:39 +0000290 "vld3", Dt, "\\{$dst1, $dst2, $dst3\\}, $addr", "", []>;
Bob Wilson055a90d2009-08-05 00:49:09 +0000291
Bob Wilson23406942010-03-20 18:14:26 +0000292def VLD3d8 : VLD3D<0b0100, 0b0000, "8">;
293def VLD3d16 : VLD3D<0b0100, 0b0100, "16">;
294def VLD3d32 : VLD3D<0b0100, 0b1000, "32">;
Bob Wilson055a90d2009-08-05 00:49:09 +0000295
Bob Wilsone5cc8602010-03-20 20:10:51 +0000296// ...with address register writeback:
297class VLD3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
298 : NLdSt<0, 0b10, op11_8, op7_4,
299 (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000300 (ins addrmode6:$addr, am6offset:$offset), IIC_VLD3,
301 "vld3", Dt, "\\{$dst1, $dst2, $dst3\\}, $addr$offset",
Bob Wilsone5cc8602010-03-20 20:10:51 +0000302 "$addr.addr = $wb", []>;
303
304def VLD3d8_UPD : VLD3DWB<0b0100, 0b0000, "8">;
305def VLD3d16_UPD : VLD3DWB<0b0100, 0b0100, "16">;
306def VLD3d32_UPD : VLD3DWB<0b0100, 0b1000, "32">;
Bob Wilsone5cc8602010-03-20 20:10:51 +0000307
308// ...with double-spaced registers (non-updating versions for disassembly only):
Bob Wilson23406942010-03-20 18:14:26 +0000309def VLD3q8 : VLD3D<0b0101, 0b0000, "8">;
310def VLD3q16 : VLD3D<0b0101, 0b0100, "16">;
311def VLD3q32 : VLD3D<0b0101, 0b1000, "32">;
Bob Wilsone5cc8602010-03-20 20:10:51 +0000312def VLD3q8_UPD : VLD3DWB<0b0101, 0b0000, "8">;
313def VLD3q16_UPD : VLD3DWB<0b0101, 0b0100, "16">;
314def VLD3q32_UPD : VLD3DWB<0b0101, 0b1000, "32">;
Bob Wilson23406942010-03-20 18:14:26 +0000315
Bob Wilsone5cc8602010-03-20 20:10:51 +0000316// ...alternate versions to be allocated odd register numbers:
317def VLD3q8odd_UPD : VLD3DWB<0b0101, 0b0000, "8">;
318def VLD3q16odd_UPD : VLD3DWB<0b0101, 0b0100, "16">;
319def VLD3q32odd_UPD : VLD3DWB<0b0101, 0b1000, "32">;
Bob Wilsona8b43622009-10-07 17:24:55 +0000320
Bob Wilson055a90d2009-08-05 00:49:09 +0000321// VLD4 : Vector Load (multiple 4-element structures)
Bob Wilson23406942010-03-20 18:14:26 +0000322class VLD4D<bits<4> op11_8, bits<4> op7_4, string Dt>
323 : NLdSt<0, 0b10, op11_8, op7_4,
Bob Wilsonb1721162009-10-07 21:53:04 +0000324 (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4),
David Goodwin78caa122009-09-23 21:38:08 +0000325 (ins addrmode6:$addr), IIC_VLD4,
Bob Wilson70709822010-03-18 20:18:39 +0000326 "vld4", Dt, "\\{$dst1, $dst2, $dst3, $dst4\\}, $addr", "", []>;
Bob Wilson055a90d2009-08-05 00:49:09 +0000327
Bob Wilson23406942010-03-20 18:14:26 +0000328def VLD4d8 : VLD4D<0b0000, 0b0000, "8">;
329def VLD4d16 : VLD4D<0b0000, 0b0100, "16">;
330def VLD4d32 : VLD4D<0b0000, 0b1000, "32">;
Bob Wilsond14b8b62009-09-01 04:26:28 +0000331
Bob Wilsone5cc8602010-03-20 20:10:51 +0000332// ...with address register writeback:
333class VLD4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
334 : NLdSt<0, 0b10, op11_8, op7_4,
335 (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000336 (ins addrmode6:$addr, am6offset:$offset), IIC_VLD4,
337 "vld4", Dt, "\\{$dst1, $dst2, $dst3, $dst4\\}, $addr$offset",
Bob Wilsone5cc8602010-03-20 20:10:51 +0000338 "$addr.addr = $wb", []>;
339
340def VLD4d8_UPD : VLD4DWB<0b0000, 0b0000, "8">;
341def VLD4d16_UPD : VLD4DWB<0b0000, 0b0100, "16">;
342def VLD4d32_UPD : VLD4DWB<0b0000, 0b1000, "32">;
Bob Wilsone5cc8602010-03-20 20:10:51 +0000343
344// ...with double-spaced registers (non-updating versions for disassembly only):
Bob Wilson23406942010-03-20 18:14:26 +0000345def VLD4q8 : VLD4D<0b0001, 0b0000, "8">;
346def VLD4q16 : VLD4D<0b0001, 0b0100, "16">;
347def VLD4q32 : VLD4D<0b0001, 0b1000, "32">;
Bob Wilsone5cc8602010-03-20 20:10:51 +0000348def VLD4q8_UPD : VLD4DWB<0b0001, 0b0000, "8">;
349def VLD4q16_UPD : VLD4DWB<0b0001, 0b0100, "16">;
350def VLD4q32_UPD : VLD4DWB<0b0001, 0b1000, "32">;
Bob Wilson23406942010-03-20 18:14:26 +0000351
Bob Wilsone5cc8602010-03-20 20:10:51 +0000352// ...alternate versions to be allocated odd register numbers:
353def VLD4q8odd_UPD : VLD4DWB<0b0001, 0b0000, "8">;
354def VLD4q16odd_UPD : VLD4DWB<0b0001, 0b0100, "16">;
355def VLD4q32odd_UPD : VLD4DWB<0b0001, 0b1000, "32">;
Bob Wilsonb1721162009-10-07 21:53:04 +0000356
357// VLD1LN : Vector Load (single element to one lane)
358// FIXME: Not yet implemented.
Bob Wilson004a2e12009-10-07 18:09:32 +0000359
Bob Wilsond14b8b62009-09-01 04:26:28 +0000360// VLD2LN : Vector Load (single 2-element structure to one lane)
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000361class VLD2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
362 : NLdSt<1, 0b10, op11_8, op7_4, (outs DPR:$dst1, DPR:$dst2),
Bob Wilsond22476d2010-03-20 20:39:53 +0000363 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, nohash_imm:$lane),
364 IIC_VLD2, "vld2", Dt, "\\{$dst1[$lane], $dst2[$lane]\\}, $addr",
365 "$src1 = $dst1, $src2 = $dst2", []>;
Bob Wilsond14b8b62009-09-01 04:26:28 +0000366
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000367def VLD2LNd8 : VLD2LN<0b0001, {?,?,?,?}, "8">;
368def VLD2LNd16 : VLD2LN<0b0101, {?,?,0,?}, "16">;
369def VLD2LNd32 : VLD2LN<0b1001, {?,0,?,?}, "32">;
Bob Wilson5687d8a2009-10-08 18:56:10 +0000370
Bob Wilsond22476d2010-03-20 20:39:53 +0000371// ...with double-spaced registers:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000372def VLD2LNq16 : VLD2LN<0b0101, {?,?,1,?}, "16">;
373def VLD2LNq32 : VLD2LN<0b1001, {?,1,?,?}, "32">;
Bob Wilson5687d8a2009-10-08 18:56:10 +0000374
Bob Wilsond22476d2010-03-20 20:39:53 +0000375// ...alternate versions to be allocated odd register numbers:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000376def VLD2LNq16odd : VLD2LN<0b0101, {?,?,1,?}, "16">;
377def VLD2LNq32odd : VLD2LN<0b1001, {?,1,?,?}, "32">;
Bob Wilsond14b8b62009-09-01 04:26:28 +0000378
Bob Wilson29133b02010-03-20 20:47:18 +0000379// ...with address register writeback:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000380class VLD2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
381 : NLdSt<1, 0b10, op11_8, op7_4, (outs DPR:$dst1, DPR:$dst2, GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000382 (ins addrmode6:$addr, am6offset:$offset,
Bob Wilson29133b02010-03-20 20:47:18 +0000383 DPR:$src1, DPR:$src2, nohash_imm:$lane), IIC_VLD2, "vld2", Dt,
Bob Wilson255e7482010-03-20 22:13:40 +0000384 "\\{$dst1[$lane], $dst2[$lane]\\}, $addr$offset",
Bob Wilson29133b02010-03-20 20:47:18 +0000385 "$src1 = $dst1, $src2 = $dst2, $addr.addr = $wb", []>;
386
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000387def VLD2LNd8_UPD : VLD2LNWB<0b0001, {?,?,?,?}, "8">;
388def VLD2LNd16_UPD : VLD2LNWB<0b0101, {?,?,0,?}, "16">;
389def VLD2LNd32_UPD : VLD2LNWB<0b1001, {?,0,?,?}, "32">;
Bob Wilson29133b02010-03-20 20:47:18 +0000390
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000391def VLD2LNq16_UPD : VLD2LNWB<0b0101, {?,?,1,?}, "16">;
392def VLD2LNq32_UPD : VLD2LNWB<0b1001, {?,1,?,?}, "32">;
Bob Wilson29133b02010-03-20 20:47:18 +0000393
Bob Wilsond14b8b62009-09-01 04:26:28 +0000394// VLD3LN : Vector Load (single 3-element structure to one lane)
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000395class VLD3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
396 : NLdSt<1, 0b10, op11_8, op7_4, (outs DPR:$dst1, DPR:$dst2, DPR:$dst3),
Bob Wilsond22476d2010-03-20 20:39:53 +0000397 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3,
398 nohash_imm:$lane), IIC_VLD3, "vld3", Dt,
399 "\\{$dst1[$lane], $dst2[$lane], $dst3[$lane]\\}, $addr",
400 "$src1 = $dst1, $src2 = $dst2, $src3 = $dst3", []>;
Bob Wilsond14b8b62009-09-01 04:26:28 +0000401
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000402def VLD3LNd8 : VLD3LN<0b0010, {?,?,?,0}, "8">;
403def VLD3LNd16 : VLD3LN<0b0110, {?,?,0,0}, "16">;
404def VLD3LNd32 : VLD3LN<0b1010, {?,0,0,0}, "32">;
Bob Wilson47a1ff62009-10-08 22:27:33 +0000405
Bob Wilsond22476d2010-03-20 20:39:53 +0000406// ...with double-spaced registers:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000407def VLD3LNq16 : VLD3LN<0b0110, {?,?,1,0}, "16">;
408def VLD3LNq32 : VLD3LN<0b1010, {?,1,0,0}, "32">;
Bob Wilson47a1ff62009-10-08 22:27:33 +0000409
Bob Wilsond22476d2010-03-20 20:39:53 +0000410// ...alternate versions to be allocated odd register numbers:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000411def VLD3LNq16odd : VLD3LN<0b0110, {?,?,1,0}, "16">;
412def VLD3LNq32odd : VLD3LN<0b1010, {?,1,0,0}, "32">;
Bob Wilsond14b8b62009-09-01 04:26:28 +0000413
Bob Wilson29133b02010-03-20 20:47:18 +0000414// ...with address register writeback:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000415class VLD3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
416 : NLdSt<1, 0b10, op11_8, op7_4,
Bob Wilson29133b02010-03-20 20:47:18 +0000417 (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000418 (ins addrmode6:$addr, am6offset:$offset,
Bob Wilson29133b02010-03-20 20:47:18 +0000419 DPR:$src1, DPR:$src2, DPR:$src3, nohash_imm:$lane),
420 IIC_VLD3, "vld3", Dt,
Bob Wilson255e7482010-03-20 22:13:40 +0000421 "\\{$dst1[$lane], $dst2[$lane], $dst3[$lane]\\}, $addr$offset",
Bob Wilson29133b02010-03-20 20:47:18 +0000422 "$src1 = $dst1, $src2 = $dst2, $src3 = $dst3, $addr.addr = $wb",
423 []>;
424
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000425def VLD3LNd8_UPD : VLD3LNWB<0b0010, {?,?,?,0}, "8">;
426def VLD3LNd16_UPD : VLD3LNWB<0b0110, {?,?,0,0}, "16">;
427def VLD3LNd32_UPD : VLD3LNWB<0b1010, {?,0,0,0}, "32">;
Bob Wilson29133b02010-03-20 20:47:18 +0000428
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000429def VLD3LNq16_UPD : VLD3LNWB<0b0110, {?,?,1,0}, "16">;
430def VLD3LNq32_UPD : VLD3LNWB<0b1010, {?,1,0,0}, "32">;
Bob Wilson29133b02010-03-20 20:47:18 +0000431
Bob Wilsond14b8b62009-09-01 04:26:28 +0000432// VLD4LN : Vector Load (single 4-element structure to one lane)
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000433class VLD4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
434 : NLdSt<1, 0b10, op11_8, op7_4,
Bob Wilsond22476d2010-03-20 20:39:53 +0000435 (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4),
436 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4,
437 nohash_imm:$lane), IIC_VLD4, "vld4", Dt,
Bob Wilson82dcfa32010-01-18 01:24:43 +0000438 "\\{$dst1[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $addr",
Bob Wilsond22476d2010-03-20 20:39:53 +0000439 "$src1 = $dst1, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4", []>;
Bob Wilsond14b8b62009-09-01 04:26:28 +0000440
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000441def VLD4LNd8 : VLD4LN<0b0011, {?,?,?,?}, "8">;
442def VLD4LNd16 : VLD4LN<0b0111, {?,?,0,?}, "16">;
443def VLD4LNd32 : VLD4LN<0b1011, {?,0,?,?}, "32">;
Bob Wilson7a8c6df2009-10-08 22:53:57 +0000444
Bob Wilsond22476d2010-03-20 20:39:53 +0000445// ...with double-spaced registers:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000446def VLD4LNq16 : VLD4LN<0b0111, {?,?,1,?}, "16">;
447def VLD4LNq32 : VLD4LN<0b1011, {?,1,?,?}, "32">;
Bob Wilson7a8c6df2009-10-08 22:53:57 +0000448
Bob Wilsond22476d2010-03-20 20:39:53 +0000449// ...alternate versions to be allocated odd register numbers:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000450def VLD4LNq16odd : VLD4LN<0b0111, {?,?,1,?}, "16">;
451def VLD4LNq32odd : VLD4LN<0b1011, {?,1,?,?}, "32">;
Bob Wilsonb1721162009-10-07 21:53:04 +0000452
Bob Wilson29133b02010-03-20 20:47:18 +0000453// ...with address register writeback:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000454class VLD4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
455 : NLdSt<1, 0b10, op11_8, op7_4,
Bob Wilson29133b02010-03-20 20:47:18 +0000456 (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000457 (ins addrmode6:$addr, am6offset:$offset,
Bob Wilson29133b02010-03-20 20:47:18 +0000458 DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
459 IIC_VLD4, "vld4", Dt,
Bob Wilson255e7482010-03-20 22:13:40 +0000460"\\{$dst1[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $addr$offset",
Bob Wilson29133b02010-03-20 20:47:18 +0000461"$src1 = $dst1, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4, $addr.addr = $wb",
462 []>;
463
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000464def VLD4LNd8_UPD : VLD4LNWB<0b0011, {?,?,?,?}, "8">;
465def VLD4LNd16_UPD : VLD4LNWB<0b0111, {?,?,0,?}, "16">;
466def VLD4LNd32_UPD : VLD4LNWB<0b1011, {?,0,?,?}, "32">;
Bob Wilson29133b02010-03-20 20:47:18 +0000467
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000468def VLD4LNq16_UPD : VLD4LNWB<0b0111, {?,?,1,?}, "16">;
469def VLD4LNq32_UPD : VLD4LNWB<0b1011, {?,1,?,?}, "32">;
Bob Wilson29133b02010-03-20 20:47:18 +0000470
Bob Wilsonb1721162009-10-07 21:53:04 +0000471// VLD1DUP : Vector Load (single element to all lanes)
472// VLD2DUP : Vector Load (single 2-element structure to all lanes)
473// VLD3DUP : Vector Load (single 3-element structure to all lanes)
474// VLD4DUP : Vector Load (single 4-element structure to all lanes)
475// FIXME: Not yet implemented.
Evan Chengb8e418a2010-05-19 06:07:03 +0000476} // mayLoad = 1, neverHasSideEffects = 1, hasExtraDefRegAllocReq = 1
Bob Wilsonee27bec2009-08-12 00:49:01 +0000477
Evan Chengb8e418a2010-05-19 06:07:03 +0000478let mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1 in {
Bob Wilson68774212010-03-20 20:54:36 +0000479
Bob Wilsond0a74632010-03-23 06:20:33 +0000480// VST1 : Vector Store (multiple single elements)
481class VST1D<bits<4> op7_4, string Dt>
482 : NLdSt<0,0b00,0b0111,op7_4, (outs), (ins addrmode6:$addr, DPR:$src), IIC_VST,
483 "vst1", Dt, "\\{$src\\}, $addr", "", []>;
484class VST1Q<bits<4> op7_4, string Dt>
485 : NLdSt<0,0b00,0b1010,op7_4, (outs),
486 (ins addrmode6:$addr, DPR:$src1, DPR:$src2), IIC_VST,
487 "vst1", Dt, "\\{$src1, $src2\\}, $addr", "", []>;
488
489def VST1d8 : VST1D<0b0000, "8">;
490def VST1d16 : VST1D<0b0100, "16">;
491def VST1d32 : VST1D<0b1000, "32">;
492def VST1d64 : VST1D<0b1100, "64">;
493
494def VST1q8 : VST1Q<0b0000, "8">;
495def VST1q16 : VST1Q<0b0100, "16">;
496def VST1q32 : VST1Q<0b1000, "32">;
497def VST1q64 : VST1Q<0b1100, "64">;
498
Bob Wilson68774212010-03-20 20:54:36 +0000499// ...with address register writeback:
500class VST1DWB<bits<4> op7_4, string Dt>
501 : NLdSt<0, 0b00, 0b0111, op7_4, (outs GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000502 (ins addrmode6:$addr, am6offset:$offset, DPR:$src), IIC_VST,
503 "vst1", Dt, "\\{$src\\}, $addr$offset", "$addr.addr = $wb", []>;
Bob Wilson68774212010-03-20 20:54:36 +0000504class VST1QWB<bits<4> op7_4, string Dt>
505 : NLdSt<0, 0b00, 0b1010, op7_4, (outs GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000506 (ins addrmode6:$addr, am6offset:$offset, QPR:$src), IIC_VST,
507 "vst1", Dt, "${src:dregpair}, $addr$offset", "$addr.addr = $wb", []>;
Bob Wilson68774212010-03-20 20:54:36 +0000508
509def VST1d8_UPD : VST1DWB<0b0000, "8">;
510def VST1d16_UPD : VST1DWB<0b0100, "16">;
511def VST1d32_UPD : VST1DWB<0b1000, "32">;
512def VST1d64_UPD : VST1DWB<0b1100, "64">;
513
514def VST1q8_UPD : VST1QWB<0b0000, "8">;
515def VST1q16_UPD : VST1QWB<0b0100, "16">;
516def VST1q32_UPD : VST1QWB<0b1000, "32">;
517def VST1q64_UPD : VST1QWB<0b1100, "64">;
518
Bob Wilsonf2cc3782010-03-22 18:22:06 +0000519// ...with 3 registers (some of these are only for the disassembler):
Bob Wilson70709822010-03-18 20:18:39 +0000520class VST1D3<bits<4> op7_4, string Dt>
Johnny Chen30c6aeb2010-02-24 02:57:20 +0000521 : NLdSt<0, 0b00, 0b0110, op7_4, (outs),
Bob Wilson15b46a42010-03-20 19:57:03 +0000522 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3),
Bob Wilson331cdff2010-03-22 18:02:38 +0000523 IIC_VST, "vst1", Dt, "\\{$src1, $src2, $src3\\}, $addr", "", []>;
Bob Wilson68774212010-03-20 20:54:36 +0000524class VST1D3WB<bits<4> op7_4, string Dt>
525 : NLdSt<0, 0b00, 0b0110, op7_4, (outs GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000526 (ins addrmode6:$addr, am6offset:$offset,
Bob Wilson68774212010-03-20 20:54:36 +0000527 DPR:$src1, DPR:$src2, DPR:$src3),
Bob Wilson255e7482010-03-20 22:13:40 +0000528 IIC_VST, "vst1", Dt, "\\{$src1, $src2, $src3\\}, $addr$offset",
Bob Wilson331cdff2010-03-22 18:02:38 +0000529 "$addr.addr = $wb", []>;
Bob Wilsonf2cc3782010-03-22 18:22:06 +0000530
531def VST1d8T : VST1D3<0b0000, "8">;
532def VST1d16T : VST1D3<0b0100, "16">;
533def VST1d32T : VST1D3<0b1000, "32">;
534def VST1d64T : VST1D3<0b1100, "64">;
535
536def VST1d8T_UPD : VST1D3WB<0b0000, "8">;
537def VST1d16T_UPD : VST1D3WB<0b0100, "16">;
538def VST1d32T_UPD : VST1D3WB<0b1000, "32">;
539def VST1d64T_UPD : VST1D3WB<0b1100, "64">;
540
541// ...with 4 registers (some of these are only for the disassembler):
542class VST1D4<bits<4> op7_4, string Dt>
543 : NLdSt<0, 0b00, 0b0010, op7_4, (outs),
544 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4),
545 IIC_VST, "vst1", Dt, "\\{$src1, $src2, $src3, $src4\\}, $addr", "",
546 []>;
Bob Wilson68774212010-03-20 20:54:36 +0000547class VST1D4WB<bits<4> op7_4, string Dt>
548 : NLdSt<0, 0b00, 0b0010, op7_4, (outs GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000549 (ins addrmode6:$addr, am6offset:$offset,
Bob Wilson68774212010-03-20 20:54:36 +0000550 DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4),
Bob Wilson255e7482010-03-20 22:13:40 +0000551 IIC_VST, "vst1", Dt, "\\{$src1, $src2, $src3, $src4\\}, $addr$offset",
Bob Wilson331cdff2010-03-22 18:02:38 +0000552 "$addr.addr = $wb", []>;
Bob Wilson68774212010-03-20 20:54:36 +0000553
Bob Wilsonf2cc3782010-03-22 18:22:06 +0000554def VST1d8Q : VST1D4<0b0000, "8">;
555def VST1d16Q : VST1D4<0b0100, "16">;
556def VST1d32Q : VST1D4<0b1000, "32">;
557def VST1d64Q : VST1D4<0b1100, "64">;
Bob Wilson68774212010-03-20 20:54:36 +0000558
559def VST1d8Q_UPD : VST1D4WB<0b0000, "8">;
560def VST1d16Q_UPD : VST1D4WB<0b0100, "16">;
561def VST1d32Q_UPD : VST1D4WB<0b1000, "32">;
Bob Wilson0ae84492010-03-22 18:13:18 +0000562def VST1d64Q_UPD : VST1D4WB<0b1100, "64">;
Bob Wilson66b34002009-08-12 17:04:56 +0000563
Bob Wilson6a209cd2009-08-06 18:47:44 +0000564// VST2 : Vector Store (multiple 2-element structures)
Bob Wilson3e98d362010-03-20 21:15:48 +0000565class VST2D<bits<4> op11_8, bits<4> op7_4, string Dt>
566 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
567 (ins addrmode6:$addr, DPR:$src1, DPR:$src2),
568 IIC_VST, "vst2", Dt, "\\{$src1, $src2\\}, $addr", "", []>;
Bob Wilson70709822010-03-18 20:18:39 +0000569class VST2Q<bits<4> op7_4, string Dt>
Bob Wilson3e98d362010-03-20 21:15:48 +0000570 : NLdSt<0, 0b00, 0b0011, op7_4, (outs),
Bob Wilsonb1721162009-10-07 21:53:04 +0000571 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4),
Bob Wilson70709822010-03-18 20:18:39 +0000572 IIC_VST, "vst2", Dt, "\\{$src1, $src2, $src3, $src4\\}, $addr",
Bob Wilson5fa67d352009-10-07 18:47:39 +0000573 "", []>;
Bob Wilson6a209cd2009-08-06 18:47:44 +0000574
Bob Wilson3e98d362010-03-20 21:15:48 +0000575def VST2d8 : VST2D<0b1000, 0b0000, "8">;
576def VST2d16 : VST2D<0b1000, 0b0100, "16">;
577def VST2d32 : VST2D<0b1000, 0b1000, "32">;
Bob Wilson6a209cd2009-08-06 18:47:44 +0000578
Bob Wilson70709822010-03-18 20:18:39 +0000579def VST2q8 : VST2Q<0b0000, "8">;
580def VST2q16 : VST2Q<0b0100, "16">;
581def VST2q32 : VST2Q<0b1000, "32">;
Bob Wilson5fa67d352009-10-07 18:47:39 +0000582
Bob Wilson8119e922010-03-20 21:45:18 +0000583// ...with address register writeback:
584class VST2DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
585 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000586 (ins addrmode6:$addr, am6offset:$offset, DPR:$src1, DPR:$src2),
587 IIC_VST, "vst2", Dt, "\\{$src1, $src2\\}, $addr$offset",
Bob Wilson8119e922010-03-20 21:45:18 +0000588 "$addr.addr = $wb", []>;
589class VST2QWB<bits<4> op7_4, string Dt>
590 : NLdSt<0, 0b00, 0b0011, op7_4, (outs GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000591 (ins addrmode6:$addr, am6offset:$offset,
Bob Wilson8119e922010-03-20 21:45:18 +0000592 DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4),
Bob Wilson255e7482010-03-20 22:13:40 +0000593 IIC_VST, "vst2", Dt, "\\{$src1, $src2, $src3, $src4\\}, $addr$offset",
Bob Wilson8119e922010-03-20 21:45:18 +0000594 "$addr.addr = $wb", []>;
595
596def VST2d8_UPD : VST2DWB<0b1000, 0b0000, "8">;
597def VST2d16_UPD : VST2DWB<0b1000, 0b0100, "16">;
598def VST2d32_UPD : VST2DWB<0b1000, 0b1000, "32">;
Bob Wilson8119e922010-03-20 21:45:18 +0000599
600def VST2q8_UPD : VST2QWB<0b0000, "8">;
601def VST2q16_UPD : VST2QWB<0b0100, "16">;
602def VST2q32_UPD : VST2QWB<0b1000, "32">;
603
Bob Wilson3e98d362010-03-20 21:15:48 +0000604// ...with double-spaced registers (for disassembly only):
605def VST2b8 : VST2D<0b1001, 0b0000, "8">;
606def VST2b16 : VST2D<0b1001, 0b0100, "16">;
607def VST2b32 : VST2D<0b1001, 0b1000, "32">;
Bob Wilson8119e922010-03-20 21:45:18 +0000608def VST2b8_UPD : VST2DWB<0b1001, 0b0000, "8">;
609def VST2b16_UPD : VST2DWB<0b1001, 0b0100, "16">;
610def VST2b32_UPD : VST2DWB<0b1001, 0b1000, "32">;
Johnny Chen30c6aeb2010-02-24 02:57:20 +0000611
Bob Wilson6a209cd2009-08-06 18:47:44 +0000612// VST3 : Vector Store (multiple 3-element structures)
Bob Wilson3e98d362010-03-20 21:15:48 +0000613class VST3D<bits<4> op11_8, bits<4> op7_4, string Dt>
614 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
Bob Wilsonb1721162009-10-07 21:53:04 +0000615 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3), IIC_VST,
Bob Wilson70709822010-03-18 20:18:39 +0000616 "vst3", Dt, "\\{$src1, $src2, $src3\\}, $addr", "", []>;
Bob Wilson6a209cd2009-08-06 18:47:44 +0000617
Bob Wilson3e98d362010-03-20 21:15:48 +0000618def VST3d8 : VST3D<0b0100, 0b0000, "8">;
619def VST3d16 : VST3D<0b0100, 0b0100, "16">;
620def VST3d32 : VST3D<0b0100, 0b1000, "32">;
Bob Wilson6a209cd2009-08-06 18:47:44 +0000621
Bob Wilson8119e922010-03-20 21:45:18 +0000622// ...with address register writeback:
623class VST3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
624 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000625 (ins addrmode6:$addr, am6offset:$offset,
Bob Wilson8119e922010-03-20 21:45:18 +0000626 DPR:$src1, DPR:$src2, DPR:$src3), IIC_VST,
Bob Wilson255e7482010-03-20 22:13:40 +0000627 "vst3", Dt, "\\{$src1, $src2, $src3\\}, $addr$offset",
Bob Wilson8119e922010-03-20 21:45:18 +0000628 "$addr.addr = $wb", []>;
629
630def VST3d8_UPD : VST3DWB<0b0100, 0b0000, "8">;
631def VST3d16_UPD : VST3DWB<0b0100, 0b0100, "16">;
632def VST3d32_UPD : VST3DWB<0b0100, 0b1000, "32">;
Bob Wilson8119e922010-03-20 21:45:18 +0000633
634// ...with double-spaced registers (non-updating versions for disassembly only):
Bob Wilson3e98d362010-03-20 21:15:48 +0000635def VST3q8 : VST3D<0b0101, 0b0000, "8">;
636def VST3q16 : VST3D<0b0101, 0b0100, "16">;
637def VST3q32 : VST3D<0b0101, 0b1000, "32">;
Bob Wilson8119e922010-03-20 21:45:18 +0000638def VST3q8_UPD : VST3DWB<0b0101, 0b0000, "8">;
639def VST3q16_UPD : VST3DWB<0b0101, 0b0100, "16">;
640def VST3q32_UPD : VST3DWB<0b0101, 0b1000, "32">;
Bob Wilson3e98d362010-03-20 21:15:48 +0000641
Bob Wilson8119e922010-03-20 21:45:18 +0000642// ...alternate versions to be allocated odd register numbers:
643def VST3q8odd_UPD : VST3DWB<0b0101, 0b0000, "8">;
644def VST3q16odd_UPD : VST3DWB<0b0101, 0b0100, "16">;
645def VST3q32odd_UPD : VST3DWB<0b0101, 0b1000, "32">;
Bob Wilson2a85bd12009-10-07 20:30:08 +0000646
Bob Wilson6a209cd2009-08-06 18:47:44 +0000647// VST4 : Vector Store (multiple 4-element structures)
Bob Wilson3e98d362010-03-20 21:15:48 +0000648class VST4D<bits<4> op11_8, bits<4> op7_4, string Dt>
649 : NLdSt<0, 0b00, op11_8, op7_4, (outs),
Bob Wilsonb1721162009-10-07 21:53:04 +0000650 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4),
Bob Wilson70709822010-03-18 20:18:39 +0000651 IIC_VST, "vst4", Dt, "\\{$src1, $src2, $src3, $src4\\}, $addr",
Bob Wilson316062a2009-08-25 17:46:06 +0000652 "", []>;
Bob Wilson6a209cd2009-08-06 18:47:44 +0000653
Bob Wilson3e98d362010-03-20 21:15:48 +0000654def VST4d8 : VST4D<0b0000, 0b0000, "8">;
655def VST4d16 : VST4D<0b0000, 0b0100, "16">;
656def VST4d32 : VST4D<0b0000, 0b1000, "32">;
Bob Wilsonc2d65852009-09-01 18:51:56 +0000657
Bob Wilson8119e922010-03-20 21:45:18 +0000658// ...with address register writeback:
659class VST4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
660 : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000661 (ins addrmode6:$addr, am6offset:$offset,
Bob Wilson8119e922010-03-20 21:45:18 +0000662 DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST,
Bob Wilson255e7482010-03-20 22:13:40 +0000663 "vst4", Dt, "\\{$src1, $src2, $src3, $src4\\}, $addr$offset",
Bob Wilson8119e922010-03-20 21:45:18 +0000664 "$addr.addr = $wb", []>;
665
666def VST4d8_UPD : VST4DWB<0b0000, 0b0000, "8">;
667def VST4d16_UPD : VST4DWB<0b0000, 0b0100, "16">;
668def VST4d32_UPD : VST4DWB<0b0000, 0b1000, "32">;
Bob Wilson8119e922010-03-20 21:45:18 +0000669
670// ...with double-spaced registers (non-updating versions for disassembly only):
Bob Wilson3e98d362010-03-20 21:15:48 +0000671def VST4q8 : VST4D<0b0001, 0b0000, "8">;
672def VST4q16 : VST4D<0b0001, 0b0100, "16">;
673def VST4q32 : VST4D<0b0001, 0b1000, "32">;
Bob Wilson8119e922010-03-20 21:45:18 +0000674def VST4q8_UPD : VST4DWB<0b0001, 0b0000, "8">;
675def VST4q16_UPD : VST4DWB<0b0001, 0b0100, "16">;
676def VST4q32_UPD : VST4DWB<0b0001, 0b1000, "32">;
Bob Wilson3e98d362010-03-20 21:15:48 +0000677
Bob Wilson8119e922010-03-20 21:45:18 +0000678// ...alternate versions to be allocated odd register numbers:
679def VST4q8odd_UPD : VST4DWB<0b0001, 0b0000, "8">;
680def VST4q16odd_UPD : VST4DWB<0b0001, 0b0100, "16">;
681def VST4q32odd_UPD : VST4DWB<0b0001, 0b1000, "32">;
Bob Wilsonb1721162009-10-07 21:53:04 +0000682
683// VST1LN : Vector Store (single element from one lane)
684// FIXME: Not yet implemented.
Bob Wilson931c76b2009-10-07 20:49:18 +0000685
Bob Wilsonc2d65852009-09-01 18:51:56 +0000686// VST2LN : Vector Store (single 2-element structure from one lane)
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000687class VST2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
688 : NLdSt<1, 0b00, op11_8, op7_4, (outs),
Bob Wilson1d2c4212010-02-17 00:31:29 +0000689 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, nohash_imm:$lane),
Bob Wilson70709822010-03-18 20:18:39 +0000690 IIC_VST, "vst2", Dt, "\\{$src1[$lane], $src2[$lane]\\}, $addr",
Bob Wilson1d2c4212010-02-17 00:31:29 +0000691 "", []>;
Bob Wilsonc2d65852009-09-01 18:51:56 +0000692
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000693def VST2LNd8 : VST2LN<0b0001, {?,?,?,?}, "8">;
694def VST2LNd16 : VST2LN<0b0101, {?,?,0,?}, "16">;
695def VST2LNd32 : VST2LN<0b1001, {?,0,?,?}, "32">;
Bob Wilson18e94a72009-10-08 23:38:24 +0000696
Bob Wilsond22476d2010-03-20 20:39:53 +0000697// ...with double-spaced registers:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000698def VST2LNq16 : VST2LN<0b0101, {?,?,1,?}, "16">;
699def VST2LNq32 : VST2LN<0b1001, {?,1,?,?}, "32">;
Bob Wilson18e94a72009-10-08 23:38:24 +0000700
Bob Wilsond22476d2010-03-20 20:39:53 +0000701// ...alternate versions to be allocated odd register numbers:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000702def VST2LNq16odd : VST2LN<0b0101, {?,?,1,?}, "16">;
703def VST2LNq32odd : VST2LN<0b1001, {?,1,?,?}, "32">;
Bob Wilsonc2d65852009-09-01 18:51:56 +0000704
Bob Wilson029da952010-03-20 21:57:36 +0000705// ...with address register writeback:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000706class VST2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
707 : NLdSt<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000708 (ins addrmode6:$addr, am6offset:$offset,
Bob Wilson029da952010-03-20 21:57:36 +0000709 DPR:$src1, DPR:$src2, nohash_imm:$lane), IIC_VST, "vst2", Dt,
Bob Wilson255e7482010-03-20 22:13:40 +0000710 "\\{$src1[$lane], $src2[$lane]\\}, $addr$offset",
Bob Wilson029da952010-03-20 21:57:36 +0000711 "$addr.addr = $wb", []>;
712
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000713def VST2LNd8_UPD : VST2LNWB<0b0001, {?,?,?,?}, "8">;
714def VST2LNd16_UPD : VST2LNWB<0b0101, {?,?,0,?}, "16">;
715def VST2LNd32_UPD : VST2LNWB<0b1001, {?,0,?,?}, "32">;
Bob Wilson029da952010-03-20 21:57:36 +0000716
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000717def VST2LNq16_UPD : VST2LNWB<0b0101, {?,?,1,?}, "16">;
718def VST2LNq32_UPD : VST2LNWB<0b1001, {?,1,?,?}, "32">;
Bob Wilson029da952010-03-20 21:57:36 +0000719
Bob Wilsonc2d65852009-09-01 18:51:56 +0000720// VST3LN : Vector Store (single 3-element structure from one lane)
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000721class VST3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
722 : NLdSt<1, 0b00, op11_8, op7_4, (outs),
Bob Wilson1d2c4212010-02-17 00:31:29 +0000723 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3,
Bob Wilson70709822010-03-18 20:18:39 +0000724 nohash_imm:$lane), IIC_VST, "vst3", Dt,
Bob Wilson1d2c4212010-02-17 00:31:29 +0000725 "\\{$src1[$lane], $src2[$lane], $src3[$lane]\\}, $addr", "", []>;
Bob Wilsonc2d65852009-09-01 18:51:56 +0000726
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000727def VST3LNd8 : VST3LN<0b0010, {?,?,?,0}, "8">;
728def VST3LNd16 : VST3LN<0b0110, {?,?,0,0}, "16">;
729def VST3LNd32 : VST3LN<0b1010, {?,0,0,0}, "32">;
Bob Wilsondbffb212009-10-08 23:51:31 +0000730
Bob Wilsond22476d2010-03-20 20:39:53 +0000731// ...with double-spaced registers:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000732def VST3LNq16 : VST3LN<0b0110, {?,?,1,0}, "16">;
733def VST3LNq32 : VST3LN<0b1010, {?,1,0,0}, "32">;
Bob Wilsondbffb212009-10-08 23:51:31 +0000734
Bob Wilsond22476d2010-03-20 20:39:53 +0000735// ...alternate versions to be allocated odd register numbers:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000736def VST3LNq16odd : VST3LN<0b0110, {?,?,1,0}, "16">;
737def VST3LNq32odd : VST3LN<0b1010, {?,1,0,0}, "32">;
Bob Wilsonc2d65852009-09-01 18:51:56 +0000738
Bob Wilson029da952010-03-20 21:57:36 +0000739// ...with address register writeback:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000740class VST3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
741 : NLdSt<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000742 (ins addrmode6:$addr, am6offset:$offset,
Bob Wilson029da952010-03-20 21:57:36 +0000743 DPR:$src1, DPR:$src2, DPR:$src3, nohash_imm:$lane),
744 IIC_VST, "vst3", Dt,
Bob Wilson255e7482010-03-20 22:13:40 +0000745 "\\{$src1[$lane], $src2[$lane], $src3[$lane]\\}, $addr$offset",
Bob Wilson029da952010-03-20 21:57:36 +0000746 "$addr.addr = $wb", []>;
747
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000748def VST3LNd8_UPD : VST3LNWB<0b0010, {?,?,?,0}, "8">;
749def VST3LNd16_UPD : VST3LNWB<0b0110, {?,?,0,0}, "16">;
750def VST3LNd32_UPD : VST3LNWB<0b1010, {?,0,0,0}, "32">;
Bob Wilson029da952010-03-20 21:57:36 +0000751
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000752def VST3LNq16_UPD : VST3LNWB<0b0110, {?,?,1,0}, "16">;
753def VST3LNq32_UPD : VST3LNWB<0b1010, {?,1,0,0}, "32">;
Bob Wilson029da952010-03-20 21:57:36 +0000754
Bob Wilsonc2d65852009-09-01 18:51:56 +0000755// VST4LN : Vector Store (single 4-element structure from one lane)
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000756class VST4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
757 : NLdSt<1, 0b00, op11_8, op7_4, (outs),
Bob Wilson1d2c4212010-02-17 00:31:29 +0000758 (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4,
Bob Wilson70709822010-03-18 20:18:39 +0000759 nohash_imm:$lane), IIC_VST, "vst4", Dt,
Bob Wilson82dcfa32010-01-18 01:24:43 +0000760 "\\{$src1[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $addr",
Bob Wilson1d2c4212010-02-17 00:31:29 +0000761 "", []>;
Bob Wilsonc2d65852009-09-01 18:51:56 +0000762
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000763def VST4LNd8 : VST4LN<0b0011, {?,?,?,?}, "8">;
764def VST4LNd16 : VST4LN<0b0111, {?,?,0,?}, "16">;
765def VST4LNd32 : VST4LN<0b1011, {?,0,?,?}, "32">;
Bob Wilsonc7692e02009-10-09 00:01:36 +0000766
Bob Wilsond22476d2010-03-20 20:39:53 +0000767// ...with double-spaced registers:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000768def VST4LNq16 : VST4LN<0b0111, {?,?,1,?}, "16">;
769def VST4LNq32 : VST4LN<0b1011, {?,1,?,?}, "32">;
Bob Wilsonc7692e02009-10-09 00:01:36 +0000770
Bob Wilsond22476d2010-03-20 20:39:53 +0000771// ...alternate versions to be allocated odd register numbers:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000772def VST4LNq16odd : VST4LN<0b0111, {?,?,1,?}, "16">;
773def VST4LNq32odd : VST4LN<0b1011, {?,1,?,?}, "32">;
Bob Wilsonc7692e02009-10-09 00:01:36 +0000774
Bob Wilson029da952010-03-20 21:57:36 +0000775// ...with address register writeback:
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000776class VST4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
777 : NLdSt<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
Bob Wilson255e7482010-03-20 22:13:40 +0000778 (ins addrmode6:$addr, am6offset:$offset,
Bob Wilson029da952010-03-20 21:57:36 +0000779 DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
780 IIC_VST, "vst4", Dt,
Bob Wilson255e7482010-03-20 22:13:40 +0000781 "\\{$src1[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $addr$offset",
Bob Wilson029da952010-03-20 21:57:36 +0000782 "$addr.addr = $wb", []>;
783
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000784def VST4LNd8_UPD : VST4LNWB<0b0011, {?,?,?,?}, "8">;
785def VST4LNd16_UPD : VST4LNWB<0b0111, {?,?,0,?}, "16">;
786def VST4LNd32_UPD : VST4LNWB<0b1011, {?,0,?,?}, "32">;
Bob Wilson029da952010-03-20 21:57:36 +0000787
Bob Wilsona4f5fe12010-03-22 16:43:10 +0000788def VST4LNq16_UPD : VST4LNWB<0b0111, {?,?,1,?}, "16">;
789def VST4LNq32_UPD : VST4LNWB<0b1011, {?,1,?,?}, "32">;
Bob Wilson029da952010-03-20 21:57:36 +0000790
Evan Chengb8e418a2010-05-19 06:07:03 +0000791} // mayStore = 1, neverHasSideEffects = 1, hasExtraSrcRegAllocReq = 1
Bob Wilson6a209cd2009-08-06 18:47:44 +0000792
Bob Wilsoned592c02009-07-08 18:11:30 +0000793
Bob Wilsone60fee02009-06-22 23:27:02 +0000794//===----------------------------------------------------------------------===//
795// NEON pattern fragments
796//===----------------------------------------------------------------------===//
797
798// Extract D sub-registers of Q registers.
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000799def DSubReg_i8_reg : SDNodeXForm<imm, [{
Jakob Stoklund Olesenb3a1b9d2010-05-24 17:13:28 +0000800 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
801 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue()/8, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000802}]>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000803def DSubReg_i16_reg : SDNodeXForm<imm, [{
Jakob Stoklund Olesenb3a1b9d2010-05-24 17:13:28 +0000804 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
805 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue()/4, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000806}]>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000807def DSubReg_i32_reg : SDNodeXForm<imm, [{
Jakob Stoklund Olesenb3a1b9d2010-05-24 17:13:28 +0000808 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
809 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue()/2, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000810}]>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000811def DSubReg_f64_reg : SDNodeXForm<imm, [{
Jakob Stoklund Olesenb3a1b9d2010-05-24 17:13:28 +0000812 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
813 return CurDAG->getTargetConstant(ARM::dsub_0 + N->getZExtValue(), MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000814}]>;
Anton Korobeynikovb261a192009-09-02 21:21:28 +0000815def DSubReg_f64_other_reg : SDNodeXForm<imm, [{
Jakob Stoklund Olesenb3a1b9d2010-05-24 17:13:28 +0000816 assert(ARM::dsub_7 == ARM::dsub_0+7 && "Unexpected subreg numbering");
817 return CurDAG->getTargetConstant(ARM::dsub_0 + (1 - N->getZExtValue()),
818 MVT::i32);
Anton Korobeynikovb261a192009-09-02 21:21:28 +0000819}]>;
Bob Wilsone60fee02009-06-22 23:27:02 +0000820
Anton Korobeynikov44e0a6c2009-08-28 23:41:26 +0000821// Extract S sub-registers of Q/D registers.
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000822def SSubReg_f32_reg : SDNodeXForm<imm, [{
Jakob Stoklund Olesenb3a1b9d2010-05-24 17:13:28 +0000823 assert(ARM::ssub_3 == ARM::ssub_0+3 && "Unexpected subreg numbering");
824 return CurDAG->getTargetConstant(ARM::ssub_0 + N->getZExtValue(), MVT::i32);
Anton Korobeynikov49284e72009-08-08 14:06:07 +0000825}]>;
826
Bob Wilsone60fee02009-06-22 23:27:02 +0000827// Translate lane numbers from Q registers to D subregs.
828def SubReg_i8_lane : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000829 return CurDAG->getTargetConstant(N->getZExtValue() & 7, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000830}]>;
831def SubReg_i16_lane : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000832 return CurDAG->getTargetConstant(N->getZExtValue() & 3, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000833}]>;
834def SubReg_i32_lane : SDNodeXForm<imm, [{
Owen Anderson36e3a6e2009-08-11 20:47:22 +0000835 return CurDAG->getTargetConstant(N->getZExtValue() & 1, MVT::i32);
Bob Wilsone60fee02009-06-22 23:27:02 +0000836}]>;
837
838//===----------------------------------------------------------------------===//
839// Instruction Classes
840//===----------------------------------------------------------------------===//
841
Bob Wilson154999f2010-02-17 22:23:11 +0000842// Basic 2-register operations: single-, double- and quad-register.
843class N2VS<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
844 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
845 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
Johnny Chen614338f2010-03-24 19:47:14 +0000846 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
847 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src),
848 IIC_VUNAD, OpcodeStr, Dt, "$dst, $src", "", []>;
Bob Wilsone60fee02009-06-22 23:27:02 +0000849class N2VD<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
Bob Wilson154999f2010-02-17 22:23:11 +0000850 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
851 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
Johnny Chen614338f2010-03-24 19:47:14 +0000852 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
853 (ins DPR:$src), IIC_VUNAD, OpcodeStr, Dt,"$dst, $src", "",
854 [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +0000855class N2VQ<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
Bob Wilson154999f2010-02-17 22:23:11 +0000856 bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
857 string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
Johnny Chen614338f2010-03-24 19:47:14 +0000858 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
859 (ins QPR:$src), IIC_VUNAQ, OpcodeStr, Dt,"$dst, $src", "",
860 [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +0000861
Bob Wilson7c7fe6e2010-02-17 22:42:54 +0000862// Basic 2-register intrinsics, both double- and quad-register.
Bob Wilsone60fee02009-06-22 23:27:02 +0000863class N2VDInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
Johnny Chen16e78bb2010-03-25 20:39:04 +0000864 bits<2> op17_16, bits<5> op11_7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000865 InstrItinClass itin, string OpcodeStr, string Dt,
Bob Wilsone60fee02009-06-22 23:27:02 +0000866 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
867 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
Evan Cheng09c61b32009-11-23 21:57:23 +0000868 (ins DPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000869 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src))))]>;
870class N2VQInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
David Goodwin78caa122009-09-23 21:38:08 +0000871 bits<2> op17_16, bits<5> op11_7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000872 InstrItinClass itin, string OpcodeStr, string Dt,
Bob Wilsone60fee02009-06-22 23:27:02 +0000873 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
874 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
Evan Cheng09c61b32009-11-23 21:57:23 +0000875 (ins QPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000876 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src))))]>;
877
878// Narrow 2-register intrinsics.
879class N2VNInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
880 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000881 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin78caa122009-09-23 21:38:08 +0000882 ValueType TyD, ValueType TyQ, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +0000883 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$dst),
Evan Cheng09c61b32009-11-23 21:57:23 +0000884 (ins QPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000885 [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src))))]>;
886
Bob Wilson52e0d9d2009-10-21 02:15:46 +0000887// Long 2-register intrinsics (currently only used for VMOVL).
888class N2VLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
889 bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000890 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin78caa122009-09-23 21:38:08 +0000891 ValueType TyQ, ValueType TyD, Intrinsic IntOp>
Bob Wilson52e0d9d2009-10-21 02:15:46 +0000892 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$dst),
Evan Cheng09c61b32009-11-23 21:57:23 +0000893 (ins DPR:$src), itin, OpcodeStr, Dt, "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +0000894 [(set QPR:$dst, (TyQ (IntOp (TyD DPR:$src))))]>;
895
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +0000896// 2-register shuffles (VTRN/VZIP/VUZP), both double- and quad-register.
Evan Cheng09c61b32009-11-23 21:57:23 +0000897class N2VDShuffle<bits<2> op19_18, bits<5> op11_7, string OpcodeStr, string Dt>
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +0000898 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 0, 0, (outs DPR:$dst1, DPR:$dst2),
David Goodwin78caa122009-09-23 21:38:08 +0000899 (ins DPR:$src1, DPR:$src2), IIC_VPERMD,
Evan Cheng09c61b32009-11-23 21:57:23 +0000900 OpcodeStr, Dt, "$dst1, $dst2",
Johnny Chen7c3f3862010-03-17 23:26:50 +0000901 "$src1 = $dst1, $src2 = $dst2", []>;
David Goodwin78caa122009-09-23 21:38:08 +0000902class N2VQShuffle<bits<2> op19_18, bits<5> op11_7,
Evan Cheng09c61b32009-11-23 21:57:23 +0000903 InstrItinClass itin, string OpcodeStr, string Dt>
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +0000904 : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 1, 0, (outs QPR:$dst1, QPR:$dst2),
Bob Wilson1d2c4212010-02-17 00:31:29 +0000905 (ins QPR:$src1, QPR:$src2), itin, OpcodeStr, Dt, "$dst1, $dst2",
Johnny Chen7c3f3862010-03-17 23:26:50 +0000906 "$src1 = $dst1, $src2 = $dst2", []>;
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +0000907
Bob Wilson154999f2010-02-17 22:23:11 +0000908// Basic 3-register operations: single-, double- and quad-register.
909class N3VS<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
910 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
911 SDNode OpNode, bit Commutable>
912 : N3V<op24, op23, op21_20, op11_8, 0, op4,
Bob Wilson724df1c2010-03-27 03:56:52 +0000913 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src1, DPR_VFP2:$src2), N3RegFrm,
914 IIC_VBIND, OpcodeStr, Dt, "$dst, $src1, $src2", "", []> {
Bob Wilson154999f2010-02-17 22:23:11 +0000915 let isCommutable = Commutable;
916}
917
Bob Wilsone60fee02009-06-22 23:27:02 +0000918class N3VD<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000919 InstrItinClass itin, string OpcodeStr, string Dt,
Bob Wilson1d2c4212010-02-17 00:31:29 +0000920 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
Bob Wilsone60fee02009-06-22 23:27:02 +0000921 : N3V<op24, op23, op21_20, op11_8, 0, op4,
Bob Wilson724df1c2010-03-27 03:56:52 +0000922 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), N3RegFrm, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000923 OpcodeStr, Dt, "$dst, $src1, $src2", "",
924 [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src1), (OpTy DPR:$src2))))]> {
925 let isCommutable = Commutable;
926}
927// Same as N3VD but no data type.
928class N3VDX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
929 InstrItinClass itin, string OpcodeStr,
930 ValueType ResTy, ValueType OpTy,
931 SDNode OpNode, bit Commutable>
932 : N3VX<op24, op23, op21_20, op11_8, 0, op4,
Bob Wilson724df1c2010-03-27 03:56:52 +0000933 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), N3RegFrm, itin,
Bob Wilson1d2c4212010-02-17 00:31:29 +0000934 OpcodeStr, "$dst, $src1, $src2", "",
935 [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src1), (OpTy DPR:$src2))))]>{
Bob Wilsone60fee02009-06-22 23:27:02 +0000936 let isCommutable = Commutable;
937}
Johnny Chen9b2b64f2010-03-27 01:03:13 +0000938
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000939class N3VDSL<bits<2> op21_20, bits<4> op11_8,
Evan Cheng09c61b32009-11-23 21:57:23 +0000940 InstrItinClass itin, string OpcodeStr, string Dt,
941 ValueType Ty, SDNode ShOp>
Bob Wilson724df1c2010-03-27 03:56:52 +0000942 : N3V<0, 1, op21_20, op11_8, 1, 0,
943 (outs DPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
944 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
945 [(set (Ty DPR:$dst),
946 (Ty (ShOp (Ty DPR:$src1),
947 (Ty (NEONvduplane (Ty DPR_VFP2:$src2),imm:$lane)))))]> {
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000948 let isCommutable = 0;
949}
950class N3VDSL16<bits<2> op21_20, bits<4> op11_8,
Evan Cheng09c61b32009-11-23 21:57:23 +0000951 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
Bob Wilson724df1c2010-03-27 03:56:52 +0000952 : N3V<0, 1, op21_20, op11_8, 1, 0,
953 (outs DPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
954 NVMulSLFrm, IIC_VMULi16D, OpcodeStr, Dt,"$dst, $src1, $src2[$lane]","",
955 [(set (Ty DPR:$dst),
956 (Ty (ShOp (Ty DPR:$src1),
957 (Ty (NEONvduplane (Ty DPR_8:$src2), imm:$lane)))))]> {
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000958 let isCommutable = 0;
959}
960
Bob Wilsone60fee02009-06-22 23:27:02 +0000961class N3VQ<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +0000962 InstrItinClass itin, string OpcodeStr, string Dt,
Bob Wilson1d2c4212010-02-17 00:31:29 +0000963 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
Bob Wilsone60fee02009-06-22 23:27:02 +0000964 : N3V<op24, op23, op21_20, op11_8, 1, op4,
Bob Wilson724df1c2010-03-27 03:56:52 +0000965 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), N3RegFrm, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +0000966 OpcodeStr, Dt, "$dst, $src1, $src2", "",
967 [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src1), (OpTy QPR:$src2))))]> {
968 let isCommutable = Commutable;
969}
970class N3VQX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
971 InstrItinClass itin, string OpcodeStr,
Bob Wilson1d2c4212010-02-17 00:31:29 +0000972 ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
Evan Cheng09c61b32009-11-23 21:57:23 +0000973 : N3VX<op24, op23, op21_20, op11_8, 1, op4,
Bob Wilson724df1c2010-03-27 03:56:52 +0000974 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), N3RegFrm, itin,
Bob Wilson1d2c4212010-02-17 00:31:29 +0000975 OpcodeStr, "$dst, $src1, $src2", "",
976 [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src1), (OpTy QPR:$src2))))]>{
Bob Wilsone60fee02009-06-22 23:27:02 +0000977 let isCommutable = Commutable;
978}
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000979class N3VQSL<bits<2> op21_20, bits<4> op11_8,
Evan Cheng09c61b32009-11-23 21:57:23 +0000980 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin36bff0c2009-09-25 18:38:29 +0000981 ValueType ResTy, ValueType OpTy, SDNode ShOp>
Bob Wilson724df1c2010-03-27 03:56:52 +0000982 : N3V<1, 1, op21_20, op11_8, 1, 0,
983 (outs QPR:$dst), (ins QPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
984 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
985 [(set (ResTy QPR:$dst),
986 (ResTy (ShOp (ResTy QPR:$src1),
987 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src2),
988 imm:$lane)))))]> {
Anton Korobeynikovdd528192009-09-08 15:22:32 +0000989 let isCommutable = 0;
990}
Bob Wilson1d2c4212010-02-17 00:31:29 +0000991class N3VQSL16<bits<2> op21_20, bits<4> op11_8, string OpcodeStr, string Dt,
Evan Cheng09c61b32009-11-23 21:57:23 +0000992 ValueType ResTy, ValueType OpTy, SDNode ShOp>
Bob Wilson724df1c2010-03-27 03:56:52 +0000993 : N3V<1, 1, op21_20, op11_8, 1, 0,
994 (outs QPR:$dst), (ins QPR:$src1, DPR_8:$src2, nohash_imm:$lane),
995 NVMulSLFrm, IIC_VMULi16Q, OpcodeStr, Dt,"$dst, $src1, $src2[$lane]","",
996 [(set (ResTy QPR:$dst),
997 (ResTy (ShOp (ResTy QPR:$src1),
998 (ResTy (NEONvduplane (OpTy DPR_8:$src2),
999 imm:$lane)))))]> {
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001000 let isCommutable = 0;
1001}
Bob Wilsone60fee02009-06-22 23:27:02 +00001002
1003// Basic 3-register intrinsics, both double- and quad-register.
1004class N3VDInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Johnny Chenfe0978b2010-03-26 23:49:07 +00001005 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001006 ValueType ResTy, ValueType OpTy, Intrinsic IntOp, bit Commutable>
Bob Wilson724df1c2010-03-27 03:56:52 +00001007 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1008 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), f, itin,
1009 OpcodeStr, Dt, "$dst, $src1, $src2", "",
1010 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src1), (OpTy DPR:$src2))))]> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001011 let isCommutable = Commutable;
1012}
David Goodwin36bff0c2009-09-25 18:38:29 +00001013class N3VDIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001014 string OpcodeStr, string Dt, ValueType Ty, Intrinsic IntOp>
Bob Wilson724df1c2010-03-27 03:56:52 +00001015 : N3V<0, 1, op21_20, op11_8, 1, 0,
1016 (outs DPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
1017 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1018 [(set (Ty DPR:$dst),
1019 (Ty (IntOp (Ty DPR:$src1),
1020 (Ty (NEONvduplane (Ty DPR_VFP2:$src2),
1021 imm:$lane)))))]> {
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001022 let isCommutable = 0;
1023}
David Goodwin36bff0c2009-09-25 18:38:29 +00001024class N3VDIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001025 string OpcodeStr, string Dt, ValueType Ty, Intrinsic IntOp>
Bob Wilson724df1c2010-03-27 03:56:52 +00001026 : N3V<0, 1, op21_20, op11_8, 1, 0,
1027 (outs DPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
1028 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1029 [(set (Ty DPR:$dst),
1030 (Ty (IntOp (Ty DPR:$src1),
1031 (Ty (NEONvduplane (Ty DPR_8:$src2), imm:$lane)))))]> {
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001032 let isCommutable = 0;
1033}
1034
Bob Wilsone60fee02009-06-22 23:27:02 +00001035class N3VQInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Johnny Chenfe0978b2010-03-26 23:49:07 +00001036 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001037 ValueType ResTy, ValueType OpTy, Intrinsic IntOp, bit Commutable>
Bob Wilson724df1c2010-03-27 03:56:52 +00001038 : N3V<op24, op23, op21_20, op11_8, 1, op4,
1039 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), f, itin,
1040 OpcodeStr, Dt, "$dst, $src1, $src2", "",
1041 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src1), (OpTy QPR:$src2))))]> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001042 let isCommutable = Commutable;
1043}
David Goodwin36bff0c2009-09-25 18:38:29 +00001044class N3VQIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001045 string OpcodeStr, string Dt,
1046 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Bob Wilson724df1c2010-03-27 03:56:52 +00001047 : N3V<1, 1, op21_20, op11_8, 1, 0,
1048 (outs QPR:$dst), (ins QPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
1049 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1050 [(set (ResTy QPR:$dst),
1051 (ResTy (IntOp (ResTy QPR:$src1),
1052 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src2),
1053 imm:$lane)))))]> {
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001054 let isCommutable = 0;
1055}
David Goodwin36bff0c2009-09-25 18:38:29 +00001056class N3VQIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001057 string OpcodeStr, string Dt,
1058 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Bob Wilson724df1c2010-03-27 03:56:52 +00001059 : N3V<1, 1, op21_20, op11_8, 1, 0,
1060 (outs QPR:$dst), (ins QPR:$src1, DPR_8:$src2, nohash_imm:$lane),
1061 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1062 [(set (ResTy QPR:$dst),
1063 (ResTy (IntOp (ResTy QPR:$src1),
1064 (ResTy (NEONvduplane (OpTy DPR_8:$src2),
1065 imm:$lane)))))]> {
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001066 let isCommutable = 0;
1067}
Bob Wilsone60fee02009-06-22 23:27:02 +00001068
Bob Wilson154999f2010-02-17 22:23:11 +00001069// Multiply-Add/Sub operations: single-, double- and quad-register.
1070class N3VSMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
1071 InstrItinClass itin, string OpcodeStr, string Dt,
1072 ValueType Ty, SDNode MulOp, SDNode OpNode>
1073 : N3V<op24, op23, op21_20, op11_8, 0, op4,
1074 (outs DPR_VFP2:$dst),
Bob Wilson724df1c2010-03-27 03:56:52 +00001075 (ins DPR_VFP2:$src1, DPR_VFP2:$src2, DPR_VFP2:$src3), N3RegFrm, itin,
Bob Wilson154999f2010-02-17 22:23:11 +00001076 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst", []>;
1077
Bob Wilsone60fee02009-06-22 23:27:02 +00001078class N3VDMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001079 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin36bff0c2009-09-25 18:38:29 +00001080 ValueType Ty, SDNode MulOp, SDNode OpNode>
Bob Wilsone60fee02009-06-22 23:27:02 +00001081 : N3V<op24, op23, op21_20, op11_8, 0, op4,
Bob Wilson724df1c2010-03-27 03:56:52 +00001082 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3), N3RegFrm, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001083 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001084 [(set DPR:$dst, (Ty (OpNode DPR:$src1,
1085 (Ty (MulOp DPR:$src2, DPR:$src3)))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001086class N3VDMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001087 string OpcodeStr, string Dt,
1088 ValueType Ty, SDNode MulOp, SDNode ShOp>
Bob Wilson724df1c2010-03-27 03:56:52 +00001089 : N3V<0, 1, op21_20, op11_8, 1, 0,
1090 (outs DPR:$dst),
1091 (ins DPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane),
1092 NVMulSLFrm, itin,
1093 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1094 [(set (Ty DPR:$dst),
1095 (Ty (ShOp (Ty DPR:$src1),
1096 (Ty (MulOp DPR:$src2,
1097 (Ty (NEONvduplane (Ty DPR_VFP2:$src3),
1098 imm:$lane)))))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001099class N3VDMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001100 string OpcodeStr, string Dt,
1101 ValueType Ty, SDNode MulOp, SDNode ShOp>
Bob Wilson724df1c2010-03-27 03:56:52 +00001102 : N3V<0, 1, op21_20, op11_8, 1, 0,
1103 (outs DPR:$dst),
1104 (ins DPR:$src1, DPR:$src2, DPR_8:$src3, nohash_imm:$lane),
1105 NVMulSLFrm, itin,
1106 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1107 [(set (Ty DPR:$dst),
1108 (Ty (ShOp (Ty DPR:$src1),
1109 (Ty (MulOp DPR:$src2,
1110 (Ty (NEONvduplane (Ty DPR_8:$src3),
1111 imm:$lane)))))))]>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001112
Bob Wilsone60fee02009-06-22 23:27:02 +00001113class N3VQMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001114 InstrItinClass itin, string OpcodeStr, string Dt, ValueType Ty,
David Goodwin36bff0c2009-09-25 18:38:29 +00001115 SDNode MulOp, SDNode OpNode>
Bob Wilsone60fee02009-06-22 23:27:02 +00001116 : N3V<op24, op23, op21_20, op11_8, 1, op4,
Bob Wilson724df1c2010-03-27 03:56:52 +00001117 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3), N3RegFrm, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001118 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001119 [(set QPR:$dst, (Ty (OpNode QPR:$src1,
1120 (Ty (MulOp QPR:$src2, QPR:$src3)))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001121class N3VQMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001122 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001123 SDNode MulOp, SDNode ShOp>
Bob Wilson724df1c2010-03-27 03:56:52 +00001124 : N3V<1, 1, op21_20, op11_8, 1, 0,
1125 (outs QPR:$dst),
1126 (ins QPR:$src1, QPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane),
1127 NVMulSLFrm, itin,
1128 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1129 [(set (ResTy QPR:$dst),
1130 (ResTy (ShOp (ResTy QPR:$src1),
1131 (ResTy (MulOp QPR:$src2,
1132 (ResTy (NEONvduplane (OpTy DPR_VFP2:$src3),
1133 imm:$lane)))))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001134class N3VQMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001135 string OpcodeStr, string Dt,
1136 ValueType ResTy, ValueType OpTy,
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001137 SDNode MulOp, SDNode ShOp>
Bob Wilson724df1c2010-03-27 03:56:52 +00001138 : N3V<1, 1, op21_20, op11_8, 1, 0,
1139 (outs QPR:$dst),
1140 (ins QPR:$src1, QPR:$src2, DPR_8:$src3, nohash_imm:$lane),
1141 NVMulSLFrm, itin,
1142 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1143 [(set (ResTy QPR:$dst),
1144 (ResTy (ShOp (ResTy QPR:$src1),
1145 (ResTy (MulOp QPR:$src2,
1146 (ResTy (NEONvduplane (OpTy DPR_8:$src3),
1147 imm:$lane)))))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001148
1149// Neon 3-argument intrinsics, both double- and quad-register.
1150// The destination register is also used as the first source operand register.
1151class N3VDInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001152 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin36bff0c2009-09-25 18:38:29 +00001153 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +00001154 : N3V<op24, op23, op21_20, op11_8, 0, op4,
Bob Wilson724df1c2010-03-27 03:56:52 +00001155 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3), N3RegFrm, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001156 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001157 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src1),
1158 (OpTy DPR:$src2), (OpTy DPR:$src3))))]>;
1159class N3VQInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001160 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin36bff0c2009-09-25 18:38:29 +00001161 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +00001162 : N3V<op24, op23, op21_20, op11_8, 1, op4,
Bob Wilson724df1c2010-03-27 03:56:52 +00001163 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3), N3RegFrm, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001164 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001165 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src1),
1166 (OpTy QPR:$src2), (OpTy QPR:$src3))))]>;
1167
1168// Neon Long 3-argument intrinsic. The destination register is
1169// a quad-register and is also used as the first source operand register.
1170class N3VLInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001171 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin36bff0c2009-09-25 18:38:29 +00001172 ValueType TyQ, ValueType TyD, Intrinsic IntOp>
Bob Wilsone60fee02009-06-22 23:27:02 +00001173 : N3V<op24, op23, op21_20, op11_8, 0, op4,
Bob Wilson724df1c2010-03-27 03:56:52 +00001174 (outs QPR:$dst), (ins QPR:$src1, DPR:$src2, DPR:$src3), N3RegFrm, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001175 OpcodeStr, Dt, "$dst, $src2, $src3", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001176 [(set QPR:$dst,
1177 (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$src2), (TyD DPR:$src3))))]>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001178class N3VLInt3SL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001179 string OpcodeStr, string Dt,
1180 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Bob Wilson724df1c2010-03-27 03:56:52 +00001181 : N3V<op24, 1, op21_20, op11_8, 1, 0,
1182 (outs QPR:$dst),
1183 (ins QPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane),
1184 NVMulSLFrm, itin,
1185 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1186 [(set (ResTy QPR:$dst),
1187 (ResTy (IntOp (ResTy QPR:$src1),
1188 (OpTy DPR:$src2),
1189 (OpTy (NEONvduplane (OpTy DPR_VFP2:$src3),
1190 imm:$lane)))))]>;
Bob Wilson1d2c4212010-02-17 00:31:29 +00001191class N3VLInt3SL16<bit op24, bits<2> op21_20, bits<4> op11_8,
1192 InstrItinClass itin, string OpcodeStr, string Dt,
1193 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Bob Wilson724df1c2010-03-27 03:56:52 +00001194 : N3V<op24, 1, op21_20, op11_8, 1, 0,
1195 (outs QPR:$dst),
1196 (ins QPR:$src1, DPR:$src2, DPR_8:$src3, nohash_imm:$lane),
1197 NVMulSLFrm, itin,
1198 OpcodeStr, Dt, "$dst, $src2, $src3[$lane]", "$src1 = $dst",
1199 [(set (ResTy QPR:$dst),
1200 (ResTy (IntOp (ResTy QPR:$src1),
1201 (OpTy DPR:$src2),
1202 (OpTy (NEONvduplane (OpTy DPR_8:$src3),
1203 imm:$lane)))))]>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001204
Bob Wilsone60fee02009-06-22 23:27:02 +00001205// Narrowing 3-register intrinsics.
1206class N3VNInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001207 string OpcodeStr, string Dt, ValueType TyD, ValueType TyQ,
Bob Wilsone60fee02009-06-22 23:27:02 +00001208 Intrinsic IntOp, bit Commutable>
1209 : N3V<op24, op23, op21_20, op11_8, 0, op4,
Bob Wilson724df1c2010-03-27 03:56:52 +00001210 (outs DPR:$dst), (ins QPR:$src1, QPR:$src2), N3RegFrm, IIC_VBINi4D,
Evan Cheng09c61b32009-11-23 21:57:23 +00001211 OpcodeStr, Dt, "$dst, $src1, $src2", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001212 [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src1), (TyQ QPR:$src2))))]> {
1213 let isCommutable = Commutable;
1214}
1215
1216// Long 3-register intrinsics.
1217class N3VLInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001218 InstrItinClass itin, string OpcodeStr, string Dt,
1219 ValueType TyQ, ValueType TyD, Intrinsic IntOp, bit Commutable>
Bob Wilsone60fee02009-06-22 23:27:02 +00001220 : N3V<op24, op23, op21_20, op11_8, 0, op4,
Bob Wilson724df1c2010-03-27 03:56:52 +00001221 (outs QPR:$dst), (ins DPR:$src1, DPR:$src2), N3RegFrm, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001222 OpcodeStr, Dt, "$dst, $src1, $src2", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001223 [(set QPR:$dst, (TyQ (IntOp (TyD DPR:$src1), (TyD DPR:$src2))))]> {
1224 let isCommutable = Commutable;
1225}
David Goodwin36bff0c2009-09-25 18:38:29 +00001226class N3VLIntSL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001227 string OpcodeStr, string Dt,
1228 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Bob Wilson724df1c2010-03-27 03:56:52 +00001229 : N3V<op24, 1, op21_20, op11_8, 1, 0,
1230 (outs QPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane),
1231 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1232 [(set (ResTy QPR:$dst),
1233 (ResTy (IntOp (OpTy DPR:$src1),
1234 (OpTy (NEONvduplane (OpTy DPR_VFP2:$src2),
1235 imm:$lane)))))]>;
Bob Wilson1d2c4212010-02-17 00:31:29 +00001236class N3VLIntSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
1237 InstrItinClass itin, string OpcodeStr, string Dt,
1238 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
Bob Wilson724df1c2010-03-27 03:56:52 +00001239 : N3V<op24, 1, op21_20, op11_8, 1, 0,
1240 (outs QPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane),
1241 NVMulSLFrm, itin, OpcodeStr, Dt, "$dst, $src1, $src2[$lane]", "",
1242 [(set (ResTy QPR:$dst),
1243 (ResTy (IntOp (OpTy DPR:$src1),
1244 (OpTy (NEONvduplane (OpTy DPR_8:$src2),
1245 imm:$lane)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001246
1247// Wide 3-register intrinsics.
1248class N3VWInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001249 string OpcodeStr, string Dt, ValueType TyQ, ValueType TyD,
Bob Wilsone60fee02009-06-22 23:27:02 +00001250 Intrinsic IntOp, bit Commutable>
1251 : N3V<op24, op23, op21_20, op11_8, 0, op4,
Bob Wilson724df1c2010-03-27 03:56:52 +00001252 (outs QPR:$dst), (ins QPR:$src1, DPR:$src2), N3RegFrm, IIC_VSUBiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001253 OpcodeStr, Dt, "$dst, $src1, $src2", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001254 [(set QPR:$dst, (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$src2))))]> {
1255 let isCommutable = Commutable;
1256}
1257
1258// Pairwise long 2-register intrinsics, both double- and quad-register.
1259class N2VDPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
Evan Cheng09c61b32009-11-23 21:57:23 +00001260 bits<2> op17_16, bits<5> op11_7, bit op4,
1261 string OpcodeStr, string Dt,
Bob Wilsone60fee02009-06-22 23:27:02 +00001262 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1263 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst),
Evan Cheng09c61b32009-11-23 21:57:23 +00001264 (ins DPR:$src), IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001265 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src))))]>;
1266class N2VQPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
Evan Cheng09c61b32009-11-23 21:57:23 +00001267 bits<2> op17_16, bits<5> op11_7, bit op4,
1268 string OpcodeStr, string Dt,
Bob Wilsone60fee02009-06-22 23:27:02 +00001269 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1270 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst),
Evan Cheng09c61b32009-11-23 21:57:23 +00001271 (ins QPR:$src), IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001272 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src))))]>;
1273
1274// Pairwise long 2-register accumulate intrinsics,
1275// both double- and quad-register.
1276// The destination register is also used as the first source operand register.
1277class N2VDPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
Evan Cheng09c61b32009-11-23 21:57:23 +00001278 bits<2> op17_16, bits<5> op11_7, bit op4,
1279 string OpcodeStr, string Dt,
Bob Wilsone60fee02009-06-22 23:27:02 +00001280 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1281 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001282 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), IIC_VPALiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001283 OpcodeStr, Dt, "$dst, $src2", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001284 [(set DPR:$dst, (ResTy (IntOp (ResTy DPR:$src1), (OpTy DPR:$src2))))]>;
1285class N2VQPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
Evan Cheng09c61b32009-11-23 21:57:23 +00001286 bits<2> op17_16, bits<5> op11_7, bit op4,
1287 string OpcodeStr, string Dt,
Bob Wilsone60fee02009-06-22 23:27:02 +00001288 ValueType ResTy, ValueType OpTy, Intrinsic IntOp>
1289 : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001290 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), IIC_VPALiQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00001291 OpcodeStr, Dt, "$dst, $src2", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001292 [(set QPR:$dst, (ResTy (IntOp (ResTy QPR:$src1), (OpTy QPR:$src2))))]>;
1293
1294// Shift by immediate,
1295// both double- and quad-register.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001296class N2VDSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001297 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
Evan Cheng09c61b32009-11-23 21:57:23 +00001298 ValueType Ty, SDNode OpNode>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001299 : N2VImm<op24, op23, op11_8, op7, 0, op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001300 (outs DPR:$dst), (ins DPR:$src, i32imm:$SIMM), f, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001301 OpcodeStr, Dt, "$dst, $src, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001302 [(set DPR:$dst, (Ty (OpNode (Ty DPR:$src), (i32 imm:$SIMM))))]>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001303class N2VQSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001304 Format f, InstrItinClass itin, string OpcodeStr, string Dt,
Evan Cheng09c61b32009-11-23 21:57:23 +00001305 ValueType Ty, SDNode OpNode>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001306 : N2VImm<op24, op23, op11_8, op7, 1, op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001307 (outs QPR:$dst), (ins QPR:$src, i32imm:$SIMM), f, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001308 OpcodeStr, Dt, "$dst, $src, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001309 [(set QPR:$dst, (Ty (OpNode (Ty QPR:$src), (i32 imm:$SIMM))))]>;
1310
Johnny Chen7c3f3862010-03-17 23:26:50 +00001311// Long shift by immediate.
1312class N2VLSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
1313 string OpcodeStr, string Dt,
1314 ValueType ResTy, ValueType OpTy, SDNode OpNode>
1315 : N2VImm<op24, op23, op11_8, op7, op6, op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001316 (outs QPR:$dst), (ins DPR:$src, i32imm:$SIMM), N2RegVShLFrm,
Johnny Chen16e78bb2010-03-25 20:39:04 +00001317 IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src, $SIMM", "",
Johnny Chen7c3f3862010-03-17 23:26:50 +00001318 [(set QPR:$dst, (ResTy (OpNode (OpTy DPR:$src),
1319 (i32 imm:$SIMM))))]>;
1320
Bob Wilsone60fee02009-06-22 23:27:02 +00001321// Narrow shift by immediate.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001322class N2VNSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001323 InstrItinClass itin, string OpcodeStr, string Dt,
David Goodwin36bff0c2009-09-25 18:38:29 +00001324 ValueType ResTy, ValueType OpTy, SDNode OpNode>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001325 : N2VImm<op24, op23, op11_8, op7, op6, op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001326 (outs DPR:$dst), (ins QPR:$src, i32imm:$SIMM), N2RegVShRFrm, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001327 OpcodeStr, Dt, "$dst, $src, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001328 [(set DPR:$dst, (ResTy (OpNode (OpTy QPR:$src),
1329 (i32 imm:$SIMM))))]>;
1330
1331// Shift right by immediate and accumulate,
1332// both double- and quad-register.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001333class N2VDShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001334 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001335 : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$dst),
Johnny Chen81f9b982010-03-26 01:07:59 +00001336 (ins DPR:$src1, DPR:$src2, i32imm:$SIMM), N2RegVShRFrm, IIC_VPALiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001337 OpcodeStr, Dt, "$dst, $src2, $SIMM", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001338 [(set DPR:$dst, (Ty (add DPR:$src1,
1339 (Ty (ShOp DPR:$src2, (i32 imm:$SIMM))))))]>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001340class N2VQShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001341 string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001342 : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$dst),
Johnny Chen81f9b982010-03-26 01:07:59 +00001343 (ins QPR:$src1, QPR:$src2, i32imm:$SIMM), N2RegVShRFrm, IIC_VPALiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001344 OpcodeStr, Dt, "$dst, $src2, $SIMM", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001345 [(set QPR:$dst, (Ty (add QPR:$src1,
1346 (Ty (ShOp QPR:$src2, (i32 imm:$SIMM))))))]>;
1347
1348// Shift by immediate and insert,
1349// both double- and quad-register.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001350class N2VDShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001351 Format f, string OpcodeStr, string Dt, ValueType Ty,SDNode ShOp>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001352 : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$dst),
Johnny Chen81f9b982010-03-26 01:07:59 +00001353 (ins DPR:$src1, DPR:$src2, i32imm:$SIMM), f, IIC_VSHLiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001354 OpcodeStr, Dt, "$dst, $src2, $SIMM", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001355 [(set DPR:$dst, (Ty (ShOp DPR:$src1, DPR:$src2, (i32 imm:$SIMM))))]>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001356class N2VQShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001357 Format f, string OpcodeStr, string Dt, ValueType Ty,SDNode ShOp>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001358 : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$dst),
Johnny Chen81f9b982010-03-26 01:07:59 +00001359 (ins QPR:$src1, QPR:$src2, i32imm:$SIMM), f, IIC_VSHLiQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00001360 OpcodeStr, Dt, "$dst, $src2, $SIMM", "$src1 = $dst",
Bob Wilsone60fee02009-06-22 23:27:02 +00001361 [(set QPR:$dst, (Ty (ShOp QPR:$src1, QPR:$src2, (i32 imm:$SIMM))))]>;
1362
1363// Convert, with fractional bits immediate,
1364// both double- and quad-register.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001365class N2VCvtD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001366 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
Bob Wilsone60fee02009-06-22 23:27:02 +00001367 Intrinsic IntOp>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001368 : N2VImm<op24, op23, op11_8, op7, 0, op4,
Johnny Chen16e78bb2010-03-25 20:39:04 +00001369 (outs DPR:$dst), (ins DPR:$src, i32imm:$SIMM), NVCVTFrm,
1370 IIC_VUNAD, OpcodeStr, Dt, "$dst, $src, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001371 [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src), (i32 imm:$SIMM))))]>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001372class N2VCvtQ<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001373 string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
Bob Wilsone60fee02009-06-22 23:27:02 +00001374 Intrinsic IntOp>
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001375 : N2VImm<op24, op23, op11_8, op7, 1, op4,
Johnny Chen16e78bb2010-03-25 20:39:04 +00001376 (outs QPR:$dst), (ins QPR:$src, i32imm:$SIMM), NVCVTFrm,
1377 IIC_VUNAQ, OpcodeStr, Dt, "$dst, $src, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00001378 [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src), (i32 imm:$SIMM))))]>;
1379
1380//===----------------------------------------------------------------------===//
1381// Multiclasses
1382//===----------------------------------------------------------------------===//
1383
Bob Wilson8af7b532009-10-03 04:44:16 +00001384// Abbreviations used in multiclass suffixes:
1385// Q = quarter int (8 bit) elements
1386// H = half int (16 bit) elements
1387// S = single int (32 bit) elements
1388// D = double int (64 bit) elements
1389
Johnny Chenfc9ef992010-02-23 00:33:12 +00001390// Neon 2-register vector operations -- for disassembly only.
1391
1392// First with only element sizes of 8, 16 and 32 bits:
Johnny Chenc2b70b52010-02-23 01:42:58 +00001393multiclass N2V_QHS_cmp<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
1394 bits<5> op11_7, bit op4, string opc, string Dt,
1395 string asm> {
Johnny Chenfc9ef992010-02-23 00:33:12 +00001396 // 64-bit vector types.
1397 def v8i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 0, op4,
1398 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
Johnny Chenc2b70b52010-02-23 01:42:58 +00001399 opc, !strconcat(Dt, "8"), asm, "", []>;
Johnny Chenfc9ef992010-02-23 00:33:12 +00001400 def v4i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 0, op4,
1401 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
Johnny Chenc2b70b52010-02-23 01:42:58 +00001402 opc, !strconcat(Dt, "16"), asm, "", []>;
Johnny Chenfc9ef992010-02-23 00:33:12 +00001403 def v2i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
1404 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
Johnny Chenc2b70b52010-02-23 01:42:58 +00001405 opc, !strconcat(Dt, "32"), asm, "", []>;
Johnny Chenfc9ef992010-02-23 00:33:12 +00001406 def v2f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
1407 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
1408 opc, "f32", asm, "", []> {
1409 let Inst{10} = 1; // overwrite F = 1
1410 }
1411
1412 // 128-bit vector types.
1413 def v16i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 1, op4,
1414 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
Johnny Chenc2b70b52010-02-23 01:42:58 +00001415 opc, !strconcat(Dt, "8"), asm, "", []>;
Johnny Chenfc9ef992010-02-23 00:33:12 +00001416 def v8i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 1, op4,
1417 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
Johnny Chenc2b70b52010-02-23 01:42:58 +00001418 opc, !strconcat(Dt, "16"), asm, "", []>;
Johnny Chenfc9ef992010-02-23 00:33:12 +00001419 def v4i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
1420 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
Johnny Chenc2b70b52010-02-23 01:42:58 +00001421 opc, !strconcat(Dt, "32"), asm, "", []>;
Johnny Chenfc9ef992010-02-23 00:33:12 +00001422 def v4f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
1423 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
1424 opc, "f32", asm, "", []> {
1425 let Inst{10} = 1; // overwrite F = 1
1426 }
1427}
1428
Bob Wilsone60fee02009-06-22 23:27:02 +00001429// Neon 3-register vector operations.
1430
1431// First with only element sizes of 8, 16 and 32 bits:
1432multiclass N3V_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin78caa122009-09-23 21:38:08 +00001433 InstrItinClass itinD16, InstrItinClass itinD32,
1434 InstrItinClass itinQ16, InstrItinClass itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001435 string OpcodeStr, string Dt,
1436 SDNode OpNode, bit Commutable = 0> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001437 // 64-bit vector types.
David Goodwin78caa122009-09-23 21:38:08 +00001438 def v8i8 : N3VD<op24, op23, 0b00, op11_8, op4, itinD16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001439 OpcodeStr, !strconcat(Dt, "8"),
1440 v8i8, v8i8, OpNode, Commutable>;
David Goodwin78caa122009-09-23 21:38:08 +00001441 def v4i16 : N3VD<op24, op23, 0b01, op11_8, op4, itinD16,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001442 OpcodeStr, !strconcat(Dt, "16"),
1443 v4i16, v4i16, OpNode, Commutable>;
David Goodwin78caa122009-09-23 21:38:08 +00001444 def v2i32 : N3VD<op24, op23, 0b10, op11_8, op4, itinD32,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001445 OpcodeStr, !strconcat(Dt, "32"),
1446 v2i32, v2i32, OpNode, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001447
1448 // 128-bit vector types.
David Goodwin78caa122009-09-23 21:38:08 +00001449 def v16i8 : N3VQ<op24, op23, 0b00, op11_8, op4, itinQ16,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001450 OpcodeStr, !strconcat(Dt, "8"),
1451 v16i8, v16i8, OpNode, Commutable>;
David Goodwin78caa122009-09-23 21:38:08 +00001452 def v8i16 : N3VQ<op24, op23, 0b01, op11_8, op4, itinQ16,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001453 OpcodeStr, !strconcat(Dt, "16"),
1454 v8i16, v8i16, OpNode, Commutable>;
David Goodwin78caa122009-09-23 21:38:08 +00001455 def v4i32 : N3VQ<op24, op23, 0b10, op11_8, op4, itinQ32,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001456 OpcodeStr, !strconcat(Dt, "32"),
1457 v4i32, v4i32, OpNode, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001458}
1459
Evan Cheng09c61b32009-11-23 21:57:23 +00001460multiclass N3VSL_HS<bits<4> op11_8, string OpcodeStr, string Dt, SDNode ShOp> {
1461 def v4i16 : N3VDSL16<0b01, op11_8, OpcodeStr, !strconcat(Dt, "16"),
1462 v4i16, ShOp>;
1463 def v2i32 : N3VDSL<0b10, op11_8, IIC_VMULi32D, OpcodeStr, !strconcat(Dt,"32"),
Evan Cheng67abcec2009-11-21 06:21:52 +00001464 v2i32, ShOp>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001465 def v8i16 : N3VQSL16<0b01, op11_8, OpcodeStr, !strconcat(Dt, "16"),
Evan Cheng67abcec2009-11-21 06:21:52 +00001466 v8i16, v4i16, ShOp>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001467 def v4i32 : N3VQSL<0b10, op11_8, IIC_VMULi32Q, OpcodeStr, !strconcat(Dt,"32"),
Evan Cheng67abcec2009-11-21 06:21:52 +00001468 v4i32, v2i32, ShOp>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001469}
1470
Bob Wilsone60fee02009-06-22 23:27:02 +00001471// ....then also with element size 64 bits:
1472multiclass N3V_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin78caa122009-09-23 21:38:08 +00001473 InstrItinClass itinD, InstrItinClass itinQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00001474 string OpcodeStr, string Dt,
1475 SDNode OpNode, bit Commutable = 0>
David Goodwin78caa122009-09-23 21:38:08 +00001476 : N3V_QHS<op24, op23, op11_8, op4, itinD, itinD, itinQ, itinQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00001477 OpcodeStr, Dt, OpNode, Commutable> {
David Goodwin78caa122009-09-23 21:38:08 +00001478 def v1i64 : N3VD<op24, op23, 0b11, op11_8, op4, itinD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001479 OpcodeStr, !strconcat(Dt, "64"),
1480 v1i64, v1i64, OpNode, Commutable>;
David Goodwin78caa122009-09-23 21:38:08 +00001481 def v2i64 : N3VQ<op24, op23, 0b11, op11_8, op4, itinQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00001482 OpcodeStr, !strconcat(Dt, "64"),
1483 v2i64, v2i64, OpNode, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001484}
1485
1486
1487// Neon Narrowing 2-register vector intrinsics,
1488// source operand element sizes of 16, 32 and 64 bits:
1489multiclass N2VNInt_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
David Goodwin78caa122009-09-23 21:38:08 +00001490 bits<5> op11_7, bit op6, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001491 InstrItinClass itin, string OpcodeStr, string Dt,
Bob Wilsone60fee02009-06-22 23:27:02 +00001492 Intrinsic IntOp> {
1493 def v8i8 : N2VNInt<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001494 itin, OpcodeStr, !strconcat(Dt, "16"),
1495 v8i8, v8i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001496 def v4i16 : N2VNInt<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001497 itin, OpcodeStr, !strconcat(Dt, "32"),
1498 v4i16, v4i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001499 def v2i32 : N2VNInt<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001500 itin, OpcodeStr, !strconcat(Dt, "64"),
1501 v2i32, v2i64, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001502}
1503
1504
1505// Neon Lengthening 2-register vector intrinsic (currently specific to VMOVL).
1506// source operand element sizes of 16, 32 and 64 bits:
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001507multiclass N2VLInt_QHS<bits<2> op24_23, bits<5> op11_7, bit op6, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001508 string OpcodeStr, string Dt, Intrinsic IntOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001509 def v8i16 : N2VLInt<op24_23, 0b00, 0b10, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001510 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, IntOp>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001511 def v4i32 : N2VLInt<op24_23, 0b01, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001512 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001513 def v2i64 : N2VLInt<op24_23, 0b10, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
Evan Cheng09c61b32009-11-23 21:57:23 +00001514 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001515}
1516
1517
1518// Neon 3-register vector intrinsics.
1519
1520// First with only element sizes of 16 and 32 bits:
Johnny Chenfe0978b2010-03-26 23:49:07 +00001521multiclass N3VInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
David Goodwin36bff0c2009-09-25 18:38:29 +00001522 InstrItinClass itinD16, InstrItinClass itinD32,
1523 InstrItinClass itinQ16, InstrItinClass itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001524 string OpcodeStr, string Dt,
1525 Intrinsic IntOp, bit Commutable = 0> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001526 // 64-bit vector types.
Johnny Chenfe0978b2010-03-26 23:49:07 +00001527 def v4i16 : N3VDInt<op24, op23, 0b01, op11_8, op4, f, itinD16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001528 OpcodeStr, !strconcat(Dt, "16"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001529 v4i16, v4i16, IntOp, Commutable>;
Johnny Chenfe0978b2010-03-26 23:49:07 +00001530 def v2i32 : N3VDInt<op24, op23, 0b10, op11_8, op4, f, itinD32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001531 OpcodeStr, !strconcat(Dt, "32"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001532 v2i32, v2i32, IntOp, Commutable>;
1533
1534 // 128-bit vector types.
Johnny Chenfe0978b2010-03-26 23:49:07 +00001535 def v8i16 : N3VQInt<op24, op23, 0b01, op11_8, op4, f, itinQ16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001536 OpcodeStr, !strconcat(Dt, "16"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001537 v8i16, v8i16, IntOp, Commutable>;
Johnny Chenfe0978b2010-03-26 23:49:07 +00001538 def v4i32 : N3VQInt<op24, op23, 0b10, op11_8, op4, f, itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001539 OpcodeStr, !strconcat(Dt, "32"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001540 v4i32, v4i32, IntOp, Commutable>;
1541}
1542
David Goodwin36bff0c2009-09-25 18:38:29 +00001543multiclass N3VIntSL_HS<bits<4> op11_8,
1544 InstrItinClass itinD16, InstrItinClass itinD32,
1545 InstrItinClass itinQ16, InstrItinClass itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001546 string OpcodeStr, string Dt, Intrinsic IntOp> {
Evan Cheng67abcec2009-11-21 06:21:52 +00001547 def v4i16 : N3VDIntSL16<0b01, op11_8, itinD16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001548 OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp>;
Evan Cheng67abcec2009-11-21 06:21:52 +00001549 def v2i32 : N3VDIntSL<0b10, op11_8, itinD32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001550 OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp>;
Evan Cheng67abcec2009-11-21 06:21:52 +00001551 def v8i16 : N3VQIntSL16<0b01, op11_8, itinQ16,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001552 OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16, IntOp>;
Evan Cheng67abcec2009-11-21 06:21:52 +00001553 def v4i32 : N3VQIntSL<0b10, op11_8, itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001554 OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32, IntOp>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001555}
1556
Bob Wilsone60fee02009-06-22 23:27:02 +00001557// ....then also with element size of 8 bits:
Johnny Chenfe0978b2010-03-26 23:49:07 +00001558multiclass N3VInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
David Goodwin36bff0c2009-09-25 18:38:29 +00001559 InstrItinClass itinD16, InstrItinClass itinD32,
1560 InstrItinClass itinQ16, InstrItinClass itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001561 string OpcodeStr, string Dt,
1562 Intrinsic IntOp, bit Commutable = 0>
Johnny Chenfe0978b2010-03-26 23:49:07 +00001563 : N3VInt_HS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001564 OpcodeStr, Dt, IntOp, Commutable> {
Johnny Chenfe0978b2010-03-26 23:49:07 +00001565 def v8i8 : N3VDInt<op24, op23, 0b00, op11_8, op4, f, itinD16,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001566 OpcodeStr, !strconcat(Dt, "8"),
1567 v8i8, v8i8, IntOp, Commutable>;
Johnny Chenfe0978b2010-03-26 23:49:07 +00001568 def v16i8 : N3VQInt<op24, op23, 0b00, op11_8, op4, f, itinQ16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001569 OpcodeStr, !strconcat(Dt, "8"),
1570 v16i8, v16i8, IntOp, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001571}
1572
1573// ....then also with element size of 64 bits:
Johnny Chenfe0978b2010-03-26 23:49:07 +00001574multiclass N3VInt_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
David Goodwin36bff0c2009-09-25 18:38:29 +00001575 InstrItinClass itinD16, InstrItinClass itinD32,
1576 InstrItinClass itinQ16, InstrItinClass itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001577 string OpcodeStr, string Dt,
1578 Intrinsic IntOp, bit Commutable = 0>
Johnny Chenfe0978b2010-03-26 23:49:07 +00001579 : N3VInt_QHS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001580 OpcodeStr, Dt, IntOp, Commutable> {
Johnny Chenfe0978b2010-03-26 23:49:07 +00001581 def v1i64 : N3VDInt<op24, op23, 0b11, op11_8, op4, f, itinD32,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001582 OpcodeStr, !strconcat(Dt, "64"),
1583 v1i64, v1i64, IntOp, Commutable>;
Johnny Chenfe0978b2010-03-26 23:49:07 +00001584 def v2i64 : N3VQInt<op24, op23, 0b11, op11_8, op4, f, itinQ32,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001585 OpcodeStr, !strconcat(Dt, "64"),
1586 v2i64, v2i64, IntOp, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001587}
1588
Bob Wilsone60fee02009-06-22 23:27:02 +00001589// Neon Narrowing 3-register vector intrinsics,
1590// source operand element sizes of 16, 32 and 64 bits:
1591multiclass N3VNInt_HSD<bit op24, bit op23, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001592 string OpcodeStr, string Dt,
1593 Intrinsic IntOp, bit Commutable = 0> {
1594 def v8i8 : N3VNInt<op24, op23, 0b00, op11_8, op4,
1595 OpcodeStr, !strconcat(Dt, "16"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001596 v8i8, v8i16, IntOp, Commutable>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001597 def v4i16 : N3VNInt<op24, op23, 0b01, op11_8, op4,
1598 OpcodeStr, !strconcat(Dt, "32"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001599 v4i16, v4i32, IntOp, Commutable>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001600 def v2i32 : N3VNInt<op24, op23, 0b10, op11_8, op4,
1601 OpcodeStr, !strconcat(Dt, "64"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001602 v2i32, v2i64, IntOp, Commutable>;
1603}
1604
1605
1606// Neon Long 3-register vector intrinsics.
1607
1608// First with only element sizes of 16 and 32 bits:
1609multiclass N3VLInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
Anton Korobeynikov8d062472010-04-07 18:21:10 +00001610 InstrItinClass itin16, InstrItinClass itin32,
1611 string OpcodeStr, string Dt,
David Goodwin36bff0c2009-09-25 18:38:29 +00001612 Intrinsic IntOp, bit Commutable = 0> {
Anton Korobeynikov8d062472010-04-07 18:21:10 +00001613 def v4i32 : N3VLInt<op24, op23, 0b01, op11_8, op4, itin16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001614 OpcodeStr, !strconcat(Dt, "16"),
1615 v4i32, v4i16, IntOp, Commutable>;
Anton Korobeynikov8d062472010-04-07 18:21:10 +00001616 def v2i64 : N3VLInt<op24, op23, 0b10, op11_8, op4, itin32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001617 OpcodeStr, !strconcat(Dt, "32"),
1618 v2i64, v2i32, IntOp, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001619}
1620
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001621multiclass N3VLIntSL_HS<bit op24, bits<4> op11_8,
Evan Cheng09c61b32009-11-23 21:57:23 +00001622 InstrItinClass itin, string OpcodeStr, string Dt,
1623 Intrinsic IntOp> {
David Goodwin36bff0c2009-09-25 18:38:29 +00001624 def v4i16 : N3VLIntSL16<op24, 0b01, op11_8, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001625 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001626 def v2i32 : N3VLIntSL<op24, 0b10, op11_8, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001627 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001628}
1629
Bob Wilsone60fee02009-06-22 23:27:02 +00001630// ....then also with element size of 8 bits:
1631multiclass N3VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
Anton Korobeynikov8d062472010-04-07 18:21:10 +00001632 InstrItinClass itin16, InstrItinClass itin32,
1633 string OpcodeStr, string Dt,
David Goodwin36bff0c2009-09-25 18:38:29 +00001634 Intrinsic IntOp, bit Commutable = 0>
Anton Korobeynikov8d062472010-04-07 18:21:10 +00001635 : N3VLInt_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt,
Evan Cheng09c61b32009-11-23 21:57:23 +00001636 IntOp, Commutable> {
Anton Korobeynikov8d062472010-04-07 18:21:10 +00001637 def v8i16 : N3VLInt<op24, op23, 0b00, op11_8, op4, itin16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001638 OpcodeStr, !strconcat(Dt, "8"),
1639 v8i16, v8i8, IntOp, Commutable>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001640}
1641
1642
1643// Neon Wide 3-register vector intrinsics,
1644// source operand element sizes of 8, 16 and 32 bits:
1645multiclass N3VWInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001646 string OpcodeStr, string Dt,
1647 Intrinsic IntOp, bit Commutable = 0> {
1648 def v8i16 : N3VWInt<op24, op23, 0b00, op11_8, op4,
1649 OpcodeStr, !strconcat(Dt, "8"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001650 v8i16, v8i8, IntOp, Commutable>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001651 def v4i32 : N3VWInt<op24, op23, 0b01, op11_8, op4,
1652 OpcodeStr, !strconcat(Dt, "16"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001653 v4i32, v4i16, IntOp, Commutable>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001654 def v2i64 : N3VWInt<op24, op23, 0b10, op11_8, op4,
1655 OpcodeStr, !strconcat(Dt, "32"),
Bob Wilsone60fee02009-06-22 23:27:02 +00001656 v2i64, v2i32, IntOp, Commutable>;
1657}
1658
1659
1660// Neon Multiply-Op vector operations,
1661// element sizes of 8, 16 and 32 bits:
1662multiclass N3VMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
David Goodwin36bff0c2009-09-25 18:38:29 +00001663 InstrItinClass itinD16, InstrItinClass itinD32,
1664 InstrItinClass itinQ16, InstrItinClass itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001665 string OpcodeStr, string Dt, SDNode OpNode> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001666 // 64-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001667 def v8i8 : N3VDMulOp<op24, op23, 0b00, op11_8, op4, itinD16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001668 OpcodeStr, !strconcat(Dt, "8"), v8i8, mul, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001669 def v4i16 : N3VDMulOp<op24, op23, 0b01, op11_8, op4, itinD16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001670 OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001671 def v2i32 : N3VDMulOp<op24, op23, 0b10, op11_8, op4, itinD32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001672 OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, OpNode>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001673
1674 // 128-bit vector types.
David Goodwin36bff0c2009-09-25 18:38:29 +00001675 def v16i8 : N3VQMulOp<op24, op23, 0b00, op11_8, op4, itinQ16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001676 OpcodeStr, !strconcat(Dt, "8"), v16i8, mul, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001677 def v8i16 : N3VQMulOp<op24, op23, 0b01, op11_8, op4, itinQ16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001678 OpcodeStr, !strconcat(Dt, "16"), v8i16, mul, OpNode>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001679 def v4i32 : N3VQMulOp<op24, op23, 0b10, op11_8, op4, itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001680 OpcodeStr, !strconcat(Dt, "32"), v4i32, mul, OpNode>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001681}
1682
David Goodwin36bff0c2009-09-25 18:38:29 +00001683multiclass N3VMulOpSL_HS<bits<4> op11_8,
1684 InstrItinClass itinD16, InstrItinClass itinD32,
1685 InstrItinClass itinQ16, InstrItinClass itinQ32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001686 string OpcodeStr, string Dt, SDNode ShOp> {
David Goodwin36bff0c2009-09-25 18:38:29 +00001687 def v4i16 : N3VDMulOpSL16<0b01, op11_8, itinD16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001688 OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, ShOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001689 def v2i32 : N3VDMulOpSL<0b10, op11_8, itinD32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001690 OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, ShOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001691 def v8i16 : N3VQMulOpSL16<0b01, op11_8, itinQ16,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001692 OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16,
1693 mul, ShOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001694 def v4i32 : N3VQMulOpSL<0b10, op11_8, itinQ32,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001695 OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32,
1696 mul, ShOp>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001697}
Bob Wilsone60fee02009-06-22 23:27:02 +00001698
1699// Neon 3-argument intrinsics,
1700// element sizes of 8, 16 and 32 bits:
1701multiclass N3VInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
Anton Korobeynikov6928d7c2010-04-07 18:20:42 +00001702 InstrItinClass itinD, InstrItinClass itinQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00001703 string OpcodeStr, string Dt, Intrinsic IntOp> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001704 // 64-bit vector types.
Anton Korobeynikov6928d7c2010-04-07 18:20:42 +00001705 def v8i8 : N3VDInt3<op24, op23, 0b00, op11_8, op4, itinD,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001706 OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
Anton Korobeynikov6928d7c2010-04-07 18:20:42 +00001707 def v4i16 : N3VDInt3<op24, op23, 0b01, op11_8, op4, itinD,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001708 OpcodeStr, !strconcat(Dt, "16"), v4i16, v4i16, IntOp>;
Anton Korobeynikov6928d7c2010-04-07 18:20:42 +00001709 def v2i32 : N3VDInt3<op24, op23, 0b10, op11_8, op4, itinD,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001710 OpcodeStr, !strconcat(Dt, "32"), v2i32, v2i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001711
1712 // 128-bit vector types.
Anton Korobeynikov6928d7c2010-04-07 18:20:42 +00001713 def v16i8 : N3VQInt3<op24, op23, 0b00, op11_8, op4, itinQ,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001714 OpcodeStr, !strconcat(Dt, "8"), v16i8, v16i8, IntOp>;
Anton Korobeynikov6928d7c2010-04-07 18:20:42 +00001715 def v8i16 : N3VQInt3<op24, op23, 0b01, op11_8, op4, itinQ,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001716 OpcodeStr, !strconcat(Dt, "16"), v8i16, v8i16, IntOp>;
Anton Korobeynikov6928d7c2010-04-07 18:20:42 +00001717 def v4i32 : N3VQInt3<op24, op23, 0b10, op11_8, op4, itinQ,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001718 OpcodeStr, !strconcat(Dt, "32"), v4i32, v4i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001719}
1720
1721
1722// Neon Long 3-argument intrinsics.
1723
1724// First with only element sizes of 16 and 32 bits:
1725multiclass N3VLInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
Anton Korobeynikov290319b2010-04-07 18:21:04 +00001726 InstrItinClass itin16, InstrItinClass itin32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001727 string OpcodeStr, string Dt, Intrinsic IntOp> {
Anton Korobeynikov290319b2010-04-07 18:21:04 +00001728 def v4i32 : N3VLInt3<op24, op23, 0b01, op11_8, op4, itin16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001729 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
Anton Korobeynikov290319b2010-04-07 18:21:04 +00001730 def v2i64 : N3VLInt3<op24, op23, 0b10, op11_8, op4, itin32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001731 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001732}
1733
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001734multiclass N3VLInt3SL_HS<bit op24, bits<4> op11_8,
Evan Cheng09c61b32009-11-23 21:57:23 +00001735 string OpcodeStr, string Dt, Intrinsic IntOp> {
David Goodwin36bff0c2009-09-25 18:38:29 +00001736 def v4i16 : N3VLInt3SL16<op24, 0b01, op11_8, IIC_VMACi16D,
Evan Cheng09c61b32009-11-23 21:57:23 +00001737 OpcodeStr, !strconcat(Dt,"16"), v4i32, v4i16, IntOp>;
David Goodwin36bff0c2009-09-25 18:38:29 +00001738 def v2i32 : N3VLInt3SL<op24, 0b10, op11_8, IIC_VMACi32D,
Evan Cheng09c61b32009-11-23 21:57:23 +00001739 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00001740}
1741
Bob Wilsone60fee02009-06-22 23:27:02 +00001742// ....then also with element size of 8 bits:
1743multiclass N3VLInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
Anton Korobeynikov290319b2010-04-07 18:21:04 +00001744 InstrItinClass itin16, InstrItinClass itin32,
Evan Cheng09c61b32009-11-23 21:57:23 +00001745 string OpcodeStr, string Dt, Intrinsic IntOp>
Anton Korobeynikov290319b2010-04-07 18:21:04 +00001746 : N3VLInt3_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt, IntOp> {
1747 def v8i16 : N3VLInt3<op24, op23, 0b00, op11_8, op4, itin16,
Evan Cheng09c61b32009-11-23 21:57:23 +00001748 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001749}
1750
1751
1752// Neon 2-register vector intrinsics,
1753// element sizes of 8, 16 and 32 bits:
1754multiclass N2VInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
David Goodwin78caa122009-09-23 21:38:08 +00001755 bits<5> op11_7, bit op4,
1756 InstrItinClass itinD, InstrItinClass itinQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00001757 string OpcodeStr, string Dt, Intrinsic IntOp> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001758 // 64-bit vector types.
1759 def v8i8 : N2VDInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001760 itinD, OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001761 def v4i16 : N2VDInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001762 itinD, OpcodeStr, !strconcat(Dt, "16"),v4i16,v4i16,IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001763 def v2i32 : N2VDInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001764 itinD, OpcodeStr, !strconcat(Dt, "32"),v2i32,v2i32,IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001765
1766 // 128-bit vector types.
1767 def v16i8 : N2VQInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001768 itinQ, OpcodeStr, !strconcat(Dt, "8"), v16i8,v16i8,IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001769 def v8i16 : N2VQInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001770 itinQ, OpcodeStr, !strconcat(Dt, "16"),v8i16,v8i16,IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001771 def v4i32 : N2VQInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
Bob Wilson1d2c4212010-02-17 00:31:29 +00001772 itinQ, OpcodeStr, !strconcat(Dt, "32"),v4i32,v4i32,IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001773}
1774
1775
1776// Neon Pairwise long 2-register intrinsics,
1777// element sizes of 8, 16 and 32 bits:
1778multiclass N2VPLInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
1779 bits<5> op11_7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001780 string OpcodeStr, string Dt, Intrinsic IntOp> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001781 // 64-bit vector types.
1782 def v8i8 : N2VDPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001783 OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001784 def v4i16 : N2VDPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001785 OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001786 def v2i32 : N2VDPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001787 OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001788
1789 // 128-bit vector types.
1790 def v16i8 : N2VQPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001791 OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001792 def v8i16 : N2VQPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001793 OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001794 def v4i32 : N2VQPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001795 OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001796}
1797
1798
1799// Neon Pairwise long 2-register accumulate intrinsics,
1800// element sizes of 8, 16 and 32 bits:
1801multiclass N2VPLInt2_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
1802 bits<5> op11_7, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001803 string OpcodeStr, string Dt, Intrinsic IntOp> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001804 // 64-bit vector types.
1805 def v8i8 : N2VDPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001806 OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001807 def v4i16 : N2VDPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001808 OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001809 def v2i32 : N2VDPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001810 OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001811
1812 // 128-bit vector types.
1813 def v16i8 : N2VQPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001814 OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001815 def v8i16 : N2VQPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001816 OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001817 def v4i32 : N2VQPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001818 OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001819}
1820
1821
1822// Neon 2-register vector shift by immediate,
Johnny Chen81f9b982010-03-26 01:07:59 +00001823// with f of either N2RegVShLFrm or N2RegVShRFrm
Bob Wilsone60fee02009-06-22 23:27:02 +00001824// element sizes of 8, 16, 32 and 64 bits:
1825multiclass N2VSh_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001826 InstrItinClass itin, string OpcodeStr, string Dt,
1827 SDNode OpNode, Format f> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001828 // 64-bit vector types.
Johnny Chen81f9b982010-03-26 01:07:59 +00001829 def v8i8 : N2VDSh<op24, op23, op11_8, 0, op4, f, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001830 OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001831 let Inst{21-19} = 0b001; // imm6 = 001xxx
1832 }
Johnny Chen81f9b982010-03-26 01:07:59 +00001833 def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, f, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001834 OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001835 let Inst{21-20} = 0b01; // imm6 = 01xxxx
1836 }
Johnny Chen81f9b982010-03-26 01:07:59 +00001837 def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, f, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001838 OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001839 let Inst{21} = 0b1; // imm6 = 1xxxxx
1840 }
Johnny Chen81f9b982010-03-26 01:07:59 +00001841 def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, f, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001842 OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001843 // imm6 = xxxxxx
Bob Wilsone60fee02009-06-22 23:27:02 +00001844
1845 // 128-bit vector types.
Johnny Chen81f9b982010-03-26 01:07:59 +00001846 def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, f, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001847 OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001848 let Inst{21-19} = 0b001; // imm6 = 001xxx
1849 }
Johnny Chen81f9b982010-03-26 01:07:59 +00001850 def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, f, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001851 OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001852 let Inst{21-20} = 0b01; // imm6 = 01xxxx
1853 }
Johnny Chen81f9b982010-03-26 01:07:59 +00001854 def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, f, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001855 OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001856 let Inst{21} = 0b1; // imm6 = 1xxxxx
1857 }
Johnny Chen81f9b982010-03-26 01:07:59 +00001858 def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, f, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001859 OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001860 // imm6 = xxxxxx
Bob Wilsone60fee02009-06-22 23:27:02 +00001861}
1862
Bob Wilsone60fee02009-06-22 23:27:02 +00001863// Neon Shift-Accumulate vector operations,
1864// element sizes of 8, 16, 32 and 64 bits:
1865multiclass N2VShAdd_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001866 string OpcodeStr, string Dt, SDNode ShOp> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001867 // 64-bit vector types.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001868 def v8i8 : N2VDShAdd<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001869 OpcodeStr, !strconcat(Dt, "8"), v8i8, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001870 let Inst{21-19} = 0b001; // imm6 = 001xxx
1871 }
1872 def v4i16 : N2VDShAdd<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001873 OpcodeStr, !strconcat(Dt, "16"), v4i16, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001874 let Inst{21-20} = 0b01; // imm6 = 01xxxx
1875 }
1876 def v2i32 : N2VDShAdd<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001877 OpcodeStr, !strconcat(Dt, "32"), v2i32, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001878 let Inst{21} = 0b1; // imm6 = 1xxxxx
1879 }
1880 def v1i64 : N2VDShAdd<op24, op23, op11_8, 1, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001881 OpcodeStr, !strconcat(Dt, "64"), v1i64, ShOp>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001882 // imm6 = xxxxxx
Bob Wilsone60fee02009-06-22 23:27:02 +00001883
1884 // 128-bit vector types.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001885 def v16i8 : N2VQShAdd<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001886 OpcodeStr, !strconcat(Dt, "8"), v16i8, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001887 let Inst{21-19} = 0b001; // imm6 = 001xxx
1888 }
1889 def v8i16 : N2VQShAdd<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001890 OpcodeStr, !strconcat(Dt, "16"), v8i16, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001891 let Inst{21-20} = 0b01; // imm6 = 01xxxx
1892 }
1893 def v4i32 : N2VQShAdd<op24, op23, op11_8, 0, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001894 OpcodeStr, !strconcat(Dt, "32"), v4i32, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001895 let Inst{21} = 0b1; // imm6 = 1xxxxx
1896 }
1897 def v2i64 : N2VQShAdd<op24, op23, op11_8, 1, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001898 OpcodeStr, !strconcat(Dt, "64"), v2i64, ShOp>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001899 // imm6 = xxxxxx
Bob Wilsone60fee02009-06-22 23:27:02 +00001900}
1901
1902
1903// Neon Shift-Insert vector operations,
Johnny Chen81f9b982010-03-26 01:07:59 +00001904// with f of either N2RegVShLFrm or N2RegVShRFrm
Bob Wilsone60fee02009-06-22 23:27:02 +00001905// element sizes of 8, 16, 32 and 64 bits:
1906multiclass N2VShIns_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001907 string OpcodeStr, SDNode ShOp,
1908 Format f> {
Bob Wilsone60fee02009-06-22 23:27:02 +00001909 // 64-bit vector types.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001910 def v8i8 : N2VDShIns<op24, op23, op11_8, 0, op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001911 f, OpcodeStr, "8", v8i8, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001912 let Inst{21-19} = 0b001; // imm6 = 001xxx
1913 }
1914 def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001915 f, OpcodeStr, "16", v4i16, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001916 let Inst{21-20} = 0b01; // imm6 = 01xxxx
1917 }
1918 def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001919 f, OpcodeStr, "32", v2i32, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001920 let Inst{21} = 0b1; // imm6 = 1xxxxx
1921 }
1922 def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001923 f, OpcodeStr, "64", v1i64, ShOp>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001924 // imm6 = xxxxxx
Bob Wilsone60fee02009-06-22 23:27:02 +00001925
1926 // 128-bit vector types.
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001927 def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001928 f, OpcodeStr, "8", v16i8, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001929 let Inst{21-19} = 0b001; // imm6 = 001xxx
1930 }
1931 def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001932 f, OpcodeStr, "16", v8i16, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001933 let Inst{21-20} = 0b01; // imm6 = 01xxxx
1934 }
1935 def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001936 f, OpcodeStr, "32", v4i32, ShOp> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001937 let Inst{21} = 0b1; // imm6 = 1xxxxx
1938 }
1939 def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4,
Johnny Chen81f9b982010-03-26 01:07:59 +00001940 f, OpcodeStr, "64", v2i64, ShOp>;
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001941 // imm6 = xxxxxx
1942}
1943
1944// Neon Shift Long operations,
1945// element sizes of 8, 16, 32 bits:
1946multiclass N2VLSh_QHS<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
Evan Cheng09c61b32009-11-23 21:57:23 +00001947 bit op4, string OpcodeStr, string Dt, SDNode OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001948 def v8i16 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001949 OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001950 let Inst{21-19} = 0b001; // imm6 = 001xxx
1951 }
1952 def v4i32 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001953 OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001954 let Inst{21-20} = 0b01; // imm6 = 01xxxx
1955 }
1956 def v2i64 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
Evan Cheng09c61b32009-11-23 21:57:23 +00001957 OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001958 let Inst{21} = 0b1; // imm6 = 1xxxxx
1959 }
1960}
1961
1962// Neon Shift Narrow operations,
1963// element sizes of 16, 32, 64 bits:
1964multiclass N2VNSh_HSD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
Evan Cheng09c61b32009-11-23 21:57:23 +00001965 bit op4, InstrItinClass itin, string OpcodeStr, string Dt,
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001966 SDNode OpNode> {
1967 def v8i8 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001968 OpcodeStr, !strconcat(Dt, "16"), v8i8, v8i16, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001969 let Inst{21-19} = 0b001; // imm6 = 001xxx
1970 }
1971 def v4i16 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001972 OpcodeStr, !strconcat(Dt, "32"), v4i16, v4i32, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001973 let Inst{21-20} = 0b01; // imm6 = 01xxxx
1974 }
1975 def v2i32 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
Evan Cheng09c61b32009-11-23 21:57:23 +00001976 OpcodeStr, !strconcat(Dt, "64"), v2i32, v2i64, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00001977 let Inst{21} = 0b1; // imm6 = 1xxxxx
1978 }
Bob Wilsone60fee02009-06-22 23:27:02 +00001979}
1980
1981//===----------------------------------------------------------------------===//
1982// Instruction Definitions.
1983//===----------------------------------------------------------------------===//
1984
1985// Vector Add Operations.
1986
1987// VADD : Vector Add (integer and floating-point)
Evan Cheng09c61b32009-11-23 21:57:23 +00001988defm VADD : N3V_QHSD<0, 0, 0b1000, 0, IIC_VBINiD, IIC_VBINiQ, "vadd", "i",
Evan Cheng67abcec2009-11-21 06:21:52 +00001989 add, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001990def VADDfd : N3VD<0, 0, 0b00, 0b1101, 0, IIC_VBIND, "vadd", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00001991 v2f32, v2f32, fadd, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00001992def VADDfq : N3VQ<0, 0, 0b00, 0b1101, 0, IIC_VBINQ, "vadd", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00001993 v4f32, v4f32, fadd, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001994// VADDL : Vector Add Long (Q = D + D)
Anton Korobeynikov8d062472010-04-07 18:21:10 +00001995defm VADDLs : N3VLInt_QHS<0,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
1996 "vaddl", "s", int_arm_neon_vaddls, 1>;
1997defm VADDLu : N3VLInt_QHS<1,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
1998 "vaddl", "u", int_arm_neon_vaddlu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00001999// VADDW : Vector Add Wide (Q = Q + D)
Evan Cheng09c61b32009-11-23 21:57:23 +00002000defm VADDWs : N3VWInt_QHS<0,1,0b0001,0, "vaddw", "s", int_arm_neon_vaddws, 0>;
2001defm VADDWu : N3VWInt_QHS<1,1,0b0001,0, "vaddw", "u", int_arm_neon_vaddwu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002002// VHADD : Vector Halving Add
Johnny Chenfe0978b2010-03-26 23:49:07 +00002003defm VHADDs : N3VInt_QHS<0, 0, 0b0000, 0, N3RegFrm,
2004 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
2005 "vhadd", "s", int_arm_neon_vhadds, 1>;
2006defm VHADDu : N3VInt_QHS<1, 0, 0b0000, 0, N3RegFrm,
2007 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
2008 "vhadd", "u", int_arm_neon_vhaddu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002009// VRHADD : Vector Rounding Halving Add
Johnny Chenfe0978b2010-03-26 23:49:07 +00002010defm VRHADDs : N3VInt_QHS<0, 0, 0b0001, 0, N3RegFrm,
2011 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
2012 "vrhadd", "s", int_arm_neon_vrhadds, 1>;
2013defm VRHADDu : N3VInt_QHS<1, 0, 0b0001, 0, N3RegFrm,
2014 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
2015 "vrhadd", "u", int_arm_neon_vrhaddu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002016// VQADD : Vector Saturating Add
Johnny Chenfe0978b2010-03-26 23:49:07 +00002017defm VQADDs : N3VInt_QHSD<0, 0, 0b0000, 1, N3RegFrm,
2018 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
2019 "vqadd", "s", int_arm_neon_vqadds, 1>;
2020defm VQADDu : N3VInt_QHSD<1, 0, 0b0000, 1, N3RegFrm,
2021 IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
2022 "vqadd", "u", int_arm_neon_vqaddu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002023// VADDHN : Vector Add and Narrow Returning High Half (D = Q + Q)
Evan Cheng09c61b32009-11-23 21:57:23 +00002024defm VADDHN : N3VNInt_HSD<0,1,0b0100,0, "vaddhn", "i",
2025 int_arm_neon_vaddhn, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002026// VRADDHN : Vector Rounding Add and Narrow Returning High Half (D = Q + Q)
Evan Cheng09c61b32009-11-23 21:57:23 +00002027defm VRADDHN : N3VNInt_HSD<1,1,0b0100,0, "vraddhn", "i",
2028 int_arm_neon_vraddhn, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002029
2030// Vector Multiply Operations.
2031
2032// VMUL : Vector Multiply (integer, polynomial and floating-point)
Evan Cheng67abcec2009-11-21 06:21:52 +00002033defm VMUL : N3V_QHS<0, 0, 0b1001, 1, IIC_VMULi16D, IIC_VMULi32D,
Evan Cheng09c61b32009-11-23 21:57:23 +00002034 IIC_VMULi16Q, IIC_VMULi32Q, "vmul", "i", mul, 1>;
Johnny Chenfe0978b2010-03-26 23:49:07 +00002035def VMULpd : N3VDInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16D, "vmul",
2036 "p8", v8i8, v8i8, int_arm_neon_vmulp, 1>;
2037def VMULpq : N3VQInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16Q, "vmul",
2038 "p8", v16i8, v16i8, int_arm_neon_vmulp, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002039def VMULfd : N3VD<1, 0, 0b00, 0b1101, 1, IIC_VBIND, "vmul", "f32",
Bob Wilson1d2c4212010-02-17 00:31:29 +00002040 v2f32, v2f32, fmul, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002041def VMULfq : N3VQ<1, 0, 0b00, 0b1101, 1, IIC_VBINQ, "vmul", "f32",
Bob Wilson1d2c4212010-02-17 00:31:29 +00002042 v4f32, v4f32, fmul, 1>;
2043defm VMULsl : N3VSL_HS<0b1000, "vmul", "i", mul>;
2044def VMULslfd : N3VDSL<0b10, 0b1001, IIC_VBIND, "vmul", "f32", v2f32, fmul>;
2045def VMULslfq : N3VQSL<0b10, 0b1001, IIC_VBINQ, "vmul", "f32", v4f32,
2046 v2f32, fmul>;
2047
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002048def : Pat<(v8i16 (mul (v8i16 QPR:$src1),
2049 (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))),
2050 (v8i16 (VMULslv8i16 (v8i16 QPR:$src1),
2051 (v4i16 (EXTRACT_SUBREG QPR:$src2,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002052 (DSubReg_i16_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002053 (SubReg_i16_lane imm:$lane)))>;
2054def : Pat<(v4i32 (mul (v4i32 QPR:$src1),
2055 (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))),
2056 (v4i32 (VMULslv4i32 (v4i32 QPR:$src1),
2057 (v2i32 (EXTRACT_SUBREG QPR:$src2,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002058 (DSubReg_i32_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002059 (SubReg_i32_lane imm:$lane)))>;
2060def : Pat<(v4f32 (fmul (v4f32 QPR:$src1),
2061 (v4f32 (NEONvduplane (v4f32 QPR:$src2), imm:$lane)))),
2062 (v4f32 (VMULslfq (v4f32 QPR:$src1),
2063 (v2f32 (EXTRACT_SUBREG QPR:$src2,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002064 (DSubReg_i32_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002065 (SubReg_i32_lane imm:$lane)))>;
2066
Bob Wilsone60fee02009-06-22 23:27:02 +00002067// VQDMULH : Vector Saturating Doubling Multiply Returning High Half
Johnny Chenfe0978b2010-03-26 23:49:07 +00002068defm VQDMULH : N3VInt_HS<0, 0, 0b1011, 0, N3RegFrm, IIC_VMULi16D, IIC_VMULi32D,
David Goodwin36bff0c2009-09-25 18:38:29 +00002069 IIC_VMULi16Q, IIC_VMULi32Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002070 "vqdmulh", "s", int_arm_neon_vqdmulh, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00002071defm VQDMULHsl: N3VIntSL_HS<0b1100, IIC_VMULi16D, IIC_VMULi32D,
2072 IIC_VMULi16Q, IIC_VMULi32Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002073 "vqdmulh", "s", int_arm_neon_vqdmulh>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002074def : Pat<(v8i16 (int_arm_neon_vqdmulh (v8i16 QPR:$src1),
Evan Cheng67abcec2009-11-21 06:21:52 +00002075 (v8i16 (NEONvduplane (v8i16 QPR:$src2),
2076 imm:$lane)))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002077 (v8i16 (VQDMULHslv8i16 (v8i16 QPR:$src1),
2078 (v4i16 (EXTRACT_SUBREG QPR:$src2,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002079 (DSubReg_i16_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002080 (SubReg_i16_lane imm:$lane)))>;
2081def : Pat<(v4i32 (int_arm_neon_vqdmulh (v4i32 QPR:$src1),
Evan Cheng67abcec2009-11-21 06:21:52 +00002082 (v4i32 (NEONvduplane (v4i32 QPR:$src2),
2083 imm:$lane)))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002084 (v4i32 (VQDMULHslv4i32 (v4i32 QPR:$src1),
2085 (v2i32 (EXTRACT_SUBREG QPR:$src2,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002086 (DSubReg_i32_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002087 (SubReg_i32_lane imm:$lane)))>;
2088
Bob Wilsone60fee02009-06-22 23:27:02 +00002089// VQRDMULH : Vector Rounding Saturating Doubling Multiply Returning High Half
Johnny Chenfe0978b2010-03-26 23:49:07 +00002090defm VQRDMULH : N3VInt_HS<1, 0, 0b1011, 0, N3RegFrm,
2091 IIC_VMULi16D,IIC_VMULi32D,IIC_VMULi16Q,IIC_VMULi32Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002092 "vqrdmulh", "s", int_arm_neon_vqrdmulh, 1>;
David Goodwin36bff0c2009-09-25 18:38:29 +00002093defm VQRDMULHsl : N3VIntSL_HS<0b1101, IIC_VMULi16D, IIC_VMULi32D,
2094 IIC_VMULi16Q, IIC_VMULi32Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002095 "vqrdmulh", "s", int_arm_neon_vqrdmulh>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002096def : Pat<(v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$src1),
Evan Cheng67abcec2009-11-21 06:21:52 +00002097 (v8i16 (NEONvduplane (v8i16 QPR:$src2),
2098 imm:$lane)))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002099 (v8i16 (VQRDMULHslv8i16 (v8i16 QPR:$src1),
2100 (v4i16 (EXTRACT_SUBREG QPR:$src2,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002101 (DSubReg_i16_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002102 (SubReg_i16_lane imm:$lane)))>;
2103def : Pat<(v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$src1),
Evan Cheng67abcec2009-11-21 06:21:52 +00002104 (v4i32 (NEONvduplane (v4i32 QPR:$src2),
2105 imm:$lane)))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002106 (v4i32 (VQRDMULHslv4i32 (v4i32 QPR:$src1),
2107 (v2i32 (EXTRACT_SUBREG QPR:$src2,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002108 (DSubReg_i32_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002109 (SubReg_i32_lane imm:$lane)))>;
2110
Bob Wilsone60fee02009-06-22 23:27:02 +00002111// VMULL : Vector Multiply Long (integer and polynomial) (Q = D * D)
Anton Korobeynikov8d062472010-04-07 18:21:10 +00002112defm VMULLs : N3VLInt_QHS<0,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
2113 "vmull", "s", int_arm_neon_vmulls, 1>;
2114defm VMULLu : N3VLInt_QHS<1,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
2115 "vmull", "u", int_arm_neon_vmullu, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002116def VMULLp : N3VLInt<0, 1, 0b00, 0b1110, 0, IIC_VMULi16D, "vmull", "p8",
Evan Cheng67abcec2009-11-21 06:21:52 +00002117 v8i16, v8i8, int_arm_neon_vmullp, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002118defm VMULLsls : N3VLIntSL_HS<0, 0b1010, IIC_VMULi16D, "vmull", "s",
Evan Cheng67abcec2009-11-21 06:21:52 +00002119 int_arm_neon_vmulls>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002120defm VMULLslu : N3VLIntSL_HS<1, 0b1010, IIC_VMULi16D, "vmull", "u",
Evan Cheng67abcec2009-11-21 06:21:52 +00002121 int_arm_neon_vmullu>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002122
Bob Wilsone60fee02009-06-22 23:27:02 +00002123// VQDMULL : Vector Saturating Doubling Multiply Long (Q = D * D)
Anton Korobeynikov8d062472010-04-07 18:21:10 +00002124defm VQDMULL : N3VLInt_HS<0,1,0b1101,0, IIC_VMULi16D, IIC_VMULi32D,
2125 "vqdmull", "s", int_arm_neon_vqdmull, 1>;
2126defm VQDMULLsl: N3VLIntSL_HS<0, 0b1011, IIC_VMULi16D,
2127 "vqdmull", "s", int_arm_neon_vqdmull>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002128
2129// Vector Multiply-Accumulate and Multiply-Subtract Operations.
2130
2131// VMLA : Vector Multiply Accumulate (integer and floating-point)
David Goodwin36bff0c2009-09-25 18:38:29 +00002132defm VMLA : N3VMulOp_QHS<0, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
Evan Cheng09c61b32009-11-23 21:57:23 +00002133 IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
2134def VMLAfd : N3VDMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002135 v2f32, fmul, fadd>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002136def VMLAfq : N3VQMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACQ, "vmla", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002137 v4f32, fmul, fadd>;
David Goodwin36bff0c2009-09-25 18:38:29 +00002138defm VMLAsl : N3VMulOpSL_HS<0b0000, IIC_VMACi16D, IIC_VMACi32D,
Evan Cheng09c61b32009-11-23 21:57:23 +00002139 IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
2140def VMLAslfd : N3VDMulOpSL<0b10, 0b0001, IIC_VMACD, "vmla", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002141 v2f32, fmul, fadd>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002142def VMLAslfq : N3VQMulOpSL<0b10, 0b0001, IIC_VMACQ, "vmla", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002143 v4f32, v2f32, fmul, fadd>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002144
2145def : Pat<(v8i16 (add (v8i16 QPR:$src1),
Bob Wilson1d2c4212010-02-17 00:31:29 +00002146 (mul (v8i16 QPR:$src2),
2147 (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))),
2148 (v8i16 (VMLAslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002149 (v4i16 (EXTRACT_SUBREG QPR:$src3,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002150 (DSubReg_i16_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002151 (SubReg_i16_lane imm:$lane)))>;
2152
2153def : Pat<(v4i32 (add (v4i32 QPR:$src1),
Bob Wilson1d2c4212010-02-17 00:31:29 +00002154 (mul (v4i32 QPR:$src2),
2155 (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))),
2156 (v4i32 (VMLAslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002157 (v2i32 (EXTRACT_SUBREG QPR:$src3,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002158 (DSubReg_i32_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002159 (SubReg_i32_lane imm:$lane)))>;
2160
2161def : Pat<(v4f32 (fadd (v4f32 QPR:$src1),
Bob Wilson1d2c4212010-02-17 00:31:29 +00002162 (fmul (v4f32 QPR:$src2),
2163 (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002164 (v4f32 (VMLAslfq (v4f32 QPR:$src1),
2165 (v4f32 QPR:$src2),
2166 (v2f32 (EXTRACT_SUBREG QPR:$src3,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002167 (DSubReg_i32_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002168 (SubReg_i32_lane imm:$lane)))>;
2169
Bob Wilsone60fee02009-06-22 23:27:02 +00002170// VMLAL : Vector Multiply Accumulate Long (Q += D * D)
Anton Korobeynikov290319b2010-04-07 18:21:04 +00002171defm VMLALs : N3VLInt3_QHS<0,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
Anton Korobeynikov6928d7c2010-04-07 18:20:42 +00002172 "vmlal", "s", int_arm_neon_vmlals>;
Anton Korobeynikov290319b2010-04-07 18:21:04 +00002173defm VMLALu : N3VLInt3_QHS<1,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
Anton Korobeynikov6928d7c2010-04-07 18:20:42 +00002174 "vmlal", "u", int_arm_neon_vmlalu>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002175
Evan Cheng09c61b32009-11-23 21:57:23 +00002176defm VMLALsls : N3VLInt3SL_HS<0, 0b0010, "vmlal", "s", int_arm_neon_vmlals>;
2177defm VMLALslu : N3VLInt3SL_HS<1, 0b0010, "vmlal", "u", int_arm_neon_vmlalu>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002178
Bob Wilsone60fee02009-06-22 23:27:02 +00002179// VQDMLAL : Vector Saturating Doubling Multiply Accumulate Long (Q += D * D)
Anton Korobeynikov290319b2010-04-07 18:21:04 +00002180defm VQDMLAL : N3VLInt3_HS<0, 1, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
Anton Korobeynikov6928d7c2010-04-07 18:20:42 +00002181 "vqdmlal", "s", int_arm_neon_vqdmlal>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002182defm VQDMLALsl: N3VLInt3SL_HS<0, 0b0011, "vqdmlal", "s", int_arm_neon_vqdmlal>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002183
Bob Wilsone60fee02009-06-22 23:27:02 +00002184// VMLS : Vector Multiply Subtract (integer and floating-point)
Bob Wilson64c60912009-10-03 04:41:21 +00002185defm VMLS : N3VMulOp_QHS<1, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
Evan Cheng09c61b32009-11-23 21:57:23 +00002186 IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
2187def VMLSfd : N3VDMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002188 v2f32, fmul, fsub>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002189def VMLSfq : N3VQMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACQ, "vmls", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002190 v4f32, fmul, fsub>;
David Goodwin36bff0c2009-09-25 18:38:29 +00002191defm VMLSsl : N3VMulOpSL_HS<0b0100, IIC_VMACi16D, IIC_VMACi32D,
Evan Cheng09c61b32009-11-23 21:57:23 +00002192 IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
2193def VMLSslfd : N3VDMulOpSL<0b10, 0b0101, IIC_VMACD, "vmls", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002194 v2f32, fmul, fsub>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002195def VMLSslfq : N3VQMulOpSL<0b10, 0b0101, IIC_VMACQ, "vmls", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002196 v4f32, v2f32, fmul, fsub>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002197
2198def : Pat<(v8i16 (sub (v8i16 QPR:$src1),
Bob Wilson1d2c4212010-02-17 00:31:29 +00002199 (mul (v8i16 QPR:$src2),
2200 (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))),
2201 (v8i16 (VMLSslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002202 (v4i16 (EXTRACT_SUBREG QPR:$src3,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002203 (DSubReg_i16_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002204 (SubReg_i16_lane imm:$lane)))>;
2205
2206def : Pat<(v4i32 (sub (v4i32 QPR:$src1),
Bob Wilson1d2c4212010-02-17 00:31:29 +00002207 (mul (v4i32 QPR:$src2),
2208 (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))),
2209 (v4i32 (VMLSslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002210 (v2i32 (EXTRACT_SUBREG QPR:$src3,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002211 (DSubReg_i32_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002212 (SubReg_i32_lane imm:$lane)))>;
2213
2214def : Pat<(v4f32 (fsub (v4f32 QPR:$src1),
Bob Wilson1d2c4212010-02-17 00:31:29 +00002215 (fmul (v4f32 QPR:$src2),
2216 (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))),
2217 (v4f32 (VMLSslfq (v4f32 QPR:$src1), (v4f32 QPR:$src2),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002218 (v2f32 (EXTRACT_SUBREG QPR:$src3,
Bob Wilson1d2c4212010-02-17 00:31:29 +00002219 (DSubReg_i32_reg imm:$lane))),
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002220 (SubReg_i32_lane imm:$lane)))>;
2221
Bob Wilsone60fee02009-06-22 23:27:02 +00002222// VMLSL : Vector Multiply Subtract Long (Q -= D * D)
Anton Korobeynikov290319b2010-04-07 18:21:04 +00002223defm VMLSLs : N3VLInt3_QHS<0,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
Anton Korobeynikov6928d7c2010-04-07 18:20:42 +00002224 "vmlsl", "s", int_arm_neon_vmlsls>;
Anton Korobeynikov290319b2010-04-07 18:21:04 +00002225defm VMLSLu : N3VLInt3_QHS<1,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
Anton Korobeynikov6928d7c2010-04-07 18:20:42 +00002226 "vmlsl", "u", int_arm_neon_vmlslu>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002227
Evan Cheng09c61b32009-11-23 21:57:23 +00002228defm VMLSLsls : N3VLInt3SL_HS<0, 0b0110, "vmlsl", "s", int_arm_neon_vmlsls>;
2229defm VMLSLslu : N3VLInt3SL_HS<1, 0b0110, "vmlsl", "u", int_arm_neon_vmlslu>;
Anton Korobeynikovdd528192009-09-08 15:22:32 +00002230
Bob Wilsone60fee02009-06-22 23:27:02 +00002231// VQDMLSL : Vector Saturating Doubling Multiply Subtract Long (Q -= D * D)
Anton Korobeynikov290319b2010-04-07 18:21:04 +00002232defm VQDMLSL : N3VLInt3_HS<0, 1, 0b1011, 0, IIC_VMACi16D, IIC_VMACi32D,
Anton Korobeynikov6928d7c2010-04-07 18:20:42 +00002233 "vqdmlsl", "s", int_arm_neon_vqdmlsl>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002234defm VQDMLSLsl: N3VLInt3SL_HS<0, 0b111, "vqdmlsl", "s", int_arm_neon_vqdmlsl>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002235
2236// Vector Subtract Operations.
2237
2238// VSUB : Vector Subtract (integer and floating-point)
Evan Cheng67abcec2009-11-21 06:21:52 +00002239defm VSUB : N3V_QHSD<1, 0, 0b1000, 0, IIC_VSUBiD, IIC_VSUBiQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00002240 "vsub", "i", sub, 0>;
2241def VSUBfd : N3VD<0, 0, 0b10, 0b1101, 0, IIC_VBIND, "vsub", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002242 v2f32, v2f32, fsub, 0>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002243def VSUBfq : N3VQ<0, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vsub", "f32",
Evan Cheng67abcec2009-11-21 06:21:52 +00002244 v4f32, v4f32, fsub, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002245// VSUBL : Vector Subtract Long (Q = D - D)
Anton Korobeynikov8d062472010-04-07 18:21:10 +00002246defm VSUBLs : N3VLInt_QHS<0,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
2247 "vsubl", "s", int_arm_neon_vsubls, 1>;
2248defm VSUBLu : N3VLInt_QHS<1,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
2249 "vsubl", "u", int_arm_neon_vsublu, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002250// VSUBW : Vector Subtract Wide (Q = Q - D)
Evan Cheng09c61b32009-11-23 21:57:23 +00002251defm VSUBWs : N3VWInt_QHS<0,1,0b0011,0, "vsubw", "s", int_arm_neon_vsubws, 0>;
2252defm VSUBWu : N3VWInt_QHS<1,1,0b0011,0, "vsubw", "u", int_arm_neon_vsubwu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002253// VHSUB : Vector Halving Subtract
Johnny Chenfe0978b2010-03-26 23:49:07 +00002254defm VHSUBs : N3VInt_QHS<0, 0, 0b0010, 0, N3RegFrm,
Anton Korobeynikov10775c12010-04-07 18:20:13 +00002255 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002256 "vhsub", "s", int_arm_neon_vhsubs, 0>;
Johnny Chenfe0978b2010-03-26 23:49:07 +00002257defm VHSUBu : N3VInt_QHS<1, 0, 0b0010, 0, N3RegFrm,
Anton Korobeynikov10775c12010-04-07 18:20:13 +00002258 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002259 "vhsub", "u", int_arm_neon_vhsubu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002260// VQSUB : Vector Saturing Subtract
Johnny Chenfe0978b2010-03-26 23:49:07 +00002261defm VQSUBs : N3VInt_QHSD<0, 0, 0b0010, 1, N3RegFrm,
Anton Korobeynikov10775c12010-04-07 18:20:13 +00002262 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002263 "vqsub", "s", int_arm_neon_vqsubs, 0>;
Johnny Chenfe0978b2010-03-26 23:49:07 +00002264defm VQSUBu : N3VInt_QHSD<1, 0, 0b0010, 1, N3RegFrm,
Anton Korobeynikov10775c12010-04-07 18:20:13 +00002265 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002266 "vqsub", "u", int_arm_neon_vqsubu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002267// VSUBHN : Vector Subtract and Narrow Returning High Half (D = Q - Q)
Evan Cheng09c61b32009-11-23 21:57:23 +00002268defm VSUBHN : N3VNInt_HSD<0,1,0b0110,0, "vsubhn", "i",
2269 int_arm_neon_vsubhn, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002270// VRSUBHN : Vector Rounding Subtract and Narrow Returning High Half (D=Q-Q)
Evan Cheng09c61b32009-11-23 21:57:23 +00002271defm VRSUBHN : N3VNInt_HSD<1,1,0b0110,0, "vrsubhn", "i",
2272 int_arm_neon_vrsubhn, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002273
2274// Vector Comparisons.
2275
2276// VCEQ : Vector Compare Equal
Anton Korobeynikov10775c12010-04-07 18:20:13 +00002277defm VCEQ : N3V_QHS<1, 0, 0b1000, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
2278 IIC_VSUBi4Q, "vceq", "i", NEONvceq, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002279def VCEQfd : N3VD<0,0,0b00,0b1110,0, IIC_VBIND, "vceq", "f32", v2i32, v2f32,
Evan Cheng67abcec2009-11-21 06:21:52 +00002280 NEONvceq, 1>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002281def VCEQfq : N3VQ<0,0,0b00,0b1110,0, IIC_VBINQ, "vceq", "f32", v4i32, v4f32,
Evan Cheng67abcec2009-11-21 06:21:52 +00002282 NEONvceq, 1>;
Johnny Chenfc9ef992010-02-23 00:33:12 +00002283// For disassembly only.
Johnny Chenc2b70b52010-02-23 01:42:58 +00002284defm VCEQz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00010, 0, "vceq", "i",
2285 "$dst, $src, #0">;
Johnny Chenfc9ef992010-02-23 00:33:12 +00002286
Bob Wilsone60fee02009-06-22 23:27:02 +00002287// VCGE : Vector Compare Greater Than or Equal
Anton Korobeynikov10775c12010-04-07 18:20:13 +00002288defm VCGEs : N3V_QHS<0, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
2289 IIC_VSUBi4Q, "vcge", "s", NEONvcge, 0>;
2290defm VCGEu : N3V_QHS<1, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
2291 IIC_VSUBi4Q, "vcge", "u", NEONvcgeu, 0>;
Johnny Chen3cc826c2010-03-24 21:25:07 +00002292def VCGEfd : N3VD<1,0,0b00,0b1110,0, IIC_VBIND, "vcge", "f32", v2i32, v2f32,
2293 NEONvcge, 0>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002294def VCGEfq : N3VQ<1,0,0b00,0b1110,0, IIC_VBINQ, "vcge", "f32", v4i32, v4f32,
Evan Cheng67abcec2009-11-21 06:21:52 +00002295 NEONvcge, 0>;
Johnny Chenc2b70b52010-02-23 01:42:58 +00002296// For disassembly only.
2297defm VCGEz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00001, 0, "vcge", "s",
2298 "$dst, $src, #0">;
2299// For disassembly only.
2300defm VCLEz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00011, 0, "vcle", "s",
2301 "$dst, $src, #0">;
2302
Bob Wilsone60fee02009-06-22 23:27:02 +00002303// VCGT : Vector Compare Greater Than
Anton Korobeynikov10775c12010-04-07 18:20:13 +00002304defm VCGTs : N3V_QHS<0, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
2305 IIC_VSUBi4Q, "vcgt", "s", NEONvcgt, 0>;
2306defm VCGTu : N3V_QHS<1, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
2307 IIC_VSUBi4Q, "vcgt", "u", NEONvcgtu, 0>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002308def VCGTfd : N3VD<1,0,0b10,0b1110,0, IIC_VBIND, "vcgt", "f32", v2i32, v2f32,
Evan Cheng67abcec2009-11-21 06:21:52 +00002309 NEONvcgt, 0>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002310def VCGTfq : N3VQ<1,0,0b10,0b1110,0, IIC_VBINQ, "vcgt", "f32", v4i32, v4f32,
Evan Cheng67abcec2009-11-21 06:21:52 +00002311 NEONvcgt, 0>;
Johnny Chenc2b70b52010-02-23 01:42:58 +00002312// For disassembly only.
2313defm VCGTz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00000, 0, "vcgt", "s",
2314 "$dst, $src, #0">;
2315// For disassembly only.
2316defm VCLTz : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00100, 0, "vclt", "s",
2317 "$dst, $src, #0">;
2318
Bob Wilsone60fee02009-06-22 23:27:02 +00002319// VACGE : Vector Absolute Compare Greater Than or Equal (aka VCAGE)
Johnny Chenfe0978b2010-03-26 23:49:07 +00002320def VACGEd : N3VDInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacge",
2321 "f32", v2i32, v2f32, int_arm_neon_vacged, 0>;
2322def VACGEq : N3VQInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacge",
2323 "f32", v4i32, v4f32, int_arm_neon_vacgeq, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002324// VACGT : Vector Absolute Compare Greater Than (aka VCAGT)
Johnny Chenfe0978b2010-03-26 23:49:07 +00002325def VACGTd : N3VDInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacgt",
2326 "f32", v2i32, v2f32, int_arm_neon_vacgtd, 0>;
2327def VACGTq : N3VQInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacgt",
2328 "f32", v4i32, v4f32, int_arm_neon_vacgtq, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002329// VTST : Vector Test Bits
David Goodwin78caa122009-09-23 21:38:08 +00002330defm VTST : N3V_QHS<0, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
Bob Wilsona21a9cc2010-01-17 06:35:17 +00002331 IIC_VBINi4Q, "vtst", "", NEONvtst, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002332
2333// Vector Bitwise Operations.
2334
Chris Lattner71c5b642010-03-28 08:08:07 +00002335def vnot8 : PatFrag<(ops node:$in),
2336 (xor node:$in, (bitconvert (v8i8 immAllOnesV)))>;
2337def vnot16 : PatFrag<(ops node:$in),
2338 (xor node:$in, (bitconvert (v16i8 immAllOnesV)))>;
2339
2340
Bob Wilsone60fee02009-06-22 23:27:02 +00002341// VAND : Vector Bitwise AND
Evan Cheng09c61b32009-11-23 21:57:23 +00002342def VANDd : N3VDX<0, 0, 0b00, 0b0001, 1, IIC_VBINiD, "vand",
2343 v2i32, v2i32, and, 1>;
2344def VANDq : N3VQX<0, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "vand",
2345 v4i32, v4i32, and, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002346
2347// VEOR : Vector Bitwise Exclusive OR
Evan Cheng09c61b32009-11-23 21:57:23 +00002348def VEORd : N3VDX<1, 0, 0b00, 0b0001, 1, IIC_VBINiD, "veor",
2349 v2i32, v2i32, xor, 1>;
2350def VEORq : N3VQX<1, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "veor",
2351 v4i32, v4i32, xor, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002352
2353// VORR : Vector Bitwise OR
Evan Cheng09c61b32009-11-23 21:57:23 +00002354def VORRd : N3VDX<0, 0, 0b10, 0b0001, 1, IIC_VBINiD, "vorr",
2355 v2i32, v2i32, or, 1>;
2356def VORRq : N3VQX<0, 0, 0b10, 0b0001, 1, IIC_VBINiQ, "vorr",
2357 v4i32, v4i32, or, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002358
2359// VBIC : Vector Bitwise Bit Clear (AND NOT)
Evan Cheng09c61b32009-11-23 21:57:23 +00002360def VBICd : N3VX<0, 0, 0b01, 0b0001, 0, 1, (outs DPR:$dst),
Bob Wilsonacfc7e42010-03-27 04:01:23 +00002361 (ins DPR:$src1, DPR:$src2), N3RegFrm, IIC_VBINiD,
2362 "vbic", "$dst, $src1, $src2", "",
2363 [(set DPR:$dst, (v2i32 (and DPR:$src1,
Chris Lattner71c5b642010-03-28 08:08:07 +00002364 (vnot8 DPR:$src2))))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002365def VBICq : N3VX<0, 0, 0b01, 0b0001, 1, 1, (outs QPR:$dst),
Bob Wilsonacfc7e42010-03-27 04:01:23 +00002366 (ins QPR:$src1, QPR:$src2), N3RegFrm, IIC_VBINiQ,
2367 "vbic", "$dst, $src1, $src2", "",
2368 [(set QPR:$dst, (v4i32 (and QPR:$src1,
Chris Lattner71c5b642010-03-28 08:08:07 +00002369 (vnot16 QPR:$src2))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002370
2371// VORN : Vector Bitwise OR NOT
Evan Cheng09c61b32009-11-23 21:57:23 +00002372def VORNd : N3VX<0, 0, 0b11, 0b0001, 0, 1, (outs DPR:$dst),
Bob Wilsonacfc7e42010-03-27 04:01:23 +00002373 (ins DPR:$src1, DPR:$src2), N3RegFrm, IIC_VBINiD,
2374 "vorn", "$dst, $src1, $src2", "",
2375 [(set DPR:$dst, (v2i32 (or DPR:$src1,
Chris Lattner71c5b642010-03-28 08:08:07 +00002376 (vnot8 DPR:$src2))))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002377def VORNq : N3VX<0, 0, 0b11, 0b0001, 1, 1, (outs QPR:$dst),
Bob Wilsonacfc7e42010-03-27 04:01:23 +00002378 (ins QPR:$src1, QPR:$src2), N3RegFrm, IIC_VBINiQ,
2379 "vorn", "$dst, $src1, $src2", "",
2380 [(set QPR:$dst, (v4i32 (or QPR:$src1,
Chris Lattner71c5b642010-03-28 08:08:07 +00002381 (vnot16 QPR:$src2))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002382
2383// VMVN : Vector Bitwise NOT
Evan Cheng09c61b32009-11-23 21:57:23 +00002384def VMVNd : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 0, 0,
Anton Korobeynikoved60a4c2010-04-07 18:20:36 +00002385 (outs DPR:$dst), (ins DPR:$src), IIC_VSUBiD,
Bob Wilsonacfc7e42010-03-27 04:01:23 +00002386 "vmvn", "$dst, $src", "",
Chris Lattner71c5b642010-03-28 08:08:07 +00002387 [(set DPR:$dst, (v2i32 (vnot8 DPR:$src)))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002388def VMVNq : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 1, 0,
Anton Korobeynikoved60a4c2010-04-07 18:20:36 +00002389 (outs QPR:$dst), (ins QPR:$src), IIC_VSUBiD,
Bob Wilsonacfc7e42010-03-27 04:01:23 +00002390 "vmvn", "$dst, $src", "",
Chris Lattner71c5b642010-03-28 08:08:07 +00002391 [(set QPR:$dst, (v4i32 (vnot16 QPR:$src)))]>;
2392def : Pat<(v2i32 (vnot8 DPR:$src)), (VMVNd DPR:$src)>;
2393def : Pat<(v4i32 (vnot16 QPR:$src)), (VMVNq QPR:$src)>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002394
2395// VBSL : Vector Bitwise Select
Evan Cheng09c61b32009-11-23 21:57:23 +00002396def VBSLd : N3VX<1, 0, 0b01, 0b0001, 0, 1, (outs DPR:$dst),
Bob Wilsonacfc7e42010-03-27 04:01:23 +00002397 (ins DPR:$src1, DPR:$src2, DPR:$src3),
2398 N3RegFrm, IIC_VCNTiD,
2399 "vbsl", "$dst, $src2, $src3", "$src1 = $dst",
2400 [(set DPR:$dst,
2401 (v2i32 (or (and DPR:$src2, DPR:$src1),
Chris Lattner71c5b642010-03-28 08:08:07 +00002402 (and DPR:$src3, (vnot8 DPR:$src1)))))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002403def VBSLq : N3VX<1, 0, 0b01, 0b0001, 1, 1, (outs QPR:$dst),
Bob Wilsonacfc7e42010-03-27 04:01:23 +00002404 (ins QPR:$src1, QPR:$src2, QPR:$src3),
2405 N3RegFrm, IIC_VCNTiQ,
2406 "vbsl", "$dst, $src2, $src3", "$src1 = $dst",
2407 [(set QPR:$dst,
2408 (v4i32 (or (and QPR:$src2, QPR:$src1),
Chris Lattner71c5b642010-03-28 08:08:07 +00002409 (and QPR:$src3, (vnot16 QPR:$src1)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002410
2411// VBIF : Vector Bitwise Insert if False
Evan Cheng09c61b32009-11-23 21:57:23 +00002412// like VBSL but with: "vbif $dst, $src3, $src1", "$src2 = $dst",
Johnny Chen7c313be2010-02-09 23:05:23 +00002413def VBIFd : N3VX<1, 0, 0b11, 0b0001, 0, 1,
2414 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3),
Bob Wilson724df1c2010-03-27 03:56:52 +00002415 N3RegFrm, IIC_VBINiD,
2416 "vbif", "$dst, $src2, $src3", "$src1 = $dst",
Johnny Chen7c313be2010-02-09 23:05:23 +00002417 [/* For disassembly only; pattern left blank */]>;
2418def VBIFq : N3VX<1, 0, 0b11, 0b0001, 1, 1,
2419 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3),
Bob Wilson724df1c2010-03-27 03:56:52 +00002420 N3RegFrm, IIC_VBINiQ,
2421 "vbif", "$dst, $src2, $src3", "$src1 = $dst",
Johnny Chen7c313be2010-02-09 23:05:23 +00002422 [/* For disassembly only; pattern left blank */]>;
2423
Bob Wilsone60fee02009-06-22 23:27:02 +00002424// VBIT : Vector Bitwise Insert if True
Evan Cheng09c61b32009-11-23 21:57:23 +00002425// like VBSL but with: "vbit $dst, $src2, $src1", "$src3 = $dst",
Johnny Chen7c313be2010-02-09 23:05:23 +00002426def VBITd : N3VX<1, 0, 0b10, 0b0001, 0, 1,
2427 (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3),
Bob Wilson724df1c2010-03-27 03:56:52 +00002428 N3RegFrm, IIC_VBINiD,
2429 "vbit", "$dst, $src2, $src3", "$src1 = $dst",
Johnny Chen7c313be2010-02-09 23:05:23 +00002430 [/* For disassembly only; pattern left blank */]>;
2431def VBITq : N3VX<1, 0, 0b10, 0b0001, 1, 1,
2432 (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3),
Bob Wilson724df1c2010-03-27 03:56:52 +00002433 N3RegFrm, IIC_VBINiQ,
2434 "vbit", "$dst, $src2, $src3", "$src1 = $dst",
Johnny Chen7c313be2010-02-09 23:05:23 +00002435 [/* For disassembly only; pattern left blank */]>;
2436
2437// VBIT/VBIF are not yet implemented. The TwoAddress pass will not go looking
Bob Wilsone60fee02009-06-22 23:27:02 +00002438// for equivalent operations with different register constraints; it just
2439// inserts copies.
2440
2441// Vector Absolute Differences.
2442
2443// VABD : Vector Absolute Difference
Johnny Chenfe0978b2010-03-26 23:49:07 +00002444defm VABDs : N3VInt_QHS<0, 0, 0b0111, 0, N3RegFrm,
Anton Korobeynikov53ab10f2010-04-07 18:20:18 +00002445 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002446 "vabd", "s", int_arm_neon_vabds, 0>;
Johnny Chenfe0978b2010-03-26 23:49:07 +00002447defm VABDu : N3VInt_QHS<1, 0, 0b0111, 0, N3RegFrm,
Anton Korobeynikov53ab10f2010-04-07 18:20:18 +00002448 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002449 "vabd", "u", int_arm_neon_vabdu, 0>;
Johnny Chenfe0978b2010-03-26 23:49:07 +00002450def VABDfd : N3VDInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBIND,
Evan Cheng09c61b32009-11-23 21:57:23 +00002451 "vabd", "f32", v2f32, v2f32, int_arm_neon_vabds, 0>;
Johnny Chenfe0978b2010-03-26 23:49:07 +00002452def VABDfq : N3VQInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBINQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00002453 "vabd", "f32", v4f32, v4f32, int_arm_neon_vabds, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002454
2455// VABDL : Vector Absolute Difference Long (Q = | D - D |)
Anton Korobeynikov8d062472010-04-07 18:21:10 +00002456defm VABDLs : N3VLInt_QHS<0,1,0b0111,0, IIC_VSUBi4Q, IIC_VSUBi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002457 "vabdl", "s", int_arm_neon_vabdls, 0>;
Anton Korobeynikov8d062472010-04-07 18:21:10 +00002458defm VABDLu : N3VLInt_QHS<1,1,0b0111,0, IIC_VSUBi4Q, IIC_VSUBi4Q,
Evan Cheng09c61b32009-11-23 21:57:23 +00002459 "vabdl", "u", int_arm_neon_vabdlu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002460
2461// VABA : Vector Absolute Difference and Accumulate
Anton Korobeynikov6928d7c2010-04-07 18:20:42 +00002462defm VABAs : N3VInt3_QHS<0,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
2463 "vaba", "s", int_arm_neon_vabas>;
2464defm VABAu : N3VInt3_QHS<1,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
2465 "vaba", "u", int_arm_neon_vabau>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002466
2467// VABAL : Vector Absolute Difference and Accumulate Long (Q += | D - D |)
Anton Korobeynikov290319b2010-04-07 18:21:04 +00002468defm VABALs : N3VLInt3_QHS<0,1,0b0101,0, IIC_VABAD, IIC_VABAD,
Anton Korobeynikov6928d7c2010-04-07 18:20:42 +00002469 "vabal", "s", int_arm_neon_vabals>;
Anton Korobeynikov290319b2010-04-07 18:21:04 +00002470defm VABALu : N3VLInt3_QHS<1,1,0b0101,0, IIC_VABAD, IIC_VABAD,
Anton Korobeynikov6928d7c2010-04-07 18:20:42 +00002471 "vabal", "u", int_arm_neon_vabalu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002472
2473// Vector Maximum and Minimum.
2474
2475// VMAX : Vector Maximum
Johnny Chenfe0978b2010-03-26 23:49:07 +00002476defm VMAXs : N3VInt_QHS<0, 0, 0b0110, 0, N3RegFrm,
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002477 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
Johnny Chenfe0978b2010-03-26 23:49:07 +00002478 "vmax", "s", int_arm_neon_vmaxs, 1>;
2479defm VMAXu : N3VInt_QHS<1, 0, 0b0110, 0, N3RegFrm,
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002480 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
Johnny Chenfe0978b2010-03-26 23:49:07 +00002481 "vmax", "u", int_arm_neon_vmaxu, 1>;
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002482def VMAXfd : N3VDInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBIND,
2483 "vmax", "f32",
Anton Korobeynikov10775c12010-04-07 18:20:13 +00002484 v2f32, v2f32, int_arm_neon_vmaxs, 1>;
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002485def VMAXfq : N3VQInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBINQ,
2486 "vmax", "f32",
Anton Korobeynikov10775c12010-04-07 18:20:13 +00002487 v4f32, v4f32, int_arm_neon_vmaxs, 1>;
2488
2489// VMIN : Vector Minimum
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002490defm VMINs : N3VInt_QHS<0, 0, 0b0110, 1, N3RegFrm,
2491 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
2492 "vmin", "s", int_arm_neon_vmins, 1>;
2493defm VMINu : N3VInt_QHS<1, 0, 0b0110, 1, N3RegFrm,
2494 IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
2495 "vmin", "u", int_arm_neon_vminu, 1>;
2496def VMINfd : N3VDInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBIND,
2497 "vmin", "f32",
Anton Korobeynikov10775c12010-04-07 18:20:13 +00002498 v2f32, v2f32, int_arm_neon_vmins, 1>;
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002499def VMINfq : N3VQInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBINQ,
2500 "vmin", "f32",
Anton Korobeynikov10775c12010-04-07 18:20:13 +00002501 v4f32, v4f32, int_arm_neon_vmins, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002502
2503// Vector Pairwise Operations.
2504
2505// VPADD : Vector Pairwise Add
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002506def VPADDi8 : N3VDInt<0, 0, 0b00, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
2507 "vpadd", "i8",
2508 v8i8, v8i8, int_arm_neon_vpadd, 0>;
2509def VPADDi16 : N3VDInt<0, 0, 0b01, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
2510 "vpadd", "i16",
2511 v4i16, v4i16, int_arm_neon_vpadd, 0>;
2512def VPADDi32 : N3VDInt<0, 0, 0b10, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
2513 "vpadd", "i32",
2514 v2i32, v2i32, int_arm_neon_vpadd, 0>;
Anton Korobeynikovd36f9942010-04-07 18:20:29 +00002515def VPADDf : N3VDInt<1, 0, 0b00, 0b1101, 0, N3RegFrm,
2516 IIC_VBIND, "vpadd", "f32",
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002517 v2f32, v2f32, int_arm_neon_vpadd, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002518
2519// VPADDL : Vector Pairwise Add Long
Evan Cheng09c61b32009-11-23 21:57:23 +00002520defm VPADDLs : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpaddl", "s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002521 int_arm_neon_vpaddls>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002522defm VPADDLu : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpaddl", "u",
Bob Wilsone60fee02009-06-22 23:27:02 +00002523 int_arm_neon_vpaddlu>;
2524
2525// VPADAL : Vector Pairwise Add and Accumulate Long
Evan Cheng09c61b32009-11-23 21:57:23 +00002526defm VPADALs : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01100, 0, "vpadal", "s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002527 int_arm_neon_vpadals>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002528defm VPADALu : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01101, 0, "vpadal", "u",
Bob Wilsone60fee02009-06-22 23:27:02 +00002529 int_arm_neon_vpadalu>;
2530
2531// VPMAX : Vector Pairwise Maximum
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002532def VPMAXs8 : N3VDInt<0, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
Johnny Chenfe0978b2010-03-26 23:49:07 +00002533 "s8", v8i8, v8i8, int_arm_neon_vpmaxs, 0>;
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002534def VPMAXs16 : N3VDInt<0, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
Johnny Chenfe0978b2010-03-26 23:49:07 +00002535 "s16", v4i16, v4i16, int_arm_neon_vpmaxs, 0>;
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002536def VPMAXs32 : N3VDInt<0, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
Johnny Chenfe0978b2010-03-26 23:49:07 +00002537 "s32", v2i32, v2i32, int_arm_neon_vpmaxs, 0>;
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002538def VPMAXu8 : N3VDInt<1, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
Johnny Chenfe0978b2010-03-26 23:49:07 +00002539 "u8", v8i8, v8i8, int_arm_neon_vpmaxu, 0>;
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002540def VPMAXu16 : N3VDInt<1, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
Johnny Chenfe0978b2010-03-26 23:49:07 +00002541 "u16", v4i16, v4i16, int_arm_neon_vpmaxu, 0>;
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002542def VPMAXu32 : N3VDInt<1, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
Johnny Chenfe0978b2010-03-26 23:49:07 +00002543 "u32", v2i32, v2i32, int_arm_neon_vpmaxu, 0>;
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002544def VPMAXf : N3VDInt<1, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
Johnny Chenfe0978b2010-03-26 23:49:07 +00002545 "f32", v2f32, v2f32, int_arm_neon_vpmaxs, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002546
2547// VPMIN : Vector Pairwise Minimum
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002548def VPMINs8 : N3VDInt<0, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
Johnny Chenfe0978b2010-03-26 23:49:07 +00002549 "s8", v8i8, v8i8, int_arm_neon_vpmins, 0>;
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002550def VPMINs16 : N3VDInt<0, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
Johnny Chenfe0978b2010-03-26 23:49:07 +00002551 "s16", v4i16, v4i16, int_arm_neon_vpmins, 0>;
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002552def VPMINs32 : N3VDInt<0, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
Johnny Chenfe0978b2010-03-26 23:49:07 +00002553 "s32", v2i32, v2i32, int_arm_neon_vpmins, 0>;
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002554def VPMINu8 : N3VDInt<1, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
Johnny Chenfe0978b2010-03-26 23:49:07 +00002555 "u8", v8i8, v8i8, int_arm_neon_vpminu, 0>;
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002556def VPMINu16 : N3VDInt<1, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
Johnny Chenfe0978b2010-03-26 23:49:07 +00002557 "u16", v4i16, v4i16, int_arm_neon_vpminu, 0>;
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002558def VPMINu32 : N3VDInt<1, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
Johnny Chenfe0978b2010-03-26 23:49:07 +00002559 "u32", v2i32, v2i32, int_arm_neon_vpminu, 0>;
Anton Korobeynikov4f2ada92010-04-07 18:20:24 +00002560def VPMINf : N3VDInt<1, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VSUBi4D, "vpmin",
Johnny Chenfe0978b2010-03-26 23:49:07 +00002561 "f32", v2f32, v2f32, int_arm_neon_vpmins, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002562
2563// Vector Reciprocal and Reciprocal Square Root Estimate and Step.
2564
2565// VRECPE : Vector Reciprocal Estimate
David Goodwin78caa122009-09-23 21:38:08 +00002566def VRECPEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002567 IIC_VUNAD, "vrecpe", "u32",
Bob Wilsone60fee02009-06-22 23:27:02 +00002568 v2i32, v2i32, int_arm_neon_vrecpe>;
David Goodwin78caa122009-09-23 21:38:08 +00002569def VRECPEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002570 IIC_VUNAQ, "vrecpe", "u32",
Bob Wilsone60fee02009-06-22 23:27:02 +00002571 v4i32, v4i32, int_arm_neon_vrecpe>;
David Goodwin78caa122009-09-23 21:38:08 +00002572def VRECPEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002573 IIC_VUNAD, "vrecpe", "f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00002574 v2f32, v2f32, int_arm_neon_vrecpe>;
David Goodwin78caa122009-09-23 21:38:08 +00002575def VRECPEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002576 IIC_VUNAQ, "vrecpe", "f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00002577 v4f32, v4f32, int_arm_neon_vrecpe>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002578
2579// VRECPS : Vector Reciprocal Step
Johnny Chenfe0978b2010-03-26 23:49:07 +00002580def VRECPSfd : N3VDInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002581 IIC_VRECSD, "vrecps", "f32",
2582 v2f32, v2f32, int_arm_neon_vrecps, 1>;
Johnny Chenfe0978b2010-03-26 23:49:07 +00002583def VRECPSfq : N3VQInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002584 IIC_VRECSQ, "vrecps", "f32",
2585 v4f32, v4f32, int_arm_neon_vrecps, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002586
2587// VRSQRTE : Vector Reciprocal Square Root Estimate
David Goodwin78caa122009-09-23 21:38:08 +00002588def VRSQRTEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002589 IIC_VUNAD, "vrsqrte", "u32",
David Goodwin78caa122009-09-23 21:38:08 +00002590 v2i32, v2i32, int_arm_neon_vrsqrte>;
2591def VRSQRTEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002592 IIC_VUNAQ, "vrsqrte", "u32",
David Goodwin78caa122009-09-23 21:38:08 +00002593 v4i32, v4i32, int_arm_neon_vrsqrte>;
2594def VRSQRTEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002595 IIC_VUNAD, "vrsqrte", "f32",
David Goodwin78caa122009-09-23 21:38:08 +00002596 v2f32, v2f32, int_arm_neon_vrsqrte>;
2597def VRSQRTEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002598 IIC_VUNAQ, "vrsqrte", "f32",
David Goodwin78caa122009-09-23 21:38:08 +00002599 v4f32, v4f32, int_arm_neon_vrsqrte>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002600
2601// VRSQRTS : Vector Reciprocal Square Root Step
Johnny Chenfe0978b2010-03-26 23:49:07 +00002602def VRSQRTSfd : N3VDInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002603 IIC_VRECSD, "vrsqrts", "f32",
2604 v2f32, v2f32, int_arm_neon_vrsqrts, 1>;
Johnny Chenfe0978b2010-03-26 23:49:07 +00002605def VRSQRTSfq : N3VQInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002606 IIC_VRECSQ, "vrsqrts", "f32",
2607 v4f32, v4f32, int_arm_neon_vrsqrts, 1>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002608
2609// Vector Shifts.
2610
2611// VSHL : Vector Shift
Johnny Chenfe0978b2010-03-26 23:49:07 +00002612defm VSHLs : N3VInt_QHSD<0, 0, 0b0100, 0, N3RegVShFrm,
2613 IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
2614 "vshl", "s", int_arm_neon_vshifts, 0>;
2615defm VSHLu : N3VInt_QHSD<1, 0, 0b0100, 0, N3RegVShFrm,
2616 IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
2617 "vshl", "u", int_arm_neon_vshiftu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002618// VSHL : Vector Shift Left (Immediate)
Johnny Chen81f9b982010-03-26 01:07:59 +00002619defm VSHLi : N2VSh_QHSD<0, 1, 0b0101, 1, IIC_VSHLiD, "vshl", "i", NEONvshl,
2620 N2RegVShLFrm>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002621// VSHR : Vector Shift Right (Immediate)
Johnny Chen81f9b982010-03-26 01:07:59 +00002622defm VSHRs : N2VSh_QHSD<0, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "s", NEONvshrs,
2623 N2RegVShRFrm>;
2624defm VSHRu : N2VSh_QHSD<1, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "u", NEONvshru,
2625 N2RegVShRFrm>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002626
2627// VSHLL : Vector Shift Left Long
Evan Cheng09c61b32009-11-23 21:57:23 +00002628defm VSHLLs : N2VLSh_QHS<0, 1, 0b1010, 0, 0, 1, "vshll", "s", NEONvshlls>;
2629defm VSHLLu : N2VLSh_QHS<1, 1, 0b1010, 0, 0, 1, "vshll", "u", NEONvshllu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002630
2631// VSHLL : Vector Shift Left Long (with maximum shift count)
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002632class N2VLShMax<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
Evan Cheng09c61b32009-11-23 21:57:23 +00002633 bit op6, bit op4, string OpcodeStr, string Dt, ValueType ResTy,
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002634 ValueType OpTy, SDNode OpNode>
Evan Cheng09c61b32009-11-23 21:57:23 +00002635 : N2VLSh<op24, op23, op11_8, op7, op6, op4, OpcodeStr, Dt,
2636 ResTy, OpTy, OpNode> {
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002637 let Inst{21-16} = op21_16;
2638}
Evan Cheng09c61b32009-11-23 21:57:23 +00002639def VSHLLi8 : N2VLShMax<1, 1, 0b110010, 0b0011, 0, 0, 0, "vshll", "i8",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002640 v8i16, v8i8, NEONvshlli>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002641def VSHLLi16 : N2VLShMax<1, 1, 0b110110, 0b0011, 0, 0, 0, "vshll", "i16",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002642 v4i32, v4i16, NEONvshlli>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002643def VSHLLi32 : N2VLShMax<1, 1, 0b111010, 0b0011, 0, 0, 0, "vshll", "i32",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002644 v2i64, v2i32, NEONvshlli>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002645
2646// VSHRN : Vector Shift Right and Narrow
Bob Wilson1d2c4212010-02-17 00:31:29 +00002647defm VSHRN : N2VNSh_HSD<0,1,0b1000,0,0,1, IIC_VSHLiD, "vshrn", "i",
2648 NEONvshrn>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002649
2650// VRSHL : Vector Rounding Shift
Johnny Chenfe0978b2010-03-26 23:49:07 +00002651defm VRSHLs : N3VInt_QHSD<0, 0, 0b0101, 0, N3RegVShFrm,
2652 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
2653 "vrshl", "s", int_arm_neon_vrshifts, 0>;
2654defm VRSHLu : N3VInt_QHSD<1, 0, 0b0101, 0, N3RegVShFrm,
2655 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
2656 "vrshl", "u", int_arm_neon_vrshiftu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002657// VRSHR : Vector Rounding Shift Right
Johnny Chen81f9b982010-03-26 01:07:59 +00002658defm VRSHRs : N2VSh_QHSD<0,1,0b0010,1, IIC_VSHLi4D, "vrshr", "s", NEONvrshrs,
2659 N2RegVShRFrm>;
2660defm VRSHRu : N2VSh_QHSD<1,1,0b0010,1, IIC_VSHLi4D, "vrshr", "u", NEONvrshru,
2661 N2RegVShRFrm>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002662
2663// VRSHRN : Vector Rounding Shift Right and Narrow
Evan Cheng09c61b32009-11-23 21:57:23 +00002664defm VRSHRN : N2VNSh_HSD<0, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vrshrn", "i",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002665 NEONvrshrn>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002666
2667// VQSHL : Vector Saturating Shift
Johnny Chenfe0978b2010-03-26 23:49:07 +00002668defm VQSHLs : N3VInt_QHSD<0, 0, 0b0100, 1, N3RegVShFrm,
2669 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
2670 "vqshl", "s", int_arm_neon_vqshifts, 0>;
2671defm VQSHLu : N3VInt_QHSD<1, 0, 0b0100, 1, N3RegVShFrm,
2672 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
2673 "vqshl", "u", int_arm_neon_vqshiftu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002674// VQSHL : Vector Saturating Shift Left (Immediate)
Johnny Chen81f9b982010-03-26 01:07:59 +00002675defm VQSHLsi : N2VSh_QHSD<0,1,0b0111,1, IIC_VSHLi4D, "vqshl", "s",NEONvqshls,
2676 N2RegVShLFrm>;
2677defm VQSHLui : N2VSh_QHSD<1,1,0b0111,1, IIC_VSHLi4D, "vqshl", "u",NEONvqshlu,
2678 N2RegVShLFrm>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002679// VQSHLU : Vector Saturating Shift Left (Immediate, Unsigned)
Johnny Chen81f9b982010-03-26 01:07:59 +00002680defm VQSHLsu : N2VSh_QHSD<1,1,0b0110,1, IIC_VSHLi4D,"vqshlu","s",NEONvqshlsu,
2681 N2RegVShLFrm>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002682
2683// VQSHRN : Vector Saturating Shift Right and Narrow
Evan Cheng09c61b32009-11-23 21:57:23 +00002684defm VQSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "s",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002685 NEONvqshrns>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002686defm VQSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "u",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002687 NEONvqshrnu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002688
2689// VQSHRUN : Vector Saturating Shift Right and Narrow (Unsigned)
Evan Cheng09c61b32009-11-23 21:57:23 +00002690defm VQSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 0, 1, IIC_VSHLi4D, "vqshrun", "s",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002691 NEONvqshrnsu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002692
2693// VQRSHL : Vector Saturating Rounding Shift
Johnny Chenfe0978b2010-03-26 23:49:07 +00002694defm VQRSHLs : N3VInt_QHSD<0, 0, 0b0101, 1, N3RegVShFrm,
2695 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
2696 "vqrshl", "s", int_arm_neon_vqrshifts, 0>;
2697defm VQRSHLu : N3VInt_QHSD<1, 0, 0b0101, 1, N3RegVShFrm,
2698 IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
2699 "vqrshl", "u", int_arm_neon_vqrshiftu, 0>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002700
2701// VQRSHRN : Vector Saturating Rounding Shift Right and Narrow
Evan Cheng09c61b32009-11-23 21:57:23 +00002702defm VQRSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "s",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002703 NEONvqrshrns>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002704defm VQRSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "u",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002705 NEONvqrshrnu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002706
2707// VQRSHRUN : Vector Saturating Rounding Shift Right and Narrow (Unsigned)
Evan Cheng09c61b32009-11-23 21:57:23 +00002708defm VQRSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vqrshrun", "s",
Bob Wilson52e0d9d2009-10-21 02:15:46 +00002709 NEONvqrshrnsu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002710
2711// VSRA : Vector Shift Right and Accumulate
Evan Cheng09c61b32009-11-23 21:57:23 +00002712defm VSRAs : N2VShAdd_QHSD<0, 1, 0b0001, 1, "vsra", "s", NEONvshrs>;
2713defm VSRAu : N2VShAdd_QHSD<1, 1, 0b0001, 1, "vsra", "u", NEONvshru>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002714// VRSRA : Vector Rounding Shift Right and Accumulate
Evan Cheng09c61b32009-11-23 21:57:23 +00002715defm VRSRAs : N2VShAdd_QHSD<0, 1, 0b0011, 1, "vrsra", "s", NEONvrshrs>;
2716defm VRSRAu : N2VShAdd_QHSD<1, 1, 0b0011, 1, "vrsra", "u", NEONvrshru>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002717
2718// VSLI : Vector Shift Left and Insert
Johnny Chen81f9b982010-03-26 01:07:59 +00002719defm VSLI : N2VShIns_QHSD<1, 1, 0b0101, 1, "vsli", NEONvsli, N2RegVShLFrm>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002720// VSRI : Vector Shift Right and Insert
Johnny Chen81f9b982010-03-26 01:07:59 +00002721defm VSRI : N2VShIns_QHSD<1, 1, 0b0100, 1, "vsri", NEONvsri, N2RegVShRFrm>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002722
2723// Vector Absolute and Saturating Absolute.
2724
2725// VABS : Vector Absolute Value
David Goodwin78caa122009-09-23 21:38:08 +00002726defm VABS : N2VInt_QHS<0b11, 0b11, 0b01, 0b00110, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002727 IIC_VUNAiD, IIC_VUNAiQ, "vabs", "s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002728 int_arm_neon_vabs>;
David Goodwin78caa122009-09-23 21:38:08 +00002729def VABSfd : N2VDInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002730 IIC_VUNAD, "vabs", "f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00002731 v2f32, v2f32, int_arm_neon_vabs>;
David Goodwin78caa122009-09-23 21:38:08 +00002732def VABSfq : N2VQInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002733 IIC_VUNAQ, "vabs", "f32",
Bob Wilson8f10b3f2009-08-11 05:39:44 +00002734 v4f32, v4f32, int_arm_neon_vabs>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002735
2736// VQABS : Vector Saturating Absolute Value
David Goodwin78caa122009-09-23 21:38:08 +00002737defm VQABS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01110, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002738 IIC_VQUNAiD, IIC_VQUNAiQ, "vqabs", "s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002739 int_arm_neon_vqabs>;
2740
2741// Vector Negate.
2742
Chris Lattner0e28e4b2010-03-28 08:39:10 +00002743def vneg : PatFrag<(ops node:$in), (sub immAllZerosV, node:$in)>;
2744def vneg8 : PatFrag<(ops node:$in),
2745 (sub (bitconvert (v8i8 immAllZerosV)), node:$in)>;
2746def vneg16 : PatFrag<(ops node:$in),
2747 (sub (bitconvert (v16i8 immAllZerosV)), node:$in)>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002748
Evan Cheng09c61b32009-11-23 21:57:23 +00002749class VNEGD<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
Bob Wilsone60fee02009-06-22 23:27:02 +00002750 : N2V<0b11, 0b11, size, 0b01, 0b00111, 0, 0, (outs DPR:$dst), (ins DPR:$src),
Evan Cheng09c61b32009-11-23 21:57:23 +00002751 IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src", "",
Chris Lattner0e28e4b2010-03-28 08:39:10 +00002752 [(set DPR:$dst, (Ty (vneg8 DPR:$src)))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002753class VNEGQ<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
Bob Wilsone60fee02009-06-22 23:27:02 +00002754 : N2V<0b11, 0b11, size, 0b01, 0b00111, 1, 0, (outs QPR:$dst), (ins QPR:$src),
Evan Cheng09c61b32009-11-23 21:57:23 +00002755 IIC_VSHLiD, OpcodeStr, Dt, "$dst, $src", "",
Chris Lattner0e28e4b2010-03-28 08:39:10 +00002756 [(set QPR:$dst, (Ty (vneg16 QPR:$src)))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002757
Chris Lattner0e28e4b2010-03-28 08:39:10 +00002758// VNEG : Vector Negate (integer)
Evan Cheng09c61b32009-11-23 21:57:23 +00002759def VNEGs8d : VNEGD<0b00, "vneg", "s8", v8i8>;
2760def VNEGs16d : VNEGD<0b01, "vneg", "s16", v4i16>;
2761def VNEGs32d : VNEGD<0b10, "vneg", "s32", v2i32>;
2762def VNEGs8q : VNEGQ<0b00, "vneg", "s8", v16i8>;
2763def VNEGs16q : VNEGQ<0b01, "vneg", "s16", v8i16>;
2764def VNEGs32q : VNEGQ<0b10, "vneg", "s32", v4i32>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002765
2766// VNEG : Vector Negate (floating-point)
Bob Wilson154999f2010-02-17 22:23:11 +00002767def VNEGfd : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00002768 (outs DPR:$dst), (ins DPR:$src), IIC_VUNAD,
Evan Cheng09c61b32009-11-23 21:57:23 +00002769 "vneg", "f32", "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002770 [(set DPR:$dst, (v2f32 (fneg DPR:$src)))]>;
2771def VNEGf32q : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 1, 0,
David Goodwin36bff0c2009-09-25 18:38:29 +00002772 (outs QPR:$dst), (ins QPR:$src), IIC_VUNAQ,
Evan Cheng09c61b32009-11-23 21:57:23 +00002773 "vneg", "f32", "$dst, $src", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002774 [(set QPR:$dst, (v4f32 (fneg QPR:$src)))]>;
2775
Chris Lattner0e28e4b2010-03-28 08:39:10 +00002776def : Pat<(v8i8 (vneg8 DPR:$src)), (VNEGs8d DPR:$src)>;
2777def : Pat<(v4i16 (vneg8 DPR:$src)), (VNEGs16d DPR:$src)>;
2778def : Pat<(v2i32 (vneg8 DPR:$src)), (VNEGs32d DPR:$src)>;
2779def : Pat<(v16i8 (vneg16 QPR:$src)), (VNEGs8q QPR:$src)>;
2780def : Pat<(v8i16 (vneg16 QPR:$src)), (VNEGs16q QPR:$src)>;
2781def : Pat<(v4i32 (vneg16 QPR:$src)), (VNEGs32q QPR:$src)>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002782
2783// VQNEG : Vector Saturating Negate
David Goodwin78caa122009-09-23 21:38:08 +00002784defm VQNEG : N2VInt_QHS<0b11, 0b11, 0b00, 0b01111, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002785 IIC_VQUNAiD, IIC_VQUNAiQ, "vqneg", "s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002786 int_arm_neon_vqneg>;
2787
2788// Vector Bit Counting Operations.
2789
2790// VCLS : Vector Count Leading Sign Bits
David Goodwin78caa122009-09-23 21:38:08 +00002791defm VCLS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01000, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002792 IIC_VCNTiD, IIC_VCNTiQ, "vcls", "s",
Bob Wilsone60fee02009-06-22 23:27:02 +00002793 int_arm_neon_vcls>;
2794// VCLZ : Vector Count Leading Zeros
David Goodwin78caa122009-09-23 21:38:08 +00002795defm VCLZ : N2VInt_QHS<0b11, 0b11, 0b00, 0b01001, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002796 IIC_VCNTiD, IIC_VCNTiQ, "vclz", "i",
Bob Wilsone60fee02009-06-22 23:27:02 +00002797 int_arm_neon_vclz>;
2798// VCNT : Vector Count One Bits
David Goodwin78caa122009-09-23 21:38:08 +00002799def VCNTd : N2VDInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002800 IIC_VCNTiD, "vcnt", "8",
Bob Wilsone60fee02009-06-22 23:27:02 +00002801 v8i8, v8i8, int_arm_neon_vcnt>;
David Goodwin78caa122009-09-23 21:38:08 +00002802def VCNTq : N2VQInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
Evan Cheng09c61b32009-11-23 21:57:23 +00002803 IIC_VCNTiQ, "vcnt", "8",
Bob Wilsone60fee02009-06-22 23:27:02 +00002804 v16i8, v16i8, int_arm_neon_vcnt>;
2805
Johnny Chened5852c2010-02-24 20:06:07 +00002806// Vector Swap -- for disassembly only.
2807def VSWPd : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 0, 0,
2808 (outs DPR:$dst), (ins DPR:$src), NoItinerary,
2809 "vswp", "$dst, $src", "", []>;
2810def VSWPq : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 1, 0,
2811 (outs QPR:$dst), (ins QPR:$src), NoItinerary,
2812 "vswp", "$dst, $src", "", []>;
2813
Bob Wilsone60fee02009-06-22 23:27:02 +00002814// Vector Move Operations.
2815
2816// VMOV : Vector Move (Register)
2817
Evan Chengd8e697a2010-05-13 00:16:46 +00002818let neverHasSideEffects = 1 in {
Evan Cheng09c61b32009-11-23 21:57:23 +00002819def VMOVDneon: N3VX<0, 0, 0b10, 0b0001, 0, 1, (outs DPR:$dst), (ins DPR:$src),
Bob Wilson724df1c2010-03-27 03:56:52 +00002820 N3RegFrm, IIC_VMOVD, "vmov", "$dst, $src", "", []>;
Evan Cheng09c61b32009-11-23 21:57:23 +00002821def VMOVQ : N3VX<0, 0, 0b10, 0b0001, 1, 1, (outs QPR:$dst), (ins QPR:$src),
Bob Wilson724df1c2010-03-27 03:56:52 +00002822 N3RegFrm, IIC_VMOVD, "vmov", "$dst, $src", "", []>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002823
Evan Cheng79599de2010-05-14 02:13:41 +00002824// Pseudo vector move instructions for QQ and QQQQ registers. This should
Evan Chengc867f732010-05-06 06:36:08 +00002825// be expanded after register allocation is completed.
2826def VMOVQQ : PseudoInst<(outs QQPR:$dst), (ins QQPR:$src),
Anton Korobeynikov5636a6e2010-05-16 09:15:36 +00002827 NoItinerary, "${:comment} vmov\t$dst, $src", []>;
Evan Cheng79599de2010-05-14 02:13:41 +00002828
2829def VMOVQQQQ : PseudoInst<(outs QQQQPR:$dst), (ins QQQQPR:$src),
Anton Korobeynikov5636a6e2010-05-16 09:15:36 +00002830 NoItinerary, "${:comment} vmov\t$dst, $src", []>;
Evan Chengd8e697a2010-05-13 00:16:46 +00002831} // neverHasSideEffects
Evan Chengc867f732010-05-06 06:36:08 +00002832
Bob Wilsone60fee02009-06-22 23:27:02 +00002833// VMOV : Vector Move (Immediate)
2834
2835// VMOV_get_imm8 xform function: convert build_vector to VMOV.i8 imm.
2836def VMOV_get_imm8 : SDNodeXForm<build_vector, [{
2837 return ARM::getVMOVImm(N, 1, *CurDAG);
2838}]>;
2839def vmovImm8 : PatLeaf<(build_vector), [{
2840 return ARM::getVMOVImm(N, 1, *CurDAG).getNode() != 0;
2841}], VMOV_get_imm8>;
2842
2843// VMOV_get_imm16 xform function: convert build_vector to VMOV.i16 imm.
2844def VMOV_get_imm16 : SDNodeXForm<build_vector, [{
2845 return ARM::getVMOVImm(N, 2, *CurDAG);
2846}]>;
2847def vmovImm16 : PatLeaf<(build_vector), [{
2848 return ARM::getVMOVImm(N, 2, *CurDAG).getNode() != 0;
2849}], VMOV_get_imm16>;
2850
2851// VMOV_get_imm32 xform function: convert build_vector to VMOV.i32 imm.
2852def VMOV_get_imm32 : SDNodeXForm<build_vector, [{
2853 return ARM::getVMOVImm(N, 4, *CurDAG);
2854}]>;
2855def vmovImm32 : PatLeaf<(build_vector), [{
2856 return ARM::getVMOVImm(N, 4, *CurDAG).getNode() != 0;
2857}], VMOV_get_imm32>;
2858
2859// VMOV_get_imm64 xform function: convert build_vector to VMOV.i64 imm.
2860def VMOV_get_imm64 : SDNodeXForm<build_vector, [{
2861 return ARM::getVMOVImm(N, 8, *CurDAG);
2862}]>;
2863def vmovImm64 : PatLeaf<(build_vector), [{
2864 return ARM::getVMOVImm(N, 8, *CurDAG).getNode() != 0;
2865}], VMOV_get_imm64>;
2866
2867// Note: Some of the cmode bits in the following VMOV instructions need to
2868// be encoded based on the immed values.
2869
Evan Cheng84d01092010-05-17 21:54:50 +00002870let isReMaterializable = 1 in {
Bob Wilsone60fee02009-06-22 23:27:02 +00002871def VMOVv8i8 : N1ModImm<1, 0b000, 0b1110, 0, 0, 0, 1, (outs DPR:$dst),
Bob Wilson6a14a002009-11-06 23:33:28 +00002872 (ins h8imm:$SIMM), IIC_VMOVImm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002873 "vmov", "i8", "$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002874 [(set DPR:$dst, (v8i8 vmovImm8:$SIMM))]>;
2875def VMOVv16i8 : N1ModImm<1, 0b000, 0b1110, 0, 1, 0, 1, (outs QPR:$dst),
Bob Wilson6a14a002009-11-06 23:33:28 +00002876 (ins h8imm:$SIMM), IIC_VMOVImm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002877 "vmov", "i8", "$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002878 [(set QPR:$dst, (v16i8 vmovImm8:$SIMM))]>;
2879
Johnny Chencf4fad22009-12-01 00:02:02 +00002880def VMOVv4i16 : N1ModImm<1, 0b000, {1,0,?,?}, 0, 0, {?}, 1, (outs DPR:$dst),
Bob Wilson6a14a002009-11-06 23:33:28 +00002881 (ins h16imm:$SIMM), IIC_VMOVImm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002882 "vmov", "i16", "$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002883 [(set DPR:$dst, (v4i16 vmovImm16:$SIMM))]>;
Johnny Chencf4fad22009-12-01 00:02:02 +00002884def VMOVv8i16 : N1ModImm<1, 0b000, {1,0,?,?}, 0, 1, {?}, 1, (outs QPR:$dst),
Bob Wilson6a14a002009-11-06 23:33:28 +00002885 (ins h16imm:$SIMM), IIC_VMOVImm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002886 "vmov", "i16", "$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002887 [(set QPR:$dst, (v8i16 vmovImm16:$SIMM))]>;
2888
Johnny Chencf4fad22009-12-01 00:02:02 +00002889def VMOVv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, {?}, 1, (outs DPR:$dst),
Bob Wilson6a14a002009-11-06 23:33:28 +00002890 (ins h32imm:$SIMM), IIC_VMOVImm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002891 "vmov", "i32", "$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002892 [(set DPR:$dst, (v2i32 vmovImm32:$SIMM))]>;
Johnny Chencf4fad22009-12-01 00:02:02 +00002893def VMOVv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, {?}, 1, (outs QPR:$dst),
Bob Wilson6a14a002009-11-06 23:33:28 +00002894 (ins h32imm:$SIMM), IIC_VMOVImm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002895 "vmov", "i32", "$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002896 [(set QPR:$dst, (v4i32 vmovImm32:$SIMM))]>;
2897
2898def VMOVv1i64 : N1ModImm<1, 0b000, 0b1110, 0, 0, 1, 1, (outs DPR:$dst),
Bob Wilson6a14a002009-11-06 23:33:28 +00002899 (ins h64imm:$SIMM), IIC_VMOVImm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002900 "vmov", "i64", "$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002901 [(set DPR:$dst, (v1i64 vmovImm64:$SIMM))]>;
2902def VMOVv2i64 : N1ModImm<1, 0b000, 0b1110, 0, 1, 1, 1, (outs QPR:$dst),
Bob Wilson6a14a002009-11-06 23:33:28 +00002903 (ins h64imm:$SIMM), IIC_VMOVImm,
Evan Cheng09c61b32009-11-23 21:57:23 +00002904 "vmov", "i64", "$dst, $SIMM", "",
Bob Wilsone60fee02009-06-22 23:27:02 +00002905 [(set QPR:$dst, (v2i64 vmovImm64:$SIMM))]>;
Evan Cheng84d01092010-05-17 21:54:50 +00002906} // isReMaterializable
Bob Wilsone60fee02009-06-22 23:27:02 +00002907
2908// VMOV : Vector Get Lane (move scalar to ARM core register)
2909
Johnny Chen0c1d2c12009-11-23 17:48:17 +00002910def VGETLNs8 : NVGetLane<{1,1,1,0,0,1,?,1}, 0b1011, {?,?},
Bob Wilson30ff4492009-08-21 21:58:55 +00002911 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00002912 IIC_VMOVSI, "vmov", "s8", "$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002913 [(set GPR:$dst, (NEONvgetlanes (v8i8 DPR:$src),
2914 imm:$lane))]>;
Johnny Chen0c1d2c12009-11-23 17:48:17 +00002915def VGETLNs16 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, {?,1},
Bob Wilson30ff4492009-08-21 21:58:55 +00002916 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00002917 IIC_VMOVSI, "vmov", "s16", "$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002918 [(set GPR:$dst, (NEONvgetlanes (v4i16 DPR:$src),
2919 imm:$lane))]>;
Johnny Chen0c1d2c12009-11-23 17:48:17 +00002920def VGETLNu8 : NVGetLane<{1,1,1,0,1,1,?,1}, 0b1011, {?,?},
Bob Wilson30ff4492009-08-21 21:58:55 +00002921 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00002922 IIC_VMOVSI, "vmov", "u8", "$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002923 [(set GPR:$dst, (NEONvgetlaneu (v8i8 DPR:$src),
2924 imm:$lane))]>;
Johnny Chen0c1d2c12009-11-23 17:48:17 +00002925def VGETLNu16 : NVGetLane<{1,1,1,0,1,0,?,1}, 0b1011, {?,1},
Bob Wilson30ff4492009-08-21 21:58:55 +00002926 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00002927 IIC_VMOVSI, "vmov", "u16", "$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002928 [(set GPR:$dst, (NEONvgetlaneu (v4i16 DPR:$src),
2929 imm:$lane))]>;
Johnny Chen0c1d2c12009-11-23 17:48:17 +00002930def VGETLNi32 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, 0b00,
Bob Wilson30ff4492009-08-21 21:58:55 +00002931 (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00002932 IIC_VMOVSI, "vmov", "32", "$dst, $src[$lane]",
Bob Wilsone60fee02009-06-22 23:27:02 +00002933 [(set GPR:$dst, (extractelt (v2i32 DPR:$src),
2934 imm:$lane))]>;
2935// def VGETLNf32: see FMRDH and FMRDL in ARMInstrVFP.td
2936def : Pat<(NEONvgetlanes (v16i8 QPR:$src), imm:$lane),
2937 (VGETLNs8 (v8i8 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002938 (DSubReg_i8_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002939 (SubReg_i8_lane imm:$lane))>;
2940def : Pat<(NEONvgetlanes (v8i16 QPR:$src), imm:$lane),
2941 (VGETLNs16 (v4i16 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002942 (DSubReg_i16_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002943 (SubReg_i16_lane imm:$lane))>;
2944def : Pat<(NEONvgetlaneu (v16i8 QPR:$src), imm:$lane),
2945 (VGETLNu8 (v8i8 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002946 (DSubReg_i8_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002947 (SubReg_i8_lane imm:$lane))>;
2948def : Pat<(NEONvgetlaneu (v8i16 QPR:$src), imm:$lane),
2949 (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002950 (DSubReg_i16_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002951 (SubReg_i16_lane imm:$lane))>;
2952def : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
2953 (VGETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002954 (DSubReg_i32_reg imm:$lane))),
Bob Wilsone60fee02009-06-22 23:27:02 +00002955 (SubReg_i32_lane imm:$lane))>;
Anton Korobeynikov44e0a6c2009-08-28 23:41:26 +00002956def : Pat<(extractelt (v2f32 DPR:$src1), imm:$src2),
Bob Wilson1d2c4212010-02-17 00:31:29 +00002957 (EXTRACT_SUBREG (v2f32 (COPY_TO_REGCLASS (v2f32 DPR:$src1),DPR_VFP2)),
Anton Korobeynikov3600d162009-09-12 22:21:08 +00002958 (SSubReg_f32_reg imm:$src2))>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002959def : Pat<(extractelt (v4f32 QPR:$src1), imm:$src2),
Bob Wilson1d2c4212010-02-17 00:31:29 +00002960 (EXTRACT_SUBREG (v4f32 (COPY_TO_REGCLASS (v4f32 QPR:$src1),QPR_VFP2)),
Anton Korobeynikov3600d162009-09-12 22:21:08 +00002961 (SSubReg_f32_reg imm:$src2))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002962//def : Pat<(extractelt (v2i64 QPR:$src1), imm:$src2),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002963// (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002964def : Pat<(extractelt (v2f64 QPR:$src1), imm:$src2),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002965 (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002966
2967
2968// VMOV : Vector Set Lane (move ARM core register to scalar)
2969
2970let Constraints = "$src1 = $dst" in {
Johnny Chen0c1d2c12009-11-23 17:48:17 +00002971def VSETLNi8 : NVSetLane<{1,1,1,0,0,1,?,0}, 0b1011, {?,?}, (outs DPR:$dst),
Bob Wilson30ff4492009-08-21 21:58:55 +00002972 (ins DPR:$src1, GPR:$src2, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00002973 IIC_VMOVISL, "vmov", "8", "$dst[$lane], $src2",
Bob Wilsone60fee02009-06-22 23:27:02 +00002974 [(set DPR:$dst, (vector_insert (v8i8 DPR:$src1),
2975 GPR:$src2, imm:$lane))]>;
Johnny Chen0c1d2c12009-11-23 17:48:17 +00002976def VSETLNi16 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, {?,1}, (outs DPR:$dst),
Bob Wilson30ff4492009-08-21 21:58:55 +00002977 (ins DPR:$src1, GPR:$src2, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00002978 IIC_VMOVISL, "vmov", "16", "$dst[$lane], $src2",
Bob Wilsone60fee02009-06-22 23:27:02 +00002979 [(set DPR:$dst, (vector_insert (v4i16 DPR:$src1),
2980 GPR:$src2, imm:$lane))]>;
Johnny Chen0c1d2c12009-11-23 17:48:17 +00002981def VSETLNi32 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, 0b00, (outs DPR:$dst),
Bob Wilson30ff4492009-08-21 21:58:55 +00002982 (ins DPR:$src1, GPR:$src2, nohash_imm:$lane),
Evan Cheng09c61b32009-11-23 21:57:23 +00002983 IIC_VMOVISL, "vmov", "32", "$dst[$lane], $src2",
Bob Wilsone60fee02009-06-22 23:27:02 +00002984 [(set DPR:$dst, (insertelt (v2i32 DPR:$src1),
2985 GPR:$src2, imm:$lane))]>;
2986}
2987def : Pat<(vector_insert (v16i8 QPR:$src1), GPR:$src2, imm:$lane),
2988 (v16i8 (INSERT_SUBREG QPR:$src1,
Chris Lattner4e624722010-03-08 18:51:21 +00002989 (v8i8 (VSETLNi8 (v8i8 (EXTRACT_SUBREG QPR:$src1,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002990 (DSubReg_i8_reg imm:$lane))),
Chris Lattner4e624722010-03-08 18:51:21 +00002991 GPR:$src2, (SubReg_i8_lane imm:$lane))),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002992 (DSubReg_i8_reg imm:$lane)))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002993def : Pat<(vector_insert (v8i16 QPR:$src1), GPR:$src2, imm:$lane),
2994 (v8i16 (INSERT_SUBREG QPR:$src1,
Chris Lattner4e624722010-03-08 18:51:21 +00002995 (v4i16 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002996 (DSubReg_i16_reg imm:$lane))),
Chris Lattner4e624722010-03-08 18:51:21 +00002997 GPR:$src2, (SubReg_i16_lane imm:$lane))),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00002998 (DSubReg_i16_reg imm:$lane)))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00002999def : Pat<(insertelt (v4i32 QPR:$src1), GPR:$src2, imm:$lane),
3000 (v4i32 (INSERT_SUBREG QPR:$src1,
Chris Lattner4e624722010-03-08 18:51:21 +00003001 (v2i32 (VSETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src1,
Anton Korobeynikov49284e72009-08-08 14:06:07 +00003002 (DSubReg_i32_reg imm:$lane))),
Chris Lattner4e624722010-03-08 18:51:21 +00003003 GPR:$src2, (SubReg_i32_lane imm:$lane))),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00003004 (DSubReg_i32_reg imm:$lane)))>;
3005
Anton Korobeynikovd3352772009-08-30 19:06:39 +00003006def : Pat<(v2f32 (insertelt DPR:$src1, SPR:$src2, imm:$src3)),
Anton Korobeynikovd9331212009-11-02 00:11:39 +00003007 (INSERT_SUBREG (v2f32 (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2)),
3008 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
Anton Korobeynikov49284e72009-08-08 14:06:07 +00003009def : Pat<(v4f32 (insertelt QPR:$src1, SPR:$src2, imm:$src3)),
Anton Korobeynikovd9331212009-11-02 00:11:39 +00003010 (INSERT_SUBREG (v4f32 (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2)),
3011 SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00003012
3013//def : Pat<(v2i64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00003014// (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00003015def : Pat<(v2f64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
Anton Korobeynikov49284e72009-08-08 14:06:07 +00003016 (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
Bob Wilsone60fee02009-06-22 23:27:02 +00003017
Anton Korobeynikovbaee7b22009-08-27 14:38:44 +00003018def : Pat<(v2f32 (scalar_to_vector SPR:$src)),
Jakob Stoklund Olesen204c1852010-05-24 16:54:32 +00003019 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
Chris Lattnerc002b572010-03-15 00:52:43 +00003020def : Pat<(v2f64 (scalar_to_vector (f64 DPR:$src))),
Jakob Stoklund Olesen204c1852010-05-24 16:54:32 +00003021 (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
Anton Korobeynikovbaee7b22009-08-27 14:38:44 +00003022def : Pat<(v4f32 (scalar_to_vector SPR:$src)),
Jakob Stoklund Olesen204c1852010-05-24 16:54:32 +00003023 (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
Anton Korobeynikovbaee7b22009-08-27 14:38:44 +00003024
Anton Korobeynikov872393c2009-08-27 16:10:17 +00003025def : Pat<(v8i8 (scalar_to_vector GPR:$src)),
3026 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
3027def : Pat<(v4i16 (scalar_to_vector GPR:$src)),
3028 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
3029def : Pat<(v2i32 (scalar_to_vector GPR:$src)),
3030 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
3031
3032def : Pat<(v16i8 (scalar_to_vector GPR:$src)),
3033 (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)),
3034 (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
Jakob Stoklund Olesen204c1852010-05-24 16:54:32 +00003035 dsub_0)>;
Anton Korobeynikov872393c2009-08-27 16:10:17 +00003036def : Pat<(v8i16 (scalar_to_vector GPR:$src)),
3037 (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)),
3038 (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
Jakob Stoklund Olesen204c1852010-05-24 16:54:32 +00003039 dsub_0)>;
Anton Korobeynikov872393c2009-08-27 16:10:17 +00003040def : Pat<(v4i32 (scalar_to_vector GPR:$src)),
3041 (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)),
3042 (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
Jakob Stoklund Olesen204c1852010-05-24 16:54:32 +00003043 dsub_0)>;
Anton Korobeynikov872393c2009-08-27 16:10:17 +00003044
Bob Wilsone60fee02009-06-22 23:27:02 +00003045// VDUP : Vector Duplicate (from ARM core register to all elements)
3046
Evan Cheng09c61b32009-11-23 21:57:23 +00003047class VDUPD<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
Bob Wilsone60fee02009-06-22 23:27:02 +00003048 : NVDup<opcod1, 0b1011, opcod3, (outs DPR:$dst), (ins GPR:$src),
Evan Cheng09c61b32009-11-23 21:57:23 +00003049 IIC_VMOVIS, "vdup", Dt, "$dst, $src",
Bob Wilsonf4f1a272009-08-14 05:13:08 +00003050 [(set DPR:$dst, (Ty (NEONvdup (i32 GPR:$src))))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00003051class VDUPQ<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
Bob Wilsone60fee02009-06-22 23:27:02 +00003052 : NVDup<opcod1, 0b1011, opcod3, (outs QPR:$dst), (ins GPR:$src),
Evan Cheng09c61b32009-11-23 21:57:23 +00003053 IIC_VMOVIS, "vdup", Dt, "$dst, $src",
Bob Wilsonf4f1a272009-08-14 05:13:08 +00003054 [(set QPR:$dst, (Ty (NEONvdup (i32 GPR:$src))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00003055
Evan Cheng09c61b32009-11-23 21:57:23 +00003056def VDUP8d : VDUPD<0b11101100, 0b00, "8", v8i8>;
3057def VDUP16d : VDUPD<0b11101000, 0b01, "16", v4i16>;
3058def VDUP32d : VDUPD<0b11101000, 0b00, "32", v2i32>;
3059def VDUP8q : VDUPQ<0b11101110, 0b00, "8", v16i8>;
3060def VDUP16q : VDUPQ<0b11101010, 0b01, "16", v8i16>;
3061def VDUP32q : VDUPQ<0b11101010, 0b00, "32", v4i32>;
Bob Wilsone60fee02009-06-22 23:27:02 +00003062
3063def VDUPfd : NVDup<0b11101000, 0b1011, 0b00, (outs DPR:$dst), (ins GPR:$src),
Evan Cheng09c61b32009-11-23 21:57:23 +00003064 IIC_VMOVIS, "vdup", "32", "$dst, $src",
Bob Wilsonf4f1a272009-08-14 05:13:08 +00003065 [(set DPR:$dst, (v2f32 (NEONvdup
3066 (f32 (bitconvert GPR:$src)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00003067def VDUPfq : NVDup<0b11101010, 0b1011, 0b00, (outs QPR:$dst), (ins GPR:$src),
Evan Cheng09c61b32009-11-23 21:57:23 +00003068 IIC_VMOVIS, "vdup", "32", "$dst, $src",
Bob Wilsonf4f1a272009-08-14 05:13:08 +00003069 [(set QPR:$dst, (v4f32 (NEONvdup
3070 (f32 (bitconvert GPR:$src)))))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00003071
3072// VDUP : Vector Duplicate Lane (from scalar to all elements)
3073
Johnny Chen01f7ec22010-03-25 17:01:27 +00003074class VDUPLND<bits<4> op19_16, string OpcodeStr, string Dt,
3075 ValueType Ty>
3076 : NVDupLane<op19_16, 0, (outs DPR:$dst), (ins DPR:$src, nohash_imm:$lane),
3077 IIC_VMOVD, OpcodeStr, Dt, "$dst, $src[$lane]",
3078 [(set DPR:$dst, (Ty (NEONvduplane (Ty DPR:$src), imm:$lane)))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00003079
Johnny Chen01f7ec22010-03-25 17:01:27 +00003080class VDUPLNQ<bits<4> op19_16, string OpcodeStr, string Dt,
Johnny Chen9ee642f2009-11-23 21:00:43 +00003081 ValueType ResTy, ValueType OpTy>
Johnny Chen01f7ec22010-03-25 17:01:27 +00003082 : NVDupLane<op19_16, 1, (outs QPR:$dst), (ins DPR:$src, nohash_imm:$lane),
3083 IIC_VMOVD, OpcodeStr, Dt, "$dst, $src[$lane]",
3084 [(set QPR:$dst, (ResTy (NEONvduplane (OpTy DPR:$src),
3085 imm:$lane)))]>;
Bob Wilsone60fee02009-06-22 23:27:02 +00003086
Bob Wilson52e0d9d2009-10-21 02:15:46 +00003087// Inst{19-16} is partially specified depending on the element size.
3088
Johnny Chen01f7ec22010-03-25 17:01:27 +00003089def VDUPLN8d : VDUPLND<{?,?,?,1}, "vdup", "8", v8i8>;
3090def VDUPLN16d : VDUPLND<{?,?,1,0}, "vdup", "16", v4i16>;
3091def VDUPLN32d : VDUPLND<{?,1,0,0}, "vdup", "32", v2i32>;
3092def VDUPLNfd : VDUPLND<{?,1,0,0}, "vdup", "32", v2f32>;
3093def VDUPLN8q : VDUPLNQ<{?,?,?,1}, "vdup", "8", v16i8, v8i8>;
3094def VDUPLN16q : VDUPLNQ<{?,?,1,0}, "vdup", "16", v8i16, v4i16>;
3095def VDUPLN32q : VDUPLNQ<{?,1,0,0}, "vdup", "32", v4i32, v2i32>;
3096def VDUPLNfq : VDUPLNQ<{?,1,0,0}, "vdup", "32", v4f32, v2f32>;
Bob Wilsone60fee02009-06-22 23:27:02 +00003097
Bob Wilson206f6c42009-08-14 05:08:32 +00003098def : Pat<(v16i8 (NEONvduplane (v16i8 QPR:$src), imm:$lane)),
3099 (v16i8 (VDUPLN8q (v8i8 (EXTRACT_SUBREG QPR:$src,
3100 (DSubReg_i8_reg imm:$lane))),
3101 (SubReg_i8_lane imm:$lane)))>;
3102def : Pat<(v8i16 (NEONvduplane (v8i16 QPR:$src), imm:$lane)),
3103 (v8i16 (VDUPLN16q (v4i16 (EXTRACT_SUBREG QPR:$src,
3104 (DSubReg_i16_reg imm:$lane))),
3105 (SubReg_i16_lane imm:$lane)))>;
3106def : Pat<(v4i32 (NEONvduplane (v4i32 QPR:$src), imm:$lane)),
3107 (v4i32 (VDUPLN32q (v2i32 (EXTRACT_SUBREG QPR:$src,
3108 (DSubReg_i32_reg imm:$lane))),
3109 (SubReg_i32_lane imm:$lane)))>;
3110def : Pat<(v4f32 (NEONvduplane (v4f32 QPR:$src), imm:$lane)),
3111 (v4f32 (VDUPLNfq (v2f32 (EXTRACT_SUBREG QPR:$src,
3112 (DSubReg_i32_reg imm:$lane))),
3113 (SubReg_i32_lane imm:$lane)))>;
3114
Johnny Chen9ee642f2009-11-23 21:00:43 +00003115def VDUPfdf : N2V<0b11, 0b11, {?,1}, {0,0}, 0b11000, 0, 0,
3116 (outs DPR:$dst), (ins SPR:$src),
Evan Cheng09c61b32009-11-23 21:57:23 +00003117 IIC_VMOVD, "vdup", "32", "$dst, ${src:lane}", "",
Johnny Chen9ee642f2009-11-23 21:00:43 +00003118 [(set DPR:$dst, (v2f32 (NEONvdup (f32 SPR:$src))))]>;
Anton Korobeynikov9c913fb2009-08-07 22:36:50 +00003119
Johnny Chen9ee642f2009-11-23 21:00:43 +00003120def VDUPfqf : N2V<0b11, 0b11, {?,1}, {0,0}, 0b11000, 1, 0,
3121 (outs QPR:$dst), (ins SPR:$src),
Evan Cheng09c61b32009-11-23 21:57:23 +00003122 IIC_VMOVD, "vdup", "32", "$dst, ${src:lane}", "",
Johnny Chen9ee642f2009-11-23 21:00:43 +00003123 [(set QPR:$dst, (v4f32 (NEONvdup (f32 SPR:$src))))]>;
Anton Korobeynikov9c913fb2009-08-07 22:36:50 +00003124
Anton Korobeynikovb261a192009-09-02 21:21:28 +00003125def : Pat<(v2i64 (NEONvduplane (v2i64 QPR:$src), imm:$lane)),
3126 (INSERT_SUBREG QPR:$src,
Bob Wilson1d2c4212010-02-17 00:31:29 +00003127 (i64 (EXTRACT_SUBREG QPR:$src,
3128 (DSubReg_f64_reg imm:$lane))),
Anton Korobeynikovb261a192009-09-02 21:21:28 +00003129 (DSubReg_f64_other_reg imm:$lane))>;
3130def : Pat<(v2f64 (NEONvduplane (v2f64 QPR:$src), imm:$lane)),
3131 (INSERT_SUBREG QPR:$src,
Bob Wilson1d2c4212010-02-17 00:31:29 +00003132 (f64 (EXTRACT_SUBREG QPR:$src,
3133 (DSubReg_f64_reg imm:$lane))),
Anton Korobeynikovb261a192009-09-02 21:21:28 +00003134 (DSubReg_f64_other_reg imm:$lane))>;
3135
Bob Wilsone60fee02009-06-22 23:27:02 +00003136// VMOVN : Vector Narrowing Move
Evan Cheng09c61b32009-11-23 21:57:23 +00003137defm VMOVN : N2VNInt_HSD<0b11,0b11,0b10,0b00100,0,0, IIC_VMOVD,
3138 "vmovn", "i", int_arm_neon_vmovn>;
Bob Wilsone60fee02009-06-22 23:27:02 +00003139// VQMOVN : Vector Saturating Narrowing Move
Evan Cheng09c61b32009-11-23 21:57:23 +00003140defm VQMOVNs : N2VNInt_HSD<0b11,0b11,0b10,0b00101,0,0, IIC_VQUNAiD,
3141 "vqmovn", "s", int_arm_neon_vqmovns>;
3142defm VQMOVNu : N2VNInt_HSD<0b11,0b11,0b10,0b00101,1,0, IIC_VQUNAiD,
3143 "vqmovn", "u", int_arm_neon_vqmovnu>;
3144defm VQMOVNsu : N2VNInt_HSD<0b11,0b11,0b10,0b00100,1,0, IIC_VQUNAiD,
3145 "vqmovun", "s", int_arm_neon_vqmovnsu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00003146// VMOVL : Vector Lengthening Move
Evan Cheng09c61b32009-11-23 21:57:23 +00003147defm VMOVLs : N2VLInt_QHS<0b01,0b10100,0,1, "vmovl", "s",
3148 int_arm_neon_vmovls>;
3149defm VMOVLu : N2VLInt_QHS<0b11,0b10100,0,1, "vmovl", "u",
3150 int_arm_neon_vmovlu>;
Bob Wilsone60fee02009-06-22 23:27:02 +00003151
3152// Vector Conversions.
3153
Johnny Chen09a43762010-03-17 17:52:21 +00003154// VCVT : Vector Convert Between Floating-Point and Integers
Johnny Chen7c3f3862010-03-17 23:26:50 +00003155def VCVTf2sd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
3156 v2i32, v2f32, fp_to_sint>;
3157def VCVTf2ud : N2VD<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
3158 v2i32, v2f32, fp_to_uint>;
3159def VCVTs2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
3160 v2f32, v2i32, sint_to_fp>;
3161def VCVTu2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
3162 v2f32, v2i32, uint_to_fp>;
Johnny Chen09a43762010-03-17 17:52:21 +00003163
Johnny Chen7c3f3862010-03-17 23:26:50 +00003164def VCVTf2sq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
3165 v4i32, v4f32, fp_to_sint>;
3166def VCVTf2uq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
3167 v4i32, v4f32, fp_to_uint>;
3168def VCVTs2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
3169 v4f32, v4i32, sint_to_fp>;
3170def VCVTu2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
3171 v4f32, v4i32, uint_to_fp>;
Bob Wilsone60fee02009-06-22 23:27:02 +00003172
3173// VCVT : Vector Convert Between Floating-Point and Fixed-Point.
Evan Cheng09c61b32009-11-23 21:57:23 +00003174def VCVTf2xsd : N2VCvtD<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
Bob Wilsone60fee02009-06-22 23:27:02 +00003175 v2i32, v2f32, int_arm_neon_vcvtfp2fxs>;
Evan Cheng09c61b32009-11-23 21:57:23 +00003176def VCVTf2xud : N2VCvtD<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
Bob Wilsone60fee02009-06-22 23:27:02 +00003177 v2i32, v2f32, int_arm_neon_vcvtfp2fxu>;
Evan Cheng09c61b32009-11-23 21:57:23 +00003178def VCVTxs2fd : N2VCvtD<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
Bob Wilsone60fee02009-06-22 23:27:02 +00003179 v2f32, v2i32, int_arm_neon_vcvtfxs2fp>;
Evan Cheng09c61b32009-11-23 21:57:23 +00003180def VCVTxu2fd : N2VCvtD<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
Bob Wilsone60fee02009-06-22 23:27:02 +00003181 v2f32, v2i32, int_arm_neon_vcvtfxu2fp>;
3182
Evan Cheng09c61b32009-11-23 21:57:23 +00003183def VCVTf2xsq : N2VCvtQ<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
Bob Wilsone60fee02009-06-22 23:27:02 +00003184 v4i32, v4f32, int_arm_neon_vcvtfp2fxs>;
Evan Cheng09c61b32009-11-23 21:57:23 +00003185def VCVTf2xuq : N2VCvtQ<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
Bob Wilsone60fee02009-06-22 23:27:02 +00003186 v4i32, v4f32, int_arm_neon_vcvtfp2fxu>;
Evan Cheng09c61b32009-11-23 21:57:23 +00003187def VCVTxs2fq : N2VCvtQ<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
Bob Wilsone60fee02009-06-22 23:27:02 +00003188 v4f32, v4i32, int_arm_neon_vcvtfxs2fp>;
Evan Cheng09c61b32009-11-23 21:57:23 +00003189def VCVTxu2fq : N2VCvtQ<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
Bob Wilsone60fee02009-06-22 23:27:02 +00003190 v4f32, v4i32, int_arm_neon_vcvtfxu2fp>;
3191
Bob Wilson08479272009-08-12 22:31:50 +00003192// Vector Reverse.
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00003193
3194// VREV64 : Vector Reverse elements within 64-bit doublewords
3195
Evan Cheng09c61b32009-11-23 21:57:23 +00003196class VREV64D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00003197 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 0, 0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00003198 (ins DPR:$src), IIC_VMOVD,
Evan Cheng09c61b32009-11-23 21:57:23 +00003199 OpcodeStr, Dt, "$dst, $src", "",
Bob Wilson08479272009-08-12 22:31:50 +00003200 [(set DPR:$dst, (Ty (NEONvrev64 (Ty DPR:$src))))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00003201class VREV64Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00003202 : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 1, 0, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00003203 (ins QPR:$src), IIC_VMOVD,
Evan Cheng09c61b32009-11-23 21:57:23 +00003204 OpcodeStr, Dt, "$dst, $src", "",
Bob Wilson08479272009-08-12 22:31:50 +00003205 [(set QPR:$dst, (Ty (NEONvrev64 (Ty QPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00003206
Evan Cheng09c61b32009-11-23 21:57:23 +00003207def VREV64d8 : VREV64D<0b00, "vrev64", "8", v8i8>;
3208def VREV64d16 : VREV64D<0b01, "vrev64", "16", v4i16>;
3209def VREV64d32 : VREV64D<0b10, "vrev64", "32", v2i32>;
3210def VREV64df : VREV64D<0b10, "vrev64", "32", v2f32>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00003211
Evan Cheng09c61b32009-11-23 21:57:23 +00003212def VREV64q8 : VREV64Q<0b00, "vrev64", "8", v16i8>;
3213def VREV64q16 : VREV64Q<0b01, "vrev64", "16", v8i16>;
3214def VREV64q32 : VREV64Q<0b10, "vrev64", "32", v4i32>;
3215def VREV64qf : VREV64Q<0b10, "vrev64", "32", v4f32>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00003216
3217// VREV32 : Vector Reverse elements within 32-bit words
3218
Evan Cheng09c61b32009-11-23 21:57:23 +00003219class VREV32D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00003220 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 0, 0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00003221 (ins DPR:$src), IIC_VMOVD,
Evan Cheng09c61b32009-11-23 21:57:23 +00003222 OpcodeStr, Dt, "$dst, $src", "",
Bob Wilson08479272009-08-12 22:31:50 +00003223 [(set DPR:$dst, (Ty (NEONvrev32 (Ty DPR:$src))))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00003224class VREV32Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00003225 : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 1, 0, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00003226 (ins QPR:$src), IIC_VMOVD,
Evan Cheng09c61b32009-11-23 21:57:23 +00003227 OpcodeStr, Dt, "$dst, $src", "",
Bob Wilson08479272009-08-12 22:31:50 +00003228 [(set QPR:$dst, (Ty (NEONvrev32 (Ty QPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00003229
Evan Cheng09c61b32009-11-23 21:57:23 +00003230def VREV32d8 : VREV32D<0b00, "vrev32", "8", v8i8>;
3231def VREV32d16 : VREV32D<0b01, "vrev32", "16", v4i16>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00003232
Evan Cheng09c61b32009-11-23 21:57:23 +00003233def VREV32q8 : VREV32Q<0b00, "vrev32", "8", v16i8>;
3234def VREV32q16 : VREV32Q<0b01, "vrev32", "16", v8i16>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00003235
3236// VREV16 : Vector Reverse elements within 16-bit halfwords
3237
Evan Cheng09c61b32009-11-23 21:57:23 +00003238class VREV16D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00003239 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 0, 0, (outs DPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00003240 (ins DPR:$src), IIC_VMOVD,
Evan Cheng09c61b32009-11-23 21:57:23 +00003241 OpcodeStr, Dt, "$dst, $src", "",
Bob Wilson08479272009-08-12 22:31:50 +00003242 [(set DPR:$dst, (Ty (NEONvrev16 (Ty DPR:$src))))]>;
Evan Cheng09c61b32009-11-23 21:57:23 +00003243class VREV16Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00003244 : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 1, 0, (outs QPR:$dst),
David Goodwin36bff0c2009-09-25 18:38:29 +00003245 (ins QPR:$src), IIC_VMOVD,
Evan Cheng09c61b32009-11-23 21:57:23 +00003246 OpcodeStr, Dt, "$dst, $src", "",
Bob Wilson08479272009-08-12 22:31:50 +00003247 [(set QPR:$dst, (Ty (NEONvrev16 (Ty QPR:$src))))]>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00003248
Evan Cheng09c61b32009-11-23 21:57:23 +00003249def VREV16d8 : VREV16D<0b00, "vrev16", "8", v8i8>;
3250def VREV16q8 : VREV16Q<0b00, "vrev16", "8", v16i8>;
Bob Wilsonc1cd72e2009-07-26 00:39:34 +00003251
Bob Wilson3ac39132009-08-19 17:03:43 +00003252// Other Vector Shuffles.
3253
3254// VEXT : Vector Extract
3255
Evan Cheng09c61b32009-11-23 21:57:23 +00003256class VEXTd<string OpcodeStr, string Dt, ValueType Ty>
Bob Wilson724df1c2010-03-27 03:56:52 +00003257 : N3V<0,1,0b11,{?,?,?,?},0,0, (outs DPR:$dst),
3258 (ins DPR:$lhs, DPR:$rhs, i32imm:$index), NVExtFrm,
3259 IIC_VEXTD, OpcodeStr, Dt, "$dst, $lhs, $rhs, $index", "",
3260 [(set DPR:$dst, (Ty (NEONvext (Ty DPR:$lhs),
3261 (Ty DPR:$rhs), imm:$index)))]>;
Anton Korobeynikov6c28c002009-08-21 12:40:21 +00003262
Evan Cheng09c61b32009-11-23 21:57:23 +00003263class VEXTq<string OpcodeStr, string Dt, ValueType Ty>
Bob Wilson724df1c2010-03-27 03:56:52 +00003264 : N3V<0,1,0b11,{?,?,?,?},1,0, (outs QPR:$dst),
3265 (ins QPR:$lhs, QPR:$rhs, i32imm:$index), NVExtFrm,
3266 IIC_VEXTQ, OpcodeStr, Dt, "$dst, $lhs, $rhs, $index", "",
3267 [(set QPR:$dst, (Ty (NEONvext (Ty QPR:$lhs),
3268 (Ty QPR:$rhs), imm:$index)))]>;
Anton Korobeynikov6c28c002009-08-21 12:40:21 +00003269
Evan Cheng09c61b32009-11-23 21:57:23 +00003270def VEXTd8 : VEXTd<"vext", "8", v8i8>;
3271def VEXTd16 : VEXTd<"vext", "16", v4i16>;
3272def VEXTd32 : VEXTd<"vext", "32", v2i32>;
3273def VEXTdf : VEXTd<"vext", "32", v2f32>;
Anton Korobeynikov6c28c002009-08-21 12:40:21 +00003274
Evan Cheng09c61b32009-11-23 21:57:23 +00003275def VEXTq8 : VEXTq<"vext", "8", v16i8>;
3276def VEXTq16 : VEXTq<"vext", "16", v8i16>;
3277def VEXTq32 : VEXTq<"vext", "32", v4i32>;
3278def VEXTqf : VEXTq<"vext", "32", v4f32>;
Bob Wilson3ac39132009-08-19 17:03:43 +00003279
Bob Wilson3b169332009-08-08 05:53:00 +00003280// VTRN : Vector Transpose
3281
Evan Cheng09c61b32009-11-23 21:57:23 +00003282def VTRNd8 : N2VDShuffle<0b00, 0b00001, "vtrn", "8">;
3283def VTRNd16 : N2VDShuffle<0b01, 0b00001, "vtrn", "16">;
3284def VTRNd32 : N2VDShuffle<0b10, 0b00001, "vtrn", "32">;
Bob Wilson3b169332009-08-08 05:53:00 +00003285
Evan Cheng09c61b32009-11-23 21:57:23 +00003286def VTRNq8 : N2VQShuffle<0b00, 0b00001, IIC_VPERMQ, "vtrn", "8">;
3287def VTRNq16 : N2VQShuffle<0b01, 0b00001, IIC_VPERMQ, "vtrn", "16">;
3288def VTRNq32 : N2VQShuffle<0b10, 0b00001, IIC_VPERMQ, "vtrn", "32">;
Bob Wilson3b169332009-08-08 05:53:00 +00003289
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +00003290// VUZP : Vector Unzip (Deinterleave)
3291
Evan Cheng09c61b32009-11-23 21:57:23 +00003292def VUZPd8 : N2VDShuffle<0b00, 0b00010, "vuzp", "8">;
3293def VUZPd16 : N2VDShuffle<0b01, 0b00010, "vuzp", "16">;
3294def VUZPd32 : N2VDShuffle<0b10, 0b00010, "vuzp", "32">;
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +00003295
Evan Cheng09c61b32009-11-23 21:57:23 +00003296def VUZPq8 : N2VQShuffle<0b00, 0b00010, IIC_VPERMQ3, "vuzp", "8">;
3297def VUZPq16 : N2VQShuffle<0b01, 0b00010, IIC_VPERMQ3, "vuzp", "16">;
3298def VUZPq32 : N2VQShuffle<0b10, 0b00010, IIC_VPERMQ3, "vuzp", "32">;
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +00003299
3300// VZIP : Vector Zip (Interleave)
3301
Evan Cheng09c61b32009-11-23 21:57:23 +00003302def VZIPd8 : N2VDShuffle<0b00, 0b00011, "vzip", "8">;
3303def VZIPd16 : N2VDShuffle<0b01, 0b00011, "vzip", "16">;
3304def VZIPd32 : N2VDShuffle<0b10, 0b00011, "vzip", "32">;
Bob Wilsonc1eaa4d2009-08-08 06:13:25 +00003305
Evan Cheng09c61b32009-11-23 21:57:23 +00003306def VZIPq8 : N2VQShuffle<0b00, 0b00011, IIC_VPERMQ3, "vzip", "8">;
3307def VZIPq16 : N2VQShuffle<0b01, 0b00011, IIC_VPERMQ3, "vzip", "16">;
3308def VZIPq32 : N2VQShuffle<0b10, 0b00011, IIC_VPERMQ3, "vzip", "32">;
Bob Wilson3b169332009-08-08 05:53:00 +00003309
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003310// Vector Table Lookup and Table Extension.
3311
3312// VTBL : Vector Table Lookup
3313def VTBL1
3314 : N3V<1,1,0b11,0b1000,0,0, (outs DPR:$dst),
Johnny Chen24b81292010-03-29 01:14:22 +00003315 (ins DPR:$tbl1, DPR:$src), NVTBLFrm, IIC_VTB1,
Evan Cheng09c61b32009-11-23 21:57:23 +00003316 "vtbl", "8", "$dst, \\{$tbl1\\}, $src", "",
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003317 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl1 DPR:$tbl1, DPR:$src)))]>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +00003318let hasExtraSrcRegAllocReq = 1 in {
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003319def VTBL2
3320 : N3V<1,1,0b11,0b1001,0,0, (outs DPR:$dst),
Johnny Chen24b81292010-03-29 01:14:22 +00003321 (ins DPR:$tbl1, DPR:$tbl2, DPR:$src), NVTBLFrm, IIC_VTB2,
Bob Wilson82dcfa32010-01-18 01:24:43 +00003322 "vtbl", "8", "$dst, \\{$tbl1, $tbl2\\}, $src", "",
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003323 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl2
3324 DPR:$tbl1, DPR:$tbl2, DPR:$src)))]>;
3325def VTBL3
3326 : N3V<1,1,0b11,0b1010,0,0, (outs DPR:$dst),
Johnny Chen24b81292010-03-29 01:14:22 +00003327 (ins DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src), NVTBLFrm, IIC_VTB3,
Bob Wilson82dcfa32010-01-18 01:24:43 +00003328 "vtbl", "8", "$dst, \\{$tbl1, $tbl2, $tbl3\\}, $src", "",
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003329 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl3
3330 DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src)))]>;
3331def VTBL4
3332 : N3V<1,1,0b11,0b1011,0,0, (outs DPR:$dst),
Bob Wilson724df1c2010-03-27 03:56:52 +00003333 (ins DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src),
Johnny Chen24b81292010-03-29 01:14:22 +00003334 NVTBLFrm, IIC_VTB4,
Bob Wilson82dcfa32010-01-18 01:24:43 +00003335 "vtbl", "8", "$dst, \\{$tbl1, $tbl2, $tbl3, $tbl4\\}, $src", "",
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003336 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl4 DPR:$tbl1, DPR:$tbl2,
3337 DPR:$tbl3, DPR:$tbl4, DPR:$src)))]>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +00003338} // hasExtraSrcRegAllocReq = 1
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003339
3340// VTBX : Vector Table Extension
3341def VTBX1
3342 : N3V<1,1,0b11,0b1000,1,0, (outs DPR:$dst),
Johnny Chen24b81292010-03-29 01:14:22 +00003343 (ins DPR:$orig, DPR:$tbl1, DPR:$src), NVTBLFrm, IIC_VTBX1,
Evan Cheng09c61b32009-11-23 21:57:23 +00003344 "vtbx", "8", "$dst, \\{$tbl1\\}, $src", "$orig = $dst",
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003345 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx1
3346 DPR:$orig, DPR:$tbl1, DPR:$src)))]>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +00003347let hasExtraSrcRegAllocReq = 1 in {
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003348def VTBX2
3349 : N3V<1,1,0b11,0b1001,1,0, (outs DPR:$dst),
Johnny Chen24b81292010-03-29 01:14:22 +00003350 (ins DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$src), NVTBLFrm, IIC_VTBX2,
Bob Wilson82dcfa32010-01-18 01:24:43 +00003351 "vtbx", "8", "$dst, \\{$tbl1, $tbl2\\}, $src", "$orig = $dst",
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003352 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx2
3353 DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$src)))]>;
3354def VTBX3
3355 : N3V<1,1,0b11,0b1010,1,0, (outs DPR:$dst),
Bob Wilson724df1c2010-03-27 03:56:52 +00003356 (ins DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src),
Johnny Chen24b81292010-03-29 01:14:22 +00003357 NVTBLFrm, IIC_VTBX3,
Bob Wilson82dcfa32010-01-18 01:24:43 +00003358 "vtbx", "8", "$dst, \\{$tbl1, $tbl2, $tbl3\\}, $src", "$orig = $dst",
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003359 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx3 DPR:$orig, DPR:$tbl1,
3360 DPR:$tbl2, DPR:$tbl3, DPR:$src)))]>;
3361def VTBX4
3362 : N3V<1,1,0b11,0b1011,1,0, (outs DPR:$dst), (ins DPR:$orig, DPR:$tbl1,
Johnny Chen24b81292010-03-29 01:14:22 +00003363 DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src), NVTBLFrm, IIC_VTBX4,
Bob Wilson82dcfa32010-01-18 01:24:43 +00003364 "vtbx", "8", "$dst, \\{$tbl1, $tbl2, $tbl3, $tbl4\\}, $src",
3365 "$orig = $dst",
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003366 [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx4 DPR:$orig, DPR:$tbl1,
3367 DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src)))]>;
Evan Cheng7c8d5ea2009-10-01 08:22:27 +00003368} // hasExtraSrcRegAllocReq = 1
Bob Wilson5ef42ed2009-08-12 20:51:55 +00003369
Bob Wilsone60fee02009-06-22 23:27:02 +00003370//===----------------------------------------------------------------------===//
Evan Cheng46961d82009-08-07 19:30:41 +00003371// NEON instructions for single-precision FP math
3372//===----------------------------------------------------------------------===//
3373
Bob Wilson154999f2010-02-17 22:23:11 +00003374class N2VSPat<SDNode OpNode, ValueType ResTy, ValueType OpTy, NeonI Inst>
3375 : NEONFPPat<(ResTy (OpNode SPR:$a)),
Chris Lattner4e624722010-03-08 18:51:21 +00003376 (EXTRACT_SUBREG (OpTy (Inst (INSERT_SUBREG (OpTy (IMPLICIT_DEF)),
Jakob Stoklund Olesen204c1852010-05-24 16:54:32 +00003377 SPR:$a, ssub_0))),
3378 ssub_0)>;
Bob Wilson154999f2010-02-17 22:23:11 +00003379
3380class N3VSPat<SDNode OpNode, NeonI Inst>
3381 : NEONFPPat<(f32 (OpNode SPR:$a, SPR:$b)),
Chris Lattner4e624722010-03-08 18:51:21 +00003382 (EXTRACT_SUBREG (v2f32
3383 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
Jakob Stoklund Olesen204c1852010-05-24 16:54:32 +00003384 SPR:$a, ssub_0),
Chris Lattner4e624722010-03-08 18:51:21 +00003385 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
Jakob Stoklund Olesen204c1852010-05-24 16:54:32 +00003386 SPR:$b, ssub_0))),
3387 ssub_0)>;
Bob Wilson154999f2010-02-17 22:23:11 +00003388
3389class N3VSMulOpPat<SDNode MulNode, SDNode OpNode, NeonI Inst>
3390 : NEONFPPat<(f32 (OpNode SPR:$acc, (f32 (MulNode SPR:$a, SPR:$b)))),
3391 (EXTRACT_SUBREG (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
Jakob Stoklund Olesen204c1852010-05-24 16:54:32 +00003392 SPR:$acc, ssub_0),
Bob Wilson154999f2010-02-17 22:23:11 +00003393 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
Jakob Stoklund Olesen204c1852010-05-24 16:54:32 +00003394 SPR:$a, ssub_0),
Bob Wilson154999f2010-02-17 22:23:11 +00003395 (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
Jakob Stoklund Olesen204c1852010-05-24 16:54:32 +00003396 SPR:$b, ssub_0)),
3397 ssub_0)>;
Bob Wilson154999f2010-02-17 22:23:11 +00003398
Evan Cheng46961d82009-08-07 19:30:41 +00003399// These need separate instructions because they must use DPR_VFP2 register
3400// class which have SPR sub-registers.
3401
3402// Vector Add Operations used for single-precision FP
3403let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003404def VADDfd_sfp : N3VS<0,0,0b00,0b1101,0, "vadd", "f32", v2f32, v2f32, fadd, 1>;
3405def : N3VSPat<fadd, VADDfd_sfp>;
Evan Cheng46961d82009-08-07 19:30:41 +00003406
David Goodwin4b358db2009-08-10 22:17:39 +00003407// Vector Sub Operations used for single-precision FP
3408let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003409def VSUBfd_sfp : N3VS<0,0,0b10,0b1101,0, "vsub", "f32", v2f32, v2f32, fsub, 0>;
3410def : N3VSPat<fsub, VSUBfd_sfp>;
David Goodwin4b358db2009-08-10 22:17:39 +00003411
Evan Cheng46961d82009-08-07 19:30:41 +00003412// Vector Multiply Operations used for single-precision FP
3413let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003414def VMULfd_sfp : N3VS<1,0,0b00,0b1101,1, "vmul", "f32", v2f32, v2f32, fmul, 1>;
3415def : N3VSPat<fmul, VMULfd_sfp>;
Evan Cheng46961d82009-08-07 19:30:41 +00003416
3417// Vector Multiply-Accumulate/Subtract used for single-precision FP
Jim Grosbach67420bf2009-10-31 22:57:36 +00003418// vml[as].f32 can cause 4-8 cycle stalls in following ASIMD instructions, so
3419// we want to avoid them for now. e.g., alternating vmla/vadd instructions.
Evan Cheng46961d82009-08-07 19:30:41 +00003420
Jim Grosbach67420bf2009-10-31 22:57:36 +00003421//let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003422//def VMLAfd_sfp : N3VSMulOp<0,0,0b00,0b1101,1, IIC_VMACD, "vmla", "f32",
Bob Wilson724df1c2010-03-27 03:56:52 +00003423// v2f32, fmul, fadd>;
Bob Wilson154999f2010-02-17 22:23:11 +00003424//def : N3VSMulOpPat<fmul, fadd, VMLAfd_sfp>;
Jim Grosbach67420bf2009-10-31 22:57:36 +00003425
3426//let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003427//def VMLSfd_sfp : N3VSMulOp<0,0,0b10,0b1101,1, IIC_VMACD, "vmls", "f32",
Bob Wilson724df1c2010-03-27 03:56:52 +00003428// v2f32, fmul, fsub>;
Bob Wilson154999f2010-02-17 22:23:11 +00003429//def : N3VSMulOpPat<fmul, fsub, VMLSfd_sfp>;
Evan Cheng46961d82009-08-07 19:30:41 +00003430
David Goodwin4b358db2009-08-10 22:17:39 +00003431// Vector Absolute used for single-precision FP
Evan Cheng46961d82009-08-07 19:30:41 +00003432let neverHasSideEffects = 1 in
Bob Wilson7c7fe6e2010-02-17 22:42:54 +00003433def VABSfd_sfp : N2V<0b11, 0b11, 0b10, 0b01, 0b01110, 0, 0,
3434 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), IIC_VUNAD,
3435 "vabs", "f32", "$dst, $src", "", []>;
Bob Wilson154999f2010-02-17 22:23:11 +00003436def : N2VSPat<fabs, f32, v2f32, VABSfd_sfp>;
Evan Cheng46961d82009-08-07 19:30:41 +00003437
David Goodwin4b358db2009-08-10 22:17:39 +00003438// Vector Negate used for single-precision FP
Evan Cheng46961d82009-08-07 19:30:41 +00003439let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003440def VNEGfd_sfp : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
3441 (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), IIC_VUNAD,
3442 "vneg", "f32", "$dst, $src", "", []>;
3443def : N2VSPat<fneg, f32, v2f32, VNEGfd_sfp>;
Evan Cheng46961d82009-08-07 19:30:41 +00003444
Bob Wilsonbc1d2dc2010-02-18 06:05:53 +00003445// Vector Maximum used for single-precision FP
3446let neverHasSideEffects = 1 in
3447def VMAXfd_sfp : N3V<0, 0, 0b00, 0b1111, 0, 0, (outs DPR_VFP2:$dst),
Bob Wilson724df1c2010-03-27 03:56:52 +00003448 (ins DPR_VFP2:$src1, DPR_VFP2:$src2), N3RegFrm, IIC_VBIND,
Bob Wilsonbc1d2dc2010-02-18 06:05:53 +00003449 "vmax", "f32", "$dst, $src1, $src2", "", []>;
3450def : N3VSPat<NEONfmax, VMAXfd_sfp>;
3451
3452// Vector Minimum used for single-precision FP
3453let neverHasSideEffects = 1 in
3454def VMINfd_sfp : N3V<0, 0, 0b00, 0b1111, 0, 0, (outs DPR_VFP2:$dst),
Bob Wilson724df1c2010-03-27 03:56:52 +00003455 (ins DPR_VFP2:$src1, DPR_VFP2:$src2), N3RegFrm, IIC_VBIND,
Bob Wilsonbc1d2dc2010-02-18 06:05:53 +00003456 "vmin", "f32", "$dst, $src1, $src2", "", []>;
3457def : N3VSPat<NEONfmin, VMINfd_sfp>;
3458
David Goodwin4b358db2009-08-10 22:17:39 +00003459// Vector Convert between single-precision FP and integer
3460let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003461def VCVTf2sd_sfp : N2VS<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
3462 v2i32, v2f32, fp_to_sint>;
Bob Wilson899588e2010-03-19 22:51:32 +00003463def : N2VSPat<arm_ftosi, f32, v2f32, VCVTf2sd_sfp>;
David Goodwin4b358db2009-08-10 22:17:39 +00003464
3465let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003466def VCVTf2ud_sfp : N2VS<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
3467 v2i32, v2f32, fp_to_uint>;
Bob Wilson899588e2010-03-19 22:51:32 +00003468def : N2VSPat<arm_ftoui, f32, v2f32, VCVTf2ud_sfp>;
David Goodwin4b358db2009-08-10 22:17:39 +00003469
3470let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003471def VCVTs2fd_sfp : N2VS<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
3472 v2f32, v2i32, sint_to_fp>;
Bob Wilson899588e2010-03-19 22:51:32 +00003473def : N2VSPat<arm_sitof, f32, v2i32, VCVTs2fd_sfp>;
David Goodwin4b358db2009-08-10 22:17:39 +00003474
3475let neverHasSideEffects = 1 in
Bob Wilson154999f2010-02-17 22:23:11 +00003476def VCVTu2fd_sfp : N2VS<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
3477 v2f32, v2i32, uint_to_fp>;
Bob Wilson899588e2010-03-19 22:51:32 +00003478def : N2VSPat<arm_uitof, f32, v2i32, VCVTu2fd_sfp>;
David Goodwin4b358db2009-08-10 22:17:39 +00003479
Evan Cheng46961d82009-08-07 19:30:41 +00003480//===----------------------------------------------------------------------===//
Bob Wilsone60fee02009-06-22 23:27:02 +00003481// Non-Instruction Patterns
3482//===----------------------------------------------------------------------===//
3483
3484// bit_convert
3485def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (v1i64 DPR:$src)>;
3486def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (v1i64 DPR:$src)>;
3487def : Pat<(v1i64 (bitconvert (v8i8 DPR:$src))), (v1i64 DPR:$src)>;
3488def : Pat<(v1i64 (bitconvert (f64 DPR:$src))), (v1i64 DPR:$src)>;
3489def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (v1i64 DPR:$src)>;
3490def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (v2i32 DPR:$src)>;
3491def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (v2i32 DPR:$src)>;
3492def : Pat<(v2i32 (bitconvert (v8i8 DPR:$src))), (v2i32 DPR:$src)>;
3493def : Pat<(v2i32 (bitconvert (f64 DPR:$src))), (v2i32 DPR:$src)>;
3494def : Pat<(v2i32 (bitconvert (v2f32 DPR:$src))), (v2i32 DPR:$src)>;
3495def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (v4i16 DPR:$src)>;
3496def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (v4i16 DPR:$src)>;
3497def : Pat<(v4i16 (bitconvert (v8i8 DPR:$src))), (v4i16 DPR:$src)>;
3498def : Pat<(v4i16 (bitconvert (f64 DPR:$src))), (v4i16 DPR:$src)>;
3499def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (v4i16 DPR:$src)>;
3500def : Pat<(v8i8 (bitconvert (v1i64 DPR:$src))), (v8i8 DPR:$src)>;
3501def : Pat<(v8i8 (bitconvert (v2i32 DPR:$src))), (v8i8 DPR:$src)>;
3502def : Pat<(v8i8 (bitconvert (v4i16 DPR:$src))), (v8i8 DPR:$src)>;
3503def : Pat<(v8i8 (bitconvert (f64 DPR:$src))), (v8i8 DPR:$src)>;
3504def : Pat<(v8i8 (bitconvert (v2f32 DPR:$src))), (v8i8 DPR:$src)>;
3505def : Pat<(f64 (bitconvert (v1i64 DPR:$src))), (f64 DPR:$src)>;
3506def : Pat<(f64 (bitconvert (v2i32 DPR:$src))), (f64 DPR:$src)>;
3507def : Pat<(f64 (bitconvert (v4i16 DPR:$src))), (f64 DPR:$src)>;
3508def : Pat<(f64 (bitconvert (v8i8 DPR:$src))), (f64 DPR:$src)>;
3509def : Pat<(f64 (bitconvert (v2f32 DPR:$src))), (f64 DPR:$src)>;
3510def : Pat<(v2f32 (bitconvert (f64 DPR:$src))), (v2f32 DPR:$src)>;
3511def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (v2f32 DPR:$src)>;
3512def : Pat<(v2f32 (bitconvert (v2i32 DPR:$src))), (v2f32 DPR:$src)>;
3513def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (v2f32 DPR:$src)>;
3514def : Pat<(v2f32 (bitconvert (v8i8 DPR:$src))), (v2f32 DPR:$src)>;
3515
3516def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (v2i64 QPR:$src)>;
3517def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (v2i64 QPR:$src)>;
3518def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (v2i64 QPR:$src)>;
3519def : Pat<(v2i64 (bitconvert (v2f64 QPR:$src))), (v2i64 QPR:$src)>;
3520def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (v2i64 QPR:$src)>;
3521def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (v4i32 QPR:$src)>;
3522def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (v4i32 QPR:$src)>;
3523def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (v4i32 QPR:$src)>;
3524def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (v4i32 QPR:$src)>;
3525def : Pat<(v4i32 (bitconvert (v4f32 QPR:$src))), (v4i32 QPR:$src)>;
3526def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (v8i16 QPR:$src)>;
3527def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (v8i16 QPR:$src)>;
3528def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (v8i16 QPR:$src)>;
3529def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (v8i16 QPR:$src)>;
3530def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (v8i16 QPR:$src)>;
3531def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (v16i8 QPR:$src)>;
3532def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (v16i8 QPR:$src)>;
3533def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (v16i8 QPR:$src)>;
3534def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (v16i8 QPR:$src)>;
3535def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (v16i8 QPR:$src)>;
3536def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (v4f32 QPR:$src)>;
3537def : Pat<(v4f32 (bitconvert (v4i32 QPR:$src))), (v4f32 QPR:$src)>;
3538def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (v4f32 QPR:$src)>;
3539def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (v4f32 QPR:$src)>;
3540def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (v4f32 QPR:$src)>;
3541def : Pat<(v2f64 (bitconvert (v2i64 QPR:$src))), (v2f64 QPR:$src)>;
3542def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (v2f64 QPR:$src)>;
3543def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (v2f64 QPR:$src)>;
3544def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (v2f64 QPR:$src)>;
3545def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (v2f64 QPR:$src)>;