aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Endo <olegendo@gcc.gnu.org>2012-04-06 12:33:24 +0000
committerOleg Endo <olegendo@gcc.gnu.org>2012-04-06 12:33:24 +0000
commitbdb7ddcc320793e5ea4737ebf0df156bdc5a8e87 (patch)
treec1cad32437613846865f9644c70f86798c929816
parent10c17a58ae6ae5dbcd83f1ecc92db7d5001811cb (diff)
downloadgcc-bdb7ddcc320793e5ea4737ebf0df156bdc5a8e87.zip
gcc-bdb7ddcc320793e5ea4737ebf0df156bdc5a8e87.tar.gz
gcc-bdb7ddcc320793e5ea4737ebf0df156bdc5a8e87.tar.bz2
sh.c (hi_const): Remove.
* config/sh/sh.c (hi_const): Remove. (find_barrier, sh_reorg): Use satisfies_constraint_I16 instead of hi_const. From-SVN: r186185
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/sh/sh.c17
2 files changed, 9 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ea39b2f..19bd0f6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2012-04-06 Oleg Endo <olegendo@gcc.gnu.org>
+ * config/sh/sh.c (hi_const): Remove.
+ (find_barrier, sh_reorg): Use satisfies_constraint_I16 instead
+ of hi_const.
+
+2012-04-06 Oleg Endo <olegendo@gcc.gnu.org>
+
* config/sh/sh-protos.h (sh_expand_t_scc): Change return type from int
to bool.
* config/sh/sh.c (sh_expand_t_scc): Likewise.
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 0a6f71d..6088d3d 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -174,7 +174,6 @@ static void force_into (rtx, rtx);
static void print_slot (rtx);
static rtx add_constant (rtx, enum machine_mode, rtx);
static void dump_table (rtx, rtx);
-static int hi_const (rtx);
static bool broken_move (rtx);
static bool mova_p (rtx);
static rtx find_barrier (int, rtx, rtx);
@@ -4377,17 +4376,6 @@ dump_table (rtx start, rtx barrier)
pool_window_last = 0;
}
-/* Return nonzero if constant would be an ok source for a
- mov.w instead of a mov.l. */
-
-static int
-hi_const (rtx src)
-{
- return (CONST_INT_P (src)
- && INTVAL (src) >= -32768
- && INTVAL (src) <= 32767);
-}
-
#define MOVA_LABELREF(mova) XVECEXP (SET_SRC (PATTERN (mova)), 0, 0)
/* Nonzero if the insn is a move instruction which needs to be fixed. */
@@ -4667,7 +4655,8 @@ find_barrier (int num_mova, rtx mova, rtx from)
front end will generate code to load unsigned constants into
HImode targets without properly sign extending them. */
if (mode == HImode
- || (mode == SImode && hi_const (src) && REGNO (dst) != FPUL_REG))
+ || (mode == SImode && satisfies_constraint_I16 (src)
+ && REGNO (dst) != FPUL_REG))
{
found_hi += 2;
/* We put the short constants before the long constants, so
@@ -5810,7 +5799,7 @@ sh_reorg (void)
dst = SET_DEST (pat);
mode = GET_MODE (dst);
- if (mode == SImode && hi_const (src)
+ if (mode == SImode && satisfies_constraint_I16 (src)
&& REGNO (dst) != FPUL_REG)
{
int offset = 0;