Home | History | Annotate | Download | only in llvm
      1 //===- IntrinsicsX86.td - Defines X86 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 X86-specific intrinsics.
     11 //
     12 //===----------------------------------------------------------------------===//
     13 
     14 //===----------------------------------------------------------------------===//
     15 // Interrupt traps
     16 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
     17   def int_x86_int : Intrinsic<[], [llvm_i8_ty]>;
     18 }
     19 
     20 //===----------------------------------------------------------------------===//
     21 // 3DNow!
     22 
     23 let TargetPrefix = "x86" in {
     24   def int_x86_3dnow_pavgusb : GCCBuiltin<"__builtin_ia32_pavgusb">,
     25               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     26                         [IntrNoMem]>;
     27   def int_x86_3dnow_pf2id : GCCBuiltin<"__builtin_ia32_pf2id">,
     28               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
     29   def int_x86_3dnow_pfacc : GCCBuiltin<"__builtin_ia32_pfacc">,
     30               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     31                         [IntrNoMem]>;
     32   def int_x86_3dnow_pfadd : GCCBuiltin<"__builtin_ia32_pfadd">,
     33               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     34                         [IntrNoMem]>;
     35   def int_x86_3dnow_pfcmpeq : GCCBuiltin<"__builtin_ia32_pfcmpeq">,
     36               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     37                         [IntrNoMem]>;
     38   def int_x86_3dnow_pfcmpge : GCCBuiltin<"__builtin_ia32_pfcmpge">,
     39               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     40                         [IntrNoMem]>;
     41   def int_x86_3dnow_pfcmpgt : GCCBuiltin<"__builtin_ia32_pfcmpgt">,
     42               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     43                         [IntrNoMem]>;
     44   def int_x86_3dnow_pfmax : GCCBuiltin<"__builtin_ia32_pfmax">,
     45               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     46                         [IntrNoMem]>;
     47   def int_x86_3dnow_pfmin : GCCBuiltin<"__builtin_ia32_pfmin">,
     48               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     49                         [IntrNoMem]>;
     50   def int_x86_3dnow_pfmul : GCCBuiltin<"__builtin_ia32_pfmul">,
     51               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     52                         [IntrNoMem]>;
     53   def int_x86_3dnow_pfrcp : GCCBuiltin<"__builtin_ia32_pfrcp">,
     54               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
     55   def int_x86_3dnow_pfrcpit1 : GCCBuiltin<"__builtin_ia32_pfrcpit1">,
     56               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     57                         [IntrNoMem]>;
     58   def int_x86_3dnow_pfrcpit2 : GCCBuiltin<"__builtin_ia32_pfrcpit2">,
     59               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     60                         [IntrNoMem]>;
     61   def int_x86_3dnow_pfrsqrt : GCCBuiltin<"__builtin_ia32_pfrsqrt">,
     62               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
     63   def int_x86_3dnow_pfrsqit1 : GCCBuiltin<"__builtin_ia32_pfrsqit1">,
     64               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     65                         [IntrNoMem]>;
     66   def int_x86_3dnow_pfsub : GCCBuiltin<"__builtin_ia32_pfsub">,
     67               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     68                         [IntrNoMem]>;
     69   def int_x86_3dnow_pfsubr : GCCBuiltin<"__builtin_ia32_pfsubr">,
     70               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     71                         [IntrNoMem]>;
     72   def int_x86_3dnow_pi2fd : GCCBuiltin<"__builtin_ia32_pi2fd">,
     73               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
     74   def int_x86_3dnow_pmulhrw : GCCBuiltin<"__builtin_ia32_pmulhrw">,
     75               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     76                         [IntrNoMem]>;
     77 }
     78 
     79 //===----------------------------------------------------------------------===//
     80 // 3DNow! extensions
     81 
     82 let TargetPrefix = "x86" in {
     83   def int_x86_3dnowa_pf2iw : GCCBuiltin<"__builtin_ia32_pf2iw">,
     84               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
     85   def int_x86_3dnowa_pfnacc : GCCBuiltin<"__builtin_ia32_pfnacc">,
     86               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     87                         [IntrNoMem]>;
     88   def int_x86_3dnowa_pfpnacc : GCCBuiltin<"__builtin_ia32_pfpnacc">,
     89               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     90                         [IntrNoMem]>;
     91   def int_x86_3dnowa_pi2fw : GCCBuiltin<"__builtin_ia32_pi2fw">,
     92               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
     93   def int_x86_3dnowa_pswapd :
     94               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
     95 }
     96 
     97 //===----------------------------------------------------------------------===//
     98 // SSE1
     99 
    100 // Arithmetic ops
    101 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    102   def int_x86_sse_add_ss : GCCBuiltin<"__builtin_ia32_addss">,
    103               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    104                          llvm_v4f32_ty], [IntrNoMem]>;
    105   def int_x86_sse_sub_ss : GCCBuiltin<"__builtin_ia32_subss">,
    106               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    107                          llvm_v4f32_ty], [IntrNoMem]>;
    108   def int_x86_sse_mul_ss : GCCBuiltin<"__builtin_ia32_mulss">,
    109               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    110                          llvm_v4f32_ty], [IntrNoMem]>;
    111   def int_x86_sse_div_ss : GCCBuiltin<"__builtin_ia32_divss">,
    112               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    113                          llvm_v4f32_ty], [IntrNoMem]>;
    114   def int_x86_sse_sqrt_ss : GCCBuiltin<"__builtin_ia32_sqrtss">,
    115               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
    116                         [IntrNoMem]>;
    117   def int_x86_sse_sqrt_ps : GCCBuiltin<"__builtin_ia32_sqrtps">,
    118               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
    119                         [IntrNoMem]>;
    120   def int_x86_sse_rcp_ss : GCCBuiltin<"__builtin_ia32_rcpss">,
    121               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
    122                         [IntrNoMem]>;
    123   def int_x86_sse_rcp_ps : GCCBuiltin<"__builtin_ia32_rcpps">,
    124               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
    125                         [IntrNoMem]>;
    126   def int_x86_sse_rsqrt_ss : GCCBuiltin<"__builtin_ia32_rsqrtss">,
    127               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
    128                         [IntrNoMem]>;
    129   def int_x86_sse_rsqrt_ps : GCCBuiltin<"__builtin_ia32_rsqrtps">,
    130               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
    131                         [IntrNoMem]>;
    132   def int_x86_sse_min_ss : GCCBuiltin<"__builtin_ia32_minss">,
    133               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    134                          llvm_v4f32_ty], [IntrNoMem]>;
    135   def int_x86_sse_min_ps : GCCBuiltin<"__builtin_ia32_minps">,
    136               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    137                          llvm_v4f32_ty], [IntrNoMem]>;
    138   def int_x86_sse_max_ss : GCCBuiltin<"__builtin_ia32_maxss">,
    139               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    140                          llvm_v4f32_ty], [IntrNoMem]>;
    141   def int_x86_sse_max_ps : GCCBuiltin<"__builtin_ia32_maxps">,
    142               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    143                          llvm_v4f32_ty], [IntrNoMem]>;
    144 }
    145 
    146 // Comparison ops
    147 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    148   def int_x86_sse_cmp_ss :
    149               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    150                          llvm_v4f32_ty, llvm_i8_ty], [IntrNoMem]>;
    151   def int_x86_sse_cmp_ps :
    152               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    153                          llvm_v4f32_ty, llvm_i8_ty], [IntrNoMem]>;
    154   def int_x86_sse_comieq_ss : GCCBuiltin<"__builtin_ia32_comieq">,
    155               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    156                          llvm_v4f32_ty], [IntrNoMem]>;
    157   def int_x86_sse_comilt_ss : GCCBuiltin<"__builtin_ia32_comilt">,
    158               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    159                          llvm_v4f32_ty], [IntrNoMem]>;
    160   def int_x86_sse_comile_ss : GCCBuiltin<"__builtin_ia32_comile">,
    161               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    162                          llvm_v4f32_ty], [IntrNoMem]>;
    163   def int_x86_sse_comigt_ss : GCCBuiltin<"__builtin_ia32_comigt">,
    164               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    165                          llvm_v4f32_ty], [IntrNoMem]>;
    166   def int_x86_sse_comige_ss : GCCBuiltin<"__builtin_ia32_comige">,
    167               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    168                          llvm_v4f32_ty], [IntrNoMem]>;
    169   def int_x86_sse_comineq_ss : GCCBuiltin<"__builtin_ia32_comineq">,
    170               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    171                          llvm_v4f32_ty], [IntrNoMem]>;
    172   def int_x86_sse_ucomieq_ss : GCCBuiltin<"__builtin_ia32_ucomieq">,
    173               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    174                          llvm_v4f32_ty], [IntrNoMem]>;
    175   def int_x86_sse_ucomilt_ss : GCCBuiltin<"__builtin_ia32_ucomilt">,
    176               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    177                          llvm_v4f32_ty], [IntrNoMem]>;
    178   def int_x86_sse_ucomile_ss : GCCBuiltin<"__builtin_ia32_ucomile">,
    179               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    180                          llvm_v4f32_ty], [IntrNoMem]>;
    181   def int_x86_sse_ucomigt_ss : GCCBuiltin<"__builtin_ia32_ucomigt">,
    182               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    183                          llvm_v4f32_ty], [IntrNoMem]>;
    184   def int_x86_sse_ucomige_ss : GCCBuiltin<"__builtin_ia32_ucomige">,
    185               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    186                          llvm_v4f32_ty], [IntrNoMem]>;
    187   def int_x86_sse_ucomineq_ss : GCCBuiltin<"__builtin_ia32_ucomineq">,
    188               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    189                          llvm_v4f32_ty], [IntrNoMem]>;
    190 }
    191 
    192 
    193 // Conversion ops
    194 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    195   def int_x86_sse_cvtss2si : GCCBuiltin<"__builtin_ia32_cvtss2si">,
    196               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    197   def int_x86_sse_cvtss2si64 : GCCBuiltin<"__builtin_ia32_cvtss2si64">,
    198               Intrinsic<[llvm_i64_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    199   def int_x86_sse_cvttss2si : GCCBuiltin<"__builtin_ia32_cvttss2si">,
    200               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    201   def int_x86_sse_cvttss2si64 : GCCBuiltin<"__builtin_ia32_cvttss2si64">,
    202               Intrinsic<[llvm_i64_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    203   def int_x86_sse_cvtsi2ss : GCCBuiltin<"__builtin_ia32_cvtsi2ss">,
    204               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    205                          llvm_i32_ty], [IntrNoMem]>;
    206   def int_x86_sse_cvtsi642ss : GCCBuiltin<"__builtin_ia32_cvtsi642ss">,
    207               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    208                          llvm_i64_ty], [IntrNoMem]>;
    209   def int_x86_sse_cvtps2pi : GCCBuiltin<"__builtin_ia32_cvtps2pi">,
    210               Intrinsic<[llvm_x86mmx_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    211   def int_x86_sse_cvttps2pi: GCCBuiltin<"__builtin_ia32_cvttps2pi">,
    212               Intrinsic<[llvm_x86mmx_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    213   def int_x86_sse_cvtpi2ps : GCCBuiltin<"__builtin_ia32_cvtpi2ps">,
    214               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    215                          llvm_x86mmx_ty], [IntrNoMem]>;
    216 }
    217 
    218 // SIMD store ops
    219 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    220   def int_x86_sse_storeu_ps : GCCBuiltin<"__builtin_ia32_storeups">,
    221               Intrinsic<[], [llvm_ptr_ty,
    222                          llvm_v4f32_ty], []>;
    223 }
    224 
    225 // Cacheability support ops
    226 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    227   def int_x86_sse_sfence : GCCBuiltin<"__builtin_ia32_sfence">,
    228               Intrinsic<[], [], []>;
    229 }
    230 
    231 // Control register.
    232 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    233   def int_x86_sse_stmxcsr :
    234               Intrinsic<[], [llvm_ptr_ty], []>;
    235   def int_x86_sse_ldmxcsr :
    236               Intrinsic<[], [llvm_ptr_ty], []>;
    237 }
    238 
    239 // Misc.
    240 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    241   def int_x86_sse_movmsk_ps : GCCBuiltin<"__builtin_ia32_movmskps">,
    242               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    243 }
    244 
    245 //===----------------------------------------------------------------------===//
    246 // SSE2
    247 
    248 // FP arithmetic ops
    249 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    250   def int_x86_sse2_add_sd : GCCBuiltin<"__builtin_ia32_addsd">,
    251               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    252                          llvm_v2f64_ty], [IntrNoMem]>;
    253   def int_x86_sse2_sub_sd : GCCBuiltin<"__builtin_ia32_subsd">,
    254               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    255                          llvm_v2f64_ty], [IntrNoMem]>;
    256   def int_x86_sse2_mul_sd : GCCBuiltin<"__builtin_ia32_mulsd">,
    257               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    258                          llvm_v2f64_ty], [IntrNoMem]>;
    259   def int_x86_sse2_div_sd : GCCBuiltin<"__builtin_ia32_divsd">,
    260               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    261                          llvm_v2f64_ty], [IntrNoMem]>;
    262   def int_x86_sse2_sqrt_sd : GCCBuiltin<"__builtin_ia32_sqrtsd">,
    263               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty],
    264                         [IntrNoMem]>;
    265   def int_x86_sse2_sqrt_pd : GCCBuiltin<"__builtin_ia32_sqrtpd">,
    266               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty],
    267                         [IntrNoMem]>;
    268   def int_x86_sse2_min_sd : GCCBuiltin<"__builtin_ia32_minsd">,
    269               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    270                          llvm_v2f64_ty], [IntrNoMem]>;
    271   def int_x86_sse2_min_pd : GCCBuiltin<"__builtin_ia32_minpd">,
    272               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    273                          llvm_v2f64_ty], [IntrNoMem]>;
    274   def int_x86_sse2_max_sd : GCCBuiltin<"__builtin_ia32_maxsd">,
    275               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    276                          llvm_v2f64_ty], [IntrNoMem]>;
    277   def int_x86_sse2_max_pd : GCCBuiltin<"__builtin_ia32_maxpd">,
    278               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    279                          llvm_v2f64_ty], [IntrNoMem]>;
    280 }
    281 
    282 // FP comparison ops
    283 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    284   def int_x86_sse2_cmp_sd :
    285               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    286                          llvm_v2f64_ty, llvm_i8_ty], [IntrNoMem]>;
    287   def int_x86_sse2_cmp_pd :
    288               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    289                          llvm_v2f64_ty, llvm_i8_ty], [IntrNoMem]>;
    290   def int_x86_sse2_comieq_sd : GCCBuiltin<"__builtin_ia32_comisdeq">,
    291               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    292                          llvm_v2f64_ty], [IntrNoMem]>;
    293   def int_x86_sse2_comilt_sd : GCCBuiltin<"__builtin_ia32_comisdlt">,
    294               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    295                          llvm_v2f64_ty], [IntrNoMem]>;
    296   def int_x86_sse2_comile_sd : GCCBuiltin<"__builtin_ia32_comisdle">,
    297               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    298                          llvm_v2f64_ty], [IntrNoMem]>;
    299   def int_x86_sse2_comigt_sd : GCCBuiltin<"__builtin_ia32_comisdgt">,
    300               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    301                          llvm_v2f64_ty], [IntrNoMem]>;
    302   def int_x86_sse2_comige_sd : GCCBuiltin<"__builtin_ia32_comisdge">,
    303               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    304                          llvm_v2f64_ty], [IntrNoMem]>;
    305   def int_x86_sse2_comineq_sd : GCCBuiltin<"__builtin_ia32_comisdneq">,
    306               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    307                          llvm_v2f64_ty], [IntrNoMem]>;
    308   def int_x86_sse2_ucomieq_sd : GCCBuiltin<"__builtin_ia32_ucomisdeq">,
    309               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    310                          llvm_v2f64_ty], [IntrNoMem]>;
    311   def int_x86_sse2_ucomilt_sd : GCCBuiltin<"__builtin_ia32_ucomisdlt">,
    312               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    313                          llvm_v2f64_ty], [IntrNoMem]>;
    314   def int_x86_sse2_ucomile_sd : GCCBuiltin<"__builtin_ia32_ucomisdle">,
    315               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    316                          llvm_v2f64_ty], [IntrNoMem]>;
    317   def int_x86_sse2_ucomigt_sd : GCCBuiltin<"__builtin_ia32_ucomisdgt">,
    318               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    319                          llvm_v2f64_ty], [IntrNoMem]>;
    320   def int_x86_sse2_ucomige_sd : GCCBuiltin<"__builtin_ia32_ucomisdge">,
    321               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    322                          llvm_v2f64_ty], [IntrNoMem]>;
    323   def int_x86_sse2_ucomineq_sd : GCCBuiltin<"__builtin_ia32_ucomisdneq">,
    324               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    325                          llvm_v2f64_ty], [IntrNoMem]>;
    326 }
    327 
    328 // Integer arithmetic ops.
    329 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    330   def int_x86_sse2_padds_b : GCCBuiltin<"__builtin_ia32_paddsb128">,
    331               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    332                          llvm_v16i8_ty], [IntrNoMem, Commutative]>;
    333   def int_x86_sse2_padds_w : GCCBuiltin<"__builtin_ia32_paddsw128">,
    334               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    335                          llvm_v8i16_ty], [IntrNoMem, Commutative]>;
    336   def int_x86_sse2_paddus_b : GCCBuiltin<"__builtin_ia32_paddusb128">,
    337               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    338                          llvm_v16i8_ty], [IntrNoMem, Commutative]>;
    339   def int_x86_sse2_paddus_w : GCCBuiltin<"__builtin_ia32_paddusw128">,
    340               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    341                          llvm_v8i16_ty], [IntrNoMem, Commutative]>;
    342   def int_x86_sse2_psubs_b : GCCBuiltin<"__builtin_ia32_psubsb128">,
    343               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    344                          llvm_v16i8_ty], [IntrNoMem]>;
    345   def int_x86_sse2_psubs_w : GCCBuiltin<"__builtin_ia32_psubsw128">,
    346               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    347                          llvm_v8i16_ty], [IntrNoMem]>;
    348   def int_x86_sse2_psubus_b : GCCBuiltin<"__builtin_ia32_psubusb128">,
    349               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    350                          llvm_v16i8_ty], [IntrNoMem]>;
    351   def int_x86_sse2_psubus_w : GCCBuiltin<"__builtin_ia32_psubusw128">,
    352               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    353                          llvm_v8i16_ty], [IntrNoMem]>;
    354   def int_x86_sse2_pmulhu_w : GCCBuiltin<"__builtin_ia32_pmulhuw128">,
    355               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    356                          llvm_v8i16_ty], [IntrNoMem, Commutative]>;
    357   def int_x86_sse2_pmulh_w : GCCBuiltin<"__builtin_ia32_pmulhw128">,
    358               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    359                          llvm_v8i16_ty], [IntrNoMem, Commutative]>;
    360   def int_x86_sse2_pmulu_dq : GCCBuiltin<"__builtin_ia32_pmuludq128">,
    361               Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty,
    362                          llvm_v4i32_ty], [IntrNoMem, Commutative]>;
    363   def int_x86_sse2_pmadd_wd : GCCBuiltin<"__builtin_ia32_pmaddwd128">,
    364               Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty,
    365                          llvm_v8i16_ty], [IntrNoMem, Commutative]>;
    366   def int_x86_sse2_pavg_b : GCCBuiltin<"__builtin_ia32_pavgb128">,
    367               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    368                          llvm_v16i8_ty], [IntrNoMem, Commutative]>;
    369   def int_x86_sse2_pavg_w : GCCBuiltin<"__builtin_ia32_pavgw128">,
    370               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    371                          llvm_v8i16_ty], [IntrNoMem, Commutative]>;
    372   def int_x86_sse2_pmaxu_b : GCCBuiltin<"__builtin_ia32_pmaxub128">,
    373               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    374                          llvm_v16i8_ty], [IntrNoMem, Commutative]>;
    375   def int_x86_sse2_pmaxs_w : GCCBuiltin<"__builtin_ia32_pmaxsw128">,
    376               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    377                          llvm_v8i16_ty], [IntrNoMem, Commutative]>;
    378   def int_x86_sse2_pminu_b : GCCBuiltin<"__builtin_ia32_pminub128">,
    379               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    380                          llvm_v16i8_ty], [IntrNoMem, Commutative]>;
    381   def int_x86_sse2_pmins_w : GCCBuiltin<"__builtin_ia32_pminsw128">,
    382               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    383                          llvm_v8i16_ty], [IntrNoMem, Commutative]>;
    384   def int_x86_sse2_psad_bw : GCCBuiltin<"__builtin_ia32_psadbw128">,
    385               Intrinsic<[llvm_v2i64_ty], [llvm_v16i8_ty,
    386                          llvm_v16i8_ty], [IntrNoMem, Commutative]>;
    387 }
    388 
    389 // Integer shift ops.
    390 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    391   def int_x86_sse2_psll_w : GCCBuiltin<"__builtin_ia32_psllw128">,
    392               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    393                          llvm_v8i16_ty], [IntrNoMem]>;
    394   def int_x86_sse2_psll_d : GCCBuiltin<"__builtin_ia32_pslld128">,
    395               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    396                          llvm_v4i32_ty], [IntrNoMem]>;
    397   def int_x86_sse2_psll_q : GCCBuiltin<"__builtin_ia32_psllq128">,
    398               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
    399                          llvm_v2i64_ty], [IntrNoMem]>;
    400   def int_x86_sse2_psrl_w : GCCBuiltin<"__builtin_ia32_psrlw128">,
    401               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    402                          llvm_v8i16_ty], [IntrNoMem]>;
    403   def int_x86_sse2_psrl_d : GCCBuiltin<"__builtin_ia32_psrld128">,
    404               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    405                          llvm_v4i32_ty], [IntrNoMem]>;
    406   def int_x86_sse2_psrl_q : GCCBuiltin<"__builtin_ia32_psrlq128">,
    407               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
    408                          llvm_v2i64_ty], [IntrNoMem]>;
    409   def int_x86_sse2_psra_w : GCCBuiltin<"__builtin_ia32_psraw128">,
    410               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    411                          llvm_v8i16_ty], [IntrNoMem]>;
    412   def int_x86_sse2_psra_d : GCCBuiltin<"__builtin_ia32_psrad128">,
    413               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    414                          llvm_v4i32_ty], [IntrNoMem]>;
    415 
    416   def int_x86_sse2_pslli_w : GCCBuiltin<"__builtin_ia32_psllwi128">,
    417               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    418                          llvm_i32_ty], [IntrNoMem]>;
    419   def int_x86_sse2_pslli_d : GCCBuiltin<"__builtin_ia32_pslldi128">,
    420               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    421                          llvm_i32_ty], [IntrNoMem]>;
    422   def int_x86_sse2_pslli_q : GCCBuiltin<"__builtin_ia32_psllqi128">,
    423               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
    424                          llvm_i32_ty], [IntrNoMem]>;
    425   def int_x86_sse2_psrli_w : GCCBuiltin<"__builtin_ia32_psrlwi128">,
    426               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    427                          llvm_i32_ty], [IntrNoMem]>;
    428   def int_x86_sse2_psrli_d : GCCBuiltin<"__builtin_ia32_psrldi128">,
    429               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    430                          llvm_i32_ty], [IntrNoMem]>;
    431   def int_x86_sse2_psrli_q : GCCBuiltin<"__builtin_ia32_psrlqi128">,
    432               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
    433                          llvm_i32_ty], [IntrNoMem]>;
    434   def int_x86_sse2_psrai_w : GCCBuiltin<"__builtin_ia32_psrawi128">,
    435               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    436                          llvm_i32_ty], [IntrNoMem]>;
    437   def int_x86_sse2_psrai_d : GCCBuiltin<"__builtin_ia32_psradi128">,
    438               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    439                          llvm_i32_ty], [IntrNoMem]>;
    440 
    441   def int_x86_sse2_psll_dq : GCCBuiltin<"__builtin_ia32_pslldqi128">,
    442               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
    443                          llvm_i32_ty], [IntrNoMem]>;
    444   def int_x86_sse2_psrl_dq : GCCBuiltin<"__builtin_ia32_psrldqi128">,
    445               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
    446                          llvm_i32_ty], [IntrNoMem]>;
    447   def int_x86_sse2_psll_dq_bs : GCCBuiltin<"__builtin_ia32_pslldqi128_byteshift">,
    448               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
    449                          llvm_i32_ty], [IntrNoMem]>;
    450   def int_x86_sse2_psrl_dq_bs : GCCBuiltin<"__builtin_ia32_psrldqi128_byteshift">,
    451               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
    452                          llvm_i32_ty], [IntrNoMem]>;
    453 }
    454 
    455 // Integer comparison ops
    456 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    457   def int_x86_sse2_pcmpeq_b : GCCBuiltin<"__builtin_ia32_pcmpeqb128">,
    458               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    459                          llvm_v16i8_ty], [IntrNoMem]>;
    460   def int_x86_sse2_pcmpeq_w : GCCBuiltin<"__builtin_ia32_pcmpeqw128">,
    461               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    462                          llvm_v8i16_ty], [IntrNoMem]>;
    463   def int_x86_sse2_pcmpeq_d : GCCBuiltin<"__builtin_ia32_pcmpeqd128">,
    464               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    465                          llvm_v4i32_ty], [IntrNoMem]>;
    466   def int_x86_sse2_pcmpgt_b : GCCBuiltin<"__builtin_ia32_pcmpgtb128">,
    467               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    468                          llvm_v16i8_ty], [IntrNoMem]>;
    469   def int_x86_sse2_pcmpgt_w : GCCBuiltin<"__builtin_ia32_pcmpgtw128">,
    470               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    471                          llvm_v8i16_ty], [IntrNoMem]>;
    472   def int_x86_sse2_pcmpgt_d : GCCBuiltin<"__builtin_ia32_pcmpgtd128">,
    473               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    474                          llvm_v4i32_ty], [IntrNoMem]>;
    475 }
    476 
    477 // Conversion ops
    478 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    479   def int_x86_sse2_cvtdq2pd : GCCBuiltin<"__builtin_ia32_cvtdq2pd">,
    480               Intrinsic<[llvm_v2f64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
    481   def int_x86_sse2_cvtdq2ps : GCCBuiltin<"__builtin_ia32_cvtdq2ps">,
    482               Intrinsic<[llvm_v4f32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
    483   def int_x86_sse2_cvtpd2dq : GCCBuiltin<"__builtin_ia32_cvtpd2dq">,
    484               Intrinsic<[llvm_v4i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    485   def int_x86_sse2_cvttpd2dq : GCCBuiltin<"__builtin_ia32_cvttpd2dq">,
    486               Intrinsic<[llvm_v4i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    487   def int_x86_sse2_cvtpd2ps : GCCBuiltin<"__builtin_ia32_cvtpd2ps">,
    488               Intrinsic<[llvm_v4f32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    489   def int_x86_sse2_cvtps2dq : GCCBuiltin<"__builtin_ia32_cvtps2dq">,
    490               Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    491   def int_x86_sse2_cvttps2dq : GCCBuiltin<"__builtin_ia32_cvttps2dq">,
    492               Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    493   def int_x86_sse2_cvtps2pd : GCCBuiltin<"__builtin_ia32_cvtps2pd">,
    494               Intrinsic<[llvm_v2f64_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    495   def int_x86_sse2_cvtsd2si : GCCBuiltin<"__builtin_ia32_cvtsd2si">,
    496               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    497   def int_x86_sse2_cvtsd2si64 : GCCBuiltin<"__builtin_ia32_cvtsd2si64">,
    498               Intrinsic<[llvm_i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    499   def int_x86_sse2_cvttsd2si : GCCBuiltin<"__builtin_ia32_cvttsd2si">,
    500               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    501   def int_x86_sse2_cvttsd2si64 : GCCBuiltin<"__builtin_ia32_cvttsd2si64">,
    502               Intrinsic<[llvm_i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    503   def int_x86_sse2_cvtsi2sd : GCCBuiltin<"__builtin_ia32_cvtsi2sd">,
    504               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    505                          llvm_i32_ty], [IntrNoMem]>;
    506   def int_x86_sse2_cvtsi642sd : GCCBuiltin<"__builtin_ia32_cvtsi642sd">,
    507               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    508                          llvm_i64_ty], [IntrNoMem]>;
    509   def int_x86_sse2_cvtsd2ss : GCCBuiltin<"__builtin_ia32_cvtsd2ss">,
    510               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    511                          llvm_v2f64_ty], [IntrNoMem]>;
    512   def int_x86_sse2_cvtss2sd : GCCBuiltin<"__builtin_ia32_cvtss2sd">,
    513               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    514                          llvm_v4f32_ty], [IntrNoMem]>;
    515   def int_x86_sse_cvtpd2pi : GCCBuiltin<"__builtin_ia32_cvtpd2pi">,
    516               Intrinsic<[llvm_x86mmx_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    517   def int_x86_sse_cvttpd2pi: GCCBuiltin<"__builtin_ia32_cvttpd2pi">,
    518               Intrinsic<[llvm_x86mmx_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    519   def int_x86_sse_cvtpi2pd : GCCBuiltin<"__builtin_ia32_cvtpi2pd">,
    520               Intrinsic<[llvm_v2f64_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
    521 }
    522 
    523 // SIMD store ops
    524 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    525   def int_x86_sse2_storeu_pd : GCCBuiltin<"__builtin_ia32_storeupd">,
    526               Intrinsic<[], [llvm_ptr_ty,
    527                          llvm_v2f64_ty], []>;
    528   def int_x86_sse2_storeu_dq : GCCBuiltin<"__builtin_ia32_storedqu">,
    529               Intrinsic<[], [llvm_ptr_ty,
    530                          llvm_v16i8_ty], []>;
    531   def int_x86_sse2_storel_dq : GCCBuiltin<"__builtin_ia32_storelv4si">,
    532               Intrinsic<[], [llvm_ptr_ty,
    533                          llvm_v4i32_ty], []>;
    534 }
    535 
    536 // Misc.
    537 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    538   def int_x86_sse2_packsswb_128 : GCCBuiltin<"__builtin_ia32_packsswb128">,
    539               Intrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty,
    540                          llvm_v8i16_ty], [IntrNoMem]>;
    541   def int_x86_sse2_packssdw_128 : GCCBuiltin<"__builtin_ia32_packssdw128">,
    542               Intrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty,
    543                          llvm_v4i32_ty], [IntrNoMem]>;
    544   def int_x86_sse2_packuswb_128 : GCCBuiltin<"__builtin_ia32_packuswb128">,
    545               Intrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty,
    546                          llvm_v8i16_ty], [IntrNoMem]>;
    547   def int_x86_sse2_movmsk_pd : GCCBuiltin<"__builtin_ia32_movmskpd">,
    548               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    549   def int_x86_sse2_pmovmskb_128 : GCCBuiltin<"__builtin_ia32_pmovmskb128">,
    550               Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
    551   def int_x86_sse2_maskmov_dqu : GCCBuiltin<"__builtin_ia32_maskmovdqu">,
    552               Intrinsic<[], [llvm_v16i8_ty,
    553                          llvm_v16i8_ty, llvm_ptr_ty], []>;
    554   def int_x86_sse2_clflush : GCCBuiltin<"__builtin_ia32_clflush">,
    555               Intrinsic<[], [llvm_ptr_ty], []>;
    556   def int_x86_sse2_lfence : GCCBuiltin<"__builtin_ia32_lfence">,
    557               Intrinsic<[], [], []>;
    558   def int_x86_sse2_mfence : GCCBuiltin<"__builtin_ia32_mfence">,
    559               Intrinsic<[], [], []>;
    560 }
    561 
    562 //===----------------------------------------------------------------------===//
    563 // SSE3
    564 
    565 // Addition / subtraction ops.
    566 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    567   def int_x86_sse3_addsub_ps : GCCBuiltin<"__builtin_ia32_addsubps">,
    568               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    569                          llvm_v4f32_ty], [IntrNoMem]>;
    570   def int_x86_sse3_addsub_pd : GCCBuiltin<"__builtin_ia32_addsubpd">,
    571               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    572                          llvm_v2f64_ty], [IntrNoMem]>;
    573 }
    574 
    575 // Horizontal ops.
    576 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    577   def int_x86_sse3_hadd_ps : GCCBuiltin<"__builtin_ia32_haddps">,
    578               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    579                          llvm_v4f32_ty], [IntrNoMem]>;
    580   def int_x86_sse3_hadd_pd : GCCBuiltin<"__builtin_ia32_haddpd">,
    581               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    582                          llvm_v2f64_ty], [IntrNoMem]>;
    583   def int_x86_sse3_hsub_ps : GCCBuiltin<"__builtin_ia32_hsubps">,
    584               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    585                          llvm_v4f32_ty], [IntrNoMem]>;
    586   def int_x86_sse3_hsub_pd : GCCBuiltin<"__builtin_ia32_hsubpd">,
    587               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    588                          llvm_v2f64_ty], [IntrNoMem]>;
    589 }
    590 
    591 // Specialized unaligned load.
    592 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    593   def int_x86_sse3_ldu_dq : GCCBuiltin<"__builtin_ia32_lddqu">,
    594               Intrinsic<[llvm_v16i8_ty], [llvm_ptr_ty], [IntrReadMem]>;
    595 }
    596 
    597 // Thread synchronization ops.
    598 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    599   def int_x86_sse3_monitor : GCCBuiltin<"__builtin_ia32_monitor">,
    600               Intrinsic<[], [llvm_ptr_ty,
    601                          llvm_i32_ty, llvm_i32_ty], []>;
    602   def int_x86_sse3_mwait : GCCBuiltin<"__builtin_ia32_mwait">,
    603               Intrinsic<[], [llvm_i32_ty,
    604                          llvm_i32_ty], []>;
    605 }
    606 
    607 //===----------------------------------------------------------------------===//
    608 // SSSE3
    609 
    610 // Horizontal arithmetic ops
    611 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    612   def int_x86_ssse3_phadd_w         : GCCBuiltin<"__builtin_ia32_phaddw">,
    613               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    614                          llvm_x86mmx_ty], [IntrNoMem]>;
    615   def int_x86_ssse3_phadd_w_128     : GCCBuiltin<"__builtin_ia32_phaddw128">,
    616               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    617                          llvm_v8i16_ty], [IntrNoMem]>;
    618 
    619   def int_x86_ssse3_phadd_d         : GCCBuiltin<"__builtin_ia32_phaddd">,
    620               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    621                          llvm_x86mmx_ty], [IntrNoMem]>;
    622   def int_x86_ssse3_phadd_d_128     : GCCBuiltin<"__builtin_ia32_phaddd128">,
    623               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    624                          llvm_v4i32_ty], [IntrNoMem]>;
    625 
    626   def int_x86_ssse3_phadd_sw        : GCCBuiltin<"__builtin_ia32_phaddsw">,
    627               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    628                          llvm_x86mmx_ty], [IntrNoMem]>;
    629   def int_x86_ssse3_phadd_sw_128    : GCCBuiltin<"__builtin_ia32_phaddsw128">,
    630               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    631                          llvm_v4i32_ty], [IntrNoMem]>;
    632 
    633   def int_x86_ssse3_phsub_w         : GCCBuiltin<"__builtin_ia32_phsubw">,
    634               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    635                          llvm_x86mmx_ty], [IntrNoMem]>;
    636   def int_x86_ssse3_phsub_w_128     : GCCBuiltin<"__builtin_ia32_phsubw128">,
    637               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    638                          llvm_v8i16_ty], [IntrNoMem]>;
    639 
    640   def int_x86_ssse3_phsub_d         : GCCBuiltin<"__builtin_ia32_phsubd">,
    641               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    642                          llvm_x86mmx_ty], [IntrNoMem]>;
    643   def int_x86_ssse3_phsub_d_128     : GCCBuiltin<"__builtin_ia32_phsubd128">,
    644               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    645                          llvm_v4i32_ty], [IntrNoMem]>;
    646 
    647   def int_x86_ssse3_phsub_sw        : GCCBuiltin<"__builtin_ia32_phsubsw">,
    648               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    649                          llvm_x86mmx_ty], [IntrNoMem]>;
    650   def int_x86_ssse3_phsub_sw_128    : GCCBuiltin<"__builtin_ia32_phsubsw128">,
    651               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    652                          llvm_v8i16_ty], [IntrNoMem]>;
    653 
    654   def int_x86_ssse3_pmadd_ub_sw     : GCCBuiltin<"__builtin_ia32_pmaddubsw">,
    655               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    656                          llvm_x86mmx_ty], [IntrNoMem]>;
    657   def int_x86_ssse3_pmadd_ub_sw_128 : GCCBuiltin<"__builtin_ia32_pmaddubsw128">,
    658               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    659                          llvm_v8i16_ty], [IntrNoMem]>;
    660 }
    661 
    662 // Packed multiply high with round and scale
    663 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    664   def int_x86_ssse3_pmul_hr_sw      : GCCBuiltin<"__builtin_ia32_pmulhrsw">,
    665               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    666                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
    667   def int_x86_ssse3_pmul_hr_sw_128  : GCCBuiltin<"__builtin_ia32_pmulhrsw128">,
    668               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    669                          llvm_v8i16_ty], [IntrNoMem, Commutative]>;
    670 }
    671 
    672 // Shuffle ops
    673 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    674   def int_x86_ssse3_pshuf_b         : GCCBuiltin<"__builtin_ia32_pshufb">,
    675               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    676                          llvm_x86mmx_ty], [IntrNoMem]>;
    677   def int_x86_ssse3_pshuf_b_128     : GCCBuiltin<"__builtin_ia32_pshufb128">,
    678               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    679                          llvm_v16i8_ty], [IntrNoMem]>;
    680   def int_x86_sse_pshuf_w           : GCCBuiltin<"__builtin_ia32_pshufw">,
    681               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i8_ty],
    682                          [IntrNoMem]>;
    683 }
    684 
    685 // Sign ops
    686 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    687   def int_x86_ssse3_psign_b         : GCCBuiltin<"__builtin_ia32_psignb">,
    688               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    689                          llvm_x86mmx_ty], [IntrNoMem]>;
    690   def int_x86_ssse3_psign_b_128     : GCCBuiltin<"__builtin_ia32_psignb128">,
    691               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    692                          llvm_v16i8_ty], [IntrNoMem]>;
    693 
    694   def int_x86_ssse3_psign_w         : GCCBuiltin<"__builtin_ia32_psignw">,
    695               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    696                          llvm_x86mmx_ty], [IntrNoMem]>;
    697   def int_x86_ssse3_psign_w_128     : GCCBuiltin<"__builtin_ia32_psignw128">,
    698               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    699                          llvm_v8i16_ty], [IntrNoMem]>;
    700 
    701   def int_x86_ssse3_psign_d         : GCCBuiltin<"__builtin_ia32_psignd">,
    702               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    703                          llvm_x86mmx_ty], [IntrNoMem]>;
    704   def int_x86_ssse3_psign_d_128     : GCCBuiltin<"__builtin_ia32_psignd128">,
    705               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    706                          llvm_v4i32_ty], [IntrNoMem]>;
    707 }
    708 
    709 // Absolute value ops
    710 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    711   def int_x86_ssse3_pabs_b     : GCCBuiltin<"__builtin_ia32_pabsb">,
    712               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
    713   def int_x86_ssse3_pabs_b_128 : GCCBuiltin<"__builtin_ia32_pabsb128">,
    714               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty], [IntrNoMem]>;
    715 
    716   def int_x86_ssse3_pabs_w     : GCCBuiltin<"__builtin_ia32_pabsw">,
    717               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
    718   def int_x86_ssse3_pabs_w_128 : GCCBuiltin<"__builtin_ia32_pabsw128">,
    719               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty], [IntrNoMem]>;
    720 
    721   def int_x86_ssse3_pabs_d     : GCCBuiltin<"__builtin_ia32_pabsd">,
    722               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
    723   def int_x86_ssse3_pabs_d_128 : GCCBuiltin<"__builtin_ia32_pabsd128">,
    724               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
    725 }
    726 
    727 //===----------------------------------------------------------------------===//
    728 // SSE4.1
    729 
    730 // FP rounding ops
    731 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    732   def int_x86_sse41_round_ss        : GCCBuiltin<"__builtin_ia32_roundss">,
    733               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
    734                          llvm_i32_ty], [IntrNoMem]>;
    735   def int_x86_sse41_round_ps        : GCCBuiltin<"__builtin_ia32_roundps">,
    736               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    737                          llvm_i32_ty], [IntrNoMem]>;
    738   def int_x86_sse41_round_sd        : GCCBuiltin<"__builtin_ia32_roundsd">,
    739               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
    740                          llvm_i32_ty], [IntrNoMem]>;
    741   def int_x86_sse41_round_pd        : GCCBuiltin<"__builtin_ia32_roundpd">,
    742               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    743                          llvm_i32_ty], [IntrNoMem]>;
    744 }
    745 
    746 // Vector sign and zero extend
    747 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    748   def int_x86_sse41_pmovsxbd        : GCCBuiltin<"__builtin_ia32_pmovsxbd128">,
    749               Intrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty],
    750                         [IntrNoMem]>;
    751   def int_x86_sse41_pmovsxbq        : GCCBuiltin<"__builtin_ia32_pmovsxbq128">,
    752               Intrinsic<[llvm_v2i64_ty], [llvm_v16i8_ty],
    753                         [IntrNoMem]>;
    754   def int_x86_sse41_pmovsxbw        : GCCBuiltin<"__builtin_ia32_pmovsxbw128">,
    755               Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty],
    756                         [IntrNoMem]>;
    757   def int_x86_sse41_pmovsxdq        : GCCBuiltin<"__builtin_ia32_pmovsxdq128">,
    758               Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty],
    759                         [IntrNoMem]>;
    760   def int_x86_sse41_pmovsxwd        : GCCBuiltin<"__builtin_ia32_pmovsxwd128">,
    761               Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty],
    762                         [IntrNoMem]>;
    763   def int_x86_sse41_pmovsxwq        : GCCBuiltin<"__builtin_ia32_pmovsxwq128">,
    764               Intrinsic<[llvm_v2i64_ty], [llvm_v8i16_ty],
    765                         [IntrNoMem]>;
    766   def int_x86_sse41_pmovzxbd        : GCCBuiltin<"__builtin_ia32_pmovzxbd128">,
    767               Intrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty],
    768                         [IntrNoMem]>;
    769   def int_x86_sse41_pmovzxbq        : GCCBuiltin<"__builtin_ia32_pmovzxbq128">,
    770               Intrinsic<[llvm_v2i64_ty], [llvm_v16i8_ty],
    771                         [IntrNoMem]>;
    772   def int_x86_sse41_pmovzxbw        : GCCBuiltin<"__builtin_ia32_pmovzxbw128">,
    773               Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty],
    774                         [IntrNoMem]>;
    775   def int_x86_sse41_pmovzxdq        : GCCBuiltin<"__builtin_ia32_pmovzxdq128">,
    776               Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty],
    777                         [IntrNoMem]>;
    778   def int_x86_sse41_pmovzxwd        : GCCBuiltin<"__builtin_ia32_pmovzxwd128">,
    779               Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty],
    780                         [IntrNoMem]>;
    781   def int_x86_sse41_pmovzxwq        : GCCBuiltin<"__builtin_ia32_pmovzxwq128">,
    782               Intrinsic<[llvm_v2i64_ty], [llvm_v8i16_ty],
    783                         [IntrNoMem]>;
    784 }
    785 
    786 // Vector min element
    787 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    788   def int_x86_sse41_phminposuw     : GCCBuiltin<"__builtin_ia32_phminposuw128">,
    789               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty],
    790                         [IntrNoMem]>;
    791 }
    792 
    793 // Vector compare, min, max
    794 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    795   def int_x86_sse41_pcmpeqq         : GCCBuiltin<"__builtin_ia32_pcmpeqq">,
    796               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    797                         [IntrNoMem, Commutative]>;
    798   def int_x86_sse42_pcmpgtq         : GCCBuiltin<"__builtin_ia32_pcmpgtq">,
    799               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    800                         [IntrNoMem]>;
    801   def int_x86_sse41_pmaxsb          : GCCBuiltin<"__builtin_ia32_pmaxsb128">,
    802               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
    803                         [IntrNoMem, Commutative]>;
    804   def int_x86_sse41_pmaxsd          : GCCBuiltin<"__builtin_ia32_pmaxsd128">,
    805               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    806                         [IntrNoMem, Commutative]>;
    807   def int_x86_sse41_pmaxud          : GCCBuiltin<"__builtin_ia32_pmaxud128">,
    808               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    809                         [IntrNoMem, Commutative]>;
    810   def int_x86_sse41_pmaxuw          : GCCBuiltin<"__builtin_ia32_pmaxuw128">,
    811               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
    812                         [IntrNoMem, Commutative]>;
    813   def int_x86_sse41_pminsb          : GCCBuiltin<"__builtin_ia32_pminsb128">,
    814               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
    815                         [IntrNoMem, Commutative]>;
    816   def int_x86_sse41_pminsd          : GCCBuiltin<"__builtin_ia32_pminsd128">,
    817               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    818                         [IntrNoMem, Commutative]>;
    819   def int_x86_sse41_pminud          : GCCBuiltin<"__builtin_ia32_pminud128">,
    820               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    821                         [IntrNoMem, Commutative]>;
    822   def int_x86_sse41_pminuw          : GCCBuiltin<"__builtin_ia32_pminuw128">,
    823               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
    824                         [IntrNoMem, Commutative]>;
    825 }
    826 
    827 // Advanced Encryption Standard (AES) Instructions
    828 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    829   def int_x86_aesni_aesimc          : GCCBuiltin<"__builtin_ia32_aesimc128">,
    830               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty],
    831                         [IntrNoMem]>;
    832   def int_x86_aesni_aesenc          : GCCBuiltin<"__builtin_ia32_aesenc128">,
    833               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    834                         [IntrNoMem]>;
    835   def int_x86_aesni_aesenclast : GCCBuiltin<"__builtin_ia32_aesenclast128">,
    836               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    837                         [IntrNoMem]>;
    838   def int_x86_aesni_aesdec          : GCCBuiltin<"__builtin_ia32_aesdec128">,
    839               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    840                         [IntrNoMem]>;
    841   def int_x86_aesni_aesdeclast : GCCBuiltin<"__builtin_ia32_aesdeclast128">,
    842               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    843                         [IntrNoMem]>;
    844   def int_x86_aesni_aeskeygenassist :
    845               GCCBuiltin<"__builtin_ia32_aeskeygenassist128">,
    846               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i8_ty],
    847                         [IntrNoMem]>;
    848 }
    849 
    850 // Vector pack
    851 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    852   def int_x86_sse41_packusdw        : GCCBuiltin<"__builtin_ia32_packusdw128">,
    853               Intrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    854                         [IntrNoMem]>;
    855 }
    856 
    857 // Vector multiply
    858 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    859   def int_x86_sse41_pmuldq          : GCCBuiltin<"__builtin_ia32_pmuldq128">,
    860               Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    861                         [IntrNoMem, Commutative]>;
    862 }
    863 
    864 // Vector extract
    865 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    866   def int_x86_sse41_pextrb         :
    867               Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty, llvm_i32_ty],
    868                         [IntrNoMem]>;
    869   def int_x86_sse41_pextrd         :
    870               Intrinsic<[llvm_i32_ty], [llvm_v4i32_ty, llvm_i32_ty],
    871                         [IntrNoMem]>;
    872   def int_x86_sse41_pextrq         :
    873               Intrinsic<[llvm_i64_ty], [llvm_v2i64_ty, llvm_i32_ty],
    874                         [IntrNoMem]>;
    875   def int_x86_sse41_extractps      : GCCBuiltin<"__builtin_ia32_extractps128">,
    876               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty],
    877                         [IntrNoMem]>;
    878 }
    879 
    880 // Vector insert
    881 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    882   def int_x86_sse41_insertps       : GCCBuiltin<"__builtin_ia32_insertps128">,
    883           Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,llvm_i32_ty],
    884                     [IntrNoMem]>;
    885 }
    886 
    887 // Vector blend
    888 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    889   def int_x86_sse41_pblendvb         : GCCBuiltin<"__builtin_ia32_pblendvb128">,
    890         Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty,llvm_v16i8_ty],
    891                   [IntrNoMem]>;
    892   def int_x86_sse41_pblendw          : GCCBuiltin<"__builtin_ia32_pblendw128">,
    893         Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_i32_ty],
    894                   [IntrNoMem]>;
    895   def int_x86_sse41_blendpd          : GCCBuiltin<"__builtin_ia32_blendpd">,
    896         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i32_ty],
    897                   [IntrNoMem]>;
    898   def int_x86_sse41_blendps          : GCCBuiltin<"__builtin_ia32_blendps">,
    899         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty],
    900                   [IntrNoMem]>;
    901   def int_x86_sse41_blendvpd         : GCCBuiltin<"__builtin_ia32_blendvpd">,
    902         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,llvm_v2f64_ty],
    903                   [IntrNoMem]>;
    904   def int_x86_sse41_blendvps         : GCCBuiltin<"__builtin_ia32_blendvps">,
    905         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,llvm_v4f32_ty],
    906                   [IntrNoMem]>;
    907 }
    908 
    909 // Vector dot product
    910 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    911   def int_x86_sse41_dppd            : GCCBuiltin<"__builtin_ia32_dppd">,
    912           Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,llvm_i32_ty],
    913                     [IntrNoMem, Commutative]>;
    914   def int_x86_sse41_dpps            : GCCBuiltin<"__builtin_ia32_dpps">,
    915           Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,llvm_i32_ty],
    916                     [IntrNoMem, Commutative]>;
    917 }
    918 
    919 // Vector sum of absolute differences
    920 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    921   def int_x86_sse41_mpsadbw         : GCCBuiltin<"__builtin_ia32_mpsadbw128">,
    922           Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty,llvm_i32_ty],
    923                     [IntrNoMem, Commutative]>;
    924 }
    925 
    926 // Cacheability support ops
    927 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    928   def int_x86_sse41_movntdqa        : GCCBuiltin<"__builtin_ia32_movntdqa">,
    929           Intrinsic<[llvm_v2i64_ty], [llvm_ptr_ty], [IntrReadMem]>;
    930 }
    931 
    932 // Test instruction with bitwise comparison.
    933 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
    934   def int_x86_sse41_ptestz          : GCCBuiltin<"__builtin_ia32_ptestz128">,
    935           Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty],
    936                     [IntrNoMem]>;
    937   def int_x86_sse41_ptestc          : GCCBuiltin<"__builtin_ia32_ptestc128">,
    938           Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty],
    939                     [IntrNoMem]>;
    940   def int_x86_sse41_ptestnzc        : GCCBuiltin<"__builtin_ia32_ptestnzc128">,
    941           Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty],
    942                     [IntrNoMem]>;
    943 }
    944 
    945 //===----------------------------------------------------------------------===//
    946 // SSE4.2
    947 
    948 // Miscellaneous
    949 // CRC Instruction
    950 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
    951   def int_x86_sse42_crc32_32_8       : GCCBuiltin<"__builtin_ia32_crc32qi">,
    952           Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i8_ty],
    953                     [IntrNoMem]>;
    954   def int_x86_sse42_crc32_32_16      : GCCBuiltin<"__builtin_ia32_crc32hi">,
    955           Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i16_ty],
    956                     [IntrNoMem]>;
    957   def int_x86_sse42_crc32_32_32      : GCCBuiltin<"__builtin_ia32_crc32si">,
    958           Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
    959                     [IntrNoMem]>;
    960   def int_x86_sse42_crc32_64_8       :
    961           Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i8_ty],
    962                     [IntrNoMem]>;
    963   def int_x86_sse42_crc32_64_64      : GCCBuiltin<"__builtin_ia32_crc32di">,
    964           Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
    965                     [IntrNoMem]>;
    966 }
    967 
    968 // String/text processing ops.
    969 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
    970   def int_x86_sse42_pcmpistrm128  : GCCBuiltin<"__builtin_ia32_pcmpistrm128">,
    971     Intrinsic<[llvm_v16i8_ty],
    972         [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
    973         [IntrNoMem]>;
    974   def int_x86_sse42_pcmpistri128  : GCCBuiltin<"__builtin_ia32_pcmpistri128">,
    975     Intrinsic<[llvm_i32_ty],
    976         [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
    977         [IntrNoMem]>;
    978   def int_x86_sse42_pcmpistria128 : GCCBuiltin<"__builtin_ia32_pcmpistria128">,
    979     Intrinsic<[llvm_i32_ty],
    980         [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
    981         [IntrNoMem]>;
    982   def int_x86_sse42_pcmpistric128 : GCCBuiltin<"__builtin_ia32_pcmpistric128">,
    983     Intrinsic<[llvm_i32_ty],
    984         [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
    985         [IntrNoMem]>;
    986   def int_x86_sse42_pcmpistrio128 : GCCBuiltin<"__builtin_ia32_pcmpistrio128">,
    987     Intrinsic<[llvm_i32_ty],
    988         [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
    989         [IntrNoMem]>;
    990   def int_x86_sse42_pcmpistris128 : GCCBuiltin<"__builtin_ia32_pcmpistris128">,
    991     Intrinsic<[llvm_i32_ty],
    992         [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
    993         [IntrNoMem]>;
    994   def int_x86_sse42_pcmpistriz128 : GCCBuiltin<"__builtin_ia32_pcmpistriz128">,
    995     Intrinsic<[llvm_i32_ty],
    996         [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
    997         [IntrNoMem]>;
    998   def int_x86_sse42_pcmpestrm128  : GCCBuiltin<"__builtin_ia32_pcmpestrm128">,
    999     Intrinsic<[llvm_v16i8_ty],
   1000         [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
   1001          llvm_i8_ty],
   1002         [IntrNoMem]>;
   1003   def int_x86_sse42_pcmpestri128  : GCCBuiltin<"__builtin_ia32_pcmpestri128">,
   1004     Intrinsic<[llvm_i32_ty],
   1005         [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
   1006          llvm_i8_ty],
   1007         [IntrNoMem]>;
   1008   def int_x86_sse42_pcmpestria128 : GCCBuiltin<"__builtin_ia32_pcmpestria128">,
   1009     Intrinsic<[llvm_i32_ty],
   1010         [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
   1011          llvm_i8_ty],
   1012         [IntrNoMem]>;
   1013   def int_x86_sse42_pcmpestric128 : GCCBuiltin<"__builtin_ia32_pcmpestric128">,
   1014     Intrinsic<[llvm_i32_ty],
   1015         [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
   1016          llvm_i8_ty],
   1017         [IntrNoMem]>;
   1018   def int_x86_sse42_pcmpestrio128 : GCCBuiltin<"__builtin_ia32_pcmpestrio128">,
   1019     Intrinsic<[llvm_i32_ty],
   1020         [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
   1021          llvm_i8_ty],
   1022         [IntrNoMem]>;
   1023   def int_x86_sse42_pcmpestris128 : GCCBuiltin<"__builtin_ia32_pcmpestris128">,
   1024     Intrinsic<[llvm_i32_ty],
   1025         [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
   1026          llvm_i8_ty],
   1027         [IntrNoMem]>;
   1028   def int_x86_sse42_pcmpestriz128 : GCCBuiltin<"__builtin_ia32_pcmpestriz128">,
   1029     Intrinsic<[llvm_i32_ty],
   1030         [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
   1031          llvm_i8_ty],
   1032         [IntrNoMem]>;
   1033 }
   1034 
   1035 //===----------------------------------------------------------------------===//
   1036 // AVX
   1037 
   1038 // Arithmetic ops
   1039 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1040   def int_x86_avx_addsub_pd_256 : GCCBuiltin<"__builtin_ia32_addsubpd256">,
   1041         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
   1042                   llvm_v4f64_ty], [IntrNoMem]>;
   1043   def int_x86_avx_addsub_ps_256 : GCCBuiltin<"__builtin_ia32_addsubps256">,
   1044         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   1045                   llvm_v8f32_ty], [IntrNoMem]>;
   1046   def int_x86_avx_max_pd_256 : GCCBuiltin<"__builtin_ia32_maxpd256">,
   1047         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
   1048                   llvm_v4f64_ty], [IntrNoMem]>;
   1049   def int_x86_avx_max_ps_256 : GCCBuiltin<"__builtin_ia32_maxps256">,
   1050         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   1051                   llvm_v8f32_ty], [IntrNoMem]>;
   1052   def int_x86_avx_min_pd_256 : GCCBuiltin<"__builtin_ia32_minpd256">,
   1053         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
   1054                   llvm_v4f64_ty], [IntrNoMem]>;
   1055   def int_x86_avx_min_ps_256 : GCCBuiltin<"__builtin_ia32_minps256">,
   1056         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   1057                   llvm_v8f32_ty], [IntrNoMem]>;
   1058 
   1059   def int_x86_avx_sqrt_pd_256 : GCCBuiltin<"__builtin_ia32_sqrtpd256">,
   1060         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty], [IntrNoMem]>;
   1061   def int_x86_avx_sqrt_ps_256 : GCCBuiltin<"__builtin_ia32_sqrtps256">,
   1062         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
   1063 
   1064   def int_x86_avx_rsqrt_ps_256 : GCCBuiltin<"__builtin_ia32_rsqrtps256">,
   1065         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
   1066 
   1067   def int_x86_avx_rcp_ps_256 : GCCBuiltin<"__builtin_ia32_rcpps256">,
   1068         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
   1069 
   1070   def int_x86_avx_round_pd_256 : GCCBuiltin<"__builtin_ia32_roundpd256">,
   1071         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
   1072                   llvm_i32_ty], [IntrNoMem]>;
   1073   def int_x86_avx_round_ps_256 : GCCBuiltin<"__builtin_ia32_roundps256">,
   1074         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   1075                   llvm_i32_ty], [IntrNoMem]>;
   1076 }
   1077 
   1078 // Horizontal ops
   1079 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1080   def int_x86_avx_hadd_pd_256 : GCCBuiltin<"__builtin_ia32_haddpd256">,
   1081         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
   1082                   llvm_v4f64_ty], [IntrNoMem]>;
   1083   def int_x86_avx_hsub_ps_256 : GCCBuiltin<"__builtin_ia32_hsubps256">,
   1084         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   1085                   llvm_v8f32_ty], [IntrNoMem]>;
   1086   def int_x86_avx_hsub_pd_256 : GCCBuiltin<"__builtin_ia32_hsubpd256">,
   1087         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
   1088                   llvm_v4f64_ty], [IntrNoMem]>;
   1089   def int_x86_avx_hadd_ps_256 : GCCBuiltin<"__builtin_ia32_haddps256">,
   1090         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   1091                   llvm_v8f32_ty], [IntrNoMem]>;
   1092 }
   1093 
   1094 // Vector permutation
   1095 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1096   def int_x86_avx_vpermilvar_pd : GCCBuiltin<"__builtin_ia32_vpermilvarpd">,
   1097         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
   1098                   llvm_v2i64_ty], [IntrNoMem]>;
   1099   def int_x86_avx_vpermilvar_ps : GCCBuiltin<"__builtin_ia32_vpermilvarps">,
   1100         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
   1101                   llvm_v4i32_ty], [IntrNoMem]>;
   1102 
   1103   def int_x86_avx_vpermilvar_pd_256 :
   1104         GCCBuiltin<"__builtin_ia32_vpermilvarpd256">,
   1105         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4i64_ty], [IntrNoMem]>;
   1106   def int_x86_avx_vpermilvar_ps_256 :
   1107         GCCBuiltin<"__builtin_ia32_vpermilvarps256">,
   1108         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8i32_ty], [IntrNoMem]>;
   1109 
   1110   def int_x86_avx_vperm2f128_pd_256 :
   1111         GCCBuiltin<"__builtin_ia32_vperm2f128_pd256">,
   1112         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
   1113                   llvm_v4f64_ty, llvm_i8_ty], [IntrNoMem]>;
   1114   def int_x86_avx_vperm2f128_ps_256 :
   1115         GCCBuiltin<"__builtin_ia32_vperm2f128_ps256">,
   1116         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   1117                   llvm_v8f32_ty, llvm_i8_ty], [IntrNoMem]>;
   1118   def int_x86_avx_vperm2f128_si_256 :
   1119         GCCBuiltin<"__builtin_ia32_vperm2f128_si256">,
   1120         Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
   1121                   llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>;
   1122 
   1123   def int_x86_avx_vpermil_pd : GCCBuiltin<"__builtin_ia32_vpermilpd">,
   1124         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
   1125                   llvm_i8_ty], [IntrNoMem]>;
   1126   def int_x86_avx_vpermil_ps : GCCBuiltin<"__builtin_ia32_vpermilps">,
   1127         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
   1128                   llvm_i8_ty], [IntrNoMem]>;
   1129 
   1130   def int_x86_avx_vpermil_pd_256 : GCCBuiltin<"__builtin_ia32_vpermilpd256">,
   1131         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
   1132                   llvm_i8_ty], [IntrNoMem]>;
   1133   def int_x86_avx_vpermil_ps_256 : GCCBuiltin<"__builtin_ia32_vpermilps256">,
   1134         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   1135                   llvm_i8_ty], [IntrNoMem]>;
   1136 }
   1137 
   1138 // Vector blend
   1139 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1140   def int_x86_avx_blend_pd_256 : GCCBuiltin<"__builtin_ia32_blendpd256">,
   1141         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
   1142                   llvm_v4f64_ty, llvm_i32_ty], [IntrNoMem]>;
   1143   def int_x86_avx_blend_ps_256 : GCCBuiltin<"__builtin_ia32_blendps256">,
   1144         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   1145                   llvm_v8f32_ty, llvm_i32_ty], [IntrNoMem]>;
   1146   def int_x86_avx_blendv_pd_256 : GCCBuiltin<"__builtin_ia32_blendvpd256">,
   1147         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
   1148                   llvm_v4f64_ty, llvm_v4f64_ty], [IntrNoMem]>;
   1149   def int_x86_avx_blendv_ps_256 : GCCBuiltin<"__builtin_ia32_blendvps256">,
   1150         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   1151                   llvm_v8f32_ty, llvm_v8f32_ty], [IntrNoMem]>;
   1152 }
   1153 
   1154 // Vector dot product
   1155 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1156   def int_x86_avx_dp_ps_256 : GCCBuiltin<"__builtin_ia32_dpps256">,
   1157         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   1158                   llvm_v8f32_ty, llvm_i32_ty], [IntrNoMem]>;
   1159 }
   1160 
   1161 // Vector compare
   1162 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1163   def int_x86_avx_cmp_pd_256 : GCCBuiltin<"__builtin_ia32_cmppd256">,
   1164         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
   1165                   llvm_v4f64_ty, llvm_i8_ty], [IntrNoMem]>;
   1166   def int_x86_avx_cmp_ps_256 : GCCBuiltin<"__builtin_ia32_cmpps256">,
   1167         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   1168                   llvm_v8f32_ty, llvm_i8_ty], [IntrNoMem]>;
   1169 }
   1170 
   1171 // Vector extract and insert
   1172 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1173   def int_x86_avx_vextractf128_pd_256 :
   1174         GCCBuiltin<"__builtin_ia32_vextractf128_pd256">,
   1175         Intrinsic<[llvm_v2f64_ty], [llvm_v4f64_ty, llvm_i8_ty], [IntrNoMem]>;
   1176   def int_x86_avx_vextractf128_ps_256 :
   1177         GCCBuiltin<"__builtin_ia32_vextractf128_ps256">,
   1178         Intrinsic<[llvm_v4f32_ty], [llvm_v8f32_ty, llvm_i8_ty], [IntrNoMem]>;
   1179   def int_x86_avx_vextractf128_si_256 :
   1180         GCCBuiltin<"__builtin_ia32_vextractf128_si256">,
   1181         Intrinsic<[llvm_v4i32_ty], [llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>;
   1182 
   1183   def int_x86_avx_vinsertf128_pd_256 :
   1184         GCCBuiltin<"__builtin_ia32_vinsertf128_pd256">,
   1185         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
   1186                   llvm_v2f64_ty, llvm_i8_ty], [IntrNoMem]>;
   1187   def int_x86_avx_vinsertf128_ps_256 :
   1188         GCCBuiltin<"__builtin_ia32_vinsertf128_ps256">,
   1189         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   1190                   llvm_v4f32_ty, llvm_i8_ty], [IntrNoMem]>;
   1191   def int_x86_avx_vinsertf128_si_256 :
   1192         GCCBuiltin<"__builtin_ia32_vinsertf128_si256">,
   1193         Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
   1194                   llvm_v4i32_ty, llvm_i8_ty], [IntrNoMem]>;
   1195 }
   1196 
   1197 // Vector convert
   1198 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1199   def int_x86_avx_cvtdq2_pd_256 : GCCBuiltin<"__builtin_ia32_cvtdq2pd256">,
   1200         Intrinsic<[llvm_v4f64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
   1201   def int_x86_avx_cvtdq2_ps_256 : GCCBuiltin<"__builtin_ia32_cvtdq2ps256">,
   1202         Intrinsic<[llvm_v8f32_ty], [llvm_v8i32_ty], [IntrNoMem]>;
   1203   def int_x86_avx_cvt_pd2_ps_256 : GCCBuiltin<"__builtin_ia32_cvtpd2ps256">,
   1204         Intrinsic<[llvm_v4f32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
   1205   def int_x86_avx_cvt_ps2dq_256 : GCCBuiltin<"__builtin_ia32_cvtps2dq256">,
   1206         Intrinsic<[llvm_v8i32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
   1207   def int_x86_avx_cvt_ps2_pd_256 : GCCBuiltin<"__builtin_ia32_cvtps2pd256">,
   1208         Intrinsic<[llvm_v4f64_ty], [llvm_v4f32_ty], [IntrNoMem]>;
   1209   def int_x86_avx_cvtt_pd2dq_256 : GCCBuiltin<"__builtin_ia32_cvttpd2dq256">,
   1210         Intrinsic<[llvm_v4i32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
   1211   def int_x86_avx_cvt_pd2dq_256 : GCCBuiltin<"__builtin_ia32_cvtpd2dq256">,
   1212         Intrinsic<[llvm_v4i32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
   1213   def int_x86_avx_cvtt_ps2dq_256 : GCCBuiltin<"__builtin_ia32_cvttps2dq256">,
   1214         Intrinsic<[llvm_v8i32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
   1215 }
   1216 
   1217 // Vector bit test
   1218 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1219   def int_x86_avx_vtestz_pd : GCCBuiltin<"__builtin_ia32_vtestzpd">,
   1220         Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
   1221                   llvm_v2f64_ty], [IntrNoMem]>;
   1222   def int_x86_avx_vtestc_pd : GCCBuiltin<"__builtin_ia32_vtestcpd">,
   1223         Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
   1224                   llvm_v2f64_ty], [IntrNoMem]>;
   1225   def int_x86_avx_vtestnzc_pd : GCCBuiltin<"__builtin_ia32_vtestnzcpd">,
   1226         Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
   1227                   llvm_v2f64_ty], [IntrNoMem]>;
   1228   def int_x86_avx_vtestz_ps : GCCBuiltin<"__builtin_ia32_vtestzps">,
   1229         Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
   1230                   llvm_v4f32_ty], [IntrNoMem]>;
   1231   def int_x86_avx_vtestc_ps : GCCBuiltin<"__builtin_ia32_vtestcps">,
   1232         Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
   1233                   llvm_v4f32_ty], [IntrNoMem]>;
   1234   def int_x86_avx_vtestnzc_ps : GCCBuiltin<"__builtin_ia32_vtestnzcps">,
   1235         Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
   1236                   llvm_v4f32_ty], [IntrNoMem]>;
   1237   def int_x86_avx_vtestz_pd_256 : GCCBuiltin<"__builtin_ia32_vtestzpd256">,
   1238         Intrinsic<[llvm_i32_ty], [llvm_v4f64_ty,
   1239                   llvm_v4f64_ty], [IntrNoMem]>;
   1240   def int_x86_avx_vtestc_pd_256 : GCCBuiltin<"__builtin_ia32_vtestcpd256">,
   1241         Intrinsic<[llvm_i32_ty], [llvm_v4f64_ty,
   1242                   llvm_v4f64_ty], [IntrNoMem]>;
   1243   def int_x86_avx_vtestnzc_pd_256 : GCCBuiltin<"__builtin_ia32_vtestnzcpd256">,
   1244         Intrinsic<[llvm_i32_ty], [llvm_v4f64_ty,
   1245                   llvm_v4f64_ty], [IntrNoMem]>;
   1246   def int_x86_avx_vtestz_ps_256 : GCCBuiltin<"__builtin_ia32_vtestzps256">,
   1247         Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty,
   1248                   llvm_v8f32_ty], [IntrNoMem]>;
   1249   def int_x86_avx_vtestc_ps_256 : GCCBuiltin<"__builtin_ia32_vtestcps256">,
   1250         Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty,
   1251                   llvm_v8f32_ty], [IntrNoMem]>;
   1252   def int_x86_avx_vtestnzc_ps_256 : GCCBuiltin<"__builtin_ia32_vtestnzcps256">,
   1253         Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty,
   1254                   llvm_v8f32_ty], [IntrNoMem]>;
   1255   def int_x86_avx_ptestz_256 : GCCBuiltin<"__builtin_ia32_ptestz256">,
   1256         Intrinsic<[llvm_i32_ty], [llvm_v4i64_ty,
   1257                   llvm_v4i64_ty], [IntrNoMem]>;
   1258   def int_x86_avx_ptestc_256 : GCCBuiltin<"__builtin_ia32_ptestc256">,
   1259         Intrinsic<[llvm_i32_ty], [llvm_v4i64_ty,
   1260                   llvm_v4i64_ty], [IntrNoMem]>;
   1261   def int_x86_avx_ptestnzc_256 : GCCBuiltin<"__builtin_ia32_ptestnzc256">,
   1262         Intrinsic<[llvm_i32_ty], [llvm_v4i64_ty,
   1263                   llvm_v4i64_ty], [IntrNoMem]>;
   1264 }
   1265 
   1266 // Vector extract sign mask
   1267 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1268   def int_x86_avx_movmsk_pd_256 : GCCBuiltin<"__builtin_ia32_movmskpd256">,
   1269         Intrinsic<[llvm_i32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
   1270   def int_x86_avx_movmsk_ps_256 : GCCBuiltin<"__builtin_ia32_movmskps256">,
   1271         Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
   1272 }
   1273 
   1274 // Vector zero
   1275 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1276   def int_x86_avx_vzeroall : GCCBuiltin<"__builtin_ia32_vzeroall">,
   1277         Intrinsic<[], [], []>;
   1278   def int_x86_avx_vzeroupper : GCCBuiltin<"__builtin_ia32_vzeroupper">,
   1279         Intrinsic<[], [], []>;
   1280 }
   1281 
   1282 // Vector load with broadcast
   1283 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1284   def int_x86_avx_vbroadcastss :
   1285         GCCBuiltin<"__builtin_ia32_vbroadcastss">,
   1286         Intrinsic<[llvm_v4f32_ty], [llvm_ptr_ty], [IntrReadMem]>;
   1287   def int_x86_avx_vbroadcast_sd_256 :
   1288         GCCBuiltin<"__builtin_ia32_vbroadcastsd256">,
   1289         Intrinsic<[llvm_v4f64_ty], [llvm_ptr_ty], [IntrReadMem]>;
   1290   def int_x86_avx_vbroadcastss_256 :
   1291         GCCBuiltin<"__builtin_ia32_vbroadcastss256">,
   1292         Intrinsic<[llvm_v8f32_ty], [llvm_ptr_ty], [IntrReadMem]>;
   1293   def int_x86_avx_vbroadcastf128_pd_256 :
   1294         GCCBuiltin<"__builtin_ia32_vbroadcastf128_pd256">,
   1295         Intrinsic<[llvm_v4f64_ty], [llvm_ptr_ty], [IntrReadMem]>;
   1296   def int_x86_avx_vbroadcastf128_ps_256 :
   1297         GCCBuiltin<"__builtin_ia32_vbroadcastf128_ps256">,
   1298         Intrinsic<[llvm_v8f32_ty], [llvm_ptr_ty], [IntrReadMem]>;
   1299 }
   1300 
   1301 // SIMD load ops
   1302 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1303   def int_x86_avx_loadu_pd_256 : GCCBuiltin<"__builtin_ia32_loadupd256">,
   1304         Intrinsic<[llvm_v4f64_ty], [llvm_ptr_ty], [IntrReadMem]>;
   1305   def int_x86_avx_loadu_ps_256 : GCCBuiltin<"__builtin_ia32_loadups256">,
   1306         Intrinsic<[llvm_v8f32_ty], [llvm_ptr_ty], [IntrReadMem]>;
   1307   def int_x86_avx_loadu_dq_256 : GCCBuiltin<"__builtin_ia32_loaddqu256">,
   1308         Intrinsic<[llvm_v32i8_ty], [llvm_ptr_ty], [IntrReadMem]>;
   1309   def int_x86_avx_ldu_dq_256 : GCCBuiltin<"__builtin_ia32_lddqu256">,
   1310         Intrinsic<[llvm_v32i8_ty], [llvm_ptr_ty], [IntrReadMem]>;
   1311 }
   1312 
   1313 // SIMD store ops
   1314 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1315   def int_x86_avx_storeu_pd_256 : GCCBuiltin<"__builtin_ia32_storeupd256">,
   1316         Intrinsic<[], [llvm_ptr_ty, llvm_v4f64_ty], []>;
   1317   def int_x86_avx_storeu_ps_256 : GCCBuiltin<"__builtin_ia32_storeups256">,
   1318         Intrinsic<[], [llvm_ptr_ty, llvm_v8f32_ty], []>;
   1319   def int_x86_avx_storeu_dq_256 : GCCBuiltin<"__builtin_ia32_storedqu256">,
   1320         Intrinsic<[], [llvm_ptr_ty, llvm_v32i8_ty], []>;
   1321 }
   1322 
   1323 // Cacheability support ops
   1324 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1325   def int_x86_avx_movnt_dq_256 : GCCBuiltin<"__builtin_ia32_movntdq256">,
   1326         Intrinsic<[], [llvm_ptr_ty, llvm_v4i64_ty], []>;
   1327   def int_x86_avx_movnt_pd_256 : GCCBuiltin<"__builtin_ia32_movntpd256">,
   1328         Intrinsic<[], [llvm_ptr_ty, llvm_v4f64_ty], []>;
   1329   def int_x86_avx_movnt_ps_256 : GCCBuiltin<"__builtin_ia32_movntps256">,
   1330         Intrinsic<[], [llvm_ptr_ty, llvm_v8f32_ty], []>;
   1331 }
   1332 
   1333 // Conditional load ops
   1334 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1335   def int_x86_avx_maskload_pd : GCCBuiltin<"__builtin_ia32_maskloadpd">,
   1336         Intrinsic<[llvm_v2f64_ty], [llvm_ptr_ty, llvm_v2f64_ty], [IntrReadMem]>;
   1337   def int_x86_avx_maskload_ps : GCCBuiltin<"__builtin_ia32_maskloadps">,
   1338         Intrinsic<[llvm_v4f32_ty], [llvm_ptr_ty, llvm_v4f32_ty], [IntrReadMem]>;
   1339   def int_x86_avx_maskload_pd_256 : GCCBuiltin<"__builtin_ia32_maskloadpd256">,
   1340         Intrinsic<[llvm_v4f64_ty], [llvm_ptr_ty, llvm_v4f64_ty], [IntrReadMem]>;
   1341   def int_x86_avx_maskload_ps_256 : GCCBuiltin<"__builtin_ia32_maskloadps256">,
   1342         Intrinsic<[llvm_v8f32_ty], [llvm_ptr_ty, llvm_v8f32_ty], [IntrReadMem]>;
   1343 }
   1344 
   1345 // Conditional store ops
   1346 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1347   def int_x86_avx_maskstore_pd : GCCBuiltin<"__builtin_ia32_maskstorepd">,
   1348         Intrinsic<[], [llvm_ptr_ty,
   1349                   llvm_v2f64_ty, llvm_v2f64_ty], []>;
   1350   def int_x86_avx_maskstore_ps : GCCBuiltin<"__builtin_ia32_maskstoreps">,
   1351         Intrinsic<[], [llvm_ptr_ty,
   1352                   llvm_v4f32_ty, llvm_v4f32_ty], []>;
   1353   def int_x86_avx_maskstore_pd_256 :
   1354         GCCBuiltin<"__builtin_ia32_maskstorepd256">,
   1355         Intrinsic<[], [llvm_ptr_ty,
   1356                   llvm_v4f64_ty, llvm_v4f64_ty], []>;
   1357   def int_x86_avx_maskstore_ps_256 :
   1358         GCCBuiltin<"__builtin_ia32_maskstoreps256">,
   1359         Intrinsic<[], [llvm_ptr_ty,
   1360                   llvm_v8f32_ty, llvm_v8f32_ty], []>;
   1361 }
   1362 
   1363 //===----------------------------------------------------------------------===//
   1364 // MMX
   1365 
   1366 // Empty MMX state op.
   1367 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1368   def int_x86_mmx_emms  : GCCBuiltin<"__builtin_ia32_emms">,
   1369               Intrinsic<[], [], []>;
   1370   def int_x86_mmx_femms : GCCBuiltin<"__builtin_ia32_femms">,
   1371               Intrinsic<[], [], []>;
   1372 }
   1373 
   1374 // Integer arithmetic ops.
   1375 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1376   // Addition
   1377   def int_x86_mmx_padd_b : GCCBuiltin<"__builtin_ia32_paddb">,
   1378               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1379                         [IntrNoMem]>;
   1380   def int_x86_mmx_padd_w : GCCBuiltin<"__builtin_ia32_paddw">,
   1381               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1382                         [IntrNoMem]>;
   1383   def int_x86_mmx_padd_d : GCCBuiltin<"__builtin_ia32_paddd">,
   1384               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1385                         [IntrNoMem]>;
   1386   def int_x86_mmx_padd_q : GCCBuiltin<"__builtin_ia32_paddq">,
   1387               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1388                         [IntrNoMem]>;
   1389 
   1390   def int_x86_mmx_padds_b : GCCBuiltin<"__builtin_ia32_paddsb">,
   1391               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1392                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   1393   def int_x86_mmx_padds_w : GCCBuiltin<"__builtin_ia32_paddsw">,
   1394               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1395                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   1396 
   1397   def int_x86_mmx_paddus_b : GCCBuiltin<"__builtin_ia32_paddusb">,
   1398               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1399                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   1400   def int_x86_mmx_paddus_w : GCCBuiltin<"__builtin_ia32_paddusw">,
   1401               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1402                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   1403 
   1404   // Subtraction
   1405   def int_x86_mmx_psub_b : GCCBuiltin<"__builtin_ia32_psubb">,
   1406               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1407                         [IntrNoMem]>;
   1408   def int_x86_mmx_psub_w : GCCBuiltin<"__builtin_ia32_psubw">,
   1409               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1410                         [IntrNoMem]>;
   1411   def int_x86_mmx_psub_d : GCCBuiltin<"__builtin_ia32_psubd">,
   1412               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1413                         [IntrNoMem]>;
   1414   def int_x86_mmx_psub_q : GCCBuiltin<"__builtin_ia32_psubq">,
   1415               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1416                         [IntrNoMem]>;
   1417 
   1418   def int_x86_mmx_psubs_b : GCCBuiltin<"__builtin_ia32_psubsb">,
   1419               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1420                          llvm_x86mmx_ty], [IntrNoMem]>;
   1421   def int_x86_mmx_psubs_w : GCCBuiltin<"__builtin_ia32_psubsw">,
   1422               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1423                          llvm_x86mmx_ty], [IntrNoMem]>;
   1424 
   1425   def int_x86_mmx_psubus_b : GCCBuiltin<"__builtin_ia32_psubusb">,
   1426               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1427                          llvm_x86mmx_ty], [IntrNoMem]>;
   1428   def int_x86_mmx_psubus_w : GCCBuiltin<"__builtin_ia32_psubusw">,
   1429               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1430                          llvm_x86mmx_ty], [IntrNoMem]>;
   1431 
   1432   // Multiplication
   1433   def int_x86_mmx_pmulh_w : GCCBuiltin<"__builtin_ia32_pmulhw">,
   1434               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1435                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   1436   def int_x86_mmx_pmull_w : GCCBuiltin<"__builtin_ia32_pmullw">,
   1437               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1438                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   1439   def int_x86_mmx_pmulhu_w : GCCBuiltin<"__builtin_ia32_pmulhuw">,
   1440               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1441                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   1442   def int_x86_mmx_pmulu_dq : GCCBuiltin<"__builtin_ia32_pmuludq">,
   1443               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1444                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   1445   def int_x86_mmx_pmadd_wd : GCCBuiltin<"__builtin_ia32_pmaddwd">,
   1446               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1447                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   1448 
   1449   // Bitwise operations
   1450   def int_x86_mmx_pand : GCCBuiltin<"__builtin_ia32_pand">,
   1451               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1452                         [IntrNoMem]>;
   1453   def int_x86_mmx_pandn : GCCBuiltin<"__builtin_ia32_pandn">,
   1454               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1455                         [IntrNoMem]>;
   1456   def int_x86_mmx_por : GCCBuiltin<"__builtin_ia32_por">,
   1457               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1458                         [IntrNoMem]>;
   1459   def int_x86_mmx_pxor : GCCBuiltin<"__builtin_ia32_pxor">,
   1460               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1461                         [IntrNoMem]>;
   1462 
   1463   // Averages
   1464   def int_x86_mmx_pavg_b : GCCBuiltin<"__builtin_ia32_pavgb">,
   1465               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1466                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   1467   def int_x86_mmx_pavg_w : GCCBuiltin<"__builtin_ia32_pavgw">,
   1468               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1469                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   1470 
   1471   // Maximum
   1472   def int_x86_mmx_pmaxu_b : GCCBuiltin<"__builtin_ia32_pmaxub">,
   1473               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1474                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   1475   def int_x86_mmx_pmaxs_w : GCCBuiltin<"__builtin_ia32_pmaxsw">,
   1476               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1477                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   1478 
   1479   // Minimum
   1480   def int_x86_mmx_pminu_b : GCCBuiltin<"__builtin_ia32_pminub">,
   1481               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1482                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   1483   def int_x86_mmx_pmins_w : GCCBuiltin<"__builtin_ia32_pminsw">,
   1484               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1485                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   1486 
   1487   // Packed sum of absolute differences
   1488   def int_x86_mmx_psad_bw : GCCBuiltin<"__builtin_ia32_psadbw">,
   1489               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1490                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   1491 }
   1492 
   1493 // Integer shift ops.
   1494 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1495   // Shift left logical
   1496   def int_x86_mmx_psll_w : GCCBuiltin<"__builtin_ia32_psllw">,
   1497               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1498                          llvm_x86mmx_ty], [IntrNoMem]>;
   1499   def int_x86_mmx_psll_d : GCCBuiltin<"__builtin_ia32_pslld">,
   1500               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1501                          llvm_x86mmx_ty], [IntrNoMem]>;
   1502   def int_x86_mmx_psll_q : GCCBuiltin<"__builtin_ia32_psllq">,
   1503               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1504                          llvm_x86mmx_ty], [IntrNoMem]>;
   1505 
   1506   def int_x86_mmx_psrl_w : GCCBuiltin<"__builtin_ia32_psrlw">,
   1507               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1508                          llvm_x86mmx_ty], [IntrNoMem]>;
   1509   def int_x86_mmx_psrl_d : GCCBuiltin<"__builtin_ia32_psrld">,
   1510               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1511                          llvm_x86mmx_ty], [IntrNoMem]>;
   1512   def int_x86_mmx_psrl_q : GCCBuiltin<"__builtin_ia32_psrlq">,
   1513               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1514                          llvm_x86mmx_ty], [IntrNoMem]>;
   1515 
   1516   def int_x86_mmx_psra_w : GCCBuiltin<"__builtin_ia32_psraw">,
   1517               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1518                          llvm_x86mmx_ty], [IntrNoMem]>;
   1519   def int_x86_mmx_psra_d : GCCBuiltin<"__builtin_ia32_psrad">,
   1520               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1521                          llvm_x86mmx_ty], [IntrNoMem]>;
   1522 
   1523   def int_x86_mmx_pslli_w : GCCBuiltin<"__builtin_ia32_psllwi">,
   1524               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1525                          llvm_i32_ty], [IntrNoMem]>;
   1526   def int_x86_mmx_pslli_d : GCCBuiltin<"__builtin_ia32_pslldi">,
   1527               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1528                          llvm_i32_ty], [IntrNoMem]>;
   1529   def int_x86_mmx_pslli_q : GCCBuiltin<"__builtin_ia32_psllqi">,
   1530               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1531                          llvm_i32_ty], [IntrNoMem]>;
   1532 
   1533   def int_x86_mmx_psrli_w : GCCBuiltin<"__builtin_ia32_psrlwi">,
   1534               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1535                          llvm_i32_ty], [IntrNoMem]>;
   1536   def int_x86_mmx_psrli_d : GCCBuiltin<"__builtin_ia32_psrldi">,
   1537               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1538                          llvm_i32_ty], [IntrNoMem]>;
   1539   def int_x86_mmx_psrli_q : GCCBuiltin<"__builtin_ia32_psrlqi">,
   1540               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1541                          llvm_i32_ty], [IntrNoMem]>;
   1542 
   1543   def int_x86_mmx_psrai_w : GCCBuiltin<"__builtin_ia32_psrawi">,
   1544               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1545                          llvm_i32_ty], [IntrNoMem]>;
   1546   def int_x86_mmx_psrai_d : GCCBuiltin<"__builtin_ia32_psradi">,
   1547               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1548                          llvm_i32_ty], [IntrNoMem]>;
   1549 }
   1550 
   1551 // Pack ops.
   1552 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1553   def int_x86_mmx_packsswb : GCCBuiltin<"__builtin_ia32_packsswb">,
   1554               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1555                          llvm_x86mmx_ty], [IntrNoMem]>;
   1556   def int_x86_mmx_packssdw : GCCBuiltin<"__builtin_ia32_packssdw">,
   1557               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1558                          llvm_x86mmx_ty], [IntrNoMem]>;
   1559   def int_x86_mmx_packuswb : GCCBuiltin<"__builtin_ia32_packuswb">,
   1560               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1561                          llvm_x86mmx_ty], [IntrNoMem]>;
   1562 }
   1563 
   1564 // Unpacking ops.
   1565 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1566   def int_x86_mmx_punpckhbw : GCCBuiltin<"__builtin_ia32_punpckhbw">,
   1567               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1568                         [IntrNoMem]>;
   1569   def int_x86_mmx_punpckhwd : GCCBuiltin<"__builtin_ia32_punpckhwd">,
   1570               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1571                         [IntrNoMem]>;
   1572   def int_x86_mmx_punpckhdq : GCCBuiltin<"__builtin_ia32_punpckhdq">,
   1573               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1574                         [IntrNoMem]>;
   1575   def int_x86_mmx_punpcklbw : GCCBuiltin<"__builtin_ia32_punpcklbw">,
   1576               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1577                         [IntrNoMem]>;
   1578   def int_x86_mmx_punpcklwd : GCCBuiltin<"__builtin_ia32_punpcklwd">,
   1579               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1580                         [IntrNoMem]>;
   1581   def int_x86_mmx_punpckldq : GCCBuiltin<"__builtin_ia32_punpckldq">,
   1582               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   1583                         [IntrNoMem]>;
   1584 }
   1585 
   1586 // Integer comparison ops
   1587 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1588   def int_x86_mmx_pcmpeq_b : GCCBuiltin<"__builtin_ia32_pcmpeqb">,
   1589               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1590                          llvm_x86mmx_ty], [IntrNoMem]>;
   1591   def int_x86_mmx_pcmpeq_w : GCCBuiltin<"__builtin_ia32_pcmpeqw">,
   1592               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1593                          llvm_x86mmx_ty], [IntrNoMem]>;
   1594   def int_x86_mmx_pcmpeq_d : GCCBuiltin<"__builtin_ia32_pcmpeqd">,
   1595               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1596                          llvm_x86mmx_ty], [IntrNoMem]>;
   1597 
   1598   def int_x86_mmx_pcmpgt_b : GCCBuiltin<"__builtin_ia32_pcmpgtb">,
   1599               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1600                          llvm_x86mmx_ty], [IntrNoMem]>;
   1601   def int_x86_mmx_pcmpgt_w : GCCBuiltin<"__builtin_ia32_pcmpgtw">,
   1602               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1603                          llvm_x86mmx_ty], [IntrNoMem]>;
   1604   def int_x86_mmx_pcmpgt_d : GCCBuiltin<"__builtin_ia32_pcmpgtd">,
   1605               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1606                          llvm_x86mmx_ty], [IntrNoMem]>;
   1607 }
   1608 
   1609 // Misc.
   1610 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1611   def int_x86_mmx_maskmovq : GCCBuiltin<"__builtin_ia32_maskmovq">,
   1612               Intrinsic<[], [llvm_x86mmx_ty, llvm_x86mmx_ty, llvm_ptr_ty], []>;
   1613 
   1614   def int_x86_mmx_pmovmskb : GCCBuiltin<"__builtin_ia32_pmovmskb">,
   1615               Intrinsic<[llvm_i32_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
   1616 
   1617   def int_x86_mmx_movnt_dq : GCCBuiltin<"__builtin_ia32_movntq">,
   1618               Intrinsic<[], [llvm_ptrx86mmx_ty, llvm_x86mmx_ty], []>;
   1619 
   1620   def int_x86_mmx_palignr_b : GCCBuiltin<"__builtin_ia32_palignr">,
   1621               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1622                         llvm_x86mmx_ty, llvm_i8_ty], [IntrNoMem]>;
   1623 
   1624   def int_x86_mmx_pextr_w : GCCBuiltin<"__builtin_ia32_vec_ext_v4hi">,
   1625               Intrinsic<[llvm_i32_ty], [llvm_x86mmx_ty, llvm_i32_ty],
   1626                         [IntrNoMem]>;
   1627 
   1628   def int_x86_mmx_pinsr_w : GCCBuiltin<"__builtin_ia32_vec_set_v4hi">,
   1629               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   1630                         llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1631 }
   1632