Adding unsafeShiftL, unsafeShiftR to Data.Bits(Bits)

Thomas Schilling nominolo at
Mon Aug 22 01:42:12 CEST 2011

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.)

/ Thomas

More information about the Libraries mailing list