aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils/simd
diff options
context:
space:
mode:
authorDaniel Neus <[email protected]>2016-01-11 21:52:38 +0100
committerDaniel Neus <[email protected]>2016-03-05 12:10:39 +0100
commitfbdc39de29a0efbcd13ad169c844189168d2110d (patch)
treeffadbfd29b164ce81a6628773a1f5f8216ab8fb6 /src/lib/utils/simd
parent4424af469bd2bfe05b9ac1cd4e156383f23ae9e4 (diff)
cppcheck fixes: Class 'X' has a constructor with 1 argument that is not explicit.
Diffstat (limited to 'src/lib/utils/simd')
-rw-r--r--src/lib/utils/simd/simd_sse2/simd_sse2.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/utils/simd/simd_sse2/simd_sse2.h b/src/lib/utils/simd/simd_sse2/simd_sse2.h
index 1757b5976..551e9189c 100644
--- a/src/lib/utils/simd/simd_sse2/simd_sse2.h
+++ b/src/lib/utils/simd/simd_sse2/simd_sse2.h
@@ -18,7 +18,7 @@ namespace Botan {
class SIMD_SSE2
{
public:
- SIMD_SSE2(const u32bit B[4])
+ explicit SIMD_SSE2(const u32bit B[4])
{
m_reg = _mm_loadu_si128(reinterpret_cast<const __m128i*>(B));
}
@@ -28,14 +28,14 @@ class SIMD_SSE2
m_reg = _mm_set_epi32(B0, B1, B2, B3);
}
- SIMD_SSE2(u32bit B)
+ explicit SIMD_SSE2(u32bit B)
{
m_reg = _mm_set1_epi32(B);
}
static SIMD_SSE2 load_le(const void* in)
{
- return _mm_loadu_si128(reinterpret_cast<const __m128i*>(in));
+ return SIMD_SSE2(_mm_loadu_si128(reinterpret_cast<const __m128i*>(in)));
}
static SIMD_SSE2 load_be(const void* in)
@@ -71,7 +71,7 @@ class SIMD_SSE2
SIMD_SSE2 operator+(const SIMD_SSE2& other) const
{
- return _mm_add_epi32(m_reg, other.m_reg);
+ return SIMD_SSE2(_mm_add_epi32(m_reg, other.m_reg));
}
void operator-=(const SIMD_SSE2& other)
@@ -81,7 +81,7 @@ class SIMD_SSE2
SIMD_SSE2 operator-(const SIMD_SSE2& other) const
{
- return _mm_sub_epi32(m_reg, other.m_reg);
+ return SIMD_SSE2(_mm_sub_epi32(m_reg, other.m_reg));
}
void operator^=(const SIMD_SSE2& other)
@@ -91,7 +91,7 @@ class SIMD_SSE2
SIMD_SSE2 operator^(const SIMD_SSE2& other) const
{
- return _mm_xor_si128(m_reg, other.m_reg);
+ return SIMD_SSE2(_mm_xor_si128(m_reg, other.m_reg));
}
void operator|=(const SIMD_SSE2& other)
@@ -101,7 +101,7 @@ class SIMD_SSE2
SIMD_SSE2 operator&(const SIMD_SSE2& other)
{
- return _mm_and_si128(m_reg, other.m_reg);
+ return SIMD_SSE2(_mm_and_si128(m_reg, other.m_reg));
}
void operator&=(const SIMD_SSE2& other)
@@ -111,23 +111,23 @@ class SIMD_SSE2
SIMD_SSE2 operator<<(size_t shift) const
{
- return _mm_slli_epi32(m_reg, static_cast<int>(shift));
+ return SIMD_SSE2(_mm_slli_epi32(m_reg, static_cast<int>(shift)));
}
SIMD_SSE2 operator>>(size_t shift) const
{
- return _mm_srli_epi32(m_reg, static_cast<int>(shift));
+ return SIMD_SSE2(_mm_srli_epi32(m_reg, static_cast<int>(shift)));
}
SIMD_SSE2 operator~() const
{
- return _mm_xor_si128(m_reg, _mm_set1_epi32(0xFFFFFFFF));
+ return SIMD_SSE2(_mm_xor_si128(m_reg, _mm_set1_epi32(0xFFFFFFFF)));
}
// (~reg) & other
SIMD_SSE2 andc(const SIMD_SSE2& other)
{
- return _mm_andnot_si128(m_reg, other.m_reg);
+ return SIMD_SSE2(_mm_andnot_si128(m_reg, other.m_reg));
}
SIMD_SSE2 bswap() const
@@ -137,8 +137,8 @@ class SIMD_SSE2
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));
+ return SIMD_SSE2(_mm_or_si128(_mm_srli_epi16(T, 8),
+ _mm_slli_epi16(T, 8)));
}
static void transpose(SIMD_SSE2& B0, SIMD_SSE2& B1,
@@ -155,7 +155,7 @@ class SIMD_SSE2
}
private:
- SIMD_SSE2(__m128i in) { m_reg = in; }
+ explicit SIMD_SSE2(__m128i in) { m_reg = in; }
__m128i m_reg;
};