Home | History | Annotate | Download | only in Mips
      1 ; RUN: llc -march=mipsel -mcpu=mips32 -mattr=+dsp -verify-machineinstrs < %s | \
      2 ; RUN:     FileCheck %s
      3 
      4 define i32 @test__builtin_mips_extr_w1(i32 %i0, i32, i64 %a0) nounwind {
      5 entry:
      6 ; CHECK: extr.w
      7 
      8   %1 = tail call i32 @llvm.mips.extr.w(i64 %a0, i32 15)
      9   ret i32 %1
     10 }
     11 
     12 declare i32 @llvm.mips.extr.w(i64, i32) nounwind
     13 
     14 define i32 @test__builtin_mips_extr_w2(i32 %i0, i32, i64 %a0, i32 %a1) nounwind {
     15 entry:
     16 ; CHECK: extrv.w
     17 
     18   %1 = tail call i32 @llvm.mips.extr.w(i64 %a0, i32 %a1)
     19   ret i32 %1
     20 }
     21 
     22 define i32 @test__builtin_mips_extr_r_w1(i32 %i0, i32, i64 %a0) nounwind {
     23 entry:
     24 ; CHECK: extr_r.w
     25 
     26   %1 = tail call i32 @llvm.mips.extr.r.w(i64 %a0, i32 15)
     27   ret i32 %1
     28 }
     29 
     30 declare i32 @llvm.mips.extr.r.w(i64, i32) nounwind
     31 
     32 define i32 @test__builtin_mips_extr_s_h1(i32 %i0, i32, i64 %a0, i32 %a1) nounwind {
     33 entry:
     34 ; CHECK: extrv_s.h
     35 
     36   %1 = tail call i32 @llvm.mips.extr.s.h(i64 %a0, i32 %a1)
     37   ret i32 %1
     38 }
     39 
     40 declare i32 @llvm.mips.extr.s.h(i64, i32) nounwind
     41 
     42 define i32 @test__builtin_mips_extr_rs_w1(i32 %i0, i32, i64 %a0) nounwind {
     43 entry:
     44 ; CHECK: extr_rs.w
     45 
     46   %1 = tail call i32 @llvm.mips.extr.rs.w(i64 %a0, i32 15)
     47   ret i32 %1
     48 }
     49 
     50 declare i32 @llvm.mips.extr.rs.w(i64, i32) nounwind
     51 
     52 define i32 @test__builtin_mips_extr_rs_w2(i32 %i0, i32, i64 %a0, i32 %a1) nounwind {
     53 entry:
     54 ; CHECK: extrv_rs.w
     55 
     56   %1 = tail call i32 @llvm.mips.extr.rs.w(i64 %a0, i32 %a1)
     57   ret i32 %1
     58 }
     59 
     60 define i32 @test__builtin_mips_extr_s_h2(i32 %i0, i32, i64 %a0) nounwind {
     61 entry:
     62 ; CHECK: extr_s.h
     63 
     64   %1 = tail call i32 @llvm.mips.extr.s.h(i64 %a0, i32 15)
     65   ret i32 %1
     66 }
     67 
     68 define i32 @test__builtin_mips_extr_r_w2(i32 %i0, i32, i64 %a0, i32 %a1) nounwind {
     69 entry:
     70 ; CHECK: extrv_r.w
     71 
     72   %1 = tail call i32 @llvm.mips.extr.r.w(i64 %a0, i32 %a1)
     73   ret i32 %1
     74 }
     75 
     76 define i32 @test__builtin_mips_extp1(i32 %i0, i32, i64 %a0) nounwind {
     77 entry:
     78 ; CHECK: extp ${{[0-9]+}}
     79 
     80   %1 = tail call i32 @llvm.mips.extp(i64 %a0, i32 15)
     81   ret i32 %1
     82 }
     83 
     84 declare i32 @llvm.mips.extp(i64, i32) nounwind
     85 
     86 define i32 @test__builtin_mips_extp2(i32 %i0, i32, i64 %a0, i32 %a1) nounwind {
     87 entry:
     88 ; CHECK: extpv
     89 
     90   %1 = tail call i32 @llvm.mips.extp(i64 %a0, i32 %a1)
     91   ret i32 %1
     92 }
     93 
     94 define i32 @test__builtin_mips_extpdp1(i32 %i0, i32, i64 %a0) nounwind {
     95 entry:
     96 ; CHECK: extpdp ${{[0-9]+}}
     97 
     98   %1 = tail call i32 @llvm.mips.extpdp(i64 %a0, i32 15)
     99   ret i32 %1
    100 }
    101 
    102 declare i32 @llvm.mips.extpdp(i64, i32) nounwind
    103 
    104 define i32 @test__builtin_mips_extpdp2(i32 %i0, i32, i64 %a0, i32 %a1) nounwind {
    105 entry:
    106 ; CHECK: extpdpv
    107 
    108   %1 = tail call i32 @llvm.mips.extpdp(i64 %a0, i32 %a1)
    109   ret i32 %1
    110 }
    111 
    112 define i64 @test__builtin_mips_dpau_h_qbl1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind readnone {
    113 entry:
    114 ; CHECK: dpau.h.qbl
    115 
    116   %1 = bitcast i32 %a1.coerce to <4 x i8>
    117   %2 = bitcast i32 %a2.coerce to <4 x i8>
    118   %3 = tail call i64 @llvm.mips.dpau.h.qbl(i64 %a0, <4 x i8> %1, <4 x i8> %2)
    119   ret i64 %3
    120 }
    121 
    122 declare i64 @llvm.mips.dpau.h.qbl(i64, <4 x i8>, <4 x i8>) nounwind readnone
    123 
    124 define i64 @test__builtin_mips_dpau_h_qbr1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind readnone {
    125 entry:
    126 ; CHECK: dpau.h.qbr
    127 
    128   %1 = bitcast i32 %a1.coerce to <4 x i8>
    129   %2 = bitcast i32 %a2.coerce to <4 x i8>
    130   %3 = tail call i64 @llvm.mips.dpau.h.qbr(i64 %a0, <4 x i8> %1, <4 x i8> %2)
    131   ret i64 %3
    132 }
    133 
    134 declare i64 @llvm.mips.dpau.h.qbr(i64, <4 x i8>, <4 x i8>) nounwind readnone
    135 
    136 define i64 @test__builtin_mips_dpsu_h_qbl1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind readnone {
    137 entry:
    138 ; CHECK: dpsu.h.qbl
    139 
    140   %1 = bitcast i32 %a1.coerce to <4 x i8>
    141   %2 = bitcast i32 %a2.coerce to <4 x i8>
    142   %3 = tail call i64 @llvm.mips.dpsu.h.qbl(i64 %a0, <4 x i8> %1, <4 x i8> %2)
    143   ret i64 %3
    144 }
    145 
    146 declare i64 @llvm.mips.dpsu.h.qbl(i64, <4 x i8>, <4 x i8>) nounwind readnone
    147 
    148 define i64 @test__builtin_mips_dpsu_h_qbr1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind readnone {
    149 entry:
    150 ; CHECK: dpsu.h.qbr
    151 
    152   %1 = bitcast i32 %a1.coerce to <4 x i8>
    153   %2 = bitcast i32 %a2.coerce to <4 x i8>
    154   %3 = tail call i64 @llvm.mips.dpsu.h.qbr(i64 %a0, <4 x i8> %1, <4 x i8> %2)
    155   ret i64 %3
    156 }
    157 
    158 declare i64 @llvm.mips.dpsu.h.qbr(i64, <4 x i8>, <4 x i8>) nounwind readnone
    159 
    160 define i64 @test__builtin_mips_dpaq_s_w_ph1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind {
    161 entry:
    162 ; CHECK: dpaq_s.w.ph
    163 
    164   %1 = bitcast i32 %a1.coerce to <2 x i16>
    165   %2 = bitcast i32 %a2.coerce to <2 x i16>
    166   %3 = tail call i64 @llvm.mips.dpaq.s.w.ph(i64 %a0, <2 x i16> %1, <2 x i16> %2)
    167   ret i64 %3
    168 }
    169 
    170 declare i64 @llvm.mips.dpaq.s.w.ph(i64, <2 x i16>, <2 x i16>) nounwind
    171 
    172 define i64 @test__builtin_mips_dpaq_sa_l_w1(i32 %i0, i32, i64 %a0, i32 %a1, i32 %a2) nounwind {
    173 entry:
    174 ; CHECK: dpaq_sa.l.w
    175 
    176   %1 = tail call i64 @llvm.mips.dpaq.sa.l.w(i64 %a0, i32 %a1, i32 %a2)
    177   ret i64 %1
    178 }
    179 
    180 declare i64 @llvm.mips.dpaq.sa.l.w(i64, i32, i32) nounwind
    181 
    182 define i64 @test__builtin_mips_dpsq_s_w_ph1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind {
    183 entry:
    184 ; CHECK: dpsq_s.w.ph
    185 
    186   %1 = bitcast i32 %a1.coerce to <2 x i16>
    187   %2 = bitcast i32 %a2.coerce to <2 x i16>
    188   %3 = tail call i64 @llvm.mips.dpsq.s.w.ph(i64 %a0, <2 x i16> %1, <2 x i16> %2)
    189   ret i64 %3
    190 }
    191 
    192 declare i64 @llvm.mips.dpsq.s.w.ph(i64, <2 x i16>, <2 x i16>) nounwind
    193 
    194 define i64 @test__builtin_mips_dpsq_sa_l_w1(i32 %i0, i32, i64 %a0, i32 %a1, i32 %a2) nounwind {
    195 entry:
    196 ; CHECK: dpsq_sa.l.w
    197 
    198   %1 = tail call i64 @llvm.mips.dpsq.sa.l.w(i64 %a0, i32 %a1, i32 %a2)
    199   ret i64 %1
    200 }
    201 
    202 declare i64 @llvm.mips.dpsq.sa.l.w(i64, i32, i32) nounwind
    203 
    204 define i64 @test__builtin_mips_mulsaq_s_w_ph1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind {
    205 entry:
    206 ; CHECK: mulsaq_s.w.ph
    207 
    208   %1 = bitcast i32 %a1.coerce to <2 x i16>
    209   %2 = bitcast i32 %a2.coerce to <2 x i16>
    210   %3 = tail call i64 @llvm.mips.mulsaq.s.w.ph(i64 %a0, <2 x i16> %1, <2 x i16> %2)
    211   ret i64 %3
    212 }
    213 
    214 declare i64 @llvm.mips.mulsaq.s.w.ph(i64, <2 x i16>, <2 x i16>) nounwind
    215 
    216 define i64 @test__builtin_mips_maq_s_w_phl1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind {
    217 entry:
    218 ; CHECK: maq_s.w.phl
    219 
    220   %1 = bitcast i32 %a1.coerce to <2 x i16>
    221   %2 = bitcast i32 %a2.coerce to <2 x i16>
    222   %3 = tail call i64 @llvm.mips.maq.s.w.phl(i64 %a0, <2 x i16> %1, <2 x i16> %2)
    223   ret i64 %3
    224 }
    225 
    226 declare i64 @llvm.mips.maq.s.w.phl(i64, <2 x i16>, <2 x i16>) nounwind
    227 
    228 define i64 @test__builtin_mips_maq_s_w_phr1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind {
    229 entry:
    230 ; CHECK: maq_s.w.phr
    231 
    232   %1 = bitcast i32 %a1.coerce to <2 x i16>
    233   %2 = bitcast i32 %a2.coerce to <2 x i16>
    234   %3 = tail call i64 @llvm.mips.maq.s.w.phr(i64 %a0, <2 x i16> %1, <2 x i16> %2)
    235   ret i64 %3
    236 }
    237 
    238 declare i64 @llvm.mips.maq.s.w.phr(i64, <2 x i16>, <2 x i16>) nounwind
    239 
    240 define i64 @test__builtin_mips_maq_sa_w_phl1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind {
    241 entry:
    242 ; CHECK: maq_sa.w.phl
    243 
    244   %1 = bitcast i32 %a1.coerce to <2 x i16>
    245   %2 = bitcast i32 %a2.coerce to <2 x i16>
    246   %3 = tail call i64 @llvm.mips.maq.sa.w.phl(i64 %a0, <2 x i16> %1, <2 x i16> %2)
    247   ret i64 %3
    248 }
    249 
    250 declare i64 @llvm.mips.maq.sa.w.phl(i64, <2 x i16>, <2 x i16>) nounwind
    251 
    252 define i64 @test__builtin_mips_maq_sa_w_phr1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind {
    253 entry:
    254 ; CHECK: maq_sa.w.phr
    255 
    256   %1 = bitcast i32 %a1.coerce to <2 x i16>
    257   %2 = bitcast i32 %a2.coerce to <2 x i16>
    258   %3 = tail call i64 @llvm.mips.maq.sa.w.phr(i64 %a0, <2 x i16> %1, <2 x i16> %2)
    259   ret i64 %3
    260 }
    261 
    262 declare i64 @llvm.mips.maq.sa.w.phr(i64, <2 x i16>, <2 x i16>) nounwind
    263 
    264 define i64 @test__builtin_mips_shilo1(i32 %i0, i32, i64 %a0) nounwind readnone {
    265 entry:
    266 ; CHECK: shilo $ac{{[0-9]}}
    267 
    268   %1 = tail call i64 @llvm.mips.shilo(i64 %a0, i32 0)
    269   ret i64 %1
    270 }
    271 
    272 declare i64 @llvm.mips.shilo(i64, i32) nounwind readnone
    273 
    274 define i64 @test__builtin_mips_shilo2(i32 %i0, i32, i64 %a0, i32 %a1) nounwind readnone {
    275 entry:
    276 ; CHECK: shilov
    277 
    278   %1 = tail call i64 @llvm.mips.shilo(i64 %a0, i32 %a1)
    279   ret i64 %1
    280 }
    281 
    282 define i64 @test__builtin_mips_mthlip1(i32 %i0, i32, i64 %a0, i32 %a1) nounwind {
    283 entry:
    284 ; CHECK: mthlip ${{[0-9]+}}
    285 
    286   %1 = tail call i64 @llvm.mips.mthlip(i64 %a0, i32 %a1)
    287   ret i64 %1
    288 }
    289 
    290 declare i64 @llvm.mips.mthlip(i64, i32) nounwind
    291 
    292 define i32 @test__builtin_mips_bposge321(i32 %i0) nounwind readonly {
    293 entry:
    294 ; CHECK: bposge32 $BB{{[0-9]+}}
    295 
    296   %0 = tail call i32 @llvm.mips.bposge32()
    297   ret i32 %0
    298 }
    299 
    300 declare i32 @llvm.mips.bposge32() nounwind readonly
    301 
    302 define i64 @test__builtin_mips_madd1(i32 %i0, i32, i64 %a0, i32 %a1, i32 %a2) nounwind readnone {
    303 entry:
    304 ; CHECK: madd $ac{{[0-9]}}
    305 
    306   %1 = tail call i64 @llvm.mips.madd(i64 %a0, i32 %a1, i32 %a2)
    307   ret i64 %1
    308 }
    309 
    310 declare i64 @llvm.mips.madd(i64, i32, i32) nounwind readnone
    311 
    312 define i64 @test__builtin_mips_maddu1(i32 %i0, i32, i64 %a0, i32 %a1, i32 %a2) nounwind readnone {
    313 entry:
    314 ; CHECK: maddu $ac{{[0-9]}}
    315 
    316   %1 = tail call i64 @llvm.mips.maddu(i64 %a0, i32 %a1, i32 %a2)
    317   ret i64 %1
    318 }
    319 
    320 declare i64 @llvm.mips.maddu(i64, i32, i32) nounwind readnone
    321 
    322 define i64 @test__builtin_mips_msub1(i32 %i0, i32, i64 %a0, i32 %a1, i32 %a2) nounwind readnone {
    323 entry:
    324 ; CHECK: msub $ac{{[0-9]}}
    325 
    326   %1 = tail call i64 @llvm.mips.msub(i64 %a0, i32 %a1, i32 %a2)
    327   ret i64 %1
    328 }
    329 
    330 declare i64 @llvm.mips.msub(i64, i32, i32) nounwind readnone
    331 
    332 define i64 @test__builtin_mips_msubu1(i32 %i0, i32, i64 %a0, i32 %a1, i32 %a2) nounwind readnone {
    333 entry:
    334 ; CHECK: msubu $ac{{[0-9]}}
    335 
    336   %1 = tail call i64 @llvm.mips.msubu(i64 %a0, i32 %a1, i32 %a2)
    337   ret i64 %1
    338 }
    339 
    340 declare i64 @llvm.mips.msubu(i64, i32, i32) nounwind readnone
    341 
    342 define i64 @test__builtin_mips_mult1(i32 %i0, i32 %a0, i32 %a1) nounwind readnone {
    343 entry:
    344 ; CHECK: mult $ac{{[0-9]}}
    345 
    346   %0 = tail call i64 @llvm.mips.mult(i32 %a0, i32 %a1)
    347   ret i64 %0
    348 }
    349 
    350 declare i64 @llvm.mips.mult(i32, i32) nounwind readnone
    351 
    352 define i64 @test__builtin_mips_multu1(i32 %i0, i32 %a0, i32 %a1) nounwind readnone {
    353 entry:
    354 ; CHECK: multu $ac{{[0-9]}}
    355 
    356   %0 = tail call i64 @llvm.mips.multu(i32 %a0, i32 %a1)
    357   ret i64 %0
    358 }
    359 
    360 declare i64 @llvm.mips.multu(i32, i32) nounwind readnone
    361 
    362 define { i32 } @test__builtin_mips_addq_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    363 entry:
    364 ; CHECK: addq.ph
    365 
    366   %0 = bitcast i32 %a0.coerce to <2 x i16>
    367   %1 = bitcast i32 %a1.coerce to <2 x i16>
    368   %2 = tail call <2 x i16> @llvm.mips.addq.ph(<2 x i16> %0, <2 x i16> %1)
    369   %3 = bitcast <2 x i16> %2 to i32
    370   %.fca.0.insert = insertvalue { i32 } undef, i32 %3, 0
    371   ret { i32 } %.fca.0.insert
    372 }
    373 
    374 declare <2 x i16> @llvm.mips.addq.ph(<2 x i16>, <2 x i16>) nounwind
    375 
    376 define { i32 } @test__builtin_mips_addq_s_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    377 entry:
    378 ; CHECK: addq_s.ph
    379 
    380   %0 = bitcast i32 %a0.coerce to <2 x i16>
    381   %1 = bitcast i32 %a1.coerce to <2 x i16>
    382   %2 = tail call <2 x i16> @llvm.mips.addq.s.ph(<2 x i16> %0, <2 x i16> %1)
    383   %3 = bitcast <2 x i16> %2 to i32
    384   %.fca.0.insert = insertvalue { i32 } undef, i32 %3, 0
    385   ret { i32 } %.fca.0.insert
    386 }
    387 
    388 declare <2 x i16> @llvm.mips.addq.s.ph(<2 x i16>, <2 x i16>) nounwind
    389 
    390 define i32 @test__builtin_mips_addq_s_w1(i32 %i0, i32 %a0, i32 %a1) nounwind {
    391 entry:
    392 ; CHECK: addq_s.w
    393 
    394   %0 = tail call i32 @llvm.mips.addq.s.w(i32 %a0, i32 %a1)
    395   ret i32 %0
    396 }
    397 
    398 declare i32 @llvm.mips.addq.s.w(i32, i32) nounwind
    399 
    400 define { i32 } @test__builtin_mips_addu_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    401 entry:
    402 ; CHECK: addu.qb
    403 
    404   %0 = bitcast i32 %a0.coerce to <4 x i8>
    405   %1 = bitcast i32 %a1.coerce to <4 x i8>
    406   %2 = tail call <4 x i8> @llvm.mips.addu.qb(<4 x i8> %0, <4 x i8> %1)
    407   %3 = bitcast <4 x i8> %2 to i32
    408   %.fca.0.insert = insertvalue { i32 } undef, i32 %3, 0
    409   ret { i32 } %.fca.0.insert
    410 }
    411 
    412 declare <4 x i8> @llvm.mips.addu.qb(<4 x i8>, <4 x i8>) nounwind
    413 
    414 define { i32 } @test__builtin_mips_addu_s_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    415 entry:
    416 ; CHECK: addu_s.qb
    417 
    418   %0 = bitcast i32 %a0.coerce to <4 x i8>
    419   %1 = bitcast i32 %a1.coerce to <4 x i8>
    420   %2 = tail call <4 x i8> @llvm.mips.addu.s.qb(<4 x i8> %0, <4 x i8> %1)
    421   %3 = bitcast <4 x i8> %2 to i32
    422   %.fca.0.insert = insertvalue { i32 } undef, i32 %3, 0
    423   ret { i32 } %.fca.0.insert
    424 }
    425 
    426 declare <4 x i8> @llvm.mips.addu.s.qb(<4 x i8>, <4 x i8>) nounwind
    427 
    428 define { i32 } @test__builtin_mips_subq_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    429 entry:
    430 ; CHECK: subq.ph
    431 
    432   %0 = bitcast i32 %a0.coerce to <2 x i16>
    433   %1 = bitcast i32 %a1.coerce to <2 x i16>
    434   %2 = tail call <2 x i16> @llvm.mips.subq.ph(<2 x i16> %0, <2 x i16> %1)
    435   %3 = bitcast <2 x i16> %2 to i32
    436   %.fca.0.insert = insertvalue { i32 } undef, i32 %3, 0
    437   ret { i32 } %.fca.0.insert
    438 }
    439 
    440 declare <2 x i16> @llvm.mips.subq.ph(<2 x i16>, <2 x i16>) nounwind
    441 
    442 define { i32 } @test__builtin_mips_subq_s_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    443 entry:
    444 ; CHECK: subq_s.ph
    445 
    446   %0 = bitcast i32 %a0.coerce to <2 x i16>
    447   %1 = bitcast i32 %a1.coerce to <2 x i16>
    448   %2 = tail call <2 x i16> @llvm.mips.subq.s.ph(<2 x i16> %0, <2 x i16> %1)
    449   %3 = bitcast <2 x i16> %2 to i32
    450   %.fca.0.insert = insertvalue { i32 } undef, i32 %3, 0
    451   ret { i32 } %.fca.0.insert
    452 }
    453 
    454 declare <2 x i16> @llvm.mips.subq.s.ph(<2 x i16>, <2 x i16>) nounwind
    455 
    456 define i32 @test__builtin_mips_subq_s_w1(i32 %i0, i32 %a0, i32 %a1) nounwind {
    457 entry:
    458 ; CHECK: subq_s.w
    459 
    460   %0 = tail call i32 @llvm.mips.subq.s.w(i32 %a0, i32 %a1)
    461   ret i32 %0
    462 }
    463 
    464 declare i32 @llvm.mips.subq.s.w(i32, i32) nounwind
    465 
    466 define { i32 } @test__builtin_mips_subu_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    467 entry:
    468 ; CHECK: subu.qb
    469 
    470   %0 = bitcast i32 %a0.coerce to <4 x i8>
    471   %1 = bitcast i32 %a1.coerce to <4 x i8>
    472   %2 = tail call <4 x i8> @llvm.mips.subu.qb(<4 x i8> %0, <4 x i8> %1)
    473   %3 = bitcast <4 x i8> %2 to i32
    474   %.fca.0.insert = insertvalue { i32 } undef, i32 %3, 0
    475   ret { i32 } %.fca.0.insert
    476 }
    477 
    478 declare <4 x i8> @llvm.mips.subu.qb(<4 x i8>, <4 x i8>) nounwind
    479 
    480 define { i32 } @test__builtin_mips_subu_s_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    481 entry:
    482 ; CHECK: subu_s.qb
    483 
    484   %0 = bitcast i32 %a0.coerce to <4 x i8>
    485   %1 = bitcast i32 %a1.coerce to <4 x i8>
    486   %2 = tail call <4 x i8> @llvm.mips.subu.s.qb(<4 x i8> %0, <4 x i8> %1)
    487   %3 = bitcast <4 x i8> %2 to i32
    488   %.fca.0.insert = insertvalue { i32 } undef, i32 %3, 0
    489   ret { i32 } %.fca.0.insert
    490 }
    491 
    492 declare <4 x i8> @llvm.mips.subu.s.qb(<4 x i8>, <4 x i8>) nounwind
    493 
    494 define i32 @test__builtin_mips_addsc1(i32 %i0, i32 %a0, i32 %a1) nounwind {
    495 entry:
    496 ; CHECK: addsc ${{[0-9]+}}
    497 
    498   %0 = tail call i32 @llvm.mips.addsc(i32 %a0, i32 %a1)
    499   ret i32 %0
    500 }
    501 
    502 declare i32 @llvm.mips.addsc(i32, i32) nounwind
    503 
    504 define i32 @test__builtin_mips_addwc1(i32 %i0, i32 %a0, i32 %a1) nounwind {
    505 entry:
    506 ; CHECK: addwc ${{[0-9]+}}
    507 
    508   %0 = tail call i32 @llvm.mips.addwc(i32 %a0, i32 %a1)
    509   ret i32 %0
    510 }
    511 
    512 declare i32 @llvm.mips.addwc(i32, i32) nounwind
    513 
    514 define i32 @test__builtin_mips_modsub1(i32 %i0, i32 %a0, i32 %a1) nounwind readnone {
    515 entry:
    516 ; CHECK: modsub ${{[0-9]+}}
    517 
    518   %0 = tail call i32 @llvm.mips.modsub(i32 %a0, i32 %a1)
    519   ret i32 %0
    520 }
    521 
    522 declare i32 @llvm.mips.modsub(i32, i32) nounwind readnone
    523 
    524 define i32 @test__builtin_mips_raddu_w_qb1(i32 %i0, i32 %a0.coerce) nounwind readnone {
    525 entry:
    526 ; CHECK: raddu.w.qb
    527 
    528   %0 = bitcast i32 %a0.coerce to <4 x i8>
    529   %1 = tail call i32 @llvm.mips.raddu.w.qb(<4 x i8> %0)
    530   ret i32 %1
    531 }
    532 
    533 declare i32 @llvm.mips.raddu.w.qb(<4 x i8>) nounwind readnone
    534 
    535 define { i32 } @test__builtin_mips_muleu_s_ph_qbl1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    536 entry:
    537 ; CHECK: muleu_s.ph.qbl
    538 
    539   %0 = bitcast i32 %a0.coerce to <4 x i8>
    540   %1 = bitcast i32 %a1.coerce to <2 x i16>
    541   %2 = tail call <2 x i16> @llvm.mips.muleu.s.ph.qbl(<4 x i8> %0, <2 x i16> %1)
    542   %3 = bitcast <2 x i16> %2 to i32
    543   %.fca.0.insert = insertvalue { i32 } undef, i32 %3, 0
    544   ret { i32 } %.fca.0.insert
    545 }
    546 
    547 declare <2 x i16> @llvm.mips.muleu.s.ph.qbl(<4 x i8>, <2 x i16>) nounwind
    548 
    549 define { i32 } @test__builtin_mips_muleu_s_ph_qbr1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    550 entry:
    551 ; CHECK: muleu_s.ph.qbr
    552 
    553   %0 = bitcast i32 %a0.coerce to <4 x i8>
    554   %1 = bitcast i32 %a1.coerce to <2 x i16>
    555   %2 = tail call <2 x i16> @llvm.mips.muleu.s.ph.qbr(<4 x i8> %0, <2 x i16> %1)
    556   %3 = bitcast <2 x i16> %2 to i32
    557   %.fca.0.insert = insertvalue { i32 } undef, i32 %3, 0
    558   ret { i32 } %.fca.0.insert
    559 }
    560 
    561 declare <2 x i16> @llvm.mips.muleu.s.ph.qbr(<4 x i8>, <2 x i16>) nounwind
    562 
    563 define { i32 } @test__builtin_mips_mulq_rs_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    564 entry:
    565 ; CHECK: mulq_rs.ph
    566 
    567   %0 = bitcast i32 %a0.coerce to <2 x i16>
    568   %1 = bitcast i32 %a1.coerce to <2 x i16>
    569   %2 = tail call <2 x i16> @llvm.mips.mulq.rs.ph(<2 x i16> %0, <2 x i16> %1)
    570   %3 = bitcast <2 x i16> %2 to i32
    571   %.fca.0.insert = insertvalue { i32 } undef, i32 %3, 0
    572   ret { i32 } %.fca.0.insert
    573 }
    574 
    575 declare <2 x i16> @llvm.mips.mulq.rs.ph(<2 x i16>, <2 x i16>) nounwind
    576 
    577 define i32 @test__builtin_mips_muleq_s_w_phl1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    578 entry:
    579 ; CHECK: muleq_s.w.phl
    580 
    581   %0 = bitcast i32 %a0.coerce to <2 x i16>
    582   %1 = bitcast i32 %a1.coerce to <2 x i16>
    583   %2 = tail call i32 @llvm.mips.muleq.s.w.phl(<2 x i16> %0, <2 x i16> %1)
    584   ret i32 %2
    585 }
    586 
    587 declare i32 @llvm.mips.muleq.s.w.phl(<2 x i16>, <2 x i16>) nounwind
    588 
    589 define i32 @test__builtin_mips_muleq_s_w_phr1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    590 entry:
    591 ; CHECK: muleq_s.w.phr
    592 
    593   %0 = bitcast i32 %a0.coerce to <2 x i16>
    594   %1 = bitcast i32 %a1.coerce to <2 x i16>
    595   %2 = tail call i32 @llvm.mips.muleq.s.w.phr(<2 x i16> %0, <2 x i16> %1)
    596   ret i32 %2
    597 }
    598 
    599 declare i32 @llvm.mips.muleq.s.w.phr(<2 x i16>, <2 x i16>) nounwind
    600 
    601 define { i32 } @test__builtin_mips_precrq_qb_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind readnone {
    602 entry:
    603 ; CHECK: precrq.qb.ph
    604 
    605   %0 = bitcast i32 %a0.coerce to <2 x i16>
    606   %1 = bitcast i32 %a1.coerce to <2 x i16>
    607   %2 = tail call <4 x i8> @llvm.mips.precrq.qb.ph(<2 x i16> %0, <2 x i16> %1)
    608   %3 = bitcast <4 x i8> %2 to i32
    609   %.fca.0.insert = insertvalue { i32 } undef, i32 %3, 0
    610   ret { i32 } %.fca.0.insert
    611 }
    612 
    613 declare <4 x i8> @llvm.mips.precrq.qb.ph(<2 x i16>, <2 x i16>) nounwind readnone
    614 
    615 define { i32 } @test__builtin_mips_precrq_ph_w1(i32 %i0, i32 %a0, i32 %a1) nounwind readnone {
    616 entry:
    617 ; CHECK: precrq.ph.w
    618 
    619   %0 = tail call <2 x i16> @llvm.mips.precrq.ph.w(i32 %a0, i32 %a1)
    620   %1 = bitcast <2 x i16> %0 to i32
    621   %.fca.0.insert = insertvalue { i32 } undef, i32 %1, 0
    622   ret { i32 } %.fca.0.insert
    623 }
    624 
    625 declare <2 x i16> @llvm.mips.precrq.ph.w(i32, i32) nounwind readnone
    626 
    627 define { i32 } @test__builtin_mips_precrq_rs_ph_w1(i32 %i0, i32 %a0, i32 %a1) nounwind {
    628 entry:
    629 ; CHECK: precrq_rs.ph.w
    630 
    631   %0 = tail call <2 x i16> @llvm.mips.precrq.rs.ph.w(i32 %a0, i32 %a1)
    632   %1 = bitcast <2 x i16> %0 to i32
    633   %.fca.0.insert = insertvalue { i32 } undef, i32 %1, 0
    634   ret { i32 } %.fca.0.insert
    635 }
    636 
    637 declare <2 x i16> @llvm.mips.precrq.rs.ph.w(i32, i32) nounwind
    638 
    639 define { i32 } @test__builtin_mips_precrqu_s_qb_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    640 entry:
    641 ; CHECK: precrqu_s.qb.ph
    642 
    643   %0 = bitcast i32 %a0.coerce to <2 x i16>
    644   %1 = bitcast i32 %a1.coerce to <2 x i16>
    645   %2 = tail call <4 x i8> @llvm.mips.precrqu.s.qb.ph(<2 x i16> %0, <2 x i16> %1)
    646   %3 = bitcast <4 x i8> %2 to i32
    647   %.fca.0.insert = insertvalue { i32 } undef, i32 %3, 0
    648   ret { i32 } %.fca.0.insert
    649 }
    650 
    651 declare <4 x i8> @llvm.mips.precrqu.s.qb.ph(<2 x i16>, <2 x i16>) nounwind
    652 
    653 
    654 define i32 @test__builtin_mips_cmpu_eq_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    655 entry:
    656 ; CHECK: cmpu.eq.qb
    657 
    658   %0 = bitcast i32 %a0.coerce to <4 x i8>
    659   %1 = bitcast i32 %a1.coerce to <4 x i8>
    660   tail call void @llvm.mips.cmpu.eq.qb(<4 x i8> %0, <4 x i8> %1)
    661   %2 = tail call i32 @llvm.mips.rddsp(i32 31)
    662   ret i32 %2
    663 }
    664 
    665 declare void @llvm.mips.cmpu.eq.qb(<4 x i8>, <4 x i8>) nounwind
    666 
    667 declare i32 @llvm.mips.rddsp(i32) nounwind readonly
    668 
    669 define i32 @test__builtin_mips_cmpu_lt_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    670 entry:
    671 ; CHECK: cmpu.lt.qb
    672 
    673   %0 = bitcast i32 %a0.coerce to <4 x i8>
    674   %1 = bitcast i32 %a1.coerce to <4 x i8>
    675   tail call void @llvm.mips.cmpu.lt.qb(<4 x i8> %0, <4 x i8> %1)
    676   %2 = tail call i32 @llvm.mips.rddsp(i32 31)
    677   ret i32 %2
    678 }
    679 
    680 declare void @llvm.mips.cmpu.lt.qb(<4 x i8>, <4 x i8>) nounwind
    681 
    682 define i32 @test__builtin_mips_cmpu_le_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    683 entry:
    684 ; CHECK: cmpu.le.qb
    685 
    686   %0 = bitcast i32 %a0.coerce to <4 x i8>
    687   %1 = bitcast i32 %a1.coerce to <4 x i8>
    688   tail call void @llvm.mips.cmpu.le.qb(<4 x i8> %0, <4 x i8> %1)
    689   %2 = tail call i32 @llvm.mips.rddsp(i32 31)
    690   ret i32 %2
    691 }
    692 
    693 declare void @llvm.mips.cmpu.le.qb(<4 x i8>, <4 x i8>) nounwind
    694 
    695 define i32 @test__builtin_mips_cmpgu_eq_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    696 entry:
    697 ; CHECK: cmpgu.eq.qb
    698 
    699   %0 = bitcast i32 %a0.coerce to <4 x i8>
    700   %1 = bitcast i32 %a1.coerce to <4 x i8>
    701   %2 = tail call i32 @llvm.mips.cmpgu.eq.qb(<4 x i8> %0, <4 x i8> %1)
    702   ret i32 %2
    703 }
    704 
    705 declare i32 @llvm.mips.cmpgu.eq.qb(<4 x i8>, <4 x i8>) nounwind
    706 
    707 define i32 @test__builtin_mips_cmpgu_lt_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    708 entry:
    709 ; CHECK: cmpgu.lt.qb
    710 
    711   %0 = bitcast i32 %a0.coerce to <4 x i8>
    712   %1 = bitcast i32 %a1.coerce to <4 x i8>
    713   %2 = tail call i32 @llvm.mips.cmpgu.lt.qb(<4 x i8> %0, <4 x i8> %1)
    714   ret i32 %2
    715 }
    716 
    717 declare i32 @llvm.mips.cmpgu.lt.qb(<4 x i8>, <4 x i8>) nounwind
    718 
    719 define i32 @test__builtin_mips_cmpgu_le_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    720 entry:
    721 ; CHECK: cmpgu.le.qb
    722 
    723   %0 = bitcast i32 %a0.coerce to <4 x i8>
    724   %1 = bitcast i32 %a1.coerce to <4 x i8>
    725   %2 = tail call i32 @llvm.mips.cmpgu.le.qb(<4 x i8> %0, <4 x i8> %1)
    726   ret i32 %2
    727 }
    728 
    729 declare i32 @llvm.mips.cmpgu.le.qb(<4 x i8>, <4 x i8>) nounwind
    730 
    731 define i32 @test__builtin_mips_cmp_eq_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    732 entry:
    733 ; CHECK: cmp.eq.ph
    734 
    735   %0 = bitcast i32 %a0.coerce to <2 x i16>
    736   %1 = bitcast i32 %a1.coerce to <2 x i16>
    737   tail call void @llvm.mips.cmp.eq.ph(<2 x i16> %0, <2 x i16> %1)
    738   %2 = tail call i32 @llvm.mips.rddsp(i32 31)
    739   ret i32 %2
    740 }
    741 
    742 declare void @llvm.mips.cmp.eq.ph(<2 x i16>, <2 x i16>) nounwind
    743 
    744 define i32 @test__builtin_mips_cmp_lt_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    745 entry:
    746 ; CHECK: cmp.lt.ph
    747 
    748   %0 = bitcast i32 %a0.coerce to <2 x i16>
    749   %1 = bitcast i32 %a1.coerce to <2 x i16>
    750   tail call void @llvm.mips.cmp.lt.ph(<2 x i16> %0, <2 x i16> %1)
    751   %2 = tail call i32 @llvm.mips.rddsp(i32 31)
    752   ret i32 %2
    753 }
    754 
    755 declare void @llvm.mips.cmp.lt.ph(<2 x i16>, <2 x i16>) nounwind
    756 
    757 define i32 @test__builtin_mips_cmp_le_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind {
    758 entry:
    759 ; CHECK: cmp.le.ph
    760 
    761   %0 = bitcast i32 %a0.coerce to <2 x i16>
    762   %1 = bitcast i32 %a1.coerce to <2 x i16>
    763   tail call void @llvm.mips.cmp.le.ph(<2 x i16> %0, <2 x i16> %1)
    764   %2 = tail call i32 @llvm.mips.rddsp(i32 31)
    765   ret i32 %2
    766 }
    767 
    768 declare void @llvm.mips.cmp.le.ph(<2 x i16>, <2 x i16>) nounwind
    769 
    770 define { i32 } @test__builtin_mips_pick_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind readonly {
    771 entry:
    772 ; CHECK: pick.qb
    773 
    774   %0 = bitcast i32 %a0.coerce to <4 x i8>
    775   %1 = bitcast i32 %a1.coerce to <4 x i8>
    776   tail call void @llvm.mips.wrdsp(i32 %i0, i32 16)
    777   %2 = tail call <4 x i8> @llvm.mips.pick.qb(<4 x i8> %0, <4 x i8> %1)
    778   %3 = bitcast <4 x i8> %2 to i32
    779   %.fca.0.insert = insertvalue { i32 } undef, i32 %3, 0
    780   ret { i32 } %.fca.0.insert
    781 }
    782 
    783 declare <4 x i8> @llvm.mips.pick.qb(<4 x i8>, <4 x i8>) nounwind readonly
    784 
    785 define { i32 } @test__builtin_mips_pick_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind readonly {
    786 entry:
    787 ; CHECK: pick.ph
    788 
    789   %0 = bitcast i32 %a0.coerce to <2 x i16>
    790   %1 = bitcast i32 %a1.coerce to <2 x i16>
    791   tail call void @llvm.mips.wrdsp(i32 %i0, i32 16)
    792   %2 = tail call <2 x i16> @llvm.mips.pick.ph(<2 x i16> %0, <2 x i16> %1)
    793   %3 = bitcast <2 x i16> %2 to i32
    794   %.fca.0.insert = insertvalue { i32 } undef, i32 %3, 0
    795   ret { i32 } %.fca.0.insert
    796 }
    797 
    798 declare <2 x i16> @llvm.mips.pick.ph(<2 x i16>, <2 x i16>) nounwind readonly
    799 
    800 define { i32 } @test__builtin_mips_packrl_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind readnone {
    801 entry:
    802 ; CHECK: packrl.ph
    803 
    804   %0 = bitcast i32 %a0.coerce to <2 x i16>
    805   %1 = bitcast i32 %a1.coerce to <2 x i16>
    806   %2 = tail call <2 x i16> @llvm.mips.packrl.ph(<2 x i16> %0, <2 x i16> %1)
    807   %3 = bitcast <2 x i16> %2 to i32
    808   %.fca.0.insert = insertvalue { i32 } undef, i32 %3, 0
    809   ret { i32 } %.fca.0.insert
    810 }
    811 
    812 declare <2 x i16> @llvm.mips.packrl.ph(<2 x i16>, <2 x i16>) nounwind readnone
    813 
    814 define { i32 } @test__builtin_mips_shll_qb1(i32 %i0, i32 %a0.coerce) nounwind {
    815 entry:
    816 ; CHECK: shll.qb
    817 
    818   %0 = bitcast i32 %a0.coerce to <4 x i8>
    819   %1 = tail call <4 x i8> @llvm.mips.shll.qb(<4 x i8> %0, i32 3)
    820   %2 = bitcast <4 x i8> %1 to i32
    821   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
    822   ret { i32 } %.fca.0.insert
    823 }
    824 
    825 declare <4 x i8> @llvm.mips.shll.qb(<4 x i8>, i32) nounwind
    826 
    827 define { i32 } @test__builtin_mips_shll_qb2(i32 %i0, i32 %a0.coerce, i32 %a1) nounwind {
    828 entry:
    829 ; CHECK: shllv.qb
    830 
    831   %0 = bitcast i32 %a0.coerce to <4 x i8>
    832   %1 = tail call <4 x i8> @llvm.mips.shll.qb(<4 x i8> %0, i32 %a1)
    833   %2 = bitcast <4 x i8> %1 to i32
    834   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
    835   ret { i32 } %.fca.0.insert
    836 }
    837 
    838 define { i32 } @test__builtin_mips_shll_ph1(i32 %i0, i32 %a0.coerce) nounwind {
    839 entry:
    840 ; CHECK: shll.ph
    841 
    842   %0 = bitcast i32 %a0.coerce to <2 x i16>
    843   %1 = tail call <2 x i16> @llvm.mips.shll.ph(<2 x i16> %0, i32 7)
    844   %2 = bitcast <2 x i16> %1 to i32
    845   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
    846   ret { i32 } %.fca.0.insert
    847 }
    848 
    849 declare <2 x i16> @llvm.mips.shll.ph(<2 x i16>, i32) nounwind
    850 
    851 define { i32 } @test__builtin_mips_shll_ph2(i32 %i0, i32 %a0.coerce, i32 %a1) nounwind {
    852 entry:
    853 ; CHECK: shllv.ph
    854 
    855   %0 = bitcast i32 %a0.coerce to <2 x i16>
    856   %1 = tail call <2 x i16> @llvm.mips.shll.ph(<2 x i16> %0, i32 %a1)
    857   %2 = bitcast <2 x i16> %1 to i32
    858   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
    859   ret { i32 } %.fca.0.insert
    860 }
    861 
    862 define { i32 } @test__builtin_mips_shll_s_ph1(i32 %i0, i32 %a0.coerce) nounwind {
    863 entry:
    864 ; CHECK: shll_s.ph
    865 
    866   %0 = bitcast i32 %a0.coerce to <2 x i16>
    867   %1 = tail call <2 x i16> @llvm.mips.shll.s.ph(<2 x i16> %0, i32 7)
    868   %2 = bitcast <2 x i16> %1 to i32
    869   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
    870   ret { i32 } %.fca.0.insert
    871 }
    872 
    873 declare <2 x i16> @llvm.mips.shll.s.ph(<2 x i16>, i32) nounwind
    874 
    875 define { i32 } @test__builtin_mips_shll_s_ph2(i32 %i0, i32 %a0.coerce, i32 %a1) nounwind {
    876 entry:
    877 ; CHECK: shllv_s.ph
    878 
    879   %0 = bitcast i32 %a0.coerce to <2 x i16>
    880   %1 = tail call <2 x i16> @llvm.mips.shll.s.ph(<2 x i16> %0, i32 %a1)
    881   %2 = bitcast <2 x i16> %1 to i32
    882   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
    883   ret { i32 } %.fca.0.insert
    884 }
    885 
    886 define i32 @test__builtin_mips_shll_s_w1(i32 %i0, i32 %a0) nounwind {
    887 entry:
    888 ; CHECK: shll_s.w
    889 
    890   %0 = tail call i32 @llvm.mips.shll.s.w(i32 %a0, i32 15)
    891   ret i32 %0
    892 }
    893 
    894 declare i32 @llvm.mips.shll.s.w(i32, i32) nounwind
    895 
    896 define i32 @test__builtin_mips_shll_s_w2(i32 %i0, i32 %a0, i32 %a1) nounwind {
    897 entry:
    898 ; CHECK: shllv_s.w
    899 
    900   %0 = tail call i32 @llvm.mips.shll.s.w(i32 %a0, i32 %a1)
    901   ret i32 %0
    902 }
    903 
    904 define { i32 } @test__builtin_mips_shrl_qb1(i32 %i0, i32 %a0.coerce) nounwind readnone {
    905 entry:
    906 ; CHECK: shrl.qb
    907 
    908   %0 = bitcast i32 %a0.coerce to <4 x i8>
    909   %1 = tail call <4 x i8> @llvm.mips.shrl.qb(<4 x i8> %0, i32 3)
    910   %2 = bitcast <4 x i8> %1 to i32
    911   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
    912   ret { i32 } %.fca.0.insert
    913 }
    914 
    915 declare <4 x i8> @llvm.mips.shrl.qb(<4 x i8>, i32) nounwind readnone
    916 
    917 define { i32 } @test__builtin_mips_shrl_qb2(i32 %i0, i32 %a0.coerce, i32 %a1) nounwind readnone {
    918 entry:
    919 ; CHECK: shrlv.qb
    920 
    921   %0 = bitcast i32 %a0.coerce to <4 x i8>
    922   %1 = tail call <4 x i8> @llvm.mips.shrl.qb(<4 x i8> %0, i32 %a1)
    923   %2 = bitcast <4 x i8> %1 to i32
    924   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
    925   ret { i32 } %.fca.0.insert
    926 }
    927 
    928 define { i32 } @test__builtin_mips_shra_ph1(i32 %i0, i32 %a0.coerce) nounwind readnone {
    929 entry:
    930 ; CHECK: shra.ph
    931 
    932   %0 = bitcast i32 %a0.coerce to <2 x i16>
    933   %1 = tail call <2 x i16> @llvm.mips.shra.ph(<2 x i16> %0, i32 7)
    934   %2 = bitcast <2 x i16> %1 to i32
    935   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
    936   ret { i32 } %.fca.0.insert
    937 }
    938 
    939 declare <2 x i16> @llvm.mips.shra.ph(<2 x i16>, i32) nounwind readnone
    940 
    941 define { i32 } @test__builtin_mips_shra_ph2(i32 %i0, i32 %a0.coerce, i32 %a1) nounwind readnone {
    942 entry:
    943 ; CHECK: shrav.ph
    944 
    945   %0 = bitcast i32 %a0.coerce to <2 x i16>
    946   %1 = tail call <2 x i16> @llvm.mips.shra.ph(<2 x i16> %0, i32 %a1)
    947   %2 = bitcast <2 x i16> %1 to i32
    948   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
    949   ret { i32 } %.fca.0.insert
    950 }
    951 
    952 define { i32 } @test__builtin_mips_shra_r_ph1(i32 %i0, i32 %a0.coerce) nounwind readnone {
    953 entry:
    954 ; CHECK: shra_r.ph
    955 
    956   %0 = bitcast i32 %a0.coerce to <2 x i16>
    957   %1 = tail call <2 x i16> @llvm.mips.shra.r.ph(<2 x i16> %0, i32 7)
    958   %2 = bitcast <2 x i16> %1 to i32
    959   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
    960   ret { i32 } %.fca.0.insert
    961 }
    962 
    963 declare <2 x i16> @llvm.mips.shra.r.ph(<2 x i16>, i32) nounwind readnone
    964 
    965 define { i32 } @test__builtin_mips_shra_r_ph2(i32 %i0, i32 %a0.coerce, i32 %a1) nounwind readnone {
    966 entry:
    967 ; CHECK: shrav_r.ph
    968 
    969   %0 = bitcast i32 %a0.coerce to <2 x i16>
    970   %1 = tail call <2 x i16> @llvm.mips.shra.r.ph(<2 x i16> %0, i32 %a1)
    971   %2 = bitcast <2 x i16> %1 to i32
    972   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
    973   ret { i32 } %.fca.0.insert
    974 }
    975 
    976 define i32 @test__builtin_mips_shra_r_w1(i32 %i0, i32 %a0) nounwind readnone {
    977 entry:
    978 ; CHECK: shra_r.w
    979 
    980   %0 = tail call i32 @llvm.mips.shra.r.w(i32 %a0, i32 15)
    981   ret i32 %0
    982 }
    983 
    984 declare i32 @llvm.mips.shra.r.w(i32, i32) nounwind readnone
    985 
    986 define i32 @test__builtin_mips_shra_r_w2(i32 %i0, i32 %a0, i32 %a1) nounwind readnone {
    987 entry:
    988 ; CHECK: shrav_r.w
    989 
    990   %0 = tail call i32 @llvm.mips.shra.r.w(i32 %a0, i32 %a1)
    991   ret i32 %0
    992 }
    993 
    994 define { i32 } @test__builtin_mips_absq_s_ph1(i32 %i0, i32 %a0.coerce) nounwind {
    995 entry:
    996 ; CHECK: absq_s.ph
    997 
    998   %0 = bitcast i32 %a0.coerce to <2 x i16>
    999   %1 = tail call <2 x i16> @llvm.mips.absq.s.ph(<2 x i16> %0)
   1000   %2 = bitcast <2 x i16> %1 to i32
   1001   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
   1002   ret { i32 } %.fca.0.insert
   1003 }
   1004 
   1005 declare <2 x i16> @llvm.mips.absq.s.ph(<2 x i16>) nounwind
   1006 
   1007 define i32 @test__builtin_mips_absq_s_w1(i32 %i0, i32 %a0) nounwind {
   1008 entry:
   1009 ; CHECK: absq_s.w
   1010 
   1011   %0 = tail call i32 @llvm.mips.absq.s.w(i32 %a0)
   1012   ret i32 %0
   1013 }
   1014 
   1015 declare i32 @llvm.mips.absq.s.w(i32) nounwind
   1016 
   1017 define i32 @test__builtin_mips_preceq_w_phl1(i32 %i0, i32 %a0.coerce) nounwind readnone {
   1018 entry:
   1019 ; CHECK: preceq.w.phl
   1020 
   1021   %0 = bitcast i32 %a0.coerce to <2 x i16>
   1022   %1 = tail call i32 @llvm.mips.preceq.w.phl(<2 x i16> %0)
   1023   ret i32 %1
   1024 }
   1025 
   1026 declare i32 @llvm.mips.preceq.w.phl(<2 x i16>) nounwind readnone
   1027 
   1028 define i32 @test__builtin_mips_preceq_w_phr1(i32 %i0, i32 %a0.coerce) nounwind readnone {
   1029 entry:
   1030 ; CHECK: preceq.w.phr
   1031 
   1032   %0 = bitcast i32 %a0.coerce to <2 x i16>
   1033   %1 = tail call i32 @llvm.mips.preceq.w.phr(<2 x i16> %0)
   1034   ret i32 %1
   1035 }
   1036 
   1037 declare i32 @llvm.mips.preceq.w.phr(<2 x i16>) nounwind readnone
   1038 
   1039 define { i32 } @test__builtin_mips_precequ_ph_qbl1(i32 %i0, i32 %a0.coerce) nounwind readnone {
   1040 entry:
   1041 ; CHECK: precequ.ph.qbl
   1042 
   1043   %0 = bitcast i32 %a0.coerce to <4 x i8>
   1044   %1 = tail call <2 x i16> @llvm.mips.precequ.ph.qbl(<4 x i8> %0)
   1045   %2 = bitcast <2 x i16> %1 to i32
   1046   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
   1047   ret { i32 } %.fca.0.insert
   1048 }
   1049 
   1050 declare <2 x i16> @llvm.mips.precequ.ph.qbl(<4 x i8>) nounwind readnone
   1051 
   1052 define { i32 } @test__builtin_mips_precequ_ph_qbr1(i32 %i0, i32 %a0.coerce) nounwind readnone {
   1053 entry:
   1054 ; CHECK: precequ.ph.qbr
   1055 
   1056   %0 = bitcast i32 %a0.coerce to <4 x i8>
   1057   %1 = tail call <2 x i16> @llvm.mips.precequ.ph.qbr(<4 x i8> %0)
   1058   %2 = bitcast <2 x i16> %1 to i32
   1059   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
   1060   ret { i32 } %.fca.0.insert
   1061 }
   1062 
   1063 declare <2 x i16> @llvm.mips.precequ.ph.qbr(<4 x i8>) nounwind readnone
   1064 
   1065 define { i32 } @test__builtin_mips_precequ_ph_qbla1(i32 %i0, i32 %a0.coerce) nounwind readnone {
   1066 entry:
   1067 ; CHECK: precequ.ph.qbla
   1068 
   1069   %0 = bitcast i32 %a0.coerce to <4 x i8>
   1070   %1 = tail call <2 x i16> @llvm.mips.precequ.ph.qbla(<4 x i8> %0)
   1071   %2 = bitcast <2 x i16> %1 to i32
   1072   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
   1073   ret { i32 } %.fca.0.insert
   1074 }
   1075 
   1076 declare <2 x i16> @llvm.mips.precequ.ph.qbla(<4 x i8>) nounwind readnone
   1077 
   1078 define { i32 } @test__builtin_mips_precequ_ph_qbra1(i32 %i0, i32 %a0.coerce) nounwind readnone {
   1079 entry:
   1080 ; CHECK: precequ.ph.qbra
   1081 
   1082   %0 = bitcast i32 %a0.coerce to <4 x i8>
   1083   %1 = tail call <2 x i16> @llvm.mips.precequ.ph.qbra(<4 x i8> %0)
   1084   %2 = bitcast <2 x i16> %1 to i32
   1085   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
   1086   ret { i32 } %.fca.0.insert
   1087 }
   1088 
   1089 declare <2 x i16> @llvm.mips.precequ.ph.qbra(<4 x i8>) nounwind readnone
   1090 
   1091 define { i32 } @test__builtin_mips_preceu_ph_qbl1(i32 %i0, i32 %a0.coerce) nounwind readnone {
   1092 entry:
   1093 ; CHECK: preceu.ph.qbl
   1094 
   1095   %0 = bitcast i32 %a0.coerce to <4 x i8>
   1096   %1 = tail call <2 x i16> @llvm.mips.preceu.ph.qbl(<4 x i8> %0)
   1097   %2 = bitcast <2 x i16> %1 to i32
   1098   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
   1099   ret { i32 } %.fca.0.insert
   1100 }
   1101 
   1102 declare <2 x i16> @llvm.mips.preceu.ph.qbl(<4 x i8>) nounwind readnone
   1103 
   1104 define { i32 } @test__builtin_mips_preceu_ph_qbr1(i32 %i0, i32 %a0.coerce) nounwind readnone {
   1105 entry:
   1106 ; CHECK: preceu.ph.qbr
   1107 
   1108   %0 = bitcast i32 %a0.coerce to <4 x i8>
   1109   %1 = tail call <2 x i16> @llvm.mips.preceu.ph.qbr(<4 x i8> %0)
   1110   %2 = bitcast <2 x i16> %1 to i32
   1111   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
   1112   ret { i32 } %.fca.0.insert
   1113 }
   1114 
   1115 declare <2 x i16> @llvm.mips.preceu.ph.qbr(<4 x i8>) nounwind readnone
   1116 
   1117 define { i32 } @test__builtin_mips_preceu_ph_qbla1(i32 %i0, i32 %a0.coerce) nounwind readnone {
   1118 entry:
   1119 ; CHECK: preceu.ph.qbla
   1120 
   1121   %0 = bitcast i32 %a0.coerce to <4 x i8>
   1122   %1 = tail call <2 x i16> @llvm.mips.preceu.ph.qbla(<4 x i8> %0)
   1123   %2 = bitcast <2 x i16> %1 to i32
   1124   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
   1125   ret { i32 } %.fca.0.insert
   1126 }
   1127 
   1128 declare <2 x i16> @llvm.mips.preceu.ph.qbla(<4 x i8>) nounwind readnone
   1129 
   1130 define { i32 } @test__builtin_mips_preceu_ph_qbra1(i32 %i0, i32 %a0.coerce) nounwind readnone {
   1131 entry:
   1132 ; CHECK: preceu.ph.qbra
   1133 
   1134   %0 = bitcast i32 %a0.coerce to <4 x i8>
   1135   %1 = tail call <2 x i16> @llvm.mips.preceu.ph.qbra(<4 x i8> %0)
   1136   %2 = bitcast <2 x i16> %1 to i32
   1137   %.fca.0.insert = insertvalue { i32 } undef, i32 %2, 0
   1138   ret { i32 } %.fca.0.insert
   1139 }
   1140 
   1141 declare <2 x i16> @llvm.mips.preceu.ph.qbra(<4 x i8>) nounwind readnone
   1142 
   1143 define { i32 } @test__builtin_mips_repl_qb1(i32 %i0) nounwind readnone {
   1144 entry:
   1145 ; CHECK: repl.qb
   1146 
   1147   %0 = tail call <4 x i8> @llvm.mips.repl.qb(i32 127)
   1148   %1 = bitcast <4 x i8> %0 to i32
   1149   %.fca.0.insert = insertvalue { i32 } undef, i32 %1, 0
   1150   ret { i32 } %.fca.0.insert
   1151 }
   1152 
   1153 declare <4 x i8> @llvm.mips.repl.qb(i32) nounwind readnone
   1154 
   1155 define { i32 } @test__builtin_mips_repl_qb2(i32 %i0, i32 %a0) nounwind readnone {
   1156 entry:
   1157 ; CHECK: replv.qb
   1158 
   1159   %0 = tail call <4 x i8> @llvm.mips.repl.qb(i32 %a0)
   1160   %1 = bitcast <4 x i8> %0 to i32
   1161   %.fca.0.insert = insertvalue { i32 } undef, i32 %1, 0
   1162   ret { i32 } %.fca.0.insert
   1163 }
   1164 
   1165 define { i32 } @test__builtin_mips_repl_ph1(i32 %i0) nounwind readnone {
   1166 entry:
   1167 ; CHECK: repl.ph
   1168 
   1169   %0 = tail call <2 x i16> @llvm.mips.repl.ph(i32 0)
   1170   %1 = bitcast <2 x i16> %0 to i32
   1171   %.fca.0.insert = insertvalue { i32 } undef, i32 %1, 0
   1172   ret { i32 } %.fca.0.insert
   1173 }
   1174 
   1175 define { i32 } @test__builtin_mips_repl_ph2(i32 %i0) nounwind readnone {
   1176 entry:
   1177 ; CHECK: repl.ph
   1178 
   1179   %0 = tail call <2 x i16> @llvm.mips.repl.ph(i32 -2)
   1180   %1 = bitcast <2 x i16> %0 to i32
   1181   %.fca.0.insert = insertvalue { i32 } undef, i32 %1, 0
   1182   ret { i32 } %.fca.0.insert
   1183 }
   1184 
   1185 declare <2 x i16> @llvm.mips.repl.ph(i32) nounwind readnone
   1186 
   1187 define { i32 } @test__builtin_mips_repl_ph3(i32 %i0, i32 %a0) nounwind readnone {
   1188 entry:
   1189 ; CHECK: replv.ph
   1190 
   1191   %0 = tail call <2 x i16> @llvm.mips.repl.ph(i32 %a0)
   1192   %1 = bitcast <2 x i16> %0 to i32
   1193   %.fca.0.insert = insertvalue { i32 } undef, i32 %1, 0
   1194   ret { i32 } %.fca.0.insert
   1195 }
   1196 
   1197 define i32 @test__builtin_mips_bitrev1(i32 %i0, i32 %a0) nounwind readnone {
   1198 entry:
   1199 ; CHECK: bitrev ${{[0-9]+}}
   1200 
   1201   %0 = tail call i32 @llvm.mips.bitrev(i32 %a0)
   1202   ret i32 %0
   1203 }
   1204 
   1205 declare i32 @llvm.mips.bitrev(i32) nounwind readnone
   1206 
   1207 define i32 @test__builtin_mips_lbux1(i32 %i0, i8* %a0, i32 %a1) nounwind readonly {
   1208 entry:
   1209 ; CHECK: lbux ${{[0-9]+}}
   1210 
   1211   %0 = tail call i32 @llvm.mips.lbux(i8* %a0, i32 %a1)
   1212   ret i32 %0
   1213 }
   1214 
   1215 declare i32 @llvm.mips.lbux(i8*, i32) nounwind readonly
   1216 
   1217 define i32 @test__builtin_mips_lhx1(i32 %i0, i8* %a0, i32 %a1) nounwind readonly {
   1218 entry:
   1219 ; CHECK: lhx ${{[0-9]+}}
   1220 
   1221   %0 = tail call i32 @llvm.mips.lhx(i8* %a0, i32 %a1)
   1222   ret i32 %0
   1223 }
   1224 
   1225 declare i32 @llvm.mips.lhx(i8*, i32) nounwind readonly
   1226 
   1227 define i32 @test__builtin_mips_lwx1(i32 %i0, i8* %a0, i32 %a1) nounwind readonly {
   1228 entry:
   1229 ; CHECK: lwx ${{[0-9]+}}
   1230 
   1231   %0 = tail call i32 @llvm.mips.lwx(i8* %a0, i32 %a1)
   1232   ret i32 %0
   1233 }
   1234 
   1235 declare i32 @llvm.mips.lwx(i8*, i32) nounwind readonly
   1236 
   1237 define i32 @test__builtin_mips_wrdsp1(i32 %i0, i32 %a0) nounwind {
   1238 entry:
   1239 ; CHECK: wrdsp ${{[0-9]+}}
   1240 ; CHECK: rddsp ${{[0-9]+}}
   1241 
   1242   tail call void @llvm.mips.wrdsp(i32 %a0, i32 31)
   1243   %0 = tail call i32 @llvm.mips.rddsp(i32 31)
   1244   ret i32 %0
   1245 }
   1246 
   1247 declare void @llvm.mips.wrdsp(i32, i32) nounwind
   1248