• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=ptx32 -mattr=+ptx20 | FileCheck %s
2
3define ptx_device float @test_sqrt_f32(float %x) {
4entry:
5; CHECK: sqrt.rn.f32 %ret{{[0-9]+}}, %f{{[0-9]+}};
6; CHECK: ret;
7  %y = call float @llvm.sqrt.f32(float %x)
8  ret float %y
9}
10
11define ptx_device double @test_sqrt_f64(double %x) {
12entry:
13; CHECK: sqrt.rn.f64 %ret{{[0-9]+}}, %fd{{[0-9]+}};
14; CHECK: ret;
15  %y = call double @llvm.sqrt.f64(double %x)
16  ret double %y
17}
18
19define ptx_device float @test_sin_f32(float %x) {
20entry:
21; CHECK: sin.approx.f32 %ret{{[0-9]+}}, %f{{[0-9]+}};
22; CHECK: ret;
23  %y = call float @llvm.sin.f32(float %x)
24  ret float %y
25}
26
27define ptx_device double @test_sin_f64(double %x) {
28entry:
29; CHECK: sin.approx.f64 %ret{{[0-9]+}}, %fd{{[0-9]+}};
30; CHECK: ret;
31  %y = call double @llvm.sin.f64(double %x)
32  ret double %y
33}
34
35define ptx_device float @test_cos_f32(float %x) {
36entry:
37; CHECK: cos.approx.f32 %ret{{[0-9]+}}, %f{{[0-9]+}};
38; CHECK: ret;
39  %y = call float @llvm.cos.f32(float %x)
40  ret float %y
41}
42
43define ptx_device double @test_cos_f64(double %x) {
44entry:
45; CHECK: cos.approx.f64 %ret{{[0-9]+}}, %fd{{[0-9]+}};
46; CHECK: ret;
47  %y = call double @llvm.cos.f64(double %x)
48  ret double %y
49}
50
51declare float  @llvm.sqrt.f32(float)
52declare double @llvm.sqrt.f64(double)
53declare float  @llvm.sin.f32(float)
54declare double @llvm.sin.f64(double)
55declare float  @llvm.cos.f32(float)
56declare double @llvm.cos.f64(double)
57