aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/NVPTX/intrinsics.ll
blob: afab60ca96a8af944c3f0fc8b4d6ef5f18cd05c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
; RUN: llc < %s -march=nvptx -mcpu=sm_10 | FileCheck %s
; RUN: llc < %s -march=nvptx64 -mcpu=sm_10 | FileCheck %s
; 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) {
; CHECK: abs.f32 %f0, %f0;
; CHECK: ret;
	%x = call float @llvm.fabs.f32(float %f)
	ret float %x
}

define ptx_device double @test_fabs(double %d) {
; CHECK: abs.f64 %fl0, %fl0;
; CHECK: ret;
	%x = call double @llvm.fabs.f64(double %d)
	ret double %x
}

declare float @llvm.fabs.f32(float)
declare double @llvm.fabs.f64(double)