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