1 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_80 -mattr=+ptx71 --enable-unsafe-fp-math | FileCheck --check-prefixes=CHECK %s
\r
2 ; RUN: %if ptxas-11.8 %{ llc < %s -march=nvptx64 -mcpu=sm_80 -mattr=+ptx71 --enable-unsafe-fp-math | %ptxas-verify -arch=sm_80 %}
\r
4 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
\r
6 declare <2 x bfloat> @llvm.sin.f16(<2 x bfloat> %a) #0
\r
7 declare <2 x bfloat> @llvm.cos.f16(<2 x bfloat> %a) #0
\r
9 ; CHECK-LABEL: test_sin(
\r
10 ; CHECK: ld.param.b32 [[A:%r[0-9]+]], [test_sin_param_0];
\r
11 ; CHECK: mov.b32 {[[A0:%rs[0-9]+]], [[A1:%rs[0-9]+]]}, [[A]]
\r
12 ; CHECK-DAG: cvt.f32.bf16 [[AF0:%f[0-9]+]], [[A0]];
\r
13 ; CHECK-DAG: cvt.f32.bf16 [[AF1:%f[0-9]+]], [[A1]];
\r
14 ; CHECK-DAG: sin.approx.f32 [[RF0:%f[0-9]+]], [[AF0]];
\r
15 ; CHECK-DAG: sin.approx.f32 [[RF1:%f[0-9]+]], [[AF1]];
\r
16 ; CHECK-DAG: cvt.rn.bf16.f32 [[R0:%rs[0-9]+]], [[RF0]];
\r
17 ; CHECK-DAG: cvt.rn.bf16.f32 [[R1:%rs[0-9]+]], [[RF1]];
\r
18 ; CHECK: mov.b32 [[R:%r[0-9]+]], {[[R0]], [[R1]]}
\r
19 ; CHECK: st.param.b32 [func_retval0+0], [[R]];
\r
21 define <2 x bfloat> @test_sin(<2 x bfloat> %a) #0 #1 {
\r
22 %r = call <2 x bfloat> @llvm.sin.f16(<2 x bfloat> %a)
\r
26 ; CHECK-LABEL: test_cos(
\r
27 ; CHECK: ld.param.b32 [[A:%r[0-9]+]], [test_cos_param_0];
\r
28 ; CHECK: mov.b32 {[[A0:%rs[0-9]+]], [[A1:%rs[0-9]+]]}, [[A]]
\r
29 ; CHECK-DAG: cvt.f32.bf16 [[AF0:%f[0-9]+]], [[A0]];
\r
30 ; CHECK-DAG: cvt.f32.bf16 [[AF1:%f[0-9]+]], [[A1]];
\r
31 ; CHECK-DAG: cos.approx.f32 [[RF0:%f[0-9]+]], [[AF0]];
\r
32 ; CHECK-DAG: cos.approx.f32 [[RF1:%f[0-9]+]], [[AF1]];
\r
33 ; CHECK-DAG: cvt.rn.bf16.f32 [[R0:%rs[0-9]+]], [[RF0]];
\r
34 ; CHECK-DAG: cvt.rn.bf16.f32 [[R1:%rs[0-9]+]], [[RF1]];
\r
35 ; CHECK: mov.b32 [[R:%r[0-9]+]], {[[R0]], [[R1]]}
\r
36 ; CHECK: st.param.b32 [func_retval0+0], [[R]];
\r
38 define <2 x bfloat> @test_cos(<2 x bfloat> %a) #0 #1 {
\r
39 %r = call <2 x bfloat> @llvm.cos.f16(<2 x bfloat> %a)
\r