annotate test/CodeGen/AMDGPU/llvm.amdgcn.kill.ll @ 128:c347d3398279 default tip

fix
author mir3636
date Wed, 06 Dec 2017 14:37:17 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 ; RUN: llc -march=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=SI %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=SI %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 ; SI-LABEL: {{^}}gs_const:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 ; SI-NOT: v_cmpx
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 ; SI: s_mov_b64 exec, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 define amdgpu_gs void @gs_const() {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 %tmp = icmp ule i32 0, 3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 %tmp1 = select i1 %tmp, float 1.000000e+00, float -1.000000e+00
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 %c1 = fcmp oge float %tmp1, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 call void @llvm.amdgcn.kill(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 %tmp2 = icmp ule i32 3, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 %tmp3 = select i1 %tmp2, float 1.000000e+00, float -1.000000e+00
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 %c2 = fcmp oge float %tmp3, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 call void @llvm.amdgcn.kill(i1 %c2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 ; SI-LABEL: {{^}}vcc_implicit_def:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 ; SI-NOT: v_cmp_gt_f32_e32 vcc,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 ; SI: v_cmp_gt_f32_e64 [[CMP:s\[[0-9]+:[0-9]+\]]], 0, v{{[0-9]+}}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 ; SI: v_cmpx_le_f32_e32 vcc, 0, v{{[0-9]+}}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 ; SI: v_cndmask_b32_e64 v{{[0-9]+}}, 0, 1.0, [[CMP]]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 define amdgpu_ps void @vcc_implicit_def(float %arg13, float %arg14) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 %tmp0 = fcmp olt float %arg13, 0.000000e+00
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 %c1 = fcmp oge float %arg14, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 call void @llvm.amdgcn.kill(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 %tmp1 = select i1 %tmp0, float 1.000000e+00, float 0.000000e+00
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 call void @llvm.amdgcn.exp.f32(i32 1, i32 15, float %tmp1, float %tmp1, float %tmp1, float %tmp1, i1 true, i1 true) #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 ; SI-LABEL: {{^}}true:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 ; SI-NEXT: BB#
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 ; SI-NEXT: BB#
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 ; SI-NEXT: s_endpgm
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 define amdgpu_gs void @true() {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 call void @llvm.amdgcn.kill(i1 true)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 ; SI-LABEL: {{^}}false:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 ; SI-NOT: v_cmpx
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 ; SI: s_mov_b64 exec, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 define amdgpu_gs void @false() {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 call void @llvm.amdgcn.kill(i1 false)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 ; SI-LABEL: {{^}}and:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 ; SI: v_cmp_lt_i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 ; SI: v_cmp_lt_i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 ; SI: s_or_b64 s[0:1]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 ; SI: s_and_b64 exec, exec, s[0:1]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 define amdgpu_gs void @and(i32 %a, i32 %b, i32 %c, i32 %d) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 %c1 = icmp slt i32 %a, %b
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 %c2 = icmp slt i32 %c, %d
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 %x = or i1 %c1, %c2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 call void @llvm.amdgcn.kill(i1 %x)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 ; SI-LABEL: {{^}}andn2:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 ; SI: v_cmp_lt_i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65 ; SI: v_cmp_lt_i32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 ; SI: s_xor_b64 s[0:1]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 ; SI: s_andn2_b64 exec, exec, s[0:1]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68 define amdgpu_gs void @andn2(i32 %a, i32 %b, i32 %c, i32 %d) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69 %c1 = icmp slt i32 %a, %b
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70 %c2 = icmp slt i32 %c, %d
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 %x = xor i1 %c1, %c2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72 %y = xor i1 %x, 1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73 call void @llvm.amdgcn.kill(i1 %y)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77 ; SI-LABEL: {{^}}oeq:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78 ; SI: v_cmpx_eq_f32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
79 ; SI-NOT: s_and
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
80 define amdgpu_gs void @oeq(float %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81 %c1 = fcmp oeq float %a, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82 call void @llvm.amdgcn.kill(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86 ; SI-LABEL: {{^}}ogt:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87 ; SI: v_cmpx_lt_f32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88 ; SI-NOT: s_and
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89 define amdgpu_gs void @ogt(float %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90 %c1 = fcmp ogt float %a, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91 call void @llvm.amdgcn.kill(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
93 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
94
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
95 ; SI-LABEL: {{^}}oge:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
96 ; SI: v_cmpx_le_f32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
97 ; SI-NOT: s_and
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
98 define amdgpu_gs void @oge(float %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
99 %c1 = fcmp oge float %a, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
100 call void @llvm.amdgcn.kill(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
101 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
102 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
103
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
104 ; SI-LABEL: {{^}}olt:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
105 ; SI: v_cmpx_gt_f32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
106 ; SI-NOT: s_and
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
107 define amdgpu_gs void @olt(float %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
108 %c1 = fcmp olt float %a, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
109 call void @llvm.amdgcn.kill(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
110 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
111 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
112
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
113 ; SI-LABEL: {{^}}ole:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
114 ; SI: v_cmpx_ge_f32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
115 ; SI-NOT: s_and
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
116 define amdgpu_gs void @ole(float %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
117 %c1 = fcmp ole float %a, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
118 call void @llvm.amdgcn.kill(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
119 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
120 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
122 ; SI-LABEL: {{^}}one:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
123 ; SI: v_cmpx_lg_f32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
124 ; SI-NOT: s_and
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
125 define amdgpu_gs void @one(float %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
126 %c1 = fcmp one float %a, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
127 call void @llvm.amdgcn.kill(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
128 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
129 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
130
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
131 ; SI-LABEL: {{^}}ord:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
132 ; FIXME: This is absolutely unimportant, but we could use the cmpx variant here.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
133 ; SI: v_cmp_o_f32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
134 define amdgpu_gs void @ord(float %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
135 %c1 = fcmp ord float %a, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
136 call void @llvm.amdgcn.kill(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
137 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
138 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
139
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
140 ; SI-LABEL: {{^}}uno:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
141 ; FIXME: This is absolutely unimportant, but we could use the cmpx variant here.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
142 ; SI: v_cmp_u_f32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
143 define amdgpu_gs void @uno(float %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
144 %c1 = fcmp uno float %a, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
145 call void @llvm.amdgcn.kill(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
146 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
147 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
148
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
149 ; SI-LABEL: {{^}}ueq:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
150 ; SI: v_cmpx_nlg_f32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
151 ; SI-NOT: s_and
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
152 define amdgpu_gs void @ueq(float %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
153 %c1 = fcmp ueq float %a, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
154 call void @llvm.amdgcn.kill(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
155 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
156 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
157
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
158 ; SI-LABEL: {{^}}ugt:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
159 ; SI: v_cmpx_nge_f32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
160 ; SI-NOT: s_and
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
161 define amdgpu_gs void @ugt(float %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
162 %c1 = fcmp ugt float %a, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
163 call void @llvm.amdgcn.kill(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
164 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
165 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
166
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
167 ; SI-LABEL: {{^}}uge:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
168 ; SI: v_cmpx_ngt_f32_e32 vcc, -1.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
169 ; SI-NOT: s_and
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
170 define amdgpu_gs void @uge(float %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
171 %c1 = fcmp uge float %a, -1.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
172 call void @llvm.amdgcn.kill(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
173 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
174 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
175
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
176 ; SI-LABEL: {{^}}ult:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
177 ; SI: v_cmpx_nle_f32_e32 vcc, -2.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
178 ; SI-NOT: s_and
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
179 define amdgpu_gs void @ult(float %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
180 %c1 = fcmp ult float %a, -2.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
181 call void @llvm.amdgcn.kill(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
182 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
183 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
184
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
185 ; SI-LABEL: {{^}}ule:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
186 ; SI: v_cmpx_nlt_f32_e32 vcc, 2.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
187 ; SI-NOT: s_and
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
188 define amdgpu_gs void @ule(float %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
189 %c1 = fcmp ule float %a, 2.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
190 call void @llvm.amdgcn.kill(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
191 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
192 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
193
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
194 ; SI-LABEL: {{^}}une:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
195 ; SI: v_cmpx_neq_f32_e32 vcc, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
196 ; SI-NOT: s_and
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
197 define amdgpu_gs void @une(float %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
198 %c1 = fcmp une float %a, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
199 call void @llvm.amdgcn.kill(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
200 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
201 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
202
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
203 ; SI-LABEL: {{^}}neg_olt:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
204 ; SI: v_cmpx_ngt_f32_e32 vcc, 1.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
205 ; SI-NOT: s_and
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
206 define amdgpu_gs void @neg_olt(float %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
207 %c1 = fcmp olt float %a, 1.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
208 %c2 = xor i1 %c1, 1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
209 call void @llvm.amdgcn.kill(i1 %c2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
210 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
211 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
212
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
213 ; SI-LABEL: {{^}}fcmp_x2:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
214 ; FIXME: LLVM should be able to combine these fcmp opcodes.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
215 ; SI: v_cmp_gt_f32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
216 ; SI: v_cndmask_b32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
217 ; SI: v_cmpx_le_f32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
218 define amdgpu_ps void @fcmp_x2(float %a) #0 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
219 %ogt = fcmp nsz ogt float %a, 2.500000e-01
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
220 %k = select i1 %ogt, float -1.000000e+00, float 0.000000e+00
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
221 %c = fcmp nsz oge float %k, 0.000000e+00
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
222 call void @llvm.amdgcn.kill(i1 %c) #1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
223 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
224 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
225
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
226 ; SI-LABEL: {{^}}wqm:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
227 ; SI: v_cmp_neq_f32_e32 vcc, 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
228 ; SI: s_wqm_b64 s[0:1], vcc
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
229 ; SI: s_and_b64 exec, exec, s[0:1]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
230 define amdgpu_ps void @wqm(float %a) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
231 %c1 = fcmp une float %a, 0.0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
232 %c2 = call i1 @llvm.amdgcn.wqm.vote(i1 %c1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
233 call void @llvm.amdgcn.kill(i1 %c2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
234 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
235 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
236
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
237 declare void @llvm.amdgcn.kill(i1) #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
238 declare void @llvm.amdgcn.exp.f32(i32, i32, float, float, float, float, i1, i1) #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
239 declare i1 @llvm.amdgcn.wqm.vote(i1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
240
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
241 attributes #0 = { nounwind }