Home | History | Annotate | Download | only in IR
      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 // SEH intrinsics for Windows
     22 let TargetPrefix = "x86" in {
     23   def int_x86_seh_lsda : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], [IntrNoMem]>;
     24 
     25   // Marks the EH registration node created in LLVM IR prior to code generation.
     26   def int_x86_seh_ehregnode : Intrinsic<[], [llvm_ptr_ty], []>;
     27 
     28   // Marks the EH guard slot node created in LLVM IR prior to code generation.
     29   def int_x86_seh_ehguard : Intrinsic<[], [llvm_ptr_ty], []>;
     30 
     31   // Given a pointer to the end of an EH registration object, returns the true
     32   // parent frame address that can be used with llvm.localrecover.
     33   def int_x86_seh_recoverfp : Intrinsic<[llvm_ptr_ty],
     34                                         [llvm_ptr_ty, llvm_ptr_ty],
     35                                         [IntrNoMem]>;
     36 }
     37 
     38 //===----------------------------------------------------------------------===//
     39 // FLAGS.
     40 let TargetPrefix = "x86" in {
     41   def int_x86_flags_read_u32 : GCCBuiltin<"__builtin_ia32_readeflags_u32">,
     42         Intrinsic<[llvm_i32_ty], [], []>;
     43   def int_x86_flags_read_u64 : GCCBuiltin<"__builtin_ia32_readeflags_u64">,
     44         Intrinsic<[llvm_i64_ty], [], []>;
     45   def int_x86_flags_write_u32 : GCCBuiltin<"__builtin_ia32_writeeflags_u32">,
     46         Intrinsic<[], [llvm_i32_ty], []>;
     47   def int_x86_flags_write_u64 : GCCBuiltin<"__builtin_ia32_writeeflags_u64">,
     48         Intrinsic<[], [llvm_i64_ty], []>;
     49 }
     50 
     51 //===----------------------------------------------------------------------===//
     52 // Read Time Stamp Counter.
     53 let TargetPrefix = "x86" in {
     54   def int_x86_rdtsc : GCCBuiltin<"__builtin_ia32_rdtsc">,
     55               Intrinsic<[llvm_i64_ty], [], []>;
     56   def int_x86_rdtscp : GCCBuiltin<"__builtin_ia32_rdtscp">,
     57               Intrinsic<[llvm_i64_ty], [llvm_ptr_ty], [IntrArgMemOnly]>;
     58 }
     59 
     60 // Read Performance-Monitoring Counter.
     61 let TargetPrefix = "x86" in {
     62   def int_x86_rdpmc : GCCBuiltin<"__builtin_ia32_rdpmc">,
     63               Intrinsic<[llvm_i64_ty], [llvm_i32_ty], []>;
     64 }
     65 
     66 //===----------------------------------------------------------------------===//
     67 // 3DNow!
     68 
     69 let TargetPrefix = "x86" in {
     70   def int_x86_3dnow_pavgusb : GCCBuiltin<"__builtin_ia32_pavgusb">,
     71               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     72                         [IntrNoMem]>;
     73   def int_x86_3dnow_pf2id : GCCBuiltin<"__builtin_ia32_pf2id">,
     74               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
     75   def int_x86_3dnow_pfacc : GCCBuiltin<"__builtin_ia32_pfacc">,
     76               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     77                         [IntrNoMem]>;
     78   def int_x86_3dnow_pfadd : GCCBuiltin<"__builtin_ia32_pfadd">,
     79               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     80                         [IntrNoMem]>;
     81   def int_x86_3dnow_pfcmpeq : GCCBuiltin<"__builtin_ia32_pfcmpeq">,
     82               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     83                         [IntrNoMem]>;
     84   def int_x86_3dnow_pfcmpge : GCCBuiltin<"__builtin_ia32_pfcmpge">,
     85               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     86                         [IntrNoMem]>;
     87   def int_x86_3dnow_pfcmpgt : GCCBuiltin<"__builtin_ia32_pfcmpgt">,
     88               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     89                         [IntrNoMem]>;
     90   def int_x86_3dnow_pfmax : GCCBuiltin<"__builtin_ia32_pfmax">,
     91               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     92                         [IntrNoMem]>;
     93   def int_x86_3dnow_pfmin : GCCBuiltin<"__builtin_ia32_pfmin">,
     94               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     95                         [IntrNoMem]>;
     96   def int_x86_3dnow_pfmul : GCCBuiltin<"__builtin_ia32_pfmul">,
     97               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
     98                         [IntrNoMem]>;
     99   def int_x86_3dnow_pfrcp : GCCBuiltin<"__builtin_ia32_pfrcp">,
    100               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
    101   def int_x86_3dnow_pfrcpit1 : GCCBuiltin<"__builtin_ia32_pfrcpit1">,
    102               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
    103                         [IntrNoMem]>;
    104   def int_x86_3dnow_pfrcpit2 : GCCBuiltin<"__builtin_ia32_pfrcpit2">,
    105               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
    106                         [IntrNoMem]>;
    107   def int_x86_3dnow_pfrsqrt : GCCBuiltin<"__builtin_ia32_pfrsqrt">,
    108               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
    109   def int_x86_3dnow_pfrsqit1 : GCCBuiltin<"__builtin_ia32_pfrsqit1">,
    110               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
    111                         [IntrNoMem]>;
    112   def int_x86_3dnow_pfsub : GCCBuiltin<"__builtin_ia32_pfsub">,
    113               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
    114                         [IntrNoMem]>;
    115   def int_x86_3dnow_pfsubr : GCCBuiltin<"__builtin_ia32_pfsubr">,
    116               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
    117                         [IntrNoMem]>;
    118   def int_x86_3dnow_pi2fd : GCCBuiltin<"__builtin_ia32_pi2fd">,
    119               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
    120   def int_x86_3dnow_pmulhrw : GCCBuiltin<"__builtin_ia32_pmulhrw">,
    121               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
    122                         [IntrNoMem]>;
    123 }
    124 
    125 //===----------------------------------------------------------------------===//
    126 // 3DNow! extensions
    127 
    128 let TargetPrefix = "x86" in {
    129   def int_x86_3dnowa_pf2iw : GCCBuiltin<"__builtin_ia32_pf2iw">,
    130               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
    131   def int_x86_3dnowa_pfnacc : GCCBuiltin<"__builtin_ia32_pfnacc">,
    132               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
    133                         [IntrNoMem]>;
    134   def int_x86_3dnowa_pfpnacc : GCCBuiltin<"__builtin_ia32_pfpnacc">,
    135               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
    136                         [IntrNoMem]>;
    137   def int_x86_3dnowa_pi2fw : GCCBuiltin<"__builtin_ia32_pi2fw">,
    138               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
    139   def int_x86_3dnowa_pswapd :
    140               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
    141 }
    142 
    143 //===----------------------------------------------------------------------===//
    144 // SSE1
    145 
    146 // Arithmetic ops
    147 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    148   def int_x86_sse_sqrt_ss : GCCBuiltin<"__builtin_ia32_sqrtss">,
    149               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
    150                         [IntrNoMem]>;
    151   def int_x86_sse_sqrt_ps : GCCBuiltin<"__builtin_ia32_sqrtps">,
    152               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
    153                         [IntrNoMem]>;
    154   def int_x86_sse_rcp_ss : GCCBuiltin<"__builtin_ia32_rcpss">,
    155               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
    156                         [IntrNoMem]>;
    157   def int_x86_sse_rcp_ps : GCCBuiltin<"__builtin_ia32_rcpps">,
    158               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
    159                         [IntrNoMem]>;
    160   def int_x86_sse_rsqrt_ss : GCCBuiltin<"__builtin_ia32_rsqrtss">,
    161               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
    162                         [IntrNoMem]>;
    163   def int_x86_sse_rsqrt_ps : GCCBuiltin<"__builtin_ia32_rsqrtps">,
    164               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty],
    165                         [IntrNoMem]>;
    166   def int_x86_sse_min_ss : GCCBuiltin<"__builtin_ia32_minss">,
    167               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    168                          llvm_v4f32_ty], [IntrNoMem]>;
    169   def int_x86_sse_min_ps : GCCBuiltin<"__builtin_ia32_minps">,
    170               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    171                          llvm_v4f32_ty], [IntrNoMem]>;
    172   def int_x86_sse_max_ss : GCCBuiltin<"__builtin_ia32_maxss">,
    173               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    174                          llvm_v4f32_ty], [IntrNoMem]>;
    175   def int_x86_sse_max_ps : GCCBuiltin<"__builtin_ia32_maxps">,
    176               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    177                          llvm_v4f32_ty], [IntrNoMem]>;
    178 }
    179 
    180 // Comparison ops
    181 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    182   def int_x86_sse_cmp_ss : GCCBuiltin<"__builtin_ia32_cmpss">,
    183               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    184                          llvm_v4f32_ty, llvm_i8_ty], [IntrNoMem]>;
    185   def int_x86_sse_cmp_ps :
    186               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    187                          llvm_v4f32_ty, llvm_i8_ty], [IntrNoMem]>;
    188   def int_x86_sse_comieq_ss : GCCBuiltin<"__builtin_ia32_comieq">,
    189               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    190                          llvm_v4f32_ty], [IntrNoMem]>;
    191   def int_x86_sse_comilt_ss : GCCBuiltin<"__builtin_ia32_comilt">,
    192               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    193                          llvm_v4f32_ty], [IntrNoMem]>;
    194   def int_x86_sse_comile_ss : GCCBuiltin<"__builtin_ia32_comile">,
    195               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    196                          llvm_v4f32_ty], [IntrNoMem]>;
    197   def int_x86_sse_comigt_ss : GCCBuiltin<"__builtin_ia32_comigt">,
    198               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    199                          llvm_v4f32_ty], [IntrNoMem]>;
    200   def int_x86_sse_comige_ss : GCCBuiltin<"__builtin_ia32_comige">,
    201               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    202                          llvm_v4f32_ty], [IntrNoMem]>;
    203   def int_x86_sse_comineq_ss : GCCBuiltin<"__builtin_ia32_comineq">,
    204               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    205                          llvm_v4f32_ty], [IntrNoMem]>;
    206   def int_x86_sse_ucomieq_ss : GCCBuiltin<"__builtin_ia32_ucomieq">,
    207               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    208                          llvm_v4f32_ty], [IntrNoMem]>;
    209   def int_x86_sse_ucomilt_ss : GCCBuiltin<"__builtin_ia32_ucomilt">,
    210               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    211                          llvm_v4f32_ty], [IntrNoMem]>;
    212   def int_x86_sse_ucomile_ss : GCCBuiltin<"__builtin_ia32_ucomile">,
    213               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    214                          llvm_v4f32_ty], [IntrNoMem]>;
    215   def int_x86_sse_ucomigt_ss : GCCBuiltin<"__builtin_ia32_ucomigt">,
    216               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    217                          llvm_v4f32_ty], [IntrNoMem]>;
    218   def int_x86_sse_ucomige_ss : GCCBuiltin<"__builtin_ia32_ucomige">,
    219               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    220                          llvm_v4f32_ty], [IntrNoMem]>;
    221   def int_x86_sse_ucomineq_ss : GCCBuiltin<"__builtin_ia32_ucomineq">,
    222               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
    223                          llvm_v4f32_ty], [IntrNoMem]>;
    224 }
    225 
    226 
    227 // Conversion ops
    228 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    229   def int_x86_sse_cvtss2si : GCCBuiltin<"__builtin_ia32_cvtss2si">,
    230               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    231   def int_x86_sse_cvtss2si64 : GCCBuiltin<"__builtin_ia32_cvtss2si64">,
    232               Intrinsic<[llvm_i64_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    233   def int_x86_sse_cvttss2si : GCCBuiltin<"__builtin_ia32_cvttss2si">,
    234               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    235   def int_x86_sse_cvttss2si64 : GCCBuiltin<"__builtin_ia32_cvttss2si64">,
    236               Intrinsic<[llvm_i64_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    237   def int_x86_sse_cvtsi2ss : // TODO: Remove this intrinsic.
    238               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    239                          llvm_i32_ty], [IntrNoMem]>;
    240   def int_x86_sse_cvtsi642ss : // TODO: Remove this intrinsic.
    241               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    242                          llvm_i64_ty], [IntrNoMem]>;
    243 
    244   def int_x86_sse_cvtps2pi : GCCBuiltin<"__builtin_ia32_cvtps2pi">,
    245               Intrinsic<[llvm_x86mmx_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    246   def int_x86_sse_cvttps2pi: GCCBuiltin<"__builtin_ia32_cvttps2pi">,
    247               Intrinsic<[llvm_x86mmx_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    248   def int_x86_sse_cvtpi2ps : GCCBuiltin<"__builtin_ia32_cvtpi2ps">,
    249               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    250                          llvm_x86mmx_ty], [IntrNoMem]>;
    251 }
    252 
    253 // Cacheability support ops
    254 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    255   def int_x86_sse_sfence : GCCBuiltin<"__builtin_ia32_sfence">,
    256               Intrinsic<[], [], []>;
    257 }
    258 
    259 // Control register.
    260 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    261   def int_x86_sse_stmxcsr :
    262               Intrinsic<[], [llvm_ptr_ty], []>;
    263   def int_x86_sse_ldmxcsr :
    264               Intrinsic<[], [llvm_ptr_ty], []>;
    265 }
    266 
    267 // Misc.
    268 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    269   def int_x86_sse_movmsk_ps : GCCBuiltin<"__builtin_ia32_movmskps">,
    270               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    271 }
    272 
    273 //===----------------------------------------------------------------------===//
    274 // SSE2
    275 
    276 // FP arithmetic ops
    277 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    278   def int_x86_sse2_sqrt_sd : GCCBuiltin<"__builtin_ia32_sqrtsd">,
    279               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty],
    280                         [IntrNoMem]>;
    281   def int_x86_sse2_sqrt_pd : GCCBuiltin<"__builtin_ia32_sqrtpd">,
    282               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty],
    283                         [IntrNoMem]>;
    284   def int_x86_sse2_min_sd : GCCBuiltin<"__builtin_ia32_minsd">,
    285               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    286                          llvm_v2f64_ty], [IntrNoMem]>;
    287   def int_x86_sse2_min_pd : GCCBuiltin<"__builtin_ia32_minpd">,
    288               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    289                          llvm_v2f64_ty], [IntrNoMem]>;
    290   def int_x86_sse2_max_sd : GCCBuiltin<"__builtin_ia32_maxsd">,
    291               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    292                          llvm_v2f64_ty], [IntrNoMem]>;
    293   def int_x86_sse2_max_pd : GCCBuiltin<"__builtin_ia32_maxpd">,
    294               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    295                          llvm_v2f64_ty], [IntrNoMem]>;
    296 }
    297 
    298 // FP comparison ops
    299 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    300   def int_x86_sse2_cmp_sd : GCCBuiltin<"__builtin_ia32_cmpsd">,
    301               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    302                          llvm_v2f64_ty, llvm_i8_ty], [IntrNoMem]>;
    303   def int_x86_sse2_cmp_pd :
    304               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    305                          llvm_v2f64_ty, llvm_i8_ty], [IntrNoMem]>;
    306   def int_x86_sse2_comieq_sd : GCCBuiltin<"__builtin_ia32_comisdeq">,
    307               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    308                          llvm_v2f64_ty], [IntrNoMem]>;
    309   def int_x86_sse2_comilt_sd : GCCBuiltin<"__builtin_ia32_comisdlt">,
    310               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    311                          llvm_v2f64_ty], [IntrNoMem]>;
    312   def int_x86_sse2_comile_sd : GCCBuiltin<"__builtin_ia32_comisdle">,
    313               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    314                          llvm_v2f64_ty], [IntrNoMem]>;
    315   def int_x86_sse2_comigt_sd : GCCBuiltin<"__builtin_ia32_comisdgt">,
    316               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    317                          llvm_v2f64_ty], [IntrNoMem]>;
    318   def int_x86_sse2_comige_sd : GCCBuiltin<"__builtin_ia32_comisdge">,
    319               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    320                          llvm_v2f64_ty], [IntrNoMem]>;
    321   def int_x86_sse2_comineq_sd : GCCBuiltin<"__builtin_ia32_comisdneq">,
    322               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    323                          llvm_v2f64_ty], [IntrNoMem]>;
    324   def int_x86_sse2_ucomieq_sd : GCCBuiltin<"__builtin_ia32_ucomisdeq">,
    325               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    326                          llvm_v2f64_ty], [IntrNoMem]>;
    327   def int_x86_sse2_ucomilt_sd : GCCBuiltin<"__builtin_ia32_ucomisdlt">,
    328               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    329                          llvm_v2f64_ty], [IntrNoMem]>;
    330   def int_x86_sse2_ucomile_sd : GCCBuiltin<"__builtin_ia32_ucomisdle">,
    331               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    332                          llvm_v2f64_ty], [IntrNoMem]>;
    333   def int_x86_sse2_ucomigt_sd : GCCBuiltin<"__builtin_ia32_ucomisdgt">,
    334               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    335                          llvm_v2f64_ty], [IntrNoMem]>;
    336   def int_x86_sse2_ucomige_sd : GCCBuiltin<"__builtin_ia32_ucomisdge">,
    337               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    338                          llvm_v2f64_ty], [IntrNoMem]>;
    339   def int_x86_sse2_ucomineq_sd : GCCBuiltin<"__builtin_ia32_ucomisdneq">,
    340               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
    341                          llvm_v2f64_ty], [IntrNoMem]>;
    342 }
    343 
    344 // Integer arithmetic ops.
    345 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    346   def int_x86_sse2_padds_b : GCCBuiltin<"__builtin_ia32_paddsb128">,
    347               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    348                          llvm_v16i8_ty], [IntrNoMem, Commutative]>;
    349   def int_x86_sse2_padds_w : GCCBuiltin<"__builtin_ia32_paddsw128">,
    350               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    351                          llvm_v8i16_ty], [IntrNoMem, Commutative]>;
    352   def int_x86_sse2_paddus_b : GCCBuiltin<"__builtin_ia32_paddusb128">,
    353               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    354                          llvm_v16i8_ty], [IntrNoMem, Commutative]>;
    355   def int_x86_sse2_paddus_w : GCCBuiltin<"__builtin_ia32_paddusw128">,
    356               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    357                          llvm_v8i16_ty], [IntrNoMem, Commutative]>;
    358   def int_x86_sse2_psubs_b : GCCBuiltin<"__builtin_ia32_psubsb128">,
    359               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    360                          llvm_v16i8_ty], [IntrNoMem]>;
    361   def int_x86_sse2_psubs_w : GCCBuiltin<"__builtin_ia32_psubsw128">,
    362               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    363                          llvm_v8i16_ty], [IntrNoMem]>;
    364   def int_x86_sse2_psubus_b : GCCBuiltin<"__builtin_ia32_psubusb128">,
    365               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    366                          llvm_v16i8_ty], [IntrNoMem]>;
    367   def int_x86_sse2_psubus_w : GCCBuiltin<"__builtin_ia32_psubusw128">,
    368               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    369                          llvm_v8i16_ty], [IntrNoMem]>;
    370   def int_x86_sse2_pmulhu_w : GCCBuiltin<"__builtin_ia32_pmulhuw128">,
    371               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    372                          llvm_v8i16_ty], [IntrNoMem, Commutative]>;
    373   def int_x86_sse2_pmulh_w : GCCBuiltin<"__builtin_ia32_pmulhw128">,
    374               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    375                          llvm_v8i16_ty], [IntrNoMem, Commutative]>;
    376   def int_x86_sse2_pmulu_dq : GCCBuiltin<"__builtin_ia32_pmuludq128">,
    377               Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty,
    378                          llvm_v4i32_ty], [IntrNoMem, Commutative]>;
    379   def int_x86_sse2_pmadd_wd : GCCBuiltin<"__builtin_ia32_pmaddwd128">,
    380               Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty,
    381                          llvm_v8i16_ty], [IntrNoMem, Commutative]>;
    382   def int_x86_sse2_psad_bw : GCCBuiltin<"__builtin_ia32_psadbw128">,
    383               Intrinsic<[llvm_v2i64_ty], [llvm_v16i8_ty,
    384                          llvm_v16i8_ty], [IntrNoMem, Commutative]>;
    385 }
    386 
    387 // Integer shift ops.
    388 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    389   def int_x86_sse2_psll_w : GCCBuiltin<"__builtin_ia32_psllw128">,
    390               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    391                          llvm_v8i16_ty], [IntrNoMem]>;
    392   def int_x86_sse2_psll_d : GCCBuiltin<"__builtin_ia32_pslld128">,
    393               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    394                          llvm_v4i32_ty], [IntrNoMem]>;
    395   def int_x86_sse2_psll_q : GCCBuiltin<"__builtin_ia32_psllq128">,
    396               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
    397                          llvm_v2i64_ty], [IntrNoMem]>;
    398   def int_x86_sse2_psrl_w : GCCBuiltin<"__builtin_ia32_psrlw128">,
    399               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    400                          llvm_v8i16_ty], [IntrNoMem]>;
    401   def int_x86_sse2_psrl_d : GCCBuiltin<"__builtin_ia32_psrld128">,
    402               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    403                          llvm_v4i32_ty], [IntrNoMem]>;
    404   def int_x86_sse2_psrl_q : GCCBuiltin<"__builtin_ia32_psrlq128">,
    405               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
    406                          llvm_v2i64_ty], [IntrNoMem]>;
    407   def int_x86_sse2_psra_w : GCCBuiltin<"__builtin_ia32_psraw128">,
    408               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    409                          llvm_v8i16_ty], [IntrNoMem]>;
    410   def int_x86_sse2_psra_d : GCCBuiltin<"__builtin_ia32_psrad128">,
    411               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    412                          llvm_v4i32_ty], [IntrNoMem]>;
    413 
    414   def int_x86_sse2_pslli_w : GCCBuiltin<"__builtin_ia32_psllwi128">,
    415               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    416                          llvm_i32_ty], [IntrNoMem]>;
    417   def int_x86_sse2_pslli_d : GCCBuiltin<"__builtin_ia32_pslldi128">,
    418               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    419                          llvm_i32_ty], [IntrNoMem]>;
    420   def int_x86_sse2_pslli_q : GCCBuiltin<"__builtin_ia32_psllqi128">,
    421               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
    422                          llvm_i32_ty], [IntrNoMem]>;
    423   def int_x86_sse2_psrli_w : GCCBuiltin<"__builtin_ia32_psrlwi128">,
    424               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    425                          llvm_i32_ty], [IntrNoMem]>;
    426   def int_x86_sse2_psrli_d : GCCBuiltin<"__builtin_ia32_psrldi128">,
    427               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    428                          llvm_i32_ty], [IntrNoMem]>;
    429   def int_x86_sse2_psrli_q : GCCBuiltin<"__builtin_ia32_psrlqi128">,
    430               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
    431                          llvm_i32_ty], [IntrNoMem]>;
    432   def int_x86_sse2_psrai_w : GCCBuiltin<"__builtin_ia32_psrawi128">,
    433               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    434                          llvm_i32_ty], [IntrNoMem]>;
    435   def int_x86_sse2_psrai_d : GCCBuiltin<"__builtin_ia32_psradi128">,
    436               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    437                          llvm_i32_ty], [IntrNoMem]>;
    438 }
    439 
    440 // Conversion ops
    441 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    442   def int_x86_sse2_cvtdq2ps : GCCBuiltin<"__builtin_ia32_cvtdq2ps">,
    443               Intrinsic<[llvm_v4f32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
    444   def int_x86_sse2_cvtpd2dq : GCCBuiltin<"__builtin_ia32_cvtpd2dq">,
    445               Intrinsic<[llvm_v4i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    446   def int_x86_sse2_cvttpd2dq : GCCBuiltin<"__builtin_ia32_cvttpd2dq">,
    447               Intrinsic<[llvm_v4i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    448   def int_x86_sse2_cvtpd2ps : GCCBuiltin<"__builtin_ia32_cvtpd2ps">,
    449               Intrinsic<[llvm_v4f32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    450   def int_x86_sse2_cvtps2dq : GCCBuiltin<"__builtin_ia32_cvtps2dq">,
    451               Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    452   def int_x86_sse2_cvttps2dq : GCCBuiltin<"__builtin_ia32_cvttps2dq">,
    453               Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    454   def int_x86_sse2_cvtsd2si : GCCBuiltin<"__builtin_ia32_cvtsd2si">,
    455               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    456   def int_x86_sse2_cvtsd2si64 : GCCBuiltin<"__builtin_ia32_cvtsd2si64">,
    457               Intrinsic<[llvm_i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    458   def int_x86_sse2_cvttsd2si : GCCBuiltin<"__builtin_ia32_cvttsd2si">,
    459               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    460   def int_x86_sse2_cvttsd2si64 : GCCBuiltin<"__builtin_ia32_cvttsd2si64">,
    461               Intrinsic<[llvm_i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    462   def int_x86_sse2_cvtsi2sd : // TODO: Remove this intrinsic.
    463               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    464                          llvm_i32_ty], [IntrNoMem]>;
    465   def int_x86_sse2_cvtsi642sd : // TODO: Remove this intrinsic.
    466               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    467                          llvm_i64_ty], [IntrNoMem]>;
    468   def int_x86_sse2_cvtsd2ss : GCCBuiltin<"__builtin_ia32_cvtsd2ss">,
    469               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    470                          llvm_v2f64_ty], [IntrNoMem]>;
    471   def int_x86_sse2_cvtss2sd : // TODO: Remove this intrinsic.
    472               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    473                          llvm_v4f32_ty], [IntrNoMem]>;
    474   def int_x86_sse_cvtpd2pi : GCCBuiltin<"__builtin_ia32_cvtpd2pi">,
    475               Intrinsic<[llvm_x86mmx_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    476   def int_x86_sse_cvttpd2pi: GCCBuiltin<"__builtin_ia32_cvttpd2pi">,
    477               Intrinsic<[llvm_x86mmx_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    478   def int_x86_sse_cvtpi2pd : GCCBuiltin<"__builtin_ia32_cvtpi2pd">,
    479               Intrinsic<[llvm_v2f64_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
    480 }
    481 
    482 // Misc.
    483 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    484   def int_x86_sse2_packsswb_128 : GCCBuiltin<"__builtin_ia32_packsswb128">,
    485               Intrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty,
    486                          llvm_v8i16_ty], [IntrNoMem]>;
    487   def int_x86_sse2_packssdw_128 : GCCBuiltin<"__builtin_ia32_packssdw128">,
    488               Intrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty,
    489                          llvm_v4i32_ty], [IntrNoMem]>;
    490   def int_x86_sse2_packuswb_128 : GCCBuiltin<"__builtin_ia32_packuswb128">,
    491               Intrinsic<[llvm_v16i8_ty], [llvm_v8i16_ty,
    492                          llvm_v8i16_ty], [IntrNoMem]>;
    493   def int_x86_sse2_movmsk_pd : GCCBuiltin<"__builtin_ia32_movmskpd">,
    494               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    495   def int_x86_sse2_pmovmskb_128 : GCCBuiltin<"__builtin_ia32_pmovmskb128">,
    496               Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
    497   def int_x86_sse2_maskmov_dqu : GCCBuiltin<"__builtin_ia32_maskmovdqu">,
    498               Intrinsic<[], [llvm_v16i8_ty,
    499                          llvm_v16i8_ty, llvm_ptr_ty], []>;
    500   def int_x86_sse2_clflush : GCCBuiltin<"__builtin_ia32_clflush">,
    501               Intrinsic<[], [llvm_ptr_ty], []>;
    502   def int_x86_sse2_lfence : GCCBuiltin<"__builtin_ia32_lfence">,
    503               Intrinsic<[], [], []>;
    504   def int_x86_sse2_mfence : GCCBuiltin<"__builtin_ia32_mfence">,
    505               Intrinsic<[], [], []>;
    506   def int_x86_sse2_pause : GCCBuiltin<"__builtin_ia32_pause">,
    507               Intrinsic<[], [], []>;
    508 }
    509 
    510 //===----------------------------------------------------------------------===//
    511 // SSE3
    512 
    513 // Addition / subtraction ops.
    514 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    515   def int_x86_sse3_addsub_ps : GCCBuiltin<"__builtin_ia32_addsubps">,
    516               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    517                          llvm_v4f32_ty], [IntrNoMem]>;
    518   def int_x86_sse3_addsub_pd : GCCBuiltin<"__builtin_ia32_addsubpd">,
    519               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    520                          llvm_v2f64_ty], [IntrNoMem]>;
    521 }
    522 
    523 // Horizontal ops.
    524 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    525   def int_x86_sse3_hadd_ps : GCCBuiltin<"__builtin_ia32_haddps">,
    526               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    527                          llvm_v4f32_ty], [IntrNoMem]>;
    528   def int_x86_sse3_hadd_pd : GCCBuiltin<"__builtin_ia32_haddpd">,
    529               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    530                          llvm_v2f64_ty], [IntrNoMem]>;
    531   def int_x86_sse3_hsub_ps : GCCBuiltin<"__builtin_ia32_hsubps">,
    532               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    533                          llvm_v4f32_ty], [IntrNoMem]>;
    534   def int_x86_sse3_hsub_pd : GCCBuiltin<"__builtin_ia32_hsubpd">,
    535               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    536                          llvm_v2f64_ty], [IntrNoMem]>;
    537 }
    538 
    539 // Specialized unaligned load.
    540 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    541   def int_x86_sse3_ldu_dq : GCCBuiltin<"__builtin_ia32_lddqu">,
    542               Intrinsic<[llvm_v16i8_ty], [llvm_ptr_ty], [IntrReadMem]>;
    543 }
    544 
    545 // Thread synchronization ops.
    546 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    547   def int_x86_sse3_monitor : GCCBuiltin<"__builtin_ia32_monitor">,
    548               Intrinsic<[], [llvm_ptr_ty,
    549                          llvm_i32_ty, llvm_i32_ty], []>;
    550   def int_x86_sse3_mwait : GCCBuiltin<"__builtin_ia32_mwait">,
    551               Intrinsic<[], [llvm_i32_ty,
    552                          llvm_i32_ty], []>;
    553 }
    554 
    555 //===----------------------------------------------------------------------===//
    556 // SSSE3
    557 
    558 // Horizontal arithmetic ops
    559 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    560   def int_x86_ssse3_phadd_w         : GCCBuiltin<"__builtin_ia32_phaddw">,
    561               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    562                          llvm_x86mmx_ty], [IntrNoMem]>;
    563   def int_x86_ssse3_phadd_w_128     : GCCBuiltin<"__builtin_ia32_phaddw128">,
    564               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    565                          llvm_v8i16_ty], [IntrNoMem]>;
    566 
    567   def int_x86_ssse3_phadd_d         : GCCBuiltin<"__builtin_ia32_phaddd">,
    568               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    569                          llvm_x86mmx_ty], [IntrNoMem]>;
    570   def int_x86_ssse3_phadd_d_128     : GCCBuiltin<"__builtin_ia32_phaddd128">,
    571               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    572                          llvm_v4i32_ty], [IntrNoMem]>;
    573 
    574   def int_x86_ssse3_phadd_sw        : GCCBuiltin<"__builtin_ia32_phaddsw">,
    575               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    576                          llvm_x86mmx_ty], [IntrNoMem]>;
    577   def int_x86_ssse3_phadd_sw_128    : GCCBuiltin<"__builtin_ia32_phaddsw128">,
    578               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    579                          llvm_v8i16_ty], [IntrNoMem]>;
    580 
    581   def int_x86_ssse3_phsub_w         : GCCBuiltin<"__builtin_ia32_phsubw">,
    582               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    583                          llvm_x86mmx_ty], [IntrNoMem]>;
    584   def int_x86_ssse3_phsub_w_128     : GCCBuiltin<"__builtin_ia32_phsubw128">,
    585               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    586                          llvm_v8i16_ty], [IntrNoMem]>;
    587 
    588   def int_x86_ssse3_phsub_d         : GCCBuiltin<"__builtin_ia32_phsubd">,
    589               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    590                          llvm_x86mmx_ty], [IntrNoMem]>;
    591   def int_x86_ssse3_phsub_d_128     : GCCBuiltin<"__builtin_ia32_phsubd128">,
    592               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    593                          llvm_v4i32_ty], [IntrNoMem]>;
    594 
    595   def int_x86_ssse3_phsub_sw        : GCCBuiltin<"__builtin_ia32_phsubsw">,
    596               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    597                          llvm_x86mmx_ty], [IntrNoMem]>;
    598   def int_x86_ssse3_phsub_sw_128    : GCCBuiltin<"__builtin_ia32_phsubsw128">,
    599               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    600                          llvm_v8i16_ty], [IntrNoMem]>;
    601 
    602   def int_x86_ssse3_pmadd_ub_sw     : GCCBuiltin<"__builtin_ia32_pmaddubsw">,
    603               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    604                          llvm_x86mmx_ty], [IntrNoMem]>;
    605   def int_x86_ssse3_pmadd_ub_sw_128 : GCCBuiltin<"__builtin_ia32_pmaddubsw128">,
    606               Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty,
    607                          llvm_v16i8_ty], [IntrNoMem]>;
    608 }
    609 
    610 // Packed multiply high with round and scale
    611 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    612   def int_x86_ssse3_pmul_hr_sw      : GCCBuiltin<"__builtin_ia32_pmulhrsw">,
    613               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    614                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
    615   def int_x86_ssse3_pmul_hr_sw_128  : GCCBuiltin<"__builtin_ia32_pmulhrsw128">,
    616               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    617                          llvm_v8i16_ty], [IntrNoMem, Commutative]>;
    618 }
    619 
    620 // Shuffle ops
    621 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    622   def int_x86_ssse3_pshuf_b         : GCCBuiltin<"__builtin_ia32_pshufb">,
    623               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    624                          llvm_x86mmx_ty], [IntrNoMem]>;
    625   def int_x86_ssse3_pshuf_b_128     : GCCBuiltin<"__builtin_ia32_pshufb128">,
    626               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    627                          llvm_v16i8_ty], [IntrNoMem]>;
    628   def int_x86_sse_pshuf_w           : GCCBuiltin<"__builtin_ia32_pshufw">,
    629               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_i8_ty],
    630                          [IntrNoMem]>;
    631 }
    632 
    633 // Sign ops
    634 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    635   def int_x86_ssse3_psign_b         : GCCBuiltin<"__builtin_ia32_psignb">,
    636               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    637                          llvm_x86mmx_ty], [IntrNoMem]>;
    638   def int_x86_ssse3_psign_b_128     : GCCBuiltin<"__builtin_ia32_psignb128">,
    639               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
    640                          llvm_v16i8_ty], [IntrNoMem]>;
    641 
    642   def int_x86_ssse3_psign_w         : GCCBuiltin<"__builtin_ia32_psignw">,
    643               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    644                          llvm_x86mmx_ty], [IntrNoMem]>;
    645   def int_x86_ssse3_psign_w_128     : GCCBuiltin<"__builtin_ia32_psignw128">,
    646               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
    647                          llvm_v8i16_ty], [IntrNoMem]>;
    648 
    649   def int_x86_ssse3_psign_d         : GCCBuiltin<"__builtin_ia32_psignd">,
    650               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
    651                          llvm_x86mmx_ty], [IntrNoMem]>;
    652   def int_x86_ssse3_psign_d_128     : GCCBuiltin<"__builtin_ia32_psignd128">,
    653               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
    654                          llvm_v4i32_ty], [IntrNoMem]>;
    655 }
    656 
    657 // Absolute value ops
    658 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    659   def int_x86_ssse3_pabs_b     : GCCBuiltin<"__builtin_ia32_pabsb">,
    660               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
    661 
    662   def int_x86_ssse3_pabs_w     : GCCBuiltin<"__builtin_ia32_pabsw">,
    663               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
    664 
    665   def int_x86_ssse3_pabs_d     : GCCBuiltin<"__builtin_ia32_pabsd">,
    666               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
    667 }
    668 
    669 //===----------------------------------------------------------------------===//
    670 // SSE4.1
    671 
    672 // FP rounding ops
    673 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    674   def int_x86_sse41_round_ss        : GCCBuiltin<"__builtin_ia32_roundss">,
    675               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
    676                          llvm_i32_ty], [IntrNoMem]>;
    677   def int_x86_sse41_round_ps        : GCCBuiltin<"__builtin_ia32_roundps">,
    678               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    679                          llvm_i32_ty], [IntrNoMem]>;
    680   def int_x86_sse41_round_sd        : GCCBuiltin<"__builtin_ia32_roundsd">,
    681               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
    682                          llvm_i32_ty], [IntrNoMem]>;
    683   def int_x86_sse41_round_pd        : GCCBuiltin<"__builtin_ia32_roundpd">,
    684               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    685                          llvm_i32_ty], [IntrNoMem]>;
    686 }
    687 
    688 // Vector min element
    689 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    690   def int_x86_sse41_phminposuw     : GCCBuiltin<"__builtin_ia32_phminposuw128">,
    691               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty],
    692                         [IntrNoMem]>;
    693 }
    694 
    695 // Advanced Encryption Standard (AES) Instructions
    696 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    697   def int_x86_aesni_aesimc          : GCCBuiltin<"__builtin_ia32_aesimc128">,
    698               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty],
    699                         [IntrNoMem]>;
    700   def int_x86_aesni_aesenc          : GCCBuiltin<"__builtin_ia32_aesenc128">,
    701               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    702                         [IntrNoMem]>;
    703   def int_x86_aesni_aesenclast : GCCBuiltin<"__builtin_ia32_aesenclast128">,
    704               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    705                         [IntrNoMem]>;
    706   def int_x86_aesni_aesdec          : GCCBuiltin<"__builtin_ia32_aesdec128">,
    707               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    708                         [IntrNoMem]>;
    709   def int_x86_aesni_aesdeclast : GCCBuiltin<"__builtin_ia32_aesdeclast128">,
    710               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    711                         [IntrNoMem]>;
    712   def int_x86_aesni_aeskeygenassist :
    713               GCCBuiltin<"__builtin_ia32_aeskeygenassist128">,
    714               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i8_ty],
    715                         [IntrNoMem]>;
    716 }
    717 
    718 // PCLMUL instruction
    719 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
    720   def int_x86_pclmulqdq : GCCBuiltin<"__builtin_ia32_pclmulqdq128">,
    721           Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty],
    722                     [IntrNoMem]>;
    723 }
    724 
    725 // Vector pack
    726 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    727   def int_x86_sse41_packusdw        : GCCBuiltin<"__builtin_ia32_packusdw128">,
    728               Intrinsic<[llvm_v8i16_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    729                         [IntrNoMem]>;
    730 }
    731 
    732 // Vector multiply
    733 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    734   def int_x86_sse41_pmuldq          : GCCBuiltin<"__builtin_ia32_pmuldq128">,
    735               Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    736                         [IntrNoMem, Commutative]>;
    737 }
    738 
    739 // Vector insert
    740 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    741   def int_x86_sse41_insertps       : GCCBuiltin<"__builtin_ia32_insertps128">,
    742           Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i8_ty],
    743                     [IntrNoMem]>;
    744 }
    745 
    746 // Vector blend
    747 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    748   def int_x86_sse41_pblendvb         : GCCBuiltin<"__builtin_ia32_pblendvb128">,
    749         Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty,llvm_v16i8_ty],
    750                   [IntrNoMem]>;
    751   def int_x86_sse41_blendvpd         : GCCBuiltin<"__builtin_ia32_blendvpd">,
    752         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,llvm_v2f64_ty],
    753                   [IntrNoMem]>;
    754   def int_x86_sse41_blendvps         : GCCBuiltin<"__builtin_ia32_blendvps">,
    755         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,llvm_v4f32_ty],
    756                   [IntrNoMem]>;
    757 }
    758 
    759 // Vector dot product
    760 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    761   def int_x86_sse41_dppd            : GCCBuiltin<"__builtin_ia32_dppd">,
    762           Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i8_ty],
    763                     [IntrNoMem, Commutative]>;
    764   def int_x86_sse41_dpps            : GCCBuiltin<"__builtin_ia32_dpps">,
    765           Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i8_ty],
    766                     [IntrNoMem, Commutative]>;
    767 }
    768 
    769 // Vector sum of absolute differences
    770 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    771   def int_x86_sse41_mpsadbw         : GCCBuiltin<"__builtin_ia32_mpsadbw128">,
    772           Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty,llvm_i8_ty],
    773                     [IntrNoMem, Commutative]>;
    774 }
    775 
    776 // Test instruction with bitwise comparison.
    777 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
    778   def int_x86_sse41_ptestz          : GCCBuiltin<"__builtin_ia32_ptestz128">,
    779           Intrinsic<[llvm_i32_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    780                     [IntrNoMem]>;
    781   def int_x86_sse41_ptestc          : GCCBuiltin<"__builtin_ia32_ptestc128">,
    782           Intrinsic<[llvm_i32_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    783                     [IntrNoMem]>;
    784   def int_x86_sse41_ptestnzc        : GCCBuiltin<"__builtin_ia32_ptestnzc128">,
    785           Intrinsic<[llvm_i32_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    786                     [IntrNoMem]>;
    787 }
    788 
    789 //===----------------------------------------------------------------------===//
    790 // SSE4.2
    791 
    792 // Miscellaneous
    793 // CRC Instruction
    794 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
    795   def int_x86_sse42_crc32_32_8       : GCCBuiltin<"__builtin_ia32_crc32qi">,
    796           Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i8_ty],
    797                     [IntrNoMem]>;
    798   def int_x86_sse42_crc32_32_16      : GCCBuiltin<"__builtin_ia32_crc32hi">,
    799           Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i16_ty],
    800                     [IntrNoMem]>;
    801   def int_x86_sse42_crc32_32_32      : GCCBuiltin<"__builtin_ia32_crc32si">,
    802           Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
    803                     [IntrNoMem]>;
    804   def int_x86_sse42_crc32_64_64      : GCCBuiltin<"__builtin_ia32_crc32di">,
    805           Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
    806                     [IntrNoMem]>;
    807 }
    808 
    809 // String/text processing ops.
    810 let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
    811   def int_x86_sse42_pcmpistrm128  : GCCBuiltin<"__builtin_ia32_pcmpistrm128">,
    812     Intrinsic<[llvm_v16i8_ty],
    813         [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
    814         [IntrNoMem]>;
    815   def int_x86_sse42_pcmpistri128  : GCCBuiltin<"__builtin_ia32_pcmpistri128">,
    816     Intrinsic<[llvm_i32_ty],
    817         [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
    818         [IntrNoMem]>;
    819   def int_x86_sse42_pcmpistria128 : GCCBuiltin<"__builtin_ia32_pcmpistria128">,
    820     Intrinsic<[llvm_i32_ty],
    821         [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
    822         [IntrNoMem]>;
    823   def int_x86_sse42_pcmpistric128 : GCCBuiltin<"__builtin_ia32_pcmpistric128">,
    824     Intrinsic<[llvm_i32_ty],
    825         [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
    826         [IntrNoMem]>;
    827   def int_x86_sse42_pcmpistrio128 : GCCBuiltin<"__builtin_ia32_pcmpistrio128">,
    828     Intrinsic<[llvm_i32_ty],
    829         [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
    830         [IntrNoMem]>;
    831   def int_x86_sse42_pcmpistris128 : GCCBuiltin<"__builtin_ia32_pcmpistris128">,
    832     Intrinsic<[llvm_i32_ty],
    833         [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
    834         [IntrNoMem]>;
    835   def int_x86_sse42_pcmpistriz128 : GCCBuiltin<"__builtin_ia32_pcmpistriz128">,
    836     Intrinsic<[llvm_i32_ty],
    837         [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i8_ty],
    838         [IntrNoMem]>;
    839   def int_x86_sse42_pcmpestrm128  : GCCBuiltin<"__builtin_ia32_pcmpestrm128">,
    840     Intrinsic<[llvm_v16i8_ty],
    841         [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
    842          llvm_i8_ty],
    843         [IntrNoMem]>;
    844   def int_x86_sse42_pcmpestri128  : GCCBuiltin<"__builtin_ia32_pcmpestri128">,
    845     Intrinsic<[llvm_i32_ty],
    846         [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
    847          llvm_i8_ty],
    848         [IntrNoMem]>;
    849   def int_x86_sse42_pcmpestria128 : GCCBuiltin<"__builtin_ia32_pcmpestria128">,
    850     Intrinsic<[llvm_i32_ty],
    851         [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
    852          llvm_i8_ty],
    853         [IntrNoMem]>;
    854   def int_x86_sse42_pcmpestric128 : GCCBuiltin<"__builtin_ia32_pcmpestric128">,
    855     Intrinsic<[llvm_i32_ty],
    856         [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
    857          llvm_i8_ty],
    858         [IntrNoMem]>;
    859   def int_x86_sse42_pcmpestrio128 : GCCBuiltin<"__builtin_ia32_pcmpestrio128">,
    860     Intrinsic<[llvm_i32_ty],
    861         [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
    862          llvm_i8_ty],
    863         [IntrNoMem]>;
    864   def int_x86_sse42_pcmpestris128 : GCCBuiltin<"__builtin_ia32_pcmpestris128">,
    865     Intrinsic<[llvm_i32_ty],
    866         [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
    867          llvm_i8_ty],
    868         [IntrNoMem]>;
    869   def int_x86_sse42_pcmpestriz128 : GCCBuiltin<"__builtin_ia32_pcmpestriz128">,
    870     Intrinsic<[llvm_i32_ty],
    871         [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty,
    872          llvm_i8_ty],
    873         [IntrNoMem]>;
    874 }
    875 
    876 //===----------------------------------------------------------------------===//
    877 // SSE4A
    878 
    879 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    880   def int_x86_sse4a_extrqi : GCCBuiltin<"__builtin_ia32_extrqi">,
    881     Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i8_ty, llvm_i8_ty],
    882               [IntrNoMem]>;
    883   def int_x86_sse4a_extrq  : GCCBuiltin<"__builtin_ia32_extrq">,
    884     Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v16i8_ty], [IntrNoMem]>;
    885 
    886   def int_x86_sse4a_insertqi : GCCBuiltin<"__builtin_ia32_insertqi">,
    887     Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
    888                                 llvm_i8_ty, llvm_i8_ty], [IntrNoMem]>;
    889   def int_x86_sse4a_insertq  : GCCBuiltin<"__builtin_ia32_insertq">,
    890     Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
    891 }
    892 
    893 //===----------------------------------------------------------------------===//
    894 // AVX
    895 
    896 // Arithmetic ops
    897 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    898   def int_x86_avx_addsub_pd_256 : GCCBuiltin<"__builtin_ia32_addsubpd256">,
    899         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
    900                   llvm_v4f64_ty], [IntrNoMem]>;
    901   def int_x86_avx_addsub_ps_256 : GCCBuiltin<"__builtin_ia32_addsubps256">,
    902         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
    903                   llvm_v8f32_ty], [IntrNoMem]>;
    904   def int_x86_avx_max_pd_256 : GCCBuiltin<"__builtin_ia32_maxpd256">,
    905         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
    906                   llvm_v4f64_ty], [IntrNoMem]>;
    907   def int_x86_avx_max_ps_256 : GCCBuiltin<"__builtin_ia32_maxps256">,
    908         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
    909                   llvm_v8f32_ty], [IntrNoMem]>;
    910   def int_x86_avx_min_pd_256 : GCCBuiltin<"__builtin_ia32_minpd256">,
    911         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
    912                   llvm_v4f64_ty], [IntrNoMem]>;
    913   def int_x86_avx_min_ps_256 : GCCBuiltin<"__builtin_ia32_minps256">,
    914         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
    915                   llvm_v8f32_ty], [IntrNoMem]>;
    916 
    917   def int_x86_avx_sqrt_pd_256 : GCCBuiltin<"__builtin_ia32_sqrtpd256">,
    918         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty], [IntrNoMem]>;
    919   def int_x86_avx_sqrt_ps_256 : GCCBuiltin<"__builtin_ia32_sqrtps256">,
    920         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
    921 
    922   def int_x86_avx_rsqrt_ps_256 : GCCBuiltin<"__builtin_ia32_rsqrtps256">,
    923         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
    924 
    925   def int_x86_avx_rcp_ps_256 : GCCBuiltin<"__builtin_ia32_rcpps256">,
    926         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
    927 
    928   def int_x86_avx_round_pd_256 : GCCBuiltin<"__builtin_ia32_roundpd256">,
    929         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
    930                   llvm_i32_ty], [IntrNoMem]>;
    931   def int_x86_avx_round_ps_256 : GCCBuiltin<"__builtin_ia32_roundps256">,
    932         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
    933                   llvm_i32_ty], [IntrNoMem]>;
    934 }
    935 
    936 // Horizontal ops
    937 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    938   def int_x86_avx_hadd_pd_256 : GCCBuiltin<"__builtin_ia32_haddpd256">,
    939         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
    940                   llvm_v4f64_ty], [IntrNoMem]>;
    941   def int_x86_avx_hsub_ps_256 : GCCBuiltin<"__builtin_ia32_hsubps256">,
    942         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
    943                   llvm_v8f32_ty], [IntrNoMem]>;
    944   def int_x86_avx_hsub_pd_256 : GCCBuiltin<"__builtin_ia32_hsubpd256">,
    945         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
    946                   llvm_v4f64_ty], [IntrNoMem]>;
    947   def int_x86_avx_hadd_ps_256 : GCCBuiltin<"__builtin_ia32_haddps256">,
    948         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
    949                   llvm_v8f32_ty], [IntrNoMem]>;
    950 }
    951 
    952 // Vector permutation
    953 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
    954   def int_x86_avx_vpermilvar_pd : GCCBuiltin<"__builtin_ia32_vpermilvarpd">,
    955         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
    956                   llvm_v2i64_ty], [IntrNoMem]>;
    957   def int_x86_avx_vpermilvar_ps : GCCBuiltin<"__builtin_ia32_vpermilvarps">,
    958         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
    959                   llvm_v4i32_ty], [IntrNoMem]>;
    960 
    961   def int_x86_avx_vpermilvar_pd_256 :
    962         GCCBuiltin<"__builtin_ia32_vpermilvarpd256">,
    963         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4i64_ty], [IntrNoMem]>;
    964   def int_x86_avx_vpermilvar_ps_256 :
    965         GCCBuiltin<"__builtin_ia32_vpermilvarps256">,
    966         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8i32_ty], [IntrNoMem]>;
    967 
    968   def int_x86_avx512_mask_vpermi2var_d_128 :
    969        GCCBuiltin<"__builtin_ia32_vpermi2vard128_mask">,
    970         Intrinsic<[llvm_v4i32_ty],
    971         [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty],
    972         [IntrNoMem]>;
    973 
    974   def int_x86_avx512_mask_vpermi2var_d_256 :
    975         GCCBuiltin<"__builtin_ia32_vpermi2vard256_mask">,
    976           Intrinsic<[llvm_v8i32_ty],
    977           [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i8_ty],
    978           [IntrNoMem]>;
    979 
    980   def int_x86_avx512_mask_vpermi2var_d_512 :
    981         GCCBuiltin<"__builtin_ia32_vpermi2vard512_mask">,
    982           Intrinsic<[llvm_v16i32_ty],
    983           [llvm_v16i32_ty, llvm_v16i32_ty, llvm_v16i32_ty, llvm_i16_ty],
    984           [IntrNoMem]>;
    985 
    986   def int_x86_avx512_mask_vpermi2var_hi_128 :
    987         GCCBuiltin<"__builtin_ia32_vpermi2varhi128_mask">,
    988           Intrinsic<[llvm_v8i16_ty],
    989           [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty, llvm_i8_ty],
    990           [IntrNoMem]>;
    991 
    992   def int_x86_avx512_mask_vpermi2var_hi_256 :
    993         GCCBuiltin<"__builtin_ia32_vpermi2varhi256_mask">,
    994           Intrinsic<[llvm_v16i16_ty],
    995           [llvm_v16i16_ty, llvm_v16i16_ty, llvm_v16i16_ty, llvm_i16_ty],
    996           [IntrNoMem]>;
    997 
    998   def int_x86_avx512_mask_vpermi2var_hi_512 :
    999         GCCBuiltin<"__builtin_ia32_vpermi2varhi512_mask">,
   1000           Intrinsic<[llvm_v32i16_ty],
   1001           [llvm_v32i16_ty, llvm_v32i16_ty, llvm_v32i16_ty, llvm_i32_ty],
   1002           [IntrNoMem]>;
   1003 
   1004   def int_x86_avx512_mask_vpermi2var_pd_128 :
   1005         GCCBuiltin<"__builtin_ia32_vpermi2varpd128_mask">,
   1006           Intrinsic<[llvm_v2f64_ty],
   1007           [llvm_v2f64_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i8_ty],
   1008           [IntrNoMem]>;
   1009 
   1010   def int_x86_avx512_mask_vpermi2var_pd_256 :
   1011         GCCBuiltin<"__builtin_ia32_vpermi2varpd256_mask">,
   1012           Intrinsic<[llvm_v4f64_ty],
   1013           [llvm_v4f64_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i8_ty],
   1014           [IntrNoMem]>;
   1015 
   1016   def int_x86_avx512_mask_vpermi2var_pd_512 :
   1017         GCCBuiltin<"__builtin_ia32_vpermi2varpd512_mask">,
   1018           Intrinsic<[llvm_v8f64_ty],
   1019           [llvm_v8f64_ty, llvm_v8i64_ty, llvm_v8f64_ty, llvm_i8_ty],
   1020           [IntrNoMem]>;
   1021 
   1022   def int_x86_avx512_mask_vpermi2var_ps_128 :
   1023         GCCBuiltin<"__builtin_ia32_vpermi2varps128_mask">,
   1024           Intrinsic<[llvm_v4f32_ty],
   1025           [llvm_v4f32_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i8_ty],
   1026           [IntrNoMem]>;
   1027 
   1028   def int_x86_avx512_mask_vpermi2var_ps_256 :
   1029         GCCBuiltin<"__builtin_ia32_vpermi2varps256_mask">,
   1030           Intrinsic<[llvm_v8f32_ty],
   1031           [llvm_v8f32_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i8_ty],
   1032           [IntrNoMem]>;
   1033 
   1034   def int_x86_avx512_mask_vpermi2var_ps_512 :
   1035         GCCBuiltin<"__builtin_ia32_vpermi2varps512_mask">,
   1036           Intrinsic<[llvm_v16f32_ty],
   1037           [llvm_v16f32_ty, llvm_v16i32_ty, llvm_v16f32_ty, llvm_i16_ty],
   1038           [IntrNoMem]>;
   1039 
   1040   def int_x86_avx512_mask_vpermi2var_q_128 :
   1041         GCCBuiltin<"__builtin_ia32_vpermi2varq128_mask">,
   1042           Intrinsic<[llvm_v2i64_ty],
   1043           [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty],
   1044           [IntrNoMem]>;
   1045 
   1046   def int_x86_avx512_mask_vpermi2var_q_256 :
   1047         GCCBuiltin<"__builtin_ia32_vpermi2varq256_mask">,
   1048           Intrinsic<[llvm_v4i64_ty],
   1049           [llvm_v4i64_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty],
   1050           [IntrNoMem]>;
   1051 
   1052   def int_x86_avx512_mask_vpermi2var_q_512 :
   1053         GCCBuiltin<"__builtin_ia32_vpermi2varq512_mask">,
   1054           Intrinsic<[llvm_v8i64_ty],
   1055           [llvm_v8i64_ty, llvm_v8i64_ty, llvm_v8i64_ty, llvm_i8_ty],
   1056           [IntrNoMem]>;
   1057 
   1058   def int_x86_avx512_mask_vpermt2var_d_512:
   1059         GCCBuiltin<"__builtin_ia32_vpermt2vard512_mask">,
   1060         Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
   1061                   llvm_v16i32_ty, llvm_v16i32_ty, llvm_i16_ty], [IntrNoMem]>;
   1062 
   1063   def int_x86_avx512_mask_vpermt2var_q_512:
   1064         GCCBuiltin<"__builtin_ia32_vpermt2varq512_mask">,
   1065         Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
   1066                   llvm_v8i64_ty, llvm_v8i64_ty, llvm_i8_ty], [IntrNoMem]>;
   1067 
   1068   def int_x86_avx512_mask_vpermt2var_ps_512:
   1069         GCCBuiltin<"__builtin_ia32_vpermt2varps512_mask">,
   1070         Intrinsic<[llvm_v16f32_ty], [llvm_v16i32_ty,
   1071                   llvm_v16f32_ty, llvm_v16f32_ty, llvm_i16_ty], [IntrNoMem]>;
   1072 
   1073   def int_x86_avx512_mask_vpermt2var_pd_512:
   1074         GCCBuiltin<"__builtin_ia32_vpermt2varpd512_mask">,
   1075         Intrinsic<[llvm_v8f64_ty], [llvm_v8i64_ty,
   1076                   llvm_v8f64_ty, llvm_v8f64_ty, llvm_i8_ty], [IntrNoMem]>;
   1077 
   1078   def int_x86_avx512_mask_vpermt2var_d_128 :
   1079         GCCBuiltin<"__builtin_ia32_vpermt2vard128_mask">,
   1080           Intrinsic<[llvm_v4i32_ty],
   1081           [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty],
   1082           [IntrNoMem]>;
   1083 
   1084   def int_x86_avx512_maskz_vpermt2var_d_128 :
   1085         GCCBuiltin<"__builtin_ia32_vpermt2vard128_maskz">,
   1086           Intrinsic<[llvm_v4i32_ty],
   1087           [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty],
   1088           [IntrNoMem]>;
   1089 
   1090   def int_x86_avx512_mask_vpermt2var_d_256 :
   1091         GCCBuiltin<"__builtin_ia32_vpermt2vard256_mask">,
   1092           Intrinsic<[llvm_v8i32_ty],
   1093           [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i8_ty],
   1094           [IntrNoMem]>;
   1095 
   1096   def int_x86_avx512_maskz_vpermt2var_d_256 :
   1097         GCCBuiltin<"__builtin_ia32_vpermt2vard256_maskz">,
   1098           Intrinsic<[llvm_v8i32_ty],
   1099           [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i8_ty],
   1100           [IntrNoMem]>;
   1101 
   1102   def int_x86_avx512_maskz_vpermt2var_d_512 :
   1103         GCCBuiltin<"__builtin_ia32_vpermt2vard512_maskz">,
   1104           Intrinsic<[llvm_v16i32_ty],
   1105           [llvm_v16i32_ty, llvm_v16i32_ty, llvm_v16i32_ty, llvm_i16_ty],
   1106           [IntrNoMem]>;
   1107 
   1108   def int_x86_avx512_mask_vpermt2var_hi_128 :
   1109         GCCBuiltin<"__builtin_ia32_vpermt2varhi128_mask">,
   1110           Intrinsic<[llvm_v8i16_ty],
   1111           [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty, llvm_i8_ty],
   1112           [IntrNoMem]>;
   1113 
   1114   def int_x86_avx512_maskz_vpermt2var_hi_128 :
   1115         GCCBuiltin<"__builtin_ia32_vpermt2varhi128_maskz">,
   1116           Intrinsic<[llvm_v8i16_ty],
   1117           [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty, llvm_i8_ty],
   1118           [IntrNoMem]>;
   1119 
   1120   def int_x86_avx512_mask_vpermt2var_hi_256 :
   1121         GCCBuiltin<"__builtin_ia32_vpermt2varhi256_mask">,
   1122           Intrinsic<[llvm_v16i16_ty],
   1123           [llvm_v16i16_ty, llvm_v16i16_ty, llvm_v16i16_ty, llvm_i16_ty],
   1124           [IntrNoMem]>;
   1125 
   1126   def int_x86_avx512_maskz_vpermt2var_hi_256 :
   1127         GCCBuiltin<"__builtin_ia32_vpermt2varhi256_maskz">,
   1128           Intrinsic<[llvm_v16i16_ty],
   1129           [llvm_v16i16_ty, llvm_v16i16_ty, llvm_v16i16_ty, llvm_i16_ty],
   1130           [IntrNoMem]>;
   1131 
   1132   def int_x86_avx512_mask_vpermt2var_hi_512 :
   1133         GCCBuiltin<"__builtin_ia32_vpermt2varhi512_mask">,
   1134           Intrinsic<[llvm_v32i16_ty],
   1135           [llvm_v32i16_ty, llvm_v32i16_ty, llvm_v32i16_ty, llvm_i32_ty],
   1136           [IntrNoMem]>;
   1137 
   1138   def int_x86_avx512_maskz_vpermt2var_hi_512 :
   1139         GCCBuiltin<"__builtin_ia32_vpermt2varhi512_maskz">,
   1140           Intrinsic<[llvm_v32i16_ty],
   1141           [llvm_v32i16_ty, llvm_v32i16_ty, llvm_v32i16_ty, llvm_i32_ty],
   1142           [IntrNoMem]>;
   1143 
   1144   def int_x86_avx512_mask_vpermt2var_pd_128 :
   1145         GCCBuiltin<"__builtin_ia32_vpermt2varpd128_mask">,
   1146           Intrinsic<[llvm_v2f64_ty],
   1147           [llvm_v2i64_ty, llvm_v2f64_ty, llvm_v2f64_ty, llvm_i8_ty],
   1148           [IntrNoMem]>;
   1149 
   1150   def int_x86_avx512_maskz_vpermt2var_pd_128 :
   1151         GCCBuiltin<"__builtin_ia32_vpermt2varpd128_maskz">,
   1152           Intrinsic<[llvm_v2f64_ty],
   1153           [llvm_v2i64_ty, llvm_v2f64_ty, llvm_v2f64_ty, llvm_i8_ty],
   1154           [IntrNoMem]>;
   1155 
   1156   def int_x86_avx512_mask_vpermt2var_pd_256 :
   1157         GCCBuiltin<"__builtin_ia32_vpermt2varpd256_mask">,
   1158           Intrinsic<[llvm_v4f64_ty],
   1159           [llvm_v4i64_ty, llvm_v4f64_ty, llvm_v4f64_ty, llvm_i8_ty],
   1160           [IntrNoMem]>;
   1161 
   1162   def int_x86_avx512_maskz_vpermt2var_pd_256 :
   1163         GCCBuiltin<"__builtin_ia32_vpermt2varpd256_maskz">,
   1164           Intrinsic<[llvm_v4f64_ty],
   1165           [llvm_v4i64_ty, llvm_v4f64_ty, llvm_v4f64_ty, llvm_i8_ty],
   1166           [IntrNoMem]>;
   1167 
   1168   def int_x86_avx512_maskz_vpermt2var_pd_512 :
   1169         GCCBuiltin<"__builtin_ia32_vpermt2varpd512_maskz">,
   1170           Intrinsic<[llvm_v8f64_ty],
   1171           [llvm_v8i64_ty, llvm_v8f64_ty, llvm_v8f64_ty, llvm_i8_ty],
   1172           [IntrNoMem]>;
   1173 
   1174   def int_x86_avx512_mask_vpermt2var_ps_128 :
   1175         GCCBuiltin<"__builtin_ia32_vpermt2varps128_mask">,
   1176           Intrinsic<[llvm_v4f32_ty],
   1177           [llvm_v4i32_ty, llvm_v4f32_ty, llvm_v4f32_ty, llvm_i8_ty],
   1178           [IntrNoMem]>;
   1179 
   1180   def int_x86_avx512_maskz_vpermt2var_ps_128 :
   1181         GCCBuiltin<"__builtin_ia32_vpermt2varps128_maskz">,
   1182           Intrinsic<[llvm_v4f32_ty],
   1183           [llvm_v4i32_ty, llvm_v4f32_ty, llvm_v4f32_ty, llvm_i8_ty],
   1184           [IntrNoMem]>;
   1185 
   1186   def int_x86_avx512_mask_vpermt2var_ps_256 :
   1187         GCCBuiltin<"__builtin_ia32_vpermt2varps256_mask">,
   1188           Intrinsic<[llvm_v8f32_ty],
   1189           [llvm_v8i32_ty, llvm_v8f32_ty, llvm_v8f32_ty, llvm_i8_ty],
   1190           [IntrNoMem]>;
   1191 
   1192   def int_x86_avx512_maskz_vpermt2var_ps_256 :
   1193         GCCBuiltin<"__builtin_ia32_vpermt2varps256_maskz">,
   1194           Intrinsic<[llvm_v8f32_ty],
   1195           [llvm_v8i32_ty, llvm_v8f32_ty, llvm_v8f32_ty, llvm_i8_ty],
   1196           [IntrNoMem]>;
   1197 
   1198   def int_x86_avx512_maskz_vpermt2var_ps_512 :
   1199         GCCBuiltin<"__builtin_ia32_vpermt2varps512_maskz">,
   1200           Intrinsic<[llvm_v16f32_ty],
   1201           [llvm_v16i32_ty, llvm_v16f32_ty, llvm_v16f32_ty, llvm_i16_ty],
   1202           [IntrNoMem]>;
   1203 
   1204   def int_x86_avx512_mask_vpermt2var_q_128 :
   1205         GCCBuiltin<"__builtin_ia32_vpermt2varq128_mask">,
   1206           Intrinsic<[llvm_v2i64_ty],
   1207           [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty],
   1208           [IntrNoMem]>;
   1209 
   1210   def int_x86_avx512_maskz_vpermt2var_q_128 :
   1211         GCCBuiltin<"__builtin_ia32_vpermt2varq128_maskz">,
   1212           Intrinsic<[llvm_v2i64_ty],
   1213           [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty],
   1214           [IntrNoMem]>;
   1215 
   1216   def int_x86_avx512_mask_vpermt2var_q_256 :
   1217         GCCBuiltin<"__builtin_ia32_vpermt2varq256_mask">,
   1218           Intrinsic<[llvm_v4i64_ty],
   1219           [llvm_v4i64_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty],
   1220           [IntrNoMem]>;
   1221 
   1222   def int_x86_avx512_maskz_vpermt2var_q_256 :
   1223         GCCBuiltin<"__builtin_ia32_vpermt2varq256_maskz">,
   1224           Intrinsic<[llvm_v4i64_ty],
   1225           [llvm_v4i64_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty],
   1226           [IntrNoMem]>;
   1227 
   1228   def int_x86_avx512_maskz_vpermt2var_q_512 :
   1229         GCCBuiltin<"__builtin_ia32_vpermt2varq512_maskz">,
   1230           Intrinsic<[llvm_v8i64_ty],
   1231           [llvm_v8i64_ty, llvm_v8i64_ty, llvm_v8i64_ty, llvm_i8_ty],
   1232           [IntrNoMem]>;
   1233 
   1234   def int_x86_avx512_mask_vpermi2var_qi_128 :
   1235         GCCBuiltin<"__builtin_ia32_vpermi2varqi128_mask">,
   1236           Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
   1237           llvm_v16i8_ty, llvm_v16i8_ty, llvm_i16_ty],
   1238           [IntrNoMem]>;
   1239 
   1240   def int_x86_avx512_mask_vpermt2var_qi_128 :
   1241         GCCBuiltin<"__builtin_ia32_vpermt2varqi128_mask">,
   1242           Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
   1243           llvm_v16i8_ty, llvm_v16i8_ty, llvm_i16_ty],
   1244           [IntrNoMem]>;
   1245 
   1246   def int_x86_avx512_maskz_vpermt2var_qi_128 :
   1247         GCCBuiltin<"__builtin_ia32_vpermt2varqi128_maskz">,
   1248           Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
   1249           llvm_v16i8_ty, llvm_v16i8_ty, llvm_i16_ty],
   1250           [IntrNoMem]>;
   1251 
   1252   def int_x86_avx512_mask_vpermi2var_qi_256 :
   1253         GCCBuiltin<"__builtin_ia32_vpermi2varqi256_mask">,
   1254           Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
   1255           llvm_v32i8_ty, llvm_v32i8_ty, llvm_i32_ty],
   1256           [IntrNoMem]>;
   1257 
   1258   def int_x86_avx512_mask_vpermt2var_qi_256 :
   1259         GCCBuiltin<"__builtin_ia32_vpermt2varqi256_mask">,
   1260           Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
   1261           llvm_v32i8_ty, llvm_v32i8_ty, llvm_i32_ty],
   1262           [IntrNoMem]>;
   1263 
   1264   def int_x86_avx512_maskz_vpermt2var_qi_256 :
   1265         GCCBuiltin<"__builtin_ia32_vpermt2varqi256_maskz">,
   1266           Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
   1267           llvm_v32i8_ty, llvm_v32i8_ty, llvm_i32_ty],
   1268           [IntrNoMem]>;
   1269 
   1270   def int_x86_avx512_mask_vpermi2var_qi_512 :
   1271         GCCBuiltin<"__builtin_ia32_vpermi2varqi512_mask">,
   1272           Intrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty,
   1273           llvm_v64i8_ty, llvm_v64i8_ty, llvm_i64_ty],
   1274           [IntrNoMem]>;
   1275 
   1276   def int_x86_avx512_mask_vpermt2var_qi_512 :
   1277         GCCBuiltin<"__builtin_ia32_vpermt2varqi512_mask">,
   1278           Intrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty,
   1279           llvm_v64i8_ty, llvm_v64i8_ty, llvm_i64_ty],
   1280           [IntrNoMem]>;
   1281 
   1282   def int_x86_avx512_maskz_vpermt2var_qi_512 :
   1283         GCCBuiltin<"__builtin_ia32_vpermt2varqi512_maskz">,
   1284           Intrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty,
   1285           llvm_v64i8_ty, llvm_v64i8_ty, llvm_i64_ty],
   1286           [IntrNoMem]>;
   1287 
   1288   def int_x86_avx512_vpermilvar_pd_512 :
   1289         GCCBuiltin<"__builtin_ia32_vpermilvarpd512">,
   1290           Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8i64_ty],
   1291           [IntrNoMem]>;
   1292 
   1293   def int_x86_avx512_vpermilvar_ps_512 :
   1294         GCCBuiltin<"__builtin_ia32_vpermilvarps512">,
   1295           Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16i32_ty],
   1296           [IntrNoMem]>;
   1297 
   1298   def int_x86_avx512_pshuf_b_512 :
   1299         GCCBuiltin<"__builtin_ia32_pshufb512">,
   1300           Intrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
   1301           [IntrNoMem]>;
   1302 
   1303   def int_x86_avx512_mask_shuf_f32x4_256 :
   1304          GCCBuiltin<"__builtin_ia32_shuf_f32x4_256_mask">,
   1305           Intrinsic<[llvm_v8f32_ty],
   1306           [llvm_v8f32_ty, llvm_v8f32_ty, llvm_i32_ty, llvm_v8f32_ty, llvm_i8_ty],
   1307           [IntrNoMem]>;
   1308 
   1309   def int_x86_avx512_mask_shuf_f32x4 :
   1310          GCCBuiltin<"__builtin_ia32_shuf_f32x4_mask">,
   1311           Intrinsic<[llvm_v16f32_ty],
   1312           [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i32_ty, llvm_v16f32_ty, llvm_i16_ty],
   1313           [IntrNoMem]>;
   1314 
   1315   def int_x86_avx512_mask_shuf_f64x2_256 :
   1316          GCCBuiltin<"__builtin_ia32_shuf_f64x2_256_mask">,
   1317           Intrinsic<[llvm_v4f64_ty],
   1318           [llvm_v4f64_ty, llvm_v4f64_ty, llvm_i32_ty, llvm_v4f64_ty, llvm_i8_ty],
   1319           [IntrNoMem]>;
   1320 
   1321   def int_x86_avx512_mask_shuf_f64x2 :
   1322          GCCBuiltin<"__builtin_ia32_shuf_f64x2_mask">,
   1323           Intrinsic<[llvm_v8f64_ty],
   1324           [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i32_ty, llvm_v8f64_ty, llvm_i8_ty],
   1325           [IntrNoMem]>;
   1326 
   1327   def int_x86_avx512_mask_shuf_i32x4_256 :
   1328          GCCBuiltin<"__builtin_ia32_shuf_i32x4_256_mask">,
   1329           Intrinsic<[llvm_v8i32_ty],
   1330           [llvm_v8i32_ty, llvm_v8i32_ty, llvm_i32_ty, llvm_v8i32_ty, llvm_i8_ty],
   1331           [IntrNoMem]>;
   1332 
   1333   def int_x86_avx512_mask_shuf_i32x4 :
   1334          GCCBuiltin<"__builtin_ia32_shuf_i32x4_mask">,
   1335           Intrinsic<[llvm_v16i32_ty],
   1336           [llvm_v16i32_ty, llvm_v16i32_ty, llvm_i32_ty, llvm_v16i32_ty, llvm_i16_ty],
   1337           [IntrNoMem]>;
   1338 
   1339   def int_x86_avx512_mask_shuf_i64x2_256 :
   1340          GCCBuiltin<"__builtin_ia32_shuf_i64x2_256_mask">,
   1341           Intrinsic<[llvm_v4i64_ty],
   1342           [llvm_v4i64_ty, llvm_v4i64_ty, llvm_i32_ty, llvm_v4i64_ty, llvm_i8_ty],
   1343           [IntrNoMem]>;
   1344 
   1345   def int_x86_avx512_mask_shuf_i64x2 :
   1346          GCCBuiltin<"__builtin_ia32_shuf_i64x2_mask">,
   1347           Intrinsic<[llvm_v8i64_ty],
   1348           [llvm_v8i64_ty, llvm_v8i64_ty, llvm_i32_ty, llvm_v8i64_ty, llvm_i8_ty],
   1349           [IntrNoMem]>;
   1350 }
   1351 
   1352 // Vector blend
   1353 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1354   def int_x86_avx_blendv_pd_256 : GCCBuiltin<"__builtin_ia32_blendvpd256">,
   1355         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
   1356                   llvm_v4f64_ty, llvm_v4f64_ty], [IntrNoMem]>;
   1357   def int_x86_avx_blendv_ps_256 : GCCBuiltin<"__builtin_ia32_blendvps256">,
   1358         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   1359                   llvm_v8f32_ty, llvm_v8f32_ty], [IntrNoMem]>;
   1360 }
   1361 
   1362 // Vector dot product
   1363 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1364   def int_x86_avx_dp_ps_256 : GCCBuiltin<"__builtin_ia32_dpps256">,
   1365         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   1366                   llvm_v8f32_ty, llvm_i8_ty], [IntrNoMem, Commutative]>;
   1367 }
   1368 
   1369 // Vector compare
   1370 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1371   def int_x86_avx_cmp_pd_256 :
   1372         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
   1373                   llvm_v4f64_ty, llvm_i8_ty], [IntrNoMem]>;
   1374   def int_x86_avx_cmp_ps_256 :
   1375         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   1376                   llvm_v8f32_ty, llvm_i8_ty], [IntrNoMem]>;
   1377 }
   1378 
   1379 // Vector convert
   1380 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1381   def int_x86_avx_cvtdq2_ps_256 : GCCBuiltin<"__builtin_ia32_cvtdq2ps256">,
   1382         Intrinsic<[llvm_v8f32_ty], [llvm_v8i32_ty], [IntrNoMem]>;
   1383   def int_x86_avx_cvt_pd2_ps_256 : GCCBuiltin<"__builtin_ia32_cvtpd2ps256">,
   1384         Intrinsic<[llvm_v4f32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
   1385   def int_x86_avx_cvt_ps2dq_256 : GCCBuiltin<"__builtin_ia32_cvtps2dq256">,
   1386         Intrinsic<[llvm_v8i32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
   1387   def int_x86_avx_cvtt_pd2dq_256 : GCCBuiltin<"__builtin_ia32_cvttpd2dq256">,
   1388         Intrinsic<[llvm_v4i32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
   1389   def int_x86_avx_cvt_pd2dq_256 : GCCBuiltin<"__builtin_ia32_cvtpd2dq256">,
   1390         Intrinsic<[llvm_v4i32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
   1391   def int_x86_avx_cvtt_ps2dq_256 : GCCBuiltin<"__builtin_ia32_cvttps2dq256">,
   1392         Intrinsic<[llvm_v8i32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
   1393 }
   1394 
   1395 // Vector bit test
   1396 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1397   def int_x86_avx_vtestz_pd : GCCBuiltin<"__builtin_ia32_vtestzpd">,
   1398         Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
   1399                   llvm_v2f64_ty], [IntrNoMem]>;
   1400   def int_x86_avx_vtestc_pd : GCCBuiltin<"__builtin_ia32_vtestcpd">,
   1401         Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
   1402                   llvm_v2f64_ty], [IntrNoMem]>;
   1403   def int_x86_avx_vtestnzc_pd : GCCBuiltin<"__builtin_ia32_vtestnzcpd">,
   1404         Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
   1405                   llvm_v2f64_ty], [IntrNoMem]>;
   1406   def int_x86_avx_vtestz_ps : GCCBuiltin<"__builtin_ia32_vtestzps">,
   1407         Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
   1408                   llvm_v4f32_ty], [IntrNoMem]>;
   1409   def int_x86_avx_vtestc_ps : GCCBuiltin<"__builtin_ia32_vtestcps">,
   1410         Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
   1411                   llvm_v4f32_ty], [IntrNoMem]>;
   1412   def int_x86_avx_vtestnzc_ps : GCCBuiltin<"__builtin_ia32_vtestnzcps">,
   1413         Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
   1414                   llvm_v4f32_ty], [IntrNoMem]>;
   1415   def int_x86_avx_vtestz_pd_256 : GCCBuiltin<"__builtin_ia32_vtestzpd256">,
   1416         Intrinsic<[llvm_i32_ty], [llvm_v4f64_ty,
   1417                   llvm_v4f64_ty], [IntrNoMem]>;
   1418   def int_x86_avx_vtestc_pd_256 : GCCBuiltin<"__builtin_ia32_vtestcpd256">,
   1419         Intrinsic<[llvm_i32_ty], [llvm_v4f64_ty,
   1420                   llvm_v4f64_ty], [IntrNoMem]>;
   1421   def int_x86_avx_vtestnzc_pd_256 : GCCBuiltin<"__builtin_ia32_vtestnzcpd256">,
   1422         Intrinsic<[llvm_i32_ty], [llvm_v4f64_ty,
   1423                   llvm_v4f64_ty], [IntrNoMem]>;
   1424   def int_x86_avx_vtestz_ps_256 : GCCBuiltin<"__builtin_ia32_vtestzps256">,
   1425         Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty,
   1426                   llvm_v8f32_ty], [IntrNoMem]>;
   1427   def int_x86_avx_vtestc_ps_256 : GCCBuiltin<"__builtin_ia32_vtestcps256">,
   1428         Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty,
   1429                   llvm_v8f32_ty], [IntrNoMem]>;
   1430   def int_x86_avx_vtestnzc_ps_256 : GCCBuiltin<"__builtin_ia32_vtestnzcps256">,
   1431         Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty,
   1432                   llvm_v8f32_ty], [IntrNoMem]>;
   1433   def int_x86_avx_ptestz_256 : GCCBuiltin<"__builtin_ia32_ptestz256">,
   1434         Intrinsic<[llvm_i32_ty], [llvm_v4i64_ty,
   1435                   llvm_v4i64_ty], [IntrNoMem]>;
   1436   def int_x86_avx_ptestc_256 : GCCBuiltin<"__builtin_ia32_ptestc256">,
   1437         Intrinsic<[llvm_i32_ty], [llvm_v4i64_ty,
   1438                   llvm_v4i64_ty], [IntrNoMem]>;
   1439   def int_x86_avx_ptestnzc_256 : GCCBuiltin<"__builtin_ia32_ptestnzc256">,
   1440         Intrinsic<[llvm_i32_ty], [llvm_v4i64_ty,
   1441                   llvm_v4i64_ty], [IntrNoMem]>;
   1442   def int_x86_avx512_ptestm_d_512 : GCCBuiltin<"__builtin_ia32_ptestmd512">,
   1443         Intrinsic<[llvm_i16_ty], [llvm_v16i32_ty, llvm_v16i32_ty,
   1444                   llvm_i16_ty], [IntrNoMem]>;
   1445   def int_x86_avx512_ptestm_q_512 : GCCBuiltin<"__builtin_ia32_ptestmq512">,
   1446         Intrinsic<[llvm_i8_ty], [llvm_v8i64_ty, llvm_v8i64_ty,
   1447                   llvm_i8_ty], [IntrNoMem]>;
   1448 
   1449   def int_x86_avx512_ptestm_b_128 : GCCBuiltin<"__builtin_ia32_ptestmb128">,
   1450         Intrinsic<[llvm_i16_ty], [llvm_v16i8_ty,
   1451                    llvm_v16i8_ty, llvm_i16_ty], [IntrNoMem]>;
   1452   def int_x86_avx512_ptestm_b_256 : GCCBuiltin<"__builtin_ia32_ptestmb256">,
   1453         Intrinsic<[llvm_i32_ty], [llvm_v32i8_ty,
   1454                    llvm_v32i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1455   def int_x86_avx512_ptestm_b_512 : GCCBuiltin<"__builtin_ia32_ptestmb512">,
   1456         Intrinsic<[llvm_i64_ty], [llvm_v64i8_ty,
   1457                    llvm_v64i8_ty, llvm_i64_ty], [IntrNoMem]>;
   1458   def int_x86_avx512_ptestm_d_128 : GCCBuiltin<"__builtin_ia32_ptestmd128">,
   1459         Intrinsic<[llvm_i8_ty], [llvm_v4i32_ty,
   1460                    llvm_v4i32_ty, llvm_i8_ty], [IntrNoMem]>;
   1461   def int_x86_avx512_ptestm_d_256 : GCCBuiltin<"__builtin_ia32_ptestmd256">,
   1462         Intrinsic<[llvm_i8_ty], [llvm_v8i32_ty,
   1463                    llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>;
   1464   def int_x86_avx512_ptestm_q_128 : GCCBuiltin<"__builtin_ia32_ptestmq128">,
   1465         Intrinsic<[llvm_i8_ty], [llvm_v2i64_ty,
   1466                    llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>;
   1467   def int_x86_avx512_ptestm_q_256 : GCCBuiltin<"__builtin_ia32_ptestmq256">,
   1468         Intrinsic<[llvm_i8_ty], [llvm_v4i64_ty,
   1469                    llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>;
   1470   def int_x86_avx512_ptestm_w_128 : GCCBuiltin<"__builtin_ia32_ptestmw128">,
   1471         Intrinsic<[llvm_i8_ty], [llvm_v8i16_ty,
   1472                    llvm_v8i16_ty, llvm_i8_ty], [IntrNoMem]>;
   1473   def int_x86_avx512_ptestm_w_256 : GCCBuiltin<"__builtin_ia32_ptestmw256">,
   1474         Intrinsic<[llvm_i16_ty], [llvm_v16i16_ty,
   1475                    llvm_v16i16_ty, llvm_i16_ty], [IntrNoMem]>;
   1476   def int_x86_avx512_ptestm_w_512 : GCCBuiltin<"__builtin_ia32_ptestmw512">,
   1477         Intrinsic<[llvm_i32_ty], [llvm_v32i16_ty,
   1478                    llvm_v32i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1479 
   1480   def int_x86_avx512_ptestnm_b_128 : GCCBuiltin<"__builtin_ia32_ptestnmb128">,
   1481         Intrinsic<[llvm_i16_ty], [llvm_v16i8_ty,
   1482                    llvm_v16i8_ty, llvm_i16_ty], [IntrNoMem]>;
   1483   def int_x86_avx512_ptestnm_b_256 : GCCBuiltin<"__builtin_ia32_ptestnmb256">,
   1484         Intrinsic<[llvm_i32_ty], [llvm_v32i8_ty,
   1485                    llvm_v32i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1486   def int_x86_avx512_ptestnm_b_512 : GCCBuiltin<"__builtin_ia32_ptestnmb512">,
   1487         Intrinsic<[llvm_i64_ty], [llvm_v64i8_ty,
   1488                    llvm_v64i8_ty, llvm_i64_ty], [IntrNoMem]>;
   1489   def int_x86_avx512_ptestnm_d_128 : GCCBuiltin<"__builtin_ia32_ptestnmd128">,
   1490         Intrinsic<[llvm_i8_ty], [llvm_v4i32_ty,
   1491                    llvm_v4i32_ty, llvm_i8_ty], [IntrNoMem]>;
   1492   def int_x86_avx512_ptestnm_d_256 : GCCBuiltin<"__builtin_ia32_ptestnmd256">,
   1493         Intrinsic<[llvm_i8_ty], [llvm_v8i32_ty,
   1494                    llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>;
   1495   def int_x86_avx512_ptestnm_d_512 : GCCBuiltin<"__builtin_ia32_ptestnmd512">,
   1496         Intrinsic<[llvm_i16_ty], [llvm_v16i32_ty,
   1497                    llvm_v16i32_ty, llvm_i16_ty], [IntrNoMem]>;
   1498   def int_x86_avx512_ptestnm_q_128 : GCCBuiltin<"__builtin_ia32_ptestnmq128">,
   1499         Intrinsic<[llvm_i8_ty], [llvm_v2i64_ty,
   1500                    llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>;
   1501   def int_x86_avx512_ptestnm_q_256 : GCCBuiltin<"__builtin_ia32_ptestnmq256">,
   1502         Intrinsic<[llvm_i8_ty], [llvm_v4i64_ty,
   1503                    llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>;
   1504   def int_x86_avx512_ptestnm_q_512 : GCCBuiltin<"__builtin_ia32_ptestnmq512">,
   1505         Intrinsic<[llvm_i8_ty], [llvm_v8i64_ty,
   1506                    llvm_v8i64_ty, llvm_i8_ty], [IntrNoMem]>;
   1507   def int_x86_avx512_ptestnm_w_128 : GCCBuiltin<"__builtin_ia32_ptestnmw128">,
   1508         Intrinsic<[llvm_i8_ty], [llvm_v8i16_ty,
   1509                    llvm_v8i16_ty, llvm_i8_ty], [IntrNoMem]>;
   1510   def int_x86_avx512_ptestnm_w_256 : GCCBuiltin<"__builtin_ia32_ptestnmw256">,
   1511         Intrinsic<[llvm_i16_ty], [llvm_v16i16_ty,
   1512                    llvm_v16i16_ty, llvm_i16_ty], [IntrNoMem]>;
   1513   def int_x86_avx512_ptestnm_w_512 : GCCBuiltin<"__builtin_ia32_ptestnmw512">,
   1514         Intrinsic<[llvm_i32_ty], [llvm_v32i16_ty,
   1515                    llvm_v32i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1516 
   1517   def int_x86_avx512_mask_fpclass_pd_128 :
   1518          GCCBuiltin<"__builtin_ia32_fpclasspd128_mask">,
   1519           Intrinsic<[llvm_i8_ty], [llvm_v2f64_ty, llvm_i32_ty, llvm_i8_ty],
   1520           [IntrNoMem]>;
   1521   def int_x86_avx512_mask_fpclass_pd_256 :
   1522          GCCBuiltin<"__builtin_ia32_fpclasspd256_mask">,
   1523           Intrinsic<[llvm_i8_ty], [llvm_v4f64_ty, llvm_i32_ty, llvm_i8_ty],
   1524           [IntrNoMem]>;
   1525   def int_x86_avx512_mask_fpclass_pd_512 :
   1526          GCCBuiltin<"__builtin_ia32_fpclasspd512_mask">,
   1527           Intrinsic<[llvm_i8_ty], [llvm_v8f64_ty, llvm_i32_ty, llvm_i8_ty],
   1528           [IntrNoMem]>;
   1529   def int_x86_avx512_mask_fpclass_ps_128 :
   1530          GCCBuiltin<"__builtin_ia32_fpclassps128_mask">,
   1531           Intrinsic<[llvm_i8_ty], [llvm_v4f32_ty, llvm_i32_ty, llvm_i8_ty],
   1532           [IntrNoMem]>;
   1533   def int_x86_avx512_mask_fpclass_ps_256 :
   1534          GCCBuiltin<"__builtin_ia32_fpclassps256_mask">,
   1535           Intrinsic<[llvm_i8_ty], [llvm_v8f32_ty, llvm_i32_ty, llvm_i8_ty],
   1536           [IntrNoMem]>;
   1537   def int_x86_avx512_mask_fpclass_ps_512 :
   1538          GCCBuiltin<"__builtin_ia32_fpclassps512_mask">,
   1539           Intrinsic<[llvm_i16_ty], [llvm_v16f32_ty, llvm_i32_ty, llvm_i16_ty],
   1540           [IntrNoMem]>;
   1541   def int_x86_avx512_mask_fpclass_sd :
   1542          GCCBuiltin<"__builtin_ia32_fpclasssd_mask">,
   1543           Intrinsic<[llvm_i8_ty], [llvm_v2f64_ty, llvm_i32_ty, llvm_i8_ty],
   1544           [IntrNoMem]>;
   1545   def int_x86_avx512_mask_fpclass_ss :
   1546          GCCBuiltin<"__builtin_ia32_fpclassss_mask">,
   1547           Intrinsic<[llvm_i8_ty], [llvm_v4f32_ty, llvm_i32_ty, llvm_i8_ty],
   1548           [IntrNoMem]>;
   1549 }
   1550 
   1551 // Vector extract sign mask
   1552 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1553   def int_x86_avx_movmsk_pd_256 : GCCBuiltin<"__builtin_ia32_movmskpd256">,
   1554         Intrinsic<[llvm_i32_ty], [llvm_v4f64_ty], [IntrNoMem]>;
   1555   def int_x86_avx_movmsk_ps_256 : GCCBuiltin<"__builtin_ia32_movmskps256">,
   1556         Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
   1557 }
   1558 
   1559 // Vector zero
   1560 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1561   def int_x86_avx_vzeroall : GCCBuiltin<"__builtin_ia32_vzeroall">,
   1562         Intrinsic<[], [], []>;
   1563   def int_x86_avx_vzeroupper : GCCBuiltin<"__builtin_ia32_vzeroupper">,
   1564         Intrinsic<[], [], []>;
   1565 }
   1566 
   1567 // SIMD load ops
   1568 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1569   def int_x86_avx_ldu_dq_256 : GCCBuiltin<"__builtin_ia32_lddqu256">,
   1570         Intrinsic<[llvm_v32i8_ty], [llvm_ptr_ty], [IntrReadMem]>;
   1571 }
   1572 
   1573 // Conditional load ops
   1574 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1575   def int_x86_avx_maskload_pd : GCCBuiltin<"__builtin_ia32_maskloadpd">,
   1576         Intrinsic<[llvm_v2f64_ty], [llvm_ptr_ty, llvm_v2i64_ty],
   1577                   [IntrReadMem, IntrArgMemOnly]>;
   1578   def int_x86_avx_maskload_ps : GCCBuiltin<"__builtin_ia32_maskloadps">,
   1579         Intrinsic<[llvm_v4f32_ty], [llvm_ptr_ty, llvm_v4i32_ty],
   1580                   [IntrReadMem, IntrArgMemOnly]>;
   1581   def int_x86_avx_maskload_pd_256 : GCCBuiltin<"__builtin_ia32_maskloadpd256">,
   1582         Intrinsic<[llvm_v4f64_ty], [llvm_ptr_ty, llvm_v4i64_ty],
   1583                   [IntrReadMem, IntrArgMemOnly]>;
   1584   def int_x86_avx_maskload_ps_256 : GCCBuiltin<"__builtin_ia32_maskloadps256">,
   1585         Intrinsic<[llvm_v8f32_ty], [llvm_ptr_ty, llvm_v8i32_ty],
   1586                   [IntrReadMem, IntrArgMemOnly]>;
   1587 }
   1588 
   1589 // Conditional store ops
   1590 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1591   def int_x86_avx_maskstore_pd : GCCBuiltin<"__builtin_ia32_maskstorepd">,
   1592         Intrinsic<[], [llvm_ptr_ty,
   1593                   llvm_v2i64_ty, llvm_v2f64_ty], [IntrArgMemOnly]>;
   1594   def int_x86_avx_maskstore_ps : GCCBuiltin<"__builtin_ia32_maskstoreps">,
   1595         Intrinsic<[], [llvm_ptr_ty,
   1596                   llvm_v4i32_ty, llvm_v4f32_ty], [IntrArgMemOnly]>;
   1597   def int_x86_avx_maskstore_pd_256 :
   1598         GCCBuiltin<"__builtin_ia32_maskstorepd256">,
   1599         Intrinsic<[], [llvm_ptr_ty,
   1600                   llvm_v4i64_ty, llvm_v4f64_ty], [IntrArgMemOnly]>;
   1601   def int_x86_avx_maskstore_ps_256 :
   1602         GCCBuiltin<"__builtin_ia32_maskstoreps256">,
   1603         Intrinsic<[], [llvm_ptr_ty,
   1604                   llvm_v8i32_ty, llvm_v8f32_ty], [IntrArgMemOnly]>;
   1605 
   1606   def int_x86_avx512_mask_store_ss :
   1607         GCCBuiltin<"__builtin_ia32_storess_mask">,
   1608         Intrinsic<[], [llvm_ptr_ty, llvm_v4f32_ty, llvm_i8_ty],
   1609                   [IntrArgMemOnly]>;
   1610 }
   1611 
   1612 //===----------------------------------------------------------------------===//
   1613 // AVX2
   1614 
   1615 // Integer arithmetic ops.
   1616 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1617   def int_x86_avx2_padds_b : GCCBuiltin<"__builtin_ia32_paddsb256">,
   1618               Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
   1619                          llvm_v32i8_ty], [IntrNoMem, Commutative]>;
   1620   def int_x86_avx2_padds_w : GCCBuiltin<"__builtin_ia32_paddsw256">,
   1621               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1622                          llvm_v16i16_ty], [IntrNoMem, Commutative]>;
   1623   def int_x86_avx2_paddus_b : GCCBuiltin<"__builtin_ia32_paddusb256">,
   1624               Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
   1625                          llvm_v32i8_ty], [IntrNoMem, Commutative]>;
   1626   def int_x86_avx2_paddus_w : GCCBuiltin<"__builtin_ia32_paddusw256">,
   1627               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1628                          llvm_v16i16_ty], [IntrNoMem, Commutative]>;
   1629   def int_x86_avx2_psubs_b : GCCBuiltin<"__builtin_ia32_psubsb256">,
   1630               Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
   1631                          llvm_v32i8_ty], [IntrNoMem]>;
   1632   def int_x86_avx2_psubs_w : GCCBuiltin<"__builtin_ia32_psubsw256">,
   1633               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1634                          llvm_v16i16_ty], [IntrNoMem]>;
   1635   def int_x86_avx2_psubus_b : GCCBuiltin<"__builtin_ia32_psubusb256">,
   1636               Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
   1637                          llvm_v32i8_ty], [IntrNoMem]>;
   1638   def int_x86_avx2_psubus_w : GCCBuiltin<"__builtin_ia32_psubusw256">,
   1639               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1640                          llvm_v16i16_ty], [IntrNoMem]>;
   1641   def int_x86_avx2_pmulhu_w : GCCBuiltin<"__builtin_ia32_pmulhuw256">,
   1642               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1643                          llvm_v16i16_ty], [IntrNoMem, Commutative]>;
   1644   def int_x86_avx2_pmulh_w : GCCBuiltin<"__builtin_ia32_pmulhw256">,
   1645               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1646                          llvm_v16i16_ty], [IntrNoMem, Commutative]>;
   1647   def int_x86_avx2_pmulu_dq : GCCBuiltin<"__builtin_ia32_pmuludq256">,
   1648               Intrinsic<[llvm_v4i64_ty], [llvm_v8i32_ty,
   1649                          llvm_v8i32_ty], [IntrNoMem, Commutative]>;
   1650   def int_x86_avx2_pmul_dq : GCCBuiltin<"__builtin_ia32_pmuldq256">,
   1651               Intrinsic<[llvm_v4i64_ty], [llvm_v8i32_ty,
   1652                          llvm_v8i32_ty], [IntrNoMem, Commutative]>;
   1653   def int_x86_avx2_pmadd_wd : GCCBuiltin<"__builtin_ia32_pmaddwd256">,
   1654               Intrinsic<[llvm_v8i32_ty], [llvm_v16i16_ty,
   1655                          llvm_v16i16_ty], [IntrNoMem, Commutative]>;
   1656   def int_x86_avx2_psad_bw : GCCBuiltin<"__builtin_ia32_psadbw256">,
   1657               Intrinsic<[llvm_v4i64_ty], [llvm_v32i8_ty,
   1658                          llvm_v32i8_ty], [IntrNoMem, Commutative]>;
   1659 }
   1660 
   1661 // Integer shift ops.
   1662 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1663   def int_x86_avx2_psll_w : GCCBuiltin<"__builtin_ia32_psllw256">,
   1664               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1665                          llvm_v8i16_ty], [IntrNoMem]>;
   1666   def int_x86_avx2_psll_d : GCCBuiltin<"__builtin_ia32_pslld256">,
   1667               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
   1668                          llvm_v4i32_ty], [IntrNoMem]>;
   1669   def int_x86_avx2_psll_q : GCCBuiltin<"__builtin_ia32_psllq256">,
   1670               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
   1671                          llvm_v2i64_ty], [IntrNoMem]>;
   1672   def int_x86_avx2_psrl_w : GCCBuiltin<"__builtin_ia32_psrlw256">,
   1673               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1674                          llvm_v8i16_ty], [IntrNoMem]>;
   1675   def int_x86_avx2_psrl_d : GCCBuiltin<"__builtin_ia32_psrld256">,
   1676               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
   1677                          llvm_v4i32_ty], [IntrNoMem]>;
   1678   def int_x86_avx2_psrl_q : GCCBuiltin<"__builtin_ia32_psrlq256">,
   1679               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
   1680                          llvm_v2i64_ty], [IntrNoMem]>;
   1681   def int_x86_avx2_psra_w : GCCBuiltin<"__builtin_ia32_psraw256">,
   1682               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1683                          llvm_v8i16_ty], [IntrNoMem]>;
   1684   def int_x86_avx2_psra_d : GCCBuiltin<"__builtin_ia32_psrad256">,
   1685               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
   1686                          llvm_v4i32_ty], [IntrNoMem]>;
   1687 
   1688   def int_x86_avx2_pslli_w : GCCBuiltin<"__builtin_ia32_psllwi256">,
   1689               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1690                          llvm_i32_ty], [IntrNoMem]>;
   1691   def int_x86_avx2_pslli_d : GCCBuiltin<"__builtin_ia32_pslldi256">,
   1692               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
   1693                          llvm_i32_ty], [IntrNoMem]>;
   1694   def int_x86_avx2_pslli_q : GCCBuiltin<"__builtin_ia32_psllqi256">,
   1695               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
   1696                          llvm_i32_ty], [IntrNoMem]>;
   1697   def int_x86_avx2_psrli_w : GCCBuiltin<"__builtin_ia32_psrlwi256">,
   1698               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1699                          llvm_i32_ty], [IntrNoMem]>;
   1700   def int_x86_avx2_psrli_d : GCCBuiltin<"__builtin_ia32_psrldi256">,
   1701               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
   1702                          llvm_i32_ty], [IntrNoMem]>;
   1703   def int_x86_avx2_psrli_q : GCCBuiltin<"__builtin_ia32_psrlqi256">,
   1704               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
   1705                          llvm_i32_ty], [IntrNoMem]>;
   1706   def int_x86_avx2_psrai_w : GCCBuiltin<"__builtin_ia32_psrawi256">,
   1707               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1708                          llvm_i32_ty], [IntrNoMem]>;
   1709   def int_x86_avx2_psrai_d : GCCBuiltin<"__builtin_ia32_psradi256">,
   1710               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
   1711                          llvm_i32_ty], [IntrNoMem]>;
   1712 
   1713   def int_x86_avx512_psra_q_128 : GCCBuiltin<"__builtin_ia32_psraq128">,
   1714               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
   1715                          llvm_v2i64_ty], [IntrNoMem]>;
   1716   def int_x86_avx512_psra_q_256 : GCCBuiltin<"__builtin_ia32_psraq256">,
   1717               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
   1718                          llvm_v2i64_ty], [IntrNoMem]>;
   1719 
   1720   def int_x86_avx512_psrai_q_128 : GCCBuiltin<"__builtin_ia32_psraqi128">,
   1721               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
   1722                          llvm_i32_ty], [IntrNoMem]>;
   1723   def int_x86_avx512_psrai_q_256 : GCCBuiltin<"__builtin_ia32_psraqi256">,
   1724               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
   1725                          llvm_i32_ty], [IntrNoMem]>;
   1726 
   1727   def int_x86_avx512_psll_w_512 : GCCBuiltin<"__builtin_ia32_psllw512">,
   1728               Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
   1729                          llvm_v8i16_ty], [IntrNoMem]>;
   1730   def int_x86_avx512_psll_d_512 : GCCBuiltin<"__builtin_ia32_pslld512">,
   1731               Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
   1732                          llvm_v4i32_ty], [IntrNoMem]>;
   1733   def int_x86_avx512_psll_q_512 : GCCBuiltin<"__builtin_ia32_psllq512">,
   1734               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
   1735                          llvm_v2i64_ty], [IntrNoMem]>;
   1736   def int_x86_avx512_psrl_w_512 : GCCBuiltin<"__builtin_ia32_psrlw512">,
   1737               Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
   1738                          llvm_v8i16_ty], [IntrNoMem]>;
   1739   def int_x86_avx512_psrl_d_512 : GCCBuiltin<"__builtin_ia32_psrld512">,
   1740               Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
   1741                          llvm_v4i32_ty], [IntrNoMem]>;
   1742   def int_x86_avx512_psrl_q_512 : GCCBuiltin<"__builtin_ia32_psrlq512">,
   1743               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
   1744                          llvm_v2i64_ty], [IntrNoMem]>;
   1745   def int_x86_avx512_psra_w_512 : GCCBuiltin<"__builtin_ia32_psraw512">,
   1746               Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
   1747                          llvm_v8i16_ty], [IntrNoMem]>;
   1748   def int_x86_avx512_psra_d_512 : GCCBuiltin<"__builtin_ia32_psrad512">,
   1749               Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
   1750                          llvm_v4i32_ty], [IntrNoMem]>;
   1751   def int_x86_avx512_psra_q_512 : GCCBuiltin<"__builtin_ia32_psraq512">,
   1752               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
   1753                          llvm_v2i64_ty], [IntrNoMem]>;
   1754 
   1755   def int_x86_avx512_pslli_w_512 : GCCBuiltin<"__builtin_ia32_psllwi512">,
   1756               Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
   1757                          llvm_i32_ty], [IntrNoMem]>;
   1758   def int_x86_avx512_pslli_d_512 : GCCBuiltin<"__builtin_ia32_pslldi512">,
   1759               Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
   1760                          llvm_i32_ty], [IntrNoMem]>;
   1761   def int_x86_avx512_pslli_q_512 : GCCBuiltin<"__builtin_ia32_psllqi512">,
   1762               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
   1763                          llvm_i32_ty], [IntrNoMem]>;
   1764   def int_x86_avx512_psrli_w_512 : GCCBuiltin<"__builtin_ia32_psrlwi512">,
   1765               Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
   1766                          llvm_i32_ty], [IntrNoMem]>;
   1767   def int_x86_avx512_psrli_d_512 : GCCBuiltin<"__builtin_ia32_psrldi512">,
   1768               Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
   1769                          llvm_i32_ty], [IntrNoMem]>;
   1770   def int_x86_avx512_psrli_q_512 : GCCBuiltin<"__builtin_ia32_psrlqi512">,
   1771               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
   1772                          llvm_i32_ty], [IntrNoMem]>;
   1773   def int_x86_avx512_psrai_w_512 : GCCBuiltin<"__builtin_ia32_psrawi512">,
   1774               Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
   1775                          llvm_i32_ty], [IntrNoMem]>;
   1776   def int_x86_avx512_psrai_d_512 : GCCBuiltin<"__builtin_ia32_psradi512">,
   1777               Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
   1778                          llvm_i32_ty], [IntrNoMem]>;
   1779   def int_x86_avx512_psrai_q_512 : GCCBuiltin<"__builtin_ia32_psraqi512">,
   1780               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
   1781                          llvm_i32_ty], [IntrNoMem]>;
   1782 
   1783   def int_x86_avx512_mask_pmultishift_qb_128:
   1784         GCCBuiltin<"__builtin_ia32_vpmultishiftqb128_mask">,
   1785         Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
   1786                    llvm_v16i8_ty, llvm_v16i8_ty, llvm_i16_ty], [IntrNoMem]>;
   1787   def int_x86_avx512_mask_pmultishift_qb_256:
   1788         GCCBuiltin<"__builtin_ia32_vpmultishiftqb256_mask">,
   1789         Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
   1790                    llvm_v32i8_ty, llvm_v32i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1791   def int_x86_avx512_mask_pmultishift_qb_512:
   1792         GCCBuiltin<"__builtin_ia32_vpmultishiftqb512_mask">,
   1793         Intrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty,
   1794                    llvm_v64i8_ty, llvm_v64i8_ty, llvm_i64_ty], [IntrNoMem]>;
   1795 }
   1796 
   1797 // Pack ops.
   1798 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1799   def int_x86_avx2_packsswb : GCCBuiltin<"__builtin_ia32_packsswb256">,
   1800               Intrinsic<[llvm_v32i8_ty], [llvm_v16i16_ty,
   1801                          llvm_v16i16_ty], [IntrNoMem]>;
   1802   def int_x86_avx2_packssdw : GCCBuiltin<"__builtin_ia32_packssdw256">,
   1803               Intrinsic<[llvm_v16i16_ty], [llvm_v8i32_ty,
   1804                          llvm_v8i32_ty], [IntrNoMem]>;
   1805   def int_x86_avx2_packuswb : GCCBuiltin<"__builtin_ia32_packuswb256">,
   1806               Intrinsic<[llvm_v32i8_ty], [llvm_v16i16_ty,
   1807                          llvm_v16i16_ty], [IntrNoMem]>;
   1808   def int_x86_avx2_packusdw : GCCBuiltin<"__builtin_ia32_packusdw256">,
   1809               Intrinsic<[llvm_v16i16_ty], [llvm_v8i32_ty,
   1810                          llvm_v8i32_ty], [IntrNoMem]>;
   1811 }
   1812 
   1813 // Horizontal arithmetic ops
   1814 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1815   def int_x86_avx2_phadd_w : GCCBuiltin<"__builtin_ia32_phaddw256">,
   1816               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1817                          llvm_v16i16_ty], [IntrNoMem]>;
   1818   def int_x86_avx2_phadd_d : GCCBuiltin<"__builtin_ia32_phaddd256">,
   1819               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
   1820                          llvm_v8i32_ty], [IntrNoMem]>;
   1821   def int_x86_avx2_phadd_sw : GCCBuiltin<"__builtin_ia32_phaddsw256">,
   1822               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1823                          llvm_v16i16_ty], [IntrNoMem]>;
   1824   def int_x86_avx2_phsub_w : GCCBuiltin<"__builtin_ia32_phsubw256">,
   1825               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1826                          llvm_v16i16_ty], [IntrNoMem]>;
   1827   def int_x86_avx2_phsub_d : GCCBuiltin<"__builtin_ia32_phsubd256">,
   1828               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
   1829                          llvm_v8i32_ty], [IntrNoMem]>;
   1830   def int_x86_avx2_phsub_sw : GCCBuiltin<"__builtin_ia32_phsubsw256">,
   1831               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1832                          llvm_v16i16_ty], [IntrNoMem]>;
   1833   def int_x86_avx2_pmadd_ub_sw : GCCBuiltin<"__builtin_ia32_pmaddubsw256">,
   1834               Intrinsic<[llvm_v16i16_ty], [llvm_v32i8_ty,
   1835                          llvm_v32i8_ty], [IntrNoMem]>;
   1836 }
   1837 
   1838 // Sign ops
   1839 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1840   def int_x86_avx2_psign_b : GCCBuiltin<"__builtin_ia32_psignb256">,
   1841               Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
   1842                          llvm_v32i8_ty], [IntrNoMem]>;
   1843   def int_x86_avx2_psign_w : GCCBuiltin<"__builtin_ia32_psignw256">,
   1844               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1845                          llvm_v16i16_ty], [IntrNoMem]>;
   1846   def int_x86_avx2_psign_d : GCCBuiltin<"__builtin_ia32_psignd256">,
   1847               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
   1848                          llvm_v8i32_ty], [IntrNoMem]>;
   1849 }
   1850 
   1851 // Packed multiply high with round and scale
   1852 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1853   def int_x86_avx2_pmul_hr_sw : GCCBuiltin<"__builtin_ia32_pmulhrsw256">,
   1854               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   1855                          llvm_v16i16_ty], [IntrNoMem, Commutative]>;
   1856   def int_x86_avx512_mask_pmul_hr_sw_128 : GCCBuiltin<"__builtin_ia32_pmulhrsw128_mask">,
   1857               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty,
   1858                      llvm_v8i16_ty, llvm_i8_ty], [IntrNoMem]>;
   1859   def int_x86_avx512_mask_pmul_hr_sw_256 : GCCBuiltin<"__builtin_ia32_pmulhrsw256_mask">,
   1860               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty,
   1861                      llvm_v16i16_ty, llvm_i16_ty], [IntrNoMem]>;
   1862   def int_x86_avx512_mask_pmul_hr_sw_512 : GCCBuiltin<"__builtin_ia32_pmulhrsw512_mask">,
   1863               Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty,
   1864                      llvm_v32i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1865 }
   1866 
   1867 // Vector blend
   1868 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1869   def int_x86_avx2_pblendvb : GCCBuiltin<"__builtin_ia32_pblendvb256">,
   1870               Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty, llvm_v32i8_ty,
   1871                          llvm_v32i8_ty], [IntrNoMem]>;
   1872 }
   1873 
   1874 
   1875 // Vector permutation
   1876 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1877   def int_x86_avx2_permd : GCCBuiltin<"__builtin_ia32_permvarsi256">,
   1878               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
   1879                         [IntrNoMem]>;
   1880   def int_x86_avx2_permps : GCCBuiltin<"__builtin_ia32_permvarsf256">,
   1881               Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8i32_ty],
   1882                         [IntrNoMem]>;
   1883 }
   1884 
   1885 // Conditional load ops
   1886 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1887   def int_x86_avx2_maskload_d : GCCBuiltin<"__builtin_ia32_maskloadd">,
   1888         Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty, llvm_v4i32_ty],
   1889                   [IntrReadMem, IntrArgMemOnly]>;
   1890   def int_x86_avx2_maskload_q : GCCBuiltin<"__builtin_ia32_maskloadq">,
   1891         Intrinsic<[llvm_v2i64_ty], [llvm_ptr_ty, llvm_v2i64_ty],
   1892                   [IntrReadMem, IntrArgMemOnly]>;
   1893   def int_x86_avx2_maskload_d_256 : GCCBuiltin<"__builtin_ia32_maskloadd256">,
   1894         Intrinsic<[llvm_v8i32_ty], [llvm_ptr_ty, llvm_v8i32_ty],
   1895                   [IntrReadMem, IntrArgMemOnly]>;
   1896   def int_x86_avx2_maskload_q_256 : GCCBuiltin<"__builtin_ia32_maskloadq256">,
   1897         Intrinsic<[llvm_v4i64_ty], [llvm_ptr_ty, llvm_v4i64_ty],
   1898                   [IntrReadMem, IntrArgMemOnly]>;
   1899 }
   1900 
   1901 // Conditional store ops
   1902 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1903   def int_x86_avx2_maskstore_d : GCCBuiltin<"__builtin_ia32_maskstored">,
   1904         Intrinsic<[], [llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i32_ty],
   1905                   [IntrArgMemOnly]>;
   1906   def int_x86_avx2_maskstore_q : GCCBuiltin<"__builtin_ia32_maskstoreq">,
   1907         Intrinsic<[], [llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty],
   1908                   [IntrArgMemOnly]>;
   1909   def int_x86_avx2_maskstore_d_256 :
   1910         GCCBuiltin<"__builtin_ia32_maskstored256">,
   1911         Intrinsic<[], [llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i32_ty],
   1912                   [IntrArgMemOnly]>;
   1913   def int_x86_avx2_maskstore_q_256 :
   1914         GCCBuiltin<"__builtin_ia32_maskstoreq256">,
   1915         Intrinsic<[], [llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i64_ty],
   1916                   [IntrArgMemOnly]>;
   1917 }
   1918 
   1919 // Variable bit shift ops
   1920 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   1921   def int_x86_avx2_psllv_d : GCCBuiltin<"__builtin_ia32_psllv4si">,
   1922               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
   1923                         [IntrNoMem]>;
   1924   def int_x86_avx2_psllv_d_256 : GCCBuiltin<"__builtin_ia32_psllv8si">,
   1925               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
   1926                         [IntrNoMem]>;
   1927   def int_x86_avx2_psllv_q : GCCBuiltin<"__builtin_ia32_psllv2di">,
   1928               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
   1929                         [IntrNoMem]>;
   1930   def int_x86_avx2_psllv_q_256 : GCCBuiltin<"__builtin_ia32_psllv4di">,
   1931               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
   1932                         [IntrNoMem]>;
   1933 
   1934   def int_x86_avx512_psllv_d_512 : GCCBuiltin<"__builtin_ia32_psllv16si">,
   1935               Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
   1936                         [IntrNoMem]>;
   1937   def int_x86_avx512_psllv_q_512 : GCCBuiltin<"__builtin_ia32_psllv8di">,
   1938               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
   1939                         [IntrNoMem]>;
   1940 
   1941   def int_x86_avx2_psrlv_d : GCCBuiltin<"__builtin_ia32_psrlv4si">,
   1942               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
   1943                         [IntrNoMem]>;
   1944   def int_x86_avx2_psrlv_d_256 : GCCBuiltin<"__builtin_ia32_psrlv8si">,
   1945               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
   1946                         [IntrNoMem]>;
   1947   def int_x86_avx2_psrlv_q : GCCBuiltin<"__builtin_ia32_psrlv2di">,
   1948               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
   1949                         [IntrNoMem]>;
   1950   def int_x86_avx2_psrlv_q_256 : GCCBuiltin<"__builtin_ia32_psrlv4di">,
   1951               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
   1952                         [IntrNoMem]>;
   1953 
   1954   def int_x86_avx512_psrlv_d_512 : GCCBuiltin<"__builtin_ia32_psrlv16si">,
   1955               Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
   1956                         [IntrNoMem]>;
   1957   def int_x86_avx512_psrlv_q_512 : GCCBuiltin<"__builtin_ia32_psrlv8di">,
   1958               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
   1959                         [IntrNoMem]>;
   1960 
   1961   def int_x86_avx2_psrav_d : GCCBuiltin<"__builtin_ia32_psrav4si">,
   1962               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
   1963                         [IntrNoMem]>;
   1964   def int_x86_avx2_psrav_d_256 : GCCBuiltin<"__builtin_ia32_psrav8si">,
   1965               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty],
   1966                         [IntrNoMem]>;
   1967 
   1968   def int_x86_avx512_psrav_d_512 : GCCBuiltin<"__builtin_ia32_psrav16si">,
   1969               Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
   1970                         [IntrNoMem]>;
   1971   def int_x86_avx512_psrav_q_128 : GCCBuiltin<"__builtin_ia32_psravq128">,
   1972               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
   1973                         [IntrNoMem]>;
   1974   def int_x86_avx512_psrav_q_256 : GCCBuiltin<"__builtin_ia32_psravq256">,
   1975               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty],
   1976                         [IntrNoMem]>;
   1977   def int_x86_avx512_psrav_q_512 : GCCBuiltin<"__builtin_ia32_psrav8di">,
   1978               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty],
   1979                         [IntrNoMem]>;
   1980 
   1981   def int_x86_avx512_psllv_w_128 : GCCBuiltin<"__builtin_ia32_psllv8hi">,
   1982               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
   1983                         [IntrNoMem]>;
   1984   def int_x86_avx512_psllv_w_256 : GCCBuiltin<"__builtin_ia32_psllv16hi">,
   1985               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty],
   1986                         [IntrNoMem]>;
   1987   def int_x86_avx512_psllv_w_512 : GCCBuiltin<"__builtin_ia32_psllv32hi">,
   1988               Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
   1989                         [IntrNoMem]>;
   1990 
   1991   def int_x86_avx512_psrlv_w_128 : GCCBuiltin<"__builtin_ia32_psrlv8hi">,
   1992               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
   1993                         [IntrNoMem]>;
   1994   def int_x86_avx512_psrlv_w_256 : GCCBuiltin<"__builtin_ia32_psrlv16hi">,
   1995               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty],
   1996                         [IntrNoMem]>;
   1997   def int_x86_avx512_psrlv_w_512 : GCCBuiltin<"__builtin_ia32_psrlv32hi">,
   1998               Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
   1999                         [IntrNoMem]>;
   2000 
   2001   def int_x86_avx512_psrav_w_128 : GCCBuiltin<"__builtin_ia32_psrav8hi">,
   2002               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
   2003                         [IntrNoMem]>;
   2004   def int_x86_avx512_psrav_w_256 : GCCBuiltin<"__builtin_ia32_psrav16hi">,
   2005               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty],
   2006                         [IntrNoMem]>;
   2007   def int_x86_avx512_psrav_w_512 : GCCBuiltin<"__builtin_ia32_psrav32hi">,
   2008               Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty],
   2009                         [IntrNoMem]>;
   2010 
   2011   def int_x86_avx512_mask_prorv_d_128 : GCCBuiltin<"__builtin_ia32_prorvd128_mask">,
   2012               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
   2013                          llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty], [IntrNoMem]>;
   2014   def int_x86_avx512_mask_prorv_d_256 : GCCBuiltin<"__builtin_ia32_prorvd256_mask">,
   2015               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
   2016                          llvm_v8i32_ty, llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>;
   2017   def int_x86_avx512_mask_prorv_d_512 : GCCBuiltin<"__builtin_ia32_prorvd512_mask">,
   2018               Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
   2019                          llvm_v16i32_ty, llvm_v16i32_ty, llvm_i16_ty], [IntrNoMem]>;
   2020   def int_x86_avx512_mask_prorv_q_128 : GCCBuiltin<"__builtin_ia32_prorvq128_mask">,
   2021               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
   2022                          llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2023   def int_x86_avx512_mask_prorv_q_256 : GCCBuiltin<"__builtin_ia32_prorvq256_mask">,
   2024               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
   2025                          llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2026   def int_x86_avx512_mask_prorv_q_512 : GCCBuiltin<"__builtin_ia32_prorvq512_mask">,
   2027               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
   2028                          llvm_v8i64_ty, llvm_v8i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2029 
   2030    def int_x86_avx512_mask_prol_d_128 : GCCBuiltin<"__builtin_ia32_prold128_mask">,
   2031               Intrinsic<[llvm_v4i32_ty] , [llvm_v4i32_ty,
   2032                          llvm_i32_ty, llvm_v4i32_ty, llvm_i8_ty], [IntrNoMem]>;
   2033   def int_x86_avx512_mask_prol_d_256 : GCCBuiltin<"__builtin_ia32_prold256_mask">,
   2034               Intrinsic<[llvm_v8i32_ty] , [llvm_v8i32_ty,
   2035                          llvm_i32_ty, llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>;
   2036   def int_x86_avx512_mask_prol_d_512 : GCCBuiltin<"__builtin_ia32_prold512_mask">,
   2037               Intrinsic<[llvm_v16i32_ty] , [llvm_v16i32_ty,
   2038                          llvm_i32_ty, llvm_v16i32_ty, llvm_i16_ty], [IntrNoMem]>;
   2039   def int_x86_avx512_mask_prol_q_128 : GCCBuiltin<"__builtin_ia32_prolq128_mask">,
   2040               Intrinsic<[llvm_v2i64_ty] , [llvm_v2i64_ty,
   2041                          llvm_i32_ty, llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2042   def int_x86_avx512_mask_prol_q_256 : GCCBuiltin<"__builtin_ia32_prolq256_mask">,
   2043               Intrinsic<[llvm_v4i64_ty] , [llvm_v4i64_ty,
   2044                          llvm_i32_ty, llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2045   def int_x86_avx512_mask_prol_q_512 : GCCBuiltin<"__builtin_ia32_prolq512_mask">,
   2046               Intrinsic<[llvm_v8i64_ty] , [llvm_v8i64_ty,
   2047                          llvm_i32_ty, llvm_v8i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2048 
   2049 
   2050   def int_x86_avx512_mask_prolv_d_128 : GCCBuiltin<"__builtin_ia32_prolvd128_mask">,
   2051               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
   2052                          llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty], [IntrNoMem]>;
   2053   def int_x86_avx512_mask_prolv_d_256 : GCCBuiltin<"__builtin_ia32_prolvd256_mask">,
   2054               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
   2055                          llvm_v8i32_ty, llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>;
   2056   def int_x86_avx512_mask_prolv_d_512 : GCCBuiltin<"__builtin_ia32_prolvd512_mask">,
   2057               Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
   2058                          llvm_v16i32_ty, llvm_v16i32_ty, llvm_i16_ty], [IntrNoMem]>;
   2059   def int_x86_avx512_mask_prolv_q_128 : GCCBuiltin<"__builtin_ia32_prolvq128_mask">,
   2060               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
   2061                          llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2062   def int_x86_avx512_mask_prolv_q_256 : GCCBuiltin<"__builtin_ia32_prolvq256_mask">,
   2063               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
   2064                          llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2065   def int_x86_avx512_mask_prolv_q_512 : GCCBuiltin<"__builtin_ia32_prolvq512_mask">,
   2066               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
   2067                          llvm_v8i64_ty, llvm_v8i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2068   def int_x86_avx512_mask_pror_d_128 : GCCBuiltin<"__builtin_ia32_prord128_mask">,
   2069               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty,
   2070                          llvm_i32_ty, llvm_v4i32_ty, llvm_i8_ty], [IntrNoMem]>;
   2071   def int_x86_avx512_mask_pror_d_256 : GCCBuiltin<"__builtin_ia32_prord256_mask">,
   2072               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
   2073                          llvm_i32_ty, llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>;
   2074   def int_x86_avx512_mask_pror_d_512 : GCCBuiltin<"__builtin_ia32_prord512_mask">,
   2075               Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
   2076                          llvm_i32_ty, llvm_v16i32_ty, llvm_i16_ty], [IntrNoMem]>;
   2077   def int_x86_avx512_mask_pror_q_128 : GCCBuiltin<"__builtin_ia32_prorq128_mask">,
   2078               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty,
   2079                          llvm_i32_ty, llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2080   def int_x86_avx512_mask_pror_q_256 : GCCBuiltin<"__builtin_ia32_prorq256_mask">,
   2081               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
   2082                          llvm_i32_ty, llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2083   def int_x86_avx512_mask_pror_q_512 : GCCBuiltin<"__builtin_ia32_prorq512_mask">,
   2084               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
   2085                          llvm_i32_ty, llvm_v8i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2086 
   2087 }
   2088 
   2089 // Gather ops
   2090 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   2091   def int_x86_avx2_gather_d_pd : GCCBuiltin<"__builtin_ia32_gatherd_pd">,
   2092       Intrinsic<[llvm_v2f64_ty],
   2093         [llvm_v2f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2f64_ty, llvm_i8_ty],
   2094         [IntrReadMem, IntrArgMemOnly]>;
   2095   def int_x86_avx2_gather_d_pd_256 : GCCBuiltin<"__builtin_ia32_gatherd_pd256">,
   2096       Intrinsic<[llvm_v4f64_ty],
   2097         [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4f64_ty, llvm_i8_ty],
   2098         [IntrReadMem, IntrArgMemOnly]>;
   2099   def int_x86_avx2_gather_q_pd : GCCBuiltin<"__builtin_ia32_gatherq_pd">,
   2100       Intrinsic<[llvm_v2f64_ty],
   2101         [llvm_v2f64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i8_ty],
   2102         [IntrReadMem, IntrArgMemOnly]>;
   2103   def int_x86_avx2_gather_q_pd_256 : GCCBuiltin<"__builtin_ia32_gatherq_pd256">,
   2104       Intrinsic<[llvm_v4f64_ty],
   2105         [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i8_ty],
   2106         [IntrReadMem, IntrArgMemOnly]>;
   2107   def int_x86_avx2_gather_d_ps : GCCBuiltin<"__builtin_ia32_gatherd_ps">,
   2108       Intrinsic<[llvm_v4f32_ty],
   2109         [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i8_ty],
   2110         [IntrReadMem, IntrArgMemOnly]>;
   2111   def int_x86_avx2_gather_d_ps_256 : GCCBuiltin<"__builtin_ia32_gatherd_ps256">,
   2112       Intrinsic<[llvm_v8f32_ty],
   2113         [llvm_v8f32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i8_ty],
   2114         [IntrReadMem, IntrArgMemOnly]>;
   2115   def int_x86_avx2_gather_q_ps : GCCBuiltin<"__builtin_ia32_gatherq_ps">,
   2116       Intrinsic<[llvm_v4f32_ty],
   2117         [llvm_v4f32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v4f32_ty, llvm_i8_ty],
   2118         [IntrReadMem, IntrArgMemOnly]>;
   2119   def int_x86_avx2_gather_q_ps_256 : GCCBuiltin<"__builtin_ia32_gatherq_ps256">,
   2120       Intrinsic<[llvm_v4f32_ty],
   2121         [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4f32_ty, llvm_i8_ty],
   2122         [IntrReadMem, IntrArgMemOnly]>;
   2123 
   2124   def int_x86_avx2_gather_d_q : GCCBuiltin<"__builtin_ia32_gatherd_q">,
   2125       Intrinsic<[llvm_v2i64_ty],
   2126         [llvm_v2i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2i64_ty, llvm_i8_ty],
   2127         [IntrReadMem, IntrArgMemOnly]>;
   2128   def int_x86_avx2_gather_d_q_256 : GCCBuiltin<"__builtin_ia32_gatherd_q256">,
   2129       Intrinsic<[llvm_v4i64_ty],
   2130         [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i64_ty, llvm_i8_ty],
   2131         [IntrReadMem, IntrArgMemOnly]>;
   2132   def int_x86_avx2_gather_q_q : GCCBuiltin<"__builtin_ia32_gatherq_q">,
   2133       Intrinsic<[llvm_v2i64_ty],
   2134         [llvm_v2i64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty],
   2135         [IntrReadMem, IntrArgMemOnly]>;
   2136   def int_x86_avx2_gather_q_q_256 : GCCBuiltin<"__builtin_ia32_gatherq_q256">,
   2137       Intrinsic<[llvm_v4i64_ty],
   2138         [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty],
   2139         [IntrReadMem, IntrArgMemOnly]>;
   2140   def int_x86_avx2_gather_d_d : GCCBuiltin<"__builtin_ia32_gatherd_d">,
   2141       Intrinsic<[llvm_v4i32_ty],
   2142         [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty],
   2143         [IntrReadMem, IntrArgMemOnly]>;
   2144   def int_x86_avx2_gather_d_d_256 : GCCBuiltin<"__builtin_ia32_gatherd_d256">,
   2145       Intrinsic<[llvm_v8i32_ty],
   2146         [llvm_v8i32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i8_ty],
   2147         [IntrReadMem, IntrArgMemOnly]>;
   2148   def int_x86_avx2_gather_q_d : GCCBuiltin<"__builtin_ia32_gatherq_d">,
   2149       Intrinsic<[llvm_v4i32_ty],
   2150         [llvm_v4i32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
   2151         [IntrReadMem, IntrArgMemOnly]>;
   2152   def int_x86_avx2_gather_q_d_256 : GCCBuiltin<"__builtin_ia32_gatherq_d256">,
   2153       Intrinsic<[llvm_v4i32_ty],
   2154         [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i32_ty, llvm_i8_ty],
   2155         [IntrReadMem, IntrArgMemOnly]>;
   2156 }
   2157 
   2158 // Misc.
   2159 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   2160   def int_x86_avx2_pmovmskb : GCCBuiltin<"__builtin_ia32_pmovmskb256">,
   2161               Intrinsic<[llvm_i32_ty], [llvm_v32i8_ty], [IntrNoMem]>;
   2162   def int_x86_avx2_pshuf_b : GCCBuiltin<"__builtin_ia32_pshufb256">,
   2163               Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
   2164                          llvm_v32i8_ty], [IntrNoMem]>;
   2165   def int_x86_avx2_mpsadbw : GCCBuiltin<"__builtin_ia32_mpsadbw256">,
   2166               Intrinsic<[llvm_v16i16_ty], [llvm_v32i8_ty, llvm_v32i8_ty,
   2167                          llvm_i8_ty], [IntrNoMem, Commutative]>;
   2168 }
   2169 
   2170 //===----------------------------------------------------------------------===//
   2171 // FMA3 and FMA4
   2172 
   2173 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   2174   def int_x86_fma_vfmadd_ss : GCCBuiltin<"__builtin_ia32_vfmaddss">,
   2175               Intrinsic<[llvm_v4f32_ty],
   2176                         [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
   2177                         [IntrNoMem]>;
   2178   def int_x86_fma_vfmadd_sd : GCCBuiltin<"__builtin_ia32_vfmaddsd">,
   2179               Intrinsic<[llvm_v2f64_ty],
   2180                         [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
   2181                         [IntrNoMem]>;
   2182   def int_x86_fma_vfmadd_ps : GCCBuiltin<"__builtin_ia32_vfmaddps">,
   2183               Intrinsic<[llvm_v4f32_ty],
   2184                         [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
   2185                         [IntrNoMem]>;
   2186   def int_x86_fma_vfmadd_pd : GCCBuiltin<"__builtin_ia32_vfmaddpd">,
   2187               Intrinsic<[llvm_v2f64_ty],
   2188                         [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
   2189                         [IntrNoMem]>;
   2190   def int_x86_fma_vfmadd_ps_256 : GCCBuiltin<"__builtin_ia32_vfmaddps256">,
   2191               Intrinsic<[llvm_v8f32_ty],
   2192                         [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty],
   2193                         [IntrNoMem]>;
   2194   def int_x86_fma_vfmadd_pd_256 : GCCBuiltin<"__builtin_ia32_vfmaddpd256">,
   2195               Intrinsic<[llvm_v4f64_ty],
   2196                         [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty],
   2197                         [IntrNoMem]>;
   2198 
   2199   def int_x86_fma_vfmsub_ss : GCCBuiltin<"__builtin_ia32_vfmsubss">,
   2200               Intrinsic<[llvm_v4f32_ty],
   2201                         [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
   2202                         [IntrNoMem]>;
   2203   def int_x86_fma_vfmsub_sd : GCCBuiltin<"__builtin_ia32_vfmsubsd">,
   2204               Intrinsic<[llvm_v2f64_ty],
   2205                         [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
   2206                         [IntrNoMem]>;
   2207   def int_x86_fma_vfmsub_ps : GCCBuiltin<"__builtin_ia32_vfmsubps">,
   2208               Intrinsic<[llvm_v4f32_ty],
   2209                         [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
   2210                         [IntrNoMem]>;
   2211   def int_x86_fma_vfmsub_pd : GCCBuiltin<"__builtin_ia32_vfmsubpd">,
   2212               Intrinsic<[llvm_v2f64_ty],
   2213                         [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
   2214                         [IntrNoMem]>;
   2215   def int_x86_fma_vfmsub_ps_256 : GCCBuiltin<"__builtin_ia32_vfmsubps256">,
   2216               Intrinsic<[llvm_v8f32_ty],
   2217                         [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty],
   2218                         [IntrNoMem]>;
   2219   def int_x86_fma_vfmsub_pd_256 : GCCBuiltin<"__builtin_ia32_vfmsubpd256">,
   2220               Intrinsic<[llvm_v4f64_ty],
   2221                         [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty],
   2222                         [IntrNoMem]>;
   2223   def int_x86_fma_vfnmadd_ss : GCCBuiltin<"__builtin_ia32_vfnmaddss">,
   2224               Intrinsic<[llvm_v4f32_ty],
   2225                         [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
   2226                         [IntrNoMem]>;
   2227   def int_x86_fma_vfnmadd_sd : GCCBuiltin<"__builtin_ia32_vfnmaddsd">,
   2228               Intrinsic<[llvm_v2f64_ty],
   2229                         [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
   2230                         [IntrNoMem]>;
   2231   def int_x86_fma_vfnmadd_ps : GCCBuiltin<"__builtin_ia32_vfnmaddps">,
   2232               Intrinsic<[llvm_v4f32_ty],
   2233                         [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
   2234                         [IntrNoMem]>;
   2235   def int_x86_fma_vfnmadd_pd : GCCBuiltin<"__builtin_ia32_vfnmaddpd">,
   2236               Intrinsic<[llvm_v2f64_ty],
   2237                         [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
   2238                         [IntrNoMem]>;
   2239   def int_x86_fma_vfnmadd_ps_256 : GCCBuiltin<"__builtin_ia32_vfnmaddps256">,
   2240               Intrinsic<[llvm_v8f32_ty],
   2241                         [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty],
   2242                         [IntrNoMem]>;
   2243   def int_x86_fma_vfnmadd_pd_256 : GCCBuiltin<"__builtin_ia32_vfnmaddpd256">,
   2244               Intrinsic<[llvm_v4f64_ty],
   2245                         [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty],
   2246                         [IntrNoMem]>;
   2247   def int_x86_fma_vfnmsub_ss : GCCBuiltin<"__builtin_ia32_vfnmsubss">,
   2248               Intrinsic<[llvm_v4f32_ty],
   2249                         [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
   2250                         [IntrNoMem]>;
   2251   def int_x86_fma_vfnmsub_sd : GCCBuiltin<"__builtin_ia32_vfnmsubsd">,
   2252               Intrinsic<[llvm_v2f64_ty],
   2253                         [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
   2254                         [IntrNoMem]>;
   2255   def int_x86_fma_vfnmsub_ps : GCCBuiltin<"__builtin_ia32_vfnmsubps">,
   2256               Intrinsic<[llvm_v4f32_ty],
   2257                         [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
   2258                         [IntrNoMem]>;
   2259   def int_x86_fma_vfnmsub_pd : GCCBuiltin<"__builtin_ia32_vfnmsubpd">,
   2260               Intrinsic<[llvm_v2f64_ty],
   2261                         [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
   2262                         [IntrNoMem]>;
   2263   def int_x86_fma_vfnmsub_ps_256 : GCCBuiltin<"__builtin_ia32_vfnmsubps256">,
   2264               Intrinsic<[llvm_v8f32_ty],
   2265                         [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty],
   2266                         [IntrNoMem]>;
   2267   def int_x86_fma_vfnmsub_pd_256 : GCCBuiltin<"__builtin_ia32_vfnmsubpd256">,
   2268               Intrinsic<[llvm_v4f64_ty],
   2269                         [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty],
   2270                         [IntrNoMem]>;
   2271   def int_x86_fma_vfmaddsub_ps : GCCBuiltin<"__builtin_ia32_vfmaddsubps">,
   2272               Intrinsic<[llvm_v4f32_ty],
   2273                         [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
   2274                         [IntrNoMem]>;
   2275   def int_x86_fma_vfmaddsub_pd : GCCBuiltin<"__builtin_ia32_vfmaddsubpd">,
   2276               Intrinsic<[llvm_v2f64_ty],
   2277                         [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
   2278                         [IntrNoMem]>;
   2279   def int_x86_fma_vfmaddsub_ps_256 :
   2280                GCCBuiltin<"__builtin_ia32_vfmaddsubps256">,
   2281               Intrinsic<[llvm_v8f32_ty],
   2282                         [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty],
   2283                         [IntrNoMem]>;
   2284   def int_x86_fma_vfmaddsub_pd_256 :
   2285               GCCBuiltin<"__builtin_ia32_vfmaddsubpd256">,
   2286               Intrinsic<[llvm_v4f64_ty],
   2287                         [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty],
   2288                         [IntrNoMem]>;
   2289   def int_x86_fma_vfmsubadd_ps : GCCBuiltin<"__builtin_ia32_vfmsubaddps">,
   2290               Intrinsic<[llvm_v4f32_ty],
   2291                         [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
   2292                         [IntrNoMem]>;
   2293   def int_x86_fma_vfmsubadd_pd : GCCBuiltin<"__builtin_ia32_vfmsubaddpd">,
   2294               Intrinsic<[llvm_v2f64_ty],
   2295                         [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
   2296                         [IntrNoMem]>;
   2297   def int_x86_fma_vfmsubadd_ps_256 :
   2298               GCCBuiltin<"__builtin_ia32_vfmsubaddps256">,
   2299               Intrinsic<[llvm_v8f32_ty],
   2300                         [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty],
   2301                         [IntrNoMem]>;
   2302   def int_x86_fma_vfmsubadd_pd_256 :
   2303               GCCBuiltin<"__builtin_ia32_vfmsubaddpd256">,
   2304               Intrinsic<[llvm_v4f64_ty],
   2305                         [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty],
   2306                         [IntrNoMem]>;
   2307 
   2308   def int_x86_avx512_mask_vfmadd_pd_128 :
   2309          GCCBuiltin<"__builtin_ia32_vfmaddpd128_mask">,
   2310           Intrinsic<[llvm_v2f64_ty],
   2311           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,  llvm_i8_ty],
   2312           [IntrNoMem]>;
   2313 
   2314   def int_x86_avx512_mask3_vfmadd_pd_128 :
   2315          GCCBuiltin<"__builtin_ia32_vfmaddpd128_mask3">,
   2316           Intrinsic<[llvm_v2f64_ty],
   2317           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,  llvm_i8_ty],
   2318           [IntrNoMem]>;
   2319 
   2320   def int_x86_avx512_maskz_vfmadd_pd_128 :
   2321          GCCBuiltin<"__builtin_ia32_vfmaddpd128_maskz">,
   2322           Intrinsic<[llvm_v2f64_ty],
   2323           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,  llvm_i8_ty],
   2324           [IntrNoMem]>;
   2325 
   2326   def int_x86_avx512_mask_vfmadd_pd_256 :
   2327          GCCBuiltin<"__builtin_ia32_vfmaddpd256_mask">,
   2328           Intrinsic<[llvm_v4f64_ty],
   2329           [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty,  llvm_i8_ty],
   2330           [IntrNoMem]>;
   2331 
   2332   def int_x86_avx512_mask3_vfmadd_pd_256 :
   2333          GCCBuiltin<"__builtin_ia32_vfmaddpd256_mask3">,
   2334           Intrinsic<[llvm_v4f64_ty],
   2335           [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty,  llvm_i8_ty],
   2336           [IntrNoMem]>;
   2337 
   2338   def int_x86_avx512_maskz_vfmadd_pd_256 :
   2339          GCCBuiltin<"__builtin_ia32_vfmaddpd256_maskz">,
   2340           Intrinsic<[llvm_v4f64_ty],
   2341           [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty,  llvm_i8_ty],
   2342           [IntrNoMem]>;
   2343 
   2344   def int_x86_avx512_mask_vfmadd_pd_512 :
   2345          GCCBuiltin<"__builtin_ia32_vfmaddpd512_mask">,
   2346           Intrinsic<[llvm_v8f64_ty],
   2347           [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty,  llvm_i8_ty,
   2348           llvm_i32_ty], [IntrNoMem]>;
   2349 
   2350   def int_x86_avx512_mask3_vfmadd_pd_512 :
   2351          GCCBuiltin<"__builtin_ia32_vfmaddpd512_mask3">,
   2352           Intrinsic<[llvm_v8f64_ty],
   2353           [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty,  llvm_i8_ty,
   2354           llvm_i32_ty], [IntrNoMem]>;
   2355 
   2356   def int_x86_avx512_maskz_vfmadd_pd_512 :
   2357          GCCBuiltin<"__builtin_ia32_vfmaddpd512_maskz">,
   2358           Intrinsic<[llvm_v8f64_ty],
   2359           [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty,  llvm_i8_ty,
   2360           llvm_i32_ty], [IntrNoMem]>;
   2361 
   2362   def int_x86_avx512_mask_vfmadd_ps_128 :
   2363          GCCBuiltin<"__builtin_ia32_vfmaddps128_mask">,
   2364           Intrinsic<[llvm_v4f32_ty],
   2365           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  llvm_i8_ty],
   2366           [IntrNoMem]>;
   2367 
   2368   def int_x86_avx512_mask3_vfmadd_ps_128 :
   2369          GCCBuiltin<"__builtin_ia32_vfmaddps128_mask3">,
   2370           Intrinsic<[llvm_v4f32_ty],
   2371           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  llvm_i8_ty],
   2372           [IntrNoMem]>;
   2373 
   2374   def int_x86_avx512_maskz_vfmadd_ps_128 :
   2375          GCCBuiltin<"__builtin_ia32_vfmaddps128_maskz">,
   2376           Intrinsic<[llvm_v4f32_ty],
   2377           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  llvm_i8_ty],
   2378           [IntrNoMem]>;
   2379 
   2380   def int_x86_avx512_mask_vfmadd_ps_256 :
   2381          GCCBuiltin<"__builtin_ia32_vfmaddps256_mask">,
   2382           Intrinsic<[llvm_v8f32_ty],
   2383           [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,  llvm_i8_ty],
   2384           [IntrNoMem]>;
   2385 
   2386   def int_x86_avx512_mask3_vfmadd_ps_256 :
   2387          GCCBuiltin<"__builtin_ia32_vfmaddps256_mask3">,
   2388           Intrinsic<[llvm_v8f32_ty],
   2389           [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,  llvm_i8_ty],
   2390           [IntrNoMem]>;
   2391 
   2392   def int_x86_avx512_maskz_vfmadd_ps_256 :
   2393          GCCBuiltin<"__builtin_ia32_vfmaddps256_maskz">,
   2394           Intrinsic<[llvm_v8f32_ty],
   2395           [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,  llvm_i8_ty],
   2396           [IntrNoMem]>;
   2397 
   2398   def int_x86_avx512_mask_vfmadd_ps_512 :
   2399          GCCBuiltin<"__builtin_ia32_vfmaddps512_mask">,
   2400           Intrinsic<[llvm_v16f32_ty],
   2401           [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,  llvm_i16_ty,
   2402           llvm_i32_ty], [IntrNoMem]>;
   2403 
   2404   def int_x86_avx512_mask3_vfmadd_ps_512 :
   2405          GCCBuiltin<"__builtin_ia32_vfmaddps512_mask3">,
   2406           Intrinsic<[llvm_v16f32_ty],
   2407           [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,  llvm_i16_ty,
   2408           llvm_i32_ty], [IntrNoMem]>;
   2409 
   2410   def int_x86_avx512_maskz_vfmadd_ps_512 :
   2411          GCCBuiltin<"__builtin_ia32_vfmaddps512_maskz">,
   2412           Intrinsic<[llvm_v16f32_ty],
   2413           [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,  llvm_i16_ty,
   2414           llvm_i32_ty], [IntrNoMem]>;
   2415 
   2416   def int_x86_avx512_mask_vfmaddsub_pd_128 :
   2417          GCCBuiltin<"__builtin_ia32_vfmaddsubpd128_mask">,
   2418           Intrinsic<[llvm_v2f64_ty],
   2419           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,  llvm_i8_ty],
   2420           [IntrNoMem]>;
   2421 
   2422   def int_x86_avx512_mask3_vfmaddsub_pd_128 :
   2423          GCCBuiltin<"__builtin_ia32_vfmaddsubpd128_mask3">,
   2424           Intrinsic<[llvm_v2f64_ty],
   2425           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,  llvm_i8_ty],
   2426           [IntrNoMem]>;
   2427 
   2428   def int_x86_avx512_maskz_vfmaddsub_pd_128 :
   2429          GCCBuiltin<"__builtin_ia32_vfmaddsubpd128_maskz">,
   2430           Intrinsic<[llvm_v2f64_ty],
   2431           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,  llvm_i8_ty],
   2432           [IntrNoMem]>;
   2433 
   2434   def int_x86_avx512_mask_vfmaddsub_pd_256 :
   2435          GCCBuiltin<"__builtin_ia32_vfmaddsubpd256_mask">,
   2436           Intrinsic<[llvm_v4f64_ty],
   2437           [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty,  llvm_i8_ty],
   2438           [IntrNoMem]>;
   2439 
   2440   def int_x86_avx512_mask3_vfmaddsub_pd_256 :
   2441          GCCBuiltin<"__builtin_ia32_vfmaddsubpd256_mask3">,
   2442           Intrinsic<[llvm_v4f64_ty],
   2443           [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty,  llvm_i8_ty],
   2444           [IntrNoMem]>;
   2445 
   2446   def int_x86_avx512_maskz_vfmaddsub_pd_256 :
   2447          GCCBuiltin<"__builtin_ia32_vfmaddsubpd256_maskz">,
   2448           Intrinsic<[llvm_v4f64_ty],
   2449           [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty,  llvm_i8_ty],
   2450           [IntrNoMem]>;
   2451 
   2452   def int_x86_avx512_mask_vfmaddsub_pd_512 :
   2453          GCCBuiltin<"__builtin_ia32_vfmaddsubpd512_mask">,
   2454           Intrinsic<[llvm_v8f64_ty],
   2455           [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty,  llvm_i8_ty,
   2456           llvm_i32_ty], [IntrNoMem]>;
   2457 
   2458   def int_x86_avx512_mask3_vfmaddsub_pd_512 :
   2459          GCCBuiltin<"__builtin_ia32_vfmaddsubpd512_mask3">,
   2460           Intrinsic<[llvm_v8f64_ty],
   2461           [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty,  llvm_i8_ty,
   2462           llvm_i32_ty], [IntrNoMem]>;
   2463 
   2464   def int_x86_avx512_maskz_vfmaddsub_pd_512 :
   2465          GCCBuiltin<"__builtin_ia32_vfmaddsubpd512_maskz">,
   2466           Intrinsic<[llvm_v8f64_ty],
   2467           [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty,  llvm_i8_ty,
   2468           llvm_i32_ty], [IntrNoMem]>;
   2469 
   2470   def int_x86_avx512_mask_vfmaddsub_ps_128 :
   2471          GCCBuiltin<"__builtin_ia32_vfmaddsubps128_mask">,
   2472           Intrinsic<[llvm_v4f32_ty],
   2473           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  llvm_i8_ty],
   2474           [IntrNoMem]>;
   2475 
   2476   def int_x86_avx512_mask3_vfmaddsub_ps_128 :
   2477          GCCBuiltin<"__builtin_ia32_vfmaddsubps128_mask3">,
   2478           Intrinsic<[llvm_v4f32_ty],
   2479           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  llvm_i8_ty],
   2480           [IntrNoMem]>;
   2481 
   2482   def int_x86_avx512_maskz_vfmaddsub_ps_128 :
   2483          GCCBuiltin<"__builtin_ia32_vfmaddsubps128_maskz">,
   2484           Intrinsic<[llvm_v4f32_ty],
   2485           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  llvm_i8_ty],
   2486           [IntrNoMem]>;
   2487 
   2488   def int_x86_avx512_mask_vfmaddsub_ps_256 :
   2489          GCCBuiltin<"__builtin_ia32_vfmaddsubps256_mask">,
   2490           Intrinsic<[llvm_v8f32_ty],
   2491           [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,  llvm_i8_ty],
   2492           [IntrNoMem]>;
   2493 
   2494   def int_x86_avx512_mask3_vfmaddsub_ps_256 :
   2495          GCCBuiltin<"__builtin_ia32_vfmaddsubps256_mask3">,
   2496           Intrinsic<[llvm_v8f32_ty],
   2497           [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,  llvm_i8_ty],
   2498           [IntrNoMem]>;
   2499 
   2500   def int_x86_avx512_maskz_vfmaddsub_ps_256 :
   2501          GCCBuiltin<"__builtin_ia32_vfmaddsubps256_maskz">,
   2502           Intrinsic<[llvm_v8f32_ty],
   2503           [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,  llvm_i8_ty],
   2504           [IntrNoMem]>;
   2505 
   2506   def int_x86_avx512_mask_vfmaddsub_ps_512 :
   2507          GCCBuiltin<"__builtin_ia32_vfmaddsubps512_mask">,
   2508           Intrinsic<[llvm_v16f32_ty],
   2509           [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,  llvm_i16_ty,
   2510           llvm_i32_ty], [IntrNoMem]>;
   2511 
   2512   def int_x86_avx512_mask3_vfmaddsub_ps_512 :
   2513          GCCBuiltin<"__builtin_ia32_vfmaddsubps512_mask3">,
   2514           Intrinsic<[llvm_v16f32_ty],
   2515           [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,  llvm_i16_ty,
   2516           llvm_i32_ty], [IntrNoMem]>;
   2517 
   2518   def int_x86_avx512_maskz_vfmaddsub_ps_512 :
   2519          GCCBuiltin<"__builtin_ia32_vfmaddsubps512_maskz">,
   2520           Intrinsic<[llvm_v16f32_ty],
   2521           [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,  llvm_i16_ty,
   2522           llvm_i32_ty], [IntrNoMem]>;
   2523 
   2524 
   2525   def int_x86_avx512_mask_vfmadd_sd :
   2526          GCCBuiltin<"__builtin_ia32_vfmaddsd3_mask">,
   2527           Intrinsic<[llvm_v2f64_ty],
   2528           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,  llvm_i8_ty,
   2529           llvm_i32_ty], [IntrNoMem]>;
   2530 
   2531   def int_x86_avx512_mask_vfmadd_ss :
   2532          GCCBuiltin<"__builtin_ia32_vfmaddss3_mask">,
   2533           Intrinsic<[llvm_v4f32_ty],
   2534           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  llvm_i8_ty,
   2535           llvm_i32_ty], [IntrNoMem]>;
   2536 
   2537   def int_x86_avx512_maskz_vfmadd_sd :
   2538          GCCBuiltin<"__builtin_ia32_vfmaddsd3_maskz">,
   2539           Intrinsic<[llvm_v2f64_ty],
   2540           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,  llvm_i8_ty,
   2541           llvm_i32_ty], [IntrNoMem]>;
   2542 
   2543   def int_x86_avx512_maskz_vfmadd_ss :
   2544          GCCBuiltin<"__builtin_ia32_vfmaddss3_maskz">,
   2545           Intrinsic<[llvm_v4f32_ty],
   2546           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  llvm_i8_ty,
   2547           llvm_i32_ty], [IntrNoMem]>;
   2548 
   2549   def int_x86_avx512_mask3_vfmadd_sd :
   2550          GCCBuiltin<"__builtin_ia32_vfmaddsd3_mask3">,
   2551           Intrinsic<[llvm_v2f64_ty],
   2552           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,  llvm_i8_ty,
   2553           llvm_i32_ty], [IntrNoMem]>;
   2554 
   2555   def int_x86_avx512_mask3_vfmadd_ss :
   2556          GCCBuiltin<"__builtin_ia32_vfmaddss3_mask3">,
   2557           Intrinsic<[llvm_v4f32_ty],
   2558           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  llvm_i8_ty,
   2559           llvm_i32_ty], [IntrNoMem]>;
   2560 
   2561   def int_x86_avx512_mask3_vfmsub_sd :
   2562          GCCBuiltin<"__builtin_ia32_vfmsubsd3_mask3">,
   2563           Intrinsic<[llvm_v2f64_ty],
   2564           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,  llvm_i8_ty,
   2565           llvm_i32_ty], [IntrNoMem]>;
   2566 
   2567   def int_x86_avx512_mask3_vfmsub_ss :
   2568          GCCBuiltin<"__builtin_ia32_vfmsubss3_mask3">,
   2569           Intrinsic<[llvm_v4f32_ty],
   2570           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  llvm_i8_ty,
   2571           llvm_i32_ty], [IntrNoMem]>;
   2572 
   2573   def int_x86_avx512_mask3_vfmsub_pd_128 :
   2574          GCCBuiltin<"__builtin_ia32_vfmsubpd128_mask3">,
   2575           Intrinsic<[llvm_v2f64_ty],
   2576           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,  llvm_i8_ty],
   2577           [IntrNoMem]>;
   2578 
   2579   def int_x86_avx512_mask3_vfmsub_pd_256 :
   2580          GCCBuiltin<"__builtin_ia32_vfmsubpd256_mask3">,
   2581           Intrinsic<[llvm_v4f64_ty],
   2582           [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty,  llvm_i8_ty],
   2583           [IntrNoMem]>;
   2584 
   2585   def int_x86_avx512_mask3_vfmsub_pd_512 :
   2586          GCCBuiltin<"__builtin_ia32_vfmsubpd512_mask3">,
   2587           Intrinsic<[llvm_v8f64_ty],
   2588           [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty,  llvm_i8_ty,
   2589           llvm_i32_ty], [IntrNoMem]>;
   2590 
   2591   def int_x86_avx512_mask3_vfmsub_ps_128 :
   2592          GCCBuiltin<"__builtin_ia32_vfmsubps128_mask3">,
   2593           Intrinsic<[llvm_v4f32_ty],
   2594           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  llvm_i8_ty],
   2595           [IntrNoMem]>;
   2596 
   2597   def int_x86_avx512_mask3_vfmsub_ps_256 :
   2598          GCCBuiltin<"__builtin_ia32_vfmsubps256_mask3">,
   2599           Intrinsic<[llvm_v8f32_ty],
   2600           [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,  llvm_i8_ty],
   2601           [IntrNoMem]>;
   2602 
   2603   def int_x86_avx512_mask3_vfmsub_ps_512 :
   2604          GCCBuiltin<"__builtin_ia32_vfmsubps512_mask3">,
   2605           Intrinsic<[llvm_v16f32_ty],
   2606           [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,  llvm_i16_ty,
   2607           llvm_i32_ty], [IntrNoMem]>;
   2608 
   2609   def int_x86_avx512_mask3_vfmsubadd_pd_128 :
   2610          GCCBuiltin<"__builtin_ia32_vfmsubaddpd128_mask3">,
   2611           Intrinsic<[llvm_v2f64_ty],
   2612           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,  llvm_i8_ty],
   2613           [IntrNoMem]>;
   2614 
   2615   def int_x86_avx512_mask3_vfmsubadd_pd_256 :
   2616          GCCBuiltin<"__builtin_ia32_vfmsubaddpd256_mask3">,
   2617           Intrinsic<[llvm_v4f64_ty],
   2618           [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty,  llvm_i8_ty],
   2619           [IntrNoMem]>;
   2620 
   2621   def int_x86_avx512_mask3_vfmsubadd_pd_512 :
   2622          GCCBuiltin<"__builtin_ia32_vfmsubaddpd512_mask3">,
   2623           Intrinsic<[llvm_v8f64_ty],
   2624           [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty,  llvm_i8_ty,
   2625           llvm_i32_ty], [IntrNoMem]>;
   2626 
   2627   def int_x86_avx512_mask3_vfmsubadd_ps_128 :
   2628          GCCBuiltin<"__builtin_ia32_vfmsubaddps128_mask3">,
   2629           Intrinsic<[llvm_v4f32_ty],
   2630           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  llvm_i8_ty],
   2631           [IntrNoMem]>;
   2632 
   2633   def int_x86_avx512_mask3_vfmsubadd_ps_256 :
   2634          GCCBuiltin<"__builtin_ia32_vfmsubaddps256_mask3">,
   2635           Intrinsic<[llvm_v8f32_ty],
   2636           [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,  llvm_i8_ty],
   2637           [IntrNoMem]>;
   2638 
   2639   def int_x86_avx512_mask3_vfmsubadd_ps_512 :
   2640          GCCBuiltin<"__builtin_ia32_vfmsubaddps512_mask3">,
   2641           Intrinsic<[llvm_v16f32_ty],
   2642           [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,  llvm_i16_ty,
   2643           llvm_i32_ty], [IntrNoMem]>;
   2644 
   2645   def int_x86_avx512_mask_vfnmadd_pd_128 :
   2646          GCCBuiltin<"__builtin_ia32_vfnmaddpd128_mask">,
   2647           Intrinsic<[llvm_v2f64_ty],
   2648           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,  llvm_i8_ty],
   2649           [IntrNoMem]>;
   2650 
   2651   def int_x86_avx512_mask_vfnmadd_pd_256 :
   2652          GCCBuiltin<"__builtin_ia32_vfnmaddpd256_mask">,
   2653           Intrinsic<[llvm_v4f64_ty],
   2654           [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty,  llvm_i8_ty],
   2655           [IntrNoMem]>;
   2656 
   2657   def int_x86_avx512_mask_vfnmadd_pd_512 :
   2658          GCCBuiltin<"__builtin_ia32_vfnmaddpd512_mask">,
   2659           Intrinsic<[llvm_v8f64_ty],
   2660           [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty,  llvm_i8_ty,
   2661           llvm_i32_ty], [IntrNoMem]>;
   2662 
   2663   def int_x86_avx512_mask_vfnmadd_ps_128 :
   2664          GCCBuiltin<"__builtin_ia32_vfnmaddps128_mask">,
   2665           Intrinsic<[llvm_v4f32_ty],
   2666           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  llvm_i8_ty],
   2667           [IntrNoMem]>;
   2668 
   2669   def int_x86_avx512_mask_vfnmadd_ps_256 :
   2670          GCCBuiltin<"__builtin_ia32_vfnmaddps256_mask">,
   2671           Intrinsic<[llvm_v8f32_ty],
   2672           [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,  llvm_i8_ty],
   2673           [IntrNoMem]>;
   2674 
   2675   def int_x86_avx512_mask_vfnmadd_ps_512 :
   2676          GCCBuiltin<"__builtin_ia32_vfnmaddps512_mask">,
   2677           Intrinsic<[llvm_v16f32_ty],
   2678           [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,  llvm_i16_ty,
   2679           llvm_i32_ty], [IntrNoMem]>;
   2680 
   2681   def int_x86_avx512_mask3_vfnmsub_sd :
   2682          GCCBuiltin<"__builtin_ia32_vfnmsubsd3_mask3">,
   2683           Intrinsic<[llvm_v2f64_ty],
   2684           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,  llvm_i8_ty,
   2685           llvm_i32_ty], [IntrNoMem]>;
   2686 
   2687   def int_x86_avx512_mask3_vfnmsub_ss :
   2688          GCCBuiltin<"__builtin_ia32_vfnmsubss3_mask3">,
   2689           Intrinsic<[llvm_v4f32_ty],
   2690           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  llvm_i8_ty,
   2691           llvm_i32_ty], [IntrNoMem]>;
   2692 
   2693   def int_x86_avx512_mask_vfnmsub_pd_128 :
   2694          GCCBuiltin<"__builtin_ia32_vfnmsubpd128_mask">,
   2695           Intrinsic<[llvm_v2f64_ty],
   2696           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,  llvm_i8_ty],
   2697           [IntrNoMem]>;
   2698 
   2699   def int_x86_avx512_mask3_vfnmsub_pd_128 :
   2700          GCCBuiltin<"__builtin_ia32_vfnmsubpd128_mask3">,
   2701           Intrinsic<[llvm_v2f64_ty],
   2702           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,  llvm_i8_ty],
   2703           [IntrNoMem]>;
   2704 
   2705   def int_x86_avx512_mask_vfnmsub_pd_256 :
   2706          GCCBuiltin<"__builtin_ia32_vfnmsubpd256_mask">,
   2707           Intrinsic<[llvm_v4f64_ty],
   2708           [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty,  llvm_i8_ty],
   2709           [IntrNoMem]>;
   2710 
   2711   def int_x86_avx512_mask3_vfnmsub_pd_256 :
   2712          GCCBuiltin<"__builtin_ia32_vfnmsubpd256_mask3">,
   2713           Intrinsic<[llvm_v4f64_ty],
   2714           [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4f64_ty,  llvm_i8_ty],
   2715           [IntrNoMem]>;
   2716 
   2717   def int_x86_avx512_mask_vfnmsub_pd_512 :
   2718          GCCBuiltin<"__builtin_ia32_vfnmsubpd512_mask">,
   2719           Intrinsic<[llvm_v8f64_ty],
   2720           [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty,  llvm_i8_ty,
   2721           llvm_i32_ty], [IntrNoMem]>;
   2722 
   2723   def int_x86_avx512_mask3_vfnmsub_pd_512 :
   2724          GCCBuiltin<"__builtin_ia32_vfnmsubpd512_mask3">,
   2725           Intrinsic<[llvm_v8f64_ty],
   2726           [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8f64_ty,  llvm_i8_ty,
   2727           llvm_i32_ty], [IntrNoMem]>;
   2728 
   2729   def int_x86_avx512_mask_vfnmsub_ps_128 :
   2730          GCCBuiltin<"__builtin_ia32_vfnmsubps128_mask">,
   2731           Intrinsic<[llvm_v4f32_ty],
   2732           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  llvm_i8_ty],
   2733           [IntrNoMem]>;
   2734 
   2735   def int_x86_avx512_mask3_vfnmsub_ps_128 :
   2736          GCCBuiltin<"__builtin_ia32_vfnmsubps128_mask3">,
   2737           Intrinsic<[llvm_v4f32_ty],
   2738           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,  llvm_i8_ty],
   2739           [IntrNoMem]>;
   2740 
   2741   def int_x86_avx512_mask_vfnmsub_ps_256 :
   2742          GCCBuiltin<"__builtin_ia32_vfnmsubps256_mask">,
   2743           Intrinsic<[llvm_v8f32_ty],
   2744           [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,  llvm_i8_ty],
   2745           [IntrNoMem]>;
   2746 
   2747   def int_x86_avx512_mask3_vfnmsub_ps_256 :
   2748          GCCBuiltin<"__builtin_ia32_vfnmsubps256_mask3">,
   2749           Intrinsic<[llvm_v8f32_ty],
   2750           [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8f32_ty,  llvm_i8_ty],
   2751           [IntrNoMem]>;
   2752 
   2753   def int_x86_avx512_mask_vfnmsub_ps_512 :
   2754          GCCBuiltin<"__builtin_ia32_vfnmsubps512_mask">,
   2755           Intrinsic<[llvm_v16f32_ty],
   2756           [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,  llvm_i16_ty,
   2757           llvm_i32_ty], [IntrNoMem]>;
   2758 
   2759   def int_x86_avx512_mask3_vfnmsub_ps_512 :
   2760          GCCBuiltin<"__builtin_ia32_vfnmsubps512_mask3">,
   2761           Intrinsic<[llvm_v16f32_ty],
   2762           [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16f32_ty,  llvm_i16_ty,
   2763           llvm_i32_ty], [IntrNoMem]>;
   2764 
   2765   def int_x86_avx512_mask_vpmadd52h_uq_128 :
   2766               GCCBuiltin<"__builtin_ia32_vpmadd52huq128_mask">,
   2767               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
   2768                          llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2769   def int_x86_avx512_maskz_vpmadd52h_uq_128 :
   2770               GCCBuiltin<"__builtin_ia32_vpmadd52huq128_maskz">,
   2771               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
   2772                          llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2773   def int_x86_avx512_mask_vpmadd52l_uq_128 :
   2774               GCCBuiltin<"__builtin_ia32_vpmadd52luq128_mask">,
   2775               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
   2776                          llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2777   def int_x86_avx512_maskz_vpmadd52l_uq_128 :
   2778               GCCBuiltin<"__builtin_ia32_vpmadd52luq128_maskz">,
   2779               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
   2780                          llvm_v2i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2781   def int_x86_avx512_mask_vpmadd52h_uq_256 :
   2782               GCCBuiltin<"__builtin_ia32_vpmadd52huq256_mask">,
   2783               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty,
   2784                          llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2785   def int_x86_avx512_maskz_vpmadd52h_uq_256 :
   2786               GCCBuiltin<"__builtin_ia32_vpmadd52huq256_maskz">,
   2787               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty,
   2788                          llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2789   def int_x86_avx512_mask_vpmadd52l_uq_256 :
   2790               GCCBuiltin<"__builtin_ia32_vpmadd52luq256_mask">,
   2791               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty,
   2792                          llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2793   def int_x86_avx512_maskz_vpmadd52l_uq_256 :
   2794               GCCBuiltin<"__builtin_ia32_vpmadd52luq256_maskz">,
   2795               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty,
   2796                          llvm_v4i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2797   def int_x86_avx512_mask_vpmadd52h_uq_512 :
   2798               GCCBuiltin<"__builtin_ia32_vpmadd52huq512_mask">,
   2799               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty,
   2800                          llvm_v8i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2801   def int_x86_avx512_maskz_vpmadd52h_uq_512 :
   2802               GCCBuiltin<"__builtin_ia32_vpmadd52huq512_maskz">,
   2803               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty,
   2804                          llvm_v8i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2805   def int_x86_avx512_mask_vpmadd52l_uq_512 :
   2806               GCCBuiltin<"__builtin_ia32_vpmadd52luq512_mask">,
   2807               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty,
   2808                          llvm_v8i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2809   def int_x86_avx512_maskz_vpmadd52l_uq_512 :
   2810               GCCBuiltin<"__builtin_ia32_vpmadd52luq512_maskz">,
   2811               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty,
   2812                          llvm_v8i64_ty, llvm_i8_ty], [IntrNoMem]>;
   2813 }
   2814 
   2815 //===----------------------------------------------------------------------===//
   2816 // XOP
   2817 
   2818 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   2819   def int_x86_xop_vpermil2pd : GCCBuiltin<"__builtin_ia32_vpermil2pd">,
   2820               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   2821                                           llvm_v2i64_ty, llvm_i8_ty],
   2822                         [IntrNoMem]>;
   2823 
   2824   def int_x86_xop_vpermil2pd_256 :
   2825               GCCBuiltin<"__builtin_ia32_vpermil2pd256">,
   2826               Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
   2827                                           llvm_v4i64_ty, llvm_i8_ty],
   2828                         [IntrNoMem]>;
   2829 
   2830   def int_x86_xop_vpermil2ps : GCCBuiltin<"__builtin_ia32_vpermil2ps">,
   2831               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   2832                                           llvm_v4i32_ty, llvm_i8_ty],
   2833                         [IntrNoMem]>;
   2834   def int_x86_xop_vpermil2ps_256 :
   2835               GCCBuiltin<"__builtin_ia32_vpermil2ps256">,
   2836               Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
   2837                                           llvm_v8i32_ty, llvm_i8_ty],
   2838                         [IntrNoMem]>;
   2839 
   2840   def int_x86_xop_vfrcz_pd : GCCBuiltin<"__builtin_ia32_vfrczpd">,
   2841               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
   2842   def int_x86_xop_vfrcz_ps : GCCBuiltin<"__builtin_ia32_vfrczps">,
   2843               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
   2844   def int_x86_xop_vfrcz_sd : GCCBuiltin<"__builtin_ia32_vfrczsd">,
   2845               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
   2846   def int_x86_xop_vfrcz_ss : GCCBuiltin<"__builtin_ia32_vfrczss">,
   2847               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
   2848   def int_x86_xop_vfrcz_pd_256 : GCCBuiltin<"__builtin_ia32_vfrczpd256">,
   2849               Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty], [IntrNoMem]>;
   2850   def int_x86_xop_vfrcz_ps_256 : GCCBuiltin<"__builtin_ia32_vfrczps256">,
   2851               Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>;
   2852 
   2853   def int_x86_xop_vpcomb : GCCBuiltin<"__builtin_ia32_vpcomb">,
   2854               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty,
   2855                          llvm_i8_ty], [IntrNoMem]>;
   2856   def int_x86_xop_vpcomw : GCCBuiltin<"__builtin_ia32_vpcomw">,
   2857               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty,
   2858                          llvm_i8_ty], [IntrNoMem]>;
   2859   def int_x86_xop_vpcomd : GCCBuiltin<"__builtin_ia32_vpcomd">,
   2860               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
   2861                          llvm_i8_ty], [IntrNoMem]>;
   2862   def int_x86_xop_vpcomq : GCCBuiltin<"__builtin_ia32_vpcomq">,
   2863               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
   2864                          llvm_i8_ty], [IntrNoMem]>;
   2865   def int_x86_xop_vpcomub : GCCBuiltin<"__builtin_ia32_vpcomub">,
   2866               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty,
   2867                          llvm_i8_ty], [IntrNoMem]>;
   2868   def int_x86_xop_vpcomuw : GCCBuiltin<"__builtin_ia32_vpcomuw">,
   2869               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty,
   2870                          llvm_i8_ty], [IntrNoMem]>;
   2871   def int_x86_xop_vpcomud : GCCBuiltin<"__builtin_ia32_vpcomud">,
   2872               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
   2873                          llvm_i8_ty], [IntrNoMem]>;
   2874   def int_x86_xop_vpcomuq : GCCBuiltin<"__builtin_ia32_vpcomuq">,
   2875               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
   2876                          llvm_i8_ty], [IntrNoMem]>;
   2877 
   2878   def int_x86_xop_vphaddbd :
   2879               GCCBuiltin<"__builtin_ia32_vphaddbd">,
   2880               Intrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
   2881   def int_x86_xop_vphaddbq :
   2882               GCCBuiltin<"__builtin_ia32_vphaddbq">,
   2883               Intrinsic<[llvm_v2i64_ty], [llvm_v16i8_ty], [IntrNoMem]>;
   2884   def int_x86_xop_vphaddbw :
   2885               GCCBuiltin<"__builtin_ia32_vphaddbw">,
   2886               Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty], [IntrNoMem]>;
   2887   def int_x86_xop_vphadddq :
   2888               GCCBuiltin<"__builtin_ia32_vphadddq">,
   2889               Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
   2890   def int_x86_xop_vphaddubd :
   2891               GCCBuiltin<"__builtin_ia32_vphaddubd">,
   2892               Intrinsic<[llvm_v4i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
   2893   def int_x86_xop_vphaddubq :
   2894               GCCBuiltin<"__builtin_ia32_vphaddubq">,
   2895               Intrinsic<[llvm_v2i64_ty], [llvm_v16i8_ty], [IntrNoMem]>;
   2896   def int_x86_xop_vphaddubw :
   2897               GCCBuiltin<"__builtin_ia32_vphaddubw">,
   2898               Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty], [IntrNoMem]>;
   2899   def int_x86_xop_vphaddudq :
   2900               GCCBuiltin<"__builtin_ia32_vphaddudq">,
   2901               Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
   2902   def int_x86_xop_vphadduwd :
   2903               GCCBuiltin<"__builtin_ia32_vphadduwd">,
   2904               Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
   2905   def int_x86_xop_vphadduwq :
   2906               GCCBuiltin<"__builtin_ia32_vphadduwq">,
   2907               Intrinsic<[llvm_v2i64_ty], [llvm_v8i16_ty], [IntrNoMem]>;
   2908   def int_x86_xop_vphaddwd :
   2909               GCCBuiltin<"__builtin_ia32_vphaddwd">,
   2910               Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
   2911   def int_x86_xop_vphaddwq :
   2912               GCCBuiltin<"__builtin_ia32_vphaddwq">,
   2913               Intrinsic<[llvm_v2i64_ty], [llvm_v8i16_ty], [IntrNoMem]>;
   2914   def int_x86_xop_vphsubbw :
   2915               GCCBuiltin<"__builtin_ia32_vphsubbw">,
   2916               Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty], [IntrNoMem]>;
   2917   def int_x86_xop_vphsubdq :
   2918               GCCBuiltin<"__builtin_ia32_vphsubdq">,
   2919               Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
   2920   def int_x86_xop_vphsubwd :
   2921               GCCBuiltin<"__builtin_ia32_vphsubwd">,
   2922               Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
   2923   def int_x86_xop_vpmacsdd :
   2924               GCCBuiltin<"__builtin_ia32_vpmacsdd">,
   2925               Intrinsic<[llvm_v4i32_ty],
   2926                         [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
   2927                         [IntrNoMem]>;
   2928   def int_x86_xop_vpmacsdqh :
   2929               GCCBuiltin<"__builtin_ia32_vpmacsdqh">,
   2930               Intrinsic<[llvm_v2i64_ty],
   2931                         [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v2i64_ty],
   2932                         [IntrNoMem]>;
   2933   def int_x86_xop_vpmacsdql :
   2934               GCCBuiltin<"__builtin_ia32_vpmacsdql">,
   2935               Intrinsic<[llvm_v2i64_ty],
   2936                         [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v2i64_ty],
   2937                         [IntrNoMem]>;
   2938   def int_x86_xop_vpmacssdd :
   2939               GCCBuiltin<"__builtin_ia32_vpmacssdd">,
   2940               Intrinsic<[llvm_v4i32_ty],
   2941                         [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
   2942                         [IntrNoMem]>;
   2943   def int_x86_xop_vpmacssdqh :
   2944               GCCBuiltin<"__builtin_ia32_vpmacssdqh">,
   2945               Intrinsic<[llvm_v2i64_ty],
   2946                         [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v2i64_ty],
   2947                         [IntrNoMem]>;
   2948   def int_x86_xop_vpmacssdql :
   2949               GCCBuiltin<"__builtin_ia32_vpmacssdql">,
   2950               Intrinsic<[llvm_v2i64_ty],
   2951                         [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v2i64_ty],
   2952                         [IntrNoMem]>;
   2953   def int_x86_xop_vpmacsswd :
   2954               GCCBuiltin<"__builtin_ia32_vpmacsswd">,
   2955               Intrinsic<[llvm_v4i32_ty],
   2956                         [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty],
   2957                         [IntrNoMem]>;
   2958   def int_x86_xop_vpmacssww :
   2959               GCCBuiltin<"__builtin_ia32_vpmacssww">,
   2960               Intrinsic<[llvm_v8i16_ty],
   2961                         [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
   2962                         [IntrNoMem]>;
   2963   def int_x86_xop_vpmacswd :
   2964               GCCBuiltin<"__builtin_ia32_vpmacswd">,
   2965               Intrinsic<[llvm_v4i32_ty],
   2966                         [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty],
   2967                         [IntrNoMem]>;
   2968   def int_x86_xop_vpmacsww :
   2969               GCCBuiltin<"__builtin_ia32_vpmacsww">,
   2970               Intrinsic<[llvm_v8i16_ty],
   2971                         [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
   2972                         [IntrNoMem]>;
   2973   def int_x86_xop_vpmadcsswd :
   2974               GCCBuiltin<"__builtin_ia32_vpmadcsswd">,
   2975               Intrinsic<[llvm_v4i32_ty],
   2976                         [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty],
   2977                         [IntrNoMem]>;
   2978   def int_x86_xop_vpmadcswd :
   2979               GCCBuiltin<"__builtin_ia32_vpmadcswd">,
   2980               Intrinsic<[llvm_v4i32_ty],
   2981                         [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty],
   2982                         [IntrNoMem]>;
   2983   def int_x86_xop_vpperm :
   2984               GCCBuiltin<"__builtin_ia32_vpperm">,
   2985               Intrinsic<[llvm_v16i8_ty],
   2986                         [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
   2987                         [IntrNoMem]>;
   2988 
   2989   def int_x86_xop_vprotb : GCCBuiltin<"__builtin_ia32_vprotb">,
   2990               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
   2991                         [IntrNoMem]>;
   2992   def int_x86_xop_vprotd : GCCBuiltin<"__builtin_ia32_vprotd">,
   2993               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
   2994                         [IntrNoMem]>;
   2995   def int_x86_xop_vprotq : GCCBuiltin<"__builtin_ia32_vprotq">,
   2996               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
   2997                         [IntrNoMem]>;
   2998   def int_x86_xop_vprotw : GCCBuiltin<"__builtin_ia32_vprotw">,
   2999               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
   3000                         [IntrNoMem]>;
   3001   def int_x86_xop_vprotbi : GCCBuiltin<"__builtin_ia32_vprotbi">,
   3002               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i8_ty],
   3003                         [IntrNoMem]>;
   3004   def int_x86_xop_vprotdi : GCCBuiltin<"__builtin_ia32_vprotdi">,
   3005               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i8_ty],
   3006                         [IntrNoMem]>;
   3007   def int_x86_xop_vprotqi : GCCBuiltin<"__builtin_ia32_vprotqi">,
   3008               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i8_ty],
   3009                         [IntrNoMem]>;
   3010   def int_x86_xop_vprotwi : GCCBuiltin<"__builtin_ia32_vprotwi">,
   3011               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i8_ty],
   3012                         [IntrNoMem]>;
   3013 
   3014   def int_x86_xop_vpshab :
   3015               GCCBuiltin<"__builtin_ia32_vpshab">,
   3016               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
   3017                         [IntrNoMem]>;
   3018   def int_x86_xop_vpshad :
   3019               GCCBuiltin<"__builtin_ia32_vpshad">,
   3020               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
   3021                         [IntrNoMem]>;
   3022   def int_x86_xop_vpshaq :
   3023               GCCBuiltin<"__builtin_ia32_vpshaq">,
   3024               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
   3025                         [IntrNoMem]>;
   3026   def int_x86_xop_vpshaw :
   3027               GCCBuiltin<"__builtin_ia32_vpshaw">,
   3028               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
   3029                         [IntrNoMem]>;
   3030   def int_x86_xop_vpshlb :
   3031               GCCBuiltin<"__builtin_ia32_vpshlb">,
   3032               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
   3033                         [IntrNoMem]>;
   3034   def int_x86_xop_vpshld :
   3035               GCCBuiltin<"__builtin_ia32_vpshld">,
   3036               Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
   3037                         [IntrNoMem]>;
   3038   def int_x86_xop_vpshlq :
   3039               GCCBuiltin<"__builtin_ia32_vpshlq">,
   3040               Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
   3041                         [IntrNoMem]>;
   3042   def int_x86_xop_vpshlw :
   3043               GCCBuiltin<"__builtin_ia32_vpshlw">,
   3044               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
   3045                         [IntrNoMem]>;
   3046 }
   3047 
   3048 //===----------------------------------------------------------------------===//
   3049 // LWP
   3050 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3051   def int_x86_llwpcb :
   3052               GCCBuiltin<"__builtin_ia32_llwpcb">,
   3053               Intrinsic<[], [llvm_ptr_ty], []>;
   3054   def int_x86_slwpcb :
   3055               GCCBuiltin<"__builtin_ia32_slwpcb">,
   3056               Intrinsic<[llvm_ptr_ty], [], []>;
   3057   def int_x86_lwpins32 :
   3058               GCCBuiltin<"__builtin_ia32_lwpins32">,
   3059               Intrinsic<[llvm_i8_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3060   def int_x86_lwpins64 :
   3061               GCCBuiltin<"__builtin_ia32_lwpins64">,
   3062               Intrinsic<[llvm_i8_ty], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3063   def int_x86_lwpval32 :
   3064               GCCBuiltin<"__builtin_ia32_lwpval32">,
   3065               Intrinsic<[], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3066   def int_x86_lwpval64 :
   3067               GCCBuiltin<"__builtin_ia32_lwpval64">,
   3068               Intrinsic<[], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3069 }
   3070 
   3071 //===----------------------------------------------------------------------===//
   3072 // MMX
   3073 
   3074 // Empty MMX state op.
   3075 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3076   def int_x86_mmx_emms  : GCCBuiltin<"__builtin_ia32_emms">,
   3077               Intrinsic<[], [], []>;
   3078   def int_x86_mmx_femms : GCCBuiltin<"__builtin_ia32_femms">,
   3079               Intrinsic<[], [], []>;
   3080 }
   3081 
   3082 // Integer arithmetic ops.
   3083 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3084   // Addition
   3085   def int_x86_mmx_padd_b : GCCBuiltin<"__builtin_ia32_paddb">,
   3086               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3087                         [IntrNoMem, Commutative]>;
   3088   def int_x86_mmx_padd_w : GCCBuiltin<"__builtin_ia32_paddw">,
   3089               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3090                         [IntrNoMem, Commutative]>;
   3091   def int_x86_mmx_padd_d : GCCBuiltin<"__builtin_ia32_paddd">,
   3092               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3093                         [IntrNoMem, Commutative]>;
   3094   def int_x86_mmx_padd_q : GCCBuiltin<"__builtin_ia32_paddq">,
   3095               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3096                         [IntrNoMem, Commutative]>;
   3097 
   3098   def int_x86_mmx_padds_b : GCCBuiltin<"__builtin_ia32_paddsb">,
   3099               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3100                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3101   def int_x86_mmx_padds_w : GCCBuiltin<"__builtin_ia32_paddsw">,
   3102               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3103                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3104 
   3105   def int_x86_mmx_paddus_b : GCCBuiltin<"__builtin_ia32_paddusb">,
   3106               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3107                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3108   def int_x86_mmx_paddus_w : GCCBuiltin<"__builtin_ia32_paddusw">,
   3109               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3110                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3111 
   3112   // Subtraction
   3113   def int_x86_mmx_psub_b : GCCBuiltin<"__builtin_ia32_psubb">,
   3114               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3115                         [IntrNoMem]>;
   3116   def int_x86_mmx_psub_w : GCCBuiltin<"__builtin_ia32_psubw">,
   3117               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3118                         [IntrNoMem]>;
   3119   def int_x86_mmx_psub_d : GCCBuiltin<"__builtin_ia32_psubd">,
   3120               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3121                         [IntrNoMem]>;
   3122   def int_x86_mmx_psub_q : GCCBuiltin<"__builtin_ia32_psubq">,
   3123               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3124                         [IntrNoMem]>;
   3125 
   3126   def int_x86_mmx_psubs_b : GCCBuiltin<"__builtin_ia32_psubsb">,
   3127               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3128                          llvm_x86mmx_ty], [IntrNoMem]>;
   3129   def int_x86_mmx_psubs_w : GCCBuiltin<"__builtin_ia32_psubsw">,
   3130               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3131                          llvm_x86mmx_ty], [IntrNoMem]>;
   3132 
   3133   def int_x86_mmx_psubus_b : GCCBuiltin<"__builtin_ia32_psubusb">,
   3134               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3135                          llvm_x86mmx_ty], [IntrNoMem]>;
   3136   def int_x86_mmx_psubus_w : GCCBuiltin<"__builtin_ia32_psubusw">,
   3137               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3138                          llvm_x86mmx_ty], [IntrNoMem]>;
   3139 
   3140   // Multiplication
   3141   def int_x86_mmx_pmulh_w : GCCBuiltin<"__builtin_ia32_pmulhw">,
   3142               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3143                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3144   def int_x86_mmx_pmull_w : GCCBuiltin<"__builtin_ia32_pmullw">,
   3145               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3146                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3147   def int_x86_mmx_pmulhu_w : GCCBuiltin<"__builtin_ia32_pmulhuw">,
   3148               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3149                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3150   def int_x86_mmx_pmulu_dq : GCCBuiltin<"__builtin_ia32_pmuludq">,
   3151               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3152                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3153   def int_x86_mmx_pmadd_wd : GCCBuiltin<"__builtin_ia32_pmaddwd">,
   3154               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3155                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3156 
   3157   // Bitwise operations
   3158   def int_x86_mmx_pand : GCCBuiltin<"__builtin_ia32_pand">,
   3159               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3160                         [IntrNoMem, Commutative]>;
   3161   def int_x86_mmx_pandn : GCCBuiltin<"__builtin_ia32_pandn">,
   3162               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3163                         [IntrNoMem]>;
   3164   def int_x86_mmx_por : GCCBuiltin<"__builtin_ia32_por">,
   3165               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3166                         [IntrNoMem, Commutative]>;
   3167   def int_x86_mmx_pxor : GCCBuiltin<"__builtin_ia32_pxor">,
   3168               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3169                         [IntrNoMem, Commutative]>;
   3170 
   3171   // Averages
   3172   def int_x86_mmx_pavg_b : GCCBuiltin<"__builtin_ia32_pavgb">,
   3173               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3174                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3175   def int_x86_mmx_pavg_w : GCCBuiltin<"__builtin_ia32_pavgw">,
   3176               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3177                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3178 
   3179   // Maximum
   3180   def int_x86_mmx_pmaxu_b : GCCBuiltin<"__builtin_ia32_pmaxub">,
   3181               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3182                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3183   def int_x86_mmx_pmaxs_w : GCCBuiltin<"__builtin_ia32_pmaxsw">,
   3184               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3185                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3186 
   3187   // Minimum
   3188   def int_x86_mmx_pminu_b : GCCBuiltin<"__builtin_ia32_pminub">,
   3189               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3190                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3191   def int_x86_mmx_pmins_w : GCCBuiltin<"__builtin_ia32_pminsw">,
   3192               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3193                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3194 
   3195   // Packed sum of absolute differences
   3196   def int_x86_mmx_psad_bw : GCCBuiltin<"__builtin_ia32_psadbw">,
   3197               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3198                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3199 }
   3200 
   3201 // Integer shift ops.
   3202 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3203   // Shift left logical
   3204   def int_x86_mmx_psll_w : GCCBuiltin<"__builtin_ia32_psllw">,
   3205               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3206                          llvm_x86mmx_ty], [IntrNoMem]>;
   3207   def int_x86_mmx_psll_d : GCCBuiltin<"__builtin_ia32_pslld">,
   3208               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3209                          llvm_x86mmx_ty], [IntrNoMem]>;
   3210   def int_x86_mmx_psll_q : GCCBuiltin<"__builtin_ia32_psllq">,
   3211               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3212                          llvm_x86mmx_ty], [IntrNoMem]>;
   3213 
   3214   def int_x86_mmx_psrl_w : GCCBuiltin<"__builtin_ia32_psrlw">,
   3215               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3216                          llvm_x86mmx_ty], [IntrNoMem]>;
   3217   def int_x86_mmx_psrl_d : GCCBuiltin<"__builtin_ia32_psrld">,
   3218               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3219                          llvm_x86mmx_ty], [IntrNoMem]>;
   3220   def int_x86_mmx_psrl_q : GCCBuiltin<"__builtin_ia32_psrlq">,
   3221               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3222                          llvm_x86mmx_ty], [IntrNoMem]>;
   3223 
   3224   def int_x86_mmx_psra_w : GCCBuiltin<"__builtin_ia32_psraw">,
   3225               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3226                          llvm_x86mmx_ty], [IntrNoMem]>;
   3227   def int_x86_mmx_psra_d : GCCBuiltin<"__builtin_ia32_psrad">,
   3228               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3229                          llvm_x86mmx_ty], [IntrNoMem]>;
   3230 
   3231   def int_x86_mmx_pslli_w : GCCBuiltin<"__builtin_ia32_psllwi">,
   3232               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3233                          llvm_i32_ty], [IntrNoMem]>;
   3234   def int_x86_mmx_pslli_d : GCCBuiltin<"__builtin_ia32_pslldi">,
   3235               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3236                          llvm_i32_ty], [IntrNoMem]>;
   3237   def int_x86_mmx_pslli_q : GCCBuiltin<"__builtin_ia32_psllqi">,
   3238               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3239                          llvm_i32_ty], [IntrNoMem]>;
   3240 
   3241   def int_x86_mmx_psrli_w : GCCBuiltin<"__builtin_ia32_psrlwi">,
   3242               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3243                          llvm_i32_ty], [IntrNoMem]>;
   3244   def int_x86_mmx_psrli_d : GCCBuiltin<"__builtin_ia32_psrldi">,
   3245               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3246                          llvm_i32_ty], [IntrNoMem]>;
   3247   def int_x86_mmx_psrli_q : GCCBuiltin<"__builtin_ia32_psrlqi">,
   3248               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3249                          llvm_i32_ty], [IntrNoMem]>;
   3250 
   3251   def int_x86_mmx_psrai_w : GCCBuiltin<"__builtin_ia32_psrawi">,
   3252               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3253                          llvm_i32_ty], [IntrNoMem]>;
   3254   def int_x86_mmx_psrai_d : GCCBuiltin<"__builtin_ia32_psradi">,
   3255               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3256                          llvm_i32_ty], [IntrNoMem]>;
   3257 }
   3258 // Permute
   3259 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3260   def int_x86_avx512_mask_permvar_df_256 : GCCBuiltin<"__builtin_ia32_permvardf256_mask">,
   3261               Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty,
   3262                         llvm_v4i64_ty, llvm_v4f64_ty, llvm_i8_ty],  [IntrNoMem]>;
   3263   def int_x86_avx512_mask_permvar_df_512 : GCCBuiltin<"__builtin_ia32_permvardf512_mask">,
   3264               Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty,
   3265                         llvm_v8i64_ty, llvm_v8f64_ty, llvm_i8_ty],  [IntrNoMem]>;
   3266   def int_x86_avx512_mask_permvar_di_256 : GCCBuiltin<"__builtin_ia32_permvardi256_mask">,
   3267               Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty,
   3268                         llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty],  [IntrNoMem]>;
   3269   def int_x86_avx512_mask_permvar_di_512 : GCCBuiltin<"__builtin_ia32_permvardi512_mask">,
   3270               Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty,
   3271                         llvm_v8i64_ty, llvm_v8i64_ty, llvm_i8_ty],  [IntrNoMem]>;
   3272   def int_x86_avx512_mask_permvar_hi_128 : GCCBuiltin<"__builtin_ia32_permvarhi128_mask">,
   3273               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty,
   3274                         llvm_v8i16_ty, llvm_v8i16_ty, llvm_i8_ty],  [IntrNoMem]>;
   3275   def int_x86_avx512_mask_permvar_hi_256 : GCCBuiltin<"__builtin_ia32_permvarhi256_mask">,
   3276               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty,
   3277                         llvm_v16i16_ty, llvm_v16i16_ty, llvm_i16_ty],  [IntrNoMem]>;
   3278   def int_x86_avx512_mask_permvar_hi_512 : GCCBuiltin<"__builtin_ia32_permvarhi512_mask">,
   3279               Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty,
   3280                         llvm_v32i16_ty, llvm_v32i16_ty, llvm_i32_ty],  [IntrNoMem]>;
   3281   def int_x86_avx512_mask_permvar_qi_128 : GCCBuiltin<"__builtin_ia32_permvarqi128_mask">,
   3282               Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty,
   3283                         llvm_v16i8_ty, llvm_v16i8_ty, llvm_i16_ty],  [IntrNoMem]>;
   3284   def int_x86_avx512_mask_permvar_qi_256 : GCCBuiltin<"__builtin_ia32_permvarqi256_mask">,
   3285               Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty,
   3286                         llvm_v32i8_ty, llvm_v32i8_ty, llvm_i32_ty],  [IntrNoMem]>;
   3287   def int_x86_avx512_mask_permvar_qi_512 : GCCBuiltin<"__builtin_ia32_permvarqi512_mask">,
   3288               Intrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty,
   3289                         llvm_v64i8_ty, llvm_v64i8_ty, llvm_i64_ty],  [IntrNoMem]>;
   3290   def int_x86_avx512_mask_permvar_sf_256 : GCCBuiltin<"__builtin_ia32_permvarsf256_mask">,
   3291               Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty,
   3292                         llvm_v8i32_ty, llvm_v8f32_ty, llvm_i8_ty],  [IntrNoMem]>;
   3293   def int_x86_avx512_mask_permvar_sf_512 : GCCBuiltin<"__builtin_ia32_permvarsf512_mask">,
   3294               Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty,
   3295                         llvm_v16i32_ty, llvm_v16f32_ty, llvm_i16_ty],  [IntrNoMem]>;
   3296   def int_x86_avx512_mask_permvar_si_256 : GCCBuiltin<"__builtin_ia32_permvarsi256_mask">,
   3297               Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty,
   3298                         llvm_v8i32_ty, llvm_v8i32_ty, llvm_i8_ty],  [IntrNoMem]>;
   3299   def int_x86_avx512_mask_permvar_si_512 : GCCBuiltin<"__builtin_ia32_permvarsi512_mask">,
   3300               Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty,
   3301                         llvm_v16i32_ty, llvm_v16i32_ty, llvm_i16_ty],  [IntrNoMem]>;
   3302 }
   3303 // Pack ops.
   3304 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3305   def int_x86_mmx_packsswb : GCCBuiltin<"__builtin_ia32_packsswb">,
   3306               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3307                          llvm_x86mmx_ty], [IntrNoMem]>;
   3308   def int_x86_mmx_packssdw : GCCBuiltin<"__builtin_ia32_packssdw">,
   3309               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3310                          llvm_x86mmx_ty], [IntrNoMem]>;
   3311   def int_x86_mmx_packuswb : GCCBuiltin<"__builtin_ia32_packuswb">,
   3312               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3313                          llvm_x86mmx_ty], [IntrNoMem]>;
   3314 }
   3315 
   3316 // Unpacking ops.
   3317 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3318   def int_x86_mmx_punpckhbw : GCCBuiltin<"__builtin_ia32_punpckhbw">,
   3319               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3320                         [IntrNoMem]>;
   3321   def int_x86_mmx_punpckhwd : GCCBuiltin<"__builtin_ia32_punpckhwd">,
   3322               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3323                         [IntrNoMem]>;
   3324   def int_x86_mmx_punpckhdq : GCCBuiltin<"__builtin_ia32_punpckhdq">,
   3325               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3326                         [IntrNoMem]>;
   3327   def int_x86_mmx_punpcklbw : GCCBuiltin<"__builtin_ia32_punpcklbw">,
   3328               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3329                         [IntrNoMem]>;
   3330   def int_x86_mmx_punpcklwd : GCCBuiltin<"__builtin_ia32_punpcklwd">,
   3331               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3332                         [IntrNoMem]>;
   3333   def int_x86_mmx_punpckldq : GCCBuiltin<"__builtin_ia32_punpckldq">,
   3334               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty, llvm_x86mmx_ty],
   3335                         [IntrNoMem]>;
   3336 }
   3337 
   3338 // Integer comparison ops
   3339 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3340   def int_x86_mmx_pcmpeq_b : GCCBuiltin<"__builtin_ia32_pcmpeqb">,
   3341               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3342                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3343   def int_x86_mmx_pcmpeq_w : GCCBuiltin<"__builtin_ia32_pcmpeqw">,
   3344               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3345                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3346   def int_x86_mmx_pcmpeq_d : GCCBuiltin<"__builtin_ia32_pcmpeqd">,
   3347               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3348                          llvm_x86mmx_ty], [IntrNoMem, Commutative]>;
   3349 
   3350   def int_x86_mmx_pcmpgt_b : GCCBuiltin<"__builtin_ia32_pcmpgtb">,
   3351               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3352                          llvm_x86mmx_ty], [IntrNoMem]>;
   3353   def int_x86_mmx_pcmpgt_w : GCCBuiltin<"__builtin_ia32_pcmpgtw">,
   3354               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3355                          llvm_x86mmx_ty], [IntrNoMem]>;
   3356   def int_x86_mmx_pcmpgt_d : GCCBuiltin<"__builtin_ia32_pcmpgtd">,
   3357               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3358                          llvm_x86mmx_ty], [IntrNoMem]>;
   3359 }
   3360 
   3361 // Misc.
   3362 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3363   def int_x86_mmx_maskmovq : GCCBuiltin<"__builtin_ia32_maskmovq">,
   3364               Intrinsic<[], [llvm_x86mmx_ty, llvm_x86mmx_ty, llvm_ptr_ty], []>;
   3365 
   3366   def int_x86_mmx_pmovmskb : GCCBuiltin<"__builtin_ia32_pmovmskb">,
   3367               Intrinsic<[llvm_i32_ty], [llvm_x86mmx_ty], [IntrNoMem]>;
   3368 
   3369   def int_x86_mmx_movnt_dq : GCCBuiltin<"__builtin_ia32_movntq">,
   3370               Intrinsic<[], [llvm_ptrx86mmx_ty, llvm_x86mmx_ty], []>;
   3371 
   3372   def int_x86_mmx_palignr_b : GCCBuiltin<"__builtin_ia32_palignr">,
   3373               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3374                         llvm_x86mmx_ty, llvm_i8_ty], [IntrNoMem]>;
   3375 
   3376   def int_x86_mmx_pextr_w : GCCBuiltin<"__builtin_ia32_vec_ext_v4hi">,
   3377               Intrinsic<[llvm_i32_ty], [llvm_x86mmx_ty, llvm_i32_ty],
   3378                         [IntrNoMem]>;
   3379 
   3380   def int_x86_mmx_pinsr_w : GCCBuiltin<"__builtin_ia32_vec_set_v4hi">,
   3381               Intrinsic<[llvm_x86mmx_ty], [llvm_x86mmx_ty,
   3382                         llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
   3383 }
   3384 
   3385 //===----------------------------------------------------------------------===//
   3386 // BMI
   3387 
   3388 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3389   def int_x86_bmi_bextr_32 : GCCBuiltin<"__builtin_ia32_bextr_u32">,
   3390               Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
   3391   def int_x86_bmi_bextr_64 : GCCBuiltin<"__builtin_ia32_bextr_u64">,
   3392               Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
   3393   def int_x86_bmi_bzhi_32 : GCCBuiltin<"__builtin_ia32_bzhi_si">,
   3394               Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
   3395   def int_x86_bmi_bzhi_64 : GCCBuiltin<"__builtin_ia32_bzhi_di">,
   3396               Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
   3397   def int_x86_bmi_pdep_32 : GCCBuiltin<"__builtin_ia32_pdep_si">,
   3398               Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
   3399   def int_x86_bmi_pdep_64 : GCCBuiltin<"__builtin_ia32_pdep_di">,
   3400               Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
   3401   def int_x86_bmi_pext_32 : GCCBuiltin<"__builtin_ia32_pext_si">,
   3402               Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
   3403   def int_x86_bmi_pext_64 : GCCBuiltin<"__builtin_ia32_pext_di">,
   3404               Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
   3405 }
   3406 
   3407 //===----------------------------------------------------------------------===//
   3408 // FS/GS Base
   3409 
   3410 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3411   def int_x86_rdfsbase_32 : GCCBuiltin<"__builtin_ia32_rdfsbase32">,
   3412               Intrinsic<[llvm_i32_ty], []>;
   3413   def int_x86_rdgsbase_32 : GCCBuiltin<"__builtin_ia32_rdgsbase32">,
   3414               Intrinsic<[llvm_i32_ty], []>;
   3415   def int_x86_rdfsbase_64 : GCCBuiltin<"__builtin_ia32_rdfsbase64">,
   3416               Intrinsic<[llvm_i64_ty], []>;
   3417   def int_x86_rdgsbase_64 : GCCBuiltin<"__builtin_ia32_rdgsbase64">,
   3418               Intrinsic<[llvm_i64_ty], []>;
   3419   def int_x86_wrfsbase_32 : GCCBuiltin<"__builtin_ia32_wrfsbase32">,
   3420               Intrinsic<[], [llvm_i32_ty]>;
   3421   def int_x86_wrgsbase_32 : GCCBuiltin<"__builtin_ia32_wrgsbase32">,
   3422               Intrinsic<[], [llvm_i32_ty]>;
   3423   def int_x86_wrfsbase_64 : GCCBuiltin<"__builtin_ia32_wrfsbase64">,
   3424               Intrinsic<[], [llvm_i64_ty]>;
   3425   def int_x86_wrgsbase_64 : GCCBuiltin<"__builtin_ia32_wrgsbase64">,
   3426               Intrinsic<[], [llvm_i64_ty]>;
   3427 }
   3428 
   3429 //===----------------------------------------------------------------------===//
   3430 // FXSR
   3431 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3432   def int_x86_fxrstor : GCCBuiltin<"__builtin_ia32_fxrstor">,
   3433               Intrinsic<[], [llvm_ptr_ty], []>;
   3434   def int_x86_fxrstor64 : GCCBuiltin<"__builtin_ia32_fxrstor64">,
   3435               Intrinsic<[], [llvm_ptr_ty], []>;
   3436   def int_x86_fxsave : GCCBuiltin<"__builtin_ia32_fxsave">,
   3437               Intrinsic<[], [llvm_ptr_ty], []>;
   3438   def int_x86_fxsave64 : GCCBuiltin<"__builtin_ia32_fxsave64">,
   3439               Intrinsic<[], [llvm_ptr_ty], []>;
   3440 }
   3441 
   3442 //===----------------------------------------------------------------------===//
   3443 // XSAVE
   3444 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3445   def int_x86_xsave :
   3446               Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3447   def int_x86_xsave64 :
   3448               Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3449   def int_x86_xrstor :
   3450               Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3451   def int_x86_xrstor64 :
   3452               Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3453   def int_x86_xsaveopt :
   3454               Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3455   def int_x86_xsaveopt64 :
   3456               Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3457   def int_x86_xrstors :
   3458               Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3459   def int_x86_xrstors64 :
   3460               Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3461   def int_x86_xsavec :
   3462               Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3463   def int_x86_xsavec64 :
   3464               Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3465   def int_x86_xsaves :
   3466               Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3467   def int_x86_xsaves64 :
   3468               Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3469   def int_x86_xgetbv :
   3470               Intrinsic<[llvm_i64_ty], [llvm_i32_ty], []>;
   3471   def int_x86_xsetbv :
   3472               Intrinsic<[], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
   3473 }
   3474 
   3475 //===----------------------------------------------------------------------===//
   3476 // CLFLUSHOPT and CLWB
   3477 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3478   def int_x86_clflushopt : GCCBuiltin<"__builtin_ia32_clflushopt">,
   3479               Intrinsic<[], [llvm_ptr_ty], []>;
   3480 
   3481   def int_x86_clwb : GCCBuiltin<"__builtin_ia32_clwb">,
   3482               Intrinsic<[], [llvm_ptr_ty], []>;
   3483 }
   3484 
   3485 //===----------------------------------------------------------------------===//
   3486 // Support protection key
   3487 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3488   def int_x86_rdpkru : GCCBuiltin <"__builtin_ia32_rdpkru">,
   3489               Intrinsic<[llvm_i32_ty], [], []>;
   3490   def int_x86_wrpkru : GCCBuiltin<"__builtin_ia32_wrpkru">,
   3491               Intrinsic<[], [llvm_i32_ty], []>;
   3492 }
   3493 //===----------------------------------------------------------------------===//
   3494 // Half float conversion
   3495 
   3496 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3497   def int_x86_vcvtph2ps_128 : GCCBuiltin<"__builtin_ia32_vcvtph2ps">,
   3498               Intrinsic<[llvm_v4f32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
   3499   def int_x86_vcvtph2ps_256 : GCCBuiltin<"__builtin_ia32_vcvtph2ps256">,
   3500               Intrinsic<[llvm_v8f32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
   3501   def int_x86_vcvtps2ph_128 : GCCBuiltin<"__builtin_ia32_vcvtps2ph">,
   3502               Intrinsic<[llvm_v8i16_ty], [llvm_v4f32_ty, llvm_i32_ty],
   3503                         [IntrNoMem]>;
   3504   def int_x86_vcvtps2ph_256 : GCCBuiltin<"__builtin_ia32_vcvtps2ph256">,
   3505               Intrinsic<[llvm_v8i16_ty], [llvm_v8f32_ty, llvm_i32_ty],
   3506                         [IntrNoMem]>;
   3507   def int_x86_avx512_mask_vcvtph2ps_512 : GCCBuiltin<"__builtin_ia32_vcvtph2ps512_mask">,
   3508               Intrinsic<[llvm_v16f32_ty], [llvm_v16i16_ty, llvm_v16f32_ty,
   3509                                            llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   3510   def int_x86_avx512_mask_vcvtph2ps_256 : GCCBuiltin<"__builtin_ia32_vcvtph2ps256_mask">,
   3511               Intrinsic<[llvm_v8f32_ty], [llvm_v8i16_ty, llvm_v8f32_ty,
   3512                                            llvm_i8_ty], [IntrNoMem]>;
   3513   def int_x86_avx512_mask_vcvtph2ps_128 : GCCBuiltin<"__builtin_ia32_vcvtph2ps_mask">,
   3514               Intrinsic<[llvm_v4f32_ty], [llvm_v8i16_ty, llvm_v4f32_ty,
   3515                                            llvm_i8_ty], [IntrNoMem]>;
   3516   def int_x86_avx512_mask_vcvtps2ph_512 : GCCBuiltin<"__builtin_ia32_vcvtps2ph512_mask">,
   3517               Intrinsic<[llvm_v16i16_ty], [llvm_v16f32_ty, llvm_i32_ty,
   3518                                            llvm_v16i16_ty, llvm_i16_ty], [IntrNoMem]>;
   3519   def int_x86_avx512_mask_vcvtps2ph_256 : GCCBuiltin<"__builtin_ia32_vcvtps2ph256_mask">,
   3520               Intrinsic<[llvm_v8i16_ty], [llvm_v8f32_ty, llvm_i32_ty,
   3521                                            llvm_v8i16_ty, llvm_i8_ty], [IntrNoMem]>;
   3522   def int_x86_avx512_mask_vcvtps2ph_128 : GCCBuiltin<"__builtin_ia32_vcvtps2ph_mask">,
   3523               Intrinsic<[llvm_v8i16_ty], [llvm_v4f32_ty, llvm_i32_ty,
   3524                                            llvm_v8i16_ty, llvm_i8_ty], [IntrNoMem]>;
   3525 }
   3526 
   3527 //===----------------------------------------------------------------------===//
   3528 // TBM
   3529 
   3530 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3531   def int_x86_tbm_bextri_u32 : GCCBuiltin<"__builtin_ia32_bextri_u32">,
   3532         Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
   3533   def int_x86_tbm_bextri_u64 : GCCBuiltin<"__builtin_ia32_bextri_u64">,
   3534         Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
   3535 }
   3536 
   3537 //===----------------------------------------------------------------------===//
   3538 // RDRAND intrinsics - Return a random value and whether it is valid.
   3539 // RDSEED intrinsics - Return a NIST SP800-90B & C compliant random value and
   3540 // whether it is valid.
   3541 
   3542 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3543   // These are declared side-effecting so they don't get eliminated by CSE or
   3544   // LICM.
   3545   def int_x86_rdrand_16 : Intrinsic<[llvm_i16_ty, llvm_i32_ty], [], []>;
   3546   def int_x86_rdrand_32 : Intrinsic<[llvm_i32_ty, llvm_i32_ty], [], []>;
   3547   def int_x86_rdrand_64 : Intrinsic<[llvm_i64_ty, llvm_i32_ty], [], []>;
   3548   def int_x86_rdseed_16 : Intrinsic<[llvm_i16_ty, llvm_i32_ty], [], []>;
   3549   def int_x86_rdseed_32 : Intrinsic<[llvm_i32_ty, llvm_i32_ty], [], []>;
   3550   def int_x86_rdseed_64 : Intrinsic<[llvm_i64_ty, llvm_i32_ty], [], []>;
   3551 }
   3552 
   3553 //===----------------------------------------------------------------------===//
   3554 // ADX
   3555 
   3556 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3557   def int_x86_addcarryx_u32: GCCBuiltin<"__builtin_ia32_addcarryx_u32">,
   3558         Intrinsic<[llvm_i8_ty], [llvm_i8_ty, llvm_i32_ty, llvm_i32_ty,
   3559                                  llvm_ptr_ty], [IntrArgMemOnly]>;
   3560   def int_x86_addcarryx_u64: GCCBuiltin<"__builtin_ia32_addcarryx_u64">,
   3561         Intrinsic<[llvm_i8_ty], [llvm_i8_ty, llvm_i64_ty, llvm_i64_ty,
   3562                                  llvm_ptr_ty], [IntrArgMemOnly]>;
   3563   def int_x86_addcarry_u32: GCCBuiltin<"__builtin_ia32_addcarry_u32">,
   3564         Intrinsic<[llvm_i8_ty], [llvm_i8_ty, llvm_i32_ty, llvm_i32_ty,
   3565                                  llvm_ptr_ty], [IntrArgMemOnly]>;
   3566   def int_x86_addcarry_u64: GCCBuiltin<"__builtin_ia32_addcarry_u64">,
   3567         Intrinsic<[llvm_i8_ty], [llvm_i8_ty, llvm_i64_ty, llvm_i64_ty,
   3568                                  llvm_ptr_ty], [IntrArgMemOnly]>;
   3569   def int_x86_subborrow_u32: GCCBuiltin<"__builtin_ia32_subborrow_u32">,
   3570         Intrinsic<[llvm_i8_ty], [llvm_i8_ty, llvm_i32_ty, llvm_i32_ty,
   3571                                  llvm_ptr_ty], [IntrArgMemOnly]>;
   3572   def int_x86_subborrow_u64: GCCBuiltin<"__builtin_ia32_subborrow_u64">,
   3573         Intrinsic<[llvm_i8_ty], [llvm_i8_ty, llvm_i64_ty, llvm_i64_ty,
   3574                                  llvm_ptr_ty], [IntrArgMemOnly]>;
   3575 }
   3576 
   3577 //===----------------------------------------------------------------------===//
   3578 // RTM intrinsics. Transactional Memory support.
   3579 
   3580 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3581   def int_x86_xbegin : GCCBuiltin<"__builtin_ia32_xbegin">,
   3582               Intrinsic<[llvm_i32_ty], [], []>;
   3583   def int_x86_xend : GCCBuiltin<"__builtin_ia32_xend">,
   3584               Intrinsic<[], [], []>;
   3585   def int_x86_xabort : GCCBuiltin<"__builtin_ia32_xabort">,
   3586               Intrinsic<[], [llvm_i8_ty], []>;
   3587   def int_x86_xtest : GCCBuiltin<"__builtin_ia32_xtest">,
   3588               Intrinsic<[llvm_i32_ty], [], []>;
   3589 }
   3590 
   3591 //===----------------------------------------------------------------------===//
   3592 // AVX512
   3593 
   3594 // Mask ops
   3595 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3596   // Mask instructions
   3597   // 16-bit mask
   3598   def int_x86_avx512_kand_w : GCCBuiltin<"__builtin_ia32_kandhi">,
   3599               Intrinsic<[llvm_i16_ty], [llvm_i16_ty, llvm_i16_ty],
   3600                          [IntrNoMem]>;
   3601   def int_x86_avx512_kandn_w : GCCBuiltin<"__builtin_ia32_kandnhi">,
   3602               Intrinsic<[llvm_i16_ty], [llvm_i16_ty, llvm_i16_ty],
   3603                          [IntrNoMem]>;
   3604   def int_x86_avx512_knot_w : GCCBuiltin<"__builtin_ia32_knothi">,
   3605               Intrinsic<[llvm_i16_ty], [llvm_i16_ty], [IntrNoMem]>;
   3606   def int_x86_avx512_kor_w : GCCBuiltin<"__builtin_ia32_korhi">,
   3607               Intrinsic<[llvm_i16_ty], [llvm_i16_ty, llvm_i16_ty],
   3608                          [IntrNoMem]>;
   3609   def int_x86_avx512_kxor_w : GCCBuiltin<"__builtin_ia32_kxorhi">,
   3610               Intrinsic<[llvm_i16_ty], [llvm_i16_ty, llvm_i16_ty],
   3611                          [IntrNoMem]>;
   3612   def int_x86_avx512_kxnor_w : GCCBuiltin<"__builtin_ia32_kxnorhi">,
   3613               Intrinsic<[llvm_i16_ty], [llvm_i16_ty, llvm_i16_ty],
   3614                          [IntrNoMem]>;
   3615   def int_x86_avx512_kunpck_bw : GCCBuiltin<"__builtin_ia32_kunpckhi">,
   3616               Intrinsic<[llvm_i16_ty], [llvm_i16_ty, llvm_i16_ty],
   3617                          [IntrNoMem]>;
   3618   def int_x86_avx512_kunpck_wd : GCCBuiltin<"__builtin_ia32_kunpcksi">,
   3619               Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
   3620                          [IntrNoMem]>;
   3621   def int_x86_avx512_kunpck_dq : GCCBuiltin<"__builtin_ia32_kunpckdi">,
   3622               Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
   3623                          [IntrNoMem]>;
   3624   def int_x86_avx512_kortestz_w : GCCBuiltin<"__builtin_ia32_kortestzhi">,
   3625               Intrinsic<[llvm_i32_ty], [llvm_i16_ty, llvm_i16_ty],
   3626                         [IntrNoMem]>;
   3627   def int_x86_avx512_kortestc_w : GCCBuiltin<"__builtin_ia32_kortestchi">,
   3628               Intrinsic<[llvm_i32_ty], [llvm_i16_ty, llvm_i16_ty],
   3629                         [IntrNoMem]>;
   3630 }
   3631 
   3632 // Conversion ops
   3633 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3634   def int_x86_avx512_cvttss2si : GCCBuiltin<"__builtin_ia32_vcvttss2si32">,
   3635               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty], [IntrNoMem]>;
   3636   def int_x86_avx512_cvttss2si64 : GCCBuiltin<"__builtin_ia32_vcvttss2si64">,
   3637               Intrinsic<[llvm_i64_ty], [llvm_v4f32_ty, llvm_i32_ty], [IntrNoMem]>;
   3638   def int_x86_avx512_cvttss2usi : GCCBuiltin<"__builtin_ia32_vcvttss2usi32">,
   3639               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty], [IntrNoMem]>;
   3640   def int_x86_avx512_cvttss2usi64 : GCCBuiltin<"__builtin_ia32_vcvttss2usi64">,
   3641               Intrinsic<[llvm_i64_ty], [llvm_v4f32_ty, llvm_i32_ty], [IntrNoMem]>;
   3642   def int_x86_avx512_cvtusi2ss : GCCBuiltin<"__builtin_ia32_cvtusi2ss32">,
   3643               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
   3644                          llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
   3645   def int_x86_avx512_cvtusi642ss : GCCBuiltin<"__builtin_ia32_cvtusi2ss64">,
   3646               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
   3647                          llvm_i64_ty, llvm_i32_ty], [IntrNoMem]>;
   3648   def int_x86_avx512_cvttsd2si : GCCBuiltin<"__builtin_ia32_vcvttsd2si32">,
   3649               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_i32_ty], [IntrNoMem]>;
   3650   def int_x86_avx512_cvttsd2si64 : GCCBuiltin<"__builtin_ia32_vcvttsd2si64">,
   3651               Intrinsic<[llvm_i64_ty], [llvm_v2f64_ty, llvm_i32_ty], [IntrNoMem]>;
   3652   def int_x86_avx512_cvttsd2usi : GCCBuiltin<"__builtin_ia32_vcvttsd2usi32">,
   3653               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_i32_ty], [IntrNoMem]>;
   3654   def int_x86_avx512_cvttsd2usi64 : GCCBuiltin<"__builtin_ia32_vcvttsd2usi64">,
   3655               Intrinsic<[llvm_i64_ty], [llvm_v2f64_ty, llvm_i32_ty], [IntrNoMem]>;
   3656   def int_x86_avx512_cvtusi2sd : GCCBuiltin<"__builtin_ia32_cvtusi2sd32">,
   3657               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
   3658                          llvm_i32_ty], [IntrNoMem]>;
   3659   def int_x86_avx512_cvtusi642sd : GCCBuiltin<"__builtin_ia32_cvtusi2sd64">,
   3660               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
   3661                          llvm_i64_ty, llvm_i32_ty], [IntrNoMem]>;
   3662   def int_x86_avx512_vcvtss2usi32 : GCCBuiltin<"__builtin_ia32_vcvtss2usi32">,
   3663               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty], [IntrNoMem]>;
   3664   def int_x86_avx512_vcvtss2usi64 : GCCBuiltin<"__builtin_ia32_vcvtss2usi64">,
   3665               Intrinsic<[llvm_i64_ty], [llvm_v4f32_ty, llvm_i32_ty], [IntrNoMem]>;
   3666   def int_x86_avx512_vcvtss2si32 : GCCBuiltin<"__builtin_ia32_vcvtss2si32">,
   3667               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty, llvm_i32_ty], [IntrNoMem]>;
   3668   def int_x86_avx512_vcvtss2si64 : GCCBuiltin<"__builtin_ia32_vcvtss2si64">,
   3669               Intrinsic<[llvm_i64_ty], [llvm_v4f32_ty, llvm_i32_ty], [IntrNoMem]>;
   3670   def int_x86_avx512_vcvtsd2usi32 : GCCBuiltin<"__builtin_ia32_vcvtsd2usi32">,
   3671               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_i32_ty], [IntrNoMem]>;
   3672   def int_x86_avx512_vcvtsd2usi64 : GCCBuiltin<"__builtin_ia32_vcvtsd2usi64">,
   3673               Intrinsic<[llvm_i64_ty], [llvm_v2f64_ty, llvm_i32_ty], [IntrNoMem]>;
   3674   def int_x86_avx512_vcvtsd2si32 : GCCBuiltin<"__builtin_ia32_vcvtsd2si32">,
   3675               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty, llvm_i32_ty], [IntrNoMem]>;
   3676   def int_x86_avx512_vcvtsd2si64 : GCCBuiltin<"__builtin_ia32_vcvtsd2si64">,
   3677               Intrinsic<[llvm_i64_ty], [llvm_v2f64_ty, llvm_i32_ty], [IntrNoMem]>;
   3678   def int_x86_avx512_cvtsi2ss32 : GCCBuiltin<"__builtin_ia32_cvtsi2ss32">,
   3679               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
   3680                          llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
   3681   def int_x86_avx512_cvtsi2ss64 : GCCBuiltin<"__builtin_ia32_cvtsi2ss64">,
   3682               Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty,
   3683                          llvm_i64_ty, llvm_i32_ty], [IntrNoMem]>;
   3684   def int_x86_avx512_cvtsi2sd64 : GCCBuiltin<"__builtin_ia32_cvtsi2sd64">,
   3685               Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty,
   3686                          llvm_i64_ty, llvm_i32_ty], [IntrNoMem]>;
   3687 
   3688   def int_x86_avx512_cvtb2mask_128 : GCCBuiltin<"__builtin_ia32_cvtb2mask128">,
   3689               Intrinsic<[llvm_i16_ty], [llvm_v16i8_ty], [IntrNoMem]>;
   3690   def int_x86_avx512_cvtb2mask_256 : GCCBuiltin<"__builtin_ia32_cvtb2mask256">,
   3691               Intrinsic<[llvm_i32_ty], [llvm_v32i8_ty], [IntrNoMem]>;
   3692   def int_x86_avx512_cvtb2mask_512 : GCCBuiltin<"__builtin_ia32_cvtb2mask512">,
   3693               Intrinsic<[llvm_i64_ty], [llvm_v64i8_ty], [IntrNoMem]>;
   3694 
   3695   def int_x86_avx512_cvtw2mask_128 : GCCBuiltin<"__builtin_ia32_cvtw2mask128">,
   3696               Intrinsic<[llvm_i8_ty], [llvm_v8i16_ty], [IntrNoMem]>;
   3697   def int_x86_avx512_cvtw2mask_256 : GCCBuiltin<"__builtin_ia32_cvtw2mask256">,
   3698               Intrinsic<[llvm_i16_ty], [llvm_v16i16_ty], [IntrNoMem]>;
   3699   def int_x86_avx512_cvtw2mask_512 : GCCBuiltin<"__builtin_ia32_cvtw2mask512">,
   3700               Intrinsic<[llvm_i32_ty], [llvm_v32i16_ty], [IntrNoMem]>;
   3701 
   3702   def int_x86_avx512_cvtd2mask_128 : GCCBuiltin<"__builtin_ia32_cvtd2mask128">,
   3703               Intrinsic<[llvm_i8_ty], [llvm_v4i32_ty], [IntrNoMem]>;
   3704   def int_x86_avx512_cvtd2mask_256 : GCCBuiltin<"__builtin_ia32_cvtd2mask256">,
   3705               Intrinsic<[llvm_i8_ty], [llvm_v8i32_ty], [IntrNoMem]>;
   3706   def int_x86_avx512_cvtd2mask_512 : GCCBuiltin<"__builtin_ia32_cvtd2mask512">,
   3707               Intrinsic<[llvm_i16_ty], [llvm_v16i32_ty], [IntrNoMem]>;
   3708 
   3709   def int_x86_avx512_cvtq2mask_128 : GCCBuiltin<"__builtin_ia32_cvtq2mask128">,
   3710               Intrinsic<[llvm_i8_ty], [llvm_v2i64_ty], [IntrNoMem]>;
   3711   def int_x86_avx512_cvtq2mask_256 : GCCBuiltin<"__builtin_ia32_cvtq2mask256">,
   3712               Intrinsic<[llvm_i8_ty], [llvm_v4i64_ty], [IntrNoMem]>;
   3713   def int_x86_avx512_cvtq2mask_512 : GCCBuiltin<"__builtin_ia32_cvtq2mask512">,
   3714               Intrinsic<[llvm_i8_ty], [llvm_v8i64_ty], [IntrNoMem]>;
   3715 
   3716 }
   3717 
   3718 // Pack ops.
   3719 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3720   def int_x86_avx512_packsswb_512 : GCCBuiltin<"__builtin_ia32_packsswb512">,
   3721               Intrinsic<[llvm_v64i8_ty], [llvm_v32i16_ty,llvm_v32i16_ty],
   3722                         [IntrNoMem]>;
   3723   def int_x86_avx512_packssdw_512 : GCCBuiltin<"__builtin_ia32_packssdw512">,
   3724               Intrinsic<[llvm_v32i16_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
   3725                          [IntrNoMem]>;
   3726   def int_x86_avx512_packuswb_512 : GCCBuiltin<"__builtin_ia32_packuswb512">,
   3727               Intrinsic<[llvm_v64i8_ty], [llvm_v32i16_ty,llvm_v32i16_ty],
   3728                          [IntrNoMem]>;
   3729   def int_x86_avx512_packusdw_512 : GCCBuiltin<"__builtin_ia32_packusdw512">,
   3730               Intrinsic<[llvm_v32i16_ty], [llvm_v16i32_ty, llvm_v16i32_ty],
   3731                          [IntrNoMem]>;
   3732 }
   3733 
   3734 // Vector convert
   3735 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   3736   def int_x86_avx512_mask_cvtdq2ps_128 :
   3737         GCCBuiltin<"__builtin_ia32_cvtdq2ps128_mask">,
   3738           Intrinsic<[llvm_v4f32_ty],
   3739           [llvm_v4i32_ty, llvm_v4f32_ty,  llvm_i8_ty],
   3740           [IntrNoMem]>;
   3741 
   3742   def int_x86_avx512_mask_cvtdq2ps_256 :
   3743         GCCBuiltin<"__builtin_ia32_cvtdq2ps256_mask">,
   3744           Intrinsic<[llvm_v8f32_ty],
   3745           [llvm_v8i32_ty, llvm_v8f32_ty,  llvm_i8_ty],
   3746           [IntrNoMem]>;
   3747 
   3748   def int_x86_avx512_mask_cvtdq2ps_512 :
   3749         GCCBuiltin<"__builtin_ia32_cvtdq2ps512_mask">,
   3750           Intrinsic<[llvm_v16f32_ty],
   3751           [llvm_v16i32_ty, llvm_v16f32_ty,  llvm_i16_ty,  llvm_i32_ty],
   3752           [IntrNoMem]>;
   3753 
   3754   def int_x86_avx512_mask_cvtpd2dq_128 :
   3755         GCCBuiltin<"__builtin_ia32_cvtpd2dq128_mask">,
   3756           Intrinsic<[llvm_v4i32_ty],
   3757           [llvm_v2f64_ty, llvm_v4i32_ty,  llvm_i8_ty],
   3758           [IntrNoMem]>;
   3759 
   3760   def int_x86_avx512_mask_cvtpd2dq_256 :
   3761         GCCBuiltin<"__builtin_ia32_cvtpd2dq256_mask">,
   3762           Intrinsic<[llvm_v4i32_ty],
   3763           [llvm_v4f64_ty, llvm_v4i32_ty,  llvm_i8_ty],
   3764           [IntrNoMem]>;
   3765 
   3766   def int_x86_avx512_mask_cvtpd2dq_512 :
   3767         GCCBuiltin<"__builtin_ia32_cvtpd2dq512_mask">,
   3768           Intrinsic<[llvm_v8i32_ty],
   3769           [llvm_v8f64_ty, llvm_v8i32_ty,  llvm_i8_ty,  llvm_i32_ty],
   3770           [IntrNoMem]>;
   3771 
   3772   def int_x86_avx512_mask_cvtpd2ps_256 :
   3773         GCCBuiltin<"__builtin_ia32_cvtpd2ps256_mask">,
   3774           Intrinsic<[llvm_v4f32_ty],
   3775           [llvm_v4f64_ty, llvm_v4f32_ty,  llvm_i8_ty],
   3776           [IntrNoMem]>;
   3777 
   3778   def int_x86_avx512_mask_cvtpd2ps_512 :
   3779         GCCBuiltin<"__builtin_ia32_cvtpd2ps512_mask">,
   3780           Intrinsic<[llvm_v8f32_ty],
   3781           [llvm_v8f64_ty, llvm_v8f32_ty,  llvm_i8_ty,  llvm_i32_ty],
   3782           [IntrNoMem]>;
   3783 
   3784   def int_x86_avx512_mask_cvtsd2ss_round :
   3785         GCCBuiltin<"__builtin_ia32_cvtsd2ss_round_mask">,
   3786           Intrinsic<[llvm_v4f32_ty],
   3787           [llvm_v4f32_ty, llvm_v2f64_ty, llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty],
   3788           [IntrNoMem]>;
   3789 
   3790   def int_x86_avx512_mask_cvtss2sd_round :
   3791         GCCBuiltin<"__builtin_ia32_cvtss2sd_round_mask">,
   3792           Intrinsic<[llvm_v2f64_ty],
   3793           [llvm_v2f64_ty, llvm_v4f32_ty, llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty],
   3794           [IntrNoMem]>;
   3795 
   3796   def int_x86_avx512_mask_cvtpd2ps :
   3797         GCCBuiltin<"__builtin_ia32_cvtpd2ps_mask">,
   3798           Intrinsic<[llvm_v4f32_ty],
   3799           [llvm_v2f64_ty, llvm_v4f32_ty,  llvm_i8_ty],
   3800           [IntrNoMem]>;
   3801 
   3802   def int_x86_avx512_mask_cvtpd2qq_128 :
   3803         GCCBuiltin<"__builtin_ia32_cvtpd2qq128_mask">,
   3804           Intrinsic<[llvm_v2i64_ty],
   3805           [llvm_v2f64_ty, llvm_v2i64_ty,  llvm_i8_ty],
   3806           [IntrNoMem]>;
   3807 
   3808   def int_x86_avx512_mask_cvtpd2qq_256 :
   3809         GCCBuiltin<"__builtin_ia32_cvtpd2qq256_mask">,
   3810           Intrinsic<[llvm_v4i64_ty],
   3811           [llvm_v4f64_ty, llvm_v4i64_ty,  llvm_i8_ty],
   3812           [IntrNoMem]>;
   3813 
   3814   def int_x86_avx512_mask_cvtpd2qq_512 :
   3815         GCCBuiltin<"__builtin_ia32_cvtpd2qq512_mask">,
   3816           Intrinsic<[llvm_v8i64_ty],
   3817           [llvm_v8f64_ty, llvm_v8i64_ty,  llvm_i8_ty,  llvm_i32_ty],
   3818           [IntrNoMem]>;
   3819 
   3820   def int_x86_avx512_mask_cvtpd2udq_128 :
   3821         GCCBuiltin<"__builtin_ia32_cvtpd2udq128_mask">,
   3822           Intrinsic<[llvm_v4i32_ty],
   3823           [llvm_v2f64_ty, llvm_v4i32_ty,  llvm_i8_ty],
   3824           [IntrNoMem]>;
   3825 
   3826   def int_x86_avx512_mask_cvtpd2udq_256 :
   3827         GCCBuiltin<"__builtin_ia32_cvtpd2udq256_mask">,
   3828           Intrinsic<[llvm_v4i32_ty],
   3829           [llvm_v4f64_ty, llvm_v4i32_ty,  llvm_i8_ty],
   3830           [IntrNoMem]>;
   3831 
   3832   def int_x86_avx512_mask_cvtpd2udq_512 :
   3833         GCCBuiltin<"__builtin_ia32_cvtpd2udq512_mask">,
   3834           Intrinsic<[llvm_v8i32_ty],
   3835           [llvm_v8f64_ty, llvm_v8i32_ty,  llvm_i8_ty,  llvm_i32_ty],
   3836           [IntrNoMem]>;
   3837 
   3838   def int_x86_avx512_mask_cvtpd2uqq_128 :
   3839         GCCBuiltin<"__builtin_ia32_cvtpd2uqq128_mask">,
   3840           Intrinsic<[llvm_v2i64_ty],
   3841           [llvm_v2f64_ty, llvm_v2i64_ty,  llvm_i8_ty],
   3842           [IntrNoMem]>;
   3843 
   3844   def int_x86_avx512_mask_cvtpd2uqq_256 :
   3845         GCCBuiltin<"__builtin_ia32_cvtpd2uqq256_mask">,
   3846           Intrinsic<[llvm_v4i64_ty],
   3847           [llvm_v4f64_ty, llvm_v4i64_ty,  llvm_i8_ty],
   3848           [IntrNoMem]>;
   3849 
   3850   def int_x86_avx512_mask_cvtpd2uqq_512 :
   3851         GCCBuiltin<"__builtin_ia32_cvtpd2uqq512_mask">,
   3852           Intrinsic<[llvm_v8i64_ty],
   3853           [llvm_v8f64_ty, llvm_v8i64_ty,  llvm_i8_ty,  llvm_i32_ty],
   3854           [IntrNoMem]>;
   3855 
   3856   def int_x86_avx512_mask_cvtps2dq_128 :
   3857         GCCBuiltin<"__builtin_ia32_cvtps2dq128_mask">,
   3858           Intrinsic<[llvm_v4i32_ty],
   3859           [llvm_v4f32_ty, llvm_v4i32_ty,  llvm_i8_ty],
   3860           [IntrNoMem]>;
   3861 
   3862   def int_x86_avx512_mask_cvtps2dq_256 :
   3863         GCCBuiltin<"__builtin_ia32_cvtps2dq256_mask">,
   3864           Intrinsic<[llvm_v8i32_ty],
   3865           [llvm_v8f32_ty, llvm_v8i32_ty,  llvm_i8_ty],
   3866           [IntrNoMem]>;
   3867 
   3868   def int_x86_avx512_mask_cvtps2dq_512 :
   3869         GCCBuiltin<"__builtin_ia32_cvtps2dq512_mask">,
   3870           Intrinsic<[llvm_v16i32_ty],
   3871           [llvm_v16f32_ty, llvm_v16i32_ty,  llvm_i16_ty,  llvm_i32_ty],
   3872           [IntrNoMem]>;
   3873 
   3874   def int_x86_avx512_mask_cvtps2pd_128 :
   3875         GCCBuiltin<"__builtin_ia32_cvtps2pd128_mask">,
   3876           Intrinsic<[llvm_v2f64_ty],
   3877           [llvm_v4f32_ty, llvm_v2f64_ty,  llvm_i8_ty],
   3878           [IntrNoMem]>;
   3879 
   3880   def int_x86_avx512_mask_cvtps2pd_256 :
   3881         GCCBuiltin<"__builtin_ia32_cvtps2pd256_mask">,
   3882           Intrinsic<[llvm_v4f64_ty],
   3883           [llvm_v4f32_ty, llvm_v4f64_ty,  llvm_i8_ty],
   3884           [IntrNoMem]>;
   3885 
   3886   def int_x86_avx512_mask_cvtps2pd_512 :
   3887         GCCBuiltin<"__builtin_ia32_cvtps2pd512_mask">,
   3888           Intrinsic<[llvm_v8f64_ty],
   3889           [llvm_v8f32_ty, llvm_v8f64_ty,  llvm_i8_ty,  llvm_i32_ty],
   3890           [IntrNoMem]>;
   3891 
   3892   def int_x86_avx512_mask_cvtps2qq_128 :
   3893         GCCBuiltin<"__builtin_ia32_cvtps2qq128_mask">,
   3894           Intrinsic<[llvm_v2i64_ty],
   3895           [llvm_v4f32_ty, llvm_v2i64_ty,  llvm_i8_ty],
   3896           [IntrNoMem]>;
   3897 
   3898   def int_x86_avx512_mask_cvtps2qq_256 :
   3899         GCCBuiltin<"__builtin_ia32_cvtps2qq256_mask">,
   3900           Intrinsic<[llvm_v4i64_ty],
   3901           [llvm_v4f32_ty, llvm_v4i64_ty,  llvm_i8_ty],
   3902           [IntrNoMem]>;
   3903 
   3904   def int_x86_avx512_mask_cvtps2qq_512 :
   3905         GCCBuiltin<"__builtin_ia32_cvtps2qq512_mask">,
   3906           Intrinsic<[llvm_v8i64_ty],
   3907           [llvm_v8f32_ty, llvm_v8i64_ty,  llvm_i8_ty,  llvm_i32_ty],
   3908           [IntrNoMem]>;
   3909 
   3910   def int_x86_avx512_mask_cvtps2udq_128 :
   3911         GCCBuiltin<"__builtin_ia32_cvtps2udq128_mask">,
   3912           Intrinsic<[llvm_v4i32_ty],
   3913           [llvm_v4f32_ty, llvm_v4i32_ty,  llvm_i8_ty],
   3914           [IntrNoMem]>;
   3915 
   3916   def int_x86_avx512_mask_cvtps2udq_256 :
   3917         GCCBuiltin<"__builtin_ia32_cvtps2udq256_mask">,
   3918           Intrinsic<[llvm_v8i32_ty],
   3919           [llvm_v8f32_ty, llvm_v8i32_ty,  llvm_i8_ty],
   3920           [IntrNoMem]>;
   3921 
   3922   def int_x86_avx512_mask_cvtps2udq_512 :
   3923         GCCBuiltin<"__builtin_ia32_cvtps2udq512_mask">,
   3924           Intrinsic<[llvm_v16i32_ty],
   3925           [llvm_v16f32_ty, llvm_v16i32_ty,  llvm_i16_ty,  llvm_i32_ty],
   3926           [IntrNoMem]>;
   3927 
   3928   def int_x86_avx512_mask_cvtps2uqq_128 :
   3929         GCCBuiltin<"__builtin_ia32_cvtps2uqq128_mask">,
   3930           Intrinsic<[llvm_v2i64_ty],
   3931           [llvm_v4f32_ty, llvm_v2i64_ty,  llvm_i8_ty],
   3932           [IntrNoMem]>;
   3933 
   3934   def int_x86_avx512_mask_cvtps2uqq_256 :
   3935         GCCBuiltin<"__builtin_ia32_cvtps2uqq256_mask">,
   3936           Intrinsic<[llvm_v4i64_ty],
   3937           [llvm_v4f32_ty, llvm_v4i64_ty,  llvm_i8_ty],
   3938           [IntrNoMem]>;
   3939 
   3940   def int_x86_avx512_mask_cvtps2uqq_512 :
   3941         GCCBuiltin<"__builtin_ia32_cvtps2uqq512_mask">,
   3942           Intrinsic<[llvm_v8i64_ty],
   3943           [llvm_v8f32_ty, llvm_v8i64_ty,  llvm_i8_ty,  llvm_i32_ty],
   3944           [IntrNoMem]>;
   3945 
   3946   def int_x86_avx512_mask_cvtqq2pd_128 :
   3947         GCCBuiltin<"__builtin_ia32_cvtqq2pd128_mask">,
   3948           Intrinsic<[llvm_v2f64_ty],
   3949           [llvm_v2i64_ty, llvm_v2f64_ty,  llvm_i8_ty],
   3950           [IntrNoMem]>;
   3951 
   3952   def int_x86_avx512_mask_cvtqq2pd_256 :
   3953         GCCBuiltin<"__builtin_ia32_cvtqq2pd256_mask">,
   3954           Intrinsic<[llvm_v4f64_ty],
   3955           [llvm_v4i64_ty, llvm_v4f64_ty,  llvm_i8_ty],
   3956           [IntrNoMem]>;
   3957 
   3958   def int_x86_avx512_mask_cvtqq2pd_512 :
   3959         GCCBuiltin<"__builtin_ia32_cvtqq2pd512_mask">,
   3960           Intrinsic<[llvm_v8f64_ty],
   3961           [llvm_v8i64_ty, llvm_v8f64_ty,  llvm_i8_ty,  llvm_i32_ty],
   3962           [IntrNoMem]>;
   3963 
   3964   def int_x86_avx512_mask_cvtqq2ps_128 :
   3965         GCCBuiltin<"__builtin_ia32_cvtqq2ps128_mask">,
   3966           Intrinsic<[llvm_v4f32_ty],
   3967           [llvm_v2i64_ty, llvm_v4f32_ty,  llvm_i8_ty],
   3968           [IntrNoMem]>;
   3969 
   3970   def int_x86_avx512_mask_cvtqq2ps_256 :
   3971         GCCBuiltin<"__builtin_ia32_cvtqq2ps256_mask">,
   3972           Intrinsic<[llvm_v4f32_ty],
   3973           [llvm_v4i64_ty, llvm_v4f32_ty,  llvm_i8_ty],
   3974           [IntrNoMem]>;
   3975 
   3976   def int_x86_avx512_mask_cvtqq2ps_512 :
   3977         GCCBuiltin<"__builtin_ia32_cvtqq2ps512_mask">,
   3978           Intrinsic<[llvm_v8f32_ty],
   3979           [llvm_v8i64_ty, llvm_v8f32_ty,  llvm_i8_ty,  llvm_i32_ty],
   3980           [IntrNoMem]>;
   3981 
   3982   def int_x86_avx512_mask_cvttpd2dq_128 :
   3983         GCCBuiltin<"__builtin_ia32_cvttpd2dq128_mask">,
   3984           Intrinsic<[llvm_v4i32_ty],
   3985           [llvm_v2f64_ty, llvm_v4i32_ty,  llvm_i8_ty],
   3986           [IntrNoMem]>;
   3987 
   3988   def int_x86_avx512_mask_cvttpd2dq_256 :
   3989         GCCBuiltin<"__builtin_ia32_cvttpd2dq256_mask">,
   3990           Intrinsic<[llvm_v4i32_ty],
   3991           [llvm_v4f64_ty, llvm_v4i32_ty,  llvm_i8_ty],
   3992           [IntrNoMem]>;
   3993 
   3994   def int_x86_avx512_mask_cvttpd2dq_512 :
   3995         GCCBuiltin<"__builtin_ia32_cvttpd2dq512_mask">,
   3996           Intrinsic<[llvm_v8i32_ty],
   3997           [llvm_v8f64_ty, llvm_v8i32_ty,  llvm_i8_ty,  llvm_i32_ty],
   3998           [IntrNoMem]>;
   3999 
   4000   def int_x86_avx512_mask_cvttpd2qq_128 :
   4001         GCCBuiltin<"__builtin_ia32_cvttpd2qq128_mask">,
   4002           Intrinsic<[llvm_v2i64_ty],
   4003           [llvm_v2f64_ty, llvm_v2i64_ty,  llvm_i8_ty],
   4004           [IntrNoMem]>;
   4005 
   4006   def int_x86_avx512_mask_cvttpd2qq_256 :
   4007         GCCBuiltin<"__builtin_ia32_cvttpd2qq256_mask">,
   4008           Intrinsic<[llvm_v4i64_ty],
   4009           [llvm_v4f64_ty, llvm_v4i64_ty,  llvm_i8_ty],
   4010           [IntrNoMem]>;
   4011 
   4012   def int_x86_avx512_mask_cvttpd2qq_512 :
   4013         GCCBuiltin<"__builtin_ia32_cvttpd2qq512_mask">,
   4014           Intrinsic<[llvm_v8i64_ty],
   4015           [llvm_v8f64_ty, llvm_v8i64_ty,  llvm_i8_ty,  llvm_i32_ty],
   4016           [IntrNoMem]>;
   4017 
   4018   def int_x86_avx512_mask_cvttpd2udq_128 :
   4019         GCCBuiltin<"__builtin_ia32_cvttpd2udq128_mask">,
   4020           Intrinsic<[llvm_v4i32_ty],
   4021           [llvm_v2f64_ty, llvm_v4i32_ty,  llvm_i8_ty],
   4022           [IntrNoMem]>;
   4023 
   4024   def int_x86_avx512_mask_cvttpd2udq_256 :
   4025         GCCBuiltin<"__builtin_ia32_cvttpd2udq256_mask">,
   4026           Intrinsic<[llvm_v4i32_ty],
   4027           [llvm_v4f64_ty, llvm_v4i32_ty,  llvm_i8_ty],
   4028           [IntrNoMem]>;
   4029 
   4030   def int_x86_avx512_mask_cvttpd2udq_512 :
   4031         GCCBuiltin<"__builtin_ia32_cvttpd2udq512_mask">,
   4032           Intrinsic<[llvm_v8i32_ty],
   4033           [llvm_v8f64_ty, llvm_v8i32_ty,  llvm_i8_ty,  llvm_i32_ty],
   4034           [IntrNoMem]>;
   4035 
   4036   def int_x86_avx512_mask_cvttpd2uqq_128 :
   4037         GCCBuiltin<"__builtin_ia32_cvttpd2uqq128_mask">,
   4038           Intrinsic<[llvm_v2i64_ty],
   4039           [llvm_v2f64_ty, llvm_v2i64_ty,  llvm_i8_ty],
   4040           [IntrNoMem]>;
   4041 
   4042   def int_x86_avx512_mask_cvttpd2uqq_256 :
   4043         GCCBuiltin<"__builtin_ia32_cvttpd2uqq256_mask">,
   4044           Intrinsic<[llvm_v4i64_ty],
   4045           [llvm_v4f64_ty, llvm_v4i64_ty,  llvm_i8_ty],
   4046           [IntrNoMem]>;
   4047 
   4048   def int_x86_avx512_mask_cvttpd2uqq_512 :
   4049         GCCBuiltin<"__builtin_ia32_cvttpd2uqq512_mask">,
   4050           Intrinsic<[llvm_v8i64_ty],
   4051           [llvm_v8f64_ty, llvm_v8i64_ty,  llvm_i8_ty,  llvm_i32_ty],
   4052           [IntrNoMem]>;
   4053 
   4054   def int_x86_avx512_mask_cvttps2dq_128 :
   4055         GCCBuiltin<"__builtin_ia32_cvttps2dq128_mask">,
   4056           Intrinsic<[llvm_v4i32_ty],
   4057           [llvm_v4f32_ty, llvm_v4i32_ty,  llvm_i8_ty],
   4058           [IntrNoMem]>;
   4059 
   4060   def int_x86_avx512_mask_cvttps2dq_256 :
   4061         GCCBuiltin<"__builtin_ia32_cvttps2dq256_mask">,
   4062           Intrinsic<[llvm_v8i32_ty],
   4063           [llvm_v8f32_ty, llvm_v8i32_ty,  llvm_i8_ty],
   4064           [IntrNoMem]>;
   4065 
   4066   def int_x86_avx512_mask_cvttps2dq_512 :
   4067         GCCBuiltin<"__builtin_ia32_cvttps2dq512_mask">,
   4068           Intrinsic<[llvm_v16i32_ty],
   4069           [llvm_v16f32_ty, llvm_v16i32_ty,  llvm_i16_ty,  llvm_i32_ty],
   4070           [IntrNoMem]>;
   4071 
   4072   def int_x86_avx512_mask_cvttps2qq_128 :
   4073         GCCBuiltin<"__builtin_ia32_cvttps2qq128_mask">,
   4074           Intrinsic<[llvm_v2i64_ty],
   4075           [llvm_v4f32_ty, llvm_v2i64_ty,  llvm_i8_ty],
   4076           [IntrNoMem]>;
   4077 
   4078   def int_x86_avx512_mask_cvttps2qq_256 :
   4079         GCCBuiltin<"__builtin_ia32_cvttps2qq256_mask">,
   4080           Intrinsic<[llvm_v4i64_ty],
   4081           [llvm_v4f32_ty, llvm_v4i64_ty,  llvm_i8_ty],
   4082           [IntrNoMem]>;
   4083 
   4084   def int_x86_avx512_mask_cvttps2qq_512 :
   4085         GCCBuiltin<"__builtin_ia32_cvttps2qq512_mask">,
   4086           Intrinsic<[llvm_v8i64_ty],
   4087           [llvm_v8f32_ty, llvm_v8i64_ty,  llvm_i8_ty,  llvm_i32_ty],
   4088           [IntrNoMem]>;
   4089 
   4090   def int_x86_avx512_mask_cvttps2udq_128 :
   4091         GCCBuiltin<"__builtin_ia32_cvttps2udq128_mask">,
   4092           Intrinsic<[llvm_v4i32_ty],
   4093           [llvm_v4f32_ty, llvm_v4i32_ty,  llvm_i8_ty],
   4094           [IntrNoMem]>;
   4095 
   4096   def int_x86_avx512_mask_cvttps2udq_256 :
   4097         GCCBuiltin<"__builtin_ia32_cvttps2udq256_mask">,
   4098           Intrinsic<[llvm_v8i32_ty],
   4099           [llvm_v8f32_ty, llvm_v8i32_ty,  llvm_i8_ty],
   4100           [IntrNoMem]>;
   4101 
   4102   def int_x86_avx512_mask_cvttps2udq_512 :
   4103         GCCBuiltin<"__builtin_ia32_cvttps2udq512_mask">,
   4104           Intrinsic<[llvm_v16i32_ty],
   4105           [llvm_v16f32_ty, llvm_v16i32_ty,  llvm_i16_ty,  llvm_i32_ty],
   4106           [IntrNoMem]>;
   4107 
   4108   def int_x86_avx512_mask_cvttps2uqq_128 :
   4109         GCCBuiltin<"__builtin_ia32_cvttps2uqq128_mask">,
   4110           Intrinsic<[llvm_v2i64_ty],
   4111           [llvm_v4f32_ty, llvm_v2i64_ty,  llvm_i8_ty],
   4112           [IntrNoMem]>;
   4113 
   4114   def int_x86_avx512_mask_cvttps2uqq_256 :
   4115         GCCBuiltin<"__builtin_ia32_cvttps2uqq256_mask">,
   4116           Intrinsic<[llvm_v4i64_ty],
   4117           [llvm_v4f32_ty, llvm_v4i64_ty,  llvm_i8_ty],
   4118           [IntrNoMem]>;
   4119 
   4120   def int_x86_avx512_mask_cvttps2uqq_512 :
   4121         GCCBuiltin<"__builtin_ia32_cvttps2uqq512_mask">,
   4122           Intrinsic<[llvm_v8i64_ty],
   4123           [llvm_v8f32_ty, llvm_v8i64_ty,  llvm_i8_ty,  llvm_i32_ty],
   4124           [IntrNoMem]>;
   4125 
   4126   def int_x86_avx512_mask_cvtudq2ps_128 :
   4127         GCCBuiltin<"__builtin_ia32_cvtudq2ps128_mask">,
   4128           Intrinsic<[llvm_v4f32_ty],
   4129           [llvm_v4i32_ty, llvm_v4f32_ty,  llvm_i8_ty],
   4130           [IntrNoMem]>;
   4131 
   4132   def int_x86_avx512_mask_cvtudq2ps_256 :
   4133         GCCBuiltin<"__builtin_ia32_cvtudq2ps256_mask">,
   4134           Intrinsic<[llvm_v8f32_ty],
   4135           [llvm_v8i32_ty, llvm_v8f32_ty,  llvm_i8_ty],
   4136           [IntrNoMem]>;
   4137 
   4138   def int_x86_avx512_mask_cvtudq2ps_512 :
   4139         GCCBuiltin<"__builtin_ia32_cvtudq2ps512_mask">,
   4140           Intrinsic<[llvm_v16f32_ty],
   4141           [llvm_v16i32_ty, llvm_v16f32_ty,  llvm_i16_ty,  llvm_i32_ty],
   4142           [IntrNoMem]>;
   4143 
   4144   def int_x86_avx512_mask_cvtuqq2pd_128 :
   4145         GCCBuiltin<"__builtin_ia32_cvtuqq2pd128_mask">,
   4146           Intrinsic<[llvm_v2f64_ty],
   4147           [llvm_v2i64_ty, llvm_v2f64_ty,  llvm_i8_ty],
   4148           [IntrNoMem]>;
   4149 
   4150   def int_x86_avx512_mask_cvtuqq2pd_256 :
   4151         GCCBuiltin<"__builtin_ia32_cvtuqq2pd256_mask">,
   4152           Intrinsic<[llvm_v4f64_ty],
   4153           [llvm_v4i64_ty, llvm_v4f64_ty,  llvm_i8_ty],
   4154           [IntrNoMem]>;
   4155 
   4156   def int_x86_avx512_mask_cvtuqq2pd_512 :
   4157         GCCBuiltin<"__builtin_ia32_cvtuqq2pd512_mask">,
   4158           Intrinsic<[llvm_v8f64_ty],
   4159           [llvm_v8i64_ty, llvm_v8f64_ty,  llvm_i8_ty,  llvm_i32_ty],
   4160           [IntrNoMem]>;
   4161 
   4162   def int_x86_avx512_mask_cvtuqq2ps_128 :
   4163         GCCBuiltin<"__builtin_ia32_cvtuqq2ps128_mask">,
   4164           Intrinsic<[llvm_v4f32_ty],
   4165           [llvm_v2i64_ty, llvm_v4f32_ty,  llvm_i8_ty],
   4166           [IntrNoMem]>;
   4167 
   4168   def int_x86_avx512_mask_cvtuqq2ps_256 :
   4169         GCCBuiltin<"__builtin_ia32_cvtuqq2ps256_mask">,
   4170           Intrinsic<[llvm_v4f32_ty],
   4171           [llvm_v4i64_ty, llvm_v4f32_ty,  llvm_i8_ty],
   4172           [IntrNoMem]>;
   4173 
   4174   def int_x86_avx512_mask_cvtuqq2ps_512 :
   4175         GCCBuiltin<"__builtin_ia32_cvtuqq2ps512_mask">,
   4176           Intrinsic<[llvm_v8f32_ty],
   4177           [llvm_v8i64_ty, llvm_v8f32_ty,  llvm_i8_ty,  llvm_i32_ty],
   4178           [IntrNoMem]>;
   4179 
   4180   def int_x86_avx512_mask_rndscale_pd_128 : GCCBuiltin<"__builtin_ia32_rndscalepd_128_mask">,
   4181         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_i32_ty,
   4182                                      llvm_v2f64_ty,  llvm_i8_ty], [IntrNoMem]>;
   4183   def int_x86_avx512_mask_rndscale_pd_256 : GCCBuiltin<"__builtin_ia32_rndscalepd_256_mask">,
   4184         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_i32_ty,
   4185                                      llvm_v4f64_ty,  llvm_i8_ty], [IntrNoMem]>;
   4186   def int_x86_avx512_mask_rndscale_pd_512 : GCCBuiltin<"__builtin_ia32_rndscalepd_mask">,
   4187         Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_i32_ty, llvm_v8f64_ty,
   4188                                      llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4189   def int_x86_avx512_mask_rndscale_ps_128 : GCCBuiltin<"__builtin_ia32_rndscaleps_128_mask">,
   4190         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_i32_ty,
   4191                                      llvm_v4f32_ty,  llvm_i8_ty], [IntrNoMem]>;
   4192   def int_x86_avx512_mask_rndscale_ps_256 : GCCBuiltin<"__builtin_ia32_rndscaleps_256_mask">,
   4193         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_i32_ty,
   4194                                      llvm_v8f32_ty,  llvm_i8_ty], [IntrNoMem]>;
   4195   def int_x86_avx512_mask_rndscale_ps_512 : GCCBuiltin<"__builtin_ia32_rndscaleps_mask">,
   4196         Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_i32_ty, llvm_v16f32_ty,
   4197                                      llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4198   def int_x86_avx512_mask_reduce_pd_128 : GCCBuiltin<"__builtin_ia32_reducepd128_mask">,
   4199         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_i32_ty,
   4200                                      llvm_v2f64_ty,  llvm_i8_ty], [IntrNoMem]>;
   4201   def int_x86_avx512_mask_reduce_pd_256 : GCCBuiltin<"__builtin_ia32_reducepd256_mask">,
   4202         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_i32_ty,
   4203                                      llvm_v4f64_ty,  llvm_i8_ty], [IntrNoMem]>;
   4204   def int_x86_avx512_mask_reduce_pd_512 : GCCBuiltin<"__builtin_ia32_reducepd512_mask">,
   4205         Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_i32_ty, llvm_v8f64_ty,
   4206                                      llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4207   def int_x86_avx512_mask_reduce_ps_128 : GCCBuiltin<"__builtin_ia32_reduceps128_mask">,
   4208         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_i32_ty,
   4209                                      llvm_v4f32_ty,  llvm_i8_ty], [IntrNoMem]>;
   4210   def int_x86_avx512_mask_reduce_ps_256 : GCCBuiltin<"__builtin_ia32_reduceps256_mask">,
   4211         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_i32_ty,
   4212                                      llvm_v8f32_ty,  llvm_i8_ty], [IntrNoMem]>;
   4213   def int_x86_avx512_mask_reduce_ps_512 : GCCBuiltin<"__builtin_ia32_reduceps512_mask">,
   4214         Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_i32_ty, llvm_v16f32_ty,
   4215                                      llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4216 def int_x86_avx512_mask_range_pd_128 : GCCBuiltin<"__builtin_ia32_rangepd128_mask">,
   4217         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i32_ty,
   4218                                     llvm_v2f64_ty,  llvm_i8_ty], [IntrNoMem]>;
   4219 def int_x86_avx512_mask_range_pd_256 : GCCBuiltin<"__builtin_ia32_rangepd256_mask">,
   4220         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty, llvm_i32_ty,
   4221                                     llvm_v4f64_ty,  llvm_i8_ty], [IntrNoMem]>;
   4222 def int_x86_avx512_mask_range_pd_512 : GCCBuiltin<"__builtin_ia32_rangepd512_mask">,
   4223         Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty, llvm_i32_ty,
   4224                                     llvm_v8f64_ty,  llvm_i8_ty,  llvm_i32_ty], [IntrNoMem]>;
   4225 def int_x86_avx512_mask_range_ps_128 : GCCBuiltin<"__builtin_ia32_rangeps128_mask">,
   4226         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty,
   4227                                     llvm_v4f32_ty,  llvm_i8_ty], [IntrNoMem]>;
   4228 def int_x86_avx512_mask_range_ps_256 : GCCBuiltin<"__builtin_ia32_rangeps256_mask">,
   4229         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty, llvm_i32_ty,
   4230                                     llvm_v8f32_ty,  llvm_i8_ty], [IntrNoMem]>;
   4231 def int_x86_avx512_mask_range_ps_512 : GCCBuiltin<"__builtin_ia32_rangeps512_mask">,
   4232         Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty, llvm_i32_ty,
   4233                                      llvm_v16f32_ty,  llvm_i16_ty,  llvm_i32_ty], [IntrNoMem]>;
   4234 }
   4235 
   4236 // Vector load with broadcast
   4237 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   4238   // TODO: Remove the broadcast intrinsics with no gcc builtin and autoupgrade
   4239   def int_x86_avx512_vbroadcast_ss_512 :
   4240         Intrinsic<[llvm_v16f32_ty], [llvm_ptr_ty], [IntrReadMem, IntrArgMemOnly]>;
   4241 
   4242   def int_x86_avx512_vbroadcast_sd_512 :
   4243         Intrinsic<[llvm_v8f64_ty], [llvm_ptr_ty], [IntrReadMem, IntrArgMemOnly]>;
   4244 
   4245    def int_x86_avx512_broadcastmw_512 :
   4246           GCCBuiltin<"__builtin_ia32_broadcastmw512">,
   4247           Intrinsic<[llvm_v16i32_ty], [llvm_i16_ty], [IntrNoMem]>;
   4248    def int_x86_avx512_broadcastmw_256 :
   4249           GCCBuiltin<"__builtin_ia32_broadcastmw256">,
   4250           Intrinsic<[llvm_v8i32_ty], [llvm_i16_ty], [IntrNoMem]>;
   4251    def int_x86_avx512_broadcastmw_128 :
   4252           GCCBuiltin<"__builtin_ia32_broadcastmw128">,
   4253           Intrinsic<[llvm_v4i32_ty], [llvm_i16_ty], [IntrNoMem]>;
   4254    def int_x86_avx512_broadcastmb_512 :
   4255           GCCBuiltin<"__builtin_ia32_broadcastmb512">,
   4256           Intrinsic<[llvm_v8i64_ty], [llvm_i8_ty], [IntrNoMem]>;
   4257    def int_x86_avx512_broadcastmb_256 :
   4258           GCCBuiltin<"__builtin_ia32_broadcastmb256">,
   4259           Intrinsic<[llvm_v4i64_ty], [llvm_i8_ty], [IntrNoMem]>;
   4260    def int_x86_avx512_broadcastmb_128 :
   4261           GCCBuiltin<"__builtin_ia32_broadcastmb128">,
   4262           Intrinsic<[llvm_v2i64_ty], [llvm_i8_ty], [IntrNoMem]>;
   4263 }
   4264 
   4265 // Arithmetic ops
   4266 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   4267 
   4268   def int_x86_avx512_mask_add_ps_512 : GCCBuiltin<"__builtin_ia32_addps512_mask">,
   4269           Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   4270                      llvm_v16f32_ty, llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4271   def int_x86_avx512_mask_add_pd_512 : GCCBuiltin<"__builtin_ia32_addpd512_mask">,
   4272           Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   4273                      llvm_v8f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4274   def int_x86_avx512_mask_sub_ps_512 : GCCBuiltin<"__builtin_ia32_subps512_mask">,
   4275           Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   4276                      llvm_v16f32_ty, llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4277   def int_x86_avx512_mask_sub_pd_512 : GCCBuiltin<"__builtin_ia32_subpd512_mask">,
   4278           Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   4279                      llvm_v8f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4280   def int_x86_avx512_mask_mul_ps_512 : GCCBuiltin<"__builtin_ia32_mulps512_mask">,
   4281           Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   4282                      llvm_v16f32_ty, llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4283   def int_x86_avx512_mask_mul_pd_512 : GCCBuiltin<"__builtin_ia32_mulpd512_mask">,
   4284           Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   4285                      llvm_v8f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4286   def int_x86_avx512_mask_div_ps_512 : GCCBuiltin<"__builtin_ia32_divps512_mask">,
   4287           Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   4288                      llvm_v16f32_ty, llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4289   def int_x86_avx512_mask_div_pd_512 : GCCBuiltin<"__builtin_ia32_divpd512_mask">,
   4290           Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   4291                      llvm_v8f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4292   def int_x86_avx512_mask_max_ps_512 : GCCBuiltin<"__builtin_ia32_maxps512_mask">,
   4293           Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   4294                      llvm_v16f32_ty, llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4295   def int_x86_avx512_mask_max_pd_512 : GCCBuiltin<"__builtin_ia32_maxpd512_mask">,
   4296           Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   4297                      llvm_v8f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4298   def int_x86_avx512_mask_min_ps_512 : GCCBuiltin<"__builtin_ia32_minps512_mask">,
   4299           Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   4300                      llvm_v16f32_ty, llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4301   def int_x86_avx512_mask_min_pd_512 : GCCBuiltin<"__builtin_ia32_minpd512_mask">,
   4302           Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   4303                      llvm_v8f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4304 
   4305   def int_x86_avx512_mask_add_ss_round : GCCBuiltin<"__builtin_ia32_addss_round_mask">,
   4306           Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   4307                      llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4308   def int_x86_avx512_mask_div_ss_round : GCCBuiltin<"__builtin_ia32_divss_round_mask">,
   4309           Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   4310                      llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4311   def int_x86_avx512_mask_mul_ss_round : GCCBuiltin<"__builtin_ia32_mulss_round_mask">,
   4312           Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   4313                      llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4314   def int_x86_avx512_mask_sub_ss_round : GCCBuiltin<"__builtin_ia32_subss_round_mask">,
   4315           Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   4316                      llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4317   def int_x86_avx512_mask_max_ss_round : GCCBuiltin<"__builtin_ia32_maxss_round_mask">,
   4318           Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   4319                      llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4320   def int_x86_avx512_mask_min_ss_round : GCCBuiltin<"__builtin_ia32_minss_round_mask">,
   4321           Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   4322                      llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4323   def int_x86_avx512_mask_add_sd_round : GCCBuiltin<"__builtin_ia32_addsd_round_mask">,
   4324           Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   4325                      llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4326   def int_x86_avx512_mask_div_sd_round : GCCBuiltin<"__builtin_ia32_divsd_round_mask">,
   4327           Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   4328                      llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4329   def int_x86_avx512_mask_mul_sd_round : GCCBuiltin<"__builtin_ia32_mulsd_round_mask">,
   4330           Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   4331                      llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4332   def int_x86_avx512_mask_sub_sd_round : GCCBuiltin<"__builtin_ia32_subsd_round_mask">,
   4333           Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   4334                      llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4335   def int_x86_avx512_mask_max_sd_round : GCCBuiltin<"__builtin_ia32_maxsd_round_mask">,
   4336           Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   4337                      llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4338   def int_x86_avx512_mask_min_sd_round : GCCBuiltin<"__builtin_ia32_minsd_round_mask">,
   4339           Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   4340                      llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4341 
   4342   def int_x86_avx512_mask_rndscale_ss : GCCBuiltin<"__builtin_ia32_rndscaless_round_mask">,
   4343           Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
   4344                                      llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
   4345                                      [IntrNoMem]>;
   4346   def int_x86_avx512_mask_rndscale_sd : GCCBuiltin<"__builtin_ia32_rndscalesd_round_mask">,
   4347           Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
   4348                                       llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
   4349                                      [IntrNoMem]>;
   4350   def int_x86_avx512_mask_range_ss : GCCBuiltin<"__builtin_ia32_rangess128_round_mask">,
   4351           Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
   4352                                      llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
   4353                                      [IntrNoMem]>;
   4354   def int_x86_avx512_mask_range_sd : GCCBuiltin<"__builtin_ia32_rangesd128_round_mask">,
   4355           Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
   4356                                       llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
   4357                                      [IntrNoMem]>;
   4358   def int_x86_avx512_mask_reduce_ss : GCCBuiltin<"__builtin_ia32_reducess_mask">,
   4359           Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
   4360                                      llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
   4361                                      [IntrNoMem]>;
   4362   def int_x86_avx512_mask_reduce_sd : GCCBuiltin<"__builtin_ia32_reducesd_mask">,
   4363           Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
   4364                                       llvm_i8_ty, llvm_i32_ty, llvm_i32_ty],
   4365                                      [IntrNoMem]>;
   4366   def int_x86_avx512_mask_scalef_sd : GCCBuiltin<"__builtin_ia32_scalefsd_round_mask">,
   4367           Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   4368                                       llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4369   def int_x86_avx512_mask_scalef_ss : GCCBuiltin<"__builtin_ia32_scalefss_round_mask">,
   4370           Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   4371                                       llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4372   def int_x86_avx512_mask_scalef_pd_128 : GCCBuiltin<"__builtin_ia32_scalefpd128_mask">,
   4373           Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   4374                     llvm_v2f64_ty, llvm_i8_ty], [IntrNoMem]>;
   4375   def int_x86_avx512_mask_scalef_pd_256 : GCCBuiltin<"__builtin_ia32_scalefpd256_mask">,
   4376           Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
   4377                     llvm_v4f64_ty, llvm_i8_ty],[IntrNoMem]>;
   4378   def int_x86_avx512_mask_scalef_pd_512 : GCCBuiltin<"__builtin_ia32_scalefpd512_mask">,
   4379           Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   4380                     llvm_v8f64_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4381   def int_x86_avx512_mask_scalef_ps_128 : GCCBuiltin<"__builtin_ia32_scalefps128_mask">,
   4382           Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   4383                     llvm_v4f32_ty, llvm_i8_ty], [IntrNoMem]>;
   4384   def int_x86_avx512_mask_scalef_ps_256 : GCCBuiltin<"__builtin_ia32_scalefps256_mask">,
   4385           Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
   4386                     llvm_v8f32_ty, llvm_i8_ty], [IntrNoMem]>;
   4387   def int_x86_avx512_mask_scalef_ps_512 : GCCBuiltin<"__builtin_ia32_scalefps512_mask">,
   4388           Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   4389                     llvm_v16f32_ty, llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4390 
   4391   def int_x86_avx512_mask_sqrt_ss : GCCBuiltin<"__builtin_ia32_sqrtss_round_mask">,
   4392         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
   4393                                     llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4394   def int_x86_avx512_mask_sqrt_sd : GCCBuiltin<"__builtin_ia32_sqrtsd_round_mask">,
   4395         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
   4396                                     llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4397 
   4398   def int_x86_avx512_mask_sqrt_pd_128 : GCCBuiltin<"__builtin_ia32_sqrtpd128_mask">,
   4399         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   4400                                     llvm_i8_ty], [IntrNoMem]>;
   4401   def int_x86_avx512_mask_sqrt_pd_256 : GCCBuiltin<"__builtin_ia32_sqrtpd256_mask">,
   4402         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
   4403                                     llvm_i8_ty], [IntrNoMem]>;
   4404   def int_x86_avx512_mask_sqrt_pd_512 : GCCBuiltin<"__builtin_ia32_sqrtpd512_mask">,
   4405         Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   4406                                     llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4407   def int_x86_avx512_mask_sqrt_ps_128 : GCCBuiltin<"__builtin_ia32_sqrtps128_mask">,
   4408         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   4409                                      llvm_i8_ty], [IntrNoMem]>;
   4410   def int_x86_avx512_mask_sqrt_ps_256 : GCCBuiltin<"__builtin_ia32_sqrtps256_mask">,
   4411         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
   4412                                      llvm_i8_ty], [IntrNoMem]>;
   4413   def int_x86_avx512_mask_sqrt_ps_512 : GCCBuiltin<"__builtin_ia32_sqrtps512_mask">,
   4414         Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   4415                                      llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4416   def int_x86_avx512_mask_fixupimm_pd_128 :
   4417          GCCBuiltin<"__builtin_ia32_fixupimmpd128_mask">,
   4418           Intrinsic<[llvm_v2f64_ty],
   4419           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2i64_ty, llvm_i32_ty, llvm_i8_ty],
   4420           [IntrNoMem]>;
   4421   def int_x86_avx512_maskz_fixupimm_pd_128 :
   4422          GCCBuiltin<"__builtin_ia32_fixupimmpd128_maskz">,
   4423           Intrinsic<[llvm_v2f64_ty],
   4424           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2i64_ty, llvm_i32_ty, llvm_i8_ty],
   4425           [IntrNoMem]>;
   4426   def int_x86_avx512_mask_fixupimm_pd_256 :
   4427          GCCBuiltin<"__builtin_ia32_fixupimmpd256_mask">,
   4428           Intrinsic<[llvm_v4f64_ty],
   4429           [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4i64_ty, llvm_i32_ty, llvm_i8_ty],
   4430           [IntrNoMem]>;
   4431   def int_x86_avx512_maskz_fixupimm_pd_256 :
   4432          GCCBuiltin<"__builtin_ia32_fixupimmpd256_maskz">,
   4433           Intrinsic<[llvm_v4f64_ty],
   4434           [llvm_v4f64_ty, llvm_v4f64_ty, llvm_v4i64_ty, llvm_i32_ty, llvm_i8_ty],
   4435           [IntrNoMem]>;
   4436   def int_x86_avx512_mask_fixupimm_pd_512 :
   4437          GCCBuiltin<"__builtin_ia32_fixupimmpd512_mask">,
   4438           Intrinsic<[llvm_v8f64_ty],
   4439           [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8i64_ty, llvm_i32_ty, llvm_i8_ty,
   4440           llvm_i32_ty], [IntrNoMem]>;
   4441   def int_x86_avx512_maskz_fixupimm_pd_512 :
   4442          GCCBuiltin<"__builtin_ia32_fixupimmpd512_maskz">,
   4443           Intrinsic<[llvm_v8f64_ty],
   4444           [llvm_v8f64_ty, llvm_v8f64_ty, llvm_v8i64_ty, llvm_i32_ty, llvm_i8_ty,
   4445           llvm_i32_ty], [IntrNoMem]>;
   4446   def int_x86_avx512_mask_fixupimm_ps_128 :
   4447          GCCBuiltin<"__builtin_ia32_fixupimmps128_mask">,
   4448           Intrinsic<[llvm_v4f32_ty],
   4449           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i8_ty],
   4450           [IntrNoMem]>;
   4451   def int_x86_avx512_maskz_fixupimm_ps_128 :
   4452          GCCBuiltin<"__builtin_ia32_fixupimmps128_maskz">,
   4453           Intrinsic<[llvm_v4f32_ty],
   4454           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i8_ty],
   4455           [IntrNoMem]>;
   4456   def int_x86_avx512_mask_fixupimm_ps_256 :
   4457          GCCBuiltin<"__builtin_ia32_fixupimmps256_mask">,
   4458           Intrinsic<[llvm_v8f32_ty],
   4459           [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8i32_ty, llvm_i32_ty, llvm_i8_ty],
   4460           [IntrNoMem]>;
   4461   def int_x86_avx512_maskz_fixupimm_ps_256 :
   4462          GCCBuiltin<"__builtin_ia32_fixupimmps256_maskz">,
   4463           Intrinsic<[llvm_v8f32_ty],
   4464           [llvm_v8f32_ty, llvm_v8f32_ty, llvm_v8i32_ty, llvm_i32_ty, llvm_i8_ty],
   4465           [IntrNoMem]>;
   4466   def int_x86_avx512_mask_fixupimm_ps_512 :
   4467          GCCBuiltin<"__builtin_ia32_fixupimmps512_mask">,
   4468           Intrinsic<[llvm_v16f32_ty],
   4469           [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16i32_ty, llvm_i32_ty,
   4470           llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4471   def int_x86_avx512_maskz_fixupimm_ps_512 :
   4472          GCCBuiltin<"__builtin_ia32_fixupimmps512_maskz">,
   4473           Intrinsic<[llvm_v16f32_ty],
   4474           [llvm_v16f32_ty, llvm_v16f32_ty, llvm_v16i32_ty, llvm_i32_ty,
   4475           llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4476   def int_x86_avx512_mask_fixupimm_sd :
   4477          GCCBuiltin<"__builtin_ia32_fixupimmsd_mask">,
   4478           Intrinsic<[llvm_v2f64_ty],
   4479           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2i64_ty, llvm_i32_ty, llvm_i8_ty,
   4480           llvm_i32_ty], [IntrNoMem]>;
   4481   def int_x86_avx512_maskz_fixupimm_sd :
   4482          GCCBuiltin<"__builtin_ia32_fixupimmsd_maskz">,
   4483           Intrinsic<[llvm_v2f64_ty],
   4484           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2i64_ty, llvm_i32_ty, llvm_i8_ty,
   4485           llvm_i32_ty], [IntrNoMem]>;
   4486   def int_x86_avx512_mask_fixupimm_ss :
   4487          GCCBuiltin<"__builtin_ia32_fixupimmss_mask">,
   4488           Intrinsic<[llvm_v4f32_ty],
   4489           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i8_ty,
   4490           llvm_i32_ty], [IntrNoMem]>;
   4491   def int_x86_avx512_maskz_fixupimm_ss :
   4492          GCCBuiltin<"__builtin_ia32_fixupimmss_maskz">,
   4493           Intrinsic<[llvm_v4f32_ty],
   4494           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4i32_ty, llvm_i32_ty, llvm_i8_ty,
   4495           llvm_i32_ty], [IntrNoMem]>;
   4496   def int_x86_avx512_mask_getexp_pd_128 : GCCBuiltin<"__builtin_ia32_getexppd128_mask">,
   4497         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   4498                                     llvm_i8_ty], [IntrNoMem]>;
   4499   def int_x86_avx512_mask_getexp_pd_256 : GCCBuiltin<"__builtin_ia32_getexppd256_mask">,
   4500         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
   4501                                     llvm_i8_ty], [IntrNoMem]>;
   4502   def int_x86_avx512_mask_getexp_pd_512 : GCCBuiltin<"__builtin_ia32_getexppd512_mask">,
   4503         Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   4504                                     llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4505   def int_x86_avx512_mask_getexp_ps_128 : GCCBuiltin<"__builtin_ia32_getexpps128_mask">,
   4506         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   4507                                      llvm_i8_ty], [IntrNoMem]>;
   4508   def int_x86_avx512_mask_getexp_ps_256 : GCCBuiltin<"__builtin_ia32_getexpps256_mask">,
   4509         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
   4510                                      llvm_i8_ty], [IntrNoMem]>;
   4511   def int_x86_avx512_mask_getexp_ps_512 : GCCBuiltin<"__builtin_ia32_getexpps512_mask">,
   4512         Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   4513                                      llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4514 
   4515   def int_x86_avx512_mask_getexp_ss : GCCBuiltin<"__builtin_ia32_getexpss128_round_mask">,
   4516         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
   4517                                     llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4518   def int_x86_avx512_mask_getexp_sd : GCCBuiltin<"__builtin_ia32_getexpsd128_round_mask">,
   4519         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
   4520                                     llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4521 
   4522   def int_x86_avx512_mask_getmant_pd_128 :
   4523          GCCBuiltin<"__builtin_ia32_getmantpd128_mask">,
   4524           Intrinsic<[llvm_v2f64_ty],
   4525           [llvm_v2f64_ty,llvm_i32_ty, llvm_v2f64_ty,  llvm_i8_ty],
   4526           [IntrNoMem]>;
   4527 
   4528   def int_x86_avx512_mask_getmant_pd_256 :
   4529          GCCBuiltin<"__builtin_ia32_getmantpd256_mask">,
   4530           Intrinsic<[llvm_v4f64_ty],
   4531           [llvm_v4f64_ty,llvm_i32_ty, llvm_v4f64_ty,  llvm_i8_ty],
   4532           [IntrNoMem]>;
   4533 
   4534   def int_x86_avx512_mask_getmant_pd_512 :
   4535          GCCBuiltin<"__builtin_ia32_getmantpd512_mask">,
   4536           Intrinsic<[llvm_v8f64_ty],
   4537           [llvm_v8f64_ty,llvm_i32_ty, llvm_v8f64_ty,  llvm_i8_ty,llvm_i32_ty ],
   4538           [IntrNoMem]>;
   4539 
   4540   def int_x86_avx512_mask_getmant_ps_128 :
   4541          GCCBuiltin<"__builtin_ia32_getmantps128_mask">,
   4542           Intrinsic<[llvm_v4f32_ty],
   4543           [llvm_v4f32_ty, llvm_i32_ty, llvm_v4f32_ty,  llvm_i8_ty],
   4544           [IntrNoMem]>;
   4545 
   4546   def int_x86_avx512_mask_getmant_ps_256 :
   4547          GCCBuiltin<"__builtin_ia32_getmantps256_mask">,
   4548           Intrinsic<[llvm_v8f32_ty],
   4549           [llvm_v8f32_ty, llvm_i32_ty, llvm_v8f32_ty,  llvm_i8_ty],
   4550           [IntrNoMem]>;
   4551 
   4552   def int_x86_avx512_mask_getmant_ps_512 :
   4553          GCCBuiltin<"__builtin_ia32_getmantps512_mask">,
   4554           Intrinsic<[llvm_v16f32_ty],
   4555           [llvm_v16f32_ty,llvm_i32_ty, llvm_v16f32_ty,llvm_i16_ty,llvm_i32_ty],
   4556           [IntrNoMem]>;
   4557 
   4558   def int_x86_avx512_mask_getmant_ss :
   4559          GCCBuiltin<"__builtin_ia32_getmantss_round_mask">,
   4560           Intrinsic<[llvm_v4f32_ty],
   4561           [llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty, llvm_v4f32_ty,
   4562            llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4563 
   4564   def int_x86_avx512_mask_getmant_sd :
   4565          GCCBuiltin<"__builtin_ia32_getmantsd_round_mask">,
   4566           Intrinsic<[llvm_v2f64_ty],
   4567           [llvm_v2f64_ty, llvm_v2f64_ty, llvm_i32_ty, llvm_v2f64_ty,
   4568            llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4569 
   4570   def int_x86_avx512_rsqrt14_ss : GCCBuiltin<"__builtin_ia32_rsqrt14ss_mask">,
   4571         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
   4572                                     llvm_i8_ty], [IntrNoMem]>;
   4573   def int_x86_avx512_rsqrt14_sd : GCCBuiltin<"__builtin_ia32_rsqrt14sd_mask">,
   4574         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
   4575                                     llvm_i8_ty], [IntrNoMem]>;
   4576 
   4577   def int_x86_avx512_rsqrt14_pd_128 : GCCBuiltin<"__builtin_ia32_rsqrt14pd128_mask">,
   4578         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   4579                                     llvm_i8_ty], [IntrNoMem]>;
   4580   def int_x86_avx512_rsqrt14_pd_256 : GCCBuiltin<"__builtin_ia32_rsqrt14pd256_mask">,
   4581         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
   4582                                     llvm_i8_ty], [IntrNoMem]>;
   4583   def int_x86_avx512_rsqrt14_pd_512 : GCCBuiltin<"__builtin_ia32_rsqrt14pd512_mask">,
   4584         Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   4585                                     llvm_i8_ty], [IntrNoMem]>;
   4586   def int_x86_avx512_rsqrt14_ps_128 : GCCBuiltin<"__builtin_ia32_rsqrt14ps128_mask">,
   4587         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   4588                                      llvm_i8_ty], [IntrNoMem]>;
   4589   def int_x86_avx512_rsqrt14_ps_256 : GCCBuiltin<"__builtin_ia32_rsqrt14ps256_mask">,
   4590           Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
   4591                                      llvm_i8_ty], [IntrNoMem]>;
   4592   def int_x86_avx512_rsqrt14_ps_512 : GCCBuiltin<"__builtin_ia32_rsqrt14ps512_mask">,
   4593         Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   4594                                      llvm_i16_ty], [IntrNoMem]>;
   4595   def int_x86_avx512_rcp14_ss : GCCBuiltin<"__builtin_ia32_rcp14ss_mask">,
   4596         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
   4597                                     llvm_i8_ty], [IntrNoMem]>;
   4598   def int_x86_avx512_rcp14_sd : GCCBuiltin<"__builtin_ia32_rcp14sd_mask">,
   4599         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty,
   4600                                     llvm_i8_ty], [IntrNoMem]>;
   4601 
   4602   def int_x86_avx512_rcp14_pd_128 : GCCBuiltin<"__builtin_ia32_rcp14pd128_mask">,
   4603         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   4604                                     llvm_i8_ty], [IntrNoMem]>;
   4605   def int_x86_avx512_rcp14_pd_256 : GCCBuiltin<"__builtin_ia32_rcp14pd256_mask">,
   4606         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
   4607                                     llvm_i8_ty], [IntrNoMem]>;
   4608   def int_x86_avx512_rcp14_pd_512 : GCCBuiltin<"__builtin_ia32_rcp14pd512_mask">,
   4609         Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   4610                                     llvm_i8_ty], [IntrNoMem]>;
   4611   def int_x86_avx512_rcp14_ps_128 : GCCBuiltin<"__builtin_ia32_rcp14ps128_mask">,
   4612         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   4613                                      llvm_i8_ty], [IntrNoMem]>;
   4614   def int_x86_avx512_rcp14_ps_256 : GCCBuiltin<"__builtin_ia32_rcp14ps256_mask">,
   4615           Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
   4616                                      llvm_i8_ty], [IntrNoMem]>;
   4617   def int_x86_avx512_rcp14_ps_512 : GCCBuiltin<"__builtin_ia32_rcp14ps512_mask">,
   4618         Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   4619                                      llvm_i16_ty], [IntrNoMem]>;
   4620 
   4621   def int_x86_avx512_rcp28_ps : GCCBuiltin<"__builtin_ia32_rcp28ps_mask">,
   4622             Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   4623                                          llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4624   def int_x86_avx512_rcp28_pd : GCCBuiltin<"__builtin_ia32_rcp28pd_mask">,
   4625             Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   4626                                         llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4627   def int_x86_avx512_exp2_ps : GCCBuiltin<"__builtin_ia32_exp2ps_mask">,
   4628             Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   4629                                          llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4630   def int_x86_avx512_exp2_pd : GCCBuiltin<"__builtin_ia32_exp2pd_mask">,
   4631             Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   4632                                         llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4633 
   4634   def int_x86_avx512_rcp28_ss : GCCBuiltin<"__builtin_ia32_rcp28ss_round_mask">,
   4635             Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   4636                                         llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty],
   4637                       [IntrNoMem]>;
   4638   def int_x86_avx512_rcp28_sd : GCCBuiltin<"__builtin_ia32_rcp28sd_round_mask">,
   4639             Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   4640                                         llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty],
   4641                       [IntrNoMem]>;
   4642   def int_x86_avx512_rsqrt28_ps : GCCBuiltin<"__builtin_ia32_rsqrt28ps_mask">,
   4643             Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   4644                                          llvm_i16_ty, llvm_i32_ty],
   4645                       [IntrNoMem]>;
   4646   def int_x86_avx512_rsqrt28_pd : GCCBuiltin<"__builtin_ia32_rsqrt28pd_mask">,
   4647             Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   4648                                         llvm_i8_ty, llvm_i32_ty],
   4649                       [IntrNoMem]>;
   4650   def int_x86_avx512_rsqrt28_ss : GCCBuiltin<"__builtin_ia32_rsqrt28ss_round_mask">,
   4651             Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   4652                                         llvm_v4f32_ty, llvm_i8_ty, llvm_i32_ty],
   4653                       [IntrNoMem]>;
   4654   def int_x86_avx512_rsqrt28_sd : GCCBuiltin<"__builtin_ia32_rsqrt28sd_round_mask">,
   4655             Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   4656                                         llvm_v2f64_ty, llvm_i8_ty, llvm_i32_ty],
   4657                       [IntrNoMem]>;
   4658   def int_x86_avx512_psad_bw_512 : GCCBuiltin<"__builtin_ia32_psadbw512">,
   4659               Intrinsic<[llvm_v8i64_ty], [llvm_v64i8_ty, llvm_v64i8_ty],
   4660                         [IntrNoMem, Commutative]>;
   4661 }
   4662 // Integer arithmetic ops
   4663 let TargetPrefix = "x86" in {
   4664   def int_x86_avx512_mask_padds_b_128 : GCCBuiltin<"__builtin_ia32_paddsb128_mask">,
   4665           Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty,
   4666                      llvm_v16i8_ty, llvm_i16_ty], [IntrNoMem]>;
   4667   def int_x86_avx512_mask_padds_b_256 : GCCBuiltin<"__builtin_ia32_paddsb256_mask">,
   4668           Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty, llvm_v32i8_ty,
   4669                      llvm_v32i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4670   def int_x86_avx512_mask_padds_b_512 : GCCBuiltin<"__builtin_ia32_paddsb512_mask">,
   4671           Intrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty,
   4672                      llvm_v64i8_ty, llvm_i64_ty], [IntrNoMem]>;
   4673   def int_x86_avx512_mask_padds_w_128 : GCCBuiltin<"__builtin_ia32_paddsw128_mask">,
   4674           Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty,
   4675                      llvm_v8i16_ty, llvm_i8_ty], [IntrNoMem]>;
   4676   def int_x86_avx512_mask_padds_w_256 : GCCBuiltin<"__builtin_ia32_paddsw256_mask">,
   4677           Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty,
   4678                      llvm_v16i16_ty, llvm_i16_ty], [IntrNoMem]>;
   4679   def int_x86_avx512_mask_padds_w_512 : GCCBuiltin<"__builtin_ia32_paddsw512_mask">,
   4680           Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty,
   4681                      llvm_v32i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4682   def int_x86_avx512_mask_paddus_b_128 : GCCBuiltin<"__builtin_ia32_paddusb128_mask">,
   4683           Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty,
   4684                      llvm_v16i8_ty, llvm_i16_ty], [IntrNoMem]>;
   4685   def int_x86_avx512_mask_paddus_b_256 : GCCBuiltin<"__builtin_ia32_paddusb256_mask">,
   4686           Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty, llvm_v32i8_ty,
   4687                      llvm_v32i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4688   def int_x86_avx512_mask_paddus_b_512 : GCCBuiltin<"__builtin_ia32_paddusb512_mask">,
   4689           Intrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty,
   4690                      llvm_v64i8_ty, llvm_i64_ty], [IntrNoMem]>;
   4691   def int_x86_avx512_mask_paddus_w_128 : GCCBuiltin<"__builtin_ia32_paddusw128_mask">,
   4692           Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty,
   4693                      llvm_v8i16_ty, llvm_i8_ty], [IntrNoMem]>;
   4694   def int_x86_avx512_mask_paddus_w_256 : GCCBuiltin<"__builtin_ia32_paddusw256_mask">,
   4695           Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty,
   4696                      llvm_v16i16_ty, llvm_i16_ty], [IntrNoMem]>;
   4697   def int_x86_avx512_mask_paddus_w_512 : GCCBuiltin<"__builtin_ia32_paddusw512_mask">,
   4698           Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty,
   4699                      llvm_v32i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4700   def int_x86_avx512_mask_psubs_b_128 : GCCBuiltin<"__builtin_ia32_psubsb128_mask">,
   4701           Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty,
   4702                      llvm_v16i8_ty, llvm_i16_ty], [IntrNoMem]>;
   4703   def int_x86_avx512_mask_psubs_b_256 : GCCBuiltin<"__builtin_ia32_psubsb256_mask">,
   4704           Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty, llvm_v32i8_ty,
   4705                      llvm_v32i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4706   def int_x86_avx512_mask_psubs_b_512 : GCCBuiltin<"__builtin_ia32_psubsb512_mask">,
   4707           Intrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty,
   4708                      llvm_v64i8_ty, llvm_i64_ty], [IntrNoMem]>;
   4709   def int_x86_avx512_mask_psubs_w_128 : GCCBuiltin<"__builtin_ia32_psubsw128_mask">,
   4710           Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty,
   4711                      llvm_v8i16_ty, llvm_i8_ty], [IntrNoMem]>;
   4712   def int_x86_avx512_mask_psubs_w_256 : GCCBuiltin<"__builtin_ia32_psubsw256_mask">,
   4713           Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty,
   4714                      llvm_v16i16_ty, llvm_i16_ty], [IntrNoMem]>;
   4715   def int_x86_avx512_mask_psubs_w_512 : GCCBuiltin<"__builtin_ia32_psubsw512_mask">,
   4716           Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty,
   4717                      llvm_v32i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4718   def int_x86_avx512_mask_psubus_b_128 : GCCBuiltin<"__builtin_ia32_psubusb128_mask">,
   4719           Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty,
   4720                      llvm_v16i8_ty, llvm_i16_ty], [IntrNoMem]>;
   4721   def int_x86_avx512_mask_psubus_b_256 : GCCBuiltin<"__builtin_ia32_psubusb256_mask">,
   4722           Intrinsic<[llvm_v32i8_ty], [llvm_v32i8_ty, llvm_v32i8_ty,
   4723                      llvm_v32i8_ty, llvm_i32_ty], [IntrNoMem]>;
   4724   def int_x86_avx512_mask_psubus_b_512 : GCCBuiltin<"__builtin_ia32_psubusb512_mask">,
   4725           Intrinsic<[llvm_v64i8_ty], [llvm_v64i8_ty, llvm_v64i8_ty,
   4726                      llvm_v64i8_ty, llvm_i64_ty], [IntrNoMem]>;
   4727   def int_x86_avx512_mask_psubus_w_128 : GCCBuiltin<"__builtin_ia32_psubusw128_mask">,
   4728           Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty,
   4729                      llvm_v8i16_ty, llvm_i8_ty], [IntrNoMem]>;
   4730   def int_x86_avx512_mask_psubus_w_256 : GCCBuiltin<"__builtin_ia32_psubusw256_mask">,
   4731           Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty,
   4732                      llvm_v16i16_ty, llvm_i16_ty], [IntrNoMem]>;
   4733   def int_x86_avx512_mask_psubus_w_512 : GCCBuiltin<"__builtin_ia32_psubusw512_mask">,
   4734           Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty,
   4735                      llvm_v32i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4736   def int_x86_avx512_pmulu_dq_512 : GCCBuiltin<"__builtin_ia32_pmuludq512">,
   4737               Intrinsic<[llvm_v8i64_ty], [llvm_v16i32_ty, llvm_v16i32_ty], [IntrNoMem]>;
   4738   def int_x86_avx512_pmul_dq_512 : GCCBuiltin<"__builtin_ia32_pmuldq512">,
   4739               Intrinsic<[llvm_v8i64_ty], [llvm_v16i32_ty, llvm_v16i32_ty], [IntrNoMem]>;
   4740   def int_x86_avx512_mask_pmulhu_w_512 : GCCBuiltin<"__builtin_ia32_pmulhuw512_mask">,
   4741               Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty,
   4742                      llvm_v32i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4743   def int_x86_avx512_mask_pmulh_w_512 : GCCBuiltin<"__builtin_ia32_pmulhw512_mask">,
   4744               Intrinsic<[llvm_v32i16_ty], [llvm_v32i16_ty, llvm_v32i16_ty,
   4745                      llvm_v32i16_ty, llvm_i32_ty], [IntrNoMem]>;
   4746   def int_x86_avx512_mask_pmulhu_w_128 : GCCBuiltin<"__builtin_ia32_pmulhuw128_mask">,
   4747               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty,
   4748                      llvm_v8i16_ty, llvm_i8_ty], [IntrNoMem]>;
   4749   def int_x86_avx512_mask_pmulhu_w_256 : GCCBuiltin<"__builtin_ia32_pmulhuw256_mask">,
   4750               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty,
   4751                      llvm_v16i16_ty, llvm_i16_ty], [IntrNoMem]>;
   4752   def int_x86_avx512_mask_pmulh_w_128 : GCCBuiltin<"__builtin_ia32_pmulhw128_mask">,
   4753               Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty,
   4754                      llvm_v8i16_ty, llvm_i8_ty], [IntrNoMem]>;
   4755   def int_x86_avx512_mask_pmulh_w_256 : GCCBuiltin<"__builtin_ia32_pmulhw256_mask">,
   4756               Intrinsic<[llvm_v16i16_ty], [llvm_v16i16_ty, llvm_v16i16_ty,
   4757                      llvm_v16i16_ty, llvm_i16_ty], [IntrNoMem]>;
   4758   def int_x86_avx512_mask_pmaddw_d_128 :
   4759          GCCBuiltin<"__builtin_ia32_pmaddwd128_mask">,
   4760           Intrinsic<[llvm_v4i32_ty],
   4761           [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v4i32_ty,  llvm_i8_ty],
   4762           [IntrNoMem]>;
   4763   def int_x86_avx512_mask_pmaddw_d_256 :
   4764          GCCBuiltin<"__builtin_ia32_pmaddwd256_mask">,
   4765           Intrinsic<[llvm_v8i32_ty],
   4766           [llvm_v16i16_ty, llvm_v16i16_ty, llvm_v8i32_ty,  llvm_i8_ty],
   4767           [IntrNoMem]>;
   4768   def int_x86_avx512_mask_pmaddw_d_512 :
   4769          GCCBuiltin<"__builtin_ia32_pmaddwd512_mask">,
   4770           Intrinsic<[llvm_v16i32_ty],
   4771           [llvm_v32i16_ty, llvm_v32i16_ty, llvm_v16i32_ty,  llvm_i16_ty],
   4772           [IntrNoMem]>;
   4773   def int_x86_avx512_mask_pmaddubs_w_128 :
   4774          GCCBuiltin<"__builtin_ia32_pmaddubsw128_mask">,
   4775           Intrinsic<[llvm_v8i16_ty],
   4776           [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v8i16_ty,  llvm_i8_ty],
   4777           [IntrNoMem]>;
   4778   def int_x86_avx512_mask_pmaddubs_w_256 :
   4779          GCCBuiltin<"__builtin_ia32_pmaddubsw256_mask">,
   4780           Intrinsic<[llvm_v16i16_ty],
   4781           [llvm_v32i8_ty, llvm_v32i8_ty, llvm_v16i16_ty,  llvm_i16_ty],
   4782           [IntrNoMem]>;
   4783   def int_x86_avx512_mask_pmaddubs_w_512 :
   4784          GCCBuiltin<"__builtin_ia32_pmaddubsw512_mask">,
   4785           Intrinsic<[llvm_v32i16_ty],
   4786           [llvm_v64i8_ty, llvm_v64i8_ty, llvm_v32i16_ty,  llvm_i32_ty],
   4787           [IntrNoMem]>;
   4788 
   4789   def int_x86_avx512_mask_dbpsadbw_128 :
   4790          GCCBuiltin<"__builtin_ia32_dbpsadbw128_mask">,
   4791           Intrinsic<[llvm_v8i16_ty],
   4792           [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty, llvm_v8i16_ty,
   4793            llvm_i8_ty], [IntrNoMem]>;
   4794 
   4795   def int_x86_avx512_mask_dbpsadbw_256 :
   4796          GCCBuiltin<"__builtin_ia32_dbpsadbw256_mask">,
   4797           Intrinsic<[llvm_v16i16_ty],
   4798           [llvm_v32i8_ty, llvm_v32i8_ty, llvm_i32_ty, llvm_v16i16_ty,
   4799            llvm_i16_ty], [IntrNoMem]>;
   4800 
   4801   def int_x86_avx512_mask_dbpsadbw_512 :
   4802          GCCBuiltin<"__builtin_ia32_dbpsadbw512_mask">,
   4803           Intrinsic<[llvm_v32i16_ty],
   4804           [llvm_v64i8_ty, llvm_v64i8_ty, llvm_i32_ty, llvm_v32i16_ty,
   4805            llvm_i32_ty], [IntrNoMem]>;
   4806 }
   4807 
   4808 // Gather and Scatter ops
   4809 let TargetPrefix = "x86" in {
   4810   def int_x86_avx512_gather_dpd_512  : GCCBuiltin<"__builtin_ia32_gathersiv8df">,
   4811           Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
   4812                      llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
   4813                     [IntrReadMem, IntrArgMemOnly]>;
   4814   def int_x86_avx512_gather_dps_512  : GCCBuiltin<"__builtin_ia32_gathersiv16sf">,
   4815           Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_ptr_ty,
   4816                      llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
   4817                     [IntrReadMem, IntrArgMemOnly]>;
   4818   def int_x86_avx512_gather_qpd_512  : GCCBuiltin<"__builtin_ia32_gatherdiv8df">,
   4819           Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_ptr_ty,
   4820                      llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
   4821                     [IntrReadMem, IntrArgMemOnly]>;
   4822   def int_x86_avx512_gather_qps_512  : GCCBuiltin<"__builtin_ia32_gatherdiv16sf">,
   4823           Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_ptr_ty,
   4824                      llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
   4825                     [IntrReadMem, IntrArgMemOnly]>;
   4826 
   4827 
   4828   def int_x86_avx512_gather_dpq_512  : GCCBuiltin<"__builtin_ia32_gathersiv8di">,
   4829           Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
   4830                      llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
   4831                     [IntrReadMem, IntrArgMemOnly]>;
   4832   def int_x86_avx512_gather_dpi_512  : GCCBuiltin<"__builtin_ia32_gathersiv16si">,
   4833           Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_ptr_ty,
   4834                      llvm_v16i32_ty, llvm_i16_ty, llvm_i32_ty],
   4835                     [IntrReadMem, IntrArgMemOnly]>;
   4836   def int_x86_avx512_gather_qpq_512  : GCCBuiltin<"__builtin_ia32_gatherdiv8di">,
   4837           Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_ptr_ty,
   4838                      llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
   4839                     [IntrReadMem, IntrArgMemOnly]>;
   4840   def int_x86_avx512_gather_qpi_512  : GCCBuiltin<"__builtin_ia32_gatherdiv16si">,
   4841           Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_ptr_ty,
   4842                      llvm_v8i64_ty, llvm_i8_ty, llvm_i32_ty],
   4843                     [IntrReadMem, IntrArgMemOnly]>;
   4844 
   4845   def int_x86_avx512_gather3div2_df :
   4846         GCCBuiltin<"__builtin_ia32_gather3div2df">,
   4847           Intrinsic<[llvm_v2f64_ty],
   4848           [llvm_v2f64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
   4849           [IntrReadMem, IntrArgMemOnly]>;
   4850 
   4851   def int_x86_avx512_gather3div2_di :
   4852         GCCBuiltin<"__builtin_ia32_gather3div2di">,
   4853           Intrinsic<[llvm_v2i64_ty],
   4854           [llvm_v2i64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
   4855           [IntrReadMem, IntrArgMemOnly]>;
   4856 
   4857   def int_x86_avx512_gather3div4_df :
   4858         GCCBuiltin<"__builtin_ia32_gather3div4df">,
   4859           Intrinsic<[llvm_v4f64_ty],
   4860           [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
   4861           [IntrReadMem, IntrArgMemOnly]>;
   4862 
   4863   def int_x86_avx512_gather3div4_di :
   4864         GCCBuiltin<"__builtin_ia32_gather3div4di">,
   4865           Intrinsic<[llvm_v4i64_ty],
   4866           [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
   4867           [IntrReadMem, IntrArgMemOnly]>;
   4868 
   4869   def int_x86_avx512_gather3div4_sf :
   4870         GCCBuiltin<"__builtin_ia32_gather3div4sf">,
   4871           Intrinsic<[llvm_v4f32_ty],
   4872           [llvm_v4f32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
   4873           [IntrReadMem, IntrArgMemOnly]>;
   4874 
   4875   def int_x86_avx512_gather3div4_si :
   4876         GCCBuiltin<"__builtin_ia32_gather3div4si">,
   4877           Intrinsic<[llvm_v4i32_ty],
   4878           [llvm_v4i32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty, llvm_i32_ty],
   4879           [IntrReadMem, IntrArgMemOnly]>;
   4880 
   4881   def int_x86_avx512_gather3div8_sf :
   4882         GCCBuiltin<"__builtin_ia32_gather3div8sf">,
   4883           Intrinsic<[llvm_v4f32_ty],
   4884           [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
   4885           [IntrReadMem, IntrArgMemOnly]>;
   4886 
   4887   def int_x86_avx512_gather3div8_si :
   4888         GCCBuiltin<"__builtin_ia32_gather3div8si">,
   4889           Intrinsic<[llvm_v4i32_ty],
   4890           [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty, llvm_i32_ty],
   4891           [IntrReadMem, IntrArgMemOnly]>;
   4892 
   4893   def int_x86_avx512_gather3siv2_df :
   4894         GCCBuiltin<"__builtin_ia32_gather3siv2df">,
   4895           Intrinsic<[llvm_v2f64_ty],
   4896           [llvm_v2f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
   4897           [IntrReadMem, IntrArgMemOnly]>;
   4898 
   4899   def int_x86_avx512_gather3siv2_di :
   4900         GCCBuiltin<"__builtin_ia32_gather3siv2di">,
   4901           Intrinsic<[llvm_v2i64_ty],
   4902           [llvm_v2i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
   4903           [IntrReadMem, IntrArgMemOnly]>;
   4904 
   4905   def int_x86_avx512_gather3siv4_df :
   4906         GCCBuiltin<"__builtin_ia32_gather3siv4df">,
   4907           Intrinsic<[llvm_v4f64_ty],
   4908           [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
   4909           [IntrReadMem, IntrArgMemOnly]>;
   4910 
   4911   def int_x86_avx512_gather3siv4_di :
   4912         GCCBuiltin<"__builtin_ia32_gather3siv4di">,
   4913           Intrinsic<[llvm_v4i64_ty],
   4914           [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
   4915           [IntrReadMem, IntrArgMemOnly]>;
   4916 
   4917   def int_x86_avx512_gather3siv4_sf :
   4918         GCCBuiltin<"__builtin_ia32_gather3siv4sf">,
   4919           Intrinsic<[llvm_v4f32_ty],
   4920           [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
   4921           [IntrReadMem, IntrArgMemOnly]>;
   4922 
   4923   def int_x86_avx512_gather3siv4_si :
   4924         GCCBuiltin<"__builtin_ia32_gather3siv4si">,
   4925           Intrinsic<[llvm_v4i32_ty],
   4926           [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty, llvm_i32_ty],
   4927           [IntrReadMem, IntrArgMemOnly]>;
   4928 
   4929   def int_x86_avx512_gather3siv8_sf :
   4930         GCCBuiltin<"__builtin_ia32_gather3siv8sf">,
   4931           Intrinsic<[llvm_v8f32_ty],
   4932           [llvm_v8f32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
   4933           [IntrReadMem, IntrArgMemOnly]>;
   4934 
   4935   def int_x86_avx512_gather3siv8_si :
   4936         GCCBuiltin<"__builtin_ia32_gather3siv8si">,
   4937           Intrinsic<[llvm_v8i32_ty],
   4938           [llvm_v8i32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty, llvm_i32_ty],
   4939           [IntrReadMem, IntrArgMemOnly]>;
   4940 
   4941 // scatter
   4942   def int_x86_avx512_scatter_dpd_512  : GCCBuiltin<"__builtin_ia32_scattersiv8df">,
   4943           Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
   4944                         llvm_v8i32_ty, llvm_v8f64_ty, llvm_i32_ty],
   4945                     [IntrArgMemOnly]>;
   4946   def int_x86_avx512_scatter_dps_512  : GCCBuiltin<"__builtin_ia32_scattersiv16sf">,
   4947           Intrinsic<[], [llvm_ptr_ty, llvm_i16_ty,
   4948                        llvm_v16i32_ty, llvm_v16f32_ty, llvm_i32_ty],
   4949                     [IntrArgMemOnly]>;
   4950   def int_x86_avx512_scatter_qpd_512  : GCCBuiltin<"__builtin_ia32_scatterdiv8df">,
   4951           Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
   4952                      llvm_v8i64_ty, llvm_v8f64_ty, llvm_i32_ty],
   4953                     [IntrArgMemOnly]>;
   4954   def int_x86_avx512_scatter_qps_512  : GCCBuiltin<"__builtin_ia32_scatterdiv16sf">,
   4955           Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
   4956                      llvm_v8i64_ty, llvm_v8f32_ty, llvm_i32_ty],
   4957                     [IntrArgMemOnly]>;
   4958 
   4959 
   4960   def int_x86_avx512_scatter_dpq_512  : GCCBuiltin<"__builtin_ia32_scattersiv8di">,
   4961           Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,
   4962                          llvm_v8i32_ty, llvm_v8i64_ty, llvm_i32_ty],
   4963                     [IntrArgMemOnly]>;
   4964   def int_x86_avx512_scatter_dpi_512  : GCCBuiltin<"__builtin_ia32_scattersiv16si">,
   4965           Intrinsic<[], [llvm_ptr_ty, llvm_i16_ty,
   4966                      llvm_v16i32_ty, llvm_v16i32_ty, llvm_i32_ty],
   4967                     [IntrArgMemOnly]>;
   4968   def int_x86_avx512_scatter_qpq_512  : GCCBuiltin<"__builtin_ia32_scatterdiv8di">,
   4969           Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty,llvm_v8i64_ty, llvm_v8i64_ty,
   4970                          llvm_i32_ty],
   4971                     [IntrArgMemOnly]>;
   4972   def int_x86_avx512_scatter_qpi_512  : GCCBuiltin<"__builtin_ia32_scatterdiv16si">,
   4973           Intrinsic<[], [llvm_ptr_ty, llvm_i8_ty, llvm_v8i64_ty, llvm_v8i32_ty,
   4974                          llvm_i32_ty],
   4975                     [IntrArgMemOnly]>;
   4976 
   4977   def int_x86_avx512_scatterdiv2_df :
   4978        GCCBuiltin<"__builtin_ia32_scatterdiv2df">,
   4979         Intrinsic<[],
   4980         [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i32_ty],
   4981         [IntrArgMemOnly]>;
   4982 
   4983   def int_x86_avx512_scatterdiv2_di :
   4984         GCCBuiltin<"__builtin_ia32_scatterdiv2di">,
   4985           Intrinsic<[],
   4986           [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
   4987           [IntrArgMemOnly]>;
   4988 
   4989   def int_x86_avx512_scatterdiv4_df :
   4990         GCCBuiltin<"__builtin_ia32_scatterdiv4df">,
   4991           Intrinsic<[],
   4992           [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i32_ty],
   4993           [IntrArgMemOnly]>;
   4994 
   4995   def int_x86_avx512_scatterdiv4_di :
   4996         GCCBuiltin<"__builtin_ia32_scatterdiv4di">,
   4997           Intrinsic<[],
   4998           [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i32_ty],
   4999           [IntrArgMemOnly]>;
   5000 
   5001   def int_x86_avx512_scatterdiv4_sf :
   5002         GCCBuiltin<"__builtin_ia32_scatterdiv4sf">,
   5003           Intrinsic<[],
   5004           [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v4f32_ty, llvm_i32_ty],
   5005           [IntrArgMemOnly]>;
   5006 
   5007   def int_x86_avx512_scatterdiv4_si :
   5008         GCCBuiltin<"__builtin_ia32_scatterdiv4si">,
   5009           Intrinsic<[],
   5010           [llvm_ptr_ty, llvm_i8_ty, llvm_v2i64_ty, llvm_v4i32_ty, llvm_i32_ty],
   5011           [IntrArgMemOnly]>;
   5012 
   5013   def int_x86_avx512_scatterdiv8_sf :
   5014         GCCBuiltin<"__builtin_ia32_scatterdiv8sf">,
   5015           Intrinsic<[],
   5016           [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4f32_ty, llvm_i32_ty],
   5017           [IntrArgMemOnly]>;
   5018 
   5019   def int_x86_avx512_scatterdiv8_si :
   5020         GCCBuiltin<"__builtin_ia32_scatterdiv8si">,
   5021           Intrinsic<[],
   5022           [llvm_ptr_ty, llvm_i8_ty, llvm_v4i64_ty, llvm_v4i32_ty, llvm_i32_ty],
   5023           [IntrArgMemOnly]>;
   5024 
   5025   def int_x86_avx512_scattersiv2_df :
   5026         GCCBuiltin<"__builtin_ia32_scattersiv2df">,
   5027           Intrinsic<[],
   5028           [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v2f64_ty, llvm_i32_ty],
   5029           [IntrArgMemOnly]>;
   5030 
   5031   def int_x86_avx512_scattersiv2_di :
   5032         GCCBuiltin<"__builtin_ia32_scattersiv2di">,
   5033           Intrinsic<[],
   5034           [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v2i64_ty, llvm_i32_ty],
   5035           [IntrArgMemOnly]>;
   5036 
   5037   def int_x86_avx512_scattersiv4_df :
   5038         GCCBuiltin<"__builtin_ia32_scattersiv4df">,
   5039           Intrinsic<[],
   5040           [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4f64_ty, llvm_i32_ty],
   5041           [IntrArgMemOnly]>;
   5042 
   5043   def int_x86_avx512_scattersiv4_di :
   5044         GCCBuiltin<"__builtin_ia32_scattersiv4di">,
   5045           Intrinsic<[],
   5046           [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4i64_ty, llvm_i32_ty],
   5047           [IntrArgMemOnly]>;
   5048 
   5049   def int_x86_avx512_scattersiv4_sf :
   5050         GCCBuiltin<"__builtin_ia32_scattersiv4sf">,
   5051           Intrinsic<[],
   5052           [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i32_ty],
   5053           [IntrArgMemOnly]>;
   5054 
   5055   def int_x86_avx512_scattersiv4_si :
   5056         GCCBuiltin<"__builtin_ia32_scattersiv4si">,
   5057           Intrinsic<[],
   5058           [llvm_ptr_ty, llvm_i8_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty],
   5059           [IntrArgMemOnly]>;
   5060 
   5061   def int_x86_avx512_scattersiv8_sf :
   5062         GCCBuiltin<"__builtin_ia32_scattersiv8sf">,
   5063           Intrinsic<[],
   5064           [llvm_ptr_ty, llvm_i8_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i32_ty],
   5065           [IntrArgMemOnly]>;
   5066 
   5067   def int_x86_avx512_scattersiv8_si :
   5068         GCCBuiltin<"__builtin_ia32_scattersiv8si">,
   5069           Intrinsic<[],
   5070           [llvm_ptr_ty, llvm_i8_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i32_ty],
   5071           [IntrArgMemOnly]>;
   5072 
   5073   // gather prefetch
   5074   def int_x86_avx512_gatherpf_dpd_512  : GCCBuiltin<"__builtin_ia32_gatherpfdpd">,
   5075           Intrinsic<[], [llvm_i8_ty, llvm_v8i32_ty, llvm_ptr_ty,
   5076                      llvm_i32_ty, llvm_i32_ty], [IntrArgMemOnly]>;
   5077   def int_x86_avx512_gatherpf_dps_512  : GCCBuiltin<"__builtin_ia32_gatherpfdps">,
   5078           Intrinsic<[], [llvm_i16_ty, llvm_v16i32_ty, llvm_ptr_ty,
   5079                      llvm_i32_ty, llvm_i32_ty], [IntrArgMemOnly]>;
   5080   def int_x86_avx512_gatherpf_qpd_512  : GCCBuiltin<"__builtin_ia32_gatherpfqpd">,
   5081           Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
   5082                      llvm_i32_ty, llvm_i32_ty], [IntrArgMemOnly]>;
   5083   def int_x86_avx512_gatherpf_qps_512  : GCCBuiltin<"__builtin_ia32_gatherpfqps">,
   5084           Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
   5085                      llvm_i32_ty, llvm_i32_ty], [IntrArgMemOnly]>;
   5086 
   5087   // scatter prefetch
   5088   def int_x86_avx512_scatterpf_dpd_512  : GCCBuiltin<"__builtin_ia32_scatterpfdpd">,
   5089           Intrinsic<[], [llvm_i8_ty, llvm_v8i32_ty, llvm_ptr_ty,
   5090                      llvm_i32_ty, llvm_i32_ty], [IntrArgMemOnly]>;
   5091   def int_x86_avx512_scatterpf_dps_512  : GCCBuiltin<"__builtin_ia32_scatterpfdps">,
   5092           Intrinsic<[], [llvm_i16_ty, llvm_v16i32_ty, llvm_ptr_ty,
   5093                      llvm_i32_ty, llvm_i32_ty], [IntrArgMemOnly]>;
   5094   def int_x86_avx512_scatterpf_qpd_512  : GCCBuiltin<"__builtin_ia32_scatterpfqpd">,
   5095           Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
   5096                      llvm_i32_ty, llvm_i32_ty], [IntrArgMemOnly]>;
   5097   def int_x86_avx512_scatterpf_qps_512  : GCCBuiltin<"__builtin_ia32_scatterpfqps">,
   5098           Intrinsic<[], [llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty,
   5099                      llvm_i32_ty, llvm_i32_ty], [IntrArgMemOnly]>;
   5100 }
   5101 
   5102 // AVX-512 conflict detection instruction
   5103 // Instructions that count the number of leading zero bits
   5104 let TargetPrefix = "x86" in {
   5105   def int_x86_avx512_mask_conflict_d_128 :
   5106           GCCBuiltin<"__builtin_ia32_vpconflictsi_128_mask">,
   5107           Intrinsic<[llvm_v4i32_ty],
   5108                     [llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty],
   5109                     [IntrNoMem]>;
   5110   def int_x86_avx512_mask_conflict_d_256 :
   5111           GCCBuiltin<"__builtin_ia32_vpconflictsi_256_mask">,
   5112           Intrinsic<[llvm_v8i32_ty],
   5113                     [llvm_v8i32_ty, llvm_v8i32_ty, llvm_i8_ty],
   5114                     [IntrNoMem]>;
   5115   def int_x86_avx512_mask_conflict_d_512 :
   5116           GCCBuiltin<"__builtin_ia32_vpconflictsi_512_mask">,
   5117           Intrinsic<[llvm_v16i32_ty],
   5118                     [llvm_v16i32_ty, llvm_v16i32_ty, llvm_i16_ty],
   5119                     [IntrNoMem]>;
   5120 
   5121   def int_x86_avx512_mask_conflict_q_128 :
   5122           GCCBuiltin<"__builtin_ia32_vpconflictdi_128_mask">,
   5123           Intrinsic<[llvm_v2i64_ty],
   5124                     [llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty],
   5125                     [IntrNoMem]>;
   5126   def int_x86_avx512_mask_conflict_q_256 :
   5127           GCCBuiltin<"__builtin_ia32_vpconflictdi_256_mask">,
   5128           Intrinsic<[llvm_v4i64_ty],
   5129                     [llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty],
   5130                     [IntrNoMem]>;
   5131   def int_x86_avx512_mask_conflict_q_512 :
   5132           GCCBuiltin<"__builtin_ia32_vpconflictdi_512_mask">,
   5133           Intrinsic<[llvm_v8i64_ty],
   5134                     [llvm_v8i64_ty, llvm_v8i64_ty, llvm_i8_ty],
   5135                     [IntrNoMem]>;
   5136 }
   5137 
   5138 // Compares
   5139 let TargetPrefix = "x86" in {
   5140   // 512-bit
   5141   def int_x86_avx512_vcomi_sd : GCCBuiltin<"__builtin_ia32_vcomisd">,
   5142               Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty,
   5143                          llvm_v2f64_ty, llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
   5144   def int_x86_avx512_vcomi_ss : GCCBuiltin<"__builtin_ia32_vcomiss">,
   5145               Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty,
   5146                          llvm_v4f32_ty, llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
   5147 }
   5148 
   5149 // Compress, Expand
   5150 let TargetPrefix = "x86" in {
   5151   def int_x86_avx512_mask_compress_ps_512 :
   5152                              GCCBuiltin<"__builtin_ia32_compresssf512_mask">,
   5153         Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   5154                    llvm_i16_ty], [IntrNoMem]>;
   5155   def int_x86_avx512_mask_compress_pd_512 :
   5156                              GCCBuiltin<"__builtin_ia32_compressdf512_mask">,
   5157         Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   5158                    llvm_i8_ty], [IntrNoMem]>;
   5159   def int_x86_avx512_mask_compress_ps_256 :
   5160                              GCCBuiltin<"__builtin_ia32_compresssf256_mask">,
   5161         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
   5162                    llvm_i8_ty], [IntrNoMem]>;
   5163   def int_x86_avx512_mask_compress_pd_256 :
   5164                              GCCBuiltin<"__builtin_ia32_compressdf256_mask">,
   5165         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
   5166                    llvm_i8_ty], [IntrNoMem]>;
   5167   def int_x86_avx512_mask_compress_ps_128 :
   5168                              GCCBuiltin<"__builtin_ia32_compresssf128_mask">,
   5169         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   5170                    llvm_i8_ty], [IntrNoMem]>;
   5171   def int_x86_avx512_mask_compress_pd_128 :
   5172                              GCCBuiltin<"__builtin_ia32_compressdf128_mask">,
   5173         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   5174                    llvm_i8_ty], [IntrNoMem]>;
   5175 
   5176   def int_x86_avx512_mask_compress_store_ps_512 :
   5177                             GCCBuiltin<"__builtin_ia32_compressstoresf512_mask">,
   5178         Intrinsic<[], [llvm_ptr_ty, llvm_v16f32_ty,
   5179                    llvm_i16_ty], [IntrArgMemOnly]>;
   5180   def int_x86_avx512_mask_compress_store_pd_512 :
   5181                             GCCBuiltin<"__builtin_ia32_compressstoredf512_mask">,
   5182         Intrinsic<[], [llvm_ptr_ty, llvm_v8f64_ty,
   5183                    llvm_i8_ty], [IntrArgMemOnly]>;
   5184   def int_x86_avx512_mask_compress_store_ps_256 :
   5185                             GCCBuiltin<"__builtin_ia32_compressstoresf256_mask">,
   5186         Intrinsic<[], [llvm_ptr_ty, llvm_v8f32_ty,
   5187                    llvm_i8_ty], [IntrArgMemOnly]>;
   5188   def int_x86_avx512_mask_compress_store_pd_256 :
   5189                             GCCBuiltin<"__builtin_ia32_compressstoredf256_mask">,
   5190         Intrinsic<[], [llvm_ptr_ty, llvm_v4f64_ty,
   5191                    llvm_i8_ty], [IntrArgMemOnly]>;
   5192   def int_x86_avx512_mask_compress_store_ps_128 :
   5193                             GCCBuiltin<"__builtin_ia32_compressstoresf128_mask">,
   5194         Intrinsic<[], [llvm_ptr_ty, llvm_v4f32_ty,
   5195                    llvm_i8_ty], [IntrArgMemOnly]>;
   5196   def int_x86_avx512_mask_compress_store_pd_128 :
   5197                             GCCBuiltin<"__builtin_ia32_compressstoredf128_mask">,
   5198         Intrinsic<[], [llvm_ptr_ty, llvm_v2f64_ty,
   5199                    llvm_i8_ty], [IntrArgMemOnly]>;
   5200 
   5201   def int_x86_avx512_mask_compress_d_512 :
   5202                              GCCBuiltin<"__builtin_ia32_compresssi512_mask">,
   5203         Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty,
   5204                    llvm_i16_ty], [IntrNoMem]>;
   5205   def int_x86_avx512_mask_compress_q_512 :
   5206                              GCCBuiltin<"__builtin_ia32_compressdi512_mask">,
   5207         Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty,
   5208                    llvm_i8_ty], [IntrNoMem]>;
   5209   def int_x86_avx512_mask_compress_d_256 :
   5210                              GCCBuiltin<"__builtin_ia32_compresssi256_mask">,
   5211         Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty,
   5212                    llvm_i8_ty], [IntrNoMem]>;
   5213   def int_x86_avx512_mask_compress_q_256 :
   5214                              GCCBuiltin<"__builtin_ia32_compressdi256_mask">,
   5215         Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty,
   5216                    llvm_i8_ty], [IntrNoMem]>;
   5217   def int_x86_avx512_mask_compress_d_128 :
   5218                              GCCBuiltin<"__builtin_ia32_compresssi128_mask">,
   5219         Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
   5220                    llvm_i8_ty], [IntrNoMem]>;
   5221   def int_x86_avx512_mask_compress_q_128 :
   5222                              GCCBuiltin<"__builtin_ia32_compressdi128_mask">,
   5223         Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
   5224                    llvm_i8_ty], [IntrNoMem]>;
   5225 
   5226   def int_x86_avx512_mask_compress_store_d_512 :
   5227                             GCCBuiltin<"__builtin_ia32_compressstoresi512_mask">,
   5228         Intrinsic<[], [llvm_ptr_ty, llvm_v16i32_ty,
   5229                    llvm_i16_ty], [IntrArgMemOnly]>;
   5230   def int_x86_avx512_mask_compress_store_q_512 :
   5231                             GCCBuiltin<"__builtin_ia32_compressstoredi512_mask">,
   5232         Intrinsic<[], [llvm_ptr_ty, llvm_v8i64_ty,
   5233                    llvm_i8_ty], [IntrArgMemOnly]>;
   5234   def int_x86_avx512_mask_compress_store_d_256 :
   5235                             GCCBuiltin<"__builtin_ia32_compressstoresi256_mask">,
   5236         Intrinsic<[], [llvm_ptr_ty, llvm_v8i32_ty,
   5237                    llvm_i8_ty], [IntrArgMemOnly]>;
   5238   def int_x86_avx512_mask_compress_store_q_256 :
   5239                             GCCBuiltin<"__builtin_ia32_compressstoredi256_mask">,
   5240         Intrinsic<[], [llvm_ptr_ty, llvm_v4i64_ty,
   5241                    llvm_i8_ty], [IntrArgMemOnly]>;
   5242   def int_x86_avx512_mask_compress_store_d_128 :
   5243                             GCCBuiltin<"__builtin_ia32_compressstoresi128_mask">,
   5244         Intrinsic<[], [llvm_ptr_ty, llvm_v4i32_ty,
   5245                    llvm_i8_ty], [IntrArgMemOnly]>;
   5246   def int_x86_avx512_mask_compress_store_q_128 :
   5247                             GCCBuiltin<"__builtin_ia32_compressstoredi128_mask">,
   5248         Intrinsic<[], [llvm_ptr_ty, llvm_v2i64_ty,
   5249                    llvm_i8_ty], [IntrArgMemOnly]>;
   5250 
   5251 // expand
   5252   def int_x86_avx512_mask_expand_ps_512 :
   5253                              GCCBuiltin<"__builtin_ia32_expandsf512_mask">,
   5254         Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   5255                    llvm_i16_ty], [IntrNoMem]>;
   5256   def int_x86_avx512_mask_expand_pd_512 :
   5257                              GCCBuiltin<"__builtin_ia32_expanddf512_mask">,
   5258         Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   5259                    llvm_i8_ty], [IntrNoMem]>;
   5260   def int_x86_avx512_mask_expand_ps_256 :
   5261                              GCCBuiltin<"__builtin_ia32_expandsf256_mask">,
   5262         Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
   5263                    llvm_i8_ty], [IntrNoMem]>;
   5264   def int_x86_avx512_mask_expand_pd_256 :
   5265                              GCCBuiltin<"__builtin_ia32_expanddf256_mask">,
   5266         Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
   5267                    llvm_i8_ty], [IntrNoMem]>;
   5268   def int_x86_avx512_mask_expand_ps_128 :
   5269                              GCCBuiltin<"__builtin_ia32_expandsf128_mask">,
   5270         Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   5271                    llvm_i8_ty], [IntrNoMem]>;
   5272   def int_x86_avx512_mask_expand_pd_128 :
   5273                              GCCBuiltin<"__builtin_ia32_expanddf128_mask">,
   5274         Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   5275                    llvm_i8_ty], [IntrNoMem]>;
   5276 
   5277   def int_x86_avx512_mask_expand_load_ps_512 :
   5278                             GCCBuiltin<"__builtin_ia32_expandloadsf512_mask">,
   5279         Intrinsic<[llvm_v16f32_ty], [llvm_ptr_ty, llvm_v16f32_ty,
   5280                    llvm_i16_ty], [IntrReadMem, IntrArgMemOnly]>;
   5281   def int_x86_avx512_mask_expand_load_pd_512 :
   5282                             GCCBuiltin<"__builtin_ia32_expandloaddf512_mask">,
   5283         Intrinsic<[llvm_v8f64_ty], [llvm_ptr_ty, llvm_v8f64_ty,
   5284                    llvm_i8_ty], [IntrReadMem, IntrArgMemOnly]>;
   5285   def int_x86_avx512_mask_expand_load_ps_256 :
   5286                             GCCBuiltin<"__builtin_ia32_expandloadsf256_mask">,
   5287         Intrinsic<[llvm_v8f32_ty], [llvm_ptr_ty, llvm_v8f32_ty,
   5288                    llvm_i8_ty], [IntrReadMem, IntrArgMemOnly]>;
   5289   def int_x86_avx512_mask_expand_load_pd_256 :
   5290                             GCCBuiltin<"__builtin_ia32_expandloaddf256_mask">,
   5291         Intrinsic<[llvm_v4f64_ty], [llvm_ptr_ty, llvm_v4f64_ty,
   5292                    llvm_i8_ty], [IntrReadMem, IntrArgMemOnly]>;
   5293   def int_x86_avx512_mask_expand_load_ps_128 :
   5294                             GCCBuiltin<"__builtin_ia32_expandloadsf128_mask">,
   5295         Intrinsic<[llvm_v4f32_ty], [llvm_ptr_ty, llvm_v4f32_ty,
   5296                    llvm_i8_ty], [IntrReadMem, IntrArgMemOnly]>;
   5297   def int_x86_avx512_mask_expand_load_pd_128 :
   5298                             GCCBuiltin<"__builtin_ia32_expandloaddf128_mask">,
   5299         Intrinsic<[llvm_v2f64_ty], [llvm_ptr_ty, llvm_v2f64_ty,
   5300                    llvm_i8_ty], [IntrReadMem, IntrArgMemOnly]>;
   5301 
   5302   def int_x86_avx512_mask_expand_d_512 :
   5303                              GCCBuiltin<"__builtin_ia32_expandsi512_mask">,
   5304         Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_v16i32_ty,
   5305                    llvm_i16_ty], [IntrNoMem]>;
   5306   def int_x86_avx512_mask_expand_q_512 :
   5307                              GCCBuiltin<"__builtin_ia32_expanddi512_mask">,
   5308         Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_v8i64_ty,
   5309                    llvm_i8_ty], [IntrNoMem]>;
   5310   def int_x86_avx512_mask_expand_d_256 :
   5311                              GCCBuiltin<"__builtin_ia32_expandsi256_mask">,
   5312         Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_v8i32_ty,
   5313                    llvm_i8_ty], [IntrNoMem]>;
   5314   def int_x86_avx512_mask_expand_q_256 :
   5315                              GCCBuiltin<"__builtin_ia32_expanddi256_mask">,
   5316         Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_v4i64_ty,
   5317                    llvm_i8_ty], [IntrNoMem]>;
   5318   def int_x86_avx512_mask_expand_d_128 :
   5319                              GCCBuiltin<"__builtin_ia32_expandsi128_mask">,
   5320         Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,
   5321                    llvm_i8_ty], [IntrNoMem]>;
   5322   def int_x86_avx512_mask_expand_q_128 :
   5323                              GCCBuiltin<"__builtin_ia32_expanddi128_mask">,
   5324         Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty,
   5325                    llvm_i8_ty], [IntrNoMem]>;
   5326 
   5327   def int_x86_avx512_mask_expand_load_d_512 :
   5328                             GCCBuiltin<"__builtin_ia32_expandloadsi512_mask">,
   5329         Intrinsic<[llvm_v16i32_ty], [llvm_ptr_ty, llvm_v16i32_ty,
   5330                    llvm_i16_ty], [IntrReadMem, IntrArgMemOnly]>;
   5331   def int_x86_avx512_mask_expand_load_q_512 :
   5332                             GCCBuiltin<"__builtin_ia32_expandloaddi512_mask">,
   5333         Intrinsic<[llvm_v8i64_ty], [llvm_ptr_ty, llvm_v8i64_ty,
   5334                    llvm_i8_ty], [IntrReadMem, IntrArgMemOnly]>;
   5335   def int_x86_avx512_mask_expand_load_d_256 :
   5336                             GCCBuiltin<"__builtin_ia32_expandloadsi256_mask">,
   5337         Intrinsic<[llvm_v8i32_ty], [llvm_ptr_ty, llvm_v8i32_ty,
   5338                    llvm_i8_ty], [IntrReadMem, IntrArgMemOnly]>;
   5339   def int_x86_avx512_mask_expand_load_q_256 :
   5340                             GCCBuiltin<"__builtin_ia32_expandloaddi256_mask">,
   5341         Intrinsic<[llvm_v4i64_ty], [llvm_ptr_ty, llvm_v4i64_ty,
   5342                    llvm_i8_ty], [IntrReadMem, IntrArgMemOnly]>;
   5343   def int_x86_avx512_mask_expand_load_d_128 :
   5344                             GCCBuiltin<"__builtin_ia32_expandloadsi128_mask">,
   5345         Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty, llvm_v4i32_ty,
   5346                    llvm_i8_ty], [IntrReadMem, IntrArgMemOnly]>;
   5347   def int_x86_avx512_mask_expand_load_q_128 :
   5348                             GCCBuiltin<"__builtin_ia32_expandloaddi128_mask">,
   5349         Intrinsic<[llvm_v2i64_ty], [llvm_ptr_ty, llvm_v2i64_ty,
   5350                    llvm_i8_ty], [IntrReadMem, IntrArgMemOnly]>;
   5351 
   5352 }
   5353 
   5354 // truncate
   5355 let TargetPrefix = "x86" in {
   5356   def int_x86_avx512_mask_pmov_qb_128 :
   5357           GCCBuiltin<"__builtin_ia32_pmovqb128_mask">,
   5358           Intrinsic<[llvm_v16i8_ty],
   5359                     [llvm_v2i64_ty, llvm_v16i8_ty, llvm_i8_ty],
   5360                     [IntrNoMem]>;
   5361   def int_x86_avx512_mask_pmov_qb_mem_128 :
   5362           GCCBuiltin<"__builtin_ia32_pmovqb128mem_mask">,
   5363           Intrinsic<[],
   5364                     [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
   5365                     [IntrArgMemOnly]>;
   5366   def int_x86_avx512_mask_pmovs_qb_128 :
   5367           GCCBuiltin<"__builtin_ia32_pmovsqb128_mask">,
   5368           Intrinsic<[llvm_v16i8_ty],
   5369                     [llvm_v2i64_ty, llvm_v16i8_ty, llvm_i8_ty],
   5370                     [IntrNoMem]>;
   5371   def int_x86_avx512_mask_pmovs_qb_mem_128 :
   5372           GCCBuiltin<"__builtin_ia32_pmovsqb128mem_mask">,
   5373           Intrinsic<[],
   5374                     [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
   5375                     [IntrArgMemOnly]>;
   5376   def int_x86_avx512_mask_pmovus_qb_128 :
   5377           GCCBuiltin<"__builtin_ia32_pmovusqb128_mask">,
   5378           Intrinsic<[llvm_v16i8_ty],
   5379                     [llvm_v2i64_ty, llvm_v16i8_ty, llvm_i8_ty],
   5380                     [IntrNoMem]>;
   5381   def int_x86_avx512_mask_pmovus_qb_mem_128 :
   5382           GCCBuiltin<"__builtin_ia32_pmovusqb128mem_mask">,
   5383           Intrinsic<[],
   5384                     [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
   5385                     [IntrArgMemOnly]>;
   5386   def int_x86_avx512_mask_pmov_qb_256 :
   5387           GCCBuiltin<"__builtin_ia32_pmovqb256_mask">,
   5388           Intrinsic<[llvm_v16i8_ty],
   5389                     [llvm_v4i64_ty, llvm_v16i8_ty, llvm_i8_ty],
   5390                     [IntrNoMem]>;
   5391   def int_x86_avx512_mask_pmov_qb_mem_256 :
   5392           GCCBuiltin<"__builtin_ia32_pmovqb256mem_mask">,
   5393           Intrinsic<[],
   5394                     [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
   5395                     [IntrArgMemOnly]>;
   5396   def int_x86_avx512_mask_pmovs_qb_256 :
   5397           GCCBuiltin<"__builtin_ia32_pmovsqb256_mask">,
   5398           Intrinsic<[llvm_v16i8_ty],
   5399                     [llvm_v4i64_ty, llvm_v16i8_ty, llvm_i8_ty],
   5400                     [IntrNoMem]>;
   5401   def int_x86_avx512_mask_pmovs_qb_mem_256 :
   5402           GCCBuiltin<"__builtin_ia32_pmovsqb256mem_mask">,
   5403           Intrinsic<[],
   5404                     [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
   5405                     [IntrArgMemOnly]>;
   5406   def int_x86_avx512_mask_pmovus_qb_256 :
   5407           GCCBuiltin<"__builtin_ia32_pmovusqb256_mask">,
   5408           Intrinsic<[llvm_v16i8_ty],
   5409                     [llvm_v4i64_ty, llvm_v16i8_ty, llvm_i8_ty],
   5410                     [IntrNoMem]>;
   5411   def int_x86_avx512_mask_pmovus_qb_mem_256 :
   5412           GCCBuiltin<"__builtin_ia32_pmovusqb256mem_mask">,
   5413           Intrinsic<[],
   5414                     [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
   5415                     [IntrArgMemOnly]>;
   5416   def int_x86_avx512_mask_pmov_qb_512 :
   5417           GCCBuiltin<"__builtin_ia32_pmovqb512_mask">,
   5418           Intrinsic<[llvm_v16i8_ty],
   5419                     [llvm_v8i64_ty, llvm_v16i8_ty, llvm_i8_ty],
   5420                     [IntrNoMem]>;
   5421   def int_x86_avx512_mask_pmov_qb_mem_512 :
   5422           GCCBuiltin<"__builtin_ia32_pmovqb512mem_mask">,
   5423           Intrinsic<[],
   5424                     [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
   5425                     [IntrArgMemOnly]>;
   5426   def int_x86_avx512_mask_pmovs_qb_512 :
   5427           GCCBuiltin<"__builtin_ia32_pmovsqb512_mask">,
   5428           Intrinsic<[llvm_v16i8_ty],
   5429                     [llvm_v8i64_ty, llvm_v16i8_ty, llvm_i8_ty],
   5430                     [IntrNoMem]>;
   5431   def int_x86_avx512_mask_pmovs_qb_mem_512 :
   5432           GCCBuiltin<"__builtin_ia32_pmovsqb512mem_mask">,
   5433           Intrinsic<[],
   5434                     [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
   5435                     [IntrArgMemOnly]>;
   5436   def int_x86_avx512_mask_pmovus_qb_512 :
   5437           GCCBuiltin<"__builtin_ia32_pmovusqb512_mask">,
   5438           Intrinsic<[llvm_v16i8_ty],
   5439                     [llvm_v8i64_ty, llvm_v16i8_ty, llvm_i8_ty],
   5440                     [IntrNoMem]>;
   5441   def int_x86_avx512_mask_pmovus_qb_mem_512 :
   5442           GCCBuiltin<"__builtin_ia32_pmovusqb512mem_mask">,
   5443           Intrinsic<[],
   5444                     [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
   5445                     [IntrArgMemOnly]>;
   5446   def int_x86_avx512_mask_pmov_qw_128 :
   5447           GCCBuiltin<"__builtin_ia32_pmovqw128_mask">,
   5448           Intrinsic<[llvm_v8i16_ty],
   5449                     [llvm_v2i64_ty, llvm_v8i16_ty, llvm_i8_ty],
   5450                     [IntrNoMem]>;
   5451   def int_x86_avx512_mask_pmov_qw_mem_128 :
   5452           GCCBuiltin<"__builtin_ia32_pmovqw128mem_mask">,
   5453           Intrinsic<[],
   5454                     [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
   5455                     [IntrArgMemOnly]>;
   5456   def int_x86_avx512_mask_pmovs_qw_128 :
   5457           GCCBuiltin<"__builtin_ia32_pmovsqw128_mask">,
   5458           Intrinsic<[llvm_v8i16_ty],
   5459                     [llvm_v2i64_ty, llvm_v8i16_ty, llvm_i8_ty],
   5460                     [IntrNoMem]>;
   5461   def int_x86_avx512_mask_pmovs_qw_mem_128 :
   5462           GCCBuiltin<"__builtin_ia32_pmovsqw128mem_mask">,
   5463           Intrinsic<[],
   5464                     [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
   5465                     [IntrArgMemOnly]>;
   5466   def int_x86_avx512_mask_pmovus_qw_128 :
   5467           GCCBuiltin<"__builtin_ia32_pmovusqw128_mask">,
   5468           Intrinsic<[llvm_v8i16_ty],
   5469                     [llvm_v2i64_ty, llvm_v8i16_ty, llvm_i8_ty],
   5470                     [IntrNoMem]>;
   5471   def int_x86_avx512_mask_pmovus_qw_mem_128 :
   5472           GCCBuiltin<"__builtin_ia32_pmovusqw128mem_mask">,
   5473           Intrinsic<[],
   5474                     [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
   5475                     [IntrArgMemOnly]>;
   5476   def int_x86_avx512_mask_pmov_qw_256 :
   5477           GCCBuiltin<"__builtin_ia32_pmovqw256_mask">,
   5478           Intrinsic<[llvm_v8i16_ty],
   5479                     [llvm_v4i64_ty, llvm_v8i16_ty, llvm_i8_ty],
   5480                     [IntrNoMem]>;
   5481   def int_x86_avx512_mask_pmov_qw_mem_256 :
   5482           GCCBuiltin<"__builtin_ia32_pmovqw256mem_mask">,
   5483           Intrinsic<[],
   5484                     [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
   5485                     [IntrArgMemOnly]>;
   5486   def int_x86_avx512_mask_pmovs_qw_256 :
   5487           GCCBuiltin<"__builtin_ia32_pmovsqw256_mask">,
   5488           Intrinsic<[llvm_v8i16_ty],
   5489                     [llvm_v4i64_ty, llvm_v8i16_ty, llvm_i8_ty],
   5490                     [IntrNoMem]>;
   5491   def int_x86_avx512_mask_pmovs_qw_mem_256 :
   5492           GCCBuiltin<"__builtin_ia32_pmovsqw256mem_mask">,
   5493           Intrinsic<[],
   5494                     [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
   5495                     [IntrArgMemOnly]>;
   5496   def int_x86_avx512_mask_pmovus_qw_256 :
   5497           GCCBuiltin<"__builtin_ia32_pmovusqw256_mask">,
   5498           Intrinsic<[llvm_v8i16_ty],
   5499                     [llvm_v4i64_ty, llvm_v8i16_ty, llvm_i8_ty],
   5500                     [IntrNoMem]>;
   5501   def int_x86_avx512_mask_pmovus_qw_mem_256 :
   5502           GCCBuiltin<"__builtin_ia32_pmovusqw256mem_mask">,
   5503           Intrinsic<[],
   5504                     [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
   5505                     [IntrArgMemOnly]>;
   5506   def int_x86_avx512_mask_pmov_qw_512 :
   5507           GCCBuiltin<"__builtin_ia32_pmovqw512_mask">,
   5508           Intrinsic<[llvm_v8i16_ty],
   5509                     [llvm_v8i64_ty, llvm_v8i16_ty, llvm_i8_ty],
   5510                     [IntrNoMem]>;
   5511   def int_x86_avx512_mask_pmov_qw_mem_512 :
   5512           GCCBuiltin<"__builtin_ia32_pmovqw512mem_mask">,
   5513           Intrinsic<[],
   5514                     [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
   5515                     [IntrArgMemOnly]>;
   5516   def int_x86_avx512_mask_pmovs_qw_512 :
   5517           GCCBuiltin<"__builtin_ia32_pmovsqw512_mask">,
   5518           Intrinsic<[llvm_v8i16_ty],
   5519                     [llvm_v8i64_ty, llvm_v8i16_ty, llvm_i8_ty],
   5520                     [IntrNoMem]>;
   5521   def int_x86_avx512_mask_pmovs_qw_mem_512 :
   5522           GCCBuiltin<"__builtin_ia32_pmovsqw512mem_mask">,
   5523           Intrinsic<[],
   5524                     [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
   5525                     [IntrArgMemOnly]>;
   5526   def int_x86_avx512_mask_pmovus_qw_512 :
   5527           GCCBuiltin<"__builtin_ia32_pmovusqw512_mask">,
   5528           Intrinsic<[llvm_v8i16_ty],
   5529                     [llvm_v8i64_ty, llvm_v8i16_ty, llvm_i8_ty],
   5530                     [IntrNoMem]>;
   5531   def int_x86_avx512_mask_pmovus_qw_mem_512 :
   5532           GCCBuiltin<"__builtin_ia32_pmovusqw512mem_mask">,
   5533           Intrinsic<[],
   5534                     [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
   5535                     [IntrArgMemOnly]>;
   5536   def int_x86_avx512_mask_pmov_qd_128 :
   5537           GCCBuiltin<"__builtin_ia32_pmovqd128_mask">,
   5538           Intrinsic<[llvm_v4i32_ty],
   5539                     [llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
   5540                     [IntrNoMem]>;
   5541   def int_x86_avx512_mask_pmov_qd_mem_128 :
   5542           GCCBuiltin<"__builtin_ia32_pmovqd128mem_mask">,
   5543           Intrinsic<[],
   5544                     [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
   5545                     [IntrArgMemOnly]>;
   5546   def int_x86_avx512_mask_pmovs_qd_128 :
   5547           GCCBuiltin<"__builtin_ia32_pmovsqd128_mask">,
   5548           Intrinsic<[llvm_v4i32_ty],
   5549                     [llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
   5550                     [IntrNoMem]>;
   5551   def int_x86_avx512_mask_pmovs_qd_mem_128 :
   5552           GCCBuiltin<"__builtin_ia32_pmovsqd128mem_mask">,
   5553           Intrinsic<[],
   5554                     [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
   5555                     [IntrArgMemOnly]>;
   5556   def int_x86_avx512_mask_pmovus_qd_128 :
   5557           GCCBuiltin<"__builtin_ia32_pmovusqd128_mask">,
   5558           Intrinsic<[llvm_v4i32_ty],
   5559                     [llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty],
   5560                     [IntrNoMem]>;
   5561   def int_x86_avx512_mask_pmovus_qd_mem_128 :
   5562           GCCBuiltin<"__builtin_ia32_pmovusqd128mem_mask">,
   5563           Intrinsic<[],
   5564                     [llvm_ptr_ty, llvm_v2i64_ty, llvm_i8_ty],
   5565                     [IntrArgMemOnly]>;
   5566   def int_x86_avx512_mask_pmov_qd_256 :
   5567           GCCBuiltin<"__builtin_ia32_pmovqd256_mask">,
   5568           Intrinsic<[llvm_v4i32_ty],
   5569                     [llvm_v4i64_ty, llvm_v4i32_ty, llvm_i8_ty],
   5570                     [IntrNoMem]>;
   5571   def int_x86_avx512_mask_pmov_qd_mem_256 :
   5572           GCCBuiltin<"__builtin_ia32_pmovqd256mem_mask">,
   5573           Intrinsic<[],
   5574                     [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
   5575                     [IntrArgMemOnly]>;
   5576   def int_x86_avx512_mask_pmovs_qd_256 :
   5577           GCCBuiltin<"__builtin_ia32_pmovsqd256_mask">,
   5578           Intrinsic<[llvm_v4i32_ty],
   5579                     [llvm_v4i64_ty, llvm_v4i32_ty, llvm_i8_ty],
   5580                     [IntrNoMem]>;
   5581   def int_x86_avx512_mask_pmovs_qd_mem_256 :
   5582           GCCBuiltin<"__builtin_ia32_pmovsqd256mem_mask">,
   5583           Intrinsic<[],
   5584                     [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
   5585                     [IntrArgMemOnly]>;
   5586   def int_x86_avx512_mask_pmovus_qd_256 :
   5587           GCCBuiltin<"__builtin_ia32_pmovusqd256_mask">,
   5588           Intrinsic<[llvm_v4i32_ty],
   5589                     [llvm_v4i64_ty, llvm_v4i32_ty, llvm_i8_ty],
   5590                     [IntrNoMem]>;
   5591   def int_x86_avx512_mask_pmovus_qd_mem_256 :
   5592           GCCBuiltin<"__builtin_ia32_pmovusqd256mem_mask">,
   5593           Intrinsic<[],
   5594                     [llvm_ptr_ty, llvm_v4i64_ty, llvm_i8_ty],
   5595                     [IntrArgMemOnly]>;
   5596   def int_x86_avx512_mask_pmov_qd_512 :
   5597           GCCBuiltin<"__builtin_ia32_pmovqd512_mask">,
   5598           Intrinsic<[llvm_v8i32_ty],
   5599                     [llvm_v8i64_ty, llvm_v8i32_ty, llvm_i8_ty],
   5600                     [IntrNoMem]>;
   5601   def int_x86_avx512_mask_pmov_qd_mem_512 :
   5602           GCCBuiltin<"__builtin_ia32_pmovqd512mem_mask">,
   5603           Intrinsic<[],
   5604                     [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
   5605                     [IntrArgMemOnly]>;
   5606   def int_x86_avx512_mask_pmovs_qd_512 :
   5607           GCCBuiltin<"__builtin_ia32_pmovsqd512_mask">,
   5608           Intrinsic<[llvm_v8i32_ty],
   5609                     [llvm_v8i64_ty, llvm_v8i32_ty, llvm_i8_ty],
   5610                     [IntrNoMem]>;
   5611   def int_x86_avx512_mask_pmovs_qd_mem_512 :
   5612           GCCBuiltin<"__builtin_ia32_pmovsqd512mem_mask">,
   5613           Intrinsic<[],
   5614                     [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
   5615                     [IntrArgMemOnly]>;
   5616   def int_x86_avx512_mask_pmovus_qd_512 :
   5617           GCCBuiltin<"__builtin_ia32_pmovusqd512_mask">,
   5618           Intrinsic<[llvm_v8i32_ty],
   5619                     [llvm_v8i64_ty, llvm_v8i32_ty, llvm_i8_ty],
   5620                     [IntrNoMem]>;
   5621   def int_x86_avx512_mask_pmovus_qd_mem_512 :
   5622           GCCBuiltin<"__builtin_ia32_pmovusqd512mem_mask">,
   5623           Intrinsic<[],
   5624                     [llvm_ptr_ty, llvm_v8i64_ty, llvm_i8_ty],
   5625                     [IntrArgMemOnly]>;
   5626   def int_x86_avx512_mask_pmov_db_128 :
   5627           GCCBuiltin<"__builtin_ia32_pmovdb128_mask">,
   5628           Intrinsic<[llvm_v16i8_ty],
   5629                     [llvm_v4i32_ty, llvm_v16i8_ty, llvm_i8_ty],
   5630                     [IntrNoMem]>;
   5631   def int_x86_avx512_mask_pmov_db_mem_128 :
   5632           GCCBuiltin<"__builtin_ia32_pmovdb128mem_mask">,
   5633           Intrinsic<[],
   5634                     [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
   5635                     [IntrArgMemOnly]>;
   5636   def int_x86_avx512_mask_pmovs_db_128 :
   5637           GCCBuiltin<"__builtin_ia32_pmovsdb128_mask">,
   5638           Intrinsic<[llvm_v16i8_ty],
   5639                     [llvm_v4i32_ty, llvm_v16i8_ty, llvm_i8_ty],
   5640                     [IntrNoMem]>;
   5641   def int_x86_avx512_mask_pmovs_db_mem_128 :
   5642           GCCBuiltin<"__builtin_ia32_pmovsdb128mem_mask">,
   5643           Intrinsic<[],
   5644                     [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
   5645                     [IntrArgMemOnly]>;
   5646   def int_x86_avx512_mask_pmovus_db_128 :
   5647           GCCBuiltin<"__builtin_ia32_pmovusdb128_mask">,
   5648           Intrinsic<[llvm_v16i8_ty],
   5649                     [llvm_v4i32_ty, llvm_v16i8_ty, llvm_i8_ty],
   5650                     [IntrNoMem]>;
   5651   def int_x86_avx512_mask_pmovus_db_mem_128 :
   5652           GCCBuiltin<"__builtin_ia32_pmovusdb128mem_mask">,
   5653           Intrinsic<[],
   5654                     [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
   5655                     [IntrArgMemOnly]>;
   5656   def int_x86_avx512_mask_pmov_db_256 :
   5657           GCCBuiltin<"__builtin_ia32_pmovdb256_mask">,
   5658           Intrinsic<[llvm_v16i8_ty],
   5659                     [llvm_v8i32_ty, llvm_v16i8_ty, llvm_i8_ty],
   5660                     [IntrNoMem]>;
   5661   def int_x86_avx512_mask_pmov_db_mem_256 :
   5662           GCCBuiltin<"__builtin_ia32_pmovdb256mem_mask">,
   5663           Intrinsic<[],
   5664                     [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
   5665                     [IntrArgMemOnly]>;
   5666   def int_x86_avx512_mask_pmovs_db_256 :
   5667           GCCBuiltin<"__builtin_ia32_pmovsdb256_mask">,
   5668           Intrinsic<[llvm_v16i8_ty],
   5669                     [llvm_v8i32_ty, llvm_v16i8_ty, llvm_i8_ty],
   5670                     [IntrNoMem]>;
   5671   def int_x86_avx512_mask_pmovs_db_mem_256 :
   5672           GCCBuiltin<"__builtin_ia32_pmovsdb256mem_mask">,
   5673           Intrinsic<[],
   5674                     [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
   5675                     [IntrArgMemOnly]>;
   5676   def int_x86_avx512_mask_pmovus_db_256 :
   5677           GCCBuiltin<"__builtin_ia32_pmovusdb256_mask">,
   5678           Intrinsic<[llvm_v16i8_ty],
   5679                     [llvm_v8i32_ty, llvm_v16i8_ty, llvm_i8_ty],
   5680                     [IntrNoMem]>;
   5681   def int_x86_avx512_mask_pmovus_db_mem_256 :
   5682           GCCBuiltin<"__builtin_ia32_pmovusdb256mem_mask">,
   5683           Intrinsic<[],
   5684                     [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
   5685                     [IntrArgMemOnly]>;
   5686   def int_x86_avx512_mask_pmov_db_512 :
   5687           GCCBuiltin<"__builtin_ia32_pmovdb512_mask">,
   5688           Intrinsic<[llvm_v16i8_ty],
   5689                     [llvm_v16i32_ty, llvm_v16i8_ty, llvm_i16_ty],
   5690                     [IntrNoMem]>;
   5691   def int_x86_avx512_mask_pmov_db_mem_512 :
   5692           GCCBuiltin<"__builtin_ia32_pmovdb512mem_mask">,
   5693           Intrinsic<[],
   5694                     [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
   5695                     [IntrArgMemOnly]>;
   5696   def int_x86_avx512_mask_pmovs_db_512 :
   5697           GCCBuiltin<"__builtin_ia32_pmovsdb512_mask">,
   5698           Intrinsic<[llvm_v16i8_ty],
   5699                     [llvm_v16i32_ty, llvm_v16i8_ty, llvm_i16_ty],
   5700                     [IntrNoMem]>;
   5701   def int_x86_avx512_mask_pmovs_db_mem_512 :
   5702           GCCBuiltin<"__builtin_ia32_pmovsdb512mem_mask">,
   5703           Intrinsic<[],
   5704                     [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
   5705                     [IntrArgMemOnly]>;
   5706   def int_x86_avx512_mask_pmovus_db_512 :
   5707           GCCBuiltin<"__builtin_ia32_pmovusdb512_mask">,
   5708           Intrinsic<[llvm_v16i8_ty],
   5709                     [llvm_v16i32_ty, llvm_v16i8_ty, llvm_i16_ty],
   5710                     [IntrNoMem]>;
   5711   def int_x86_avx512_mask_pmovus_db_mem_512 :
   5712           GCCBuiltin<"__builtin_ia32_pmovusdb512mem_mask">,
   5713           Intrinsic<[],
   5714                     [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
   5715                     [IntrArgMemOnly]>;
   5716   def int_x86_avx512_mask_pmov_dw_128 :
   5717           GCCBuiltin<"__builtin_ia32_pmovdw128_mask">,
   5718           Intrinsic<[llvm_v8i16_ty],
   5719                     [llvm_v4i32_ty, llvm_v8i16_ty, llvm_i8_ty],
   5720                     [IntrNoMem]>;
   5721   def int_x86_avx512_mask_pmov_dw_mem_128 :
   5722           GCCBuiltin<"__builtin_ia32_pmovdw128mem_mask">,
   5723           Intrinsic<[],
   5724                     [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
   5725                     [IntrArgMemOnly]>;
   5726   def int_x86_avx512_mask_pmovs_dw_128 :
   5727           GCCBuiltin<"__builtin_ia32_pmovsdw128_mask">,
   5728           Intrinsic<[llvm_v8i16_ty],
   5729                     [llvm_v4i32_ty, llvm_v8i16_ty, llvm_i8_ty],
   5730                     [IntrNoMem]>;
   5731   def int_x86_avx512_mask_pmovs_dw_mem_128 :
   5732           GCCBuiltin<"__builtin_ia32_pmovsdw128mem_mask">,
   5733           Intrinsic<[],
   5734                     [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
   5735                     [IntrArgMemOnly]>;
   5736   def int_x86_avx512_mask_pmovus_dw_128 :
   5737           GCCBuiltin<"__builtin_ia32_pmovusdw128_mask">,
   5738           Intrinsic<[llvm_v8i16_ty],
   5739                     [llvm_v4i32_ty, llvm_v8i16_ty, llvm_i8_ty],
   5740                     [IntrNoMem]>;
   5741   def int_x86_avx512_mask_pmovus_dw_mem_128 :
   5742           GCCBuiltin<"__builtin_ia32_pmovusdw128mem_mask">,
   5743           Intrinsic<[],
   5744                     [llvm_ptr_ty, llvm_v4i32_ty, llvm_i8_ty],
   5745                     [IntrArgMemOnly]>;
   5746   def int_x86_avx512_mask_pmov_dw_256 :
   5747           GCCBuiltin<"__builtin_ia32_pmovdw256_mask">,
   5748           Intrinsic<[llvm_v8i16_ty],
   5749                     [llvm_v8i32_ty, llvm_v8i16_ty, llvm_i8_ty],
   5750                     [IntrNoMem]>;
   5751   def int_x86_avx512_mask_pmov_dw_mem_256 :
   5752           GCCBuiltin<"__builtin_ia32_pmovdw256mem_mask">,
   5753           Intrinsic<[],
   5754                     [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
   5755                     [IntrArgMemOnly]>;
   5756   def int_x86_avx512_mask_pmovs_dw_256 :
   5757           GCCBuiltin<"__builtin_ia32_pmovsdw256_mask">,
   5758           Intrinsic<[llvm_v8i16_ty],
   5759                     [llvm_v8i32_ty, llvm_v8i16_ty, llvm_i8_ty],
   5760                     [IntrNoMem]>;
   5761   def int_x86_avx512_mask_pmovs_dw_mem_256 :
   5762           GCCBuiltin<"__builtin_ia32_pmovsdw256mem_mask">,
   5763           Intrinsic<[],
   5764                     [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
   5765                     [IntrArgMemOnly]>;
   5766   def int_x86_avx512_mask_pmovus_dw_256 :
   5767           GCCBuiltin<"__builtin_ia32_pmovusdw256_mask">,
   5768           Intrinsic<[llvm_v8i16_ty],
   5769                     [llvm_v8i32_ty, llvm_v8i16_ty, llvm_i8_ty],
   5770                     [IntrNoMem]>;
   5771   def int_x86_avx512_mask_pmovus_dw_mem_256 :
   5772           GCCBuiltin<"__builtin_ia32_pmovusdw256mem_mask">,
   5773           Intrinsic<[],
   5774                     [llvm_ptr_ty, llvm_v8i32_ty, llvm_i8_ty],
   5775                     [IntrArgMemOnly]>;
   5776   def int_x86_avx512_mask_pmov_dw_512 :
   5777           GCCBuiltin<"__builtin_ia32_pmovdw512_mask">,
   5778           Intrinsic<[llvm_v16i16_ty],
   5779                     [llvm_v16i32_ty, llvm_v16i16_ty, llvm_i16_ty],
   5780                     [IntrNoMem]>;
   5781   def int_x86_avx512_mask_pmov_dw_mem_512 :
   5782           GCCBuiltin<"__builtin_ia32_pmovdw512mem_mask">,
   5783           Intrinsic<[],
   5784                     [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
   5785                     [IntrArgMemOnly]>;
   5786   def int_x86_avx512_mask_pmovs_dw_512 :
   5787           GCCBuiltin<"__builtin_ia32_pmovsdw512_mask">,
   5788           Intrinsic<[llvm_v16i16_ty],
   5789                     [llvm_v16i32_ty, llvm_v16i16_ty, llvm_i16_ty],
   5790                     [IntrNoMem]>;
   5791   def int_x86_avx512_mask_pmovs_dw_mem_512 :
   5792           GCCBuiltin<"__builtin_ia32_pmovsdw512mem_mask">,
   5793           Intrinsic<[],
   5794                     [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
   5795                     [IntrArgMemOnly]>;
   5796   def int_x86_avx512_mask_pmovus_dw_512 :
   5797           GCCBuiltin<"__builtin_ia32_pmovusdw512_mask">,
   5798           Intrinsic<[llvm_v16i16_ty],
   5799                     [llvm_v16i32_ty, llvm_v16i16_ty, llvm_i16_ty],
   5800                     [IntrNoMem]>;
   5801   def int_x86_avx512_mask_pmovus_dw_mem_512 :
   5802           GCCBuiltin<"__builtin_ia32_pmovusdw512mem_mask">,
   5803           Intrinsic<[],
   5804                     [llvm_ptr_ty, llvm_v16i32_ty, llvm_i16_ty],
   5805                     [IntrArgMemOnly]>;
   5806   def int_x86_avx512_mask_pmov_wb_128 :
   5807           GCCBuiltin<"__builtin_ia32_pmovwb128_mask">,
   5808           Intrinsic<[llvm_v16i8_ty],
   5809                     [llvm_v8i16_ty, llvm_v16i8_ty, llvm_i8_ty],
   5810                     [IntrNoMem]>;
   5811   def int_x86_avx512_mask_pmov_wb_mem_128 :
   5812           GCCBuiltin<"__builtin_ia32_pmovwb128mem_mask">,
   5813           Intrinsic<[],
   5814                     [llvm_ptr_ty, llvm_v8i16_ty, llvm_i8_ty],
   5815                     [IntrArgMemOnly]>;
   5816   def int_x86_avx512_mask_pmovs_wb_128 :
   5817           GCCBuiltin<"__builtin_ia32_pmovswb128_mask">,
   5818           Intrinsic<[llvm_v16i8_ty],
   5819                     [llvm_v8i16_ty, llvm_v16i8_ty, llvm_i8_ty],
   5820                     [IntrNoMem]>;
   5821   def int_x86_avx512_mask_pmovs_wb_mem_128 :
   5822           GCCBuiltin<"__builtin_ia32_pmovswb128mem_mask">,
   5823           Intrinsic<[],
   5824                     [llvm_ptr_ty, llvm_v8i16_ty, llvm_i8_ty],
   5825                     [IntrArgMemOnly]>;
   5826   def int_x86_avx512_mask_pmovus_wb_128 :
   5827           GCCBuiltin<"__builtin_ia32_pmovuswb128_mask">,
   5828           Intrinsic<[llvm_v16i8_ty],
   5829                     [llvm_v8i16_ty, llvm_v16i8_ty, llvm_i8_ty],
   5830                     [IntrNoMem]>;
   5831   def int_x86_avx512_mask_pmovus_wb_mem_128 :
   5832           GCCBuiltin<"__builtin_ia32_pmovuswb128mem_mask">,
   5833           Intrinsic<[],
   5834                     [llvm_ptr_ty, llvm_v8i16_ty, llvm_i8_ty],
   5835                     [IntrArgMemOnly]>;
   5836   def int_x86_avx512_mask_pmov_wb_256 :
   5837           GCCBuiltin<"__builtin_ia32_pmovwb256_mask">,
   5838           Intrinsic<[llvm_v16i8_ty],
   5839                     [llvm_v16i16_ty, llvm_v16i8_ty, llvm_i16_ty],
   5840                     [IntrNoMem]>;
   5841   def int_x86_avx512_mask_pmov_wb_mem_256 :
   5842           GCCBuiltin<"__builtin_ia32_pmovwb256mem_mask">,
   5843           Intrinsic<[],
   5844                     [llvm_ptr_ty, llvm_v16i16_ty, llvm_i16_ty],
   5845                     [IntrArgMemOnly]>;
   5846   def int_x86_avx512_mask_pmovs_wb_256 :
   5847           GCCBuiltin<"__builtin_ia32_pmovswb256_mask">,
   5848           Intrinsic<[llvm_v16i8_ty],
   5849                     [llvm_v16i16_ty, llvm_v16i8_ty, llvm_i16_ty],
   5850                     [IntrNoMem]>;
   5851   def int_x86_avx512_mask_pmovs_wb_mem_256 :
   5852           GCCBuiltin<"__builtin_ia32_pmovswb256mem_mask">,
   5853           Intrinsic<[],
   5854                     [llvm_ptr_ty, llvm_v16i16_ty, llvm_i16_ty],
   5855                     [IntrArgMemOnly]>;
   5856   def int_x86_avx512_mask_pmovus_wb_256 :
   5857           GCCBuiltin<"__builtin_ia32_pmovuswb256_mask">,
   5858           Intrinsic<[llvm_v16i8_ty],
   5859                     [llvm_v16i16_ty, llvm_v16i8_ty, llvm_i16_ty],
   5860                     [IntrNoMem]>;
   5861   def int_x86_avx512_mask_pmovus_wb_mem_256 :
   5862           GCCBuiltin<"__builtin_ia32_pmovuswb256mem_mask">,
   5863           Intrinsic<[],
   5864                     [llvm_ptr_ty, llvm_v16i16_ty, llvm_i16_ty],
   5865                     [IntrArgMemOnly]>;
   5866   def int_x86_avx512_mask_pmov_wb_512 :
   5867           GCCBuiltin<"__builtin_ia32_pmovwb512_mask">,
   5868           Intrinsic<[llvm_v32i8_ty],
   5869                     [llvm_v32i16_ty, llvm_v32i8_ty, llvm_i32_ty],
   5870                     [IntrNoMem]>;
   5871   def int_x86_avx512_mask_pmov_wb_mem_512 :
   5872           GCCBuiltin<"__builtin_ia32_pmovwb512mem_mask">,
   5873           Intrinsic<[],
   5874                     [llvm_ptr_ty, llvm_v32i16_ty, llvm_i32_ty],
   5875                     [IntrArgMemOnly]>;
   5876   def int_x86_avx512_mask_pmovs_wb_512 :
   5877           GCCBuiltin<"__builtin_ia32_pmovswb512_mask">,
   5878           Intrinsic<[llvm_v32i8_ty],
   5879                     [llvm_v32i16_ty, llvm_v32i8_ty, llvm_i32_ty],
   5880                     [IntrNoMem]>;
   5881   def int_x86_avx512_mask_pmovs_wb_mem_512 :
   5882           GCCBuiltin<"__builtin_ia32_pmovswb512mem_mask">,
   5883           Intrinsic<[],
   5884                     [llvm_ptr_ty, llvm_v32i16_ty, llvm_i32_ty],
   5885                     [IntrArgMemOnly]>;
   5886   def int_x86_avx512_mask_pmovus_wb_512 :
   5887           GCCBuiltin<"__builtin_ia32_pmovuswb512_mask">,
   5888           Intrinsic<[llvm_v32i8_ty],
   5889                     [llvm_v32i16_ty, llvm_v32i8_ty, llvm_i32_ty],
   5890                     [IntrNoMem]>;
   5891   def int_x86_avx512_mask_pmovus_wb_mem_512 :
   5892           GCCBuiltin<"__builtin_ia32_pmovuswb512mem_mask">,
   5893           Intrinsic<[],
   5894                     [llvm_ptr_ty, llvm_v32i16_ty, llvm_i32_ty],
   5895                     [IntrArgMemOnly]>;
   5896 }
   5897 
   5898 // Bitwise ternary logic
   5899 let TargetPrefix = "x86" in {
   5900   def int_x86_avx512_mask_pternlog_d_128 :
   5901           GCCBuiltin<"__builtin_ia32_pternlogd128_mask">,
   5902           Intrinsic<[llvm_v4i32_ty],
   5903                     [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty,
   5904                      llvm_i8_ty], [IntrNoMem]>;
   5905 
   5906   def int_x86_avx512_maskz_pternlog_d_128 :
   5907           GCCBuiltin<"__builtin_ia32_pternlogd128_maskz">,
   5908           Intrinsic<[llvm_v4i32_ty],
   5909                     [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty,
   5910                      llvm_i8_ty], [IntrNoMem]>;
   5911 
   5912   def int_x86_avx512_mask_pternlog_d_256 :
   5913           GCCBuiltin<"__builtin_ia32_pternlogd256_mask">,
   5914           Intrinsic<[llvm_v8i32_ty],
   5915                     [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i32_ty,
   5916                      llvm_i8_ty], [IntrNoMem]>;
   5917 
   5918   def int_x86_avx512_maskz_pternlog_d_256 :
   5919           GCCBuiltin<"__builtin_ia32_pternlogd256_maskz">,
   5920           Intrinsic<[llvm_v8i32_ty],
   5921                     [llvm_v8i32_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i32_ty,
   5922                      llvm_i8_ty], [IntrNoMem]>;
   5923 
   5924   def int_x86_avx512_mask_pternlog_d_512 :
   5925           GCCBuiltin<"__builtin_ia32_pternlogd512_mask">,
   5926           Intrinsic<[llvm_v16i32_ty],
   5927                     [llvm_v16i32_ty, llvm_v16i32_ty, llvm_v16i32_ty, llvm_i32_ty,
   5928                      llvm_i16_ty], [IntrNoMem]>;
   5929 
   5930   def int_x86_avx512_maskz_pternlog_d_512 :
   5931           GCCBuiltin<"__builtin_ia32_pternlogd512_maskz">,
   5932           Intrinsic<[llvm_v16i32_ty],
   5933                     [llvm_v16i32_ty, llvm_v16i32_ty, llvm_v16i32_ty, llvm_i32_ty,
   5934                      llvm_i16_ty], [IntrNoMem]>;
   5935 
   5936   def int_x86_avx512_mask_pternlog_q_128 :
   5937           GCCBuiltin<"__builtin_ia32_pternlogq128_mask">,
   5938           Intrinsic<[llvm_v2i64_ty],
   5939                     [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty,
   5940                      llvm_i8_ty], [IntrNoMem]>;
   5941 
   5942   def int_x86_avx512_maskz_pternlog_q_128 :
   5943           GCCBuiltin<"__builtin_ia32_pternlogq128_maskz">,
   5944           Intrinsic<[llvm_v2i64_ty],
   5945                     [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty,
   5946                      llvm_i8_ty], [IntrNoMem]>;
   5947 
   5948   def int_x86_avx512_mask_pternlog_q_256 :
   5949           GCCBuiltin<"__builtin_ia32_pternlogq256_mask">,
   5950           Intrinsic<[llvm_v4i64_ty],
   5951                     [llvm_v4i64_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i32_ty,
   5952                      llvm_i8_ty], [IntrNoMem]>;
   5953 
   5954   def int_x86_avx512_maskz_pternlog_q_256 :
   5955           GCCBuiltin<"__builtin_ia32_pternlogq256_maskz">,
   5956           Intrinsic<[llvm_v4i64_ty],
   5957                     [llvm_v4i64_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i32_ty,
   5958                      llvm_i8_ty], [IntrNoMem]>;
   5959 
   5960   def int_x86_avx512_mask_pternlog_q_512 :
   5961           GCCBuiltin<"__builtin_ia32_pternlogq512_mask">,
   5962           Intrinsic<[llvm_v8i64_ty],
   5963                     [llvm_v8i64_ty, llvm_v8i64_ty, llvm_v8i64_ty, llvm_i32_ty,
   5964                      llvm_i8_ty], [IntrNoMem]>;
   5965 
   5966   def int_x86_avx512_maskz_pternlog_q_512 :
   5967           GCCBuiltin<"__builtin_ia32_pternlogq512_maskz">,
   5968           Intrinsic<[llvm_v8i64_ty],
   5969                     [llvm_v8i64_ty, llvm_v8i64_ty, llvm_v8i64_ty, llvm_i32_ty,
   5970                      llvm_i8_ty], [IntrNoMem]>;
   5971 }
   5972 
   5973 // Misc.
   5974 let TargetPrefix = "x86" in {
   5975   def int_x86_avx512_mask_cmp_ps_512 :
   5976         GCCBuiltin<"__builtin_ia32_cmpps512_mask">,
   5977               Intrinsic<[llvm_i16_ty], [llvm_v16f32_ty, llvm_v16f32_ty,
   5978                          llvm_i32_ty, llvm_i16_ty, llvm_i32_ty], [IntrNoMem]>;
   5979   def int_x86_avx512_mask_cmp_pd_512 :
   5980         GCCBuiltin<"__builtin_ia32_cmppd512_mask">,
   5981               Intrinsic<[llvm_i8_ty], [llvm_v8f64_ty, llvm_v8f64_ty,
   5982                          llvm_i32_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   5983   def int_x86_avx512_mask_cmp_ps_256 :
   5984         GCCBuiltin<"__builtin_ia32_cmpps256_mask">,
   5985               Intrinsic<[llvm_i8_ty], [llvm_v8f32_ty, llvm_v8f32_ty,
   5986                          llvm_i32_ty, llvm_i8_ty], [IntrNoMem]>;
   5987   def int_x86_avx512_mask_cmp_pd_256 :
   5988         GCCBuiltin<"__builtin_ia32_cmppd256_mask">,
   5989               Intrinsic<[llvm_i8_ty], [llvm_v4f64_ty, llvm_v4f64_ty,
   5990                          llvm_i32_ty, llvm_i8_ty], [IntrNoMem]>;
   5991   def int_x86_avx512_mask_cmp_ps_128 :
   5992         GCCBuiltin<"__builtin_ia32_cmpps128_mask">,
   5993             Intrinsic<[llvm_i8_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   5994                        llvm_i32_ty, llvm_i8_ty], [IntrNoMem]>;
   5995   def int_x86_avx512_mask_cmp_pd_128 :
   5996         GCCBuiltin<"__builtin_ia32_cmppd128_mask">,
   5997             Intrinsic<[llvm_i8_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   5998                        llvm_i32_ty, llvm_i8_ty], [IntrNoMem]>;
   5999   def int_x86_avx512_mask_cmp_ss :
   6000         GCCBuiltin<"__builtin_ia32_cmpss_mask">,
   6001               Intrinsic<[llvm_i8_ty], [llvm_v4f32_ty, llvm_v4f32_ty,
   6002                          llvm_i32_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   6003   def int_x86_avx512_mask_cmp_sd :
   6004         GCCBuiltin<"__builtin_ia32_cmpsd_mask">,
   6005               Intrinsic<[llvm_i8_ty], [llvm_v2f64_ty, llvm_v2f64_ty,
   6006                          llvm_i32_ty, llvm_i8_ty, llvm_i32_ty], [IntrNoMem]>;
   6007 }
   6008 
   6009 //===----------------------------------------------------------------------===//
   6010 // SHA intrinsics
   6011 let TargetPrefix = "x86" in {
   6012   def int_x86_sha1rnds4 : GCCBuiltin<"__builtin_ia32_sha1rnds4">,
   6013         Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty],
   6014                   [IntrNoMem]>;
   6015   def int_x86_sha1nexte : GCCBuiltin<"__builtin_ia32_sha1nexte">,
   6016       Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   6017   def int_x86_sha1msg1 : GCCBuiltin<"__builtin_ia32_sha1msg1">,
   6018       Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   6019   def int_x86_sha1msg2 : GCCBuiltin<"__builtin_ia32_sha1msg2">,
   6020       Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   6021   def int_x86_sha256rnds2 : GCCBuiltin<"__builtin_ia32_sha256rnds2">,
   6022       Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
   6023                 [IntrNoMem]>;
   6024   def int_x86_sha256msg1 : GCCBuiltin<"__builtin_ia32_sha256msg1">,
   6025       Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   6026   def int_x86_sha256msg2 : GCCBuiltin<"__builtin_ia32_sha256msg2">,
   6027       Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   6028 }
   6029 
   6030 //===----------------------------------------------------------------------===//
   6031 // Thread synchronization ops with timer.
   6032 let TargetPrefix = "x86" in {
   6033   def int_x86_monitorx
   6034       : GCCBuiltin<"__builtin_ia32_monitorx">,
   6035         Intrinsic<[], [ llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty ], []>;
   6036   def int_x86_mwaitx
   6037       : GCCBuiltin<"__builtin_ia32_mwaitx">,
   6038         Intrinsic<[], [ llvm_i32_ty, llvm_i32_ty, llvm_i32_ty ], []>;
   6039 }
   6040 
   6041 //===----------------------------------------------------------------------===//
   6042 // Cache-line zero
   6043 let TargetPrefix = "x86" in {
   6044   def int_x86_clzero : GCCBuiltin<"__builtin_ia32_clzero">,
   6045       Intrinsic<[], [llvm_ptr_ty], []>;
   6046 }
   6047