|
4 | 4 | ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -mattr=+real-true16 < %s | FileCheck -check-prefixes=GFX11,GFX11-TRUE16 %s
|
5 | 5 | ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -mattr=-real-true16 < %s | FileCheck -check-prefixes=GFX11,GFX11-FAKE16 %s
|
6 | 6 |
|
7 |
| -; Ensure that the conversion of bitmasks affecting the sign bit on integers to srcmods |
| 7 | +; Demonstrate that the conversion of bitmasks affecting the sign bit on integers to srcmods |
8 | 8 | ; does not apply to canonicalizing instructions.
|
9 | 9 |
|
10 | 10 | define double @v_uitofp_i32_to_f64_abs(i32 %arg0) nounwind {
|
@@ -46,6 +46,46 @@ define double @v_uitofp_i32_to_f64_neg(i32 %arg0) nounwind {
|
46 | 46 | %cvt = uitofp i32 %arg0.neg to double
|
47 | 47 | ret double %cvt
|
48 | 48 | }
|
| 49 | + |
| 50 | +define double @s_uitofp_i32_to_f64_abs(i32 inreg %arg0) nounwind { |
| 51 | +; GCN-LABEL: s_uitofp_i32_to_f64_abs: |
| 52 | +; GCN: ; %bb.0: |
| 53 | +; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 54 | +; GCN-NEXT: s_bitset0_b32 s16, 31 |
| 55 | +; GCN-NEXT: v_cvt_f64_u32_e32 v[0:1], s16 |
| 56 | +; GCN-NEXT: s_setpc_b64 s[30:31] |
| 57 | +; |
| 58 | +; GFX11-LABEL: s_uitofp_i32_to_f64_abs: |
| 59 | +; GFX11: ; %bb.0: |
| 60 | +; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 61 | +; GFX11-NEXT: s_bitset0_b32 s0, 31 |
| 62 | +; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) |
| 63 | +; GFX11-NEXT: v_cvt_f64_u32_e32 v[0:1], s0 |
| 64 | +; GFX11-NEXT: s_setpc_b64 s[30:31] |
| 65 | + %arg0.abs = and i32 %arg0, u0x7fffffff |
| 66 | + %cvt = uitofp i32 %arg0.abs to double |
| 67 | + ret double %cvt |
| 68 | +} |
| 69 | + |
| 70 | +define double @s_uitofp_i32_to_f64_neg(i32 inreg %arg0) nounwind { |
| 71 | +; GCN-LABEL: s_uitofp_i32_to_f64_neg: |
| 72 | +; GCN: ; %bb.0: |
| 73 | +; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 74 | +; GCN-NEXT: s_and_b32 s4, s16, 0x80000000 |
| 75 | +; GCN-NEXT: v_cvt_f64_u32_e32 v[0:1], s4 |
| 76 | +; GCN-NEXT: s_setpc_b64 s[30:31] |
| 77 | +; |
| 78 | +; GFX11-LABEL: s_uitofp_i32_to_f64_neg: |
| 79 | +; GFX11: ; %bb.0: |
| 80 | +; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 81 | +; GFX11-NEXT: s_and_b32 s0, s0, 0x80000000 |
| 82 | +; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) |
| 83 | +; GFX11-NEXT: v_cvt_f64_u32_e32 v[0:1], s0 |
| 84 | +; GFX11-NEXT: s_setpc_b64 s[30:31] |
| 85 | + %arg0.neg = and i32 %arg0, u0x80000000 |
| 86 | + %cvt = uitofp i32 %arg0.neg to double |
| 87 | + ret double %cvt |
| 88 | +} |
49 | 89 | ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
|
50 | 90 | ; GFX11-FAKE16: {{.*}}
|
51 | 91 | ; GFX11-TRUE16: {{.*}}
|
|
0 commit comments