summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToAsm/SPARC/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/CmmToAsm/SPARC/CodeGen')
-rw-r--r--compiler/GHC/CmmToAsm/SPARC/CodeGen/Amode.hs4
-rw-r--r--compiler/GHC/CmmToAsm/SPARC/CodeGen/Base.hs7
-rw-r--r--compiler/GHC/CmmToAsm/SPARC/CodeGen/CondCode.hs6
-rw-r--r--compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen32.hs16
4 files changed, 15 insertions, 18 deletions
diff --git a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Amode.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Amode.hs
index d6c9d7b360..75eba25023 100644
--- a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Amode.hs
+++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Amode.hs
@@ -27,8 +27,8 @@ getAmode
-> NatM Amode
getAmode tree@(CmmRegOff _ _)
- = do dflags <- getDynFlags
- getAmode (mangleIndexTree dflags tree)
+ = do platform <- getPlatform
+ getAmode (mangleIndexTree platform tree)
getAmode (CmmMachOp (MO_Sub _) [x, CmmLit (CmmInt i _)])
| fits13Bits (-i)
diff --git a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Base.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Base.hs
index cf249303e4..f00e60ca93 100644
--- a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Base.hs
+++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Base.hs
@@ -23,7 +23,6 @@ import GHC.CmmToAsm.Format
import GHC.Platform.Reg
import GHC.Platform.Regs
-import GHC.Driver.Session
import GHC.Cmm
import GHC.Cmm.Ppr.Expr () -- For Outputable instances
import GHC.Platform
@@ -109,11 +108,11 @@ getRegisterReg platform (CmmGlobal mid)
-- Expand CmmRegOff. ToDo: should we do it this way around, or convert
-- CmmExprs into CmmRegOff?
-mangleIndexTree :: DynFlags -> CmmExpr -> CmmExpr
+mangleIndexTree :: Platform -> CmmExpr -> CmmExpr
-mangleIndexTree dflags (CmmRegOff reg off)
+mangleIndexTree platform (CmmRegOff reg off)
= CmmMachOp (MO_Add width) [CmmReg reg, CmmLit (CmmInt (fromIntegral off) width)]
- where width = typeWidth (cmmRegType dflags reg)
+ where width = typeWidth (cmmRegType platform reg)
mangleIndexTree _ _
= panic "SPARC.CodeGen.Base.mangleIndexTree: no match"
diff --git a/compiler/GHC/CmmToAsm/SPARC/CodeGen/CondCode.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/CondCode.hs
index e501d799f2..3f8912a9c4 100644
--- a/compiler/GHC/CmmToAsm/SPARC/CodeGen/CondCode.hs
+++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/CondCode.hs
@@ -87,15 +87,15 @@ condIntCode cond x y = do
condFltCode :: Cond -> CmmExpr -> CmmExpr -> NatM CondCode
condFltCode cond x y = do
- dflags <- getDynFlags
+ platform <- getPlatform
(src1, code1) <- getSomeReg x
(src2, code2) <- getSomeReg y
tmp <- getNewRegNat FF64
let
promote x = FxTOy FF32 FF64 x tmp
- pk1 = cmmExprType dflags x
- pk2 = cmmExprType dflags y
+ pk1 = cmmExprType platform x
+ pk2 = cmmExprType platform y
code__2 =
if pk1 `cmmEqType` pk2 then
diff --git a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen32.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen32.hs
index ee67bd4a9d..8d2c6c33f6 100644
--- a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen32.hs
+++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen32.hs
@@ -26,7 +26,6 @@ import GHC.Platform.Reg
import GHC.Cmm
import Control.Monad (liftM)
-import GHC.Driver.Session
import OrdList
import Outputable
@@ -49,14 +48,13 @@ getSomeReg expr = do
getRegister :: CmmExpr -> NatM Register
getRegister (CmmReg reg)
- = do dflags <- getDynFlags
- let platform = targetPlatform dflags
- return (Fixed (cmmTypeFormat (cmmRegType dflags reg))
+ = do platform <- getPlatform
+ return (Fixed (cmmTypeFormat (cmmRegType platform reg))
(getRegisterReg platform reg) nilOL)
getRegister tree@(CmmRegOff _ _)
- = do dflags <- getDynFlags
- getRegister (mangleIndexTree dflags tree)
+ = do platform <- getPlatform
+ getRegister (mangleIndexTree platform tree)
getRegister (CmmMachOp (MO_UU_Conv W64 W32)
[CmmMachOp (MO_U_Shr W64) [x,CmmLit (CmmInt 32 _)]]) = do
@@ -483,15 +481,15 @@ trivialFCode
-> NatM Register
trivialFCode pk instr x y = do
- dflags <- getDynFlags
+ platform <- getPlatform
(src1, code1) <- getSomeReg x
(src2, code2) <- getSomeReg y
tmp <- getNewRegNat FF64
let
promote x = FxTOy FF32 FF64 x tmp
- pk1 = cmmExprType dflags x
- pk2 = cmmExprType dflags y
+ pk1 = cmmExprType platform x
+ pk2 = cmmExprType platform y
code__2 dst =
if pk1 `cmmEqType` pk2 then