2012-05-29 05:48:37 +08: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 20:14:49 +08:00
|
|
|
; CHECK: abs.f32 %f{{[0-9]+}}, %f{{[0-9]+}};
|
2012-05-29 05:48:37 +08: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 20:14:49 +08:00
|
|
|
; CHECK: abs.f64 %fl{{[0-9]+}}, %fl{{[0-9]+}};
|
2012-05-29 05:48:37 +08:00
|
|
|
; CHECK: ret;
|
|
|
|
%x = call double @llvm.fabs.f64(double %d)
|
|
|
|
ret double %x
|
|
|
|
}
|
|
|
|
|
2013-05-22 00:51:30 +08:00
|
|
|
define float @test_nvvm_sqrt(float %a) {
|
|
|
|
%val = call float @llvm.nvvm.sqrt.f(float %a)
|
|
|
|
ret float %val
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-05-29 05:48:37 +08:00
|
|
|
declare float @llvm.fabs.f32(float)
|
|
|
|
declare double @llvm.fabs.f64(double)
|
2013-05-22 00:51:30 +08:00
|
|
|
declare float @llvm.nvvm.sqrt.f(float)
|