Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1 | //===- 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 | |
| 18 | def SDTARMVCMP : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisSameAs<1, 2>]>; |
| 19 | |
| 20 | def NEONvceq : SDNode<"ARMISD::VCEQ", SDTARMVCMP>; |
| 21 | def NEONvcge : SDNode<"ARMISD::VCGE", SDTARMVCMP>; |
| 22 | def NEONvcgeu : SDNode<"ARMISD::VCGEU", SDTARMVCMP>; |
| 23 | def NEONvcgt : SDNode<"ARMISD::VCGT", SDTARMVCMP>; |
| 24 | def NEONvcgtu : SDNode<"ARMISD::VCGTU", SDTARMVCMP>; |
| 25 | def 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. |
| 30 | def SDTARMVSH : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisSameAs<0, 1>, |
| 31 | SDTCisVT<2, i32>]>; |
| 32 | def SDTARMVSHX : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisInt<1>, |
| 33 | SDTCisVT<2, i32>]>; |
| 34 | def SDTARMVSHINS : SDTypeProfile<1, 3, [SDTCisInt<0>, SDTCisSameAs<0, 1>, |
| 35 | SDTCisSameAs<0, 2>, SDTCisVT<3, i32>]>; |
| 36 | |
| 37 | def NEONvshl : SDNode<"ARMISD::VSHL", SDTARMVSH>; |
| 38 | def NEONvshrs : SDNode<"ARMISD::VSHRs", SDTARMVSH>; |
| 39 | def NEONvshru : SDNode<"ARMISD::VSHRu", SDTARMVSH>; |
| 40 | def NEONvshlls : SDNode<"ARMISD::VSHLLs", SDTARMVSHX>; |
| 41 | def NEONvshllu : SDNode<"ARMISD::VSHLLu", SDTARMVSHX>; |
| 42 | def NEONvshlli : SDNode<"ARMISD::VSHLLi", SDTARMVSHX>; |
| 43 | def NEONvshrn : SDNode<"ARMISD::VSHRN", SDTARMVSHX>; |
| 44 | |
| 45 | def NEONvrshrs : SDNode<"ARMISD::VRSHRs", SDTARMVSH>; |
| 46 | def NEONvrshru : SDNode<"ARMISD::VRSHRu", SDTARMVSH>; |
| 47 | def NEONvrshrn : SDNode<"ARMISD::VRSHRN", SDTARMVSHX>; |
| 48 | |
| 49 | def NEONvqshls : SDNode<"ARMISD::VQSHLs", SDTARMVSH>; |
| 50 | def NEONvqshlu : SDNode<"ARMISD::VQSHLu", SDTARMVSH>; |
| 51 | def NEONvqshlsu : SDNode<"ARMISD::VQSHLsu", SDTARMVSH>; |
| 52 | def NEONvqshrns : SDNode<"ARMISD::VQSHRNs", SDTARMVSHX>; |
| 53 | def NEONvqshrnu : SDNode<"ARMISD::VQSHRNu", SDTARMVSHX>; |
| 54 | def NEONvqshrnsu : SDNode<"ARMISD::VQSHRNsu", SDTARMVSHX>; |
| 55 | |
| 56 | def NEONvqrshrns : SDNode<"ARMISD::VQRSHRNs", SDTARMVSHX>; |
| 57 | def NEONvqrshrnu : SDNode<"ARMISD::VQRSHRNu", SDTARMVSHX>; |
| 58 | def NEONvqrshrnsu : SDNode<"ARMISD::VQRSHRNsu", SDTARMVSHX>; |
| 59 | |
| 60 | def NEONvsli : SDNode<"ARMISD::VSLI", SDTARMVSHINS>; |
| 61 | def NEONvsri : SDNode<"ARMISD::VSRI", SDTARMVSHINS>; |
| 62 | |
| 63 | def SDTARMVGETLN : SDTypeProfile<1, 2, [SDTCisVT<0, i32>, SDTCisInt<1>, |
| 64 | SDTCisVT<2, i32>]>; |
| 65 | def NEONvgetlaneu : SDNode<"ARMISD::VGETLANEu", SDTARMVGETLN>; |
| 66 | def NEONvgetlanes : SDNode<"ARMISD::VGETLANEs", SDTARMVGETLN>; |
| 67 | |
Bob Wilson | c1d287b | 2009-08-14 05:13:08 +0000 | [diff] [blame] | 68 | def NEONvdup : SDNode<"ARMISD::VDUP", SDTypeProfile<1, 1, [SDTCisVec<0>]>>; |
| 69 | |
Bob Wilson | 0ce3710 | 2009-08-14 05:08:32 +0000 | [diff] [blame] | 70 | // VDUPLANE can produce a quad-register result from a double-register source, |
| 71 | // so the result is not constrained to match the source. |
| 72 | def NEONvduplane : SDNode<"ARMISD::VDUPLANE", |
| 73 | SDTypeProfile<1, 2, [SDTCisVec<0>, SDTCisVec<1>, |
| 74 | SDTCisVT<2, i32>]>>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 75 | |
Bob Wilson | de95c1b8 | 2009-08-19 17:03:43 +0000 | [diff] [blame] | 76 | def SDTARMVEXT : SDTypeProfile<1, 3, [SDTCisVec<0>, SDTCisSameAs<0, 1>, |
| 77 | SDTCisSameAs<0, 2>, SDTCisVT<3, i32>]>; |
| 78 | def NEONvext : SDNode<"ARMISD::VEXT", SDTARMVEXT>; |
| 79 | |
Bob Wilson | d8e1757 | 2009-08-12 22:31:50 +0000 | [diff] [blame] | 80 | def SDTARMVSHUF : SDTypeProfile<1, 1, [SDTCisVec<0>, SDTCisSameAs<0, 1>]>; |
| 81 | def NEONvrev64 : SDNode<"ARMISD::VREV64", SDTARMVSHUF>; |
| 82 | def NEONvrev32 : SDNode<"ARMISD::VREV32", SDTARMVSHUF>; |
| 83 | def NEONvrev16 : SDNode<"ARMISD::VREV16", SDTARMVSHUF>; |
| 84 | |
Anton Korobeynikov | 62e84f1 | 2009-08-21 12:40:50 +0000 | [diff] [blame] | 85 | def SDTARMVSHUF2 : SDTypeProfile<2, 2, [SDTCisVec<0>, SDTCisSameAs<0, 1>, |
| 86 | SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>]>; |
Anton Korobeynikov | 051cfd6 | 2009-08-21 12:41:42 +0000 | [diff] [blame] | 87 | def NEONzip : SDNode<"ARMISD::VZIP", SDTARMVSHUF2>; |
| 88 | def NEONuzp : SDNode<"ARMISD::VUZP", SDTARMVSHUF2>; |
| 89 | def NEONtrn : SDNode<"ARMISD::VTRN", SDTARMVSHUF2>; |
Anton Korobeynikov | 62e84f1 | 2009-08-21 12:40:50 +0000 | [diff] [blame] | 90 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 91 | //===----------------------------------------------------------------------===// |
| 92 | // NEON operand definitions |
| 93 | //===----------------------------------------------------------------------===// |
| 94 | |
| 95 | // addrmode_neonldstm := reg |
| 96 | // |
| 97 | /* TODO: Take advantage of vldm. |
| 98 | def addrmode_neonldstm : Operand<i32>, |
| 99 | ComplexPattern<i32, 2, "SelectAddrModeNeonLdStM", []> { |
| 100 | let PrintMethod = "printAddrNeonLdStMOperand"; |
| 101 | let MIOperandInfo = (ops GPR, i32imm); |
| 102 | } |
| 103 | */ |
| 104 | |
| 105 | //===----------------------------------------------------------------------===// |
| 106 | // NEON load / store instructions |
| 107 | //===----------------------------------------------------------------------===// |
| 108 | |
Bob Wilson | dbd3c0e | 2009-08-12 00:49:01 +0000 | [diff] [blame] | 109 | /* TODO: Take advantage of vldm. |
Evan Cheng | 0d92f5f | 2009-10-01 08:22:27 +0000 | [diff] [blame] | 110 | let mayLoad = 1, hasExtraDefRegAllocReq = 1 in { |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 111 | def VLDMD : NI<(outs), |
| 112 | (ins addrmode_neonldstm:$addr, reglist:$dst1, variable_ops), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 113 | IIC_fpLoadm, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 114 | "vldm${addr:submode} ${addr:base}, $dst1", |
Evan Cheng | dda0f4c | 2009-07-08 22:51:32 +0000 | [diff] [blame] | 115 | []> { |
| 116 | let Inst{27-25} = 0b110; |
| 117 | let Inst{20} = 1; |
| 118 | let Inst{11-9} = 0b101; |
| 119 | } |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 120 | |
| 121 | def VLDMS : NI<(outs), |
| 122 | (ins addrmode_neonldstm:$addr, reglist:$dst1, variable_ops), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 123 | IIC_fpLoadm, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 124 | "vldm${addr:submode} ${addr:base}, $dst1", |
Evan Cheng | dda0f4c | 2009-07-08 22:51:32 +0000 | [diff] [blame] | 125 | []> { |
| 126 | let Inst{27-25} = 0b110; |
| 127 | let Inst{20} = 1; |
| 128 | let Inst{11-9} = 0b101; |
| 129 | } |
Bob Wilson | 9f7d60f | 2009-08-12 17:04:56 +0000 | [diff] [blame] | 130 | } |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 131 | */ |
| 132 | |
| 133 | // Use vldmia to load a Q register as a D register pair. |
Anton Korobeynikov | baf3108 | 2009-08-08 13:35:48 +0000 | [diff] [blame] | 134 | def VLDRQ : NI4<(outs QPR:$dst), (ins addrmode4:$addr), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 135 | IIC_fpLoadm, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 136 | "vldmia $addr, ${dst:dregpair}", |
Anton Korobeynikov | baf3108 | 2009-08-08 13:35:48 +0000 | [diff] [blame] | 137 | [(set QPR:$dst, (v2f64 (load addrmode4:$addr)))]> { |
Evan Cheng | dda0f4c | 2009-07-08 22:51:32 +0000 | [diff] [blame] | 138 | let Inst{27-25} = 0b110; |
| 139 | let Inst{24} = 0; // P bit |
| 140 | let Inst{23} = 1; // U bit |
| 141 | let Inst{20} = 1; |
| 142 | let Inst{11-9} = 0b101; |
| 143 | } |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 144 | |
Bob Wilson | 9f7d60f | 2009-08-12 17:04:56 +0000 | [diff] [blame] | 145 | // Use vstmia to store a Q register as a D register pair. |
| 146 | def VSTRQ : NI4<(outs), (ins QPR:$src, addrmode4:$addr), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 147 | IIC_fpStorem, |
Bob Wilson | 9f7d60f | 2009-08-12 17:04:56 +0000 | [diff] [blame] | 148 | "vstmia $addr, ${src:dregpair}", |
| 149 | [(store (v2f64 QPR:$src), addrmode4:$addr)]> { |
| 150 | let Inst{27-25} = 0b110; |
| 151 | let Inst{24} = 0; // P bit |
| 152 | let Inst{23} = 1; // U bit |
| 153 | let Inst{20} = 0; |
| 154 | let Inst{11-9} = 0b101; |
| 155 | } |
| 156 | |
Bob Wilson | 205a5ca | 2009-07-08 18:11:30 +0000 | [diff] [blame] | 157 | // VLD1 : Vector Load (multiple single elements) |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 158 | class VLD1D<bits<4> op7_4, string OpcodeStr, ValueType Ty, Intrinsic IntOp> |
| 159 | : NLdSt<0,0b10,0b0111,op7_4, (outs DPR:$dst), (ins addrmode6:$addr), IIC_VLD1, |
Bob Wilson | 2a9df47 | 2009-08-25 17:46:06 +0000 | [diff] [blame] | 160 | !strconcat(OpcodeStr, "\t\\{$dst\\}, $addr"), "", |
Bob Wilson | b7d0c90 | 2009-07-29 16:39:22 +0000 | [diff] [blame] | 161 | [(set DPR:$dst, (Ty (IntOp addrmode6:$addr)))]>; |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 162 | class VLD1Q<bits<4> op7_4, string OpcodeStr, ValueType Ty, Intrinsic IntOp> |
| 163 | : NLdSt<0,0b10,0b1010,op7_4, (outs QPR:$dst), (ins addrmode6:$addr), IIC_VLD1, |
Bob Wilson | 2a9df47 | 2009-08-25 17:46:06 +0000 | [diff] [blame] | 164 | !strconcat(OpcodeStr, "\t${dst:dregpair}, $addr"), "", |
Bob Wilson | b7d0c90 | 2009-07-29 16:39:22 +0000 | [diff] [blame] | 165 | [(set QPR:$dst, (Ty (IntOp addrmode6:$addr)))]>; |
Bob Wilson | 205a5ca | 2009-07-08 18:11:30 +0000 | [diff] [blame] | 166 | |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 167 | def VLD1d8 : VLD1D<0b0000, "vld1.8", v8i8, int_arm_neon_vld1>; |
| 168 | def VLD1d16 : VLD1D<0b0100, "vld1.16", v4i16, int_arm_neon_vld1>; |
| 169 | def VLD1d32 : VLD1D<0b1000, "vld1.32", v2i32, int_arm_neon_vld1>; |
| 170 | def VLD1df : VLD1D<0b1000, "vld1.32", v2f32, int_arm_neon_vld1>; |
| 171 | def VLD1d64 : VLD1D<0b1100, "vld1.64", v1i64, int_arm_neon_vld1>; |
Bob Wilson | 205a5ca | 2009-07-08 18:11:30 +0000 | [diff] [blame] | 172 | |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 173 | def VLD1q8 : VLD1Q<0b0000, "vld1.8", v16i8, int_arm_neon_vld1>; |
| 174 | def VLD1q16 : VLD1Q<0b0100, "vld1.16", v8i16, int_arm_neon_vld1>; |
| 175 | def VLD1q32 : VLD1Q<0b1000, "vld1.32", v4i32, int_arm_neon_vld1>; |
| 176 | def VLD1qf : VLD1Q<0b1000, "vld1.32", v4f32, int_arm_neon_vld1>; |
| 177 | def VLD1q64 : VLD1Q<0b1100, "vld1.64", v2i64, int_arm_neon_vld1>; |
Bob Wilson | 205a5ca | 2009-07-08 18:11:30 +0000 | [diff] [blame] | 178 | |
Evan Cheng | 0d92f5f | 2009-10-01 08:22:27 +0000 | [diff] [blame] | 179 | let mayLoad = 1, hasExtraDefRegAllocReq = 1 in { |
Bob Wilson | 9f7d60f | 2009-08-12 17:04:56 +0000 | [diff] [blame] | 180 | |
Bob Wilson | 4a3d35a | 2009-08-05 00:49:09 +0000 | [diff] [blame] | 181 | // VLD2 : Vector Load (multiple 2-element structures) |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 182 | class VLD2D<bits<4> op7_4, string OpcodeStr> |
| 183 | : NLdSt<0,0b10,0b1000,op7_4, (outs DPR:$dst1, DPR:$dst2), |
| 184 | (ins addrmode6:$addr), IIC_VLD2, |
Bob Wilson | 2a9df47 | 2009-08-25 17:46:06 +0000 | [diff] [blame] | 185 | !strconcat(OpcodeStr, "\t\\{$dst1,$dst2\\}, $addr"), "", []>; |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 186 | class VLD2Q<bits<4> op7_4, string OpcodeStr> |
| 187 | : NLdSt<0,0b10,0b0011,op7_4, |
| 188 | (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4), |
Bob Wilson | 3bf12ab | 2009-10-06 22:01:59 +0000 | [diff] [blame] | 189 | (ins addrmode6:$addr), IIC_VLD2, |
| 190 | !strconcat(OpcodeStr, "\t\\{$dst1,$dst2,$dst3,$dst4\\}, $addr"), |
| 191 | "", []>; |
Bob Wilson | 4a3d35a | 2009-08-05 00:49:09 +0000 | [diff] [blame] | 192 | |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 193 | def VLD2d8 : VLD2D<0b0000, "vld2.8">; |
| 194 | def VLD2d16 : VLD2D<0b0100, "vld2.16">; |
| 195 | def VLD2d32 : VLD2D<0b1000, "vld2.32">; |
Bob Wilson | a428808 | 2009-10-07 22:57:01 +0000 | [diff] [blame] | 196 | def VLD2d64 : NLdSt<0,0b10,0b1010,0b1100, (outs DPR:$dst1, DPR:$dst2), |
| 197 | (ins addrmode6:$addr), IIC_VLD1, |
| 198 | "vld1.64\t\\{$dst1,$dst2\\}, $addr", "", []>; |
Bob Wilson | 4a3d35a | 2009-08-05 00:49:09 +0000 | [diff] [blame] | 199 | |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 200 | def VLD2q8 : VLD2Q<0b0000, "vld2.8">; |
| 201 | def VLD2q16 : VLD2Q<0b0100, "vld2.16">; |
| 202 | def VLD2q32 : VLD2Q<0b1000, "vld2.32">; |
Bob Wilson | 3bf12ab | 2009-10-06 22:01:59 +0000 | [diff] [blame] | 203 | |
Bob Wilson | 4a3d35a | 2009-08-05 00:49:09 +0000 | [diff] [blame] | 204 | // VLD3 : Vector Load (multiple 3-element structures) |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 205 | class VLD3D<bits<4> op7_4, string OpcodeStr> |
| 206 | : NLdSt<0,0b10,0b0100,op7_4, (outs DPR:$dst1, DPR:$dst2, DPR:$dst3), |
| 207 | (ins addrmode6:$addr), IIC_VLD3, |
Bob Wilson | 2a9df47 | 2009-08-25 17:46:06 +0000 | [diff] [blame] | 208 | !strconcat(OpcodeStr, "\t\\{$dst1,$dst2,$dst3\\}, $addr"), "", []>; |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 209 | class VLD3WB<bits<4> op7_4, string OpcodeStr> |
| 210 | : NLdSt<0,0b10,0b0101,op7_4, (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, GPR:$wb), |
Bob Wilson | ff8952e | 2009-10-07 17:24:55 +0000 | [diff] [blame] | 211 | (ins addrmode6:$addr), IIC_VLD3, |
| 212 | !strconcat(OpcodeStr, "\t\\{$dst1,$dst2,$dst3\\}, $addr"), |
| 213 | "$addr.addr = $wb", []>; |
Bob Wilson | 4a3d35a | 2009-08-05 00:49:09 +0000 | [diff] [blame] | 214 | |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 215 | def VLD3d8 : VLD3D<0b0000, "vld3.8">; |
| 216 | def VLD3d16 : VLD3D<0b0100, "vld3.16">; |
| 217 | def VLD3d32 : VLD3D<0b1000, "vld3.32">; |
Bob Wilson | c67160c | 2009-10-07 23:39:57 +0000 | [diff] [blame] | 218 | def VLD3d64 : NLdSt<0,0b10,0b0110,0b1100, |
| 219 | (outs DPR:$dst1, DPR:$dst2, DPR:$dst3), |
| 220 | (ins addrmode6:$addr), IIC_VLD1, |
| 221 | "vld1.64\t\\{$dst1,$dst2,$dst3\\}, $addr", "", []>; |
Bob Wilson | 4a3d35a | 2009-08-05 00:49:09 +0000 | [diff] [blame] | 222 | |
Bob Wilson | ff8952e | 2009-10-07 17:24:55 +0000 | [diff] [blame] | 223 | // vld3 to double-spaced even registers. |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 224 | def VLD3q8a : VLD3WB<0b0000, "vld3.8">; |
| 225 | def VLD3q16a : VLD3WB<0b0100, "vld3.16">; |
| 226 | def VLD3q32a : VLD3WB<0b1000, "vld3.32">; |
Bob Wilson | ff8952e | 2009-10-07 17:24:55 +0000 | [diff] [blame] | 227 | |
| 228 | // vld3 to double-spaced odd registers. |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 229 | def VLD3q8b : VLD3WB<0b0000, "vld3.8">; |
| 230 | def VLD3q16b : VLD3WB<0b0100, "vld3.16">; |
| 231 | def VLD3q32b : VLD3WB<0b1000, "vld3.32">; |
Bob Wilson | ff8952e | 2009-10-07 17:24:55 +0000 | [diff] [blame] | 232 | |
Bob Wilson | 4a3d35a | 2009-08-05 00:49:09 +0000 | [diff] [blame] | 233 | // VLD4 : Vector Load (multiple 4-element structures) |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 234 | class VLD4D<bits<4> op7_4, string OpcodeStr> |
| 235 | : NLdSt<0,0b10,0b0000,op7_4, |
| 236 | (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 237 | (ins addrmode6:$addr), IIC_VLD4, |
Bob Wilson | 2a9df47 | 2009-08-25 17:46:06 +0000 | [diff] [blame] | 238 | !strconcat(OpcodeStr, "\t\\{$dst1,$dst2,$dst3,$dst4\\}, $addr"), |
| 239 | "", []>; |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 240 | class VLD4WB<bits<4> op7_4, string OpcodeStr> |
| 241 | : NLdSt<0,0b10,0b0001,op7_4, |
| 242 | (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb), |
Bob Wilson | 7708c22 | 2009-10-07 18:09:32 +0000 | [diff] [blame] | 243 | (ins addrmode6:$addr), IIC_VLD4, |
| 244 | !strconcat(OpcodeStr, "\t\\{$dst1,$dst2,$dst3,$dst4\\}, $addr"), |
| 245 | "$addr.addr = $wb", []>; |
Bob Wilson | 4a3d35a | 2009-08-05 00:49:09 +0000 | [diff] [blame] | 246 | |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 247 | def VLD4d8 : VLD4D<0b0000, "vld4.8">; |
| 248 | def VLD4d16 : VLD4D<0b0100, "vld4.16">; |
| 249 | def VLD4d32 : VLD4D<0b1000, "vld4.32">; |
Bob Wilson | 0ea38bb | 2009-10-07 23:54:04 +0000 | [diff] [blame] | 250 | def VLD4d64 : NLdSt<0,0b10,0b0010,0b1100, |
| 251 | (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4), |
| 252 | (ins addrmode6:$addr), IIC_VLD1, |
| 253 | "vld1.64\t\\{$dst1,$dst2,$dst3,$dst4\\}, $addr", "", []>; |
Bob Wilson | 243fcc5 | 2009-09-01 04:26:28 +0000 | [diff] [blame] | 254 | |
Bob Wilson | 7708c22 | 2009-10-07 18:09:32 +0000 | [diff] [blame] | 255 | // vld4 to double-spaced even registers. |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 256 | def VLD4q8a : VLD4WB<0b0000, "vld4.8">; |
| 257 | def VLD4q16a : VLD4WB<0b0100, "vld4.16">; |
| 258 | def VLD4q32a : VLD4WB<0b1000, "vld4.32">; |
Bob Wilson | 7708c22 | 2009-10-07 18:09:32 +0000 | [diff] [blame] | 259 | |
| 260 | // vld4 to double-spaced odd registers. |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 261 | def VLD4q8b : VLD4WB<0b0000, "vld4.8">; |
| 262 | def VLD4q16b : VLD4WB<0b0100, "vld4.16">; |
| 263 | def VLD4q32b : VLD4WB<0b1000, "vld4.32">; |
| 264 | |
| 265 | // VLD1LN : Vector Load (single element to one lane) |
| 266 | // FIXME: Not yet implemented. |
Bob Wilson | 7708c22 | 2009-10-07 18:09:32 +0000 | [diff] [blame] | 267 | |
Bob Wilson | 243fcc5 | 2009-09-01 04:26:28 +0000 | [diff] [blame] | 268 | // VLD2LN : Vector Load (single 2-element structure to one lane) |
Bob Wilson | 30aea9d | 2009-10-08 18:56:10 +0000 | [diff] [blame] | 269 | class VLD2LN<bits<4> op11_8, string OpcodeStr> |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 270 | : NLdSt<1,0b10,op11_8,0b0000, (outs DPR:$dst1, DPR:$dst2), |
Bob Wilson | 243fcc5 | 2009-09-01 04:26:28 +0000 | [diff] [blame] | 271 | (ins addrmode6:$addr, DPR:$src1, DPR:$src2, nohash_imm:$lane), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 272 | IIC_VLD2, |
Bob Wilson | 243fcc5 | 2009-09-01 04:26:28 +0000 | [diff] [blame] | 273 | !strconcat(OpcodeStr, "\t\\{$dst1[$lane],$dst2[$lane]\\}, $addr"), |
| 274 | "$src1 = $dst1, $src2 = $dst2", []>; |
| 275 | |
Bob Wilson | 30aea9d | 2009-10-08 18:56:10 +0000 | [diff] [blame] | 276 | def VLD2LNd8 : VLD2LN<0b0001, "vld2.8">; |
| 277 | def VLD2LNd16 : VLD2LN<0b0101, "vld2.16">; |
| 278 | def VLD2LNd32 : VLD2LN<0b1001, "vld2.32">; |
| 279 | |
| 280 | // vld2 to double-spaced even registers. |
| 281 | def VLD2LNq16a: VLD2LN<0b0101, "vld2.16">; |
| 282 | def VLD2LNq32a: VLD2LN<0b1001, "vld2.32">; |
| 283 | |
| 284 | // vld2 to double-spaced odd registers. |
| 285 | def VLD2LNq16b: VLD2LN<0b0101, "vld2.16">; |
| 286 | def VLD2LNq32b: VLD2LN<0b1001, "vld2.32">; |
Bob Wilson | 243fcc5 | 2009-09-01 04:26:28 +0000 | [diff] [blame] | 287 | |
| 288 | // VLD3LN : Vector Load (single 3-element structure to one lane) |
Bob Wilson | 0bf7d99 | 2009-10-08 22:27:33 +0000 | [diff] [blame] | 289 | class VLD3LN<bits<4> op11_8, string OpcodeStr> |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 290 | : NLdSt<1,0b10,op11_8,0b0000, (outs DPR:$dst1, DPR:$dst2, DPR:$dst3), |
Bob Wilson | 243fcc5 | 2009-09-01 04:26:28 +0000 | [diff] [blame] | 291 | (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 292 | nohash_imm:$lane), IIC_VLD3, |
Bob Wilson | 243fcc5 | 2009-09-01 04:26:28 +0000 | [diff] [blame] | 293 | !strconcat(OpcodeStr, |
| 294 | "\t\\{$dst1[$lane],$dst2[$lane],$dst3[$lane]\\}, $addr"), |
| 295 | "$src1 = $dst1, $src2 = $dst2, $src3 = $dst3", []>; |
| 296 | |
Bob Wilson | 0bf7d99 | 2009-10-08 22:27:33 +0000 | [diff] [blame] | 297 | def VLD3LNd8 : VLD3LN<0b0010, "vld3.8">; |
| 298 | def VLD3LNd16 : VLD3LN<0b0110, "vld3.16">; |
| 299 | def VLD3LNd32 : VLD3LN<0b1010, "vld3.32">; |
| 300 | |
| 301 | // vld3 to double-spaced even registers. |
Bob Wilson | 62e053e | 2009-10-08 22:53:57 +0000 | [diff] [blame] | 302 | def VLD3LNq16a: VLD3LN<0b0110, "vld3.16">; |
| 303 | def VLD3LNq32a: VLD3LN<0b1010, "vld3.32">; |
Bob Wilson | 0bf7d99 | 2009-10-08 22:27:33 +0000 | [diff] [blame] | 304 | |
| 305 | // vld3 to double-spaced odd registers. |
Bob Wilson | 62e053e | 2009-10-08 22:53:57 +0000 | [diff] [blame] | 306 | def VLD3LNq16b: VLD3LN<0b0110, "vld3.16">; |
| 307 | def VLD3LNq32b: VLD3LN<0b1010, "vld3.32">; |
Bob Wilson | 243fcc5 | 2009-09-01 04:26:28 +0000 | [diff] [blame] | 308 | |
| 309 | // VLD4LN : Vector Load (single 4-element structure to one lane) |
Bob Wilson | 62e053e | 2009-10-08 22:53:57 +0000 | [diff] [blame] | 310 | class VLD4LN<bits<4> op11_8, string OpcodeStr> |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 311 | : NLdSt<1,0b10,op11_8,0b0000, |
| 312 | (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4), |
Bob Wilson | 243fcc5 | 2009-09-01 04:26:28 +0000 | [diff] [blame] | 313 | (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 314 | nohash_imm:$lane), IIC_VLD4, |
Bob Wilson | 243fcc5 | 2009-09-01 04:26:28 +0000 | [diff] [blame] | 315 | !strconcat(OpcodeStr, |
| 316 | "\t\\{$dst1[$lane],$dst2[$lane],$dst3[$lane],$dst4[$lane]\\}, $addr"), |
| 317 | "$src1 = $dst1, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4", []>; |
| 318 | |
Bob Wilson | 62e053e | 2009-10-08 22:53:57 +0000 | [diff] [blame] | 319 | def VLD4LNd8 : VLD4LN<0b0011, "vld4.8">; |
| 320 | def VLD4LNd16 : VLD4LN<0b0111, "vld4.16">; |
| 321 | def VLD4LNd32 : VLD4LN<0b1011, "vld4.32">; |
| 322 | |
| 323 | // vld4 to double-spaced even registers. |
| 324 | def VLD4LNq16a: VLD4LN<0b0111, "vld4.16">; |
| 325 | def VLD4LNq32a: VLD4LN<0b1011, "vld4.32">; |
| 326 | |
| 327 | // vld4 to double-spaced odd registers. |
| 328 | def VLD4LNq16b: VLD4LN<0b0111, "vld4.16">; |
| 329 | def VLD4LNq32b: VLD4LN<0b1011, "vld4.32">; |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 330 | |
| 331 | // VLD1DUP : Vector Load (single element to all lanes) |
| 332 | // VLD2DUP : Vector Load (single 2-element structure to all lanes) |
| 333 | // VLD3DUP : Vector Load (single 3-element structure to all lanes) |
| 334 | // VLD4DUP : Vector Load (single 4-element structure to all lanes) |
| 335 | // FIXME: Not yet implemented. |
Evan Cheng | 0d92f5f | 2009-10-01 08:22:27 +0000 | [diff] [blame] | 336 | } // mayLoad = 1, hasExtraDefRegAllocReq = 1 |
Bob Wilson | dbd3c0e | 2009-08-12 00:49:01 +0000 | [diff] [blame] | 337 | |
Bob Wilson | b36ec86 | 2009-08-06 18:47:44 +0000 | [diff] [blame] | 338 | // VST1 : Vector Store (multiple single elements) |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 339 | class VST1D<bits<4> op7_4, string OpcodeStr, ValueType Ty, Intrinsic IntOp> |
| 340 | : NLdSt<0,0b00,0b0111,op7_4, (outs), (ins addrmode6:$addr, DPR:$src), IIC_VST, |
Bob Wilson | 2a9df47 | 2009-08-25 17:46:06 +0000 | [diff] [blame] | 341 | !strconcat(OpcodeStr, "\t\\{$src\\}, $addr"), "", |
Bob Wilson | b36ec86 | 2009-08-06 18:47:44 +0000 | [diff] [blame] | 342 | [(IntOp addrmode6:$addr, (Ty DPR:$src))]>; |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 343 | class VST1Q<bits<4> op7_4, string OpcodeStr, ValueType Ty, Intrinsic IntOp> |
| 344 | : NLdSt<0,0b00,0b1010,op7_4, (outs), (ins addrmode6:$addr, QPR:$src), IIC_VST, |
Bob Wilson | 2a9df47 | 2009-08-25 17:46:06 +0000 | [diff] [blame] | 345 | !strconcat(OpcodeStr, "\t${src:dregpair}, $addr"), "", |
Bob Wilson | b36ec86 | 2009-08-06 18:47:44 +0000 | [diff] [blame] | 346 | [(IntOp addrmode6:$addr, (Ty QPR:$src))]>; |
| 347 | |
Evan Cheng | 0d92f5f | 2009-10-01 08:22:27 +0000 | [diff] [blame] | 348 | let hasExtraSrcRegAllocReq = 1 in { |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 349 | def VST1d8 : VST1D<0b0000, "vst1.8", v8i8, int_arm_neon_vst1>; |
| 350 | def VST1d16 : VST1D<0b0100, "vst1.16", v4i16, int_arm_neon_vst1>; |
| 351 | def VST1d32 : VST1D<0b1000, "vst1.32", v2i32, int_arm_neon_vst1>; |
| 352 | def VST1df : VST1D<0b1000, "vst1.32", v2f32, int_arm_neon_vst1>; |
| 353 | def VST1d64 : VST1D<0b1100, "vst1.64", v1i64, int_arm_neon_vst1>; |
Bob Wilson | b36ec86 | 2009-08-06 18:47:44 +0000 | [diff] [blame] | 354 | |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 355 | def VST1q8 : VST1Q<0b0000, "vst1.8", v16i8, int_arm_neon_vst1>; |
| 356 | def VST1q16 : VST1Q<0b0100, "vst1.16", v8i16, int_arm_neon_vst1>; |
| 357 | def VST1q32 : VST1Q<0b1000, "vst1.32", v4i32, int_arm_neon_vst1>; |
| 358 | def VST1qf : VST1Q<0b1000, "vst1.32", v4f32, int_arm_neon_vst1>; |
| 359 | def VST1q64 : VST1Q<0b1100, "vst1.64", v2i64, int_arm_neon_vst1>; |
Evan Cheng | 0d92f5f | 2009-10-01 08:22:27 +0000 | [diff] [blame] | 360 | } // hasExtraSrcRegAllocReq |
Bob Wilson | b36ec86 | 2009-08-06 18:47:44 +0000 | [diff] [blame] | 361 | |
Evan Cheng | 0d92f5f | 2009-10-01 08:22:27 +0000 | [diff] [blame] | 362 | let mayStore = 1, hasExtraSrcRegAllocReq = 1 in { |
Bob Wilson | 9f7d60f | 2009-08-12 17:04:56 +0000 | [diff] [blame] | 363 | |
Bob Wilson | b36ec86 | 2009-08-06 18:47:44 +0000 | [diff] [blame] | 364 | // VST2 : Vector Store (multiple 2-element structures) |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 365 | class VST2D<bits<4> op7_4, string OpcodeStr> |
| 366 | : NLdSt<0,0b00,0b1000,op7_4, (outs), |
| 367 | (ins addrmode6:$addr, DPR:$src1, DPR:$src2), IIC_VST, |
Bob Wilson | 2a9df47 | 2009-08-25 17:46:06 +0000 | [diff] [blame] | 368 | !strconcat(OpcodeStr, "\t\\{$src1,$src2\\}, $addr"), "", []>; |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 369 | class VST2Q<bits<4> op7_4, string OpcodeStr> |
| 370 | : NLdSt<0,0b00,0b0011,op7_4, (outs), |
| 371 | (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4), |
| 372 | IIC_VST, |
Bob Wilson | d285575 | 2009-10-07 18:47:39 +0000 | [diff] [blame] | 373 | !strconcat(OpcodeStr, "\t\\{$src1,$src2,$src3,$src4\\}, $addr"), |
| 374 | "", []>; |
Bob Wilson | b36ec86 | 2009-08-06 18:47:44 +0000 | [diff] [blame] | 375 | |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 376 | def VST2d8 : VST2D<0b0000, "vst2.8">; |
| 377 | def VST2d16 : VST2D<0b0100, "vst2.16">; |
| 378 | def VST2d32 : VST2D<0b1000, "vst2.32">; |
Bob Wilson | 24e04c5 | 2009-10-08 00:21:01 +0000 | [diff] [blame] | 379 | def VST2d64 : NLdSt<0,0b00,0b1010,0b1100, (outs), |
| 380 | (ins addrmode6:$addr, DPR:$src1, DPR:$src2), IIC_VST, |
| 381 | "vst1.64\t\\{$src1,$src2\\}, $addr", "", []>; |
Bob Wilson | b36ec86 | 2009-08-06 18:47:44 +0000 | [diff] [blame] | 382 | |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 383 | def VST2q8 : VST2Q<0b0000, "vst2.8">; |
| 384 | def VST2q16 : VST2Q<0b0100, "vst2.16">; |
| 385 | def VST2q32 : VST2Q<0b1000, "vst2.32">; |
Bob Wilson | d285575 | 2009-10-07 18:47:39 +0000 | [diff] [blame] | 386 | |
Bob Wilson | b36ec86 | 2009-08-06 18:47:44 +0000 | [diff] [blame] | 387 | // VST3 : Vector Store (multiple 3-element structures) |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 388 | class VST3D<bits<4> op7_4, string OpcodeStr> |
| 389 | : NLdSt<0,0b00,0b0100,op7_4, (outs), |
| 390 | (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3), IIC_VST, |
Bob Wilson | 2a9df47 | 2009-08-25 17:46:06 +0000 | [diff] [blame] | 391 | !strconcat(OpcodeStr, "\t\\{$src1,$src2,$src3\\}, $addr"), "", []>; |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 392 | class VST3WB<bits<4> op7_4, string OpcodeStr> |
| 393 | : NLdSt<0,0b00,0b0101,op7_4, (outs GPR:$wb), |
| 394 | (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3), IIC_VST, |
Bob Wilson | 66a7063 | 2009-10-07 20:30:08 +0000 | [diff] [blame] | 395 | !strconcat(OpcodeStr, "\t\\{$src1,$src2,$src3\\}, $addr"), |
| 396 | "$addr.addr = $wb", []>; |
Bob Wilson | b36ec86 | 2009-08-06 18:47:44 +0000 | [diff] [blame] | 397 | |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 398 | def VST3d8 : VST3D<0b0000, "vst3.8">; |
| 399 | def VST3d16 : VST3D<0b0100, "vst3.16">; |
| 400 | def VST3d32 : VST3D<0b1000, "vst3.32">; |
Bob Wilson | 5adf60c | 2009-10-08 00:28:28 +0000 | [diff] [blame] | 401 | def VST3d64 : NLdSt<0,0b00,0b0110,0b1100, (outs), |
| 402 | (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3), |
| 403 | IIC_VST, |
| 404 | "vst1.64\t\\{$src1,$src2,$src3\\}, $addr", "", []>; |
Bob Wilson | b36ec86 | 2009-08-06 18:47:44 +0000 | [diff] [blame] | 405 | |
Bob Wilson | 66a7063 | 2009-10-07 20:30:08 +0000 | [diff] [blame] | 406 | // vst3 to double-spaced even registers. |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 407 | def VST3q8a : VST3WB<0b0000, "vst3.8">; |
| 408 | def VST3q16a : VST3WB<0b0100, "vst3.16">; |
| 409 | def VST3q32a : VST3WB<0b1000, "vst3.32">; |
Bob Wilson | 66a7063 | 2009-10-07 20:30:08 +0000 | [diff] [blame] | 410 | |
| 411 | // vst3 to double-spaced odd registers. |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 412 | def VST3q8b : VST3WB<0b0000, "vst3.8">; |
| 413 | def VST3q16b : VST3WB<0b0100, "vst3.16">; |
| 414 | def VST3q32b : VST3WB<0b1000, "vst3.32">; |
Bob Wilson | 66a7063 | 2009-10-07 20:30:08 +0000 | [diff] [blame] | 415 | |
Bob Wilson | b36ec86 | 2009-08-06 18:47:44 +0000 | [diff] [blame] | 416 | // VST4 : Vector Store (multiple 4-element structures) |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 417 | class VST4D<bits<4> op7_4, string OpcodeStr> |
| 418 | : NLdSt<0,0b00,0b0000,op7_4, (outs), |
| 419 | (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4), |
| 420 | IIC_VST, |
Bob Wilson | 2a9df47 | 2009-08-25 17:46:06 +0000 | [diff] [blame] | 421 | !strconcat(OpcodeStr, "\t\\{$src1,$src2,$src3,$src4\\}, $addr"), |
| 422 | "", []>; |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 423 | class VST4WB<bits<4> op7_4, string OpcodeStr> |
| 424 | : NLdSt<0,0b00,0b0001,op7_4, (outs GPR:$wb), |
| 425 | (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4), |
| 426 | IIC_VST, |
Bob Wilson | 63c9063 | 2009-10-07 20:49:18 +0000 | [diff] [blame] | 427 | !strconcat(OpcodeStr, "\t\\{$src1,$src2,$src3,$src4\\}, $addr"), |
| 428 | "$addr.addr = $wb", []>; |
Bob Wilson | b36ec86 | 2009-08-06 18:47:44 +0000 | [diff] [blame] | 429 | |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 430 | def VST4d8 : VST4D<0b0000, "vst4.8">; |
| 431 | def VST4d16 : VST4D<0b0100, "vst4.16">; |
| 432 | def VST4d32 : VST4D<0b1000, "vst4.32">; |
Bob Wilson | deb3141 | 2009-10-08 05:18:18 +0000 | [diff] [blame] | 433 | def VST4d64 : NLdSt<0,0b00,0b0010,0b1100, (outs), |
| 434 | (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, |
| 435 | DPR:$src4), IIC_VST, |
| 436 | "vst1.64\t\\{$src1,$src2,$src3,$src4\\}, $addr", "", []>; |
Bob Wilson | 8a3198b | 2009-09-01 18:51:56 +0000 | [diff] [blame] | 437 | |
Bob Wilson | 63c9063 | 2009-10-07 20:49:18 +0000 | [diff] [blame] | 438 | // vst4 to double-spaced even registers. |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 439 | def VST4q8a : VST4WB<0b0000, "vst4.8">; |
| 440 | def VST4q16a : VST4WB<0b0100, "vst4.16">; |
| 441 | def VST4q32a : VST4WB<0b1000, "vst4.32">; |
Bob Wilson | 63c9063 | 2009-10-07 20:49:18 +0000 | [diff] [blame] | 442 | |
| 443 | // vst4 to double-spaced odd registers. |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 444 | def VST4q8b : VST4WB<0b0000, "vst4.8">; |
| 445 | def VST4q16b : VST4WB<0b0100, "vst4.16">; |
| 446 | def VST4q32b : VST4WB<0b1000, "vst4.32">; |
| 447 | |
| 448 | // VST1LN : Vector Store (single element from one lane) |
| 449 | // FIXME: Not yet implemented. |
Bob Wilson | 63c9063 | 2009-10-07 20:49:18 +0000 | [diff] [blame] | 450 | |
Bob Wilson | 8a3198b | 2009-09-01 18:51:56 +0000 | [diff] [blame] | 451 | // VST2LN : Vector Store (single 2-element structure from one lane) |
Bob Wilson | c5c6edb | 2009-10-08 23:38:24 +0000 | [diff] [blame] | 452 | class VST2LN<bits<4> op11_8, string OpcodeStr> |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 453 | : NLdSt<1,0b00,op11_8,0b0000, (outs), |
| 454 | (ins addrmode6:$addr, DPR:$src1, DPR:$src2, nohash_imm:$lane), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 455 | IIC_VST, |
Bob Wilson | 8a3198b | 2009-09-01 18:51:56 +0000 | [diff] [blame] | 456 | !strconcat(OpcodeStr, "\t\\{$src1[$lane],$src2[$lane]\\}, $addr"), |
| 457 | "", []>; |
| 458 | |
Bob Wilson | c5c6edb | 2009-10-08 23:38:24 +0000 | [diff] [blame] | 459 | def VST2LNd8 : VST2LN<0b0000, "vst2.8">; |
| 460 | def VST2LNd16 : VST2LN<0b0100, "vst2.16">; |
| 461 | def VST2LNd32 : VST2LN<0b1000, "vst2.32">; |
| 462 | |
| 463 | // vst2 to double-spaced even registers. |
| 464 | def VST2LNq16a: VST2LN<0b0100, "vst2.16">; |
| 465 | def VST2LNq32a: VST2LN<0b1000, "vst2.32">; |
| 466 | |
| 467 | // vst2 to double-spaced odd registers. |
| 468 | def VST2LNq16b: VST2LN<0b0100, "vst2.16">; |
| 469 | def VST2LNq32b: VST2LN<0b1000, "vst2.32">; |
Bob Wilson | 8a3198b | 2009-09-01 18:51:56 +0000 | [diff] [blame] | 470 | |
| 471 | // VST3LN : Vector Store (single 3-element structure from one lane) |
Bob Wilson | 8cdb269 | 2009-10-08 23:51:31 +0000 | [diff] [blame] | 472 | class VST3LN<bits<4> op11_8, string OpcodeStr> |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 473 | : NLdSt<1,0b00,op11_8,0b0000, (outs), |
| 474 | (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, |
| 475 | nohash_imm:$lane), IIC_VST, |
Bob Wilson | 8a3198b | 2009-09-01 18:51:56 +0000 | [diff] [blame] | 476 | !strconcat(OpcodeStr, |
| 477 | "\t\\{$src1[$lane],$src2[$lane],$src3[$lane]\\}, $addr"), "", []>; |
| 478 | |
Bob Wilson | 8cdb269 | 2009-10-08 23:51:31 +0000 | [diff] [blame] | 479 | def VST3LNd8 : VST3LN<0b0010, "vst3.8">; |
| 480 | def VST3LNd16 : VST3LN<0b0110, "vst3.16">; |
| 481 | def VST3LNd32 : VST3LN<0b1010, "vst3.32">; |
| 482 | |
| 483 | // vst3 to double-spaced even registers. |
| 484 | def VST3LNq16a: VST3LN<0b0110, "vst3.16">; |
| 485 | def VST3LNq32a: VST3LN<0b1010, "vst3.32">; |
| 486 | |
| 487 | // vst3 to double-spaced odd registers. |
| 488 | def VST3LNq16b: VST3LN<0b0110, "vst3.16">; |
| 489 | def VST3LNq32b: VST3LN<0b1010, "vst3.32">; |
Bob Wilson | 8a3198b | 2009-09-01 18:51:56 +0000 | [diff] [blame] | 490 | |
| 491 | // VST4LN : Vector Store (single 4-element structure from one lane) |
Bob Wilson | 5631139 | 2009-10-09 00:01:36 +0000 | [diff] [blame^] | 492 | class VST4LN<bits<4> op11_8, string OpcodeStr> |
Bob Wilson | b07c171 | 2009-10-07 21:53:04 +0000 | [diff] [blame] | 493 | : NLdSt<1,0b00,op11_8,0b0000, (outs), |
| 494 | (ins addrmode6:$addr, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4, |
| 495 | nohash_imm:$lane), IIC_VST, |
Bob Wilson | 8a3198b | 2009-09-01 18:51:56 +0000 | [diff] [blame] | 496 | !strconcat(OpcodeStr, |
| 497 | "\t\\{$src1[$lane],$src2[$lane],$src3[$lane],$src4[$lane]\\}, $addr"), |
| 498 | "", []>; |
| 499 | |
Bob Wilson | 5631139 | 2009-10-09 00:01:36 +0000 | [diff] [blame^] | 500 | def VST4LNd8 : VST4LN<0b0011, "vst4.8">; |
| 501 | def VST4LNd16 : VST4LN<0b0111, "vst4.16">; |
| 502 | def VST4LNd32 : VST4LN<0b1011, "vst4.32">; |
| 503 | |
| 504 | // vst4 to double-spaced even registers. |
| 505 | def VST4LNq16a: VST4LN<0b0111, "vst4.16">; |
| 506 | def VST4LNq32a: VST4LN<0b1011, "vst4.32">; |
| 507 | |
| 508 | // vst4 to double-spaced odd registers. |
| 509 | def VST4LNq16b: VST4LN<0b0111, "vst4.16">; |
| 510 | def VST4LNq32b: VST4LN<0b1011, "vst4.32">; |
| 511 | |
Evan Cheng | 0d92f5f | 2009-10-01 08:22:27 +0000 | [diff] [blame] | 512 | } // mayStore = 1, hasExtraSrcRegAllocReq = 1 |
Bob Wilson | b36ec86 | 2009-08-06 18:47:44 +0000 | [diff] [blame] | 513 | |
Bob Wilson | 205a5ca | 2009-07-08 18:11:30 +0000 | [diff] [blame] | 514 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 515 | //===----------------------------------------------------------------------===// |
| 516 | // NEON pattern fragments |
| 517 | //===----------------------------------------------------------------------===// |
| 518 | |
| 519 | // Extract D sub-registers of Q registers. |
| 520 | // (arm_dsubreg_0 is 5; arm_dsubreg_1 is 6) |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 521 | def DSubReg_i8_reg : SDNodeXForm<imm, [{ |
Owen Anderson | 825b72b | 2009-08-11 20:47:22 +0000 | [diff] [blame] | 522 | return CurDAG->getTargetConstant(5 + N->getZExtValue() / 8, MVT::i32); |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 523 | }]>; |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 524 | def DSubReg_i16_reg : SDNodeXForm<imm, [{ |
Owen Anderson | 825b72b | 2009-08-11 20:47:22 +0000 | [diff] [blame] | 525 | return CurDAG->getTargetConstant(5 + N->getZExtValue() / 4, MVT::i32); |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 526 | }]>; |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 527 | def DSubReg_i32_reg : SDNodeXForm<imm, [{ |
Owen Anderson | 825b72b | 2009-08-11 20:47:22 +0000 | [diff] [blame] | 528 | return CurDAG->getTargetConstant(5 + N->getZExtValue() / 2, MVT::i32); |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 529 | }]>; |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 530 | def DSubReg_f64_reg : SDNodeXForm<imm, [{ |
Owen Anderson | 825b72b | 2009-08-11 20:47:22 +0000 | [diff] [blame] | 531 | return CurDAG->getTargetConstant(5 + N->getZExtValue(), MVT::i32); |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 532 | }]>; |
Anton Korobeynikov | 69d1c1a | 2009-09-02 21:21:28 +0000 | [diff] [blame] | 533 | def DSubReg_f64_other_reg : SDNodeXForm<imm, [{ |
| 534 | return CurDAG->getTargetConstant(5 + (1 - N->getZExtValue()), MVT::i32); |
| 535 | }]>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 536 | |
Anton Korobeynikov | 2324bdc | 2009-08-28 23:41:26 +0000 | [diff] [blame] | 537 | // Extract S sub-registers of Q/D registers. |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 538 | // (arm_ssubreg_0 is 1; arm_ssubreg_1 is 2; etc.) |
| 539 | def SSubReg_f32_reg : SDNodeXForm<imm, [{ |
Owen Anderson | 825b72b | 2009-08-11 20:47:22 +0000 | [diff] [blame] | 540 | return CurDAG->getTargetConstant(1 + N->getZExtValue(), MVT::i32); |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 541 | }]>; |
| 542 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 543 | // Translate lane numbers from Q registers to D subregs. |
| 544 | def SubReg_i8_lane : SDNodeXForm<imm, [{ |
Owen Anderson | 825b72b | 2009-08-11 20:47:22 +0000 | [diff] [blame] | 545 | return CurDAG->getTargetConstant(N->getZExtValue() & 7, MVT::i32); |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 546 | }]>; |
| 547 | def SubReg_i16_lane : SDNodeXForm<imm, [{ |
Owen Anderson | 825b72b | 2009-08-11 20:47:22 +0000 | [diff] [blame] | 548 | return CurDAG->getTargetConstant(N->getZExtValue() & 3, MVT::i32); |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 549 | }]>; |
| 550 | def SubReg_i32_lane : SDNodeXForm<imm, [{ |
Owen Anderson | 825b72b | 2009-08-11 20:47:22 +0000 | [diff] [blame] | 551 | return CurDAG->getTargetConstant(N->getZExtValue() & 1, MVT::i32); |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 552 | }]>; |
| 553 | |
| 554 | //===----------------------------------------------------------------------===// |
| 555 | // Instruction Classes |
| 556 | //===----------------------------------------------------------------------===// |
| 557 | |
| 558 | // Basic 2-register operations, both double- and quad-register. |
| 559 | class N2VD<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, |
| 560 | bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr, |
| 561 | ValueType ResTy, ValueType OpTy, SDNode OpNode> |
| 562 | : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 563 | (ins DPR:$src), IIC_VUNAD, !strconcat(OpcodeStr, "\t$dst, $src"), "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 564 | [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src))))]>; |
| 565 | class N2VQ<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, |
| 566 | bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr, |
| 567 | ValueType ResTy, ValueType OpTy, SDNode OpNode> |
| 568 | : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 569 | (ins QPR:$src), IIC_VUNAQ, !strconcat(OpcodeStr, "\t$dst, $src"), "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 570 | [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src))))]>; |
| 571 | |
David Goodwin | 338268c | 2009-08-10 22:17:39 +0000 | [diff] [blame] | 572 | // Basic 2-register operations, scalar single-precision. |
| 573 | class N2VDs<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, |
| 574 | bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr, |
| 575 | ValueType ResTy, ValueType OpTy, SDNode OpNode> |
| 576 | : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, |
| 577 | (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 578 | IIC_VUNAD, !strconcat(OpcodeStr, "\t$dst, $src"), "", []>; |
David Goodwin | 338268c | 2009-08-10 22:17:39 +0000 | [diff] [blame] | 579 | |
| 580 | class N2VDsPat<SDNode OpNode, ValueType ResTy, ValueType OpTy, NeonI Inst> |
| 581 | : NEONFPPat<(ResTy (OpNode SPR:$a)), |
| 582 | (EXTRACT_SUBREG |
| 583 | (Inst (INSERT_SUBREG (OpTy (IMPLICIT_DEF)), SPR:$a, arm_ssubreg_0)), |
| 584 | arm_ssubreg_0)>; |
| 585 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 586 | // Basic 2-register intrinsics, both double- and quad-register. |
| 587 | class N2VDInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 588 | bits<2> op17_16, bits<5> op11_7, bit op4, |
| 589 | InstrItinClass itin, string OpcodeStr, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 590 | ValueType ResTy, ValueType OpTy, Intrinsic IntOp> |
| 591 | : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 592 | (ins DPR:$src), itin, !strconcat(OpcodeStr, "\t$dst, $src"), "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 593 | [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src))))]>; |
| 594 | class N2VQInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 595 | bits<2> op17_16, bits<5> op11_7, bit op4, |
| 596 | InstrItinClass itin, string OpcodeStr, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 597 | ValueType ResTy, ValueType OpTy, Intrinsic IntOp> |
| 598 | : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 599 | (ins QPR:$src), itin, !strconcat(OpcodeStr, "\t$dst, $src"), "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 600 | [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src))))]>; |
| 601 | |
David Goodwin | 338268c | 2009-08-10 22:17:39 +0000 | [diff] [blame] | 602 | // Basic 2-register intrinsics, scalar single-precision |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 603 | class N2VDInts<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 604 | bits<2> op17_16, bits<5> op11_7, bit op4, |
| 605 | InstrItinClass itin, string OpcodeStr, |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 606 | ValueType ResTy, ValueType OpTy, Intrinsic IntOp> |
| 607 | : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 608 | (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), itin, |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 609 | !strconcat(OpcodeStr, "\t$dst, $src"), "", []>; |
| 610 | |
| 611 | class N2VDIntsPat<SDNode OpNode, NeonI Inst> |
David Goodwin | 53e4471 | 2009-08-04 20:39:05 +0000 | [diff] [blame] | 612 | : NEONFPPat<(f32 (OpNode SPR:$a)), |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 613 | (EXTRACT_SUBREG |
| 614 | (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$a, arm_ssubreg_0)), |
| 615 | arm_ssubreg_0)>; |
David Goodwin | 53e4471 | 2009-08-04 20:39:05 +0000 | [diff] [blame] | 616 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 617 | // Narrow 2-register intrinsics. |
| 618 | class N2VNInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, |
| 619 | bits<2> op17_16, bits<5> op11_7, bit op6, bit op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 620 | InstrItinClass itin, string OpcodeStr, |
| 621 | ValueType TyD, ValueType TyQ, Intrinsic IntOp> |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 622 | : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$dst), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 623 | (ins QPR:$src), itin, !strconcat(OpcodeStr, "\t$dst, $src"), "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 624 | [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src))))]>; |
| 625 | |
| 626 | // Long 2-register intrinsics. (This is currently only used for VMOVL and is |
| 627 | // derived from N2VImm instead of N2V because of the way the size is encoded.) |
| 628 | class N2VLInt<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 629 | bit op6, bit op4, InstrItinClass itin, string OpcodeStr, |
| 630 | ValueType TyQ, ValueType TyD, Intrinsic IntOp> |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 631 | : N2VImm<op24, op23, op21_16, op11_8, op7, op6, op4, (outs QPR:$dst), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 632 | (ins DPR:$src), itin, !strconcat(OpcodeStr, "\t$dst, $src"), "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 633 | [(set QPR:$dst, (TyQ (IntOp (TyD DPR:$src))))]>; |
| 634 | |
Bob Wilson | b6ab51e | 2009-08-08 06:13:25 +0000 | [diff] [blame] | 635 | // 2-register shuffles (VTRN/VZIP/VUZP), both double- and quad-register. |
| 636 | class N2VDShuffle<bits<2> op19_18, bits<5> op11_7, string OpcodeStr> |
| 637 | : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 0, 0, (outs DPR:$dst1, DPR:$dst2), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 638 | (ins DPR:$src1, DPR:$src2), IIC_VPERMD, |
Bob Wilson | b6ab51e | 2009-08-08 06:13:25 +0000 | [diff] [blame] | 639 | !strconcat(OpcodeStr, "\t$dst1, $dst2"), |
| 640 | "$src1 = $dst1, $src2 = $dst2", []>; |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 641 | class N2VQShuffle<bits<2> op19_18, bits<5> op11_7, |
| 642 | InstrItinClass itin, string OpcodeStr> |
Bob Wilson | b6ab51e | 2009-08-08 06:13:25 +0000 | [diff] [blame] | 643 | : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 1, 0, (outs QPR:$dst1, QPR:$dst2), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 644 | (ins QPR:$src1, QPR:$src2), itin, |
Bob Wilson | b6ab51e | 2009-08-08 06:13:25 +0000 | [diff] [blame] | 645 | !strconcat(OpcodeStr, "\t$dst1, $dst2"), |
| 646 | "$src1 = $dst1, $src2 = $dst2", []>; |
| 647 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 648 | // Basic 3-register operations, both double- and quad-register. |
| 649 | class N3VD<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 650 | InstrItinClass itin, string OpcodeStr, ValueType ResTy, ValueType OpTy, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 651 | SDNode OpNode, bit Commutable> |
| 652 | : N3V<op24, op23, op21_20, op11_8, 0, op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 653 | (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 654 | !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "", |
| 655 | [(set DPR:$dst, (ResTy (OpNode (OpTy DPR:$src1), (OpTy DPR:$src2))))]> { |
| 656 | let isCommutable = Commutable; |
| 657 | } |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 658 | class N3VDSL<bits<2> op21_20, bits<4> op11_8, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 659 | InstrItinClass itin, string OpcodeStr, ValueType Ty, SDNode ShOp> |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 660 | : N3V<0, 1, op21_20, op11_8, 1, 0, |
| 661 | (outs DPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 662 | itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 663 | [(set (Ty DPR:$dst), |
| 664 | (Ty (ShOp (Ty DPR:$src1), |
| 665 | (Ty (NEONvduplane (Ty DPR_VFP2:$src2), |
| 666 | imm:$lane)))))]> { |
| 667 | let isCommutable = 0; |
| 668 | } |
| 669 | class N3VDSL16<bits<2> op21_20, bits<4> op11_8, |
| 670 | string OpcodeStr, ValueType Ty, SDNode ShOp> |
| 671 | : N3V<0, 1, op21_20, op11_8, 1, 0, |
| 672 | (outs DPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 673 | IIC_VMULi16D, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 674 | !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", |
| 675 | [(set (Ty DPR:$dst), |
| 676 | (Ty (ShOp (Ty DPR:$src1), |
| 677 | (Ty (NEONvduplane (Ty DPR_8:$src2), |
| 678 | imm:$lane)))))]> { |
| 679 | let isCommutable = 0; |
| 680 | } |
| 681 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 682 | class N3VQ<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 683 | InstrItinClass itin, string OpcodeStr, ValueType ResTy, ValueType OpTy, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 684 | SDNode OpNode, bit Commutable> |
| 685 | : N3V<op24, op23, op21_20, op11_8, 1, op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 686 | (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 687 | !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "", |
| 688 | [(set QPR:$dst, (ResTy (OpNode (OpTy QPR:$src1), (OpTy QPR:$src2))))]> { |
| 689 | let isCommutable = Commutable; |
| 690 | } |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 691 | class N3VQSL<bits<2> op21_20, bits<4> op11_8, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 692 | InstrItinClass itin, string OpcodeStr, |
| 693 | ValueType ResTy, ValueType OpTy, SDNode ShOp> |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 694 | : N3V<1, 1, op21_20, op11_8, 1, 0, |
| 695 | (outs QPR:$dst), (ins QPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 696 | itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 697 | [(set (ResTy QPR:$dst), |
| 698 | (ResTy (ShOp (ResTy QPR:$src1), |
| 699 | (ResTy (NEONvduplane (OpTy DPR_VFP2:$src2), |
| 700 | imm:$lane)))))]> { |
| 701 | let isCommutable = 0; |
| 702 | } |
| 703 | class N3VQSL16<bits<2> op21_20, bits<4> op11_8, |
| 704 | string OpcodeStr, ValueType ResTy, ValueType OpTy, SDNode ShOp> |
| 705 | : N3V<1, 1, op21_20, op11_8, 1, 0, |
| 706 | (outs QPR:$dst), (ins QPR:$src1, DPR_8:$src2, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 707 | IIC_VMULi16Q, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 708 | !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", |
| 709 | [(set (ResTy QPR:$dst), |
| 710 | (ResTy (ShOp (ResTy QPR:$src1), |
| 711 | (ResTy (NEONvduplane (OpTy DPR_8:$src2), |
| 712 | imm:$lane)))))]> { |
| 713 | let isCommutable = 0; |
| 714 | } |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 715 | |
David Goodwin | 42a83f2 | 2009-08-04 17:53:06 +0000 | [diff] [blame] | 716 | // Basic 3-register operations, scalar single-precision |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 717 | class N3VDs<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4, |
| 718 | string OpcodeStr, ValueType ResTy, ValueType OpTy, |
| 719 | SDNode OpNode, bit Commutable> |
| 720 | : N3V<op24, op23, op21_20, op11_8, 0, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 721 | (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src1, DPR_VFP2:$src2), IIC_VBIND, |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 722 | !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "", []> { |
| 723 | let isCommutable = Commutable; |
| 724 | } |
| 725 | class N3VDsPat<SDNode OpNode, NeonI Inst> |
David Goodwin | 42a83f2 | 2009-08-04 17:53:06 +0000 | [diff] [blame] | 726 | : NEONFPPat<(f32 (OpNode SPR:$a, SPR:$b)), |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 727 | (EXTRACT_SUBREG |
| 728 | (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$a, arm_ssubreg_0), |
| 729 | (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$b, arm_ssubreg_0)), |
| 730 | arm_ssubreg_0)>; |
David Goodwin | 42a83f2 | 2009-08-04 17:53:06 +0000 | [diff] [blame] | 731 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 732 | // Basic 3-register intrinsics, both double- and quad-register. |
| 733 | class N3VDInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 734 | InstrItinClass itin, string OpcodeStr, ValueType ResTy, ValueType OpTy, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 735 | Intrinsic IntOp, bit Commutable> |
| 736 | : N3V<op24, op23, op21_20, op11_8, 0, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 737 | (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 738 | !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "", |
| 739 | [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src1), (OpTy DPR:$src2))))]> { |
| 740 | let isCommutable = Commutable; |
| 741 | } |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 742 | class N3VDIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 743 | string OpcodeStr, ValueType Ty, Intrinsic IntOp> |
| 744 | : N3V<0, 1, op21_20, op11_8, 1, 0, |
| 745 | (outs DPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 746 | itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 747 | [(set (Ty DPR:$dst), |
| 748 | (Ty (IntOp (Ty DPR:$src1), |
| 749 | (Ty (NEONvduplane (Ty DPR_VFP2:$src2), |
| 750 | imm:$lane)))))]> { |
| 751 | let isCommutable = 0; |
| 752 | } |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 753 | class N3VDIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 754 | string OpcodeStr, ValueType Ty, Intrinsic IntOp> |
| 755 | : N3V<0, 1, op21_20, op11_8, 1, 0, |
| 756 | (outs DPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 757 | itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 758 | [(set (Ty DPR:$dst), |
| 759 | (Ty (IntOp (Ty DPR:$src1), |
| 760 | (Ty (NEONvduplane (Ty DPR_8:$src2), |
| 761 | imm:$lane)))))]> { |
| 762 | let isCommutable = 0; |
| 763 | } |
| 764 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 765 | class N3VQInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 766 | InstrItinClass itin, string OpcodeStr, ValueType ResTy, ValueType OpTy, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 767 | Intrinsic IntOp, bit Commutable> |
| 768 | : N3V<op24, op23, op21_20, op11_8, 1, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 769 | (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 770 | !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "", |
| 771 | [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src1), (OpTy QPR:$src2))))]> { |
| 772 | let isCommutable = Commutable; |
| 773 | } |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 774 | class N3VQIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 775 | string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp> |
| 776 | : N3V<1, 1, op21_20, op11_8, 1, 0, |
| 777 | (outs QPR:$dst), (ins QPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 778 | itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 779 | [(set (ResTy QPR:$dst), |
| 780 | (ResTy (IntOp (ResTy QPR:$src1), |
| 781 | (ResTy (NEONvduplane (OpTy DPR_VFP2:$src2), |
| 782 | imm:$lane)))))]> { |
| 783 | let isCommutable = 0; |
| 784 | } |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 785 | class N3VQIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 786 | string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp> |
| 787 | : N3V<1, 1, op21_20, op11_8, 1, 0, |
| 788 | (outs QPR:$dst), (ins QPR:$src1, DPR_8:$src2, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 789 | itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 790 | [(set (ResTy QPR:$dst), |
| 791 | (ResTy (IntOp (ResTy QPR:$src1), |
| 792 | (ResTy (NEONvduplane (OpTy DPR_8:$src2), |
| 793 | imm:$lane)))))]> { |
| 794 | let isCommutable = 0; |
| 795 | } |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 796 | |
| 797 | // Multiply-Add/Sub operations, both double- and quad-register. |
| 798 | class N3VDMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 799 | InstrItinClass itin, string OpcodeStr, |
| 800 | ValueType Ty, SDNode MulOp, SDNode OpNode> |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 801 | : N3V<op24, op23, op21_20, op11_8, 0, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 802 | (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3), itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 803 | !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst", |
| 804 | [(set DPR:$dst, (Ty (OpNode DPR:$src1, |
| 805 | (Ty (MulOp DPR:$src2, DPR:$src3)))))]>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 806 | class N3VDMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 807 | string OpcodeStr, ValueType Ty, SDNode MulOp, SDNode ShOp> |
| 808 | : N3V<0, 1, op21_20, op11_8, 1, 0, |
| 809 | (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 810 | (ins DPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane), itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 811 | !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst", |
| 812 | [(set (Ty DPR:$dst), |
| 813 | (Ty (ShOp (Ty DPR:$src1), |
| 814 | (Ty (MulOp DPR:$src2, |
| 815 | (Ty (NEONvduplane (Ty DPR_VFP2:$src3), |
| 816 | imm:$lane)))))))]>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 817 | class N3VDMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 818 | string OpcodeStr, ValueType Ty, SDNode MulOp, SDNode ShOp> |
| 819 | : N3V<0, 1, op21_20, op11_8, 1, 0, |
| 820 | (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 821 | (ins DPR:$src1, DPR:$src2, DPR_8:$src3, nohash_imm:$lane), itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 822 | !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst", |
| 823 | [(set (Ty DPR:$dst), |
| 824 | (Ty (ShOp (Ty DPR:$src1), |
| 825 | (Ty (MulOp DPR:$src2, |
| 826 | (Ty (NEONvduplane (Ty DPR_8:$src3), |
| 827 | imm:$lane)))))))]>; |
| 828 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 829 | class N3VQMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 830 | InstrItinClass itin, string OpcodeStr, ValueType Ty, |
| 831 | SDNode MulOp, SDNode OpNode> |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 832 | : N3V<op24, op23, op21_20, op11_8, 1, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 833 | (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3), itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 834 | !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst", |
| 835 | [(set QPR:$dst, (Ty (OpNode QPR:$src1, |
| 836 | (Ty (MulOp QPR:$src2, QPR:$src3)))))]>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 837 | class N3VQMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 838 | string OpcodeStr, ValueType ResTy, ValueType OpTy, |
| 839 | SDNode MulOp, SDNode ShOp> |
| 840 | : N3V<1, 1, op21_20, op11_8, 1, 0, |
| 841 | (outs QPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 842 | (ins QPR:$src1, QPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane), itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 843 | !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst", |
| 844 | [(set (ResTy QPR:$dst), |
| 845 | (ResTy (ShOp (ResTy QPR:$src1), |
| 846 | (ResTy (MulOp QPR:$src2, |
| 847 | (ResTy (NEONvduplane (OpTy DPR_VFP2:$src3), |
| 848 | imm:$lane)))))))]>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 849 | class N3VQMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 850 | string OpcodeStr, ValueType ResTy, ValueType OpTy, |
| 851 | SDNode MulOp, SDNode ShOp> |
| 852 | : N3V<1, 1, op21_20, op11_8, 1, 0, |
| 853 | (outs QPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 854 | (ins QPR:$src1, QPR:$src2, DPR_8:$src3, nohash_imm:$lane), itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 855 | !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst", |
| 856 | [(set (ResTy QPR:$dst), |
| 857 | (ResTy (ShOp (ResTy QPR:$src1), |
| 858 | (ResTy (MulOp QPR:$src2, |
| 859 | (ResTy (NEONvduplane (OpTy DPR_8:$src3), |
| 860 | imm:$lane)))))))]>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 861 | |
David Goodwin | 42a83f2 | 2009-08-04 17:53:06 +0000 | [diff] [blame] | 862 | // Multiply-Add/Sub operations, scalar single-precision |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 863 | class N3VDMulOps<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 864 | InstrItinClass itin, string OpcodeStr, |
| 865 | ValueType Ty, SDNode MulOp, SDNode OpNode> |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 866 | : N3V<op24, op23, op21_20, op11_8, 0, op4, |
| 867 | (outs DPR_VFP2:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 868 | (ins DPR_VFP2:$src1, DPR_VFP2:$src2, DPR_VFP2:$src3), itin, |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 869 | !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst", []>; |
| 870 | |
| 871 | class N3VDMulOpsPat<SDNode MulNode, SDNode OpNode, NeonI Inst> |
| 872 | : NEONFPPat<(f32 (OpNode SPR:$acc, (f32 (MulNode SPR:$a, SPR:$b)))), |
| 873 | (EXTRACT_SUBREG |
| 874 | (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$acc, arm_ssubreg_0), |
| 875 | (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$a, arm_ssubreg_0), |
| 876 | (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$b, arm_ssubreg_0)), |
| 877 | arm_ssubreg_0)>; |
David Goodwin | 42a83f2 | 2009-08-04 17:53:06 +0000 | [diff] [blame] | 878 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 879 | // Neon 3-argument intrinsics, both double- and quad-register. |
| 880 | // The destination register is also used as the first source operand register. |
| 881 | class N3VDInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 882 | InstrItinClass itin, string OpcodeStr, |
| 883 | ValueType ResTy, ValueType OpTy, Intrinsic IntOp> |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 884 | : N3V<op24, op23, op21_20, op11_8, 0, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 885 | (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, DPR:$src3), itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 886 | !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst", |
| 887 | [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src1), |
| 888 | (OpTy DPR:$src2), (OpTy DPR:$src3))))]>; |
| 889 | class N3VQInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 890 | InstrItinClass itin, string OpcodeStr, |
| 891 | ValueType ResTy, ValueType OpTy, Intrinsic IntOp> |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 892 | : N3V<op24, op23, op21_20, op11_8, 1, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 893 | (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, QPR:$src3), itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 894 | !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst", |
| 895 | [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src1), |
| 896 | (OpTy QPR:$src2), (OpTy QPR:$src3))))]>; |
| 897 | |
| 898 | // Neon Long 3-argument intrinsic. The destination register is |
| 899 | // a quad-register and is also used as the first source operand register. |
| 900 | class N3VLInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 901 | InstrItinClass itin, string OpcodeStr, |
| 902 | ValueType TyQ, ValueType TyD, Intrinsic IntOp> |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 903 | : N3V<op24, op23, op21_20, op11_8, 0, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 904 | (outs QPR:$dst), (ins QPR:$src1, DPR:$src2, DPR:$src3), itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 905 | !strconcat(OpcodeStr, "\t$dst, $src2, $src3"), "$src1 = $dst", |
| 906 | [(set QPR:$dst, |
| 907 | (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$src2), (TyD DPR:$src3))))]>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 908 | class N3VLInt3SL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 909 | string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp> |
| 910 | : N3V<op24, 1, op21_20, op11_8, 1, 0, |
| 911 | (outs QPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 912 | (ins QPR:$src1, DPR:$src2, DPR_VFP2:$src3, nohash_imm:$lane), itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 913 | !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst", |
| 914 | [(set (ResTy QPR:$dst), |
| 915 | (ResTy (IntOp (ResTy QPR:$src1), |
| 916 | (OpTy DPR:$src2), |
| 917 | (OpTy (NEONvduplane (OpTy DPR_VFP2:$src3), |
| 918 | imm:$lane)))))]>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 919 | class N3VLInt3SL16<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 920 | string OpcodeStr, ValueType ResTy, ValueType OpTy, |
| 921 | Intrinsic IntOp> |
| 922 | : N3V<op24, 1, op21_20, op11_8, 1, 0, |
| 923 | (outs QPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 924 | (ins QPR:$src1, DPR:$src2, DPR_8:$src3, nohash_imm:$lane), itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 925 | !strconcat(OpcodeStr, "\t$dst, $src2, $src3[$lane]"), "$src1 = $dst", |
| 926 | [(set (ResTy QPR:$dst), |
| 927 | (ResTy (IntOp (ResTy QPR:$src1), |
| 928 | (OpTy DPR:$src2), |
| 929 | (OpTy (NEONvduplane (OpTy DPR_8:$src3), |
| 930 | imm:$lane)))))]>; |
| 931 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 932 | |
| 933 | // Narrowing 3-register intrinsics. |
| 934 | class N3VNInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4, |
| 935 | string OpcodeStr, ValueType TyD, ValueType TyQ, |
| 936 | Intrinsic IntOp, bit Commutable> |
| 937 | : N3V<op24, op23, op21_20, op11_8, 0, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 938 | (outs DPR:$dst), (ins QPR:$src1, QPR:$src2), IIC_VBINi4D, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 939 | !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "", |
| 940 | [(set DPR:$dst, (TyD (IntOp (TyQ QPR:$src1), (TyQ QPR:$src2))))]> { |
| 941 | let isCommutable = Commutable; |
| 942 | } |
| 943 | |
| 944 | // Long 3-register intrinsics. |
| 945 | class N3VLInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 946 | InstrItinClass itin, string OpcodeStr, ValueType TyQ, ValueType TyD, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 947 | Intrinsic IntOp, bit Commutable> |
| 948 | : N3V<op24, op23, op21_20, op11_8, 0, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 949 | (outs QPR:$dst), (ins DPR:$src1, DPR:$src2), itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 950 | !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "", |
| 951 | [(set QPR:$dst, (TyQ (IntOp (TyD DPR:$src1), (TyD DPR:$src2))))]> { |
| 952 | let isCommutable = Commutable; |
| 953 | } |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 954 | class N3VLIntSL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 955 | string OpcodeStr, ValueType ResTy, ValueType OpTy, Intrinsic IntOp> |
| 956 | : N3V<op24, 1, op21_20, op11_8, 1, 0, |
| 957 | (outs QPR:$dst), (ins DPR:$src1, DPR_VFP2:$src2, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 958 | itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 959 | [(set (ResTy QPR:$dst), |
| 960 | (ResTy (IntOp (OpTy DPR:$src1), |
| 961 | (OpTy (NEONvduplane (OpTy DPR_VFP2:$src2), |
| 962 | imm:$lane)))))]>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 963 | class N3VLIntSL16<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 964 | string OpcodeStr, ValueType ResTy, ValueType OpTy, |
| 965 | Intrinsic IntOp> |
| 966 | : N3V<op24, 1, op21_20, op11_8, 1, 0, |
| 967 | (outs QPR:$dst), (ins DPR:$src1, DPR_8:$src2, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 968 | itin, !strconcat(OpcodeStr, "\t$dst, $src1, $src2[$lane]"), "", |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 969 | [(set (ResTy QPR:$dst), |
| 970 | (ResTy (IntOp (OpTy DPR:$src1), |
| 971 | (OpTy (NEONvduplane (OpTy DPR_8:$src2), |
| 972 | imm:$lane)))))]>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 973 | |
| 974 | // Wide 3-register intrinsics. |
| 975 | class N3VWInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4, |
| 976 | string OpcodeStr, ValueType TyQ, ValueType TyD, |
| 977 | Intrinsic IntOp, bit Commutable> |
| 978 | : N3V<op24, op23, op21_20, op11_8, 0, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 979 | (outs QPR:$dst), (ins QPR:$src1, DPR:$src2), IIC_VSUBiD, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 980 | !strconcat(OpcodeStr, "\t$dst, $src1, $src2"), "", |
| 981 | [(set QPR:$dst, (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$src2))))]> { |
| 982 | let isCommutable = Commutable; |
| 983 | } |
| 984 | |
| 985 | // Pairwise long 2-register intrinsics, both double- and quad-register. |
| 986 | class N2VDPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, |
| 987 | bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr, |
| 988 | ValueType ResTy, ValueType OpTy, Intrinsic IntOp> |
| 989 | : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 990 | (ins DPR:$src), IIC_VSHLiD, !strconcat(OpcodeStr, "\t$dst, $src"), "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 991 | [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src))))]>; |
| 992 | class N2VQPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, |
| 993 | bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr, |
| 994 | ValueType ResTy, ValueType OpTy, Intrinsic IntOp> |
| 995 | : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 996 | (ins QPR:$src), IIC_VSHLiD, !strconcat(OpcodeStr, "\t$dst, $src"), "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 997 | [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src))))]>; |
| 998 | |
| 999 | // Pairwise long 2-register accumulate intrinsics, |
| 1000 | // both double- and quad-register. |
| 1001 | // The destination register is also used as the first source operand register. |
| 1002 | class N2VDPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, |
| 1003 | bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr, |
| 1004 | ValueType ResTy, ValueType OpTy, Intrinsic IntOp> |
| 1005 | : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1006 | (outs DPR:$dst), (ins DPR:$src1, DPR:$src2), IIC_VPALiD, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1007 | !strconcat(OpcodeStr, "\t$dst, $src2"), "$src1 = $dst", |
| 1008 | [(set DPR:$dst, (ResTy (IntOp (ResTy DPR:$src1), (OpTy DPR:$src2))))]>; |
| 1009 | class N2VQPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18, |
| 1010 | bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr, |
| 1011 | ValueType ResTy, ValueType OpTy, Intrinsic IntOp> |
| 1012 | : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1013 | (outs QPR:$dst), (ins QPR:$src1, QPR:$src2), IIC_VPALiQ, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1014 | !strconcat(OpcodeStr, "\t$dst, $src2"), "$src1 = $dst", |
| 1015 | [(set QPR:$dst, (ResTy (IntOp (ResTy QPR:$src1), (OpTy QPR:$src2))))]>; |
| 1016 | |
| 1017 | // Shift by immediate, |
| 1018 | // both double- and quad-register. |
| 1019 | class N2VDSh<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1020 | bit op4, InstrItinClass itin, string OpcodeStr, |
| 1021 | ValueType Ty, SDNode OpNode> |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1022 | : N2VImm<op24, op23, op21_16, op11_8, op7, 0, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1023 | (outs DPR:$dst), (ins DPR:$src, i32imm:$SIMM), itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1024 | !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "", |
| 1025 | [(set DPR:$dst, (Ty (OpNode (Ty DPR:$src), (i32 imm:$SIMM))))]>; |
| 1026 | class N2VQSh<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1027 | bit op4, InstrItinClass itin, string OpcodeStr, |
| 1028 | ValueType Ty, SDNode OpNode> |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1029 | : N2VImm<op24, op23, op21_16, op11_8, op7, 1, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1030 | (outs QPR:$dst), (ins QPR:$src, i32imm:$SIMM), itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1031 | !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "", |
| 1032 | [(set QPR:$dst, (Ty (OpNode (Ty QPR:$src), (i32 imm:$SIMM))))]>; |
| 1033 | |
| 1034 | // Long shift by immediate. |
| 1035 | class N2VLSh<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7, |
| 1036 | bit op6, bit op4, string OpcodeStr, ValueType ResTy, |
| 1037 | ValueType OpTy, SDNode OpNode> |
| 1038 | : N2VImm<op24, op23, op21_16, op11_8, op7, op6, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1039 | (outs QPR:$dst), (ins DPR:$src, i32imm:$SIMM), IIC_VSHLiD, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1040 | !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "", |
| 1041 | [(set QPR:$dst, (ResTy (OpNode (OpTy DPR:$src), |
| 1042 | (i32 imm:$SIMM))))]>; |
| 1043 | |
| 1044 | // Narrow shift by immediate. |
| 1045 | class N2VNSh<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1046 | bit op6, bit op4, InstrItinClass itin, string OpcodeStr, |
| 1047 | ValueType ResTy, ValueType OpTy, SDNode OpNode> |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1048 | : N2VImm<op24, op23, op21_16, op11_8, op7, op6, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1049 | (outs DPR:$dst), (ins QPR:$src, i32imm:$SIMM), itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1050 | !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "", |
| 1051 | [(set DPR:$dst, (ResTy (OpNode (OpTy QPR:$src), |
| 1052 | (i32 imm:$SIMM))))]>; |
| 1053 | |
| 1054 | // Shift right by immediate and accumulate, |
| 1055 | // both double- and quad-register. |
| 1056 | class N2VDShAdd<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7, |
| 1057 | bit op4, string OpcodeStr, ValueType Ty, SDNode ShOp> |
| 1058 | : N2VImm<op24, op23, op21_16, op11_8, op7, 0, op4, |
| 1059 | (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, i32imm:$SIMM), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1060 | IIC_VPALiD, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1061 | !strconcat(OpcodeStr, "\t$dst, $src2, $SIMM"), "$src1 = $dst", |
| 1062 | [(set DPR:$dst, (Ty (add DPR:$src1, |
| 1063 | (Ty (ShOp DPR:$src2, (i32 imm:$SIMM))))))]>; |
| 1064 | class N2VQShAdd<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7, |
| 1065 | bit op4, string OpcodeStr, ValueType Ty, SDNode ShOp> |
| 1066 | : N2VImm<op24, op23, op21_16, op11_8, op7, 1, op4, |
| 1067 | (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, i32imm:$SIMM), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1068 | IIC_VPALiD, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1069 | !strconcat(OpcodeStr, "\t$dst, $src2, $SIMM"), "$src1 = $dst", |
| 1070 | [(set QPR:$dst, (Ty (add QPR:$src1, |
| 1071 | (Ty (ShOp QPR:$src2, (i32 imm:$SIMM))))))]>; |
| 1072 | |
| 1073 | // Shift by immediate and insert, |
| 1074 | // both double- and quad-register. |
| 1075 | class N2VDShIns<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7, |
| 1076 | bit op4, string OpcodeStr, ValueType Ty, SDNode ShOp> |
| 1077 | : N2VImm<op24, op23, op21_16, op11_8, op7, 0, op4, |
| 1078 | (outs DPR:$dst), (ins DPR:$src1, DPR:$src2, i32imm:$SIMM), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1079 | IIC_VSHLiD, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1080 | !strconcat(OpcodeStr, "\t$dst, $src2, $SIMM"), "$src1 = $dst", |
| 1081 | [(set DPR:$dst, (Ty (ShOp DPR:$src1, DPR:$src2, (i32 imm:$SIMM))))]>; |
| 1082 | class N2VQShIns<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7, |
| 1083 | bit op4, string OpcodeStr, ValueType Ty, SDNode ShOp> |
| 1084 | : N2VImm<op24, op23, op21_16, op11_8, op7, 1, op4, |
| 1085 | (outs QPR:$dst), (ins QPR:$src1, QPR:$src2, i32imm:$SIMM), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1086 | IIC_VSHLiQ, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1087 | !strconcat(OpcodeStr, "\t$dst, $src2, $SIMM"), "$src1 = $dst", |
| 1088 | [(set QPR:$dst, (Ty (ShOp QPR:$src1, QPR:$src2, (i32 imm:$SIMM))))]>; |
| 1089 | |
| 1090 | // Convert, with fractional bits immediate, |
| 1091 | // both double- and quad-register. |
| 1092 | class N2VCvtD<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7, |
| 1093 | bit op4, string OpcodeStr, ValueType ResTy, ValueType OpTy, |
| 1094 | Intrinsic IntOp> |
| 1095 | : N2VImm<op24, op23, op21_16, op11_8, op7, 0, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1096 | (outs DPR:$dst), (ins DPR:$src, i32imm:$SIMM), IIC_VUNAD, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1097 | !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "", |
| 1098 | [(set DPR:$dst, (ResTy (IntOp (OpTy DPR:$src), (i32 imm:$SIMM))))]>; |
| 1099 | class N2VCvtQ<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7, |
| 1100 | bit op4, string OpcodeStr, ValueType ResTy, ValueType OpTy, |
| 1101 | Intrinsic IntOp> |
| 1102 | : N2VImm<op24, op23, op21_16, op11_8, op7, 1, op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1103 | (outs QPR:$dst), (ins QPR:$src, i32imm:$SIMM), IIC_VUNAQ, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1104 | !strconcat(OpcodeStr, "\t$dst, $src, $SIMM"), "", |
| 1105 | [(set QPR:$dst, (ResTy (IntOp (OpTy QPR:$src), (i32 imm:$SIMM))))]>; |
| 1106 | |
| 1107 | //===----------------------------------------------------------------------===// |
| 1108 | // Multiclasses |
| 1109 | //===----------------------------------------------------------------------===// |
| 1110 | |
Bob Wilson | 916ac5b | 2009-10-03 04:44:16 +0000 | [diff] [blame] | 1111 | // Abbreviations used in multiclass suffixes: |
| 1112 | // Q = quarter int (8 bit) elements |
| 1113 | // H = half int (16 bit) elements |
| 1114 | // S = single int (32 bit) elements |
| 1115 | // D = double int (64 bit) elements |
| 1116 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1117 | // Neon 3-register vector operations. |
| 1118 | |
| 1119 | // First with only element sizes of 8, 16 and 32 bits: |
| 1120 | multiclass N3V_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1121 | InstrItinClass itinD16, InstrItinClass itinD32, |
| 1122 | InstrItinClass itinQ16, InstrItinClass itinQ32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1123 | string OpcodeStr, SDNode OpNode, bit Commutable = 0> { |
| 1124 | // 64-bit vector types. |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1125 | def v8i8 : N3VD<op24, op23, 0b00, op11_8, op4, itinD16, |
| 1126 | !strconcat(OpcodeStr, "8"), v8i8, v8i8, OpNode, Commutable>; |
| 1127 | def v4i16 : N3VD<op24, op23, 0b01, op11_8, op4, itinD16, |
| 1128 | !strconcat(OpcodeStr, "16"), v4i16, v4i16, OpNode, Commutable>; |
| 1129 | def v2i32 : N3VD<op24, op23, 0b10, op11_8, op4, itinD32, |
| 1130 | !strconcat(OpcodeStr, "32"), v2i32, v2i32, OpNode, Commutable>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1131 | |
| 1132 | // 128-bit vector types. |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1133 | def v16i8 : N3VQ<op24, op23, 0b00, op11_8, op4, itinQ16, |
| 1134 | !strconcat(OpcodeStr, "8"), v16i8, v16i8, OpNode, Commutable>; |
| 1135 | def v8i16 : N3VQ<op24, op23, 0b01, op11_8, op4, itinQ16, |
| 1136 | !strconcat(OpcodeStr, "16"), v8i16, v8i16, OpNode, Commutable>; |
| 1137 | def v4i32 : N3VQ<op24, op23, 0b10, op11_8, op4, itinQ32, |
| 1138 | !strconcat(OpcodeStr, "32"), v4i32, v4i32, OpNode, Commutable>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1139 | } |
| 1140 | |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1141 | multiclass N3VSL_HS<bits<4> op11_8, string OpcodeStr, SDNode ShOp> { |
| 1142 | def v4i16 : N3VDSL16<0b01, op11_8, !strconcat(OpcodeStr, "16"), v4i16, ShOp>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1143 | def v2i32 : N3VDSL<0b10, op11_8, IIC_VMULi32D, !strconcat(OpcodeStr, "32"), v2i32, ShOp>; |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1144 | def v8i16 : N3VQSL16<0b01, op11_8, !strconcat(OpcodeStr, "16"), v8i16, v4i16, ShOp>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1145 | def v4i32 : N3VQSL<0b10, op11_8, IIC_VMULi32Q, !strconcat(OpcodeStr, "32"), v4i32, v2i32, ShOp>; |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1146 | } |
| 1147 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1148 | // ....then also with element size 64 bits: |
| 1149 | multiclass N3V_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1150 | InstrItinClass itinD, InstrItinClass itinQ, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1151 | string OpcodeStr, SDNode OpNode, bit Commutable = 0> |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1152 | : N3V_QHS<op24, op23, op11_8, op4, itinD, itinD, itinQ, itinQ, |
| 1153 | OpcodeStr, OpNode, Commutable> { |
| 1154 | def v1i64 : N3VD<op24, op23, 0b11, op11_8, op4, itinD, |
| 1155 | !strconcat(OpcodeStr, "64"), v1i64, v1i64, OpNode, Commutable>; |
| 1156 | def v2i64 : N3VQ<op24, op23, 0b11, op11_8, op4, itinQ, |
| 1157 | !strconcat(OpcodeStr, "64"), v2i64, v2i64, OpNode, Commutable>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1158 | } |
| 1159 | |
| 1160 | |
| 1161 | // Neon Narrowing 2-register vector intrinsics, |
| 1162 | // source operand element sizes of 16, 32 and 64 bits: |
| 1163 | multiclass N2VNInt_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1164 | bits<5> op11_7, bit op6, bit op4, |
| 1165 | InstrItinClass itin, string OpcodeStr, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1166 | Intrinsic IntOp> { |
| 1167 | def v8i8 : N2VNInt<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1168 | itin, !strconcat(OpcodeStr, "16"), v8i8, v8i16, IntOp>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1169 | def v4i16 : N2VNInt<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1170 | itin, !strconcat(OpcodeStr, "32"), v4i16, v4i32, IntOp>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1171 | def v2i32 : N2VNInt<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1172 | itin, !strconcat(OpcodeStr, "64"), v2i32, v2i64, IntOp>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1173 | } |
| 1174 | |
| 1175 | |
| 1176 | // Neon Lengthening 2-register vector intrinsic (currently specific to VMOVL). |
| 1177 | // source operand element sizes of 16, 32 and 64 bits: |
| 1178 | multiclass N2VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, |
| 1179 | bit op4, string OpcodeStr, Intrinsic IntOp> { |
| 1180 | def v8i16 : N2VLInt<op24, op23, 0b001000, op11_8, op7, op6, op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1181 | IIC_VQUNAiD, !strconcat(OpcodeStr, "8"), v8i16, v8i8, IntOp>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1182 | def v4i32 : N2VLInt<op24, op23, 0b010000, op11_8, op7, op6, op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1183 | IIC_VQUNAiD, !strconcat(OpcodeStr, "16"), v4i32, v4i16, IntOp>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1184 | def v2i64 : N2VLInt<op24, op23, 0b100000, op11_8, op7, op6, op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1185 | IIC_VQUNAiD, !strconcat(OpcodeStr, "32"), v2i64, v2i32, IntOp>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1186 | } |
| 1187 | |
| 1188 | |
| 1189 | // Neon 3-register vector intrinsics. |
| 1190 | |
| 1191 | // First with only element sizes of 16 and 32 bits: |
| 1192 | multiclass N3VInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1193 | InstrItinClass itinD16, InstrItinClass itinD32, |
| 1194 | InstrItinClass itinQ16, InstrItinClass itinQ32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1195 | string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> { |
| 1196 | // 64-bit vector types. |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1197 | def v4i16 : N3VDInt<op24, op23, 0b01, op11_8, op4, itinD16, !strconcat(OpcodeStr,"16"), |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1198 | v4i16, v4i16, IntOp, Commutable>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1199 | def v2i32 : N3VDInt<op24, op23, 0b10, op11_8, op4, itinD32, !strconcat(OpcodeStr,"32"), |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1200 | v2i32, v2i32, IntOp, Commutable>; |
| 1201 | |
| 1202 | // 128-bit vector types. |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1203 | def v8i16 : N3VQInt<op24, op23, 0b01, op11_8, op4, itinQ16, !strconcat(OpcodeStr,"16"), |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1204 | v8i16, v8i16, IntOp, Commutable>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1205 | def v4i32 : N3VQInt<op24, op23, 0b10, op11_8, op4, itinQ32, !strconcat(OpcodeStr,"32"), |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1206 | v4i32, v4i32, IntOp, Commutable>; |
| 1207 | } |
| 1208 | |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1209 | multiclass N3VIntSL_HS<bits<4> op11_8, |
| 1210 | InstrItinClass itinD16, InstrItinClass itinD32, |
| 1211 | InstrItinClass itinQ16, InstrItinClass itinQ32, |
| 1212 | string OpcodeStr, Intrinsic IntOp> { |
| 1213 | def v4i16 : N3VDIntSL16<0b01, op11_8, itinD16, !strconcat(OpcodeStr, "16"), v4i16, IntOp>; |
| 1214 | def v2i32 : N3VDIntSL<0b10, op11_8, itinD32, !strconcat(OpcodeStr, "32"), v2i32, IntOp>; |
| 1215 | def v8i16 : N3VQIntSL16<0b01, op11_8, itinQ16, !strconcat(OpcodeStr, "16"), v8i16, v4i16, IntOp>; |
| 1216 | def v4i32 : N3VQIntSL<0b10, op11_8, itinQ32, !strconcat(OpcodeStr, "32"), v4i32, v2i32, IntOp>; |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1217 | } |
| 1218 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1219 | // ....then also with element size of 8 bits: |
| 1220 | multiclass N3VInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1221 | InstrItinClass itinD16, InstrItinClass itinD32, |
| 1222 | InstrItinClass itinQ16, InstrItinClass itinQ32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1223 | string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1224 | : N3VInt_HS<op24, op23, op11_8, op4, itinD16, itinD32, itinQ16, itinQ32, |
| 1225 | OpcodeStr, IntOp, Commutable> { |
| 1226 | def v8i8 : N3VDInt<op24, op23, 0b00, op11_8, op4, itinD16, |
| 1227 | !strconcat(OpcodeStr, "8"), v8i8, v8i8, IntOp, Commutable>; |
| 1228 | def v16i8 : N3VQInt<op24, op23, 0b00, op11_8, op4, itinQ16, |
| 1229 | !strconcat(OpcodeStr, "8"), v16i8, v16i8, IntOp, Commutable>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1230 | } |
| 1231 | |
| 1232 | // ....then also with element size of 64 bits: |
| 1233 | multiclass N3VInt_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1234 | InstrItinClass itinD16, InstrItinClass itinD32, |
| 1235 | InstrItinClass itinQ16, InstrItinClass itinQ32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1236 | string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1237 | : N3VInt_QHS<op24, op23, op11_8, op4, itinD16, itinD32, itinQ16, itinQ32, |
| 1238 | OpcodeStr, IntOp, Commutable> { |
| 1239 | def v1i64 : N3VDInt<op24, op23, 0b11, op11_8, op4, itinD32, |
| 1240 | !strconcat(OpcodeStr,"64"), v1i64, v1i64, IntOp, Commutable>; |
| 1241 | def v2i64 : N3VQInt<op24, op23, 0b11, op11_8, op4, itinQ32, |
| 1242 | !strconcat(OpcodeStr,"64"), v2i64, v2i64, IntOp, Commutable>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1243 | } |
| 1244 | |
| 1245 | |
| 1246 | // Neon Narrowing 3-register vector intrinsics, |
| 1247 | // source operand element sizes of 16, 32 and 64 bits: |
| 1248 | multiclass N3VNInt_HSD<bit op24, bit op23, bits<4> op11_8, bit op4, |
| 1249 | string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> { |
| 1250 | def v8i8 : N3VNInt<op24, op23, 0b00, op11_8, op4, !strconcat(OpcodeStr,"16"), |
| 1251 | v8i8, v8i16, IntOp, Commutable>; |
| 1252 | def v4i16 : N3VNInt<op24, op23, 0b01, op11_8, op4, !strconcat(OpcodeStr,"32"), |
| 1253 | v4i16, v4i32, IntOp, Commutable>; |
| 1254 | def v2i32 : N3VNInt<op24, op23, 0b10, op11_8, op4, !strconcat(OpcodeStr,"64"), |
| 1255 | v2i32, v2i64, IntOp, Commutable>; |
| 1256 | } |
| 1257 | |
| 1258 | |
| 1259 | // Neon Long 3-register vector intrinsics. |
| 1260 | |
| 1261 | // First with only element sizes of 16 and 32 bits: |
| 1262 | multiclass N3VLInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1263 | InstrItinClass itin, string OpcodeStr, |
| 1264 | Intrinsic IntOp, bit Commutable = 0> { |
| 1265 | def v4i32 : N3VLInt<op24, op23, 0b01, op11_8, op4, itin, |
| 1266 | !strconcat(OpcodeStr,"16"), v4i32, v4i16, IntOp, Commutable>; |
| 1267 | def v2i64 : N3VLInt<op24, op23, 0b10, op11_8, op4, itin, |
| 1268 | !strconcat(OpcodeStr,"32"), v2i64, v2i32, IntOp, Commutable>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1269 | } |
| 1270 | |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1271 | multiclass N3VLIntSL_HS<bit op24, bits<4> op11_8, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1272 | InstrItinClass itin, string OpcodeStr, Intrinsic IntOp> { |
| 1273 | def v4i16 : N3VLIntSL16<op24, 0b01, op11_8, itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1274 | !strconcat(OpcodeStr, "16"), v4i32, v4i16, IntOp>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1275 | def v2i32 : N3VLIntSL<op24, 0b10, op11_8, itin, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1276 | !strconcat(OpcodeStr, "32"), v2i64, v2i32, IntOp>; |
| 1277 | } |
| 1278 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1279 | // ....then also with element size of 8 bits: |
| 1280 | multiclass N3VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1281 | InstrItinClass itin, string OpcodeStr, |
| 1282 | Intrinsic IntOp, bit Commutable = 0> |
| 1283 | : N3VLInt_HS<op24, op23, op11_8, op4, itin, OpcodeStr, IntOp, Commutable> { |
| 1284 | def v8i16 : N3VLInt<op24, op23, 0b00, op11_8, op4, itin, |
| 1285 | !strconcat(OpcodeStr, "8"), v8i16, v8i8, IntOp, Commutable>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1286 | } |
| 1287 | |
| 1288 | |
| 1289 | // Neon Wide 3-register vector intrinsics, |
| 1290 | // source operand element sizes of 8, 16 and 32 bits: |
| 1291 | multiclass N3VWInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, |
| 1292 | string OpcodeStr, Intrinsic IntOp, bit Commutable = 0> { |
| 1293 | def v8i16 : N3VWInt<op24, op23, 0b00, op11_8, op4, !strconcat(OpcodeStr, "8"), |
| 1294 | v8i16, v8i8, IntOp, Commutable>; |
| 1295 | def v4i32 : N3VWInt<op24, op23, 0b01, op11_8, op4, !strconcat(OpcodeStr,"16"), |
| 1296 | v4i32, v4i16, IntOp, Commutable>; |
| 1297 | def v2i64 : N3VWInt<op24, op23, 0b10, op11_8, op4, !strconcat(OpcodeStr,"32"), |
| 1298 | v2i64, v2i32, IntOp, Commutable>; |
| 1299 | } |
| 1300 | |
| 1301 | |
| 1302 | // Neon Multiply-Op vector operations, |
| 1303 | // element sizes of 8, 16 and 32 bits: |
| 1304 | multiclass N3VMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1305 | InstrItinClass itinD16, InstrItinClass itinD32, |
| 1306 | InstrItinClass itinQ16, InstrItinClass itinQ32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1307 | string OpcodeStr, SDNode OpNode> { |
| 1308 | // 64-bit vector types. |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1309 | def v8i8 : N3VDMulOp<op24, op23, 0b00, op11_8, op4, itinD16, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1310 | !strconcat(OpcodeStr, "8"), v8i8, mul, OpNode>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1311 | def v4i16 : N3VDMulOp<op24, op23, 0b01, op11_8, op4, itinD16, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1312 | !strconcat(OpcodeStr, "16"), v4i16, mul, OpNode>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1313 | def v2i32 : N3VDMulOp<op24, op23, 0b10, op11_8, op4, itinD32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1314 | !strconcat(OpcodeStr, "32"), v2i32, mul, OpNode>; |
| 1315 | |
| 1316 | // 128-bit vector types. |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1317 | def v16i8 : N3VQMulOp<op24, op23, 0b00, op11_8, op4, itinQ16, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1318 | !strconcat(OpcodeStr, "8"), v16i8, mul, OpNode>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1319 | def v8i16 : N3VQMulOp<op24, op23, 0b01, op11_8, op4, itinQ16, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1320 | !strconcat(OpcodeStr, "16"), v8i16, mul, OpNode>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1321 | def v4i32 : N3VQMulOp<op24, op23, 0b10, op11_8, op4, itinQ32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1322 | !strconcat(OpcodeStr, "32"), v4i32, mul, OpNode>; |
| 1323 | } |
| 1324 | |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1325 | multiclass N3VMulOpSL_HS<bits<4> op11_8, |
| 1326 | InstrItinClass itinD16, InstrItinClass itinD32, |
| 1327 | InstrItinClass itinQ16, InstrItinClass itinQ32, |
| 1328 | string OpcodeStr, SDNode ShOp> { |
| 1329 | def v4i16 : N3VDMulOpSL16<0b01, op11_8, itinD16, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1330 | !strconcat(OpcodeStr, "16"), v4i16, mul, ShOp>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1331 | def v2i32 : N3VDMulOpSL<0b10, op11_8, itinD32, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1332 | !strconcat(OpcodeStr, "32"), v2i32, mul, ShOp>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1333 | def v8i16 : N3VQMulOpSL16<0b01, op11_8, itinQ16, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1334 | !strconcat(OpcodeStr, "16"), v8i16, v4i16, mul, ShOp>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1335 | def v4i32 : N3VQMulOpSL<0b10, op11_8, itinQ32, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1336 | !strconcat(OpcodeStr, "32"), v4i32, v2i32, mul, ShOp>; |
| 1337 | } |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1338 | |
| 1339 | // Neon 3-argument intrinsics, |
| 1340 | // element sizes of 8, 16 and 32 bits: |
| 1341 | multiclass N3VInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, |
| 1342 | string OpcodeStr, Intrinsic IntOp> { |
| 1343 | // 64-bit vector types. |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1344 | def v8i8 : N3VDInt3<op24, op23, 0b00, op11_8, op4, IIC_VMACi16D, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1345 | !strconcat(OpcodeStr, "8"), v8i8, v8i8, IntOp>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1346 | def v4i16 : N3VDInt3<op24, op23, 0b01, op11_8, op4, IIC_VMACi16D, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1347 | !strconcat(OpcodeStr, "16"), v4i16, v4i16, IntOp>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1348 | def v2i32 : N3VDInt3<op24, op23, 0b10, op11_8, op4, IIC_VMACi32D, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1349 | !strconcat(OpcodeStr, "32"), v2i32, v2i32, IntOp>; |
| 1350 | |
| 1351 | // 128-bit vector types. |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1352 | def v16i8 : N3VQInt3<op24, op23, 0b00, op11_8, op4, IIC_VMACi16Q, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1353 | !strconcat(OpcodeStr, "8"), v16i8, v16i8, IntOp>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1354 | def v8i16 : N3VQInt3<op24, op23, 0b01, op11_8, op4, IIC_VMACi16Q, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1355 | !strconcat(OpcodeStr, "16"), v8i16, v8i16, IntOp>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1356 | def v4i32 : N3VQInt3<op24, op23, 0b10, op11_8, op4, IIC_VMACi32Q, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1357 | !strconcat(OpcodeStr, "32"), v4i32, v4i32, IntOp>; |
| 1358 | } |
| 1359 | |
| 1360 | |
| 1361 | // Neon Long 3-argument intrinsics. |
| 1362 | |
| 1363 | // First with only element sizes of 16 and 32 bits: |
| 1364 | multiclass N3VLInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4, |
| 1365 | string OpcodeStr, Intrinsic IntOp> { |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1366 | def v4i32 : N3VLInt3<op24, op23, 0b01, op11_8, op4, IIC_VMACi16D, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1367 | !strconcat(OpcodeStr, "16"), v4i32, v4i16, IntOp>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1368 | def v2i64 : N3VLInt3<op24, op23, 0b10, op11_8, op4, IIC_VMACi16D, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1369 | !strconcat(OpcodeStr, "32"), v2i64, v2i32, IntOp>; |
| 1370 | } |
| 1371 | |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1372 | multiclass N3VLInt3SL_HS<bit op24, bits<4> op11_8, |
| 1373 | string OpcodeStr, Intrinsic IntOp> { |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1374 | def v4i16 : N3VLInt3SL16<op24, 0b01, op11_8, IIC_VMACi16D, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1375 | !strconcat(OpcodeStr, "16"), v4i32, v4i16, IntOp>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1376 | def v2i32 : N3VLInt3SL<op24, 0b10, op11_8, IIC_VMACi32D, |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1377 | !strconcat(OpcodeStr, "32"), v2i64, v2i32, IntOp>; |
| 1378 | } |
| 1379 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1380 | // ....then also with element size of 8 bits: |
| 1381 | multiclass N3VLInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, |
| 1382 | string OpcodeStr, Intrinsic IntOp> |
| 1383 | : N3VLInt3_HS<op24, op23, op11_8, op4, OpcodeStr, IntOp> { |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1384 | def v8i16 : N3VLInt3<op24, op23, 0b01, op11_8, op4, IIC_VMACi16D, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1385 | !strconcat(OpcodeStr, "8"), v8i16, v8i8, IntOp>; |
| 1386 | } |
| 1387 | |
| 1388 | |
| 1389 | // Neon 2-register vector intrinsics, |
| 1390 | // element sizes of 8, 16 and 32 bits: |
| 1391 | multiclass N2VInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1392 | bits<5> op11_7, bit op4, |
| 1393 | InstrItinClass itinD, InstrItinClass itinQ, |
| 1394 | string OpcodeStr, Intrinsic IntOp> { |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1395 | // 64-bit vector types. |
| 1396 | def v8i8 : N2VDInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1397 | itinD, !strconcat(OpcodeStr, "8"), v8i8, v8i8, IntOp>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1398 | def v4i16 : N2VDInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1399 | itinD, !strconcat(OpcodeStr, "16"), v4i16, v4i16, IntOp>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1400 | def v2i32 : N2VDInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1401 | itinD, !strconcat(OpcodeStr, "32"), v2i32, v2i32, IntOp>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1402 | |
| 1403 | // 128-bit vector types. |
| 1404 | def v16i8 : N2VQInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1405 | itinQ, !strconcat(OpcodeStr, "8"), v16i8, v16i8, IntOp>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1406 | def v8i16 : N2VQInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1407 | itinQ, !strconcat(OpcodeStr, "16"), v8i16, v8i16, IntOp>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1408 | def v4i32 : N2VQInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1409 | itinQ, !strconcat(OpcodeStr, "32"), v4i32, v4i32, IntOp>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1410 | } |
| 1411 | |
| 1412 | |
| 1413 | // Neon Pairwise long 2-register intrinsics, |
| 1414 | // element sizes of 8, 16 and 32 bits: |
| 1415 | multiclass N2VPLInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16, |
| 1416 | bits<5> op11_7, bit op4, |
| 1417 | string OpcodeStr, Intrinsic IntOp> { |
| 1418 | // 64-bit vector types. |
| 1419 | def v8i8 : N2VDPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4, |
| 1420 | !strconcat(OpcodeStr, "8"), v4i16, v8i8, IntOp>; |
| 1421 | def v4i16 : N2VDPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4, |
| 1422 | !strconcat(OpcodeStr, "16"), v2i32, v4i16, IntOp>; |
| 1423 | def v2i32 : N2VDPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4, |
| 1424 | !strconcat(OpcodeStr, "32"), v1i64, v2i32, IntOp>; |
| 1425 | |
| 1426 | // 128-bit vector types. |
| 1427 | def v16i8 : N2VQPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4, |
| 1428 | !strconcat(OpcodeStr, "8"), v8i16, v16i8, IntOp>; |
| 1429 | def v8i16 : N2VQPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4, |
| 1430 | !strconcat(OpcodeStr, "16"), v4i32, v8i16, IntOp>; |
| 1431 | def v4i32 : N2VQPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4, |
| 1432 | !strconcat(OpcodeStr, "32"), v2i64, v4i32, IntOp>; |
| 1433 | } |
| 1434 | |
| 1435 | |
| 1436 | // Neon Pairwise long 2-register accumulate intrinsics, |
| 1437 | // element sizes of 8, 16 and 32 bits: |
| 1438 | multiclass N2VPLInt2_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16, |
| 1439 | bits<5> op11_7, bit op4, |
| 1440 | string OpcodeStr, Intrinsic IntOp> { |
| 1441 | // 64-bit vector types. |
| 1442 | def v8i8 : N2VDPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4, |
| 1443 | !strconcat(OpcodeStr, "8"), v4i16, v8i8, IntOp>; |
| 1444 | def v4i16 : N2VDPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4, |
| 1445 | !strconcat(OpcodeStr, "16"), v2i32, v4i16, IntOp>; |
| 1446 | def v2i32 : N2VDPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4, |
| 1447 | !strconcat(OpcodeStr, "32"), v1i64, v2i32, IntOp>; |
| 1448 | |
| 1449 | // 128-bit vector types. |
| 1450 | def v16i8 : N2VQPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4, |
| 1451 | !strconcat(OpcodeStr, "8"), v8i16, v16i8, IntOp>; |
| 1452 | def v8i16 : N2VQPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4, |
| 1453 | !strconcat(OpcodeStr, "16"), v4i32, v8i16, IntOp>; |
| 1454 | def v4i32 : N2VQPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4, |
| 1455 | !strconcat(OpcodeStr, "32"), v2i64, v4i32, IntOp>; |
| 1456 | } |
| 1457 | |
| 1458 | |
| 1459 | // Neon 2-register vector shift by immediate, |
| 1460 | // element sizes of 8, 16, 32 and 64 bits: |
| 1461 | multiclass N2VSh_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1462 | InstrItinClass itin, string OpcodeStr, SDNode OpNode> { |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1463 | // 64-bit vector types. |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1464 | def v8i8 : N2VDSh<op24, op23, 0b001000, op11_8, 0, op4, itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1465 | !strconcat(OpcodeStr, "8"), v8i8, OpNode>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1466 | def v4i16 : N2VDSh<op24, op23, 0b010000, op11_8, 0, op4, itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1467 | !strconcat(OpcodeStr, "16"), v4i16, OpNode>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1468 | def v2i32 : N2VDSh<op24, op23, 0b100000, op11_8, 0, op4, itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1469 | !strconcat(OpcodeStr, "32"), v2i32, OpNode>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1470 | def v1i64 : N2VDSh<op24, op23, 0b000000, op11_8, 1, op4, itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1471 | !strconcat(OpcodeStr, "64"), v1i64, OpNode>; |
| 1472 | |
| 1473 | // 128-bit vector types. |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1474 | def v16i8 : N2VQSh<op24, op23, 0b001000, op11_8, 0, op4, itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1475 | !strconcat(OpcodeStr, "8"), v16i8, OpNode>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1476 | def v8i16 : N2VQSh<op24, op23, 0b010000, op11_8, 0, op4, itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1477 | !strconcat(OpcodeStr, "16"), v8i16, OpNode>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1478 | def v4i32 : N2VQSh<op24, op23, 0b100000, op11_8, 0, op4, itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1479 | !strconcat(OpcodeStr, "32"), v4i32, OpNode>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1480 | def v2i64 : N2VQSh<op24, op23, 0b000000, op11_8, 1, op4, itin, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1481 | !strconcat(OpcodeStr, "64"), v2i64, OpNode>; |
| 1482 | } |
| 1483 | |
| 1484 | |
| 1485 | // Neon Shift-Accumulate vector operations, |
| 1486 | // element sizes of 8, 16, 32 and 64 bits: |
| 1487 | multiclass N2VShAdd_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4, |
| 1488 | string OpcodeStr, SDNode ShOp> { |
| 1489 | // 64-bit vector types. |
| 1490 | def v8i8 : N2VDShAdd<op24, op23, 0b001000, op11_8, 0, op4, |
| 1491 | !strconcat(OpcodeStr, "8"), v8i8, ShOp>; |
| 1492 | def v4i16 : N2VDShAdd<op24, op23, 0b010000, op11_8, 0, op4, |
| 1493 | !strconcat(OpcodeStr, "16"), v4i16, ShOp>; |
| 1494 | def v2i32 : N2VDShAdd<op24, op23, 0b100000, op11_8, 0, op4, |
| 1495 | !strconcat(OpcodeStr, "32"), v2i32, ShOp>; |
| 1496 | def v1i64 : N2VDShAdd<op24, op23, 0b000000, op11_8, 1, op4, |
| 1497 | !strconcat(OpcodeStr, "64"), v1i64, ShOp>; |
| 1498 | |
| 1499 | // 128-bit vector types. |
| 1500 | def v16i8 : N2VQShAdd<op24, op23, 0b001000, op11_8, 0, op4, |
| 1501 | !strconcat(OpcodeStr, "8"), v16i8, ShOp>; |
| 1502 | def v8i16 : N2VQShAdd<op24, op23, 0b010000, op11_8, 0, op4, |
| 1503 | !strconcat(OpcodeStr, "16"), v8i16, ShOp>; |
| 1504 | def v4i32 : N2VQShAdd<op24, op23, 0b100000, op11_8, 0, op4, |
| 1505 | !strconcat(OpcodeStr, "32"), v4i32, ShOp>; |
| 1506 | def v2i64 : N2VQShAdd<op24, op23, 0b000000, op11_8, 1, op4, |
| 1507 | !strconcat(OpcodeStr, "64"), v2i64, ShOp>; |
| 1508 | } |
| 1509 | |
| 1510 | |
| 1511 | // Neon Shift-Insert vector operations, |
| 1512 | // element sizes of 8, 16, 32 and 64 bits: |
| 1513 | multiclass N2VShIns_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4, |
| 1514 | string OpcodeStr, SDNode ShOp> { |
| 1515 | // 64-bit vector types. |
| 1516 | def v8i8 : N2VDShIns<op24, op23, 0b001000, op11_8, 0, op4, |
| 1517 | !strconcat(OpcodeStr, "8"), v8i8, ShOp>; |
| 1518 | def v4i16 : N2VDShIns<op24, op23, 0b010000, op11_8, 0, op4, |
| 1519 | !strconcat(OpcodeStr, "16"), v4i16, ShOp>; |
| 1520 | def v2i32 : N2VDShIns<op24, op23, 0b100000, op11_8, 0, op4, |
| 1521 | !strconcat(OpcodeStr, "32"), v2i32, ShOp>; |
| 1522 | def v1i64 : N2VDShIns<op24, op23, 0b000000, op11_8, 1, op4, |
| 1523 | !strconcat(OpcodeStr, "64"), v1i64, ShOp>; |
| 1524 | |
| 1525 | // 128-bit vector types. |
| 1526 | def v16i8 : N2VQShIns<op24, op23, 0b001000, op11_8, 0, op4, |
| 1527 | !strconcat(OpcodeStr, "8"), v16i8, ShOp>; |
| 1528 | def v8i16 : N2VQShIns<op24, op23, 0b010000, op11_8, 0, op4, |
| 1529 | !strconcat(OpcodeStr, "16"), v8i16, ShOp>; |
| 1530 | def v4i32 : N2VQShIns<op24, op23, 0b100000, op11_8, 0, op4, |
| 1531 | !strconcat(OpcodeStr, "32"), v4i32, ShOp>; |
| 1532 | def v2i64 : N2VQShIns<op24, op23, 0b000000, op11_8, 1, op4, |
| 1533 | !strconcat(OpcodeStr, "64"), v2i64, ShOp>; |
| 1534 | } |
| 1535 | |
| 1536 | //===----------------------------------------------------------------------===// |
| 1537 | // Instruction Definitions. |
| 1538 | //===----------------------------------------------------------------------===// |
| 1539 | |
| 1540 | // Vector Add Operations. |
| 1541 | |
| 1542 | // VADD : Vector Add (integer and floating-point) |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1543 | defm VADD : N3V_QHSD<0, 0, 0b1000, 0, IIC_VBINiD, IIC_VBINiQ, "vadd.i", add, 1>; |
| 1544 | def VADDfd : N3VD<0, 0, 0b00, 0b1101, 0, IIC_VBIND, "vadd.f32", v2f32, v2f32, fadd, 1>; |
| 1545 | def VADDfq : N3VQ<0, 0, 0b00, 0b1101, 0, IIC_VBINQ, "vadd.f32", v4f32, v4f32, fadd, 1>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1546 | // VADDL : Vector Add Long (Q = D + D) |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1547 | defm VADDLs : N3VLInt_QHS<0,1,0b0000,0, IIC_VSHLiD, "vaddl.s", int_arm_neon_vaddls, 1>; |
| 1548 | defm VADDLu : N3VLInt_QHS<1,1,0b0000,0, IIC_VSHLiD, "vaddl.u", int_arm_neon_vaddlu, 1>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1549 | // VADDW : Vector Add Wide (Q = Q + D) |
| 1550 | defm VADDWs : N3VWInt_QHS<0,1,0b0001,0, "vaddw.s", int_arm_neon_vaddws, 0>; |
| 1551 | defm VADDWu : N3VWInt_QHS<1,1,0b0001,0, "vaddw.u", int_arm_neon_vaddwu, 0>; |
| 1552 | // VHADD : Vector Halving Add |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1553 | defm VHADDs : N3VInt_QHS<0,0,0b0000,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1554 | IIC_VBINi4Q, "vhadd.s", int_arm_neon_vhadds, 1>; |
| 1555 | defm VHADDu : N3VInt_QHS<1,0,0b0000,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1556 | IIC_VBINi4Q, "vhadd.u", int_arm_neon_vhaddu, 1>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1557 | // VRHADD : Vector Rounding Halving Add |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1558 | defm VRHADDs : N3VInt_QHS<0,0,0b0001,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1559 | IIC_VBINi4Q, "vrhadd.s", int_arm_neon_vrhadds, 1>; |
| 1560 | defm VRHADDu : N3VInt_QHS<1,0,0b0001,0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1561 | IIC_VBINi4Q, "vrhadd.u", int_arm_neon_vrhaddu, 1>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1562 | // VQADD : Vector Saturating Add |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1563 | defm VQADDs : N3VInt_QHSD<0,0,0b0000,1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1564 | IIC_VBINi4Q, "vqadd.s", int_arm_neon_vqadds, 1>; |
| 1565 | defm VQADDu : N3VInt_QHSD<1,0,0b0000,1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1566 | IIC_VBINi4Q, "vqadd.u", int_arm_neon_vqaddu, 1>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1567 | // VADDHN : Vector Add and Narrow Returning High Half (D = Q + Q) |
| 1568 | defm VADDHN : N3VNInt_HSD<0,1,0b0100,0, "vaddhn.i", int_arm_neon_vaddhn, 1>; |
| 1569 | // VRADDHN : Vector Rounding Add and Narrow Returning High Half (D = Q + Q) |
| 1570 | defm VRADDHN : N3VNInt_HSD<1,1,0b0100,0, "vraddhn.i", int_arm_neon_vraddhn, 1>; |
| 1571 | |
| 1572 | // Vector Multiply Operations. |
| 1573 | |
| 1574 | // VMUL : Vector Multiply (integer, polynomial and floating-point) |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1575 | defm VMUL : N3V_QHS<0, 0, 0b1001, 1, IIC_VMULi16D, IIC_VMULi32D, IIC_VMULi16Q, |
| 1576 | IIC_VMULi32Q, "vmul.i", mul, 1>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1577 | def VMULpd : N3VDInt<1, 0, 0b00, 0b1001, 1, IIC_VMULi16D, "vmul.p8", v8i8, v8i8, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1578 | int_arm_neon_vmulp, 1>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1579 | def VMULpq : N3VQInt<1, 0, 0b00, 0b1001, 1, IIC_VMULi16Q, "vmul.p8", v16i8, v16i8, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1580 | int_arm_neon_vmulp, 1>; |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1581 | def VMULfd : N3VD<1, 0, 0b00, 0b1101, 1, IIC_VBIND, "vmul.f32", v2f32, v2f32, fmul, 1>; |
| 1582 | def VMULfq : N3VQ<1, 0, 0b00, 0b1101, 1, IIC_VBINQ, "vmul.f32", v4f32, v4f32, fmul, 1>; |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1583 | defm VMULsl : N3VSL_HS<0b1000, "vmul.i", mul>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1584 | def VMULslfd : N3VDSL<0b10, 0b1001, IIC_VBIND, "vmul.f32", v2f32, fmul>; |
| 1585 | def VMULslfq : N3VQSL<0b10, 0b1001, IIC_VBINQ, "vmul.f32", v4f32, v2f32, fmul>; |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1586 | def : Pat<(v8i16 (mul (v8i16 QPR:$src1), |
| 1587 | (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))), |
| 1588 | (v8i16 (VMULslv8i16 (v8i16 QPR:$src1), |
| 1589 | (v4i16 (EXTRACT_SUBREG QPR:$src2, |
| 1590 | (DSubReg_i16_reg imm:$lane))), |
| 1591 | (SubReg_i16_lane imm:$lane)))>; |
| 1592 | def : Pat<(v4i32 (mul (v4i32 QPR:$src1), |
| 1593 | (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))), |
| 1594 | (v4i32 (VMULslv4i32 (v4i32 QPR:$src1), |
| 1595 | (v2i32 (EXTRACT_SUBREG QPR:$src2, |
| 1596 | (DSubReg_i32_reg imm:$lane))), |
| 1597 | (SubReg_i32_lane imm:$lane)))>; |
| 1598 | def : Pat<(v4f32 (fmul (v4f32 QPR:$src1), |
| 1599 | (v4f32 (NEONvduplane (v4f32 QPR:$src2), imm:$lane)))), |
| 1600 | (v4f32 (VMULslfq (v4f32 QPR:$src1), |
| 1601 | (v2f32 (EXTRACT_SUBREG QPR:$src2, |
| 1602 | (DSubReg_i32_reg imm:$lane))), |
| 1603 | (SubReg_i32_lane imm:$lane)))>; |
| 1604 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1605 | // VQDMULH : Vector Saturating Doubling Multiply Returning High Half |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1606 | defm VQDMULH : N3VInt_HS<0, 0, 0b1011, 0, IIC_VMULi16D, IIC_VMULi32D, |
| 1607 | IIC_VMULi16Q, IIC_VMULi32Q, |
| 1608 | "vqdmulh.s", int_arm_neon_vqdmulh, 1>; |
| 1609 | defm VQDMULHsl: N3VIntSL_HS<0b1100, IIC_VMULi16D, IIC_VMULi32D, |
| 1610 | IIC_VMULi16Q, IIC_VMULi32Q, |
| 1611 | "vqdmulh.s", int_arm_neon_vqdmulh>; |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1612 | def : Pat<(v8i16 (int_arm_neon_vqdmulh (v8i16 QPR:$src1), |
| 1613 | (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))), |
| 1614 | (v8i16 (VQDMULHslv8i16 (v8i16 QPR:$src1), |
| 1615 | (v4i16 (EXTRACT_SUBREG QPR:$src2, |
| 1616 | (DSubReg_i16_reg imm:$lane))), |
| 1617 | (SubReg_i16_lane imm:$lane)))>; |
| 1618 | def : Pat<(v4i32 (int_arm_neon_vqdmulh (v4i32 QPR:$src1), |
| 1619 | (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))), |
| 1620 | (v4i32 (VQDMULHslv4i32 (v4i32 QPR:$src1), |
| 1621 | (v2i32 (EXTRACT_SUBREG QPR:$src2, |
| 1622 | (DSubReg_i32_reg imm:$lane))), |
| 1623 | (SubReg_i32_lane imm:$lane)))>; |
| 1624 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1625 | // VQRDMULH : Vector Rounding Saturating Doubling Multiply Returning High Half |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1626 | defm VQRDMULH : N3VInt_HS<1, 0, 0b1011, 0, IIC_VMULi16D, IIC_VMULi32D, |
| 1627 | IIC_VMULi16Q, IIC_VMULi32Q, |
| 1628 | "vqrdmulh.s", int_arm_neon_vqrdmulh, 1>; |
| 1629 | defm VQRDMULHsl : N3VIntSL_HS<0b1101, IIC_VMULi16D, IIC_VMULi32D, |
| 1630 | IIC_VMULi16Q, IIC_VMULi32Q, |
| 1631 | "vqrdmulh.s", int_arm_neon_vqrdmulh>; |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1632 | def : Pat<(v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$src1), |
| 1633 | (v8i16 (NEONvduplane (v8i16 QPR:$src2), imm:$lane)))), |
| 1634 | (v8i16 (VQRDMULHslv8i16 (v8i16 QPR:$src1), |
| 1635 | (v4i16 (EXTRACT_SUBREG QPR:$src2, |
| 1636 | (DSubReg_i16_reg imm:$lane))), |
| 1637 | (SubReg_i16_lane imm:$lane)))>; |
| 1638 | def : Pat<(v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$src1), |
| 1639 | (v4i32 (NEONvduplane (v4i32 QPR:$src2), imm:$lane)))), |
| 1640 | (v4i32 (VQRDMULHslv4i32 (v4i32 QPR:$src1), |
| 1641 | (v2i32 (EXTRACT_SUBREG QPR:$src2, |
| 1642 | (DSubReg_i32_reg imm:$lane))), |
| 1643 | (SubReg_i32_lane imm:$lane)))>; |
| 1644 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1645 | // VMULL : Vector Multiply Long (integer and polynomial) (Q = D * D) |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1646 | defm VMULLs : N3VLInt_QHS<0,1,0b1100,0, IIC_VMULi16D, "vmull.s", int_arm_neon_vmulls, 1>; |
| 1647 | defm VMULLu : N3VLInt_QHS<1,1,0b1100,0, IIC_VMULi16D, "vmull.u", int_arm_neon_vmullu, 1>; |
| 1648 | def VMULLp : N3VLInt<0, 1, 0b00, 0b1110, 0, IIC_VMULi16D, "vmull.p8", v8i16, v8i8, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1649 | int_arm_neon_vmullp, 1>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1650 | defm VMULLsls : N3VLIntSL_HS<0, 0b1010, IIC_VMULi16D, "vmull.s", int_arm_neon_vmulls>; |
| 1651 | defm VMULLslu : N3VLIntSL_HS<1, 0b1010, IIC_VMULi16D, "vmull.u", int_arm_neon_vmullu>; |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1652 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1653 | // VQDMULL : Vector Saturating Doubling Multiply Long (Q = D * D) |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1654 | defm VQDMULL : N3VLInt_HS<0,1,0b1101,0, IIC_VMULi16D, "vqdmull.s", int_arm_neon_vqdmull, 1>; |
| 1655 | defm VQDMULLsl: N3VLIntSL_HS<0, 0b1011, IIC_VMULi16D, "vqdmull.s", int_arm_neon_vqdmull>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1656 | |
| 1657 | // Vector Multiply-Accumulate and Multiply-Subtract Operations. |
| 1658 | |
| 1659 | // VMLA : Vector Multiply Accumulate (integer and floating-point) |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1660 | defm VMLA : N3VMulOp_QHS<0, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D, |
| 1661 | IIC_VMACi16Q, IIC_VMACi32Q, "vmla.i", add>; |
| 1662 | def VMLAfd : N3VDMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla.f32", v2f32, fmul, fadd>; |
| 1663 | def VMLAfq : N3VQMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACQ, "vmla.f32", v4f32, fmul, fadd>; |
| 1664 | defm VMLAsl : N3VMulOpSL_HS<0b0000, IIC_VMACi16D, IIC_VMACi32D, |
| 1665 | IIC_VMACi16Q, IIC_VMACi32Q, "vmla.i", add>; |
| 1666 | def VMLAslfd : N3VDMulOpSL<0b10, 0b0001, IIC_VMACD, "vmla.f32", v2f32, fmul, fadd>; |
| 1667 | def VMLAslfq : N3VQMulOpSL<0b10, 0b0001, IIC_VMACQ, "vmla.f32", v4f32, v2f32, fmul, fadd>; |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1668 | |
| 1669 | def : Pat<(v8i16 (add (v8i16 QPR:$src1), |
| 1670 | (mul (v8i16 QPR:$src2), |
| 1671 | (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))), |
| 1672 | (v8i16 (VMLAslv8i16 (v8i16 QPR:$src1), |
| 1673 | (v8i16 QPR:$src2), |
| 1674 | (v4i16 (EXTRACT_SUBREG QPR:$src3, |
| 1675 | (DSubReg_i16_reg imm:$lane))), |
| 1676 | (SubReg_i16_lane imm:$lane)))>; |
| 1677 | |
| 1678 | def : Pat<(v4i32 (add (v4i32 QPR:$src1), |
| 1679 | (mul (v4i32 QPR:$src2), |
| 1680 | (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))), |
| 1681 | (v4i32 (VMLAslv4i32 (v4i32 QPR:$src1), |
| 1682 | (v4i32 QPR:$src2), |
| 1683 | (v2i32 (EXTRACT_SUBREG QPR:$src3, |
| 1684 | (DSubReg_i32_reg imm:$lane))), |
| 1685 | (SubReg_i32_lane imm:$lane)))>; |
| 1686 | |
| 1687 | def : Pat<(v4f32 (fadd (v4f32 QPR:$src1), |
| 1688 | (fmul (v4f32 QPR:$src2), |
| 1689 | (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))), |
| 1690 | (v4f32 (VMLAslfq (v4f32 QPR:$src1), |
| 1691 | (v4f32 QPR:$src2), |
| 1692 | (v2f32 (EXTRACT_SUBREG QPR:$src3, |
| 1693 | (DSubReg_i32_reg imm:$lane))), |
| 1694 | (SubReg_i32_lane imm:$lane)))>; |
| 1695 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1696 | // VMLAL : Vector Multiply Accumulate Long (Q += D * D) |
| 1697 | defm VMLALs : N3VLInt3_QHS<0,1,0b1000,0, "vmlal.s", int_arm_neon_vmlals>; |
| 1698 | defm VMLALu : N3VLInt3_QHS<1,1,0b1000,0, "vmlal.u", int_arm_neon_vmlalu>; |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1699 | |
| 1700 | defm VMLALsls : N3VLInt3SL_HS<0, 0b0010, "vmlal.s", int_arm_neon_vmlals>; |
| 1701 | defm VMLALslu : N3VLInt3SL_HS<1, 0b0010, "vmlal.u", int_arm_neon_vmlalu>; |
| 1702 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1703 | // VQDMLAL : Vector Saturating Doubling Multiply Accumulate Long (Q += D * D) |
| 1704 | defm VQDMLAL : N3VLInt3_HS<0, 1, 0b1001, 0, "vqdmlal.s", int_arm_neon_vqdmlal>; |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1705 | defm VQDMLALsl: N3VLInt3SL_HS<0, 0b0011, "vqdmlal.s", int_arm_neon_vqdmlal>; |
| 1706 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1707 | // VMLS : Vector Multiply Subtract (integer and floating-point) |
Bob Wilson | 8f07b9e | 2009-10-03 04:41:21 +0000 | [diff] [blame] | 1708 | defm VMLS : N3VMulOp_QHS<1, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1709 | IIC_VMACi16Q, IIC_VMACi32Q, "vmls.i", sub>; |
| 1710 | def VMLSfd : N3VDMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls.f32", v2f32, fmul, fsub>; |
| 1711 | def VMLSfq : N3VQMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACQ, "vmls.f32", v4f32, fmul, fsub>; |
| 1712 | defm VMLSsl : N3VMulOpSL_HS<0b0100, IIC_VMACi16D, IIC_VMACi32D, |
| 1713 | IIC_VMACi16Q, IIC_VMACi32Q, "vmls.i", sub>; |
| 1714 | def VMLSslfd : N3VDMulOpSL<0b10, 0b0101, IIC_VMACD, "vmls.f32", v2f32, fmul, fsub>; |
| 1715 | def VMLSslfq : N3VQMulOpSL<0b10, 0b0101, IIC_VMACQ, "vmls.f32", v4f32, v2f32, fmul, fsub>; |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1716 | |
| 1717 | def : Pat<(v8i16 (sub (v8i16 QPR:$src1), |
| 1718 | (mul (v8i16 QPR:$src2), |
| 1719 | (v8i16 (NEONvduplane (v8i16 QPR:$src3), imm:$lane))))), |
| 1720 | (v8i16 (VMLSslv8i16 (v8i16 QPR:$src1), |
| 1721 | (v8i16 QPR:$src2), |
| 1722 | (v4i16 (EXTRACT_SUBREG QPR:$src3, |
| 1723 | (DSubReg_i16_reg imm:$lane))), |
| 1724 | (SubReg_i16_lane imm:$lane)))>; |
| 1725 | |
| 1726 | def : Pat<(v4i32 (sub (v4i32 QPR:$src1), |
| 1727 | (mul (v4i32 QPR:$src2), |
| 1728 | (v4i32 (NEONvduplane (v4i32 QPR:$src3), imm:$lane))))), |
| 1729 | (v4i32 (VMLSslv4i32 (v4i32 QPR:$src1), |
| 1730 | (v4i32 QPR:$src2), |
| 1731 | (v2i32 (EXTRACT_SUBREG QPR:$src3, |
| 1732 | (DSubReg_i32_reg imm:$lane))), |
| 1733 | (SubReg_i32_lane imm:$lane)))>; |
| 1734 | |
| 1735 | def : Pat<(v4f32 (fsub (v4f32 QPR:$src1), |
| 1736 | (fmul (v4f32 QPR:$src2), |
| 1737 | (v4f32 (NEONvduplane (v4f32 QPR:$src3), imm:$lane))))), |
| 1738 | (v4f32 (VMLSslfq (v4f32 QPR:$src1), |
| 1739 | (v4f32 QPR:$src2), |
| 1740 | (v2f32 (EXTRACT_SUBREG QPR:$src3, |
| 1741 | (DSubReg_i32_reg imm:$lane))), |
| 1742 | (SubReg_i32_lane imm:$lane)))>; |
| 1743 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1744 | // VMLSL : Vector Multiply Subtract Long (Q -= D * D) |
| 1745 | defm VMLSLs : N3VLInt3_QHS<0,1,0b1010,0, "vmlsl.s", int_arm_neon_vmlsls>; |
| 1746 | defm VMLSLu : N3VLInt3_QHS<1,1,0b1010,0, "vmlsl.u", int_arm_neon_vmlslu>; |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1747 | |
| 1748 | defm VMLSLsls : N3VLInt3SL_HS<0, 0b0110, "vmlsl.s", int_arm_neon_vmlsls>; |
| 1749 | defm VMLSLslu : N3VLInt3SL_HS<1, 0b0110, "vmlsl.u", int_arm_neon_vmlslu>; |
| 1750 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1751 | // VQDMLSL : Vector Saturating Doubling Multiply Subtract Long (Q -= D * D) |
| 1752 | defm VQDMLSL : N3VLInt3_HS<0, 1, 0b1011, 0, "vqdmlsl.s", int_arm_neon_vqdmlsl>; |
Anton Korobeynikov | 6ca0b9e | 2009-09-08 15:22:32 +0000 | [diff] [blame] | 1753 | defm VQDMLSLsl: N3VLInt3SL_HS<0, 0b111, "vqdmlsl.s", int_arm_neon_vqdmlsl>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1754 | |
| 1755 | // Vector Subtract Operations. |
| 1756 | |
| 1757 | // VSUB : Vector Subtract (integer and floating-point) |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1758 | defm VSUB : N3V_QHSD<1, 0, 0b1000, 0, IIC_VSUBiD, IIC_VSUBiQ, "vsub.i", sub, 0>; |
| 1759 | def VSUBfd : N3VD<0, 0, 0b10, 0b1101, 0, IIC_VBIND, "vsub.f32", v2f32, v2f32, fsub, 0>; |
| 1760 | def VSUBfq : N3VQ<0, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vsub.f32", v4f32, v4f32, fsub, 0>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1761 | // VSUBL : Vector Subtract Long (Q = D - D) |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1762 | defm VSUBLs : N3VLInt_QHS<0,1,0b0010,0, IIC_VSHLiD, "vsubl.s", int_arm_neon_vsubls, 1>; |
| 1763 | defm VSUBLu : N3VLInt_QHS<1,1,0b0010,0, IIC_VSHLiD, "vsubl.u", int_arm_neon_vsublu, 1>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1764 | // VSUBW : Vector Subtract Wide (Q = Q - D) |
| 1765 | defm VSUBWs : N3VWInt_QHS<0,1,0b0011,0, "vsubw.s", int_arm_neon_vsubws, 0>; |
| 1766 | defm VSUBWu : N3VWInt_QHS<1,1,0b0011,0, "vsubw.u", int_arm_neon_vsubwu, 0>; |
| 1767 | // VHSUB : Vector Halving Subtract |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1768 | defm VHSUBs : N3VInt_QHS<0, 0, 0b0010, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1769 | IIC_VBINi4Q, "vhsub.s", int_arm_neon_vhsubs, 0>; |
| 1770 | defm VHSUBu : N3VInt_QHS<1, 0, 0b0010, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1771 | IIC_VBINi4Q, "vhsub.u", int_arm_neon_vhsubu, 0>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1772 | // VQSUB : Vector Saturing Subtract |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1773 | defm VQSUBs : N3VInt_QHSD<0, 0, 0b0010, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1774 | IIC_VBINi4Q, "vqsub.s", int_arm_neon_vqsubs, 0>; |
| 1775 | defm VQSUBu : N3VInt_QHSD<1, 0, 0b0010, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1776 | IIC_VBINi4Q, "vqsub.u", int_arm_neon_vqsubu, 0>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1777 | // VSUBHN : Vector Subtract and Narrow Returning High Half (D = Q - Q) |
| 1778 | defm VSUBHN : N3VNInt_HSD<0,1,0b0110,0, "vsubhn.i", int_arm_neon_vsubhn, 0>; |
| 1779 | // VRSUBHN : Vector Rounding Subtract and Narrow Returning High Half (D=Q-Q) |
| 1780 | defm VRSUBHN : N3VNInt_HSD<1,1,0b0110,0, "vrsubhn.i", int_arm_neon_vrsubhn, 0>; |
| 1781 | |
| 1782 | // Vector Comparisons. |
| 1783 | |
| 1784 | // VCEQ : Vector Compare Equal |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1785 | defm VCEQ : N3V_QHS<1, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1786 | IIC_VBINi4Q, "vceq.i", NEONvceq, 1>; |
| 1787 | def VCEQfd : N3VD<0,0,0b00,0b1110,0, IIC_VBIND, "vceq.f32", v2i32, v2f32, NEONvceq, 1>; |
| 1788 | def VCEQfq : N3VQ<0,0,0b00,0b1110,0, IIC_VBINQ, "vceq.f32", v4i32, v4f32, NEONvceq, 1>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1789 | // VCGE : Vector Compare Greater Than or Equal |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1790 | defm VCGEs : N3V_QHS<0, 0, 0b0011, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1791 | IIC_VBINi4Q, "vcge.s", NEONvcge, 0>; |
| 1792 | defm VCGEu : N3V_QHS<1, 0, 0b0011, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1793 | IIC_VBINi4Q, "vcge.u", NEONvcgeu, 0>; |
| 1794 | def VCGEfd : N3VD<1,0,0b00,0b1110,0, IIC_VBIND, "vcge.f32", v2i32, v2f32, NEONvcge, 0>; |
| 1795 | def VCGEfq : N3VQ<1,0,0b00,0b1110,0, IIC_VBINQ, "vcge.f32", v4i32, v4f32, NEONvcge, 0>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1796 | // VCGT : Vector Compare Greater Than |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1797 | defm VCGTs : N3V_QHS<0, 0, 0b0011, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1798 | IIC_VBINi4Q, "vcgt.s", NEONvcgt, 0>; |
| 1799 | defm VCGTu : N3V_QHS<1, 0, 0b0011, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1800 | IIC_VBINi4Q, "vcgt.u", NEONvcgtu, 0>; |
| 1801 | def VCGTfd : N3VD<1,0,0b10,0b1110,0, IIC_VBIND, "vcgt.f32", v2i32, v2f32, NEONvcgt, 0>; |
| 1802 | def VCGTfq : N3VQ<1,0,0b10,0b1110,0, IIC_VBINQ, "vcgt.f32", v4i32, v4f32, NEONvcgt, 0>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1803 | // VACGE : Vector Absolute Compare Greater Than or Equal (aka VCAGE) |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1804 | def VACGEd : N3VDInt<1, 0, 0b00, 0b1110, 1, IIC_VBIND, "vacge.f32", v2i32, v2f32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1805 | int_arm_neon_vacged, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1806 | def VACGEq : N3VQInt<1, 0, 0b00, 0b1110, 1, IIC_VBINQ, "vacge.f32", v4i32, v4f32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1807 | int_arm_neon_vacgeq, 0>; |
| 1808 | // VACGT : Vector Absolute Compare Greater Than (aka VCAGT) |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1809 | def VACGTd : N3VDInt<1, 0, 0b10, 0b1110, 1, IIC_VBIND, "vacgt.f32", v2i32, v2f32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1810 | int_arm_neon_vacgtd, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1811 | def VACGTq : N3VQInt<1, 0, 0b10, 0b1110, 1, IIC_VBINQ, "vacgt.f32", v4i32, v4f32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1812 | int_arm_neon_vacgtq, 0>; |
| 1813 | // VTST : Vector Test Bits |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1814 | defm VTST : N3V_QHS<0, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1815 | IIC_VBINi4Q, "vtst.i", NEONvtst, 1>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1816 | |
| 1817 | // Vector Bitwise Operations. |
| 1818 | |
| 1819 | // VAND : Vector Bitwise AND |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1820 | def VANDd : N3VD<0, 0, 0b00, 0b0001, 1, IIC_VBINiD, "vand", v2i32, v2i32, and, 1>; |
| 1821 | def VANDq : N3VQ<0, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "vand", v4i32, v4i32, and, 1>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1822 | |
| 1823 | // VEOR : Vector Bitwise Exclusive OR |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1824 | def VEORd : N3VD<1, 0, 0b00, 0b0001, 1, IIC_VBINiD, "veor", v2i32, v2i32, xor, 1>; |
| 1825 | def VEORq : N3VQ<1, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "veor", v4i32, v4i32, xor, 1>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1826 | |
| 1827 | // VORR : Vector Bitwise OR |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1828 | def VORRd : N3VD<0, 0, 0b10, 0b0001, 1, IIC_VBINiD, "vorr", v2i32, v2i32, or, 1>; |
| 1829 | def VORRq : N3VQ<0, 0, 0b10, 0b0001, 1, IIC_VBINiQ, "vorr", v4i32, v4i32, or, 1>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1830 | |
| 1831 | // VBIC : Vector Bitwise Bit Clear (AND NOT) |
| 1832 | def VBICd : N3V<0, 0, 0b01, 0b0001, 0, 1, (outs DPR:$dst), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1833 | (ins DPR:$src1, DPR:$src2), IIC_VBINiD, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 1834 | "vbic\t$dst, $src1, $src2", "", |
Anton Korobeynikov | 2ba62ef | 2009-09-08 22:51:43 +0000 | [diff] [blame] | 1835 | [(set DPR:$dst, (v2i32 (and DPR:$src1, |
| 1836 | (vnot_conv DPR:$src2))))]>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1837 | def VBICq : N3V<0, 0, 0b01, 0b0001, 1, 1, (outs QPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1838 | (ins QPR:$src1, QPR:$src2), IIC_VBINiQ, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 1839 | "vbic\t$dst, $src1, $src2", "", |
Anton Korobeynikov | 2ba62ef | 2009-09-08 22:51:43 +0000 | [diff] [blame] | 1840 | [(set QPR:$dst, (v4i32 (and QPR:$src1, |
| 1841 | (vnot_conv QPR:$src2))))]>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1842 | |
| 1843 | // VORN : Vector Bitwise OR NOT |
| 1844 | def VORNd : N3V<0, 0, 0b11, 0b0001, 0, 1, (outs DPR:$dst), |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1845 | (ins DPR:$src1, DPR:$src2), IIC_VBINiD, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 1846 | "vorn\t$dst, $src1, $src2", "", |
Anton Korobeynikov | 2ba62ef | 2009-09-08 22:51:43 +0000 | [diff] [blame] | 1847 | [(set DPR:$dst, (v2i32 (or DPR:$src1, |
| 1848 | (vnot_conv DPR:$src2))))]>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1849 | def VORNq : N3V<0, 0, 0b11, 0b0001, 1, 1, (outs QPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1850 | (ins QPR:$src1, QPR:$src2), IIC_VBINiQ, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 1851 | "vorn\t$dst, $src1, $src2", "", |
Anton Korobeynikov | 2ba62ef | 2009-09-08 22:51:43 +0000 | [diff] [blame] | 1852 | [(set QPR:$dst, (v4i32 (or QPR:$src1, |
| 1853 | (vnot_conv QPR:$src2))))]>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1854 | |
| 1855 | // VMVN : Vector Bitwise NOT |
| 1856 | def VMVNd : N2V<0b11, 0b11, 0b00, 0b00, 0b01011, 0, 0, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1857 | (outs DPR:$dst), (ins DPR:$src), IIC_VSHLiD, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 1858 | "vmvn\t$dst, $src", "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1859 | [(set DPR:$dst, (v2i32 (vnot DPR:$src)))]>; |
| 1860 | def VMVNq : N2V<0b11, 0b11, 0b00, 0b00, 0b01011, 1, 0, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1861 | (outs QPR:$dst), (ins QPR:$src), IIC_VSHLiD, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 1862 | "vmvn\t$dst, $src", "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1863 | [(set QPR:$dst, (v4i32 (vnot QPR:$src)))]>; |
| 1864 | def : Pat<(v2i32 (vnot_conv DPR:$src)), (VMVNd DPR:$src)>; |
| 1865 | def : Pat<(v4i32 (vnot_conv QPR:$src)), (VMVNq QPR:$src)>; |
| 1866 | |
| 1867 | // VBSL : Vector Bitwise Select |
| 1868 | def VBSLd : N3V<1, 0, 0b01, 0b0001, 0, 1, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1869 | (ins DPR:$src1, DPR:$src2, DPR:$src3), IIC_VCNTiD, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1870 | "vbsl\t$dst, $src2, $src3", "$src1 = $dst", |
| 1871 | [(set DPR:$dst, |
| 1872 | (v2i32 (or (and DPR:$src2, DPR:$src1), |
Anton Korobeynikov | 2ba62ef | 2009-09-08 22:51:43 +0000 | [diff] [blame] | 1873 | (and DPR:$src3, (vnot_conv DPR:$src1)))))]>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1874 | def VBSLq : N3V<1, 0, 0b01, 0b0001, 1, 1, (outs QPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1875 | (ins QPR:$src1, QPR:$src2, QPR:$src3), IIC_VCNTiQ, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1876 | "vbsl\t$dst, $src2, $src3", "$src1 = $dst", |
| 1877 | [(set QPR:$dst, |
| 1878 | (v4i32 (or (and QPR:$src2, QPR:$src1), |
Anton Korobeynikov | 2ba62ef | 2009-09-08 22:51:43 +0000 | [diff] [blame] | 1879 | (and QPR:$src3, (vnot_conv QPR:$src1)))))]>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1880 | |
| 1881 | // VBIF : Vector Bitwise Insert if False |
| 1882 | // like VBSL but with: "vbif\t$dst, $src3, $src1", "$src2 = $dst", |
| 1883 | // VBIT : Vector Bitwise Insert if True |
| 1884 | // like VBSL but with: "vbit\t$dst, $src2, $src1", "$src3 = $dst", |
| 1885 | // These are not yet implemented. The TwoAddress pass will not go looking |
| 1886 | // for equivalent operations with different register constraints; it just |
| 1887 | // inserts copies. |
| 1888 | |
| 1889 | // Vector Absolute Differences. |
| 1890 | |
| 1891 | // VABD : Vector Absolute Difference |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1892 | defm VABDs : N3VInt_QHS<0, 0, 0b0111, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1893 | IIC_VBINi4Q, "vabd.s", int_arm_neon_vabds, 0>; |
| 1894 | defm VABDu : N3VInt_QHS<1, 0, 0b0111, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1895 | IIC_VBINi4Q, "vabd.u", int_arm_neon_vabdu, 0>; |
| 1896 | def VABDfd : N3VDInt<1, 0, 0b10, 0b1101, 0, IIC_VBIND, "vabd.f32", v2f32, v2f32, |
Bob Wilson | b0abb4d | 2009-08-11 05:39:44 +0000 | [diff] [blame] | 1897 | int_arm_neon_vabds, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1898 | def VABDfq : N3VQInt<1, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vabd.f32", v4f32, v4f32, |
Bob Wilson | b0abb4d | 2009-08-11 05:39:44 +0000 | [diff] [blame] | 1899 | int_arm_neon_vabds, 0>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1900 | |
| 1901 | // VABDL : Vector Absolute Difference Long (Q = | D - D |) |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1902 | defm VABDLs : N3VLInt_QHS<0,1,0b0111,0, IIC_VBINi4Q, "vabdl.s", int_arm_neon_vabdls, 0>; |
| 1903 | defm VABDLu : N3VLInt_QHS<1,1,0b0111,0, IIC_VBINi4Q, "vabdl.u", int_arm_neon_vabdlu, 0>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1904 | |
| 1905 | // VABA : Vector Absolute Difference and Accumulate |
| 1906 | defm VABAs : N3VInt3_QHS<0,1,0b0101,0, "vaba.s", int_arm_neon_vabas>; |
| 1907 | defm VABAu : N3VInt3_QHS<1,1,0b0101,0, "vaba.u", int_arm_neon_vabau>; |
| 1908 | |
| 1909 | // VABAL : Vector Absolute Difference and Accumulate Long (Q += | D - D |) |
| 1910 | defm VABALs : N3VLInt3_QHS<0,1,0b0101,0, "vabal.s", int_arm_neon_vabals>; |
| 1911 | defm VABALu : N3VLInt3_QHS<1,1,0b0101,0, "vabal.u", int_arm_neon_vabalu>; |
| 1912 | |
| 1913 | // Vector Maximum and Minimum. |
| 1914 | |
| 1915 | // VMAX : Vector Maximum |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1916 | defm VMAXs : N3VInt_QHS<0, 0, 0b0110, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1917 | IIC_VBINi4Q, "vmax.s", int_arm_neon_vmaxs, 1>; |
| 1918 | defm VMAXu : N3VInt_QHS<1, 0, 0b0110, 0, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1919 | IIC_VBINi4Q, "vmax.u", int_arm_neon_vmaxu, 1>; |
| 1920 | def VMAXfd : N3VDInt<0, 0, 0b00, 0b1111, 0, IIC_VBIND, "vmax.f32", v2f32, v2f32, |
Bob Wilson | b0abb4d | 2009-08-11 05:39:44 +0000 | [diff] [blame] | 1921 | int_arm_neon_vmaxs, 1>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1922 | def VMAXfq : N3VQInt<0, 0, 0b00, 0b1111, 0, IIC_VBINQ, "vmax.f32", v4f32, v4f32, |
Bob Wilson | b0abb4d | 2009-08-11 05:39:44 +0000 | [diff] [blame] | 1923 | int_arm_neon_vmaxs, 1>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1924 | |
| 1925 | // VMIN : Vector Minimum |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1926 | defm VMINs : N3VInt_QHS<0, 0, 0b0110, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1927 | IIC_VBINi4Q, "vmin.s", int_arm_neon_vmins, 1>; |
| 1928 | defm VMINu : N3VInt_QHS<1, 0, 0b0110, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, |
| 1929 | IIC_VBINi4Q, "vmin.u", int_arm_neon_vminu, 1>; |
| 1930 | def VMINfd : N3VDInt<0, 0, 0b10, 0b1111, 0, IIC_VBIND, "vmin.f32", v2f32, v2f32, |
Bob Wilson | b0abb4d | 2009-08-11 05:39:44 +0000 | [diff] [blame] | 1931 | int_arm_neon_vmins, 1>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1932 | def VMINfq : N3VQInt<0, 0, 0b10, 0b1111, 0, IIC_VBINQ, "vmin.f32", v4f32, v4f32, |
Bob Wilson | b0abb4d | 2009-08-11 05:39:44 +0000 | [diff] [blame] | 1933 | int_arm_neon_vmins, 1>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1934 | |
| 1935 | // Vector Pairwise Operations. |
| 1936 | |
| 1937 | // VPADD : Vector Pairwise Add |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1938 | def VPADDi8 : N3VDInt<0, 0, 0b00, 0b1011, 1, IIC_VBINiD, "vpadd.i8", v8i8, v8i8, |
Bob Wilson | f24bd40 | 2009-08-11 01:15:26 +0000 | [diff] [blame] | 1939 | int_arm_neon_vpadd, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1940 | def VPADDi16 : N3VDInt<0, 0, 0b01, 0b1011, 1, IIC_VBINiD, "vpadd.i16", v4i16, v4i16, |
Bob Wilson | f24bd40 | 2009-08-11 01:15:26 +0000 | [diff] [blame] | 1941 | int_arm_neon_vpadd, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1942 | def VPADDi32 : N3VDInt<0, 0, 0b10, 0b1011, 1, IIC_VBINiD, "vpadd.i32", v2i32, v2i32, |
Bob Wilson | f24bd40 | 2009-08-11 01:15:26 +0000 | [diff] [blame] | 1943 | int_arm_neon_vpadd, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1944 | def VPADDf : N3VDInt<1, 0, 0b00, 0b1101, 0, IIC_VBIND, "vpadd.f32", v2f32, v2f32, |
Bob Wilson | f24bd40 | 2009-08-11 01:15:26 +0000 | [diff] [blame] | 1945 | int_arm_neon_vpadd, 0>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1946 | |
| 1947 | // VPADDL : Vector Pairwise Add Long |
| 1948 | defm VPADDLs : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpaddl.s", |
| 1949 | int_arm_neon_vpaddls>; |
| 1950 | defm VPADDLu : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpaddl.u", |
| 1951 | int_arm_neon_vpaddlu>; |
| 1952 | |
| 1953 | // VPADAL : Vector Pairwise Add and Accumulate Long |
| 1954 | defm VPADALs : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpadal.s", |
| 1955 | int_arm_neon_vpadals>; |
| 1956 | defm VPADALu : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpadal.u", |
| 1957 | int_arm_neon_vpadalu>; |
| 1958 | |
| 1959 | // VPMAX : Vector Pairwise Maximum |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1960 | def VPMAXs8 : N3VDInt<0, 0, 0b00, 0b1010, 0, IIC_VBINi4D, "vpmax.s8", v8i8, v8i8, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1961 | int_arm_neon_vpmaxs, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1962 | def VPMAXs16 : N3VDInt<0, 0, 0b01, 0b1010, 0, IIC_VBINi4D, "vpmax.s16", v4i16, v4i16, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1963 | int_arm_neon_vpmaxs, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1964 | def VPMAXs32 : N3VDInt<0, 0, 0b10, 0b1010, 0, IIC_VBINi4D, "vpmax.s32", v2i32, v2i32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1965 | int_arm_neon_vpmaxs, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1966 | def VPMAXu8 : N3VDInt<1, 0, 0b00, 0b1010, 0, IIC_VBINi4D, "vpmax.u8", v8i8, v8i8, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1967 | int_arm_neon_vpmaxu, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1968 | def VPMAXu16 : N3VDInt<1, 0, 0b01, 0b1010, 0, IIC_VBINi4D, "vpmax.u16", v4i16, v4i16, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1969 | int_arm_neon_vpmaxu, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1970 | def VPMAXu32 : N3VDInt<1, 0, 0b10, 0b1010, 0, IIC_VBINi4D, "vpmax.u32", v2i32, v2i32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1971 | int_arm_neon_vpmaxu, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1972 | def VPMAXf : N3VDInt<1, 0, 0b00, 0b1111, 0, IIC_VBINi4D, "vpmax.f32", v2f32, v2f32, |
Bob Wilson | b0abb4d | 2009-08-11 05:39:44 +0000 | [diff] [blame] | 1973 | int_arm_neon_vpmaxs, 0>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1974 | |
| 1975 | // VPMIN : Vector Pairwise Minimum |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1976 | def VPMINs8 : N3VDInt<0, 0, 0b00, 0b1010, 1, IIC_VBINi4D, "vpmin.s8", v8i8, v8i8, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1977 | int_arm_neon_vpmins, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1978 | def VPMINs16 : N3VDInt<0, 0, 0b01, 0b1010, 1, IIC_VBINi4D, "vpmin.s16", v4i16, v4i16, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1979 | int_arm_neon_vpmins, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1980 | def VPMINs32 : N3VDInt<0, 0, 0b10, 0b1010, 1, IIC_VBINi4D, "vpmin.s32", v2i32, v2i32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1981 | int_arm_neon_vpmins, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1982 | def VPMINu8 : N3VDInt<1, 0, 0b00, 0b1010, 1, IIC_VBINi4D, "vpmin.u8", v8i8, v8i8, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1983 | int_arm_neon_vpminu, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1984 | def VPMINu16 : N3VDInt<1, 0, 0b01, 0b1010, 1, IIC_VBINi4D, "vpmin.u16", v4i16, v4i16, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1985 | int_arm_neon_vpminu, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1986 | def VPMINu32 : N3VDInt<1, 0, 0b10, 0b1010, 1, IIC_VBINi4D, "vpmin.u32", v2i32, v2i32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1987 | int_arm_neon_vpminu, 0>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 1988 | def VPMINf : N3VDInt<1, 0, 0b10, 0b1111, 0, IIC_VBINi4D, "vpmin.f32", v2f32, v2f32, |
Bob Wilson | b0abb4d | 2009-08-11 05:39:44 +0000 | [diff] [blame] | 1989 | int_arm_neon_vpmins, 0>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1990 | |
| 1991 | // Vector Reciprocal and Reciprocal Square Root Estimate and Step. |
| 1992 | |
| 1993 | // VRECPE : Vector Reciprocal Estimate |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1994 | def VRECPEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0, |
| 1995 | IIC_VUNAD, "vrecpe.u32", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1996 | v2i32, v2i32, int_arm_neon_vrecpe>; |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 1997 | def VRECPEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0, |
| 1998 | IIC_VUNAQ, "vrecpe.u32", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 1999 | v4i32, v4i32, int_arm_neon_vrecpe>; |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2000 | def VRECPEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0, |
| 2001 | IIC_VUNAD, "vrecpe.f32", |
Bob Wilson | b0abb4d | 2009-08-11 05:39:44 +0000 | [diff] [blame] | 2002 | v2f32, v2f32, int_arm_neon_vrecpe>; |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2003 | def VRECPEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0, |
| 2004 | IIC_VUNAQ, "vrecpe.f32", |
Bob Wilson | b0abb4d | 2009-08-11 05:39:44 +0000 | [diff] [blame] | 2005 | v4f32, v4f32, int_arm_neon_vrecpe>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2006 | |
| 2007 | // VRECPS : Vector Reciprocal Step |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2008 | def VRECPSfd : N3VDInt<0, 0, 0b00, 0b1111, 1, IIC_VRECSD, "vrecps.f32", v2f32, v2f32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2009 | int_arm_neon_vrecps, 1>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2010 | def VRECPSfq : N3VQInt<0, 0, 0b00, 0b1111, 1, IIC_VRECSQ, "vrecps.f32", v4f32, v4f32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2011 | int_arm_neon_vrecps, 1>; |
| 2012 | |
| 2013 | // VRSQRTE : Vector Reciprocal Square Root Estimate |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2014 | def VRSQRTEd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0, |
| 2015 | IIC_VUNAD, "vrsqrte.u32", |
| 2016 | v2i32, v2i32, int_arm_neon_vrsqrte>; |
| 2017 | def VRSQRTEq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0, |
| 2018 | IIC_VUNAQ, "vrsqrte.u32", |
| 2019 | v4i32, v4i32, int_arm_neon_vrsqrte>; |
| 2020 | def VRSQRTEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0, |
| 2021 | IIC_VUNAD, "vrsqrte.f32", |
| 2022 | v2f32, v2f32, int_arm_neon_vrsqrte>; |
| 2023 | def VRSQRTEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0, |
| 2024 | IIC_VUNAQ, "vrsqrte.f32", |
| 2025 | v4f32, v4f32, int_arm_neon_vrsqrte>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2026 | |
| 2027 | // VRSQRTS : Vector Reciprocal Square Root Step |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2028 | def VRSQRTSfd : N3VDInt<0, 0, 0b10, 0b1111, 1, IIC_VRECSD, "vrsqrts.f32", v2f32, v2f32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2029 | int_arm_neon_vrsqrts, 1>; |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2030 | def VRSQRTSfq : N3VQInt<0, 0, 0b10, 0b1111, 1, IIC_VRECSQ, "vrsqrts.f32", v4f32, v4f32, |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2031 | int_arm_neon_vrsqrts, 1>; |
| 2032 | |
| 2033 | // Vector Shifts. |
| 2034 | |
| 2035 | // VSHL : Vector Shift |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2036 | defm VSHLs : N3VInt_QHSD<0, 0, 0b0100, 0, IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, |
| 2037 | IIC_VSHLiQ, "vshl.s", int_arm_neon_vshifts, 0>; |
| 2038 | defm VSHLu : N3VInt_QHSD<1, 0, 0b0100, 0, IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, |
| 2039 | IIC_VSHLiQ, "vshl.u", int_arm_neon_vshiftu, 0>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2040 | // VSHL : Vector Shift Left (Immediate) |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2041 | defm VSHLi : N2VSh_QHSD<0, 1, 0b0111, 1, IIC_VSHLiD, "vshl.i", NEONvshl>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2042 | // VSHR : Vector Shift Right (Immediate) |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2043 | defm VSHRs : N2VSh_QHSD<0, 1, 0b0000, 1, IIC_VSHLiD, "vshr.s", NEONvshrs>; |
| 2044 | defm VSHRu : N2VSh_QHSD<1, 1, 0b0000, 1, IIC_VSHLiD, "vshr.u", NEONvshru>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2045 | |
| 2046 | // VSHLL : Vector Shift Left Long |
| 2047 | def VSHLLs8 : N2VLSh<0, 1, 0b001000, 0b1010, 0, 0, 1, "vshll.s8", |
| 2048 | v8i16, v8i8, NEONvshlls>; |
| 2049 | def VSHLLs16 : N2VLSh<0, 1, 0b010000, 0b1010, 0, 0, 1, "vshll.s16", |
| 2050 | v4i32, v4i16, NEONvshlls>; |
| 2051 | def VSHLLs32 : N2VLSh<0, 1, 0b100000, 0b1010, 0, 0, 1, "vshll.s32", |
| 2052 | v2i64, v2i32, NEONvshlls>; |
| 2053 | def VSHLLu8 : N2VLSh<1, 1, 0b001000, 0b1010, 0, 0, 1, "vshll.u8", |
| 2054 | v8i16, v8i8, NEONvshllu>; |
| 2055 | def VSHLLu16 : N2VLSh<1, 1, 0b010000, 0b1010, 0, 0, 1, "vshll.u16", |
| 2056 | v4i32, v4i16, NEONvshllu>; |
| 2057 | def VSHLLu32 : N2VLSh<1, 1, 0b100000, 0b1010, 0, 0, 1, "vshll.u32", |
| 2058 | v2i64, v2i32, NEONvshllu>; |
| 2059 | |
| 2060 | // VSHLL : Vector Shift Left Long (with maximum shift count) |
| 2061 | def VSHLLi8 : N2VLSh<1, 1, 0b110010, 0b0011, 0, 0, 0, "vshll.i8", |
| 2062 | v8i16, v8i8, NEONvshlli>; |
| 2063 | def VSHLLi16 : N2VLSh<1, 1, 0b110110, 0b0011, 0, 0, 0, "vshll.i16", |
| 2064 | v4i32, v4i16, NEONvshlli>; |
| 2065 | def VSHLLi32 : N2VLSh<1, 1, 0b111010, 0b0011, 0, 0, 0, "vshll.i32", |
| 2066 | v2i64, v2i32, NEONvshlli>; |
| 2067 | |
| 2068 | // VSHRN : Vector Shift Right and Narrow |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2069 | def VSHRN16 : N2VNSh<0, 1, 0b001000, 0b1000, 0, 0, 1, |
| 2070 | IIC_VSHLiD, "vshrn.i16", v8i8, v8i16, NEONvshrn>; |
| 2071 | def VSHRN32 : N2VNSh<0, 1, 0b010000, 0b1000, 0, 0, 1, |
| 2072 | IIC_VSHLiD, "vshrn.i32", v4i16, v4i32, NEONvshrn>; |
| 2073 | def VSHRN64 : N2VNSh<0, 1, 0b100000, 0b1000, 0, 0, 1, |
| 2074 | IIC_VSHLiD, "vshrn.i64", v2i32, v2i64, NEONvshrn>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2075 | |
| 2076 | // VRSHL : Vector Rounding Shift |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2077 | defm VRSHLs : N3VInt_QHSD<0,0,0b0101,0, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, |
| 2078 | IIC_VSHLi4Q, "vrshl.s", int_arm_neon_vrshifts, 0>; |
| 2079 | defm VRSHLu : N3VInt_QHSD<1,0,0b0101,0, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, |
| 2080 | IIC_VSHLi4Q, "vrshl.u", int_arm_neon_vrshiftu, 0>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2081 | // VRSHR : Vector Rounding Shift Right |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2082 | defm VRSHRs : N2VSh_QHSD<0, 1, 0b0010, 1, IIC_VSHLi4D, "vrshr.s", NEONvrshrs>; |
| 2083 | defm VRSHRu : N2VSh_QHSD<1, 1, 0b0010, 1, IIC_VSHLi4D, "vrshr.u", NEONvrshru>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2084 | |
| 2085 | // VRSHRN : Vector Rounding Shift Right and Narrow |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2086 | def VRSHRN16 : N2VNSh<0, 1, 0b001000, 0b1000, 0, 1, 1, |
| 2087 | IIC_VSHLi4D, "vrshrn.i16", v8i8, v8i16, NEONvrshrn>; |
| 2088 | def VRSHRN32 : N2VNSh<0, 1, 0b010000, 0b1000, 0, 1, 1, |
| 2089 | IIC_VSHLi4D, "vrshrn.i32", v4i16, v4i32, NEONvrshrn>; |
| 2090 | def VRSHRN64 : N2VNSh<0, 1, 0b100000, 0b1000, 0, 1, 1, |
| 2091 | IIC_VSHLi4D, "vrshrn.i64", v2i32, v2i64, NEONvrshrn>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2092 | |
| 2093 | // VQSHL : Vector Saturating Shift |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2094 | defm VQSHLs : N3VInt_QHSD<0,0,0b0100,1, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, |
| 2095 | IIC_VSHLi4Q, "vqshl.s", int_arm_neon_vqshifts, 0>; |
| 2096 | defm VQSHLu : N3VInt_QHSD<1,0,0b0100,1, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, |
| 2097 | IIC_VSHLi4Q, "vqshl.u", int_arm_neon_vqshiftu, 0>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2098 | // VQSHL : Vector Saturating Shift Left (Immediate) |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2099 | defm VQSHLsi : N2VSh_QHSD<0, 1, 0b0111, 1, IIC_VSHLi4D, "vqshl.s", NEONvqshls>; |
| 2100 | defm VQSHLui : N2VSh_QHSD<1, 1, 0b0111, 1, IIC_VSHLi4D, "vqshl.u", NEONvqshlu>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2101 | // VQSHLU : Vector Saturating Shift Left (Immediate, Unsigned) |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2102 | defm VQSHLsu : N2VSh_QHSD<1, 1, 0b0110, 1, IIC_VSHLi4D, "vqshlu.s", NEONvqshlsu>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2103 | |
| 2104 | // VQSHRN : Vector Saturating Shift Right and Narrow |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2105 | def VQSHRNs16 : N2VNSh<0, 1, 0b001000, 0b1001, 0, 0, 1, |
| 2106 | IIC_VSHLi4D, "vqshrn.s16", v8i8, v8i16, NEONvqshrns>; |
| 2107 | def VQSHRNs32 : N2VNSh<0, 1, 0b010000, 0b1001, 0, 0, 1, |
| 2108 | IIC_VSHLi4D, "vqshrn.s32", v4i16, v4i32, NEONvqshrns>; |
| 2109 | def VQSHRNs64 : N2VNSh<0, 1, 0b100000, 0b1001, 0, 0, 1, |
| 2110 | IIC_VSHLi4D, "vqshrn.s64", v2i32, v2i64, NEONvqshrns>; |
| 2111 | def VQSHRNu16 : N2VNSh<1, 1, 0b001000, 0b1001, 0, 0, 1, |
| 2112 | IIC_VSHLi4D, "vqshrn.u16", v8i8, v8i16, NEONvqshrnu>; |
| 2113 | def VQSHRNu32 : N2VNSh<1, 1, 0b010000, 0b1001, 0, 0, 1, |
| 2114 | IIC_VSHLi4D, "vqshrn.u32", v4i16, v4i32, NEONvqshrnu>; |
| 2115 | def VQSHRNu64 : N2VNSh<1, 1, 0b100000, 0b1001, 0, 0, 1, |
| 2116 | IIC_VSHLi4D, "vqshrn.u64", v2i32, v2i64, NEONvqshrnu>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2117 | |
| 2118 | // VQSHRUN : Vector Saturating Shift Right and Narrow (Unsigned) |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2119 | def VQSHRUN16 : N2VNSh<1, 1, 0b001000, 0b1000, 0, 0, 1, |
| 2120 | IIC_VSHLi4D, "vqshrun.s16", v8i8, v8i16, NEONvqshrnsu>; |
| 2121 | def VQSHRUN32 : N2VNSh<1, 1, 0b010000, 0b1000, 0, 0, 1, |
| 2122 | IIC_VSHLi4D, "vqshrun.s32", v4i16, v4i32, NEONvqshrnsu>; |
| 2123 | def VQSHRUN64 : N2VNSh<1, 1, 0b100000, 0b1000, 0, 0, 1, |
| 2124 | IIC_VSHLi4D, "vqshrun.s64", v2i32, v2i64, NEONvqshrnsu>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2125 | |
| 2126 | // VQRSHL : Vector Saturating Rounding Shift |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2127 | defm VQRSHLs : N3VInt_QHSD<0, 0, 0b0101, 1, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, |
| 2128 | IIC_VSHLi4Q, "vqrshl.s", int_arm_neon_vqrshifts, 0>; |
| 2129 | defm VQRSHLu : N3VInt_QHSD<1, 0, 0b0101, 1, IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, |
| 2130 | IIC_VSHLi4Q, "vqrshl.u", int_arm_neon_vqrshiftu, 0>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2131 | |
| 2132 | // VQRSHRN : Vector Saturating Rounding Shift Right and Narrow |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2133 | def VQRSHRNs16: N2VNSh<0, 1, 0b001000, 0b1001, 0, 1, 1, |
| 2134 | IIC_VSHLi4D, "vqrshrn.s16", v8i8, v8i16, NEONvqrshrns>; |
| 2135 | def VQRSHRNs32: N2VNSh<0, 1, 0b010000, 0b1001, 0, 1, 1, |
| 2136 | IIC_VSHLi4D, "vqrshrn.s32", v4i16, v4i32, NEONvqrshrns>; |
| 2137 | def VQRSHRNs64: N2VNSh<0, 1, 0b100000, 0b1001, 0, 1, 1, |
| 2138 | IIC_VSHLi4D, "vqrshrn.s64", v2i32, v2i64, NEONvqrshrns>; |
| 2139 | def VQRSHRNu16: N2VNSh<1, 1, 0b001000, 0b1001, 0, 1, 1, |
| 2140 | IIC_VSHLi4D, "vqrshrn.u16", v8i8, v8i16, NEONvqrshrnu>; |
| 2141 | def VQRSHRNu32: N2VNSh<1, 1, 0b010000, 0b1001, 0, 1, 1, |
| 2142 | IIC_VSHLi4D, "vqrshrn.u32", v4i16, v4i32, NEONvqrshrnu>; |
| 2143 | def VQRSHRNu64: N2VNSh<1, 1, 0b100000, 0b1001, 0, 1, 1, |
| 2144 | IIC_VSHLi4D, "vqrshrn.u64", v2i32, v2i64, NEONvqrshrnu>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2145 | |
| 2146 | // VQRSHRUN : Vector Saturating Rounding Shift Right and Narrow (Unsigned) |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2147 | def VQRSHRUN16: N2VNSh<1, 1, 0b001000, 0b1000, 0, 1, 1, |
| 2148 | IIC_VSHLi4D, "vqrshrun.s16", v8i8, v8i16, NEONvqrshrnsu>; |
| 2149 | def VQRSHRUN32: N2VNSh<1, 1, 0b010000, 0b1000, 0, 1, 1, |
| 2150 | IIC_VSHLi4D, "vqrshrun.s32", v4i16, v4i32, NEONvqrshrnsu>; |
| 2151 | def VQRSHRUN64: N2VNSh<1, 1, 0b100000, 0b1000, 0, 1, 1, |
| 2152 | IIC_VSHLi4D, "vqrshrun.s64", v2i32, v2i64, NEONvqrshrnsu>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2153 | |
| 2154 | // VSRA : Vector Shift Right and Accumulate |
| 2155 | defm VSRAs : N2VShAdd_QHSD<0, 1, 0b0001, 1, "vsra.s", NEONvshrs>; |
| 2156 | defm VSRAu : N2VShAdd_QHSD<1, 1, 0b0001, 1, "vsra.u", NEONvshru>; |
| 2157 | // VRSRA : Vector Rounding Shift Right and Accumulate |
| 2158 | defm VRSRAs : N2VShAdd_QHSD<0, 1, 0b0011, 1, "vrsra.s", NEONvrshrs>; |
| 2159 | defm VRSRAu : N2VShAdd_QHSD<1, 1, 0b0011, 1, "vrsra.u", NEONvrshru>; |
| 2160 | |
| 2161 | // VSLI : Vector Shift Left and Insert |
| 2162 | defm VSLI : N2VShIns_QHSD<1, 1, 0b0101, 1, "vsli.", NEONvsli>; |
| 2163 | // VSRI : Vector Shift Right and Insert |
| 2164 | defm VSRI : N2VShIns_QHSD<1, 1, 0b0100, 1, "vsri.", NEONvsri>; |
| 2165 | |
| 2166 | // Vector Absolute and Saturating Absolute. |
| 2167 | |
| 2168 | // VABS : Vector Absolute Value |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2169 | defm VABS : N2VInt_QHS<0b11, 0b11, 0b01, 0b00110, 0, |
| 2170 | IIC_VUNAiD, IIC_VUNAiQ, "vabs.s", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2171 | int_arm_neon_vabs>; |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2172 | def VABSfd : N2VDInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0, |
| 2173 | IIC_VUNAD, "vabs.f32", |
Bob Wilson | b0abb4d | 2009-08-11 05:39:44 +0000 | [diff] [blame] | 2174 | v2f32, v2f32, int_arm_neon_vabs>; |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2175 | def VABSfq : N2VQInt<0b11, 0b11, 0b10, 0b01, 0b01110, 0, |
| 2176 | IIC_VUNAQ, "vabs.f32", |
Bob Wilson | b0abb4d | 2009-08-11 05:39:44 +0000 | [diff] [blame] | 2177 | v4f32, v4f32, int_arm_neon_vabs>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2178 | |
| 2179 | // VQABS : Vector Saturating Absolute Value |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2180 | defm VQABS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01110, 0, |
| 2181 | IIC_VQUNAiD, IIC_VQUNAiQ, "vqabs.s", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2182 | int_arm_neon_vqabs>; |
| 2183 | |
| 2184 | // Vector Negate. |
| 2185 | |
| 2186 | def vneg : PatFrag<(ops node:$in), (sub immAllZerosV, node:$in)>; |
| 2187 | def vneg_conv : PatFrag<(ops node:$in), (sub immAllZerosV_bc, node:$in)>; |
| 2188 | |
| 2189 | class VNEGD<bits<2> size, string OpcodeStr, ValueType Ty> |
| 2190 | : N2V<0b11, 0b11, size, 0b01, 0b00111, 0, 0, (outs DPR:$dst), (ins DPR:$src), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2191 | IIC_VSHLiD, !strconcat(OpcodeStr, "\t$dst, $src"), "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2192 | [(set DPR:$dst, (Ty (vneg DPR:$src)))]>; |
| 2193 | class VNEGQ<bits<2> size, string OpcodeStr, ValueType Ty> |
| 2194 | : N2V<0b11, 0b11, size, 0b01, 0b00111, 1, 0, (outs QPR:$dst), (ins QPR:$src), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2195 | IIC_VSHLiD, !strconcat(OpcodeStr, "\t$dst, $src"), "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2196 | [(set QPR:$dst, (Ty (vneg QPR:$src)))]>; |
| 2197 | |
| 2198 | // VNEG : Vector Negate |
| 2199 | def VNEGs8d : VNEGD<0b00, "vneg.s8", v8i8>; |
| 2200 | def VNEGs16d : VNEGD<0b01, "vneg.s16", v4i16>; |
| 2201 | def VNEGs32d : VNEGD<0b10, "vneg.s32", v2i32>; |
| 2202 | def VNEGs8q : VNEGQ<0b00, "vneg.s8", v16i8>; |
| 2203 | def VNEGs16q : VNEGQ<0b01, "vneg.s16", v8i16>; |
| 2204 | def VNEGs32q : VNEGQ<0b10, "vneg.s32", v4i32>; |
| 2205 | |
| 2206 | // VNEG : Vector Negate (floating-point) |
| 2207 | def VNEGf32d : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2208 | (outs DPR:$dst), (ins DPR:$src), IIC_VUNAD, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 2209 | "vneg.f32\t$dst, $src", "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2210 | [(set DPR:$dst, (v2f32 (fneg DPR:$src)))]>; |
| 2211 | def VNEGf32q : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 1, 0, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2212 | (outs QPR:$dst), (ins QPR:$src), IIC_VUNAQ, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 2213 | "vneg.f32\t$dst, $src", "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2214 | [(set QPR:$dst, (v4f32 (fneg QPR:$src)))]>; |
| 2215 | |
| 2216 | def : Pat<(v8i8 (vneg_conv DPR:$src)), (VNEGs8d DPR:$src)>; |
| 2217 | def : Pat<(v4i16 (vneg_conv DPR:$src)), (VNEGs16d DPR:$src)>; |
| 2218 | def : Pat<(v2i32 (vneg_conv DPR:$src)), (VNEGs32d DPR:$src)>; |
| 2219 | def : Pat<(v16i8 (vneg_conv QPR:$src)), (VNEGs8q QPR:$src)>; |
| 2220 | def : Pat<(v8i16 (vneg_conv QPR:$src)), (VNEGs16q QPR:$src)>; |
| 2221 | def : Pat<(v4i32 (vneg_conv QPR:$src)), (VNEGs32q QPR:$src)>; |
| 2222 | |
| 2223 | // VQNEG : Vector Saturating Negate |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2224 | defm VQNEG : N2VInt_QHS<0b11, 0b11, 0b00, 0b01111, 0, |
| 2225 | IIC_VQUNAiD, IIC_VQUNAiQ, "vqneg.s", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2226 | int_arm_neon_vqneg>; |
| 2227 | |
| 2228 | // Vector Bit Counting Operations. |
| 2229 | |
| 2230 | // VCLS : Vector Count Leading Sign Bits |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2231 | defm VCLS : N2VInt_QHS<0b11, 0b11, 0b00, 0b01000, 0, |
| 2232 | IIC_VCNTiD, IIC_VCNTiQ, "vcls.s", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2233 | int_arm_neon_vcls>; |
| 2234 | // VCLZ : Vector Count Leading Zeros |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2235 | defm VCLZ : N2VInt_QHS<0b11, 0b11, 0b00, 0b01001, 0, |
| 2236 | IIC_VCNTiD, IIC_VCNTiQ, "vclz.i", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2237 | int_arm_neon_vclz>; |
| 2238 | // VCNT : Vector Count One Bits |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2239 | def VCNTd : N2VDInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0, |
| 2240 | IIC_VCNTiD, "vcnt.8", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2241 | v8i8, v8i8, int_arm_neon_vcnt>; |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2242 | def VCNTq : N2VQInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0, |
| 2243 | IIC_VCNTiQ, "vcnt.8", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2244 | v16i8, v16i8, int_arm_neon_vcnt>; |
| 2245 | |
| 2246 | // Vector Move Operations. |
| 2247 | |
| 2248 | // VMOV : Vector Move (Register) |
| 2249 | |
| 2250 | def VMOVD : N3V<0, 0, 0b10, 0b0001, 0, 1, (outs DPR:$dst), (ins DPR:$src), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2251 | IIC_VMOVD, "vmov\t$dst, $src", "", []>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2252 | def VMOVQ : N3V<0, 0, 0b10, 0b0001, 1, 1, (outs QPR:$dst), (ins QPR:$src), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2253 | IIC_VMOVD, "vmov\t$dst, $src", "", []>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2254 | |
| 2255 | // VMOV : Vector Move (Immediate) |
| 2256 | |
| 2257 | // VMOV_get_imm8 xform function: convert build_vector to VMOV.i8 imm. |
| 2258 | def VMOV_get_imm8 : SDNodeXForm<build_vector, [{ |
| 2259 | return ARM::getVMOVImm(N, 1, *CurDAG); |
| 2260 | }]>; |
| 2261 | def vmovImm8 : PatLeaf<(build_vector), [{ |
| 2262 | return ARM::getVMOVImm(N, 1, *CurDAG).getNode() != 0; |
| 2263 | }], VMOV_get_imm8>; |
| 2264 | |
| 2265 | // VMOV_get_imm16 xform function: convert build_vector to VMOV.i16 imm. |
| 2266 | def VMOV_get_imm16 : SDNodeXForm<build_vector, [{ |
| 2267 | return ARM::getVMOVImm(N, 2, *CurDAG); |
| 2268 | }]>; |
| 2269 | def vmovImm16 : PatLeaf<(build_vector), [{ |
| 2270 | return ARM::getVMOVImm(N, 2, *CurDAG).getNode() != 0; |
| 2271 | }], VMOV_get_imm16>; |
| 2272 | |
| 2273 | // VMOV_get_imm32 xform function: convert build_vector to VMOV.i32 imm. |
| 2274 | def VMOV_get_imm32 : SDNodeXForm<build_vector, [{ |
| 2275 | return ARM::getVMOVImm(N, 4, *CurDAG); |
| 2276 | }]>; |
| 2277 | def vmovImm32 : PatLeaf<(build_vector), [{ |
| 2278 | return ARM::getVMOVImm(N, 4, *CurDAG).getNode() != 0; |
| 2279 | }], VMOV_get_imm32>; |
| 2280 | |
| 2281 | // VMOV_get_imm64 xform function: convert build_vector to VMOV.i64 imm. |
| 2282 | def VMOV_get_imm64 : SDNodeXForm<build_vector, [{ |
| 2283 | return ARM::getVMOVImm(N, 8, *CurDAG); |
| 2284 | }]>; |
| 2285 | def vmovImm64 : PatLeaf<(build_vector), [{ |
| 2286 | return ARM::getVMOVImm(N, 8, *CurDAG).getNode() != 0; |
| 2287 | }], VMOV_get_imm64>; |
| 2288 | |
| 2289 | // Note: Some of the cmode bits in the following VMOV instructions need to |
| 2290 | // be encoded based on the immed values. |
| 2291 | |
| 2292 | def VMOVv8i8 : N1ModImm<1, 0b000, 0b1110, 0, 0, 0, 1, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2293 | (ins i8imm:$SIMM), IIC_VMOVImm, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 2294 | "vmov.i8\t$dst, $SIMM", "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2295 | [(set DPR:$dst, (v8i8 vmovImm8:$SIMM))]>; |
| 2296 | def VMOVv16i8 : N1ModImm<1, 0b000, 0b1110, 0, 1, 0, 1, (outs QPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2297 | (ins i8imm:$SIMM), IIC_VMOVImm, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 2298 | "vmov.i8\t$dst, $SIMM", "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2299 | [(set QPR:$dst, (v16i8 vmovImm8:$SIMM))]>; |
| 2300 | |
| 2301 | def VMOVv4i16 : N1ModImm<1, 0b000, 0b1000, 0, 0, 0, 1, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2302 | (ins i16imm:$SIMM), IIC_VMOVImm, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 2303 | "vmov.i16\t$dst, $SIMM", "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2304 | [(set DPR:$dst, (v4i16 vmovImm16:$SIMM))]>; |
| 2305 | def VMOVv8i16 : N1ModImm<1, 0b000, 0b1000, 0, 1, 0, 1, (outs QPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2306 | (ins i16imm:$SIMM), IIC_VMOVImm, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 2307 | "vmov.i16\t$dst, $SIMM", "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2308 | [(set QPR:$dst, (v8i16 vmovImm16:$SIMM))]>; |
| 2309 | |
| 2310 | def VMOVv2i32 : N1ModImm<1, 0b000, 0b0000, 0, 0, 0, 1, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2311 | (ins i32imm:$SIMM), IIC_VMOVImm, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 2312 | "vmov.i32\t$dst, $SIMM", "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2313 | [(set DPR:$dst, (v2i32 vmovImm32:$SIMM))]>; |
| 2314 | def VMOVv4i32 : N1ModImm<1, 0b000, 0b0000, 0, 1, 0, 1, (outs QPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2315 | (ins i32imm:$SIMM), IIC_VMOVImm, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 2316 | "vmov.i32\t$dst, $SIMM", "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2317 | [(set QPR:$dst, (v4i32 vmovImm32:$SIMM))]>; |
| 2318 | |
| 2319 | def VMOVv1i64 : N1ModImm<1, 0b000, 0b1110, 0, 0, 1, 1, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2320 | (ins i64imm:$SIMM), IIC_VMOVImm, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 2321 | "vmov.i64\t$dst, $SIMM", "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2322 | [(set DPR:$dst, (v1i64 vmovImm64:$SIMM))]>; |
| 2323 | def VMOVv2i64 : N1ModImm<1, 0b000, 0b1110, 0, 1, 1, 1, (outs QPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2324 | (ins i64imm:$SIMM), IIC_VMOVImm, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 2325 | "vmov.i64\t$dst, $SIMM", "", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2326 | [(set QPR:$dst, (v2i64 vmovImm64:$SIMM))]>; |
| 2327 | |
| 2328 | // VMOV : Vector Get Lane (move scalar to ARM core register) |
| 2329 | |
| 2330 | def VGETLNs8 : NVGetLane<0b11100101, 0b1011, 0b00, |
Bob Wilson | 4f38b38 | 2009-08-21 21:58:55 +0000 | [diff] [blame] | 2331 | (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2332 | IIC_VMOVSI, "vmov", ".s8\t$dst, $src[$lane]", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2333 | [(set GPR:$dst, (NEONvgetlanes (v8i8 DPR:$src), |
| 2334 | imm:$lane))]>; |
| 2335 | def VGETLNs16 : NVGetLane<0b11100001, 0b1011, 0b01, |
Bob Wilson | 4f38b38 | 2009-08-21 21:58:55 +0000 | [diff] [blame] | 2336 | (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2337 | IIC_VMOVSI, "vmov", ".s16\t$dst, $src[$lane]", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2338 | [(set GPR:$dst, (NEONvgetlanes (v4i16 DPR:$src), |
| 2339 | imm:$lane))]>; |
| 2340 | def VGETLNu8 : NVGetLane<0b11101101, 0b1011, 0b00, |
Bob Wilson | 4f38b38 | 2009-08-21 21:58:55 +0000 | [diff] [blame] | 2341 | (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2342 | IIC_VMOVSI, "vmov", ".u8\t$dst, $src[$lane]", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2343 | [(set GPR:$dst, (NEONvgetlaneu (v8i8 DPR:$src), |
| 2344 | imm:$lane))]>; |
| 2345 | def VGETLNu16 : NVGetLane<0b11101001, 0b1011, 0b01, |
Bob Wilson | 4f38b38 | 2009-08-21 21:58:55 +0000 | [diff] [blame] | 2346 | (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2347 | IIC_VMOVSI, "vmov", ".u16\t$dst, $src[$lane]", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2348 | [(set GPR:$dst, (NEONvgetlaneu (v4i16 DPR:$src), |
| 2349 | imm:$lane))]>; |
| 2350 | def VGETLNi32 : NVGetLane<0b11100001, 0b1011, 0b00, |
Bob Wilson | 4f38b38 | 2009-08-21 21:58:55 +0000 | [diff] [blame] | 2351 | (outs GPR:$dst), (ins DPR:$src, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2352 | IIC_VMOVSI, "vmov", ".32\t$dst, $src[$lane]", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2353 | [(set GPR:$dst, (extractelt (v2i32 DPR:$src), |
| 2354 | imm:$lane))]>; |
| 2355 | // def VGETLNf32: see FMRDH and FMRDL in ARMInstrVFP.td |
| 2356 | def : Pat<(NEONvgetlanes (v16i8 QPR:$src), imm:$lane), |
| 2357 | (VGETLNs8 (v8i8 (EXTRACT_SUBREG QPR:$src, |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2358 | (DSubReg_i8_reg imm:$lane))), |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2359 | (SubReg_i8_lane imm:$lane))>; |
| 2360 | def : Pat<(NEONvgetlanes (v8i16 QPR:$src), imm:$lane), |
| 2361 | (VGETLNs16 (v4i16 (EXTRACT_SUBREG QPR:$src, |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2362 | (DSubReg_i16_reg imm:$lane))), |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2363 | (SubReg_i16_lane imm:$lane))>; |
| 2364 | def : Pat<(NEONvgetlaneu (v16i8 QPR:$src), imm:$lane), |
| 2365 | (VGETLNu8 (v8i8 (EXTRACT_SUBREG QPR:$src, |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2366 | (DSubReg_i8_reg imm:$lane))), |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2367 | (SubReg_i8_lane imm:$lane))>; |
| 2368 | def : Pat<(NEONvgetlaneu (v8i16 QPR:$src), imm:$lane), |
| 2369 | (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src, |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2370 | (DSubReg_i16_reg imm:$lane))), |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2371 | (SubReg_i16_lane imm:$lane))>; |
| 2372 | def : Pat<(extractelt (v4i32 QPR:$src), imm:$lane), |
| 2373 | (VGETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src, |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2374 | (DSubReg_i32_reg imm:$lane))), |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2375 | (SubReg_i32_lane imm:$lane))>; |
Anton Korobeynikov | 2324bdc | 2009-08-28 23:41:26 +0000 | [diff] [blame] | 2376 | def : Pat<(extractelt (v2f32 DPR:$src1), imm:$src2), |
Anton Korobeynikov | e56f908 | 2009-09-12 22:21:08 +0000 | [diff] [blame] | 2377 | (EXTRACT_SUBREG (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2), |
| 2378 | (SSubReg_f32_reg imm:$src2))>; |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2379 | def : Pat<(extractelt (v4f32 QPR:$src1), imm:$src2), |
Anton Korobeynikov | e56f908 | 2009-09-12 22:21:08 +0000 | [diff] [blame] | 2380 | (EXTRACT_SUBREG (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2), |
| 2381 | (SSubReg_f32_reg imm:$src2))>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2382 | //def : Pat<(extractelt (v2i64 QPR:$src1), imm:$src2), |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2383 | // (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2384 | def : Pat<(extractelt (v2f64 QPR:$src1), imm:$src2), |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2385 | (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2386 | |
| 2387 | |
| 2388 | // VMOV : Vector Set Lane (move ARM core register to scalar) |
| 2389 | |
| 2390 | let Constraints = "$src1 = $dst" in { |
| 2391 | def VSETLNi8 : NVSetLane<0b11100100, 0b1011, 0b00, (outs DPR:$dst), |
Bob Wilson | 4f38b38 | 2009-08-21 21:58:55 +0000 | [diff] [blame] | 2392 | (ins DPR:$src1, GPR:$src2, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2393 | IIC_VMOVISL, "vmov", ".8\t$dst[$lane], $src2", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2394 | [(set DPR:$dst, (vector_insert (v8i8 DPR:$src1), |
| 2395 | GPR:$src2, imm:$lane))]>; |
| 2396 | def VSETLNi16 : NVSetLane<0b11100000, 0b1011, 0b01, (outs DPR:$dst), |
Bob Wilson | 4f38b38 | 2009-08-21 21:58:55 +0000 | [diff] [blame] | 2397 | (ins DPR:$src1, GPR:$src2, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2398 | IIC_VMOVISL, "vmov", ".16\t$dst[$lane], $src2", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2399 | [(set DPR:$dst, (vector_insert (v4i16 DPR:$src1), |
| 2400 | GPR:$src2, imm:$lane))]>; |
| 2401 | def VSETLNi32 : NVSetLane<0b11100000, 0b1011, 0b00, (outs DPR:$dst), |
Bob Wilson | 4f38b38 | 2009-08-21 21:58:55 +0000 | [diff] [blame] | 2402 | (ins DPR:$src1, GPR:$src2, nohash_imm:$lane), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2403 | IIC_VMOVISL, "vmov", ".32\t$dst[$lane], $src2", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2404 | [(set DPR:$dst, (insertelt (v2i32 DPR:$src1), |
| 2405 | GPR:$src2, imm:$lane))]>; |
| 2406 | } |
| 2407 | def : Pat<(vector_insert (v16i8 QPR:$src1), GPR:$src2, imm:$lane), |
| 2408 | (v16i8 (INSERT_SUBREG QPR:$src1, |
| 2409 | (VSETLNi8 (v8i8 (EXTRACT_SUBREG QPR:$src1, |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2410 | (DSubReg_i8_reg imm:$lane))), |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2411 | GPR:$src2, (SubReg_i8_lane imm:$lane)), |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2412 | (DSubReg_i8_reg imm:$lane)))>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2413 | def : Pat<(vector_insert (v8i16 QPR:$src1), GPR:$src2, imm:$lane), |
| 2414 | (v8i16 (INSERT_SUBREG QPR:$src1, |
| 2415 | (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1, |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2416 | (DSubReg_i16_reg imm:$lane))), |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2417 | GPR:$src2, (SubReg_i16_lane imm:$lane)), |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2418 | (DSubReg_i16_reg imm:$lane)))>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2419 | def : Pat<(insertelt (v4i32 QPR:$src1), GPR:$src2, imm:$lane), |
| 2420 | (v4i32 (INSERT_SUBREG QPR:$src1, |
| 2421 | (VSETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src1, |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2422 | (DSubReg_i32_reg imm:$lane))), |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2423 | GPR:$src2, (SubReg_i32_lane imm:$lane)), |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2424 | (DSubReg_i32_reg imm:$lane)))>; |
| 2425 | |
Anton Korobeynikov | d91aafd | 2009-08-30 19:06:39 +0000 | [diff] [blame] | 2426 | def : Pat<(v2f32 (insertelt DPR:$src1, SPR:$src2, imm:$src3)), |
Anton Korobeynikov | e56f908 | 2009-09-12 22:21:08 +0000 | [diff] [blame] | 2427 | (INSERT_SUBREG (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2), |
| 2428 | SPR:$src2, (SSubReg_f32_reg imm:$src3))>; |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2429 | def : Pat<(v4f32 (insertelt QPR:$src1, SPR:$src2, imm:$src3)), |
Anton Korobeynikov | e56f908 | 2009-09-12 22:21:08 +0000 | [diff] [blame] | 2430 | (INSERT_SUBREG (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2), |
| 2431 | SPR:$src2, (SSubReg_f32_reg imm:$src3))>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2432 | |
| 2433 | //def : Pat<(v2i64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)), |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2434 | // (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2435 | def : Pat<(v2f64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)), |
Anton Korobeynikov | 06af2ba | 2009-08-08 14:06:07 +0000 | [diff] [blame] | 2436 | (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2437 | |
Anton Korobeynikov | fdf189a | 2009-08-27 14:38:44 +0000 | [diff] [blame] | 2438 | def : Pat<(v2f32 (scalar_to_vector SPR:$src)), |
| 2439 | (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$src, arm_ssubreg_0)>; |
| 2440 | def : Pat<(v2f64 (scalar_to_vector DPR:$src)), |
| 2441 | (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), DPR:$src, arm_dsubreg_0)>; |
| 2442 | def : Pat<(v4f32 (scalar_to_vector SPR:$src)), |
| 2443 | (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), SPR:$src, arm_ssubreg_0)>; |
| 2444 | |
Anton Korobeynikov | b5cdf87 | 2009-08-27 16:10:17 +0000 | [diff] [blame] | 2445 | def : Pat<(v8i8 (scalar_to_vector GPR:$src)), |
| 2446 | (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0))>; |
| 2447 | def : Pat<(v4i16 (scalar_to_vector GPR:$src)), |
| 2448 | (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0))>; |
| 2449 | def : Pat<(v2i32 (scalar_to_vector GPR:$src)), |
| 2450 | (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0))>; |
| 2451 | |
| 2452 | def : Pat<(v16i8 (scalar_to_vector GPR:$src)), |
| 2453 | (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)), |
| 2454 | (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0)), |
| 2455 | arm_dsubreg_0)>; |
| 2456 | def : Pat<(v8i16 (scalar_to_vector GPR:$src)), |
| 2457 | (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)), |
| 2458 | (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0)), |
| 2459 | arm_dsubreg_0)>; |
| 2460 | def : Pat<(v4i32 (scalar_to_vector GPR:$src)), |
| 2461 | (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)), |
| 2462 | (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0)), |
| 2463 | arm_dsubreg_0)>; |
| 2464 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2465 | // VDUP : Vector Duplicate (from ARM core register to all elements) |
| 2466 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2467 | class VDUPD<bits<8> opcod1, bits<2> opcod3, string asmSize, ValueType Ty> |
| 2468 | : NVDup<opcod1, 0b1011, opcod3, (outs DPR:$dst), (ins GPR:$src), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2469 | IIC_VMOVIS, "vdup", !strconcat(asmSize, "\t$dst, $src"), |
Bob Wilson | c1d287b | 2009-08-14 05:13:08 +0000 | [diff] [blame] | 2470 | [(set DPR:$dst, (Ty (NEONvdup (i32 GPR:$src))))]>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2471 | class VDUPQ<bits<8> opcod1, bits<2> opcod3, string asmSize, ValueType Ty> |
| 2472 | : NVDup<opcod1, 0b1011, opcod3, (outs QPR:$dst), (ins GPR:$src), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2473 | IIC_VMOVIS, "vdup", !strconcat(asmSize, "\t$dst, $src"), |
Bob Wilson | c1d287b | 2009-08-14 05:13:08 +0000 | [diff] [blame] | 2474 | [(set QPR:$dst, (Ty (NEONvdup (i32 GPR:$src))))]>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2475 | |
| 2476 | def VDUP8d : VDUPD<0b11101100, 0b00, ".8", v8i8>; |
| 2477 | def VDUP16d : VDUPD<0b11101000, 0b01, ".16", v4i16>; |
| 2478 | def VDUP32d : VDUPD<0b11101000, 0b00, ".32", v2i32>; |
| 2479 | def VDUP8q : VDUPQ<0b11101110, 0b00, ".8", v16i8>; |
| 2480 | def VDUP16q : VDUPQ<0b11101010, 0b01, ".16", v8i16>; |
| 2481 | def VDUP32q : VDUPQ<0b11101010, 0b00, ".32", v4i32>; |
| 2482 | |
| 2483 | def VDUPfd : NVDup<0b11101000, 0b1011, 0b00, (outs DPR:$dst), (ins GPR:$src), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2484 | IIC_VMOVIS, "vdup", ".32\t$dst, $src", |
Bob Wilson | c1d287b | 2009-08-14 05:13:08 +0000 | [diff] [blame] | 2485 | [(set DPR:$dst, (v2f32 (NEONvdup |
| 2486 | (f32 (bitconvert GPR:$src)))))]>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2487 | def VDUPfq : NVDup<0b11101010, 0b1011, 0b00, (outs QPR:$dst), (ins GPR:$src), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2488 | IIC_VMOVIS, "vdup", ".32\t$dst, $src", |
Bob Wilson | c1d287b | 2009-08-14 05:13:08 +0000 | [diff] [blame] | 2489 | [(set QPR:$dst, (v4f32 (NEONvdup |
| 2490 | (f32 (bitconvert GPR:$src)))))]>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2491 | |
| 2492 | // VDUP : Vector Duplicate Lane (from scalar to all elements) |
| 2493 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2494 | class VDUPLND<bits<2> op19_18, bits<2> op17_16, string OpcodeStr, ValueType Ty> |
| 2495 | : N2V<0b11, 0b11, op19_18, op17_16, 0b11000, 0, 0, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2496 | (outs DPR:$dst), (ins DPR:$src, nohash_imm:$lane), IIC_VMOVD, |
Anton Korobeynikov | 8e9ece7 | 2009-08-08 23:10:41 +0000 | [diff] [blame] | 2497 | !strconcat(OpcodeStr, "\t$dst, $src[$lane]"), "", |
Bob Wilson | 0ce3710 | 2009-08-14 05:08:32 +0000 | [diff] [blame] | 2498 | [(set DPR:$dst, (Ty (NEONvduplane (Ty DPR:$src), imm:$lane)))]>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2499 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2500 | class VDUPLNQ<bits<2> op19_18, bits<2> op17_16, string OpcodeStr, |
| 2501 | ValueType ResTy, ValueType OpTy> |
| 2502 | : N2V<0b11, 0b11, op19_18, op17_16, 0b11000, 1, 0, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2503 | (outs QPR:$dst), (ins DPR:$src, nohash_imm:$lane), IIC_VMOVD, |
Anton Korobeynikov | 8e9ece7 | 2009-08-08 23:10:41 +0000 | [diff] [blame] | 2504 | !strconcat(OpcodeStr, "\t$dst, $src[$lane]"), "", |
Bob Wilson | 0ce3710 | 2009-08-14 05:08:32 +0000 | [diff] [blame] | 2505 | [(set QPR:$dst, (ResTy (NEONvduplane (OpTy DPR:$src), imm:$lane)))]>; |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2506 | |
| 2507 | def VDUPLN8d : VDUPLND<0b00, 0b01, "vdup.8", v8i8>; |
| 2508 | def VDUPLN16d : VDUPLND<0b00, 0b10, "vdup.16", v4i16>; |
| 2509 | def VDUPLN32d : VDUPLND<0b01, 0b00, "vdup.32", v2i32>; |
| 2510 | def VDUPLNfd : VDUPLND<0b01, 0b00, "vdup.32", v2f32>; |
| 2511 | def VDUPLN8q : VDUPLNQ<0b00, 0b01, "vdup.8", v16i8, v8i8>; |
| 2512 | def VDUPLN16q : VDUPLNQ<0b00, 0b10, "vdup.16", v8i16, v4i16>; |
| 2513 | def VDUPLN32q : VDUPLNQ<0b01, 0b00, "vdup.32", v4i32, v2i32>; |
| 2514 | def VDUPLNfq : VDUPLNQ<0b01, 0b00, "vdup.32", v4f32, v2f32>; |
| 2515 | |
Bob Wilson | 0ce3710 | 2009-08-14 05:08:32 +0000 | [diff] [blame] | 2516 | def : Pat<(v16i8 (NEONvduplane (v16i8 QPR:$src), imm:$lane)), |
| 2517 | (v16i8 (VDUPLN8q (v8i8 (EXTRACT_SUBREG QPR:$src, |
| 2518 | (DSubReg_i8_reg imm:$lane))), |
| 2519 | (SubReg_i8_lane imm:$lane)))>; |
| 2520 | def : Pat<(v8i16 (NEONvduplane (v8i16 QPR:$src), imm:$lane)), |
| 2521 | (v8i16 (VDUPLN16q (v4i16 (EXTRACT_SUBREG QPR:$src, |
| 2522 | (DSubReg_i16_reg imm:$lane))), |
| 2523 | (SubReg_i16_lane imm:$lane)))>; |
| 2524 | def : Pat<(v4i32 (NEONvduplane (v4i32 QPR:$src), imm:$lane)), |
| 2525 | (v4i32 (VDUPLN32q (v2i32 (EXTRACT_SUBREG QPR:$src, |
| 2526 | (DSubReg_i32_reg imm:$lane))), |
| 2527 | (SubReg_i32_lane imm:$lane)))>; |
| 2528 | def : Pat<(v4f32 (NEONvduplane (v4f32 QPR:$src), imm:$lane)), |
| 2529 | (v4f32 (VDUPLNfq (v2f32 (EXTRACT_SUBREG QPR:$src, |
| 2530 | (DSubReg_i32_reg imm:$lane))), |
| 2531 | (SubReg_i32_lane imm:$lane)))>; |
| 2532 | |
Anton Korobeynikov | 32a1b25 | 2009-08-07 22:36:50 +0000 | [diff] [blame] | 2533 | def VDUPfdf : N2V<0b11, 0b11, 0b01, 0b00, 0b11000, 0, 0, |
| 2534 | (outs DPR:$dst), (ins SPR:$src), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2535 | IIC_VMOVD, "vdup.32\t$dst, ${src:lane}", "", |
Bob Wilson | c1d287b | 2009-08-14 05:13:08 +0000 | [diff] [blame] | 2536 | [(set DPR:$dst, (v2f32 (NEONvdup (f32 SPR:$src))))]>; |
Anton Korobeynikov | 32a1b25 | 2009-08-07 22:36:50 +0000 | [diff] [blame] | 2537 | |
| 2538 | def VDUPfqf : N2V<0b11, 0b11, 0b01, 0b00, 0b11000, 1, 0, |
| 2539 | (outs QPR:$dst), (ins SPR:$src), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2540 | IIC_VMOVD, "vdup.32\t$dst, ${src:lane}", "", |
Bob Wilson | c1d287b | 2009-08-14 05:13:08 +0000 | [diff] [blame] | 2541 | [(set QPR:$dst, (v4f32 (NEONvdup (f32 SPR:$src))))]>; |
Anton Korobeynikov | 32a1b25 | 2009-08-07 22:36:50 +0000 | [diff] [blame] | 2542 | |
Anton Korobeynikov | 69d1c1a | 2009-09-02 21:21:28 +0000 | [diff] [blame] | 2543 | def : Pat<(v2i64 (NEONvduplane (v2i64 QPR:$src), imm:$lane)), |
| 2544 | (INSERT_SUBREG QPR:$src, |
| 2545 | (i64 (EXTRACT_SUBREG QPR:$src, (DSubReg_f64_reg imm:$lane))), |
| 2546 | (DSubReg_f64_other_reg imm:$lane))>; |
| 2547 | def : Pat<(v2f64 (NEONvduplane (v2f64 QPR:$src), imm:$lane)), |
| 2548 | (INSERT_SUBREG QPR:$src, |
| 2549 | (f64 (EXTRACT_SUBREG QPR:$src, (DSubReg_f64_reg imm:$lane))), |
| 2550 | (DSubReg_f64_other_reg imm:$lane))>; |
| 2551 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2552 | // VMOVN : Vector Narrowing Move |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2553 | defm VMOVN : N2VNInt_HSD<0b11,0b11,0b10,0b00100,0,0, IIC_VMOVD, "vmovn.i", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2554 | int_arm_neon_vmovn>; |
| 2555 | // VQMOVN : Vector Saturating Narrowing Move |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2556 | defm VQMOVNs : N2VNInt_HSD<0b11,0b11,0b10,0b00101,0,0, IIC_VQUNAiD, "vqmovn.s", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2557 | int_arm_neon_vqmovns>; |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2558 | defm VQMOVNu : N2VNInt_HSD<0b11,0b11,0b10,0b00101,1,0, IIC_VQUNAiD, "vqmovn.u", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2559 | int_arm_neon_vqmovnu>; |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2560 | defm VQMOVNsu : N2VNInt_HSD<0b11,0b11,0b10,0b00100,1,0, IIC_VQUNAiD, "vqmovun.s", |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2561 | int_arm_neon_vqmovnsu>; |
| 2562 | // VMOVL : Vector Lengthening Move |
| 2563 | defm VMOVLs : N2VLInt_QHS<0,1,0b1010,0,0,1, "vmovl.s", int_arm_neon_vmovls>; |
| 2564 | defm VMOVLu : N2VLInt_QHS<1,1,0b1010,0,0,1, "vmovl.u", int_arm_neon_vmovlu>; |
| 2565 | |
| 2566 | // Vector Conversions. |
| 2567 | |
| 2568 | // VCVT : Vector Convert Between Floating-Point and Integers |
| 2569 | def VCVTf2sd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt.s32.f32", |
| 2570 | v2i32, v2f32, fp_to_sint>; |
| 2571 | def VCVTf2ud : N2VD<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt.u32.f32", |
| 2572 | v2i32, v2f32, fp_to_uint>; |
| 2573 | def VCVTs2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt.f32.s32", |
| 2574 | v2f32, v2i32, sint_to_fp>; |
| 2575 | def VCVTu2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt.f32.u32", |
| 2576 | v2f32, v2i32, uint_to_fp>; |
| 2577 | |
| 2578 | def VCVTf2sq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt.s32.f32", |
| 2579 | v4i32, v4f32, fp_to_sint>; |
| 2580 | def VCVTf2uq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt.u32.f32", |
| 2581 | v4i32, v4f32, fp_to_uint>; |
| 2582 | def VCVTs2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt.f32.s32", |
| 2583 | v4f32, v4i32, sint_to_fp>; |
| 2584 | def VCVTu2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt.f32.u32", |
| 2585 | v4f32, v4i32, uint_to_fp>; |
| 2586 | |
| 2587 | // VCVT : Vector Convert Between Floating-Point and Fixed-Point. |
| 2588 | // Note: Some of the opcode bits in the following VCVT instructions need to |
| 2589 | // be encoded based on the immed values. |
| 2590 | def VCVTf2xsd : N2VCvtD<0, 1, 0b000000, 0b1111, 0, 1, "vcvt.s32.f32", |
| 2591 | v2i32, v2f32, int_arm_neon_vcvtfp2fxs>; |
| 2592 | def VCVTf2xud : N2VCvtD<1, 1, 0b000000, 0b1111, 0, 1, "vcvt.u32.f32", |
| 2593 | v2i32, v2f32, int_arm_neon_vcvtfp2fxu>; |
| 2594 | def VCVTxs2fd : N2VCvtD<0, 1, 0b000000, 0b1110, 0, 1, "vcvt.f32.s32", |
| 2595 | v2f32, v2i32, int_arm_neon_vcvtfxs2fp>; |
| 2596 | def VCVTxu2fd : N2VCvtD<1, 1, 0b000000, 0b1110, 0, 1, "vcvt.f32.u32", |
| 2597 | v2f32, v2i32, int_arm_neon_vcvtfxu2fp>; |
| 2598 | |
| 2599 | def VCVTf2xsq : N2VCvtQ<0, 1, 0b000000, 0b1111, 0, 1, "vcvt.s32.f32", |
| 2600 | v4i32, v4f32, int_arm_neon_vcvtfp2fxs>; |
| 2601 | def VCVTf2xuq : N2VCvtQ<1, 1, 0b000000, 0b1111, 0, 1, "vcvt.u32.f32", |
| 2602 | v4i32, v4f32, int_arm_neon_vcvtfp2fxu>; |
| 2603 | def VCVTxs2fq : N2VCvtQ<0, 1, 0b000000, 0b1110, 0, 1, "vcvt.f32.s32", |
| 2604 | v4f32, v4i32, int_arm_neon_vcvtfxs2fp>; |
| 2605 | def VCVTxu2fq : N2VCvtQ<1, 1, 0b000000, 0b1110, 0, 1, "vcvt.f32.u32", |
| 2606 | v4f32, v4i32, int_arm_neon_vcvtfxu2fp>; |
| 2607 | |
Bob Wilson | d8e1757 | 2009-08-12 22:31:50 +0000 | [diff] [blame] | 2608 | // Vector Reverse. |
Bob Wilson | 8bb9e48 | 2009-07-26 00:39:34 +0000 | [diff] [blame] | 2609 | |
| 2610 | // VREV64 : Vector Reverse elements within 64-bit doublewords |
| 2611 | |
| 2612 | class VREV64D<bits<2> op19_18, string OpcodeStr, ValueType Ty> |
| 2613 | : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 0, 0, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2614 | (ins DPR:$src), IIC_VMOVD, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 2615 | !strconcat(OpcodeStr, "\t$dst, $src"), "", |
Bob Wilson | d8e1757 | 2009-08-12 22:31:50 +0000 | [diff] [blame] | 2616 | [(set DPR:$dst, (Ty (NEONvrev64 (Ty DPR:$src))))]>; |
Bob Wilson | 8bb9e48 | 2009-07-26 00:39:34 +0000 | [diff] [blame] | 2617 | class VREV64Q<bits<2> op19_18, string OpcodeStr, ValueType Ty> |
| 2618 | : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 1, 0, (outs QPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2619 | (ins QPR:$src), IIC_VMOVD, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 2620 | !strconcat(OpcodeStr, "\t$dst, $src"), "", |
Bob Wilson | d8e1757 | 2009-08-12 22:31:50 +0000 | [diff] [blame] | 2621 | [(set QPR:$dst, (Ty (NEONvrev64 (Ty QPR:$src))))]>; |
Bob Wilson | 8bb9e48 | 2009-07-26 00:39:34 +0000 | [diff] [blame] | 2622 | |
| 2623 | def VREV64d8 : VREV64D<0b00, "vrev64.8", v8i8>; |
| 2624 | def VREV64d16 : VREV64D<0b01, "vrev64.16", v4i16>; |
| 2625 | def VREV64d32 : VREV64D<0b10, "vrev64.32", v2i32>; |
| 2626 | def VREV64df : VREV64D<0b10, "vrev64.32", v2f32>; |
| 2627 | |
| 2628 | def VREV64q8 : VREV64Q<0b00, "vrev64.8", v16i8>; |
| 2629 | def VREV64q16 : VREV64Q<0b01, "vrev64.16", v8i16>; |
| 2630 | def VREV64q32 : VREV64Q<0b10, "vrev64.32", v4i32>; |
| 2631 | def VREV64qf : VREV64Q<0b10, "vrev64.32", v4f32>; |
| 2632 | |
| 2633 | // VREV32 : Vector Reverse elements within 32-bit words |
| 2634 | |
| 2635 | class VREV32D<bits<2> op19_18, string OpcodeStr, ValueType Ty> |
| 2636 | : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 0, 0, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2637 | (ins DPR:$src), IIC_VMOVD, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 2638 | !strconcat(OpcodeStr, "\t$dst, $src"), "", |
Bob Wilson | d8e1757 | 2009-08-12 22:31:50 +0000 | [diff] [blame] | 2639 | [(set DPR:$dst, (Ty (NEONvrev32 (Ty DPR:$src))))]>; |
Bob Wilson | 8bb9e48 | 2009-07-26 00:39:34 +0000 | [diff] [blame] | 2640 | class VREV32Q<bits<2> op19_18, string OpcodeStr, ValueType Ty> |
| 2641 | : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 1, 0, (outs QPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2642 | (ins QPR:$src), IIC_VMOVD, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 2643 | !strconcat(OpcodeStr, "\t$dst, $src"), "", |
Bob Wilson | d8e1757 | 2009-08-12 22:31:50 +0000 | [diff] [blame] | 2644 | [(set QPR:$dst, (Ty (NEONvrev32 (Ty QPR:$src))))]>; |
Bob Wilson | 8bb9e48 | 2009-07-26 00:39:34 +0000 | [diff] [blame] | 2645 | |
| 2646 | def VREV32d8 : VREV32D<0b00, "vrev32.8", v8i8>; |
| 2647 | def VREV32d16 : VREV32D<0b01, "vrev32.16", v4i16>; |
| 2648 | |
| 2649 | def VREV32q8 : VREV32Q<0b00, "vrev32.8", v16i8>; |
| 2650 | def VREV32q16 : VREV32Q<0b01, "vrev32.16", v8i16>; |
| 2651 | |
| 2652 | // VREV16 : Vector Reverse elements within 16-bit halfwords |
| 2653 | |
| 2654 | class VREV16D<bits<2> op19_18, string OpcodeStr, ValueType Ty> |
| 2655 | : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 0, 0, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2656 | (ins DPR:$src), IIC_VMOVD, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 2657 | !strconcat(OpcodeStr, "\t$dst, $src"), "", |
Bob Wilson | d8e1757 | 2009-08-12 22:31:50 +0000 | [diff] [blame] | 2658 | [(set DPR:$dst, (Ty (NEONvrev16 (Ty DPR:$src))))]>; |
Bob Wilson | 8bb9e48 | 2009-07-26 00:39:34 +0000 | [diff] [blame] | 2659 | class VREV16Q<bits<2> op19_18, string OpcodeStr, ValueType Ty> |
| 2660 | : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 1, 0, (outs QPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2661 | (ins QPR:$src), IIC_VMOVD, |
David Goodwin | 8b7d7ad | 2009-08-06 16:52:47 +0000 | [diff] [blame] | 2662 | !strconcat(OpcodeStr, "\t$dst, $src"), "", |
Bob Wilson | d8e1757 | 2009-08-12 22:31:50 +0000 | [diff] [blame] | 2663 | [(set QPR:$dst, (Ty (NEONvrev16 (Ty QPR:$src))))]>; |
Bob Wilson | 8bb9e48 | 2009-07-26 00:39:34 +0000 | [diff] [blame] | 2664 | |
| 2665 | def VREV16d8 : VREV16D<0b00, "vrev16.8", v8i8>; |
| 2666 | def VREV16q8 : VREV16Q<0b00, "vrev16.8", v16i8>; |
| 2667 | |
Bob Wilson | de95c1b8 | 2009-08-19 17:03:43 +0000 | [diff] [blame] | 2668 | // Other Vector Shuffles. |
| 2669 | |
| 2670 | // VEXT : Vector Extract |
| 2671 | |
Anton Korobeynikov | 5da894f | 2009-08-21 12:40:21 +0000 | [diff] [blame] | 2672 | class VEXTd<string OpcodeStr, ValueType Ty> |
| 2673 | : N3V<0,1,0b11,0b0000,0,0, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2674 | (ins DPR:$lhs, DPR:$rhs, i32imm:$index), IIC_VEXTD, |
Anton Korobeynikov | 5da894f | 2009-08-21 12:40:21 +0000 | [diff] [blame] | 2675 | !strconcat(OpcodeStr, "\t$dst, $lhs, $rhs, $index"), "", |
| 2676 | [(set DPR:$dst, (Ty (NEONvext (Ty DPR:$lhs), |
| 2677 | (Ty DPR:$rhs), imm:$index)))]>; |
| 2678 | |
| 2679 | class VEXTq<string OpcodeStr, ValueType Ty> |
| 2680 | : N3V<0,1,0b11,0b0000,1,0, (outs QPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2681 | (ins QPR:$lhs, QPR:$rhs, i32imm:$index), IIC_VEXTQ, |
Anton Korobeynikov | 5da894f | 2009-08-21 12:40:21 +0000 | [diff] [blame] | 2682 | !strconcat(OpcodeStr, "\t$dst, $lhs, $rhs, $index"), "", |
| 2683 | [(set QPR:$dst, (Ty (NEONvext (Ty QPR:$lhs), |
| 2684 | (Ty QPR:$rhs), imm:$index)))]>; |
| 2685 | |
| 2686 | def VEXTd8 : VEXTd<"vext.8", v8i8>; |
| 2687 | def VEXTd16 : VEXTd<"vext.16", v4i16>; |
| 2688 | def VEXTd32 : VEXTd<"vext.32", v2i32>; |
| 2689 | def VEXTdf : VEXTd<"vext.32", v2f32>; |
| 2690 | |
| 2691 | def VEXTq8 : VEXTq<"vext.8", v16i8>; |
| 2692 | def VEXTq16 : VEXTq<"vext.16", v8i16>; |
| 2693 | def VEXTq32 : VEXTq<"vext.32", v4i32>; |
| 2694 | def VEXTqf : VEXTq<"vext.32", v4f32>; |
Bob Wilson | de95c1b8 | 2009-08-19 17:03:43 +0000 | [diff] [blame] | 2695 | |
Bob Wilson | 64efd90 | 2009-08-08 05:53:00 +0000 | [diff] [blame] | 2696 | // VTRN : Vector Transpose |
| 2697 | |
Bob Wilson | b6ab51e | 2009-08-08 06:13:25 +0000 | [diff] [blame] | 2698 | def VTRNd8 : N2VDShuffle<0b00, 0b00001, "vtrn.8">; |
| 2699 | def VTRNd16 : N2VDShuffle<0b01, 0b00001, "vtrn.16">; |
| 2700 | def VTRNd32 : N2VDShuffle<0b10, 0b00001, "vtrn.32">; |
Bob Wilson | 64efd90 | 2009-08-08 05:53:00 +0000 | [diff] [blame] | 2701 | |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2702 | def VTRNq8 : N2VQShuffle<0b00, 0b00001, IIC_VPERMQ, "vtrn.8">; |
| 2703 | def VTRNq16 : N2VQShuffle<0b01, 0b00001, IIC_VPERMQ, "vtrn.16">; |
| 2704 | def VTRNq32 : N2VQShuffle<0b10, 0b00001, IIC_VPERMQ, "vtrn.32">; |
Bob Wilson | 64efd90 | 2009-08-08 05:53:00 +0000 | [diff] [blame] | 2705 | |
Bob Wilson | b6ab51e | 2009-08-08 06:13:25 +0000 | [diff] [blame] | 2706 | // VUZP : Vector Unzip (Deinterleave) |
| 2707 | |
| 2708 | def VUZPd8 : N2VDShuffle<0b00, 0b00010, "vuzp.8">; |
| 2709 | def VUZPd16 : N2VDShuffle<0b01, 0b00010, "vuzp.16">; |
| 2710 | def VUZPd32 : N2VDShuffle<0b10, 0b00010, "vuzp.32">; |
| 2711 | |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2712 | def VUZPq8 : N2VQShuffle<0b00, 0b00010, IIC_VPERMQ3, "vuzp.8">; |
| 2713 | def VUZPq16 : N2VQShuffle<0b01, 0b00010, IIC_VPERMQ3, "vuzp.16">; |
| 2714 | def VUZPq32 : N2VQShuffle<0b10, 0b00010, IIC_VPERMQ3, "vuzp.32">; |
Bob Wilson | b6ab51e | 2009-08-08 06:13:25 +0000 | [diff] [blame] | 2715 | |
| 2716 | // VZIP : Vector Zip (Interleave) |
| 2717 | |
| 2718 | def VZIPd8 : N2VDShuffle<0b00, 0b00011, "vzip.8">; |
| 2719 | def VZIPd16 : N2VDShuffle<0b01, 0b00011, "vzip.16">; |
| 2720 | def VZIPd32 : N2VDShuffle<0b10, 0b00011, "vzip.32">; |
| 2721 | |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2722 | def VZIPq8 : N2VQShuffle<0b00, 0b00011, IIC_VPERMQ3, "vzip.8">; |
| 2723 | def VZIPq16 : N2VQShuffle<0b01, 0b00011, IIC_VPERMQ3, "vzip.16">; |
| 2724 | def VZIPq32 : N2VQShuffle<0b10, 0b00011, IIC_VPERMQ3, "vzip.32">; |
Bob Wilson | 64efd90 | 2009-08-08 05:53:00 +0000 | [diff] [blame] | 2725 | |
Bob Wilson | 114a266 | 2009-08-12 20:51:55 +0000 | [diff] [blame] | 2726 | // Vector Table Lookup and Table Extension. |
| 2727 | |
| 2728 | // VTBL : Vector Table Lookup |
| 2729 | def VTBL1 |
| 2730 | : N3V<1,1,0b11,0b1000,0,0, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2731 | (ins DPR:$tbl1, DPR:$src), IIC_VTB1, |
Bob Wilson | 114a266 | 2009-08-12 20:51:55 +0000 | [diff] [blame] | 2732 | "vtbl.8\t$dst, \\{$tbl1\\}, $src", "", |
| 2733 | [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl1 DPR:$tbl1, DPR:$src)))]>; |
Evan Cheng | 0d92f5f | 2009-10-01 08:22:27 +0000 | [diff] [blame] | 2734 | let hasExtraSrcRegAllocReq = 1 in { |
Bob Wilson | 114a266 | 2009-08-12 20:51:55 +0000 | [diff] [blame] | 2735 | def VTBL2 |
| 2736 | : N3V<1,1,0b11,0b1001,0,0, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2737 | (ins DPR:$tbl1, DPR:$tbl2, DPR:$src), IIC_VTB2, |
Bob Wilson | 114a266 | 2009-08-12 20:51:55 +0000 | [diff] [blame] | 2738 | "vtbl.8\t$dst, \\{$tbl1,$tbl2\\}, $src", "", |
| 2739 | [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl2 |
| 2740 | DPR:$tbl1, DPR:$tbl2, DPR:$src)))]>; |
| 2741 | def VTBL3 |
| 2742 | : N3V<1,1,0b11,0b1010,0,0, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2743 | (ins DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src), IIC_VTB3, |
Bob Wilson | 114a266 | 2009-08-12 20:51:55 +0000 | [diff] [blame] | 2744 | "vtbl.8\t$dst, \\{$tbl1,$tbl2,$tbl3\\}, $src", "", |
| 2745 | [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl3 |
| 2746 | DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src)))]>; |
| 2747 | def VTBL4 |
| 2748 | : N3V<1,1,0b11,0b1011,0,0, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2749 | (ins DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src), IIC_VTB4, |
Bob Wilson | 114a266 | 2009-08-12 20:51:55 +0000 | [diff] [blame] | 2750 | "vtbl.8\t$dst, \\{$tbl1,$tbl2,$tbl3,$tbl4\\}, $src", "", |
| 2751 | [(set DPR:$dst, (v8i8 (int_arm_neon_vtbl4 DPR:$tbl1, DPR:$tbl2, |
| 2752 | DPR:$tbl3, DPR:$tbl4, DPR:$src)))]>; |
Evan Cheng | 0d92f5f | 2009-10-01 08:22:27 +0000 | [diff] [blame] | 2753 | } // hasExtraSrcRegAllocReq = 1 |
Bob Wilson | 114a266 | 2009-08-12 20:51:55 +0000 | [diff] [blame] | 2754 | |
| 2755 | // VTBX : Vector Table Extension |
| 2756 | def VTBX1 |
| 2757 | : N3V<1,1,0b11,0b1000,1,0, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2758 | (ins DPR:$orig, DPR:$tbl1, DPR:$src), IIC_VTBX1, |
Bob Wilson | 114a266 | 2009-08-12 20:51:55 +0000 | [diff] [blame] | 2759 | "vtbx.8\t$dst, \\{$tbl1\\}, $src", "$orig = $dst", |
| 2760 | [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx1 |
| 2761 | DPR:$orig, DPR:$tbl1, DPR:$src)))]>; |
Evan Cheng | 0d92f5f | 2009-10-01 08:22:27 +0000 | [diff] [blame] | 2762 | let hasExtraSrcRegAllocReq = 1 in { |
Bob Wilson | 114a266 | 2009-08-12 20:51:55 +0000 | [diff] [blame] | 2763 | def VTBX2 |
| 2764 | : N3V<1,1,0b11,0b1001,1,0, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2765 | (ins DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$src), IIC_VTBX2, |
Bob Wilson | 114a266 | 2009-08-12 20:51:55 +0000 | [diff] [blame] | 2766 | "vtbx.8\t$dst, \\{$tbl1,$tbl2\\}, $src", "$orig = $dst", |
| 2767 | [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx2 |
| 2768 | DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$src)))]>; |
| 2769 | def VTBX3 |
| 2770 | : N3V<1,1,0b11,0b1010,1,0, (outs DPR:$dst), |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2771 | (ins DPR:$orig, DPR:$tbl1, DPR:$tbl2, DPR:$tbl3, DPR:$src), IIC_VTBX3, |
Bob Wilson | 114a266 | 2009-08-12 20:51:55 +0000 | [diff] [blame] | 2772 | "vtbx.8\t$dst, \\{$tbl1,$tbl2,$tbl3\\}, $src", "$orig = $dst", |
| 2773 | [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx3 DPR:$orig, DPR:$tbl1, |
| 2774 | DPR:$tbl2, DPR:$tbl3, DPR:$src)))]>; |
| 2775 | def VTBX4 |
| 2776 | : N3V<1,1,0b11,0b1011,1,0, (outs DPR:$dst), (ins DPR:$orig, DPR:$tbl1, |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2777 | DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src), IIC_VTBX4, |
Bob Wilson | 114a266 | 2009-08-12 20:51:55 +0000 | [diff] [blame] | 2778 | "vtbx.8\t$dst, \\{$tbl1,$tbl2,$tbl3,$tbl4\\}, $src", "$orig = $dst", |
| 2779 | [(set DPR:$dst, (v8i8 (int_arm_neon_vtbx4 DPR:$orig, DPR:$tbl1, |
| 2780 | DPR:$tbl2, DPR:$tbl3, DPR:$tbl4, DPR:$src)))]>; |
Evan Cheng | 0d92f5f | 2009-10-01 08:22:27 +0000 | [diff] [blame] | 2781 | } // hasExtraSrcRegAllocReq = 1 |
Bob Wilson | 114a266 | 2009-08-12 20:51:55 +0000 | [diff] [blame] | 2782 | |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2783 | //===----------------------------------------------------------------------===// |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 2784 | // NEON instructions for single-precision FP math |
| 2785 | //===----------------------------------------------------------------------===// |
| 2786 | |
| 2787 | // These need separate instructions because they must use DPR_VFP2 register |
| 2788 | // class which have SPR sub-registers. |
| 2789 | |
| 2790 | // Vector Add Operations used for single-precision FP |
| 2791 | let neverHasSideEffects = 1 in |
| 2792 | def VADDfd_sfp : N3VDs<0, 0, 0b00, 0b1101, 0, "vadd.f32", v2f32, v2f32, fadd,1>; |
| 2793 | def : N3VDsPat<fadd, VADDfd_sfp>; |
| 2794 | |
David Goodwin | 338268c | 2009-08-10 22:17:39 +0000 | [diff] [blame] | 2795 | // Vector Sub Operations used for single-precision FP |
| 2796 | let neverHasSideEffects = 1 in |
| 2797 | def VSUBfd_sfp : N3VDs<0, 0, 0b10, 0b1101, 0, "vsub.f32", v2f32, v2f32, fsub,0>; |
| 2798 | def : N3VDsPat<fsub, VSUBfd_sfp>; |
| 2799 | |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 2800 | // Vector Multiply Operations used for single-precision FP |
| 2801 | let neverHasSideEffects = 1 in |
| 2802 | def VMULfd_sfp : N3VDs<1, 0, 0b00, 0b1101, 1, "vmul.f32", v2f32, v2f32, fmul,1>; |
| 2803 | def : N3VDsPat<fmul, VMULfd_sfp>; |
| 2804 | |
| 2805 | // Vector Multiply-Accumulate/Subtract used for single-precision FP |
| 2806 | let neverHasSideEffects = 1 in |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2807 | def VMLAfd_sfp : N3VDMulOps<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla.f32", v2f32,fmul,fadd>; |
David Goodwin | 338268c | 2009-08-10 22:17:39 +0000 | [diff] [blame] | 2808 | def : N3VDMulOpsPat<fmul, fadd, VMLAfd_sfp>; |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 2809 | |
| 2810 | let neverHasSideEffects = 1 in |
David Goodwin | 658ea60 | 2009-09-25 18:38:29 +0000 | [diff] [blame] | 2811 | def VMLSfd_sfp : N3VDMulOps<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls.f32", v2f32,fmul,fsub>; |
David Goodwin | 338268c | 2009-08-10 22:17:39 +0000 | [diff] [blame] | 2812 | def : N3VDMulOpsPat<fmul, fsub, VMLSfd_sfp>; |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 2813 | |
David Goodwin | 338268c | 2009-08-10 22:17:39 +0000 | [diff] [blame] | 2814 | // Vector Absolute used for single-precision FP |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 2815 | let neverHasSideEffects = 1 in |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2816 | def VABSfd_sfp : N2VDInts<0b11, 0b11, 0b10, 0b01, 0b01110, 0, |
| 2817 | IIC_VUNAD, "vabs.f32", |
Bob Wilson | b0abb4d | 2009-08-11 05:39:44 +0000 | [diff] [blame] | 2818 | v2f32, v2f32, int_arm_neon_vabs>; |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 2819 | def : N2VDIntsPat<fabs, VABSfd_sfp>; |
| 2820 | |
David Goodwin | 338268c | 2009-08-10 22:17:39 +0000 | [diff] [blame] | 2821 | // Vector Negate used for single-precision FP |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 2822 | let neverHasSideEffects = 1 in |
| 2823 | def VNEGf32d_sfp : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0, |
David Goodwin | 127221f | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 2824 | (outs DPR_VFP2:$dst), (ins DPR_VFP2:$src), IIC_VUNAD, |
David Goodwin | 338268c | 2009-08-10 22:17:39 +0000 | [diff] [blame] | 2825 | "vneg.f32\t$dst, $src", "", []>; |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 2826 | def : N2VDIntsPat<fneg, VNEGf32d_sfp>; |
| 2827 | |
David Goodwin | 338268c | 2009-08-10 22:17:39 +0000 | [diff] [blame] | 2828 | // Vector Convert between single-precision FP and integer |
| 2829 | let neverHasSideEffects = 1 in |
| 2830 | def VCVTf2sd_sfp : N2VDs<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt.s32.f32", |
| 2831 | v2i32, v2f32, fp_to_sint>; |
| 2832 | def : N2VDsPat<arm_ftosi, f32, v2f32, VCVTf2sd_sfp>; |
| 2833 | |
| 2834 | let neverHasSideEffects = 1 in |
| 2835 | def VCVTf2ud_sfp : N2VDs<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt.u32.f32", |
| 2836 | v2i32, v2f32, fp_to_uint>; |
| 2837 | def : N2VDsPat<arm_ftoui, f32, v2f32, VCVTf2ud_sfp>; |
| 2838 | |
| 2839 | let neverHasSideEffects = 1 in |
David Goodwin | f35290c | 2009-08-11 01:07:38 +0000 | [diff] [blame] | 2840 | def VCVTs2fd_sfp : N2VDs<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt.f32.s32", |
| 2841 | v2f32, v2i32, sint_to_fp>; |
David Goodwin | 338268c | 2009-08-10 22:17:39 +0000 | [diff] [blame] | 2842 | def : N2VDsPat<arm_sitof, f32, v2i32, VCVTs2fd_sfp>; |
| 2843 | |
| 2844 | let neverHasSideEffects = 1 in |
David Goodwin | f35290c | 2009-08-11 01:07:38 +0000 | [diff] [blame] | 2845 | def VCVTu2fd_sfp : N2VDs<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt.f32.u32", |
| 2846 | v2f32, v2i32, uint_to_fp>; |
David Goodwin | 338268c | 2009-08-10 22:17:39 +0000 | [diff] [blame] | 2847 | def : N2VDsPat<arm_uitof, f32, v2i32, VCVTu2fd_sfp>; |
| 2848 | |
Evan Cheng | 1d2426c | 2009-08-07 19:30:41 +0000 | [diff] [blame] | 2849 | //===----------------------------------------------------------------------===// |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2850 | // Non-Instruction Patterns |
| 2851 | //===----------------------------------------------------------------------===// |
| 2852 | |
| 2853 | // bit_convert |
| 2854 | def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (v1i64 DPR:$src)>; |
| 2855 | def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (v1i64 DPR:$src)>; |
| 2856 | def : Pat<(v1i64 (bitconvert (v8i8 DPR:$src))), (v1i64 DPR:$src)>; |
| 2857 | def : Pat<(v1i64 (bitconvert (f64 DPR:$src))), (v1i64 DPR:$src)>; |
| 2858 | def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (v1i64 DPR:$src)>; |
| 2859 | def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (v2i32 DPR:$src)>; |
| 2860 | def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (v2i32 DPR:$src)>; |
| 2861 | def : Pat<(v2i32 (bitconvert (v8i8 DPR:$src))), (v2i32 DPR:$src)>; |
| 2862 | def : Pat<(v2i32 (bitconvert (f64 DPR:$src))), (v2i32 DPR:$src)>; |
| 2863 | def : Pat<(v2i32 (bitconvert (v2f32 DPR:$src))), (v2i32 DPR:$src)>; |
| 2864 | def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (v4i16 DPR:$src)>; |
| 2865 | def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (v4i16 DPR:$src)>; |
| 2866 | def : Pat<(v4i16 (bitconvert (v8i8 DPR:$src))), (v4i16 DPR:$src)>; |
| 2867 | def : Pat<(v4i16 (bitconvert (f64 DPR:$src))), (v4i16 DPR:$src)>; |
| 2868 | def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (v4i16 DPR:$src)>; |
| 2869 | def : Pat<(v8i8 (bitconvert (v1i64 DPR:$src))), (v8i8 DPR:$src)>; |
| 2870 | def : Pat<(v8i8 (bitconvert (v2i32 DPR:$src))), (v8i8 DPR:$src)>; |
| 2871 | def : Pat<(v8i8 (bitconvert (v4i16 DPR:$src))), (v8i8 DPR:$src)>; |
| 2872 | def : Pat<(v8i8 (bitconvert (f64 DPR:$src))), (v8i8 DPR:$src)>; |
| 2873 | def : Pat<(v8i8 (bitconvert (v2f32 DPR:$src))), (v8i8 DPR:$src)>; |
| 2874 | def : Pat<(f64 (bitconvert (v1i64 DPR:$src))), (f64 DPR:$src)>; |
| 2875 | def : Pat<(f64 (bitconvert (v2i32 DPR:$src))), (f64 DPR:$src)>; |
| 2876 | def : Pat<(f64 (bitconvert (v4i16 DPR:$src))), (f64 DPR:$src)>; |
| 2877 | def : Pat<(f64 (bitconvert (v8i8 DPR:$src))), (f64 DPR:$src)>; |
| 2878 | def : Pat<(f64 (bitconvert (v2f32 DPR:$src))), (f64 DPR:$src)>; |
| 2879 | def : Pat<(v2f32 (bitconvert (f64 DPR:$src))), (v2f32 DPR:$src)>; |
| 2880 | def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (v2f32 DPR:$src)>; |
| 2881 | def : Pat<(v2f32 (bitconvert (v2i32 DPR:$src))), (v2f32 DPR:$src)>; |
| 2882 | def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (v2f32 DPR:$src)>; |
| 2883 | def : Pat<(v2f32 (bitconvert (v8i8 DPR:$src))), (v2f32 DPR:$src)>; |
| 2884 | |
| 2885 | def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (v2i64 QPR:$src)>; |
| 2886 | def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (v2i64 QPR:$src)>; |
| 2887 | def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (v2i64 QPR:$src)>; |
| 2888 | def : Pat<(v2i64 (bitconvert (v2f64 QPR:$src))), (v2i64 QPR:$src)>; |
| 2889 | def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (v2i64 QPR:$src)>; |
| 2890 | def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (v4i32 QPR:$src)>; |
| 2891 | def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (v4i32 QPR:$src)>; |
| 2892 | def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (v4i32 QPR:$src)>; |
| 2893 | def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (v4i32 QPR:$src)>; |
| 2894 | def : Pat<(v4i32 (bitconvert (v4f32 QPR:$src))), (v4i32 QPR:$src)>; |
| 2895 | def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (v8i16 QPR:$src)>; |
| 2896 | def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (v8i16 QPR:$src)>; |
| 2897 | def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (v8i16 QPR:$src)>; |
| 2898 | def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (v8i16 QPR:$src)>; |
| 2899 | def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (v8i16 QPR:$src)>; |
| 2900 | def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (v16i8 QPR:$src)>; |
| 2901 | def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (v16i8 QPR:$src)>; |
| 2902 | def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (v16i8 QPR:$src)>; |
| 2903 | def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (v16i8 QPR:$src)>; |
| 2904 | def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (v16i8 QPR:$src)>; |
| 2905 | def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (v4f32 QPR:$src)>; |
| 2906 | def : Pat<(v4f32 (bitconvert (v4i32 QPR:$src))), (v4f32 QPR:$src)>; |
| 2907 | def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (v4f32 QPR:$src)>; |
| 2908 | def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (v4f32 QPR:$src)>; |
| 2909 | def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (v4f32 QPR:$src)>; |
| 2910 | def : Pat<(v2f64 (bitconvert (v2i64 QPR:$src))), (v2f64 QPR:$src)>; |
| 2911 | def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (v2f64 QPR:$src)>; |
| 2912 | def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (v2f64 QPR:$src)>; |
| 2913 | def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (v2f64 QPR:$src)>; |
| 2914 | def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (v2f64 QPR:$src)>; |