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 i16 @llvm.nvvm.fmin.xorsign.abs.bf16(i16, i16)
13 declare i16 @llvm.nvvm.fmin.nan.xorsign.abs.bf16(i16, i16)
14 declare i32 @llvm.nvvm.fmin.xorsign.abs.bf16x2(i32, i32)
15 declare i32 @llvm.nvvm.fmin.nan.xorsign.abs.bf16x2(i32, i32)
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 i16 @llvm.nvvm.fmax.xorsign.abs.bf16(i16, i16)
30 declare i16 @llvm.nvvm.fmax.nan.xorsign.abs.bf16(i16, i16)
31 declare i32 @llvm.nvvm.fmax.xorsign.abs.bf16x2(i32, i32)
32 declare i32 @llvm.nvvm.fmax.nan.xorsign.abs.bf16x2(i32, i32)
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 i16 @fmin_xorsign_abs_bf16(i16 %0, i16 %1) {
105 ; CHECK: min.xorsign.abs.bf16
106 %res = call i16 @llvm.nvvm.fmin.xorsign.abs.bf16(i16 %0, i16 %1)
110 ; CHECK-LABEL: fmin_nan_xorsign_abs_bf16
111 define i16 @fmin_nan_xorsign_abs_bf16(i16 %0, i16 %1) {
113 ; CHECK: min.NaN.xorsign.abs.bf16
114 %res = call i16 @llvm.nvvm.fmin.nan.xorsign.abs.bf16(i16 %0, i16 %1)
118 ; CHECK-LABEL: fmin_xorsign_abs_bf16x2
119 define i32 @fmin_xorsign_abs_bf16x2(i32 %0, i32 %1) {
121 ; CHECK: min.xorsign.abs.bf16x2
122 %res = call i32 @llvm.nvvm.fmin.xorsign.abs.bf16x2(i32 %0, i32 %1)
126 ; CHECK-LABEL: fmin_nan_xorsign_abs_bf16x2
127 define i32 @fmin_nan_xorsign_abs_bf16x2(i32 %0, i32 %1) {
129 ; CHECK: min.NaN.xorsign.abs.bf16x2
130 %res = call i32 @llvm.nvvm.fmin.nan.xorsign.abs.bf16x2(i32 %0, i32 %1)
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 i16 @fmax_xorsign_abs_bf16(i16 %0, i16 %1) {
233 ; CHECK: max.xorsign.abs.bf16
234 %res = call i16 @llvm.nvvm.fmax.xorsign.abs.bf16(i16 %0, i16 %1)
238 ; CHECK-LABEL: fmax_nan_xorsign_abs_bf16
239 define i16 @fmax_nan_xorsign_abs_bf16(i16 %0, i16 %1) {
241 ; CHECK: max.NaN.xorsign.abs.bf16
242 %res = call i16 @llvm.nvvm.fmax.nan.xorsign.abs.bf16(i16 %0, i16 %1)
246 ; CHECK-LABEL: fmax_xorsign_abs_bf16x2
247 define i32 @fmax_xorsign_abs_bf16x2(i32 %0, i32 %1) {
249 ; CHECK: max.xorsign.abs.bf16x2
250 %res = call i32 @llvm.nvvm.fmax.xorsign.abs.bf16x2(i32 %0, i32 %1)
254 ; CHECK-LABEL: fmax_nan_xorsign_abs_bf16x2
255 define i32 @fmax_nan_xorsign_abs_bf16x2(i32 %0, i32 %1) {
257 ; CHECK: max.NaN.xorsign.abs.bf16x2
258 %res = call i32 @llvm.nvvm.fmax.nan.xorsign.abs.bf16x2(i32 %0, i32 %1)
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)