mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-10 18:20:51 +08:00
jump.c (rtx_renumbered_equal_p): Use subreg_get_info.
2009-03-27 H.J. Lu <hongjiu.lu@intel.com> * jump.c (rtx_renumbered_equal_p): Use subreg_get_info. (true_regnum): Likewise. * rtlanal.c (subreg_info): Moved to ... * rtl.h (subreg_info): Here. New. (subreg_get_info): New. * rtlanal.c (subreg_get_info): Make it extern. From-SVN: r145134
This commit is contained in:
parent
51212b321b
commit
c619e9823e
@ -1,3 +1,14 @@
|
||||
2009-03-27 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* jump.c (rtx_renumbered_equal_p): Use subreg_get_info.
|
||||
(true_regnum): Likewise.
|
||||
|
||||
* rtlanal.c (subreg_info): Moved to ...
|
||||
* rtl.h (subreg_info): Here. New.
|
||||
(subreg_get_info): New.
|
||||
|
||||
* rtlanal.c (subreg_get_info): Make it extern.
|
||||
|
||||
2009-03-27 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR target/39472
|
||||
|
45
gcc/jump.c
45
gcc/jump.c
@ -1536,6 +1536,7 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
|
||||
{
|
||||
int reg_x = -1, reg_y = -1;
|
||||
int byte_x = 0, byte_y = 0;
|
||||
struct subreg_info info;
|
||||
|
||||
if (GET_MODE (x) != GET_MODE (y))
|
||||
return 0;
|
||||
@ -1552,15 +1553,12 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
|
||||
|
||||
if (reg_renumber[reg_x] >= 0)
|
||||
{
|
||||
if (!subreg_offset_representable_p (reg_renumber[reg_x],
|
||||
GET_MODE (SUBREG_REG (x)),
|
||||
byte_x,
|
||||
GET_MODE (x)))
|
||||
subreg_get_info (reg_renumber[reg_x],
|
||||
GET_MODE (SUBREG_REG (x)), byte_x,
|
||||
GET_MODE (x), &info);
|
||||
if (!info.representable_p)
|
||||
return 0;
|
||||
reg_x = subreg_regno_offset (reg_renumber[reg_x],
|
||||
GET_MODE (SUBREG_REG (x)),
|
||||
byte_x,
|
||||
GET_MODE (x));
|
||||
reg_x = info.offset;
|
||||
byte_x = 0;
|
||||
}
|
||||
}
|
||||
@ -1578,15 +1576,12 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
|
||||
|
||||
if (reg_renumber[reg_y] >= 0)
|
||||
{
|
||||
if (!subreg_offset_representable_p (reg_renumber[reg_y],
|
||||
GET_MODE (SUBREG_REG (y)),
|
||||
byte_y,
|
||||
GET_MODE (y)))
|
||||
subreg_get_info (reg_renumber[reg_y],
|
||||
GET_MODE (SUBREG_REG (y)), byte_y,
|
||||
GET_MODE (y), &info);
|
||||
if (!info.representable_p)
|
||||
return 0;
|
||||
reg_y = subreg_regno_offset (reg_renumber[reg_y],
|
||||
GET_MODE (SUBREG_REG (y)),
|
||||
byte_y,
|
||||
GET_MODE (y));
|
||||
reg_y = info.offset;
|
||||
byte_y = 0;
|
||||
}
|
||||
}
|
||||
@ -1728,13 +1723,17 @@ true_regnum (const_rtx x)
|
||||
{
|
||||
int base = true_regnum (SUBREG_REG (x));
|
||||
if (base >= 0
|
||||
&& base < FIRST_PSEUDO_REGISTER
|
||||
&& subreg_offset_representable_p (REGNO (SUBREG_REG (x)),
|
||||
GET_MODE (SUBREG_REG (x)),
|
||||
SUBREG_BYTE (x), GET_MODE (x)))
|
||||
return base + subreg_regno_offset (REGNO (SUBREG_REG (x)),
|
||||
GET_MODE (SUBREG_REG (x)),
|
||||
SUBREG_BYTE (x), GET_MODE (x));
|
||||
&& base < FIRST_PSEUDO_REGISTER)
|
||||
{
|
||||
struct subreg_info info;
|
||||
|
||||
subreg_get_info (REGNO (SUBREG_REG (x)),
|
||||
GET_MODE (SUBREG_REG (x)),
|
||||
SUBREG_BYTE (x), GET_MODE (x), &info);
|
||||
|
||||
if (info.representable_p)
|
||||
return base + info.offset;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
16
gcc/rtl.h
16
gcc/rtl.h
@ -1806,6 +1806,22 @@ extern rtx canonicalize_condition (rtx, rtx, int, rtx *, rtx, int, int);
|
||||
being made. */
|
||||
extern rtx get_condition (rtx, rtx *, int, int);
|
||||
|
||||
/* Information about a subreg of a hard register. */
|
||||
struct subreg_info
|
||||
{
|
||||
/* Offset of first hard register involved in the subreg. */
|
||||
int offset;
|
||||
/* Number of hard registers involved in the subreg. */
|
||||
int nregs;
|
||||
/* Whether this subreg can be represented as a hard reg with the new
|
||||
mode. */
|
||||
bool representable_p;
|
||||
};
|
||||
|
||||
extern void subreg_get_info (unsigned int, enum machine_mode,
|
||||
unsigned int, enum machine_mode,
|
||||
struct subreg_info *);
|
||||
|
||||
/* lists.c */
|
||||
|
||||
extern void free_EXPR_LIST_list (rtx *);
|
||||
|
@ -39,18 +39,6 @@ along with GCC; see the file COPYING3. If not see
|
||||
#include "df.h"
|
||||
#include "tree.h"
|
||||
|
||||
/* Information about a subreg of a hard register. */
|
||||
struct subreg_info
|
||||
{
|
||||
/* Offset of first hard register involved in the subreg. */
|
||||
int offset;
|
||||
/* Number of hard registers involved in the subreg. */
|
||||
int nregs;
|
||||
/* Whether this subreg can be represented as a hard reg with the new
|
||||
mode. */
|
||||
bool representable_p;
|
||||
};
|
||||
|
||||
/* Forward declarations */
|
||||
static void set_of_1 (rtx, const_rtx, void *);
|
||||
static bool covers_regno_p (const_rtx, unsigned int);
|
||||
@ -58,9 +46,6 @@ static bool covers_regno_no_parallel_p (const_rtx, unsigned int);
|
||||
static int rtx_referenced_p_1 (rtx *, void *);
|
||||
static int computed_jump_p_1 (const_rtx);
|
||||
static void parms_set (rtx, const_rtx, void *);
|
||||
static void subreg_get_info (unsigned int, enum machine_mode,
|
||||
unsigned int, enum machine_mode,
|
||||
struct subreg_info *);
|
||||
|
||||
static unsigned HOST_WIDE_INT cached_nonzero_bits (const_rtx, enum machine_mode,
|
||||
const_rtx, enum machine_mode,
|
||||
@ -3090,7 +3075,7 @@ subreg_lsb (const_rtx x)
|
||||
offset - The byte offset.
|
||||
ymode - The mode of a top level SUBREG (or what may become one).
|
||||
info - Pointer to structure to fill in. */
|
||||
static void
|
||||
void
|
||||
subreg_get_info (unsigned int xregno, enum machine_mode xmode,
|
||||
unsigned int offset, enum machine_mode ymode,
|
||||
struct subreg_info *info)
|
||||
|
Loading…
x
Reference in New Issue
Block a user