diff options
author | Gael Guennebaud <g.gael@free.fr> | 2008-08-20 20:08:38 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2008-08-20 20:08:38 +0000 |
commit | fd681507dc9e8bf3cc1dbbc4c017b5d5c0d2b506 (patch) | |
tree | 2d7facc637c0bfc41c12506807aa8259b35a7221 /Eigen/src/Core/arch | |
parent | ff8e98c974b1cb7667a20049e992cd4fd0b1aeec (diff) |
Add a packetmath unit test, re-enable the comma-initializer unit test,
and bug fix in PacketMath/SSE
Diffstat (limited to 'Eigen/src/Core/arch')
-rw-r--r-- | Eigen/src/Core/arch/SSE/PacketMath.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/Eigen/src/Core/arch/SSE/PacketMath.h b/Eigen/src/Core/arch/SSE/PacketMath.h index 07aa84d69..f2744e340 100644 --- a/Eigen/src/Core/arch/SSE/PacketMath.h +++ b/Eigen/src/Core/arch/SSE/PacketMath.h @@ -219,7 +219,8 @@ struct ei_palign_impl<Offset,__m128> { inline static void run(__m128& first, const __m128& second) { - first = _mm_castsi128_ps(_mm_alignr_epi8(_mm_castps_si128(first), _mm_castps_si128(second), (4-Offset)*4)); + if (Offset!=0) + first = _mm_castsi128_ps(_mm_alignr_epi8(_mm_castps_si128(second), _mm_castps_si128(first), (Offset)*4)); } }; @@ -228,7 +229,18 @@ struct ei_palign_impl<Offset,__m128i> { inline static void run(__m128i& first, const __m128i& second) { - first = _mm_alignr_epi8(first, second, (4-Offset)*4); + if (Offset!=0) + first = _mm_alignr_epi8(second,first, (Offset)*4); + } +}; + +template<int Offset> +struct ei_palign_impl<Offset,__m128d> +{ + inline static void run(__m128d& first, const __m128d& second) + { + if (Offset==1) + first = _mm_castsi128_pd(_mm_alignr_epi8(_mm_castpd_si128(second), _mm_castpd_si128(first), 8)); } }; #else @@ -278,6 +290,19 @@ struct ei_palign_impl<Offset,__m128i> } } }; + +template<int Offset> +struct ei_palign_impl<Offset,__m128d> +{ + inline static void run(__m128d& first, const __m128d& second) + { + if (Offset==1) + { + first = _mm_castps_pd(_mm_movehl_ps(_mm_castpd_ps(first),_mm_castpd_ps(first))); + first = _mm_castps_pd(_mm_movelh_ps(_mm_castpd_ps(first),_mm_castpd_ps(second))); + } + } +}; #endif #endif // EIGEN_PACKET_MATH_SSE_H |