annotate llvm/test/CodeGen/AMDGPU/xnor.ll @ 223:5f17cb93ff66 llvm-original

LLVM13 (2021/7/18)
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:43:00 +0900
parents 79ff65ed7e25
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
1 ; RUN: llc -march=amdgcn -mcpu=gfx600 -verify-machineinstrs < %s | FileCheck --check-prefix=GCN %s
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
2 ; RUN: llc -march=amdgcn -mcpu=gfx700 -verify-machineinstrs < %s | FileCheck --check-prefix=GCN %s
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
3 ; RUN: llc -march=amdgcn -mcpu=gfx801 -verify-machineinstrs < %s | FileCheck --check-prefix=GCN %s
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
4 ; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck --check-prefix=GCN %s
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
5 ; RUN: llc -march=amdgcn -mcpu=gfx906 -verify-machineinstrs < %s | FileCheck --check-prefix=GCN-DL %s
150
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 ; GCN-LABEL: {{^}}scalar_xnor_i32_one_use
anatofuz
parents:
diff changeset
8 ; GCN: s_xnor_b32
anatofuz
parents:
diff changeset
9 define amdgpu_kernel void @scalar_xnor_i32_one_use(
anatofuz
parents:
diff changeset
10 i32 addrspace(1)* %r0, i32 %a, i32 %b) {
anatofuz
parents:
diff changeset
11 entry:
anatofuz
parents:
diff changeset
12 %xor = xor i32 %a, %b
anatofuz
parents:
diff changeset
13 %r0.val = xor i32 %xor, -1
anatofuz
parents:
diff changeset
14 store i32 %r0.val, i32 addrspace(1)* %r0
anatofuz
parents:
diff changeset
15 ret void
anatofuz
parents:
diff changeset
16 }
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 ; GCN-LABEL: {{^}}scalar_xnor_i32_mul_use
anatofuz
parents:
diff changeset
19 ; GCN-NOT: s_xnor_b32
anatofuz
parents:
diff changeset
20 ; GCN: s_xor_b32
anatofuz
parents:
diff changeset
21 ; GCN: s_not_b32
anatofuz
parents:
diff changeset
22 ; GCN: s_add_i32
anatofuz
parents:
diff changeset
23 define amdgpu_kernel void @scalar_xnor_i32_mul_use(
anatofuz
parents:
diff changeset
24 i32 addrspace(1)* %r0, i32 addrspace(1)* %r1, i32 %a, i32 %b) {
anatofuz
parents:
diff changeset
25 entry:
anatofuz
parents:
diff changeset
26 %xor = xor i32 %a, %b
anatofuz
parents:
diff changeset
27 %r0.val = xor i32 %xor, -1
anatofuz
parents:
diff changeset
28 %r1.val = add i32 %xor, %a
anatofuz
parents:
diff changeset
29 store i32 %r0.val, i32 addrspace(1)* %r0
anatofuz
parents:
diff changeset
30 store i32 %r1.val, i32 addrspace(1)* %r1
anatofuz
parents:
diff changeset
31 ret void
anatofuz
parents:
diff changeset
32 }
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 ; GCN-LABEL: {{^}}scalar_xnor_i64_one_use
anatofuz
parents:
diff changeset
35 ; GCN: s_xnor_b64
anatofuz
parents:
diff changeset
36 define amdgpu_kernel void @scalar_xnor_i64_one_use(
anatofuz
parents:
diff changeset
37 i64 addrspace(1)* %r0, i64 %a, i64 %b) {
anatofuz
parents:
diff changeset
38 entry:
anatofuz
parents:
diff changeset
39 %xor = xor i64 %a, %b
anatofuz
parents:
diff changeset
40 %r0.val = xor i64 %xor, -1
anatofuz
parents:
diff changeset
41 store i64 %r0.val, i64 addrspace(1)* %r0
anatofuz
parents:
diff changeset
42 ret void
anatofuz
parents:
diff changeset
43 }
anatofuz
parents:
diff changeset
44
anatofuz
parents:
diff changeset
45 ; GCN-LABEL: {{^}}scalar_xnor_i64_mul_use
anatofuz
parents:
diff changeset
46 ; GCN-NOT: s_xnor_b64
anatofuz
parents:
diff changeset
47 ; GCN: s_xor_b64
anatofuz
parents:
diff changeset
48 ; GCN: s_not_b64
anatofuz
parents:
diff changeset
49 ; GCN: s_add_u32
anatofuz
parents:
diff changeset
50 ; GCN: s_addc_u32
anatofuz
parents:
diff changeset
51 define amdgpu_kernel void @scalar_xnor_i64_mul_use(
anatofuz
parents:
diff changeset
52 i64 addrspace(1)* %r0, i64 addrspace(1)* %r1, i64 %a, i64 %b) {
anatofuz
parents:
diff changeset
53 entry:
anatofuz
parents:
diff changeset
54 %xor = xor i64 %a, %b
anatofuz
parents:
diff changeset
55 %r0.val = xor i64 %xor, -1
anatofuz
parents:
diff changeset
56 %r1.val = add i64 %xor, %a
anatofuz
parents:
diff changeset
57 store i64 %r0.val, i64 addrspace(1)* %r0
anatofuz
parents:
diff changeset
58 store i64 %r1.val, i64 addrspace(1)* %r1
anatofuz
parents:
diff changeset
59 ret void
anatofuz
parents:
diff changeset
60 }
anatofuz
parents:
diff changeset
61
anatofuz
parents:
diff changeset
62 ; GCN-LABEL: {{^}}vector_xnor_i32_one_use
anatofuz
parents:
diff changeset
63 ; GCN-NOT: s_xnor_b32
anatofuz
parents:
diff changeset
64 ; GCN: v_not_b32
anatofuz
parents:
diff changeset
65 ; GCN: v_xor_b32
anatofuz
parents:
diff changeset
66 ; GCN-DL: v_xnor_b32
anatofuz
parents:
diff changeset
67 define i32 @vector_xnor_i32_one_use(i32 %a, i32 %b) {
anatofuz
parents:
diff changeset
68 entry:
anatofuz
parents:
diff changeset
69 %xor = xor i32 %a, %b
anatofuz
parents:
diff changeset
70 %r = xor i32 %xor, -1
anatofuz
parents:
diff changeset
71 ret i32 %r
anatofuz
parents:
diff changeset
72 }
anatofuz
parents:
diff changeset
73
anatofuz
parents:
diff changeset
74 ; GCN-LABEL: {{^}}vector_xnor_i64_one_use
anatofuz
parents:
diff changeset
75 ; GCN-NOT: s_xnor_b64
anatofuz
parents:
diff changeset
76 ; GCN: v_not_b32
anatofuz
parents:
diff changeset
77 ; GCN: v_not_b32
anatofuz
parents:
diff changeset
78 ; GCN: v_xor_b32
anatofuz
parents:
diff changeset
79 ; GCN: v_xor_b32
anatofuz
parents:
diff changeset
80 ; GCN-DL: v_xnor_b32
anatofuz
parents:
diff changeset
81 ; GCN-DL: v_xnor_b32
anatofuz
parents:
diff changeset
82 define i64 @vector_xnor_i64_one_use(i64 %a, i64 %b) {
anatofuz
parents:
diff changeset
83 entry:
anatofuz
parents:
diff changeset
84 %xor = xor i64 %a, %b
anatofuz
parents:
diff changeset
85 %r = xor i64 %xor, -1
anatofuz
parents:
diff changeset
86 ret i64 %r
anatofuz
parents:
diff changeset
87 }
anatofuz
parents:
diff changeset
88
anatofuz
parents:
diff changeset
89 ; GCN-LABEL: {{^}}xnor_s_v_i32_one_use
anatofuz
parents:
diff changeset
90 ; GCN-NOT: s_xnor_b32
anatofuz
parents:
diff changeset
91 ; GCN: s_not_b32
anatofuz
parents:
diff changeset
92 ; GCN: v_xor_b32
anatofuz
parents:
diff changeset
93 define amdgpu_kernel void @xnor_s_v_i32_one_use(i32 addrspace(1)* %out, i32 %s) {
anatofuz
parents:
diff changeset
94 %v = call i32 @llvm.amdgcn.workitem.id.x() #1
anatofuz
parents:
diff changeset
95 %xor = xor i32 %s, %v
anatofuz
parents:
diff changeset
96 %d = xor i32 %xor, -1
anatofuz
parents:
diff changeset
97 store i32 %d, i32 addrspace(1)* %out
anatofuz
parents:
diff changeset
98 ret void
anatofuz
parents:
diff changeset
99 }
anatofuz
parents:
diff changeset
100
anatofuz
parents:
diff changeset
101 ; GCN-LABEL: {{^}}xnor_v_s_i32_one_use
anatofuz
parents:
diff changeset
102 ; GCN-NOT: s_xnor_b32
anatofuz
parents:
diff changeset
103 ; GCN: s_not_b32
anatofuz
parents:
diff changeset
104 ; GCN: v_xor_b32
anatofuz
parents:
diff changeset
105 define amdgpu_kernel void @xnor_v_s_i32_one_use(i32 addrspace(1)* %out, i32 %s) {
anatofuz
parents:
diff changeset
106 %v = call i32 @llvm.amdgcn.workitem.id.x() #1
anatofuz
parents:
diff changeset
107 %xor = xor i32 %v, %s
anatofuz
parents:
diff changeset
108 %d = xor i32 %xor, -1
anatofuz
parents:
diff changeset
109 store i32 %d, i32 addrspace(1)* %out
anatofuz
parents:
diff changeset
110 ret void
anatofuz
parents:
diff changeset
111 }
anatofuz
parents:
diff changeset
112
anatofuz
parents:
diff changeset
113 ; GCN-LABEL: {{^}}xnor_i64_s_v_one_use
anatofuz
parents:
diff changeset
114 ; GCN-NOT: s_xnor_b64
anatofuz
parents:
diff changeset
115 ; GCN: s_not_b64
anatofuz
parents:
diff changeset
116 ; GCN: v_xor_b32
anatofuz
parents:
diff changeset
117 ; GCN: v_xor_b32
anatofuz
parents:
diff changeset
118 ; GCN-DL: v_xnor_b32
anatofuz
parents:
diff changeset
119 ; GCN-DL: v_xnor_b32
anatofuz
parents:
diff changeset
120 define amdgpu_kernel void @xnor_i64_s_v_one_use(
anatofuz
parents:
diff changeset
121 i64 addrspace(1)* %r0, i64 %a) {
anatofuz
parents:
diff changeset
122 entry:
anatofuz
parents:
diff changeset
123 %b32 = call i32 @llvm.amdgcn.workitem.id.x() #1
anatofuz
parents:
diff changeset
124 %b64 = zext i32 %b32 to i64
anatofuz
parents:
diff changeset
125 %b = shl i64 %b64, 29
anatofuz
parents:
diff changeset
126 %xor = xor i64 %a, %b
anatofuz
parents:
diff changeset
127 %r0.val = xor i64 %xor, -1
anatofuz
parents:
diff changeset
128 store i64 %r0.val, i64 addrspace(1)* %r0
anatofuz
parents:
diff changeset
129 ret void
anatofuz
parents:
diff changeset
130 }
anatofuz
parents:
diff changeset
131
anatofuz
parents:
diff changeset
132 ; GCN-LABEL: {{^}}xnor_i64_v_s_one_use
anatofuz
parents:
diff changeset
133 ; GCN-NOT: s_xnor_b64
anatofuz
parents:
diff changeset
134 ; GCN: s_not_b64
anatofuz
parents:
diff changeset
135 ; GCN: v_xor_b32
anatofuz
parents:
diff changeset
136 ; GCN: v_xor_b32
anatofuz
parents:
diff changeset
137 ; GCN-DL: v_xnor_b32
anatofuz
parents:
diff changeset
138 ; GCN-DL: v_xnor_b32
anatofuz
parents:
diff changeset
139 define amdgpu_kernel void @xnor_i64_v_s_one_use(
anatofuz
parents:
diff changeset
140 i64 addrspace(1)* %r0, i64 %a) {
anatofuz
parents:
diff changeset
141 entry:
anatofuz
parents:
diff changeset
142 %b32 = call i32 @llvm.amdgcn.workitem.id.x() #1
anatofuz
parents:
diff changeset
143 %b64 = zext i32 %b32 to i64
anatofuz
parents:
diff changeset
144 %b = shl i64 %b64, 29
anatofuz
parents:
diff changeset
145 %xor = xor i64 %b, %a
anatofuz
parents:
diff changeset
146 %r0.val = xor i64 %xor, -1
anatofuz
parents:
diff changeset
147 store i64 %r0.val, i64 addrspace(1)* %r0
anatofuz
parents:
diff changeset
148 ret void
anatofuz
parents:
diff changeset
149 }
anatofuz
parents:
diff changeset
150
anatofuz
parents:
diff changeset
151 ; GCN-LABEL: {{^}}vector_xor_na_b_i32_one_use
anatofuz
parents:
diff changeset
152 ; GCN-NOT: s_xnor_b32
anatofuz
parents:
diff changeset
153 ; GCN: v_not_b32
anatofuz
parents:
diff changeset
154 ; GCN: v_xor_b32
anatofuz
parents:
diff changeset
155 ; GCN-DL: v_xnor_b32
anatofuz
parents:
diff changeset
156 define i32 @vector_xor_na_b_i32_one_use(i32 %a, i32 %b) {
anatofuz
parents:
diff changeset
157 entry:
anatofuz
parents:
diff changeset
158 %na = xor i32 %a, -1
anatofuz
parents:
diff changeset
159 %r = xor i32 %na, %b
anatofuz
parents:
diff changeset
160 ret i32 %r
anatofuz
parents:
diff changeset
161 }
anatofuz
parents:
diff changeset
162
anatofuz
parents:
diff changeset
163 ; GCN-LABEL: {{^}}vector_xor_a_nb_i32_one_use
anatofuz
parents:
diff changeset
164 ; GCN-NOT: s_xnor_b32
anatofuz
parents:
diff changeset
165 ; GCN: v_not_b32
anatofuz
parents:
diff changeset
166 ; GCN: v_xor_b32
anatofuz
parents:
diff changeset
167 ; GCN-DL: v_xnor_b32
anatofuz
parents:
diff changeset
168 define i32 @vector_xor_a_nb_i32_one_use(i32 %a, i32 %b) {
anatofuz
parents:
diff changeset
169 entry:
anatofuz
parents:
diff changeset
170 %nb = xor i32 %b, -1
anatofuz
parents:
diff changeset
171 %r = xor i32 %a, %nb
anatofuz
parents:
diff changeset
172 ret i32 %r
anatofuz
parents:
diff changeset
173 }
anatofuz
parents:
diff changeset
174
anatofuz
parents:
diff changeset
175 ; GCN-LABEL: {{^}}scalar_xor_a_nb_i64_one_use
anatofuz
parents:
diff changeset
176 ; GCN: s_xnor_b64
anatofuz
parents:
diff changeset
177 define amdgpu_kernel void @scalar_xor_a_nb_i64_one_use(
anatofuz
parents:
diff changeset
178 i64 addrspace(1)* %r0, i64 %a, i64 %b) {
anatofuz
parents:
diff changeset
179 entry:
anatofuz
parents:
diff changeset
180 %nb = xor i64 %b, -1
anatofuz
parents:
diff changeset
181 %r0.val = xor i64 %a, %nb
anatofuz
parents:
diff changeset
182 store i64 %r0.val, i64 addrspace(1)* %r0
anatofuz
parents:
diff changeset
183 ret void
anatofuz
parents:
diff changeset
184 }
anatofuz
parents:
diff changeset
185
anatofuz
parents:
diff changeset
186 ; GCN-LABEL: {{^}}scalar_xor_na_b_i64_one_use
anatofuz
parents:
diff changeset
187 ; GCN: s_xnor_b64
anatofuz
parents:
diff changeset
188 define amdgpu_kernel void @scalar_xor_na_b_i64_one_use(
anatofuz
parents:
diff changeset
189 i64 addrspace(1)* %r0, i64 %a, i64 %b) {
anatofuz
parents:
diff changeset
190 entry:
anatofuz
parents:
diff changeset
191 %na = xor i64 %a, -1
anatofuz
parents:
diff changeset
192 %r0.val = xor i64 %na, %b
anatofuz
parents:
diff changeset
193 store i64 %r0.val, i64 addrspace(1)* %r0
anatofuz
parents:
diff changeset
194 ret void
anatofuz
parents:
diff changeset
195 }
anatofuz
parents:
diff changeset
196
anatofuz
parents:
diff changeset
197 ; Function Attrs: nounwind readnone
anatofuz
parents:
diff changeset
198 declare i32 @llvm.amdgcn.workitem.id.x() #0