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