diff options
| author | Ben Gamari <ben@smart-cactus.org> | 2015-06-16 20:16:16 +0200 |
|---|---|---|
| committer | Ben Gamari <ben@smart-cactus.org> | 2015-06-16 20:16:16 +0200 |
| commit | a0d158fdd1db6b8f586bcbc1acd317d9836fb9dc (patch) | |
| tree | 82a297bb2bfef97a20ba33d106b35ed9286579ee /compiler/nativeGen/SPARC/CodeGen.hs | |
| parent | d46fdf25888e624e78eefed64bd13dc205ed5fef (diff) | |
| parent | 681973c31c614185229bdae4f6b7ab4f6e64753d (diff) | |
| download | haskell-a0d158fdd1db6b8f586bcbc1acd317d9836fb9dc.tar.gz | |
Encode alignment in MO_Memcpy and friends
Summary:
Alignment needs to be a compile-time constant. Previously the code
generators had to jump through hoops to ensure this was the case as the
alignment was passed as a CmmExpr in the arguments list. Now we take
care of this up front.
This fixes #8131.
Authored-by: Reid Barton <rwbarton@gmail.com>
Dusted-off-by: Ben Gamari <ben@smart-cactus.org>
Tests for T8131
Test Plan: Validate
Reviewers: rwbarton, austin
Reviewed By: rwbarton, austin
Subscribers: bgamari, carter, thomie
Differential Revision: https://phabricator.haskell.org/D624
GHC Trac Issues: #8131
Diffstat (limited to 'compiler/nativeGen/SPARC/CodeGen.hs')
| -rw-r--r-- | compiler/nativeGen/SPARC/CodeGen.hs | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/compiler/nativeGen/SPARC/CodeGen.hs b/compiler/nativeGen/SPARC/CodeGen.hs index a9d861946e..4792933366 100644 --- a/compiler/nativeGen/SPARC/CodeGen.hs +++ b/compiler/nativeGen/SPARC/CodeGen.hs @@ -404,19 +404,8 @@ genCCall (PrimTarget MO_WriteBarrier) _ _ genCCall (PrimTarget (MO_Prefetch_Data _)) _ _ = return $ nilOL -genCCall target dest_regs args0 - = do - -- need to remove alignment information - let args | PrimTarget mop <- target, - (mop == MO_Memcpy || - mop == MO_Memset || - mop == MO_Memmove) - = init args0 - - | otherwise - = args0 - - -- work out the arguments, and assign them to integer regs +genCCall target dest_regs args + = do -- work out the arguments, and assign them to integer regs argcode_and_vregs <- mapM arg_to_int_vregs args let (argcodes, vregss) = unzip argcode_and_vregs let vregs = concat vregss @@ -653,9 +642,9 @@ outOfLineMachOp_table mop MO_UF_Conv w -> fsLit $ word2FloatLabel w - MO_Memcpy -> fsLit "memcpy" - MO_Memset -> fsLit "memset" - MO_Memmove -> fsLit "memmove" + MO_Memcpy _ -> fsLit "memcpy" + MO_Memset _ -> fsLit "memset" + MO_Memmove _ -> fsLit "memmove" MO_BSwap w -> fsLit $ bSwapLabel w MO_PopCnt w -> fsLit $ popCntLabel w |
