Add support for byte endian swapping for Word 16/32/64.
authorIan Lynagh <ian@well-typed.com>
Sun, 9 Jun 2013 11:10:35 +0000 (12:10 +0100)
committerIan Lynagh <ian@well-typed.com>
Sun, 9 Jun 2013 11:10:35 +0000 (12:10 +0100)
commit1c5b0511a89488f5280523569d45ee61c0d09ffa
treeccdb8a6ff90162e4d26318b901c473ab5a7f90cc
parent972c044d5da72cee3a43209ccb41e2229914211c
Add support for byte endian swapping for Word 16/32/64.

* Exposes bSwap{,16,32,64}# primops
* Add a new machops MO_BSwap
* Use a Stg implementation (hs_bswap{16,32,64}) for other implementation
  in NCG.
* Generate bswap in X86 NCG for 32 and 64 bits, and for 16 bits, bswap+shr
  instead of using xchg.
* Generate llvm.bswap intrinsics in llvm codegen.

Patch from Vincent Hanquez.
compiler/cmm/CmmMachOp.hs
compiler/cmm/PprC.hs
compiler/codeGen/StgCmmPrim.hs
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
compiler/nativeGen/CPrim.hs
compiler/nativeGen/PPC/CodeGen.hs
compiler/nativeGen/SPARC/CodeGen.hs
compiler/nativeGen/X86/CodeGen.hs
compiler/nativeGen/X86/Instr.hs
compiler/nativeGen/X86/Ppr.hs
compiler/prelude/primops.txt.pp