1//===- IntrinsicsPowerPC.td - Defines PowerPC intrinsics ---*- 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 defines all of the PowerPC-specific intrinsics. 11// 12//===----------------------------------------------------------------------===// 13 14//===----------------------------------------------------------------------===// 15// Definitions for all PowerPC intrinsics. 16// 17 18// Non-altivec intrinsics. 19let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.". 20 // dcba/dcbf/dcbi/dcbst/dcbt/dcbz/dcbzl(PPC970) instructions. 21 def int_ppc_dcba : Intrinsic<[], [llvm_ptr_ty], []>; 22 def int_ppc_dcbf : Intrinsic<[], [llvm_ptr_ty], []>; 23 def int_ppc_dcbi : Intrinsic<[], [llvm_ptr_ty], []>; 24 def int_ppc_dcbst : Intrinsic<[], [llvm_ptr_ty], []>; 25 def int_ppc_dcbt : Intrinsic<[], [llvm_ptr_ty], 26 [IntrReadWriteArgMem, NoCapture<0>]>; 27 def int_ppc_dcbtst: Intrinsic<[], [llvm_ptr_ty], []>; 28 def int_ppc_dcbz : Intrinsic<[], [llvm_ptr_ty], []>; 29 def int_ppc_dcbzl : Intrinsic<[], [llvm_ptr_ty], []>; 30 31 // sync instruction (i.e. sync 0, a.k.a hwsync) 32 def int_ppc_sync : Intrinsic<[], [], []>; 33 // lwsync is sync 1 34 def int_ppc_lwsync : Intrinsic<[], [], []>; 35 36 // Intrinsics used to generate ctr-based loops. These should only be 37 // generated by the PowerPC backend! 38 def int_ppc_mtctr : Intrinsic<[], [llvm_anyint_ty], []>; 39 def int_ppc_is_decremented_ctr_nonzero : Intrinsic<[llvm_i1_ty], [], []>; 40 41 // Intrinsics for [double]word extended forms of divide instructions 42 def int_ppc_divwe : GCCBuiltin<"__builtin_divwe">, 43 Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], 44 [IntrNoMem]>; 45 def int_ppc_divweu : GCCBuiltin<"__builtin_divweu">, 46 Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], 47 [IntrNoMem]>; 48 def int_ppc_divde : GCCBuiltin<"__builtin_divde">, 49 Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], 50 [IntrNoMem]>; 51 def int_ppc_divdeu : GCCBuiltin<"__builtin_divdeu">, 52 Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], 53 [IntrNoMem]>; 54 55 // Bit permute doubleword 56 def int_ppc_bpermd : GCCBuiltin<"__builtin_bpermd">, 57 Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], 58 [IntrNoMem]>; 59} 60 61 62let TargetPrefix = "ppc" in { // All PPC intrinsics start with "llvm.ppc.". 63 /// PowerPC_Vec_Intrinsic - Base class for all altivec intrinsics. 64 class PowerPC_Vec_Intrinsic<string GCCIntSuffix, list<LLVMType> ret_types, 65 list<LLVMType> param_types, 66 list<IntrinsicProperty> properties> 67 : GCCBuiltin<!strconcat("__builtin_altivec_", GCCIntSuffix)>, 68 Intrinsic<ret_types, param_types, properties>; 69 70 /// PowerPC_VSX_Intrinsic - Base class for all VSX intrinsics. 71 class PowerPC_VSX_Intrinsic<string GCCIntSuffix, list<LLVMType> ret_types, 72 list<LLVMType> param_types, 73 list<IntrinsicProperty> properties> 74 : GCCBuiltin<!strconcat("__builtin_vsx_", GCCIntSuffix)>, 75 Intrinsic<ret_types, param_types, properties>; 76} 77 78//===----------------------------------------------------------------------===// 79// PowerPC Altivec Intrinsic Class Definitions. 80// 81 82/// PowerPC_Vec_FF_Intrinsic - A PowerPC intrinsic that takes one v4f32 83/// vector and returns one. These intrinsics have no side effects. 84class PowerPC_Vec_FF_Intrinsic<string GCCIntSuffix> 85 : PowerPC_Vec_Intrinsic<GCCIntSuffix, 86 [llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>; 87 88/// PowerPC_Vec_FFF_Intrinsic - A PowerPC intrinsic that takes two v4f32 89/// vectors and returns one. These intrinsics have no side effects. 90class PowerPC_Vec_FFF_Intrinsic<string GCCIntSuffix> 91 : PowerPC_Vec_Intrinsic<GCCIntSuffix, 92 [llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], 93 [IntrNoMem]>; 94 95/// PowerPC_Vec_BBB_Intrinsic - A PowerPC intrinsic that takes two v16i8 96/// vectors and returns one. These intrinsics have no side effects. 97class PowerPC_Vec_BBB_Intrinsic<string GCCIntSuffix> 98 : PowerPC_Vec_Intrinsic<GCCIntSuffix, 99 [llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], 100 [IntrNoMem]>; 101 102/// PowerPC_Vec_HHH_Intrinsic - A PowerPC intrinsic that takes two v8i16 103/// vectors and returns one. These intrinsics have no side effects. 104class PowerPC_Vec_HHH_Intrinsic<string GCCIntSuffix> 105 : PowerPC_Vec_Intrinsic<GCCIntSuffix, 106 [llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 107 [IntrNoMem]>; 108 109/// PowerPC_Vec_WWW_Intrinsic - A PowerPC intrinsic that takes two v4i32 110/// vectors and returns one. These intrinsics have no side effects. 111class PowerPC_Vec_WWW_Intrinsic<string GCCIntSuffix> 112 : PowerPC_Vec_Intrinsic<GCCIntSuffix, 113 [llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 114 [IntrNoMem]>; 115 116/// PowerPC_Vec_DDD_Intrinsic - A PowerPC intrinsic that takes two v2i64 117/// vectors and returns one. These intrinsics have no side effects. 118class PowerPC_Vec_DDD_Intrinsic<string GCCIntSuffix> 119 : PowerPC_Vec_Intrinsic<GCCIntSuffix, 120 [llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], 121 [IntrNoMem]>; 122 123//===----------------------------------------------------------------------===// 124// PowerPC VSX Intrinsic Class Definitions. 125// 126 127/// PowerPC_VSX_Vec_DDD_Intrinsic - A PowerPC intrinsic that takes two v2f64 128/// vectors and returns one. These intrinsics have no side effects. 129class PowerPC_VSX_Vec_DDD_Intrinsic<string GCCIntSuffix> 130 : PowerPC_VSX_Intrinsic<GCCIntSuffix, 131 [llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], 132 [IntrNoMem]>; 133 134/// PowerPC_VSX_Vec_FFF_Intrinsic - A PowerPC intrinsic that takes two v4f32 135/// vectors and returns one. These intrinsics have no side effects. 136class PowerPC_VSX_Vec_FFF_Intrinsic<string GCCIntSuffix> 137 : PowerPC_VSX_Intrinsic<GCCIntSuffix, 138 [llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], 139 [IntrNoMem]>; 140 141/// PowerPC_VSX_Sca_DDD_Intrinsic - A PowerPC intrinsic that takes two f64 142/// scalars and returns one. These intrinsics have no side effects. 143class PowerPC_VSX_Sca_DDD_Intrinsic<string GCCIntSuffix> 144 : PowerPC_VSX_Intrinsic<GCCIntSuffix, 145 [llvm_double_ty], [llvm_double_ty, llvm_double_ty], 146 [IntrNoMem]>; 147 148//===----------------------------------------------------------------------===// 149// PowerPC Altivec Intrinsic Definitions. 150 151let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.". 152 // Data Stream Control. 153 def int_ppc_altivec_dss : GCCBuiltin<"__builtin_altivec_dss">, 154 Intrinsic<[], [llvm_i32_ty], []>; 155 def int_ppc_altivec_dssall : GCCBuiltin<"__builtin_altivec_dssall">, 156 Intrinsic<[], [], []>; 157 def int_ppc_altivec_dst : GCCBuiltin<"__builtin_altivec_dst">, 158 Intrinsic<[], 159 [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], 160 []>; 161 def int_ppc_altivec_dstt : GCCBuiltin<"__builtin_altivec_dstt">, 162 Intrinsic<[], 163 [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], 164 []>; 165 def int_ppc_altivec_dstst : GCCBuiltin<"__builtin_altivec_dstst">, 166 Intrinsic<[], 167 [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], 168 []>; 169 def int_ppc_altivec_dststt : GCCBuiltin<"__builtin_altivec_dststt">, 170 Intrinsic<[], 171 [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], 172 []>; 173 174 // VSCR access. 175 def int_ppc_altivec_mfvscr : GCCBuiltin<"__builtin_altivec_mfvscr">, 176 Intrinsic<[llvm_v8i16_ty], [], [IntrReadMem]>; 177 def int_ppc_altivec_mtvscr : GCCBuiltin<"__builtin_altivec_mtvscr">, 178 Intrinsic<[], [llvm_v4i32_ty], []>; 179 180 181 // Loads. These don't map directly to GCC builtins because they represent the 182 // source address with a single pointer. 183 def int_ppc_altivec_lvx : 184 Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty], [IntrReadArgMem]>; 185 def int_ppc_altivec_lvxl : 186 Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty], [IntrReadArgMem]>; 187 def int_ppc_altivec_lvebx : 188 Intrinsic<[llvm_v16i8_ty], [llvm_ptr_ty], [IntrReadArgMem]>; 189 def int_ppc_altivec_lvehx : 190 Intrinsic<[llvm_v8i16_ty], [llvm_ptr_ty], [IntrReadArgMem]>; 191 def int_ppc_altivec_lvewx : 192 Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty], [IntrReadArgMem]>; 193 194 // Stores. These don't map directly to GCC builtins because they represent the 195 // source address with a single pointer. 196 def int_ppc_altivec_stvx : 197 Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty], 198 [IntrReadWriteArgMem]>; 199 def int_ppc_altivec_stvxl : 200 Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty], 201 [IntrReadWriteArgMem]>; 202 def int_ppc_altivec_stvebx : 203 Intrinsic<[], [llvm_v16i8_ty, llvm_ptr_ty], 204 [IntrReadWriteArgMem]>; 205 def int_ppc_altivec_stvehx : 206 Intrinsic<[], [llvm_v8i16_ty, llvm_ptr_ty], 207 [IntrReadWriteArgMem]>; 208 def int_ppc_altivec_stvewx : 209 Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty], 210 [IntrReadWriteArgMem]>; 211 212 // Comparisons setting a vector. 213 def int_ppc_altivec_vcmpbfp : GCCBuiltin<"__builtin_altivec_vcmpbfp">, 214 Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], 215 [IntrNoMem]>; 216 def int_ppc_altivec_vcmpeqfp : GCCBuiltin<"__builtin_altivec_vcmpeqfp">, 217 Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], 218 [IntrNoMem]>; 219 def int_ppc_altivec_vcmpgefp : GCCBuiltin<"__builtin_altivec_vcmpgefp">, 220 Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], 221 [IntrNoMem]>; 222 def int_ppc_altivec_vcmpgtfp : GCCBuiltin<"__builtin_altivec_vcmpgtfp">, 223 Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], 224 [IntrNoMem]>; 225 226 def int_ppc_altivec_vcmpequd : GCCBuiltin<"__builtin_altivec_vcmpequd">, 227 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], 228 [IntrNoMem]>; 229 def int_ppc_altivec_vcmpgtsd : GCCBuiltin<"__builtin_altivec_vcmpgtsd">, 230 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], 231 [IntrNoMem]>; 232 def int_ppc_altivec_vcmpgtud : GCCBuiltin<"__builtin_altivec_vcmpgtud">, 233 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], 234 [IntrNoMem]>; 235 236 def int_ppc_altivec_vcmpequw : GCCBuiltin<"__builtin_altivec_vcmpequw">, 237 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 238 [IntrNoMem]>; 239 def int_ppc_altivec_vcmpgtsw : GCCBuiltin<"__builtin_altivec_vcmpgtsw">, 240 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 241 [IntrNoMem]>; 242 def int_ppc_altivec_vcmpgtuw : GCCBuiltin<"__builtin_altivec_vcmpgtuw">, 243 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 244 [IntrNoMem]>; 245 246 def int_ppc_altivec_vcmpequh : GCCBuiltin<"__builtin_altivec_vcmpequh">, 247 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 248 [IntrNoMem]>; 249 def int_ppc_altivec_vcmpgtsh : GCCBuiltin<"__builtin_altivec_vcmpgtsh">, 250 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 251 [IntrNoMem]>; 252 def int_ppc_altivec_vcmpgtuh : GCCBuiltin<"__builtin_altivec_vcmpgtuh">, 253 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 254 [IntrNoMem]>; 255 256 def int_ppc_altivec_vcmpequb : GCCBuiltin<"__builtin_altivec_vcmpequb">, 257 Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], 258 [IntrNoMem]>; 259 def int_ppc_altivec_vcmpgtsb : GCCBuiltin<"__builtin_altivec_vcmpgtsb">, 260 Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], 261 [IntrNoMem]>; 262 def int_ppc_altivec_vcmpgtub : GCCBuiltin<"__builtin_altivec_vcmpgtub">, 263 Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], 264 [IntrNoMem]>; 265 266 // Predicate Comparisons. The first operand specifies interpretation of CR6. 267 def int_ppc_altivec_vcmpbfp_p : GCCBuiltin<"__builtin_altivec_vcmpbfp_p">, 268 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v4f32_ty,llvm_v4f32_ty], 269 [IntrNoMem]>; 270 def int_ppc_altivec_vcmpeqfp_p : GCCBuiltin<"__builtin_altivec_vcmpeqfp_p">, 271 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v4f32_ty,llvm_v4f32_ty], 272 [IntrNoMem]>; 273 def int_ppc_altivec_vcmpgefp_p : GCCBuiltin<"__builtin_altivec_vcmpgefp_p">, 274 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v4f32_ty,llvm_v4f32_ty], 275 [IntrNoMem]>; 276 def int_ppc_altivec_vcmpgtfp_p : GCCBuiltin<"__builtin_altivec_vcmpgtfp_p">, 277 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v4f32_ty,llvm_v4f32_ty], 278 [IntrNoMem]>; 279 280 def int_ppc_altivec_vcmpequd_p : GCCBuiltin<"__builtin_altivec_vcmpequd_p">, 281 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v2i64_ty,llvm_v2i64_ty], 282 [IntrNoMem]>; 283 def int_ppc_altivec_vcmpgtsd_p : GCCBuiltin<"__builtin_altivec_vcmpgtsd_p">, 284 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v2i64_ty,llvm_v2i64_ty], 285 [IntrNoMem]>; 286 def int_ppc_altivec_vcmpgtud_p : GCCBuiltin<"__builtin_altivec_vcmpgtud_p">, 287 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v2i64_ty,llvm_v2i64_ty], 288 [IntrNoMem]>; 289 290 def int_ppc_altivec_vcmpequw_p : GCCBuiltin<"__builtin_altivec_vcmpequw_p">, 291 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v4i32_ty,llvm_v4i32_ty], 292 [IntrNoMem]>; 293 def int_ppc_altivec_vcmpgtsw_p : GCCBuiltin<"__builtin_altivec_vcmpgtsw_p">, 294 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v4i32_ty,llvm_v4i32_ty], 295 [IntrNoMem]>; 296 def int_ppc_altivec_vcmpgtuw_p : GCCBuiltin<"__builtin_altivec_vcmpgtuw_p">, 297 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v4i32_ty,llvm_v4i32_ty], 298 [IntrNoMem]>; 299 300 def int_ppc_altivec_vcmpequh_p : GCCBuiltin<"__builtin_altivec_vcmpequh_p">, 301 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v8i16_ty,llvm_v8i16_ty], 302 [IntrNoMem]>; 303 def int_ppc_altivec_vcmpgtsh_p : GCCBuiltin<"__builtin_altivec_vcmpgtsh_p">, 304 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v8i16_ty,llvm_v8i16_ty], 305 [IntrNoMem]>; 306 def int_ppc_altivec_vcmpgtuh_p : GCCBuiltin<"__builtin_altivec_vcmpgtuh_p">, 307 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v8i16_ty,llvm_v8i16_ty], 308 [IntrNoMem]>; 309 310 def int_ppc_altivec_vcmpequb_p : GCCBuiltin<"__builtin_altivec_vcmpequb_p">, 311 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v16i8_ty,llvm_v16i8_ty], 312 [IntrNoMem]>; 313 def int_ppc_altivec_vcmpgtsb_p : GCCBuiltin<"__builtin_altivec_vcmpgtsb_p">, 314 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v16i8_ty,llvm_v16i8_ty], 315 [IntrNoMem]>; 316 def int_ppc_altivec_vcmpgtub_p : GCCBuiltin<"__builtin_altivec_vcmpgtub_p">, 317 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v16i8_ty,llvm_v16i8_ty], 318 [IntrNoMem]>; 319} 320 321// Vector average. 322def int_ppc_altivec_vavgsb : PowerPC_Vec_BBB_Intrinsic<"vavgsb">; 323def int_ppc_altivec_vavgsh : PowerPC_Vec_HHH_Intrinsic<"vavgsh">; 324def int_ppc_altivec_vavgsw : PowerPC_Vec_WWW_Intrinsic<"vavgsw">; 325def int_ppc_altivec_vavgub : PowerPC_Vec_BBB_Intrinsic<"vavgub">; 326def int_ppc_altivec_vavguh : PowerPC_Vec_HHH_Intrinsic<"vavguh">; 327def int_ppc_altivec_vavguw : PowerPC_Vec_WWW_Intrinsic<"vavguw">; 328 329// Vector maximum. 330def int_ppc_altivec_vmaxfp : PowerPC_Vec_FFF_Intrinsic<"vmaxfp">; 331def int_ppc_altivec_vmaxsb : PowerPC_Vec_BBB_Intrinsic<"vmaxsb">; 332def int_ppc_altivec_vmaxsh : PowerPC_Vec_HHH_Intrinsic<"vmaxsh">; 333def int_ppc_altivec_vmaxsw : PowerPC_Vec_WWW_Intrinsic<"vmaxsw">; 334def int_ppc_altivec_vmaxsd : PowerPC_Vec_DDD_Intrinsic<"vmaxsd">; 335def int_ppc_altivec_vmaxub : PowerPC_Vec_BBB_Intrinsic<"vmaxub">; 336def int_ppc_altivec_vmaxuh : PowerPC_Vec_HHH_Intrinsic<"vmaxuh">; 337def int_ppc_altivec_vmaxuw : PowerPC_Vec_WWW_Intrinsic<"vmaxuw">; 338def int_ppc_altivec_vmaxud : PowerPC_Vec_DDD_Intrinsic<"vmaxud">; 339 340// Vector minimum. 341def int_ppc_altivec_vminfp : PowerPC_Vec_FFF_Intrinsic<"vminfp">; 342def int_ppc_altivec_vminsb : PowerPC_Vec_BBB_Intrinsic<"vminsb">; 343def int_ppc_altivec_vminsh : PowerPC_Vec_HHH_Intrinsic<"vminsh">; 344def int_ppc_altivec_vminsw : PowerPC_Vec_WWW_Intrinsic<"vminsw">; 345def int_ppc_altivec_vminsd : PowerPC_Vec_DDD_Intrinsic<"vminsd">; 346def int_ppc_altivec_vminub : PowerPC_Vec_BBB_Intrinsic<"vminub">; 347def int_ppc_altivec_vminuh : PowerPC_Vec_HHH_Intrinsic<"vminuh">; 348def int_ppc_altivec_vminuw : PowerPC_Vec_WWW_Intrinsic<"vminuw">; 349def int_ppc_altivec_vminud : PowerPC_Vec_DDD_Intrinsic<"vminud">; 350 351// Saturating adds. 352def int_ppc_altivec_vaddubs : PowerPC_Vec_BBB_Intrinsic<"vaddubs">; 353def int_ppc_altivec_vaddsbs : PowerPC_Vec_BBB_Intrinsic<"vaddsbs">; 354def int_ppc_altivec_vadduhs : PowerPC_Vec_HHH_Intrinsic<"vadduhs">; 355def int_ppc_altivec_vaddshs : PowerPC_Vec_HHH_Intrinsic<"vaddshs">; 356def int_ppc_altivec_vadduws : PowerPC_Vec_WWW_Intrinsic<"vadduws">; 357def int_ppc_altivec_vaddsws : PowerPC_Vec_WWW_Intrinsic<"vaddsws">; 358def int_ppc_altivec_vaddcuw : PowerPC_Vec_WWW_Intrinsic<"vaddcuw">; 359 360// Saturating subs. 361def int_ppc_altivec_vsububs : PowerPC_Vec_BBB_Intrinsic<"vsububs">; 362def int_ppc_altivec_vsubsbs : PowerPC_Vec_BBB_Intrinsic<"vsubsbs">; 363def int_ppc_altivec_vsubuhs : PowerPC_Vec_HHH_Intrinsic<"vsubuhs">; 364def int_ppc_altivec_vsubshs : PowerPC_Vec_HHH_Intrinsic<"vsubshs">; 365def int_ppc_altivec_vsubuws : PowerPC_Vec_WWW_Intrinsic<"vsubuws">; 366def int_ppc_altivec_vsubsws : PowerPC_Vec_WWW_Intrinsic<"vsubsws">; 367def int_ppc_altivec_vsubcuw : PowerPC_Vec_WWW_Intrinsic<"vsubcuw">; 368 369let TargetPrefix = "ppc" in { // All PPC intrinsics start with "llvm.ppc.". 370 // Saturating multiply-adds. 371 def int_ppc_altivec_vmhaddshs : GCCBuiltin<"__builtin_altivec_vmhaddshs">, 372 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, 373 llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>; 374 def int_ppc_altivec_vmhraddshs : GCCBuiltin<"__builtin_altivec_vmhraddshs">, 375 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, 376 llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>; 377 378 def int_ppc_altivec_vmaddfp : GCCBuiltin<"__builtin_altivec_vmaddfp">, 379 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, 380 llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>; 381 def int_ppc_altivec_vnmsubfp : GCCBuiltin<"__builtin_altivec_vnmsubfp">, 382 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, 383 llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>; 384 385 // Vector Multiply Sum Intructions. 386 def int_ppc_altivec_vmsummbm : GCCBuiltin<"__builtin_altivec_vmsummbm">, 387 Intrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty, llvm_v16i8_ty, 388 llvm_v4i32_ty], [IntrNoMem]>; 389 def int_ppc_altivec_vmsumshm : GCCBuiltin<"__builtin_altivec_vmsumshm">, 390 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty, 391 llvm_v4i32_ty], [IntrNoMem]>; 392 def int_ppc_altivec_vmsumshs : GCCBuiltin<"__builtin_altivec_vmsumshs">, 393 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty, 394 llvm_v4i32_ty], [IntrNoMem]>; 395 def int_ppc_altivec_vmsumubm : GCCBuiltin<"__builtin_altivec_vmsumubm">, 396 Intrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty, llvm_v16i8_ty, 397 llvm_v4i32_ty], [IntrNoMem]>; 398 def int_ppc_altivec_vmsumuhm : GCCBuiltin<"__builtin_altivec_vmsumuhm">, 399 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty, 400 llvm_v4i32_ty], [IntrNoMem]>; 401 def int_ppc_altivec_vmsumuhs : GCCBuiltin<"__builtin_altivec_vmsumuhs">, 402 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty, 403 llvm_v4i32_ty], [IntrNoMem]>; 404 405 // Vector Multiply Intructions. 406 def int_ppc_altivec_vmulesb : GCCBuiltin<"__builtin_altivec_vmulesb">, 407 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], 408 [IntrNoMem]>; 409 def int_ppc_altivec_vmulesh : GCCBuiltin<"__builtin_altivec_vmulesh">, 410 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 411 [IntrNoMem]>; 412 def int_ppc_altivec_vmulesw : GCCBuiltin<"__builtin_altivec_vmulesw">, 413 Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 414 [IntrNoMem]>; 415 def int_ppc_altivec_vmuleub : GCCBuiltin<"__builtin_altivec_vmuleub">, 416 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], 417 [IntrNoMem]>; 418 def int_ppc_altivec_vmuleuh : GCCBuiltin<"__builtin_altivec_vmuleuh">, 419 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 420 [IntrNoMem]>; 421 def int_ppc_altivec_vmuleuw : GCCBuiltin<"__builtin_altivec_vmuleuw">, 422 Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 423 [IntrNoMem]>; 424 425 def int_ppc_altivec_vmulosb : GCCBuiltin<"__builtin_altivec_vmulosb">, 426 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], 427 [IntrNoMem]>; 428 def int_ppc_altivec_vmulosh : GCCBuiltin<"__builtin_altivec_vmulosh">, 429 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 430 [IntrNoMem]>; 431 def int_ppc_altivec_vmulosw : GCCBuiltin<"__builtin_altivec_vmulosw">, 432 Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 433 [IntrNoMem]>; 434 def int_ppc_altivec_vmuloub : GCCBuiltin<"__builtin_altivec_vmuloub">, 435 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], 436 [IntrNoMem]>; 437 def int_ppc_altivec_vmulouh : GCCBuiltin<"__builtin_altivec_vmulouh">, 438 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 439 [IntrNoMem]>; 440 def int_ppc_altivec_vmulouw : GCCBuiltin<"__builtin_altivec_vmulouw">, 441 Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 442 [IntrNoMem]>; 443 444 // Vector Sum Intructions. 445 def int_ppc_altivec_vsumsws : GCCBuiltin<"__builtin_altivec_vsumsws">, 446 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 447 [IntrNoMem]>; 448 def int_ppc_altivec_vsum2sws : GCCBuiltin<"__builtin_altivec_vsum2sws">, 449 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 450 [IntrNoMem]>; 451 def int_ppc_altivec_vsum4sbs : GCCBuiltin<"__builtin_altivec_vsum4sbs">, 452 Intrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty, llvm_v4i32_ty], 453 [IntrNoMem]>; 454 def int_ppc_altivec_vsum4shs : GCCBuiltin<"__builtin_altivec_vsum4shs">, 455 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v4i32_ty], 456 [IntrNoMem]>; 457 def int_ppc_altivec_vsum4ubs : GCCBuiltin<"__builtin_altivec_vsum4ubs">, 458 Intrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty, llvm_v4i32_ty], 459 [IntrNoMem]>; 460 461 // Other multiplies. 462 def int_ppc_altivec_vmladduhm : GCCBuiltin<"__builtin_altivec_vmladduhm">, 463 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, 464 llvm_v8i16_ty], [IntrNoMem]>; 465 466 // Packs. 467 def int_ppc_altivec_vpkpx : GCCBuiltin<"__builtin_altivec_vpkpx">, 468 Intrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 469 [IntrNoMem]>; 470 def int_ppc_altivec_vpkshss : GCCBuiltin<"__builtin_altivec_vpkshss">, 471 Intrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 472 [IntrNoMem]>; 473 def int_ppc_altivec_vpkshus : GCCBuiltin<"__builtin_altivec_vpkshus">, 474 Intrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 475 [IntrNoMem]>; 476 def int_ppc_altivec_vpkswss : GCCBuiltin<"__builtin_altivec_vpkswss">, 477 Intrinsic<[llvm_v16i8_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 478 [IntrNoMem]>; 479 def int_ppc_altivec_vpkswus : GCCBuiltin<"__builtin_altivec_vpkswus">, 480 Intrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 481 [IntrNoMem]>; 482 // vpkuhum is lowered to a shuffle. 483 def int_ppc_altivec_vpkuhus : GCCBuiltin<"__builtin_altivec_vpkuhus">, 484 Intrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 485 [IntrNoMem]>; 486 // vpkuwum is lowered to a shuffle. 487 def int_ppc_altivec_vpkuwus : GCCBuiltin<"__builtin_altivec_vpkuwus">, 488 Intrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 489 [IntrNoMem]>; 490 491 // Unpacks. 492 def int_ppc_altivec_vupkhpx : GCCBuiltin<"__builtin_altivec_vupkhpx">, 493 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>; 494 def int_ppc_altivec_vupkhsb : GCCBuiltin<"__builtin_altivec_vupkhsb">, 495 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty], [IntrNoMem]>; 496 def int_ppc_altivec_vupkhsh : GCCBuiltin<"__builtin_altivec_vupkhsh">, 497 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>; 498 def int_ppc_altivec_vupklpx : GCCBuiltin<"__builtin_altivec_vupklpx">, 499 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>; 500 def int_ppc_altivec_vupklsb : GCCBuiltin<"__builtin_altivec_vupklsb">, 501 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty], [IntrNoMem]>; 502 def int_ppc_altivec_vupklsh : GCCBuiltin<"__builtin_altivec_vupklsh">, 503 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>; 504 505 506 // FP <-> integer conversion. 507 def int_ppc_altivec_vcfsx : GCCBuiltin<"__builtin_altivec_vcfsx">, 508 Intrinsic<[llvm_v4f32_ty], [llvm_v4i32_ty, llvm_i32_ty], 509 [IntrNoMem]>; 510 def int_ppc_altivec_vcfux : GCCBuiltin<"__builtin_altivec_vcfux">, 511 Intrinsic<[llvm_v4f32_ty], [llvm_v4i32_ty, llvm_i32_ty], 512 [IntrNoMem]>; 513 def int_ppc_altivec_vctsxs : GCCBuiltin<"__builtin_altivec_vctsxs">, 514 Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_i32_ty], 515 [IntrNoMem]>; 516 def int_ppc_altivec_vctuxs : GCCBuiltin<"__builtin_altivec_vctuxs">, 517 Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_i32_ty], 518 [IntrNoMem]>; 519 520 def int_ppc_altivec_vrfim : GCCBuiltin<"__builtin_altivec_vrfim">, 521 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>; 522 def int_ppc_altivec_vrfin : GCCBuiltin<"__builtin_altivec_vrfin">, 523 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>; 524 def int_ppc_altivec_vrfip : GCCBuiltin<"__builtin_altivec_vrfip">, 525 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>; 526 def int_ppc_altivec_vrfiz : GCCBuiltin<"__builtin_altivec_vrfiz">, 527 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>; 528} 529 530def int_ppc_altivec_vsl : PowerPC_Vec_WWW_Intrinsic<"vsl">; 531def int_ppc_altivec_vslo : PowerPC_Vec_WWW_Intrinsic<"vslo">; 532 533def int_ppc_altivec_vslb : PowerPC_Vec_BBB_Intrinsic<"vslb">; 534def int_ppc_altivec_vslh : PowerPC_Vec_HHH_Intrinsic<"vslh">; 535def int_ppc_altivec_vslw : PowerPC_Vec_WWW_Intrinsic<"vslw">; 536 537// Right Shifts. 538def int_ppc_altivec_vsr : PowerPC_Vec_WWW_Intrinsic<"vsr">; 539def int_ppc_altivec_vsro : PowerPC_Vec_WWW_Intrinsic<"vsro">; 540 541def int_ppc_altivec_vsrb : PowerPC_Vec_BBB_Intrinsic<"vsrb">; 542def int_ppc_altivec_vsrh : PowerPC_Vec_HHH_Intrinsic<"vsrh">; 543def int_ppc_altivec_vsrw : PowerPC_Vec_WWW_Intrinsic<"vsrw">; 544def int_ppc_altivec_vsrab : PowerPC_Vec_BBB_Intrinsic<"vsrab">; 545def int_ppc_altivec_vsrah : PowerPC_Vec_HHH_Intrinsic<"vsrah">; 546def int_ppc_altivec_vsraw : PowerPC_Vec_WWW_Intrinsic<"vsraw">; 547 548// Rotates. 549def int_ppc_altivec_vrlb : PowerPC_Vec_BBB_Intrinsic<"vrlb">; 550def int_ppc_altivec_vrlh : PowerPC_Vec_HHH_Intrinsic<"vrlh">; 551def int_ppc_altivec_vrlw : PowerPC_Vec_WWW_Intrinsic<"vrlw">; 552def int_ppc_altivec_vrld : PowerPC_Vec_DDD_Intrinsic<"vrld">; 553 554let TargetPrefix = "ppc" in { // All PPC intrinsics start with "llvm.ppc.". 555 // Miscellaneous. 556 def int_ppc_altivec_lvsl : 557 Intrinsic<[llvm_v16i8_ty], [llvm_ptr_ty], [IntrNoMem]>; 558 def int_ppc_altivec_lvsr : 559 Intrinsic<[llvm_v16i8_ty], [llvm_ptr_ty], [IntrNoMem]>; 560 561 def int_ppc_altivec_vperm : GCCBuiltin<"__builtin_altivec_vperm_4si">, 562 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, 563 llvm_v4i32_ty, llvm_v16i8_ty], [IntrNoMem]>; 564 def int_ppc_altivec_vsel : GCCBuiltin<"__builtin_altivec_vsel_4si">, 565 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, 566 llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>; 567} 568 569def int_ppc_altivec_vexptefp : PowerPC_Vec_FF_Intrinsic<"vexptefp">; 570def int_ppc_altivec_vlogefp : PowerPC_Vec_FF_Intrinsic<"vlogefp">; 571def int_ppc_altivec_vrefp : PowerPC_Vec_FF_Intrinsic<"vrefp">; 572def int_ppc_altivec_vrsqrtefp : PowerPC_Vec_FF_Intrinsic<"vrsqrtefp">; 573 574// Power8 Intrinsics 575// Crypto 576let TargetPrefix = "ppc" in { // All PPC intrinsics start with "llvm.ppc.". 577 def int_ppc_altivec_crypto_vsbox : 578 GCCBuiltin<"__builtin_altivec_crypto_vsbox">, 579 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty], [IntrNoMem]>; 580 def int_ppc_altivec_crypto_vpermxor : 581 GCCBuiltin<"__builtin_altivec_crypto_vpermxor">, 582 Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, 583 llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>; 584 585def int_ppc_altivec_crypto_vshasigmad : 586 GCCBuiltin<"__builtin_altivec_crypto_vshasigmad">, 587 Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, 588 llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>; 589def int_ppc_altivec_crypto_vshasigmaw : 590 GCCBuiltin<"__builtin_altivec_crypto_vshasigmaw">, 591 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, 592 llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>; 593} 594def int_ppc_altivec_crypto_vcipher : 595 PowerPC_Vec_DDD_Intrinsic<"crypto_vcipher">; 596def int_ppc_altivec_crypto_vcipherlast : 597 PowerPC_Vec_DDD_Intrinsic<"crypto_vcipherlast">; 598def int_ppc_altivec_crypto_vncipher : 599 PowerPC_Vec_DDD_Intrinsic<"crypto_vncipher">; 600def int_ppc_altivec_crypto_vncipherlast : 601 PowerPC_Vec_DDD_Intrinsic<"crypto_vncipherlast">; 602def int_ppc_altivec_crypto_vpmsumb : 603 PowerPC_Vec_BBB_Intrinsic<"crypto_vpmsumb">; 604def int_ppc_altivec_crypto_vpmsumh : 605 PowerPC_Vec_HHH_Intrinsic<"crypto_vpmsumh">; 606def int_ppc_altivec_crypto_vpmsumw : 607 PowerPC_Vec_WWW_Intrinsic<"crypto_vpmsumw">; 608def int_ppc_altivec_crypto_vpmsumd : 609 PowerPC_Vec_DDD_Intrinsic<"crypto_vpmsumd">; 610 611//===----------------------------------------------------------------------===// 612// PowerPC VSX Intrinsic Definitions. 613 614let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.". 615 616// Vector load. 617def int_ppc_vsx_lxvw4x : 618 Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty], [IntrReadArgMem]>; 619def int_ppc_vsx_lxvd2x : 620 Intrinsic<[llvm_v2f64_ty], [llvm_ptr_ty], [IntrReadArgMem]>; 621 622// Vector store. 623def int_ppc_vsx_stxvw4x : 624 Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty], [IntrReadWriteArgMem]>; 625def int_ppc_vsx_stxvd2x : 626 Intrinsic<[], [llvm_v2f64_ty, llvm_ptr_ty], [IntrReadWriteArgMem]>; 627 628// Vector and scalar maximum. 629def int_ppc_vsx_xvmaxdp : PowerPC_VSX_Vec_DDD_Intrinsic<"xvmaxdp">; 630def int_ppc_vsx_xvmaxsp : PowerPC_VSX_Vec_FFF_Intrinsic<"xvmaxsp">; 631def int_ppc_vsx_xsmaxdp : PowerPC_VSX_Sca_DDD_Intrinsic<"xsmaxdp">; 632 633// Vector and scalar minimum. 634def int_ppc_vsx_xvmindp : PowerPC_VSX_Vec_DDD_Intrinsic<"xvmindp">; 635def int_ppc_vsx_xvminsp : PowerPC_VSX_Vec_FFF_Intrinsic<"xvminsp">; 636def int_ppc_vsx_xsmindp : PowerPC_VSX_Sca_DDD_Intrinsic<"xsmindp">; 637 638// Vector divide. 639def int_ppc_vsx_xvdivdp : PowerPC_VSX_Vec_DDD_Intrinsic<"xvdivdp">; 640def int_ppc_vsx_xvdivsp : PowerPC_VSX_Vec_FFF_Intrinsic<"xvdivsp">; 641} 642 643//===----------------------------------------------------------------------===// 644// PowerPC QPX Intrinsics. 645// 646 647let TargetPrefix = "ppc" in { // All PPC intrinsics start with "llvm.ppc.". 648 /// PowerPC_QPX_Intrinsic - Base class for all QPX intrinsics. 649 class PowerPC_QPX_Intrinsic<string GCCIntSuffix, list<LLVMType> ret_types, 650 list<LLVMType> param_types, 651 list<IntrinsicProperty> properties> 652 : GCCBuiltin<!strconcat("__builtin_qpx_", GCCIntSuffix)>, 653 Intrinsic<ret_types, param_types, properties>; 654} 655 656//===----------------------------------------------------------------------===// 657// PowerPC QPX Intrinsic Class Definitions. 658// 659 660/// PowerPC_QPX_FF_Intrinsic - A PowerPC intrinsic that takes one v4f64 661/// vector and returns one. These intrinsics have no side effects. 662class PowerPC_QPX_FF_Intrinsic<string GCCIntSuffix> 663 : PowerPC_QPX_Intrinsic<GCCIntSuffix, 664 [llvm_v4f64_ty], [llvm_v4f64_ty], [IntrNoMem]>; 665 666/// PowerPC_QPX_FFF_Intrinsic - A PowerPC intrinsic that takes two v4f64 667/// vectors and returns one. These intrinsics have no side effects. 668class PowerPC_QPX_FFF_Intrinsic<string GCCIntSuffix> 669 : PowerPC_QPX_Intrinsic<GCCIntSuffix, 670 [llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty], 671 [IntrNoMem]>; 672 673/// PowerPC_QPX_FFFF_Intrinsic - A PowerPC intrinsic that takes three v4f64 674/// vectors and returns one. These intrinsics have no side effects. 675class PowerPC_QPX_FFFF_Intrinsic<string GCCIntSuffix> 676 : PowerPC_QPX_Intrinsic<GCCIntSuffix, 677 [llvm_v4f64_ty], 678 [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty], 679 [IntrNoMem]>; 680 681/// PowerPC_QPX_Load_Intrinsic - A PowerPC intrinsic that takes a pointer 682/// and returns a v4f64. 683class PowerPC_QPX_Load_Intrinsic<string GCCIntSuffix> 684 : PowerPC_QPX_Intrinsic<GCCIntSuffix, 685 [llvm_v4f64_ty], [llvm_ptr_ty], [IntrReadArgMem]>; 686 687/// PowerPC_QPX_LoadPerm_Intrinsic - A PowerPC intrinsic that takes a pointer 688/// and returns a v4f64 permutation. 689class PowerPC_QPX_LoadPerm_Intrinsic<string GCCIntSuffix> 690 : PowerPC_QPX_Intrinsic<GCCIntSuffix, 691 [llvm_v4f64_ty], [llvm_ptr_ty], [IntrNoMem]>; 692 693/// PowerPC_QPX_Store_Intrinsic - A PowerPC intrinsic that takes a pointer 694/// and stores a v4f64. 695class PowerPC_QPX_Store_Intrinsic<string GCCIntSuffix> 696 : PowerPC_QPX_Intrinsic<GCCIntSuffix, 697 [], [llvm_v4f64_ty, llvm_ptr_ty], 698 [IntrReadWriteArgMem]>; 699 700//===----------------------------------------------------------------------===// 701// PowerPC QPX Intrinsic Definitions. 702 703let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.". 704 // Add Instructions 705 def int_ppc_qpx_qvfadd : PowerPC_QPX_FFF_Intrinsic<"qvfadd">; 706 def int_ppc_qpx_qvfadds : PowerPC_QPX_FFF_Intrinsic<"qvfadds">; 707 def int_ppc_qpx_qvfsub : PowerPC_QPX_FFF_Intrinsic<"qvfsub">; 708 def int_ppc_qpx_qvfsubs : PowerPC_QPX_FFF_Intrinsic<"qvfsubs">; 709 710 // Estimate Instructions 711 def int_ppc_qpx_qvfre : PowerPC_QPX_FF_Intrinsic<"qvfre">; 712 def int_ppc_qpx_qvfres : PowerPC_QPX_FF_Intrinsic<"qvfres">; 713 def int_ppc_qpx_qvfrsqrte : PowerPC_QPX_FF_Intrinsic<"qvfrsqrte">; 714 def int_ppc_qpx_qvfrsqrtes : PowerPC_QPX_FF_Intrinsic<"qvfrsqrtes">; 715 716 // Multiply Instructions 717 def int_ppc_qpx_qvfmul : PowerPC_QPX_FFF_Intrinsic<"qvfmul">; 718 def int_ppc_qpx_qvfmuls : PowerPC_QPX_FFF_Intrinsic<"qvfmuls">; 719 def int_ppc_qpx_qvfxmul : PowerPC_QPX_FFF_Intrinsic<"qvfxmul">; 720 def int_ppc_qpx_qvfxmuls : PowerPC_QPX_FFF_Intrinsic<"qvfxmuls">; 721 722 // Multiply-add instructions 723 def int_ppc_qpx_qvfmadd : PowerPC_QPX_FFFF_Intrinsic<"qvfmadd">; 724 def int_ppc_qpx_qvfmadds : PowerPC_QPX_FFFF_Intrinsic<"qvfmadds">; 725 def int_ppc_qpx_qvfnmadd : PowerPC_QPX_FFFF_Intrinsic<"qvfnmadd">; 726 def int_ppc_qpx_qvfnmadds : PowerPC_QPX_FFFF_Intrinsic<"qvfnmadds">; 727 def int_ppc_qpx_qvfmsub : PowerPC_QPX_FFFF_Intrinsic<"qvfmsub">; 728 def int_ppc_qpx_qvfmsubs : PowerPC_QPX_FFFF_Intrinsic<"qvfmsubs">; 729 def int_ppc_qpx_qvfnmsub : PowerPC_QPX_FFFF_Intrinsic<"qvfnmsub">; 730 def int_ppc_qpx_qvfnmsubs : PowerPC_QPX_FFFF_Intrinsic<"qvfnmsubs">; 731 def int_ppc_qpx_qvfxmadd : PowerPC_QPX_FFFF_Intrinsic<"qvfxmadd">; 732 def int_ppc_qpx_qvfxmadds : PowerPC_QPX_FFFF_Intrinsic<"qvfxmadds">; 733 def int_ppc_qpx_qvfxxnpmadd : PowerPC_QPX_FFFF_Intrinsic<"qvfxxnpmadd">; 734 def int_ppc_qpx_qvfxxnpmadds : PowerPC_QPX_FFFF_Intrinsic<"qvfxxnpmadds">; 735 def int_ppc_qpx_qvfxxcpnmadd : PowerPC_QPX_FFFF_Intrinsic<"qvfxxcpnmadd">; 736 def int_ppc_qpx_qvfxxcpnmadds : PowerPC_QPX_FFFF_Intrinsic<"qvfxxcpnmadds">; 737 def int_ppc_qpx_qvfxxmadd : PowerPC_QPX_FFFF_Intrinsic<"qvfxxmadd">; 738 def int_ppc_qpx_qvfxxmadds : PowerPC_QPX_FFFF_Intrinsic<"qvfxxmadds">; 739 740 // Select Instruction 741 def int_ppc_qpx_qvfsel : PowerPC_QPX_FFFF_Intrinsic<"qvfsel">; 742 743 // Permute Instruction 744 def int_ppc_qpx_qvfperm : PowerPC_QPX_FFFF_Intrinsic<"qvfperm">; 745 746 // Convert and Round Instructions 747 def int_ppc_qpx_qvfctid : PowerPC_QPX_FF_Intrinsic<"qvfctid">; 748 def int_ppc_qpx_qvfctidu : PowerPC_QPX_FF_Intrinsic<"qvfctidu">; 749 def int_ppc_qpx_qvfctidz : PowerPC_QPX_FF_Intrinsic<"qvfctidz">; 750 def int_ppc_qpx_qvfctiduz : PowerPC_QPX_FF_Intrinsic<"qvfctiduz">; 751 def int_ppc_qpx_qvfctiw : PowerPC_QPX_FF_Intrinsic<"qvfctiw">; 752 def int_ppc_qpx_qvfctiwu : PowerPC_QPX_FF_Intrinsic<"qvfctiwu">; 753 def int_ppc_qpx_qvfctiwz : PowerPC_QPX_FF_Intrinsic<"qvfctiwz">; 754 def int_ppc_qpx_qvfctiwuz : PowerPC_QPX_FF_Intrinsic<"qvfctiwuz">; 755 def int_ppc_qpx_qvfcfid : PowerPC_QPX_FF_Intrinsic<"qvfcfid">; 756 def int_ppc_qpx_qvfcfidu : PowerPC_QPX_FF_Intrinsic<"qvfcfidu">; 757 def int_ppc_qpx_qvfcfids : PowerPC_QPX_FF_Intrinsic<"qvfcfids">; 758 def int_ppc_qpx_qvfcfidus : PowerPC_QPX_FF_Intrinsic<"qvfcfidus">; 759 def int_ppc_qpx_qvfrsp : PowerPC_QPX_FF_Intrinsic<"qvfrsp">; 760 def int_ppc_qpx_qvfriz : PowerPC_QPX_FF_Intrinsic<"qvfriz">; 761 def int_ppc_qpx_qvfrin : PowerPC_QPX_FF_Intrinsic<"qvfrin">; 762 def int_ppc_qpx_qvfrip : PowerPC_QPX_FF_Intrinsic<"qvfrip">; 763 def int_ppc_qpx_qvfrim : PowerPC_QPX_FF_Intrinsic<"qvfrim">; 764 765 // Move Instructions 766 def int_ppc_qpx_qvfneg : PowerPC_QPX_FF_Intrinsic<"qvfneg">; 767 def int_ppc_qpx_qvfabs : PowerPC_QPX_FF_Intrinsic<"qvfabs">; 768 def int_ppc_qpx_qvfnabs : PowerPC_QPX_FF_Intrinsic<"qvfnabs">; 769 def int_ppc_qpx_qvfcpsgn : PowerPC_QPX_FFF_Intrinsic<"qvfcpsgn">; 770 771 // Compare Instructions 772 def int_ppc_qpx_qvftstnan : PowerPC_QPX_FFF_Intrinsic<"qvftstnan">; 773 def int_ppc_qpx_qvfcmplt : PowerPC_QPX_FFF_Intrinsic<"qvfcmplt">; 774 def int_ppc_qpx_qvfcmpgt : PowerPC_QPX_FFF_Intrinsic<"qvfcmpgt">; 775 def int_ppc_qpx_qvfcmpeq : PowerPC_QPX_FFF_Intrinsic<"qvfcmpeq">; 776 777 // Load instructions 778 def int_ppc_qpx_qvlfd : PowerPC_QPX_Load_Intrinsic<"qvlfd">; 779 def int_ppc_qpx_qvlfda : PowerPC_QPX_Load_Intrinsic<"qvlfda">; 780 def int_ppc_qpx_qvlfs : PowerPC_QPX_Load_Intrinsic<"qvlfs">; 781 def int_ppc_qpx_qvlfsa : PowerPC_QPX_Load_Intrinsic<"qvlfsa">; 782 783 def int_ppc_qpx_qvlfcda : PowerPC_QPX_Load_Intrinsic<"qvlfcda">; 784 def int_ppc_qpx_qvlfcd : PowerPC_QPX_Load_Intrinsic<"qvlfcd">; 785 def int_ppc_qpx_qvlfcsa : PowerPC_QPX_Load_Intrinsic<"qvlfcsa">; 786 def int_ppc_qpx_qvlfcs : PowerPC_QPX_Load_Intrinsic<"qvlfcs">; 787 def int_ppc_qpx_qvlfiwaa : PowerPC_QPX_Load_Intrinsic<"qvlfiwaa">; 788 def int_ppc_qpx_qvlfiwa : PowerPC_QPX_Load_Intrinsic<"qvlfiwa">; 789 def int_ppc_qpx_qvlfiwza : PowerPC_QPX_Load_Intrinsic<"qvlfiwza">; 790 def int_ppc_qpx_qvlfiwz : PowerPC_QPX_Load_Intrinsic<"qvlfiwz">; 791 792 def int_ppc_qpx_qvlpcld : PowerPC_QPX_LoadPerm_Intrinsic<"qvlpcld">; 793 def int_ppc_qpx_qvlpcls : PowerPC_QPX_LoadPerm_Intrinsic<"qvlpcls">; 794 def int_ppc_qpx_qvlpcrd : PowerPC_QPX_LoadPerm_Intrinsic<"qvlpcrd">; 795 def int_ppc_qpx_qvlpcrs : PowerPC_QPX_LoadPerm_Intrinsic<"qvlpcrs">; 796 797 // Store instructions 798 def int_ppc_qpx_qvstfd : PowerPC_QPX_Store_Intrinsic<"qvstfd">; 799 def int_ppc_qpx_qvstfda : PowerPC_QPX_Store_Intrinsic<"qvstfda">; 800 def int_ppc_qpx_qvstfs : PowerPC_QPX_Store_Intrinsic<"qvstfs">; 801 def int_ppc_qpx_qvstfsa : PowerPC_QPX_Store_Intrinsic<"qvstfsa">; 802 803 def int_ppc_qpx_qvstfcda : PowerPC_QPX_Store_Intrinsic<"qvstfcda">; 804 def int_ppc_qpx_qvstfcd : PowerPC_QPX_Store_Intrinsic<"qvstfcd">; 805 def int_ppc_qpx_qvstfcsa : PowerPC_QPX_Store_Intrinsic<"qvstfcsa">; 806 def int_ppc_qpx_qvstfcs : PowerPC_QPX_Store_Intrinsic<"qvstfcs">; 807 def int_ppc_qpx_qvstfiwa : PowerPC_QPX_Store_Intrinsic<"qvstfiwa">; 808 def int_ppc_qpx_qvstfiw : PowerPC_QPX_Store_Intrinsic<"qvstfiw">; 809 810 // Logical and permutation formation 811 def int_ppc_qpx_qvflogical : PowerPC_QPX_Intrinsic<"qvflogical", 812 [llvm_v4f64_ty], 813 [llvm_v4f64_ty, llvm_v4f64_ty, llvm_i32_ty], 814 [IntrNoMem]>; 815 def int_ppc_qpx_qvgpci : PowerPC_QPX_Intrinsic<"qvgpci", 816 [llvm_v4f64_ty], [llvm_i32_ty], [IntrNoMem]>; 817} 818 819//===----------------------------------------------------------------------===// 820// PowerPC HTM Intrinsic Definitions. 821 822let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.". 823 824def int_ppc_tbegin : GCCBuiltin<"__builtin_tbegin">, 825 Intrinsic<[llvm_i32_ty], [llvm_i32_ty], []>; 826def int_ppc_tend : GCCBuiltin<"__builtin_tend">, 827 Intrinsic<[llvm_i32_ty], [llvm_i32_ty], []>; 828 829def int_ppc_tabort : GCCBuiltin<"__builtin_tabort">, 830 Intrinsic<[llvm_i32_ty], [llvm_i32_ty], []>; 831def int_ppc_tabortwc : GCCBuiltin<"__builtin_tabortwc">, 832 Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>; 833def int_ppc_tabortwci : GCCBuiltin<"__builtin_tabortwci">, 834 Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>; 835def int_ppc_tabortdc : GCCBuiltin<"__builtin_tabortdc">, 836 Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>; 837def int_ppc_tabortdci : GCCBuiltin<"__builtin_tabortdci">, 838 Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>; 839 840def int_ppc_tcheck : GCCBuiltin<"__builtin_tcheck">, 841 Intrinsic<[llvm_i32_ty], [], []>; 842def int_ppc_treclaim : GCCBuiltin<"__builtin_treclaim">, 843 Intrinsic<[llvm_i32_ty], [llvm_i32_ty], []>; 844def int_ppc_trechkpt : GCCBuiltin<"__builtin_trechkpt">, 845 Intrinsic<[llvm_i32_ty], [], []>; 846def int_ppc_tsr : GCCBuiltin<"__builtin_tsr">, 847 Intrinsic<[llvm_i32_ty], [llvm_i32_ty], []>; 848 849def int_ppc_get_texasr : GCCBuiltin<"__builtin_get_texasr">, 850 Intrinsic<[llvm_i64_ty], [], []>; 851def int_ppc_get_texasru : GCCBuiltin<"__builtin_get_texasru">, 852 Intrinsic<[llvm_i64_ty], [], []>; 853def int_ppc_get_tfhar : GCCBuiltin<"__builtin_get_tfhar">, 854 Intrinsic<[llvm_i64_ty], [], []>; 855def int_ppc_get_tfiar : GCCBuiltin<"__builtin_get_tfiar">, 856 Intrinsic<[llvm_i64_ty], [], []>; 857 858def int_ppc_set_texasr : GCCBuiltin<"__builtin_set_texasr">, 859 Intrinsic<[], [llvm_i64_ty], []>; 860def int_ppc_set_texasru : GCCBuiltin<"__builtin_set_texasru">, 861 Intrinsic<[], [llvm_i64_ty], []>; 862def int_ppc_set_tfhar : GCCBuiltin<"__builtin_set_tfhar">, 863 Intrinsic<[], [llvm_i64_ty], []>; 864def int_ppc_set_tfiar : GCCBuiltin<"__builtin_set_tfiar">, 865 Intrinsic<[], [llvm_i64_ty], []>; 866 867// Extended mnemonics 868def int_ppc_tendall : GCCBuiltin<"__builtin_tendall">, 869 Intrinsic<[llvm_i32_ty], [], []>; 870def int_ppc_tresume : GCCBuiltin<"__builtin_tresume">, 871 Intrinsic<[llvm_i32_ty], [], []>; 872def int_ppc_tsuspend : GCCBuiltin<"__builtin_tsuspend">, 873 Intrinsic<[llvm_i32_ty], [], []>; 874 875def int_ppc_ttest : GCCBuiltin<"__builtin_ttest">, 876 Intrinsic<[llvm_i64_ty], [], []>; 877} 878