diff options
author | lloyd <[email protected]> | 2009-10-29 04:57:59 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-10-29 04:57:59 +0000 |
commit | 1cb38d792c7784133f0c022f09c33d02098c9291 (patch) | |
tree | 8c014b52b763fabbff310a2ef22fcc682ad5fc38 /src/utils/simd_32/simd_sse.h | |
parent | 511f670f32f920ace6352c4216a4a124dc9b01ac (diff) |
Give each version of SIMD_32 a public bswap()
Diffstat (limited to 'src/utils/simd_32/simd_sse.h')
-rw-r--r-- | src/utils/simd_32/simd_sse.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/utils/simd_32/simd_sse.h b/src/utils/simd_32/simd_sse.h index fcfe6f203..c45d8032f 100644 --- a/src/utils/simd_32/simd_sse.h +++ b/src/utils/simd_32/simd_sse.h @@ -121,6 +121,17 @@ class SIMD_SSE2 return _mm_xor_si128(reg, all_ones); } + SIMD_SSE2 bswap() const + { + __m128i T = reg; + + T = _mm_shufflehi_epi16(T, _MM_SHUFFLE(2, 3, 0, 1)); + T = _mm_shufflelo_epi16(T, _MM_SHUFFLE(2, 3, 0, 1)); + + return _mm_or_si128(_mm_srli_epi16(T, 8), + _mm_slli_epi16(T, 8)); + } + static void transpose(SIMD_SSE2& B0, SIMD_SSE2& B1, SIMD_SSE2& B2, SIMD_SSE2& B3) { @@ -137,17 +148,6 @@ class SIMD_SSE2 private: SIMD_SSE2(__m128i in) { reg = in; } - SIMD_SSE2 bswap() const - { - __m128i T = reg; - - T = _mm_shufflehi_epi16(T, _MM_SHUFFLE(2, 3, 0, 1)); - T = _mm_shufflelo_epi16(T, _MM_SHUFFLE(2, 3, 0, 1)); - - return _mm_or_si128(_mm_srli_epi16(T, 8), - _mm_slli_epi16(T, 8)); - } - __m128i reg; }; |