[libclc] 75/79: nan: Implement

Andreas Boll aboll-guest at moszumanska.debian.org
Mon Mar 19 16:51:02 UTC 2018


This is an automated email from the git hooks/post-receive script.

aboll-guest pushed a commit to branch master
in repository libclc.

commit 00236279a293b3737dee08c14f25923a889d2795
Author: Jan Vesely <jan.vesely at rutgers.edu>
Date:   Mon Mar 12 19:46:52 2018 +0000

    nan: Implement
    
    Passes CTS on carrizo and turks
    
    Reviewer: Aaron Watry <awatry at gmail.com>
    Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
    
    git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@327324 91177308-0d34-0410-b5e6-96231b3b80d8
---
 generic/include/clc/clc.h        |  1 +
 generic/include/clc/math/nan.h   |  8 ++++++++
 generic/include/clc/math/nan.inc | 16 ++++++++++++++++
 generic/lib/SOURCES              |  1 +
 generic/lib/math/nan.cl          |  6 ++++++
 generic/lib/math/nan.inc         | 20 ++++++++++++++++++++
 6 files changed, 52 insertions(+)

diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index decc899..36ab134 100644
--- a/generic/include/clc/clc.h
+++ b/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/generic/include/clc/math/nan.h b/generic/include/clc/math/nan.h
new file mode 100644
index 0000000..0907493
--- /dev/null
+++ b/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/generic/include/clc/math/nan.inc b/generic/include/clc/math/nan.inc
new file mode 100644
index 0000000..bf36ed2
--- /dev/null
+++ b/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
diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES
index 247708a..9c060ed 100644
--- a/generic/lib/SOURCES
+++ b/generic/lib/SOURCES
@@ -134,6 +134,7 @@ math/mad.cl
 math/maxmag.cl
 math/minmag.cl
 math/modf.cl
+math/nan.cl
 math/native_cos.cl
 math/native_divide.cl
 math/native_exp.cl
diff --git a/generic/lib/math/nan.cl b/generic/lib/math/nan.cl
new file mode 100644
index 0000000..03752ab
--- /dev/null
+++ b/generic/lib/math/nan.cl
@@ -0,0 +1,6 @@
+#include <clc/clc.h>
+#include "utils.h"
+
+#define __CLC_AS_GENTYPE __CLC_XCONCAT(as_, __CLC_GENTYPE)
+#define __CLC_BODY <nan.inc>
+#include <clc/math/gentype.inc>
diff --git a/generic/lib/math/nan.inc b/generic/lib/math/nan.inc
new file mode 100644
index 0000000..6e4afc8
--- /dev/null
+++ b/generic/lib/math/nan.inc
@@ -0,0 +1,20 @@
+#ifdef __CLC_SCALAR
+#define __CLC_VECSIZE
+#endif
+
+#if __CLC_FPSIZE == 64
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE nan(__CLC_XCONCAT(ulong, __CLC_VECSIZE) code)
+{
+	return __CLC_AS_GENTYPE(code | 0x7ff0000000000000ul);
+}
+#else
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE nan(__CLC_XCONCAT(uint, __CLC_VECSIZE) code)
+{
+	return __CLC_AS_GENTYPE(code | 0x7fc00000);
+}
+#endif
+
+
+#ifdef __CLC_SCALAR
+#undef __CLC_VECSIZE
+#endif

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/libclc.git



More information about the Pkg-opencl-commits mailing list