summaryrefslogtreecommitdiff
path: root/includes/Cmm.h
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 /includes/Cmm.h
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 'includes/Cmm.h')
-rw-r--r--includes/Cmm.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/Cmm.h b/includes/Cmm.h
index 802ab51a5a..908a3763ca 100644
--- a/includes/Cmm.h
+++ b/includes/Cmm.h
@@ -855,7 +855,7 @@
src_p = (src) + SIZEOF_StgMutArrPtrs + WDS(src_off); \
bytes = WDS(n); \
\
- prim %memcpy(dst_p, src_p, bytes, WDS(1)); \
+ prim %memcpy(dst_p, src_p, bytes, SIZEOF_W); \
\
dst_cards_p = dst_elems_p + WDS(StgMutArrPtrs_ptrs(dst)); \
setCards(dst_cards_p, dst_off, n); \
@@ -875,9 +875,9 @@
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); \
} \
\
dst_cards_p = dst_elems_p + WDS(StgMutArrPtrs_ptrs(dst)); \