|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 |
| 2 | +; RUN: llc -O3 -mtriple=amdgcn -mcpu=fiji %s -o - | FileCheck %s |
| 3 | + |
| 4 | +define i1 @basic_eq_i16_3x5(i16 %arg) { |
| 5 | +; CHECK-LABEL: basic_eq_i16_3x5: |
| 6 | +; CHECK: ; %bb.0: ; %entry |
| 7 | +; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 8 | +; CHECK-NEXT: v_and_b32_e32 v0, 0x7fff, v0 |
| 9 | +; CHECK-NEXT: v_cmp_eq_u16_e32 vcc, 0, v0 |
| 10 | +; CHECK-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc |
| 11 | +; CHECK-NEXT: s_setpc_b64 s[30:31] |
| 12 | +entry: |
| 13 | + %a = and i16 %arg, 31 |
| 14 | + %sh5 = lshr i16 %arg, 5 |
| 15 | + %b = and i16 %sh5, 31 |
| 16 | + %or = or i16 %a, %b |
| 17 | + %sh10 = lshr i16 %arg, 10 |
| 18 | + %c = and i16 %sh10, 31 |
| 19 | + %or1 = or i16 %or, %c |
| 20 | + %cmp = icmp eq i16 %or1, 0 |
| 21 | + ret i1 %cmp |
| 22 | +} |
| 23 | + |
| 24 | +define i1 @basic_eq_i32_3x5(i32 %arg) { |
| 25 | +; CHECK-LABEL: basic_eq_i32_3x5: |
| 26 | +; CHECK: ; %bb.0: ; %entry |
| 27 | +; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 28 | +; CHECK-NEXT: v_and_b32_e32 v0, 0x7fff, v0 |
| 29 | +; CHECK-NEXT: v_cmp_eq_u32_e32 vcc, 0, v0 |
| 30 | +; CHECK-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc |
| 31 | +; CHECK-NEXT: s_setpc_b64 s[30:31] |
| 32 | +entry: |
| 33 | + %a = and i32 %arg, 31 |
| 34 | + %sh5 = lshr i32 %arg, 5 |
| 35 | + %b = and i32 %sh5, 31 |
| 36 | + %or = or i32 %a, %b |
| 37 | + %sh10 = lshr i32 %arg, 10 |
| 38 | + %c = and i32 %sh10, 31 |
| 39 | + %or1 = or i32 %or, %c |
| 40 | + %cmp = icmp eq i32 %or1, 0 |
| 41 | + ret i1 %cmp |
| 42 | +} |
| 43 | + |
| 44 | +define i1 @basic_eq_i64_3x5(i64 %arg) { |
| 45 | +; CHECK-LABEL: basic_eq_i64_3x5: |
| 46 | +; CHECK: ; %bb.0: ; %entry |
| 47 | +; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 48 | +; CHECK-NEXT: v_and_b32_e32 v0, 0x7fff, v0 |
| 49 | +; CHECK-NEXT: v_cmp_eq_u32_e32 vcc, 0, v0 |
| 50 | +; CHECK-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc |
| 51 | +; CHECK-NEXT: s_setpc_b64 s[30:31] |
| 52 | +entry: |
| 53 | + %a = and i64 %arg, 31 |
| 54 | + %sh5 = lshr i64 %arg, 5 |
| 55 | + %b = and i64 %sh5, 31 |
| 56 | + %or = or i64 %a, %b |
| 57 | + %sh10 = lshr i64 %arg, 10 |
| 58 | + %c = and i64 %sh10, 31 |
| 59 | + %or1 = or i64 %or, %c |
| 60 | + %cmp = icmp eq i64 %or1, 0 |
| 61 | + ret i1 %cmp |
| 62 | +} |
| 63 | + |
| 64 | +define i1 @basic_ne_i32_3x5(i32 %arg) { |
| 65 | +; CHECK-LABEL: basic_ne_i32_3x5: |
| 66 | +; CHECK: ; %bb.0: ; %entry |
| 67 | +; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 68 | +; CHECK-NEXT: v_and_b32_e32 v0, 0x7fff, v0 |
| 69 | +; CHECK-NEXT: v_cmp_ne_u32_e32 vcc, 0, v0 |
| 70 | +; CHECK-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc |
| 71 | +; CHECK-NEXT: s_setpc_b64 s[30:31] |
| 72 | +entry: |
| 73 | + %a = and i32 %arg, 31 |
| 74 | + %sh5 = lshr i32 %arg, 5 |
| 75 | + %b = and i32 %sh5, 31 |
| 76 | + %or = or i32 %a, %b |
| 77 | + %sh10 = lshr i32 %arg, 10 |
| 78 | + %c = and i32 %sh10, 31 |
| 79 | + %or1 = or i32 %or, %c |
| 80 | + %cmp = icmp ne i32 %or1, 0 |
| 81 | + ret i1 %cmp |
| 82 | +} |
| 83 | + |
| 84 | +define i1 @eq_i32_3x5_holes_in_mask(i32 %arg) { |
| 85 | +; CHECK-LABEL: eq_i32_3x5_holes_in_mask: |
| 86 | +; CHECK: ; %bb.0: ; %entry |
| 87 | +; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 88 | +; CHECK-NEXT: v_and_b32_e32 v0, 0x7f9f, v0 |
| 89 | +; CHECK-NEXT: v_cmp_ne_u32_e32 vcc, 0, v0 |
| 90 | +; CHECK-NEXT: v_cndmask_b32_e64 v0, 0, 1, vcc |
| 91 | +; CHECK-NEXT: s_setpc_b64 s[30:31] |
| 92 | +entry: |
| 93 | + %a = and i32 %arg, 31 |
| 94 | + %sh5 = lshr i32 %arg, 7 |
| 95 | + %b = and i32 %sh5, 31 |
| 96 | + %or = or i32 %a, %b |
| 97 | + %sh10 = lshr i32 %arg, 10 |
| 98 | + %c = and i32 %sh10, 31 |
| 99 | + %or1 = or i32 %or, %c |
| 100 | + %cmp = icmp ne i32 %or1, 0 |
| 101 | + ret i1 %cmp |
| 102 | +} |
0 commit comments