;; add instruction.
;; Some assemblers apparently won't accept two addresses added together.
+;; ??? The condition should be improved to reject the case of two
+;; symbolic constants.
+
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=d,d,d")
(plus:SI (match_operand:SI 1 "arith32_operand" "%dn,i,dn")
else if (INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) < 32)
return \"addo %1,%2,%0\";
}
+ /* Non-canonical results (op1 == const, op2 != const) have been seen
+ in reload output when both operands were symbols before reload, so
+ we deal with it here. This may be a fault of the constraints above. */
if (CONSTANT_P (operands[1]))
- return \"lda %1+%2,%0\";
+ {
+ if (CONSTANT_P (operands[2]))
+ return \"lda %1+%2,%0\";
+ else
+ return \"lda %1(%2),%0\";
+ }
return \"lda %2(%1),%0\";
}")