proposal/RFC: add bSwap to base in Data.Bits

Vincent Hanquez tab at
Thu May 16 11:46:10 CEST 2013

On Thu, May 16, 2013 at 10:59:03AM +0200, Henning Thielemann wrote:
> If it would work on bits, I would certainly not call it swap, but
> 'reverse'. On the MC68000 processor there was an assembly
> instruction "swap" that swapped upper and lower 16 bits of a 32 bit
> word.
> However if you really only want to swap byte order (and not 16 bit
> words within 64 bit words and so on), then how about just using a
> package like 'endian':

I'm sorry, i completely forgot to put the rationale of this in the original proposal.

The point of this exercise is to expose some new primops that swap bytes
efficiently (by generating the proper assembly code), not using an existing


More information about the Libraries mailing list