aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils/simd
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-09-04 11:52:45 -0400
committerJack Lloyd <[email protected]>2019-09-04 11:53:55 -0400
commit05e4367ef0ed92730bf46048479ebab8b42d9971 (patch)
tree948ed771d79bd514f424a59165a59b465b0d7047 /src/lib/utils/simd
parent7e2356173973a1c9c3040ab5f59141f98430d8e4 (diff)
Fix gcc warnings in Altivec SIMD_4x32 code
Diffstat (limited to 'src/lib/utils/simd')
-rw-r--r--src/lib/utils/simd/simd_32.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/utils/simd/simd_32.h b/src/lib/utils/simd/simd_32.h
index 7b6929c6d..7934e0c93 100644
--- a/src/lib/utils/simd/simd_32.h
+++ b/src/lib/utils/simd/simd_32.h
@@ -90,7 +90,8 @@ class SIMD_4x32 final
#if defined(BOTAN_SIMD_USE_SSE2)
m_simd = _mm_loadu_si128(reinterpret_cast<const __m128i*>(B));
#elif defined(BOTAN_SIMD_USE_ALTIVEC)
- m_simd = (__vector unsigned int){B[0], B[1], B[2], B[3]};
+ __vector unsigned int val = { B[0], B[1], B[2], B[3]};
+ m_simd = val;
#elif defined(BOTAN_SIMD_USE_NEON)
m_simd = vld1q_u32(B);
#else
@@ -109,7 +110,8 @@ class SIMD_4x32 final
#if defined(BOTAN_SIMD_USE_SSE2)
m_simd = _mm_set_epi32(B3, B2, B1, B0);
#elif defined(BOTAN_SIMD_USE_ALTIVEC)
- m_simd = (__vector unsigned int){B0, B1, B2, B3};
+ __vector unsigned int val = {B0, B1, B2, B3};
+ m_simd = val;
#elif defined(BOTAN_SIMD_USE_NEON)
// Better way to do this?
const uint32_t B[4] = { B0, B1, B2, B3 };
@@ -303,7 +305,8 @@ class SIMD_4x32 final
#elif defined(BOTAN_SIMD_USE_ALTIVEC)
const unsigned int r = static_cast<unsigned int>(ROT);
- return SIMD_4x32(vec_rl(m_simd, (__vector unsigned int){r, r, r, r}));
+ __vector unsigned int rot = {r, r, r, r};
+ return SIMD_4x32(vec_rl(m_simd, rot));
#elif defined(BOTAN_SIMD_USE_NEON)
@@ -488,7 +491,8 @@ class SIMD_4x32 final
#elif defined(BOTAN_SIMD_USE_ALTIVEC)
const unsigned int s = static_cast<unsigned int>(SHIFT);
- return SIMD_4x32(vec_sl(m_simd, (__vector unsigned int){s, s, s, s}));
+ const __vector unsigned int shifts = {s, s, s, s};
+ return SIMD_4x32(vec_sl(m_simd, shifts));
#elif defined(BOTAN_SIMD_USE_NEON)
return SIMD_4x32(vshlq_n_u32(m_simd, SHIFT));
#else
@@ -506,7 +510,8 @@ class SIMD_4x32 final
#elif defined(BOTAN_SIMD_USE_ALTIVEC)
const unsigned int s = static_cast<unsigned int>(SHIFT);
- return SIMD_4x32(vec_sr(m_simd, (__vector unsigned int){s, s, s, s}));
+ const __vector unsigned int shifts = {s, s, s, s};
+ return SIMD_4x32(vec_sr(m_simd, shifts));
#elif defined(BOTAN_SIMD_USE_NEON)
return SIMD_4x32(vshrq_n_u32(m_simd, SHIFT));
#else