diff options
author | Austin Seipp <aseipp@pobox.com> | 2013-07-17 03:41:01 -0500 |
---|---|---|
committer | Austin Seipp <aseipp@pobox.com> | 2013-07-17 04:18:52 -0500 |
commit | 18087a119b47368b15231c43402c81888c75957d (patch) | |
tree | 9bc069d9d0540fd40dc75745f4ab80218c1bf6d3 /compiler/nativeGen/PPC/CodeGen.hs | |
parent | 2f99cdb9f9e561f29d726fea90a5a98de7499a2d (diff) | |
download | haskell-18087a119b47368b15231c43402c81888c75957d.tar.gz |
Add support for byte endian swapping for Word 16/32/64.
* Exposes bSwap{,16,32,64}# primops
* Add a new machop: 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.
Authored-by: Vincent Hanquez <tab@snarc.org>
Signed-off-by: Austin Seipp <aseipp@pobox.com>
Diffstat (limited to 'compiler/nativeGen/PPC/CodeGen.hs')
-rw-r--r-- | compiler/nativeGen/PPC/CodeGen.hs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs index 39b64002dc..65533d8f9a 100644 --- a/compiler/nativeGen/PPC/CodeGen.hs +++ b/compiler/nativeGen/PPC/CodeGen.hs @@ -1155,6 +1155,7 @@ genCCall' dflags gcp target dest_regs args0 MO_Memset -> (fsLit "memset", False) MO_Memmove -> (fsLit "memmove", False) + MO_BSwap w -> (fsLit $ bSwapLabel w, False) MO_PopCnt w -> (fsLit $ popCntLabel w, False) MO_S_QuotRem {} -> unsupported |