Subject: Re: [PATCH] powerpc: 32 bit getcpu VDSO function uses 64 bit instructions

From: Peter Bergner <[email-masked]>
Date: Thu, 27 Nov 2014 11:41:40 -0600

On Thu, 2014-11-27 at 10:08 -0600, Segher Boessenkool wrote:
> On Wed, Nov 26, 2014 at 05:50:27PM -0600, Peter Bergner wrote:
> > Nope, you don't get a SIGILL when executing 64-bit instructions in
> > 32-bit mode, so it'll happily just execute the instruction, doing
> > a full 64-bit compare.  I'm guessing that the upper 32-bits of both
> > r3 and r4 contain zeros, so we're probably just getting lucky.
> 
> You will get a SIGILL if you run on 32-bit hardware.

Ha, I completely forgot about 32-bit hardware.  Anyway, I looked
at the ISA, and cmpdi and cmpwi are just extended mnemonics for
cmpi, with cmpdi setting the L field to 1.  Probably on 32-bit
hardware, the hardware is just ignoring the L bit being set and
doing a cmpwi for us???

Peter