half_powr: Implement using powr
authorJan Vesely <jan.vesely@rutgers.edu>
Thu, 1 Feb 2018 03:00:35 +0000 (03:00 +0000)
committerJan Vesely <jan.vesely@rutgers.edu>
Thu, 1 Feb 2018 03:00:35 +0000 (03:00 +0000)
v2: Use full precision implementation

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

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

index edb67fd..decc899 100644 (file)
@@ -78,6 +78,7 @@
 #include <clc/math/half_log.h>
 #include <clc/math/half_log10.h>
 #include <clc/math/half_log2.h>
+#include <clc/math/half_powr.h>
 #include <clc/math/half_recip.h>
 #include <clc/math/half_rsqrt.h>
 #include <clc/math/half_sin.h>
diff --git a/libclc/generic/include/clc/math/half_powr.h b/libclc/generic/include/clc/math/half_powr.h
new file mode 100644 (file)
index 0000000..c4e5242
--- /dev/null
@@ -0,0 +1,7 @@
+#define __CLC_BODY <clc/math/binary_decl_tt.inc>
+#define __CLC_FUNCTION half_powr
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION
index 3109286..13fe4fa 100644 (file)
@@ -112,6 +112,7 @@ math/half_exp2.cl
 math/half_log.cl
 math/half_log10.cl
 math/half_log2.cl
+math/half_powr.cl
 math/half_recip.cl
 math/half_rsqrt.cl
 math/half_sin.cl
diff --git a/libclc/generic/lib/math/half_powr.cl b/libclc/generic/lib/math/half_powr.cl
new file mode 100644 (file)
index 0000000..53174d4
--- /dev/null
@@ -0,0 +1,6 @@
+#include <clc/clc.h>
+
+#define __CLC_FUNC powr
+#define __CLC_BODY <half_binary.inc>
+#define __FLOAT_ONLY
+#include <clc/math/gentype.inc>