blob: d9e982e09b2f3fabe050a7a79f45f7b67d663deb [file] [log] [blame]
Tom Stellard919bb6b2014-04-29 23:12:53 +00001;RUN: llc < %s -march=r600 -mcpu=SI -verify-machineinstrs| FileCheck --check-prefix=SI --check-prefix=FUNC %s
Tom Stellardc0845332013-11-22 23:07:58 +00002
3; XXX: Merge this into setcc, once R600 supports 64-bit operations
4
5;;;==========================================================================;;;
6;; Double comparisons
7;;;==========================================================================;;;
8
Tom Stellard79243d92014-10-01 17:15:17 +00009; FUNC-LABEL: {{^}}f64_oeq:
Tom Stellard326d6ec2014-11-05 14:50:53 +000010; SI: v_cmp_eq_f64
Tom Stellardc0845332013-11-22 23:07:58 +000011define void @f64_oeq(i32 addrspace(1)* %out, double %a, double %b) {
12entry:
13 %0 = fcmp oeq double %a, %b
14 %1 = sext i1 %0 to i32
15 store i32 %1, i32 addrspace(1)* %out
16 ret void
17}
18
Tom Stellard79243d92014-10-01 17:15:17 +000019; FUNC-LABEL: {{^}}f64_ogt:
Tom Stellard326d6ec2014-11-05 14:50:53 +000020; SI: v_cmp_gt_f64
Tom Stellardc0845332013-11-22 23:07:58 +000021define void @f64_ogt(i32 addrspace(1)* %out, double %a, double %b) {
22entry:
23 %0 = fcmp ogt double %a, %b
24 %1 = sext i1 %0 to i32
25 store i32 %1, i32 addrspace(1)* %out
26 ret void
27}
28
Tom Stellard79243d92014-10-01 17:15:17 +000029; FUNC-LABEL: {{^}}f64_oge:
Tom Stellard326d6ec2014-11-05 14:50:53 +000030; SI: v_cmp_ge_f64
Tom Stellardc0845332013-11-22 23:07:58 +000031define void @f64_oge(i32 addrspace(1)* %out, double %a, double %b) {
32entry:
33 %0 = fcmp oge double %a, %b
34 %1 = sext i1 %0 to i32
35 store i32 %1, i32 addrspace(1)* %out
36 ret void
37}
38
Tom Stellard79243d92014-10-01 17:15:17 +000039; FUNC-LABEL: {{^}}f64_olt:
Tom Stellard326d6ec2014-11-05 14:50:53 +000040; SI: v_cmp_lt_f64
Tom Stellardc0845332013-11-22 23:07:58 +000041define void @f64_olt(i32 addrspace(1)* %out, double %a, double %b) {
42entry:
43 %0 = fcmp olt double %a, %b
44 %1 = sext i1 %0 to i32
45 store i32 %1, i32 addrspace(1)* %out
46 ret void
47}
48
Tom Stellard79243d92014-10-01 17:15:17 +000049; FUNC-LABEL: {{^}}f64_ole:
Tom Stellard326d6ec2014-11-05 14:50:53 +000050; SI: v_cmp_le_f64
Tom Stellardc0845332013-11-22 23:07:58 +000051define void @f64_ole(i32 addrspace(1)* %out, double %a, double %b) {
52entry:
53 %0 = fcmp ole double %a, %b
54 %1 = sext i1 %0 to i32
55 store i32 %1, i32 addrspace(1)* %out
56 ret void
57}
58
Tom Stellard79243d92014-10-01 17:15:17 +000059; FUNC-LABEL: {{^}}f64_one:
Matt Arsenault9cded7a2014-12-11 22:15:35 +000060; SI: v_cmp_lg_f64_e32 vcc
61; SI-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
Tom Stellardc0845332013-11-22 23:07:58 +000062define void @f64_one(i32 addrspace(1)* %out, double %a, double %b) {
63entry:
64 %0 = fcmp one double %a, %b
65 %1 = sext i1 %0 to i32
66 store i32 %1, i32 addrspace(1)* %out
67 ret void
68}
69
Tom Stellard79243d92014-10-01 17:15:17 +000070; FUNC-LABEL: {{^}}f64_ord:
Tom Stellard326d6ec2014-11-05 14:50:53 +000071; SI: v_cmp_o_f64
Tom Stellardc0845332013-11-22 23:07:58 +000072define void @f64_ord(i32 addrspace(1)* %out, double %a, double %b) {
73entry:
74 %0 = fcmp ord double %a, %b
75 %1 = sext i1 %0 to i32
76 store i32 %1, i32 addrspace(1)* %out
77 ret void
78}
79
Tom Stellard79243d92014-10-01 17:15:17 +000080; FUNC-LABEL: {{^}}f64_ueq:
Tom Stellard326d6ec2014-11-05 14:50:53 +000081; SI: v_cmp_u_f64
82; SI: v_cmp_eq_f64
Matt Arsenaultbecd6562014-12-03 05:22:35 +000083; SI: s_or_b64
84; SI: v_cndmask_b32
Tom Stellardc0845332013-11-22 23:07:58 +000085define void @f64_ueq(i32 addrspace(1)* %out, double %a, double %b) {
86entry:
87 %0 = fcmp ueq double %a, %b
88 %1 = sext i1 %0 to i32
89 store i32 %1, i32 addrspace(1)* %out
90 ret void
91}
92
Tom Stellard79243d92014-10-01 17:15:17 +000093; FUNC-LABEL: {{^}}f64_ugt:
Matt Arsenault8b989ef2014-12-11 22:15:39 +000094
95; SI: v_cmp_nle_f64_e32 vcc
96; SI-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
Tom Stellardc0845332013-11-22 23:07:58 +000097define void @f64_ugt(i32 addrspace(1)* %out, double %a, double %b) {
98entry:
99 %0 = fcmp ugt double %a, %b
100 %1 = sext i1 %0 to i32
101 store i32 %1, i32 addrspace(1)* %out
102 ret void
103}
104
Tom Stellard79243d92014-10-01 17:15:17 +0000105; FUNC-LABEL: {{^}}f64_uge:
Matt Arsenault8b989ef2014-12-11 22:15:39 +0000106; SI: v_cmp_nlt_f64_e32 vcc
107; SI-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
Tom Stellardc0845332013-11-22 23:07:58 +0000108define void @f64_uge(i32 addrspace(1)* %out, double %a, double %b) {
109entry:
110 %0 = fcmp uge double %a, %b
111 %1 = sext i1 %0 to i32
112 store i32 %1, i32 addrspace(1)* %out
113 ret void
114}
115
Tom Stellard79243d92014-10-01 17:15:17 +0000116; FUNC-LABEL: {{^}}f64_ult:
Matt Arsenault8b989ef2014-12-11 22:15:39 +0000117; SI: v_cmp_nge_f64_e32 vcc
118; SI-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
Tom Stellardc0845332013-11-22 23:07:58 +0000119define void @f64_ult(i32 addrspace(1)* %out, double %a, double %b) {
120entry:
121 %0 = fcmp ult double %a, %b
122 %1 = sext i1 %0 to i32
123 store i32 %1, i32 addrspace(1)* %out
124 ret void
125}
126
Tom Stellard79243d92014-10-01 17:15:17 +0000127; FUNC-LABEL: {{^}}f64_ule:
Matt Arsenault8b989ef2014-12-11 22:15:39 +0000128; SI: v_cmp_ngt_f64_e32 vcc
129; SI-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
Tom Stellardc0845332013-11-22 23:07:58 +0000130define void @f64_ule(i32 addrspace(1)* %out, double %a, double %b) {
131entry:
132 %0 = fcmp ule double %a, %b
133 %1 = sext i1 %0 to i32
134 store i32 %1, i32 addrspace(1)* %out
135 ret void
136}
137
Tom Stellard79243d92014-10-01 17:15:17 +0000138; FUNC-LABEL: {{^}}f64_une:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000139; SI: v_cmp_neq_f64
Tom Stellardc0845332013-11-22 23:07:58 +0000140define void @f64_une(i32 addrspace(1)* %out, double %a, double %b) {
141entry:
142 %0 = fcmp une double %a, %b
143 %1 = sext i1 %0 to i32
144 store i32 %1, i32 addrspace(1)* %out
145 ret void
146}
147
Tom Stellard79243d92014-10-01 17:15:17 +0000148; FUNC-LABEL: {{^}}f64_uno:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000149; SI: v_cmp_u_f64
Tom Stellardc0845332013-11-22 23:07:58 +0000150define void @f64_uno(i32 addrspace(1)* %out, double %a, double %b) {
151entry:
152 %0 = fcmp uno double %a, %b
153 %1 = sext i1 %0 to i32
154 store i32 %1, i32 addrspace(1)* %out
155 ret void
156}
157
158;;;==========================================================================;;;
159;; 64-bit integer comparisons
160;;;==========================================================================;;;
161
Tom Stellard79243d92014-10-01 17:15:17 +0000162; FUNC-LABEL: {{^}}i64_eq:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000163; SI: v_cmp_eq_i64
Tom Stellardc0845332013-11-22 23:07:58 +0000164define void @i64_eq(i32 addrspace(1)* %out, i64 %a, i64 %b) {
165entry:
166 %0 = icmp eq i64 %a, %b
167 %1 = sext i1 %0 to i32
168 store i32 %1, i32 addrspace(1)* %out
169 ret void
170}
171
Tom Stellard79243d92014-10-01 17:15:17 +0000172; FUNC-LABEL: {{^}}i64_ne:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000173; SI: v_cmp_ne_i64
Tom Stellardc0845332013-11-22 23:07:58 +0000174define void @i64_ne(i32 addrspace(1)* %out, i64 %a, i64 %b) {
175entry:
176 %0 = icmp ne i64 %a, %b
177 %1 = sext i1 %0 to i32
178 store i32 %1, i32 addrspace(1)* %out
179 ret void
180}
181
Tom Stellard79243d92014-10-01 17:15:17 +0000182; FUNC-LABEL: {{^}}i64_ugt:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000183; SI: v_cmp_gt_u64
Tom Stellardc0845332013-11-22 23:07:58 +0000184define void @i64_ugt(i32 addrspace(1)* %out, i64 %a, i64 %b) {
185entry:
186 %0 = icmp ugt i64 %a, %b
187 %1 = sext i1 %0 to i32
188 store i32 %1, i32 addrspace(1)* %out
189 ret void
190}
191
Tom Stellard79243d92014-10-01 17:15:17 +0000192; FUNC-LABEL: {{^}}i64_uge:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000193; SI: v_cmp_ge_u64
Tom Stellardc0845332013-11-22 23:07:58 +0000194define void @i64_uge(i32 addrspace(1)* %out, i64 %a, i64 %b) {
195entry:
196 %0 = icmp uge i64 %a, %b
197 %1 = sext i1 %0 to i32
198 store i32 %1, i32 addrspace(1)* %out
199 ret void
200}
201
Tom Stellard79243d92014-10-01 17:15:17 +0000202; FUNC-LABEL: {{^}}i64_ult:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000203; SI: v_cmp_lt_u64
Tom Stellardc0845332013-11-22 23:07:58 +0000204define void @i64_ult(i32 addrspace(1)* %out, i64 %a, i64 %b) {
205entry:
206 %0 = icmp ult i64 %a, %b
207 %1 = sext i1 %0 to i32
208 store i32 %1, i32 addrspace(1)* %out
209 ret void
210}
211
Tom Stellard79243d92014-10-01 17:15:17 +0000212; FUNC-LABEL: {{^}}i64_ule:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000213; SI: v_cmp_le_u64
Tom Stellardc0845332013-11-22 23:07:58 +0000214define void @i64_ule(i32 addrspace(1)* %out, i64 %a, i64 %b) {
215entry:
216 %0 = icmp ule i64 %a, %b
217 %1 = sext i1 %0 to i32
218 store i32 %1, i32 addrspace(1)* %out
219 ret void
220}
221
Tom Stellard79243d92014-10-01 17:15:17 +0000222; FUNC-LABEL: {{^}}i64_sgt:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000223; SI: v_cmp_gt_i64
Tom Stellardc0845332013-11-22 23:07:58 +0000224define void @i64_sgt(i32 addrspace(1)* %out, i64 %a, i64 %b) {
225entry:
226 %0 = icmp sgt i64 %a, %b
227 %1 = sext i1 %0 to i32
228 store i32 %1, i32 addrspace(1)* %out
229 ret void
230}
231
Tom Stellard79243d92014-10-01 17:15:17 +0000232; FUNC-LABEL: {{^}}i64_sge:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000233; SI: v_cmp_ge_i64
Tom Stellardc0845332013-11-22 23:07:58 +0000234define void @i64_sge(i32 addrspace(1)* %out, i64 %a, i64 %b) {
235entry:
236 %0 = icmp sge i64 %a, %b
237 %1 = sext i1 %0 to i32
238 store i32 %1, i32 addrspace(1)* %out
239 ret void
240}
241
Tom Stellard79243d92014-10-01 17:15:17 +0000242; FUNC-LABEL: {{^}}i64_slt:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000243; SI: v_cmp_lt_i64
Tom Stellardc0845332013-11-22 23:07:58 +0000244define void @i64_slt(i32 addrspace(1)* %out, i64 %a, i64 %b) {
245entry:
246 %0 = icmp slt i64 %a, %b
247 %1 = sext i1 %0 to i32
248 store i32 %1, i32 addrspace(1)* %out
249 ret void
250}
251
Tom Stellard79243d92014-10-01 17:15:17 +0000252; FUNC-LABEL: {{^}}i64_sle:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000253; SI: v_cmp_le_i64
Tom Stellardc0845332013-11-22 23:07:58 +0000254define void @i64_sle(i32 addrspace(1)* %out, i64 %a, i64 %b) {
255entry:
256 %0 = icmp sle i64 %a, %b
257 %1 = sext i1 %0 to i32
258 store i32 %1, i32 addrspace(1)* %out
259 ret void
260}