public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-9564] i386: Skip decimal float vector modes in type_natural_mode [PR79754]
@ 2022-02-13  9:18 Uros Bizjak
  0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2022-02-13  9:18 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:e89144e8a3984608da2d31f18776df51d9e0f352

commit r11-9564-ge89144e8a3984608da2d31f18776df51d9e0f352
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Sat Feb 12 10:53:49 2022 +0100

    i386: Skip decimal float vector modes in type_natural_mode [PR79754]
    
    2022-02-12  Uroš Bizjak  <ubizjak@gmail.com>
    
    gcc/ChangeLog:
    
            PR target/79754
            * config/i386/i386.c (type_natural_mode):
            Skip decimal float vector modes.
    
    gcc/testsuite/ChangeLog:
    
            PR target/79754
            * gcc.target/i386/pr79754.c: New test.
    
    (cherry picked from commit edadc7e0510b703d9727cf5ff68d55d84bb95def)

Diff:
---
 gcc/config/i386/i386.c                  | 6 +++++-
 gcc/testsuite/gcc.target/i386/pr79754.c | 7 +++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index bf471735d58..ecb78087502 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1872,10 +1872,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] only message in thread

only message in thread, other threads:[~2022-02-13  9:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-13  9:18 [gcc r11-9564] i386: Skip decimal float vector modes in type_natural_mode [PR79754] Uros Bizjak

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