Skip to content
Snippets Groups Projects
Commit 69f562d8 authored by Michael Kuron's avatar Michael Kuron :mortar_board:
Browse files

AES-NI: correct AVX512 guards

parent 1d1f0da5
Branches
Tags
1 merge request!46AES-NI vectorization improvements
Pipeline #18038 passed with stage
in 2 minutes and 40 seconds
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <emmintrin.h> // SSE2 #include <emmintrin.h> // SSE2
#include <wmmintrin.h> // AES #include <wmmintrin.h> // AES
#if defined(__AVX512VL__) || defined(__AVX512F__) #ifdef __AVX512VL__
#include <immintrin.h> // AVX* #include <immintrin.h> // AVX*
#else #else
#include <smmintrin.h> // SSE4 #include <smmintrin.h> // SSE4
...@@ -38,7 +38,7 @@ QUALIFIERS __m128i aesni1xm128i(const __m128i & in, const __m128i & k) { ...@@ -38,7 +38,7 @@ QUALIFIERS __m128i aesni1xm128i(const __m128i & in, const __m128i & k) {
QUALIFIERS __m128 _my_cvtepu32_ps(const __m128i v) QUALIFIERS __m128 _my_cvtepu32_ps(const __m128i v)
{ {
#if defined(__AVX512VL__) || defined(__AVX512F__) #ifdef __AVX512VL__
return _mm_cvtepu32_ps(v); return _mm_cvtepu32_ps(v);
#else #else
__m128i v2 = _mm_srli_epi32(v, 1); __m128i v2 = _mm_srli_epi32(v, 1);
...@@ -49,12 +49,12 @@ QUALIFIERS __m128 _my_cvtepu32_ps(const __m128i v) ...@@ -49,12 +49,12 @@ QUALIFIERS __m128 _my_cvtepu32_ps(const __m128i v)
#endif #endif
} }
#if !defined(__AVX512VL__) && !defined(__AVX512F__) && defined(__GNUC__) && __GNUC__ >= 5 #if !defined(__AVX512VL__) && defined(__GNUC__) && __GNUC__ >= 5
__attribute__((optimize("no-associative-math"))) __attribute__((optimize("no-associative-math")))
#endif #endif
QUALIFIERS __m128d _my_cvtepu64_pd(const __m128i x) QUALIFIERS __m128d _my_cvtepu64_pd(const __m128i x)
{ {
#if defined(__AVX512VL__) || defined(__AVX512F__) #ifdef __AVX512VL__
return _mm_cvtepu64_pd(x); return _mm_cvtepu64_pd(x);
#else #else
__m128i xH = _mm_srli_epi64(x, 32); __m128i xH = _mm_srli_epi64(x, 32);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment