poly_int: TRULY_NOOP_TRUNCATION
authorRichard Sandiford <richard.sandiford@linaro.org>
Wed, 20 Dec 2017 12:52:12 +0000 (12:52 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 20 Dec 2017 12:52:12 +0000 (12:52 +0000)
This patch makes TRULY_NOOP_TRUNCATION take the mode sizes as
poly_uint64s instead of unsigned ints.  The function bodies
don't need to change.

2017-12-20  Richard Sandiford  <richard.sandiford@linaro.org>
            Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* target.def (truly_noop_truncation): Take poly_uint64s instead of
unsigned ints.  Change default to hook_bool_puint64_puint64_true.
* doc/tm.texi: Regenerate.
* hooks.h (hook_bool_uint_uint_true): Delete.
(hook_bool_puint64_puint64_true): Declare.
* hooks.c (hook_bool_uint_uint_true): Delete.
(hook_bool_puint64_puint64_true): New function.
* config/mips/mips.c (mips_truly_noop_truncation): Take poly_uint64s
instead of unsigned ints.
* config/spu/spu.c (spu_truly_noop_truncation): Likewise.
* config/tilegx/tilegx.c (tilegx_truly_noop_truncation): Likewise.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r255866

gcc/ChangeLog
gcc/config/mips/mips.c
gcc/config/spu/spu.c
gcc/config/tilegx/tilegx.c
gcc/doc/tm.texi
gcc/hooks.c
gcc/hooks.h
gcc/target.def

index 5f26d1b..e99f20c 100644 (file)
@@ -1,4 +1,20 @@
 2017-12-20  Richard Sandiford  <richard.sandiford@linaro.org>
+            Alan Hayward  <alan.hayward@arm.com>
+           David Sherwood  <david.sherwood@arm.com>
+
+       * target.def (truly_noop_truncation): Take poly_uint64s instead of
+       unsigned ints.  Change default to hook_bool_puint64_puint64_true.
+       * doc/tm.texi: Regenerate.
+       * hooks.h (hook_bool_uint_uint_true): Delete.
+       (hook_bool_puint64_puint64_true): Declare.
+       * hooks.c (hook_bool_uint_uint_true): Delete.
+       (hook_bool_puint64_puint64_true): New function.
+       * config/mips/mips.c (mips_truly_noop_truncation): Take poly_uint64s
+       instead of unsigned ints.
+       * config/spu/spu.c (spu_truly_noop_truncation): Likewise.
+       * config/tilegx/tilegx.c (tilegx_truly_noop_truncation): Likewise.
+
+2017-12-20  Richard Sandiford  <richard.sandiford@linaro.org>
            Alan Hayward  <alan.hayward@arm.com>
            David Sherwood  <david.sherwood@arm.com>
 
index 4f6eb84..f16a67b 100644 (file)
@@ -22322,7 +22322,7 @@ mips_promote_function_mode (const_tree type ATTRIBUTE_UNUSED,
 /* Implement TARGET_TRULY_NOOP_TRUNCATION.  */
 
 static bool
-mips_truly_noop_truncation (unsigned int outprec, unsigned int inprec)
+mips_truly_noop_truncation (poly_uint64 outprec, poly_uint64 inprec)
 {
   return !TARGET_64BIT || inprec <= 32 || outprec > 32;
 }
index 4b47b4a..2800a8f 100644 (file)
@@ -7185,7 +7185,7 @@ spu_can_change_mode_class (machine_mode from, machine_mode to, reg_class_t)
 /* Implement TARGET_TRULY_NOOP_TRUNCATION.  */
 
 static bool
-spu_truly_noop_truncation (unsigned int outprec, unsigned int inprec)
+spu_truly_noop_truncation (poly_uint64 outprec, poly_uint64 inprec)
 {
   return inprec <= 32 && outprec <= inprec;
 }
index 794afee..140cce1 100644 (file)
@@ -5566,7 +5566,7 @@ tilegx_file_end (void)
    as sign-extended DI values in registers.  */
 
 static bool
-tilegx_truly_noop_truncation (unsigned int outprec, unsigned int inprec)
+tilegx_truly_noop_truncation (poly_uint64 outprec, poly_uint64 inprec)
 {
   return inprec <= 32 || outprec > 32;
 }
index 45675e3..fc73bb2 100644 (file)
@@ -10801,7 +10801,7 @@ nevertheless truncate the shift count, you may get better code
 by overriding it.
 @end deftypefn
 
-@deftypefn {Target Hook} bool TARGET_TRULY_NOOP_TRUNCATION (unsigned int @var{outprec}, unsigned int @var{inprec})
+@deftypefn {Target Hook} bool TARGET_TRULY_NOOP_TRUNCATION (poly_uint64 @var{outprec}, poly_uint64 @var{inprec})
 This hook returns true if it is safe to ``convert'' a value of
 @var{inprec} bits to one of @var{outprec} bits (where @var{outprec} is
 smaller than @var{inprec}) by merely operating on it as if it had only
index 61ff890..18a957e 100644 (file)
@@ -133,9 +133,9 @@ hook_bool_mode_uhwi_false (machine_mode, unsigned HOST_WIDE_INT)
   return false;
 }
 
-/* Generic hook that takes (unsigned int, unsigned int) and returns true.  */
+/* Generic hook that takes (poly_uint64, poly_uint64) and returns true.  */
 bool
-hook_bool_uint_uint_true (unsigned int, unsigned int)
+hook_bool_puint64_puint64_true (poly_uint64, poly_uint64)
 {
   return true;
 }
index 8dbfd78..b0d830a 100644 (file)
@@ -39,7 +39,7 @@ extern bool hook_bool_const_rtx_insn_const_rtx_insn_true (const rtx_insn *,
                                                          const rtx_insn *);
 extern bool hook_bool_mode_uhwi_false (machine_mode,
                                       unsigned HOST_WIDE_INT);
-extern bool hook_bool_uint_uint_true (unsigned int, unsigned int);
+extern bool hook_bool_puint64_puint64_true (poly_uint64, poly_uint64);
 extern bool hook_bool_uint_mode_false (unsigned int, machine_mode);
 extern bool hook_bool_uint_mode_true (unsigned int, machine_mode);
 extern bool hook_bool_tree_false (tree);
index 78577d6..b1178ca 100644 (file)
@@ -3154,8 +3154,8 @@ is correct for most machines.\n\
 If @code{TARGET_MODES_TIEABLE_P} returns false for a pair of modes,\n\
 suboptimal code can result if this hook returns true for the corresponding\n\
 mode sizes.  Making this hook return false in such cases may improve things.",
- bool, (unsigned int outprec, unsigned int inprec),
- hook_bool_uint_uint_true)
+ bool, (poly_uint64 outprec, poly_uint64 inprec),
+ hook_bool_puint64_puint64_true)
 
 /* If the representation of integral MODE is such that values are
    always sign-extended to a wider mode MODE_REP then return