Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 1 | //===- PPCInstrVSX.td - The PowerPC VSX Extension --*- tablegen -*-===// |
| 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 VSX extension to the PowerPC instruction set. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | def PPCRegVSRCAsmOperand : AsmOperandClass { |
| 15 | let Name = "RegVSRC"; let PredicateMethod = "isVSRegNumber"; |
| 16 | } |
| 17 | def vsrc : RegisterOperand<VSRC> { |
| 18 | let ParserMatchClass = PPCRegVSRCAsmOperand; |
| 19 | } |
| 20 | |
| 21 | multiclass XX3Form_Rcr<bits<6> opcode, bits<7> xo, dag OOL, dag IOL, |
| 22 | string asmbase, string asmstr, InstrItinClass itin, |
| 23 | list<dag> pattern> { |
| 24 | let BaseName = asmbase in { |
| 25 | def NAME : XX3Form_Rc<opcode, xo, OOL, IOL, |
| 26 | !strconcat(asmbase, !strconcat(" ", asmstr)), itin, |
| 27 | pattern>; |
| 28 | let Defs = [CR6] in |
| 29 | def o : XX3Form_Rc<opcode, xo, OOL, IOL, |
| 30 | !strconcat(asmbase, !strconcat(". ", asmstr)), itin, |
| 31 | []>, isDOT; |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | def HasVSX : Predicate<"PPCSubTarget.hasVSX()">; |
| 36 | let Predicates = [HasVSX] in { |
| 37 | let AddedComplexity = 400 in { // Prefer VSX patterns over non-VSX patterns. |
| 38 | let neverHasSideEffects = 1 in { // VSX instructions don't have side effects. |
| 39 | let Uses = [RM] in { |
| 40 | |
| 41 | // Load indexed instructions |
| 42 | let mayLoad = 1, canFoldAsLoad = 1 in { |
| 43 | def LXSDX : XForm_1<31, 588, |
| 44 | (outs vsrc:$XT), (ins memrr:$src), |
| 45 | "lxsdx $XT, $src", IIC_LdStLFD, |
| 46 | [(set f64:$XT, (load xoaddr:$src))]>; |
| 47 | |
| 48 | def LXVD2X : XForm_1<31, 844, |
| 49 | (outs vsrc:$XT), (ins memrr:$src), |
| 50 | "lxvd2x $XT, $src", IIC_LdStLFD, |
| 51 | [(set v2f64:$XT, (load xoaddr:$src))]>; |
| 52 | |
| 53 | def LXVDSX : XForm_1<31, 332, |
| 54 | (outs vsrc:$XT), (ins memrr:$src), |
| 55 | "lxvdsx $XT, $src", IIC_LdStLFD, []>; |
| 56 | // TODO: match load + splat to lxvdsx. |
| 57 | |
| 58 | def LXVW4X : XForm_1<31, 780, |
| 59 | (outs vsrc:$XT), (ins memrr:$src), |
| 60 | "lxvw4x $XT, $src", IIC_LdStLFD, |
| 61 | [(set v4f32:$XT, (load xoaddr:$src))]>; |
| 62 | } |
| 63 | |
| 64 | // Store indexed instructions |
| 65 | let mayStore = 1 in { |
| 66 | def STXSDX : XX1Form<31, 716, |
| 67 | (outs), (ins vsrc:$XT, memrr:$dst), |
| 68 | "stxsdx $XT, $dst", IIC_LdStSTFD, |
| 69 | [(store f64:$XT, xoaddr:$dst)]>; |
| 70 | |
| 71 | def STXVD2X : XX1Form<31, 972, |
| 72 | (outs), (ins vsrc:$XT, memrr:$dst), |
| 73 | "stxvd2x $XT, $dst", IIC_LdStSTFD, |
| 74 | [(store v2f64:$XT, xoaddr:$dst)]>; |
| 75 | |
| 76 | def STXVW4X : XX1Form<31, 908, |
| 77 | (outs), (ins vsrc:$XT, memrr:$dst), |
| 78 | "stxvw4x $XT, $dst", IIC_LdStSTFD, |
| 79 | [(store v4f32:$XT, xoaddr:$dst)]>; |
| 80 | } |
| 81 | |
| 82 | // Add/Mul Instructions |
| 83 | let isCommutable = 1 in { |
| 84 | def XSADDDP : XX3Form<60, 32, |
| 85 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 86 | "xsadddp $XT, $XA, $XB", IIC_VecFP, |
| 87 | [(set f64:$XT, (fadd f64:$XA, f64:$XB))]>; |
| 88 | def XSMULDP : XX3Form<60, 48, |
| 89 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 90 | "xsmuldp $XT, $XA, $XB", IIC_VecFP, |
| 91 | [(set f64:$XT, (fmul f64:$XA, f64:$XB))]>; |
| 92 | |
| 93 | def XVADDDP : XX3Form<60, 96, |
| 94 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 95 | "xvadddp $XT, $XA, $XB", IIC_VecFP, |
| 96 | [(set v2f64:$XT, (fadd v2f64:$XA, v2f64:$XB))]>; |
| 97 | |
| 98 | def XVADDSP : XX3Form<60, 64, |
| 99 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 100 | "xvaddsp $XT, $XA, $XB", IIC_VecFP, |
| 101 | [(set v4f32:$XT, (fadd v4f32:$XA, v4f32:$XB))]>; |
| 102 | |
| 103 | def XVMULDP : XX3Form<60, 112, |
| 104 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 105 | "xvmuldp $XT, $XA, $XB", IIC_VecFP, |
| 106 | [(set v2f64:$XT, (fmul v2f64:$XA, v2f64:$XB))]>; |
| 107 | |
| 108 | def XVMULSP : XX3Form<60, 80, |
| 109 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 110 | "xvmulsp $XT, $XA, $XB", IIC_VecFP, |
| 111 | [(set v4f32:$XT, (fmul v4f32:$XA, v4f32:$XB))]>; |
| 112 | } |
| 113 | |
| 114 | // Subtract Instructions |
| 115 | def XSSUBDP : XX3Form<60, 40, |
| 116 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 117 | "xssubdp $XT, $XA, $XB", IIC_VecFP, |
| 118 | [(set f64:$XT, (fsub f64:$XA, f64:$XB))]>; |
| 119 | |
| 120 | def XVSUBDP : XX3Form<60, 104, |
| 121 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 122 | "xvsubdp $XT, $XA, $XB", IIC_VecFP, |
| 123 | [(set v2f64:$XT, (fsub v2f64:$XA, v2f64:$XB))]>; |
| 124 | def XVSUBSP : XX3Form<60, 72, |
| 125 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 126 | "xvsubsp $XT, $XA, $XB", IIC_VecFP, |
| 127 | [(set v4f32:$XT, (fsub v4f32:$XA, v4f32:$XB))]>; |
| 128 | |
| 129 | // FMA Instructions |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 130 | let isCommutable = 1 in |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 131 | def XSMADDADP : XX3Form<60, 33, |
| 132 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 133 | "xsmaddadp $XT, $XA, $XB", IIC_VecFP, |
| 134 | [(set f64:$XT, (fma f64:$XA, f64:$XB, f64:$XTi))]>, |
| 135 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 136 | def XSMADDMDP : XX3Form<60, 41, |
| 137 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 138 | "xsmaddmdp $XT, $XA, $XB", IIC_VecFP, []>, |
| 139 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 140 | // TODO: Select between these based first on whether one of the operands has |
| 141 | // no further uses. We probably want to do this after scheduling but before |
| 142 | // register allocation. |
| 143 | |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 144 | let isCommutable = 1 in |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 145 | def XSMSUBADP : XX3Form<60, 49, |
| 146 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 147 | "xsmsubadp $XT, $XA, $XB", IIC_VecFP, |
| 148 | [(set f64:$XT, (fma f64:$XA, f64:$XB, (fneg f64:$XTi)))]>, |
| 149 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 150 | def XSMSUBMDP : XX3Form<60, 57, |
| 151 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 152 | "xsmsubmdp $XT, $XA, $XB", IIC_VecFP, []>, |
| 153 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 154 | |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 155 | let isCommutable = 1 in |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 156 | def XSNMADDADP : XX3Form<60, 161, |
| 157 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 158 | "xsnmaddadp $XT, $XA, $XB", IIC_VecFP, |
| 159 | [(set f64:$XT, (fneg (fma f64:$XA, f64:$XB, f64:$XTi)))]>, |
| 160 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 161 | def XSNMADDMDP : XX3Form<60, 169, |
| 162 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 163 | "xsnmaddmdp $XT, $XA, $XB", IIC_VecFP, []>, |
| 164 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 165 | |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 166 | let isCommutable = 1 in |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 167 | def XSNMSUBADP : XX3Form<60, 177, |
| 168 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 169 | "xsnmsubadp $XT, $XA, $XB", IIC_VecFP, |
| 170 | [(set f64:$XT, (fneg (fma f64:$XA, f64:$XB, (fneg f64:$XTi))))]>, |
| 171 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 172 | def XSNMSUBMDP : XX3Form<60, 185, |
| 173 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 174 | "xsnmsubmdp $XT, $XA, $XB", IIC_VecFP, []>, |
| 175 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 176 | |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 177 | let isCommutable = 1 in |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 178 | def XVMADDADP : XX3Form<60, 97, |
| 179 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 180 | "xvmaddadp $XT, $XA, $XB", IIC_VecFP, |
| 181 | [(set v2f64:$XT, (fma v2f64:$XA, v2f64:$XB, v2f64:$XTi))]>, |
| 182 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 183 | def XVMADDMDP : XX3Form<60, 105, |
| 184 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 185 | "xvmaddmdp $XT, $XA, $XB", IIC_VecFP, []>, |
| 186 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 187 | |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 188 | let isCommutable = 1 in |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 189 | def XVMADDASP : XX3Form<60, 65, |
| 190 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 191 | "xvmaddasp $XT, $XA, $XB", IIC_VecFP, |
| 192 | [(set v4f32:$XT, (fma v4f32:$XA, v4f32:$XB, v4f32:$XTi))]>, |
| 193 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 194 | def XVMADDMSP : XX3Form<60, 73, |
| 195 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 196 | "xvmaddmsp $XT, $XA, $XB", IIC_VecFP, []>, |
| 197 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 198 | |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 199 | let isCommutable = 1 in |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 200 | def XVMSUBADP : XX3Form<60, 113, |
| 201 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 202 | "xvmsubadp $XT, $XA, $XB", IIC_VecFP, |
| 203 | [(set v2f64:$XT, (fma v2f64:$XA, v2f64:$XB, (fneg v2f64:$XTi)))]>, |
| 204 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 205 | def XVMSUBMDP : XX3Form<60, 121, |
| 206 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 207 | "xvmsubmdp $XT, $XA, $XB", IIC_VecFP, []>, |
| 208 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 209 | |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 210 | let isCommutable = 1 in |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 211 | def XVMSUBASP : XX3Form<60, 81, |
| 212 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 213 | "xvmsubasp $XT, $XA, $XB", IIC_VecFP, |
| 214 | [(set v4f32:$XT, (fma v4f32:$XA, v4f32:$XB, (fneg v4f32:$XTi)))]>, |
| 215 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 216 | def XVMSUBMSP : XX3Form<60, 89, |
| 217 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 218 | "xvmsubmsp $XT, $XA, $XB", IIC_VecFP, []>, |
| 219 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 220 | |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 221 | let isCommutable = 1 in |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 222 | def XVNMADDADP : XX3Form<60, 225, |
| 223 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 224 | "xvnmaddadp $XT, $XA, $XB", IIC_VecFP, |
| 225 | [(set v2f64:$XT, (fneg (fma v2f64:$XA, v2f64:$XB, v2f64:$XTi)))]>, |
| 226 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 227 | def XVNMADDMDP : XX3Form<60, 233, |
| 228 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 229 | "xvnmaddmdp $XT, $XA, $XB", IIC_VecFP, []>, |
| 230 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 231 | |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 232 | let isCommutable = 1 in |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 233 | def XVNMADDASP : XX3Form<60, 193, |
| 234 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 235 | "xvnmaddasp $XT, $XA, $XB", IIC_VecFP, |
| 236 | [(set v4f32:$XT, (fneg (fma v4f32:$XA, v4f32:$XB, v4f32:$XTi)))]>, |
| 237 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 238 | def XVNMADDMSP : XX3Form<60, 201, |
| 239 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 240 | "xvnmaddmsp $XT, $XA, $XB", IIC_VecFP, []>, |
| 241 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 242 | |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 243 | let isCommutable = 1 in |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 244 | def XVNMSUBADP : XX3Form<60, 241, |
| 245 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 246 | "xvnmsubadp $XT, $XA, $XB", IIC_VecFP, |
| 247 | [(set v2f64:$XT, (fneg (fma v2f64:$XA, v2f64:$XB, (fneg v2f64:$XTi))))]>, |
| 248 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 249 | def XVNMSUBMDP : XX3Form<60, 249, |
| 250 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 251 | "xvnmsubmdp $XT, $XA, $XB", IIC_VecFP, []>, |
| 252 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 253 | |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 254 | let isCommutable = 1 in |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 255 | def XVNMSUBASP : XX3Form<60, 209, |
| 256 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 257 | "xvnmsubasp $XT, $XA, $XB", IIC_VecFP, |
| 258 | [(set v4f32:$XT, (fneg (fma v4f32:$XA, v4f32:$XB, (fneg v4f32:$XTi))))]>, |
| 259 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 260 | def XVNMSUBMSP : XX3Form<60, 217, |
| 261 | (outs vsrc:$XT), (ins vsrc:$XTi, vsrc:$XA, vsrc:$XB), |
| 262 | "xvnmsubmsp $XT, $XA, $XB", IIC_VecFP, []>, |
| 263 | RegConstraint<"$XTi = $XT">, NoEncode<"$XTi">; |
| 264 | |
| 265 | // Division Instructions |
| 266 | def XSDIVDP : XX3Form<60, 56, |
| 267 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 268 | "xsdivdp $XT, $XA, $XB", IIC_VecFP, |
| 269 | [(set f64:$XT, (fdiv f64:$XA, f64:$XB))]>; |
| 270 | def XSSQRTDP : XX2Form<60, 75, |
| 271 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 272 | "xssqrtdp $XT, $XB", IIC_VecFP, |
| 273 | [(set f64:$XT, (fsqrt f64:$XB))]>; |
| 274 | |
| 275 | def XSREDP : XX2Form<60, 90, |
| 276 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 277 | "xsredp $XT, $XB", IIC_VecFP, |
| 278 | [(set f64:$XT, (PPCfre f64:$XB))]>; |
| 279 | def XSRSQRTEDP : XX2Form<60, 74, |
| 280 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 281 | "xsrsqrtedp $XT, $XB", IIC_VecFP, |
| 282 | [(set f64:$XT, (PPCfrsqrte f64:$XB))]>; |
| 283 | |
| 284 | def XSTDIVDP : XX3Form_1<60, 61, |
| 285 | (outs crrc:$crD), (ins vsrc:$XA, vsrc:$XB), |
| 286 | "xstdivdp $crD, $XA, $XB", IIC_VecFP, []>; |
| 287 | def XSTSQRTDP : XX2Form_1<60, 106, |
| 288 | (outs crrc:$crD), (ins vsrc:$XB), |
| 289 | "xstsqrtdp $crD, $XB", IIC_VecFP, []>; |
| 290 | |
| 291 | def XVDIVDP : XX3Form<60, 120, |
| 292 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 293 | "xvdivdp $XT, $XA, $XB", IIC_VecFP, |
| 294 | [(set v2f64:$XT, (fdiv v2f64:$XA, v2f64:$XB))]>; |
| 295 | def XVDIVSP : XX3Form<60, 88, |
| 296 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 297 | "xvdivsp $XT, $XA, $XB", IIC_VecFP, |
| 298 | [(set v4f32:$XT, (fdiv v4f32:$XA, v4f32:$XB))]>; |
| 299 | |
| 300 | def XVSQRTDP : XX2Form<60, 203, |
| 301 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 302 | "xvsqrtdp $XT, $XB", IIC_VecFP, |
| 303 | [(set v2f64:$XT, (fsqrt v2f64:$XB))]>; |
| 304 | def XVSQRTSP : XX2Form<60, 139, |
| 305 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 306 | "xvsqrtsp $XT, $XB", IIC_VecFP, |
| 307 | [(set v4f32:$XT, (fsqrt v4f32:$XB))]>; |
| 308 | |
| 309 | def XVTDIVDP : XX3Form_1<60, 125, |
| 310 | (outs crrc:$crD), (ins vsrc:$XA, vsrc:$XB), |
| 311 | "xvtdivdp $crD, $XA, $XB", IIC_VecFP, []>; |
| 312 | def XVTDIVSP : XX3Form_1<60, 93, |
| 313 | (outs crrc:$crD), (ins vsrc:$XA, vsrc:$XB), |
| 314 | "xvtdivsp $crD, $XA, $XB", IIC_VecFP, []>; |
| 315 | |
| 316 | def XVTSQRTDP : XX2Form_1<60, 234, |
| 317 | (outs crrc:$crD), (ins vsrc:$XB), |
| 318 | "xvtsqrtdp $crD, $XB", IIC_VecFP, []>; |
| 319 | def XVTSQRTSP : XX2Form_1<60, 170, |
| 320 | (outs crrc:$crD), (ins vsrc:$XB), |
| 321 | "xvtsqrtsp $crD, $XB", IIC_VecFP, []>; |
| 322 | |
| 323 | def XVREDP : XX2Form<60, 218, |
| 324 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 325 | "xvredp $XT, $XB", IIC_VecFP, |
| 326 | [(set v2f64:$XT, (PPCfre v2f64:$XB))]>; |
| 327 | def XVRESP : XX2Form<60, 154, |
| 328 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 329 | "xvresp $XT, $XB", IIC_VecFP, |
| 330 | [(set v4f32:$XT, (PPCfre v4f32:$XB))]>; |
| 331 | |
| 332 | def XVRSQRTEDP : XX2Form<60, 202, |
| 333 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 334 | "xvrsqrtedp $XT, $XB", IIC_VecFP, |
| 335 | [(set v2f64:$XT, (PPCfrsqrte v2f64:$XB))]>; |
| 336 | def XVRSQRTESP : XX2Form<60, 138, |
| 337 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 338 | "xvrsqrtesp $XT, $XB", IIC_VecFP, |
| 339 | [(set v4f32:$XT, (PPCfrsqrte v4f32:$XB))]>; |
| 340 | |
| 341 | // Compare Instructions |
| 342 | def XSCMPODP : XX3Form_1<60, 43, |
| 343 | (outs crrc:$crD), (ins vsrc:$XA, vsrc:$XB), |
| 344 | "xscmpodp $crD, $XA, $XB", IIC_VecFPCompare, []>; |
| 345 | def XSCMPUDP : XX3Form_1<60, 35, |
| 346 | (outs crrc:$crD), (ins vsrc:$XA, vsrc:$XB), |
| 347 | "xscmpudp $crD, $XA, $XB", IIC_VecFPCompare, []>; |
| 348 | |
| 349 | defm XVCMPEQDP : XX3Form_Rcr<60, 99, |
| 350 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 351 | "xvcmpeqdp", "$XT, $XA, $XB", IIC_VecFPCompare, []>; |
| 352 | defm XVCMPEQSP : XX3Form_Rcr<60, 67, |
| 353 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 354 | "xvcmpeqsp", "$XT, $XA, $XB", IIC_VecFPCompare, []>; |
| 355 | defm XVCMPGEDP : XX3Form_Rcr<60, 115, |
| 356 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 357 | "xvcmpgedp", "$XT, $XA, $XB", IIC_VecFPCompare, []>; |
| 358 | defm XVCMPGESP : XX3Form_Rcr<60, 83, |
| 359 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 360 | "xvcmpgesp", "$XT, $XA, $XB", IIC_VecFPCompare, []>; |
| 361 | defm XVCMPGTDP : XX3Form_Rcr<60, 107, |
| 362 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 363 | "xvcmpgtdp", "$XT, $XA, $XB", IIC_VecFPCompare, []>; |
| 364 | defm XVCMPGTSP : XX3Form_Rcr<60, 75, |
| 365 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 366 | "xvcmpgtsp", "$XT, $XA, $XB", IIC_VecFPCompare, []>; |
| 367 | |
| 368 | // Move Instructions |
| 369 | def XSABSDP : XX2Form<60, 345, |
| 370 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 371 | "xsabsdp $XT, $XB", IIC_VecFP, |
| 372 | [(set f64:$XT, (fabs f64:$XB))]>; |
| 373 | def XSNABSDP : XX2Form<60, 361, |
| 374 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 375 | "xsnabsdp $XT, $XB", IIC_VecFP, |
| 376 | [(set f64:$XT, (fneg (fabs f64:$XB)))]>; |
| 377 | def XSNEGDP : XX2Form<60, 377, |
| 378 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 379 | "xsnegdp $XT, $XB", IIC_VecFP, |
| 380 | [(set f64:$XT, (fneg f64:$XB))]>; |
| 381 | def XSCPSGNDP : XX3Form<60, 176, |
| 382 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 383 | "xscpsgndp $XT, $XA, $XB", IIC_VecFP, |
| 384 | [(set f64:$XT, (fcopysign f64:$XB, f64:$XA))]>; |
| 385 | |
| 386 | def XVABSDP : XX2Form<60, 473, |
| 387 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 388 | "xvabsdp $XT, $XB", IIC_VecFP, |
| 389 | [(set v2f64:$XT, (fabs v2f64:$XB))]>; |
| 390 | |
| 391 | def XVABSSP : XX2Form<60, 409, |
| 392 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 393 | "xvabssp $XT, $XB", IIC_VecFP, |
| 394 | [(set v4f32:$XT, (fabs v4f32:$XB))]>; |
| 395 | |
| 396 | def XVCPSGNDP : XX3Form<60, 240, |
| 397 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 398 | "xvcpsgndp $XT, $XA, $XB", IIC_VecFP, |
| 399 | [(set v2f64:$XT, (fcopysign v2f64:$XB, v2f64:$XA))]>; |
| 400 | def XVCPSGNSP : XX3Form<60, 208, |
| 401 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 402 | "xvcpsgnsp $XT, $XA, $XB", IIC_VecFP, |
| 403 | [(set v4f32:$XT, (fcopysign v4f32:$XB, v4f32:$XA))]>; |
| 404 | |
| 405 | def XVNABSDP : XX2Form<60, 489, |
| 406 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 407 | "xvnabsdp $XT, $XB", IIC_VecFP, |
| 408 | [(set v2f64:$XT, (fneg (fabs v2f64:$XB)))]>; |
| 409 | def XVNABSSP : XX2Form<60, 425, |
| 410 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 411 | "xvnabssp $XT, $XB", IIC_VecFP, |
| 412 | [(set v4f32:$XT, (fneg (fabs v4f32:$XB)))]>; |
| 413 | |
| 414 | def XVNEGDP : XX2Form<60, 505, |
| 415 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 416 | "xvnegdp $XT, $XB", IIC_VecFP, |
| 417 | [(set v2f64:$XT, (fneg v2f64:$XB))]>; |
| 418 | def XVNEGSP : XX2Form<60, 441, |
| 419 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 420 | "xvnegsp $XT, $XB", IIC_VecFP, |
| 421 | [(set v4f32:$XT, (fneg v4f32:$XB))]>; |
| 422 | |
| 423 | // Conversion Instructions |
| 424 | def XSCVDPSP : XX2Form<60, 265, |
| 425 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 426 | "xscvdpsp $XT, $XB", IIC_VecFP, []>; |
| 427 | def XSCVDPSXDS : XX2Form<60, 344, |
| 428 | (outs vsrc:$XT), (ins vsrc:$XB), |
Hal Finkel | 4a91225 | 2014-03-23 05:35:00 +0000 | [diff] [blame] | 429 | "xscvdpsxds $XT, $XB", IIC_VecFP, |
| 430 | [(set f64:$XT, (PPCfctidz f64:$XB))]>; |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 431 | def XSCVDPSXWS : XX2Form<60, 88, |
| 432 | (outs vsrc:$XT), (ins vsrc:$XB), |
Hal Finkel | 4a91225 | 2014-03-23 05:35:00 +0000 | [diff] [blame] | 433 | "xscvdpsxws $XT, $XB", IIC_VecFP, |
| 434 | [(set f64:$XT, (PPCfctiwz f64:$XB))]>; |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 435 | def XSCVDPUXDS : XX2Form<60, 328, |
| 436 | (outs vsrc:$XT), (ins vsrc:$XB), |
Hal Finkel | 4a91225 | 2014-03-23 05:35:00 +0000 | [diff] [blame] | 437 | "xscvdpuxds $XT, $XB", IIC_VecFP, |
| 438 | [(set f64:$XT, (PPCfctiduz f64:$XB))]>; |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 439 | def XSCVDPUXWS : XX2Form<60, 72, |
| 440 | (outs vsrc:$XT), (ins vsrc:$XB), |
Hal Finkel | 4a91225 | 2014-03-23 05:35:00 +0000 | [diff] [blame] | 441 | "xscvdpuxws $XT, $XB", IIC_VecFP, |
| 442 | [(set f64:$XT, (PPCfctiwuz f64:$XB))]>; |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 443 | def XSCVSPDP : XX2Form<60, 329, |
| 444 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 445 | "xscvspdp $XT, $XB", IIC_VecFP, []>; |
| 446 | def XSCVSXDDP : XX2Form<60, 376, |
| 447 | (outs vsrc:$XT), (ins vsrc:$XB), |
Hal Finkel | 4a91225 | 2014-03-23 05:35:00 +0000 | [diff] [blame] | 448 | "xscvsxddp $XT, $XB", IIC_VecFP, |
| 449 | [(set f64:$XT, (PPCfcfid f64:$XB))]>; |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 450 | def XSCVUXDDP : XX2Form<60, 360, |
| 451 | (outs vsrc:$XT), (ins vsrc:$XB), |
Hal Finkel | 4a91225 | 2014-03-23 05:35:00 +0000 | [diff] [blame] | 452 | "xscvuxddp $XT, $XB", IIC_VecFP, |
| 453 | [(set f64:$XT, (PPCfcfidu f64:$XB))]>; |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 454 | |
| 455 | def XVCVDPSP : XX2Form<60, 393, |
| 456 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 457 | "xvcvdpsp $XT, $XB", IIC_VecFP, []>; |
| 458 | def XVCVDPSXDS : XX2Form<60, 472, |
| 459 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 460 | "xvcvdpsxds $XT, $XB", IIC_VecFP, []>; |
| 461 | def XVCVDPSXWS : XX2Form<60, 216, |
| 462 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 463 | "xvcvdpsxws $XT, $XB", IIC_VecFP, []>; |
| 464 | def XVCVDPUXDS : XX2Form<60, 456, |
| 465 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 466 | "xvcvdpuxds $XT, $XB", IIC_VecFP, []>; |
| 467 | def XVCVDPUXWS : XX2Form<60, 200, |
| 468 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 469 | "xvcvdpuxws $XT, $XB", IIC_VecFP, []>; |
| 470 | |
| 471 | def XVCVSPDP : XX2Form<60, 457, |
| 472 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 473 | "xvcvspdp $XT, $XB", IIC_VecFP, []>; |
| 474 | def XVCVSPSXDS : XX2Form<60, 408, |
| 475 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 476 | "xvcvspsxds $XT, $XB", IIC_VecFP, []>; |
| 477 | def XVCVSPSXWS : XX2Form<60, 152, |
| 478 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 479 | "xvcvspsxws $XT, $XB", IIC_VecFP, []>; |
| 480 | def XVCVSPUXDS : XX2Form<60, 392, |
| 481 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 482 | "xvcvspuxds $XT, $XB", IIC_VecFP, []>; |
| 483 | def XVCVSPUXWS : XX2Form<60, 136, |
| 484 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 485 | "xvcvspuxws $XT, $XB", IIC_VecFP, []>; |
| 486 | def XVCVSXDDP : XX2Form<60, 504, |
| 487 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 488 | "xvcvsxddp $XT, $XB", IIC_VecFP, []>; |
| 489 | def XVCVSXDSP : XX2Form<60, 440, |
| 490 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 491 | "xvcvsxdsp $XT, $XB", IIC_VecFP, []>; |
| 492 | def XVCVSXWDP : XX2Form<60, 248, |
| 493 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 494 | "xvcvsxwdp $XT, $XB", IIC_VecFP, []>; |
| 495 | def XVCVSXWSP : XX2Form<60, 184, |
| 496 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 497 | "xvcvsxwsp $XT, $XB", IIC_VecFP, []>; |
| 498 | def XVCVUXDDP : XX2Form<60, 488, |
| 499 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 500 | "xvcvuxddp $XT, $XB", IIC_VecFP, []>; |
| 501 | def XVCVUXDSP : XX2Form<60, 424, |
| 502 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 503 | "xvcvuxdsp $XT, $XB", IIC_VecFP, []>; |
| 504 | def XVCVUXWDP : XX2Form<60, 232, |
| 505 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 506 | "xvcvuxwdp $XT, $XB", IIC_VecFP, []>; |
| 507 | def XVCVUXWSP : XX2Form<60, 168, |
| 508 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 509 | "xvcvuxwsp $XT, $XB", IIC_VecFP, []>; |
| 510 | |
| 511 | // Rounding Instructions |
| 512 | def XSRDPI : XX2Form<60, 73, |
| 513 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 514 | "xsrdpi $XT, $XB", IIC_VecFP, |
| 515 | [(set f64:$XT, (frnd f64:$XB))]>; |
| 516 | def XSRDPIC : XX2Form<60, 107, |
| 517 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 518 | "xsrdpic $XT, $XB", IIC_VecFP, |
| 519 | [(set f64:$XT, (fnearbyint f64:$XB))]>; |
| 520 | def XSRDPIM : XX2Form<60, 121, |
| 521 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 522 | "xsrdpim $XT, $XB", IIC_VecFP, |
| 523 | [(set f64:$XT, (ffloor f64:$XB))]>; |
| 524 | def XSRDPIP : XX2Form<60, 105, |
| 525 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 526 | "xsrdpip $XT, $XB", IIC_VecFP, |
| 527 | [(set f64:$XT, (fceil f64:$XB))]>; |
| 528 | def XSRDPIZ : XX2Form<60, 89, |
| 529 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 530 | "xsrdpiz $XT, $XB", IIC_VecFP, |
| 531 | [(set f64:$XT, (ftrunc f64:$XB))]>; |
| 532 | |
| 533 | def XVRDPI : XX2Form<60, 201, |
| 534 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 535 | "xvrdpi $XT, $XB", IIC_VecFP, |
| 536 | [(set v2f64:$XT, (frnd v2f64:$XB))]>; |
| 537 | def XVRDPIC : XX2Form<60, 235, |
| 538 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 539 | "xvrdpic $XT, $XB", IIC_VecFP, |
| 540 | [(set v2f64:$XT, (fnearbyint v2f64:$XB))]>; |
| 541 | def XVRDPIM : XX2Form<60, 249, |
| 542 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 543 | "xvrdpim $XT, $XB", IIC_VecFP, |
| 544 | [(set v2f64:$XT, (ffloor v2f64:$XB))]>; |
| 545 | def XVRDPIP : XX2Form<60, 233, |
| 546 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 547 | "xvrdpip $XT, $XB", IIC_VecFP, |
| 548 | [(set v2f64:$XT, (fceil v2f64:$XB))]>; |
| 549 | def XVRDPIZ : XX2Form<60, 217, |
| 550 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 551 | "xvrdpiz $XT, $XB", IIC_VecFP, |
| 552 | [(set v2f64:$XT, (ftrunc v2f64:$XB))]>; |
| 553 | |
| 554 | def XVRSPI : XX2Form<60, 137, |
| 555 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 556 | "xvrspi $XT, $XB", IIC_VecFP, |
| 557 | [(set v4f32:$XT, (frnd v4f32:$XB))]>; |
| 558 | def XVRSPIC : XX2Form<60, 171, |
| 559 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 560 | "xvrspic $XT, $XB", IIC_VecFP, |
| 561 | [(set v4f32:$XT, (fnearbyint v4f32:$XB))]>; |
| 562 | def XVRSPIM : XX2Form<60, 185, |
| 563 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 564 | "xvrspim $XT, $XB", IIC_VecFP, |
| 565 | [(set v4f32:$XT, (ffloor v4f32:$XB))]>; |
| 566 | def XVRSPIP : XX2Form<60, 169, |
| 567 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 568 | "xvrspip $XT, $XB", IIC_VecFP, |
| 569 | [(set v4f32:$XT, (fceil v4f32:$XB))]>; |
| 570 | def XVRSPIZ : XX2Form<60, 153, |
| 571 | (outs vsrc:$XT), (ins vsrc:$XB), |
| 572 | "xvrspiz $XT, $XB", IIC_VecFP, |
| 573 | [(set v4f32:$XT, (ftrunc v4f32:$XB))]>; |
| 574 | |
| 575 | // Max/Min Instructions |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 576 | let isCommutable = 1 in { |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 577 | def XSMAXDP : XX3Form<60, 160, |
| 578 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 579 | "xsmaxdp $XT, $XA, $XB", IIC_VecFP, []>; |
| 580 | def XSMINDP : XX3Form<60, 168, |
| 581 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 582 | "xsmindp $XT, $XA, $XB", IIC_VecFP, []>; |
| 583 | |
| 584 | def XVMAXDP : XX3Form<60, 224, |
| 585 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 586 | "xvmaxdp $XT, $XA, $XB", IIC_VecFP, []>; |
| 587 | def XVMINDP : XX3Form<60, 232, |
| 588 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 589 | "xvmindp $XT, $XA, $XB", IIC_VecFP, []>; |
| 590 | |
| 591 | def XVMAXSP : XX3Form<60, 192, |
| 592 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 593 | "xvmaxsp $XT, $XA, $XB", IIC_VecFP, []>; |
| 594 | def XVMINSP : XX3Form<60, 200, |
| 595 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 596 | "xvminsp $XT, $XA, $XB", IIC_VecFP, []>; |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 597 | } // isCommutable |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 598 | } // Uses = [RM] |
| 599 | |
| 600 | // Logical Instructions |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 601 | let isCommutable = 1 in |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 602 | def XXLAND : XX3Form<60, 130, |
| 603 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 604 | "xxland $XT, $XA, $XB", IIC_VecGeneral, []>; |
| 605 | def XXLANDC : XX3Form<60, 138, |
| 606 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 607 | "xxlandc $XT, $XA, $XB", IIC_VecGeneral, []>; |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 608 | let isCommutable = 1 in { |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 609 | def XXLNOR : XX3Form<60, 162, |
| 610 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 611 | "xxlnor $XT, $XA, $XB", IIC_VecGeneral, []>; |
| 612 | def XXLOR : XX3Form<60, 146, |
| 613 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 614 | "xxlor $XT, $XA, $XB", IIC_VecGeneral, []>; |
| 615 | def XXLXOR : XX3Form<60, 154, |
| 616 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 617 | "xxlxor $XT, $XA, $XB", IIC_VecGeneral, []>; |
Hal Finkel | e01d321 | 2014-03-24 15:07:28 +0000 | [diff] [blame^] | 618 | } // isCommutable |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 619 | |
| 620 | // Permutation Instructions |
| 621 | def XXMRGHW : XX3Form<60, 18, |
| 622 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 623 | "xxmrghw $XT, $XA, $XB", IIC_VecPerm, []>; |
| 624 | def XXMRGLW : XX3Form<60, 50, |
| 625 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB), |
| 626 | "xxmrglw $XT, $XA, $XB", IIC_VecPerm, []>; |
| 627 | |
| 628 | def XXPERMDI : XX3Form_2<60, 10, |
| 629 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB, u2imm:$DM), |
| 630 | "xxpermdi $XT, $XA, $XB, $DM", IIC_VecPerm, []>; |
| 631 | def XXSEL : XX4Form<60, 3, |
| 632 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB, vsrc:$XC), |
| 633 | "xxsel $XT, $XA, $XB, $XC", IIC_VecPerm, []>; |
| 634 | |
| 635 | def XXSLDWI : XX3Form_2<60, 2, |
| 636 | (outs vsrc:$XT), (ins vsrc:$XA, vsrc:$XB, u2imm:$SHW), |
| 637 | "xxsldwi $XT, $XA, $XB, $SHW", IIC_VecPerm, []>; |
| 638 | def XXSPLTW : XX2Form_2<60, 164, |
| 639 | (outs vsrc:$XT), (ins vsrc:$XB, u2imm:$UIM), |
| 640 | "xxspltw $XT, $XB, $UIM", IIC_VecPerm, []>; |
| 641 | } // neverHasSideEffects |
| 642 | } // AddedComplexity |
| 643 | |
| 644 | def : InstAlias<"xvmovdp $XT, $XB", |
| 645 | (XVCPSGNDP vsrc:$XT, vsrc:$XB, vsrc:$XB)>; |
| 646 | def : InstAlias<"xvmovsp $XT, $XB", |
| 647 | (XVCPSGNSP vsrc:$XT, vsrc:$XB, vsrc:$XB)>; |
| 648 | |
| 649 | def : InstAlias<"xxspltd $XT, $XB, 0", |
| 650 | (XXPERMDI vsrc:$XT, vsrc:$XB, vsrc:$XB, 0)>; |
| 651 | def : InstAlias<"xxspltd $XT, $XB, 1", |
| 652 | (XXPERMDI vsrc:$XT, vsrc:$XB, vsrc:$XB, 3)>; |
| 653 | def : InstAlias<"xxmrghd $XT, $XA, $XB", |
| 654 | (XXPERMDI vsrc:$XT, vsrc:$XA, vsrc:$XB, 0)>; |
| 655 | def : InstAlias<"xxmrgld $XT, $XA, $XB", |
| 656 | (XXPERMDI vsrc:$XT, vsrc:$XA, vsrc:$XB, 3)>; |
| 657 | def : InstAlias<"xxswapd $XT, $XB", |
| 658 | (XXPERMDI vsrc:$XT, vsrc:$XB, vsrc:$XB, 2)>; |
| 659 | |
| 660 | let AddedComplexity = 400 in { // Prefer VSX patterns over non-VSX patterns. |
| 661 | def : Pat<(v2f64 (scalar_to_vector f64:$A)), |
| 662 | (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), $A, sub_64)>; |
| 663 | |
| 664 | def : Pat<(f64 (vector_extract v2f64:$S, 0)), |
| 665 | (EXTRACT_SUBREG (v2f64 (COPY_TO_REGCLASS $S, VSLRC)), sub_64)>; |
| 666 | def : Pat<(f64 (vector_extract v2f64:$S, 1)), |
| 667 | (EXTRACT_SUBREG (v2f64 (COPY_TO_REGCLASS (XXPERMDI $S, $S, 3), |
| 668 | VSLRC)), sub_64)>; |
| 669 | |
| 670 | // Additional fnmsub patterns: -a*c + b == -(a*c - b) |
| 671 | def : Pat<(fma (fneg f64:$A), f64:$C, f64:$B), |
| 672 | (XSNMSUBADP $B, $C, $A)>; |
| 673 | def : Pat<(fma f64:$A, (fneg f64:$C), f64:$B), |
| 674 | (XSNMSUBADP $B, $C, $A)>; |
| 675 | |
| 676 | def : Pat<(fma (fneg v2f64:$A), v2f64:$C, v2f64:$B), |
| 677 | (XVNMSUBADP $B, $C, $A)>; |
| 678 | def : Pat<(fma v2f64:$A, (fneg v2f64:$C), v2f64:$B), |
| 679 | (XVNMSUBADP $B, $C, $A)>; |
| 680 | |
| 681 | def : Pat<(fma (fneg v4f32:$A), v4f32:$C, v4f32:$B), |
| 682 | (XVNMSUBASP $B, $C, $A)>; |
| 683 | def : Pat<(fma v4f32:$A, (fneg v4f32:$C), v4f32:$B), |
| 684 | (XVNMSUBASP $B, $C, $A)>; |
| 685 | |
| 686 | def : Pat<(v2f64 (bitconvert v4i32:$A)), |
| 687 | (COPY_TO_REGCLASS $A, VSRC)>; |
| 688 | def : Pat<(v2f64 (bitconvert v8i16:$A)), |
| 689 | (COPY_TO_REGCLASS $A, VSRC)>; |
| 690 | def : Pat<(v2f64 (bitconvert v16i8:$A)), |
| 691 | (COPY_TO_REGCLASS $A, VSRC)>; |
| 692 | |
| 693 | def : Pat<(v4i32 (bitconvert v2f64:$A)), |
| 694 | (COPY_TO_REGCLASS $A, VRRC)>; |
| 695 | def : Pat<(v8i16 (bitconvert v2f64:$A)), |
| 696 | (COPY_TO_REGCLASS $A, VRRC)>; |
| 697 | def : Pat<(v16i8 (bitconvert v2f64:$A)), |
| 698 | (COPY_TO_REGCLASS $A, VRRC)>; |
| 699 | |
| 700 | } // AddedComplexity |
| 701 | } // HasVSX |
| 702 | |