This is the mail archive of the
mailing list for the GCC project.
Re: builtin_bswap plus enhancements
On Thursday 10 August 2006 21:07, Falk Hueffner wrote:
> Paul Brook <firstname.lastname@example.org> writes:
> > On Thursday 10 August 2006 20:43, Falk Hueffner wrote:
> >> Chris Lattner <email@example.com> writes:
> >> > Why not add bswap16 as well?
> >> It should be unnecessary, since any attempt to express it should be
> >> picked up by the rot idiom recognizer, and the backends should then
> >> emit optimal code for constant-8 rots (and if that doesn't actually
> >> happen, we should rather fix that).
> > Is this true for machines that don't have HImode registers or arithmetic
> > operations?
> I suppose it should still be true if the machine doesn't have 16bit
> registers. However it wouldn't work if the target doesn't have any
> mode corresponding to 16 bit (although I suspect that targets
> deviating from the standard SI=32bit will become extinct at some
> point, so I don't know whether it's worth bothering...).
Where does the rothi idiom recognition happen? On trees or RTL?
In particular does the idiom recognition still work if the target only has
lsrsi3, not lsrhi3?
I was thinking of targets like ARM where arithmetic only usually happens on
SImode values. Arm has an instruction that byteswaps the low half of a
register and extends the result to full register width.
Do I need to define a named rotlhi3 pattern that fails for anything other than
a constat rotation of 8?