aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorCatherine Moore <clm@redhat.com>2001-10-05 20:33:09 +0000
committerCatherine Moore <clm@gcc.gnu.org>2001-10-05 16:33:09 -0400
commitda6e254e4494708c3ab07965c0d13bce0cbcaaf3 (patch)
treede24cc2f4de71f36970bb2f8a818bd54857ec18f /gcc
parent9f1c29317caa8a7433fd893ee86a0efafd8ab249 (diff)
downloadgcc-da6e254e4494708c3ab07965c0d13bce0cbcaaf3.zip
gcc-da6e254e4494708c3ab07965c0d13bce0cbcaaf3.tar.gz
gcc-da6e254e4494708c3ab07965c0d13bce0cbcaaf3.tar.bz2
stormy-abi: Document abi changes.
* config/stormy16/stormy-abi: Document abi changes. * config/stormy16/stormy16.h (REG_ALLOC_ORDER): Redefine. (ICALL_REGS): New register class. (NUM_ARGUMENT_REGISTERS): Now 6. (DEFAULT_PCC_STRUCT_RETURN): Don't try to return structs in registers. (REG_CLASS_FROM_LETTER): Map 'z' to ICALL_REGS. * config/stormy16.md (call_internal, call_value_internal, indirect_jump): Use new 'z' constraint. From-SVN: r46041
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/config/stormy16/stormy-abi18
-rw-r--r--gcc/config/stormy16/stormy16.h10
-rw-r--r--gcc/config/stormy16/stormy16.md6
4 files changed, 31 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b3d96f4..b696f91 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2001-10-05 Catherine Moore <clm@redhat.com>
+
+ * config/stormy16/stormy-abi: Document abi changes.
+ * config/stormy16/stormy16.h (REG_ALLOC_ORDER): Redefine.
+ (ICALL_REGS): New register class.
+ (NUM_ARGUMENT_REGISTERS): Now 6.
+ (DEFAULT_PCC_STRUCT_RETURN): Don't try to return structs
+ in registers.
+ (REG_CLASS_FROM_LETTER): Map 'z' to ICALL_REGS.
+ * config/stormy16.md (call_internal, call_value_internal,
+ indirect_jump): Use new 'z' constraint.
+
2001-10-05 Neil Booth <neil@daikokuya.demon.co.uk>
* doc/cppinternals.texi: Update.
diff --git a/gcc/config/stormy16/stormy-abi b/gcc/config/stormy16/stormy-abi
index 78ed4b0..847aa7c 100644
--- a/gcc/config/stormy16/stormy-abi
+++ b/gcc/config/stormy16/stormy-abi
@@ -24,17 +24,19 @@ The registers are allocated as follows:
Register Purpose
-------------------------------------------------------------------
-r0, r1 Call-volatile. May be changed during the execution
+r0, r1 Call-volatile. May be changed during the execution
+ of a call instruction.
+r2 through r7 Argument passing; call-clobbered.
+r8, r9 Call-volatile. May be changed during the execution
of a call instruction.
-r2 through r9 Argument passing; call-clobbered.
r10 through r13 Call-saved.
r14 Program status word.
r15 Stack pointer.
-The return value of a procedure is returned in r2-r9 if it fits,
-otherwise a pointer is passed as a `hidden' first argument
-and the return value is placed there.
+Scalar values are returned in register r2-r7 if the value fits.
+Otherwise, a pointer is passed as a 'hidden' first argument and
+the return value is placed there.
Arguments are passed in registers starting in r2, then on the stack.
Arguments of size not a multiple of a word are padded to whole words.
@@ -83,20 +85,18 @@ count += N;
One implementation of this is if a variadic function first
-pushes registers 2 through 9 in sequence at entry, and
+pushes registers 2 through 7 in sequence at entry, and
sets 'base' to the address of the first word pushed,
producing a stack that appears like:
SP ->
[other data]
- r9
- r8
r7
r6
r5
r4
r3
-count-> r2
+count-> r2
Return address (two words)
9th procedure parameter word
10th procedure parameter word
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index b2e85fa..a0a3961 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -1043,7 +1043,7 @@ do { \
only sequences of consecutive registers. On such machines, define
`REG_ALLOC_ORDER' to be an initializer that lists the highest numbered
allocatable register first. */
-#define REG_ALLOC_ORDER { 9, 7, 6, 5, 4, 3, 8, 2, 1, 0, 10, 11, 12, 13, 14, 15, 16 }
+#define REG_ALLOC_ORDER { 7, 6, 5, 4, 3, 2, 1, 0, 9, 8, 10, 11, 12, 13, 14, 15, 16 }
/* A C statement (sans semicolon) to choose the order in which to allocate hard
registers for pseudo-registers local to a basic block.
@@ -1204,6 +1204,7 @@ enum reg_class
R2_REGS,
EIGHT_REGS,
R8_REGS,
+ ICALL_REGS,
GENERAL_REGS,
CARRY_REGS,
ALL_REGS,
@@ -1226,6 +1227,7 @@ enum reg_class
"R2_REGS", \
"EIGHT_REGS", \
"R8_REGS", \
+ "ICALL_REGS", \
"GENERAL_REGS", \
"CARRY_REGS", \
"ALL_REGS" \
@@ -1250,6 +1252,7 @@ enum reg_class
0x00004, \
0x000FF, \
0x00100, \
+ 0x00300, \
0x6FFFF, \
0x10000, \
(1 << FIRST_PSEUDO_REGISTER) - 1 \
@@ -1303,6 +1306,7 @@ enum reg_class
: (CHAR) == 'e' ? EIGHT_REGS \
: (CHAR) == 't' ? TWO_REGS \
: (CHAR) == 'y' ? CARRY_REGS \
+ : (CHAR) == 'z' ? ICALL_REGS \
: NO_REGS)
/* A C expression which is nonzero if register number NUM is suitable for use
@@ -2007,7 +2011,7 @@ enum reg_class
/* Function Arguments in Registers */
-#define NUM_ARGUMENT_REGISTERS 8
+#define NUM_ARGUMENT_REGISTERS 6
#define FIRST_ARGUMENT_REGISTER 2
#define STORMY16_WORD_SIZE(TYPE, MODE) \
@@ -2293,7 +2297,7 @@ typedef int CUMULATIVE_ARGS;
return values are decided by the `RETURN_IN_MEMORY' macro.
If not defined, this defaults to the value 1. */
-#define DEFAULT_PCC_STRUCT_RETURN 0
+/* #define DEFAULT_PCC_STRUCT_RETURN 0 */
/* If the structure value address is passed in a register, then
`STRUCT_VALUE_REGNUM' should be the number of that register. */
diff --git a/gcc/config/stormy16/stormy16.md b/gcc/config/stormy16/stormy16.md
index c1b6128..ae3b76a 100644
--- a/gcc/config/stormy16/stormy16.md
+++ b/gcc/config/stormy16/stormy16.md
@@ -822,7 +822,7 @@
(define_insn "*call_internal"
[(call (mem:HI (match_operand:HI 0 "nonmemory_operand" "i,r"))
(match_operand 1 "" ""))
- (use (match_operand:HI 2 "nonmemory_operand" "X,t"))]
+ (use (match_operand:HI 2 "nonmemory_operand" "X,z"))]
""
"@
callf %C0
@@ -834,7 +834,7 @@
[(set (match_operand 3 "register_operand" "=r,r")
(call (mem:HI (match_operand:HI 0 "nonmemory_operand" "i,r"))
(match_operand 1 "" "")))
- (use (match_operand:HI 2 "nonmemory_operand" "X,t"))]
+ (use (match_operand:HI 2 "nonmemory_operand" "X,z"))]
""
"@
callf %C0
@@ -882,7 +882,7 @@
(define_insn ""
[(set (pc) (match_operand:HI 0 "register_operand" "r"))
- (use (match_operand:HI 1 "register_operand" "t"))]
+ (use (match_operand:HI 1 "register_operand" "z"))]
""
"jmp %1,%0"
[(set_attr "length" "4")