Skip to content

Commit 10d60b7

Browse files
Fix eigen build (#56774)
* Fix eigen build * Fix * Fix
1 parent 67c84c4 commit 10d60b7

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

patches/eigen/Complex.h.patch

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
diff --git a/Eigen/src/Core/arch/SSE/Complex.h b/Eigen/src/Core/arch/SSE/Complex.h
2-
index f6f1b8c..2f4e7d1 100644
3-
--- a/Eigen/src/Core/arch/SSE/Complex.h
4-
+++ b/Eigen/src/Core/arch/SSE/Complex.h
1+
diff --git a/old/Complex.h b/new/Complex.h
2+
index f6f1b8c..7558e8c 100644
3+
--- a/old/Complex.h
4+
+++ b/new/Complex.h
55
@@ -17,7 +17,7 @@ namespace internal {
66
//---------- float ----------
77
struct Packet2cf
@@ -11,3 +11,28 @@ index f6f1b8c..2f4e7d1 100644
1111
EIGEN_STRONG_INLINE explicit Packet2cf(const __m128& a) : v(a) {}
1212
__m128 v;
1313
};
14+
@@ -113,19 +113,13 @@ template<> EIGEN_STRONG_INLINE Packet2cf ploadu<Packet2cf>(const std::complex<fl
15+
template<> EIGEN_STRONG_INLINE Packet2cf pset1<Packet2cf>(const std::complex<float>& from)
16+
{
17+
Packet2cf res;
18+
-#if EIGEN_GNUC_AT_MOST(4,2)
19+
- // Workaround annoying "may be used uninitialized in this function" warning with gcc 4.2
20+
- res.v = _mm_loadl_pi(_mm_set1_ps(0.0f), reinterpret_cast<const __m64*>(&from));
21+
-#elif EIGEN_GNUC_AT_LEAST(4,6)
22+
- // Suppress annoying "may be used uninitialized in this function" warning with gcc >= 4.6
23+
- #pragma GCC diagnostic push
24+
- #pragma GCC diagnostic ignored "-Wuninitialized"
25+
- res.v = _mm_loadl_pi(res.v, (const __m64*)&from);
26+
- #pragma GCC diagnostic pop
27+
+#ifdef EIGEN_VECTORIZE_SSE3
28+
+ res.v = _mm_castpd_ps(_mm_loaddup_pd(reinterpret_cast<double const*>(&from)));
29+
#else
30+
- res.v = _mm_loadl_pi(res.v, (const __m64*)&from);
31+
+ res.v = _mm_castpd_ps(_mm_load_sd(reinterpret_cast<double const*>(&from)));
32+
+ res.v = _mm_movelh_ps(res.v, res.v);
33+
#endif
34+
- return Packet2cf(_mm_movelh_ps(res.v,res.v));
35+
+ return res;
36+
}
37+
38+
template<> EIGEN_STRONG_INLINE Packet2cf ploaddup<Packet2cf>(const std::complex<float>* from) { return pset1<Packet2cf>(*from); }

0 commit comments

Comments
 (0)