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 def int_ppc_dcbtst: Intrinsic<[], [llvm_ptr_ty], []>; 27 def int_ppc_dcbz : Intrinsic<[], [llvm_ptr_ty], []>; 28 def int_ppc_dcbzl : Intrinsic<[], [llvm_ptr_ty], []>; 29 30 // sync instruction 31 def int_ppc_sync : Intrinsic<[], [], []>; 32} 33 34 35let TargetPrefix = "ppc" in { // All PPC intrinsics start with "llvm.ppc.". 36 /// PowerPC_Vec_Intrinsic - Base class for all altivec intrinsics. 37 class PowerPC_Vec_Intrinsic<string GCCIntSuffix, list<LLVMType> ret_types, 38 list<LLVMType> param_types, 39 list<IntrinsicProperty> properties> 40 : GCCBuiltin<!strconcat("__builtin_altivec_", GCCIntSuffix)>, 41 Intrinsic<ret_types, param_types, properties>; 42} 43 44//===----------------------------------------------------------------------===// 45// PowerPC Altivec Intrinsic Class Definitions. 46// 47 48/// PowerPC_Vec_FF_Intrinsic - A PowerPC intrinsic that takes one v4f32 49/// vector and returns one. These intrinsics have no side effects. 50class PowerPC_Vec_FF_Intrinsic<string GCCIntSuffix> 51 : PowerPC_Vec_Intrinsic<GCCIntSuffix, 52 [llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>; 53 54/// PowerPC_Vec_FFF_Intrinsic - A PowerPC intrinsic that takes two v4f32 55/// vectors and returns one. These intrinsics have no side effects. 56class PowerPC_Vec_FFF_Intrinsic<string GCCIntSuffix> 57 : PowerPC_Vec_Intrinsic<GCCIntSuffix, 58 [llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], 59 [IntrNoMem]>; 60 61/// PowerPC_Vec_BBB_Intrinsic - A PowerPC intrinsic that takes two v16f8 62/// vectors and returns one. These intrinsics have no side effects. 63class PowerPC_Vec_BBB_Intrinsic<string GCCIntSuffix> 64 : PowerPC_Vec_Intrinsic<GCCIntSuffix, 65 [llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], 66 [IntrNoMem]>; 67 68/// PowerPC_Vec_HHH_Intrinsic - A PowerPC intrinsic that takes two v8i16 69/// vectors and returns one. These intrinsics have no side effects. 70class PowerPC_Vec_HHH_Intrinsic<string GCCIntSuffix> 71 : PowerPC_Vec_Intrinsic<GCCIntSuffix, 72 [llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 73 [IntrNoMem]>; 74 75/// PowerPC_Vec_WWW_Intrinsic - A PowerPC intrinsic that takes two v4i32 76/// vectors and returns one. These intrinsics have no side effects. 77class PowerPC_Vec_WWW_Intrinsic<string GCCIntSuffix> 78 : PowerPC_Vec_Intrinsic<GCCIntSuffix, 79 [llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 80 [IntrNoMem]>; 81 82 83//===----------------------------------------------------------------------===// 84// PowerPC Altivec Intrinsic Definitions. 85 86let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.". 87 // Data Stream Control. 88 def int_ppc_altivec_dss : GCCBuiltin<"__builtin_altivec_dss">, 89 Intrinsic<[], [llvm_i32_ty], []>; 90 def int_ppc_altivec_dssall : GCCBuiltin<"__builtin_altivec_dssall">, 91 Intrinsic<[], [], []>; 92 def int_ppc_altivec_dst : GCCBuiltin<"__builtin_altivec_dst">, 93 Intrinsic<[], 94 [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], 95 []>; 96 def int_ppc_altivec_dstt : GCCBuiltin<"__builtin_altivec_dstt">, 97 Intrinsic<[], 98 [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], 99 []>; 100 def int_ppc_altivec_dstst : GCCBuiltin<"__builtin_altivec_dstst">, 101 Intrinsic<[], 102 [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], 103 []>; 104 def int_ppc_altivec_dststt : GCCBuiltin<"__builtin_altivec_dststt">, 105 Intrinsic<[], 106 [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], 107 []>; 108 109 // VSCR access. 110 def int_ppc_altivec_mfvscr : GCCBuiltin<"__builtin_altivec_mfvscr">, 111 Intrinsic<[llvm_v8i16_ty], [], [IntrReadMem]>; 112 def int_ppc_altivec_mtvscr : GCCBuiltin<"__builtin_altivec_mtvscr">, 113 Intrinsic<[], [llvm_v4i32_ty], []>; 114 115 116 // Loads. These don't map directly to GCC builtins because they represent the 117 // source address with a single pointer. 118 def int_ppc_altivec_lvx : 119 Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty], [IntrReadMem]>; 120 def int_ppc_altivec_lvxl : 121 Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty], [IntrReadMem]>; 122 def int_ppc_altivec_lvebx : 123 Intrinsic<[llvm_v16i8_ty], [llvm_ptr_ty], [IntrReadMem]>; 124 def int_ppc_altivec_lvehx : 125 Intrinsic<[llvm_v8i16_ty], [llvm_ptr_ty], [IntrReadMem]>; 126 def int_ppc_altivec_lvewx : 127 Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty], [IntrReadMem]>; 128 129 // Stores. These don't map directly to GCC builtins because they represent the 130 // source address with a single pointer. 131 def int_ppc_altivec_stvx : 132 Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty], []>; 133 def int_ppc_altivec_stvxl : 134 Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty], []>; 135 def int_ppc_altivec_stvebx : 136 Intrinsic<[], [llvm_v16i8_ty, llvm_ptr_ty], []>; 137 def int_ppc_altivec_stvehx : 138 Intrinsic<[], [llvm_v8i16_ty, llvm_ptr_ty], []>; 139 def int_ppc_altivec_stvewx : 140 Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty], []>; 141 142 // Comparisons setting a vector. 143 def int_ppc_altivec_vcmpbfp : GCCBuiltin<"__builtin_altivec_vcmpbfp">, 144 Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], 145 [IntrNoMem]>; 146 def int_ppc_altivec_vcmpeqfp : GCCBuiltin<"__builtin_altivec_vcmpeqfp">, 147 Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], 148 [IntrNoMem]>; 149 def int_ppc_altivec_vcmpgefp : GCCBuiltin<"__builtin_altivec_vcmpgefp">, 150 Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], 151 [IntrNoMem]>; 152 def int_ppc_altivec_vcmpgtfp : GCCBuiltin<"__builtin_altivec_vcmpgtfp">, 153 Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], 154 [IntrNoMem]>; 155 156 def int_ppc_altivec_vcmpequw : GCCBuiltin<"__builtin_altivec_vcmpequw">, 157 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 158 [IntrNoMem]>; 159 def int_ppc_altivec_vcmpgtsw : GCCBuiltin<"__builtin_altivec_vcmpgtsw">, 160 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 161 [IntrNoMem]>; 162 def int_ppc_altivec_vcmpgtuw : GCCBuiltin<"__builtin_altivec_vcmpgtuw">, 163 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 164 [IntrNoMem]>; 165 166 def int_ppc_altivec_vcmpequh : GCCBuiltin<"__builtin_altivec_vcmpequh">, 167 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 168 [IntrNoMem]>; 169 def int_ppc_altivec_vcmpgtsh : GCCBuiltin<"__builtin_altivec_vcmpgtsh">, 170 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 171 [IntrNoMem]>; 172 def int_ppc_altivec_vcmpgtuh : GCCBuiltin<"__builtin_altivec_vcmpgtuh">, 173 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 174 [IntrNoMem]>; 175 176 def int_ppc_altivec_vcmpequb : GCCBuiltin<"__builtin_altivec_vcmpequb">, 177 Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], 178 [IntrNoMem]>; 179 def int_ppc_altivec_vcmpgtsb : GCCBuiltin<"__builtin_altivec_vcmpgtsb">, 180 Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], 181 [IntrNoMem]>; 182 def int_ppc_altivec_vcmpgtub : GCCBuiltin<"__builtin_altivec_vcmpgtub">, 183 Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], 184 [IntrNoMem]>; 185 186 // Predicate Comparisons. The first operand specifies interpretation of CR6. 187 def int_ppc_altivec_vcmpbfp_p : GCCBuiltin<"__builtin_altivec_vcmpbfp_p">, 188 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v4f32_ty,llvm_v4f32_ty], 189 [IntrNoMem]>; 190 def int_ppc_altivec_vcmpeqfp_p : GCCBuiltin<"__builtin_altivec_vcmpeqfp_p">, 191 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v4f32_ty,llvm_v4f32_ty], 192 [IntrNoMem]>; 193 def int_ppc_altivec_vcmpgefp_p : GCCBuiltin<"__builtin_altivec_vcmpgefp_p">, 194 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v4f32_ty,llvm_v4f32_ty], 195 [IntrNoMem]>; 196 def int_ppc_altivec_vcmpgtfp_p : GCCBuiltin<"__builtin_altivec_vcmpgtfp_p">, 197 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v4f32_ty,llvm_v4f32_ty], 198 [IntrNoMem]>; 199 200 def int_ppc_altivec_vcmpequw_p : GCCBuiltin<"__builtin_altivec_vcmpequw_p">, 201 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v4i32_ty,llvm_v4i32_ty], 202 [IntrNoMem]>; 203 def int_ppc_altivec_vcmpgtsw_p : GCCBuiltin<"__builtin_altivec_vcmpgtsw_p">, 204 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v4i32_ty,llvm_v4i32_ty], 205 [IntrNoMem]>; 206 def int_ppc_altivec_vcmpgtuw_p : GCCBuiltin<"__builtin_altivec_vcmpgtuw_p">, 207 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v4i32_ty,llvm_v4i32_ty], 208 [IntrNoMem]>; 209 210 def int_ppc_altivec_vcmpequh_p : GCCBuiltin<"__builtin_altivec_vcmpequh_p">, 211 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v8i16_ty,llvm_v8i16_ty], 212 [IntrNoMem]>; 213 def int_ppc_altivec_vcmpgtsh_p : GCCBuiltin<"__builtin_altivec_vcmpgtsh_p">, 214 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v8i16_ty,llvm_v8i16_ty], 215 [IntrNoMem]>; 216 def int_ppc_altivec_vcmpgtuh_p : GCCBuiltin<"__builtin_altivec_vcmpgtuh_p">, 217 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v8i16_ty,llvm_v8i16_ty], 218 [IntrNoMem]>; 219 220 def int_ppc_altivec_vcmpequb_p : GCCBuiltin<"__builtin_altivec_vcmpequb_p">, 221 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v16i8_ty,llvm_v16i8_ty], 222 [IntrNoMem]>; 223 def int_ppc_altivec_vcmpgtsb_p : GCCBuiltin<"__builtin_altivec_vcmpgtsb_p">, 224 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v16i8_ty,llvm_v16i8_ty], 225 [IntrNoMem]>; 226 def int_ppc_altivec_vcmpgtub_p : GCCBuiltin<"__builtin_altivec_vcmpgtub_p">, 227 Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v16i8_ty,llvm_v16i8_ty], 228 [IntrNoMem]>; 229} 230 231// Vector average. 232def int_ppc_altivec_vavgsb : PowerPC_Vec_BBB_Intrinsic<"vavgsb">; 233def int_ppc_altivec_vavgsh : PowerPC_Vec_HHH_Intrinsic<"vavgsh">; 234def int_ppc_altivec_vavgsw : PowerPC_Vec_WWW_Intrinsic<"vavgsw">; 235def int_ppc_altivec_vavgub : PowerPC_Vec_BBB_Intrinsic<"vavgub">; 236def int_ppc_altivec_vavguh : PowerPC_Vec_HHH_Intrinsic<"vavguh">; 237def int_ppc_altivec_vavguw : PowerPC_Vec_WWW_Intrinsic<"vavguw">; 238 239// Vector maximum. 240def int_ppc_altivec_vmaxfp : PowerPC_Vec_FFF_Intrinsic<"vmaxfp">; 241def int_ppc_altivec_vmaxsb : PowerPC_Vec_BBB_Intrinsic<"vmaxsb">; 242def int_ppc_altivec_vmaxsh : PowerPC_Vec_HHH_Intrinsic<"vmaxsh">; 243def int_ppc_altivec_vmaxsw : PowerPC_Vec_WWW_Intrinsic<"vmaxsw">; 244def int_ppc_altivec_vmaxub : PowerPC_Vec_BBB_Intrinsic<"vmaxub">; 245def int_ppc_altivec_vmaxuh : PowerPC_Vec_HHH_Intrinsic<"vmaxuh">; 246def int_ppc_altivec_vmaxuw : PowerPC_Vec_WWW_Intrinsic<"vmaxuw">; 247 248// Vector minimum. 249def int_ppc_altivec_vminfp : PowerPC_Vec_FFF_Intrinsic<"vminfp">; 250def int_ppc_altivec_vminsb : PowerPC_Vec_BBB_Intrinsic<"vminsb">; 251def int_ppc_altivec_vminsh : PowerPC_Vec_HHH_Intrinsic<"vminsh">; 252def int_ppc_altivec_vminsw : PowerPC_Vec_WWW_Intrinsic<"vminsw">; 253def int_ppc_altivec_vminub : PowerPC_Vec_BBB_Intrinsic<"vminub">; 254def int_ppc_altivec_vminuh : PowerPC_Vec_HHH_Intrinsic<"vminuh">; 255def int_ppc_altivec_vminuw : PowerPC_Vec_WWW_Intrinsic<"vminuw">; 256 257// Saturating adds. 258def int_ppc_altivec_vaddubs : PowerPC_Vec_BBB_Intrinsic<"vaddubs">; 259def int_ppc_altivec_vaddsbs : PowerPC_Vec_BBB_Intrinsic<"vaddsbs">; 260def int_ppc_altivec_vadduhs : PowerPC_Vec_HHH_Intrinsic<"vadduhs">; 261def int_ppc_altivec_vaddshs : PowerPC_Vec_HHH_Intrinsic<"vaddshs">; 262def int_ppc_altivec_vadduws : PowerPC_Vec_WWW_Intrinsic<"vadduws">; 263def int_ppc_altivec_vaddsws : PowerPC_Vec_WWW_Intrinsic<"vaddsws">; 264def int_ppc_altivec_vaddcuw : PowerPC_Vec_WWW_Intrinsic<"vaddcuw">; 265 266// Saturating subs. 267def int_ppc_altivec_vsububs : PowerPC_Vec_BBB_Intrinsic<"vsububs">; 268def int_ppc_altivec_vsubsbs : PowerPC_Vec_BBB_Intrinsic<"vsubsbs">; 269def int_ppc_altivec_vsubuhs : PowerPC_Vec_HHH_Intrinsic<"vsubuhs">; 270def int_ppc_altivec_vsubshs : PowerPC_Vec_HHH_Intrinsic<"vsubshs">; 271def int_ppc_altivec_vsubuws : PowerPC_Vec_WWW_Intrinsic<"vsubuws">; 272def int_ppc_altivec_vsubsws : PowerPC_Vec_WWW_Intrinsic<"vsubsws">; 273def int_ppc_altivec_vsubcuw : PowerPC_Vec_WWW_Intrinsic<"vsubcuw">; 274 275let TargetPrefix = "ppc" in { // All PPC intrinsics start with "llvm.ppc.". 276 // Saturating multiply-adds. 277 def int_ppc_altivec_vmhaddshs : GCCBuiltin<"__builtin_altivec_vmhaddshs">, 278 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, 279 llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>; 280 def int_ppc_altivec_vmhraddshs : GCCBuiltin<"__builtin_altivec_vmhraddshs">, 281 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, 282 llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>; 283 284 def int_ppc_altivec_vmaddfp : GCCBuiltin<"__builtin_altivec_vmaddfp">, 285 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, 286 llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>; 287 def int_ppc_altivec_vnmsubfp : GCCBuiltin<"__builtin_altivec_vnmsubfp">, 288 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, 289 llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>; 290 291 // Vector Multiply Sum Intructions. 292 def int_ppc_altivec_vmsummbm : GCCBuiltin<"__builtin_altivec_vmsummbm">, 293 Intrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty, llvm_v16i8_ty, 294 llvm_v4i32_ty], [IntrNoMem]>; 295 def int_ppc_altivec_vmsumshm : GCCBuiltin<"__builtin_altivec_vmsumshm">, 296 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty, 297 llvm_v4i32_ty], [IntrNoMem]>; 298 def int_ppc_altivec_vmsumshs : GCCBuiltin<"__builtin_altivec_vmsumshs">, 299 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty, 300 llvm_v4i32_ty], [IntrNoMem]>; 301 def int_ppc_altivec_vmsumubm : GCCBuiltin<"__builtin_altivec_vmsumubm">, 302 Intrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty, llvm_v16i8_ty, 303 llvm_v4i32_ty], [IntrNoMem]>; 304 def int_ppc_altivec_vmsumuhm : GCCBuiltin<"__builtin_altivec_vmsumuhm">, 305 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty, 306 llvm_v4i32_ty], [IntrNoMem]>; 307 def int_ppc_altivec_vmsumuhs : GCCBuiltin<"__builtin_altivec_vmsumuhs">, 308 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty, 309 llvm_v4i32_ty], [IntrNoMem]>; 310 311 // Vector Multiply Intructions. 312 def int_ppc_altivec_vmulesb : GCCBuiltin<"__builtin_altivec_vmulesb">, 313 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], 314 [IntrNoMem]>; 315 def int_ppc_altivec_vmulesh : GCCBuiltin<"__builtin_altivec_vmulesh">, 316 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 317 [IntrNoMem]>; 318 def int_ppc_altivec_vmuleub : GCCBuiltin<"__builtin_altivec_vmuleub">, 319 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], 320 [IntrNoMem]>; 321 def int_ppc_altivec_vmuleuh : GCCBuiltin<"__builtin_altivec_vmuleuh">, 322 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 323 [IntrNoMem]>; 324 325 def int_ppc_altivec_vmulosb : GCCBuiltin<"__builtin_altivec_vmulosb">, 326 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], 327 [IntrNoMem]>; 328 def int_ppc_altivec_vmulosh : GCCBuiltin<"__builtin_altivec_vmulosh">, 329 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 330 [IntrNoMem]>; 331 def int_ppc_altivec_vmuloub : GCCBuiltin<"__builtin_altivec_vmuloub">, 332 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], 333 [IntrNoMem]>; 334 def int_ppc_altivec_vmulouh : GCCBuiltin<"__builtin_altivec_vmulouh">, 335 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 336 [IntrNoMem]>; 337 338 // Vector Sum Intructions. 339 def int_ppc_altivec_vsumsws : GCCBuiltin<"__builtin_altivec_vsumsws">, 340 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 341 [IntrNoMem]>; 342 def int_ppc_altivec_vsum2sws : GCCBuiltin<"__builtin_altivec_vsum2sws">, 343 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 344 [IntrNoMem]>; 345 def int_ppc_altivec_vsum4sbs : GCCBuiltin<"__builtin_altivec_vsum4sbs">, 346 Intrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty, llvm_v4i32_ty], 347 [IntrNoMem]>; 348 def int_ppc_altivec_vsum4shs : GCCBuiltin<"__builtin_altivec_vsum4shs">, 349 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v4i32_ty], 350 [IntrNoMem]>; 351 def int_ppc_altivec_vsum4ubs : GCCBuiltin<"__builtin_altivec_vsum4ubs">, 352 Intrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty, llvm_v4i32_ty], 353 [IntrNoMem]>; 354 355 // Other multiplies. 356 def int_ppc_altivec_vmladduhm : GCCBuiltin<"__builtin_altivec_vmladduhm">, 357 Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, 358 llvm_v8i16_ty], [IntrNoMem]>; 359 360 // Packs. 361 def int_ppc_altivec_vpkpx : GCCBuiltin<"__builtin_altivec_vpkpx">, 362 Intrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 363 [IntrNoMem]>; 364 def int_ppc_altivec_vpkshss : GCCBuiltin<"__builtin_altivec_vpkshss">, 365 Intrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 366 [IntrNoMem]>; 367 def int_ppc_altivec_vpkshus : GCCBuiltin<"__builtin_altivec_vpkshus">, 368 Intrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 369 [IntrNoMem]>; 370 def int_ppc_altivec_vpkswss : GCCBuiltin<"__builtin_altivec_vpkswss">, 371 Intrinsic<[llvm_v16i8_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 372 [IntrNoMem]>; 373 def int_ppc_altivec_vpkswus : GCCBuiltin<"__builtin_altivec_vpkswus">, 374 Intrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 375 [IntrNoMem]>; 376 // vpkuhum is lowered to a shuffle. 377 def int_ppc_altivec_vpkuhus : GCCBuiltin<"__builtin_altivec_vpkuhus">, 378 Intrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty, llvm_v8i16_ty], 379 [IntrNoMem]>; 380 // vpkuwum is lowered to a shuffle. 381 def int_ppc_altivec_vpkuwus : GCCBuiltin<"__builtin_altivec_vpkuwus">, 382 Intrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty, llvm_v4i32_ty], 383 [IntrNoMem]>; 384 385 // Unpacks. 386 def int_ppc_altivec_vupkhpx : GCCBuiltin<"__builtin_altivec_vupkhpx">, 387 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>; 388 def int_ppc_altivec_vupkhsb : GCCBuiltin<"__builtin_altivec_vupkhsb">, 389 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty], [IntrNoMem]>; 390 def int_ppc_altivec_vupkhsh : GCCBuiltin<"__builtin_altivec_vupkhsh">, 391 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>; 392 def int_ppc_altivec_vupklpx : GCCBuiltin<"__builtin_altivec_vupklpx">, 393 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>; 394 def int_ppc_altivec_vupklsb : GCCBuiltin<"__builtin_altivec_vupklsb">, 395 Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty], [IntrNoMem]>; 396 def int_ppc_altivec_vupklsh : GCCBuiltin<"__builtin_altivec_vupklsh">, 397 Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>; 398 399 400 // FP <-> integer conversion. 401 def int_ppc_altivec_vcfsx : GCCBuiltin<"__builtin_altivec_vcfsx">, 402 Intrinsic<[llvm_v4f32_ty], [llvm_v4i32_ty, llvm_i32_ty], 403 [IntrNoMem]>; 404 def int_ppc_altivec_vcfux : GCCBuiltin<"__builtin_altivec_vcfux">, 405 Intrinsic<[llvm_v4f32_ty], [llvm_v4i32_ty, llvm_i32_ty], 406 [IntrNoMem]>; 407 def int_ppc_altivec_vctsxs : GCCBuiltin<"__builtin_altivec_vctsxs">, 408 Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_i32_ty], 409 [IntrNoMem]>; 410 def int_ppc_altivec_vctuxs : GCCBuiltin<"__builtin_altivec_vctuxs">, 411 Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_i32_ty], 412 [IntrNoMem]>; 413 414 def int_ppc_altivec_vrfim : GCCBuiltin<"__builtin_altivec_vrfim">, 415 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>; 416 def int_ppc_altivec_vrfin : GCCBuiltin<"__builtin_altivec_vrfin">, 417 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>; 418 def int_ppc_altivec_vrfip : GCCBuiltin<"__builtin_altivec_vrfip">, 419 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>; 420 def int_ppc_altivec_vrfiz : GCCBuiltin<"__builtin_altivec_vrfiz">, 421 Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>; 422} 423 424def int_ppc_altivec_vsl : PowerPC_Vec_WWW_Intrinsic<"vsl">; 425def int_ppc_altivec_vslo : PowerPC_Vec_WWW_Intrinsic<"vslo">; 426 427def int_ppc_altivec_vslb : PowerPC_Vec_BBB_Intrinsic<"vslb">; 428def int_ppc_altivec_vslh : PowerPC_Vec_HHH_Intrinsic<"vslh">; 429def int_ppc_altivec_vslw : PowerPC_Vec_WWW_Intrinsic<"vslw">; 430 431// Right Shifts. 432def int_ppc_altivec_vsr : PowerPC_Vec_WWW_Intrinsic<"vsr">; 433def int_ppc_altivec_vsro : PowerPC_Vec_WWW_Intrinsic<"vsro">; 434 435def int_ppc_altivec_vsrb : PowerPC_Vec_BBB_Intrinsic<"vsrb">; 436def int_ppc_altivec_vsrh : PowerPC_Vec_HHH_Intrinsic<"vsrh">; 437def int_ppc_altivec_vsrw : PowerPC_Vec_WWW_Intrinsic<"vsrw">; 438def int_ppc_altivec_vsrab : PowerPC_Vec_BBB_Intrinsic<"vsrab">; 439def int_ppc_altivec_vsrah : PowerPC_Vec_HHH_Intrinsic<"vsrah">; 440def int_ppc_altivec_vsraw : PowerPC_Vec_WWW_Intrinsic<"vsraw">; 441 442// Rotates. 443def int_ppc_altivec_vrlb : PowerPC_Vec_BBB_Intrinsic<"vrlb">; 444def int_ppc_altivec_vrlh : PowerPC_Vec_HHH_Intrinsic<"vrlh">; 445def int_ppc_altivec_vrlw : PowerPC_Vec_WWW_Intrinsic<"vrlw">; 446 447let TargetPrefix = "ppc" in { // All PPC intrinsics start with "llvm.ppc.". 448 // Miscellaneous. 449 def int_ppc_altivec_lvsl : 450 Intrinsic<[llvm_v16i8_ty], [llvm_ptr_ty], [IntrNoMem]>; 451 def int_ppc_altivec_lvsr : 452 Intrinsic<[llvm_v16i8_ty], [llvm_ptr_ty], [IntrNoMem]>; 453 454 def int_ppc_altivec_vperm : GCCBuiltin<"__builtin_altivec_vperm_4si">, 455 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, 456 llvm_v4i32_ty, llvm_v16i8_ty], [IntrNoMem]>; 457 def int_ppc_altivec_vsel : GCCBuiltin<"__builtin_altivec_vsel_4si">, 458 Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, 459 llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>; 460} 461 462def int_ppc_altivec_vexptefp : PowerPC_Vec_FF_Intrinsic<"vexptefp">; 463def int_ppc_altivec_vlogefp : PowerPC_Vec_FF_Intrinsic<"vlogefp">; 464def int_ppc_altivec_vrefp : PowerPC_Vec_FF_Intrinsic<"vrefp">; 465def int_ppc_altivec_vrsqrtefp : PowerPC_Vec_FF_Intrinsic<"vrsqrtefp">; 466