[beignet] 01/09: Use system default LLVM/Clang version, fix bug when 3.6 is used (Closes: #803643)

Rebecca Palmer rnpalmer-guest at moszumanska.debian.org
Thu Nov 12 22:23:26 UTC 2015


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

rnpalmer-guest pushed a commit to branch master
in repository beignet.

commit c5279f3651e3c282533dbbedab648a5be0c2dfb7
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
Date:   Mon Nov 9 21:51:46 2015 +0000

    Use system default LLVM/Clang version, fix bug when 3.6 is used
    (Closes: #803643)
---
 debian/changelog                         |  7 ++++
 debian/control                           |  6 ++--
 debian/patches/llvm-36-convert-bug.patch | 58 ++++++++++++++++++++++++++++++++
 debian/patches/series                    |  1 +
 4 files changed, 69 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 16d7fc1..33e1d4c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+beignet (1.1.1-2) UNRELEASED; urgency=medium
+
+  * Add patch to support LLVM 3.6,
+    use system default version. (Closes: #803643)
+
+ -- Rebecca N. Palmer <rebecca_palmer at zoho.com>  Mon, 09 Nov 2015 21:47:04 +0000
+
 beignet (1.1.1-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/debian/control b/debian/control
index 4ffd814..7aec58b 100644
--- a/debian/control
+++ b/debian/control
@@ -9,9 +9,9 @@ Uploaders:
 Build-Depends:
  debhelper (>= 9),
  cmake (>= 2.8.5),
- clang-3.5,
- libclang-3.5-dev,
- llvm-3.5-dev,
+ clang (>= 1:3.5~), clang (<< 1:3.7~),
+ libclang-dev,
+ llvm-dev,
  ocl-icd-dev,
  ocl-icd-opencl-dev,
  pkg-config,
diff --git a/debian/patches/llvm-36-convert-bug.patch b/debian/patches/llvm-36-convert-bug.patch
new file mode 100644
index 0000000..9b832fd
--- /dev/null
+++ b/debian/patches/llvm-36-convert-bug.patch
@@ -0,0 +1,58 @@
+Description: LibOcl: Fix float convert to long/ulong bug.
+
+Needed with LLVM 3.6+
+http://lists.freedesktop.org/archives/beignet/2015-November/006549.html
+
+If the float overflow, convert to long/ulong is undef. So must use
+long/ulong's max and min value as return value.
+Also refine long to other integer type sat convert. Use to statement
+to avoid generate if/else/endif.
+
+Origin: upstream http://cgit.freedesktop.org/beignet/commit/?id=99041b53d94d4732d9b7d99fa44b06b88ddd71e9
+Author: Yang Rong <rong.r.yang at intel.com>
+
+diff --git a/backend/src/libocl/script/ocl_convert.sh b/backend/src/libocl/script/ocl_convert.sh
+index 4f720fe..7599a66 100755
+--- a/backend/src/libocl/script/ocl_convert.sh
++++ b/backend/src/libocl/script/ocl_convert.sh
+@@ -161,7 +161,8 @@ else
+     echo '
+ #define DEF(DSTTYPE, SRCTYPE, MIN, MAX) \
+ OVERLOADABLE DSTTYPE convert_ ## DSTTYPE ## _sat(SRCTYPE x) { \
+-  return x >= MAX ? (DSTTYPE)MAX : x <= MIN ? (DSTTYPE)MIN : x; \
++  x = x >= MAX ? MAX : x; \
++  return x <= MIN ? (DSTTYPE)MIN : (DSTTYPE)x; \
+ }
+ '
+ fi
+@@ -173,8 +174,27 @@ DEF(short, long, -32768, 32767);
+ DEF(ushort, long, 0, 65535);
+ DEF(int, long, -0x7fffffff-1, 0x7fffffff);
+ DEF(uint, long, 0, 0xffffffffu);
+-DEF(long, float, -9.223372036854776e+18f, 9.223372036854776e+18f);
+-DEF(ulong, float, 0, 1.8446744073709552e+19f);
++#undef DEF
++'
++
++if [ $1"a" = "-pa" ]; then
++    echo "
++#define DEF(DSTTYPE, SRCTYPE, SRC_MIN, SRC_MAX, DST_MIN, DST_MAX) \
++OVERLOADABLE DSTTYPE convert_ ## DSTTYPE ## _sat(SRCTYPE x);"
++else
++    echo '
++//convert float to long/ulong must take care of overflow, if overflow the value is undef.
++#define DEF(DSTTYPE, SRCTYPE, SRC_MIN, SRC_MAX, DST_MIN, DST_MAX) \
++OVERLOADABLE DSTTYPE convert_ ## DSTTYPE ## _sat(SRCTYPE x) { \
++  DSTTYPE y = x >= SRC_MAX ? DST_MAX : (DSTTYPE)x; \
++  return x <= SRC_MIN ? DST_MIN : y; \
++}
++'
++fi
++
++echo '
++DEF(long, float, -0x1.0p63, 0x1.0p63, 0x8000000000000000, 0x7fffffffffffffff);
++DEF(ulong, float, 0, 0x1.0p64, 0, 0xffffffffffffffff);
+ #undef DEF
+ '
+ 
+
diff --git a/debian/patches/series b/debian/patches/series
index a37a907..7abc562 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@ reduce-notfound-output.patch
 shared-llvm.patch
 update-docs.patch
 allow-+-in-directory.patch
+llvm-36-convert-bug.patch

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



More information about the Pkg-opencl-commits mailing list