This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Review microblaze.md, required changes


Richard Henderson wrote:

 > (define_insn "subsi3"
 >   [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d")
 >         (minus:SI (match_operand:SI 1 "arith_operand" "dJ,dJ,dJ,I,i")
 >                   (match_operand:SI 2 "arith_operand" "d,I,i,dJ,dJ")))]
...
 > (define_insn "subdi3"
 >   [(set (match_operand:DI 0 "register_operand" "=d,d,d,d")
 >         (minus:DI (match_operand:DI 1 "register_operand" "d,d,d,d")
 >                   (match_operand:DI 2 "arith_operand" "d,P,J,N")))]

You can ditch the immediate alternatives to operand 2; those should have been canonicalized to addition. You can ditch the pure zero alternatives as well, those should have been discarded entirely.

You might do well to write subdi3 as

(define_insn "subdi3"
  [(set (match_operand:DI 0 "register_operand" "=d,d")
        (minus:DI (match_operand:DI 1 "arith_operand" "d,n")
                  (match_operand:DI 2 "register_operand" "d,d")))]
  ""
  "@
   rsub\t%L0,%L2,%L1\;rsubc\t%M0,%M2,%M1
   rsubi\t%L0,%L2,%L1\;rsubic\t%M0,%M2,%M1"
  ...)

And, really, subsi3 shouldn't be much different.

Simplified both subsi3 and subdi3. Also fixed bug in ashl*.


http://gcc.gnu.org/viewcvs?view=revision&revision=156909
or
svn diff svn://gcc.gnu.org/svn/gcc/branches/microblaze -r 156908:156909

--
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]