From 195ac2c7c9483bdfd6d06d2abc02fc6afd293db5 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 10 Dec 2017 11:09:50 -0500 Subject: Refactor rijndael-simd.cpp and simon.simd.cpp to use adv-simd.h --- misc.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'misc.h') diff --git a/misc.h b/misc.h index ce09d366..cb85e665 100644 --- a/misc.h +++ b/misc.h @@ -469,8 +469,15 @@ inline void memmove_s(void *dest, size_t sizeInBytes, const void *src, size_t co template 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 -- cgit v1.2.1