(plus:AM (match_operand:AM 1 "register_operand" " 0,0")
(match_operand:AM 2 "reg_or_imm_operand" " r,I")))]
"1"
- "{add<msuffix>\t%0,%2|%w0 += %w1}"
+ "{add<msuffix>\t%0,%2|%w0 += %w2}"
[(set_attr "type" "<mtype>")])
;;; Subtraction
(minus:AM (match_operand:AM 1 "register_operand" " 0")
(match_operand:AM 2 "register_operand" " r")))]
""
- "{sub<msuffix>\t%0,%2|%w0 -= %w1}"
+ "{sub<msuffix>\t%0,%2|%w0 -= %w2}"
[(set_attr "type" "<mtype>")])
;;; Negation
--- /dev/null
+/* Check add and sub instructions. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+long foo (long x, long y)
+{
+ return y - x + 4;
+}
+
+/* { dg-final { scan-assembler-not {sub\t(%r.),\1\n} } } */
+/* { dg-final { scan-assembler {sub\t(\%r.),(\%r.)\n} } } */
+/* { dg-final { scan-assembler {add\t(\%r.),4\n} } } */
--- /dev/null
+/* Check add and sub instructions (pseudoc asm dialect). */
+/* { dg-do compile } */
+/* { dg-options "-masm=pseudoc" } */
+
+long foo (long x, long y)
+{
+ return y - x + 4;
+}
+
+/* { dg-final { scan-assembler-not {\t(r.) -= \1\n} } } */
+/* { dg-final { scan-assembler {\t(r.) -= (r.)\n} } } */
+/* { dg-final { scan-assembler {\t(r.) \+= 4\n} } } */
+