From 23bce99cbe7016a04e14c2163ed3fe6a5a64f4e2 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sat, 29 Sep 2018 18:04:09 +0200 Subject: [PATCH] re PR target/87467 (Incorrect function parameter for _mm512_abs_pd in `include/avx512fintrin.h`) PR target/87467 * config/i386/avx512fintrin.h (_mm512_abs_pd, _mm512_mask_abs_pd): Use __m512d type for __A argument rather than __m512. * gcc.target/i386/avx512f-abspd-1.c (SIZE): Divide by two. (CALC): Use double instead of float. (TEST): Adjust to test _mm512_abs_pd and _mm512_mask_abs_pd rather than _mm512_abs_ps and _mm512_mask_abs_ps. From-SVN: r264711 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/avx512fintrin.h | 4 ++-- gcc/testsuite/ChangeLog | 8 ++++++++ .../gcc.target/i386/avx512f-abspd-1.c | 20 +++++++++---------- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7be6ceb3d62..859984cf7cb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-09-29 Jakub Jelinek + + PR target/87467 + * config/i386/avx512fintrin.h (_mm512_abs_pd, _mm512_mask_abs_pd): Use + __m512d type for __A argument rather than __m512. + 2018-09-28 John David Anglin * match.pd (simple_comparison): Don't optimize if either operand is diff --git a/gcc/config/i386/avx512fintrin.h b/gcc/config/i386/avx512fintrin.h index 80525f9fb4d..4308c71bdd6 100644 --- a/gcc/config/i386/avx512fintrin.h +++ b/gcc/config/i386/avx512fintrin.h @@ -7798,7 +7798,7 @@ _mm512_mask_abs_ps (__m512 __W, __mmask16 __U, __m512 __A) extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm512_abs_pd (__m512 __A) +_mm512_abs_pd (__m512d __A) { return (__m512d) _mm512_and_epi64 ((__m512i) __A, _mm512_set1_epi64 (0x7fffffffffffffffLL)); @@ -7806,7 +7806,7 @@ _mm512_abs_pd (__m512 __A) extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm512_mask_abs_pd (__m512d __W, __mmask8 __U, __m512 __A) +_mm512_mask_abs_pd (__m512d __W, __mmask8 __U, __m512d __A) { return (__m512d) _mm512_mask_and_epi64 ((__m512i) __W, __U, (__m512i) __A, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2a81011d61a..2ef07c5202b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2018-09-29 Jakub Jelinek + + PR target/87467 + * gcc.target/i386/avx512f-abspd-1.c (SIZE): Divide by two. + (CALC): Use double instead of float. + (TEST): Adjust to test _mm512_abs_pd and _mm512_mask_abs_pd rather than + _mm512_abs_ps and _mm512_mask_abs_ps. + 2018-09-28 David Malcolm * c-c++-common/unroll-1.c: Update expected output from "note" to diff --git a/gcc/testsuite/gcc.target/i386/avx512f-abspd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-abspd-1.c index 14ed0374444..1b6872151d8 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-abspd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-abspd-1.c @@ -6,11 +6,11 @@ #include "avx512f-helper.h" -#define SIZE (AVX512F_LEN / 32) +#define SIZE (AVX512F_LEN / 64) #include "avx512f-mask-type.h" static void -CALC (float *i1, float *r) +CALC (double *i1, double *r) { int i; @@ -24,27 +24,27 @@ CALC (float *i1, float *r) void TEST (void) { - float ck[SIZE]; + double ck[SIZE]; int i; - UNION_TYPE (AVX512F_LEN, ) s, d, dm; + UNION_TYPE (AVX512F_LEN, d) s, d, dm; MASK_TYPE mask = MASK_VALUE; for (i = 0; i < SIZE; i++) { - s.a[i] = i * ((i & 1) ? 3.5f : -7.5f); + s.a[i] = i * ((i & 1) ? 3.5 : -7.5); d.a[i] = DEFAULT_VALUE; dm.a[i] = DEFAULT_VALUE; } CALC (s.a, ck); - d.x = INTRINSIC (_abs_ps) (s.x); - dm.x = INTRINSIC (_mask_abs_ps) (dm.x, mask, s.x); + d.x = INTRINSIC (_abs_pd) (s.x); + dm.x = INTRINSIC (_mask_abs_pd) (dm.x, mask, s.x); - if (UNION_CHECK (AVX512F_LEN, ) (d, ck)) + if (UNION_CHECK (AVX512F_LEN, d) (d, ck)) abort (); - MASK_MERGE () (ck, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, ) (dm, ck)) + MASK_MERGE (d) (ck, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, d) (dm, ck)) abort (); } -- 2.30.2