Patch: fix to sparc.c:arith_4096_operand

Richard Henderson rth@redhat.com
Fri Mar 8 18:53:00 GMT 2002


Incidentally, the places this is used in sparc.md are not really
correct.  While adding 4096 is best done with a subtract insn in
the assembly, the rtl should not be made non-canonical in this way.

Instead you should have a constraint letter, possibly like so:

	(C) == 'O' ? SPARC_SIMM13_P (-(VALUE))

(define_insn "*addsi3"
  [(set (match_operand:SI 0 "register_operand" "=r,r,d")
        (plus:SI (match_operand:SI 1 "arith_operand" "%r,r,d")
                 (match_operand:SI 2 "arith_operand" "rI,O,d")))]
  ""
  "@
   add\\t%1, %2, %0
   sub\\t%1, %N2, %0
   fpadd32s\\t%1, %2, %0"
  [(set_attr "type" "*,*,fp")])

where %N negates the operand.


r~



More information about the Gcc-patches mailing list