[flint] 01/02: Preparing 2.5.2-9 with a patch from Dejan Latinovic fixing a FTBFS in flint-arb on MIPS
Julien Puydt
julien.puydt at laposte.net
Fri Sep 2 04:37:29 UTC 2016
This is an automated email from the git hooks/post-receive script.
jpuydt-guest pushed a commit to branch master
in repository flint.
commit 7f7048066b0bc3922a5ad3ff178db8af9cb706b1
Author: Julien Puydt <julien.puydt at laposte.net>
Date: Thu Sep 1 20:56:58 2016 +0200
Preparing 2.5.2-9 with a patch from Dejan Latinovic fixing a FTBFS in flint-arb on MIPS
---
debian/changelog | 6 ++
debian/patches/series | 1 +
debian/patches/use_clz_builtins_for_mips.patch | 77 ++++++++++++++++++++++++++
longlong.h | 37 +++++++++++++
4 files changed, 121 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 1354499..2809857 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+flint (2.5.2-9) unstable; urgency=medium
+
+ * Added a patch from Dejan Latinovic to fix a MIPS issue. (Closes: #836304)
+
+ -- Julien Puydt <julien.puydt at laposte.net> Thu, 01 Sep 2016 20:56:14 +0200
+
flint (2.5.2-8) unstable; urgency=medium
* Team upload.
diff --git a/debian/patches/series b/debian/patches/series
index dedfb51..67a04c1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
0001-Fixed-latex-manual-compilation.patch
hurd
+use_clz_builtins_for_mips.patch
diff --git a/debian/patches/use_clz_builtins_for_mips.patch b/debian/patches/use_clz_builtins_for_mips.patch
new file mode 100644
index 0000000..43d79f2
--- /dev/null
+++ b/debian/patches/use_clz_builtins_for_mips.patch
@@ -0,0 +1,77 @@
+Author: Dejan Latinovic
+Description: Use clz builtins on MIPS
+ Without this patch, the flint-arb package FTBFS.
+ There is no need to forward a patch already in
+ upstream's git!
+Forwarded: not-needed
+
+--- flint-2.5.2.orig/longlong.h
++++ flint-2.5.2/longlong.h
+@@ -324,6 +324,39 @@
+
+ #endif
+
++/* MIPS */
++#if (defined (__mips__) || defined (__arm__))
++
++#ifdef _LONG_LONG_LIMB
++#define count_leading_zeros(count,x) \
++ do { \
++ FLINT_ASSERT ((x) != 0); \
++ (count) = __builtin_clzll (x); \
++ } while (0)
++#else
++#define count_leading_zeros(count,x) \
++ do { \
++ FLINT_ASSERT ((x) != 0); \
++ (count) = __builtin_clzl (x); \
++ } while (0)
++#endif
++
++#ifdef _LONG_LONG_LIMB
++#define count_trailing_zeros(count,x) \
++ do { \
++ FLINT_ASSERT ((x) != 0); \
++ (count) = __builtin_ctzll (x); \
++ } while (0)
++#else
++#define count_trailing_zeros(count,x) \
++ do { \
++ FLINT_ASSERT ((x) != 0); \
++ (count) = __builtin_ctzl (x); \
++ } while (0)
++#endif
++
++#endif /* MIPS */
++
+ #define udiv_qrnnd_int(q, r, n1, n0, d) \
+ do { \
+ mp_limb_t __d1, __d0, __q1, __q0, __r1, __r0, __m; \
+@@ -364,6 +397,7 @@
+ (r) = __r0; \
+ } while (0)
+
++#ifndef count_leading_zeros
+ #define count_leading_zeros(count, x) \
+ do { \
+ mp_limb_t __xr = (x); \
+@@ -386,9 +421,11 @@
+ \
+ (count) = GMP_LIMB_BITS + 1 - __a - __flint_clz_tab[__xr >> __a]; \
+ } while (0)
++#endif
+
+ #if !(GMP_LIMB_BITS == 64 && defined (__ia64))
+
++#ifndef count_trailing_zeros
+ #define count_trailing_zeros(count, x) \
+ do { \
+ mp_limb_t __ctz_x = (x); \
+@@ -397,6 +434,7 @@
+ count_leading_zeros (__ctz_c, __ctz_x & -__ctz_x); \
+ (count) = GMP_LIMB_BITS - 1 - __ctz_c; \
+ } while (0)
++#endif
+
+ #endif
+
diff --git a/longlong.h b/longlong.h
index 7fcb546..2c6d6d3 100644
--- a/longlong.h
+++ b/longlong.h
@@ -324,6 +324,39 @@
#endif
+/* MIPS */
+#if (defined (__mips__) || defined (__arm__))
+
+#ifdef _LONG_LONG_LIMB
+#define count_leading_zeros(count,x) \
+ do { \
+ FLINT_ASSERT ((x) != 0); \
+ (count) = __builtin_clzll (x); \
+ } while (0)
+#else
+#define count_leading_zeros(count,x) \
+ do { \
+ FLINT_ASSERT ((x) != 0); \
+ (count) = __builtin_clzl (x); \
+ } while (0)
+#endif
+
+#ifdef _LONG_LONG_LIMB
+#define count_trailing_zeros(count,x) \
+ do { \
+ FLINT_ASSERT ((x) != 0); \
+ (count) = __builtin_ctzll (x); \
+ } while (0)
+#else
+#define count_trailing_zeros(count,x) \
+ do { \
+ FLINT_ASSERT ((x) != 0); \
+ (count) = __builtin_ctzl (x); \
+ } while (0)
+#endif
+
+#endif /* MIPS */
+
#define udiv_qrnnd_int(q, r, n1, n0, d) \
do { \
mp_limb_t __d1, __d0, __q1, __q0, __r1, __r0, __m; \
@@ -364,6 +397,7 @@
(r) = __r0; \
} while (0)
+#ifndef count_leading_zeros
#define count_leading_zeros(count, x) \
do { \
mp_limb_t __xr = (x); \
@@ -386,9 +420,11 @@
\
(count) = GMP_LIMB_BITS + 1 - __a - __flint_clz_tab[__xr >> __a]; \
} while (0)
+#endif
#if !(GMP_LIMB_BITS == 64 && defined (__ia64))
+#ifndef count_trailing_zeros
#define count_trailing_zeros(count, x) \
do { \
mp_limb_t __ctz_x = (x); \
@@ -397,6 +433,7 @@
count_leading_zeros (__ctz_c, __ctz_x & -__ctz_x); \
(count) = GMP_LIMB_BITS - 1 - __ctz_c; \
} while (0)
+#endif
#endif
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/flint.git
More information about the debian-science-commits
mailing list