Commit c619e982 by H.J. Lu Committed by H.J. Lu

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
parent 51212b32
2009-03-27 H.J. Lu <hongjiu.lu@intel.com> 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 PR target/39472
* config/i386/i386.c (ix86_abi): New. * config/i386/i386.c (ix86_abi): New.
(override_options): Handle -mabi=. (override_options): Handle -mabi=.
......
...@@ -1536,6 +1536,7 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y) ...@@ -1536,6 +1536,7 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
{ {
int reg_x = -1, reg_y = -1; int reg_x = -1, reg_y = -1;
int byte_x = 0, byte_y = 0; int byte_x = 0, byte_y = 0;
struct subreg_info info;
if (GET_MODE (x) != GET_MODE (y)) if (GET_MODE (x) != GET_MODE (y))
return 0; return 0;
...@@ -1552,15 +1553,12 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y) ...@@ -1552,15 +1553,12 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
if (reg_renumber[reg_x] >= 0) if (reg_renumber[reg_x] >= 0)
{ {
if (!subreg_offset_representable_p (reg_renumber[reg_x], subreg_get_info (reg_renumber[reg_x],
GET_MODE (SUBREG_REG (x)), GET_MODE (SUBREG_REG (x)), byte_x,
byte_x, GET_MODE (x), &info);
GET_MODE (x))) if (!info.representable_p)
return 0; return 0;
reg_x = subreg_regno_offset (reg_renumber[reg_x], reg_x = info.offset;
GET_MODE (SUBREG_REG (x)),
byte_x,
GET_MODE (x));
byte_x = 0; byte_x = 0;
} }
} }
...@@ -1578,15 +1576,12 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y) ...@@ -1578,15 +1576,12 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
if (reg_renumber[reg_y] >= 0) if (reg_renumber[reg_y] >= 0)
{ {
if (!subreg_offset_representable_p (reg_renumber[reg_y], subreg_get_info (reg_renumber[reg_y],
GET_MODE (SUBREG_REG (y)), GET_MODE (SUBREG_REG (y)), byte_y,
byte_y, GET_MODE (y), &info);
GET_MODE (y))) if (!info.representable_p)
return 0; return 0;
reg_y = subreg_regno_offset (reg_renumber[reg_y], reg_y = info.offset;
GET_MODE (SUBREG_REG (y)),
byte_y,
GET_MODE (y));
byte_y = 0; byte_y = 0;
} }
} }
...@@ -1728,13 +1723,17 @@ true_regnum (const_rtx x) ...@@ -1728,13 +1723,17 @@ true_regnum (const_rtx x)
{ {
int base = true_regnum (SUBREG_REG (x)); int base = true_regnum (SUBREG_REG (x));
if (base >= 0 if (base >= 0
&& base < FIRST_PSEUDO_REGISTER && base < FIRST_PSEUDO_REGISTER)
&& subreg_offset_representable_p (REGNO (SUBREG_REG (x)), {
GET_MODE (SUBREG_REG (x)), struct subreg_info info;
SUBREG_BYTE (x), GET_MODE (x)))
return base + subreg_regno_offset (REGNO (SUBREG_REG (x)), subreg_get_info (REGNO (SUBREG_REG (x)),
GET_MODE (SUBREG_REG (x)), GET_MODE (SUBREG_REG (x)),
SUBREG_BYTE (x), GET_MODE (x)); SUBREG_BYTE (x), GET_MODE (x), &info);
if (info.representable_p)
return base + info.offset;
}
} }
return -1; return -1;
} }
......
...@@ -1806,6 +1806,22 @@ extern rtx canonicalize_condition (rtx, rtx, int, rtx *, rtx, int, int); ...@@ -1806,6 +1806,22 @@ extern rtx canonicalize_condition (rtx, rtx, int, rtx *, rtx, int, int);
being made. */ being made. */
extern rtx get_condition (rtx, rtx *, int, int); 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 */ /* lists.c */
extern void free_EXPR_LIST_list (rtx *); extern void free_EXPR_LIST_list (rtx *);
......
...@@ -39,18 +39,6 @@ along with GCC; see the file COPYING3. If not see ...@@ -39,18 +39,6 @@ along with GCC; see the file COPYING3. If not see
#include "df.h" #include "df.h"
#include "tree.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 */ /* Forward declarations */
static void set_of_1 (rtx, const_rtx, void *); static void set_of_1 (rtx, const_rtx, void *);
static bool covers_regno_p (const_rtx, unsigned int); static bool covers_regno_p (const_rtx, unsigned int);
...@@ -58,9 +46,6 @@ static bool covers_regno_no_parallel_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 rtx_referenced_p_1 (rtx *, void *);
static int computed_jump_p_1 (const_rtx); static int computed_jump_p_1 (const_rtx);
static void parms_set (rtx, const_rtx, void *); 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, static unsigned HOST_WIDE_INT cached_nonzero_bits (const_rtx, enum machine_mode,
const_rtx, enum machine_mode, const_rtx, enum machine_mode,
...@@ -3090,7 +3075,7 @@ subreg_lsb (const_rtx x) ...@@ -3090,7 +3075,7 @@ subreg_lsb (const_rtx x)
offset - The byte offset. offset - The byte offset.
ymode - The mode of a top level SUBREG (or what may become one). ymode - The mode of a top level SUBREG (or what may become one).
info - Pointer to structure to fill in. */ info - Pointer to structure to fill in. */
static void void
subreg_get_info (unsigned int xregno, enum machine_mode xmode, subreg_get_info (unsigned int xregno, enum machine_mode xmode,
unsigned int offset, enum machine_mode ymode, unsigned int offset, enum machine_mode ymode,
struct subreg_info *info) struct subreg_info *info)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment