Skip to content

Commit a42040f

Browse files
committed
Add additional scalar test cases for completeness, even though srcmods
would not be applied.
1 parent 89ff393 commit a42040f

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

llvm/test/CodeGen/AMDGPU/integer-canonicalizing-src-modifiers.ll

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -mattr=+real-true16 < %s | FileCheck -check-prefixes=GFX11,GFX11-TRUE16 %s
55
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -mattr=-real-true16 < %s | FileCheck -check-prefixes=GFX11,GFX11-FAKE16 %s
66

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
88
; does not apply to canonicalizing instructions.
99

1010
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 {
4646
%cvt = uitofp i32 %arg0.neg to double
4747
ret double %cvt
4848
}
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+
}
4989
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
5090
; GFX11-FAKE16: {{.*}}
5191
; GFX11-TRUE16: {{.*}}

0 commit comments

Comments
 (0)