summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Vesely <jan.vesely@rutgers.edu>2018-01-18 21:11:40 +0000
committerJan Vesely <jan.vesely@rutgers.edu>2018-01-18 21:11:40 +0000
commitb5d556061d1f72b00a9d4c276e8bee76bdb24492 (patch)
tree2956463007db98b32eaef201ba32584c2bcf85b2
parente53ae3b596616cb03f656815f11ae0338c4d4898 (diff)
downloadbcm5719-llvm-b5d556061d1f72b00a9d4c276e8bee76bdb24492.tar.gz
bcm5719-llvm-b5d556061d1f72b00a9d4c276e8bee76bdb24492.zip
half_cos: Implement using cos
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: 322889
-rw-r--r--libclc/generic/include/clc/clc.h1
-rw-r--r--libclc/generic/include/clc/math/half_cos.h9
-rw-r--r--libclc/generic/lib/SOURCES1
-rw-r--r--libclc/generic/lib/math/half_cos.cl6
4 files changed, 17 insertions, 0 deletions
diff --git a/libclc/generic/include/clc/clc.h b/libclc/generic/include/clc/clc.h
index 7525f24198f..6f2bc6da447 100644
--- a/libclc/generic/include/clc/clc.h
+++ b/libclc/generic/include/clc/clc.h
@@ -70,6 +70,7 @@
#include <clc/math/fmod.h>
#include <clc/math/fract.h>
#include <clc/math/frexp.h>
+#include <clc/math/half_cos.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_cos.h b/libclc/generic/include/clc/math/half_cos.h
new file mode 100644
index 00000000000..e278e12403f
--- /dev/null
+++ b/libclc/generic/include/clc/math/half_cos.h
@@ -0,0 +1,9 @@
+#define __CLC_BODY <clc/math/unary_decl.inc>
+#define __CLC_FUNCTION half_cos
+#define __FLOAT_ONLY
+
+#include <clc/math/gentype.inc>
+
+#undef __FLOAT_ONLY
+#undef __CLC_BODY
+#undef __CLC_FUNCTION
diff --git a/libclc/generic/lib/SOURCES b/libclc/generic/lib/SOURCES
index 7ed95794ef5..20c79701725 100644
--- a/libclc/generic/lib/SOURCES
+++ b/libclc/generic/lib/SOURCES
@@ -104,6 +104,7 @@ math/fmin.cl
math/fmod.cl
math/fract.cl
math/frexp.cl
+math/half_cos.cl
math/half_rsqrt.cl
math/half_sqrt.cl
math/hypot.cl
diff --git a/libclc/generic/lib/math/half_cos.cl b/libclc/generic/lib/math/half_cos.cl
new file mode 100644
index 00000000000..3cad97a9429
--- /dev/null
+++ b/libclc/generic/lib/math/half_cos.cl
@@ -0,0 +1,6 @@
+#include <clc/clc.h>
+
+#define __CLC_FUNC cos
+#define __CLC_BODY <half_unary.inc>
+#define __FLOAT_ONLY
+#include <clc/math/gentype.inc>
OpenPOWER on IntegriCloud