Home | History | Annotate | Download | only in IR
      1 //===- IntrinsicsMips.td - Defines Mips 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 MIPS-specific intrinsics.
     11 //
     12 //===----------------------------------------------------------------------===//
     13 
     14 //===----------------------------------------------------------------------===//
     15 // MIPS DSP data types
     16 def mips_v2q15_ty: LLVMType<v2i16>;
     17 def mips_v4q7_ty: LLVMType<v4i8>;
     18 def mips_q31_ty: LLVMType<i32>;
     19 
     20 let TargetPrefix = "mips" in {  // All intrinsics start with "llvm.mips.".
     21 
     22 //===----------------------------------------------------------------------===//
     23 // MIPS DSP Rev 1
     24 
     25 //===----------------------------------------------------------------------===//
     26 // Addition/subtraction
     27 
     28 def int_mips_addu_qb : GCCBuiltin<"__builtin_mips_addu_qb">,
     29   Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty],
     30             [Commutative, IntrNoMem]>;
     31 def int_mips_addu_s_qb : GCCBuiltin<"__builtin_mips_addu_s_qb">,
     32   Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty],
     33             [Commutative, IntrNoMem]>;
     34 def int_mips_subu_qb : GCCBuiltin<"__builtin_mips_subu_qb">,
     35   Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [IntrNoMem]>;
     36 def int_mips_subu_s_qb : GCCBuiltin<"__builtin_mips_subu_s_qb">,
     37   Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [IntrNoMem]>;
     38 
     39 def int_mips_addq_ph : GCCBuiltin<"__builtin_mips_addq_ph">,
     40   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty],
     41             [Commutative, IntrNoMem]>;
     42 def int_mips_addq_s_ph : GCCBuiltin<"__builtin_mips_addq_s_ph">,
     43   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty],
     44             [Commutative, IntrNoMem]>;
     45 def int_mips_subq_ph : GCCBuiltin<"__builtin_mips_subq_ph">,
     46   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty], [IntrNoMem]>;
     47 def int_mips_subq_s_ph : GCCBuiltin<"__builtin_mips_subq_s_ph">,
     48   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty], [IntrNoMem]>;
     49 
     50 def int_mips_madd: GCCBuiltin<"__builtin_mips_madd">,
     51   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty],
     52             [IntrNoMem, Commutative]>;
     53 def int_mips_maddu: GCCBuiltin<"__builtin_mips_maddu">,
     54   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty],
     55             [IntrNoMem, Commutative]>;
     56 
     57 def int_mips_msub: GCCBuiltin<"__builtin_mips_msub">,
     58   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty],
     59             [IntrNoMem]>;
     60 def int_mips_msubu: GCCBuiltin<"__builtin_mips_msubu">,
     61   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty, llvm_i32_ty],
     62             [IntrNoMem]>;
     63 
     64 def int_mips_addq_s_w: GCCBuiltin<"__builtin_mips_addq_s_w">,
     65   Intrinsic<[mips_q31_ty], [mips_q31_ty, mips_q31_ty], [Commutative]>;
     66 def int_mips_subq_s_w: GCCBuiltin<"__builtin_mips_subq_s_w">,
     67   Intrinsic<[mips_q31_ty], [mips_q31_ty, mips_q31_ty], []>;
     68 
     69 def int_mips_addsc: GCCBuiltin<"__builtin_mips_addsc">,
     70   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [Commutative]>;
     71 def int_mips_addwc: GCCBuiltin<"__builtin_mips_addwc">,
     72   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [Commutative]>;
     73 
     74 def int_mips_modsub: GCCBuiltin<"__builtin_mips_modsub">,
     75   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
     76 
     77 def int_mips_raddu_w_qb: GCCBuiltin<"__builtin_mips_raddu_w_qb">,
     78   Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty], [IntrNoMem]>;
     79 
     80 //===----------------------------------------------------------------------===//
     81 // Absolute value
     82 
     83 def int_mips_absq_s_ph: GCCBuiltin<"__builtin_mips_absq_s_ph">,
     84   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty], []>;
     85 def int_mips_absq_s_w: GCCBuiltin<"__builtin_mips_absq_s_w">,
     86   Intrinsic<[mips_q31_ty], [mips_q31_ty], []>;
     87 
     88 //===----------------------------------------------------------------------===//
     89 // Precision reduce/expand
     90 
     91 def int_mips_precrq_qb_ph: GCCBuiltin<"__builtin_mips_precrq_qb_ph">,
     92   Intrinsic<[llvm_v4i8_ty], [mips_v2q15_ty, mips_v2q15_ty], [IntrNoMem]>;
     93 def int_mips_precrqu_s_qb_ph: GCCBuiltin<"__builtin_mips_precrqu_s_qb_ph">,
     94   Intrinsic<[llvm_v4i8_ty], [mips_v2q15_ty, mips_v2q15_ty], []>;
     95 def int_mips_precrq_ph_w: GCCBuiltin<"__builtin_mips_precrq_ph_w">,
     96   Intrinsic<[mips_v2q15_ty], [mips_q31_ty, mips_q31_ty], [IntrNoMem]>;
     97 def int_mips_precrq_rs_ph_w: GCCBuiltin<"__builtin_mips_precrq_rs_ph_w">,
     98   Intrinsic<[mips_v2q15_ty], [mips_q31_ty, mips_q31_ty], []>;
     99 def int_mips_preceq_w_phl: GCCBuiltin<"__builtin_mips_preceq_w_phl">,
    100   Intrinsic<[mips_q31_ty], [mips_v2q15_ty], [IntrNoMem]>;
    101 def int_mips_preceq_w_phr: GCCBuiltin<"__builtin_mips_preceq_w_phr">,
    102   Intrinsic<[mips_q31_ty], [mips_v2q15_ty], [IntrNoMem]>;
    103 def int_mips_precequ_ph_qbl: GCCBuiltin<"__builtin_mips_precequ_ph_qbl">,
    104   Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty], [IntrNoMem]>;
    105 def int_mips_precequ_ph_qbr: GCCBuiltin<"__builtin_mips_precequ_ph_qbr">,
    106   Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty], [IntrNoMem]>;
    107 def int_mips_precequ_ph_qbla: GCCBuiltin<"__builtin_mips_precequ_ph_qbla">,
    108   Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty], [IntrNoMem]>;
    109 def int_mips_precequ_ph_qbra: GCCBuiltin<"__builtin_mips_precequ_ph_qbra">,
    110   Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty], [IntrNoMem]>;
    111 def int_mips_preceu_ph_qbl: GCCBuiltin<"__builtin_mips_preceu_ph_qbl">,
    112   Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty], [IntrNoMem]>;
    113 def int_mips_preceu_ph_qbr: GCCBuiltin<"__builtin_mips_preceu_ph_qbr">,
    114   Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty], [IntrNoMem]>;
    115 def int_mips_preceu_ph_qbla: GCCBuiltin<"__builtin_mips_preceu_ph_qbla">,
    116   Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty], [IntrNoMem]>;
    117 def int_mips_preceu_ph_qbra: GCCBuiltin<"__builtin_mips_preceu_ph_qbra">,
    118   Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty], [IntrNoMem]>;
    119 
    120 //===----------------------------------------------------------------------===//
    121 // Shift
    122 
    123 def int_mips_shll_qb: GCCBuiltin<"__builtin_mips_shll_qb">,
    124   Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_i32_ty], []>;
    125 def int_mips_shrl_qb: GCCBuiltin<"__builtin_mips_shrl_qb">,
    126   Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_i32_ty], [IntrNoMem]>;
    127 def int_mips_shll_ph: GCCBuiltin<"__builtin_mips_shll_ph">,
    128   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, llvm_i32_ty], []>;
    129 def int_mips_shll_s_ph: GCCBuiltin<"__builtin_mips_shll_s_ph">,
    130   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, llvm_i32_ty], []>;
    131 def int_mips_shra_ph: GCCBuiltin<"__builtin_mips_shra_ph">,
    132   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, llvm_i32_ty], [IntrNoMem]>;
    133 def int_mips_shra_r_ph: GCCBuiltin<"__builtin_mips_shra_r_ph">,
    134   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, llvm_i32_ty], [IntrNoMem]>;
    135 def int_mips_shll_s_w: GCCBuiltin<"__builtin_mips_shll_s_w">,
    136   Intrinsic<[mips_q31_ty], [mips_q31_ty, llvm_i32_ty], []>;
    137 def int_mips_shra_r_w: GCCBuiltin<"__builtin_mips_shra_r_w">,
    138   Intrinsic<[mips_q31_ty], [mips_q31_ty, llvm_i32_ty], [IntrNoMem]>;
    139 def int_mips_shilo: GCCBuiltin<"__builtin_mips_shilo">,
    140   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty], [IntrNoMem]>;
    141 
    142 //===----------------------------------------------------------------------===//
    143 // Multiplication
    144 
    145 def int_mips_muleu_s_ph_qbl: GCCBuiltin<"__builtin_mips_muleu_s_ph_qbl">,
    146   Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty, mips_v2q15_ty], []>;
    147 def int_mips_muleu_s_ph_qbr: GCCBuiltin<"__builtin_mips_muleu_s_ph_qbr">,
    148   Intrinsic<[mips_v2q15_ty], [llvm_v4i8_ty, mips_v2q15_ty], []>;
    149 def int_mips_mulq_rs_ph: GCCBuiltin<"__builtin_mips_mulq_rs_ph">,
    150   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty], [Commutative]>;
    151 def int_mips_muleq_s_w_phl: GCCBuiltin<"__builtin_mips_muleq_s_w_phl">,
    152   Intrinsic<[mips_q31_ty], [mips_v2q15_ty, mips_v2q15_ty], [Commutative]>;
    153 def int_mips_muleq_s_w_phr: GCCBuiltin<"__builtin_mips_muleq_s_w_phr">,
    154   Intrinsic<[mips_q31_ty], [mips_v2q15_ty, mips_v2q15_ty], [Commutative]>;
    155 def int_mips_mulsaq_s_w_ph: GCCBuiltin<"__builtin_mips_mulsaq_s_w_ph">,
    156   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
    157 def int_mips_maq_s_w_phl: GCCBuiltin<"__builtin_mips_maq_s_w_phl">,
    158   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
    159 def int_mips_maq_s_w_phr: GCCBuiltin<"__builtin_mips_maq_s_w_phr">,
    160   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
    161 def int_mips_maq_sa_w_phl: GCCBuiltin<"__builtin_mips_maq_sa_w_phl">,
    162   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
    163 def int_mips_maq_sa_w_phr: GCCBuiltin<"__builtin_mips_maq_sa_w_phr">,
    164   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
    165 def int_mips_mult: GCCBuiltin<"__builtin_mips_mult">,
    166   Intrinsic<[llvm_i64_ty], [llvm_i32_ty, llvm_i32_ty],
    167             [IntrNoMem, Commutative]>;
    168 def int_mips_multu: GCCBuiltin<"__builtin_mips_multu">,
    169   Intrinsic<[llvm_i64_ty], [llvm_i32_ty, llvm_i32_ty],
    170             [IntrNoMem, Commutative]>;
    171 
    172 //===----------------------------------------------------------------------===//
    173 // Dot product with accumulate/subtract
    174 
    175 def int_mips_dpau_h_qbl: GCCBuiltin<"__builtin_mips_dpau_h_qbl">,
    176   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v4i8_ty, llvm_v4i8_ty],
    177             [IntrNoMem]>;
    178 def int_mips_dpau_h_qbr: GCCBuiltin<"__builtin_mips_dpau_h_qbr">,
    179   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v4i8_ty, llvm_v4i8_ty],
    180             [IntrNoMem]>;
    181 def int_mips_dpsu_h_qbl: GCCBuiltin<"__builtin_mips_dpsu_h_qbl">,
    182   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v4i8_ty, llvm_v4i8_ty],
    183             [IntrNoMem]>;
    184 def int_mips_dpsu_h_qbr: GCCBuiltin<"__builtin_mips_dpsu_h_qbr">,
    185   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v4i8_ty, llvm_v4i8_ty],
    186             [IntrNoMem]>;
    187 def int_mips_dpaq_s_w_ph: GCCBuiltin<"__builtin_mips_dpaq_s_w_ph">,
    188   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
    189 def int_mips_dpsq_s_w_ph: GCCBuiltin<"__builtin_mips_dpsq_s_w_ph">,
    190   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
    191 def int_mips_dpaq_sa_l_w: GCCBuiltin<"__builtin_mips_dpaq_sa_l_w">,
    192   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_q31_ty, mips_q31_ty], []>;
    193 def int_mips_dpsq_sa_l_w: GCCBuiltin<"__builtin_mips_dpsq_sa_l_w">,
    194   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_q31_ty, mips_q31_ty], []>;
    195 
    196 //===----------------------------------------------------------------------===//
    197 // Comparison
    198 
    199 def int_mips_cmpu_eq_qb: GCCBuiltin<"__builtin_mips_cmpu_eq_qb">,
    200   Intrinsic<[], [llvm_v4i8_ty, llvm_v4i8_ty], [Commutative]>;
    201 def int_mips_cmpu_lt_qb: GCCBuiltin<"__builtin_mips_cmpu_lt_qb">,
    202   Intrinsic<[], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
    203 def int_mips_cmpu_le_qb: GCCBuiltin<"__builtin_mips_cmpu_le_qb">,
    204   Intrinsic<[], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
    205 def int_mips_cmpgu_eq_qb: GCCBuiltin<"__builtin_mips_cmpgu_eq_qb">,
    206   Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [Commutative]>;
    207 def int_mips_cmpgu_lt_qb: GCCBuiltin<"__builtin_mips_cmpgu_lt_qb">,
    208   Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
    209 def int_mips_cmpgu_le_qb: GCCBuiltin<"__builtin_mips_cmpgu_le_qb">,
    210   Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
    211 def int_mips_cmp_eq_ph: GCCBuiltin<"__builtin_mips_cmp_eq_ph">,
    212   Intrinsic<[], [mips_v2q15_ty, mips_v2q15_ty], [Commutative]>;
    213 def int_mips_cmp_lt_ph: GCCBuiltin<"__builtin_mips_cmp_lt_ph">,
    214   Intrinsic<[], [mips_v2q15_ty, mips_v2q15_ty], []>;
    215 def int_mips_cmp_le_ph: GCCBuiltin<"__builtin_mips_cmp_le_ph">,
    216   Intrinsic<[], [mips_v2q15_ty, mips_v2q15_ty], []>;
    217 
    218 //===----------------------------------------------------------------------===//
    219 // Extracting
    220 
    221 def int_mips_extr_s_h: GCCBuiltin<"__builtin_mips_extr_s_h">,
    222   Intrinsic<[llvm_i32_ty], [llvm_i64_ty, llvm_i32_ty], []>;
    223 def int_mips_extr_w: GCCBuiltin<"__builtin_mips_extr_w">,
    224   Intrinsic<[llvm_i32_ty], [llvm_i64_ty, llvm_i32_ty], []>;
    225 def int_mips_extr_rs_w: GCCBuiltin<"__builtin_mips_extr_rs_w">,
    226   Intrinsic<[llvm_i32_ty], [llvm_i64_ty, llvm_i32_ty], []>;
    227 def int_mips_extr_r_w: GCCBuiltin<"__builtin_mips_extr_r_w">,
    228   Intrinsic<[llvm_i32_ty], [llvm_i64_ty, llvm_i32_ty], []>;
    229 def int_mips_extp: GCCBuiltin<"__builtin_mips_extp">,
    230   Intrinsic<[llvm_i32_ty], [llvm_i64_ty, llvm_i32_ty], []>;
    231 def int_mips_extpdp: GCCBuiltin<"__builtin_mips_extpdp">,
    232   Intrinsic<[llvm_i32_ty], [llvm_i64_ty, llvm_i32_ty], []>;
    233 
    234 //===----------------------------------------------------------------------===//
    235 // Misc
    236 
    237 def int_mips_wrdsp: GCCBuiltin<"__builtin_mips_wrdsp">,
    238   Intrinsic<[], [llvm_i32_ty, llvm_i32_ty], []>;
    239 def int_mips_rddsp: GCCBuiltin<"__builtin_mips_rddsp">,
    240   Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrReadMem]>;
    241 
    242 def int_mips_insv: GCCBuiltin<"__builtin_mips_insv">,
    243   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrReadMem]>;
    244 def int_mips_bitrev: GCCBuiltin<"__builtin_mips_bitrev">,
    245   Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrNoMem]>;
    246 
    247 def int_mips_packrl_ph: GCCBuiltin<"__builtin_mips_packrl_ph">,
    248   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty], [IntrNoMem]>;
    249 
    250 def int_mips_repl_qb: GCCBuiltin<"__builtin_mips_repl_qb">,
    251   Intrinsic<[llvm_v4i8_ty], [llvm_i32_ty], [IntrNoMem]>;
    252 def int_mips_repl_ph: GCCBuiltin<"__builtin_mips_repl_ph">,
    253   Intrinsic<[mips_v2q15_ty], [llvm_i32_ty], [IntrNoMem]>;
    254 
    255 def int_mips_pick_qb: GCCBuiltin<"__builtin_mips_pick_qb">,
    256   Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [IntrReadMem]>;
    257 def int_mips_pick_ph: GCCBuiltin<"__builtin_mips_pick_ph">,
    258   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty], [IntrReadMem]>;
    259 
    260 def int_mips_mthlip: GCCBuiltin<"__builtin_mips_mthlip">,
    261   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i32_ty], []>;
    262 
    263 def int_mips_bposge32: GCCBuiltin<"__builtin_mips_bposge32">,
    264   Intrinsic<[llvm_i32_ty], [], [IntrReadMem]>;
    265 
    266 def int_mips_lbux: GCCBuiltin<"__builtin_mips_lbux">,
    267   Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty], [IntrReadMem, IntrArgMemOnly]>;
    268 def int_mips_lhx: GCCBuiltin<"__builtin_mips_lhx">,
    269   Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty], [IntrReadMem, IntrArgMemOnly]>;
    270 def int_mips_lwx: GCCBuiltin<"__builtin_mips_lwx">,
    271   Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty], [IntrReadMem, IntrArgMemOnly]>;
    272 
    273 //===----------------------------------------------------------------------===//
    274 // MIPS DSP Rev 2
    275 
    276 def int_mips_absq_s_qb: GCCBuiltin<"__builtin_mips_absq_s_qb">,
    277   Intrinsic<[mips_v4q7_ty], [mips_v4q7_ty], []>;
    278 
    279 def int_mips_addqh_ph: GCCBuiltin<"__builtin_mips_addqh_ph">,
    280   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty],
    281             [IntrNoMem, Commutative]>;
    282 def int_mips_addqh_r_ph: GCCBuiltin<"__builtin_mips_addqh_r_ph">,
    283   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty],
    284             [IntrNoMem, Commutative]>;
    285 def int_mips_addqh_w: GCCBuiltin<"__builtin_mips_addqh_w">,
    286   Intrinsic<[mips_q31_ty], [mips_q31_ty, mips_q31_ty],
    287             [IntrNoMem, Commutative]>;
    288 def int_mips_addqh_r_w: GCCBuiltin<"__builtin_mips_addqh_r_w">,
    289   Intrinsic<[mips_q31_ty], [mips_q31_ty, mips_q31_ty],
    290             [IntrNoMem, Commutative]>;
    291 
    292 def int_mips_addu_ph: GCCBuiltin<"__builtin_mips_addu_ph">,
    293   Intrinsic<[llvm_v2i16_ty], [llvm_v2i16_ty, llvm_v2i16_ty], [Commutative]>;
    294 def int_mips_addu_s_ph: GCCBuiltin<"__builtin_mips_addu_s_ph">,
    295   Intrinsic<[llvm_v2i16_ty], [llvm_v2i16_ty, llvm_v2i16_ty], [Commutative]>;
    296 
    297 def int_mips_adduh_qb: GCCBuiltin<"__builtin_mips_adduh_qb">,
    298   Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty],
    299             [IntrNoMem, Commutative]>;
    300 def int_mips_adduh_r_qb: GCCBuiltin<"__builtin_mips_adduh_r_qb">,
    301   Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty],
    302             [IntrNoMem, Commutative]>;
    303 
    304 def int_mips_append: GCCBuiltin<"__builtin_mips_append">,
    305   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
    306   [IntrNoMem]>;
    307 def int_mips_balign: GCCBuiltin<"__builtin_mips_balign">,
    308   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
    309   [IntrNoMem]>;
    310 
    311 def int_mips_cmpgdu_eq_qb: GCCBuiltin<"__builtin_mips_cmpgdu_eq_qb">,
    312   Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [Commutative]>;
    313 def int_mips_cmpgdu_lt_qb: GCCBuiltin<"__builtin_mips_cmpgdu_lt_qb">,
    314   Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
    315 def int_mips_cmpgdu_le_qb: GCCBuiltin<"__builtin_mips_cmpgdu_le_qb">,
    316   Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
    317 
    318 def int_mips_dpa_w_ph: GCCBuiltin<"__builtin_mips_dpa_w_ph">,
    319   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v2i16_ty, llvm_v2i16_ty],
    320             [IntrNoMem]>;
    321 def int_mips_dps_w_ph: GCCBuiltin<"__builtin_mips_dps_w_ph">,
    322   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v2i16_ty, llvm_v2i16_ty],
    323             [IntrNoMem]>;
    324 
    325 def int_mips_dpaqx_s_w_ph: GCCBuiltin<"__builtin_mips_dpaqx_s_w_ph">,
    326   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
    327 def int_mips_dpaqx_sa_w_ph: GCCBuiltin<"__builtin_mips_dpaqx_sa_w_ph">,
    328   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
    329 def int_mips_dpax_w_ph: GCCBuiltin<"__builtin_mips_dpax_w_ph">,
    330   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v2i16_ty, llvm_v2i16_ty],
    331             [IntrNoMem]>;
    332 def int_mips_dpsx_w_ph: GCCBuiltin<"__builtin_mips_dpsx_w_ph">,
    333   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v2i16_ty, llvm_v2i16_ty],
    334             [IntrNoMem]>;
    335 def int_mips_dpsqx_s_w_ph: GCCBuiltin<"__builtin_mips_dpsqx_s_w_ph">,
    336   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
    337 def int_mips_dpsqx_sa_w_ph: GCCBuiltin<"__builtin_mips_dpsqx_sa_w_ph">,
    338   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, mips_v2q15_ty, mips_v2q15_ty], []>;
    339 
    340 def int_mips_mul_ph: GCCBuiltin<"__builtin_mips_mul_ph">,
    341   Intrinsic<[llvm_v2i16_ty], [llvm_v2i16_ty, llvm_v2i16_ty], [Commutative]>;
    342 def int_mips_mul_s_ph: GCCBuiltin<"__builtin_mips_mul_s_ph">,
    343   Intrinsic<[llvm_v2i16_ty], [llvm_v2i16_ty, llvm_v2i16_ty], [Commutative]>;
    344 
    345 def int_mips_mulq_rs_w: GCCBuiltin<"__builtin_mips_mulq_rs_w">,
    346   Intrinsic<[mips_q31_ty], [mips_q31_ty, mips_q31_ty], [Commutative]>;
    347 def int_mips_mulq_s_ph: GCCBuiltin<"__builtin_mips_mulq_s_ph">,
    348   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty], [Commutative]>;
    349 def int_mips_mulq_s_w: GCCBuiltin<"__builtin_mips_mulq_s_w">,
    350   Intrinsic<[mips_q31_ty], [mips_q31_ty, mips_q31_ty], [Commutative]>;
    351 def int_mips_mulsa_w_ph: GCCBuiltin<"__builtin_mips_mulsa_w_ph">,
    352   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v2i16_ty, llvm_v2i16_ty],
    353             [IntrNoMem]>;
    354 
    355 def int_mips_precr_qb_ph: GCCBuiltin<"__builtin_mips_precr_qb_ph">,
    356   Intrinsic<[llvm_v4i8_ty], [llvm_v2i16_ty, llvm_v2i16_ty], []>;
    357 def int_mips_precr_sra_ph_w: GCCBuiltin<"__builtin_mips_precr_sra_ph_w">,
    358   Intrinsic<[llvm_v2i16_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
    359             [IntrNoMem]>;
    360 def int_mips_precr_sra_r_ph_w: GCCBuiltin<"__builtin_mips_precr_sra_r_ph_w">,
    361   Intrinsic<[llvm_v2i16_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
    362             [IntrNoMem]>;
    363 
    364 def int_mips_prepend: GCCBuiltin<"__builtin_mips_prepend">,
    365   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
    366   [IntrNoMem]>;
    367 
    368 def int_mips_shra_qb: GCCBuiltin<"__builtin_mips_shra_qb">,
    369   Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_i32_ty], [IntrNoMem]>;
    370 def int_mips_shra_r_qb: GCCBuiltin<"__builtin_mips_shra_r_qb">,
    371   Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_i32_ty], [IntrNoMem]>;
    372 def int_mips_shrl_ph: GCCBuiltin<"__builtin_mips_shrl_ph">,
    373   Intrinsic<[llvm_v2i16_ty], [llvm_v2i16_ty, llvm_i32_ty], [IntrNoMem]>;
    374 
    375 def int_mips_subqh_ph: GCCBuiltin<"__builtin_mips_subqh_ph">,
    376   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty], [IntrNoMem]>;
    377 def int_mips_subqh_r_ph: GCCBuiltin<"__builtin_mips_subqh_r_ph">,
    378   Intrinsic<[mips_v2q15_ty], [mips_v2q15_ty, mips_v2q15_ty], [IntrNoMem]>;
    379 def int_mips_subqh_w: GCCBuiltin<"__builtin_mips_subqh_w">,
    380   Intrinsic<[mips_q31_ty], [mips_q31_ty, mips_q31_ty], [IntrNoMem]>;
    381 def int_mips_subqh_r_w: GCCBuiltin<"__builtin_mips_subqh_r_w">,
    382   Intrinsic<[mips_q31_ty], [mips_q31_ty, mips_q31_ty], [IntrNoMem]>;
    383 
    384 def int_mips_subu_ph: GCCBuiltin<"__builtin_mips_subu_ph">,
    385   Intrinsic<[llvm_v2i16_ty], [llvm_v2i16_ty, llvm_v2i16_ty], []>;
    386 def int_mips_subu_s_ph: GCCBuiltin<"__builtin_mips_subu_s_ph">,
    387   Intrinsic<[llvm_v2i16_ty], [llvm_v2i16_ty, llvm_v2i16_ty], []>;
    388 
    389 def int_mips_subuh_qb: GCCBuiltin<"__builtin_mips_subuh_qb">,
    390   Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [IntrNoMem]>;
    391 def int_mips_subuh_r_qb: GCCBuiltin<"__builtin_mips_subuh_r_qb">,
    392   Intrinsic<[llvm_v4i8_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [IntrNoMem]>;
    393 
    394 //===----------------------------------------------------------------------===//
    395 // MIPS MSA
    396 
    397 //===----------------------------------------------------------------------===//
    398 // Addition/subtraction
    399 
    400 def int_mips_add_a_b : GCCBuiltin<"__builtin_msa_add_a_b">,
    401   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
    402   [Commutative, IntrNoMem]>;
    403 def int_mips_add_a_h : GCCBuiltin<"__builtin_msa_add_a_h">,
    404   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
    405   [Commutative, IntrNoMem]>;
    406 def int_mips_add_a_w : GCCBuiltin<"__builtin_msa_add_a_w">,
    407   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    408   [Commutative, IntrNoMem]>;
    409 def int_mips_add_a_d : GCCBuiltin<"__builtin_msa_add_a_d">,
    410   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    411   [Commutative, IntrNoMem]>;
    412 
    413 def int_mips_adds_a_b : GCCBuiltin<"__builtin_msa_adds_a_b">,
    414   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
    415   [Commutative, IntrNoMem]>;
    416 def int_mips_adds_a_h : GCCBuiltin<"__builtin_msa_adds_a_h">,
    417   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
    418   [Commutative, IntrNoMem]>;
    419 def int_mips_adds_a_w : GCCBuiltin<"__builtin_msa_adds_a_w">,
    420   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    421   [Commutative, IntrNoMem]>;
    422 def int_mips_adds_a_d : GCCBuiltin<"__builtin_msa_adds_a_d">,
    423   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    424   [Commutative, IntrNoMem]>;
    425 
    426 def int_mips_adds_s_b : GCCBuiltin<"__builtin_msa_adds_s_b">,
    427   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
    428   [Commutative, IntrNoMem]>;
    429 def int_mips_adds_s_h : GCCBuiltin<"__builtin_msa_adds_s_h">,
    430   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
    431   [Commutative, IntrNoMem]>;
    432 def int_mips_adds_s_w : GCCBuiltin<"__builtin_msa_adds_s_w">,
    433   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    434   [Commutative, IntrNoMem]>;
    435 def int_mips_adds_s_d : GCCBuiltin<"__builtin_msa_adds_s_d">,
    436   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    437   [Commutative, IntrNoMem]>;
    438 
    439 def int_mips_adds_u_b : GCCBuiltin<"__builtin_msa_adds_u_b">,
    440   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
    441   [Commutative, IntrNoMem]>;
    442 def int_mips_adds_u_h : GCCBuiltin<"__builtin_msa_adds_u_h">,
    443   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
    444   [Commutative, IntrNoMem]>;
    445 def int_mips_adds_u_w : GCCBuiltin<"__builtin_msa_adds_u_w">,
    446   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    447   [Commutative, IntrNoMem]>;
    448 def int_mips_adds_u_d : GCCBuiltin<"__builtin_msa_adds_u_d">,
    449   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    450   [Commutative, IntrNoMem]>;
    451 
    452 def int_mips_addv_b : GCCBuiltin<"__builtin_msa_addv_b">,
    453   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
    454   [Commutative, IntrNoMem]>;
    455 def int_mips_addv_h : GCCBuiltin<"__builtin_msa_addv_h">,
    456   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
    457   [Commutative, IntrNoMem]>;
    458 def int_mips_addv_w : GCCBuiltin<"__builtin_msa_addv_w">,
    459   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    460   [Commutative, IntrNoMem]>;
    461 def int_mips_addv_d : GCCBuiltin<"__builtin_msa_addv_d">,
    462   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    463   [Commutative, IntrNoMem]>;
    464 
    465 def int_mips_addvi_b : GCCBuiltin<"__builtin_msa_addvi_b">,
    466   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty],
    467   [Commutative, IntrNoMem]>;
    468 def int_mips_addvi_h : GCCBuiltin<"__builtin_msa_addvi_h">,
    469   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty],
    470   [Commutative, IntrNoMem]>;
    471 def int_mips_addvi_w : GCCBuiltin<"__builtin_msa_addvi_w">,
    472   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty],
    473   [Commutative, IntrNoMem]>;
    474 def int_mips_addvi_d : GCCBuiltin<"__builtin_msa_addvi_d">,
    475   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty],
    476   [Commutative, IntrNoMem]>;
    477 
    478 def int_mips_and_v : GCCBuiltin<"__builtin_msa_and_v">,
    479   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
    480 
    481 def int_mips_andi_b : GCCBuiltin<"__builtin_msa_andi_b">,
    482   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
    483 
    484 def int_mips_asub_s_b : GCCBuiltin<"__builtin_msa_asub_s_b">,
    485   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
    486 def int_mips_asub_s_h : GCCBuiltin<"__builtin_msa_asub_s_h">,
    487   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
    488 def int_mips_asub_s_w : GCCBuiltin<"__builtin_msa_asub_s_w">,
    489   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
    490 def int_mips_asub_s_d : GCCBuiltin<"__builtin_msa_asub_s_d">,
    491   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
    492 
    493 def int_mips_asub_u_b : GCCBuiltin<"__builtin_msa_asub_u_b">,
    494   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
    495 def int_mips_asub_u_h : GCCBuiltin<"__builtin_msa_asub_u_h">,
    496   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
    497 def int_mips_asub_u_w : GCCBuiltin<"__builtin_msa_asub_u_w">,
    498   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
    499 def int_mips_asub_u_d : GCCBuiltin<"__builtin_msa_asub_u_d">,
    500   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
    501 
    502 def int_mips_ave_s_b : GCCBuiltin<"__builtin_msa_ave_s_b">,
    503   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
    504   [Commutative, IntrNoMem]>;
    505 def int_mips_ave_s_h : GCCBuiltin<"__builtin_msa_ave_s_h">,
    506   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
    507   [Commutative, IntrNoMem]>;
    508 def int_mips_ave_s_w : GCCBuiltin<"__builtin_msa_ave_s_w">,
    509   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    510   [Commutative, IntrNoMem]>;
    511 def int_mips_ave_s_d : GCCBuiltin<"__builtin_msa_ave_s_d">,
    512   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    513   [Commutative, IntrNoMem]>;
    514 
    515 def int_mips_ave_u_b : GCCBuiltin<"__builtin_msa_ave_u_b">,
    516   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
    517   [Commutative, IntrNoMem]>;
    518 def int_mips_ave_u_h : GCCBuiltin<"__builtin_msa_ave_u_h">,
    519   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
    520   [Commutative, IntrNoMem]>;
    521 def int_mips_ave_u_w : GCCBuiltin<"__builtin_msa_ave_u_w">,
    522   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    523   [Commutative, IntrNoMem]>;
    524 def int_mips_ave_u_d : GCCBuiltin<"__builtin_msa_ave_u_d">,
    525   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    526   [Commutative, IntrNoMem]>;
    527 
    528 def int_mips_aver_s_b : GCCBuiltin<"__builtin_msa_aver_s_b">,
    529   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
    530   [Commutative, IntrNoMem]>;
    531 def int_mips_aver_s_h : GCCBuiltin<"__builtin_msa_aver_s_h">,
    532   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
    533   [Commutative, IntrNoMem]>;
    534 def int_mips_aver_s_w : GCCBuiltin<"__builtin_msa_aver_s_w">,
    535   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    536   [Commutative, IntrNoMem]>;
    537 def int_mips_aver_s_d : GCCBuiltin<"__builtin_msa_aver_s_d">,
    538   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    539   [Commutative, IntrNoMem]>;
    540 
    541 def int_mips_aver_u_b : GCCBuiltin<"__builtin_msa_aver_u_b">,
    542   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty],
    543   [Commutative, IntrNoMem]>;
    544 def int_mips_aver_u_h : GCCBuiltin<"__builtin_msa_aver_u_h">,
    545   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty],
    546   [Commutative, IntrNoMem]>;
    547 def int_mips_aver_u_w : GCCBuiltin<"__builtin_msa_aver_u_w">,
    548   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty],
    549   [Commutative, IntrNoMem]>;
    550 def int_mips_aver_u_d : GCCBuiltin<"__builtin_msa_aver_u_d">,
    551   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
    552   [Commutative, IntrNoMem]>;
    553 
    554 def int_mips_bclr_b : GCCBuiltin<"__builtin_msa_bclr_b">,
    555   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
    556 def int_mips_bclr_h : GCCBuiltin<"__builtin_msa_bclr_h">,
    557   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
    558 def int_mips_bclr_w : GCCBuiltin<"__builtin_msa_bclr_w">,
    559   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
    560 def int_mips_bclr_d : GCCBuiltin<"__builtin_msa_bclr_d">,
    561   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
    562 
    563 def int_mips_bclri_b : GCCBuiltin<"__builtin_msa_bclri_b">,
    564   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
    565 def int_mips_bclri_h : GCCBuiltin<"__builtin_msa_bclri_h">,
    566   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
    567 def int_mips_bclri_w : GCCBuiltin<"__builtin_msa_bclri_w">,
    568   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
    569 def int_mips_bclri_d : GCCBuiltin<"__builtin_msa_bclri_d">,
    570   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
    571 
    572 def int_mips_binsl_b : GCCBuiltin<"__builtin_msa_binsl_b">,
    573   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
    574             [IntrNoMem]>;
    575 def int_mips_binsl_h : GCCBuiltin<"__builtin_msa_binsl_h">,
    576   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
    577             [IntrNoMem]>;
    578 def int_mips_binsl_w : GCCBuiltin<"__builtin_msa_binsl_w">,
    579   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
    580             [IntrNoMem]>;
    581 def int_mips_binsl_d : GCCBuiltin<"__builtin_msa_binsl_d">,
    582   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
    583             [IntrNoMem]>;
    584 
    585 def int_mips_binsli_b : GCCBuiltin<"__builtin_msa_binsli_b">,
    586   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
    587             [IntrNoMem]>;
    588 def int_mips_binsli_h : GCCBuiltin<"__builtin_msa_binsli_h">,
    589   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_i32_ty],
    590             [IntrNoMem]>;
    591 def int_mips_binsli_w : GCCBuiltin<"__builtin_msa_binsli_w">,
    592   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty],
    593             [IntrNoMem]>;
    594 def int_mips_binsli_d : GCCBuiltin<"__builtin_msa_binsli_d">,
    595   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
    596             [IntrNoMem]>;
    597 
    598 def int_mips_binsr_b : GCCBuiltin<"__builtin_msa_binsr_b">,
    599   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
    600             [IntrNoMem]>;
    601 def int_mips_binsr_h : GCCBuiltin<"__builtin_msa_binsr_h">,
    602   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
    603             [IntrNoMem]>;
    604 def int_mips_binsr_w : GCCBuiltin<"__builtin_msa_binsr_w">,
    605   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
    606             [IntrNoMem]>;
    607 def int_mips_binsr_d : GCCBuiltin<"__builtin_msa_binsr_d">,
    608   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
    609             [IntrNoMem]>;
    610 
    611 def int_mips_binsri_b : GCCBuiltin<"__builtin_msa_binsri_b">,
    612   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
    613             [IntrNoMem]>;
    614 def int_mips_binsri_h : GCCBuiltin<"__builtin_msa_binsri_h">,
    615   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_i32_ty],
    616             [IntrNoMem]>;
    617 def int_mips_binsri_w : GCCBuiltin<"__builtin_msa_binsri_w">,
    618   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty],
    619             [IntrNoMem]>;
    620 def int_mips_binsri_d : GCCBuiltin<"__builtin_msa_binsri_d">,
    621   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
    622             [IntrNoMem]>;
    623 
    624 def int_mips_bmnz_v : GCCBuiltin<"__builtin_msa_bmnz_v">,
    625   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
    626             [IntrNoMem]>;
    627 
    628 def int_mips_bmnzi_b : GCCBuiltin<"__builtin_msa_bmnzi_b">,
    629   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
    630             [IntrNoMem]>;
    631 
    632 def int_mips_bmz_v : GCCBuiltin<"__builtin_msa_bmz_v">,
    633   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
    634             [IntrNoMem]>;
    635 
    636 def int_mips_bmzi_b : GCCBuiltin<"__builtin_msa_bmzi_b">,
    637   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
    638             [IntrNoMem]>;
    639 
    640 def int_mips_bneg_b : GCCBuiltin<"__builtin_msa_bneg_b">,
    641   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
    642 def int_mips_bneg_h : GCCBuiltin<"__builtin_msa_bneg_h">,
    643   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
    644 def int_mips_bneg_w : GCCBuiltin<"__builtin_msa_bneg_w">,
    645   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
    646 def int_mips_bneg_d : GCCBuiltin<"__builtin_msa_bneg_d">,
    647   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
    648 
    649 def int_mips_bnegi_b : GCCBuiltin<"__builtin_msa_bnegi_b">,
    650   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
    651 def int_mips_bnegi_h : GCCBuiltin<"__builtin_msa_bnegi_h">,
    652   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
    653 def int_mips_bnegi_w : GCCBuiltin<"__builtin_msa_bnegi_w">,
    654   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
    655 def int_mips_bnegi_d : GCCBuiltin<"__builtin_msa_bnegi_d">,
    656   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
    657 
    658 def int_mips_bnz_b : GCCBuiltin<"__builtin_msa_bnz_b">,
    659   Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
    660 def int_mips_bnz_h : GCCBuiltin<"__builtin_msa_bnz_h">,
    661   Intrinsic<[llvm_i32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
    662 def int_mips_bnz_w : GCCBuiltin<"__builtin_msa_bnz_w">,
    663   Intrinsic<[llvm_i32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
    664 def int_mips_bnz_d : GCCBuiltin<"__builtin_msa_bnz_d">,
    665   Intrinsic<[llvm_i32_ty], [llvm_v2i64_ty], [IntrNoMem]>;
    666 
    667 def int_mips_bnz_v : GCCBuiltin<"__builtin_msa_bnz_v">,
    668   Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
    669 
    670 def int_mips_bsel_v : GCCBuiltin<"__builtin_msa_bsel_v">,
    671   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
    672             [IntrNoMem]>;
    673 
    674 def int_mips_bseli_b : GCCBuiltin<"__builtin_msa_bseli_b">,
    675   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
    676             [IntrNoMem]>;
    677 
    678 def int_mips_bset_b : GCCBuiltin<"__builtin_msa_bset_b">,
    679   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
    680 def int_mips_bset_h : GCCBuiltin<"__builtin_msa_bset_h">,
    681   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
    682 def int_mips_bset_w : GCCBuiltin<"__builtin_msa_bset_w">,
    683   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
    684 def int_mips_bset_d : GCCBuiltin<"__builtin_msa_bset_d">,
    685   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
    686 
    687 def int_mips_bseti_b : GCCBuiltin<"__builtin_msa_bseti_b">,
    688   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
    689 def int_mips_bseti_h : GCCBuiltin<"__builtin_msa_bseti_h">,
    690   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
    691 def int_mips_bseti_w : GCCBuiltin<"__builtin_msa_bseti_w">,
    692   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
    693 def int_mips_bseti_d : GCCBuiltin<"__builtin_msa_bseti_d">,
    694   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
    695 
    696 def int_mips_bz_b : GCCBuiltin<"__builtin_msa_bz_b">,
    697   Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
    698 def int_mips_bz_h : GCCBuiltin<"__builtin_msa_bz_h">,
    699   Intrinsic<[llvm_i32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
    700 def int_mips_bz_w : GCCBuiltin<"__builtin_msa_bz_w">,
    701   Intrinsic<[llvm_i32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
    702 def int_mips_bz_d : GCCBuiltin<"__builtin_msa_bz_d">,
    703   Intrinsic<[llvm_i32_ty], [llvm_v2i64_ty], [IntrNoMem]>;
    704 
    705 def int_mips_bz_v : GCCBuiltin<"__builtin_msa_bz_v">,
    706   Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty], [IntrNoMem]>;
    707 
    708 def int_mips_ceq_b : GCCBuiltin<"__builtin_msa_ceq_b">,
    709   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
    710 def int_mips_ceq_h : GCCBuiltin<"__builtin_msa_ceq_h">,
    711   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
    712 def int_mips_ceq_w : GCCBuiltin<"__builtin_msa_ceq_w">,
    713   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
    714 def int_mips_ceq_d : GCCBuiltin<"__builtin_msa_ceq_d">,
    715   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
    716 
    717 def int_mips_ceqi_b : GCCBuiltin<"__builtin_msa_ceqi_b">,
    718   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
    719 def int_mips_ceqi_h : GCCBuiltin<"__builtin_msa_ceqi_h">,
    720   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
    721 def int_mips_ceqi_w : GCCBuiltin<"__builtin_msa_ceqi_w">,
    722   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
    723 def int_mips_ceqi_d : GCCBuiltin<"__builtin_msa_ceqi_d">,
    724   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
    725 
    726 def int_mips_cfcmsa : GCCBuiltin<"__builtin_msa_cfcmsa">,
    727   Intrinsic<[llvm_i32_ty], [llvm_i32_ty], []>;
    728 
    729 def int_mips_cle_s_b : GCCBuiltin<"__builtin_msa_cle_s_b">,
    730   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
    731 def int_mips_cle_s_h : GCCBuiltin<"__builtin_msa_cle_s_h">,
    732   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
    733 def int_mips_cle_s_w : GCCBuiltin<"__builtin_msa_cle_s_w">,
    734   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
    735 def int_mips_cle_s_d : GCCBuiltin<"__builtin_msa_cle_s_d">,
    736   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
    737 
    738 def int_mips_cle_u_b : GCCBuiltin<"__builtin_msa_cle_u_b">,
    739   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
    740 def int_mips_cle_u_h : GCCBuiltin<"__builtin_msa_cle_u_h">,
    741   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
    742 def int_mips_cle_u_w : GCCBuiltin<"__builtin_msa_cle_u_w">,
    743   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
    744 def int_mips_cle_u_d : GCCBuiltin<"__builtin_msa_cle_u_d">,
    745   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
    746 
    747 def int_mips_clei_s_b : GCCBuiltin<"__builtin_msa_clei_s_b">,
    748   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
    749 def int_mips_clei_s_h : GCCBuiltin<"__builtin_msa_clei_s_h">,
    750   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
    751 def int_mips_clei_s_w : GCCBuiltin<"__builtin_msa_clei_s_w">,
    752   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
    753 def int_mips_clei_s_d : GCCBuiltin<"__builtin_msa_clei_s_d">,
    754   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
    755 
    756 def int_mips_clei_u_b : GCCBuiltin<"__builtin_msa_clei_u_b">,
    757   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
    758 def int_mips_clei_u_h : GCCBuiltin<"__builtin_msa_clei_u_h">,
    759   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
    760 def int_mips_clei_u_w : GCCBuiltin<"__builtin_msa_clei_u_w">,
    761   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
    762 def int_mips_clei_u_d : GCCBuiltin<"__builtin_msa_clei_u_d">,
    763   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
    764 
    765 def int_mips_clt_s_b : GCCBuiltin<"__builtin_msa_clt_s_b">,
    766   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
    767 def int_mips_clt_s_h : GCCBuiltin<"__builtin_msa_clt_s_h">,
    768   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
    769 def int_mips_clt_s_w : GCCBuiltin<"__builtin_msa_clt_s_w">,
    770   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
    771 def int_mips_clt_s_d : GCCBuiltin<"__builtin_msa_clt_s_d">,
    772   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
    773 
    774 def int_mips_clt_u_b : GCCBuiltin<"__builtin_msa_clt_u_b">,
    775   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
    776 def int_mips_clt_u_h : GCCBuiltin<"__builtin_msa_clt_u_h">,
    777   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
    778 def int_mips_clt_u_w : GCCBuiltin<"__builtin_msa_clt_u_w">,
    779   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
    780 def int_mips_clt_u_d : GCCBuiltin<"__builtin_msa_clt_u_d">,
    781   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
    782 
    783 def int_mips_clti_s_b : GCCBuiltin<"__builtin_msa_clti_s_b">,
    784   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
    785 def int_mips_clti_s_h : GCCBuiltin<"__builtin_msa_clti_s_h">,
    786   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
    787 def int_mips_clti_s_w : GCCBuiltin<"__builtin_msa_clti_s_w">,
    788   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
    789 def int_mips_clti_s_d : GCCBuiltin<"__builtin_msa_clti_s_d">,
    790   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
    791 
    792 def int_mips_clti_u_b : GCCBuiltin<"__builtin_msa_clti_u_b">,
    793   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
    794 def int_mips_clti_u_h : GCCBuiltin<"__builtin_msa_clti_u_h">,
    795   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
    796 def int_mips_clti_u_w : GCCBuiltin<"__builtin_msa_clti_u_w">,
    797   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
    798 def int_mips_clti_u_d : GCCBuiltin<"__builtin_msa_clti_u_d">,
    799   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
    800 
    801 def int_mips_copy_s_b : GCCBuiltin<"__builtin_msa_copy_s_b">,
    802   Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
    803 def int_mips_copy_s_h : GCCBuiltin<"__builtin_msa_copy_s_h">,
    804   Intrinsic<[llvm_i32_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
    805 def int_mips_copy_s_w : GCCBuiltin<"__builtin_msa_copy_s_w">,
    806   Intrinsic<[llvm_i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
    807 def int_mips_copy_s_d : GCCBuiltin<"__builtin_msa_copy_s_d">,
    808   Intrinsic<[llvm_i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
    809 
    810 def int_mips_copy_u_b : GCCBuiltin<"__builtin_msa_copy_u_b">,
    811   Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
    812 def int_mips_copy_u_h : GCCBuiltin<"__builtin_msa_copy_u_h">,
    813   Intrinsic<[llvm_i32_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
    814 def int_mips_copy_u_w : GCCBuiltin<"__builtin_msa_copy_u_w">,
    815   Intrinsic<[llvm_i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
    816 def int_mips_copy_u_d : GCCBuiltin<"__builtin_msa_copy_u_d">,
    817   Intrinsic<[llvm_i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
    818 
    819 def int_mips_ctcmsa : GCCBuiltin<"__builtin_msa_ctcmsa">,
    820   Intrinsic<[], [llvm_i32_ty, llvm_i32_ty], []>;
    821 
    822 def int_mips_div_s_b : GCCBuiltin<"__builtin_msa_div_s_b">,
    823   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
    824 def int_mips_div_s_h : GCCBuiltin<"__builtin_msa_div_s_h">,
    825   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
    826 def int_mips_div_s_w : GCCBuiltin<"__builtin_msa_div_s_w">,
    827   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
    828 def int_mips_div_s_d : GCCBuiltin<"__builtin_msa_div_s_d">,
    829   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
    830 
    831 def int_mips_div_u_b : GCCBuiltin<"__builtin_msa_div_u_b">,
    832   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
    833 def int_mips_div_u_h : GCCBuiltin<"__builtin_msa_div_u_h">,
    834   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
    835 def int_mips_div_u_w : GCCBuiltin<"__builtin_msa_div_u_w">,
    836   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
    837 def int_mips_div_u_d : GCCBuiltin<"__builtin_msa_div_u_d">,
    838   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
    839 
    840 // This instruction is part of the MSA spec but it does not share the
    841 // __builtin_msa prefix because it operates on GP registers.
    842 def int_mips_dlsa : GCCBuiltin<"__builtin_mips_dlsa">,
    843   Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty],
    844             [IntrNoMem]>;
    845 
    846 def int_mips_dotp_s_h : GCCBuiltin<"__builtin_msa_dotp_s_h">,
    847   Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
    848 def int_mips_dotp_s_w : GCCBuiltin<"__builtin_msa_dotp_s_w">,
    849   Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
    850 def int_mips_dotp_s_d : GCCBuiltin<"__builtin_msa_dotp_s_d">,
    851   Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
    852 
    853 def int_mips_dotp_u_h : GCCBuiltin<"__builtin_msa_dotp_u_h">,
    854   Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
    855 def int_mips_dotp_u_w : GCCBuiltin<"__builtin_msa_dotp_u_w">,
    856   Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
    857 def int_mips_dotp_u_d : GCCBuiltin<"__builtin_msa_dotp_u_d">,
    858   Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
    859 
    860 def int_mips_dpadd_s_h : GCCBuiltin<"__builtin_msa_dpadd_s_h">,
    861   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v16i8_ty, llvm_v16i8_ty],
    862   [IntrNoMem]>;
    863 def int_mips_dpadd_s_w : GCCBuiltin<"__builtin_msa_dpadd_s_w">,
    864   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
    865   [IntrNoMem]>;
    866 def int_mips_dpadd_s_d : GCCBuiltin<"__builtin_msa_dpadd_s_d">,
    867   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v4i32_ty, llvm_v4i32_ty],
    868   [IntrNoMem]>;
    869 
    870 def int_mips_dpadd_u_h : GCCBuiltin<"__builtin_msa_dpadd_u_h">,
    871   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v16i8_ty, llvm_v16i8_ty],
    872   [IntrNoMem]>;
    873 def int_mips_dpadd_u_w : GCCBuiltin<"__builtin_msa_dpadd_u_w">,
    874   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
    875   [IntrNoMem]>;
    876 def int_mips_dpadd_u_d : GCCBuiltin<"__builtin_msa_dpadd_u_d">,
    877   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v4i32_ty, llvm_v4i32_ty],
    878   [IntrNoMem]>;
    879 
    880 def int_mips_dpsub_s_h : GCCBuiltin<"__builtin_msa_dpsub_s_h">,
    881   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v16i8_ty, llvm_v16i8_ty],
    882   [IntrNoMem]>;
    883 def int_mips_dpsub_s_w : GCCBuiltin<"__builtin_msa_dpsub_s_w">,
    884   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
    885   [IntrNoMem]>;
    886 def int_mips_dpsub_s_d : GCCBuiltin<"__builtin_msa_dpsub_s_d">,
    887   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v4i32_ty, llvm_v4i32_ty],
    888   [IntrNoMem]>;
    889 
    890 def int_mips_dpsub_u_h : GCCBuiltin<"__builtin_msa_dpsub_u_h">,
    891   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v16i8_ty, llvm_v16i8_ty],
    892   [IntrNoMem]>;
    893 def int_mips_dpsub_u_w : GCCBuiltin<"__builtin_msa_dpsub_u_w">,
    894   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v8i16_ty, llvm_v8i16_ty],
    895   [IntrNoMem]>;
    896 def int_mips_dpsub_u_d : GCCBuiltin<"__builtin_msa_dpsub_u_d">,
    897   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v4i32_ty, llvm_v4i32_ty],
    898   [IntrNoMem]>;
    899 
    900 def int_mips_fadd_w : GCCBuiltin<"__builtin_msa_fadd_w">,
    901   Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
    902 def int_mips_fadd_d : GCCBuiltin<"__builtin_msa_fadd_d">,
    903   Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
    904 
    905 def int_mips_fcaf_w : GCCBuiltin<"__builtin_msa_fcaf_w">,
    906   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
    907 def int_mips_fcaf_d : GCCBuiltin<"__builtin_msa_fcaf_d">,
    908   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
    909 
    910 def int_mips_fceq_w : GCCBuiltin<"__builtin_msa_fceq_w">,
    911   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
    912 def int_mips_fceq_d : GCCBuiltin<"__builtin_msa_fceq_d">,
    913   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
    914 
    915 def int_mips_fcle_w : GCCBuiltin<"__builtin_msa_fcle_w">,
    916   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
    917 def int_mips_fcle_d : GCCBuiltin<"__builtin_msa_fcle_d">,
    918   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
    919 
    920 def int_mips_fclt_w : GCCBuiltin<"__builtin_msa_fclt_w">,
    921   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
    922 def int_mips_fclt_d : GCCBuiltin<"__builtin_msa_fclt_d">,
    923   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
    924 
    925 def int_mips_fclass_w : GCCBuiltin<"__builtin_msa_fclass_w">,
    926   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    927 def int_mips_fclass_d : GCCBuiltin<"__builtin_msa_fclass_d">,
    928   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
    929 
    930 def int_mips_fcne_w : GCCBuiltin<"__builtin_msa_fcne_w">,
    931   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
    932 def int_mips_fcne_d : GCCBuiltin<"__builtin_msa_fcne_d">,
    933   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
    934 
    935 def int_mips_fcor_w : GCCBuiltin<"__builtin_msa_fcor_w">,
    936   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
    937 def int_mips_fcor_d : GCCBuiltin<"__builtin_msa_fcor_d">,
    938   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
    939 
    940 def int_mips_fcueq_w : GCCBuiltin<"__builtin_msa_fcueq_w">,
    941   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
    942 def int_mips_fcueq_d : GCCBuiltin<"__builtin_msa_fcueq_d">,
    943   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
    944 
    945 def int_mips_fcule_w : GCCBuiltin<"__builtin_msa_fcule_w">,
    946   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
    947 def int_mips_fcule_d : GCCBuiltin<"__builtin_msa_fcule_d">,
    948   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
    949 
    950 def int_mips_fcult_w : GCCBuiltin<"__builtin_msa_fcult_w">,
    951   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
    952 def int_mips_fcult_d : GCCBuiltin<"__builtin_msa_fcult_d">,
    953   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
    954 
    955 def int_mips_fcun_w : GCCBuiltin<"__builtin_msa_fcun_w">,
    956   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
    957 def int_mips_fcun_d : GCCBuiltin<"__builtin_msa_fcun_d">,
    958   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
    959 
    960 def int_mips_fcune_w : GCCBuiltin<"__builtin_msa_fcune_w">,
    961   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
    962 def int_mips_fcune_d : GCCBuiltin<"__builtin_msa_fcune_d">,
    963   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
    964 
    965 def int_mips_fdiv_w : GCCBuiltin<"__builtin_msa_fdiv_w">,
    966   Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
    967 def int_mips_fdiv_d : GCCBuiltin<"__builtin_msa_fdiv_d">,
    968   Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
    969 
    970 def int_mips_fexdo_h : GCCBuiltin<"__builtin_msa_fexdo_h">,
    971   Intrinsic<[llvm_v8f16_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
    972 def int_mips_fexdo_w : GCCBuiltin<"__builtin_msa_fexdo_w">,
    973   Intrinsic<[llvm_v4f32_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
    974 
    975 def int_mips_fexp2_w : GCCBuiltin<"__builtin_msa_fexp2_w">,
    976   Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4i32_ty], [IntrNoMem]>;
    977 def int_mips_fexp2_d : GCCBuiltin<"__builtin_msa_fexp2_d">,
    978   Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2i64_ty], [IntrNoMem]>;
    979 
    980 def int_mips_fexupl_w : GCCBuiltin<"__builtin_msa_fexupl_w">,
    981   Intrinsic<[llvm_v4f32_ty], [llvm_v8f16_ty], [IntrNoMem]>;
    982 def int_mips_fexupl_d : GCCBuiltin<"__builtin_msa_fexupl_d">,
    983   Intrinsic<[llvm_v2f64_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    984 
    985 def int_mips_fexupr_w : GCCBuiltin<"__builtin_msa_fexupr_w">,
    986   Intrinsic<[llvm_v4f32_ty], [llvm_v8f16_ty], [IntrNoMem]>;
    987 def int_mips_fexupr_d : GCCBuiltin<"__builtin_msa_fexupr_d">,
    988   Intrinsic<[llvm_v2f64_ty], [llvm_v4f32_ty], [IntrNoMem]>;
    989 
    990 def int_mips_ffint_s_w : GCCBuiltin<"__builtin_msa_ffint_s_w">,
    991   Intrinsic<[llvm_v4f32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
    992 def int_mips_ffint_s_d : GCCBuiltin<"__builtin_msa_ffint_s_d">,
    993   Intrinsic<[llvm_v2f64_ty], [llvm_v2i64_ty], [IntrNoMem]>;
    994 
    995 def int_mips_ffint_u_w : GCCBuiltin<"__builtin_msa_ffint_u_w">,
    996   Intrinsic<[llvm_v4f32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
    997 def int_mips_ffint_u_d : GCCBuiltin<"__builtin_msa_ffint_u_d">,
    998   Intrinsic<[llvm_v2f64_ty], [llvm_v2i64_ty], [IntrNoMem]>;
    999 
   1000 def int_mips_ffql_w : GCCBuiltin<"__builtin_msa_ffql_w">,
   1001   Intrinsic<[llvm_v4f32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
   1002 def int_mips_ffql_d : GCCBuiltin<"__builtin_msa_ffql_d">,
   1003   Intrinsic<[llvm_v2f64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
   1004 
   1005 def int_mips_ffqr_w : GCCBuiltin<"__builtin_msa_ffqr_w">,
   1006   Intrinsic<[llvm_v4f32_ty], [llvm_v8i16_ty], [IntrNoMem]>;
   1007 def int_mips_ffqr_d : GCCBuiltin<"__builtin_msa_ffqr_d">,
   1008   Intrinsic<[llvm_v2f64_ty], [llvm_v4i32_ty], [IntrNoMem]>;
   1009 
   1010 def int_mips_fill_b : GCCBuiltin<"__builtin_msa_fill_b">,
   1011   Intrinsic<[llvm_v16i8_ty], [llvm_i32_ty], [IntrNoMem]>;
   1012 def int_mips_fill_h : GCCBuiltin<"__builtin_msa_fill_h">,
   1013   Intrinsic<[llvm_v8i16_ty], [llvm_i32_ty], [IntrNoMem]>;
   1014 def int_mips_fill_w : GCCBuiltin<"__builtin_msa_fill_w">,
   1015   Intrinsic<[llvm_v4i32_ty], [llvm_i32_ty], [IntrNoMem]>;
   1016 def int_mips_fill_d : GCCBuiltin<"__builtin_msa_fill_d">,
   1017   Intrinsic<[llvm_v2i64_ty], [llvm_i64_ty], [IntrNoMem]>;
   1018 
   1019 def int_mips_flog2_w : GCCBuiltin<"__builtin_msa_flog2_w">,
   1020   Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
   1021 def int_mips_flog2_d : GCCBuiltin<"__builtin_msa_flog2_d">,
   1022   Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
   1023 
   1024 def int_mips_fmadd_w : GCCBuiltin<"__builtin_msa_fmadd_w">,
   1025   Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
   1026             [IntrNoMem]>;
   1027 def int_mips_fmadd_d : GCCBuiltin<"__builtin_msa_fmadd_d">,
   1028   Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
   1029             [IntrNoMem]>;
   1030 
   1031 def int_mips_fmax_w : GCCBuiltin<"__builtin_msa_fmax_w">,
   1032   Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1033 def int_mips_fmax_d : GCCBuiltin<"__builtin_msa_fmax_d">,
   1034   Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1035 
   1036 def int_mips_fmax_a_w : GCCBuiltin<"__builtin_msa_fmax_a_w">,
   1037   Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1038 def int_mips_fmax_a_d : GCCBuiltin<"__builtin_msa_fmax_a_d">,
   1039   Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1040 
   1041 def int_mips_fmin_w : GCCBuiltin<"__builtin_msa_fmin_w">,
   1042   Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1043 def int_mips_fmin_d : GCCBuiltin<"__builtin_msa_fmin_d">,
   1044   Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1045 
   1046 def int_mips_fmin_a_w : GCCBuiltin<"__builtin_msa_fmin_a_w">,
   1047   Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1048 def int_mips_fmin_a_d : GCCBuiltin<"__builtin_msa_fmin_a_d">,
   1049   Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1050 
   1051 def int_mips_fmsub_w : GCCBuiltin<"__builtin_msa_fmsub_w">,
   1052   Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty],
   1053             [IntrNoMem]>;
   1054 def int_mips_fmsub_d : GCCBuiltin<"__builtin_msa_fmsub_d">,
   1055   Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty],
   1056             [IntrNoMem]>;
   1057 
   1058 def int_mips_fmul_w : GCCBuiltin<"__builtin_msa_fmul_w">,
   1059   Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1060 def int_mips_fmul_d : GCCBuiltin<"__builtin_msa_fmul_d">,
   1061   Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1062 
   1063 def int_mips_frint_w : GCCBuiltin<"__builtin_msa_frint_w">,
   1064   Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
   1065 def int_mips_frint_d : GCCBuiltin<"__builtin_msa_frint_d">,
   1066   Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
   1067 
   1068 def int_mips_frcp_w : GCCBuiltin<"__builtin_msa_frcp_w">,
   1069   Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
   1070 def int_mips_frcp_d : GCCBuiltin<"__builtin_msa_frcp_d">,
   1071   Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
   1072 
   1073 def int_mips_frsqrt_w : GCCBuiltin<"__builtin_msa_frsqrt_w">,
   1074   Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
   1075 def int_mips_frsqrt_d : GCCBuiltin<"__builtin_msa_frsqrt_d">,
   1076   Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
   1077 
   1078 def int_mips_fsaf_w : GCCBuiltin<"__builtin_msa_fsaf_w">,
   1079   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1080 def int_mips_fsaf_d : GCCBuiltin<"__builtin_msa_fsaf_d">,
   1081   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1082 
   1083 def int_mips_fseq_w : GCCBuiltin<"__builtin_msa_fseq_w">,
   1084   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1085 def int_mips_fseq_d : GCCBuiltin<"__builtin_msa_fseq_d">,
   1086   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1087 
   1088 def int_mips_fsle_w : GCCBuiltin<"__builtin_msa_fsle_w">,
   1089   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1090 def int_mips_fsle_d : GCCBuiltin<"__builtin_msa_fsle_d">,
   1091   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1092 
   1093 def int_mips_fslt_w : GCCBuiltin<"__builtin_msa_fslt_w">,
   1094   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1095 def int_mips_fslt_d : GCCBuiltin<"__builtin_msa_fslt_d">,
   1096   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1097 
   1098 def int_mips_fsne_w : GCCBuiltin<"__builtin_msa_fsne_w">,
   1099   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1100 def int_mips_fsne_d : GCCBuiltin<"__builtin_msa_fsne_d">,
   1101   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1102 
   1103 def int_mips_fsor_w : GCCBuiltin<"__builtin_msa_fsor_w">,
   1104   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1105 def int_mips_fsor_d : GCCBuiltin<"__builtin_msa_fsor_d">,
   1106   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1107 
   1108 def int_mips_fsqrt_w : GCCBuiltin<"__builtin_msa_fsqrt_w">,
   1109   Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
   1110 def int_mips_fsqrt_d : GCCBuiltin<"__builtin_msa_fsqrt_d">,
   1111   Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
   1112 
   1113 def int_mips_fsub_w : GCCBuiltin<"__builtin_msa_fsub_w">,
   1114   Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1115 def int_mips_fsub_d : GCCBuiltin<"__builtin_msa_fsub_d">,
   1116   Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1117 
   1118 def int_mips_fsueq_w : GCCBuiltin<"__builtin_msa_fsueq_w">,
   1119   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1120 def int_mips_fsueq_d : GCCBuiltin<"__builtin_msa_fsueq_d">,
   1121   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1122 
   1123 def int_mips_fsule_w : GCCBuiltin<"__builtin_msa_fsule_w">,
   1124   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1125 def int_mips_fsule_d : GCCBuiltin<"__builtin_msa_fsule_d">,
   1126   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1127 
   1128 def int_mips_fsult_w : GCCBuiltin<"__builtin_msa_fsult_w">,
   1129   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1130 def int_mips_fsult_d : GCCBuiltin<"__builtin_msa_fsult_d">,
   1131   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1132 
   1133 def int_mips_fsun_w : GCCBuiltin<"__builtin_msa_fsun_w">,
   1134   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1135 def int_mips_fsun_d : GCCBuiltin<"__builtin_msa_fsun_d">,
   1136   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1137 
   1138 def int_mips_fsune_w : GCCBuiltin<"__builtin_msa_fsune_w">,
   1139   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1140 def int_mips_fsune_d : GCCBuiltin<"__builtin_msa_fsune_d">,
   1141   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1142 
   1143 def int_mips_ftint_s_w : GCCBuiltin<"__builtin_msa_ftint_s_w">,
   1144   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
   1145 def int_mips_ftint_s_d : GCCBuiltin<"__builtin_msa_ftint_s_d">,
   1146   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
   1147 
   1148 def int_mips_ftint_u_w : GCCBuiltin<"__builtin_msa_ftint_u_w">,
   1149   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
   1150 def int_mips_ftint_u_d : GCCBuiltin<"__builtin_msa_ftint_u_d">,
   1151   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
   1152 
   1153 def int_mips_ftq_h : GCCBuiltin<"__builtin_msa_ftq_h">,
   1154   Intrinsic<[llvm_v8i16_ty], [llvm_v4f32_ty, llvm_v4f32_ty], [IntrNoMem]>;
   1155 def int_mips_ftq_w : GCCBuiltin<"__builtin_msa_ftq_w">,
   1156   Intrinsic<[llvm_v4i32_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
   1157 
   1158 def int_mips_ftrunc_s_w : GCCBuiltin<"__builtin_msa_ftrunc_s_w">,
   1159   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
   1160 def int_mips_ftrunc_s_d : GCCBuiltin<"__builtin_msa_ftrunc_s_d">,
   1161   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
   1162 
   1163 def int_mips_ftrunc_u_w : GCCBuiltin<"__builtin_msa_ftrunc_u_w">,
   1164   Intrinsic<[llvm_v4i32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
   1165 def int_mips_ftrunc_u_d : GCCBuiltin<"__builtin_msa_ftrunc_u_d">,
   1166   Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
   1167 
   1168 def int_mips_hadd_s_h : GCCBuiltin<"__builtin_msa_hadd_s_h">,
   1169   Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1170 def int_mips_hadd_s_w : GCCBuiltin<"__builtin_msa_hadd_s_w">,
   1171   Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1172 def int_mips_hadd_s_d : GCCBuiltin<"__builtin_msa_hadd_s_d">,
   1173   Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1174 
   1175 def int_mips_hadd_u_h : GCCBuiltin<"__builtin_msa_hadd_u_h">,
   1176   Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1177 def int_mips_hadd_u_w : GCCBuiltin<"__builtin_msa_hadd_u_w">,
   1178   Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1179 def int_mips_hadd_u_d : GCCBuiltin<"__builtin_msa_hadd_u_d">,
   1180   Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1181 
   1182 def int_mips_hsub_s_h : GCCBuiltin<"__builtin_msa_hsub_s_h">,
   1183   Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1184 def int_mips_hsub_s_w : GCCBuiltin<"__builtin_msa_hsub_s_w">,
   1185   Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1186 def int_mips_hsub_s_d : GCCBuiltin<"__builtin_msa_hsub_s_d">,
   1187   Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1188 
   1189 def int_mips_hsub_u_h : GCCBuiltin<"__builtin_msa_hsub_u_h">,
   1190   Intrinsic<[llvm_v8i16_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1191 def int_mips_hsub_u_w : GCCBuiltin<"__builtin_msa_hsub_u_w">,
   1192   Intrinsic<[llvm_v4i32_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1193 def int_mips_hsub_u_d : GCCBuiltin<"__builtin_msa_hsub_u_d">,
   1194   Intrinsic<[llvm_v2i64_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1195 
   1196 def int_mips_ilvev_b : GCCBuiltin<"__builtin_msa_ilvev_b">,
   1197   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1198 def int_mips_ilvev_h : GCCBuiltin<"__builtin_msa_ilvev_h">,
   1199   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1200 def int_mips_ilvev_w : GCCBuiltin<"__builtin_msa_ilvev_w">,
   1201   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1202 def int_mips_ilvev_d : GCCBuiltin<"__builtin_msa_ilvev_d">,
   1203   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1204 
   1205 def int_mips_ilvl_b : GCCBuiltin<"__builtin_msa_ilvl_b">,
   1206   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1207 def int_mips_ilvl_h : GCCBuiltin<"__builtin_msa_ilvl_h">,
   1208   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1209 def int_mips_ilvl_w : GCCBuiltin<"__builtin_msa_ilvl_w">,
   1210   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1211 def int_mips_ilvl_d : GCCBuiltin<"__builtin_msa_ilvl_d">,
   1212   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1213 
   1214 def int_mips_ilvod_b : GCCBuiltin<"__builtin_msa_ilvod_b">,
   1215   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1216 def int_mips_ilvod_h : GCCBuiltin<"__builtin_msa_ilvod_h">,
   1217   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1218 def int_mips_ilvod_w : GCCBuiltin<"__builtin_msa_ilvod_w">,
   1219   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1220 def int_mips_ilvod_d : GCCBuiltin<"__builtin_msa_ilvod_d">,
   1221   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1222 
   1223 def int_mips_ilvr_b : GCCBuiltin<"__builtin_msa_ilvr_b">,
   1224   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1225 def int_mips_ilvr_h : GCCBuiltin<"__builtin_msa_ilvr_h">,
   1226   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1227 def int_mips_ilvr_w : GCCBuiltin<"__builtin_msa_ilvr_w">,
   1228   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1229 def int_mips_ilvr_d : GCCBuiltin<"__builtin_msa_ilvr_d">,
   1230   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1231 
   1232 def int_mips_insert_b : GCCBuiltin<"__builtin_msa_insert_b">,
   1233   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty, llvm_i32_ty],
   1234   [IntrNoMem]>;
   1235 def int_mips_insert_h : GCCBuiltin<"__builtin_msa_insert_h">,
   1236   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty, llvm_i32_ty],
   1237   [IntrNoMem]>;
   1238 def int_mips_insert_w : GCCBuiltin<"__builtin_msa_insert_w">,
   1239   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty, llvm_i32_ty],
   1240   [IntrNoMem]>;
   1241 def int_mips_insert_d : GCCBuiltin<"__builtin_msa_insert_d">,
   1242   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty, llvm_i64_ty],
   1243   [IntrNoMem]>;
   1244 
   1245 def int_mips_insve_b : GCCBuiltin<"__builtin_msa_insve_b">,
   1246   Intrinsic<[llvm_v16i8_ty],
   1247             [llvm_v16i8_ty, llvm_i32_ty, llvm_v16i8_ty],
   1248             [IntrNoMem]>;
   1249 def int_mips_insve_h : GCCBuiltin<"__builtin_msa_insve_h">,
   1250   Intrinsic<[llvm_v8i16_ty],
   1251             [llvm_v8i16_ty, llvm_i32_ty, llvm_v8i16_ty],
   1252             [IntrNoMem]>;
   1253 def int_mips_insve_w : GCCBuiltin<"__builtin_msa_insve_w">,
   1254   Intrinsic<[llvm_v4i32_ty],
   1255             [llvm_v4i32_ty, llvm_i32_ty, llvm_v4i32_ty],
   1256             [IntrNoMem]>;
   1257 def int_mips_insve_d : GCCBuiltin<"__builtin_msa_insve_d">,
   1258   Intrinsic<[llvm_v2i64_ty],
   1259             [llvm_v2i64_ty, llvm_i32_ty, llvm_v2i64_ty],
   1260             [IntrNoMem]>;
   1261 
   1262 def int_mips_ld_b : GCCBuiltin<"__builtin_msa_ld_b">,
   1263   Intrinsic<[llvm_v16i8_ty], [llvm_ptr_ty, llvm_i32_ty],
   1264   [IntrReadMem, IntrArgMemOnly]>;
   1265 def int_mips_ld_h : GCCBuiltin<"__builtin_msa_ld_h">,
   1266   Intrinsic<[llvm_v8i16_ty], [llvm_ptr_ty, llvm_i32_ty],
   1267   [IntrReadMem, IntrArgMemOnly]>;
   1268 def int_mips_ld_w : GCCBuiltin<"__builtin_msa_ld_w">,
   1269   Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty, llvm_i32_ty],
   1270   [IntrReadMem, IntrArgMemOnly]>;
   1271 def int_mips_ld_d : GCCBuiltin<"__builtin_msa_ld_d">,
   1272   Intrinsic<[llvm_v2i64_ty], [llvm_ptr_ty, llvm_i32_ty],
   1273   [IntrReadMem, IntrArgMemOnly]>;
   1274 
   1275 def int_mips_ldi_b : GCCBuiltin<"__builtin_msa_ldi_b">,
   1276   Intrinsic<[llvm_v16i8_ty], [llvm_i32_ty], [IntrNoMem]>;
   1277 def int_mips_ldi_h : GCCBuiltin<"__builtin_msa_ldi_h">,
   1278   Intrinsic<[llvm_v8i16_ty], [llvm_i32_ty], [IntrNoMem]>;
   1279 def int_mips_ldi_w : GCCBuiltin<"__builtin_msa_ldi_w">,
   1280   Intrinsic<[llvm_v4i32_ty], [llvm_i32_ty], [IntrNoMem]>;
   1281 def int_mips_ldi_d : GCCBuiltin<"__builtin_msa_ldi_d">,
   1282   Intrinsic<[llvm_v2i64_ty], [llvm_i32_ty], [IntrNoMem]>;
   1283 
   1284 // This instruction is part of the MSA spec but it does not share the
   1285 // __builtin_msa prefix because it operates on the GPR registers.
   1286 def int_mips_lsa : GCCBuiltin<"__builtin_mips_lsa">,
   1287   Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
   1288             [IntrNoMem]>;
   1289 
   1290 def int_mips_madd_q_h : GCCBuiltin<"__builtin_msa_madd_q_h">,
   1291   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
   1292   [IntrNoMem]>;
   1293 def int_mips_madd_q_w : GCCBuiltin<"__builtin_msa_madd_q_w">,
   1294   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
   1295   [IntrNoMem]>;
   1296 
   1297 def int_mips_maddr_q_h : GCCBuiltin<"__builtin_msa_maddr_q_h">,
   1298   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
   1299   [IntrNoMem]>;
   1300 def int_mips_maddr_q_w : GCCBuiltin<"__builtin_msa_maddr_q_w">,
   1301   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
   1302   [IntrNoMem]>;
   1303 
   1304 def int_mips_maddv_b : GCCBuiltin<"__builtin_msa_maddv_b">,
   1305   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
   1306   [IntrNoMem]>;
   1307 def int_mips_maddv_h : GCCBuiltin<"__builtin_msa_maddv_h">,
   1308   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
   1309   [IntrNoMem]>;
   1310 def int_mips_maddv_w : GCCBuiltin<"__builtin_msa_maddv_w">,
   1311   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
   1312   [IntrNoMem]>;
   1313 def int_mips_maddv_d : GCCBuiltin<"__builtin_msa_maddv_d">,
   1314   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
   1315   [IntrNoMem]>;
   1316 
   1317 def int_mips_max_a_b : GCCBuiltin<"__builtin_msa_max_a_b">,
   1318   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1319 def int_mips_max_a_h : GCCBuiltin<"__builtin_msa_max_a_h">,
   1320   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1321 def int_mips_max_a_w : GCCBuiltin<"__builtin_msa_max_a_w">,
   1322   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1323 def int_mips_max_a_d : GCCBuiltin<"__builtin_msa_max_a_d">,
   1324   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1325 
   1326 def int_mips_max_s_b : GCCBuiltin<"__builtin_msa_max_s_b">,
   1327   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1328 def int_mips_max_s_h : GCCBuiltin<"__builtin_msa_max_s_h">,
   1329   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1330 def int_mips_max_s_w : GCCBuiltin<"__builtin_msa_max_s_w">,
   1331   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1332 def int_mips_max_s_d : GCCBuiltin<"__builtin_msa_max_s_d">,
   1333   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1334 
   1335 def int_mips_max_u_b : GCCBuiltin<"__builtin_msa_max_u_b">,
   1336   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1337 def int_mips_max_u_h : GCCBuiltin<"__builtin_msa_max_u_h">,
   1338   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1339 def int_mips_max_u_w : GCCBuiltin<"__builtin_msa_max_u_w">,
   1340   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1341 def int_mips_max_u_d : GCCBuiltin<"__builtin_msa_max_u_d">,
   1342   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1343 
   1344 def int_mips_maxi_s_b : GCCBuiltin<"__builtin_msa_maxi_s_b">,
   1345   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1346 def int_mips_maxi_s_h : GCCBuiltin<"__builtin_msa_maxi_s_h">,
   1347   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1348 def int_mips_maxi_s_w : GCCBuiltin<"__builtin_msa_maxi_s_w">,
   1349   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1350 def int_mips_maxi_s_d : GCCBuiltin<"__builtin_msa_maxi_s_d">,
   1351   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
   1352 
   1353 def int_mips_maxi_u_b : GCCBuiltin<"__builtin_msa_maxi_u_b">,
   1354   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1355 def int_mips_maxi_u_h : GCCBuiltin<"__builtin_msa_maxi_u_h">,
   1356   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1357 def int_mips_maxi_u_w : GCCBuiltin<"__builtin_msa_maxi_u_w">,
   1358   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1359 def int_mips_maxi_u_d : GCCBuiltin<"__builtin_msa_maxi_u_d">,
   1360   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
   1361 
   1362 def int_mips_min_a_b : GCCBuiltin<"__builtin_msa_min_a_b">,
   1363   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1364 def int_mips_min_a_h : GCCBuiltin<"__builtin_msa_min_a_h">,
   1365   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1366 def int_mips_min_a_w : GCCBuiltin<"__builtin_msa_min_a_w">,
   1367   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1368 def int_mips_min_a_d : GCCBuiltin<"__builtin_msa_min_a_d">,
   1369   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1370 
   1371 def int_mips_min_s_b : GCCBuiltin<"__builtin_msa_min_s_b">,
   1372   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1373 def int_mips_min_s_h : GCCBuiltin<"__builtin_msa_min_s_h">,
   1374   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1375 def int_mips_min_s_w : GCCBuiltin<"__builtin_msa_min_s_w">,
   1376   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1377 def int_mips_min_s_d : GCCBuiltin<"__builtin_msa_min_s_d">,
   1378   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1379 
   1380 def int_mips_min_u_b : GCCBuiltin<"__builtin_msa_min_u_b">,
   1381   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1382 def int_mips_min_u_h : GCCBuiltin<"__builtin_msa_min_u_h">,
   1383   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1384 def int_mips_min_u_w : GCCBuiltin<"__builtin_msa_min_u_w">,
   1385   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1386 def int_mips_min_u_d : GCCBuiltin<"__builtin_msa_min_u_d">,
   1387   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1388 
   1389 def int_mips_mini_s_b : GCCBuiltin<"__builtin_msa_mini_s_b">,
   1390   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1391 def int_mips_mini_s_h : GCCBuiltin<"__builtin_msa_mini_s_h">,
   1392   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1393 def int_mips_mini_s_w : GCCBuiltin<"__builtin_msa_mini_s_w">,
   1394   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1395 def int_mips_mini_s_d : GCCBuiltin<"__builtin_msa_mini_s_d">,
   1396   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
   1397 
   1398 def int_mips_mini_u_b : GCCBuiltin<"__builtin_msa_mini_u_b">,
   1399   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1400 def int_mips_mini_u_h : GCCBuiltin<"__builtin_msa_mini_u_h">,
   1401   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1402 def int_mips_mini_u_w : GCCBuiltin<"__builtin_msa_mini_u_w">,
   1403   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1404 def int_mips_mini_u_d : GCCBuiltin<"__builtin_msa_mini_u_d">,
   1405   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
   1406 
   1407 def int_mips_mod_s_b : GCCBuiltin<"__builtin_msa_mod_s_b">,
   1408   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1409 def int_mips_mod_s_h : GCCBuiltin<"__builtin_msa_mod_s_h">,
   1410   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1411 def int_mips_mod_s_w : GCCBuiltin<"__builtin_msa_mod_s_w">,
   1412   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1413 def int_mips_mod_s_d : GCCBuiltin<"__builtin_msa_mod_s_d">,
   1414   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1415 
   1416 def int_mips_mod_u_b : GCCBuiltin<"__builtin_msa_mod_u_b">,
   1417   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1418 def int_mips_mod_u_h : GCCBuiltin<"__builtin_msa_mod_u_h">,
   1419   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1420 def int_mips_mod_u_w : GCCBuiltin<"__builtin_msa_mod_u_w">,
   1421   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1422 def int_mips_mod_u_d : GCCBuiltin<"__builtin_msa_mod_u_d">,
   1423   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1424 
   1425 def int_mips_move_v : GCCBuiltin<"__builtin_msa_move_v">,
   1426   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty], [IntrNoMem]>;
   1427 
   1428 def int_mips_msub_q_h : GCCBuiltin<"__builtin_msa_msub_q_h">,
   1429   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
   1430   [IntrNoMem]>;
   1431 def int_mips_msub_q_w : GCCBuiltin<"__builtin_msa_msub_q_w">,
   1432   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
   1433   [IntrNoMem]>;
   1434 
   1435 def int_mips_msubr_q_h : GCCBuiltin<"__builtin_msa_msubr_q_h">,
   1436   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
   1437   [IntrNoMem]>;
   1438 def int_mips_msubr_q_w : GCCBuiltin<"__builtin_msa_msubr_q_w">,
   1439   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
   1440   [IntrNoMem]>;
   1441 
   1442 def int_mips_msubv_b : GCCBuiltin<"__builtin_msa_msubv_b">,
   1443   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
   1444   [IntrNoMem]>;
   1445 def int_mips_msubv_h : GCCBuiltin<"__builtin_msa_msubv_h">,
   1446   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
   1447   [IntrNoMem]>;
   1448 def int_mips_msubv_w : GCCBuiltin<"__builtin_msa_msubv_w">,
   1449   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
   1450   [IntrNoMem]>;
   1451 def int_mips_msubv_d : GCCBuiltin<"__builtin_msa_msubv_d">,
   1452   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
   1453   [IntrNoMem]>;
   1454 
   1455 def int_mips_mul_q_h : GCCBuiltin<"__builtin_msa_mul_q_h">,
   1456   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1457 def int_mips_mul_q_w : GCCBuiltin<"__builtin_msa_mul_q_w">,
   1458   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1459 
   1460 def int_mips_mulr_q_h : GCCBuiltin<"__builtin_msa_mulr_q_h">,
   1461   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1462 def int_mips_mulr_q_w : GCCBuiltin<"__builtin_msa_mulr_q_w">,
   1463   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1464 
   1465 def int_mips_mulv_b : GCCBuiltin<"__builtin_msa_mulv_b">,
   1466   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1467 def int_mips_mulv_h : GCCBuiltin<"__builtin_msa_mulv_h">,
   1468   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1469 def int_mips_mulv_w : GCCBuiltin<"__builtin_msa_mulv_w">,
   1470   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1471 def int_mips_mulv_d : GCCBuiltin<"__builtin_msa_mulv_d">,
   1472   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1473 
   1474 def int_mips_nloc_b : GCCBuiltin<"__builtin_msa_nloc_b">,
   1475   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty], [IntrNoMem]>;
   1476 def int_mips_nloc_h : GCCBuiltin<"__builtin_msa_nloc_h">,
   1477   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty], [IntrNoMem]>;
   1478 def int_mips_nloc_w : GCCBuiltin<"__builtin_msa_nloc_w">,
   1479   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
   1480 def int_mips_nloc_d : GCCBuiltin<"__builtin_msa_nloc_d">,
   1481   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty], [IntrNoMem]>;
   1482 
   1483 def int_mips_nlzc_b : GCCBuiltin<"__builtin_msa_nlzc_b">,
   1484   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty], [IntrNoMem]>;
   1485 def int_mips_nlzc_h : GCCBuiltin<"__builtin_msa_nlzc_h">,
   1486   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty], [IntrNoMem]>;
   1487 def int_mips_nlzc_w : GCCBuiltin<"__builtin_msa_nlzc_w">,
   1488   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
   1489 def int_mips_nlzc_d : GCCBuiltin<"__builtin_msa_nlzc_d">,
   1490   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty], [IntrNoMem]>;
   1491 
   1492 def int_mips_nor_v : GCCBuiltin<"__builtin_msa_nor_v">,
   1493   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1494 
   1495 def int_mips_nori_b : GCCBuiltin<"__builtin_msa_nori_b">,
   1496   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1497 
   1498 def int_mips_or_v : GCCBuiltin<"__builtin_msa_or_v">,
   1499   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1500 
   1501 def int_mips_ori_b : GCCBuiltin<"__builtin_msa_ori_b">,
   1502   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1503 
   1504 def int_mips_pckev_b : GCCBuiltin<"__builtin_msa_pckev_b">,
   1505   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1506 def int_mips_pckev_h : GCCBuiltin<"__builtin_msa_pckev_h">,
   1507   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1508 def int_mips_pckev_w : GCCBuiltin<"__builtin_msa_pckev_w">,
   1509   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1510 def int_mips_pckev_d : GCCBuiltin<"__builtin_msa_pckev_d">,
   1511   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1512 
   1513 def int_mips_pckod_b : GCCBuiltin<"__builtin_msa_pckod_b">,
   1514   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1515 def int_mips_pckod_h : GCCBuiltin<"__builtin_msa_pckod_h">,
   1516   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1517 def int_mips_pckod_w : GCCBuiltin<"__builtin_msa_pckod_w">,
   1518   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1519 def int_mips_pckod_d : GCCBuiltin<"__builtin_msa_pckod_d">,
   1520   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1521 
   1522 def int_mips_pcnt_b : GCCBuiltin<"__builtin_msa_pcnt_b">,
   1523   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty], [IntrNoMem]>;
   1524 def int_mips_pcnt_h : GCCBuiltin<"__builtin_msa_pcnt_h">,
   1525   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty], [IntrNoMem]>;
   1526 def int_mips_pcnt_w : GCCBuiltin<"__builtin_msa_pcnt_w">,
   1527   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty], [IntrNoMem]>;
   1528 def int_mips_pcnt_d : GCCBuiltin<"__builtin_msa_pcnt_d">,
   1529   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty], [IntrNoMem]>;
   1530 
   1531 def int_mips_sat_s_b : GCCBuiltin<"__builtin_msa_sat_s_b">,
   1532   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1533 def int_mips_sat_s_h : GCCBuiltin<"__builtin_msa_sat_s_h">,
   1534   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1535 def int_mips_sat_s_w : GCCBuiltin<"__builtin_msa_sat_s_w">,
   1536   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1537 def int_mips_sat_s_d : GCCBuiltin<"__builtin_msa_sat_s_d">,
   1538   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
   1539 
   1540 def int_mips_sat_u_b : GCCBuiltin<"__builtin_msa_sat_u_b">,
   1541   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1542 def int_mips_sat_u_h : GCCBuiltin<"__builtin_msa_sat_u_h">,
   1543   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1544 def int_mips_sat_u_w : GCCBuiltin<"__builtin_msa_sat_u_w">,
   1545   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1546 def int_mips_sat_u_d : GCCBuiltin<"__builtin_msa_sat_u_d">,
   1547   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
   1548 
   1549 def int_mips_shf_b : GCCBuiltin<"__builtin_msa_shf_b">,
   1550   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1551 def int_mips_shf_h : GCCBuiltin<"__builtin_msa_shf_h">,
   1552   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1553 def int_mips_shf_w : GCCBuiltin<"__builtin_msa_shf_w">,
   1554   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1555 
   1556 def int_mips_sld_b : GCCBuiltin<"__builtin_msa_sld_b">,
   1557   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1558 def int_mips_sld_h : GCCBuiltin<"__builtin_msa_sld_h">,
   1559   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1560 def int_mips_sld_w : GCCBuiltin<"__builtin_msa_sld_w">,
   1561   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1562 def int_mips_sld_d : GCCBuiltin<"__builtin_msa_sld_d">,
   1563   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
   1564 
   1565 def int_mips_sldi_b : GCCBuiltin<"__builtin_msa_sldi_b">,
   1566   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty],
   1567             [IntrNoMem]>;
   1568 def int_mips_sldi_h : GCCBuiltin<"__builtin_msa_sldi_h">,
   1569   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_i32_ty],
   1570             [IntrNoMem]>;
   1571 def int_mips_sldi_w : GCCBuiltin<"__builtin_msa_sldi_w">,
   1572   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty],
   1573             [IntrNoMem]>;
   1574 def int_mips_sldi_d : GCCBuiltin<"__builtin_msa_sldi_d">,
   1575   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_i32_ty],
   1576             [IntrNoMem]>;
   1577 
   1578 def int_mips_sll_b : GCCBuiltin<"__builtin_msa_sll_b">,
   1579   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1580 def int_mips_sll_h : GCCBuiltin<"__builtin_msa_sll_h">,
   1581   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1582 def int_mips_sll_w : GCCBuiltin<"__builtin_msa_sll_w">,
   1583   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1584 def int_mips_sll_d : GCCBuiltin<"__builtin_msa_sll_d">,
   1585   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1586 
   1587 def int_mips_slli_b : GCCBuiltin<"__builtin_msa_slli_b">,
   1588   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1589 def int_mips_slli_h : GCCBuiltin<"__builtin_msa_slli_h">,
   1590   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1591 def int_mips_slli_w : GCCBuiltin<"__builtin_msa_slli_w">,
   1592   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1593 def int_mips_slli_d : GCCBuiltin<"__builtin_msa_slli_d">,
   1594   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
   1595 
   1596 def int_mips_splat_b : GCCBuiltin<"__builtin_msa_splat_b">,
   1597   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1598 def int_mips_splat_h : GCCBuiltin<"__builtin_msa_splat_h">,
   1599   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1600 def int_mips_splat_w : GCCBuiltin<"__builtin_msa_splat_w">,
   1601   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1602 def int_mips_splat_d : GCCBuiltin<"__builtin_msa_splat_d">,
   1603   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
   1604 
   1605 def int_mips_splati_b : GCCBuiltin<"__builtin_msa_splati_b">,
   1606   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1607 def int_mips_splati_h : GCCBuiltin<"__builtin_msa_splati_h">,
   1608   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1609 def int_mips_splati_w : GCCBuiltin<"__builtin_msa_splati_w">,
   1610   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1611 def int_mips_splati_d : GCCBuiltin<"__builtin_msa_splati_d">,
   1612   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
   1613 
   1614 def int_mips_sra_b : GCCBuiltin<"__builtin_msa_sra_b">,
   1615   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1616 def int_mips_sra_h : GCCBuiltin<"__builtin_msa_sra_h">,
   1617   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1618 def int_mips_sra_w : GCCBuiltin<"__builtin_msa_sra_w">,
   1619   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1620 def int_mips_sra_d : GCCBuiltin<"__builtin_msa_sra_d">,
   1621   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1622 
   1623 def int_mips_srai_b : GCCBuiltin<"__builtin_msa_srai_b">,
   1624   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1625 def int_mips_srai_h : GCCBuiltin<"__builtin_msa_srai_h">,
   1626   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1627 def int_mips_srai_w : GCCBuiltin<"__builtin_msa_srai_w">,
   1628   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1629 def int_mips_srai_d : GCCBuiltin<"__builtin_msa_srai_d">,
   1630   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
   1631 
   1632 def int_mips_srar_b : GCCBuiltin<"__builtin_msa_srar_b">,
   1633   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1634 def int_mips_srar_h : GCCBuiltin<"__builtin_msa_srar_h">,
   1635   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1636 def int_mips_srar_w : GCCBuiltin<"__builtin_msa_srar_w">,
   1637   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1638 def int_mips_srar_d : GCCBuiltin<"__builtin_msa_srar_d">,
   1639   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1640 
   1641 def int_mips_srari_b : GCCBuiltin<"__builtin_msa_srari_b">,
   1642   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1643 def int_mips_srari_h : GCCBuiltin<"__builtin_msa_srari_h">,
   1644   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1645 def int_mips_srari_w : GCCBuiltin<"__builtin_msa_srari_w">,
   1646   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1647 def int_mips_srari_d : GCCBuiltin<"__builtin_msa_srari_d">,
   1648   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
   1649 
   1650 def int_mips_srl_b : GCCBuiltin<"__builtin_msa_srl_b">,
   1651   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1652 def int_mips_srl_h : GCCBuiltin<"__builtin_msa_srl_h">,
   1653   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1654 def int_mips_srl_w : GCCBuiltin<"__builtin_msa_srl_w">,
   1655   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1656 def int_mips_srl_d : GCCBuiltin<"__builtin_msa_srl_d">,
   1657   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1658 
   1659 def int_mips_srli_b : GCCBuiltin<"__builtin_msa_srli_b">,
   1660   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1661 def int_mips_srli_h : GCCBuiltin<"__builtin_msa_srli_h">,
   1662   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1663 def int_mips_srli_w : GCCBuiltin<"__builtin_msa_srli_w">,
   1664   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1665 def int_mips_srli_d : GCCBuiltin<"__builtin_msa_srli_d">,
   1666   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
   1667 
   1668 def int_mips_srlr_b : GCCBuiltin<"__builtin_msa_srlr_b">,
   1669   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1670 def int_mips_srlr_h : GCCBuiltin<"__builtin_msa_srlr_h">,
   1671   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1672 def int_mips_srlr_w : GCCBuiltin<"__builtin_msa_srlr_w">,
   1673   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1674 def int_mips_srlr_d : GCCBuiltin<"__builtin_msa_srlr_d">,
   1675   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1676 
   1677 def int_mips_srlri_b : GCCBuiltin<"__builtin_msa_srlri_b">,
   1678   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1679 def int_mips_srlri_h : GCCBuiltin<"__builtin_msa_srlri_h">,
   1680   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1681 def int_mips_srlri_w : GCCBuiltin<"__builtin_msa_srlri_w">,
   1682   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1683 def int_mips_srlri_d : GCCBuiltin<"__builtin_msa_srlri_d">,
   1684   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
   1685 
   1686 def int_mips_st_b : GCCBuiltin<"__builtin_msa_st_b">,
   1687   Intrinsic<[], [llvm_v16i8_ty, llvm_ptr_ty, llvm_i32_ty],
   1688   [IntrArgMemOnly]>;
   1689 def int_mips_st_h : GCCBuiltin<"__builtin_msa_st_h">,
   1690   Intrinsic<[], [llvm_v8i16_ty, llvm_ptr_ty, llvm_i32_ty],
   1691   [IntrArgMemOnly]>;
   1692 def int_mips_st_w : GCCBuiltin<"__builtin_msa_st_w">,
   1693   Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty, llvm_i32_ty],
   1694   [IntrArgMemOnly]>;
   1695 def int_mips_st_d : GCCBuiltin<"__builtin_msa_st_d">,
   1696   Intrinsic<[], [llvm_v2i64_ty, llvm_ptr_ty, llvm_i32_ty],
   1697   [IntrArgMemOnly]>;
   1698 
   1699 def int_mips_subs_s_b : GCCBuiltin<"__builtin_msa_subs_s_b">,
   1700   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1701 def int_mips_subs_s_h : GCCBuiltin<"__builtin_msa_subs_s_h">,
   1702   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1703 def int_mips_subs_s_w : GCCBuiltin<"__builtin_msa_subs_s_w">,
   1704   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1705 def int_mips_subs_s_d : GCCBuiltin<"__builtin_msa_subs_s_d">,
   1706   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1707 
   1708 def int_mips_subs_u_b : GCCBuiltin<"__builtin_msa_subs_u_b">,
   1709   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1710 def int_mips_subs_u_h : GCCBuiltin<"__builtin_msa_subs_u_h">,
   1711   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1712 def int_mips_subs_u_w : GCCBuiltin<"__builtin_msa_subs_u_w">,
   1713   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1714 def int_mips_subs_u_d : GCCBuiltin<"__builtin_msa_subs_u_d">,
   1715   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1716 
   1717 def int_mips_subsus_u_b : GCCBuiltin<"__builtin_msa_subsus_u_b">,
   1718   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1719 def int_mips_subsus_u_h : GCCBuiltin<"__builtin_msa_subsus_u_h">,
   1720   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1721 def int_mips_subsus_u_w : GCCBuiltin<"__builtin_msa_subsus_u_w">,
   1722   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1723 def int_mips_subsus_u_d : GCCBuiltin<"__builtin_msa_subsus_u_d">,
   1724   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1725 
   1726 def int_mips_subsuu_s_b : GCCBuiltin<"__builtin_msa_subsuu_s_b">,
   1727   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1728 def int_mips_subsuu_s_h : GCCBuiltin<"__builtin_msa_subsuu_s_h">,
   1729   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1730 def int_mips_subsuu_s_w : GCCBuiltin<"__builtin_msa_subsuu_s_w">,
   1731   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1732 def int_mips_subsuu_s_d : GCCBuiltin<"__builtin_msa_subsuu_s_d">,
   1733   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1734 
   1735 def int_mips_subv_b : GCCBuiltin<"__builtin_msa_subv_b">,
   1736   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1737 def int_mips_subv_h : GCCBuiltin<"__builtin_msa_subv_h">,
   1738   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty], [IntrNoMem]>;
   1739 def int_mips_subv_w : GCCBuiltin<"__builtin_msa_subv_w">,
   1740   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty], [IntrNoMem]>;
   1741 def int_mips_subv_d : GCCBuiltin<"__builtin_msa_subv_d">,
   1742   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty], [IntrNoMem]>;
   1743 
   1744 def int_mips_subvi_b : GCCBuiltin<"__builtin_msa_subvi_b">,
   1745   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1746 def int_mips_subvi_h : GCCBuiltin<"__builtin_msa_subvi_h">,
   1747   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_i32_ty], [IntrNoMem]>;
   1748 def int_mips_subvi_w : GCCBuiltin<"__builtin_msa_subvi_w">,
   1749   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_i32_ty], [IntrNoMem]>;
   1750 def int_mips_subvi_d : GCCBuiltin<"__builtin_msa_subvi_d">,
   1751   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty], [IntrNoMem]>;
   1752 
   1753 def int_mips_vshf_b : GCCBuiltin<"__builtin_msa_vshf_b">,
   1754   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty, llvm_v16i8_ty],
   1755             [IntrNoMem]>;
   1756 def int_mips_vshf_h : GCCBuiltin<"__builtin_msa_vshf_h">,
   1757   Intrinsic<[llvm_v8i16_ty], [llvm_v8i16_ty, llvm_v8i16_ty, llvm_v8i16_ty],
   1758             [IntrNoMem]>;
   1759 def int_mips_vshf_w : GCCBuiltin<"__builtin_msa_vshf_w">,
   1760   Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty, llvm_v4i32_ty],
   1761             [IntrNoMem]>;
   1762 def int_mips_vshf_d : GCCBuiltin<"__builtin_msa_vshf_d">,
   1763   Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty, llvm_v2i64_ty],
   1764             [IntrNoMem]>;
   1765 
   1766 def int_mips_xor_v : GCCBuiltin<"__builtin_msa_xor_v">,
   1767   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_v16i8_ty], [IntrNoMem]>;
   1768 
   1769 def int_mips_xori_b : GCCBuiltin<"__builtin_msa_xori_b">,
   1770   Intrinsic<[llvm_v16i8_ty], [llvm_v16i8_ty, llvm_i32_ty], [IntrNoMem]>;
   1771 }
   1772