diff options
-rw-r--r-- | compiler/GHC/CmmToC.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/GHC/CmmToC.hs b/compiler/GHC/CmmToC.hs index 60059124b2..30568b0995 100644 --- a/compiler/GHC/CmmToC.hs +++ b/compiler/GHC/CmmToC.hs @@ -645,7 +645,9 @@ staticLitsToWords platform = go . foldMap decomposeMultiWord = [floatToWord32 n] decomposeMultiWord (CmmInt n W64) | W32 <- wordWidth platform - = [CmmInt hi W32, CmmInt lo W32] + = case platformByteOrder platform of + BigEndian -> [CmmInt hi W32, CmmInt lo W32] + LittleEndian -> [CmmInt lo W32, CmmInt hi W32] where hi = n `shiftR` 32 lo = n .&. 0xffffffff |