[eigen3] 01/01: Fix sign issue with pmul on altivec (Closes: #836844)

Graham Inggs ginggs at moszumanska.debian.org
Tue Dec 20 20:49:05 UTC 2016


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

ginggs pushed a commit to branch master
in repository eigen3.

commit 8dc16b1d4c3754795dafd91b4ff5f747c6ff7723
Author: Graham Inggs <ginggs at debian.org>
Date:   Tue Dec 20 22:02:19 2016 +0200

    Fix sign issue with pmul on altivec (Closes: #836844)
---
 debian/patches/fix_altivec_sign_issue.patch | 75 +++++++++++++++++++++++++++++
 debian/patches/series                       |  1 +
 2 files changed, 76 insertions(+)

diff --git a/debian/patches/fix_altivec_sign_issue.patch b/debian/patches/fix_altivec_sign_issue.patch
new file mode 100644
index 0000000..5b45a66
--- /dev/null
+++ b/debian/patches/fix_altivec_sign_issue.patch
@@ -0,0 +1,75 @@
+Description: Fix sign issue with pmul on altivec
+Bug-Debian: https://bugs.debian.org/836844
+Bug: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1360
+Origin: upstream, https://bitbucket.org/eigen/eigen/commits/d7f257380d20/
+Author: Gael Guennebaud <g.gael at free.fr>
+Last-Update: 2016-12-19
+--- a/Eigen/src/Core/arch/AltiVec/Complex.h
++++ b/Eigen/src/Core/arch/AltiVec/Complex.h
+@@ -15,14 +15,14 @@
+ 
+ namespace internal {
+ 
+-static Packet4ui  p4ui_CONJ_XOR = vec_mergeh((Packet4ui)p4i_ZERO, (Packet4ui)p4f_ZERO_);//{ 0x00000000, 0x80000000, 0x00000000, 0x80000000 };
++static Packet4ui  p4ui_CONJ_XOR = vec_mergeh((Packet4ui)p4i_ZERO, (Packet4ui)p4f_MZERO);//{ 0x00000000, 0x80000000, 0x00000000, 0x80000000 };
+ #ifdef __VSX__
+ #if defined(_BIG_ENDIAN)
+-static Packet2ul  p2ul_CONJ_XOR1 = (Packet2ul) vec_sld((Packet4ui) p2d_ZERO_, (Packet4ui) p2l_ZERO, 8);//{ 0x8000000000000000, 0x0000000000000000 };
+-static Packet2ul  p2ul_CONJ_XOR2 = (Packet2ul) vec_sld((Packet4ui) p2l_ZERO,  (Packet4ui) p2d_ZERO_, 8);//{ 0x8000000000000000, 0x0000000000000000 };
++static Packet2ul  p2ul_CONJ_XOR1 = (Packet2ul) vec_sld((Packet4ui) p2d_MZERO, (Packet4ui) p2l_ZERO, 8);//{ 0x8000000000000000, 0x0000000000000000 };
++static Packet2ul  p2ul_CONJ_XOR2 = (Packet2ul) vec_sld((Packet4ui) p2l_ZERO,  (Packet4ui) p2d_MZERO, 8);//{ 0x8000000000000000, 0x0000000000000000 };
+ #else
+-static Packet2ul  p2ul_CONJ_XOR1 = (Packet2ul) vec_sld((Packet4ui) p2l_ZERO,  (Packet4ui) p2d_ZERO_, 8);//{ 0x8000000000000000, 0x0000000000000000 };
+-static Packet2ul  p2ul_CONJ_XOR2 = (Packet2ul) vec_sld((Packet4ui) p2d_ZERO_, (Packet4ui) p2l_ZERO, 8);//{ 0x8000000000000000, 0x0000000000000000 };
++static Packet2ul  p2ul_CONJ_XOR1 = (Packet2ul) vec_sld((Packet4ui) p2l_ZERO,  (Packet4ui) p2d_MZERO, 8);//{ 0x8000000000000000, 0x0000000000000000 };
++static Packet2ul  p2ul_CONJ_XOR2 = (Packet2ul) vec_sld((Packet4ui) p2d_MZERO, (Packet4ui) p2l_ZERO, 8);//{ 0x8000000000000000, 0x0000000000000000 };
+ #endif
+ #endif
+ 
+--- a/Eigen/src/Core/arch/AltiVec/PacketMath.h
++++ b/Eigen/src/Core/arch/AltiVec/PacketMath.h
+@@ -72,7 +72,7 @@
+ static _EIGEN_DECLARE_CONST_FAST_Packet4i(ONE,1); //{ 1, 1, 1, 1}
+ static _EIGEN_DECLARE_CONST_FAST_Packet4i(MINUS16,-16); //{ -16, -16, -16, -16}
+ static _EIGEN_DECLARE_CONST_FAST_Packet4i(MINUS1,-1); //{ -1, -1, -1, -1}
+-static Packet4f p4f_ZERO_ = (Packet4f) vec_sl((Packet4ui)p4i_MINUS1, (Packet4ui)p4i_MINUS1); //{ 0x80000000, 0x80000000, 0x80000000, 0x80000000}
++static Packet4f p4f_MZERO = (Packet4f) vec_sl((Packet4ui)p4i_MINUS1, (Packet4ui)p4i_MINUS1); //{ 0x80000000, 0x80000000, 0x80000000, 0x80000000}
+ #ifndef __VSX__
+ static Packet4f p4f_ONE = vec_ctf(p4i_ONE, 0); //{ 1.0, 1.0, 1.0, 1.0}
+ #endif
+@@ -358,7 +358,7 @@
+ template<> EIGEN_STRONG_INLINE Packet4f pconj(const Packet4f& a) { return a; }
+ template<> EIGEN_STRONG_INLINE Packet4i pconj(const Packet4i& a) { return a; }
+ 
+-template<> EIGEN_STRONG_INLINE Packet4f pmul<Packet4f>(const Packet4f& a, const Packet4f& b) { return vec_madd(a,b, p4f_ZERO); }
++template<> EIGEN_STRONG_INLINE Packet4f pmul<Packet4f>(const Packet4f& a, const Packet4f& b) { return vec_madd(a,b, p4f_MZERO); }
+ template<> EIGEN_STRONG_INLINE Packet4i pmul<Packet4i>(const Packet4i& a, const Packet4i& b) { return a * b; }
+ 
+ template<> EIGEN_STRONG_INLINE Packet4f pdiv<Packet4f>(const Packet4f& a, const Packet4f& b)
+@@ -373,7 +373,7 @@
+   t   = vec_nmsub(y_0, b, p4f_ONE);
+   y_1 = vec_madd(y_0, t, y_0);
+ 
+-  return vec_madd(a, y_1, p4f_ZERO);
++  return vec_madd(a, y_1, p4f_MZERO);
+ #else
+   return vec_div(a, b);
+ #endif
+@@ -766,7 +766,7 @@
+ static Packet2l  p2l_ZERO = reinterpret_cast<Packet2l>(p4i_ZERO);
+ static Packet2d  p2d_ONE  = { 1.0, 1.0 }; 
+ static Packet2d  p2d_ZERO = reinterpret_cast<Packet2d>(p4f_ZERO);
+-static Packet2d  p2d_ZERO_ = { -0.0, -0.0 };
++static Packet2d  p2d_MZERO = { -0.0, -0.0 };
+ 
+ #ifdef _BIG_ENDIAN
+ static Packet2d p2d_COUNTDOWN = reinterpret_cast<Packet2d>(vec_sld(reinterpret_cast<Packet4f>(p2d_ZERO), reinterpret_cast<Packet4f>(p2d_ONE), 8));
+@@ -904,7 +904,7 @@
+ 
+ template<> EIGEN_STRONG_INLINE Packet2d pconj(const Packet2d& a) { return a; }
+ 
+-template<> EIGEN_STRONG_INLINE Packet2d pmul<Packet2d>(const Packet2d& a, const Packet2d& b) { return vec_madd(a,b,p2d_ZERO); }
++template<> EIGEN_STRONG_INLINE Packet2d pmul<Packet2d>(const Packet2d& a, const Packet2d& b) { return vec_madd(a,b,p2d_MZERO); }
+ template<> EIGEN_STRONG_INLINE Packet2d pdiv<Packet2d>(const Packet2d& a, const Packet2d& b) { return vec_div(a,b); }
+ 
+ // for some weird raisons, it has to be overloaded for packet of integers
diff --git a/debian/patches/series b/debian/patches/series
index 8e95ef3..653fc89 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
 07_remove_compressed_doc.patch
 08_fix_path_FindEigen3.patch
 12_grammer_tweak.patch
+fix_altivec_sign_issue.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/eigen3.git



More information about the debian-science-commits mailing list