diff options
author | Jeffrey Walton <noloader@gmail.com> | 2017-12-10 11:09:50 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2017-12-10 11:09:50 -0500 |
commit | 195ac2c7c9483bdfd6d06d2abc02fc6afd293db5 (patch) | |
tree | d5e2b2a40676b12f11485573f81bd73c7f266cde /misc.h | |
parent | e90cc9a0289c550f2fbf721c0ef12d5087a2d3d5 (diff) | |
download | cryptopp-git-195ac2c7c9483bdfd6d06d2abc02fc6afd293db5.tar.gz |
Refactor rijndael-simd.cpp and simon.simd.cpp to use adv-simd.h
Diffstat (limited to 'misc.h')
-rw-r--r-- | misc.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -469,8 +469,15 @@ inline void memmove_s(void *dest, size_t sizeInBytes, const void *src, size_t co template <class T>
inline void vec_swap(T& a, T& b)
{
+ // __m128i is an unsigned long long[2], and support for swapping it was
+ // not added until C++11. SunCC 12.1 - 12.3 fail to consume the swap; while
+ // SunCC 12.4 consumes it without -std=c++11.
+#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x5120)
T t;
t=a, a=b, b=t;
+#else
+ std::swap(a, b);
+#endif
}
/// \brief Memory block initializer and eraser that attempts to survive optimizations
|