[patch] h8300 port: Replace hard coded register numbers with appropriate macros.
Kazu Hirata
kazu@hxi.com
Sun Feb 17 07:17:00 GMT 2002
Hi,
Attached is a patch to replace hard coded register numbers with
appropriate macros.
Tested on h8300 port. Committed.
Kazu Hirata
2002-02-17 Kazu Hirata <kazu@hxi.com>
* config/h8300/h8300.h (CONDITIONAL_REGISTER_USAGE): Replace a
hard coded register number with an appropriate macro.
(HARD_REGNO_MODE_OK): Likewise.
(ARG_POINTER_REGNUM): Likewise.
(STATIC_CHAIN_REGNUM): Likewise.
(RETURN_ADDRESS_POINTER_REGNUM): Likewise.
* config/h8300/h8300.md (define_constants): Define more
register numbers.
Index: h8300.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.h,v
retrieving revision 1.75
diff -u -r1.75 h8300.h
--- h8300.h 2002/02/14 13:25:30 1.75
+++ h8300.h 2002/02/17 12:10:59
@@ -294,10 +294,10 @@
#define REG_ALLOC_ORDER \
{ 2, 3, 0, 1, 4, 5, 6, 8, 7, 9, 10}
-#define CONDITIONAL_REGISTER_USAGE \
-{ \
- if (!TARGET_MAC) \
- fixed_regs[8] = call_used_regs[8] = 1; \
+#define CONDITIONAL_REGISTER_USAGE \
+{ \
+ if (!TARGET_MAC) \
+ fixed_regs[MAC_REG] = call_used_regs[MAC_REG] = 1; \
}
/* Return number of consecutive hard regs needed starting at reg REGNO
@@ -322,7 +322,7 @@
#define HARD_REGNO_MODE_OK(REGNO, MODE) \
(TARGET_H8300 \
? ((((REGNO) & 1) == 0) || ((MODE) == HImode) || ((MODE) == QImode)) \
- : (REGNO) == 8 ? (MODE) == SImode : 1)
+ : (REGNO) == MAC_REG ? (MODE) == SImode : 1)
/* Value is 1 if it is a good idea to tie two pseudo registers
when one has mode MODE1 and one has mode MODE2.
@@ -355,14 +355,14 @@
#define FRAME_POINTER_REQUIRED 0
/* Base register for access to arguments of the function. */
-#define ARG_POINTER_REGNUM 9
+#define ARG_POINTER_REGNUM AP_REG
/* Register in which static-chain is passed to a function. */
-#define STATIC_CHAIN_REGNUM 3
+#define STATIC_CHAIN_REGNUM SC_REG
/* Fake register that holds the address on the stack of the
current function's return address. */
-#define RETURN_ADDRESS_POINTER_REGNUM 10
+#define RETURN_ADDRESS_POINTER_REGNUM RAP_REG
/* A C expression whose value is RTL representing the value of the return
address for the frame COUNT steps up from the current frame.
Index: h8300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.md,v
retrieving revision 1.75
diff -u -r1.75 h8300.md
--- h8300.md 2002/02/13 12:51:53 1.75
+++ h8300.md 2002/02/17 12:10:59
@@ -51,8 +51,12 @@
;; ----------------------------------------------------------------------
(define_constants
- [(FP_REG 6)
- (SP_REG 7)])
+ [(SC_REG 3)
+ (FP_REG 6)
+ (SP_REG 7)
+ (MAC_REG 8)
+ (AP_REG 9)
+ (RAP_REG 10)])
;; ----------------------------------------------------------------------
;; ATTRIBUTES
More information about the Gcc-patches
mailing list