summaryrefslogtreecommitdiffstats
path: root/libclc/generic/include
diff options
context:
space:
mode:
authorJan Vesely <jan.vesely@rutgers.edu>2018-03-12 19:46:52 +0000
committerJan Vesely <jan.vesely@rutgers.edu>2018-03-12 19:46:52 +0000
commitb672f7a2519afc54b852ebb6b5b4e51d80deea57 (patch)
treedfeb55596576f2f9613d12bda04b3be9e3121c0d /libclc/generic/include
parent08c96acb277de1916c19f217b09aa023910f68b9 (diff)
downloadbcm5719-llvm-b672f7a2519afc54b852ebb6b5b4e51d80deea57.tar.gz
bcm5719-llvm-b672f7a2519afc54b852ebb6b5b4e51d80deea57.zip
nan: Implement
Passes CTS on carrizo and turks Reviewer: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 327324
Diffstat (limited to 'libclc/generic/include')
-rw-r--r--libclc/generic/include/clc/clc.h1
-rw-r--r--libclc/generic/include/clc/math/nan.h8
-rw-r--r--libclc/generic/include/clc/math/nan.inc16
3 files changed, 25 insertions, 0 deletions
diff --git a/libclc/generic/include/clc/clc.h b/libclc/generic/include/clc/clc.h
index decc899d2d2..36ab134be9c 100644
--- a/libclc/generic/include/clc/clc.h
+++ b/libclc/generic/include/clc/clc.h
@@ -98,6 +98,7 @@
#include <clc/math/maxmag.h>
#include <clc/math/minmag.h>
#include <clc/math/modf.h>
+#include <clc/math/nan.h>
#include <clc/math/nextafter.h>
#include <clc/math/pow.h>
#include <clc/math/pown.h>
diff --git a/libclc/generic/include/clc/math/nan.h b/libclc/generic/include/clc/math/nan.h
new file mode 100644
index 00000000000..090749307f9
--- /dev/null
+++ b/libclc/generic/include/clc/math/nan.h
@@ -0,0 +1,8 @@
+#define __CLC_CONCAT(x, y) x ## y
+#define __CLC_XCONCAT(x, y) __CLC_CONCAT(x, y)
+
+#define __CLC_BODY <clc/math/nan.inc>
+#include <clc/math/gentype.inc>
+
+#undef __CLC_XCONCAT
+#undef __CLC_CONCAT
diff --git a/libclc/generic/include/clc/math/nan.inc b/libclc/generic/include/clc/math/nan.inc
new file mode 100644
index 00000000000..bf36ed24620
--- /dev/null
+++ b/libclc/generic/include/clc/math/nan.inc
@@ -0,0 +1,16 @@
+#ifdef __CLC_SCALAR
+#define __CLC_VECSIZE
+#endif
+
+#if __CLC_FPSIZE == 64
+#define __CLC_NATN __CLC_XCONCAT(ulong, __CLC_VECSIZE)
+#else
+#define __CLC_NATN __CLC_XCONCAT(uint, __CLC_VECSIZE)
+#endif
+
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE nan(__CLC_NATN code);
+
+#undef __CLC_NATN
+#ifdef __CLC_SCALAR
+#undef __CLC_VECSIZE
+#endif
OpenPOWER on IntegriCloud