diff options
-rw-r--r-- | gcc/ChangeLog | 19 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 48 | ||||
-rw-r--r-- | gcc/config/i386/i386.h | 1 | ||||
-rw-r--r-- | gcc/config/i386/i386.md | 508 | ||||
-rw-r--r-- | gcc/reg-stack.c | 18 |
5 files changed, 335 insertions, 259 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f50a947ede2..bb6d884c08b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,22 @@ +Sat Apr 10 20:09:55 EDT 1999 John Wehle (john@feith.com) + + * i386.md (floatsisf2, floatdisf2, floatsidf2, floatdidf2, + floatsixf2, floatdixf2, movsicc, movhicc, movsfcc, movdfcc, + movxfcc, movdicc): Remove unused register constraints from + the splitters. + + * i386.md (fixuns_truncsfsi2, fixuns_truncdfsi2, + fixuns_truncxfsi2): Delete. + + * reg-stack.c (delete_insn_for_stacker): Ensure that + the only side effects of a PARALLEL are clobbers. + (subst_stack_regs): Handle subst_stack_regs_pat deleting + a PARALLEL. + * i386.md (extendsfdf2, extenddfxf2, + extendsfxf2): Rewrite using a splitter. + * i386.c (output_op_from_reg): Remove. + * i386.h: Likewise. + Sat Apr 10 13:09:18 1999 Nick Clifton <nickc@cygnus.com> * config/arm/arm.c (di_operand): Allow SUBREGs as well. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index adec5a2c962..ab542355506 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -854,54 +854,6 @@ function_arg_partial_nregs (cum, mode, type, named) return 0; } -/* Output an insn whose source is a 386 integer register. SRC is the - rtx for the register, and TEMPLATE is the op-code template. SRC may - be either SImode or DImode. - - The template will be output with operands[0] as SRC, and operands[1] - as a pointer to the top of the 386 stack. So a call from floatsidf2 - would look like this: - - output_op_from_reg (operands[1], AS1 (fild%z0,%1)); - - where %z0 corresponds to the caller's operands[1], and is used to - emit the proper size suffix. - - ??? Extend this to handle HImode - a 387 can load and store HImode - values directly. */ - -void -output_op_from_reg (src, template) - rtx src; - char *template; -{ - rtx xops[4]; - int size = GET_MODE_SIZE (GET_MODE (src)); - - xops[0] = src; - xops[1] = AT_SP (Pmode); - xops[2] = GEN_INT (size); - xops[3] = stack_pointer_rtx; - - if (size > UNITS_PER_WORD) - { - rtx high; - - if (size > 2 * UNITS_PER_WORD) - { - high = gen_rtx_REG (SImode, REGNO (src) + 2); - output_asm_insn (AS1 (push%L0,%0), &high); - } - - high = gen_rtx_REG (SImode, REGNO (src) + 1); - output_asm_insn (AS1 (push%L0,%0), &high); - } - - output_asm_insn (AS1 (push%L0,%0), &src); - output_asm_insn (template, xops); - output_asm_insn (AS2 (add%L3,%2,%3), xops); -} - /* Output an insn to pop an value from the 387 top-of-stack to 386 register DEST. The 387 register stack is popped if DIES is true. If the mode of DEST is an integer mode, a `fist' integer store is done, diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 994d1571762..2bbf94e24f1 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -2713,7 +2713,6 @@ extern void function_arg_advance (); extern struct rtx_def *function_arg (); extern int function_arg_partial_nregs (); extern char *output_strlen_unroll (); -extern void output_op_from_reg (); extern void output_to_reg (); extern char *singlemove_string (); extern char *output_move_double (); diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 3ec8875e711..8eade3ebb58 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -2171,110 +2171,271 @@ ;; Conversions between float and double. -(define_insn "extendsfdf2" - [(set (match_operand:DF 0 "nonimmediate_operand" "=fm,f") - (float_extend:DF - (match_operand:SF 1 "nonimmediate_operand" "f,fm")))] +(define_expand "extendsfdf2" + [(parallel [(set (match_operand:DF 0 "nonimmediate_operand" "") + (float_extend:DF + (match_operand:SF 1 "nonimmediate_operand" ""))) + (clobber (match_dup 2)) + (clobber (match_dup 3))])] "TARGET_80387" + " +{ + if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM) + operands[1] = force_reg (SFmode, operands[1]); + + operands[2] = assign_386_stack_local (SFmode, 0); + operands[3] = assign_386_stack_local (DFmode, 0); +}") + +(define_insn "" + [(set (match_operand:DF 0 "nonimmediate_operand" "=f,m,!f,!*r") + (float_extend:DF + (match_operand:SF 1 "nonimmediate_operand" "fm,f,*r,f"))) + (clobber (match_operand:SF 2 "memory_operand" "m,m,m,m")) + (clobber (match_operand:DF 3 "memory_operand" "m,m,m,o"))] + "TARGET_80387 && (GET_CODE (operands[0]) != MEM + || GET_CODE (operands[1]) != MEM)" + "#") + +(define_split + [(set (match_operand:DF 0 "register_operand" "") + (float_extend:DF (match_operand:SF 1 "register_operand" ""))) + (clobber (match_operand:SF 2 "memory_operand" "")) + (clobber (match_operand:DF 3 "memory_operand" ""))] + "TARGET_80387 && reload_completed && NON_STACK_REG_P (operands[1])" + [(set (match_dup 2) + (match_dup 1)) + (set (match_dup 0) + (float_extend:DF (match_dup 2)))] + "") + +(define_split + [(set (match_operand:DF 0 "register_operand" "") + (float_extend:DF (match_operand:SF 1 "register_operand" ""))) + (clobber (match_operand:SF 2 "memory_operand" "")) + (clobber (match_operand:DF 3 "memory_operand" ""))] + "TARGET_80387 && reload_completed && NON_STACK_REG_P (operands[0])" + [(set (match_dup 3) + (float_extend:DF (match_dup 1))) + (set (match_dup 0) + (match_dup 3))] + "") + +(define_split + [(set (match_operand:DF 0 "nonimmediate_operand" "") + (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" ""))) + (clobber (match_operand:SF 2 "memory_operand" "")) + (clobber (match_operand:DF 3 "memory_operand" ""))] + "TARGET_80387 && reload_completed" + [(set (match_dup 0) + (float_extend:DF (match_dup 1)))] + "") + +(define_insn "" + [(set (match_operand:DF 0 "nonimmediate_operand" "=f,m") + (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "fm,f")))] + "TARGET_80387 && (GET_CODE (operands[0]) != MEM + || GET_CODE (operands[1]) != MEM)" "* { int stack_top_dies = find_regno_note (insn, REG_DEAD, FIRST_STACK_REG) != 0; - if (NON_STACK_REG_P (operands[1])) - { - output_op_from_reg (operands[1], AS1 (fld%z0,%y1)); - RET; - } + if (! STACK_TOP_P (operands[0]) && ! STACK_TOP_P (operands[1])) + abort (); - if (NON_STACK_REG_P (operands[0])) - { - output_to_reg (operands[0], stack_top_dies, 0); - RET; - } + if (STACK_TOP_P (operands[0]) && STACK_TOP_P (operands[1])) + return \"\"; if (STACK_TOP_P (operands[0])) return AS1 (fld%z1,%y1); - if (GET_CODE (operands[0]) == MEM) - { - if (stack_top_dies) - return AS1 (fstp%z0,%y0); - else - return AS1 (fst%z0,%y0); - } + if (stack_top_dies) + return AS1 (fstp%z0,%y0); + else + return AS1 (fst%z0,%y0); +}" + [(set_attr "type" "fld,fpop")]) + +(define_expand "extenddfxf2" + [(parallel [(set (match_operand:XF 0 "nonimmediate_operand" "") + (float_extend:XF + (match_operand:DF 1 "nonimmediate_operand" ""))) + (clobber (match_dup 2)) + (clobber (match_dup 3))])] + "TARGET_80387" + " +{ + if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM) + operands[1] = force_reg (DFmode, operands[1]); - abort (); + operands[2] = assign_386_stack_local (DFmode, 0); + operands[3] = assign_386_stack_local (XFmode, 0); }") -(define_insn "extenddfxf2" - [(set (match_operand:XF 0 "nonimmediate_operand" "=fm,f,f,!*r") +(define_insn "" + [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,!f,!*r") (float_extend:XF - (match_operand:DF 1 "nonimmediate_operand" "f,fm,!*r,f")))] - "TARGET_80387" + (match_operand:DF 1 "nonimmediate_operand" "fm,f,*r,f"))) + (clobber (match_operand:DF 2 "memory_operand" "m,m,o,m")) + (clobber (match_operand:XF 3 "memory_operand" "m,m,m,o"))] + "TARGET_80387 && (GET_CODE (operands[0]) != MEM + || GET_CODE (operands[1]) != MEM)" + "#") + +(define_split + [(set (match_operand:XF 0 "register_operand" "") + (float_extend:XF (match_operand:DF 1 "register_operand" ""))) + (clobber (match_operand:DF 2 "memory_operand" "")) + (clobber (match_operand:XF 3 "memory_operand" ""))] + "TARGET_80387 && reload_completed && NON_STACK_REG_P (operands[1])" + [(set (match_dup 2) + (match_dup 1)) + (set (match_dup 0) + (float_extend:XF (match_dup 2)))] + "") + +(define_split + [(set (match_operand:XF 0 "register_operand" "") + (float_extend:XF (match_operand:DF 1 "register_operand" ""))) + (clobber (match_operand:DF 2 "memory_operand" "")) + (clobber (match_operand:XF 3 "memory_operand" ""))] + "TARGET_80387 && reload_completed && NON_STACK_REG_P (operands[0])" + [(set (match_dup 3) + (float_extend:XF (match_dup 1))) + (set (match_dup 0) + (match_dup 3))] + "") + +(define_split + [(set (match_operand:XF 0 "nonimmediate_operand" "") + (float_extend:XF (match_operand:DF 1 "nonimmediate_operand" ""))) + (clobber (match_operand:DF 2 "memory_operand" "")) + (clobber (match_operand:XF 3 "memory_operand" ""))] + "TARGET_80387 && reload_completed" + [(set (match_dup 0) + (float_extend:XF (match_dup 1)))] + "") + +(define_insn "" + [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m") + (float_extend:XF (match_operand:DF 1 "nonimmediate_operand" "fm,f")))] + "TARGET_80387 && (GET_CODE (operands[0]) != MEM + || GET_CODE (operands[1]) != MEM)" "* { int stack_top_dies = find_regno_note (insn, REG_DEAD, FIRST_STACK_REG) != 0; - if (NON_STACK_REG_P (operands[1])) - { - output_op_from_reg (operands[1], AS1 (fld%z0,%y1)); - RET; - } + if (! STACK_TOP_P (operands[0]) && ! STACK_TOP_P (operands[1])) + abort (); - if (NON_STACK_REG_P (operands[0])) - { - output_to_reg (operands[0], stack_top_dies, 0); - RET; - } + if (STACK_TOP_P (operands[0]) && STACK_TOP_P (operands[1])) + return \"\"; if (STACK_TOP_P (operands[0])) return AS1 (fld%z1,%y1); - if (GET_CODE (operands[0]) == MEM) - { - output_asm_insn (AS1 (fstp%z0,%y0), operands); - if (! stack_top_dies) - return AS1 (fld%z0,%y0); - RET; - } + if (stack_top_dies || GET_CODE (operands[0]) == MEM) + output_asm_insn (AS1 (fstp%z0,%y0), operands); + else + return AS1 (fst%z0,%y0); - abort (); + if (! stack_top_dies) + return AS1 (fld%z0,%y0); + + return \"\"; +}" + [(set_attr "type" "fld,fpop")]) + +(define_expand "extendsfxf2" + [(parallel [(set (match_operand:XF 0 "nonimmediate_operand" "") + (float_extend:XF + (match_operand:SF 1 "nonimmediate_operand" ""))) + (clobber (match_dup 2)) + (clobber (match_dup 3))])] + "TARGET_80387" + " +{ + if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM) + operands[1] = force_reg (SFmode, operands[1]); + + operands[2] = assign_386_stack_local (SFmode, 0); + operands[3] = assign_386_stack_local (XFmode, 0); }") -(define_insn "extendsfxf2" - [(set (match_operand:XF 0 "nonimmediate_operand" "=fm,f,f,!*r") +(define_insn "" + [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,!f,!*r") (float_extend:XF - (match_operand:SF 1 "nonimmediate_operand" "f,fm,!*r,f")))] - "TARGET_80387" + (match_operand:SF 1 "nonimmediate_operand" "fm,f,*r,f"))) + (clobber (match_operand:SF 2 "memory_operand" "m,m,m,m")) + (clobber (match_operand:XF 3 "memory_operand" "m,m,m,o"))] + "TARGET_80387 && (GET_CODE (operands[0]) != MEM + || GET_CODE (operands[1]) != MEM)" + "#") + +(define_split + [(set (match_operand:XF 0 "register_operand" "") + (float_extend:XF (match_operand:SF 1 "register_operand" ""))) + (clobber (match_operand:SF 2 "memory_operand" "")) + (clobber (match_operand:XF 3 "memory_operand" ""))] + "TARGET_80387 && reload_completed && NON_STACK_REG_P (operands[1])" + [(set (match_dup 2) + (match_dup 1)) + (set (match_dup 0) + (float_extend:XF (match_dup 2)))] + "") + +(define_split + [(set (match_operand:XF 0 "register_operand" "") + (float_extend:XF (match_operand:SF 1 "register_operand" ""))) + (clobber (match_operand:SF 2 "memory_operand" "")) + (clobber (match_operand:XF 3 "memory_operand" ""))] + "TARGET_80387 && reload_completed && NON_STACK_REG_P (operands[0])" + [(set (match_dup 3) + (float_extend:XF (match_dup 1))) + (set (match_dup 0) + (match_dup 3))] + "") + +(define_split + [(set (match_operand:XF 0 "nonimmediate_operand" "") + (float_extend:XF (match_operand:SF 1 "nonimmediate_operand" ""))) + (clobber (match_operand:SF 2 "memory_operand" "")) + (clobber (match_operand:XF 3 "memory_operand" ""))] + "TARGET_80387 && reload_completed" + [(set (match_dup 0) + (float_extend:XF (match_dup 1)))] + "") + +(define_insn "" + [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m") + (float_extend:XF + (match_operand:SF 1 "nonimmediate_operand" "fm,f")))] + "TARGET_80387 && (GET_CODE (operands[0]) != MEM + || GET_CODE (operands[1]) != MEM)" "* { int stack_top_dies = find_regno_note (insn, REG_DEAD, FIRST_STACK_REG) != 0; - if (NON_STACK_REG_P (operands[1])) - { - output_op_from_reg (operands[1], AS1 (fld%z0,%y1)); - RET; - } + if (! STACK_TOP_P (operands[0]) && ! STACK_TOP_P (operands[1])) + abort (); - if (NON_STACK_REG_P (operands[0])) - { - output_to_reg (operands[0], stack_top_dies, 0); - RET; - } + if (STACK_TOP_P (operands[0]) && STACK_TOP_P (operands[1])) + return \"\"; if (STACK_TOP_P (operands[0])) return AS1 (fld%z1,%y1); - if (GET_CODE (operands[0]) == MEM) - { - output_asm_insn (AS1 (fstp%z0,%y0), operands); - if (! stack_top_dies) - return AS1 (fld%z0,%y0); - RET; - } + if (stack_top_dies || GET_CODE (operands[0]) == MEM) + output_asm_insn (AS1 (fstp%z0,%y0), operands); + else + return AS1 (fst%z0,%y0); - abort (); -}") + if (! stack_top_dies) + return AS1 (fld%z0,%y0); + + return \"\"; +}" + [(set_attr "type" "fld,fpop")]) (define_expand "truncdfsf2" [(parallel [(set (match_operand:SF 0 "nonimmediate_operand" "") @@ -2502,75 +2663,6 @@ }" [(set_attr "type" "fpop")]) -;; The 387 requires that the stack top dies after converting to DImode. - -;; Represent an unsigned conversion from SImode to MODE_FLOAT by first -;; doing a signed conversion to DImode, and then taking just the low -;; part. - -(define_expand "fixuns_truncxfsi2" - [(set (match_dup 4) - (match_operand:XF 1 "register_operand" "")) - (parallel [(set (match_dup 2) - (fix:DI (fix:XF (match_dup 4)))) - (clobber (match_dup 4)) - (clobber (match_dup 5)) - (clobber (match_dup 6)) - (clobber (match_scratch:SI 7 ""))]) - (set (match_operand:SI 0 "general_operand" "") - (match_dup 3))] - "TARGET_80387" - " -{ - operands[2] = gen_reg_rtx (DImode); - operands[3] = gen_lowpart (SImode, operands[2]); - operands[4] = gen_reg_rtx (XFmode); - operands[5] = (rtx) assign_386_stack_local (SImode, 0); - operands[6] = (rtx) assign_386_stack_local (DImode, 1); -}") - -(define_expand "fixuns_truncdfsi2" - [(set (match_dup 4) - (match_operand:DF 1 "register_operand" "")) - (parallel [(set (match_dup 2) - (fix:DI (fix:DF (match_dup 4)))) - (clobber (match_dup 4)) - (clobber (match_dup 5)) - (clobber (match_dup 6)) - (clobber (match_scratch:SI 7 ""))]) - (set (match_operand:SI 0 "general_operand" "") - (match_dup 3))] - "TARGET_80387" - " -{ - operands[2] = gen_reg_rtx (DImode); - operands[3] = gen_lowpart (SImode, operands[2]); - operands[4] = gen_reg_rtx (DFmode); - operands[5] = (rtx) assign_386_stack_local (SImode, 0); - operands[6] = (rtx) assign_386_stack_local (DImode, 1); -}") - -(define_expand "fixuns_truncsfsi2" - [(set (match_dup 4) - (match_operand:SF 1 "register_operand" "")) - (parallel [(set (match_dup 2) - (fix:DI (fix:SF (match_dup 4)))) - (clobber (match_dup 4)) - (clobber (match_dup 5)) - (clobber (match_dup 6)) - (clobber (match_scratch:SI 7 ""))]) - (set (match_operand:SI 0 "general_operand" "") - (match_dup 3))] - "TARGET_80387" - " -{ - operands[2] = gen_reg_rtx (DImode); - operands[3] = gen_lowpart (SImode, operands[2]); - operands[4] = gen_reg_rtx (SFmode); - operands[5] = (rtx) assign_386_stack_local (SImode, 0); - operands[6] = (rtx) assign_386_stack_local (DImode, 1); -}") - ;; Signed conversion to DImode. (define_expand "fix_truncxfdi2" @@ -2749,18 +2841,18 @@ "#") (define_split - [(set (match_operand:SF 0 "register_operand" "=f") - (float:SF (match_operand:SI 1 "memory_operand" "m"))) - (clobber (match_operand:SI 2 "memory_operand" "m"))] + [(set (match_operand:SF 0 "register_operand" "") + (float:SF (match_operand:SI 1 "memory_operand" ""))) + (clobber (match_operand:SI 2 "memory_operand" ""))] "TARGET_80387 && reload_completed" [(set (match_dup 0) (float:SF (match_dup 1)))] "") (define_split - [(set (match_operand:SF 0 "register_operand" "=f") - (float:SF (match_operand:SI 1 "register_operand" "r"))) - (clobber (match_operand:SI 2 "memory_operand" "m"))] + [(set (match_operand:SF 0 "register_operand" "") + (float:SF (match_operand:SI 1 "register_operand" ""))) + (clobber (match_operand:SI 2 "memory_operand" ""))] "TARGET_80387 && reload_completed" [(set (match_dup 2) (match_dup 1)) @@ -2790,18 +2882,18 @@ "#") (define_split - [(set (match_operand:SF 0 "register_operand" "=f") - (float:SF (match_operand:DI 1 "memory_operand" "m"))) - (clobber (match_operand:DI 2 "memory_operand" "m"))] + [(set (match_operand:SF 0 "register_operand" "") + (float:SF (match_operand:DI 1 "memory_operand" ""))) + (clobber (match_operand:DI 2 "memory_operand" ""))] "TARGET_80387 && reload_completed" [(set (match_dup 0) (float:SF (match_dup 1)))] "") (define_split - [(set (match_operand:SF 0 "register_operand" "=f") - (float:SF (match_operand:DI 1 "register_operand" "r"))) - (clobber (match_operand:DI 2 "memory_operand" "o"))] + [(set (match_operand:SF 0 "register_operand" "") + (float:SF (match_operand:DI 1 "register_operand" ""))) + (clobber (match_operand:DI 2 "memory_operand" ""))] "TARGET_80387 && reload_completed" [(set (match_dup 2) (match_dup 1)) @@ -2831,18 +2923,18 @@ "#") (define_split - [(set (match_operand:DF 0 "register_operand" "=f") - (float:DF (match_operand:SI 1 "memory_operand" "m"))) - (clobber (match_operand:SI 2 "memory_operand" "m"))] + [(set (match_operand:DF 0 "register_operand" "") + (float:DF (match_operand:SI 1 "memory_operand" ""))) + (clobber (match_operand:SI 2 "memory_operand" ""))] "TARGET_80387 && reload_completed" [(set (match_dup 0) (float:DF (match_dup 1)))] "") (define_split - [(set (match_operand:DF 0 "register_operand" "=f") - (float:DF (match_operand:SI 1 "register_operand" "r"))) - (clobber (match_operand:SI 2 "memory_operand" "m"))] + [(set (match_operand:DF 0 "register_operand" "") + (float:DF (match_operand:SI 1 "register_operand" ""))) + (clobber (match_operand:SI 2 "memory_operand" ""))] "TARGET_80387 && reload_completed" [(set (match_dup 2) (match_dup 1)) @@ -2872,18 +2964,18 @@ "#") (define_split - [(set (match_operand:DF 0 "register_operand" "=f") - (float:DF (match_operand:DI 1 "memory_operand" "m"))) - (clobber (match_operand:DI 2 "memory_operand" "m"))] + [(set (match_operand:DF 0 "register_operand" "") + (float:DF (match_operand:DI 1 "memory_operand" ""))) + (clobber (match_operand:DI 2 "memory_operand" ""))] "TARGET_80387 && reload_completed" [(set (match_dup 0) (float:DF (match_dup 1)))] "") (define_split - [(set (match_operand:DF 0 "register_operand" "=f") - (float:DF (match_operand:DI 1 "register_operand" "r"))) - (clobber (match_operand:DI 2 "memory_operand" "o"))] + [(set (match_operand:DF 0 "register_operand" "") + (float:DF (match_operand:DI 1 "register_operand" ""))) + (clobber (match_operand:DI 2 "memory_operand" ""))] "TARGET_80387 && reload_completed" [(set (match_dup 2) (match_dup 1)) @@ -2913,18 +3005,18 @@ "#") (define_split - [(set (match_operand:XF 0 "register_operand" "=f") - (float:XF (match_operand:SI 1 "memory_operand" "m"))) - (clobber (match_operand:SI 2 "memory_operand" "m"))] + [(set (match_operand:XF 0 "register_operand" "") + (float:XF (match_operand:SI 1 "memory_operand" ""))) + (clobber (match_operand:SI 2 "memory_operand" ""))] "TARGET_80387 && reload_completed" [(set (match_dup 0) (float:XF (match_dup 1)))] "") (define_split - [(set (match_operand:XF 0 "register_operand" "=f") - (float:XF (match_operand:SI 1 "register_operand" "r"))) - (clobber (match_operand:SI 2 "memory_operand" "m"))] + [(set (match_operand:XF 0 "register_operand" "") + (float:XF (match_operand:SI 1 "register_operand" ""))) + (clobber (match_operand:SI 2 "memory_operand" ""))] "TARGET_80387 && reload_completed" [(set (match_dup 2) (match_dup 1)) @@ -2954,18 +3046,18 @@ "#") (define_split - [(set (match_operand:XF 0 "register_operand" "=f") - (float:XF (match_operand:DI 1 "memory_operand" "m"))) - (clobber (match_operand:DI 2 "memory_operand" "m"))] + [(set (match_operand:XF 0 "register_operand" "") + (float:XF (match_operand:DI 1 "memory_operand" ""))) + (clobber (match_operand:DI 2 "memory_operand" ""))] "TARGET_80387 && reload_completed" [(set (match_dup 0) (float:XF (match_dup 1)))] "") (define_split - [(set (match_operand:XF 0 "register_operand" "=f") - (float:XF (match_operand:DI 1 "register_operand" "r"))) - (clobber (match_operand:DI 2 "memory_operand" "o"))] + [(set (match_operand:XF 0 "register_operand" "") + (float:XF (match_operand:DI 1 "register_operand" ""))) + (clobber (match_operand:DI 2 "memory_operand" ""))] "TARGET_80387 && reload_completed" [(set (match_dup 2) (match_dup 1)) @@ -7208,12 +7300,12 @@ byte_xor_operation: "#") (define_split - [(set (match_operand:SI 0 "register_operand" "=r,r") + [(set (match_operand:SI 0 "register_operand" "") (if_then_else:SI (match_operator 1 "comparison_operator" [(match_operand 2 "nonimmediate_operand" "") (const_int 0)]) - (match_operand:SI 3 "nonimmediate_operand" "rm,0") - (match_operand:SI 4 "nonimmediate_operand" "0,rm")))] + (match_operand:SI 3 "nonimmediate_operand" "") + (match_operand:SI 4 "nonimmediate_operand" "")))] "TARGET_CMOVE && reload_completed" [(set (cc0) (match_dup 2)) @@ -7223,12 +7315,12 @@ byte_xor_operation: "") (define_split - [(set (match_operand:SI 0 "register_operand" "=r,r") + [(set (match_operand:SI 0 "register_operand" "") (if_then_else:SI (match_operator 1 "comparison_operator" [(match_operand 2 "nonimmediate_operand" "") (match_operand 3 "general_operand" "")]) - (match_operand:SI 4 "nonimmediate_operand" "rm,0") - (match_operand:SI 5 "nonimmediate_operand" "0,rm")))] + (match_operand:SI 4 "nonimmediate_operand" "") + (match_operand:SI 5 "nonimmediate_operand" "")))] "TARGET_CMOVE && reload_completed" [(set (cc0) (compare (match_dup 2) (match_dup 3))) (set (match_dup 0) @@ -7282,12 +7374,12 @@ byte_xor_operation: "#") (define_split - [(set (match_operand:HI 0 "register_operand" "=r,r") + [(set (match_operand:HI 0 "register_operand" "") (if_then_else:HI (match_operator 1 "comparison_operator" [(match_operand 2 "nonimmediate_operand" "") (const_int 0)]) - (match_operand:HI 3 "nonimmediate_operand" "rm,0") - (match_operand:HI 4 "nonimmediate_operand" "0,rm")))] + (match_operand:HI 3 "nonimmediate_operand" "") + (match_operand:HI 4 "nonimmediate_operand" "")))] "TARGET_CMOVE && reload_completed" [(set (cc0) (match_dup 2)) @@ -7297,12 +7389,12 @@ byte_xor_operation: "") (define_split - [(set (match_operand:HI 0 "register_operand" "=r,r") + [(set (match_operand:HI 0 "register_operand" "") (if_then_else:HI (match_operator 1 "comparison_operator" [(match_operand 2 "nonimmediate_operand" "") (match_operand 3 "general_operand" "")]) - (match_operand:HI 4 "nonimmediate_operand" "rm,0") - (match_operand:HI 5 "nonimmediate_operand" "0,rm")))] + (match_operand:HI 4 "nonimmediate_operand" "") + (match_operand:HI 5 "nonimmediate_operand" "")))] "TARGET_CMOVE && reload_completed" [(set (cc0) (compare (match_dup 2) (match_dup 3))) @@ -7385,12 +7477,12 @@ byte_xor_operation: "#") (define_split - [(set (match_operand:SF 0 "register_operand" "=f,f") + [(set (match_operand:SF 0 "register_operand" "") (if_then_else:SF (match_operator 1 "comparison_operator" [(match_operand 2 "nonimmediate_operand" "") (const_int 0)]) - (match_operand:SF 3 "register_operand" "f,0") - (match_operand:SF 4 "register_operand" "0,f")))] + (match_operand:SF 3 "register_operand" "") + (match_operand:SF 4 "register_operand" "")))] "TARGET_CMOVE && reload_completed" [(set (cc0) (match_dup 2)) @@ -7400,12 +7492,12 @@ byte_xor_operation: "") (define_split - [(set (match_operand:SF 0 "register_operand" "=f,f") + [(set (match_operand:SF 0 "register_operand" "") (if_then_else:SF (match_operator 1 "comparison_operator" [(match_operand 2 "nonimmediate_operand" "") (match_operand 3 "general_operand" "")]) - (match_operand:SF 4 "register_operand" "f,0") - (match_operand:SF 5 "register_operand" "0,f")))] + (match_operand:SF 4 "register_operand" "") + (match_operand:SF 5 "register_operand" "")))] "TARGET_CMOVE && reload_completed" [(set (cc0) (compare (match_dup 2) (match_dup 3))) (set (match_dup 0) @@ -7487,12 +7579,12 @@ byte_xor_operation: "#") (define_split - [(set (match_operand:DF 0 "register_operand" "=f,f") + [(set (match_operand:DF 0 "register_operand" "") (if_then_else:DF (match_operator 1 "comparison_operator" [(match_operand 2 "nonimmediate_operand" "") (const_int 0)]) - (match_operand:DF 3 "register_operand" "f,0") - (match_operand:DF 4 "register_operand" "0,f")))] + (match_operand:DF 3 "register_operand" "") + (match_operand:DF 4 "register_operand" "")))] "TARGET_CMOVE && reload_completed" [(set (cc0) (match_dup 2)) @@ -7502,12 +7594,12 @@ byte_xor_operation: "") (define_split - [(set (match_operand:DF 0 "register_operand" "=f,f") + [(set (match_operand:DF 0 "register_operand" "") (if_then_else:DF (match_operator 1 "comparison_operator" [(match_operand 2 "nonimmediate_operand" "") (match_operand 3 "general_operand" "")]) - (match_operand:DF 4 "register_operand" "f,0") - (match_operand:DF 5 "register_operand" "0,f")))] + (match_operand:DF 4 "register_operand" "") + (match_operand:DF 5 "register_operand" "")))] "TARGET_CMOVE && reload_completed" [(set (cc0) (compare (match_dup 2) (match_dup 3))) (set (match_dup 0) @@ -7589,12 +7681,12 @@ byte_xor_operation: "#") (define_split - [(set (match_operand:XF 0 "register_operand" "=f,f") + [(set (match_operand:XF 0 "register_operand" "") (if_then_else:XF (match_operator 1 "comparison_operator" [(match_operand 2 "nonimmediate_operand" "") (const_int 0)]) - (match_operand:XF 3 "register_operand" "f,0") - (match_operand:XF 4 "register_operand" "0,f")))] + (match_operand:XF 3 "register_operand" "") + (match_operand:XF 4 "register_operand" "")))] "TARGET_CMOVE && reload_completed" [(set (cc0) (match_dup 2)) @@ -7604,12 +7696,12 @@ byte_xor_operation: "") (define_split - [(set (match_operand:XF 0 "register_operand" "=f,f") + [(set (match_operand:XF 0 "register_operand" "") (if_then_else:XF (match_operator 1 "comparison_operator" [(match_operand 2 "nonimmediate_operand" "") (match_operand 3 "general_operand" "")]) - (match_operand:XF 4 "register_operand" "f,0") - (match_operand:XF 5 "register_operand" "0,f")))] + (match_operand:XF 4 "register_operand" "") + (match_operand:XF 5 "register_operand" "")))] "TARGET_CMOVE && reload_completed" [(set (cc0) (compare (match_dup 2) (match_dup 3))) (set (match_dup 0) @@ -7663,12 +7755,12 @@ byte_xor_operation: "#") (define_split - [(set (match_operand:DI 0 "register_operand" "=&r,&r") + [(set (match_operand:DI 0 "register_operand" "") (if_then_else:DI (match_operator 1 "comparison_operator" [(match_operand 2 "nonimmediate_operand" "") (const_int 0)]) - (match_operand:DI 3 "nonimmediate_operand" "ro,0") - (match_operand:DI 4 "nonimmediate_operand" "0,ro")))] + (match_operand:DI 3 "nonimmediate_operand" "") + (match_operand:DI 4 "nonimmediate_operand" "")))] "TARGET_CMOVE && reload_completed" [(set (cc0) (match_dup 2)) @@ -7683,12 +7775,12 @@ byte_xor_operation: split_di (&operands[4], 1, &operands[9], &operands[10]);") (define_split - [(set (match_operand:DI 0 "register_operand" "=&r,&r") + [(set (match_operand:DI 0 "register_operand" "") (if_then_else:DI (match_operator 1 "comparison_operator" [(match_operand 2 "nonimmediate_operand" "") (match_operand 3 "general_operand" "")]) - (match_operand:DI 4 "nonimmediate_operand" "ro,0") - (match_operand:DI 5 "nonimmediate_operand" "0,ro")))] + (match_operand:DI 4 "nonimmediate_operand" "") + (match_operand:DI 5 "nonimmediate_operand" "")))] "TARGET_CMOVE && reload_completed" [(set (cc0) (compare (match_dup 2) (match_dup 3))) (set (match_dup 6) diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index 014f9524013..fe554a031c9 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -1405,6 +1405,14 @@ static void delete_insn_for_stacker (insn) rtx insn; { + int i; + + /* Ensure that the side effects were clobbers when deleting a PARALLEL. */ + if (GET_CODE (PATTERN (insn)) == PARALLEL) + for (i = 1; i < XVECLEN (PATTERN (insn), 0); i++) + if (GET_CODE (XVECEXP (PATTERN (insn), 0, i)) != CLOBBER) + abort (); + PUT_CODE (insn, NOTE); NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED; NOTE_SOURCE_FILE (insn) = 0; @@ -2478,8 +2486,14 @@ subst_stack_regs (insn, regstack) for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++) { if (stack_regs_mentioned_p (XVECEXP (PATTERN (insn), 0, i))) - subst_stack_regs_pat (insn, regstack, - XVECEXP (PATTERN (insn), 0, i)); + { + subst_stack_regs_pat (insn, regstack, + XVECEXP (PATTERN (insn), 0, i)); + + /* subst_stack_regs_pat may have deleted a no-op insn. */ + if (GET_CODE (insn) == NOTE) + break; + } } else subst_stack_regs_pat (insn, regstack, PATTERN (insn)); |