Home | History | Annotate | Download | only in NVPTX
      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 %fd{{[0-9]+}}, %fd{{[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 ; CHECK: sqrt.rn.f32 %f{{[0-9]+}}, %f{{[0-9]+}};
     20 ; CHECK: ret;
     21   %val = call float @llvm.nvvm.sqrt.f(float %a)
     22   ret float %val
     23 }
     24 
     25 
     26 declare float @llvm.fabs.f32(float)
     27 declare double @llvm.fabs.f64(double)
     28 declare float @llvm.nvvm.sqrt.f(float)
     29