i386: Skip decimal float vector modes in type_natural_mode [PR79754]
Commit Message
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.
Comments
> 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 } *
@@ -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
new file mode 100644
@@ -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; }