annotate llvm/test/CodeGen/AMDGPU/fmin_legacy.ll @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 0572611fdcc8
children 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN-SAFE,SI-SAFE,GCN,FUNC %s
anatofuz
parents:
diff changeset
2 ; RUN: llc -enable-no-nans-fp-math -enable-no-signed-zeros-fp-math -march=amdgcn -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=SI-NONAN,GCN-NONAN,GCN,FUNC %s
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 ; RUN: llc -march=amdgcn -mcpu=fiji -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=VI-SAFE,GCN-SAFE,GCN,FUNC %s
anatofuz
parents:
diff changeset
5 ; RUN: llc -enable-no-nans-fp-math -enable-no-signed-zeros-fp-math -march=amdgcn -mcpu=fiji -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=VI-NONAN,GCN-NONAN,GCN,FUNC %s
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -enable-var-scope -check-prefix=EG -check-prefix=FUNC %s
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 declare i32 @llvm.amdgcn.workitem.id.x() #1
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 ; The two inputs to the instruction are different SGPRs from the same
anatofuz
parents:
diff changeset
12 ; super register, so we can't fold both SGPR operands even though they
anatofuz
parents:
diff changeset
13 ; are both the same register.
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 ; FUNC-LABEL: {{^}}s_test_fmin_legacy_subreg_inputs_f32:
anatofuz
parents:
diff changeset
16 ; EG: MIN *
anatofuz
parents:
diff changeset
17 ; SI-SAFE: v_min_legacy_f32_e32 v{{[0-9]+}}, s{{[0-9]+}}, v{{[0-9]+}}
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 ; SI-NONAN: v_min_f32_e32 v{{[0-9]+}}, s{{[0-9]+}}, v{{[0-9]+}}
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 ; VI-SAFE: v_cmp_nlt_f32_e32 vcc, s{{[0-9]+}}, v{{[0-9]+}}
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 ; VI-NONAN: v_min_f32_e32 v{{[0-9]+}}, s{{[0-9]+}}, v{{[0-9]+}}
anatofuz
parents:
diff changeset
24 define amdgpu_kernel void @s_test_fmin_legacy_subreg_inputs_f32(float addrspace(1)* %out, <4 x float> %reg0) #0 {
anatofuz
parents:
diff changeset
25 %r0 = extractelement <4 x float> %reg0, i32 0
anatofuz
parents:
diff changeset
26 %r1 = extractelement <4 x float> %reg0, i32 1
anatofuz
parents:
diff changeset
27 %r2 = fcmp uge float %r0, %r1
anatofuz
parents:
diff changeset
28 %r3 = select i1 %r2, float %r1, float %r0
anatofuz
parents:
diff changeset
29 store float %r3, float addrspace(1)* %out
anatofuz
parents:
diff changeset
30 ret void
anatofuz
parents:
diff changeset
31 }
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 ; FUNC-LABEL: {{^}}s_test_fmin_legacy_ule_f32:
anatofuz
parents:
diff changeset
34 ; GCN-DAG: s_load_dwordx2 s{{\[}}[[A:[0-9]+]]:[[B:[0-9]+]]{{\]}}, s{{\[[0-9]+:[0-9]+\]}}, {{0xb|0x2c}}
anatofuz
parents:
diff changeset
35
anatofuz
parents:
diff changeset
36 ; SI-SAFE: v_mov_b32_e32 [[VA:v[0-9]+]], s[[A]]
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 ; GCN-NONAN: v_mov_b32_e32 [[VB:v[0-9]+]], s[[B]]
anatofuz
parents:
diff changeset
39
anatofuz
parents:
diff changeset
40 ; VI-SAFE: v_mov_b32_e32 [[VB:v[0-9]+]], s[[B]]
anatofuz
parents:
diff changeset
41
anatofuz
parents:
diff changeset
42 ; SI-SAFE: v_min_legacy_f32_e32 {{v[0-9]+}}, s[[B]], [[VA]]
anatofuz
parents:
diff changeset
43
anatofuz
parents:
diff changeset
44 ; VI-SAFE: v_mov_b32_e32 [[VA:v[0-9]+]], s[[A]]
anatofuz
parents:
diff changeset
45 ; VI-SAFE: v_cmp_ngt_f32_e32 vcc, s[[A]], [[VB]]
anatofuz
parents:
diff changeset
46 ; VI-SAFE: v_cndmask_b32_e32 v{{[0-9]+}}, [[VB]], [[VA]]
anatofuz
parents:
diff changeset
47
anatofuz
parents:
diff changeset
48 ; GCN-NONAN: v_min_f32_e32 {{v[0-9]+}}, s[[A]], [[VB]]
anatofuz
parents:
diff changeset
49 define amdgpu_kernel void @s_test_fmin_legacy_ule_f32(float addrspace(1)* %out, float %a, float %b) #0 {
anatofuz
parents:
diff changeset
50 %cmp = fcmp ule float %a, %b
anatofuz
parents:
diff changeset
51 %val = select i1 %cmp, float %a, float %b
anatofuz
parents:
diff changeset
52 store float %val, float addrspace(1)* %out, align 4
anatofuz
parents:
diff changeset
53 ret void
anatofuz
parents:
diff changeset
54 }
anatofuz
parents:
diff changeset
55
anatofuz
parents:
diff changeset
56 ; Nsz also needed
anatofuz
parents:
diff changeset
57 ; FIXME: Should separate tests
anatofuz
parents:
diff changeset
58 ; GCN-LABEL: {{^}}s_test_fmin_legacy_ule_f32_nnan_src:
anatofuz
parents:
diff changeset
59 ; GCN: s_load_dwordx2 s{{\[}}[[A:[0-9]+]]:[[B:[0-9]+]]{{\]}}, s{{\[[0-9]+:[0-9]+\]}}, {{0xb|0x2c}}
anatofuz
parents:
diff changeset
60
anatofuz
parents:
diff changeset
61 ; GCN-DAG: v_add_f32_e64 [[ADD_A:v[0-9]+]], s[[A]], 1.0
anatofuz
parents:
diff changeset
62 ; GCN-DAG: v_add_f32_e64 [[ADD_B:v[0-9]+]], s[[B]], 2.0
anatofuz
parents:
diff changeset
63
anatofuz
parents:
diff changeset
64 ; SI-SAFE: v_min_legacy_f32_e32 {{v[0-9]+}}, [[ADD_B]], [[ADD_A]]
anatofuz
parents:
diff changeset
65
anatofuz
parents:
diff changeset
66 ; VI-SAFE: v_cmp_ngt_f32_e32 vcc, [[ADD_A]], [[ADD_B]]
anatofuz
parents:
diff changeset
67 ; VI-SAFE: v_cndmask_b32_e32 {{v[0-9]+}}, [[ADD_B]], [[ADD_A]], vcc
anatofuz
parents:
diff changeset
68
anatofuz
parents:
diff changeset
69 ; GCN-NONAN: v_min_f32_e32 {{v[0-9]+}}, [[ADD_A]], [[ADD_B]]
anatofuz
parents:
diff changeset
70 define amdgpu_kernel void @s_test_fmin_legacy_ule_f32_nnan_src(float addrspace(1)* %out, float %a, float %b) #0 {
anatofuz
parents:
diff changeset
71 %a.nnan = fadd nnan float %a, 1.0
anatofuz
parents:
diff changeset
72 %b.nnan = fadd nnan float %b, 2.0
anatofuz
parents:
diff changeset
73 %cmp = fcmp ule float %a.nnan, %b.nnan
anatofuz
parents:
diff changeset
74 %val = select i1 %cmp, float %a.nnan, float %b.nnan
anatofuz
parents:
diff changeset
75 store float %val, float addrspace(1)* %out, align 4
anatofuz
parents:
diff changeset
76 ret void
anatofuz
parents:
diff changeset
77 }
anatofuz
parents:
diff changeset
78
anatofuz
parents:
diff changeset
79 ; FUNC-LABEL: {{^}}test_fmin_legacy_ule_f32:
anatofuz
parents:
diff changeset
80 ; GCN: {{buffer|flat}}_load_dword [[A:v[0-9]+]]
anatofuz
parents:
diff changeset
81 ; GCN: {{buffer|flat}}_load_dword [[B:v[0-9]+]]
anatofuz
parents:
diff changeset
82
anatofuz
parents:
diff changeset
83 ; SI-SAFE: v_min_legacy_f32_e32 {{v[0-9]+}}, [[B]], [[A]]
anatofuz
parents:
diff changeset
84
anatofuz
parents:
diff changeset
85 ; VI-SAFE: v_cmp_ngt_f32_e32 vcc, [[A]], [[B]]
anatofuz
parents:
diff changeset
86 ; VI-SAFE: v_cndmask_b32_e32 v{{[0-9]+}}, [[B]], [[A]]
anatofuz
parents:
diff changeset
87
anatofuz
parents:
diff changeset
88 ; GCN-NONAN: v_min_f32_e32 {{v[0-9]+}}, [[A]], [[B]]
anatofuz
parents:
diff changeset
89 define amdgpu_kernel void @test_fmin_legacy_ule_f32(float addrspace(1)* %out, float addrspace(1)* %in) #0 {
anatofuz
parents:
diff changeset
90 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
anatofuz
parents:
diff changeset
91 %gep.0 = getelementptr float, float addrspace(1)* %in, i32 %tid
anatofuz
parents:
diff changeset
92 %gep.1 = getelementptr float, float addrspace(1)* %gep.0, i32 1
anatofuz
parents:
diff changeset
93
anatofuz
parents:
diff changeset
94 %a = load volatile float, float addrspace(1)* %gep.0, align 4
anatofuz
parents:
diff changeset
95 %b = load volatile float, float addrspace(1)* %gep.1, align 4
anatofuz
parents:
diff changeset
96
anatofuz
parents:
diff changeset
97 %cmp = fcmp ule float %a, %b
anatofuz
parents:
diff changeset
98 %val = select i1 %cmp, float %a, float %b
anatofuz
parents:
diff changeset
99 store float %val, float addrspace(1)* %out, align 4
anatofuz
parents:
diff changeset
100 ret void
anatofuz
parents:
diff changeset
101 }
anatofuz
parents:
diff changeset
102
anatofuz
parents:
diff changeset
103 ; FUNC-LABEL: {{^}}test_fmin_legacy_ole_f32:
anatofuz
parents:
diff changeset
104 ; GCN: {{buffer|flat}}_load_dword [[A:v[0-9]+]]
anatofuz
parents:
diff changeset
105 ; GCN: {{buffer|flat}}_load_dword [[B:v[0-9]+]]
anatofuz
parents:
diff changeset
106
anatofuz
parents:
diff changeset
107 ; SI-SAFE: v_min_legacy_f32_e32 {{v[0-9]+}}, [[A]], [[B]]
anatofuz
parents:
diff changeset
108
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
109 ; VI-SAFE: v_cmp_le_f32_e32 vcc, [[A]], [[B]]
150
anatofuz
parents:
diff changeset
110 ; VI-SAFE: v_cndmask_b32_e32 v{{[0-9]+}}, [[B]], [[A]]
anatofuz
parents:
diff changeset
111
anatofuz
parents:
diff changeset
112 ; GCN-NONAN: v_min_f32_e32 {{v[0-9]+}}, [[A]], [[B]]
anatofuz
parents:
diff changeset
113 define amdgpu_kernel void @test_fmin_legacy_ole_f32(float addrspace(1)* %out, float addrspace(1)* %in) #0 {
anatofuz
parents:
diff changeset
114 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
anatofuz
parents:
diff changeset
115 %gep.0 = getelementptr float, float addrspace(1)* %in, i32 %tid
anatofuz
parents:
diff changeset
116 %gep.1 = getelementptr float, float addrspace(1)* %gep.0, i32 1
anatofuz
parents:
diff changeset
117
anatofuz
parents:
diff changeset
118 %a = load volatile float, float addrspace(1)* %gep.0, align 4
anatofuz
parents:
diff changeset
119 %b = load volatile float, float addrspace(1)* %gep.1, align 4
anatofuz
parents:
diff changeset
120
anatofuz
parents:
diff changeset
121 %cmp = fcmp ole float %a, %b
anatofuz
parents:
diff changeset
122 %val = select i1 %cmp, float %a, float %b
anatofuz
parents:
diff changeset
123 store float %val, float addrspace(1)* %out, align 4
anatofuz
parents:
diff changeset
124 ret void
anatofuz
parents:
diff changeset
125 }
anatofuz
parents:
diff changeset
126
anatofuz
parents:
diff changeset
127 ; FUNC-LABEL: {{^}}test_fmin_legacy_olt_f32:
anatofuz
parents:
diff changeset
128 ; GCN: {{buffer|flat}}_load_dword [[A:v[0-9]+]]
anatofuz
parents:
diff changeset
129 ; GCN: {{buffer|flat}}_load_dword [[B:v[0-9]+]]
anatofuz
parents:
diff changeset
130
anatofuz
parents:
diff changeset
131 ; SI-SAFE: v_min_legacy_f32_e32 {{v[0-9]+}}, [[A]], [[B]]
anatofuz
parents:
diff changeset
132
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
133 ; VI-SAFE: v_cmp_lt_f32_e32 vcc, [[A]], [[B]]
150
anatofuz
parents:
diff changeset
134 ; VI-SAFE: v_cndmask_b32_e32 v{{[0-9]+}}, [[B]], [[A]]
anatofuz
parents:
diff changeset
135
anatofuz
parents:
diff changeset
136 ; GCN-NONAN: v_min_f32_e32 {{v[0-9]+}}, [[A]], [[B]]
anatofuz
parents:
diff changeset
137 define amdgpu_kernel void @test_fmin_legacy_olt_f32(float addrspace(1)* %out, float addrspace(1)* %in) #0 {
anatofuz
parents:
diff changeset
138 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
anatofuz
parents:
diff changeset
139 %gep.0 = getelementptr float, float addrspace(1)* %in, i32 %tid
anatofuz
parents:
diff changeset
140 %gep.1 = getelementptr float, float addrspace(1)* %gep.0, i32 1
anatofuz
parents:
diff changeset
141
anatofuz
parents:
diff changeset
142 %a = load volatile float, float addrspace(1)* %gep.0, align 4
anatofuz
parents:
diff changeset
143 %b = load volatile float, float addrspace(1)* %gep.1, align 4
anatofuz
parents:
diff changeset
144
anatofuz
parents:
diff changeset
145 %cmp = fcmp olt float %a, %b
anatofuz
parents:
diff changeset
146 %val = select i1 %cmp, float %a, float %b
anatofuz
parents:
diff changeset
147 store float %val, float addrspace(1)* %out, align 4
anatofuz
parents:
diff changeset
148 ret void
anatofuz
parents:
diff changeset
149 }
anatofuz
parents:
diff changeset
150
anatofuz
parents:
diff changeset
151 ; FUNC-LABEL: {{^}}test_fmin_legacy_ult_f32:
anatofuz
parents:
diff changeset
152 ; GCN: {{buffer|flat}}_load_dword [[A:v[0-9]+]]
anatofuz
parents:
diff changeset
153 ; GCN: {{buffer|flat}}_load_dword [[B:v[0-9]+]]
anatofuz
parents:
diff changeset
154
anatofuz
parents:
diff changeset
155 ; SI-SAFE: v_min_legacy_f32_e32 {{v[0-9]+}}, [[B]], [[A]]
anatofuz
parents:
diff changeset
156
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
157 ; VI-SAFE: v_cmp_nge_f32_e32 vcc, [[A]], [[B]]
150
anatofuz
parents:
diff changeset
158 ; VI-SAFE: v_cndmask_b32_e32 v{{[0-9]+}}, [[B]], [[A]]
anatofuz
parents:
diff changeset
159
anatofuz
parents:
diff changeset
160 ; GCN-NONAN: v_min_f32_e32 {{v[0-9]+}}, [[A]], [[B]]
anatofuz
parents:
diff changeset
161 define amdgpu_kernel void @test_fmin_legacy_ult_f32(float addrspace(1)* %out, float addrspace(1)* %in) #0 {
anatofuz
parents:
diff changeset
162 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
anatofuz
parents:
diff changeset
163 %gep.0 = getelementptr float, float addrspace(1)* %in, i32 %tid
anatofuz
parents:
diff changeset
164 %gep.1 = getelementptr float, float addrspace(1)* %gep.0, i32 1
anatofuz
parents:
diff changeset
165
anatofuz
parents:
diff changeset
166 %a = load volatile float, float addrspace(1)* %gep.0, align 4
anatofuz
parents:
diff changeset
167 %b = load volatile float, float addrspace(1)* %gep.1, align 4
anatofuz
parents:
diff changeset
168
anatofuz
parents:
diff changeset
169 %cmp = fcmp ult float %a, %b
anatofuz
parents:
diff changeset
170 %val = select i1 %cmp, float %a, float %b
anatofuz
parents:
diff changeset
171 store float %val, float addrspace(1)* %out, align 4
anatofuz
parents:
diff changeset
172 ret void
anatofuz
parents:
diff changeset
173 }
anatofuz
parents:
diff changeset
174
anatofuz
parents:
diff changeset
175 ; FUNC-LABEL: {{^}}test_fmin_legacy_ult_v1f32:
anatofuz
parents:
diff changeset
176 ; GCN: {{buffer|flat}}_load_dword [[A:v[0-9]+]]
anatofuz
parents:
diff changeset
177 ; GCN: {{buffer|flat}}_load_dword [[B:v[0-9]+]]
anatofuz
parents:
diff changeset
178
anatofuz
parents:
diff changeset
179 ; SI-SAFE: v_min_legacy_f32_e32 {{v[0-9]+}}, [[B]], [[A]]
anatofuz
parents:
diff changeset
180
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
181 ; VI-SAFE: v_cmp_nge_f32_e32 vcc, [[A]], [[B]]
150
anatofuz
parents:
diff changeset
182 ; VI-SAFE: v_cndmask_b32_e32 v{{[0-9]+}}, [[B]], [[A]]
anatofuz
parents:
diff changeset
183
anatofuz
parents:
diff changeset
184 ; GCN-NONAN: v_min_f32_e32 {{v[0-9]+}}, [[A]], [[B]]
anatofuz
parents:
diff changeset
185 define amdgpu_kernel void @test_fmin_legacy_ult_v1f32(<1 x float> addrspace(1)* %out, <1 x float> addrspace(1)* %in) #0 {
anatofuz
parents:
diff changeset
186 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
anatofuz
parents:
diff changeset
187 %gep.0 = getelementptr <1 x float>, <1 x float> addrspace(1)* %in, i32 %tid
anatofuz
parents:
diff changeset
188 %gep.1 = getelementptr <1 x float>, <1 x float> addrspace(1)* %gep.0, i32 1
anatofuz
parents:
diff changeset
189
anatofuz
parents:
diff changeset
190 %a = load <1 x float>, <1 x float> addrspace(1)* %gep.0
anatofuz
parents:
diff changeset
191 %b = load <1 x float>, <1 x float> addrspace(1)* %gep.1
anatofuz
parents:
diff changeset
192
anatofuz
parents:
diff changeset
193 %cmp = fcmp ult <1 x float> %a, %b
anatofuz
parents:
diff changeset
194 %val = select <1 x i1> %cmp, <1 x float> %a, <1 x float> %b
anatofuz
parents:
diff changeset
195 store <1 x float> %val, <1 x float> addrspace(1)* %out
anatofuz
parents:
diff changeset
196 ret void
anatofuz
parents:
diff changeset
197 }
anatofuz
parents:
diff changeset
198
anatofuz
parents:
diff changeset
199 ; FUNC-LABEL: {{^}}test_fmin_legacy_ult_v2f32:
anatofuz
parents:
diff changeset
200 ; GCN: {{buffer|flat}}_load_dwordx2
anatofuz
parents:
diff changeset
201 ; GCN: {{buffer|flat}}_load_dwordx2
anatofuz
parents:
diff changeset
202 ; SI-SAFE: v_min_legacy_f32_e32
anatofuz
parents:
diff changeset
203 ; SI-SAFE: v_min_legacy_f32_e32
anatofuz
parents:
diff changeset
204
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
205 ; VI-SAFE: v_cmp_nge_f32_e32
150
anatofuz
parents:
diff changeset
206 ; VI-SAFE: v_cndmask_b32_e32
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
207 ; VI-SAFE: v_cmp_nge_f32_e32
150
anatofuz
parents:
diff changeset
208 ; VI-SAFE: v_cndmask_b32_e32
anatofuz
parents:
diff changeset
209
anatofuz
parents:
diff changeset
210 ; GCN-NONAN: v_min_f32_e32
anatofuz
parents:
diff changeset
211 ; GCN-NONAN: v_min_f32_e32
anatofuz
parents:
diff changeset
212 define amdgpu_kernel void @test_fmin_legacy_ult_v2f32(<2 x float> addrspace(1)* %out, <2 x float> addrspace(1)* %in) #0 {
anatofuz
parents:
diff changeset
213 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
anatofuz
parents:
diff changeset
214 %gep.0 = getelementptr <2 x float>, <2 x float> addrspace(1)* %in, i32 %tid
anatofuz
parents:
diff changeset
215 %gep.1 = getelementptr <2 x float>, <2 x float> addrspace(1)* %gep.0, i32 1
anatofuz
parents:
diff changeset
216
anatofuz
parents:
diff changeset
217 %a = load <2 x float>, <2 x float> addrspace(1)* %gep.0
anatofuz
parents:
diff changeset
218 %b = load <2 x float>, <2 x float> addrspace(1)* %gep.1
anatofuz
parents:
diff changeset
219
anatofuz
parents:
diff changeset
220 %cmp = fcmp ult <2 x float> %a, %b
anatofuz
parents:
diff changeset
221 %val = select <2 x i1> %cmp, <2 x float> %a, <2 x float> %b
anatofuz
parents:
diff changeset
222 store <2 x float> %val, <2 x float> addrspace(1)* %out
anatofuz
parents:
diff changeset
223 ret void
anatofuz
parents:
diff changeset
224 }
anatofuz
parents:
diff changeset
225
anatofuz
parents:
diff changeset
226 ; FUNC-LABEL: {{^}}test_fmin_legacy_ult_v3f32:
anatofuz
parents:
diff changeset
227 ; SI-SAFE: v_min_legacy_f32_e32
anatofuz
parents:
diff changeset
228 ; SI-SAFE: v_min_legacy_f32_e32
anatofuz
parents:
diff changeset
229 ; SI-SAFE: v_min_legacy_f32_e32
anatofuz
parents:
diff changeset
230 ; SI-SAFE-NOT: v_min_
anatofuz
parents:
diff changeset
231
anatofuz
parents:
diff changeset
232 ; VI-SAFE: v_cmp_nge_f32_e32
anatofuz
parents:
diff changeset
233 ; VI-SAFE: v_cndmask_b32_e32
anatofuz
parents:
diff changeset
234 ; VI-SAFE: v_cmp_nge_f32_e32
anatofuz
parents:
diff changeset
235 ; VI-SAFE: v_cndmask_b32_e32
anatofuz
parents:
diff changeset
236 ; VI-SAFE: v_cmp_nge_f32_e32
anatofuz
parents:
diff changeset
237 ; VI-SAFE: v_cndmask_b32_e32
anatofuz
parents:
diff changeset
238 ; VI-NOT: v_cmp
anatofuz
parents:
diff changeset
239 ; VI-NOT: v_cndmask
anatofuz
parents:
diff changeset
240
anatofuz
parents:
diff changeset
241 ; GCN-NONAN: v_min_f32_e32
anatofuz
parents:
diff changeset
242 ; GCN-NONAN: v_min_f32_e32
anatofuz
parents:
diff changeset
243 ; GCN-NONAN: v_min_f32_e32
anatofuz
parents:
diff changeset
244 ; GCN-NONAN-NOT: v_min_
anatofuz
parents:
diff changeset
245 define amdgpu_kernel void @test_fmin_legacy_ult_v3f32(<3 x float> addrspace(1)* %out, <3 x float> addrspace(1)* %in) #0 {
anatofuz
parents:
diff changeset
246 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
anatofuz
parents:
diff changeset
247 %gep.0 = getelementptr <3 x float>, <3 x float> addrspace(1)* %in, i32 %tid
anatofuz
parents:
diff changeset
248 %gep.1 = getelementptr <3 x float>, <3 x float> addrspace(1)* %gep.0, i32 1
anatofuz
parents:
diff changeset
249
anatofuz
parents:
diff changeset
250 %a = load <3 x float>, <3 x float> addrspace(1)* %gep.0
anatofuz
parents:
diff changeset
251 %b = load <3 x float>, <3 x float> addrspace(1)* %gep.1
anatofuz
parents:
diff changeset
252
anatofuz
parents:
diff changeset
253 %cmp = fcmp ult <3 x float> %a, %b
anatofuz
parents:
diff changeset
254 %val = select <3 x i1> %cmp, <3 x float> %a, <3 x float> %b
anatofuz
parents:
diff changeset
255 store <3 x float> %val, <3 x float> addrspace(1)* %out
anatofuz
parents:
diff changeset
256 ret void
anatofuz
parents:
diff changeset
257 }
anatofuz
parents:
diff changeset
258
anatofuz
parents:
diff changeset
259 ; FUNC-LABEL: {{^}}test_fmin_legacy_ole_f32_multi_use:
anatofuz
parents:
diff changeset
260 ; GCN: {{buffer|flat}}_load_dword [[A:v[0-9]+]]
anatofuz
parents:
diff changeset
261 ; GCN: {{buffer|flat}}_load_dword [[B:v[0-9]+]]
anatofuz
parents:
diff changeset
262 ; GCN-NOT: v_min
anatofuz
parents:
diff changeset
263 ; GCN: v_cmp_le_f32
anatofuz
parents:
diff changeset
264 ; GCN-NEXT: v_cndmask_b32
anatofuz
parents:
diff changeset
265 ; GCN-NOT: v_min
anatofuz
parents:
diff changeset
266 ; GCN: s_endpgm
anatofuz
parents:
diff changeset
267 define amdgpu_kernel void @test_fmin_legacy_ole_f32_multi_use(float addrspace(1)* %out0, i1 addrspace(1)* %out1, float addrspace(1)* %in) #0 {
anatofuz
parents:
diff changeset
268 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
anatofuz
parents:
diff changeset
269 %gep.0 = getelementptr float, float addrspace(1)* %in, i32 %tid
anatofuz
parents:
diff changeset
270 %gep.1 = getelementptr float, float addrspace(1)* %gep.0, i32 1
anatofuz
parents:
diff changeset
271
anatofuz
parents:
diff changeset
272 %a = load volatile float, float addrspace(1)* %gep.0, align 4
anatofuz
parents:
diff changeset
273 %b = load volatile float, float addrspace(1)* %gep.1, align 4
anatofuz
parents:
diff changeset
274
anatofuz
parents:
diff changeset
275 %cmp = fcmp ole float %a, %b
anatofuz
parents:
diff changeset
276 %val0 = select i1 %cmp, float %a, float %b
anatofuz
parents:
diff changeset
277 store float %val0, float addrspace(1)* %out0, align 4
anatofuz
parents:
diff changeset
278 store i1 %cmp, i1 addrspace(1)* %out1
anatofuz
parents:
diff changeset
279 ret void
anatofuz
parents:
diff changeset
280 }
anatofuz
parents:
diff changeset
281
anatofuz
parents:
diff changeset
282 attributes #0 = { nounwind }
anatofuz
parents:
diff changeset
283 attributes #1 = { nounwind readnone }