diff options
Diffstat (limited to 'gcc/config/i386')
-rw-r--r-- | gcc/config/i386/i386-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 27 | ||||
-rw-r--r-- | gcc/config/i386/i386.md | 26 | ||||
-rw-r--r-- | gcc/config/i386/mmx.md | 8 | ||||
-rw-r--r-- | gcc/config/i386/sse.md | 8 |
5 files changed, 22 insertions, 48 deletions
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index 803a130..3493904 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -84,7 +84,6 @@ extern void ix86_expand_clear (rtx); extern void ix86_expand_move (enum machine_mode, rtx[]); extern void ix86_expand_vector_move (enum machine_mode, rtx[]); extern void ix86_expand_vector_move_misalign (enum machine_mode, rtx[]); -extern void ix86_expand_push (enum machine_mode, rtx); extern rtx ix86_fixup_binary_operands (enum rtx_code, enum machine_mode, rtx[]); extern void ix86_fixup_binary_operands_no_copy (enum rtx_code, diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index abe05aa..18f5d57 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -16828,6 +16828,9 @@ ix86_expand_vector_move (enum machine_mode mode, rtx operands[]) rtx op0 = operands[0], op1 = operands[1]; unsigned int align = GET_MODE_ALIGNMENT (mode); + if (push_operand (op0, VOIDmode)) + op0 = emit_move_resolve_push (mode, op0); + /* Force constants other than zero into memory. We do not know how the instructions used to build constants modify the upper 64 bits of the register, once we have that information we may be able @@ -17255,30 +17258,6 @@ ix86_expand_vector_move_misalign (enum machine_mode mode, rtx operands[]) gcc_unreachable (); } -/* Expand a push in MODE. This is some mode for which we do not support - proper push instructions, at least from the registers that we expect - the value to live in. */ - -void -ix86_expand_push (enum machine_mode mode, rtx x) -{ - rtx tmp; - - tmp = expand_simple_binop (Pmode, PLUS, stack_pointer_rtx, - GEN_INT (-GET_MODE_SIZE (mode)), - stack_pointer_rtx, 1, OPTAB_DIRECT); - if (tmp != stack_pointer_rtx) - emit_move_insn (stack_pointer_rtx, tmp); - - tmp = gen_rtx_MEM (mode, stack_pointer_rtx); - - /* When we push an operand onto stack, it has to be aligned at least - at the function argument boundary. However since we don't have - the argument type, we can't determine the actual argument - boundary. */ - emit_move_insn (tmp, x); -} - /* Helper function of ix86_fixup_binary_operands to canonicalize operand order. Returns true if the operands should be swapped. */ diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 87feb47..05fc00a 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -1821,8 +1821,6 @@ { if (TARGET_64BIT) ix86_expand_move (TImode, operands); - else if (push_operand (operands[0], TImode)) - ix86_expand_push (TImode, operands[1]); else ix86_expand_vector_move (TImode, operands); DONE; @@ -2682,7 +2680,11 @@ (match_operand:TF 1 "sse_reg_operand"))] "TARGET_SSE && reload_completed" [(set (reg:P SP_REG) (plus:P (reg:P SP_REG) (const_int -16))) - (set (mem:TF (reg:P SP_REG)) (match_dup 1))]) + (set (match_dup 0) (match_dup 1))] +{ + /* Preserve memory attributes. */ + operands[0] = replace_equiv_address (operands[0], stack_pointer_rtx); +}) (define_insn "*pushxf" [(set (match_operand:XF 0 "push_operand" "=<,<") @@ -2708,8 +2710,12 @@ (match_operand:XF 1 "fp_register_operand"))] "reload_completed" [(set (reg:P SP_REG) (plus:P (reg:P SP_REG) (match_dup 2))) - (set (mem:XF (reg:P SP_REG)) (match_dup 1))] - "operands[2] = GEN_INT (-GET_MODE_SIZE (XFmode));") + (set (match_dup 0) (match_dup 1))] +{ + operands[2] = GEN_INT (-GET_MODE_SIZE (XFmode)); + /* Preserve memory attributes. */ + operands[0] = replace_equiv_address (operands[0], stack_pointer_rtx); +}) (define_insn "*pushdf" [(set (match_operand:DF 0 "push_operand" "=<,<,<,<") @@ -2730,7 +2736,11 @@ (match_operand:DF 1 "any_fp_register_operand"))] "reload_completed" [(set (reg:P SP_REG) (plus:P (reg:P SP_REG) (const_int -8))) - (set (mem:DF (reg:P SP_REG)) (match_dup 1))]) + (set (match_dup 0) (match_dup 1))] +{ + /* Preserve memory attributes. */ + operands[0] = replace_equiv_address (operands[0], stack_pointer_rtx); +}) (define_insn "*pushsf_rex64" [(set (match_operand:SF 0 "push_operand" "=X,X,X") @@ -2764,7 +2774,7 @@ (match_operand:SF 1 "any_fp_register_operand"))] "reload_completed" [(set (reg:P SP_REG) (plus:P (reg:P SP_REG) (match_dup 2))) - (set (mem:SF (reg:P SP_REG)) (match_dup 1))] + (set (match_dup 0) (match_dup 1))] { rtx op = XEXP (operands[0], 0); if (GET_CODE (op) == PRE_DEC) @@ -2778,6 +2788,8 @@ gcc_assert (CONST_INT_P (op)); } operands[2] = op; + /* Preserve memory attributes. */ + operands[0] = replace_equiv_address (operands[0], stack_pointer_rtx); }) (define_split diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index 239e5db..214acde 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -213,14 +213,6 @@ [(const_int 0)] "ix86_split_long_move (operands); DONE;") -(define_expand "push<mode>1" - [(match_operand:MMXMODE 0 "register_operand")] - "TARGET_MMX" -{ - ix86_expand_push (<MODE>mode, operands[0]); - DONE; -}) - (define_expand "movmisalign<mode>" [(set (match_operand:MMXMODE 0 "nonimmediate_operand") (match_operand:MMXMODE 1 "nonimmediate_operand"))] diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index cbebd87..345b6e0 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -913,14 +913,6 @@ operands[2] = CONST0_RTX (DFmode); }) -(define_expand "push<mode>1" - [(match_operand:VMOVE 0 "register_operand")] - "TARGET_SSE" -{ - ix86_expand_push (<MODE>mode, operands[0]); - DONE; -}) - (define_expand "movmisalign<mode>" [(set (match_operand:VMOVE 0 "nonimmediate_operand") (match_operand:VMOVE 1 "nonimmediate_operand"))] |