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