[libclc] r317938 - native_cos: Switch implementation to llvm intrinsic

Jan Vesely via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 10 14:16:33 PST 2017


Author: jvesely
Date: Fri Nov 10 14:16:33 2017
New Revision: 317938

URL: http://llvm.org/viewvc/llvm-project?rev=317938&view=rev
Log:
native_cos: Switch implementation to llvm intrinsic

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>

Added:
    libclc/trunk/generic/lib/math/native_cos.cl
Modified:
    libclc/trunk/generic/include/clc/math/native_cos.h
    libclc/trunk/generic/lib/SOURCES

Modified: libclc/trunk/generic/include/clc/math/native_cos.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/native_cos.h?rev=317938&r1=317937&r2=317938&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/math/native_cos.h (original)
+++ libclc/trunk/generic/include/clc/math/native_cos.h Fri Nov 10 14:16:33 2017
@@ -1 +1,9 @@
-#define native_cos cos
+#define __CLC_BODY <clc/math/unary_decl.inc>
+#define __CLC_FUNCTION native_cos
+#define __FLOAT_ONLY
+
+#include <clc/math/gentype.inc>
+
+#undef __FLOAT_ONLY
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Modified: libclc/trunk/generic/lib/SOURCES
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=317938&r1=317937&r2=317938&view=diff
==============================================================================
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Fri Nov 10 14:16:33 2017
@@ -119,6 +119,7 @@ math/log2.cl
 math/logb.cl
 math/mad.cl
 math/modf.cl
+math/native_cos.cl
 math/native_exp.cl
 math/native_exp2.cl
 math/native_log.cl

Added: libclc/trunk/generic/lib/math/native_cos.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/native_cos.cl?rev=317938&view=auto
==============================================================================
--- libclc/trunk/generic/lib/math/native_cos.cl (added)
+++ libclc/trunk/generic/lib/math/native_cos.cl Fri Nov 10 14:16:33 2017
@@ -0,0 +1,7 @@
+#include <clc/clc.h>
+
+#define __CLC_NATIVE_INTRINSIC cos
+
+#define __CLC_BODY <native_unary_intrinsic.inc>
+#define __FLOAT_ONLY
+#include <clc/math/gentype.inc>




More information about the cfe-commits mailing list