X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fcmm%2FPprC.hs;h=9a3a3a2cf17eaed804e59dbbaea6283d19c48166;hp=a943575d5141756f5a2ea149353d2c71d9b3c933;hb=dcf739bd7fb7de140be3bafb4ce211e2e5c7bba9;hpb=89eac8928317774fdc3f283d78d3ff3cb315db5e diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs index a943575..9a3a3a2 100644 --- a/compiler/cmm/PprC.hs +++ b/compiler/cmm/PprC.hs @@ -395,7 +395,16 @@ pprMachOpApp' mop args pprLit :: CmmLit -> SDoc pprLit lit = case lit of CmmInt i rep -> pprHexVal i rep - CmmFloat f rep -> parens (machRepCType rep) <> (rational f) + + CmmFloat f rep -> parens (machRepCType rep) <> str + where d = fromRational f :: Double + str | isInfinite d && d < 0 = ptext (sLit "-INFINITY") + | isInfinite d = ptext (sLit "INFINITY") + | isNaN d = ptext (sLit "NAN") + | otherwise = text (show d) + -- these constants come from + -- see #1861 + CmmLabel clbl -> mkW_ <> pprCLabelAddr clbl CmmLabelOff clbl i -> mkW_ <> pprCLabelAddr clbl <> char '+' <> int i CmmLabelDiffOff clbl1 clbl2 i