[PATCH] MIPS gas: 64 bit aware rol/ror macros

Thiemo Seufer ica2_ts@csv.ica.uni-stuttgart.de
Tue May 14 00:02:00 GMT 2002


cgd@broadcom.com wrote:
[snip]
> > I thought about using drol/dror, but why should someone expect to have
> > a 32 bit "rotate" of a 64 bit register? It looks like the la/dla
> > weirdness.
> 
> oh, that one's easy:
> 
> 	lw	$2, addr
> 	ror	$3, $2, 1
> 
> what is bit 31 of $3?

Hm, rotating an address to a misaligned value? Not the most convincing
exmaple, I assume. :-)

> choices are:
> 
> 	bit 0 of $2
> 
> 	bit 32 of $2, a.k.a. the sign-extension of bit 31 of $2?
> 
> The former is what one would get if one ran the code on a machine w/
> 32-bit registers.  I.e., it allows upward compatibility.  Also, even
> on a 64-bit system it's a useful operation in its own right.

It would be as useful as "rotate half" or "rotate byte".
Ok, dro[lr] helps for compatibility, so I'll change my patch.


Thiemo



More information about the Binutils mailing list