Skip to content

Commit

Permalink
avx512 abs: refine GCC compiler checks for _mm512{,_mask}_abs_pd (#…
Browse files Browse the repository at this point in the history
…1118)

Adds definition of SIMDE_BUG_GCC_87467

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87467

It is fixed in versions 7.4.0 and 8.3.0 and above.

Closes #1117
  • Loading branch information
thomas-schlichter authored Dec 15, 2023
1 parent fdbd6b2 commit 5405bbd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions simde/simde-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,9 @@ HEDLEY_DIAGNOSTIC_POP
# if !HEDLEY_GCC_VERSION_CHECK(4,6,0)
# define SIMDE_BUG_GCC_BAD_MM_EXTRACT_EPI8 /* TODO: find relevant bug or commit */
# endif
# if !HEDLEY_GCC_VERSION_CHECK(7,4,0) || (HEDLEY_GCC_VERSION_CHECK(8,0,0) && !HEDLEY_GCC_VERSION_CHECK(8,3,0))
# define SIMDE_BUG_GCC_87467
# endif
# if !HEDLEY_GCC_VERSION_CHECK(8,0,0)
# define SIMDE_BUG_GCC_REV_247851
# endif
Expand Down
4 changes: 2 additions & 2 deletions simde/x86/avx512/abs.h
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ simde_mm512_mask_abs_ps(simde__m512 src, simde__mmask16 k, simde__m512 v2) {
SIMDE_FUNCTION_ATTRIBUTES
simde__m512d
simde_mm512_abs_pd(simde__m512d v2) {
#if defined(SIMDE_X86_AVX512F_NATIVE) && (!defined(HEDLEY_GCC_VERSION) || HEDLEY_GCC_VERSION_CHECK(8,3,0))
#if defined(SIMDE_X86_AVX512F_NATIVE) && !defined(SIMDE_BUG_GCC_87467)
return _mm512_abs_pd(v2);
#elif defined(SIMDE_X86_AVX512F_NATIVE) && (!defined(HEDLEY_GCC_VERSION) || HEDLEY_GCC_VERSION_CHECK(7,0,0))
/* gcc bug: https://gcc.gnu.org/legacy-ml/gcc-patches/2018-01/msg01962.html */
Expand Down Expand Up @@ -560,7 +560,7 @@ simde_mm512_abs_pd(simde__m512d v2) {
SIMDE_FUNCTION_ATTRIBUTES
simde__m512d
simde_mm512_mask_abs_pd(simde__m512d src, simde__mmask8 k, simde__m512d v2) {
#if defined(SIMDE_X86_AVX512F_NATIVE) && (!defined(HEDLEY_GCC_VERSION) || HEDLEY_GCC_VERSION_CHECK(8,3,0))
#if defined(SIMDE_X86_AVX512F_NATIVE) && !defined(SIMDE_BUG_GCC_87467)
return _mm512_mask_abs_pd(src, k, v2);
#elif defined(SIMDE_X86_AVX512F_NATIVE) && (!defined(HEDLEY_GCC_VERSION) || HEDLEY_GCC_VERSION_CHECK(7,0,0))
/* gcc bug: https://gcc.gnu.org/legacy-ml/gcc-patches/2018-01/msg01962.html */
Expand Down

0 comments on commit 5405bbd

Please sign in to comment.