Commit 172c08a5 by Richard Henderson Committed by Richard Henderson

re PR target/49881 ([AVR] Inefficient stack manipulation around calls)

PR target/49881
        * config/avr/avr.h (PUSH_ROUNDING): New.
        * config/avr/avr.md (pushqi1): Rename from *pushqi.
        (*pushhi, *pushsi, *pushsf): Remove.
        (MPUSH): New mode iterator.
        (push<MPUSH>1): New expander.

From-SVN: r177071
parent 750867b7
2011-08-01 Richard Henderson <rth@redhat.com>
PR target/49881
* config/avr/avr.h (PUSH_ROUNDING): New.
* config/avr/avr.md (pushqi1): Rename from *pushqi.
(*pushhi, *pushsi, *pushsf): Remove.
(MPUSH): New mode iterator.
(push<MPUSH>1): New expander.
2011-08-01 Anatoly Sokolov <aesok@post.ru> 2011-08-01 Anatoly Sokolov <aesok@post.ru>
* config/mmix/mmix.h (PREFERRED_RELOAD_CLASS, * config/mmix/mmix.h (PREFERRED_RELOAD_CLASS,
......
...@@ -685,3 +685,7 @@ struct GTY(()) machine_function ...@@ -685,3 +685,7 @@ struct GTY(()) machine_function
/* 'true' if a callee might be tail called */ /* 'true' if a callee might be tail called */
int sibcall_fails; int sibcall_fails;
}; };
/* AVR does not round pushes, but the existance of this macro is
required in order for pushes to be generated. */
#define PUSH_ROUNDING(X) (X)
...@@ -202,8 +202,7 @@ ...@@ -202,8 +202,7 @@
DONE; DONE;
}) })
(define_insn "pushqi1"
(define_insn "*pushqi"
[(set (mem:QI (post_dec:HI (reg:HI REG_SP))) [(set (mem:QI (post_dec:HI (reg:HI REG_SP)))
(match_operand:QI 0 "reg_or_0_operand" "r,L"))] (match_operand:QI 0 "reg_or_0_operand" "r,L"))]
"" ""
...@@ -212,33 +211,29 @@ ...@@ -212,33 +211,29 @@
push __zero_reg__" push __zero_reg__"
[(set_attr "length" "1,1")]) [(set_attr "length" "1,1")])
(define_insn "*pushhi" ;; All modes for a multi-byte push. We must include complex modes here too,
[(set (mem:HI (post_dec:HI (reg:HI REG_SP))) ;; lest emit_single_push_insn "helpfully " create the auto-inc itself.
(match_operand:HI 0 "reg_or_0_operand" "r,L"))] (define_mode_iterator MPUSH
"" [(CQI "")
"@ (HI "") (CHI "")
push %B0\;push %A0 (SI "") (CSI "")
push __zero_reg__\;push __zero_reg__" (DI "") (CDI "")
[(set_attr "length" "2,2")]) (SF "") (SC "")])
(define_insn "*pushsi" (define_expand "push<mode>1"
[(set (mem:SI (post_dec:HI (reg:HI REG_SP))) [(match_operand:MPUSH 0 "general_operand" "")]
(match_operand:SI 0 "reg_or_0_operand" "r,L"))]
"" ""
"@ {
push %D0\;push %C0\;push %B0\;push %A0 int i;
push __zero_reg__\;push __zero_reg__\;push __zero_reg__\;push __zero_reg__" for (i = GET_MODE_SIZE (<MODE>mode) - 1; i >= 0; --i)
[(set_attr "length" "4,4")]) {
rtx part = simplify_gen_subreg (QImode, operands[0], <MODE>mode, i);
(define_insn "*pushsf" if (part != const0_rtx)
[(set (mem:SF (post_dec:HI (reg:HI REG_SP))) part = force_reg (QImode, part);
(match_operand:SF 0 "register_operand" "r"))] emit_insn (gen_pushqi1 (part));
"" }
"push %D0 DONE;
push %C0 })
push %B0
push %A0"
[(set_attr "length" "4")])
;;======================================================================== ;;========================================================================
;; move byte ;; move byte
......
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