1 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_80 -mattr=+ptx70 | FileCheck %s
2 ; RUN: %if ptxas-11.0 %{ llc < %s -march=nvptx64 -mcpu=sm_80 -mattr=+ptx70 | %ptxas-verify -arch=sm_80 %}
4 ; CHECK-LABEL: abs_bf16
5 define bfloat @abs_bf16(bfloat %0) {
8 %res = call bfloat @llvm.nvvm.abs.bf16(bfloat %0);
12 ; CHECK-LABEL: abs_bf16x2
13 define <2 x bfloat> @abs_bf16x2(<2 x bfloat> %0) {
16 %res = call <2 x bfloat> @llvm.nvvm.abs.bf16x2(<2 x bfloat> %0);
20 ; CHECK-LABEL: neg_bf16
21 define bfloat @neg_bf16(bfloat %0) {
24 %res = call bfloat @llvm.nvvm.neg.bf16(bfloat %0);
28 ; CHECK-LABEL: neg_bf16x2
29 define <2 x bfloat> @neg_bf16x2(<2 x bfloat> %0) {
32 %res = call <2 x bfloat> @llvm.nvvm.neg.bf16x2(<2 x bfloat> %0);
36 ; CHECK-LABEL: fmin_nan_f
37 define float @fmin_nan_f(float %0, float %1) {
40 %res = call float @llvm.nvvm.fmin.nan.f(float %0, float %1);
44 ; CHECK-LABEL: fmin_ftz_nan_f
45 define float @fmin_ftz_nan_f(float %0, float %1) {
47 ; CHECK: min.ftz.NaN.f32
48 %res = call float @llvm.nvvm.fmin.ftz.nan.f(float %0, float %1);
52 ; CHECK-LABEL: fmin_f16
53 define half @fmin_f16(half %0, half %1) {
56 %res = call half @llvm.nvvm.fmin.f16(half %0, half %1)
60 ; CHECK-LABEL: fmin_ftz_f16
61 define half @fmin_ftz_f16(half %0, half %1) {
64 %res = call half @llvm.nvvm.fmin.ftz.f16(half %0, half %1)
68 ; CHECK-LABEL: fmin_nan_f16
69 define half @fmin_nan_f16(half %0, half %1) {
72 %res = call half @llvm.nvvm.fmin.nan.f16(half %0, half %1)
76 ; CHECK-LABEL: fmin_ftz_nan_f16
77 define half @fmin_ftz_nan_f16(half %0, half %1) {
79 ; CHECK: min.ftz.NaN.f16
80 %res = call half @llvm.nvvm.fmin.ftz.nan.f16(half %0, half %1)
84 ; CHECK-LABEL: fmin_f16x2
85 define <2 x half> @fmin_f16x2(<2 x half> %0, <2 x half> %1) {
88 %res = call <2 x half> @llvm.nvvm.fmin.f16x2(<2 x half> %0, <2 x half> %1)
92 ; CHECK-LABEL: fmin_ftz_f16x2
93 define <2 x half> @fmin_ftz_f16x2(<2 x half> %0, <2 x half> %1) {
95 ; CHECK: min.ftz.f16x2
96 %res = call <2 x half> @llvm.nvvm.fmin.ftz.f16x2(<2 x half> %0, <2 x half> %1)
100 ; CHECK-LABEL: fmin_nan_f16x2
101 define <2 x half> @fmin_nan_f16x2(<2 x half> %0, <2 x half> %1) {
103 ; CHECK: min.NaN.f16x2
104 %res = call <2 x half> @llvm.nvvm.fmin.nan.f16x2(<2 x half> %0, <2 x half> %1)
108 ; CHECK-LABEL: fmin_ftz_nan_f16x2
109 define <2 x half> @fmin_ftz_nan_f16x2(<2 x half> %0, <2 x half> %1) {
111 ; CHECK: min.ftz.NaN.f16x2
112 %res = call <2 x half> @llvm.nvvm.fmin.ftz.nan.f16x2(<2 x half> %0, <2 x half> %1)
116 ; CHECK-LABEL: fmin_bf16
117 define bfloat @fmin_bf16(bfloat %0, bfloat %1) {
120 %res = call bfloat @llvm.nvvm.fmin.bf16(bfloat %0, bfloat %1)
124 ; CHECK-LABEL: fmin_nan_bf16
125 define bfloat @fmin_nan_bf16(bfloat %0, bfloat %1) {
127 ; CHECK: min.NaN.bf16
128 %res = call bfloat @llvm.nvvm.fmin.nan.bf16(bfloat %0, bfloat %1)
132 ; CHECK-LABEL: fmin_bf16x2
133 define <2 x bfloat> @fmin_bf16x2(<2 x bfloat> %0, <2 x bfloat> %1) {
136 %res = call <2 x bfloat> @llvm.nvvm.fmin.bf16x2(<2 x bfloat> %0, <2 x bfloat> %1)
137 ret <2 x bfloat> %res
140 ; CHECK-LABEL: fmin_nan_bf16x2
141 define <2 x bfloat> @fmin_nan_bf16x2(<2 x bfloat> %0, <2 x bfloat> %1) {
143 ; CHECK: min.NaN.bf16x2
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
148 ; CHECK-LABEL: fmax_nan_f
149 define float @fmax_nan_f(float %0, float %1) {
152 %res = call float @llvm.nvvm.fmax.nan.f(float %0, float %1);
156 ; CHECK-LABEL: fmax_ftz_nan_f
157 define float @fmax_ftz_nan_f(float %0, float %1) {
159 ; CHECK: max.ftz.NaN.f32
160 %res = call float @llvm.nvvm.fmax.ftz.nan.f(float %0, float %1);
164 ; CHECK-LABEL: fmax_f16
165 define half @fmax_f16(half %0, half %1) {
168 %res = call half @llvm.nvvm.fmax.f16(half %0, half %1)
172 ; CHECK-LABEL: fmax_ftz_f16
173 define half @fmax_ftz_f16(half %0, half %1) {
176 %res = call half @llvm.nvvm.fmax.ftz.f16(half %0, half %1)
180 ; CHECK-LABEL: fmax_nan_f16
181 define half @fmax_nan_f16(half %0, half %1) {
184 %res = call half @llvm.nvvm.fmax.nan.f16(half %0, half %1)
188 ; CHECK-LABEL: fmax_ftz_nan_f16
189 define half @fmax_ftz_nan_f16(half %0, half %1) {
191 ; CHECK: max.ftz.NaN.f16
192 %res = call half @llvm.nvvm.fmax.ftz.nan.f16(half %0, half %1)
196 ; CHECK-LABEL: fmax_f16x2
197 define <2 x half> @fmax_f16x2(<2 x half> %0, <2 x half> %1) {
200 %res = call <2 x half> @llvm.nvvm.fmax.f16x2(<2 x half> %0, <2 x half> %1)
204 ; CHECK-LABEL: fmax_ftz_f16x2
205 define <2 x half> @fmax_ftz_f16x2(<2 x half> %0, <2 x half> %1) {
207 ; CHECK: max.ftz.f16x2
208 %res = call <2 x half> @llvm.nvvm.fmax.ftz.f16x2(<2 x half> %0, <2 x half> %1)
212 ; CHECK-LABEL: fmax_nan_f16x2
213 define <2 x half> @fmax_nan_f16x2(<2 x half> %0, <2 x half> %1) {
215 ; CHECK: max.NaN.f16x2
216 %res = call <2 x half> @llvm.nvvm.fmax.nan.f16x2(<2 x half> %0, <2 x half> %1)
220 ; CHECK-LABEL: fmax_ftz_nan_f16x2
221 define <2 x half> @fmax_ftz_nan_f16x2(<2 x half> %0, <2 x half> %1) {
223 ; CHECK: max.ftz.NaN.f16x2
224 %res = call <2 x half> @llvm.nvvm.fmax.ftz.nan.f16x2(<2 x half> %0, <2 x half> %1)
228 ; CHECK-LABEL: fmax_bf16
229 define bfloat @fmax_bf16(bfloat %0, bfloat %1) {
232 %res = call bfloat @llvm.nvvm.fmax.bf16(bfloat %0, bfloat %1)
236 ; CHECK-LABEL: fmax_nan_bf16
237 define bfloat @fmax_nan_bf16(bfloat %0, bfloat %1) {
239 ; CHECK: max.NaN.bf16
240 %res = call bfloat @llvm.nvvm.fmax.nan.bf16(bfloat %0, bfloat %1)
244 ; CHECK-LABEL: fmax_bf16x2
245 define <2 x bfloat> @fmax_bf16x2(<2 x bfloat> %0, <2 x bfloat> %1) {
248 %res = call <2 x bfloat> @llvm.nvvm.fmax.bf16x2(<2 x bfloat> %0, <2 x bfloat> %1)
249 ret <2 x bfloat> %res
252 ; CHECK-LABEL: fmax_nan_bf16x2
253 define <2 x bfloat> @fmax_nan_bf16x2(<2 x bfloat> %0, <2 x bfloat> %1) {
255 ; CHECK: max.NaN.bf16x2
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
260 ; CHECK-LABEL: fma_rn_relu_f16
261 define half @fma_rn_relu_f16(half %0, half %1, half %2) {
263 ; CHECK: fma.rn.relu.f16
264 %res = call half @llvm.nvvm.fma.rn.relu.f16(half %0, half %1, half %2)
268 ; CHECK-LABEL: fma_rn_ftz_relu_f16
269 define half @fma_rn_ftz_relu_f16(half %0, half %1, half %2) {
271 ; CHECK: fma.rn.ftz.relu.f16
272 %res = call half @llvm.nvvm.fma.rn.ftz.relu.f16(half %0, half %1, half %2)
276 ; CHECK-LABEL: fma_rn_relu_f16x2
277 define <2 x half> @fma_rn_relu_f16x2(<2 x half> %0, <2 x half> %1, <2 x half> %2) {
279 ; CHECK: fma.rn.relu.f16x2
280 %res = call <2 x half> @llvm.nvvm.fma.rn.relu.f16x2(<2 x half> %0, <2 x half> %1, <2 x half> %2)
284 ; CHECK-LABEL: fma_rn_ftz_relu_f16x2
285 define <2 x half> @fma_rn_ftz_relu_f16x2(<2 x half> %0, <2 x half> %1, <2 x half> %2) {
287 ; CHECK: fma.rn.ftz.relu.f16x2
288 %res = call <2 x half> @llvm.nvvm.fma.rn.ftz.relu.f16x2(<2 x half> %0, <2 x half> %1, <2 x half> %2)
292 ; CHECK-LABEL: fma_rn_bf16
293 define bfloat @fma_rn_bf16(bfloat %0, bfloat %1, bfloat %2) {
296 %res = call bfloat @llvm.nvvm.fma.rn.bf16(bfloat %0, bfloat %1, bfloat %2)
300 ; CHECK-LABEL: fma_rn_relu_bf16
301 define bfloat @fma_rn_relu_bf16(bfloat %0, bfloat %1, bfloat %2) {
303 ; CHECK: fma.rn.relu.bf16
304 %res = call bfloat @llvm.nvvm.fma.rn.relu.bf16(bfloat %0, bfloat %1, bfloat %2)
308 ; CHECK-LABEL: fma_rn_bf16x2
309 define <2 x bfloat> @fma_rn_bf16x2(<2 x bfloat> %0, <2 x bfloat> %1, <2 x bfloat> %2) {
311 ; CHECK: fma.rn.bf16x2
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
316 ; CHECK-LABEL: fma_rn_relu_bf16x2
317 define <2 x bfloat> @fma_rn_relu_bf16x2(<2 x bfloat> %0, <2 x bfloat> %1, <2 x bfloat> %2) {
319 ; CHECK: fma.rn.relu.bf16x2
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