2012-05-28 23:48:37 +02:00
|
|
|
; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
|
|
|
|
; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s
|
|
|
|
|
|
|
|
define ptx_device float @test_fabsf(float %f) {
|
2013-05-31 14:14:49 +02:00
|
|
|
; CHECK: abs.f32 %f{{[0-9]+}}, %f{{[0-9]+}};
|
2012-05-28 23:48:37 +02:00
|
|
|
; CHECK: ret;
|
|
|
|
%x = call float @llvm.fabs.f32(float %f)
|
|
|
|
ret float %x
|
|
|
|
}
|
|
|
|
|
|
|
|
define ptx_device double @test_fabs(double %d) {
|
2013-05-31 14:14:49 +02:00
|
|
|
; CHECK: abs.f64 %fl{{[0-9]+}}, %fl{{[0-9]+}};
|
2012-05-28 23:48:37 +02:00
|
|
|
; CHECK: ret;
|
|
|
|
%x = call double @llvm.fabs.f64(double %d)
|
|
|
|
ret double %x
|
|
|
|
}
|
|
|
|
|
2013-05-21 18:51:30 +02:00
|
|
|
define float @test_nvvm_sqrt(float %a) {
|
|
|
|
%val = call float @llvm.nvvm.sqrt.f(float %a)
|
|
|
|
ret float %val
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-05-28 23:48:37 +02:00
|
|
|
declare float @llvm.fabs.f32(float)
|
|
|
|
declare double @llvm.fabs.f64(double)
|
2013-05-21 18:51:30 +02:00
|
|
|
declare float @llvm.nvvm.sqrt.f(float)
|