summaryrefslogtreecommitdiff
path: root/test/CodeGen/R600
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-12-20 05:11:55 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-12-20 05:11:55 +0000
commit37ee312f7766714e9fcb0b848a13c5cf456fd0b7 (patch)
tree57251270c76c3f4115354ac1451652b26ac6d122 /test/CodeGen/R600
parent658537c710e399aa4e9c4ca3cd2f8211bc240560 (diff)
downloadllvm-37ee312f7766714e9fcb0b848a13c5cf456fd0b7.tar.gz
llvm-37ee312f7766714e9fcb0b848a13c5cf456fd0b7.tar.bz2
llvm-37ee312f7766714e9fcb0b848a13c5cf456fd0b7.tar.xz
R600: Allow ftrunc
v2: Add ftrunc->TRUNC pattern instead of replacing int_AMDGPU_trunc v3: move ftrunc pattern next to TRUNC definition, it's available since R600 Patch By: Jan Vesely Reviewed-by: Tom Stellard <thomas.stellard@amd.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197783 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/R600')
-rw-r--r--test/CodeGen/R600/llvm.trunc.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGen/R600/llvm.trunc.ll b/test/CodeGen/R600/llvm.trunc.ll
new file mode 100644
index 0000000000..fa6fb9906d
--- /dev/null
+++ b/test/CodeGen/R600/llvm.trunc.ll
@@ -0,0 +1,13 @@
+; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s
+
+; CHECK-LABEL: @trunc_f32
+; CHECK: TRUNC
+
+define void @trunc_f32(float addrspace(1)* %out, float %in) {
+entry:
+ %0 = call float @llvm.trunc.f32(float %in)
+ store float %0, float addrspace(1)* %out
+ ret void
+}
+
+declare float @llvm.trunc.f32(float)