public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] i386: Skip decimal float vector modes in type_natural_mode [PR79754]
@ 2022-02-12  9:57 Uros Bizjak
  2022-02-17 16:05 ` Eric Botcazou
  0 siblings, 1 reply; 2+ messages in thread
From: Uros Bizjak @ 2022-02-12  9:57 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 366 bytes --]

2022-02-12  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

    PR target/79754
    * config/i386/i386.cc (type_natural_mode):
    Skip decimal float vector modes.

gcc/testsuite/ChangeLog:

    PR target/79754
    * gcc.target/i386/pr79754.c: New test.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Pushed to master.

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 1060 bytes --]

diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index 6b97a2b0e50..cf246e74e57 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -1876,10 +1876,14 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum,
 	{
 	  machine_mode innermode = TYPE_MODE (TREE_TYPE (type));
 
-	  /* There are no XFmode vector modes.  */
+	  /* There are no XFmode vector modes ...  */
 	  if (innermode == XFmode)
 	    return mode;
 
+	  /* ... and no decimal float vector modes.  */
+	  if (DECIMAL_FLOAT_MODE_P (innermode))
+	    return mode;
+
 	  if (TREE_CODE (TREE_TYPE (type)) == REAL_TYPE)
 	    mode = MIN_MODE_VECTOR_FLOAT;
 	  else
diff --git a/gcc/testsuite/gcc.target/i386/pr79754.c b/gcc/testsuite/gcc.target/i386/pr79754.c
new file mode 100644
index 00000000000..27845c9d5b9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr79754.c
@@ -0,0 +1,7 @@
+/* PR target/79754 */
+/* { dg-do compile } */
+/* { dg-options "-Wno-psabi" } */
+
+typedef _Decimal32 V __attribute__ ((vector_size(16)));
+
+V fn1 (V a) { return a; }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] i386: Skip decimal float vector modes in type_natural_mode [PR79754]
  2022-02-12  9:57 [PATCH] i386: Skip decimal float vector modes in type_natural_mode [PR79754] Uros Bizjak
@ 2022-02-17 16:05 ` Eric Botcazou
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Botcazou @ 2022-02-17 16:05 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

> gcc/testsuite/ChangeLog:
> 
>     PR target/79754
>     * gcc.target/i386/pr79754.c: New test.
> 
> Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.
> 
> Pushed to master.

And 11 branch apparently, but it should be:

/* { dg-do compile { target dfp } } */

instead of just:

/* { dg-do compile } *

-- 
Eric Botcazou



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-17 16:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-12  9:57 [PATCH] i386: Skip decimal float vector modes in type_natural_mode [PR79754] Uros Bizjak
2022-02-17 16:05 ` Eric Botcazou

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).