[project @ 2005-05-18 12:14:03 by simonmar]
authorsimonmar <unknown>
Wed, 18 May 2005 12:14:03 +0000 (12:14 +0000)
committersimonmar <unknown>
Wed, 18 May 2005 12:14:03 +0000 (12:14 +0000)
We should be using ASSIGN_DBL/PK_DBL for stores/loads respectively of
doubles.  Hopefully fixes SIGBUS on HPPA, and possible Sparc too.

ghc/compiler/cmm/PprC.hs

index 1cb5366..f2c607b 100644 (file)
@@ -184,6 +184,10 @@ pprStmt stmt = case stmt of
        -> ptext SLIT("ASSIGN_Word64") <> 
                parens (mkP_ <> pprExpr1 dest <> comma <> pprExpr src) <> semi
 
+       | rep == F64 && wordRep /= I64
+       -> ptext SLIT("ASSIGN_DBL") <> 
+               parens (mkP_ <> pprExpr1 dest <> comma <> pprExpr src) <> semi
+
        | otherwise
        -> hsep [ pprExpr (CmmLoad dest rep), equals, pprExpr src <> semi ]
        where
@@ -300,6 +304,9 @@ pprExpr e = case e of
     CmmLoad e I64 | wordRep /= I64
        -> ptext SLIT("PK_Word64") <> parens (mkP_ <> pprExpr1 e)
 
+    CmmLoad e F64 | wordRep /= I64
+       -> ptext SLIT("PK_DBL") <> parens (mkP_ <> pprExpr1 e)
+
     CmmLoad (CmmReg r) rep 
        | isPtrReg r && rep == wordRep
        -> char '*' <> pprAsPtrReg r