]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
always define SHORT_IMMEDIATES_SIGN_EXTEND
authorTrevor Saunders <tbsaunde+gcc@tbsaunde.org>
Thu, 9 Jul 2015 02:50:07 +0000 (02:50 +0000)
committerTrevor Saunders <tbsaunde@gcc.gnu.org>
Thu, 9 Jul 2015 02:50:07 +0000 (02:50 +0000)
gcc/ChangeLog:

2015-07-08  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

* combine.c (update_rsp_from_reg_equal): Don't check if
SHORT_IMMEDIATES_SIGN_EXTEND is defined.
(reg_nonzero_bits_for_combine): Likewise.
* config/alpha/alpha.h: Define SHORT_IMMEDIATES_SIGN_EXTEND to
1.
* config/frv/frv.h: Likewise.
* config/lm32/lm32.h: Likewise.
* config/mep/mep.h: Likewise.
* config/mips/mips.h: Likewise.
* config/rs6000/rs6000.h: Likewise.
* config/sh/sh.h: Likewise.
* config/tilegx/tilegx.h (enum reg_class): Likewise.
* config/tilepro/tilepro.h: Likewise.
* defaults.h: Add default for SHORT_IMMEDIATES_SIGN_EXTEND.
* doc/tm.texi: Regenerate.
* doc/tm.texi.in: Adjust.
* rtlanal.c (nonzero_bits1): Likewise.

From-SVN: r225593

15 files changed:
gcc/ChangeLog
gcc/combine.c
gcc/config/alpha/alpha.h
gcc/config/frv/frv.h
gcc/config/lm32/lm32.h
gcc/config/mep/mep.h
gcc/config/mips/mips.h
gcc/config/rs6000/rs6000.h
gcc/config/sh/sh.h
gcc/config/tilegx/tilegx.h
gcc/config/tilepro/tilepro.h
gcc/defaults.h
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/rtlanal.c

index 59afe38ffef94cdb35e26c90da22f8942570c0ac..2275e3b6b7950232d571d50ec4a2fa99f30e04a7 100644 (file)
@@ -1,3 +1,23 @@
+2015-07-08  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
+
+       * combine.c (update_rsp_from_reg_equal): Don't check if
+       SHORT_IMMEDIATES_SIGN_EXTEND is defined.
+       (reg_nonzero_bits_for_combine): Likewise.
+       * config/alpha/alpha.h: Define SHORT_IMMEDIATES_SIGN_EXTEND to
+       1.
+       * config/frv/frv.h: Likewise.
+       * config/lm32/lm32.h: Likewise.
+       * config/mep/mep.h: Likewise.
+       * config/mips/mips.h: Likewise.
+       * config/rs6000/rs6000.h: Likewise.
+       * config/sh/sh.h: Likewise.
+       * config/tilegx/tilegx.h (enum reg_class): Likewise.
+       * config/tilepro/tilepro.h: Likewise.
+       * defaults.h: Add default for SHORT_IMMEDIATES_SIGN_EXTEND.
+       * doc/tm.texi: Regenerate.
+       * doc/tm.texi.in: Adjust.
+       * rtlanal.c (nonzero_bits1): Likewise.
+
 2015-07-08  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
 
        * combine.c (do_SUBST_MODE): Don't check the value of HAVE_cc0
index 19aa0e1e6b5de4f4d8debd7ebb8e9a970186fe9b..14d1468699a0750f07d826c39e205dc6995323c0 100644 (file)
@@ -1624,7 +1624,6 @@ setup_incoming_promotions (rtx_insn *first)
     }
 }
 
-#ifdef SHORT_IMMEDIATES_SIGN_EXTEND
 /* If MODE has a precision lower than PREC and SRC is a non-negative constant
    that would appear negative in MODE, sign-extend SRC for use in nonzero_bits
    because some machines (maybe most) will actually do the sign-extension and
@@ -1644,7 +1643,6 @@ sign_extend_short_imm (rtx src, machine_mode mode, unsigned int prec)
 
   return src;
 }
-#endif
 
 /* Update RSP for pseudo-register X from INSN's REG_EQUAL note (if one exists)
    and SET.  */
@@ -1661,11 +1659,12 @@ update_rsp_from_reg_equal (reg_stat_type *rsp, rtx_insn *insn, const_rtx set,
   if (reg_equal_note)
     reg_equal = XEXP (reg_equal_note, 0);
 
-#ifdef SHORT_IMMEDIATES_SIGN_EXTEND
-  src = sign_extend_short_imm (src, GET_MODE (x), BITS_PER_WORD);
-  if (reg_equal)
-    reg_equal = sign_extend_short_imm (reg_equal, GET_MODE (x), BITS_PER_WORD);
-#endif
+  if (SHORT_IMMEDIATES_SIGN_EXTEND)
+    {
+      src = sign_extend_short_imm (src, GET_MODE (x), BITS_PER_WORD);
+      if (reg_equal)
+       reg_equal = sign_extend_short_imm (reg_equal, GET_MODE (x), BITS_PER_WORD);
+    }
 
   /* Don't call nonzero_bits if it cannot change anything.  */
   if (rsp->nonzero_bits != ~(unsigned HOST_WIDE_INT) 0)
@@ -9824,10 +9823,10 @@ reg_nonzero_bits_for_combine (const_rtx x, machine_mode mode,
 
   if (tem)
     {
-#ifdef SHORT_IMMEDIATES_SIGN_EXTEND
-      tem = sign_extend_short_imm (tem, GET_MODE (x),
-                                  GET_MODE_PRECISION (mode));
-#endif
+      if (SHORT_IMMEDIATES_SIGN_EXTEND)
+       tem = sign_extend_short_imm (tem, GET_MODE (x),
+                                    GET_MODE_PRECISION (mode));
+
       return tem;
     }
   else if (nonzero_sign_valid && rsp->nonzero_bits)
index 8d2ab238157fd2098e0f4d390f261d5a73e6f43c..c39f1031b0a7e05a3fddfc8436b7ff554e7cc4a5 100644 (file)
@@ -897,7 +897,7 @@ do {                                                                             \
 #define LOAD_EXTEND_OP(MODE) ((MODE) == SImode ? SIGN_EXTEND : ZERO_EXTEND)
 
 /* Define if loading short immediate values into registers sign extends.  */
-#define SHORT_IMMEDIATES_SIGN_EXTEND
+#define SHORT_IMMEDIATES_SIGN_EXTEND 1
 
 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
    is done just by pretending it is already truncated.  */
index 2d4cbddeb74e489c5e75a337941bf5b43ddd7835..a96f201b3572da18cd0a390f7026489ae1ccd246 100644 (file)
@@ -1899,7 +1899,7 @@ fprintf (STREAM, "\t.word .L%d\n", VALUE)
 #define LOAD_EXTEND_OP(MODE) SIGN_EXTEND
 
 /* Define if loading short immediate values into registers sign extends.  */
-#define SHORT_IMMEDIATES_SIGN_EXTEND
+#define SHORT_IMMEDIATES_SIGN_EXTEND 1
 
 /* The maximum number of bytes that a single instruction can move quickly from
    memory to memory.  */
index d2847035237cf21d22746c7c6f1b98ae093c84e6..9872860ec62f5695101ee8e1ffac36d2156c1266 100644 (file)
@@ -525,7 +525,7 @@ do {                                                            \
 
 #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
 
-#define SHORT_IMMEDIATES_SIGN_EXTEND
+#define SHORT_IMMEDIATES_SIGN_EXTEND 1
 
 #define MOVE_MAX        UNITS_PER_WORD
 #define MAX_MOVE_MAX    4
index 861189d54200ca387114049e7e4fe446af145162..8fee2735a6363bb8d3a5f0281ef75df1d238fbac 100644 (file)
@@ -765,7 +765,7 @@ typedef struct
 #define WORD_REGISTER_OPERATIONS
 #define LOAD_EXTEND_OP(MODE) SIGN_EXTEND
 
-#define SHORT_IMMEDIATES_SIGN_EXTEND
+#define SHORT_IMMEDIATES_SIGN_EXTEND 1
 
 #define MOVE_MAX 4
 
index 7a6f9171ac7e7fcfb764b4a965959dcee2c0de5f..03bbae1ad5a1a4d77920781eae9b5e346e38a417 100644 (file)
@@ -1626,7 +1626,7 @@ FP_ASM_SPEC "\
 #define POINTERS_EXTEND_UNSIGNED false
 
 /* Define if loading short immediate values into registers sign extends.  */
-#define SHORT_IMMEDIATES_SIGN_EXTEND
+#define SHORT_IMMEDIATES_SIGN_EXTEND 1
 
 /* The [d]clz instructions have the natural values at 0.  */
 
index ef8ff38b96a85663353468d90f6f5c6879bbfc10..3bd2048b82ccead101e1072c91a3736d4b41bf76 100644 (file)
@@ -2046,7 +2046,7 @@ do {                                                                           \
 #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
 
 /* Define if loading short immediate values into registers sign extends.  */
-#define SHORT_IMMEDIATES_SIGN_EXTEND
+#define SHORT_IMMEDIATES_SIGN_EXTEND 1
 \f
 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
    is done just by pretending it is already truncated.  */
index 3078880a69a82c2f0cecb3596a3afc42a5caf7ee..c4947a681790f69f46053a7c62694ea6f308c01f 100644 (file)
@@ -1827,7 +1827,7 @@ struct sh_args {
   : (MODE) != SImode ? SIGN_EXTEND : UNKNOWN)
 
 /* Define if loading short immediate values into registers sign extends.  */
-#define SHORT_IMMEDIATES_SIGN_EXTEND
+#define SHORT_IMMEDIATES_SIGN_EXTEND 1
 
 /* Nonzero if access to memory by bytes is no faster than for words.  */
 #define SLOW_BYTE_ACCESS 1
index 5fa10b39e394e98f1f7b9e87577ce47f62fe49c4..7c3995abecc988fec9357aa7576d46562f21d69e 100644 (file)
@@ -386,7 +386,7 @@ enum reg_class
 
 #define SHIFT_COUNT_TRUNCATED 0
 
-#define SHORT_IMMEDIATES_SIGN_EXTEND
+#define SHORT_IMMEDIATES_SIGN_EXTEND 1
 
 /* We represent all SI values as sign-extended DI values in
    registers.  */
index f2b7b163270fef1eb0fb7f9f045a08b576249f64..970135a1d965674e7bebab0aa316bfc38b2e58b5 100644 (file)
@@ -346,7 +346,7 @@ enum reg_class
 
 #define SHIFT_COUNT_TRUNCATED 1
 
-#define SHORT_IMMEDIATES_SIGN_EXTEND
+#define SHORT_IMMEDIATES_SIGN_EXTEND 1
 
 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
 
index 5beddea669ea5880187edd05ddd921315673a2fb..f0296a3e472882801c658d09623b0c5924965f56 100644 (file)
@@ -1265,6 +1265,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define TARGET_SUPPORTS_WIDE_INT 0
 #endif
 
+#ifndef SHORT_IMMEDIATES_SIGN_EXTEND
+#define SHORT_IMMEDIATES_SIGN_EXTEND 0
+#endif
+
 #ifdef GCC_INSN_FLAGS_H
 /* Dependent default target macro definitions
 
index 3dc51c00b9a35f21b6ceb4317f045cd7e2154ef6..a67b6a1c4f351ad215ebb80389fc43dd761d2acd 100644 (file)
@@ -10410,7 +10410,7 @@ is larger then @var{mem_mode} but still smaller than @code{word_mode}.
 @end defmac
 
 @defmac SHORT_IMMEDIATES_SIGN_EXTEND
-Define this macro if loading short immediate values into registers sign
+Define this macro to 1 if loading short immediate values into registers sign
 extends.
 @end defmac
 
index 93fb41c6879c2b8f87745874cf9a7880ef66b396..59aa589bec9414f4e9f5fa9c7d2588669129d3c7 100644 (file)
@@ -7534,7 +7534,7 @@ is larger then @var{mem_mode} but still smaller than @code{word_mode}.
 @end defmac
 
 @defmac SHORT_IMMEDIATES_SIGN_EXTEND
-Define this macro if loading short immediate values into registers sign
+Define this macro to 1 if loading short immediate values into registers sign
 extends.
 @end defmac
 
index 854d74183de4b6054d3f8c64cc1e13283838bbb0..e910ae7985fb2556fbb105f7a1907d893d05a570 100644 (file)
@@ -4327,14 +4327,12 @@ nonzero_bits1 (const_rtx x, machine_mode mode, const_rtx known_x,
       }
 
     case CONST_INT:
-#ifdef SHORT_IMMEDIATES_SIGN_EXTEND
       /* If X is negative in MODE, sign-extend the value.  */
-      if (INTVAL (x) > 0
+      if (SHORT_IMMEDIATES_SIGN_EXTEND && INTVAL (x) > 0
          && mode_width < BITS_PER_WORD
          && (UINTVAL (x) & ((unsigned HOST_WIDE_INT) 1 << (mode_width - 1)))
             != 0)
        return UINTVAL (x) | (HOST_WIDE_INT_M1U << mode_width);
-#endif
 
       return UINTVAL (x);