1; Tests if we can read binary operators. 2 3; RUN: %p2i -i %s --insts | FileCheck %s 4; RUN: %l2i -i %s --insts | %ifl FileCheck %s 5; RUN: %lc2i -i %s --insts | %iflc FileCheck %s 6; RUN: %p2i -i %s --args -notranslate -timing | \ 7; RUN: FileCheck --check-prefix=NOIR %s 8 9; TODO(kschimpf): add i8/i16. Needs bitcasts. 10 11define internal i32 @AddI32(i32 %a, i32 %b) { 12entry: 13 %add = add i32 %b, %a 14 ret i32 %add 15} 16 17; CHECK: define internal i32 @AddI32(i32 %a, i32 %b) { 18; CHECK-NEXT: entry: 19; CHECK-NEXT: %add = add i32 %b, %a 20; CHECK-NEXT: ret i32 %add 21; CHECK-NEXT: } 22 23define internal i64 @AddI64(i64 %a, i64 %b) { 24entry: 25 %add = add i64 %b, %a 26 ret i64 %add 27} 28 29; CHECK-NEXT: define internal i64 @AddI64(i64 %a, i64 %b) { 30; CHECK-NEXT: entry: 31; CHECK-NEXT: %add = add i64 %b, %a 32; CHECK-NEXT: ret i64 %add 33; CHECK-NEXT: } 34 35define internal <16 x i8> @AddV16I8(<16 x i8> %a, <16 x i8> %b) { 36entry: 37 %add = add <16 x i8> %b, %a 38 ret <16 x i8> %add 39} 40 41; CHECK-NEXT: define internal <16 x i8> @AddV16I8(<16 x i8> %a, <16 x i8> %b) { 42; CHECK-NEXT: entry: 43; CHECK-NEXT: %add = add <16 x i8> %b, %a 44; CHECK-NEXT: ret <16 x i8> %add 45; CHECK-NEXT: } 46 47define internal <8 x i16> @AddV8I16(<8 x i16> %a, <8 x i16> %b) { 48entry: 49 %add = add <8 x i16> %b, %a 50 ret <8 x i16> %add 51} 52 53; CHECK-NEXT: define internal <8 x i16> @AddV8I16(<8 x i16> %a, <8 x i16> %b) { 54; CHECK-NEXT: entry: 55; CHECK-NEXT: %add = add <8 x i16> %b, %a 56; CHECK-NEXT: ret <8 x i16> %add 57; CHECK-NEXT: } 58 59define internal <4 x i32> @AddV4I32(<4 x i32> %a, <4 x i32> %b) { 60entry: 61 %add = add <4 x i32> %b, %a 62 ret <4 x i32> %add 63} 64 65; CHECK-NEXT: define internal <4 x i32> @AddV4I32(<4 x i32> %a, <4 x i32> %b) { 66; CHECK-NEXT: entry: 67; CHECK-NEXT: %add = add <4 x i32> %b, %a 68; CHECK-NEXT: ret <4 x i32> %add 69; CHECK-NEXT: } 70 71define internal float @AddFloat(float %a, float %b) { 72entry: 73 %add = fadd float %b, %a 74 ret float %add 75} 76 77; CHECK-NEXT: define internal float @AddFloat(float %a, float %b) { 78; CHECK-NEXT: entry: 79; CHECK-NEXT: %add = fadd float %b, %a 80; CHECK-NEXT: ret float %add 81; CHECK-NEXT: } 82 83define internal double @AddDouble(double %a, double %b) { 84entry: 85 %add = fadd double %b, %a 86 ret double %add 87} 88 89; CHECK-NEXT: define internal double @AddDouble(double %a, double %b) { 90; CHECK-NEXT: entry: 91; CHECK-NEXT: %add = fadd double %b, %a 92; CHECK-NEXT: ret double %add 93; CHECK-NEXT: } 94 95define internal <4 x float> @AddV4Float(<4 x float> %a, <4 x float> %b) { 96entry: 97 %add = fadd <4 x float> %b, %a 98 ret <4 x float> %add 99} 100 101; CHECK-NEXT: define internal <4 x float> @AddV4Float(<4 x float> %a, <4 x float> %b) { 102; CHECK-NEXT: entry: 103; CHECK-NEXT: %add = fadd <4 x float> %b, %a 104; CHECK-NEXT: ret <4 x float> %add 105; CHECK-NEXT: } 106 107; TODO(kschimpf): sub i8/i16. Needs bitcasts. 108 109define internal i32 @SubI32(i32 %a, i32 %b) { 110entry: 111 %sub = sub i32 %a, %b 112 ret i32 %sub 113} 114 115; CHECK-NEXT: define internal i32 @SubI32(i32 %a, i32 %b) { 116; CHECK-NEXT: entry: 117; CHECK-NEXT: %sub = sub i32 %a, %b 118; CHECK-NEXT: ret i32 %sub 119; CHECK-NEXT: } 120 121define internal i64 @SubI64(i64 %a, i64 %b) { 122entry: 123 %sub = sub i64 %a, %b 124 ret i64 %sub 125} 126 127; CHECK-NEXT: define internal i64 @SubI64(i64 %a, i64 %b) { 128; CHECK-NEXT: entry: 129; CHECK-NEXT: %sub = sub i64 %a, %b 130; CHECK-NEXT: ret i64 %sub 131; CHECK-NEXT: } 132 133define internal <16 x i8> @SubV16I8(<16 x i8> %a, <16 x i8> %b) { 134entry: 135 %sub = sub <16 x i8> %a, %b 136 ret <16 x i8> %sub 137} 138 139; CHECK-NEXT: define internal <16 x i8> @SubV16I8(<16 x i8> %a, <16 x i8> %b) { 140; CHECK-NEXT: entry: 141; CHECK-NEXT: %sub = sub <16 x i8> %a, %b 142; CHECK-NEXT: ret <16 x i8> %sub 143; CHECK-NEXT: } 144 145define internal <8 x i16> @SubV8I16(<8 x i16> %a, <8 x i16> %b) { 146entry: 147 %sub = sub <8 x i16> %a, %b 148 ret <8 x i16> %sub 149} 150 151; CHECK-NEXT: define internal <8 x i16> @SubV8I16(<8 x i16> %a, <8 x i16> %b) { 152; CHECK-NEXT: entry: 153; CHECK-NEXT: %sub = sub <8 x i16> %a, %b 154; CHECK-NEXT: ret <8 x i16> %sub 155; CHECK-NEXT: } 156 157define internal <4 x i32> @SubV4I32(<4 x i32> %a, <4 x i32> %b) { 158entry: 159 %sub = sub <4 x i32> %a, %b 160 ret <4 x i32> %sub 161} 162 163; CHECK-NEXT: define internal <4 x i32> @SubV4I32(<4 x i32> %a, <4 x i32> %b) { 164; CHECK-NEXT: entry: 165; CHECK-NEXT: %sub = sub <4 x i32> %a, %b 166; CHECK-NEXT: ret <4 x i32> %sub 167; CHECK-NEXT: } 168 169define internal float @SubFloat(float %a, float %b) { 170entry: 171 %sub = fsub float %a, %b 172 ret float %sub 173} 174 175; CHECK-NEXT: define internal float @SubFloat(float %a, float %b) { 176; CHECK-NEXT: entry: 177; CHECK-NEXT: %sub = fsub float %a, %b 178; CHECK-NEXT: ret float %sub 179; CHECK-NEXT: } 180 181define internal double @SubDouble(double %a, double %b) { 182entry: 183 %sub = fsub double %a, %b 184 ret double %sub 185} 186 187; CHECK-NEXT: define internal double @SubDouble(double %a, double %b) { 188; CHECK-NEXT: entry: 189; CHECK-NEXT: %sub = fsub double %a, %b 190; CHECK-NEXT: ret double %sub 191; CHECK-NEXT: } 192 193define internal <4 x float> @SubV4Float(<4 x float> %a, <4 x float> %b) { 194entry: 195 %sub = fsub <4 x float> %a, %b 196 ret <4 x float> %sub 197} 198 199; CHECK-NEXT: define internal <4 x float> @SubV4Float(<4 x float> %a, <4 x float> %b) { 200; CHECK-NEXT: entry: 201; CHECK-NEXT: %sub = fsub <4 x float> %a, %b 202; CHECK-NEXT: ret <4 x float> %sub 203; CHECK-NEXT: } 204 205; TODO(kschimpf): mul i8/i16. Needs bitcasts. 206 207define internal i32 @MulI32(i32 %a, i32 %b) { 208entry: 209 %mul = mul i32 %b, %a 210 ret i32 %mul 211} 212 213; CHECK-NEXT: define internal i32 @MulI32(i32 %a, i32 %b) { 214; CHECK-NEXT: entry: 215; CHECK-NEXT: %mul = mul i32 %b, %a 216; CHECK-NEXT: ret i32 %mul 217; CHECK-NEXT: } 218 219define internal i64 @MulI64(i64 %a, i64 %b) { 220entry: 221 %mul = mul i64 %b, %a 222 ret i64 %mul 223} 224 225; CHECK-NEXT: define internal i64 @MulI64(i64 %a, i64 %b) { 226; CHECK-NEXT: entry: 227; CHECK-NEXT: %mul = mul i64 %b, %a 228; CHECK-NEXT: ret i64 %mul 229; CHECK-NEXT: } 230 231define internal <16 x i8> @MulV16I8(<16 x i8> %a, <16 x i8> %b) { 232entry: 233 %mul = mul <16 x i8> %b, %a 234 ret <16 x i8> %mul 235} 236 237; CHECK-NEXT: define internal <16 x i8> @MulV16I8(<16 x i8> %a, <16 x i8> %b) { 238; CHECK-NEXT: entry: 239; CHECK-NEXT: %mul = mul <16 x i8> %b, %a 240; CHECK-NEXT: ret <16 x i8> %mul 241; CHECK-NEXT: } 242 243define internal float @MulFloat(float %a, float %b) { 244entry: 245 %mul = fmul float %b, %a 246 ret float %mul 247} 248 249; CHECK-NEXT: define internal float @MulFloat(float %a, float %b) { 250; CHECK-NEXT: entry: 251; CHECK-NEXT: %mul = fmul float %b, %a 252; CHECK-NEXT: ret float %mul 253; CHECK-NEXT: } 254 255define internal double @MulDouble(double %a, double %b) { 256entry: 257 %mul = fmul double %b, %a 258 ret double %mul 259} 260 261; CHECK-NEXT: define internal double @MulDouble(double %a, double %b) { 262; CHECK-NEXT: entry: 263; CHECK-NEXT: %mul = fmul double %b, %a 264; CHECK-NEXT: ret double %mul 265; CHECK-NEXT: } 266 267define internal <4 x float> @MulV4Float(<4 x float> %a, <4 x float> %b) { 268entry: 269 %mul = fmul <4 x float> %b, %a 270 ret <4 x float> %mul 271} 272 273; CHECK-NEXT: define internal <4 x float> @MulV4Float(<4 x float> %a, <4 x float> %b) { 274; CHECK-NEXT: entry: 275; CHECK-NEXT: %mul = fmul <4 x float> %b, %a 276; CHECK-NEXT: ret <4 x float> %mul 277; CHECK-NEXT: } 278 279; TODO(kschimpf): sdiv i8/i16. Needs bitcasts. 280 281define internal i32 @SdivI32(i32 %a, i32 %b) { 282entry: 283 %div = sdiv i32 %a, %b 284 ret i32 %div 285} 286 287; CHECK-NEXT: define internal i32 @SdivI32(i32 %a, i32 %b) { 288; CHECK-NEXT: entry: 289; CHECK-NEXT: %div = sdiv i32 %a, %b 290; CHECK-NEXT: ret i32 %div 291; CHECK-NEXT: } 292 293define internal i64 @SdivI64(i64 %a, i64 %b) { 294entry: 295 %div = sdiv i64 %a, %b 296 ret i64 %div 297} 298 299; CHECK-NEXT: define internal i64 @SdivI64(i64 %a, i64 %b) { 300; CHECK-NEXT: entry: 301; CHECK-NEXT: %div = sdiv i64 %a, %b 302; CHECK-NEXT: ret i64 %div 303; CHECK-NEXT: } 304 305define internal <16 x i8> @SdivV16I8(<16 x i8> %a, <16 x i8> %b) { 306entry: 307 %div = sdiv <16 x i8> %a, %b 308 ret <16 x i8> %div 309} 310 311; CHECK-NEXT: define internal <16 x i8> @SdivV16I8(<16 x i8> %a, <16 x i8> %b) { 312; CHECK-NEXT: entry: 313; CHECK-NEXT: %div = sdiv <16 x i8> %a, %b 314; CHECK-NEXT: ret <16 x i8> %div 315; CHECK-NEXT: } 316 317define internal <8 x i16> @SdivV8I16(<8 x i16> %a, <8 x i16> %b) { 318entry: 319 %div = sdiv <8 x i16> %a, %b 320 ret <8 x i16> %div 321} 322 323; CHECK-NEXT: define internal <8 x i16> @SdivV8I16(<8 x i16> %a, <8 x i16> %b) { 324; CHECK-NEXT: entry: 325; CHECK-NEXT: %div = sdiv <8 x i16> %a, %b 326; CHECK-NEXT: ret <8 x i16> %div 327; CHECK-NEXT: } 328 329define internal <4 x i32> @SdivV4I32(<4 x i32> %a, <4 x i32> %b) { 330entry: 331 %div = sdiv <4 x i32> %a, %b 332 ret <4 x i32> %div 333} 334 335; CHECK-NEXT: define internal <4 x i32> @SdivV4I32(<4 x i32> %a, <4 x i32> %b) { 336; CHECK-NEXT: entry: 337; CHECK-NEXT: %div = sdiv <4 x i32> %a, %b 338; CHECK-NEXT: ret <4 x i32> %div 339; CHECK-NEXT: } 340 341; TODO(kschimpf): srem i8/i16. Needs bitcasts. 342 343define internal i32 @SremI32(i32 %a, i32 %b) { 344entry: 345 %rem = srem i32 %a, %b 346 ret i32 %rem 347} 348 349; CHECK-NEXT: define internal i32 @SremI32(i32 %a, i32 %b) { 350; CHECK-NEXT: entry: 351; CHECK-NEXT: %rem = srem i32 %a, %b 352; CHECK-NEXT: ret i32 %rem 353; CHECK-NEXT: } 354 355define internal i64 @SremI64(i64 %a, i64 %b) { 356entry: 357 %rem = srem i64 %a, %b 358 ret i64 %rem 359} 360 361; CHECK-NEXT: define internal i64 @SremI64(i64 %a, i64 %b) { 362; CHECK-NEXT: entry: 363; CHECK-NEXT: %rem = srem i64 %a, %b 364; CHECK-NEXT: ret i64 %rem 365; CHECK-NEXT: } 366 367define internal <16 x i8> @SremV16I8(<16 x i8> %a, <16 x i8> %b) { 368entry: 369 %rem = srem <16 x i8> %a, %b 370 ret <16 x i8> %rem 371} 372 373; CHECK-NEXT: define internal <16 x i8> @SremV16I8(<16 x i8> %a, <16 x i8> %b) { 374; CHECK-NEXT: entry: 375; CHECK-NEXT: %rem = srem <16 x i8> %a, %b 376; CHECK-NEXT: ret <16 x i8> %rem 377; CHECK-NEXT: } 378 379define internal <8 x i16> @SremV8I16(<8 x i16> %a, <8 x i16> %b) { 380entry: 381 %rem = srem <8 x i16> %a, %b 382 ret <8 x i16> %rem 383} 384 385; CHECK-NEXT: define internal <8 x i16> @SremV8I16(<8 x i16> %a, <8 x i16> %b) { 386; CHECK-NEXT: entry: 387; CHECK-NEXT: %rem = srem <8 x i16> %a, %b 388; CHECK-NEXT: ret <8 x i16> %rem 389; CHECK-NEXT: } 390 391define internal <4 x i32> @SremV4I32(<4 x i32> %a, <4 x i32> %b) { 392entry: 393 %rem = srem <4 x i32> %a, %b 394 ret <4 x i32> %rem 395} 396 397; CHECK-NEXT: define internal <4 x i32> @SremV4I32(<4 x i32> %a, <4 x i32> %b) { 398; CHECK-NEXT: entry: 399; CHECK-NEXT: %rem = srem <4 x i32> %a, %b 400; CHECK-NEXT: ret <4 x i32> %rem 401; CHECK-NEXT: } 402 403; TODO(kschimpf): udiv i8/i16. Needs bitcasts. 404 405define internal i32 @UdivI32(i32 %a, i32 %b) { 406entry: 407 %div = udiv i32 %a, %b 408 ret i32 %div 409} 410 411; CHECK-NEXT: define internal i32 @UdivI32(i32 %a, i32 %b) { 412; CHECK-NEXT: entry: 413; CHECK-NEXT: %div = udiv i32 %a, %b 414; CHECK-NEXT: ret i32 %div 415; CHECK-NEXT: } 416 417define internal i64 @UdivI64(i64 %a, i64 %b) { 418entry: 419 %div = udiv i64 %a, %b 420 ret i64 %div 421} 422 423; CHECK-NEXT: define internal i64 @UdivI64(i64 %a, i64 %b) { 424; CHECK-NEXT: entry: 425; CHECK-NEXT: %div = udiv i64 %a, %b 426; CHECK-NEXT: ret i64 %div 427; CHECK-NEXT: } 428 429define internal <16 x i8> @UdivV16I8(<16 x i8> %a, <16 x i8> %b) { 430entry: 431 %div = udiv <16 x i8> %a, %b 432 ret <16 x i8> %div 433} 434 435; CHECK-NEXT: define internal <16 x i8> @UdivV16I8(<16 x i8> %a, <16 x i8> %b) { 436; CHECK-NEXT: entry: 437; CHECK-NEXT: %div = udiv <16 x i8> %a, %b 438; CHECK-NEXT: ret <16 x i8> %div 439; CHECK-NEXT: } 440 441define internal <8 x i16> @UdivV8I16(<8 x i16> %a, <8 x i16> %b) { 442entry: 443 %div = udiv <8 x i16> %a, %b 444 ret <8 x i16> %div 445} 446 447; CHECK-NEXT: define internal <8 x i16> @UdivV8I16(<8 x i16> %a, <8 x i16> %b) { 448; CHECK-NEXT: entry: 449; CHECK-NEXT: %div = udiv <8 x i16> %a, %b 450; CHECK-NEXT: ret <8 x i16> %div 451; CHECK-NEXT: } 452 453define internal <4 x i32> @UdivV4I32(<4 x i32> %a, <4 x i32> %b) { 454entry: 455 %div = udiv <4 x i32> %a, %b 456 ret <4 x i32> %div 457} 458 459; CHECK-NEXT: define internal <4 x i32> @UdivV4I32(<4 x i32> %a, <4 x i32> %b) { 460; CHECK-NEXT: entry: 461; CHECK-NEXT: %div = udiv <4 x i32> %a, %b 462; CHECK-NEXT: ret <4 x i32> %div 463; CHECK-NEXT: } 464 465; TODO(kschimpf): urem i8/i16. Needs bitcasts. 466 467define internal i32 @UremI32(i32 %a, i32 %b) { 468entry: 469 %rem = urem i32 %a, %b 470 ret i32 %rem 471} 472 473; CHECK-NEXT: define internal i32 @UremI32(i32 %a, i32 %b) { 474; CHECK-NEXT: entry: 475; CHECK-NEXT: %rem = urem i32 %a, %b 476; CHECK-NEXT: ret i32 %rem 477; CHECK-NEXT: } 478 479define internal i64 @UremI64(i64 %a, i64 %b) { 480entry: 481 %rem = urem i64 %a, %b 482 ret i64 %rem 483} 484 485; CHECK-NEXT: define internal i64 @UremI64(i64 %a, i64 %b) { 486; CHECK-NEXT: entry: 487; CHECK-NEXT: %rem = urem i64 %a, %b 488; CHECK-NEXT: ret i64 %rem 489; CHECK-NEXT: } 490 491define internal <16 x i8> @UremV16I8(<16 x i8> %a, <16 x i8> %b) { 492entry: 493 %rem = urem <16 x i8> %a, %b 494 ret <16 x i8> %rem 495} 496 497; CHECK-NEXT: define internal <16 x i8> @UremV16I8(<16 x i8> %a, <16 x i8> %b) { 498; CHECK-NEXT: entry: 499; CHECK-NEXT: %rem = urem <16 x i8> %a, %b 500; CHECK-NEXT: ret <16 x i8> %rem 501; CHECK-NEXT: } 502 503define internal <8 x i16> @UremV8I16(<8 x i16> %a, <8 x i16> %b) { 504entry: 505 %rem = urem <8 x i16> %a, %b 506 ret <8 x i16> %rem 507} 508 509; CHECK-NEXT: define internal <8 x i16> @UremV8I16(<8 x i16> %a, <8 x i16> %b) { 510; CHECK-NEXT: entry: 511; CHECK-NEXT: %rem = urem <8 x i16> %a, %b 512; CHECK-NEXT: ret <8 x i16> %rem 513; CHECK-NEXT: } 514 515define internal <4 x i32> @UremV4I32(<4 x i32> %a, <4 x i32> %b) { 516entry: 517 %rem = urem <4 x i32> %a, %b 518 ret <4 x i32> %rem 519} 520 521; CHECK-NEXT: define internal <4 x i32> @UremV4I32(<4 x i32> %a, <4 x i32> %b) { 522; CHECK-NEXT: entry: 523; CHECK-NEXT: %rem = urem <4 x i32> %a, %b 524; CHECK-NEXT: ret <4 x i32> %rem 525; CHECK-NEXT: } 526 527define internal float @fdivFloat(float %a, float %b) { 528entry: 529 %div = fdiv float %a, %b 530 ret float %div 531} 532 533; CHECK-NEXT: define internal float @fdivFloat(float %a, float %b) { 534; CHECK-NEXT: entry: 535; CHECK-NEXT: %div = fdiv float %a, %b 536; CHECK-NEXT: ret float %div 537; CHECK-NEXT: } 538 539define internal double @fdivDouble(double %a, double %b) { 540entry: 541 %div = fdiv double %a, %b 542 ret double %div 543} 544 545; CHECK-NEXT: define internal double @fdivDouble(double %a, double %b) { 546; CHECK-NEXT: entry: 547; CHECK-NEXT: %div = fdiv double %a, %b 548; CHECK-NEXT: ret double %div 549; CHECK-NEXT: } 550 551define internal <4 x float> @fdivV4Float(<4 x float> %a, <4 x float> %b) { 552entry: 553 %div = fdiv <4 x float> %a, %b 554 ret <4 x float> %div 555} 556 557; CHECK-NEXT: define internal <4 x float> @fdivV4Float(<4 x float> %a, <4 x float> %b) { 558; CHECK-NEXT: entry: 559; CHECK-NEXT: %div = fdiv <4 x float> %a, %b 560; CHECK-NEXT: ret <4 x float> %div 561; CHECK-NEXT: } 562 563define internal float @fremFloat(float %a, float %b) { 564entry: 565 %rem = frem float %a, %b 566 ret float %rem 567} 568 569; CHECK-NEXT: define internal float @fremFloat(float %a, float %b) { 570; CHECK-NEXT: entry: 571; CHECK-NEXT: %rem = frem float %a, %b 572; CHECK-NEXT: ret float %rem 573; CHECK-NEXT: } 574 575define internal double @fremDouble(double %a, double %b) { 576entry: 577 %rem = frem double %a, %b 578 ret double %rem 579} 580 581; CHECK-NEXT: define internal double @fremDouble(double %a, double %b) { 582; CHECK-NEXT: entry: 583; CHECK-NEXT: %rem = frem double %a, %b 584; CHECK-NEXT: ret double %rem 585; CHECK-NEXT: } 586 587define internal <4 x float> @fremV4Float(<4 x float> %a, <4 x float> %b) { 588entry: 589 %rem = frem <4 x float> %a, %b 590 ret <4 x float> %rem 591} 592 593; CHECK-NEXT: define internal <4 x float> @fremV4Float(<4 x float> %a, <4 x float> %b) { 594; CHECK-NEXT: entry: 595; CHECK-NEXT: %rem = frem <4 x float> %a, %b 596; CHECK-NEXT: ret <4 x float> %rem 597; CHECK-NEXT: } 598 599; TODO(kschimpf): and i1/i8/i16. Needs bitcasts. 600 601define internal i32 @AndI32(i32 %a, i32 %b) { 602entry: 603 %and = and i32 %b, %a 604 ret i32 %and 605} 606 607; CHECK-NEXT: define internal i32 @AndI32(i32 %a, i32 %b) { 608; CHECK-NEXT: entry: 609; CHECK-NEXT: %and = and i32 %b, %a 610; CHECK-NEXT: ret i32 %and 611; CHECK-NEXT: } 612 613define internal i64 @AndI64(i64 %a, i64 %b) { 614entry: 615 %and = and i64 %b, %a 616 ret i64 %and 617} 618 619; CHECK-NEXT: define internal i64 @AndI64(i64 %a, i64 %b) { 620; CHECK-NEXT: entry: 621; CHECK-NEXT: %and = and i64 %b, %a 622; CHECK-NEXT: ret i64 %and 623; CHECK-NEXT: } 624 625define internal <16 x i8> @AndV16I8(<16 x i8> %a, <16 x i8> %b) { 626entry: 627 %and = and <16 x i8> %b, %a 628 ret <16 x i8> %and 629} 630 631; CHECK-NEXT: define internal <16 x i8> @AndV16I8(<16 x i8> %a, <16 x i8> %b) { 632; CHECK-NEXT: entry: 633; CHECK-NEXT: %and = and <16 x i8> %b, %a 634; CHECK-NEXT: ret <16 x i8> %and 635; CHECK-NEXT: } 636 637define internal <8 x i16> @AndV8I16(<8 x i16> %a, <8 x i16> %b) { 638entry: 639 %and = and <8 x i16> %b, %a 640 ret <8 x i16> %and 641} 642 643; CHECK-NEXT: define internal <8 x i16> @AndV8I16(<8 x i16> %a, <8 x i16> %b) { 644; CHECK-NEXT: entry: 645; CHECK-NEXT: %and = and <8 x i16> %b, %a 646; CHECK-NEXT: ret <8 x i16> %and 647; CHECK-NEXT: } 648 649define internal <4 x i32> @AndV4I32(<4 x i32> %a, <4 x i32> %b) { 650entry: 651 %and = and <4 x i32> %b, %a 652 ret <4 x i32> %and 653} 654 655; CHECK-NEXT: define internal <4 x i32> @AndV4I32(<4 x i32> %a, <4 x i32> %b) { 656; CHECK-NEXT: entry: 657; CHECK-NEXT: %and = and <4 x i32> %b, %a 658; CHECK-NEXT: ret <4 x i32> %and 659; CHECK-NEXT: } 660 661; TODO(kschimpf): or i1/i8/i16. Needs bitcasts. 662 663define internal i32 @OrI32(i32 %a, i32 %b) { 664entry: 665 %or = or i32 %b, %a 666 ret i32 %or 667} 668 669; CHECK-NEXT: define internal i32 @OrI32(i32 %a, i32 %b) { 670; CHECK-NEXT: entry: 671; CHECK-NEXT: %or = or i32 %b, %a 672; CHECK-NEXT: ret i32 %or 673; CHECK-NEXT: } 674 675define internal i64 @OrI64(i64 %a, i64 %b) { 676entry: 677 %or = or i64 %b, %a 678 ret i64 %or 679} 680 681; CHECK-NEXT: define internal i64 @OrI64(i64 %a, i64 %b) { 682; CHECK-NEXT: entry: 683; CHECK-NEXT: %or = or i64 %b, %a 684; CHECK-NEXT: ret i64 %or 685; CHECK-NEXT: } 686 687define internal <16 x i8> @OrV16I8(<16 x i8> %a, <16 x i8> %b) { 688entry: 689 %or = or <16 x i8> %b, %a 690 ret <16 x i8> %or 691} 692 693; CHECK-NEXT: define internal <16 x i8> @OrV16I8(<16 x i8> %a, <16 x i8> %b) { 694; CHECK-NEXT: entry: 695; CHECK-NEXT: %or = or <16 x i8> %b, %a 696; CHECK-NEXT: ret <16 x i8> %or 697; CHECK-NEXT: } 698 699define internal <8 x i16> @OrV8I16(<8 x i16> %a, <8 x i16> %b) { 700entry: 701 %or = or <8 x i16> %b, %a 702 ret <8 x i16> %or 703} 704 705; CHECK-NEXT: define internal <8 x i16> @OrV8I16(<8 x i16> %a, <8 x i16> %b) { 706; CHECK-NEXT: entry: 707; CHECK-NEXT: %or = or <8 x i16> %b, %a 708; CHECK-NEXT: ret <8 x i16> %or 709; CHECK-NEXT: } 710 711define internal <4 x i32> @OrV4I32(<4 x i32> %a, <4 x i32> %b) { 712entry: 713 %or = or <4 x i32> %b, %a 714 ret <4 x i32> %or 715} 716 717; CHECK-NEXT: define internal <4 x i32> @OrV4I32(<4 x i32> %a, <4 x i32> %b) { 718; CHECK-NEXT: entry: 719; CHECK-NEXT: %or = or <4 x i32> %b, %a 720; CHECK-NEXT: ret <4 x i32> %or 721; CHECK-NEXT: } 722 723; TODO(kschimpf): xor i1/i8/i16. Needs bitcasts. 724 725define internal i32 @XorI32(i32 %a, i32 %b) { 726entry: 727 %xor = xor i32 %b, %a 728 ret i32 %xor 729} 730 731; CHECK-NEXT: define internal i32 @XorI32(i32 %a, i32 %b) { 732; CHECK-NEXT: entry: 733; CHECK-NEXT: %xor = xor i32 %b, %a 734; CHECK-NEXT: ret i32 %xor 735; CHECK-NEXT: } 736 737define internal i64 @XorI64(i64 %a, i64 %b) { 738entry: 739 %xor = xor i64 %b, %a 740 ret i64 %xor 741} 742 743; CHECK-NEXT: define internal i64 @XorI64(i64 %a, i64 %b) { 744; CHECK-NEXT: entry: 745; CHECK-NEXT: %xor = xor i64 %b, %a 746; CHECK-NEXT: ret i64 %xor 747; CHECK-NEXT: } 748 749define internal <16 x i8> @XorV16I8(<16 x i8> %a, <16 x i8> %b) { 750entry: 751 %xor = xor <16 x i8> %b, %a 752 ret <16 x i8> %xor 753} 754 755; CHECK-NEXT: define internal <16 x i8> @XorV16I8(<16 x i8> %a, <16 x i8> %b) { 756; CHECK-NEXT: entry: 757; CHECK-NEXT: %xor = xor <16 x i8> %b, %a 758; CHECK-NEXT: ret <16 x i8> %xor 759; CHECK-NEXT: } 760 761define internal <8 x i16> @XorV8I16(<8 x i16> %a, <8 x i16> %b) { 762entry: 763 %xor = xor <8 x i16> %b, %a 764 ret <8 x i16> %xor 765} 766 767; CHECK-NEXT: define internal <8 x i16> @XorV8I16(<8 x i16> %a, <8 x i16> %b) { 768; CHECK-NEXT: entry: 769; CHECK-NEXT: %xor = xor <8 x i16> %b, %a 770; CHECK-NEXT: ret <8 x i16> %xor 771; CHECK-NEXT: } 772 773define internal <4 x i32> @XorV4I32(<4 x i32> %a, <4 x i32> %b) { 774entry: 775 %xor = xor <4 x i32> %b, %a 776 ret <4 x i32> %xor 777} 778 779; CHECK-NEXT: define internal <4 x i32> @XorV4I32(<4 x i32> %a, <4 x i32> %b) { 780; CHECK-NEXT: entry: 781; CHECK-NEXT: %xor = xor <4 x i32> %b, %a 782; CHECK-NEXT: ret <4 x i32> %xor 783; CHECK-NEXT: } 784 785; TODO(kschimpf): shl i8/i16. Needs bitcasts. 786 787define internal i32 @ShlI32(i32 %a, i32 %b) { 788entry: 789 %shl = shl i32 %b, %a 790 ret i32 %shl 791} 792 793; CHECK-NEXT: define internal i32 @ShlI32(i32 %a, i32 %b) { 794; CHECK-NEXT: entry: 795; CHECK-NEXT: %shl = shl i32 %b, %a 796; CHECK-NEXT: ret i32 %shl 797; CHECK-NEXT: } 798 799define internal i64 @ShlI64(i64 %a, i64 %b) { 800entry: 801 %shl = shl i64 %b, %a 802 ret i64 %shl 803} 804 805; CHECK-NEXT: define internal i64 @ShlI64(i64 %a, i64 %b) { 806; CHECK-NEXT: entry: 807; CHECK-NEXT: %shl = shl i64 %b, %a 808; CHECK-NEXT: ret i64 %shl 809; CHECK-NEXT: } 810 811define internal <16 x i8> @ShlV16I8(<16 x i8> %a, <16 x i8> %b) { 812entry: 813 %shl = shl <16 x i8> %b, %a 814 ret <16 x i8> %shl 815} 816 817; CHECK-NEXT: define internal <16 x i8> @ShlV16I8(<16 x i8> %a, <16 x i8> %b) { 818; CHECK-NEXT: entry: 819; CHECK-NEXT: %shl = shl <16 x i8> %b, %a 820; CHECK-NEXT: ret <16 x i8> %shl 821; CHECK-NEXT: } 822 823define internal <8 x i16> @ShlV8I16(<8 x i16> %a, <8 x i16> %b) { 824entry: 825 %shl = shl <8 x i16> %b, %a 826 ret <8 x i16> %shl 827} 828 829; CHECK-NEXT: define internal <8 x i16> @ShlV8I16(<8 x i16> %a, <8 x i16> %b) { 830; CHECK-NEXT: entry: 831; CHECK-NEXT: %shl = shl <8 x i16> %b, %a 832; CHECK-NEXT: ret <8 x i16> %shl 833; CHECK-NEXT: } 834 835define internal <4 x i32> @ShlV4I32(<4 x i32> %a, <4 x i32> %b) { 836entry: 837 %shl = shl <4 x i32> %b, %a 838 ret <4 x i32> %shl 839} 840 841; CHECK-NEXT: define internal <4 x i32> @ShlV4I32(<4 x i32> %a, <4 x i32> %b) { 842; CHECK-NEXT: entry: 843; CHECK-NEXT: %shl = shl <4 x i32> %b, %a 844; CHECK-NEXT: ret <4 x i32> %shl 845; CHECK-NEXT: } 846 847; TODO(kschimpf): ashr i8/i16. Needs bitcasts. 848 849define internal i32 @ashrI32(i32 %a, i32 %b) { 850entry: 851 %ashr = ashr i32 %b, %a 852 ret i32 %ashr 853} 854 855; CHECK-NEXT: define internal i32 @ashrI32(i32 %a, i32 %b) { 856; CHECK-NEXT: entry: 857; CHECK-NEXT: %ashr = ashr i32 %b, %a 858; CHECK-NEXT: ret i32 %ashr 859; CHECK-NEXT: } 860 861define internal i64 @AshrI64(i64 %a, i64 %b) { 862entry: 863 %ashr = ashr i64 %b, %a 864 ret i64 %ashr 865} 866 867; CHECK-NEXT: define internal i64 @AshrI64(i64 %a, i64 %b) { 868; CHECK-NEXT: entry: 869; CHECK-NEXT: %ashr = ashr i64 %b, %a 870; CHECK-NEXT: ret i64 %ashr 871; CHECK-NEXT: } 872 873define internal <16 x i8> @AshrV16I8(<16 x i8> %a, <16 x i8> %b) { 874entry: 875 %ashr = ashr <16 x i8> %b, %a 876 ret <16 x i8> %ashr 877} 878 879; CHECK-NEXT: define internal <16 x i8> @AshrV16I8(<16 x i8> %a, <16 x i8> %b) { 880; CHECK-NEXT: entry: 881; CHECK-NEXT: %ashr = ashr <16 x i8> %b, %a 882; CHECK-NEXT: ret <16 x i8> %ashr 883; CHECK-NEXT: } 884 885define internal <8 x i16> @AshrV8I16(<8 x i16> %a, <8 x i16> %b) { 886entry: 887 %ashr = ashr <8 x i16> %b, %a 888 ret <8 x i16> %ashr 889} 890 891; CHECK-NEXT: define internal <8 x i16> @AshrV8I16(<8 x i16> %a, <8 x i16> %b) { 892; CHECK-NEXT: entry: 893; CHECK-NEXT: %ashr = ashr <8 x i16> %b, %a 894; CHECK-NEXT: ret <8 x i16> %ashr 895; CHECK-NEXT: } 896 897define internal <4 x i32> @AshrV4I32(<4 x i32> %a, <4 x i32> %b) { 898entry: 899 %ashr = ashr <4 x i32> %b, %a 900 ret <4 x i32> %ashr 901} 902 903; CHECK-NEXT: define internal <4 x i32> @AshrV4I32(<4 x i32> %a, <4 x i32> %b) { 904; CHECK-NEXT: entry: 905; CHECK-NEXT: %ashr = ashr <4 x i32> %b, %a 906; CHECK-NEXT: ret <4 x i32> %ashr 907; CHECK-NEXT: } 908 909; TODO(kschimpf): lshr i8/i16. Needs bitcasts. 910 911define internal i32 @lshrI32(i32 %a, i32 %b) { 912entry: 913 %lshr = lshr i32 %b, %a 914 ret i32 %lshr 915} 916 917; CHECK-NEXT: define internal i32 @lshrI32(i32 %a, i32 %b) { 918; CHECK-NEXT: entry: 919; CHECK-NEXT: %lshr = lshr i32 %b, %a 920; CHECK-NEXT: ret i32 %lshr 921; CHECK-NEXT: } 922 923define internal i64 @LshrI64(i64 %a, i64 %b) { 924entry: 925 %lshr = lshr i64 %b, %a 926 ret i64 %lshr 927} 928 929; CHECK-NEXT: define internal i64 @LshrI64(i64 %a, i64 %b) { 930; CHECK-NEXT: entry: 931; CHECK-NEXT: %lshr = lshr i64 %b, %a 932; CHECK-NEXT: ret i64 %lshr 933; CHECK-NEXT: } 934 935define internal <16 x i8> @LshrV16I8(<16 x i8> %a, <16 x i8> %b) { 936entry: 937 %lshr = lshr <16 x i8> %b, %a 938 ret <16 x i8> %lshr 939} 940 941; CHECK-NEXT: define internal <16 x i8> @LshrV16I8(<16 x i8> %a, <16 x i8> %b) { 942; CHECK-NEXT: entry: 943; CHECK-NEXT: %lshr = lshr <16 x i8> %b, %a 944; CHECK-NEXT: ret <16 x i8> %lshr 945; CHECK-NEXT: } 946 947define internal <8 x i16> @LshrV8I16(<8 x i16> %a, <8 x i16> %b) { 948entry: 949 %lshr = lshr <8 x i16> %b, %a 950 ret <8 x i16> %lshr 951} 952 953; CHECK-NEXT: define internal <8 x i16> @LshrV8I16(<8 x i16> %a, <8 x i16> %b) { 954; CHECK-NEXT: entry: 955; CHECK-NEXT: %lshr = lshr <8 x i16> %b, %a 956; CHECK-NEXT: ret <8 x i16> %lshr 957; CHECK-NEXT: } 958 959define internal <4 x i32> @LshrV4I32(<4 x i32> %a, <4 x i32> %b) { 960entry: 961 %lshr = lshr <4 x i32> %b, %a 962 ret <4 x i32> %lshr 963} 964 965; CHECK-NEXT: define internal <4 x i32> @LshrV4I32(<4 x i32> %a, <4 x i32> %b) { 966; CHECK-NEXT: entry: 967; CHECK-NEXT: %lshr = lshr <4 x i32> %b, %a 968; CHECK-NEXT: ret <4 x i32> %lshr 969; CHECK-NEXT: } 970 971; NOIR: Total across all functions 972