[libclc] r317940 - native_sqrt: Switch implementation to llvm intrinsic
Jan Vesely via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 10 14:16:39 PST 2017
Author: jvesely
Date: Fri Nov 10 14:16:39 2017
New Revision: 317940
URL: http://llvm.org/viewvc/llvm-project?rev=317940&view=rev
Log:
native_sqrt: 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_sqrt.cl
Modified:
libclc/trunk/generic/include/clc/math/native_sqrt.h
libclc/trunk/generic/lib/SOURCES
Modified: libclc/trunk/generic/include/clc/math/native_sqrt.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/native_sqrt.h?rev=317940&r1=317939&r2=317940&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/math/native_sqrt.h (original)
+++ libclc/trunk/generic/include/clc/math/native_sqrt.h Fri Nov 10 14:16:39 2017
@@ -1 +1,9 @@
-#define native_sqrt sqrt
+#define __CLC_BODY <clc/math/unary_decl.inc>
+#define __CLC_FUNCTION native_sqrt
+#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=317940&r1=317939&r2=317940&view=diff
==============================================================================
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Fri Nov 10 14:16:39 2017
@@ -126,6 +126,7 @@ math/native_log.cl
math/native_log10.cl
math/native_log2.cl
math/native_sin.cl
+math/native_sqrt.cl
math/tables.cl
math/clc_nextafter.cl
math/nextafter.cl
Added: libclc/trunk/generic/lib/math/native_sqrt.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/native_sqrt.cl?rev=317940&view=auto
==============================================================================
--- libclc/trunk/generic/lib/math/native_sqrt.cl (added)
+++ libclc/trunk/generic/lib/math/native_sqrt.cl Fri Nov 10 14:16:39 2017
@@ -0,0 +1,7 @@
+#include <clc/clc.h>
+
+#define __CLC_NATIVE_INTRINSIC sqrt
+
+#define __CLC_BODY <native_unary_intrinsic.inc>
+#define __FLOAT_ONLY
+#include <clc/math/gentype.inc>
More information about the cfe-commits
mailing list