|
1 | 1 | ; RUN: llc < %s -march=nvptx64 -mcpu=sm_80 -mattr=+ptx70 | FileCheck %s |
2 | 2 | ; RUN: %if ptxas-11.0 %{ llc < %s -march=nvptx64 -mcpu=sm_80 -mattr=+ptx70 | %ptxas-verify -arch=sm_80 %} |
3 | 3 |
|
4 | | -declare i16 @llvm.nvvm.abs.bf16(i16) |
5 | | -declare i32 @llvm.nvvm.abs.bf16x2(i32) |
6 | | -declare i16 @llvm.nvvm.neg.bf16(i16) |
7 | | -declare i32 @llvm.nvvm.neg.bf16x2(i32) |
8 | | - |
9 | | -declare i16 @llvm.nvvm.fmin.bf16(i16, i16) |
10 | | -declare i16 @llvm.nvvm.fmin.nan.bf16(i16, i16) |
11 | | -declare i32 @llvm.nvvm.fmin.bf16x2(i32, i32) |
12 | | -declare i32 @llvm.nvvm.fmin.nan.bf16x2(i32, i32) |
13 | | - |
14 | | -declare i16 @llvm.nvvm.fmax.bf16(i16, i16) |
15 | | -declare i16 @llvm.nvvm.fmax.nan.bf16(i16, i16) |
16 | | -declare i32 @llvm.nvvm.fmax.bf16x2(i32, i32) |
17 | | -declare i32 @llvm.nvvm.fmax.nan.bf16x2(i32, i32) |
18 | | - |
19 | | -declare i16 @llvm.nvvm.fma.rn.bf16(i16, i16, i16) |
20 | | -declare i16 @llvm.nvvm.fma.rn.relu.bf16(i16, i16, i16) |
21 | | -declare i32 @llvm.nvvm.fma.rn.bf16x2(i32, i32, i32) |
22 | | -declare i32 @llvm.nvvm.fma.rn.relu.bf16x2(i32, i32, i32) |
23 | | - |
24 | 4 | ; CHECK-LABEL: abs_bf16 |
25 | | -define i16 @abs_bf16(i16 %0) { |
| 5 | +define bfloat @abs_bf16(bfloat %0) { |
26 | 6 | ; CHECK-NOT: call |
27 | 7 | ; CHECK: abs.bf16 |
28 | | - %res = call i16 @llvm.nvvm.abs.bf16(i16 %0); |
29 | | - ret i16 %res |
| 8 | + %res = call bfloat @llvm.nvvm.abs.bf16(bfloat %0); |
| 9 | + ret bfloat %res |
30 | 10 | } |
31 | 11 |
|
32 | 12 | ; CHECK-LABEL: abs_bf16x2 |
33 | | -define i32 @abs_bf16x2(i32 %0) { |
| 13 | +define <2 x bfloat> @abs_bf16x2(<2 x bfloat> %0) { |
34 | 14 | ; CHECK-NOT: call |
35 | 15 | ; CHECK: abs.bf16x2 |
36 | | - %res = call i32 @llvm.nvvm.abs.bf16x2(i32 %0); |
37 | | - ret i32 %res |
| 16 | + %res = call <2 x bfloat> @llvm.nvvm.abs.bf16x2(<2 x bfloat> %0); |
| 17 | + ret <2 x bfloat> %res |
38 | 18 | } |
39 | 19 |
|
40 | 20 | ; CHECK-LABEL: neg_bf16 |
41 | | -define i16 @neg_bf16(i16 %0) { |
| 21 | +define bfloat @neg_bf16(bfloat %0) { |
42 | 22 | ; CHECK-NOT: call |
43 | 23 | ; CHECK: neg.bf16 |
44 | | - %res = call i16 @llvm.nvvm.neg.bf16(i16 %0); |
45 | | - ret i16 %res |
| 24 | + %res = call bfloat @llvm.nvvm.neg.bf16(bfloat %0); |
| 25 | + ret bfloat %res |
46 | 26 | } |
47 | 27 |
|
48 | 28 | ; CHECK-LABEL: neg_bf16x2 |
49 | | -define i32 @neg_bf16x2(i32 %0) { |
| 29 | +define <2 x bfloat> @neg_bf16x2(<2 x bfloat> %0) { |
50 | 30 | ; CHECK-NOT: call |
51 | 31 | ; CHECK: neg.bf16x2 |
52 | | - %res = call i32 @llvm.nvvm.neg.bf16x2(i32 %0); |
53 | | - ret i32 %res |
| 32 | + %res = call <2 x bfloat> @llvm.nvvm.neg.bf16x2(<2 x bfloat> %0); |
| 33 | + ret <2 x bfloat> %res |
54 | 34 | } |
55 | 35 |
|
56 | 36 | ; CHECK-LABEL: fmin_nan_f |
@@ -134,35 +114,35 @@ define <2 x half> @fmin_ftz_nan_f16x2(<2 x half> %0, <2 x half> %1) { |
134 | 114 | } |
135 | 115 |
|
136 | 116 | ; CHECK-LABEL: fmin_bf16 |
137 | | -define i16 @fmin_bf16(i16 %0, i16 %1) { |
| 117 | +define bfloat @fmin_bf16(bfloat %0, bfloat %1) { |
138 | 118 | ; CHECK-NOT: call |
139 | 119 | ; CHECK: min.bf16 |
140 | | - %res = call i16 @llvm.nvvm.fmin.bf16(i16 %0, i16 %1) |
141 | | - ret i16 %res |
| 120 | + %res = call bfloat @llvm.nvvm.fmin.bf16(bfloat %0, bfloat %1) |
| 121 | + ret bfloat %res |
142 | 122 | } |
143 | 123 |
|
144 | 124 | ; CHECK-LABEL: fmin_nan_bf16 |
145 | | -define i16 @fmin_nan_bf16(i16 %0, i16 %1) { |
| 125 | +define bfloat @fmin_nan_bf16(bfloat %0, bfloat %1) { |
146 | 126 | ; CHECK-NOT: call |
147 | 127 | ; CHECK: min.NaN.bf16 |
148 | | - %res = call i16 @llvm.nvvm.fmin.nan.bf16(i16 %0, i16 %1) |
149 | | - ret i16 %res |
| 128 | + %res = call bfloat @llvm.nvvm.fmin.nan.bf16(bfloat %0, bfloat %1) |
| 129 | + ret bfloat %res |
150 | 130 | } |
151 | 131 |
|
152 | 132 | ; CHECK-LABEL: fmin_bf16x2 |
153 | | -define i32 @fmin_bf16x2(i32 %0, i32 %1) { |
| 133 | +define <2 x bfloat> @fmin_bf16x2(<2 x bfloat> %0, <2 x bfloat> %1) { |
154 | 134 | ; CHECK-NOT: call |
155 | 135 | ; CHECK: min.bf16x2 |
156 | | - %res = call i32 @llvm.nvvm.fmin.bf16x2(i32 %0, i32 %1) |
157 | | - ret i32 %res |
| 136 | + %res = call <2 x bfloat> @llvm.nvvm.fmin.bf16x2(<2 x bfloat> %0, <2 x bfloat> %1) |
| 137 | + ret <2 x bfloat> %res |
158 | 138 | } |
159 | 139 |
|
160 | 140 | ; CHECK-LABEL: fmin_nan_bf16x2 |
161 | | -define i32 @fmin_nan_bf16x2(i32 %0, i32 %1) { |
| 141 | +define <2 x bfloat> @fmin_nan_bf16x2(<2 x bfloat> %0, <2 x bfloat> %1) { |
162 | 142 | ; CHECK-NOT: call |
163 | 143 | ; CHECK: min.NaN.bf16x2 |
164 | | - %res = call i32 @llvm.nvvm.fmin.nan.bf16x2(i32 %0, i32 %1) |
165 | | - ret i32 %res |
| 144 | + %res = call <2 x bfloat> @llvm.nvvm.fmin.nan.bf16x2(<2 x bfloat> %0, <2 x bfloat> %1) |
| 145 | + ret <2 x bfloat> %res |
166 | 146 | } |
167 | 147 |
|
168 | 148 | ; CHECK-LABEL: fmax_nan_f |
@@ -246,35 +226,35 @@ define <2 x half> @fmax_ftz_nan_f16x2(<2 x half> %0, <2 x half> %1) { |
246 | 226 | } |
247 | 227 |
|
248 | 228 | ; CHECK-LABEL: fmax_bf16 |
249 | | -define i16 @fmax_bf16(i16 %0, i16 %1) { |
| 229 | +define bfloat @fmax_bf16(bfloat %0, bfloat %1) { |
250 | 230 | ; CHECK-NOT: call |
251 | 231 | ; CHECK: max.bf16 |
252 | | - %res = call i16 @llvm.nvvm.fmax.bf16(i16 %0, i16 %1) |
253 | | - ret i16 %res |
| 232 | + %res = call bfloat @llvm.nvvm.fmax.bf16(bfloat %0, bfloat %1) |
| 233 | + ret bfloat %res |
254 | 234 | } |
255 | 235 |
|
256 | 236 | ; CHECK-LABEL: fmax_nan_bf16 |
257 | | -define i16 @fmax_nan_bf16(i16 %0, i16 %1) { |
| 237 | +define bfloat @fmax_nan_bf16(bfloat %0, bfloat %1) { |
258 | 238 | ; CHECK-NOT: call |
259 | 239 | ; CHECK: max.NaN.bf16 |
260 | | - %res = call i16 @llvm.nvvm.fmax.nan.bf16(i16 %0, i16 %1) |
261 | | - ret i16 %res |
| 240 | + %res = call bfloat @llvm.nvvm.fmax.nan.bf16(bfloat %0, bfloat %1) |
| 241 | + ret bfloat %res |
262 | 242 | } |
263 | 243 |
|
264 | 244 | ; CHECK-LABEL: fmax_bf16x2 |
265 | | -define i32 @fmax_bf16x2(i32 %0, i32 %1) { |
| 245 | +define <2 x bfloat> @fmax_bf16x2(<2 x bfloat> %0, <2 x bfloat> %1) { |
266 | 246 | ; CHECK-NOT: call |
267 | 247 | ; CHECK: max.bf16x2 |
268 | | - %res = call i32 @llvm.nvvm.fmax.bf16x2(i32 %0, i32 %1) |
269 | | - ret i32 %res |
| 248 | + %res = call <2 x bfloat> @llvm.nvvm.fmax.bf16x2(<2 x bfloat> %0, <2 x bfloat> %1) |
| 249 | + ret <2 x bfloat> %res |
270 | 250 | } |
271 | 251 |
|
272 | 252 | ; CHECK-LABEL: fmax_nan_bf16x2 |
273 | | -define i32 @fmax_nan_bf16x2(i32 %0, i32 %1) { |
| 253 | +define <2 x bfloat> @fmax_nan_bf16x2(<2 x bfloat> %0, <2 x bfloat> %1) { |
274 | 254 | ; CHECK-NOT: call |
275 | 255 | ; CHECK: max.NaN.bf16x2 |
276 | | - %res = call i32 @llvm.nvvm.fmax.nan.bf16x2(i32 %0, i32 %1) |
277 | | - ret i32 %res |
| 256 | + %res = call <2 x bfloat> @llvm.nvvm.fmax.nan.bf16x2(<2 x bfloat> %0, <2 x bfloat> %1) |
| 257 | + ret <2 x bfloat> %res |
278 | 258 | } |
279 | 259 |
|
280 | 260 | ; CHECK-LABEL: fma_rn_relu_f16 |
@@ -310,33 +290,33 @@ define <2 x half> @fma_rn_ftz_relu_f16x2(<2 x half> %0, <2 x half> %1, <2 x half |
310 | 290 | } |
311 | 291 |
|
312 | 292 | ; CHECK-LABEL: fma_rn_bf16 |
313 | | -define i16 @fma_rn_bf16(i16 %0, i16 %1, i16 %2) { |
| 293 | +define bfloat @fma_rn_bf16(bfloat %0, bfloat %1, bfloat %2) { |
314 | 294 | ; CHECK-NOT: call |
315 | 295 | ; CHECK: fma.rn.bf16 |
316 | | - %res = call i16 @llvm.nvvm.fma.rn.bf16(i16 %0, i16 %1, i16 %2) |
317 | | - ret i16 %res |
| 296 | + %res = call bfloat @llvm.nvvm.fma.rn.bf16(bfloat %0, bfloat %1, bfloat %2) |
| 297 | + ret bfloat %res |
318 | 298 | } |
319 | 299 |
|
320 | 300 | ; CHECK-LABEL: fma_rn_relu_bf16 |
321 | | -define i16 @fma_rn_relu_bf16(i16 %0, i16 %1, i16 %2) { |
| 301 | +define bfloat @fma_rn_relu_bf16(bfloat %0, bfloat %1, bfloat %2) { |
322 | 302 | ; CHECK-NOT: call |
323 | 303 | ; CHECK: fma.rn.relu.bf16 |
324 | | - %res = call i16 @llvm.nvvm.fma.rn.relu.bf16(i16 %0, i16 %1, i16 %2) |
325 | | - ret i16 %res |
| 304 | + %res = call bfloat @llvm.nvvm.fma.rn.relu.bf16(bfloat %0, bfloat %1, bfloat %2) |
| 305 | + ret bfloat %res |
326 | 306 | } |
327 | 307 |
|
328 | 308 | ; CHECK-LABEL: fma_rn_bf16x2 |
329 | | -define i32 @fma_rn_bf16x2(i32 %0, i32 %1, i32 %2) { |
| 309 | +define <2 x bfloat> @fma_rn_bf16x2(<2 x bfloat> %0, <2 x bfloat> %1, <2 x bfloat> %2) { |
330 | 310 | ; CHECK-NOT: call |
331 | 311 | ; CHECK: fma.rn.bf16x2 |
332 | | - %res = call i32 @llvm.nvvm.fma.rn.bf16x2(i32 %0, i32 %1, i32 %2) |
333 | | - ret i32 %res |
| 312 | + %res = call <2 x bfloat> @llvm.nvvm.fma.rn.bf16x2(<2 x bfloat> %0, <2 x bfloat> %1, <2 x bfloat> %2) |
| 313 | + ret <2 x bfloat> %res |
334 | 314 | } |
335 | 315 |
|
336 | 316 | ; CHECK-LABEL: fma_rn_relu_bf16x2 |
337 | | -define i32 @fma_rn_relu_bf16x2(i32 %0, i32 %1, i32 %2) { |
| 317 | +define <2 x bfloat> @fma_rn_relu_bf16x2(<2 x bfloat> %0, <2 x bfloat> %1, <2 x bfloat> %2) { |
338 | 318 | ; CHECK-NOT: call |
339 | 319 | ; CHECK: fma.rn.relu.bf16x2 |
340 | | - %res = call i32 @llvm.nvvm.fma.rn.relu.bf16x2(i32 %0, i32 %1, i32 %2) |
341 | | - ret i32 %res |
| 320 | + %res = call <2 x bfloat> @llvm.nvvm.fma.rn.relu.bf16x2(<2 x bfloat> %0, <2 x bfloat> %1, <2 x bfloat> %2) |
| 321 | + ret <2 x bfloat> %res |
342 | 322 | } |
0 commit comments