2012-05-28 21:48:37 +00: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 12:14:49 +00:00
|
|
|
; CHECK: abs.f32 %f{{[0-9]+}}, %f{{[0-9]+}};
|
2012-05-28 21:48:37 +00:00
|
|
|
; CHECK: ret;
|
|
|
|
%x = call float @llvm.fabs.f32(float %f)
|
|
|
|
ret float %x
|
|
|
|
}
|
|
|
|
|
|
|
|
define ptx_device double @test_fabs(double %d) {
|
2014-07-16 16:26:58 +00:00
|
|
|
; CHECK: abs.f64 %fd{{[0-9]+}}, %fd{{[0-9]+}};
|
2012-05-28 21:48:37 +00:00
|
|
|
; CHECK: ret;
|
|
|
|
%x = call double @llvm.fabs.f64(double %d)
|
|
|
|
ret double %x
|
|
|
|
}
|
|
|
|
|
2013-05-21 16:51:30 +00:00
|
|
|
define float @test_nvvm_sqrt(float %a) {
|
|
|
|
%val = call float @llvm.nvvm.sqrt.f(float %a)
|
|
|
|
ret float %val
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-05-28 21:48:37 +00:00
|
|
|
declare float @llvm.fabs.f32(float)
|
|
|
|
declare double @llvm.fabs.f64(double)
|
2013-05-21 16:51:30 +00:00
|
|
|
declare float @llvm.nvvm.sqrt.f(float)
|