summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2015-06-16 20:16:08 +0200
committerBen Gamari <ben@smart-cactus.org>2015-06-16 20:16:08 +0200
commit681973c31c614185229bdae4f6b7ab4f6e64753d (patch)
tree9ef8257217c05f4a05828a04e24199f42e0e2fe0 /rts
parentd20031d4c88b256cdae264cb05d9d850e973d956 (diff)
downloadhaskell-681973c31c614185229bdae4f6b7ab4f6e64753d.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 'rts')
-rw-r--r--rts/PrimOps.cmm8
1 files changed, 4 insertions, 4 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index 2e6ca46ede..26a67167bc 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -186,7 +186,7 @@ stg_resizzeMutableByteArrayzh ( gcptr mba, W_ new_size )
// copy over old content
prim %memcpy(BYTE_ARR_CTS(new_mba), BYTE_ARR_CTS(mba),
- StgArrWords_bytes(mba), WDS(1));
+ StgArrWords_bytes(mba), SIZEOF_W);
return (new_mba);
}
@@ -438,7 +438,7 @@ stg_copySmallArrayzh ( gcptr src, W_ src_off, gcptr dst, W_ dst_off, W_ n)
dst_p = dst + SIZEOF_StgSmallMutArrPtrs + WDS(dst_off);
src_p = src + SIZEOF_StgSmallMutArrPtrs + WDS(src_off);
bytes = WDS(n);
- prim %memcpy(dst_p, src_p, bytes, WDS(1));
+ prim %memcpy(dst_p, src_p, bytes, SIZEOF_W);
return ();
}
@@ -453,9 +453,9 @@ stg_copySmallMutableArrayzh ( gcptr src, W_ src_off, gcptr dst, W_ dst_off, W_ n
src_p = src + SIZEOF_StgSmallMutArrPtrs + WDS(src_off);
bytes = WDS(n);
if (src == dst) {
- prim %memmove(dst_p, src_p, bytes, WDS(1));
+ prim %memmove(dst_p, src_p, bytes, SIZEOF_W);
} else {
- prim %memcpy(dst_p, src_p, bytes, WDS(1));
+ prim %memcpy(dst_p, src_p, bytes, SIZEOF_W);
}
return ();