This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix simplify_immed_subreg
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: Richard dot Earnshaw at arm dot com, gcc-patches at gcc dot gnu dot org
- Date: Tue, 13 Jan 2004 13:35:43 +0000
- Subject: Re: [PATCH] Fix simplify_immed_subreg
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> On 12-jan-04, at 17:06, Richard Earnshaw wrote:
> > On ARM hosts a shift by a register is done modulo 256 (whereas clearly
> > on
> > most platforms it must be done mod 32).
>
> [I'm sorry I'll have to be political here...]
>
> You probably mean "on x86 and friends" instead of "on most platforms".
>
> For example, on PowerPC, it's done either mod 64 (for 32-bit ops) or
> mod 128 (for 64-bit ops); on Alpha, it's done mod 64; on M16C, shifts
> take a signed number (and shift either left or right accordingly), and
> have a range of either -8..8 or -16..16, other values give undefined
> results. And as you mention, on ARM it's mod 256.
>
> If you had said "on most machines" I would (grudgingly) not have
> replied at all, but I couldn't resist now ;-)
>
I was over-generalizing. Most likely it must be 'mod
HOST_BITS_PER_WIDE_INT' on most machines, or other people would have
spotted the bug before I did...
R.