From bf4526f87e5ce407d521fffa89f571232529c09e Mon Sep 17 00:00:00 2001 From: lloyd Date: Mon, 4 Jan 2010 14:47:14 +0000 Subject: Remove pshufb-based bswap_4; it causes problems too easily with external application code that wants to use loadstor.h, since that loads bswap.h and if SSSE3 isn't enabled via -march GCC will error out. Doesn't seem to be at all faster than the shuffle-based bswap for SSE2 on a Core2 in any case. --- src/utils/bswap.h | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'src/utils') diff --git a/src/utils/bswap.h b/src/utils/bswap.h index cceeda4f3..fcb0fa7ea 100644 --- a/src/utils/bswap.h +++ b/src/utils/bswap.h @@ -16,10 +16,6 @@ #include #endif -#if defined(BOTAN_TARGET_CPU_HAS_SSSE3) - #include -#endif - namespace Botan { /* @@ -82,23 +78,7 @@ inline void bswap_4(T x[4]) x[3] = reverse_bytes(x[3]); } -#if defined(BOTAN_TARGET_CPU_HAS_SSSE3) - -template<> -inline void bswap_4(u32bit x[4]) - { - const __m128i bswap_mask = _mm_set_epi8( - 12, 13, 14, 15, - 8, 9, 10, 11, - 4, 5, 6, 7, - 0, 1, 2, 3); - - __m128i T = _mm_loadu_si128((const __m128i*)x); - T = _mm_shuffle_epi8(T, bswap_mask); - _mm_storeu_si128((__m128i*)x, T); - } - -#elif defined(BOTAN_TARGET_CPU_HAS_SSE2) +#if defined(BOTAN_TARGET_CPU_HAS_SSE2) template<> inline void bswap_4(u32bit x[4]) -- cgit v1.2.3