diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2018-06-14 23:13:16 +0100 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2018-06-15 07:24:01 +0100 |
commit | 01c9d95aca12caf5c954320a2a82335b32568554 (patch) | |
tree | 2924e62534687daad012814d5317418142b68618 | |
parent | db5ef2b4f9d22738ae75db29c3e45e370efa4169 (diff) | |
download | haskell-01c9d95aca12caf5c954320a2a82335b32568554.tar.gz |
UNREG: PprC: add support for of W16 literals (Ticket #15237)
Fix UNREG build failure for 32-bit targets.
This change is an equivalent of commit
0238a6c78102d43dae2f56192bd3486e4f9ecf1d
("UNREG: PprC: add support for of W32 literals")
The change allows combining two subwords into one word
on 32-bit targets. Tested on nios2-unknown-linux-gnu.
GHC Trac Issues: #15237
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-rw-r--r-- | compiler/cmm/PprC.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs index e46fff195d..8b30bbf692 100644 --- a/compiler/cmm/PprC.hs +++ b/compiler/cmm/PprC.hs @@ -546,6 +546,14 @@ pprStatics dflags (CmmStaticLit (CmmInt a W32) : rest) else pprStatics dflags (CmmStaticLit (CmmInt ((shiftL b 32) .|. a) W64) : rest) +pprStatics dflags (CmmStaticLit (CmmInt a W16) : + CmmStaticLit (CmmInt b W16) : rest) + | wordWidth dflags == W32 + = if wORDS_BIGENDIAN dflags + then pprStatics dflags (CmmStaticLit (CmmInt ((shiftL a 16) .|. b) W32) : + rest) + else pprStatics dflags (CmmStaticLit (CmmInt ((shiftL b 16) .|. a) W32) : + rest) pprStatics dflags (CmmStaticLit (CmmInt _ w) : _) | w /= wordWidth dflags = pprPanic "pprStatics: cannot emit a non-word-sized static literal" (ppr w) |