diff options
author | Jeffrey Walton <noloader@gmail.com> | 2019-06-09 01:49:44 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2019-06-09 01:49:44 -0400 |
commit | 8fab1c3677198f941ae83fcf322edc420603d325 (patch) | |
tree | dff39d958e97521dad33c0b7467961101693f636 /gf2n_simd.cpp | |
parent | 3ce1823fd190a8518c99882d22ca86e22a642650 (diff) | |
download | cryptopp-git-8fab1c3677198f941ae83fcf322edc420603d325.tar.gz |
Revert changes for lgtm findings
This broke SunCC to the point of no repair. SunCC is using AVX2 instructions for C++ and SSE2. Man this compiler sucks...
Diffstat (limited to 'gf2n_simd.cpp')
-rw-r--r-- | gf2n_simd.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/gf2n_simd.cpp b/gf2n_simd.cpp index 3bd3cd0e..1d4d933f 100644 --- a/gf2n_simd.cpp +++ b/gf2n_simd.cpp @@ -28,7 +28,6 @@ #if (CRYPTOPP_CLMUL_AVAILABLE)
# include <emmintrin.h>
# include <wmmintrin.h>
-# include "sse_simd.h"
#endif
#if (CRYPTOPP_ARM_PMULL_AVAILABLE)
@@ -466,31 +465,36 @@ NAMESPACE_BEGIN(CryptoPP) void
GF2NT_233_Multiply_Reduce_CLMUL(const word* pA, const word* pB, word* pC)
{
- __m128i a0 = load_m128i<0>(pA);
- __m128i a1 = load_m128i<1>(pA);
- __m128i b0 = load_m128i<0>(pB);
- __m128i b1 = load_m128i<1>(pB);
+ const __m128i* pAA = reinterpret_cast<const __m128i*>(pA);
+ const __m128i* pBB = reinterpret_cast<const __m128i*>(pB);
+ __m128i a0 = _mm_loadu_si128(pAA+0);
+ __m128i a1 = _mm_loadu_si128(pAA+1);
+ __m128i b0 = _mm_loadu_si128(pBB+0);
+ __m128i b1 = _mm_loadu_si128(pBB+1);
__m128i c0, c1, c2, c3;
F2N_Multiply_256x256_CLMUL(c3, c2, c1, c0, a1, a0, b1, b0);
GF2NT_233_Reduce_CLMUL(c3, c2, c1, c0);
- store_m128i<0>(pC, c0);
- store_m128i<1>(pC, c1);
+ __m128i* pCC = reinterpret_cast<__m128i*>(pC);
+ _mm_storeu_si128(pCC+0, c0);
+ _mm_storeu_si128(pCC+1, c1);
}
void
GF2NT_233_Square_Reduce_CLMUL(const word* pA, word* pC)
{
- __m128i a0 = load_m128i<0>(pA);
- __m128i a1 = load_m128i<1>(pA);
+ const __m128i* pAA = reinterpret_cast<const __m128i*>(pA);
+ __m128i a0 = _mm_loadu_si128(pAA+0);
+ __m128i a1 = _mm_loadu_si128(pAA+1);
__m128i c0, c1, c2, c3;
F2N_Square_256_CLMUL(c3, c2, c1, c0, a1, a0);
GF2NT_233_Reduce_CLMUL(c3, c2, c1, c0);
- store_m128i<0>(pC, c0);
- store_m128i<1>(pC, c1);
+ __m128i* pCC = reinterpret_cast<__m128i*>(pC);
+ _mm_storeu_si128(pCC+0, c0);
+ _mm_storeu_si128(pCC+1, c1);
}
#elif (CRYPTOPP_ARM_PMULL_AVAILABLE)
|