emit-rtl.c (gen_int_mode): New function.
authorLars Brinkhoff <lars@nocrew.org>
Tue, 19 Mar 2002 18:00:43 +0000 (10:00 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 19 Mar 2002 18:00:43 +0000 (10:00 -0800)
        * emit-rtl.c (gen_int_mode): New function.
        * rtl.h: Prototype for it.
        * combine.c (make_extraction, simplify_comparison), expmed.c
        (store_bit_field, expand_mult_highpart, expand_divmod), expr.c
        (convert_modes, store_field), optabs.c (expand_fix),
        simplify-rtx.c (neg_const_int, simplify_unary_real),

        * config/rs6000/rs6000.c, config/rs6000/rs6000.md:
        Use it instead of GEN_INT (trunc_int_for_mode (...)).

From-SVN: r51030

gcc/ChangeLog
gcc/combine.c
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.md
gcc/emit-rtl.c
gcc/expmed.c
gcc/expr.c
gcc/optabs.c
gcc/rtl.h
gcc/simplify-rtx.c

index 795c75f1932a12bafc710e480bc57f73c5877684..fbaee551790da6103267e30b5d0f8ccb4704c1da 100644 (file)
@@ -1,3 +1,15 @@
+2002-03-19  Lars Brinkhoff  <lars@nocrew.org>
+
+       * emit-rtl.c (gen_int_mode): New function.
+       * rtl.h: Prototype for it.
+       * combine.c (make_extraction, simplify_comparison), expmed.c
+       (store_bit_field, expand_mult_highpart, expand_divmod), expr.c
+       (convert_modes, store_field), optabs.c (expand_fix),
+       simplify-rtx.c (neg_const_int, simplify_unary_real),
+
+       * config/rs6000/rs6000.c, config/rs6000/rs6000.md:
+       Use it instead of GEN_INT (trunc_int_for_mode (...)).
+
 2002-03-19  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/5656
 
 2002-03-18  Aldy Hernandez  <aldyh@redhat.com>
 
-        * config/rs6000/rs6000.h (PREDICATE_CODES): Add PARALLEL to
-        any_operand.
+       * config/rs6000/rs6000.h (PREDICATE_CODES): Add PARALLEL to
+       any_operand.
 
 2002-03-17  Richard Henderson  <rth@redhat.com>
 
index 7dc4b29addbbc9dafa70bd39f6d120cade6e6b98..0f175599b29bf15536b84a4a228483dc2d36ed8d 100644 (file)
@@ -6033,7 +6033,7 @@ make_extraction (mode, inner, pos, pos_rtx, len,
        return new;
 
       if (GET_CODE (new) == CONST_INT)
-       return GEN_INT (trunc_int_for_mode (INTVAL (new), mode));
+       return gen_int_mode (INTVAL (new), mode);
 
       /* If we know that no extraneous bits are set, and that the high
         bit is not set, convert the extraction to the cheaper of
@@ -10792,7 +10792,7 @@ simplify_comparison (code, pop0, pop1)
              unsigned HOST_WIDE_INT temp = const_op & GET_MODE_MASK (mode);
 
              temp >>= INTVAL (XEXP (op0, 1));
-             op1 = GEN_INT (trunc_int_for_mode (temp, mode));
+             op1 = gen_int_mode (temp, mode);
              op0 = XEXP (op0, 0);
              continue;
            }
index 8ad9fa52e419eeb661a0fe69640c9ef9adf42979..de4af5d1d8725e85e1b16d28cc90f4c40e454924 100644 (file)
@@ -2177,8 +2177,7 @@ rs6000_emit_move (dest, source, mode)
       /* FIXME.  This should never happen.  */
       /* Since it seems that it does, do the safe thing and convert
         to a CONST_INT.  */
-      operands[1] = 
-       GEN_INT (trunc_int_for_mode (CONST_DOUBLE_LOW (operands[1]), mode));
+      operands[1] = gen_int_mode (CONST_DOUBLE_LOW (operands[1]), mode);
     }
   if (GET_CODE (operands[1]) == CONST_DOUBLE
       && ! FLOAT_MODE_P (mode)
@@ -8312,10 +8311,8 @@ rs6000_emit_eh_toc_restore (stacksize)
                               bottom_of_stack, stacksize,
                               NULL_RTX, 1, OPTAB_WIDEN);
 
-  emit_move_insn (tocompare, 
-                 GEN_INT (trunc_int_for_mode (TARGET_32BIT 
-                                              ? 0x80410014 
-                                              : 0xE8410028, SImode)));
+  emit_move_insn (tocompare, gen_int_mode (TARGET_32BIT ? 0x80410014 
+                                          : 0xE8410028, SImode));
 
   if (insn_after_throw == NULL_RTX)
     abort ();
index f5e27ee68a38cdc2d143b11c1cc7489edc123b7e..1330361ae72794257fcfa773fa26214212906232 100644 (file)
   else
     operands[2] = gen_lowpart (SImode, operands[0]);
 
-  operands[3] = GEN_INT (trunc_int_for_mode (l, SImode));
+  operands[3] = gen_int_mode (l, SImode);
 }")
 
 (define_insn "*movsf_hardfloat"
 
   operands[2] = operand_subword (operands[0], endian, 0, DFmode);
   operands[3] = operand_subword (operands[0], 1 - endian, 0, DFmode);
-  operands[4] = GEN_INT (trunc_int_for_mode (l[endian], SImode));
-  operands[5] = GEN_INT (trunc_int_for_mode (l[1 - endian], SImode));
+  operands[4] = gen_int_mode (l[endian], SImode);
+  operands[5] = gen_int_mode (l[1 - endian], SImode);
 }")
 
 (define_split
index 937bd2064e050fc3920ae27282bc9da32373ff1b..d54bacab6b95c4ae6eed240ece3b9282e61bc88a 100644 (file)
@@ -355,6 +355,14 @@ gen_rtx_CONST_INT (mode, arg)
   return (rtx) *slot;
 }
 
+rtx
+gen_int_mode (c, mode)
+     HOST_WIDE_INT c;
+     enum machine_mode mode;
+{
+  return GEN_INT (trunc_int_for_mode (c, mode));
+}
+
 /* CONST_DOUBLEs needs special handling because their length is known
    only at run-time.  */
 
index 48a3ef602785e144c835e506baf8572addb5a7c6..d2edd813c964ea35f15119b4fd593ddcbc873185 100644 (file)
@@ -656,7 +656,7 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size)
                value1 = gen_lowpart (maxmode, value1);
            }
          else if (GET_CODE (value) == CONST_INT)
-           value1 = GEN_INT (trunc_int_for_mode (INTVAL (value), maxmode));
+           value1 = gen_int_mode (INTVAL (value), maxmode);
          else if (!CONSTANT_P (value))
            /* Parse phase is supposed to make VALUE's data type
               match that of the component reference, which is a type
@@ -2789,7 +2789,7 @@ expand_mult_highpart (mode, op0, cnst1, target, unsignedp, max_cost)
   if (size > HOST_BITS_PER_WIDE_INT)
     abort ();
 
-  op1 = GEN_INT (trunc_int_for_mode (cnst1, mode));
+  op1 = gen_int_mode (cnst1, mode);
 
   wide_op1
     = immed_double_const (cnst1,
@@ -3273,7 +3273,7 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
                if (rem_flag && d < 0)
                  {
                    d = abs_d;
-                   op1 = GEN_INT (trunc_int_for_mode (abs_d, compute_mode));
+                   op1 = gen_int_mode (abs_d, compute_mode);
                  }
 
                if (d == 1)
@@ -3312,8 +3312,8 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
                        t1 = copy_to_mode_reg (compute_mode, op0);
                        do_cmp_and_jump (t1, const0_rtx, GE,
                                         compute_mode, label);
-                       expand_inc (t1, GEN_INT (trunc_int_for_mode
-                                                (abs_d - 1, compute_mode)));
+                       expand_inc (t1, gen_int_mode (abs_d - 1,
+                                                     compute_mode));
                        emit_label (label);
                        quotient = expand_shift (RSHIFT_EXPR, compute_mode, t1,
                                                 build_int_2 (lgup, 0),
@@ -3853,8 +3853,7 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
            t1 = expand_shift (RSHIFT_EXPR, compute_mode, op0,
                               build_int_2 (pre_shift, 0), NULL_RTX, unsignedp);
            quotient = expand_mult (compute_mode, t1,
-                                   GEN_INT (trunc_int_for_mode
-                                            (ml, compute_mode)),
+                                   gen_int_mode (ml, compute_mode),
                                    NULL_RTX, 0);
 
            insn = get_last_insn ();
index ebe05fc20c9363d8d92600d69bf6659d6d68b792..f8a045a49fd23e26d97e6b0e0ff018b3a07946c8 100644 (file)
@@ -1352,7 +1352,7 @@ convert_modes (mode, oldmode, x, unsignedp)
              && (val & ((HOST_WIDE_INT) 1 << (width - 1))))
            val |= (HOST_WIDE_INT) (-1) << width;
 
-         return GEN_INT (trunc_int_for_mode (val, mode));
+         return gen_int_mode (val, mode);
        }
 
       return gen_lowpart (mode, x);
@@ -5150,8 +5150,7 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode, unsignedp, type,
 
              if (unsignedp)
                return expand_and (tmode, temp,
-                                  GEN_INT (trunc_int_for_mode (width_mask,
-                                                               tmode)),
+                                  gen_int_mode (width_mask, tmode),
                                   NULL_RTX);
 
              count = build_int_2 (GET_MODE_BITSIZE (tmode) - bitsize, 0);
index 94927b9b2fe66982a88c47bf3cdb350aea4eb846..2abf67359c47fcd86d9a56f622a95ab391603eb0 100644 (file)
@@ -4560,9 +4560,9 @@ expand_fix (to, from, unsignedp)
                                 NULL_RTX, 0, OPTAB_LIB_WIDEN);
          expand_fix (to, target, 0);
          target = expand_binop (GET_MODE (to), xor_optab, to,
-                                GEN_INT (trunc_int_for_mode
-                                         ((HOST_WIDE_INT) 1 << (bitsize - 1),
-                                          GET_MODE (to))),
+                                gen_int_mode
+                                ((HOST_WIDE_INT) 1 << (bitsize - 1),
+                                 GET_MODE (to)),
                                 to, 1, OPTAB_LIB_WIDEN);
 
          if (target != to)
index e8f819c9dd77e8eb9f776e2876a88e5cc5669f90..711f53b4d9ef3ba722cb8e4a49b979fff95c554d 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1246,6 +1246,8 @@ extern rtx gen_rtx                        PARAMS ((enum rtx_code,
 extern rtvec gen_rtvec                 PARAMS ((int, ...));
 extern rtx copy_insn_1                 PARAMS ((rtx));
 extern rtx copy_insn                   PARAMS ((rtx));
+extern rtx gen_int_mode                        PARAMS ((HOST_WIDE_INT,
+                                                enum machine_mode));
 
 /* In rtl.c */
 extern rtx rtx_alloc                   PARAMS ((RTX_CODE));
index 5fba25cf5a9a4181853571769b0588e7bde14a95..21012ce31a3a3d4e6af11ac59d30777d78ec781e 100644 (file)
@@ -114,7 +114,7 @@ neg_const_int (mode, i)
      enum machine_mode mode;
      rtx i;
 {
-  return GEN_INT (trunc_int_for_mode (- INTVAL (i), mode));
+  return gen_int_mode (- INTVAL (i), mode);
 }
 
 \f
@@ -376,7 +376,7 @@ simplify_unary_real (p)
        default:
          abort ();
        }
-      args->result = GEN_INT (trunc_int_for_mode (i, args->mode));
+      args->result = gen_int_mode (i, args->mode);
     }
   else
     {