Adding unsafeShiftL, unsafeShiftR to Data.Bits(Bits)

Brandon Allbery allbery.b at
Mon Aug 22 07:57:32 CEST 2011

On Sun, Aug 21, 2011 at 19:42, Thomas Schilling <nominolo at>wrote:

> On 16 August 2011 15:39, Johan Tibell <johan.tibell at> wrote:
> > the CPU masks out the
> > last 5 bits in the shift amount and only uses those when shifting
> As an aside, this may be how it's specified now in all modern x86(-64)
> CPUs, but it definitely wasn't true for all CPUs.  Some older x86 CPUs
> actually would set the value to zero if the shift amount was greater
> than the word length.  (I'm not sure which, but may have been
> different in early 386 CPUs and Athlon CPUs.)

FWIW I vaguely recall a bit of an outcry when this changed on Intel CPUs.
 It may have been around the 80486.

brandon s allbery                                      allbery.b at
wandering unix systems administrator (available)     (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list