half_log: Implement using log
authorJan Vesely <jan.vesely@rutgers.edu>
Thu, 18 Jan 2018 21:11:50 +0000 (21:11 +0000)
committerJan Vesely <jan.vesely@rutgers.edu>
Thu, 18 Jan 2018 21:11:50 +0000 (21:11 +0000)
Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322893

libclc/generic/include/clc/clc.h
libclc/generic/include/clc/math/half_log.h [new file with mode: 0644]
libclc/generic/lib/SOURCES
libclc/generic/lib/math/half_log.cl [new file with mode: 0644]

index a9457c0..8ff6066 100644 (file)
@@ -74,6 +74,7 @@
 #include <clc/math/half_exp.h>
 #include <clc/math/half_exp10.h>
 #include <clc/math/half_exp2.h>
+#include <clc/math/half_log.h>
 #include <clc/math/half_rsqrt.h>
 #include <clc/math/half_sqrt.h>
 #include <clc/math/hypot.h>
diff --git a/libclc/generic/include/clc/math/half_log.h b/libclc/generic/include/clc/math/half_log.h
new file mode 100644 (file)
index 0000000..de8fe24
--- /dev/null
@@ -0,0 +1,9 @@
+#define __CLC_BODY <clc/math/unary_decl.inc>
+#define __CLC_FUNCTION half_log
+#define __FLOAT_ONLY
+
+#include <clc/math/gentype.inc>
+
+#undef __FLOAT_ONLY
+#undef __CLC_BODY
+#undef __CLC_FUNCTION
index 292e9b4..f746bcd 100644 (file)
@@ -108,6 +108,7 @@ math/half_cos.cl
 math/half_exp.cl
 math/half_exp10.cl
 math/half_exp2.cl
+math/half_log.cl
 math/half_rsqrt.cl
 math/half_sqrt.cl
 math/hypot.cl
diff --git a/libclc/generic/lib/math/half_log.cl b/libclc/generic/lib/math/half_log.cl
new file mode 100644 (file)
index 0000000..a46653a
--- /dev/null
@@ -0,0 +1,6 @@
+#include <clc/clc.h>
+
+#define __CLC_FUNC log
+#define __CLC_BODY <half_unary.inc>
+#define __FLOAT_ONLY
+#include <clc/math/gentype.inc>