Commit 264ddbaa by Richard Henderson Committed by Richard Henderson

vax.h (RETURN_POPS_ARGS): Max at 255 arguments.

        * config/vax/vax.h (RETURN_POPS_ARGS): Max at 255 arguments.
        * config/vax/vax.md (call_pop): Turn into an expander.
        (call_value_pop): Likewise.
        (call, call_value): New.

From-SVN: r39004
parent 5b9b177a
......@@ -5,6 +5,11 @@
* config/vax/vax.md (indirect_jump): Use register_operand.
* config/vax/vax.h (RETURN_POPS_ARGS): Max at 255 arguments.
* config/vax/vax.md (call_pop): Turn into an expander.
(call_value_pop): Likewise.
(call, call_value): New.
2001-01-14 Andreas Jaeger <aj@suse.de>
* config/i386/i386.c (ix86_split_fp_branch): Remove unused
......
......@@ -369,9 +369,10 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
or for a library call it is an identifier node for the subroutine name.
SIZE is the number of bytes of arguments passed on the stack.
On the Vax, the RET insn always pops all the args for any function. */
On the Vax, the RET insn pops a maximum of 255 args for any function. */
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) (SIZE)
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
((SIZE) > 255*4 ? 0 : (SIZE))
/* Define how to find the value returned by a function.
VALTYPE is the data type of the value (as a tree).
......
......@@ -1823,63 +1823,66 @@
;; It is used in the call instruction as a byte, but in the addl2 as
;; a word. Since the only time we actually use it in the call instruction
;; is when it is a constant, SImode (for addl2) is the proper mode.
(define_insn "call_pop"
(define_expand "call_pop"
[(parallel [(call (match_operand:QI 0 "memory_operand" "")
(match_operand:SI 1 "const_int_operand" ""))
(set (reg:SI 14)
(plus:SI (reg:SI 14)
(match_operand:SI 3 "immediate_operand" "")))])]
""
"
{
if (INTVAL (operands[1]) > 255 * 4)
abort ();
operands[1] = GEN_INT ((INTVAL (operands[1]) + 3)/ 4);
}")
(define_insn "*call_pop"
[(call (match_operand:QI 0 "memory_operand" "m")
(match_operand:SI 1 "const_int_operand" "n"))
(set (reg:SI 14) (plus:SI (reg:SI 14)
(match_operand:SI 3 "immediate_operand" "i")))]
(match_operand:SI 2 "immediate_operand" "i")))]
""
"*
if (INTVAL (operands[1]) > 255 * 4)
/* Vax `calls' really uses only one byte of #args, so pop explicitly. */
return \"calls $0,%0\;addl2 %1,sp\";
operands[1] = GEN_INT ((INTVAL (operands[1]) + 3)/ 4);
return \"calls %1,%0\";
")
"calls %1,%0")
(define_expand "call_value_pop"
[(parallel [(set (match_operand 0 "" "")
(call (match_operand:QI 1 "memory_operand" "")
(match_operand:SI 2 "const_int_operand" "")))
(set (reg:SI 14)
(plus:SI (reg:SI 14)
(match_operand:SI 4 "immediate_operand" "")))])]
""
"
{
if (INTVAL (operands[2]) > 255 * 4)
abort ();
operands[2] = GEN_INT ((INTVAL (operands[2]) + 3)/ 4);
}")
(define_insn "call_value_pop"
[(set (match_operand 0 "" "=g")
(define_insn "*call_value_pop"
[(set (match_operand 0 "" "")
(call (match_operand:QI 1 "memory_operand" "m")
(match_operand:SI 2 "const_int_operand" "n")))
(set (reg:SI 14) (plus:SI (reg:SI 14)
(match_operand:SI 4 "immediate_operand" "i")))]
(match_operand:SI 3 "immediate_operand" "i")))]
""
"*
if (INTVAL (operands[2]) > 255 * 4)
/* Vax `calls' really uses only one byte of #args, so pop explicitly. */
return \"calls $0,%1\;addl2 %2,sp\";
operands[2] = GEN_INT ((INTVAL (operands[2]) + 3)/ 4);
return \"calls %2,%1\";
")
"calls %2,%1")
;; Define another set of these for the case of functions with no
;; operands. In that case, combine may simplify the adjustment of sp.
(define_insn ""
;; Define another set of these for the case of functions with no operands.
;; These will allow the optimizers to do a slightly better job.
(define_insn "call"
[(call (match_operand:QI 0 "memory_operand" "m")
(match_operand:SI 1 "const_int_operand" "n"))
(set (reg:SI 14) (reg:SI 14))]
(const_int 0))]
""
"*
if (INTVAL (operands[1]) > 255 * 4)
/* Vax `calls' really uses only one byte of #args, so pop explicitly. */
return \"calls $0,%0\;addl2 %1,sp\";
operands[1] = GEN_INT ((INTVAL (operands[1]) + 3)/ 4);
return \"calls %1,%0\";
")
"calls $0,%0")
(define_insn ""
[(set (match_operand 0 "" "=g")
(define_insn "call_value"
[(set (match_operand 0 "" "")
(call (match_operand:QI 1 "memory_operand" "m")
(match_operand:SI 2 "const_int_operand" "n")))
(set (reg:SI 14) (reg:SI 14))]
(const_int 0)))]
""
"*
if (INTVAL (operands[2]) > 255 * 4)
/* Vax `calls' really uses only one byte of #args, so pop explicitly. */
return \"calls $0,%1\;addl2 %2,sp\";
operands[2] = GEN_INT ((INTVAL (operands[2]) + 3)/ 4);
return \"calls %2,%1\";
")
"calls $0,%1")
;; Call subroutine returning any type.
......
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