* [PATCH] i386: Fix _mm512_fpclass_ps_mask in O0 [PR 101471]
@ 2021-08-25 5:59 Kong, Lingling
0 siblings, 0 replies; only message in thread
From: Kong, Lingling @ 2021-08-25 5:59 UTC (permalink / raw)
To: Liu, Hongtao; +Cc: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]
Hi,
For _mm512_fpclass_ps_mask in O0, mask should be (__mmask16)-1 instead of
(__mmask8)-1).
Bootstrapped and regtested on x86_64-linux-gnu{-m32,}.
Ok for master?
gcc/ChangeLog:
* gcc/config/i386/avx512dqintrin.h : fix _mm512_fpclass_ps_mask define in O0
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512f-pr101471.c: add new test
[-- Attachment #2: 0001-i386-Fix-_mm512_fpclass_ps_mask-in-O0-PR-101471.patch --]
[-- Type: application/octet-stream, Size: 2298 bytes --]
From 2535b3577bb5b170f9dc39c632a97ddbb47a0cd3 Mon Sep 17 00:00:00 2001
From: konglin1 <lingling.kong@intel.com>
Date: Mon, 9 Aug 2021 10:58:24 +0800
Subject: [PATCH] i386: Fix _mm512_fpclass_ps_mask in O0 [PR 101471]
gcc/ChangeLog:
* gcc/config/i386/avx512dqintrin.h : fix _mm512_fpclass_ps_mask define in O0
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512f-pr101471.c: add new test
---
gcc/config/i386/avx512dqintrin.h | 4 ++--
.../gcc.target/i386/avx512f-pr101471.c | 18 ++++++++++++++++++
2 files changed, 20 insertions(+), 2 deletions(-)
create mode 100644 gcc/testsuite/gcc.target/i386/avx512f-pr101471.c
diff --git a/gcc/config/i386/avx512dqintrin.h b/gcc/config/i386/avx512dqintrin.h
index 51c0b1249ae..9794f5d3e8b 100644
--- a/gcc/config/i386/avx512dqintrin.h
+++ b/gcc/config/i386/avx512dqintrin.h
@@ -2814,7 +2814,7 @@ _mm512_fpclass_ps_mask (__m512 __A, const int __imm)
#define _mm512_mask_fpclass_ps_mask(u, x, c) \
((__mmask16) __builtin_ia32_fpclassps512_mask ((__v16sf) (__m512) (x),\
- (int) (c),(__mmask8)(u)))
+ (int) (c),(__mmask16)(u)))
#define _mm512_fpclass_pd_mask(X, C) \
((__mmask8) __builtin_ia32_fpclasspd512_mask ((__v8df) (__m512d) (X), \
@@ -2822,7 +2822,7 @@ _mm512_fpclass_ps_mask (__m512 __A, const int __imm)
#define _mm512_fpclass_ps_mask(x, c) \
((__mmask16) __builtin_ia32_fpclassps512_mask ((__v16sf) (__m512) (x),\
- (int) (c),(__mmask8)-1))
+ (int) (c),(__mmask16)-1))
#define _mm_reduce_sd(A, B, C) \
((__m128d) __builtin_ia32_reducesd_mask ((__v2df)(__m128d)(A), \
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-pr101471.c b/gcc/testsuite/gcc.target/i386/avx512f-pr101471.c
new file mode 100644
index 00000000000..4a0057b241e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512f-pr101471.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-options "-mavx512dq -O0" } */
+/* { dg-require-effective-target avx512dq } */
+
+#include "avx512f-check.h"
+
+static void
+avx512f_test (void)
+{
+ __m512 x = {
+ 1, 1, 1, 1,
+ 1, 1, 1, 1,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0, };
+ int ret = _mm512_fpclass_ps_mask(x, 0x26);
+ if (ret != 65280)
+ __builtin_abort();
+}
--
2.18.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-25 5:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25 5:59 [PATCH] i386: Fix _mm512_fpclass_ps_mask in O0 [PR 101471] Kong, Lingling
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).