diff options
author | Jeffrey Walton <noloader@gmail.com> | 2021-03-18 12:15:53 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2021-03-18 12:15:53 -0400 |
commit | 949b7632f11b4edaddfd05edb5042fbc0580348c (patch) | |
tree | fc1c02a58c86391964ebd4deeb4639f2ec0b6a41 /misc.cpp | |
parent | bb5b48d1dc4bbd39df0d65e34d403275a5543207 (diff) | |
download | cryptopp-git-949b7632f11b4edaddfd05edb5042fbc0580348c.tar.gz |
Fold count==0 tests in xorbuf
Diffstat (limited to 'misc.cpp')
-rw-r--r-- | misc.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -84,8 +84,6 @@ void xorbuf(byte *buf, const byte *mask, size_t count) _mm_xor_ps(_mm_castsi128_ps(b), _mm_castsi128_ps(m))));
buf += 16; mask += 16; count -= 16;
}
-
- if (count == 0) return;
# endif
# if defined(__aarch64__) || defined(__aarch32__) || defined(_M_ARM64)
while (count >= 16)
@@ -93,8 +91,6 @@ void xorbuf(byte *buf, const byte *mask, size_t count) vst1q_u8(buf, veorq_u8(vld1q_u8(buf), vld1q_u8(mask)));
buf += 16; mask += 16; count -= 16;
}
-
- if (count == 0) return;
# endif
#endif // CRYPTOPP_DISABLE_ASM
@@ -113,9 +109,10 @@ void xorbuf(byte *buf, const byte *mask, size_t count) buf += 16; mask += 16; count -= 16;
}
+#endif
+ // One of the arch specific xor's may have cleared the request
if (count == 0) return;
-#endif
while (count >= 4)
{
@@ -161,8 +158,6 @@ void xorbuf(byte *output, const byte *input, const byte *mask, size_t count) _mm_xor_ps(_mm_castsi128_ps(b), _mm_castsi128_ps(m))));
output += 16; input += 16; mask += 16; count -= 16;
}
-
- if (count == 0) return;
# endif
# if defined(__aarch64__) || defined(__aarch32__) || defined(_M_ARM64)
while (count >= 16)
@@ -170,8 +165,6 @@ void xorbuf(byte *output, const byte *input, const byte *mask, size_t count) vst1q_u8(output, veorq_u8(vld1q_u8(input), vld1q_u8(mask)));
output += 16; input += 16; mask += 16; count -= 16;
}
-
- if (count == 0) return;
# endif
#endif // CRYPTOPP_DISABLE_ASM
@@ -190,9 +183,10 @@ void xorbuf(byte *output, const byte *input, const byte *mask, size_t count) output += 16; input += 16; mask += 16; count -= 16;
}
+#endif
+ // One of the arch specific xor's may have cleared the request
if (count == 0) return;
-#endif
while (count >= 4)
{
|