Commit da6e254e by Catherine Moore Committed by Catherine Moore

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
parent 9f1c2931
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> 2001-10-05 Neil Booth <neil@daikokuya.demon.co.uk>
* doc/cppinternals.texi: Update. * doc/cppinternals.texi: Update.
......
...@@ -24,17 +24,19 @@ The registers are allocated as follows: ...@@ -24,17 +24,19 @@ The registers are allocated as follows:
Register Purpose 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. of a call instruction.
r2 through r9 Argument passing; call-clobbered.
r10 through r13 Call-saved. r10 through r13 Call-saved.
r14 Program status word. r14 Program status word.
r15 Stack pointer. r15 Stack pointer.
The return value of a procedure is returned in r2-r9 if it fits, Scalar values are returned in register r2-r7 if the value fits.
otherwise a pointer is passed as a `hidden' first argument Otherwise, a pointer is passed as a 'hidden' first argument and
and the return value is placed there. the return value is placed there.
Arguments are passed in registers starting in r2, then on the stack. 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. Arguments of size not a multiple of a word are padded to whole words.
...@@ -83,20 +85,18 @@ count += N; ...@@ -83,20 +85,18 @@ count += N;
One implementation of this is if a variadic function first 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, sets 'base' to the address of the first word pushed,
producing a stack that appears like: producing a stack that appears like:
SP -> SP ->
[other data] [other data]
r9
r8
r7 r7
r6 r6
r5 r5
r4 r4
r3 r3
count-> r2 count-> r2
Return address (two words) Return address (two words)
9th procedure parameter word 9th procedure parameter word
10th procedure parameter word 10th procedure parameter word
......
...@@ -1043,7 +1043,7 @@ do { \ ...@@ -1043,7 +1043,7 @@ do { \
only sequences of consecutive registers. On such machines, define only sequences of consecutive registers. On such machines, define
`REG_ALLOC_ORDER' to be an initializer that lists the highest numbered `REG_ALLOC_ORDER' to be an initializer that lists the highest numbered
allocatable register first. */ 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 /* A C statement (sans semicolon) to choose the order in which to allocate hard
registers for pseudo-registers local to a basic block. registers for pseudo-registers local to a basic block.
...@@ -1204,6 +1204,7 @@ enum reg_class ...@@ -1204,6 +1204,7 @@ enum reg_class
R2_REGS, R2_REGS,
EIGHT_REGS, EIGHT_REGS,
R8_REGS, R8_REGS,
ICALL_REGS,
GENERAL_REGS, GENERAL_REGS,
CARRY_REGS, CARRY_REGS,
ALL_REGS, ALL_REGS,
...@@ -1226,6 +1227,7 @@ enum reg_class ...@@ -1226,6 +1227,7 @@ enum reg_class
"R2_REGS", \ "R2_REGS", \
"EIGHT_REGS", \ "EIGHT_REGS", \
"R8_REGS", \ "R8_REGS", \
"ICALL_REGS", \
"GENERAL_REGS", \ "GENERAL_REGS", \
"CARRY_REGS", \ "CARRY_REGS", \
"ALL_REGS" \ "ALL_REGS" \
...@@ -1250,6 +1252,7 @@ enum reg_class ...@@ -1250,6 +1252,7 @@ enum reg_class
0x00004, \ 0x00004, \
0x000FF, \ 0x000FF, \
0x00100, \ 0x00100, \
0x00300, \
0x6FFFF, \ 0x6FFFF, \
0x10000, \ 0x10000, \
(1 << FIRST_PSEUDO_REGISTER) - 1 \ (1 << FIRST_PSEUDO_REGISTER) - 1 \
...@@ -1303,6 +1306,7 @@ enum reg_class ...@@ -1303,6 +1306,7 @@ enum reg_class
: (CHAR) == 'e' ? EIGHT_REGS \ : (CHAR) == 'e' ? EIGHT_REGS \
: (CHAR) == 't' ? TWO_REGS \ : (CHAR) == 't' ? TWO_REGS \
: (CHAR) == 'y' ? CARRY_REGS \ : (CHAR) == 'y' ? CARRY_REGS \
: (CHAR) == 'z' ? ICALL_REGS \
: NO_REGS) : NO_REGS)
/* A C expression which is nonzero if register number NUM is suitable for use /* A C expression which is nonzero if register number NUM is suitable for use
...@@ -2007,7 +2011,7 @@ enum reg_class ...@@ -2007,7 +2011,7 @@ enum reg_class
/* Function Arguments in Registers */ /* Function Arguments in Registers */
#define NUM_ARGUMENT_REGISTERS 8 #define NUM_ARGUMENT_REGISTERS 6
#define FIRST_ARGUMENT_REGISTER 2 #define FIRST_ARGUMENT_REGISTER 2
#define STORMY16_WORD_SIZE(TYPE, MODE) \ #define STORMY16_WORD_SIZE(TYPE, MODE) \
...@@ -2293,7 +2297,7 @@ typedef int CUMULATIVE_ARGS; ...@@ -2293,7 +2297,7 @@ typedef int CUMULATIVE_ARGS;
return values are decided by the `RETURN_IN_MEMORY' macro. return values are decided by the `RETURN_IN_MEMORY' macro.
If not defined, this defaults to the value 1. */ 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 /* If the structure value address is passed in a register, then
`STRUCT_VALUE_REGNUM' should be the number of that register. */ `STRUCT_VALUE_REGNUM' should be the number of that register. */
......
...@@ -822,7 +822,7 @@ ...@@ -822,7 +822,7 @@
(define_insn "*call_internal" (define_insn "*call_internal"
[(call (mem:HI (match_operand:HI 0 "nonmemory_operand" "i,r")) [(call (mem:HI (match_operand:HI 0 "nonmemory_operand" "i,r"))
(match_operand 1 "" "")) (match_operand 1 "" ""))
(use (match_operand:HI 2 "nonmemory_operand" "X,t"))] (use (match_operand:HI 2 "nonmemory_operand" "X,z"))]
"" ""
"@ "@
callf %C0 callf %C0
...@@ -834,7 +834,7 @@ ...@@ -834,7 +834,7 @@
[(set (match_operand 3 "register_operand" "=r,r") [(set (match_operand 3 "register_operand" "=r,r")
(call (mem:HI (match_operand:HI 0 "nonmemory_operand" "i,r")) (call (mem:HI (match_operand:HI 0 "nonmemory_operand" "i,r"))
(match_operand 1 "" ""))) (match_operand 1 "" "")))
(use (match_operand:HI 2 "nonmemory_operand" "X,t"))] (use (match_operand:HI 2 "nonmemory_operand" "X,z"))]
"" ""
"@ "@
callf %C0 callf %C0
...@@ -882,7 +882,7 @@ ...@@ -882,7 +882,7 @@
(define_insn "" (define_insn ""
[(set (pc) (match_operand:HI 0 "register_operand" "r")) [(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" "jmp %1,%0"
[(set_attr "length" "4") [(set_attr "length" "4")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment