aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-08-30 11:20:30 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-08-30 11:20:30 +0000
commit18e2a8b889d520fc3598f74e39e1dbf1ef06ebd1 (patch)
treee1451bf5c192ca3f87cbe104e8705b376d580712 /gcc/c-family
parent16d2200070f49ed71053b81699e37bd539a0ee69 (diff)
downloadgcc-18e2a8b889d520fc3598f74e39e1dbf1ef06ebd1.zip
gcc-18e2a8b889d520fc3598f74e39e1dbf1ef06ebd1.tar.gz
gcc-18e2a8b889d520fc3598f74e39e1dbf1ef06ebd1.tar.bz2
[72/77] Pass scalar_mode to scalar_mode_supported_p
This patch makes the scalar_mode_supported_p target hook take a scalar_mode rather than a machine_mode. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * target.def (scalar_mode_supported_p): Take a scalar_mode instead of a machine_mode. * targhooks.h (default_scalar_mode_supported_p): Likewise. * targhooks.c (default_scalar_mode_supported_p): Likewise. * config/aarch64/aarch64.c (aarch64_scalar_mode_supported_p): Likewise. * config/alpha/alpha.c (alpha_scalar_mode_supported_p): Likewise. * config/arm/arm.c (arm_scalar_mode_supported_p): Likewise. * config/avr/avr.c (avr_scalar_mode_supported_p): Likewise. * config/c6x/c6x.c (c6x_scalar_mode_supported_p): Likewise. * config/i386/i386.c (ix86_scalar_mode_supported_p): Likewise. * config/ia64/ia64.c (ia64_scalar_mode_supported_p): Likewise. * config/mips/mips.c (mips_scalar_mode_supported_p): Likewise. * config/msp430/msp430.c (msp430_scalar_mode_supported_p): Likewise. * config/pa/pa.c (pa_scalar_mode_supported_p): Likewise. * config/pdp11/pdp11.c (pdp11_scalar_mode_supported_p): Likewise. * config/powerpcspe/powerpcspe.c (rs6000_scalar_mode_supported_p): Likewise. * config/rs6000/rs6000.c (rs6000_scalar_mode_supported_p): Likewise. * config/s390/s390.c (s390_scalar_mode_supported_p): Likewise. * config/spu/spu.c (spu_scalar_mode_supported_p): Likewise. * config/tilegx/tilegx.c (tilegx_scalar_mode_supported_p): Likewise. * config/tilepro/tilepro.c (tilepro_scalar_mode_supported_p): Likewise. * doc/tm.texi: Regenerate. gcc/c-family/ * c-attribs.c (vector_mode_valid_p) Fold GET_MODE_INNER call into scalar_mode_supported_p call. (handle_mode_attribute): Update call to scalar_mode_supported_p. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251523
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog8
-rw-r--r--gcc/c-family/c-attribs.c8
2 files changed, 11 insertions, 5 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index a294404..9aba47f 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -2,6 +2,14 @@
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
+ * c-attribs.c (vector_mode_valid_p) Fold GET_MODE_INNER call
+ into scalar_mode_supported_p call.
+ (handle_mode_attribute): Update call to scalar_mode_supported_p.
+
+2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
+ Alan Hayward <alan.hayward@arm.com>
+ David Sherwood <david.sherwood@arm.com>
+
* c-common.c (c_common_fixed_point_type_for_size): Use opt_scalar_mode
for the mode iterator.
diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/c-attribs.c
index e564c72..4f6638f 100644
--- a/gcc/c-family/c-attribs.c
+++ b/gcc/c-family/c-attribs.c
@@ -1339,7 +1339,6 @@ static bool
vector_mode_valid_p (machine_mode mode)
{
enum mode_class mclass = GET_MODE_CLASS (mode);
- machine_mode innermode;
/* Doh! What's going on? */
if (mclass != MODE_VECTOR_INT
@@ -1354,14 +1353,12 @@ vector_mode_valid_p (machine_mode mode)
if (targetm.vector_mode_supported_p (mode))
return true;
- innermode = GET_MODE_INNER (mode);
-
/* We should probably return 1 if requesting V4DI and we have no DI,
but we have V2DI, but this is probably very unlikely. */
/* If we have support for the inner mode, we can safely emulate it.
We may not have V2DI, but me can emulate with a pair of DIs. */
- return targetm.scalar_mode_supported_p (innermode);
+ return targetm.scalar_mode_supported_p (GET_MODE_INNER (mode));
}
@@ -1437,7 +1434,8 @@ handle_mode_attribute (tree *node, tree name, tree args,
case MODE_UFRACT:
case MODE_ACCUM:
case MODE_UACCUM:
- valid_mode = targetm.scalar_mode_supported_p (mode);
+ valid_mode
+ = targetm.scalar_mode_supported_p (as_a <scalar_mode> (mode));
break;
case MODE_COMPLEX_INT: