]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/NVPTX/intrinsics.ll
Vendor import of llvm release_34 branch r197841 (effectively, 3.4 RC3):
[FreeBSD/FreeBSD.git] / test / CodeGen / NVPTX / intrinsics.ll
1 ; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
2 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s
3
4 define ptx_device float @test_fabsf(float %f) {
5 ; CHECK: abs.f32 %f{{[0-9]+}}, %f{{[0-9]+}};
6 ; CHECK: ret;
7         %x = call float @llvm.fabs.f32(float %f)
8         ret float %x
9 }
10
11 define ptx_device double @test_fabs(double %d) {
12 ; CHECK: abs.f64 %fl{{[0-9]+}}, %fl{{[0-9]+}};
13 ; CHECK: ret;
14         %x = call double @llvm.fabs.f64(double %d)
15         ret double %x
16 }
17
18 define float @test_nvvm_sqrt(float %a) {
19   %val = call float @llvm.nvvm.sqrt.f(float %a)
20   ret float %val
21 }
22
23
24 declare float @llvm.fabs.f32(float)
25 declare double @llvm.fabs.f64(double)
26 declare float @llvm.nvvm.sqrt.f(float)