mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-04-20 03:01:31 -04:00
Support for processors without AVX.
This commit is contained in:
@@ -14,11 +14,13 @@
|
||||
inline void avx_memcpy(void* dest, const void* source, size_t length)
|
||||
{
|
||||
__m256i* d = (__m256i*)dest, *s = (__m256i*)source;
|
||||
#ifdef __AVX__
|
||||
while (length >= 32)
|
||||
{
|
||||
_mm256_storeu_si256(d++, _mm256_loadu_si256(s++));
|
||||
length -= 32;
|
||||
}
|
||||
#endif
|
||||
__m128i* d2 = (__m128i*)d;
|
||||
__m128i* s2 = (__m128i*)s;
|
||||
while (length >= 16)
|
||||
@@ -33,12 +35,14 @@ inline void avx_memcpy(void* dest, const void* source, size_t length)
|
||||
inline void avx_memzero(void* dest, size_t length)
|
||||
{
|
||||
__m256i* d = (__m256i*)dest;
|
||||
#ifdef __AVX__
|
||||
__m256i s = _mm256_setzero_si256();
|
||||
while (length >= 32)
|
||||
{
|
||||
_mm256_storeu_si256(d++, s);
|
||||
length -= 32;
|
||||
}
|
||||
#endif
|
||||
if (length)
|
||||
memset(d, 0, length);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user