From: Richard Stallman Date: Sat, 31 Oct 1992 05:46:36 +0000 (+0000) Subject: (addsi3, subsi3): Don't allow -32768 as the second operand; X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=71cd5224b3f1f86a9b5f5701dd5e1e92e8535fd0;p=gcc.git (addsi3, subsi3): Don't allow -32768 as the second operand; the assembler complains if the instruction fills a delay slot. From-SVN: r2661 --- diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index 8f3274b44d0..d5a9faa6f05 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -293,16 +293,27 @@ (set_attr "mode" "SF") (set_attr "length" "1")]) -(define_insn "addsi3" +(define_expand "addsi3" [(set (match_operand:SI 0 "register_operand" "=d") - (plus:SI (match_operand:SI 1 "arith_operand" "%d") + (plus:SI (match_operand:SI 1 "reg_or_0_operand" "dJ") (match_operand:SI 2 "arith_operand" "dI")))] "" + " +{ + if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == -32768) + operands[2] = force_reg (SImode, operands[2]); +}") + +(define_insn "addsi3_internal" + [(set (match_operand:SI 0 "register_operand" "=d") + (plus:SI (match_operand:SI 1 "reg_or_0_operand" "dJ") + (match_operand:SI 2 "arith_operand" "dI")))] + "GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -32768" "* { return (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0) - ? \"subu\\t%0,%1,%n2\" - : \"addu\\t%0,%1,%2\"; + ? \"subu\\t%0,%z1,%n2\" + : \"addu\\t%0,%z1,%2\"; }" [(set_attr "type" "arith") (set_attr "mode" "SI") @@ -485,11 +496,22 @@ (set_attr "mode" "SF") (set_attr "length" "1")]) -(define_insn "subsi3" +(define_expand "subsi3" [(set (match_operand:SI 0 "register_operand" "=d") (minus:SI (match_operand:SI 1 "reg_or_0_operand" "dJ") (match_operand:SI 2 "arith_operand" "dI")))] "" + " +{ + if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == -32768) + operands[2] = force_reg (SImode, operands[2]); +}") + +(define_insn "subsi3_internal" + [(set (match_operand:SI 0 "register_operand" "=d") + (minus:SI (match_operand:SI 1 "reg_or_0_operand" "dJ") + (match_operand:SI 2 "arith_operand" "dI")))] + "GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -32768" "* { return (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)