summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheng Shao <astrohavoc@gmail.com>2022-03-08 09:35:38 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-03-11 20:00:01 -0500
commit9e67c69e8421f1223a1d14a764740095adeaf89b (patch)
treeeb30f482bba39b07edba1e5b40f3a569e04fe59e
parent6bdcd5573a1fe67dd872c55e5911a1186071c5d3 (diff)
downloadhaskell-9e67c69e8421f1223a1d14a764740095adeaf89b.tar.gz
CmmToC: fix Double# literal payload for 32-bit targets
Contrary to the legacy comment, the splitting didn't happen and we ended up with a single StgWord64 literal in the output code! Let's just do the splitting here.
-rw-r--r--compiler/GHC/CmmToC.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/GHC/CmmToC.hs b/compiler/GHC/CmmToC.hs
index 30568b0995..9fe20cc098 100644
--- a/compiler/GHC/CmmToC.hs
+++ b/compiler/GHC/CmmToC.hs
@@ -638,9 +638,8 @@ staticLitsToWords platform = go . foldMap decomposeMultiWord
-- single-word (or smaller) literals.
decomposeMultiWord :: CmmLit -> [CmmLit]
decomposeMultiWord (CmmFloat n W64)
- -- This will produce a W64 integer, which will then be broken up further
- -- on the next iteration on 32-bit platforms.
- = [doubleToWord64 n]
+ | W32 <- wordWidth platform = decomposeMultiWord (doubleToWord64 n)
+ | otherwise = [doubleToWord64 n]
decomposeMultiWord (CmmFloat n W32)
= [floatToWord32 n]
decomposeMultiWord (CmmInt n W64)