This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: Patch to implement rotates by zero


Hmm, having had a bit more chance to think about it, I'd like to
stick with the original patch...

cgd@broadcom.com writes:
> it just makes the binutils code simpler.  People who do rotate by 0
> and expect an optimization should lose.  it wouldn't happen if they
> had real rotate instructions (i.e., they'd get an actual instruction).
> So, they might as well get the 'normal' rotate macro expansion.

I don't really understand what you mean by "it wouldn't happen if they
had real rotate instructions".  If you don't have a real rotate insn,
you'd get "sll" instead or "ror", but either way you'd get exactly
one instruction.

As for it making the code simpler...  well, yes, I suppose it does
slightly.  But it would have been even simpler if we didn't bother
having "rol" or "ror" macros at all.  I think now we have them, we
have to treat them as far as possible like other macros.  To me,
it seems consistent with the way other constant macros are
treated that:

        sll     at,R2,0
        srl     R1,R2,0
        or      R1,R1,at

becomes:

        sll     R1,R2,0

Not that the patch justifies this much attention, really. ;)

Richard


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