i386.md: Apply trunc_int_for_mode() to GEN_INT operands that make it to RTL.
authorAlexandre Oliva <aoliva@redhat.com>
Thu, 12 Apr 2001 02:59:43 +0000 (02:59 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Thu, 12 Apr 2001 02:59:43 +0000 (02:59 +0000)
* config/i386/i386.md: Apply trunc_int_for_mode() to GEN_INT
operands that make it to RTL.

From-SVN: r41279

gcc/ChangeLog
gcc/config/i386/i386.md

index 094a788..01f0943 100644 (file)
@@ -1,3 +1,8 @@
+2001-04-11  Alexandre Oliva  <aoliva@redhat.com>
+
+       * config/i386/i386.md: Apply trunc_int_for_mode() to GEN_INT
+       operands that make it to RTL.
+
 2001-04-11  Stan Shebs  <shebs@apple.com>
 
        Add Darwin (Mac OS X kernel) native support.
index d3990ca..a243109 100644 (file)
   mask  = ((HOST_WIDE_INT)1 << (pos + len)) - 1;
   mask &= ~(((HOST_WIDE_INT)1 << pos) - 1);
 
-  operands[3] = gen_rtx_AND (mode, operands[0], GEN_INT (mask));
+  operands[3] = gen_rtx_AND (mode, operands[0],
+                            GEN_INT (trunc_int_for_mode (mask, mode)));
 }")
 
 ;; %%% This used to optimize known byte-wide and operations to memory,
   "TARGET_80387 && reload_completed && !FP_REGNO_P (REGNO (operands[0]))"
   [(parallel [(set (match_dup 0) (xor:SI (match_dup 0) (match_dup 1)))
              (clobber (reg:CC 17))])]
-  "operands[1] = GEN_INT (0x80000000);
+  "operands[1] = GEN_INT (trunc_int_for_mode (0x80000000, SImode));
    operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]));")
 
 (define_split
     size = 10;
   operands[0] = gen_rtx_MEM (QImode, XEXP (operands[0], 0));
   operands[0] = adj_offsettable_operand (operands[0], size - 1);
-  operands[1] = GEN_INT (0x80);
+  operands[1] = GEN_INT (trunc_int_for_mode (0x80, QImode));
 }")
 
 (define_expand "negdf2"
   "TARGET_80387 && reload_completed && !FP_REGNO_P (REGNO (operands[0]))"
   [(parallel [(set (match_dup 3) (xor:SI (match_dup 3) (match_dup 4)))
              (clobber (reg:CC 17))])]
-  "operands[4] = GEN_INT (0x80000000);
+  "operands[4] = GEN_INT (trunc_int_for_mode (0x80000000, SImode));
    split_di (operands+0, 1, operands+2, operands+3);")
 
 (define_expand "negxf2"
   "TARGET_80387 && reload_completed && !FP_REGNO_P (REGNO (operands[0]))"
   [(parallel [(set (match_dup 0) (and:SI (match_dup 0) (match_dup 1)))
              (clobber (reg:CC 17))])]
-  "operands[1] = GEN_INT (~0x80000000);
+  "operands[1] = GEN_INT (trunc_int_for_mode (~0x80000000, SImode));
    operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]));")
 
 (define_split
     size = 10;
   operands[0] = gen_rtx_MEM (QImode, XEXP (operands[0], 0));
   operands[0] = adj_offsettable_operand (operands[0], size - 1);
-  operands[1] = GEN_INT (~0x80);
+  operands[1] = GEN_INT (trunc_int_for_mode (~0x80, QImode));
 }")
 
 (define_expand "absdf2"
   "TARGET_80387 && reload_completed && !FP_REGNO_P (REGNO (operands[0]))"
   [(parallel [(set (match_dup 3) (and:SI (match_dup 3) (match_dup 4)))
              (clobber (reg:CC 17))])]
-  "operands[4] = GEN_INT (~0x80000000);
+  "operands[4] = GEN_INT (trunc_int_for_mode (~0x80000000, SImode));
    split_di (operands+0, 1, operands+2, operands+3);")
 
 (define_expand "absxf2"
   "TARGET_80387 && reload_completed && !FP_REGNO_P (REGNO (operands[0]))"
   [(parallel [(set (match_dup 0) (and:SI (match_dup 0) (match_dup 1)))
              (clobber (reg:CC 17))])]
-  "operands[1] = GEN_INT (~0x8000);
+  "operands[1] = GEN_INT (trunc_int_for_mode (~0x8000, SImode));
    operands[0] = gen_rtx_REG (SImode, true_regnum (operands[0]) + 2);")
 
 (define_insn "*abstf2_if"
   "TARGET_80387 && reload_completed && !FP_REGNO_P (REGNO (operands[0]))"
   [(parallel [(set (match_dup 0) (and:SI (match_dup 0) (match_dup 1)))
              (clobber (reg:CC 17))])]
-  "operands[1] = GEN_INT (~0x8000);
+  "operands[1] = GEN_INT (trunc_int_for_mode (~0x8000, SImode));
    operands[0] = gen_rtx_REG (SImode, true_regnum (operands[0]) + 2);")
 
 (define_insn "*abssf2_1"
   [(set (match_dup 0)
        (mult:DI (match_dup 1)
                 (match_dup 2)))]
-  "operands[2] = GEN_INT (1 << INTVAL (operands[2]));")
+  "operands[2] = GEN_INT (trunc_int_for_mode (1 << INTVAL (operands[2]),
+                                             DImode));")
 
 ;; This pattern can't accept a variable shift count, since shifts by
 ;; zero don't affect the flags.  We assume that shifts by constant
   rtx pat;
   operands[0] = gen_lowpart (SImode, operands[0]);
   operands[1] = gen_lowpart (Pmode, operands[1]);
-  operands[2] = GEN_INT (1 << INTVAL (operands[2]));
+  operands[2] = GEN_INT (trunc_int_for_mode (1 << INTVAL (operands[2]),
+                                            Pmode));
   pat = gen_rtx_MULT (Pmode, operands[1], operands[2]);
   if (Pmode != SImode)
     pat = gen_rtx_SUBREG (SImode, pat, 0);
   "
 {
   operands[1] = gen_lowpart (Pmode, operands[1]);
-  operands[2] = GEN_INT (1 << INTVAL (operands[2]));
+  operands[2] = GEN_INT (trunc_int_for_mode (1 << INTVAL (operands[2]),
+                                            Pmode));
 }")
 
 ;; This pattern can't accept a variable shift count, since shifts by
              (set (match_dup 0)
                   (and:SI (match_dup 1) (match_dup 2)))])]
   "operands[2]
-     = GEN_INT (INTVAL (operands[2]) & GET_MODE_MASK (GET_MODE (operands[0])));
+     = GEN_INT (trunc_int_for_mode (INTVAL (operands[2])
+                                   & GET_MODE_MASK (GET_MODE (operands[0])),
+                                   SImode));
    operands[0] = gen_lowpart (SImode, operands[0]);
    operands[1] = gen_lowpart (SImode, operands[1]);")
 
        (compare:CCNO (and:SI (match_dup 0) (match_dup 1))
                      (const_int 0)))]
   "operands[1]
-     = GEN_INT (INTVAL (operands[1]) & GET_MODE_MASK (GET_MODE (operands[0])));
+     = GEN_INT (trunc_int_for_mode (INTVAL (operands[1])
+                                   & GET_MODE_MASK (GET_MODE (operands[0])),
+                                   SImode));
    operands[0] = gen_lowpart (SImode, operands[0]);")
 
 (define_split