Commit 01c9d95a authored by Sergei Trofimovich's avatar Sergei Trofimovich
Browse files

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
("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: default avatarSergei Trofimovich <>
parent db5ef2b4
......@@ -546,6 +546,14 @@ pprStatics dflags (CmmStaticLit (CmmInt a W32) :
else pprStatics dflags (CmmStaticLit (CmmInt ((shiftL b 32) .|. a) W64) :
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) :
else pprStatics dflags (CmmStaticLit (CmmInt ((shiftL b 16) .|. a) W32) :
pprStatics dflags (CmmStaticLit (CmmInt _ w) : _)
| w /= wordWidth dflags
= pprPanic "pprStatics: cannot emit a non-word-sized static literal" (ppr w)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment