summaryrefslogtreecommitdiff
path: root/gf2n_simd.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-01-19 05:34:02 -0500
committerJeffrey Walton <noloader@gmail.com>2019-01-19 05:34:02 -0500
commit5909ec6186bf54ce462b0135938331b161980fdd (patch)
tree55ffc5ddef1b613adee8b791cd03374550bab6a7 /gf2n_simd.cpp
parent76b7390840d361d89cb76a4008d1f5c6dd536b9f (diff)
downloadcryptopp-git-5909ec6186bf54ce462b0135938331b161980fdd.tar.gz
Cleanup PowerPC vector operations
Diffstat (limited to 'gf2n_simd.cpp')
-rw-r--r--gf2n_simd.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/gf2n_simd.cpp b/gf2n_simd.cpp
index 9fa9aec3..b0296b5f 100644
--- a/gf2n_simd.cpp
+++ b/gf2n_simd.cpp
@@ -310,7 +310,6 @@ using CryptoPP::uint8x16_p;
using CryptoPP::uint64x2_p;
using CryptoPP::VecLoad;
-using CryptoPP::VecLoadBE;
using CryptoPP::VecStore;
using CryptoPP::VecOr;
@@ -361,7 +360,8 @@ inline uint64x2_p VMULL_11LE(const uint64x2_p& a, const uint64x2_p& b)
inline void
F2N_Multiply_128x128_POWER8(uint64x2_p& c1, uint64x2_p& c0, const uint64x2_p& a, const uint64x2_p& b)
{
- uint64x2_p t1, t2, z0={0};
+ uint64x2_p t1, t2;
+ const uint64x2_p z0={0};
c0 = VMULL_00LE(a, b);
c1 = VMULL_11LE(a, b);
@@ -383,7 +383,9 @@ F2N_Multiply_128x128_POWER8(uint64x2_p& c1, uint64x2_p& c0, const uint64x2_p& a,
template <unsigned int N>
inline uint64x2_p ShiftLeft128_POWER8(uint64x2_p x)
{
- uint64x2_p u=x, v, z={0};
+ uint64x2_p u=x, v;
+ const uint64x2_p z={0};
+
x = VecShiftLeft<N>(x);
u = VecShiftRight<64-N>(u);
v = vec_mergeh(z, u);
@@ -399,7 +401,9 @@ GF2NT_233_Reduce_POWER8(uint64x2_p& c3, uint64x2_p& c2, uint64x2_p& c1, uint64x2
const uint64_t mod[] = {0xffffffffffffffff, 0x01ffffffffff};
const uint64x2_p m0 = (uint64x2_p)VecLoad(mod);
- uint64x2_p b3, b2, b1, /*b0,*/ a1, a0, z0={0};
+ uint64x2_p b3, b2, b1, /*b0,*/ a1, a0;
+ const uint64x2_p z0={0};
+
b1 = c1; a1 = c1;
a0 = vec_mergeh(c1, z0);
a1 = VecShiftLeft<23>(a1);