Commit 1c71e60e by Jan Hubicka Committed by Richard Henderson

i386.c (SAVE_REGS_FIRST): Remove.

        * i386.c (SAVE_REGS_FIRST): Remove.
        (ix86_initial_elimination_offset): Handle only SAVE_REGS_FIRST mode.
        (ix86_compute_frame_size): Likewise.
        (ix86_expand_prologue): Likewise.  Use pro_epilogue_adjust_stack.
        (ix86_emit_restore_regs): Remove.
        (ix86_emit_epilogue_esp_adjustment): Use pro_epilogue_adjust_stack
        when a frame pointer is in use.
        (ix86_expand_epilogue): Handle only SAVE_REGS_FIRST mode.  Use mov
        instead of pop to restore a register when profitable; emit leave
        when profitable.
        (ix86_attr_length_default): Handle pro_epilogue_adjust_stack
        as a TYPE_LEA insn.
        (ix86_adjust_cost): Handle pro_epilogue_adjust_stack as TYPE_ALU.
        * i386.md (prologue_allocate_stack): Remove.
        (epilogue_deallocate_stack): Remove.
        (pro_epilogue_adjust_stack): New.

Co-Authored-By: Richard Henderson <rth@cygnus.com>

From-SVN: r31792
parent c13fde05
2000-02-04 Jan Hubicka <jh@suse.cz>
Richard Henderson <rth@cygnus.com>
* i386.c (SAVE_REGS_FIRST): Remove.
(ix86_initial_elimination_offset): Handle only SAVE_REGS_FIRST mode.
(ix86_compute_frame_size): Likewise.
(ix86_expand_prologue): Likewise. Use pro_epilogue_adjust_stack.
(ix86_emit_restore_regs): Remove.
(ix86_emit_epilogue_esp_adjustment): Use pro_epilogue_adjust_stack
when a frame pointer is in use.
(ix86_expand_epilogue): Handle only SAVE_REGS_FIRST mode. Use mov
instead of pop to restore a register when profitable; emit leave
when profitable.
(ix86_attr_length_default): Handle pro_epilogue_adjust_stack
as a TYPE_LEA insn.
(ix86_adjust_cost): Handle pro_epilogue_adjust_stack as TYPE_ALU.
* i386.md (prologue_allocate_stack): Remove.
(epilogue_deallocate_stack): Remove.
(pro_epilogue_adjust_stack): New.
2000-02-04 Richard Henderson <rth@cygnus.com> 2000-02-04 Richard Henderson <rth@cygnus.com>
* function.c (diddle_return_value): Rework to use a callback function. * function.c (diddle_return_value): Rework to use a callback function.
......
...@@ -8807,35 +8807,47 @@ ...@@ -8807,35 +8807,47 @@
;; ;;
;; in proper program order. ;; in proper program order.
(define_insn "prologue_allocate_stack" (define_insn "pro_epilogue_adjust_stack"
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r,r")
(plus:SI (match_operand:SI 1 "register_operand" "0") (plus:SI (match_operand:SI 1 "register_operand" "0,r")
(match_operand:SI 2 "nonmemory_operand" "ri"))) (match_operand:SI 2 "immediate_operand" "i,i")))
(set (match_operand:SI 3 "register_operand" "=r") (set (match_operand:SI 3 "register_operand" "+r,r")
(match_dup 3)) (match_dup 3))
(clobber (reg:CC 17))] (clobber (reg:CC 17))]
"" ""
"* "*
{ {
if (GET_CODE (operands[2]) == CONST_INT switch (get_attr_type (insn))
&& (INTVAL (operands[2]) == 128
|| (INTVAL (operands[2]) < 0
&& INTVAL (operands[2]) != -128)))
{ {
operands[2] = GEN_INT (-INTVAL (operands[2])); case TYPE_IMOV:
return \"sub{l}\\t{%2, %0|%0, %2}\"; return \"mov{l}\\t{%1, %0|%0, %1}\";
case TYPE_ALU:
if (GET_CODE (operands[2]) == CONST_INT
&& (INTVAL (operands[2]) == 128
|| (INTVAL (operands[2]) < 0
&& INTVAL (operands[2]) != -128)))
{
operands[2] = GEN_INT (-INTVAL (operands[2]));
return \"sub{l}\\t{%2, %0|%0, %2}\";
}
return \"add{l}\\t{%2, %0|%0, %2}\";
case TYPE_LEA:
operands[2] = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
return \"lea{l}\\t{%a2, %0|%0, %a2}\";
default:
abort ();
} }
return \"add{l}\\t{%2, %0|%0, %2}\";
}" }"
[(set_attr "type" "alu")]) [(set (attr "type")
(cond [(eq_attr "alternative" "0")
(define_insn "epilogue_deallocate_stack" (const_string "alu")
[(set (match_operand:SI 0 "register_operand" "=r") (match_operand:SI 2 "const0_operand" "")
(match_operand:SI 1 "register_operand" "+r")) (const_string "imov")
(set (match_dup 1) (match_dup 1))] ]
"" (const_string "lea")))])
"mov{l}\\t{%1, %0|%0, %1}"
[(set_attr "type" "imov")])
(define_insn "allocate_stack_worker" (define_insn "allocate_stack_worker"
[(unspec:SI [(match_operand:SI 0 "register_operand" "a")] 3) [(unspec:SI [(match_operand:SI 0 "register_operand" "a")] 3)
......
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