xref: /llvm-project/llvm/test/CodeGen/NVPTX/math-intrins-sm53-ptx42.ll (revision b279f6b098d3849f7f1c1f539b108307d5f8ae2d)
1; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_53 -mattr=+ptx42 | FileCheck %s
2; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64 -mcpu=sm_53 -mattr=+ptx42 | %ptxas-verify -arch=sm_53 %}
3
4declare half @llvm.nvvm.fma.rn.f16(half, half, half)
5declare half @llvm.nvvm.fma.rn.ftz.f16(half, half, half)
6declare half @llvm.nvvm.fma.rn.sat.f16(half, half, half)
7declare half @llvm.nvvm.fma.rn.ftz.sat.f16(half, half, half)
8declare <2 x half> @llvm.nvvm.fma.rn.f16x2(<2 x half>, <2 x half>, <2 x half>)
9declare <2 x half> @llvm.nvvm.fma.rn.ftz.f16x2(<2 x half>, <2 x half>, <2 x half>)
10declare <2 x half> @llvm.nvvm.fma.rn.sat.f16x2(<2 x half>, <2 x half>, <2 x half>)
11declare <2 x half> @llvm.nvvm.fma.rn.ftz.sat.f16x2(<2 x half>, <2 x half>, <2 x half>)
12
13; CHECK-LABEL: fma_rn_f16
14define half @fma_rn_f16(half %0, half %1, half %2) {
15  ; CHECK-NOT: call
16  ; CHECK: fma.rn.f16
17  %res = call half @llvm.nvvm.fma.rn.f16(half %0, half %1, half %2)
18  ret half %res
19}
20
21; CHECK-LABEL: fma_rn_ftz_f16
22define half @fma_rn_ftz_f16(half %0, half %1, half %2) {
23  ; CHECK-NOT: call
24  ; CHECK: fma.rn.ftz.f16
25  %res = call half @llvm.nvvm.fma.rn.ftz.f16(half %0, half %1, half %2)
26  ret half %res
27}
28
29; CHECK-LABEL: fma_rn_sat_f16
30define half @fma_rn_sat_f16(half %0, half %1, half %2) {
31  ; CHECK-NOT: call
32  ; CHECK: fma.rn.sat.f16
33  %res = call half @llvm.nvvm.fma.rn.sat.f16(half %0, half %1, half %2)
34  ret half %res
35}
36
37; CHECK-LABEL: fma_rn_ftz_sat_f16
38define half @fma_rn_ftz_sat_f16(half %0, half %1, half %2) {
39  ; CHECK-NOT: call
40  ; CHECK: fma.rn.ftz.sat.f16
41  %res = call half @llvm.nvvm.fma.rn.ftz.sat.f16(half %0, half %1, half %2)
42  ret half %res
43}
44
45; CHECK-LABEL: fma_rn_f16x2
46define <2 x half> @fma_rn_f16x2(<2 x half> %0, <2 x half> %1, <2 x half> %2) {
47  ; CHECK-NOT: call
48  ; CHECK: fma.rn.f16x2
49  %res = call <2 x half> @llvm.nvvm.fma.rn.f16x2(<2 x half> %0, <2 x half> %1, <2 x half> %2)
50  ret <2 x half> %res
51}
52
53; CHECK-LABEL: fma_rn_ftz_f16x2
54define <2 x half> @fma_rn_ftz_f16x2(<2 x half> %0, <2 x half> %1, <2 x half> %2) {
55  ; CHECK-NOT: call
56  ; CHECK: fma.rn.ftz.f16x2
57  %res = call <2 x half> @llvm.nvvm.fma.rn.ftz.f16x2(<2 x half> %0, <2 x half> %1, <2 x half> %2)
58  ret <2 x half> %res
59}
60
61; CHECK-LABEL: fma_rn_sat_f16x2
62define <2 x half> @fma_rn_sat_f16x2(<2 x half> %0, <2 x half> %1, <2 x half> %2) {
63  ; CHECK-NOT: call
64  ; CHECK: fma.rn.sat.f16x2
65  %res = call <2 x half> @llvm.nvvm.fma.rn.sat.f16x2(<2 x half> %0, <2 x half> %1, <2 x half> %2)
66  ret <2 x half> %res
67}
68
69; CHECK-LABEL: fma_rn_ftz_sat_f16x2
70define <2 x half> @fma_rn_ftz_sat_f16x2(<2 x half> %0, <2 x half> %1, <2 x half> %2) {
71  ; CHECK-NOT: call
72  ; CHECK: fma.rn.ftz.sat.f16x2
73  %res = call <2 x half> @llvm.nvvm.fma.rn.ftz.sat.f16x2(<2 x half> %0, <2 x half> %1, <2 x half> %2)
74  ret <2 x half> %res
75}
76