• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
2; RUN: llc -march=amdgcn -mcpu=fiji -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
3
4declare i64 @llvm.amdgcn.icmp.i32(i32, i32, i32) #0
5declare i64 @llvm.amdgcn.icmp.i64(i64, i64, i32) #0
6
7; No crash on invalid input
8; GCN-LABEL: {{^}}v_icmp_i32_dynamic_cc:
9; GCN: s_endpgm
10define amdgpu_kernel void @v_icmp_i32_dynamic_cc(i64 addrspace(1)* %out, i32 %src, i32 %cc) {
11  %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 %cc)
12  store i64 %result, i64 addrspace(1)* %out
13  ret void
14}
15
16; GCN-LABEL: {{^}}v_icmp_i32_eq:
17; GCN: v_cmp_eq_u32_e64
18define amdgpu_kernel void @v_icmp_i32_eq(i64 addrspace(1)* %out, i32 %src) {
19  %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 32)
20  store i64 %result, i64 addrspace(1)* %out
21  ret void
22}
23
24; GCN-LABEL: {{^}}v_icmp:
25; GCN-NOT: v_cmp_eq_u32_e64
26define amdgpu_kernel void @v_icmp(i64 addrspace(1)* %out, i32 %src) {
27  %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 30)
28  store i64 %result, i64 addrspace(1)* %out
29  ret void
30}
31; GCN-LABEL: {{^}}v_icmp_i32_ne:
32; GCN: v_cmp_ne_u32_e64
33define amdgpu_kernel void @v_icmp_i32_ne(i64 addrspace(1)* %out, i32 %src) {
34  %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 33)
35  store i64 %result, i64 addrspace(1)* %out
36  ret void
37}
38
39; GCN-LABEL: {{^}}v_icmp_u32_ugt:
40; GCN: v_cmp_gt_u32_e64
41define amdgpu_kernel void @v_icmp_u32_ugt(i64 addrspace(1)* %out, i32 %src) {
42  %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 34)
43  store i64 %result, i64 addrspace(1)* %out
44  ret void
45}
46
47; GCN-LABEL: {{^}}v_icmp_u32_uge:
48; GCN: v_cmp_ge_u32_e64
49define amdgpu_kernel void @v_icmp_u32_uge(i64 addrspace(1)* %out, i32 %src) {
50  %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 35)
51  store i64 %result, i64 addrspace(1)* %out
52  ret void
53}
54
55; GCN-LABEL: {{^}}v_icmp_u32_ult:
56; GCN: v_cmp_lt_u32_e64
57define amdgpu_kernel void @v_icmp_u32_ult(i64 addrspace(1)* %out, i32 %src) {
58  %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 36)
59  store i64 %result, i64 addrspace(1)* %out
60  ret void
61}
62
63; GCN-LABEL: {{^}}v_icmp_u32_ule:
64; GCN: v_cmp_le_u32_e64
65define amdgpu_kernel void @v_icmp_u32_ule(i64 addrspace(1)* %out, i32 %src) {
66  %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 37)
67  store i64 %result, i64 addrspace(1)* %out
68  ret void
69}
70
71; GCN-LABEL: {{^}}v_icmp_i32_sgt:
72; GCN: v_cmp_gt_i32_e64
73define amdgpu_kernel void @v_icmp_i32_sgt(i64 addrspace(1)* %out, i32 %src) #1 {
74  %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 38)
75  store i64 %result, i64 addrspace(1)* %out
76  ret void
77}
78
79; GCN-LABEL: {{^}}v_icmp_i32_sge:
80; GCN: v_cmp_ge_i32_e64
81define amdgpu_kernel void @v_icmp_i32_sge(i64 addrspace(1)* %out, i32 %src) {
82  %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 39)
83  store i64 %result, i64 addrspace(1)* %out
84  ret void
85}
86
87; GCN-LABEL: {{^}}v_icmp_i32_slt:
88; GCN: v_cmp_lt_i32_e64
89define amdgpu_kernel void @v_icmp_i32_slt(i64 addrspace(1)* %out, i32 %src) {
90  %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 40)
91  store i64 %result, i64 addrspace(1)* %out
92  ret void
93}
94; GCN-LABEL: {{^}}v_icmp_i32_sle:
95; GCN: v_cmp_le_i32_e64
96define amdgpu_kernel void @v_icmp_i32_sle(i64 addrspace(1)* %out, i32 %src) {
97  %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 41)
98  store i64 %result, i64 addrspace(1)* %out
99  ret void
100}
101
102; GCN-LABEL: {{^}}v_icmp_i64_eq:
103; GCN: v_cmp_eq_u64_e64
104define amdgpu_kernel void @v_icmp_i64_eq(i64 addrspace(1)* %out, i64 %src) {
105  %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 32)
106  store i64 %result, i64 addrspace(1)* %out
107  ret void
108}
109
110; GCN-LABEL: {{^}}v_icmp_i64_ne:
111; GCN: v_cmp_ne_u64_e64
112define amdgpu_kernel void @v_icmp_i64_ne(i64 addrspace(1)* %out, i64 %src) {
113  %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 33)
114  store i64 %result, i64 addrspace(1)* %out
115  ret void
116}
117
118; GCN-LABEL: {{^}}v_icmp_u64_ugt:
119; GCN: v_cmp_gt_u64_e64
120define amdgpu_kernel void @v_icmp_u64_ugt(i64 addrspace(1)* %out, i64 %src) {
121  %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 34)
122  store i64 %result, i64 addrspace(1)* %out
123  ret void
124}
125
126; GCN-LABEL: {{^}}v_icmp_u64_uge:
127; GCN: v_cmp_ge_u64_e64
128define amdgpu_kernel void @v_icmp_u64_uge(i64 addrspace(1)* %out, i64 %src) {
129  %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 35)
130  store i64 %result, i64 addrspace(1)* %out
131  ret void
132}
133
134; GCN-LABEL: {{^}}v_icmp_u64_ult:
135; GCN: v_cmp_lt_u64_e64
136define amdgpu_kernel void @v_icmp_u64_ult(i64 addrspace(1)* %out, i64 %src) {
137  %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 36)
138  store i64 %result, i64 addrspace(1)* %out
139  ret void
140}
141
142; GCN-LABEL: {{^}}v_icmp_u64_ule:
143; GCN: v_cmp_le_u64_e64
144define amdgpu_kernel void @v_icmp_u64_ule(i64 addrspace(1)* %out, i64 %src) {
145  %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 37)
146  store i64 %result, i64 addrspace(1)* %out
147  ret void
148}
149
150; GCN-LABEL: {{^}}v_icmp_i64_sgt:
151; GCN: v_cmp_gt_i64_e64
152define amdgpu_kernel void @v_icmp_i64_sgt(i64 addrspace(1)* %out, i64 %src) {
153  %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 38)
154  store i64 %result, i64 addrspace(1)* %out
155  ret void
156}
157
158; GCN-LABEL: {{^}}v_icmp_i64_sge:
159; GCN: v_cmp_ge_i64_e64
160define amdgpu_kernel void @v_icmp_i64_sge(i64 addrspace(1)* %out, i64 %src) {
161  %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 39)
162  store i64 %result, i64 addrspace(1)* %out
163  ret void
164}
165
166; GCN-LABEL: {{^}}v_icmp_i64_slt:
167; GCN: v_cmp_lt_i64_e64
168define amdgpu_kernel void @v_icmp_i64_slt(i64 addrspace(1)* %out, i64 %src) {
169  %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 40)
170  store i64 %result, i64 addrspace(1)* %out
171  ret void
172}
173; GCN-LABEL: {{^}}v_icmp_i64_sle:
174; GCN: v_cmp_le_i64_e64
175define amdgpu_kernel void @v_icmp_i64_sle(i64 addrspace(1)* %out, i64 %src) {
176  %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 41)
177  store i64 %result, i64 addrspace(1)* %out
178  ret void
179}
180
181attributes #0 = { nounwind readnone convergent }
182