]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm.md (addsi3_cbranch_scratch): Correct constraints.
authorPaul Brook <pbrook@gcc.gnu.org>
Tue, 12 Oct 2004 13:56:03 +0000 (13:56 +0000)
committerPaul Brook <pbrook@gcc.gnu.org>
Tue, 12 Oct 2004 13:56:03 +0000 (13:56 +0000)
* config/arm/arm.md (addsi3_cbranch_scratch): Correct constraints.
Handle negative constants.

From-SVN: r88929

gcc/config/arm/arm.md

index 13e81e495edc73b6e7ce5ee2a08f6b76db04d6c7..86113e7135e91f88cfa1c18ffc33110b7cffc2e2 100644 (file)
         (match_operator 3 "comparison_operator"
          [(plus:SI
            (match_operand:SI 1 "s_register_operand" "%l,l,l,0")
-           (match_operand:SI 2 "reg_or_int_operand" "J,l,I,L"))
+           (match_operand:SI 2 "reg_or_int_operand" "J,l,L,IJ"))
           (const_int 0)])
         (label_ref (match_operand 4 "" ""))
         (pc)))
         output_asm_insn (\"cmn\t%1, %2\", operands);
         break;
        case 2:
-        output_asm_insn (\"add\t%0, %1, %2\", operands);
+        if (INTVAL (operands[2]) < 0)
+          output_asm_insn (\"sub\t%0, %1, %2\", operands);
+        else
+          output_asm_insn (\"add\t%0, %1, %2\", operands);
         break;
        case 3:
-        output_asm_insn (\"add\t%0, %0, %2\", operands);
+        if (INTVAL (operands[2]) < 0)
+          output_asm_insn (\"sub\t%0, %0, %2\", operands);
+        else
+          output_asm_insn (\"add\t%0, %0, %2\", operands);
         break;
        }