diff options
author | Jack Lloyd <[email protected]> | 2018-03-16 12:47:13 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-03-16 12:47:13 -0400 |
commit | 0ebad384ee8f5933b76438724394e66a668c4dfc (patch) | |
tree | 54172172c0443ba1346df9ebfef2c9f377751571 | |
parent | 6c8ffb4d2ee1f762804fc8d6a90a3d1761462503 (diff) |
Avoid a problematic construct for AltiVec byteswap
Seems to cause problems with GCC 8 on ppc64le. GH #1498
-rw-r--r-- | src/lib/utils/simd/simd_32.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/utils/simd/simd_32.h b/src/lib/utils/simd/simd_32.h index 304ac72e1..d1f3b8510 100644 --- a/src/lib/utils/simd/simd_32.h +++ b/src/lib/utils/simd/simd_32.h @@ -583,9 +583,14 @@ class SIMD_4x32 final #elif defined(BOTAN_SIMD_USE_ALTIVEC) - __vector unsigned char perm = vec_lvsl(0, static_cast<uint32_t*>(nullptr)); - perm = vec_xor(perm, vec_splat_u8(3)); - return SIMD_4x32(vec_perm(m_vmx, m_vmx, perm)); + union { + __vector unsigned int V; + uint32_t R[4]; + } vec; + + vec.V = m_vmx; + bswap_4(vec.R); + return SIMD_4x32(vec.V); #elif defined(BOTAN_SIMD_USE_NEON) |