[libclc] 106/291: Implement trunc builtin.

Andreas Beckmann anbe at moszumanska.debian.org
Tue Sep 8 10:53:38 UTC 2015


This is an automated email from the git hooks/post-receive script.

anbe pushed a commit to branch master
in repository libclc.

commit 9173b5d98e3923006e098cc9c9d109b06fc9277a
Author: Tom Stellard <thomas.stellard at amd.com>
Date:   Fri Dec 20 02:08:46 2013 +0000

    Implement trunc builtin.
    
    OpenCL C lang says that trunc rounds towards zero.
    llvm.trunc.* intrinsic rounds to integer not larger in magnitude.
    These definitions are equivalent.
    
    Patch by: Jan Vesely
    
    Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
    Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
    
    git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@197769 91177308-0d34-0410-b5e6-96231b3b80d8
---
 generic/include/clc/clc.h        | 1 +
 generic/include/clc/math/trunc.h | 9 +++++++++
 2 files changed, 10 insertions(+)

diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index 8f0dbd3..c14d072 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -51,6 +51,7 @@
 #include <clc/math/round.h>
 #include <clc/math/sin.h>
 #include <clc/math/sqrt.h>
+#include <clc/math/trunc.h>
 #include <clc/math/native_cos.h>
 #include <clc/math/native_divide.h>
 #include <clc/math/native_exp.h>
diff --git a/generic/include/clc/math/trunc.h b/generic/include/clc/math/trunc.h
new file mode 100644
index 0000000..d34f661
--- /dev/null
+++ b/generic/include/clc/math/trunc.h
@@ -0,0 +1,9 @@
+#undef trunc
+#define trunc __clc_trunc
+
+#define __CLC_FUNCTION __clc_trunc
+#define __CLC_INTRINSIC "llvm.trunc"
+#include <clc/math/unary_intrin.inc>
+
+#undef __CLC_FUNCTION
+#undef __CLC_INTRINSIC

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/libclc.git



More information about the Pkg-opencl-commits mailing list