1 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_86 -mattr=+ptx72 | FileCheck %s
2 ; RUN: %if ptxas-11.2 %{ llc < %s -march=nvptx64 -mcpu=sm_86 -mattr=+ptx72 | %ptxas-verify -arch=sm_86 %}
4 declare half @llvm.nvvm.fmin.xorsign.abs.f16(half, half)
5 declare half @llvm.nvvm.fmin.ftz.xorsign.abs.f16(half, half)
6 declare half @llvm.nvvm.fmin.nan.xorsign.abs.f16(half, half)
7 declare half @llvm.nvvm.fmin.ftz.nan.xorsign.abs.f16(half, half)
8 declare <2 x half> @llvm.nvvm.fmin.xorsign.abs.f16x2(<2 x half> , <2 x half>)
9 declare <2 x half> @llvm.nvvm.fmin.ftz.xorsign.abs.f16x2(<2 x half> , <2 x half>)
10 declare <2 x half> @llvm.nvvm.fmin.nan.xorsign.abs.f16x2(<2 x half> , <2 x half>)
11 declare <2 x half> @llvm.nvvm.fmin.ftz.nan.xorsign.abs.f16x2(<2 x half> , <2 x half>)
12 declare bfloat @llvm.nvvm.fmin.xorsign.abs.bf16(bfloat, bfloat)
13 declare bfloat @llvm.nvvm.fmin.nan.xorsign.abs.bf16(bfloat, bfloat)
14 declare <2 x bfloat> @llvm.nvvm.fmin.xorsign.abs.bf16x2(<2 x bfloat>, <2 x bfloat>)
15 declare <2 x bfloat> @llvm.nvvm.fmin.nan.xorsign.abs.bf16x2(<2 x bfloat>, <2 x bfloat>)
16 declare float @llvm.nvvm.fmin.xorsign.abs.f(float, float)
17 declare float @llvm.nvvm.fmin.ftz.xorsign.abs.f(float, float)
18 declare float @llvm.nvvm.fmin.nan.xorsign.abs.f(float, float)
19 declare float @llvm.nvvm.fmin.ftz.nan.xorsign.abs.f(float, float)
21 declare half @llvm.nvvm.fmax.xorsign.abs.f16(half, half)
22 declare half @llvm.nvvm.fmax.ftz.xorsign.abs.f16(half, half)
23 declare half @llvm.nvvm.fmax.nan.xorsign.abs.f16(half, half)
24 declare half @llvm.nvvm.fmax.ftz.nan.xorsign.abs.f16(half, half)
25 declare <2 x half> @llvm.nvvm.fmax.xorsign.abs.f16x2(<2 x half> , <2 x half>)
26 declare <2 x half> @llvm.nvvm.fmax.ftz.xorsign.abs.f16x2(<2 x half> , <2 x half>)
27 declare <2 x half> @llvm.nvvm.fmax.nan.xorsign.abs.f16x2(<2 x half> , <2 x half>)
28 declare <2 x half> @llvm.nvvm.fmax.ftz.nan.xorsign.abs.f16x2(<2 x half> , <2 x half>)
29 declare bfloat @llvm.nvvm.fmax.xorsign.abs.bf16(bfloat, bfloat)
30 declare bfloat @llvm.nvvm.fmax.nan.xorsign.abs.bf16(bfloat, bfloat)
31 declare <2 x bfloat> @llvm.nvvm.fmax.xorsign.abs.bf16x2(<2 x bfloat>, <2 x bfloat>)
32 declare <2 x bfloat> @llvm.nvvm.fmax.nan.xorsign.abs.bf16x2(<2 x bfloat>, <2 x bfloat>)
33 declare float @llvm.nvvm.fmax.xorsign.abs.f(float, float)
34 declare float @llvm.nvvm.fmax.ftz.xorsign.abs.f(float, float)
35 declare float @llvm.nvvm.fmax.nan.xorsign.abs.f(float, float)
36 declare float @llvm.nvvm.fmax.ftz.nan.xorsign.abs.f(float, float)
38 ; CHECK-LABEL: fmin_xorsign_abs_f16
39 define half @fmin_xorsign_abs_f16(half %0, half %1) {
41 ; CHECK: min.xorsign.abs.f16
42 %res = call half @llvm.nvvm.fmin.xorsign.abs.f16(half %0, half %1)
46 ; CHECK-LABEL: fmin_ftz_xorsign_abs_f16
47 define half @fmin_ftz_xorsign_abs_f16(half %0, half %1) {
49 ; CHECK: min.ftz.xorsign.abs.f16
50 %res = call half @llvm.nvvm.fmin.ftz.xorsign.abs.f16(half %0, half %1)
54 ; CHECK-LABEL: fmin_nan_xorsign_abs_f16
55 define half @fmin_nan_xorsign_abs_f16(half %0, half %1) {
57 ; CHECK: min.NaN.xorsign.abs.f16
58 %res = call half @llvm.nvvm.fmin.nan.xorsign.abs.f16(half %0, half %1)
62 ; CHECK-LABEL: fmin_ftz_nan_xorsign_abs_f16
63 define half @fmin_ftz_nan_xorsign_abs_f16(half %0, half %1) {
65 ; CHECK: min.ftz.NaN.xorsign.abs.f16
66 %res = call half @llvm.nvvm.fmin.ftz.nan.xorsign.abs.f16(half %0, half %1)
70 ; CHECK-LABEL: fmin_xorsign_abs_f16x2
71 define <2 x half> @fmin_xorsign_abs_f16x2(<2 x half> %0, <2 x half> %1) {
73 ; CHECK: min.xorsign.abs.f16x2
74 %res = call <2 x half> @llvm.nvvm.fmin.xorsign.abs.f16x2(<2 x half> %0, <2 x half> %1)
78 ; CHECK-LABEL: fmin_ftz_xorsign_abs_f16x2
79 define <2 x half> @fmin_ftz_xorsign_abs_f16x2(<2 x half> %0, <2 x half> %1) {
81 ; CHECK: min.ftz.xorsign.abs.f16x2
82 %res = call <2 x half> @llvm.nvvm.fmin.ftz.xorsign.abs.f16x2(<2 x half> %0, <2 x half> %1)
86 ; CHECK-LABEL: fmin_nan_xorsign_abs_f16x2
87 define <2 x half> @fmin_nan_xorsign_abs_f16x2(<2 x half> %0, <2 x half> %1) {
89 ; CHECK: min.NaN.xorsign.abs.f16x2
90 %res = call <2 x half> @llvm.nvvm.fmin.nan.xorsign.abs.f16x2(<2 x half> %0, <2 x half> %1)
94 ; CHECK-LABEL: fmin_ftz_nan_xorsign_abs_f16x2
95 define <2 x half> @fmin_ftz_nan_xorsign_abs_f16x2(<2 x half> %0, <2 x half> %1) {
97 ; CHECK: min.ftz.NaN.xorsign.abs.f16x2
98 %res = call <2 x half> @llvm.nvvm.fmin.ftz.nan.xorsign.abs.f16x2(<2 x half> %0, <2 x half> %1)
102 ; CHECK-LABEL: fmin_xorsign_abs_bf16
103 define bfloat @fmin_xorsign_abs_bf16(bfloat %0, bfloat %1) {
105 ; CHECK: min.xorsign.abs.bf16
106 %res = call bfloat @llvm.nvvm.fmin.xorsign.abs.bf16(bfloat %0, bfloat %1)
110 ; CHECK-LABEL: fmin_nan_xorsign_abs_bf16
111 define bfloat @fmin_nan_xorsign_abs_bf16(bfloat %0, bfloat %1) {
113 ; CHECK: min.NaN.xorsign.abs.bf16
114 %res = call bfloat @llvm.nvvm.fmin.nan.xorsign.abs.bf16(bfloat %0, bfloat %1)
118 ; CHECK-LABEL: fmin_xorsign_abs_bf16x2
119 define <2 x bfloat> @fmin_xorsign_abs_bf16x2(<2 x bfloat> %0, <2 x bfloat> %1) {
121 ; CHECK: min.xorsign.abs.bf16x2
122 %res = call <2 x bfloat> @llvm.nvvm.fmin.xorsign.abs.bf16x2(<2 x bfloat> %0, <2 x bfloat> %1)
123 ret <2 x bfloat> %res
126 ; CHECK-LABEL: fmin_nan_xorsign_abs_bf16x2
127 define <2 x bfloat> @fmin_nan_xorsign_abs_bf16x2(<2 x bfloat> %0, <2 x bfloat> %1) {
129 ; CHECK: min.NaN.xorsign.abs.bf16x2
130 %res = call <2 x bfloat> @llvm.nvvm.fmin.nan.xorsign.abs.bf16x2(<2 x bfloat> %0, <2 x bfloat> %1)
131 ret <2 x bfloat> %res
134 ; CHECK-LABEL: fmin_xorsign_abs_f
135 define float @fmin_xorsign_abs_f(float %0, float %1) {
137 ; CHECK: min.xorsign.abs.f
138 %res = call float @llvm.nvvm.fmin.xorsign.abs.f(float %0, float %1)
142 ; CHECK-LABEL: fmin_ftz_xorsign_abs_f
143 define float @fmin_ftz_xorsign_abs_f(float %0, float %1) {
145 ; CHECK: min.ftz.xorsign.abs.f
146 %res = call float @llvm.nvvm.fmin.ftz.xorsign.abs.f(float %0, float %1)
150 ; CHECK-LABEL: fmin_nan_xorsign_abs_f
151 define float @fmin_nan_xorsign_abs_f(float %0, float %1) {
153 ; CHECK: min.NaN.xorsign.abs.f
154 %res = call float @llvm.nvvm.fmin.nan.xorsign.abs.f(float %0, float %1)
158 ; CHECK-LABEL: fmin_ftz_nan_xorsign_abs_f
159 define float @fmin_ftz_nan_xorsign_abs_f(float %0, float %1) {
161 ; CHECK: min.ftz.NaN.xorsign.abs.f
162 %res = call float @llvm.nvvm.fmin.ftz.nan.xorsign.abs.f(float %0, float %1)
166 ; CHECK-LABEL: fmax_xorsign_abs_f16
167 define half @fmax_xorsign_abs_f16(half %0, half %1) {
169 ; CHECK: max.xorsign.abs.f16
170 %res = call half @llvm.nvvm.fmax.xorsign.abs.f16(half %0, half %1)
174 ; CHECK-LABEL: fmax_ftz_xorsign_abs_f16
175 define half @fmax_ftz_xorsign_abs_f16(half %0, half %1) {
177 ; CHECK: max.ftz.xorsign.abs.f16
178 %res = call half @llvm.nvvm.fmax.ftz.xorsign.abs.f16(half %0, half %1)
182 ; CHECK-LABEL: fmax_nan_xorsign_abs_f16
183 define half @fmax_nan_xorsign_abs_f16(half %0, half %1) {
185 ; CHECK: max.NaN.xorsign.abs.f16
186 %res = call half @llvm.nvvm.fmax.nan.xorsign.abs.f16(half %0, half %1)
190 ; CHECK-LABEL: fmax_ftz_nan_xorsign_abs_f16
191 define half @fmax_ftz_nan_xorsign_abs_f16(half %0, half %1) {
193 ; CHECK: max.ftz.NaN.xorsign.abs.f16
194 %res = call half @llvm.nvvm.fmax.ftz.nan.xorsign.abs.f16(half %0, half %1)
198 ; CHECK-LABEL: fmax_xorsign_abs_f16x2
199 define <2 x half> @fmax_xorsign_abs_f16x2(<2 x half> %0, <2 x half> %1) {
201 ; CHECK: max.xorsign.abs.f16x2
202 %res = call <2 x half> @llvm.nvvm.fmax.xorsign.abs.f16x2(<2 x half> %0, <2 x half> %1)
206 ; CHECK-LABEL: fmax_ftz_xorsign_abs_f16x2
207 define <2 x half> @fmax_ftz_xorsign_abs_f16x2(<2 x half> %0, <2 x half> %1) {
209 ; CHECK: max.ftz.xorsign.abs.f16x2
210 %res = call <2 x half> @llvm.nvvm.fmax.ftz.xorsign.abs.f16x2(<2 x half> %0, <2 x half> %1)
214 ; CHECK-LABEL: fmax_nan_xorsign_abs_f16x2
215 define <2 x half> @fmax_nan_xorsign_abs_f16x2(<2 x half> %0, <2 x half> %1) {
217 ; CHECK: max.NaN.xorsign.abs.f16x2
218 %res = call <2 x half> @llvm.nvvm.fmax.nan.xorsign.abs.f16x2(<2 x half> %0, <2 x half> %1)
222 ; CHECK-LABEL: fmax_ftz_nan_xorsign_abs_f16x2
223 define <2 x half> @fmax_ftz_nan_xorsign_abs_f16x2(<2 x half> %0, <2 x half> %1) {
225 ; CHECK: max.ftz.NaN.xorsign.abs.f16x2
226 %res = call <2 x half> @llvm.nvvm.fmax.ftz.nan.xorsign.abs.f16x2(<2 x half> %0, <2 x half> %1)
230 ; CHECK-LABEL: fmax_xorsign_abs_bf16
231 define bfloat @fmax_xorsign_abs_bf16(bfloat %0, bfloat %1) {
233 ; CHECK: max.xorsign.abs.bf16
234 %res = call bfloat @llvm.nvvm.fmax.xorsign.abs.bf16(bfloat %0, bfloat %1)
238 ; CHECK-LABEL: fmax_nan_xorsign_abs_bf16
239 define bfloat @fmax_nan_xorsign_abs_bf16(bfloat %0, bfloat %1) {
241 ; CHECK: max.NaN.xorsign.abs.bf16
242 %res = call bfloat @llvm.nvvm.fmax.nan.xorsign.abs.bf16(bfloat %0, bfloat %1)
246 ; CHECK-LABEL: fmax_xorsign_abs_bf16x2
247 define <2 x bfloat> @fmax_xorsign_abs_bf16x2(<2 x bfloat> %0, <2 x bfloat> %1) {
249 ; CHECK: max.xorsign.abs.bf16x2
250 %res = call <2 x bfloat> @llvm.nvvm.fmax.xorsign.abs.bf16x2(<2 x bfloat> %0, <2 x bfloat> %1)
251 ret <2 x bfloat> %res
254 ; CHECK-LABEL: fmax_nan_xorsign_abs_bf16x2
255 define <2 x bfloat> @fmax_nan_xorsign_abs_bf16x2(<2 x bfloat> %0, <2 x bfloat> %1) {
257 ; CHECK: max.NaN.xorsign.abs.bf16x2
258 %res = call <2 x bfloat> @llvm.nvvm.fmax.nan.xorsign.abs.bf16x2(<2 x bfloat> %0, <2 x bfloat> %1)
259 ret <2 x bfloat> %res
262 ; CHECK-LABEL: fmax_xorsign_abs_f
263 define float @fmax_xorsign_abs_f(float %0, float %1) {
265 ; CHECK: max.xorsign.abs.f
266 %res = call float @llvm.nvvm.fmax.xorsign.abs.f(float %0, float %1)
270 ; CHECK-LABEL: fmax_ftz_xorsign_abs_f
271 define float @fmax_ftz_xorsign_abs_f(float %0, float %1) {
273 ; CHECK: max.ftz.xorsign.abs.f
274 %res = call float @llvm.nvvm.fmax.ftz.xorsign.abs.f(float %0, float %1)
278 ; CHECK-LABEL: fmax_nan_xorsign_abs_f
279 define float @fmax_nan_xorsign_abs_f(float %0, float %1) {
281 ; CHECK: max.NaN.xorsign.abs.f
282 %res = call float @llvm.nvvm.fmax.nan.xorsign.abs.f(float %0, float %1)
286 ; CHECK-LABEL: fmax_ftz_nan_xorsign_abs_f
287 define float @fmax_ftz_nan_xorsign_abs_f(float %0, float %1) {
289 ; CHECK: max.ftz.NaN.xorsign.abs.f
290 %res = call float @llvm.nvvm.fmax.ftz.nan.xorsign.abs.f(float %0, float %1)