1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx900 < %s | FileCheck -check-prefix=GCN %s
3 ; RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1010 < %s | FileCheck -check-prefix=GFX10 %s
5 define float @v_constained_fadd_f32_fpexcept_strict(float %x, float %y) #0 {
6 ; GCN-LABEL: v_constained_fadd_f32_fpexcept_strict:
8 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9 ; GCN-NEXT: v_add_f32_e32 v0, v0, v1
10 ; GCN-NEXT: s_setpc_b64 s[30:31]
12 ; GFX10-LABEL: v_constained_fadd_f32_fpexcept_strict:
14 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
15 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
16 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v1
17 ; GFX10-NEXT: s_setpc_b64 s[30:31]
18 %val = call float @llvm.experimental.constrained.fadd.f32(float %x, float %y, metadata !"round.tonearest", metadata !"fpexcept.strict")
22 define float @v_constained_fadd_f32_fpexcept_ignore(float %x, float %y) #0 {
23 ; GCN-LABEL: v_constained_fadd_f32_fpexcept_ignore:
25 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
26 ; GCN-NEXT: v_add_f32_e32 v0, v0, v1
27 ; GCN-NEXT: s_setpc_b64 s[30:31]
29 ; GFX10-LABEL: v_constained_fadd_f32_fpexcept_ignore:
31 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
32 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
33 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v1
34 ; GFX10-NEXT: s_setpc_b64 s[30:31]
35 %val = call float @llvm.experimental.constrained.fadd.f32(float %x, float %y, metadata !"round.tonearest", metadata !"fpexcept.ignore")
39 define float @v_constained_fadd_f32_fpexcept_maytrap(float %x, float %y) #0 {
40 ; GCN-LABEL: v_constained_fadd_f32_fpexcept_maytrap:
42 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
43 ; GCN-NEXT: v_add_f32_e32 v0, v0, v1
44 ; GCN-NEXT: s_setpc_b64 s[30:31]
46 ; GFX10-LABEL: v_constained_fadd_f32_fpexcept_maytrap:
48 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
49 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
50 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v1
51 ; GFX10-NEXT: s_setpc_b64 s[30:31]
52 %val = call float @llvm.experimental.constrained.fadd.f32(float %x, float %y, metadata !"round.tonearest", metadata !"fpexcept.maytrap")
56 define <2 x float> @v_constained_fadd_v2f32_fpexcept_strict(<2 x float> %x, <2 x float> %y) #0 {
57 ; GCN-LABEL: v_constained_fadd_v2f32_fpexcept_strict:
59 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
60 ; GCN-NEXT: v_add_f32_e32 v0, v0, v2
61 ; GCN-NEXT: v_add_f32_e32 v1, v1, v3
62 ; GCN-NEXT: s_setpc_b64 s[30:31]
64 ; GFX10-LABEL: v_constained_fadd_v2f32_fpexcept_strict:
66 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
67 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
68 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
69 ; GFX10-NEXT: v_add_f32_e32 v1, v1, v3
70 ; GFX10-NEXT: s_setpc_b64 s[30:31]
71 %val = call <2 x float> @llvm.experimental.constrained.fadd.v2f32(<2 x float> %x, <2 x float> %y, metadata !"round.tonearest", metadata !"fpexcept.strict")
75 define <2 x float> @v_constained_fadd_v2f32_fpexcept_ignore(<2 x float> %x, <2 x float> %y) #0 {
76 ; GCN-LABEL: v_constained_fadd_v2f32_fpexcept_ignore:
78 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
79 ; GCN-NEXT: v_add_f32_e32 v0, v0, v2
80 ; GCN-NEXT: v_add_f32_e32 v1, v1, v3
81 ; GCN-NEXT: s_setpc_b64 s[30:31]
83 ; GFX10-LABEL: v_constained_fadd_v2f32_fpexcept_ignore:
85 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
86 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
87 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
88 ; GFX10-NEXT: v_add_f32_e32 v1, v1, v3
89 ; GFX10-NEXT: s_setpc_b64 s[30:31]
90 %val = call <2 x float> @llvm.experimental.constrained.fadd.v2f32(<2 x float> %x, <2 x float> %y, metadata !"round.tonearest", metadata !"fpexcept.ignore")
94 define <2 x float> @v_constained_fadd_v2f32_fpexcept_maytrap(<2 x float> %x, <2 x float> %y) #0 {
95 ; GCN-LABEL: v_constained_fadd_v2f32_fpexcept_maytrap:
97 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
98 ; GCN-NEXT: v_add_f32_e32 v0, v0, v2
99 ; GCN-NEXT: v_add_f32_e32 v1, v1, v3
100 ; GCN-NEXT: s_setpc_b64 s[30:31]
102 ; GFX10-LABEL: v_constained_fadd_v2f32_fpexcept_maytrap:
104 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
105 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
106 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v2
107 ; GFX10-NEXT: v_add_f32_e32 v1, v1, v3
108 ; GFX10-NEXT: s_setpc_b64 s[30:31]
109 %val = call <2 x float> @llvm.experimental.constrained.fadd.v2f32(<2 x float> %x, <2 x float> %y, metadata !"round.tonearest", metadata !"fpexcept.maytrap")
113 define <3 x float> @v_constained_fadd_v3f32_fpexcept_strict(<3 x float> %x, <3 x float> %y) #0 {
114 ; GCN-LABEL: v_constained_fadd_v3f32_fpexcept_strict:
116 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
117 ; GCN-NEXT: v_add_f32_e32 v0, v0, v3
118 ; GCN-NEXT: v_add_f32_e32 v1, v1, v4
119 ; GCN-NEXT: v_add_f32_e32 v2, v2, v5
120 ; GCN-NEXT: s_setpc_b64 s[30:31]
122 ; GFX10-LABEL: v_constained_fadd_v3f32_fpexcept_strict:
124 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
125 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
126 ; GFX10-NEXT: v_add_f32_e32 v0, v0, v3
127 ; GFX10-NEXT: v_add_f32_e32 v1, v1, v4
128 ; GFX10-NEXT: v_add_f32_e32 v2, v2, v5
129 ; GFX10-NEXT: s_setpc_b64 s[30:31]
130 %val = call <3 x float> @llvm.experimental.constrained.fadd.v3f32(<3 x float> %x, <3 x float> %y, metadata !"round.tonearest", metadata !"fpexcept.strict")
134 define amdgpu_ps float @s_constained_fadd_f32_fpexcept_strict(float inreg %x, float inreg %y) #0 {
135 ; GCN-LABEL: s_constained_fadd_f32_fpexcept_strict:
137 ; GCN-NEXT: v_mov_b32_e32 v0, s3
138 ; GCN-NEXT: v_add_f32_e32 v0, s2, v0
139 ; GCN-NEXT: ; return to shader part epilog
141 ; GFX10-LABEL: s_constained_fadd_f32_fpexcept_strict:
143 ; GFX10-NEXT: v_add_f32_e64 v0, s2, s3
144 ; GFX10-NEXT: ; return to shader part epilog
145 %val = call float @llvm.experimental.constrained.fadd.f32(float %x, float %y, metadata !"round.tonearest", metadata !"fpexcept.strict")
149 define float @v_constained_fadd_f32_fpexcept_strict_fabs_lhs(float %x, float %y) #0 {
150 ; GCN-LABEL: v_constained_fadd_f32_fpexcept_strict_fabs_lhs:
152 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
153 ; GCN-NEXT: v_add_f32_e64 v0, |v0|, v1
154 ; GCN-NEXT: s_setpc_b64 s[30:31]
156 ; GFX10-LABEL: v_constained_fadd_f32_fpexcept_strict_fabs_lhs:
158 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
159 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
160 ; GFX10-NEXT: v_add_f32_e64 v0, |v0|, v1
161 ; GFX10-NEXT: s_setpc_b64 s[30:31]
162 %fabs.x = call float @llvm.fabs.f32(float %x)
163 %val = call float @llvm.experimental.constrained.fadd.f32(float %fabs.x, float %y, metadata !"round.tonearest", metadata !"fpexcept.strict")
167 define float @v_constained_fadd_f32_fpexcept_strict_fabs_rhs(float %x, float %y) #0 {
168 ; GCN-LABEL: v_constained_fadd_f32_fpexcept_strict_fabs_rhs:
170 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
171 ; GCN-NEXT: v_add_f32_e64 v0, v0, |v1|
172 ; GCN-NEXT: s_setpc_b64 s[30:31]
174 ; GFX10-LABEL: v_constained_fadd_f32_fpexcept_strict_fabs_rhs:
176 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
177 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
178 ; GFX10-NEXT: v_add_f32_e64 v0, v0, |v1|
179 ; GFX10-NEXT: s_setpc_b64 s[30:31]
180 %fabs.y = call float @llvm.fabs.f32(float %y)
181 %val = call float @llvm.experimental.constrained.fadd.f32(float %x, float %fabs.y, metadata !"round.tonearest", metadata !"fpexcept.strict")
185 define float @v_constained_fadd_f32_fpexcept_strict_fneg_fabs_lhs(float %x, float %y) #0 {
186 ; GCN-LABEL: v_constained_fadd_f32_fpexcept_strict_fneg_fabs_lhs:
188 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
189 ; GCN-NEXT: v_sub_f32_e64 v0, v1, |v0|
190 ; GCN-NEXT: s_setpc_b64 s[30:31]
192 ; GFX10-LABEL: v_constained_fadd_f32_fpexcept_strict_fneg_fabs_lhs:
194 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
195 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
196 ; GFX10-NEXT: v_sub_f32_e64 v0, v1, |v0|
197 ; GFX10-NEXT: s_setpc_b64 s[30:31]
198 %fabs.x = call float @llvm.fabs.f32(float %x)
199 %neg.fabs.x = fneg float %fabs.x
200 %val = call float @llvm.experimental.constrained.fadd.f32(float %neg.fabs.x, float %y, metadata !"round.tonearest", metadata !"fpexcept.strict")
204 declare float @llvm.fabs.f32(float) #1
205 declare float @llvm.experimental.constrained.fadd.f32(float, float, metadata, metadata) #1
206 declare <2 x float> @llvm.experimental.constrained.fadd.v2f32(<2 x float>, <2 x float>, metadata, metadata) #1
207 declare <3 x float> @llvm.experimental.constrained.fadd.v3f32(<3 x float>, <3 x float>, metadata, metadata) #1
209 attributes #0 = { strictfp }
210 attributes #1 = { inaccessiblememonly nounwind willreturn }