Hi all,
I was under the impression that simple code like the below, which swaps
the endianness of a block of data, ought to be near C speed:
-8<--8<--8<--8<-
module Main (main) where
import Word (Word32)
import Foreign.Ptr (Ptr)
import Foreign.Marshal.Array (mall
Ian Lynagh wrote:
Hi all,
I was under the impression that simple code like the below, which swaps
the endianness of a block of data, ought to be near C speed:
[...]
poke p (shiftL x 24 .|. shiftL (x .&. 0xff00) 8
.|. (shiftR x 8 .&. 0xff00)
wolfgang.thaller:
> Ian Lynagh wrote:
> >Hi all,
> >
> >I was under the impression that simple code like the below, which swaps
> >the endianness of a block of data, ought to be near C speed:
> >
> >[...]
> > poke p (shiftL x 24 .|. shiftL (x .&. 0xff00) 8
> > .|. (shi