diff options
author | jrv <jrv@138bc75d-0d04-0410-961f-82ee72b054a4> | 1993-10-05 05:48:02 +0000 |
---|---|---|
committer | jrv <jrv@138bc75d-0d04-0410-961f-82ee72b054a4> | 1993-10-05 05:48:02 +0000 |
commit | b6e49ac059869ebde9e9a9383837c9dc9b799ed7 (patch) | |
tree | df9f87807211728104ca217f0da45bf92cb3031b /gcc/reg-stack.c | |
parent | 03898be8b17ae9604f870451a6dbc22f0cc02277 (diff) | |
download | gcc-b6e49ac059869ebde9e9a9383837c9dc9b799ed7.tar.gz |
(move_for_stack_reg): If the 387 regstack is not full when doing an XFmode
write from 387 to MEM, copy the source reg and write the copy.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5598 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reg-stack.c')
-rw-r--r-- | gcc/reg-stack.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index 3cf49dedf64..005f55493ea 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -230,7 +230,7 @@ static rtx FP_mode_reg[FIRST_PSEUDO_REGISTER][(int) MAX_MACHINE_MODE]; : block_number)[INSN_UID (INSN)]) extern rtx gen_jump (); -extern rtx gen_movdf (); +extern rtx gen_movdf (), gen_movxf (); extern rtx find_regno_note (); extern rtx emit_jump_insn_before (); extern rtx emit_label_after (); @@ -1723,6 +1723,24 @@ move_for_stack_reg (insn, regstack, pat) regstack->top--; CLEAR_HARD_REG_BIT (regstack->reg_set, REGNO (*src)); } + else if (GET_MODE (*src) == XFmode && regstack->top != REG_STACK_SIZE) + { + /* A 387 cannot write an XFmode value to a MEM without + clobbering the source reg. The output code can handle + this by reading back the value from the MEM. + But it is more efficient to use a temp register if one is + available. Push the source value here if the register + stack is not full, and then write the value to memory via + a pop. */ + rtx push_rtx, push_insn; + rtx top_stack_reg = FP_mode_reg[FIRST_STACK_REG][(int) XFmode]; + + push_rtx = gen_movxf (top_stack_reg, top_stack_reg); + push_insn = emit_insn_before (push_rtx, insn); + PUT_MODE (push_insn, QImode); + REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_DEAD, top_stack_reg, + REG_NOTES (insn)); + } replace_reg (src, FIRST_STACK_REG); } |