From f55b8040c62145b1e3ec52f96dac2200bac21d8d Mon Sep 17 00:00:00 2001 From: Evan Nemerson Date: Mon, 22 Jun 2020 09:26:24 -0700 Subject: [PATCH] avx, avx512f: use macro instead of typedef to create __m* types on ICC Even if the destination types doesn't exist, ICC will actually issue a diagnostic to tell you to use the one from the official header instead, which will cause ICC to use instructions from that ISA extension even if it isn't being targeted. --- x86/avx.h | 12 +++++++++--- x86/avx512f.h | 13 +++++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/x86/avx.h b/x86/avx.h index 88ca58fc..46b4dc1d 100644 --- a/x86/avx.h +++ b/x86/avx.h @@ -223,9 +223,15 @@ typedef union { #endif #if defined(SIMDE_X86_AVX_ENABLE_NATIVE_ALIASES) - typedef simde__m256 __m256; - typedef simde__m256i __m256i; - typedef simde__m256d __m256d; + #if !defined(HEDLEY_INTEL_VERSION) + typedef simde__m256 __m256; + typedef simde__m256i __m256i; + typedef simde__m256d __m256d; + #else + #define __m256 simde__m256 + #define __m256i simde__m256i + #define __m256d simde__m256d + #endif #endif HEDLEY_STATIC_ASSERT(32 == sizeof(simde__m256), "simde__m256 size incorrect"); diff --git a/x86/avx512f.h b/x86/avx512f.h index f83efd4b..1edf27b9 100644 --- a/x86/avx512f.h +++ b/x86/avx512f.h @@ -290,10 +290,15 @@ typedef union { #endif #if !defined(SIMDE_X86_AVX512F_NATIVE) && defined(SIMDE_ENABLE_NATIVE_ALIASES) - #define SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES - typedef simde__m512 __m512; - typedef simde__m512i __m512i; - typedef simde__m512d __m512d; + #if !defined(HEDLEY_INTEL_VERSION) + typedef simde__m512 __m512; + typedef simde__m512i __m512i; + typedef simde__m512d __m512d; + #else + #define __m512 simde__m512 + #define __m512i simde__m512i + #define __m512d simde__m512d + #endif #endif HEDLEY_STATIC_ASSERT(64 == sizeof(simde__m512), "simde__m512 size incorrect");