...
 
Commits (12)
  • Ben Gamari's avatar
    fs: Port fixes from ghc-jailbreak repository · 1674353a
    Ben Gamari authored
    * Override rename, unlink, and remove
    * Factor out wchar conversion
    1674353a
  • Adam Sandberg Eriksson's avatar
    853210f2
  • Adam Sandberg Eriksson's avatar
    2831544a
  • Adam Sandberg Eriksson's avatar
  • Vladislav Zavialov's avatar
    Remove Ord SrcLoc, Ord SrcSpan · 26e8fff3
    Vladislav Zavialov authored
    Before this patch, GHC relied on Ord SrcSpan to identify source elements, by
    using SrcSpan as Map keys:
    
    	blackList :: Map SrcSpan ()      -- compiler/GHC/HsToCore/Coverage.hs
    	instanceMap :: Map SrcSpan Name  -- compiler/GHC/HsToCore/Docs.hs
    
    Firstly, this design is not valid in presence of UnhelpfulSpan, as it
    distinguishes between  UnhelpfulSpan "X"  and  UnhelpfulSpan "Y", but those
    strings are messages for the user, unfit to serve as identifiers for source
    elements.
    
    Secondly, this design made it hard to extend SrcSpan with additional data.
    Recall that the definition of SrcSpan is:
    
    	data SrcSpan =
    	    RealSrcSpan !RealSrcSpan
    	  | UnhelpfulSpan !FastString
    
    Say we want to extend the RealSrcSpan constructor with additional information:
    
    	data SrcSpan =
    	    RealSrcSpan !RealSrcSpan !AdditionalInformation
    	  | UnhelpfulSpan !FastString
    
    	getAdditionalInformation :: SrcSpan -> AdditionalInformation
    	getAdditionalInformation (RealSrcSpan _ a) = a
    
    Now, in order for  Map SrcSpan  to keep working correctly, we must *ignore* additional
    information when comparing SrcSpan values:
    
    	instance Ord SrcSpan where
    	  compare (RealSrcSpan r1 _) (RealSrcSpan r2 _) = compare r1 r2
    	  ...
    
    However, this would violate an important law:
    
    	a == b  therefore  f a == f b
    
    Ignoring  AdditionalInformation  in comparisons would mean that with
    f=getAdditionalInformation, the law above does not hold.
    
    A more robust design is to avoid  Ord SrcSpan  altogether, which is what this patch implements.
    The mappings are changed to use RealSrcSpan instead:
    
    	blackList :: Set RealSrcSpan         -- compiler/GHC/HsToCore/Coverage.hs
    	instanceMap :: Map RealSrcSpan Name  -- compiler/GHC/HsToCore/Docs.hs
    
    All SrcSpan comparisons are now done with explicit comparison strategies:
    
    	SrcLoc.leftmost_smallest
    	SrcLoc.leftmost_largest
    	SrcLoc.rightmost_smallest
    
    These strategies are not subject to the law mentioned above and can easily
    discard both the string stored in  UnhelpfulSpan  and  AdditionalInformation.
    
    Updates haddock submodule.
    26e8fff3
  • Ben Gamari's avatar
    users-guide: Shuffle text · 5aa6c188
    Ben Gamari authored
    5aa6c188
  • Ben Gamari's avatar
    users-guide: Drop old release notes · e3f17413
    Ben Gamari authored
    e3f17413
  • Ben Gamari's avatar
    Bump directory submodule to 1.3.6.0 · 84dd9610
    Ben Gamari authored
    84dd9610
  • Stefan Pavikevik's avatar
  • Krzysztof Gogolewski's avatar
    Comments, small refactor · 354e2787
    Krzysztof Gogolewski authored
    * Remove outdated Note [HsForAllTy tyvar binders] and [Context quantification].
      Since the wildcard refactor 1e041b73, HsForAllTy no longer has an flag
      controlling explicity. The field `hsq_implicit` is gone too.
      The current situation is covered by Note [HsType binders] which is already
      linked from LHsQTyVars.
    * Small refactor in CoreLint, extracting common code to a function
    * Remove "not so sure about WpFun" in TcEvidence, per Richard's comment
      !852 (comment 223226)
    * Use mkIfThenElse in Foreign/Call, as it does exactly what we need.
    354e2787
  • Sylvain Henry's avatar
    Modules: CmmToAsm (#13009) · 1b1067d1
    Sylvain Henry authored
    1b1067d1
  • Shayne Fletcher's avatar
    Derive Ord instance for Extension · 49a07175
    Shayne Fletcher authored
    49a07175
...@@ -969,7 +969,7 @@ doc-tarball: ...@@ -969,7 +969,7 @@ doc-tarball:
- validate-x86_64-linux-deb9-debug - validate-x86_64-linux-deb9-debug
- validate-x86_64-windows - validate-x86_64-windows
variables: variables:
LINUX_BINDIST: "ghc-x86_64-deb9-linux.tar.xz" LINUX_BINDIST: "ghc-x86_64-deb9-linux-debug.tar.xz"
WINDOWS_BINDIST: "ghc-x86_64-mingw32.tar.xz" WINDOWS_BINDIST: "ghc-x86_64-mingw32.tar.xz"
# Due to Windows allow_failure # Due to Windows allow_failure
allow_failure: true allow_failure: true
......
...@@ -260,7 +260,7 @@ module GHC ( ...@@ -260,7 +260,7 @@ module GHC (
-- *** Combining and comparing Located values -- *** Combining and comparing Located values
eqLocated, cmpLocated, combineLocs, addCLoc, eqLocated, cmpLocated, combineLocs, addCLoc,
leftmost_smallest, leftmost_largest, rightmost, leftmost_smallest, leftmost_largest, rightmost_smallest,
spans, isSubspanOf, spans, isSubspanOf,
-- * Exceptions -- * Exceptions
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-} {-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
module AsmCodeGen ( module GHC.CmmToAsm (
-- * Module entry point -- * Module entry point
nativeCodeGen nativeCodeGen
...@@ -32,43 +32,43 @@ module AsmCodeGen ( ...@@ -32,43 +32,43 @@ module AsmCodeGen (
import GhcPrelude import GhcPrelude
import qualified X86.CodeGen import qualified GHC.CmmToAsm.X86.CodeGen as X86.CodeGen
import qualified X86.Regs import qualified GHC.CmmToAsm.X86.Regs as X86.Regs
import qualified X86.Instr import qualified GHC.CmmToAsm.X86.Instr as X86.Instr
import qualified X86.Ppr import qualified GHC.CmmToAsm.X86.Ppr as X86.Ppr
import qualified SPARC.CodeGen import qualified GHC.CmmToAsm.SPARC.CodeGen as SPARC.CodeGen
import qualified SPARC.Regs import qualified GHC.CmmToAsm.SPARC.Regs as SPARC.Regs
import qualified SPARC.Instr import qualified GHC.CmmToAsm.SPARC.Instr as SPARC.Instr
import qualified SPARC.Ppr import qualified GHC.CmmToAsm.SPARC.Ppr as SPARC.Ppr
import qualified SPARC.ShortcutJump import qualified GHC.CmmToAsm.SPARC.ShortcutJump as SPARC.ShortcutJump
import qualified SPARC.CodeGen.Expand import qualified GHC.CmmToAsm.SPARC.CodeGen.Expand as SPARC.CodeGen.Expand
import qualified PPC.CodeGen import qualified GHC.CmmToAsm.PPC.CodeGen as PPC.CodeGen
import qualified PPC.Regs import qualified GHC.CmmToAsm.PPC.Regs as PPC.Regs
import qualified PPC.RegInfo import qualified GHC.CmmToAsm.PPC.RegInfo as PPC.RegInfo
import qualified PPC.Instr import qualified GHC.CmmToAsm.PPC.Instr as PPC.Instr
import qualified PPC.Ppr import qualified GHC.CmmToAsm.PPC.Ppr as PPC.Ppr
import RegAlloc.Liveness import GHC.CmmToAsm.Reg.Liveness
import qualified RegAlloc.Linear.Main as Linear import qualified GHC.CmmToAsm.Reg.Linear as Linear
import qualified GraphColor as Color import qualified GraphColor as Color
import qualified RegAlloc.Graph.Main as Color import qualified GHC.CmmToAsm.Reg.Graph as Color
import qualified RegAlloc.Graph.Stats as Color import qualified GHC.CmmToAsm.Reg.Graph.Stats as Color
import qualified RegAlloc.Graph.TrivColorable as Color import qualified GHC.CmmToAsm.Reg.Graph.TrivColorable as Color
import AsmUtils import AsmUtils
import TargetReg import GHC.CmmToAsm.Reg.Target
import GHC.Platform import GHC.Platform
import BlockLayout import GHC.CmmToAsm.BlockLayout as BlockLayout
import Config import Config
import Instruction import GHC.CmmToAsm.Instr
import PIC import GHC.CmmToAsm.PIC
import Reg import GHC.Platform.Reg
import NCGMonad import GHC.CmmToAsm.Monad
import CFG import GHC.CmmToAsm.CFG
import Dwarf import GHC.CmmToAsm.Dwarf
import GHC.Cmm.DebugBlock import GHC.Cmm.DebugBlock
import GHC.Cmm.BlockId import GHC.Cmm.BlockId
......
...@@ -9,16 +9,16 @@ ...@@ -9,16 +9,16 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleContexts #-}
module BlockLayout module GHC.CmmToAsm.BlockLayout
( sequenceTop ) ( sequenceTop )
where where
#include "HsVersions.h" #include "HsVersions.h"
import GhcPrelude import GhcPrelude
import Instruction import GHC.CmmToAsm.Instr
import NCGMonad import GHC.CmmToAsm.Monad
import CFG import GHC.CmmToAsm.CFG
import GHC.Cmm.BlockId import GHC.Cmm.BlockId
import GHC.Cmm import GHC.Cmm
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DataKinds #-}
module CFG module GHC.CmmToAsm.CFG
( CFG, CfgEdge(..), EdgeInfo(..), EdgeWeight(..) ( CFG, CfgEdge(..), EdgeInfo(..), EdgeWeight(..)
, TransitionSource(..) , TransitionSource(..)
...@@ -61,7 +61,7 @@ import Digraph ...@@ -61,7 +61,7 @@ import Digraph
import Maybes import Maybes
import Unique import Unique
import qualified Dominators as Dom import qualified GHC.CmmToAsm.CFG.Dominators as Dom
import Data.IntMap.Strict (IntMap) import Data.IntMap.Strict (IntMap)
import Data.IntSet (IntSet) import Data.IntSet (IntSet)
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
Originally taken from the dom-lt package. Originally taken from the dom-lt package.
-} -}
module Dominators ( module GHC.CmmToAsm.CFG.Dominators (
Node,Path,Edge Node,Path,Edge
,Graph,Rooted ,Graph,Rooted
,idom,ipdom ,idom,ipdom
......
-- | Generating C symbol names emitted by the compiler. -- | Generating C symbol names emitted by the compiler.
module CPrim module GHC.CmmToAsm.CPrim
( atomicReadLabel ( atomicReadLabel
, atomicWriteLabel , atomicWriteLabel
, atomicRMWLabel , atomicRMWLabel
......
module Dwarf ( module GHC.CmmToAsm.Dwarf (
dwarfGen dwarfGen
) where ) where
...@@ -16,8 +16,8 @@ import GHC.Platform ...@@ -16,8 +16,8 @@ import GHC.Platform
import Unique import Unique
import UniqSupply import UniqSupply
import Dwarf.Constants import GHC.CmmToAsm.Dwarf.Constants
import Dwarf.Types import GHC.CmmToAsm.Dwarf.Types
import Control.Arrow ( first ) import Control.Arrow ( first )
import Control.Monad ( mfilter ) import Control.Monad ( mfilter )
......
-- | Constants describing the DWARF format. Most of this simply -- | Constants describing the DWARF format. Most of this simply
-- mirrors /usr/include/dwarf.h. -- mirrors /usr/include/dwarf.h.
module Dwarf.Constants where module GHC.CmmToAsm.Dwarf.Constants where
import GhcPrelude import GhcPrelude
...@@ -10,8 +10,8 @@ import FastString ...@@ -10,8 +10,8 @@ import FastString
import GHC.Platform import GHC.Platform
import Outputable import Outputable
import Reg import GHC.Platform.Reg
import X86.Regs import GHC.CmmToAsm.X86.Regs
import Data.Word import Data.Word
......
module Dwarf.Types module GHC.CmmToAsm.Dwarf.Types
( -- * Dwarf information ( -- * Dwarf information
DwarfInfo(..) DwarfInfo(..)
, pprDwarfInfo , pprDwarfInfo
...@@ -32,11 +32,11 @@ import FastString ...@@ -32,11 +32,11 @@ import FastString
import Outputable import Outputable
import GHC.Platform import GHC.Platform
import Unique import Unique
import Reg import GHC.Platform.Reg
import SrcLoc import SrcLoc
import Util import Util
import Dwarf.Constants import GHC.CmmToAsm.Dwarf.Constants
import qualified Data.ByteString as BS import qualified Data.ByteString as BS
import qualified Control.Monad.Trans.State.Strict as S import qualified Control.Monad.Trans.State.Strict as S
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
-- to have architecture specific formats, and do the overloading -- to have architecture specific formats, and do the overloading
-- properly. eg SPARC doesn't care about FF80. -- properly. eg SPARC doesn't care about FF80.
-- --
module Format ( module GHC.CmmToAsm.Format (
Format(..), Format(..),
intFormat, intFormat,
floatFormat, floatFormat,
......
module Instruction ( module GHC.CmmToAsm.Instr (
RegUsage(..), RegUsage(..),
noUsage, noUsage,
GenBasicBlock(..), blockId, GenBasicBlock(..), blockId,
...@@ -16,7 +16,7 @@ where ...@@ -16,7 +16,7 @@ where
import GhcPrelude import GhcPrelude
import Reg import GHC.Platform.Reg
import GHC.Cmm.BlockId import GHC.Cmm.BlockId
import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow.Collections
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
-- --
-- ----------------------------------------------------------------------------- -- -----------------------------------------------------------------------------
module NCGMonad ( module GHC.CmmToAsm.Monad (
NcgImpl(..), NcgImpl(..),
NatM_State(..), mkNatM_State, NatM_State(..), mkNatM_State,
...@@ -45,9 +45,9 @@ where ...@@ -45,9 +45,9 @@ where
import GhcPrelude import GhcPrelude
import Reg import GHC.Platform.Reg
import Format import GHC.CmmToAsm.Format
import TargetReg import GHC.CmmToAsm.Reg.Target
import GHC.Cmm.BlockId import GHC.Cmm.BlockId
import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow.Collections
...@@ -63,10 +63,10 @@ import Module ...@@ -63,10 +63,10 @@ import Module
import Control.Monad ( ap ) import Control.Monad ( ap )
import Instruction import GHC.CmmToAsm.Instr
import Outputable (SDoc, pprPanic, ppr) import Outputable (SDoc, pprPanic, ppr)
import GHC.Cmm (RawCmmDecl, RawCmmStatics) import GHC.Cmm (RawCmmDecl, RawCmmStatics)
import CFG import GHC.CmmToAsm.CFG
data NcgImpl statics instr jumpDest = NcgImpl { data NcgImpl statics instr jumpDest = NcgImpl {
cmmTopCodeGen :: RawCmmDecl -> NatM [NatCmmDecl statics instr], cmmTopCodeGen :: RawCmmDecl -> NatM [NatCmmDecl statics instr],
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
that wasn't in the original Cmm code (e.g. floating point literals). that wasn't in the original Cmm code (e.g. floating point literals).
-} -}
module PIC ( module GHC.CmmToAsm.PIC (
cmmMakeDynamicReference, cmmMakeDynamicReference,
CmmMakeDynamicReferenceM(..), CmmMakeDynamicReferenceM(..),
ReferenceKind(..), ReferenceKind(..),
...@@ -49,15 +49,14 @@ where ...@@ -49,15 +49,14 @@ where
import GhcPrelude import GhcPrelude
import qualified PPC.Instr as PPC import qualified GHC.CmmToAsm.PPC.Instr as PPC
import qualified PPC.Regs as PPC import qualified GHC.CmmToAsm.PPC.Regs as PPC
import qualified GHC.CmmToAsm.X86.Instr as X86
import qualified X86.Instr as X86
import GHC.Platform import GHC.Platform
import Instruction import GHC.CmmToAsm.Instr
import Reg import GHC.Platform.Reg
import NCGMonad import GHC.CmmToAsm.Monad
import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow.Collections
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
-- (a) the sectioning, and (b) the type signatures, -- (a) the sectioning, and (b) the type signatures,
-- the structure should not be too overwhelming. -- the structure should not be too overwhelming.
module PPC.CodeGen ( module GHC.CmmToAsm.PPC.CodeGen (
cmmTopCodeGen, cmmTopCodeGen,
generateJumpTableForInstr, generateJumpTableForInstr,
InstrBlock InstrBlock
...@@ -26,19 +26,21 @@ where ...@@ -26,19 +26,21 @@ where
import GhcPrelude import GhcPrelude
import GHC.Platform.Regs import GHC.Platform.Regs
import PPC.Instr import GHC.CmmToAsm.PPC.Instr
import PPC.Cond import GHC.CmmToAsm.PPC.Cond
import PPC.Regs import GHC.CmmToAsm.PPC.Regs
import CPrim import GHC.CmmToAsm.CPrim
import NCGMonad ( NatM, getNewRegNat, getNewLabelNat import GHC.CmmToAsm.Monad
, getBlockIdNat, getPicBaseNat, getNewRegPairNat ( NatM, getNewRegNat, getNewLabelNat
, getPicBaseMaybeNat ) , getBlockIdNat, getPicBaseNat, getNewRegPairNat
import Instruction , getPicBaseMaybeNat
import PIC )
import Format import GHC.CmmToAsm.Instr
import RegClass import GHC.CmmToAsm.PIC
import Reg import GHC.CmmToAsm.Format
import TargetReg import GHC.Platform.Reg.Class
import GHC.Platform.Reg
import GHC.CmmToAsm.Reg.Target
import GHC.Platform import GHC.Platform
-- Our intermediate code: -- Our intermediate code:
......
module PPC.Cond ( module GHC.CmmToAsm.PPC.Cond (
Cond(..), Cond(..),
condNegate, condNegate,
condUnsigned, condUnsigned,
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "HsVersions.h" #include "HsVersions.h"
module PPC.Instr ( module GHC.CmmToAsm.PPC.Instr (
archWordFormat, archWordFormat,
RI(..), RI(..),
Instr(..), Instr(..),
...@@ -26,13 +26,13 @@ where ...@@ -26,13 +26,13 @@ where
import GhcPrelude import GhcPrelude
import PPC.Regs import GHC.CmmToAsm.PPC.Regs
import PPC.Cond import GHC.CmmToAsm.PPC.Cond
import Instruction import GHC.CmmToAsm.Instr
import Format import GHC.CmmToAsm.Format
import TargetReg import GHC.CmmToAsm.Reg.Target
import RegClass import GHC.Platform.Reg.Class
import Reg import GHC.Platform.Reg
import GHC.Platform.Regs import GHC.Platform.Regs
import GHC.Cmm.BlockId import GHC.Cmm.BlockId
...@@ -110,8 +110,8 @@ ppc_mkStackAllocInstr' platform amount ...@@ -110,8 +110,8 @@ ppc_mkStackAllocInstr' platform amount
allocMoreStack allocMoreStack
:: Platform :: Platform
-> Int -> Int
-> NatCmmDecl statics PPC.Instr.Instr -> NatCmmDecl statics GHC.CmmToAsm.PPC.Instr.Instr
-> UniqSM (NatCmmDecl statics PPC.Instr.Instr, [(BlockId,BlockId)]) -> UniqSM (NatCmmDecl statics GHC.CmmToAsm.PPC.Instr.Instr, [(BlockId,BlockId)])
allocMoreStack _ _ top@(CmmData _ _) = return (top,[]) allocMoreStack _ _ top@(CmmData _ _) = return (top,[])
allocMoreStack platform slots (CmmProc info lbl live (ListGraph code)) = do allocMoreStack platform slots (CmmProc info lbl live (ListGraph code)) = do
......
...@@ -7,19 +7,19 @@ ...@@ -7,19 +7,19 @@
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_GHC -fno-warn-orphans #-}
module PPC.Ppr (pprNatCmmDecl) where module GHC.CmmToAsm.PPC.Ppr (pprNatCmmDecl) where
import GhcPrelude import GhcPrelude
import PPC.Regs import GHC.CmmToAsm.PPC.Regs
import PPC.Instr import GHC.CmmToAsm.PPC.Instr
import PPC.Cond import GHC.CmmToAsm.PPC.Cond
import PprBase import GHC.CmmToAsm.Ppr
import Instruction import GHC.CmmToAsm.Instr
import Format import GHC.CmmToAsm.Format
import Reg import GHC.Platform.Reg
import RegClass import GHC.Platform.Reg.Class
import TargetReg import GHC.CmmToAsm.Reg.Target
import GHC.Cmm hiding (topInfoTable) import GHC.Cmm hiding (topInfoTable)
import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow.Collections
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- (c) The University of Glasgow 1996-2004 -- (c) The University of Glasgow 1996-2004
-- --
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
module PPC.RegInfo ( module GHC.CmmToAsm.PPC.RegInfo (
JumpDest( DestBlockId ), getJumpDestBlockId, JumpDest( DestBlockId ), getJumpDestBlockId,
canShortcut, canShortcut,
shortcutJump, shortcutJump,
...@@ -21,7 +21,7 @@ where ...@@ -21,7 +21,7 @@ where
import GhcPrelude import GhcPrelude
import PPC.Instr import GHC.CmmToAsm.PPC.Instr
import GHC.Cmm.BlockId import GHC.Cmm.BlockId
import GHC.Cmm import GHC.Cmm
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- --
-- ----------------------------------------------------------------------------- -- -----------------------------------------------------------------------------
module PPC.Regs ( module GHC.CmmToAsm.PPC.Regs (
-- squeeze functions -- squeeze functions
virtualRegSqueeze, virtualRegSqueeze,
realRegSqueeze, realRegSqueeze,
...@@ -51,9 +51,9 @@ where ...@@ -51,9 +51,9 @@ where
import GhcPrelude import GhcPrelude
import Reg import GHC.Platform.Reg
import RegClass import GHC.Platform.Reg.Class
import Format import GHC.CmmToAsm.Format
import GHC.Cmm import GHC.Cmm
import GHC.Cmm.CLabel ( CLabel ) import GHC.Cmm.CLabel ( CLabel )
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
-- --
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
module PprBase ( module GHC.CmmToAsm.Ppr (
castFloatToWord8Array, castFloatToWord8Array,
castDoubleToWord8Array, castDoubleToWord8Array,
floatToBytes, floatToBytes,
......
...@@ -2,22 +2,22 @@ ...@@ -2,22 +2,22 @@
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ScopedTypeVariables #-}
-- | Graph coloring register allocator. -- | Graph coloring register allocator.
module RegAlloc.Graph.Main ( module GHC.CmmToAsm.Reg.Graph (
regAlloc regAlloc
) where ) where
import GhcPrelude import GhcPrelude
import qualified GraphColor as Color import qualified GraphColor as Color
import RegAlloc.Liveness import GHC.CmmToAsm.Reg.Liveness
import RegAlloc.Graph.Spill import GHC.CmmToAsm.Reg.Graph.Spill
import RegAlloc.Graph.SpillClean import GHC.CmmToAsm.Reg.Graph.SpillClean
import RegAlloc.Graph.SpillCost import GHC.CmmToAsm.Reg.Graph.SpillCost
import RegAlloc.Graph.Stats import GHC.CmmToAsm.Reg.Graph.Stats
import RegAlloc.Graph.TrivColorable import GHC.CmmToAsm.Reg.Graph.TrivColorable
import Instruction import GHC.CmmToAsm.Instr
import TargetReg import GHC.CmmToAsm.Reg.Target
import RegClass import GHC.Platform.Reg.Class
import Reg import GHC.Platform.Reg
import Bag import Bag
import GHC.Driver.Session import GHC.Driver.Session
...@@ -27,7 +27,7 @@ import UniqFM ...@@ -27,7 +27,7 @@ import UniqFM
import UniqSet import UniqSet
import UniqSupply import UniqSupply
import Util (seqList) import Util (seqList)
import CFG import GHC.CmmToAsm.CFG
import Data.Maybe import Data.Maybe
import Control.Monad import Control.Monad
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
-- This code is here because we can test the architecture specific code against -- This code is here because we can test the architecture specific code against
-- it. -- it.
-- --
module RegAlloc.Graph.ArchBase ( module GHC.CmmToAsm.Reg.Graph.Base (
RegClass(..), RegClass(..),
Reg(..), Reg(..),
RegSub(..), RegSub(..),
......
-- | Register coalescing. -- | Register coalescing.
module RegAlloc.Graph.Coalesce ( module GHC.CmmToAsm.Reg.Graph.Coalesce (
regCoalesce, regCoalesce,
slurpJoinMovs slurpJoinMovs
) where ) where
import GhcPrelude import GhcPrelude
import RegAlloc.Liveness import GHC.CmmToAsm.Reg.Liveness
import Instruction import GHC.CmmToAsm.Instr
import Reg import GHC.Platform.Reg
import GHC.Cmm import GHC.Cmm
import Bag import Bag
......
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
-- | When there aren't enough registers to hold all the vregs we have to spill -- | When there aren't enough registers to hold all the vregs we have to spill
-- some of those vregs to slots on the stack. This module is used modify the -- some of those vregs to slots on the stack. This module is used modify the
-- code to use those slots. -- code to use those slots.
module RegAlloc.Graph.Spill ( module GHC.CmmToAsm.Reg.Graph.Spill (
regSpill, regSpill,
SpillStats(..), SpillStats(..),
accSpillSL accSpillSL
) where ) where
import GhcPrelude import GhcPrelude
import RegAlloc.Liveness import GHC.CmmToAsm.Reg.Liveness
import Instruction import GHC.CmmToAsm.Instr
import Reg import GHC.Platform.Reg
import GHC.Cmm hiding (RegSet) import GHC.Cmm hiding (RegSet)
import GHC.Cmm.BlockId import GHC.Cmm.BlockId
import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow.Collections
......
...@@ -26,14 +26,14 @@ ...@@ -26,14 +26,14 @@
-- This also works if the reloads in B1\/B2 were spills instead, because -- This also works if the reloads in B1\/B2 were spills instead, because
-- spilling %r1 to a slot makes that slot have the same value as %r1. -- spilling %r1 to a slot makes that slot have the same value as %r1.
-- --
module RegAlloc.Graph.SpillClean ( module GHC.CmmToAsm.Reg.Graph.SpillClean (
cleanSpills cleanSpills
) where ) where
import GhcPrelude import GhcPrelude
import RegAlloc.Liveness import GHC.CmmToAsm.Reg.Liveness
import Instruction import GHC.CmmToAsm.Instr
import Reg import GHC.Platform.Reg
import GHC.Cmm.BlockId import GHC.Cmm.BlockId
import GHC.Cmm import GHC.Cmm
......
{-# LANGUAGE ScopedTypeVariables, GADTs, BangPatterns #-} {-# LANGUAGE ScopedTypeVariables, GADTs, BangPatterns #-}
module RegAlloc.Graph.SpillCost ( module GHC.CmmToAsm.Reg.Graph.SpillCost (
SpillCostRecord, SpillCostRecord,
plusSpillCostRecord, plusSpillCostRecord,
pprSpillCostRecord, pprSpillCostRecord,
...@@ -15,10 +15,10 @@ module RegAlloc.Graph.SpillCost ( ...@@ -15,10 +15,10 @@ module RegAlloc.Graph.SpillCost (
) where ) where
import GhcPrelude import GhcPrelude
import RegAlloc.Liveness import GHC.CmmToAsm.Reg.Liveness
import Instruction import GHC.CmmToAsm.Instr
import RegClass import GHC.Platform.Reg.Class
import Reg import GHC.Platform.Reg
import GraphBase import GraphBase
...@@ -31,7 +31,7 @@ import Digraph (flattenSCCs) ...@@ -31,7 +31,7 @@ import Digraph (flattenSCCs)
import Outputable import Outputable
import GHC.Platform import GHC.Platform
import State import State
import CFG import GHC.CmmToAsm.CFG
import Data.List (nub, minimumBy) import Data.List (nub, minimumBy)
import Data.Maybe import Data.Maybe
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
-- | Carries interesting info for debugging / profiling of the -- | Carries interesting info for debugging / profiling of the
-- graph coloring register allocator. -- graph coloring register allocator.
module RegAlloc.Graph.Stats ( module GHC.CmmToAsm.Reg.Graph.Stats (
RegAllocStats (..), RegAllocStats (..),
pprStats, pprStats,
...@@ -19,14 +19,14 @@ module RegAlloc.Graph.Stats ( ...@@ -19,14 +19,14 @@ module RegAlloc.Graph.Stats (
import GhcPrelude import GhcPrelude
import qualified GraphColor as Color import qualified GraphColor as Color
import RegAlloc.Liveness import GHC.CmmToAsm.Reg.Liveness
import RegAlloc.Graph.Spill import GHC.CmmToAsm.Reg.Graph.Spill
import RegAlloc.Graph.SpillCost import GHC.CmmToAsm.Reg.Graph.SpillCost
import RegAlloc.Graph.TrivColorable import GHC.CmmToAsm.Reg.Graph.TrivColorable
import Instruction import GHC.CmmToAsm.Instr
import RegClass import GHC.Platform.Reg.Class
import Reg import GHC.Platform.Reg
import TargetReg import GHC.CmmToAsm.Reg.Target
import Outputable import Outputable
import UniqFM import UniqFM
......
{-# LANGUAGE CPP #-} {-# LANGUAGE CPP #-}
module RegAlloc.Graph.TrivColorable ( module GHC.CmmToAsm.Reg.Graph.TrivColorable (
trivColorable, trivColorable,
) )
...@@ -10,8 +10,8 @@ where ...@@ -10,8 +10,8 @@ where
import GhcPrelude import GhcPrelude
import RegClass import GHC.Platform.Reg.Class
import Reg import GHC.Platform.Reg
import GraphBase import GraphBase
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- See RegArchBase.hs for the reference. -- See RegArchBase.hs for the reference.
-- See MachRegs.hs for the actual trivColorable function used in GHC. -- See MachRegs.hs for the actual trivColorable function used in GHC.
-- --
module RegAlloc.Graph.ArchX86 ( module GHC.CmmToAsm.Reg.Graph.X86 (
classOfReg, classOfReg,
regsOfClass, regsOfClass,
regName, regName,
...@@ -17,7 +17,7 @@ module RegAlloc.Graph.ArchX86 ( ...@@ -17,7 +17,7 @@ module RegAlloc.Graph.ArchX86 (
import GhcPrelude import GhcPrelude
import RegAlloc.Graph.ArchBase (Reg(..), RegSub(..), RegClass(..)) import GHC.CmmToAsm.Reg.Graph.Base (Reg(..), RegSub(..), RegClass(..))
import UniqSet import UniqSet
import qualified Data.Array as A import qualified Data.Array as A
......
...@@ -95,10 +95,10 @@ The algorithm is roughly: ...@@ -95,10 +95,10 @@ The algorithm is roughly:
-} -}
module RegAlloc.Linear.Main ( module GHC.CmmToAsm.Reg.Linear (
regAlloc, regAlloc,
module RegAlloc.Linear.Base, module GHC.CmmToAsm.Reg.Linear.Base,
module RegAlloc.Linear.Stats module GHC.CmmToAsm.Reg.Linear.Stats
) where ) where
#include "HsVersions.h" #include "HsVersions.h"
...@@ -106,20 +106,20 @@ module RegAlloc.Linear.Main ( ...@@ -106,20 +106,20 @@ module RegAlloc.Linear.Main (
import GhcPrelude import GhcPrelude
import RegAlloc.Linear.State import GHC.CmmToAsm.Reg.Linear.State
import RegAlloc.Linear.Base import GHC.CmmToAsm.Reg.Linear.Base
import RegAlloc.Linear.StackMap import GHC.CmmToAsm.Reg.Linear.StackMap
import RegAlloc.Linear.FreeRegs import GHC.CmmToAsm.Reg.Linear.FreeRegs
import RegAlloc.Linear.Stats import GHC.CmmToAsm.Reg.Linear.Stats
import RegAlloc.Linear.JoinToTargets import GHC.CmmToAsm.Reg.Linear.JoinToTargets
import qualified RegAlloc.Linear.PPC.FreeRegs as PPC import qualified GHC.CmmToAsm.Reg.Linear.PPC as PPC
import qualified RegAlloc.Linear.SPARC.FreeRegs as SPARC import qualified GHC.CmmToAsm.Reg.Linear.SPARC as SPARC
import qualified RegAlloc.Linear.X86.FreeRegs as X86 import qualified GHC.CmmToAsm.Reg.Linear.X86 as X86
import qualified RegAlloc.Linear.X86_64.FreeRegs as X86_64 import qualified GHC.CmmToAsm.Reg.Linear.X86_64 as X86_64
import TargetReg import GHC.CmmToAsm.Reg.Target
import RegAlloc.Liveness import GHC.CmmToAsm.Reg.Liveness
import Instruction import GHC.CmmToAsm.Instr
import Reg import GHC.Platform.Reg
import GHC.Cmm.BlockId import GHC.Cmm.BlockId
import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow.Collections
......
-- | Put common type definitions here to break recursive module dependencies. -- | Put common type definitions here to break recursive module dependencies.
module RegAlloc.Linear.Base ( module GHC.CmmToAsm.Reg.Linear.Base (
BlockAssignment, BlockAssignment,
Loc(..), Loc(..),
...@@ -19,9 +19,9 @@ where ...@@ -19,9 +19,9 @@ where
import GhcPrelude import GhcPrelude
import RegAlloc.Linear.StackMap import GHC.CmmToAsm.Reg.Linear.StackMap
import RegAlloc.Liveness import GHC.CmmToAsm.Reg.Liveness
import Reg import GHC.Platform.Reg
import GHC.Driver.Session import GHC.Driver.Session
import Outputable import Outputable
......
{-# LANGUAGE CPP #-} {-# LANGUAGE CPP #-}
module RegAlloc.Linear.FreeRegs ( module GHC.CmmToAsm.Reg.Linear.FreeRegs (
FR(..), FR(..),
maxSpillSlots maxSpillSlots
) )
...@@ -11,8 +11,8 @@ where ...@@ -11,8 +11,8 @@ where
import GhcPrelude import GhcPrelude
import Reg import GHC.Platform.Reg
import RegClass import GHC.Platform.Reg.Class
import GHC.Driver.Session import GHC.Driver.Session
import Panic import Panic
...@@ -30,14 +30,14 @@ import GHC.Platform ...@@ -30,14 +30,14 @@ import GHC.Platform
-- getFreeRegs cls f = filter ( (==cls) . regClass . RealReg ) f -- getFreeRegs cls f = filter ( (==cls) . regClass . RealReg ) f
-- allocateReg f r = filter (/= r) f -- allocateReg f r = filter (/= r) f
import qualified RegAlloc.Linear.PPC.FreeRegs as PPC import qualified GHC.CmmToAsm.Reg.Linear.PPC as PPC
import qualified RegAlloc.Linear.SPARC.FreeRegs as SPARC import qualified GHC.CmmToAsm.Reg.Linear.SPARC as SPARC
import qualified RegAlloc.Linear.X86.FreeRegs as X86 import qualified GHC.CmmToAsm.Reg.Linear.X86 as X86
import qualified RegAlloc.Linear.X86_64.FreeRegs as X86_64 import qualified GHC.CmmToAsm.Reg.Linear.X86_64 as X86_64
import qualified PPC.Instr import qualified GHC.CmmToAsm.PPC.Instr as PPC.Instr
import qualified SPARC.Instr import qualified GHC.CmmToAsm.SPARC.Instr as SPARC.Instr
import qualified X86.Instr import qualified GHC.CmmToAsm.X86.Instr as X86.Instr
class Show freeRegs => FR freeRegs where class Show freeRegs => FR freeRegs where
frAllocateReg :: Platform -> RealReg -> freeRegs -> freeRegs frAllocateReg :: Platform -> RealReg -> freeRegs -> freeRegs
......
...@@ -8,16 +8,16 @@ ...@@ -8,16 +8,16 @@
-- stored one. They might be different if spilling has occurred in one -- stored one. They might be different if spilling has occurred in one
-- branch; so some fixup code will be required to match up the assignments. -- branch; so some fixup code will be required to match up the assignments.
-- --
module RegAlloc.Linear.JoinToTargets (joinToTargets) where module GHC.CmmToAsm.Reg.Linear.JoinToTargets (joinToTargets) where
import GhcPrelude import GhcPrelude
import RegAlloc.Linear.State import GHC.CmmToAsm.Reg.Linear.State
import RegAlloc.Linear.Base import GHC.CmmToAsm.Reg.Linear.Base
import RegAlloc.Linear.FreeRegs import GHC.CmmToAsm.Reg.Linear.FreeRegs
import RegAlloc.Liveness import GHC.CmmToAsm.Reg.Liveness
import Instruction import GHC.CmmToAsm.Instr
import Reg import GHC.Platform.Reg
import GHC.Cmm.BlockId import GHC.Cmm.BlockId
import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow.Collections
......
-- | Free regs map for PowerPC -- | Free regs map for PowerPC
module RegAlloc.Linear.PPC.FreeRegs module GHC.CmmToAsm.Reg.Linear.PPC where
where
import GhcPrelude import GhcPrelude
import PPC.Regs import GHC.CmmToAsm.PPC.Regs
import RegClass import GHC.Platform.Reg.Class
import Reg import GHC.Platform.Reg
import Outputable import Outputable
import GHC.Platform import GHC.Platform
......
{-# LANGUAGE CPP #-} {-# LANGUAGE CPP #-}
-- | Free regs map for SPARC -- | Free regs map for SPARC
module RegAlloc.Linear.SPARC.FreeRegs module GHC.CmmToAsm.Reg.Linear.SPARC where
where
import GhcPrelude import GhcPrelude
import SPARC.Regs import GHC.CmmToAsm.SPARC.Regs
import RegClass import GHC.Platform.Reg.Class
import Reg import GHC.Platform.Reg
import GHC.Platform.Regs import GHC.Platform.Regs
import Outputable import Outputable
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
-- associated, a stack slot is never "freed" or removed from the StackMap again, -- associated, a stack slot is never "freed" or removed from the StackMap again,
-- it remains associated until we are done with the current CmmProc. -- it remains associated until we are done with the current CmmProc.
-- --
module RegAlloc.Linear.StackMap ( module GHC.CmmToAsm.Reg.Linear.StackMap (
StackSlot, StackSlot,
StackMap(..), StackMap(..),
emptyStackMap, emptyStackMap,
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
-- Here we keep all the state that the register allocator keeps track -- Here we keep all the state that the register allocator keeps track
-- of as it walks the instructions in a basic block. -- of as it walks the instructions in a basic block.
module RegAlloc.Linear.State ( module GHC.CmmToAsm.Reg.Linear.State (
RA_State(..), RA_State(..),
RegM, RegM,
runR, runR,
...@@ -38,12 +38,12 @@ where ...@@ -38,12 +38,12 @@ where
import GhcPrelude import GhcPrelude
import RegAlloc.Linear.Stats import GHC.CmmToAsm.Reg.Linear.Stats
import RegAlloc.Linear.StackMap import GHC.CmmToAsm.Reg.Linear.StackMap
import RegAlloc.Linear.Base import GHC.CmmToAsm.Reg.Linear.Base
import RegAlloc.Liveness import GHC.CmmToAsm.Reg.Liveness
import Instruction import GHC.CmmToAsm.Instr
import Reg import GHC.Platform.Reg
import GHC.Cmm.BlockId import GHC.Cmm.BlockId
import GHC.Driver.Session import GHC.Driver.Session
......
module RegAlloc.Linear.Stats ( module GHC.CmmToAsm.Reg.Linear.Stats (
binSpillReasons, binSpillReasons,
countRegRegMovesNat, countRegRegMovesNat,
pprStats pprStats
...@@ -8,9 +8,9 @@ where ...@@ -8,9 +8,9 @@ where
import GhcPrelude import GhcPrelude
import RegAlloc.Linear.Base import GHC.CmmToAsm.Reg.Linear.Base
import RegAlloc.Liveness import GHC.CmmToAsm.Reg.Liveness
import Instruction import GHC.CmmToAsm.Instr
import UniqFM import UniqFM
import Outputable import Outputable
......
-- | Free regs map for i386 -- | Free regs map for i386
module RegAlloc.Linear.X86.FreeRegs module GHC.CmmToAsm.Reg.Linear.X86 where
where
import GhcPrelude import GhcPrelude
import X86.Regs import GHC.CmmToAsm.X86.Regs
import RegClass import GHC.Platform.Reg.Class
import Reg import GHC.Platform.Reg
import Panic import Panic
import GHC.Platform import GHC.Platform
......
-- | Free regs map for x86_64 -- | Free regs map for x86_64
module RegAlloc.Linear.X86_64.FreeRegs module GHC.CmmToAsm.Reg.Linear.X86_64 where
where
import GhcPrelude import GhcPrelude
import X86.Regs import GHC.CmmToAsm.X86.Regs
import RegClass import GHC.Platform.Reg.Class
import Reg import GHC.Platform.Reg
import Panic import Panic
import GHC.Platform import GHC.Platform
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
-- --
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
module RegAlloc.Liveness ( module GHC.CmmToAsm.Reg.Liveness (
RegSet, RegSet,
RegMap, emptyRegMap, RegMap, emptyRegMap,
BlockMap, mapEmpty, BlockMap, mapEmpty,
...@@ -39,11 +39,11 @@ module RegAlloc.Liveness ( ...@@ -39,11 +39,11 @@ module RegAlloc.Liveness (
) where ) where
import GhcPrelude import GhcPrelude
import Reg import GHC.Platform.Reg
import Instruction import GHC.CmmToAsm.Instr
import GHC.Cmm.BlockId import GHC.Cmm.BlockId
import CFG import GHC.CmmToAsm.CFG
import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow.Collections
import GHC.Cmm.Dataflow.Label import GHC.Cmm.Dataflow.Label
import GHC.Cmm hiding (RegSet, emptyRegSet) import GHC.Cmm hiding (RegSet, emptyRegSet)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
-- Instruction somehow. -- Instruction somehow.
-- --
-- TODO: We should also make arch specific versions of RegAlloc.Graph.TrivColorable -- TODO: We should also make arch specific versions of RegAlloc.Graph.TrivColorable
module TargetReg ( module GHC.CmmToAsm.Reg.Target (
targetVirtualRegSqueeze, targetVirtualRegSqueeze,
targetRealRegSqueeze, targetRealRegSqueeze,
targetClassOfRealReg, targetClassOfRealReg,
...@@ -23,20 +23,18 @@ where ...@@ -23,20 +23,18 @@ where
import GhcPrelude import GhcPrelude
import Reg import GHC.Platform.Reg
import RegClass import GHC.Platform.Reg.Class
import Format import GHC.CmmToAsm.Format
import Outputable import Outputable
import Unique import Unique
import GHC.Platform import GHC.Platform
import qualified X86.Regs as X86 import qualified GHC.CmmToAsm.X86.Regs as X86
import qualified X86.RegInfo as X86 import qualified GHC.CmmToAsm.X86.RegInfo as X86
import qualified GHC.CmmToAsm.PPC.Regs as PPC
import qualified PPC.Regs as PPC import qualified GHC.CmmToAsm.SPARC.Regs as SPARC
import qualified SPARC.Regs as SPARC
targetVirtualRegSqueeze :: Platform -> RegClass -> VirtualReg -> Int targetVirtualRegSqueeze :: Platform -> RegClass -> VirtualReg -> Int
targetVirtualRegSqueeze platform targetVirtualRegSqueeze platform
......
module SPARC.AddrMode ( module GHC.CmmToAsm.SPARC.AddrMode (
AddrMode(..), AddrMode(..),
addrOffset addrOffset
) )
...@@ -8,9 +8,9 @@ where ...@@ -8,9 +8,9 @@ where
import GhcPrelude import GhcPrelude
import SPARC.Imm import GHC.CmmToAsm.SPARC.Imm
import SPARC.Base import GHC.CmmToAsm.SPARC.Base
import Reg import GHC.Platform.Reg
-- addressing modes ------------------------------------------------------------ -- addressing modes ------------------------------------------------------------
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
-- In the interests of cross-compilation, we want to free ourselves -- In the interests of cross-compilation, we want to free ourselves
-- from the autoconf generated modules like main/Constants -- from the autoconf generated modules like main/Constants
module SPARC.Base ( module GHC.CmmToAsm.SPARC.Base (
wordLength, wordLength,
wordLengthInBits, wordLengthInBits,
spillAreaLength, spillAreaLength,
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
{-# LANGUAGE GADTs #-} {-# LANGUAGE GADTs #-}
module SPARC.CodeGen ( module GHC.CmmToAsm.SPARC.CodeGen (
cmmTopCodeGen, cmmTopCodeGen,
generateJumpTableForInstr, generateJumpTableForInstr,
InstrBlock InstrBlock
...@@ -22,21 +22,21 @@ where ...@@ -22,21 +22,21 @@ where
-- NCG stuff: -- NCG stuff:
import GhcPrelude import GhcPrelude
import SPARC.Base import GHC.CmmToAsm.SPARC.Base
import SPARC.CodeGen.Sanity import GHC.CmmToAsm.SPARC.CodeGen.Sanity
import SPARC.CodeGen.Amode import GHC.CmmToAsm.SPARC.CodeGen.Amode
import SPARC.CodeGen.CondCode import GHC.CmmToAsm.SPARC.CodeGen.CondCode
import SPARC.CodeGen.Gen64 import GHC.CmmToAsm.SPARC.CodeGen.Gen64
import SPARC.CodeGen.Gen32 import GHC.CmmToAsm.SPARC.CodeGen.Gen32
import SPARC.CodeGen.Base import GHC.CmmToAsm.SPARC.CodeGen.Base
import SPARC.Instr import GHC.CmmToAsm.SPARC.Instr
import SPARC.Imm import GHC.CmmToAsm.SPARC.Imm
import SPARC.AddrMode import GHC.CmmToAsm.SPARC.AddrMode
import SPARC.Regs import GHC.CmmToAsm.SPARC.Regs
import SPARC.Stack import GHC.CmmToAsm.SPARC.Stack
import Instruction import GHC.CmmToAsm.Instr
import Format import GHC.CmmToAsm.Format
import NCGMonad ( NatM, getNewRegNat, getNewLabelNat ) import GHC.CmmToAsm.Monad ( NatM, getNewRegNat, getNewLabelNat )
-- Our intermediate code: -- Our intermediate code:
import GHC.Cmm.BlockId import GHC.Cmm.BlockId
...@@ -45,10 +45,10 @@ import GHC.Cmm.Utils ...@@ -45,10 +45,10 @@ import GHC.Cmm.Utils
import GHC.Cmm.Switch import GHC.Cmm.Switch
import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Block
import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Graph
import PIC import GHC.CmmToAsm.PIC
import Reg import GHC.Platform.Reg
import GHC.Cmm.CLabel import GHC.Cmm.CLabel
import CPrim import GHC.CmmToAsm.CPrim
-- The rest: -- The rest:
import BasicTypes import BasicTypes
......
module SPARC.CodeGen.Amode ( module GHC.CmmToAsm.SPARC.CodeGen.Amode (
getAmode getAmode
) )
...@@ -6,15 +6,15 @@ where ...@@ -6,15 +6,15 @@ where
import GhcPrelude import GhcPrelude
import {-# SOURCE #-} SPARC.CodeGen.Gen32 import {-# SOURCE #-} GHC.CmmToAsm.SPARC.CodeGen.Gen32
import SPARC.CodeGen.Base import GHC.CmmToAsm.SPARC.CodeGen.Base
import SPARC.AddrMode import GHC.CmmToAsm.SPARC.AddrMode
import SPARC.Imm import GHC.CmmToAsm.SPARC.Imm
import SPARC.Instr import GHC.CmmToAsm.SPARC.Instr
import SPARC.Regs import GHC.CmmToAsm.SPARC.Regs
import SPARC.Base import GHC.CmmToAsm.SPARC.Base
import NCGMonad import GHC.CmmToAsm.Monad
import Format import GHC.CmmToAsm.Format
import GHC.Cmm import GHC.Cmm
......
module SPARC.CodeGen.Base ( module GHC.CmmToAsm.SPARC.CodeGen.Base (
InstrBlock, InstrBlock,
CondCode(..), CondCode(..),
ChildCode64(..), ChildCode64(..),
...@@ -15,12 +15,12 @@ where ...@@ -15,12 +15,12 @@ where
import GhcPrelude import GhcPrelude
import SPARC.Instr import GHC.CmmToAsm.SPARC.Instr
import SPARC.Cond import GHC.CmmToAsm.SPARC.Cond
import SPARC.AddrMode import GHC.CmmToAsm.SPARC.AddrMode
import SPARC.Regs import GHC.CmmToAsm.SPARC.Regs
import Format import GHC.CmmToAsm.Format
import Reg import GHC.Platform.Reg
import GHC.Platform.Regs import GHC.Platform.Regs
import GHC.Driver.Session import GHC.Driver.Session
......
module SPARC.CodeGen.CondCode ( module GHC.CmmToAsm.SPARC.CodeGen.CondCode (
getCondCode, getCondCode,
condIntCode, condIntCode,
condFltCode condFltCode
...@@ -8,15 +8,15 @@ where ...@@ -8,15 +8,15 @@ where
import GhcPrelude import GhcPrelude
import {-# SOURCE #-} SPARC.CodeGen.Gen32 import {-# SOURCE #-} GHC.CmmToAsm.SPARC.CodeGen.Gen32
import SPARC.CodeGen.Base import GHC.CmmToAsm.SPARC.CodeGen.Base
import SPARC.Instr import GHC.CmmToAsm.SPARC.Instr
import SPARC.Regs import GHC.CmmToAsm.SPARC.Regs
import SPARC.Cond import GHC.CmmToAsm.SPARC.Cond
import SPARC.Imm import GHC.CmmToAsm.SPARC.Imm
import SPARC.Base import GHC.CmmToAsm.SPARC.Base
import NCGMonad import GHC.CmmToAsm.Monad
import Format import GHC.CmmToAsm.Format
import GHC.Cmm import GHC.Cmm
......
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
-- | Expand out synthetic instructions into single machine instrs. -- | Expand out synthetic instructions into single machine instrs.
module SPARC.CodeGen.Expand ( module GHC.CmmToAsm.SPARC.CodeGen.Expand (
expandTop expandTop
) )
...@@ -9,13 +9,13 @@ where ...@@ -9,13 +9,13 @@ where
import GhcPrelude import GhcPrelude
import SPARC.Instr import GHC.CmmToAsm.SPARC.Instr
import SPARC.Imm import GHC.CmmToAsm.SPARC.Imm
import SPARC.AddrMode import GHC.CmmToAsm.SPARC.AddrMode
import SPARC.Regs import GHC.CmmToAsm.SPARC.Regs
import Instruction import GHC.CmmToAsm.Instr
import Reg import GHC.Platform.Reg
import Format import GHC.CmmToAsm.Format
import GHC.Cmm import GHC.Cmm
......
-- | Evaluation of 32 bit values. -- | Evaluation of 32 bit values.
module SPARC.CodeGen.Gen32 ( module GHC.CmmToAsm.SPARC.CodeGen.Gen32 (
getSomeReg, getSomeReg,
getRegister getRegister
) )
...@@ -8,20 +8,20 @@ where ...@@ -8,20 +8,20 @@ where
import GhcPrelude import GhcPrelude
import SPARC.CodeGen.CondCode import GHC.CmmToAsm.SPARC.CodeGen.CondCode
import SPARC.CodeGen.Amode import GHC.CmmToAsm.SPARC.CodeGen.Amode
import SPARC.CodeGen.Gen64 import GHC.CmmToAsm.SPARC.CodeGen.Gen64
import SPARC.CodeGen.Base import GHC.CmmToAsm.SPARC.CodeGen.Base
import SPARC.Stack import GHC.CmmToAsm.SPARC.Stack
import SPARC.Instr import GHC.CmmToAsm.SPARC.Instr
import SPARC.Cond import GHC.CmmToAsm.SPARC.Cond
import SPARC.AddrMode import GHC.CmmToAsm.SPARC.AddrMode
import SPARC.Imm import GHC.CmmToAsm.SPARC.Imm
import SPARC.Regs import GHC.CmmToAsm.SPARC.Regs
import SPARC.Base import GHC.CmmToAsm.SPARC.Base
import NCGMonad import GHC.CmmToAsm.Monad
import Format import GHC.CmmToAsm.Format
import Reg import GHC.Platform.Reg
import GHC.Cmm import GHC.Cmm
......
module SPARC.CodeGen.Gen32 ( module GHC.CmmToAsm.SPARC.CodeGen.Gen32 (
getSomeReg, getSomeReg,
getRegister getRegister
) )
where where
import SPARC.CodeGen.Base import GHC.CmmToAsm.SPARC.CodeGen.Base
import NCGMonad import GHC.CmmToAsm.Monad
import Reg import GHC.Platform.Reg
import GHC.Cmm import GHC.Cmm
......
-- | Evaluation of 64 bit values on 32 bit platforms. -- | Evaluation of 64 bit values on 32 bit platforms.
module SPARC.CodeGen.Gen64 ( module GHC.CmmToAsm.SPARC.CodeGen.Gen64 (
assignMem_I64Code, assignMem_I64Code,
assignReg_I64Code, assignReg_I64Code,
iselExpr64 iselExpr64
...@@ -9,18 +9,18 @@ where ...@@ -9,18 +9,18 @@ where
import GhcPrelude import GhcPrelude
import {-# SOURCE #-} SPARC.CodeGen.Gen32 import {-# SOURCE #-} GHC.CmmToAsm.SPARC.CodeGen.Gen32
import SPARC.CodeGen.Base import GHC.CmmToAsm.SPARC.CodeGen.Base
import SPARC.CodeGen.Amode import GHC.CmmToAsm.SPARC.CodeGen.Amode
import SPARC.Regs import GHC.CmmToAsm.SPARC.Regs
import SPARC.AddrMode import GHC.CmmToAsm.SPARC.AddrMode
import SPARC.Imm import GHC.CmmToAsm.SPARC.Imm
import SPARC.Instr import GHC.CmmToAsm.SPARC.Instr