rs6000-protos.h (rs6000_find_base_term): Declare.
gcc/ * config/rs6000/rs6000-protos.h (rs6000_find_base_term): Declare. * config/rs6000/rs6000.h (FIND_BASE_TERM): New macro. * config/rs6000/rs6000.c (rs6000_find_base_term): New function. From-SVN: r140912
This commit is contained in:
parent
08a6a74b91
commit
944258ebc6
4 changed files with 30 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2008-10-06 Richard Sandiford <rdsandiford@googlemail.com>
|
||||
|
||||
* config/rs6000/rs6000-protos.h (rs6000_find_base_term): Declare.
|
||||
* config/rs6000/rs6000.h (FIND_BASE_TERM): New macro.
|
||||
* config/rs6000/rs6000.c (rs6000_find_base_term): New function.
|
||||
|
||||
2008-10-06 Richard Sandiford <rdsandiford@googlemail.com>
|
||||
|
||||
* config/darwin-protos.h (machopic_function_base_name): Delete.
|
||||
|
|
|
@ -112,6 +112,7 @@ extern rtx rs6000_legitimize_reload_address (rtx, enum machine_mode,
|
|||
extern int rs6000_legitimate_address (enum machine_mode, rtx, int);
|
||||
extern bool rs6000_legitimate_offset_address_p (enum machine_mode, rtx, int);
|
||||
extern bool rs6000_mode_dependent_address (rtx);
|
||||
extern rtx rs6000_find_base_term (rtx);
|
||||
extern bool rs6000_offsettable_memref_p (rtx);
|
||||
extern rtx rs6000_return_addr (int, rtx);
|
||||
extern void rs6000_output_symbol_ref (FILE*, rtx);
|
||||
|
|
|
@ -4455,6 +4455,27 @@ rs6000_mode_dependent_address (rtx addr)
|
|||
return false;
|
||||
}
|
||||
|
||||
/* Implement FIND_BASE_TERM. */
|
||||
|
||||
rtx
|
||||
rs6000_find_base_term (rtx op)
|
||||
{
|
||||
rtx base, offset;
|
||||
|
||||
split_const (op, &base, &offset);
|
||||
if (GET_CODE (base) == UNSPEC)
|
||||
switch (XINT (base, 1))
|
||||
{
|
||||
case UNSPEC_TOCREL:
|
||||
case UNSPEC_MACHOPIC_OFFSET:
|
||||
/* OP represents SYM [+ OFFSET] - ANCHOR. SYM is the base term
|
||||
for aliasing purposes. */
|
||||
return XVECEXP (base, 0, 0);
|
||||
}
|
||||
|
||||
return op;
|
||||
}
|
||||
|
||||
/* More elaborate version of recog's offsettable_memref_p predicate
|
||||
that works around the ??? note of rs6000_mode_dependent_address.
|
||||
In particular it accepts
|
||||
|
|
|
@ -1856,6 +1856,8 @@ do { \
|
|||
if (rs6000_mode_dependent_address (ADDR)) \
|
||||
goto LABEL; \
|
||||
} while (0)
|
||||
|
||||
#define FIND_BASE_TERM rs6000_find_base_term
|
||||
|
||||
/* The register number of the register used to address a table of
|
||||
static data addresses in memory. In some cases this register is
|
||||
|
|
Loading…
Add table
Reference in a new issue