combine.c (simplify_and_const_int): Use gen_int_mode instead of GEN_INT (trunc_int_fo...
authorKazu Hirata <kazu@cs.umass.edu>
Sat, 5 Mar 2005 17:25:33 +0000 (17:25 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sat, 5 Mar 2005 17:25:33 +0000 (17:25 +0000)
* combine.c (simplify_and_const_int): Use gen_int_mode instead
of GEN_INT (trunc_int_for_mode (...)).
* loop-iv.c (iv_number_of_iterations): Likewise.
* postreload.c (reload_cse_move2add): Likewise.
* simplify-rtx.c (simplify_const_unary_operation,
simplify_const_binary_operation): Likewise.
* stor-layout.c (get_mode_bounds): Likewise.

From-SVN: r95935

gcc/ChangeLog
gcc/combine.c
gcc/loop-iv.c
gcc/postreload.c
gcc/simplify-rtx.c
gcc/stor-layout.c

index ab6f61722525a1d9fe2ee7af314980c301fe78f6..e4f46793f1b5101a05d58a5afc82df980658de77 100644 (file)
        * tree-ssa-pre.c (remove_dead_inserted_code): Likewise.
        * tree-ssa.c (kill_redundant_phi_nodes): Likewise.
 
+       * combine.c (simplify_and_const_int): Use gen_int_mode instead
+       of GEN_INT (trunc_int_for_mode (...)).
+       * loop-iv.c (iv_number_of_iterations): Likewise.
+       * postreload.c (reload_cse_move2add): Likewise.
+       * simplify-rtx.c (simplify_const_unary_operation,
+       simplify_const_binary_operation): Likewise.
+       * stor-layout.c (get_mode_bounds): Likewise.
+
 2005-03-05  Richard Sandiford  <rsandifo@redhat.com>
 
        * doc/invoke.texi: Document new MIPS -msym32 and -mno-sym32 options.
index 5d34dfa83f5c34ef30f7729858579d1cf48ac966..48d7020641cc6873c435b4d90bd769cc047920b5 100644 (file)
@@ -8095,7 +8095,7 @@ simplify_and_const_int (rtx x, enum machine_mode mode, rtx varop,
   /* If VAROP is a CONST_INT, then we need to apply the mask in CONSTOP
      to VAROP and return the new constant.  */
   if (GET_CODE (varop) == CONST_INT)
-    return GEN_INT (trunc_int_for_mode (INTVAL (varop) & constop, mode));
+    return gen_int_mode (INTVAL (varop) & constop, mode);
 
   /* See what bits may be nonzero in VAROP.  Unlike the general case of
      a call to nonzero_bits, here we don't care about bits outside
index 04f53b88d3ef5f21d7be37993dbc0ef3db97feaa..99b43b74213e69ea9e82e832bf13b9a0a620c6bb 100644 (file)
@@ -2369,8 +2369,7 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition,
 
       tmp = simplify_gen_binary (UDIV, mode, tmp1, GEN_INT (d));
       inv = inverse (s, size);
-      inv = trunc_int_for_mode (inv, mode);
-      tmp = simplify_gen_binary (MULT, mode, tmp, GEN_INT (inv));
+      tmp = simplify_gen_binary (MULT, mode, tmp, gen_int_mode (inv, mode));
       desc->niter_expr = simplify_gen_binary (AND, mode, tmp, bound);
     }
   else
index df10eb49425cf8f8ceab64f481c2f69e05e8ddd5..1b98c287a977081e6ae5b67b5f5045d1ee7ad97a 100644 (file)
@@ -1244,10 +1244,8 @@ reload_cse_move2add (rtx first)
 
              if (GET_CODE (src) == CONST_INT && reg_base_reg[regno] < 0)
                {
-                 rtx new_src =
-                   GEN_INT (trunc_int_for_mode (INTVAL (src)
-                                                - reg_offset[regno],
-                                                GET_MODE (reg)));
+                 rtx new_src = gen_int_mode (INTVAL (src) - reg_offset[regno],
+                                             GET_MODE (reg));
                  /* (set (reg) (plus (reg) (const_int 0))) is not canonical;
                     use (set (reg) (reg)) instead.
                     We don't delete this insn, nor do we convert it into a
@@ -1284,9 +1282,8 @@ reload_cse_move2add (rtx first)
                            {
                              rtx narrow_reg = gen_rtx_REG (narrow_mode,
                                                            REGNO (reg));
-                             rtx narrow_src =
-                               GEN_INT (trunc_int_for_mode (INTVAL (src),
-                                                            narrow_mode));
+                             rtx narrow_src = gen_int_mode (INTVAL (src),
+                                                            narrow_mode);
                              rtx new_set =
                                gen_rtx_SET (VOIDmode,
                                             gen_rtx_STRICT_LOW_PART (VOIDmode,
@@ -1335,10 +1332,10 @@ reload_cse_move2add (rtx first)
                      HOST_WIDE_INT base_offset = reg_offset[REGNO (src)];
                      HOST_WIDE_INT regno_offset = reg_offset[regno];
                      rtx new_src =
-                       GEN_INT (trunc_int_for_mode (added_offset
-                                                    + base_offset
-                                                    - regno_offset,
-                                                    GET_MODE (reg)));
+                       gen_int_mode (added_offset
+                                     + base_offset
+                                     - regno_offset,
+                                     GET_MODE (reg));
                      int success = 0;
 
                      if (new_src == const0_rtx)
index c6b0ec812797f5f65427c4ebe1f13d656ecbcffa..8a1b9bb4805689ea083ec5cd52560a595258cb70 100644 (file)
@@ -829,9 +829,7 @@ simplify_const_unary_operation (enum rtx_code code, enum machine_mode mode,
          gcc_unreachable ();
        }
 
-      val = trunc_int_for_mode (val, mode);
-
-      return GEN_INT (val);
+      return gen_int_mode (val, mode);
     }
 
   /* We can do some operations on integer CONST_DOUBLEs.  Also allow
@@ -2491,8 +2489,7 @@ simplify_const_binary_operation (enum rtx_code code, enum machine_mode mode,
          gcc_unreachable ();
        }
 
-      val = trunc_int_for_mode (val, mode);
-      return GEN_INT (val);
+      return gen_int_mode (val, mode);
     }
 
   return NULL_RTX;
index ac7fb744f66b365b846e3418c970e94bff5ad680..66395a9c86be0c30be4d0b8a7c4d4eaba631adeb 100644 (file)
@@ -2097,8 +2097,8 @@ get_mode_bounds (enum machine_mode mode, int sign,
       max_val = ((unsigned HOST_WIDE_INT) 1 << (size - 1) << 1) - 1;
     }
 
-  *mmin = GEN_INT (trunc_int_for_mode (min_val, target_mode));
-  *mmax = GEN_INT (trunc_int_for_mode (max_val, target_mode));
+  *mmin = gen_int_mode (min_val, target_mode);
+  *mmax = gen_int_mode (max_val, target_mode);
 }
 
 #include "gt-stor-layout.h"