Skip to content

Commit

Permalink
avx, avx512f: use macro instead of typedef to create __m* types on ICC
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nemequ committed Jun 22, 2020
1 parent 6f9f3a7 commit f55b804
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
12 changes: 9 additions & 3 deletions x86/avx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
13 changes: 9 additions & 4 deletions x86/avx512f.h
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit f55b804

Please sign in to comment.