diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-09-06 16:48:48 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-09-06 16:48:48 +0000 |
commit | f643a7d5eab84f0bed2429b3770e336a42680381 (patch) | |
tree | 6e79bd04e722e4cfd11cde76207d760d72c13d78 /gcc/config/h8300/h8300.h | |
parent | da7f51a31ca5f563c656b65b4c81ab74520852a4 (diff) | |
download | gcc-f643a7d5eab84f0bed2429b3770e336a42680381.tar.gz |
Thu Sep 6 11:16:35 2001 Jeffrey A Law (law@cygnus.com)
Joern Rennecke (amylaar@cygnus.com)
* h8300-protos.h (h8300_return_addr_rtx): New prototype.
* h8300.c (initial_offset): Handle offset between RP and FP.
(h8300_return_addr_rtx): New function.
* h8300.h (FIRST_PSEUDO_REGISTER): Bump now that we have a
return register.
(FIXED_REGISTERS, CALL_USED_REGISTERS): Corresponding changes.
(REG_ALLOC_ORDER, RETURN_ADDRESS_POINTER_REGNUM): Likewise.
(REG_CLASS_CONTENTS, ELIMINABLE_REGS): Likewise.
(CAN_ELIMINATE, REGISTER_NAMES):
(RETURN_ADDR_RTX): Call h8300_return_addr_rtx.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45441 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/h8300/h8300.h')
-rw-r--r-- | gcc/config/h8300/h8300.h | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index 6ec826e0960..b14469fa914 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -270,13 +270,13 @@ extern int target_flags; eliminated during reloading in favor of either the stack or frame pointer. */ -#define FIRST_PSEUDO_REGISTER 10 +#define FIRST_PSEUDO_REGISTER 11 /* 1 for registers that have pervasive standard uses and are not available for the register allocator. */ #define FIXED_REGISTERS \ - { 0, 0, 0, 0, 0, 0, 0, 1, 0, 1} + { 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1} /* 1 for registers not available across function calls. These must include the FIXED_REGISTERS and also any @@ -289,10 +289,10 @@ extern int target_flags; H8 destroys r0,r1,r2,r3. */ #define CALL_USED_REGISTERS \ - { 1, 1, 1, 1, 0, 0, 0, 1, 1, 1 } + { 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1 } #define REG_ALLOC_ORDER \ - { 2, 3, 0, 1, 4, 5, 6, 8, 7, 9} + { 2, 3, 0, 1, 4, 5, 6, 8, 7, 9, 10} #define CONDITIONAL_REGISTER_USAGE \ { \ @@ -359,6 +359,16 @@ extern int target_flags; /* Register in which static-chain is passed to a function. */ #define STATIC_CHAIN_REGNUM 3 + +/* Fake register that holds the address on the stack of the + current function's return address. */ +#define RETURN_ADDRESS_POINTER_REGNUM 10 + +/* A C expression whose value is RTL representing the value of the return + address for the frame COUNT steps up from the current frame. + FRAMEADDR is already the frame pointer of the COUNT frame, assuming + a stack layout with the frame pointer as the first saved register. */ +#define RETURN_ADDR_RTX(COUNT, FRAME) h8300_return_addr_rtx ((COUNT), (FRAME)) /* Define the classes of registers for register constraints in the machine description. Also define ranges of constants. @@ -397,9 +407,9 @@ enum reg_class { #define REG_CLASS_CONTENTS \ { {0}, /* No regs */ \ - {0x2ff}, /* GENERAL_REGS */ \ + {0x6ff}, /* GENERAL_REGS */ \ {0x100}, /* MAC_REGS */ \ - {0x3ff}, /* ALL_REGS */ \ + {0x7ff}, /* ALL_REGS */ \ } /* The same information, inverted: @@ -555,21 +565,24 @@ enum reg_class { pointer register. Secondly, the argument pointer register can always be eliminated; it is replaced with either the stack or frame pointer. */ -#define ELIMINABLE_REGS \ -{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ - { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ +#define ELIMINABLE_REGS \ +{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ + { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ + { RETURN_ADDRESS_POINTER_REGNUM, STACK_POINTER_REGNUM},\ + { RETURN_ADDRESS_POINTER_REGNUM, FRAME_POINTER_REGNUM},\ { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}} /* Given FROM and TO register numbers, say whether this elimination is allowed. Frame pointer elimination is automatically handled. For the h8300, if frame pointer elimination is being done, we would like to - convert ap into sp, not fp. + convert ap and rp into sp, not fp. All other eliminations are valid. */ #define CAN_ELIMINATE(FROM, TO) \ - ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \ + ((((FROM) == ARG_POINTER_REGNUM || (FROM) == RETURN_ADDRESS_POINTER_REGNUM) \ + && (TO) == STACK_POINTER_REGNUM) \ ? ! frame_pointer_needed \ : 1) @@ -1176,7 +1189,7 @@ readonly_data () \ This sequence is indexed by compiler's hard-register-number (see above). */ #define REGISTER_NAMES \ -{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "sp", "mac", "ap" } +{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "sp", "mac", "ap", "rap" } #define ADDITIONAL_REGISTER_NAMES \ { {"er0", 0}, {"er1", 1}, {"er2", 2}, {"er3", 3}, {"er4", 4}, \ |