mn10300.h (FIRST_DATA_REGNUM, [...]): New macros.

* config/mn10300/mn10300.h (FIRST_DATA_REGNUM,
LAST_DATA_REGNUM, FIRST_ADDRESS_REGNUM, LAST_ADDRESS_REGNUM,
FIRST_EXTENDED_REGNUM, LAST_EXTENDED_REGNUM): New macros.
(REGNO_SP_P): Redefine in terms of STACK_POINTER_REGNUM.
(REGNO_DATA_P, REGNO_ADDRESS_P, REGNO_EXTENDED_P,
REGNO_AM33_P): Redefine in terms of the new macros.
(CONDITIONAL_REGISTER_USAGE, REGNO_REG_CLASS): Likewise.
(FUNCTION_VALUE, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
STRUCT_VALUE): Likewise.
(STACK_POINTER_REGNUM, FRAME_POINTER_REGNUM,
ARG_POINTER_REGNUM, STATIC_CHAIN_REGNUM): Likewise.  Moved.

From-SVN: r33534
This commit is contained in:
Alexandre Oliva 2000-04-29 15:28:42 +00:00 committed by Alexandre Oliva
parent 3b94497c20
commit a47944e2be
2 changed files with 59 additions and 30 deletions

View File

@ -1,3 +1,17 @@
Sat Apr 29 12:25:17 2000 Alexandre Oliva <aoliva@cygnus.com>
* config/mn10300/mn10300.h (FIRST_DATA_REGNUM,
LAST_DATA_REGNUM, FIRST_ADDRESS_REGNUM, LAST_ADDRESS_REGNUM,
FIRST_EXTENDED_REGNUM, LAST_EXTENDED_REGNUM): New macros.
(REGNO_SP_P): Redefine in terms of STACK_POINTER_REGNUM.
(REGNO_DATA_P, REGNO_ADDRESS_P, REGNO_EXTENDED_P,
REGNO_AM33_P): Redefine in terms of the new macros.
(CONDITIONAL_REGISTER_USAGE, REGNO_REG_CLASS): Likewise.
(FUNCTION_VALUE, LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P,
STRUCT_VALUE): Likewise.
(STACK_POINTER_REGNUM, FRAME_POINTER_REGNUM,
ARG_POINTER_REGNUM, STATIC_CHAIN_REGNUM): Likewise. Moved.
Sat Apr 29 01:18:45 MET DST 2000 Jan Hubicka <jh@suse.cz>
* regmove.c (struct record_stack_memrefs_data): New.

View File

@ -145,6 +145,31 @@ extern int target_flags;
#define FIRST_PSEUDO_REGISTER 18
/* Specify machine-specific register numbers. */
#define FIRST_DATA_REGNUM 0
#define LAST_DATA_REGNUM 3
#define FIRST_ADDRESS_REGNUM 4
#define LAST_ADDRESS_REGNUM 8
#define FIRST_EXTENDED_REGNUM 10
#define LAST_EXTENDED_REGNUM 17
/* Specify the registers used for certain standard purposes.
The values of these macros are register numbers. */
/* Register to use for pushing function arguments. */
#define STACK_POINTER_REGNUM (LAST_ADDRESS_REGNUM+1)
/* Base register for access to local variables of the function. */
#define FRAME_POINTER_REGNUM (LAST_ADDRESS_REGNUM-1)
/* Base register for access to arguments of the function. This
is a fake register and will be eliminated into either the frame
pointer or stack pointer. */
#define ARG_POINTER_REGNUM LAST_ADDRESS_REGNUM
/* Register in which static-chain is passed to a function. */
#define STATIC_CHAIN_REGNUM (FIRST_ADDRESS_REGNUM+1)
/* 1 for registers that have pervasive standard uses
and are not available for the register allocator. */
@ -169,7 +194,8 @@ extern int target_flags;
{ \
if (!TARGET_AM33) \
{ \
for (i = 10; i < 18; i++) \
for (i = FIRST_EXTENDED_REGNUM; \
i <= LAST_EXTENDED_REGNUM; i++) \
fixed_regs[i] = call_used_regs[i] = 1; \
} \
}
@ -272,10 +298,10 @@ enum reg_class {
or could index an array. */
#define REGNO_REG_CLASS(REGNO) \
((REGNO) < 4 ? DATA_REGS : \
(REGNO) < 9 ? ADDRESS_REGS : \
(REGNO) == 9 ? SP_REGS : \
(REGNO) < 18 ? EXTENDED_REGS : \
((REGNO) <= LAST_DATA_REGNUM ? DATA_REGS : \
(REGNO) <= LAST_ADDRESS_REGNUM ? ADDRESS_REGS : \
(REGNO) == STACK_POINTER_REGNUM ? SP_REGS : \
(REGNO) <= LAST_EXTENDED_REGNUM ? EXTENDED_REGS : \
NO_REGS)
/* The class value for index registers, and the one for base regs. */
@ -323,10 +349,14 @@ enum reg_class {
&& reg_renumber[(regno)] >= (min) && reg_renumber[(regno)] <= (max)))
#endif
#define REGNO_DATA_P(regno) REGNO_IN_RANGE_P ((regno), 0, 3)
#define REGNO_ADDRESS_P(regno) REGNO_IN_RANGE_P ((regno), 4, 8)
#define REGNO_SP_P(regno) REGNO_IN_RANGE_P ((regno), 9, 9)
#define REGNO_EXTENDED_P(regno) REGNO_IN_RANGE_P ((regno), 10, 17)
#define REGNO_DATA_P(regno) \
REGNO_IN_RANGE_P ((regno), FIRST_DATA_REGNUM, LAST_DATA_REGNUM)
#define REGNO_ADDRESS_P(regno) \
REGNO_IN_RANGE_P ((regno), FIRST_ADDRESS_REGNUM, LAST_ADDRESS_REGNUM)
#define REGNO_SP_P(regno) \
REGNO_IN_RANGE_P ((regno), STACK_POINTER_REGNUM, STACK_POINTER_REGNUM)
#define REGNO_EXTENDED_P(regno) \
REGNO_IN_RANGE_P ((regno), FIRST_EXTENDED_REGNUM, LAST_EXTENDED_REGNUM)
#define REGNO_AM33_P(regno) \
(REGNO_DATA_P ((regno)) || REGNO_ADDRESS_P ((regno)) \
|| REGNO_EXTENDED_P ((regno)))
@ -431,23 +461,6 @@ enum reg_class {
#define FIRST_PARM_OFFSET(FNDECL) 4
/* Specify the registers used for certain standard purposes.
The values of these macros are register numbers. */
/* Register to use for pushing function arguments. */
#define STACK_POINTER_REGNUM 9
/* Base register for access to local variables of the function. */
#define FRAME_POINTER_REGNUM 7
/* Base register for access to arguments of the function. This
is a fake register and will be eliminated into either the frame
pointer or stack pointer. */
#define ARG_POINTER_REGNUM 8
/* Register in which static-chain is passed to a function. */
#define STATIC_CHAIN_REGNUM 5
#define ELIMINABLE_REGS \
{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
{ ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
@ -554,16 +567,18 @@ struct cum_arg {int nbytes; };
otherwise, FUNC is 0. */
#define FUNCTION_VALUE(VALTYPE, FUNC) \
gen_rtx_REG (TYPE_MODE (VALTYPE), POINTER_TYPE_P (VALTYPE) ? 4 : 0)
gen_rtx_REG (TYPE_MODE (VALTYPE), POINTER_TYPE_P (VALTYPE) \
? FIRST_ADDRESS_REGNUM : FIRST_DATA_REGNUM)
/* Define how to find the value returned by a library function
assuming the value has mode MODE. */
#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0)
#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, FIRST_DATA_REGNUM)
/* 1 if N is a possible register number for a function value. */
#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0 || (N) == 4)
#define FUNCTION_VALUE_REGNO_P(N) \
((N) == FIRST_DATA_REGNUM || (N) == FIRST_ADDRESS_REGNUM)
/* Return values > 8 bytes in length in memory. */
#define DEFAULT_PCC_STRUCT_RETURN 0
@ -574,7 +589,7 @@ struct cum_arg {int nbytes; };
is passed to a function. On the MN10300 it's passed as
the first parameter. */
#define STRUCT_VALUE 0
#define STRUCT_VALUE FIRST_DATA_REGNUM
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
the stack pointer does not matter. The value is tested only in