1; RUN: llc -march=mipsel -mcpu=mips32 -mattr=+dsp -verify-machineinstrs < %s | \ 2; RUN: FileCheck %s 3 4define i32 @test__builtin_mips_extr_w1(i32 %i0, i32, i64 %a0) nounwind { 5entry: 6; CHECK: extr.w 7 8 %1 = tail call i32 @llvm.mips.extr.w(i64 %a0, i32 15) 9 ret i32 %1 10} 11 12declare i32 @llvm.mips.extr.w(i64, i32) nounwind 13 14define i32 @test__builtin_mips_extr_w2(i32 %i0, i32, i64 %a0, i32 %a1) nounwind { 15entry: 16; CHECK: extrv.w 17 18 %1 = tail call i32 @llvm.mips.extr.w(i64 %a0, i32 %a1) 19 ret i32 %1 20} 21 22define i32 @test__builtin_mips_extr_r_w1(i32 %i0, i32, i64 %a0) nounwind { 23entry: 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 30declare i32 @llvm.mips.extr.r.w(i64, i32) nounwind 31 32define i32 @test__builtin_mips_extr_s_h1(i32 %i0, i32, i64 %a0, i32 %a1) nounwind { 33entry: 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 40declare i32 @llvm.mips.extr.s.h(i64, i32) nounwind 41 42define i32 @test__builtin_mips_extr_rs_w1(i32 %i0, i32, i64 %a0) nounwind { 43entry: 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 50declare i32 @llvm.mips.extr.rs.w(i64, i32) nounwind 51 52define i32 @test__builtin_mips_extr_rs_w2(i32 %i0, i32, i64 %a0, i32 %a1) nounwind { 53entry: 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 60define i32 @test__builtin_mips_extr_s_h2(i32 %i0, i32, i64 %a0) nounwind { 61entry: 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 68define i32 @test__builtin_mips_extr_r_w2(i32 %i0, i32, i64 %a0, i32 %a1) nounwind { 69entry: 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 76define i32 @test__builtin_mips_extp1(i32 %i0, i32, i64 %a0) nounwind { 77entry: 78; CHECK: extp ${{[0-9]+}} 79 80 %1 = tail call i32 @llvm.mips.extp(i64 %a0, i32 15) 81 ret i32 %1 82} 83 84declare i32 @llvm.mips.extp(i64, i32) nounwind 85 86define i32 @test__builtin_mips_extp2(i32 %i0, i32, i64 %a0, i32 %a1) nounwind { 87entry: 88; CHECK: extpv 89 90 %1 = tail call i32 @llvm.mips.extp(i64 %a0, i32 %a1) 91 ret i32 %1 92} 93 94define i32 @test__builtin_mips_extpdp1(i32 %i0, i32, i64 %a0) nounwind { 95entry: 96; CHECK: extpdp ${{[0-9]+}} 97 98 %1 = tail call i32 @llvm.mips.extpdp(i64 %a0, i32 15) 99 ret i32 %1 100} 101 102declare i32 @llvm.mips.extpdp(i64, i32) nounwind 103 104define i32 @test__builtin_mips_extpdp2(i32 %i0, i32, i64 %a0, i32 %a1) nounwind { 105entry: 106; CHECK: extpdpv 107 108 %1 = tail call i32 @llvm.mips.extpdp(i64 %a0, i32 %a1) 109 ret i32 %1 110} 111 112define i64 @test__builtin_mips_dpau_h_qbl1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind readnone { 113entry: 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 122declare i64 @llvm.mips.dpau.h.qbl(i64, <4 x i8>, <4 x i8>) nounwind readnone 123 124define i64 @test__builtin_mips_dpau_h_qbr1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind readnone { 125entry: 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 134declare i64 @llvm.mips.dpau.h.qbr(i64, <4 x i8>, <4 x i8>) nounwind readnone 135 136define i64 @test__builtin_mips_dpsu_h_qbl1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind readnone { 137entry: 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 146declare i64 @llvm.mips.dpsu.h.qbl(i64, <4 x i8>, <4 x i8>) nounwind readnone 147 148define i64 @test__builtin_mips_dpsu_h_qbr1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind readnone { 149entry: 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 158declare i64 @llvm.mips.dpsu.h.qbr(i64, <4 x i8>, <4 x i8>) nounwind readnone 159 160define i64 @test__builtin_mips_dpaq_s_w_ph1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind { 161entry: 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 170declare i64 @llvm.mips.dpaq.s.w.ph(i64, <2 x i16>, <2 x i16>) nounwind 171 172define i64 @test__builtin_mips_dpaq_sa_l_w1(i32 %i0, i32, i64 %a0, i32 %a1, i32 %a2) nounwind { 173entry: 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 180declare i64 @llvm.mips.dpaq.sa.l.w(i64, i32, i32) nounwind 181 182define i64 @test__builtin_mips_dpsq_s_w_ph1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind { 183entry: 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 192declare i64 @llvm.mips.dpsq.s.w.ph(i64, <2 x i16>, <2 x i16>) nounwind 193 194define i64 @test__builtin_mips_dpsq_sa_l_w1(i32 %i0, i32, i64 %a0, i32 %a1, i32 %a2) nounwind { 195entry: 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 202declare i64 @llvm.mips.dpsq.sa.l.w(i64, i32, i32) nounwind 203 204define i64 @test__builtin_mips_mulsaq_s_w_ph1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind { 205entry: 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 214declare i64 @llvm.mips.mulsaq.s.w.ph(i64, <2 x i16>, <2 x i16>) nounwind 215 216define i64 @test__builtin_mips_maq_s_w_phl1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind { 217entry: 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 226declare i64 @llvm.mips.maq.s.w.phl(i64, <2 x i16>, <2 x i16>) nounwind 227 228define i64 @test__builtin_mips_maq_s_w_phr1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind { 229entry: 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 238declare i64 @llvm.mips.maq.s.w.phr(i64, <2 x i16>, <2 x i16>) nounwind 239 240define i64 @test__builtin_mips_maq_sa_w_phl1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind { 241entry: 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 250declare i64 @llvm.mips.maq.sa.w.phl(i64, <2 x i16>, <2 x i16>) nounwind 251 252define i64 @test__builtin_mips_maq_sa_w_phr1(i32 %i0, i32, i64 %a0, i32 %a1.coerce, i32 %a2.coerce) nounwind { 253entry: 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 262declare i64 @llvm.mips.maq.sa.w.phr(i64, <2 x i16>, <2 x i16>) nounwind 263 264define i64 @test__builtin_mips_shilo1(i32 %i0, i32, i64 %a0) nounwind readnone { 265entry: 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 272declare i64 @llvm.mips.shilo(i64, i32) nounwind readnone 273 274define i64 @test__builtin_mips_shilo2(i32 %i0, i32, i64 %a0, i32 %a1) nounwind readnone { 275entry: 276; CHECK: shilov 277 278 %1 = tail call i64 @llvm.mips.shilo(i64 %a0, i32 %a1) 279 ret i64 %1 280} 281 282define i64 @test__builtin_mips_mthlip1(i32 %i0, i32, i64 %a0, i32 %a1) nounwind { 283entry: 284; CHECK: mthlip ${{[0-9]+}} 285 286 %1 = tail call i64 @llvm.mips.mthlip(i64 %a0, i32 %a1) 287 ret i64 %1 288} 289 290declare i64 @llvm.mips.mthlip(i64, i32) nounwind 291 292define i32 @test__builtin_mips_bposge321(i32 %i0) nounwind readonly { 293entry: 294; CHECK: bposge32 $BB{{[0-9]+}} 295 296 %0 = tail call i32 @llvm.mips.bposge32() 297 ret i32 %0 298} 299 300declare i32 @llvm.mips.bposge32() nounwind readonly 301 302define i64 @test__builtin_mips_madd1(i32 %i0, i32, i64 %a0, i32 %a1, i32 %a2) nounwind readnone { 303entry: 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 310declare i64 @llvm.mips.madd(i64, i32, i32) nounwind readnone 311 312define i64 @test__builtin_mips_maddu1(i32 %i0, i32, i64 %a0, i32 %a1, i32 %a2) nounwind readnone { 313entry: 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 320declare i64 @llvm.mips.maddu(i64, i32, i32) nounwind readnone 321 322define i64 @test__builtin_mips_msub1(i32 %i0, i32, i64 %a0, i32 %a1, i32 %a2) nounwind readnone { 323entry: 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 330declare i64 @llvm.mips.msub(i64, i32, i32) nounwind readnone 331 332define i64 @test__builtin_mips_msubu1(i32 %i0, i32, i64 %a0, i32 %a1, i32 %a2) nounwind readnone { 333entry: 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 340declare i64 @llvm.mips.msubu(i64, i32, i32) nounwind readnone 341 342define i64 @test__builtin_mips_mult1(i32 %i0, i32 %a0, i32 %a1) nounwind readnone { 343entry: 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 350declare i64 @llvm.mips.mult(i32, i32) nounwind readnone 351 352define i64 @test__builtin_mips_multu1(i32 %i0, i32 %a0, i32 %a1) nounwind readnone { 353entry: 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 360declare i64 @llvm.mips.multu(i32, i32) nounwind readnone 361 362define { i32 } @test__builtin_mips_addq_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 363entry: 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 374declare <2 x i16> @llvm.mips.addq.ph(<2 x i16>, <2 x i16>) nounwind 375 376define { i32 } @test__builtin_mips_addq_s_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 377entry: 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 388declare <2 x i16> @llvm.mips.addq.s.ph(<2 x i16>, <2 x i16>) nounwind 389 390define i32 @test__builtin_mips_addq_s_w1(i32 %i0, i32 %a0, i32 %a1) nounwind { 391entry: 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 398declare i32 @llvm.mips.addq.s.w(i32, i32) nounwind 399 400define { i32 } @test__builtin_mips_addu_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 401entry: 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 412declare <4 x i8> @llvm.mips.addu.qb(<4 x i8>, <4 x i8>) nounwind 413 414define { i32 } @test__builtin_mips_addu_s_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 415entry: 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 426declare <4 x i8> @llvm.mips.addu.s.qb(<4 x i8>, <4 x i8>) nounwind 427 428define { i32 } @test__builtin_mips_subq_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 429entry: 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 440declare <2 x i16> @llvm.mips.subq.ph(<2 x i16>, <2 x i16>) nounwind 441 442define { i32 } @test__builtin_mips_subq_s_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 443entry: 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 454declare <2 x i16> @llvm.mips.subq.s.ph(<2 x i16>, <2 x i16>) nounwind 455 456define i32 @test__builtin_mips_subq_s_w1(i32 %i0, i32 %a0, i32 %a1) nounwind { 457entry: 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 464declare i32 @llvm.mips.subq.s.w(i32, i32) nounwind 465 466define { i32 } @test__builtin_mips_subu_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 467entry: 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 478declare <4 x i8> @llvm.mips.subu.qb(<4 x i8>, <4 x i8>) nounwind 479 480define { i32 } @test__builtin_mips_subu_s_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 481entry: 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 492declare <4 x i8> @llvm.mips.subu.s.qb(<4 x i8>, <4 x i8>) nounwind 493 494define i32 @test__builtin_mips_addsc1(i32 %i0, i32 %a0, i32 %a1) nounwind { 495entry: 496; CHECK: addsc ${{[0-9]+}} 497 498 %0 = tail call i32 @llvm.mips.addsc(i32 %a0, i32 %a1) 499 ret i32 %0 500} 501 502declare i32 @llvm.mips.addsc(i32, i32) nounwind 503 504define i32 @test__builtin_mips_addwc1(i32 %i0, i32 %a0, i32 %a1) nounwind { 505entry: 506; CHECK: addwc ${{[0-9]+}} 507 508 %0 = tail call i32 @llvm.mips.addwc(i32 %a0, i32 %a1) 509 ret i32 %0 510} 511 512declare i32 @llvm.mips.addwc(i32, i32) nounwind 513 514define i32 @test__builtin_mips_modsub1(i32 %i0, i32 %a0, i32 %a1) nounwind readnone { 515entry: 516; CHECK: modsub ${{[0-9]+}} 517 518 %0 = tail call i32 @llvm.mips.modsub(i32 %a0, i32 %a1) 519 ret i32 %0 520} 521 522declare i32 @llvm.mips.modsub(i32, i32) nounwind readnone 523 524define i32 @test__builtin_mips_raddu_w_qb1(i32 %i0, i32 %a0.coerce) nounwind readnone { 525entry: 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 533declare i32 @llvm.mips.raddu.w.qb(<4 x i8>) nounwind readnone 534 535define { i32 } @test__builtin_mips_muleu_s_ph_qbl1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 536entry: 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 547declare <2 x i16> @llvm.mips.muleu.s.ph.qbl(<4 x i8>, <2 x i16>) nounwind 548 549define { i32 } @test__builtin_mips_muleu_s_ph_qbr1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 550entry: 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 561declare <2 x i16> @llvm.mips.muleu.s.ph.qbr(<4 x i8>, <2 x i16>) nounwind 562 563define { i32 } @test__builtin_mips_mulq_rs_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 564entry: 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 575declare <2 x i16> @llvm.mips.mulq.rs.ph(<2 x i16>, <2 x i16>) nounwind 576 577define i32 @test__builtin_mips_muleq_s_w_phl1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 578entry: 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 587declare i32 @llvm.mips.muleq.s.w.phl(<2 x i16>, <2 x i16>) nounwind 588 589define i32 @test__builtin_mips_muleq_s_w_phr1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 590entry: 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 599declare i32 @llvm.mips.muleq.s.w.phr(<2 x i16>, <2 x i16>) nounwind 600 601define { i32 } @test__builtin_mips_precrq_qb_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind readnone { 602entry: 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 613declare <4 x i8> @llvm.mips.precrq.qb.ph(<2 x i16>, <2 x i16>) nounwind readnone 614 615define { i32 } @test__builtin_mips_precrq_ph_w1(i32 %i0, i32 %a0, i32 %a1) nounwind readnone { 616entry: 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 625declare <2 x i16> @llvm.mips.precrq.ph.w(i32, i32) nounwind readnone 626 627define { i32 } @test__builtin_mips_precrq_rs_ph_w1(i32 %i0, i32 %a0, i32 %a1) nounwind { 628entry: 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 637declare <2 x i16> @llvm.mips.precrq.rs.ph.w(i32, i32) nounwind 638 639define { i32 } @test__builtin_mips_precrqu_s_qb_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 640entry: 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 651declare <4 x i8> @llvm.mips.precrqu.s.qb.ph(<2 x i16>, <2 x i16>) nounwind 652 653 654define i32 @test__builtin_mips_cmpu_eq_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 655entry: 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 665declare void @llvm.mips.cmpu.eq.qb(<4 x i8>, <4 x i8>) nounwind 666 667declare i32 @llvm.mips.rddsp(i32) nounwind readonly 668 669define i32 @test__builtin_mips_cmpu_lt_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 670entry: 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 680declare void @llvm.mips.cmpu.lt.qb(<4 x i8>, <4 x i8>) nounwind 681 682define i32 @test__builtin_mips_cmpu_le_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 683entry: 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 693declare void @llvm.mips.cmpu.le.qb(<4 x i8>, <4 x i8>) nounwind 694 695define i32 @test__builtin_mips_cmpgu_eq_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 696entry: 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 705declare i32 @llvm.mips.cmpgu.eq.qb(<4 x i8>, <4 x i8>) nounwind 706 707define i32 @test__builtin_mips_cmpgu_lt_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 708entry: 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 717declare i32 @llvm.mips.cmpgu.lt.qb(<4 x i8>, <4 x i8>) nounwind 718 719define i32 @test__builtin_mips_cmpgu_le_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 720entry: 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 729declare i32 @llvm.mips.cmpgu.le.qb(<4 x i8>, <4 x i8>) nounwind 730 731define i32 @test__builtin_mips_cmp_eq_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 732entry: 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 742declare void @llvm.mips.cmp.eq.ph(<2 x i16>, <2 x i16>) nounwind 743 744define i32 @test__builtin_mips_cmp_lt_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 745entry: 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 755declare void @llvm.mips.cmp.lt.ph(<2 x i16>, <2 x i16>) nounwind 756 757define i32 @test__builtin_mips_cmp_le_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind { 758entry: 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 768declare void @llvm.mips.cmp.le.ph(<2 x i16>, <2 x i16>) nounwind 769 770define { i32 } @test__builtin_mips_pick_qb1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind readonly { 771entry: 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 783declare <4 x i8> @llvm.mips.pick.qb(<4 x i8>, <4 x i8>) nounwind readonly 784 785define { i32 } @test__builtin_mips_pick_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind readonly { 786entry: 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 798declare <2 x i16> @llvm.mips.pick.ph(<2 x i16>, <2 x i16>) nounwind readonly 799 800define { i32 } @test__builtin_mips_packrl_ph1(i32 %i0, i32 %a0.coerce, i32 %a1.coerce) nounwind readnone { 801entry: 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 812declare <2 x i16> @llvm.mips.packrl.ph(<2 x i16>, <2 x i16>) nounwind readnone 813 814define { i32 } @test__builtin_mips_shll_qb1(i32 %i0, i32 %a0.coerce) nounwind { 815entry: 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 825declare <4 x i8> @llvm.mips.shll.qb(<4 x i8>, i32) nounwind 826 827define { i32 } @test__builtin_mips_shll_qb2(i32 %i0, i32 %a0.coerce, i32 %a1) nounwind { 828entry: 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 838define { i32 } @test__builtin_mips_shll_ph1(i32 %i0, i32 %a0.coerce) nounwind { 839entry: 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 849declare <2 x i16> @llvm.mips.shll.ph(<2 x i16>, i32) nounwind 850 851define { i32 } @test__builtin_mips_shll_ph2(i32 %i0, i32 %a0.coerce, i32 %a1) nounwind { 852entry: 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 862define { i32 } @test__builtin_mips_shll_s_ph1(i32 %i0, i32 %a0.coerce) nounwind { 863entry: 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 873declare <2 x i16> @llvm.mips.shll.s.ph(<2 x i16>, i32) nounwind 874 875define { i32 } @test__builtin_mips_shll_s_ph2(i32 %i0, i32 %a0.coerce, i32 %a1) nounwind { 876entry: 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 886define i32 @test__builtin_mips_shll_s_w1(i32 %i0, i32 %a0) nounwind { 887entry: 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 894declare i32 @llvm.mips.shll.s.w(i32, i32) nounwind 895 896define i32 @test__builtin_mips_shll_s_w2(i32 %i0, i32 %a0, i32 %a1) nounwind { 897entry: 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 904define { i32 } @test__builtin_mips_shrl_qb1(i32 %i0, i32 %a0.coerce) nounwind readnone { 905entry: 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 915declare <4 x i8> @llvm.mips.shrl.qb(<4 x i8>, i32) nounwind readnone 916 917define { i32 } @test__builtin_mips_shrl_qb2(i32 %i0, i32 %a0.coerce, i32 %a1) nounwind readnone { 918entry: 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 928define { i32 } @test__builtin_mips_shra_ph1(i32 %i0, i32 %a0.coerce) nounwind readnone { 929entry: 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 939declare <2 x i16> @llvm.mips.shra.ph(<2 x i16>, i32) nounwind readnone 940 941define { i32 } @test__builtin_mips_shra_ph2(i32 %i0, i32 %a0.coerce, i32 %a1) nounwind readnone { 942entry: 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 952define { i32 } @test__builtin_mips_shra_r_ph1(i32 %i0, i32 %a0.coerce) nounwind readnone { 953entry: 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 963declare <2 x i16> @llvm.mips.shra.r.ph(<2 x i16>, i32) nounwind readnone 964 965define { i32 } @test__builtin_mips_shra_r_ph2(i32 %i0, i32 %a0.coerce, i32 %a1) nounwind readnone { 966entry: 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 976define i32 @test__builtin_mips_shra_r_w1(i32 %i0, i32 %a0) nounwind readnone { 977entry: 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 984declare i32 @llvm.mips.shra.r.w(i32, i32) nounwind readnone 985 986define i32 @test__builtin_mips_shra_r_w2(i32 %i0, i32 %a0, i32 %a1) nounwind readnone { 987entry: 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 994define { i32 } @test__builtin_mips_absq_s_ph1(i32 %i0, i32 %a0.coerce) nounwind { 995entry: 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 1005declare <2 x i16> @llvm.mips.absq.s.ph(<2 x i16>) nounwind 1006 1007define i32 @test__builtin_mips_absq_s_w1(i32 %i0, i32 %a0) nounwind { 1008entry: 1009; CHECK: absq_s.w 1010 1011 %0 = tail call i32 @llvm.mips.absq.s.w(i32 %a0) 1012 ret i32 %0 1013} 1014 1015declare i32 @llvm.mips.absq.s.w(i32) nounwind 1016 1017define i32 @test__builtin_mips_preceq_w_phl1(i32 %i0, i32 %a0.coerce) nounwind readnone { 1018entry: 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 1026declare i32 @llvm.mips.preceq.w.phl(<2 x i16>) nounwind readnone 1027 1028define i32 @test__builtin_mips_preceq_w_phr1(i32 %i0, i32 %a0.coerce) nounwind readnone { 1029entry: 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 1037declare i32 @llvm.mips.preceq.w.phr(<2 x i16>) nounwind readnone 1038 1039define { i32 } @test__builtin_mips_precequ_ph_qbl1(i32 %i0, i32 %a0.coerce) nounwind readnone { 1040entry: 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 1050declare <2 x i16> @llvm.mips.precequ.ph.qbl(<4 x i8>) nounwind readnone 1051 1052define { i32 } @test__builtin_mips_precequ_ph_qbr1(i32 %i0, i32 %a0.coerce) nounwind readnone { 1053entry: 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 1063declare <2 x i16> @llvm.mips.precequ.ph.qbr(<4 x i8>) nounwind readnone 1064 1065define { i32 } @test__builtin_mips_precequ_ph_qbla1(i32 %i0, i32 %a0.coerce) nounwind readnone { 1066entry: 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 1076declare <2 x i16> @llvm.mips.precequ.ph.qbla(<4 x i8>) nounwind readnone 1077 1078define { i32 } @test__builtin_mips_precequ_ph_qbra1(i32 %i0, i32 %a0.coerce) nounwind readnone { 1079entry: 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 1089declare <2 x i16> @llvm.mips.precequ.ph.qbra(<4 x i8>) nounwind readnone 1090 1091define { i32 } @test__builtin_mips_preceu_ph_qbl1(i32 %i0, i32 %a0.coerce) nounwind readnone { 1092entry: 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 1102declare <2 x i16> @llvm.mips.preceu.ph.qbl(<4 x i8>) nounwind readnone 1103 1104define { i32 } @test__builtin_mips_preceu_ph_qbr1(i32 %i0, i32 %a0.coerce) nounwind readnone { 1105entry: 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 1115declare <2 x i16> @llvm.mips.preceu.ph.qbr(<4 x i8>) nounwind readnone 1116 1117define { i32 } @test__builtin_mips_preceu_ph_qbla1(i32 %i0, i32 %a0.coerce) nounwind readnone { 1118entry: 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 1128declare <2 x i16> @llvm.mips.preceu.ph.qbla(<4 x i8>) nounwind readnone 1129 1130define { i32 } @test__builtin_mips_preceu_ph_qbra1(i32 %i0, i32 %a0.coerce) nounwind readnone { 1131entry: 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 1141declare <2 x i16> @llvm.mips.preceu.ph.qbra(<4 x i8>) nounwind readnone 1142 1143define { i32 } @test__builtin_mips_repl_qb1(i32 %i0) nounwind readnone { 1144entry: 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 1153declare <4 x i8> @llvm.mips.repl.qb(i32) nounwind readnone 1154 1155define { i32 } @test__builtin_mips_repl_qb2(i32 %i0, i32 %a0) nounwind readnone { 1156entry: 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 1165define { i32 } @test__builtin_mips_repl_ph1(i32 %i0) nounwind readnone { 1166entry: 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 1175define { i32 } @test__builtin_mips_repl_ph2(i32 %i0) nounwind readnone { 1176entry: 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 1185declare <2 x i16> @llvm.mips.repl.ph(i32) nounwind readnone 1186 1187define { i32 } @test__builtin_mips_repl_ph3(i32 %i0, i32 %a0) nounwind readnone { 1188entry: 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 1197define i32 @test__builtin_mips_bitrev1(i32 %i0, i32 %a0) nounwind readnone { 1198entry: 1199; CHECK: bitrev ${{[0-9]+}} 1200 1201 %0 = tail call i32 @llvm.mips.bitrev(i32 %a0) 1202 ret i32 %0 1203} 1204 1205declare i32 @llvm.mips.bitrev(i32) nounwind readnone 1206 1207define i32 @test__builtin_mips_lbux1(i32 %i0, i8* %a0, i32 %a1) nounwind readonly { 1208entry: 1209; CHECK: lbux ${{[0-9]+}} 1210 1211 %0 = tail call i32 @llvm.mips.lbux(i8* %a0, i32 %a1) 1212 ret i32 %0 1213} 1214 1215declare i32 @llvm.mips.lbux(i8*, i32) nounwind readonly 1216 1217define i32 @test__builtin_mips_lhx1(i32 %i0, i8* %a0, i32 %a1) nounwind readonly { 1218entry: 1219; CHECK: lhx ${{[0-9]+}} 1220 1221 %0 = tail call i32 @llvm.mips.lhx(i8* %a0, i32 %a1) 1222 ret i32 %0 1223} 1224 1225declare i32 @llvm.mips.lhx(i8*, i32) nounwind readonly 1226 1227define i32 @test__builtin_mips_lwx1(i32 %i0, i8* %a0, i32 %a1) nounwind readonly { 1228entry: 1229; CHECK: lwx ${{[0-9]+}} 1230 1231 %0 = tail call i32 @llvm.mips.lwx(i8* %a0, i32 %a1) 1232 ret i32 %0 1233} 1234 1235declare i32 @llvm.mips.lwx(i8*, i32) nounwind readonly 1236 1237define i32 @test__builtin_mips_wrdsp1(i32 %i0, i32 %a0) nounwind { 1238entry: 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 1247declare void @llvm.mips.wrdsp(i32, i32) nounwind 1248