From d1e7092f2c4ddf8ee07da15bcef6828923b391a2 Mon Sep 17 00:00:00 2001 From: wolfgang Date: Sat, 24 Sep 2005 04:22:22 +0000 Subject: [PATCH] [project @ 2005-09-24 04:22:22 by wolfgang] x86 & PIC: make floating point constants on x86 PIC-aware --- ghc/compiler/nativeGen/MachCodeGen.hs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ghc/compiler/nativeGen/MachCodeGen.hs b/ghc/compiler/nativeGen/MachCodeGen.hs index 8560d4a..50d886c 100644 --- a/ghc/compiler/nativeGen/MachCodeGen.hs +++ b/ghc/compiler/nativeGen/MachCodeGen.hs @@ -735,12 +735,14 @@ getRegister leaf getRegister (CmmLit (CmmFloat f F32)) = do lbl <- getNewLabelNat - let code dst = toOL [ + dynRef <- cmmMakeDynamicReference addImportNat False lbl + Amode addr addr_code <- getAmode dynRef + let code dst = LDATA ReadOnlyData [CmmDataLabel lbl, - CmmStaticLit (CmmFloat f F32)], - GLD F32 (ImmAddr (ImmCLbl lbl) 0) dst - ] + CmmStaticLit (CmmFloat f F32)] + `consOL` (addr_code `snocOL` + GLD F32 addr dst) -- in return (Any F32 code) @@ -756,12 +758,14 @@ getRegister (CmmLit (CmmFloat d F64)) | otherwise = do lbl <- getNewLabelNat - let code dst = toOL [ + dynRef <- cmmMakeDynamicReference addImportNat False lbl + Amode addr addr_code <- getAmode dynRef + let code dst = LDATA ReadOnlyData [CmmDataLabel lbl, - CmmStaticLit (CmmFloat d F64)], - GLD F64 (ImmAddr (ImmCLbl lbl) 0) dst - ] + CmmStaticLit (CmmFloat d F64)] + `consOL` (addr_code `snocOL` + GLD F64 addr dst) -- in return (Any F64 code) -- 1.7.10.4