diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-02-22 15:05:20 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-02-24 20:55:25 -0500 |
commit | 1b1067d14b656bbbfa7c47f156ec2700c9751549 (patch) | |
tree | 32346e3c4c3f89117190b36364144d85dc260e05 /compiler | |
parent | 354e2787be08fb6d973de1a39e58080ff8e107f8 (diff) | |
download | haskell-1b1067d14b656bbbfa7c47f156ec2700c9751549.tar.gz |
Modules: CmmToAsm (#13009)
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/GHC/CmmToAsm.hs (renamed from compiler/nativeGen/AsmCodeGen.hs) | 60 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/BlockLayout.hs (renamed from compiler/nativeGen/BlockLayout.hs) | 8 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/CFG.hs (renamed from compiler/nativeGen/CFG.hs) | 4 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/CFG/Dominators.hs (renamed from compiler/utils/Dominators.hs) | 2 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/CPrim.hs (renamed from compiler/nativeGen/CPrim.hs) | 2 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Dwarf.hs (renamed from compiler/nativeGen/Dwarf.hs) | 6 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Dwarf/Constants.hs (renamed from compiler/nativeGen/Dwarf/Constants.hs) | 6 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Dwarf/Types.hs (renamed from compiler/nativeGen/Dwarf/Types.hs) | 6 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Format.hs (renamed from compiler/nativeGen/Format.hs) | 2 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Instr.hs (renamed from compiler/nativeGen/Instruction.hs) | 4 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Monad.hs (renamed from compiler/nativeGen/NCGMonad.hs) | 12 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/PIC.hs (renamed from compiler/nativeGen/PIC.hs) | 15 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/PPC/CodeGen.hs (renamed from compiler/nativeGen/PPC/CodeGen.hs) | 30 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/PPC/Cond.hs (renamed from compiler/nativeGen/PPC/Cond.hs) | 2 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/PPC/Instr.hs (renamed from compiler/nativeGen/PPC/Instr.hs) | 20 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/PPC/Ppr.hs (renamed from compiler/nativeGen/PPC/Ppr.hs) | 20 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/PPC/RegInfo.hs (renamed from compiler/nativeGen/PPC/RegInfo.hs) | 4 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/PPC/Regs.hs (renamed from compiler/nativeGen/PPC/Regs.hs) | 8 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Ppr.hs (renamed from compiler/nativeGen/PprBase.hs) | 2 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Graph.hs (renamed from compiler/nativeGen/RegAlloc/Graph/Main.hs) | 24 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Graph/Base.hs (renamed from compiler/nativeGen/RegAlloc/Graph/ArchBase.hs) | 2 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Graph/Coalesce.hs (renamed from compiler/nativeGen/RegAlloc/Graph/Coalesce.hs) | 8 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs (renamed from compiler/nativeGen/RegAlloc/Graph/Spill.hs) | 8 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs (renamed from compiler/nativeGen/RegAlloc/Graph/SpillClean.hs) | 8 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs (renamed from compiler/nativeGen/RegAlloc/Graph/SpillCost.hs) | 12 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs (renamed from compiler/nativeGen/RegAlloc/Graph/Stats.hs) | 18 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs (renamed from compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs) | 6 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Graph/X86.hs (renamed from compiler/nativeGen/RegAlloc/Graph/ArchX86.hs) | 4 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Linear.hs (renamed from compiler/nativeGen/RegAlloc/Linear/Main.hs) | 34 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Linear/Base.hs (renamed from compiler/nativeGen/RegAlloc/Linear/Base.hs) | 8 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs (renamed from compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs) | 20 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs (renamed from compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs) | 14 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Linear/PPC.hs (renamed from compiler/nativeGen/RegAlloc/Linear/PPC/FreeRegs.hs) | 9 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Linear/SPARC.hs (renamed from compiler/nativeGen/RegAlloc/Linear/SPARC/FreeRegs.hs) | 9 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Linear/StackMap.hs (renamed from compiler/nativeGen/RegAlloc/Linear/StackMap.hs) | 2 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Linear/State.hs (renamed from compiler/nativeGen/RegAlloc/Linear/State.hs) | 14 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Linear/Stats.hs (renamed from compiler/nativeGen/RegAlloc/Linear/Stats.hs) | 8 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Linear/X86.hs (renamed from compiler/nativeGen/RegAlloc/Linear/X86/FreeRegs.hs) | 9 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Linear/X86_64.hs (renamed from compiler/nativeGen/RegAlloc/Linear/X86_64/FreeRegs.hs) | 9 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Liveness.hs (renamed from compiler/nativeGen/RegAlloc/Liveness.hs) | 8 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Target.hs (renamed from compiler/nativeGen/TargetReg.hs) | 18 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/AddrMode.hs (renamed from compiler/nativeGen/SPARC/AddrMode.hs) | 8 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/Base.hs (renamed from compiler/nativeGen/SPARC/Base.hs) | 2 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/CodeGen.hs (renamed from compiler/nativeGen/SPARC/CodeGen.hs) | 38 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/CodeGen/Amode.hs (renamed from compiler/nativeGen/SPARC/CodeGen/Amode.hs) | 20 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/CodeGen/Base.hs (renamed from compiler/nativeGen/SPARC/CodeGen/Base.hs) | 14 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/CodeGen/CondCode.hs (renamed from compiler/nativeGen/SPARC/CodeGen/CondCode.hs) | 20 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/CodeGen/Expand.hs (renamed from compiler/nativeGen/SPARC/CodeGen/Expand.hs) | 16 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen32.hs (renamed from compiler/nativeGen/SPARC/CodeGen/Gen32.hs) | 30 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen32.hs-boot (renamed from compiler/nativeGen/SPARC/CodeGen/Gen32.hs-boot) | 8 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen64.hs (renamed from compiler/nativeGen/SPARC/CodeGen/Gen64.hs) | 26 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/CodeGen/Sanity.hs (renamed from compiler/nativeGen/SPARC/CodeGen/Sanity.hs) | 8 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/Cond.hs (renamed from compiler/nativeGen/SPARC/Cond.hs) | 2 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/Imm.hs (renamed from compiler/nativeGen/SPARC/Imm.hs) | 2 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/Instr.hs (renamed from compiler/nativeGen/SPARC/Instr.hs) | 24 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/Ppr.hs (renamed from compiler/nativeGen/SPARC/Ppr.hs) | 22 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/Regs.hs (renamed from compiler/nativeGen/SPARC/Regs.hs) | 8 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/ShortcutJump.hs (renamed from compiler/nativeGen/SPARC/ShortcutJump.hs) | 6 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/SPARC/Stack.hs (renamed from compiler/nativeGen/SPARC/Stack.hs) | 10 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/X86/CodeGen.hs (renamed from compiler/nativeGen/X86/CodeGen.hs) | 40 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/X86/Cond.hs (renamed from compiler/nativeGen/X86/Cond.hs) | 2 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/X86/Instr.hs (renamed from compiler/nativeGen/X86/Instr.hs) | 28 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/X86/Ppr.hs (renamed from compiler/nativeGen/X86/Ppr.hs) | 16 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/X86/RegInfo.hs (renamed from compiler/nativeGen/X86/RegInfo.hs) | 8 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/X86/Regs.hs (renamed from compiler/nativeGen/X86/Regs.hs) | 6 | ||||
-rw-r--r-- | compiler/GHC/CmmToC.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Driver/CodeOutput.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Llvm/Types.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Platform/Reg.hs (renamed from compiler/nativeGen/Reg.hs) | 4 | ||||
-rw-r--r-- | compiler/GHC/Platform/Reg/Class.hs (renamed from compiler/nativeGen/RegClass.hs) | 2 | ||||
-rw-r--r-- | compiler/GHC/Platform/Regs.hs | 2 | ||||
-rw-r--r-- | compiler/ghc.cabal.in | 133 | ||||
-rw-r--r-- | compiler/nativeGen/NOTES | 41 |
73 files changed, 488 insertions, 529 deletions
diff --git a/compiler/nativeGen/AsmCodeGen.hs b/compiler/GHC/CmmToAsm.hs index 9aa6933757..8dc9b61198 100644 --- a/compiler/nativeGen/AsmCodeGen.hs +++ b/compiler/GHC/CmmToAsm.hs @@ -15,7 +15,7 @@ {-# OPTIONS_GHC -Wno-incomplete-record-updates #-} -module AsmCodeGen ( +module GHC.CmmToAsm ( -- * Module entry point nativeCodeGen @@ -32,43 +32,43 @@ module AsmCodeGen ( import GhcPrelude -import qualified X86.CodeGen -import qualified X86.Regs -import qualified X86.Instr -import qualified X86.Ppr +import qualified GHC.CmmToAsm.X86.CodeGen as X86.CodeGen +import qualified GHC.CmmToAsm.X86.Regs as X86.Regs +import qualified GHC.CmmToAsm.X86.Instr as X86.Instr +import qualified GHC.CmmToAsm.X86.Ppr as X86.Ppr -import qualified SPARC.CodeGen -import qualified SPARC.Regs -import qualified SPARC.Instr -import qualified SPARC.Ppr -import qualified SPARC.ShortcutJump -import qualified SPARC.CodeGen.Expand +import qualified GHC.CmmToAsm.SPARC.CodeGen as SPARC.CodeGen +import qualified GHC.CmmToAsm.SPARC.Regs as SPARC.Regs +import qualified GHC.CmmToAsm.SPARC.Instr as SPARC.Instr +import qualified GHC.CmmToAsm.SPARC.Ppr as SPARC.Ppr +import qualified GHC.CmmToAsm.SPARC.ShortcutJump as SPARC.ShortcutJump +import qualified GHC.CmmToAsm.SPARC.CodeGen.Expand as SPARC.CodeGen.Expand -import qualified PPC.CodeGen -import qualified PPC.Regs -import qualified PPC.RegInfo -import qualified PPC.Instr -import qualified PPC.Ppr +import qualified GHC.CmmToAsm.PPC.CodeGen as PPC.CodeGen +import qualified GHC.CmmToAsm.PPC.Regs as PPC.Regs +import qualified GHC.CmmToAsm.PPC.RegInfo as PPC.RegInfo +import qualified GHC.CmmToAsm.PPC.Instr as PPC.Instr +import qualified GHC.CmmToAsm.PPC.Ppr as PPC.Ppr -import RegAlloc.Liveness -import qualified RegAlloc.Linear.Main as Linear +import GHC.CmmToAsm.Reg.Liveness +import qualified GHC.CmmToAsm.Reg.Linear as Linear -import qualified GraphColor as Color -import qualified RegAlloc.Graph.Main as Color -import qualified RegAlloc.Graph.Stats as Color -import qualified RegAlloc.Graph.TrivColorable as Color +import qualified GraphColor as Color +import qualified GHC.CmmToAsm.Reg.Graph as Color +import qualified GHC.CmmToAsm.Reg.Graph.Stats as Color +import qualified GHC.CmmToAsm.Reg.Graph.TrivColorable as Color import AsmUtils -import TargetReg +import GHC.CmmToAsm.Reg.Target import GHC.Platform -import BlockLayout +import GHC.CmmToAsm.BlockLayout as BlockLayout import Config -import Instruction -import PIC -import Reg -import NCGMonad -import CFG -import Dwarf +import GHC.CmmToAsm.Instr +import GHC.CmmToAsm.PIC +import GHC.Platform.Reg +import GHC.CmmToAsm.Monad +import GHC.CmmToAsm.CFG +import GHC.CmmToAsm.Dwarf import GHC.Cmm.DebugBlock import GHC.Cmm.BlockId diff --git a/compiler/nativeGen/BlockLayout.hs b/compiler/GHC/CmmToAsm/BlockLayout.hs index e488f0908f..01a1388b5f 100644 --- a/compiler/nativeGen/BlockLayout.hs +++ b/compiler/GHC/CmmToAsm/BlockLayout.hs @@ -9,16 +9,16 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleContexts #-} -module BlockLayout +module GHC.CmmToAsm.BlockLayout ( sequenceTop ) where #include "HsVersions.h" import GhcPrelude -import Instruction -import NCGMonad -import CFG +import GHC.CmmToAsm.Instr +import GHC.CmmToAsm.Monad +import GHC.CmmToAsm.CFG import GHC.Cmm.BlockId import GHC.Cmm diff --git a/compiler/nativeGen/CFG.hs b/compiler/GHC/CmmToAsm/CFG.hs index 7e2c2de095..f52ff514b1 100644 --- a/compiler/nativeGen/CFG.hs +++ b/compiler/GHC/CmmToAsm/CFG.hs @@ -10,7 +10,7 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE DataKinds #-} -module CFG +module GHC.CmmToAsm.CFG ( CFG, CfgEdge(..), EdgeInfo(..), EdgeWeight(..) , TransitionSource(..) @@ -61,7 +61,7 @@ import Digraph import Maybes import Unique -import qualified Dominators as Dom +import qualified GHC.CmmToAsm.CFG.Dominators as Dom import Data.IntMap.Strict (IntMap) import Data.IntSet (IntSet) diff --git a/compiler/utils/Dominators.hs b/compiler/GHC/CmmToAsm/CFG/Dominators.hs index 485cc75995..b9dcacd8cb 100644 --- a/compiler/utils/Dominators.hs +++ b/compiler/GHC/CmmToAsm/CFG/Dominators.hs @@ -25,7 +25,7 @@ Originally taken from the dom-lt package.
-}
-module Dominators (
+module GHC.CmmToAsm.CFG.Dominators (
Node,Path,Edge
,Graph,Rooted
,idom,ipdom
diff --git a/compiler/nativeGen/CPrim.hs b/compiler/GHC/CmmToAsm/CPrim.hs index 344e62d53c..34c3a7ff6a 100644 --- a/compiler/nativeGen/CPrim.hs +++ b/compiler/GHC/CmmToAsm/CPrim.hs @@ -1,5 +1,5 @@ -- | Generating C symbol names emitted by the compiler. -module CPrim +module GHC.CmmToAsm.CPrim ( atomicReadLabel , atomicWriteLabel , atomicRMWLabel diff --git a/compiler/nativeGen/Dwarf.hs b/compiler/GHC/CmmToAsm/Dwarf.hs index 5bd62a7234..8cacd19023 100644 --- a/compiler/nativeGen/Dwarf.hs +++ b/compiler/GHC/CmmToAsm/Dwarf.hs @@ -1,4 +1,4 @@ -module Dwarf ( +module GHC.CmmToAsm.Dwarf ( dwarfGen ) where @@ -16,8 +16,8 @@ import GHC.Platform import Unique import UniqSupply -import Dwarf.Constants -import Dwarf.Types +import GHC.CmmToAsm.Dwarf.Constants +import GHC.CmmToAsm.Dwarf.Types import Control.Arrow ( first ) import Control.Monad ( mfilter ) diff --git a/compiler/nativeGen/Dwarf/Constants.hs b/compiler/GHC/CmmToAsm/Dwarf/Constants.hs index 01b85c47bc..4ab54b6629 100644 --- a/compiler/nativeGen/Dwarf/Constants.hs +++ b/compiler/GHC/CmmToAsm/Dwarf/Constants.hs @@ -1,7 +1,7 @@ -- | Constants describing the DWARF format. Most of this simply -- mirrors /usr/include/dwarf.h. -module Dwarf.Constants where +module GHC.CmmToAsm.Dwarf.Constants where import GhcPrelude @@ -10,8 +10,8 @@ import FastString import GHC.Platform import Outputable -import Reg -import X86.Regs +import GHC.Platform.Reg +import GHC.CmmToAsm.X86.Regs import Data.Word diff --git a/compiler/nativeGen/Dwarf/Types.hs b/compiler/GHC/CmmToAsm/Dwarf/Types.hs index c006081872..5eda37a653 100644 --- a/compiler/nativeGen/Dwarf/Types.hs +++ b/compiler/GHC/CmmToAsm/Dwarf/Types.hs @@ -1,4 +1,4 @@ -module Dwarf.Types +module GHC.CmmToAsm.Dwarf.Types ( -- * Dwarf information DwarfInfo(..) , pprDwarfInfo @@ -32,11 +32,11 @@ import FastString import Outputable import GHC.Platform import Unique -import Reg +import GHC.Platform.Reg import SrcLoc import Util -import Dwarf.Constants +import GHC.CmmToAsm.Dwarf.Constants import qualified Data.ByteString as BS import qualified Control.Monad.Trans.State.Strict as S diff --git a/compiler/nativeGen/Format.hs b/compiler/GHC/CmmToAsm/Format.hs index d7b6f6b868..446c760939 100644 --- a/compiler/nativeGen/Format.hs +++ b/compiler/GHC/CmmToAsm/Format.hs @@ -8,7 +8,7 @@ -- to have architecture specific formats, and do the overloading -- properly. eg SPARC doesn't care about FF80. -- -module Format ( +module GHC.CmmToAsm.Format ( Format(..), intFormat, floatFormat, diff --git a/compiler/nativeGen/Instruction.hs b/compiler/GHC/CmmToAsm/Instr.hs index 23c5ced1d8..44fa9b7cc9 100644 --- a/compiler/nativeGen/Instruction.hs +++ b/compiler/GHC/CmmToAsm/Instr.hs @@ -1,5 +1,5 @@ -module Instruction ( +module GHC.CmmToAsm.Instr ( RegUsage(..), noUsage, GenBasicBlock(..), blockId, @@ -16,7 +16,7 @@ where import GhcPrelude -import Reg +import GHC.Platform.Reg import GHC.Cmm.BlockId import GHC.Cmm.Dataflow.Collections diff --git a/compiler/nativeGen/NCGMonad.hs b/compiler/GHC/CmmToAsm/Monad.hs index 5f2af49d4c..c9414a2eee 100644 --- a/compiler/nativeGen/NCGMonad.hs +++ b/compiler/GHC/CmmToAsm/Monad.hs @@ -10,7 +10,7 @@ -- -- ----------------------------------------------------------------------------- -module NCGMonad ( +module GHC.CmmToAsm.Monad ( NcgImpl(..), NatM_State(..), mkNatM_State, @@ -45,9 +45,9 @@ where import GhcPrelude -import Reg -import Format -import TargetReg +import GHC.Platform.Reg +import GHC.CmmToAsm.Format +import GHC.CmmToAsm.Reg.Target import GHC.Cmm.BlockId import GHC.Cmm.Dataflow.Collections @@ -63,10 +63,10 @@ import Module import Control.Monad ( ap ) -import Instruction +import GHC.CmmToAsm.Instr import Outputable (SDoc, pprPanic, ppr) import GHC.Cmm (RawCmmDecl, RawCmmStatics) -import CFG +import GHC.CmmToAsm.CFG data NcgImpl statics instr jumpDest = NcgImpl { cmmTopCodeGen :: RawCmmDecl -> NatM [NatCmmDecl statics instr], diff --git a/compiler/nativeGen/PIC.hs b/compiler/GHC/CmmToAsm/PIC.hs index 5c217f2fe6..323d93d173 100644 --- a/compiler/nativeGen/PIC.hs +++ b/compiler/GHC/CmmToAsm/PIC.hs @@ -33,7 +33,7 @@ that wasn't in the original Cmm code (e.g. floating point literals). -} -module PIC ( +module GHC.CmmToAsm.PIC ( cmmMakeDynamicReference, CmmMakeDynamicReferenceM(..), ReferenceKind(..), @@ -49,15 +49,14 @@ where import GhcPrelude -import qualified PPC.Instr as PPC -import qualified PPC.Regs as PPC - -import qualified X86.Instr as X86 +import qualified GHC.CmmToAsm.PPC.Instr as PPC +import qualified GHC.CmmToAsm.PPC.Regs as PPC +import qualified GHC.CmmToAsm.X86.Instr as X86 import GHC.Platform -import Instruction -import Reg -import NCGMonad +import GHC.CmmToAsm.Instr +import GHC.Platform.Reg +import GHC.CmmToAsm.Monad import GHC.Cmm.Dataflow.Collections diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs index ad47501981..02319171dc 100644 --- a/compiler/nativeGen/PPC/CodeGen.hs +++ b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs @@ -12,7 +12,7 @@ -- (a) the sectioning, and (b) the type signatures, -- the structure should not be too overwhelming. -module PPC.CodeGen ( +module GHC.CmmToAsm.PPC.CodeGen ( cmmTopCodeGen, generateJumpTableForInstr, InstrBlock @@ -26,19 +26,21 @@ where import GhcPrelude import GHC.Platform.Regs -import PPC.Instr -import PPC.Cond -import PPC.Regs -import CPrim -import NCGMonad ( NatM, getNewRegNat, getNewLabelNat - , getBlockIdNat, getPicBaseNat, getNewRegPairNat - , getPicBaseMaybeNat ) -import Instruction -import PIC -import Format -import RegClass -import Reg -import TargetReg +import GHC.CmmToAsm.PPC.Instr +import GHC.CmmToAsm.PPC.Cond +import GHC.CmmToAsm.PPC.Regs +import GHC.CmmToAsm.CPrim +import GHC.CmmToAsm.Monad + ( NatM, getNewRegNat, getNewLabelNat + , getBlockIdNat, getPicBaseNat, getNewRegPairNat + , getPicBaseMaybeNat + ) +import GHC.CmmToAsm.Instr +import GHC.CmmToAsm.PIC +import GHC.CmmToAsm.Format +import GHC.Platform.Reg.Class +import GHC.Platform.Reg +import GHC.CmmToAsm.Reg.Target import GHC.Platform -- Our intermediate code: diff --git a/compiler/nativeGen/PPC/Cond.hs b/compiler/GHC/CmmToAsm/PPC/Cond.hs index bd8bdee81a..e8efa30064 100644 --- a/compiler/nativeGen/PPC/Cond.hs +++ b/compiler/GHC/CmmToAsm/PPC/Cond.hs @@ -1,4 +1,4 @@ -module PPC.Cond ( +module GHC.CmmToAsm.PPC.Cond ( Cond(..), condNegate, condUnsigned, diff --git a/compiler/nativeGen/PPC/Instr.hs b/compiler/GHC/CmmToAsm/PPC/Instr.hs index ad2039d463..b92a952340 100644 --- a/compiler/nativeGen/PPC/Instr.hs +++ b/compiler/GHC/CmmToAsm/PPC/Instr.hs @@ -12,7 +12,7 @@ #include "HsVersions.h" -module PPC.Instr ( +module GHC.CmmToAsm.PPC.Instr ( archWordFormat, RI(..), Instr(..), @@ -26,13 +26,13 @@ where import GhcPrelude -import PPC.Regs -import PPC.Cond -import Instruction -import Format -import TargetReg -import RegClass -import Reg +import GHC.CmmToAsm.PPC.Regs +import GHC.CmmToAsm.PPC.Cond +import GHC.CmmToAsm.Instr +import GHC.CmmToAsm.Format +import GHC.CmmToAsm.Reg.Target +import GHC.Platform.Reg.Class +import GHC.Platform.Reg import GHC.Platform.Regs import GHC.Cmm.BlockId @@ -110,8 +110,8 @@ ppc_mkStackAllocInstr' platform amount allocMoreStack :: Platform -> Int - -> NatCmmDecl statics PPC.Instr.Instr - -> UniqSM (NatCmmDecl statics PPC.Instr.Instr, [(BlockId,BlockId)]) + -> NatCmmDecl statics GHC.CmmToAsm.PPC.Instr.Instr + -> UniqSM (NatCmmDecl statics GHC.CmmToAsm.PPC.Instr.Instr, [(BlockId,BlockId)]) allocMoreStack _ _ top@(CmmData _ _) = return (top,[]) allocMoreStack platform slots (CmmProc info lbl live (ListGraph code)) = do diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/GHC/CmmToAsm/PPC/Ppr.hs index 8b81274db9..550bd618ef 100644 --- a/compiler/nativeGen/PPC/Ppr.hs +++ b/compiler/GHC/CmmToAsm/PPC/Ppr.hs @@ -7,19 +7,19 @@ ----------------------------------------------------------------------------- {-# OPTIONS_GHC -fno-warn-orphans #-} -module PPC.Ppr (pprNatCmmDecl) where +module GHC.CmmToAsm.PPC.Ppr (pprNatCmmDecl) where import GhcPrelude -import PPC.Regs -import PPC.Instr -import PPC.Cond -import PprBase -import Instruction -import Format -import Reg -import RegClass -import TargetReg +import GHC.CmmToAsm.PPC.Regs +import GHC.CmmToAsm.PPC.Instr +import GHC.CmmToAsm.PPC.Cond +import GHC.CmmToAsm.Ppr +import GHC.CmmToAsm.Instr +import GHC.CmmToAsm.Format +import GHC.Platform.Reg +import GHC.Platform.Reg.Class +import GHC.CmmToAsm.Reg.Target import GHC.Cmm hiding (topInfoTable) import GHC.Cmm.Dataflow.Collections diff --git a/compiler/nativeGen/PPC/RegInfo.hs b/compiler/GHC/CmmToAsm/PPC/RegInfo.hs index c1a4e73e3d..a75040d703 100644 --- a/compiler/nativeGen/PPC/RegInfo.hs +++ b/compiler/GHC/CmmToAsm/PPC/RegInfo.hs @@ -7,7 +7,7 @@ -- (c) The University of Glasgow 1996-2004 -- ----------------------------------------------------------------------------- -module PPC.RegInfo ( +module GHC.CmmToAsm.PPC.RegInfo ( JumpDest( DestBlockId ), getJumpDestBlockId, canShortcut, shortcutJump, @@ -21,7 +21,7 @@ where import GhcPrelude -import PPC.Instr +import GHC.CmmToAsm.PPC.Instr import GHC.Cmm.BlockId import GHC.Cmm diff --git a/compiler/nativeGen/PPC/Regs.hs b/compiler/GHC/CmmToAsm/PPC/Regs.hs index ff3ec639be..8a9a859665 100644 --- a/compiler/nativeGen/PPC/Regs.hs +++ b/compiler/GHC/CmmToAsm/PPC/Regs.hs @@ -6,7 +6,7 @@ -- -- ----------------------------------------------------------------------------- -module PPC.Regs ( +module GHC.CmmToAsm.PPC.Regs ( -- squeeze functions virtualRegSqueeze, realRegSqueeze, @@ -51,9 +51,9 @@ where import GhcPrelude -import Reg -import RegClass -import Format +import GHC.Platform.Reg +import GHC.Platform.Reg.Class +import GHC.CmmToAsm.Format import GHC.Cmm import GHC.Cmm.CLabel ( CLabel ) diff --git a/compiler/nativeGen/PprBase.hs b/compiler/GHC/CmmToAsm/Ppr.hs index dc6e65bd70..636d2e4e3a 100644 --- a/compiler/nativeGen/PprBase.hs +++ b/compiler/GHC/CmmToAsm/Ppr.hs @@ -8,7 +8,7 @@ -- ----------------------------------------------------------------------------- -module PprBase ( +module GHC.CmmToAsm.Ppr ( castFloatToWord8Array, castDoubleToWord8Array, floatToBytes, diff --git a/compiler/nativeGen/RegAlloc/Graph/Main.hs b/compiler/GHC/CmmToAsm/Reg/Graph.hs index 6b2758f723..6dfe84cf95 100644 --- a/compiler/nativeGen/RegAlloc/Graph/Main.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph.hs @@ -2,22 +2,22 @@ {-# LANGUAGE ScopedTypeVariables #-} -- | Graph coloring register allocator. -module RegAlloc.Graph.Main ( +module GHC.CmmToAsm.Reg.Graph ( regAlloc ) where import GhcPrelude import qualified GraphColor as Color -import RegAlloc.Liveness -import RegAlloc.Graph.Spill -import RegAlloc.Graph.SpillClean -import RegAlloc.Graph.SpillCost -import RegAlloc.Graph.Stats -import RegAlloc.Graph.TrivColorable -import Instruction -import TargetReg -import RegClass -import Reg +import GHC.CmmToAsm.Reg.Liveness +import GHC.CmmToAsm.Reg.Graph.Spill +import GHC.CmmToAsm.Reg.Graph.SpillClean +import GHC.CmmToAsm.Reg.Graph.SpillCost +import GHC.CmmToAsm.Reg.Graph.Stats +import GHC.CmmToAsm.Reg.Graph.TrivColorable +import GHC.CmmToAsm.Instr +import GHC.CmmToAsm.Reg.Target +import GHC.Platform.Reg.Class +import GHC.Platform.Reg import Bag import GHC.Driver.Session @@ -27,7 +27,7 @@ import UniqFM import UniqSet import UniqSupply import Util (seqList) -import CFG +import GHC.CmmToAsm.CFG import Data.Maybe import Control.Monad diff --git a/compiler/nativeGen/RegAlloc/Graph/ArchBase.hs b/compiler/GHC/CmmToAsm/Reg/Graph/Base.hs index c38d998779..95fa174415 100644 --- a/compiler/nativeGen/RegAlloc/Graph/ArchBase.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/Base.hs @@ -12,7 +12,7 @@ -- This code is here because we can test the architecture specific code against -- it. -- -module RegAlloc.Graph.ArchBase ( +module GHC.CmmToAsm.Reg.Graph.Base ( RegClass(..), Reg(..), RegSub(..), diff --git a/compiler/nativeGen/RegAlloc/Graph/Coalesce.hs b/compiler/GHC/CmmToAsm/Reg/Graph/Coalesce.hs index f42ff9450a..d223137dd0 100644 --- a/compiler/nativeGen/RegAlloc/Graph/Coalesce.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/Coalesce.hs @@ -1,13 +1,13 @@ -- | Register coalescing. -module RegAlloc.Graph.Coalesce ( +module GHC.CmmToAsm.Reg.Graph.Coalesce ( regCoalesce, slurpJoinMovs ) where import GhcPrelude -import RegAlloc.Liveness -import Instruction -import Reg +import GHC.CmmToAsm.Reg.Liveness +import GHC.CmmToAsm.Instr +import GHC.Platform.Reg import GHC.Cmm import Bag diff --git a/compiler/nativeGen/RegAlloc/Graph/Spill.hs b/compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs index 9ffb51ee29..a0e11433f7 100644 --- a/compiler/nativeGen/RegAlloc/Graph/Spill.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs @@ -2,16 +2,16 @@ -- | 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 -- code to use those slots. -module RegAlloc.Graph.Spill ( +module GHC.CmmToAsm.Reg.Graph.Spill ( regSpill, SpillStats(..), accSpillSL ) where import GhcPrelude -import RegAlloc.Liveness -import Instruction -import Reg +import GHC.CmmToAsm.Reg.Liveness +import GHC.CmmToAsm.Instr +import GHC.Platform.Reg import GHC.Cmm hiding (RegSet) import GHC.Cmm.BlockId import GHC.Cmm.Dataflow.Collections diff --git a/compiler/nativeGen/RegAlloc/Graph/SpillClean.hs b/compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs index bd8b449cbb..6d14c7194b 100644 --- a/compiler/nativeGen/RegAlloc/Graph/SpillClean.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs @@ -26,14 +26,14 @@ -- 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. -- -module RegAlloc.Graph.SpillClean ( +module GHC.CmmToAsm.Reg.Graph.SpillClean ( cleanSpills ) where import GhcPrelude -import RegAlloc.Liveness -import Instruction -import Reg +import GHC.CmmToAsm.Reg.Liveness +import GHC.CmmToAsm.Instr +import GHC.Platform.Reg import GHC.Cmm.BlockId import GHC.Cmm diff --git a/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs b/compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs index 4870bf5269..e3e456e98d 100644 --- a/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs @@ -1,5 +1,5 @@ {-# LANGUAGE ScopedTypeVariables, GADTs, BangPatterns #-} -module RegAlloc.Graph.SpillCost ( +module GHC.CmmToAsm.Reg.Graph.SpillCost ( SpillCostRecord, plusSpillCostRecord, pprSpillCostRecord, @@ -15,10 +15,10 @@ module RegAlloc.Graph.SpillCost ( ) where import GhcPrelude -import RegAlloc.Liveness -import Instruction -import RegClass -import Reg +import GHC.CmmToAsm.Reg.Liveness +import GHC.CmmToAsm.Instr +import GHC.Platform.Reg.Class +import GHC.Platform.Reg import GraphBase @@ -31,7 +31,7 @@ import Digraph (flattenSCCs) import Outputable import GHC.Platform import State -import CFG +import GHC.CmmToAsm.CFG import Data.List (nub, minimumBy) import Data.Maybe diff --git a/compiler/nativeGen/RegAlloc/Graph/Stats.hs b/compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs index 2159548437..05d2e814af 100644 --- a/compiler/nativeGen/RegAlloc/Graph/Stats.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs @@ -4,7 +4,7 @@ -- | Carries interesting info for debugging / profiling of the -- graph coloring register allocator. -module RegAlloc.Graph.Stats ( +module GHC.CmmToAsm.Reg.Graph.Stats ( RegAllocStats (..), pprStats, @@ -19,14 +19,14 @@ module RegAlloc.Graph.Stats ( import GhcPrelude import qualified GraphColor as Color -import RegAlloc.Liveness -import RegAlloc.Graph.Spill -import RegAlloc.Graph.SpillCost -import RegAlloc.Graph.TrivColorable -import Instruction -import RegClass -import Reg -import TargetReg +import GHC.CmmToAsm.Reg.Liveness +import GHC.CmmToAsm.Reg.Graph.Spill +import GHC.CmmToAsm.Reg.Graph.SpillCost +import GHC.CmmToAsm.Reg.Graph.TrivColorable +import GHC.CmmToAsm.Instr +import GHC.Platform.Reg.Class +import GHC.Platform.Reg +import GHC.CmmToAsm.Reg.Target import Outputable import UniqFM diff --git a/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs b/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs index cc2ad7d594..ec7c5ad13e 100644 --- a/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs @@ -1,6 +1,6 @@ {-# LANGUAGE CPP #-} -module RegAlloc.Graph.TrivColorable ( +module GHC.CmmToAsm.Reg.Graph.TrivColorable ( trivColorable, ) @@ -10,8 +10,8 @@ where import GhcPrelude -import RegClass -import Reg +import GHC.Platform.Reg.Class +import GHC.Platform.Reg import GraphBase diff --git a/compiler/nativeGen/RegAlloc/Graph/ArchX86.hs b/compiler/GHC/CmmToAsm/Reg/Graph/X86.hs index 0472e4cf09..0d4c56ba21 100644 --- a/compiler/nativeGen/RegAlloc/Graph/ArchX86.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/X86.hs @@ -6,7 +6,7 @@ -- See RegArchBase.hs for the reference. -- See MachRegs.hs for the actual trivColorable function used in GHC. -- -module RegAlloc.Graph.ArchX86 ( +module GHC.CmmToAsm.Reg.Graph.X86 ( classOfReg, regsOfClass, regName, @@ -17,7 +17,7 @@ module RegAlloc.Graph.ArchX86 ( import GhcPrelude -import RegAlloc.Graph.ArchBase (Reg(..), RegSub(..), RegClass(..)) +import GHC.CmmToAsm.Reg.Graph.Base (Reg(..), RegSub(..), RegClass(..)) import UniqSet import qualified Data.Array as A diff --git a/compiler/nativeGen/RegAlloc/Linear/Main.hs b/compiler/GHC/CmmToAsm/Reg/Linear.hs index 076b63a4ed..9b263889d8 100644 --- a/compiler/nativeGen/RegAlloc/Linear/Main.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear.hs @@ -95,10 +95,10 @@ The algorithm is roughly: -} -module RegAlloc.Linear.Main ( +module GHC.CmmToAsm.Reg.Linear ( regAlloc, - module RegAlloc.Linear.Base, - module RegAlloc.Linear.Stats + module GHC.CmmToAsm.Reg.Linear.Base, + module GHC.CmmToAsm.Reg.Linear.Stats ) where #include "HsVersions.h" @@ -106,20 +106,20 @@ module RegAlloc.Linear.Main ( import GhcPrelude -import RegAlloc.Linear.State -import RegAlloc.Linear.Base -import RegAlloc.Linear.StackMap -import RegAlloc.Linear.FreeRegs -import RegAlloc.Linear.Stats -import RegAlloc.Linear.JoinToTargets -import qualified RegAlloc.Linear.PPC.FreeRegs as PPC -import qualified RegAlloc.Linear.SPARC.FreeRegs as SPARC -import qualified RegAlloc.Linear.X86.FreeRegs as X86 -import qualified RegAlloc.Linear.X86_64.FreeRegs as X86_64 -import TargetReg -import RegAlloc.Liveness -import Instruction -import Reg +import GHC.CmmToAsm.Reg.Linear.State +import GHC.CmmToAsm.Reg.Linear.Base +import GHC.CmmToAsm.Reg.Linear.StackMap +import GHC.CmmToAsm.Reg.Linear.FreeRegs +import GHC.CmmToAsm.Reg.Linear.Stats +import GHC.CmmToAsm.Reg.Linear.JoinToTargets +import qualified GHC.CmmToAsm.Reg.Linear.PPC as PPC +import qualified GHC.CmmToAsm.Reg.Linear.SPARC as SPARC +import qualified GHC.CmmToAsm.Reg.Linear.X86 as X86 +import qualified GHC.CmmToAsm.Reg.Linear.X86_64 as X86_64 +import GHC.CmmToAsm.Reg.Target +import GHC.CmmToAsm.Reg.Liveness +import GHC.CmmToAsm.Instr +import GHC.Platform.Reg import GHC.Cmm.BlockId import GHC.Cmm.Dataflow.Collections diff --git a/compiler/nativeGen/RegAlloc/Linear/Base.hs b/compiler/GHC/CmmToAsm/Reg/Linear/Base.hs index 552f14929d..43dbab843b 100644 --- a/compiler/nativeGen/RegAlloc/Linear/Base.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/Base.hs @@ -1,7 +1,7 @@ -- | Put common type definitions here to break recursive module dependencies. -module RegAlloc.Linear.Base ( +module GHC.CmmToAsm.Reg.Linear.Base ( BlockAssignment, Loc(..), @@ -19,9 +19,9 @@ where import GhcPrelude -import RegAlloc.Linear.StackMap -import RegAlloc.Liveness -import Reg +import GHC.CmmToAsm.Reg.Linear.StackMap +import GHC.CmmToAsm.Reg.Liveness +import GHC.Platform.Reg import GHC.Driver.Session import Outputable diff --git a/compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs b/compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs index b2b9cff5bb..0d72d8b6e9 100644 --- a/compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs @@ -1,6 +1,6 @@ {-# LANGUAGE CPP #-} -module RegAlloc.Linear.FreeRegs ( +module GHC.CmmToAsm.Reg.Linear.FreeRegs ( FR(..), maxSpillSlots ) @@ -11,8 +11,8 @@ where import GhcPrelude -import Reg -import RegClass +import GHC.Platform.Reg +import GHC.Platform.Reg.Class import GHC.Driver.Session import Panic @@ -30,14 +30,14 @@ import GHC.Platform -- getFreeRegs cls f = filter ( (==cls) . regClass . RealReg ) f -- allocateReg f r = filter (/= r) f -import qualified RegAlloc.Linear.PPC.FreeRegs as PPC -import qualified RegAlloc.Linear.SPARC.FreeRegs as SPARC -import qualified RegAlloc.Linear.X86.FreeRegs as X86 -import qualified RegAlloc.Linear.X86_64.FreeRegs as X86_64 +import qualified GHC.CmmToAsm.Reg.Linear.PPC as PPC +import qualified GHC.CmmToAsm.Reg.Linear.SPARC as SPARC +import qualified GHC.CmmToAsm.Reg.Linear.X86 as X86 +import qualified GHC.CmmToAsm.Reg.Linear.X86_64 as X86_64 -import qualified PPC.Instr -import qualified SPARC.Instr -import qualified X86.Instr +import qualified GHC.CmmToAsm.PPC.Instr as PPC.Instr +import qualified GHC.CmmToAsm.SPARC.Instr as SPARC.Instr +import qualified GHC.CmmToAsm.X86.Instr as X86.Instr class Show freeRegs => FR freeRegs where frAllocateReg :: Platform -> RealReg -> freeRegs -> freeRegs diff --git a/compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs b/compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs index 4362ca8a17..b4ad1b948c 100644 --- a/compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs @@ -8,16 +8,16 @@ -- 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. -- -module RegAlloc.Linear.JoinToTargets (joinToTargets) where +module GHC.CmmToAsm.Reg.Linear.JoinToTargets (joinToTargets) where import GhcPrelude -import RegAlloc.Linear.State -import RegAlloc.Linear.Base -import RegAlloc.Linear.FreeRegs -import RegAlloc.Liveness -import Instruction -import Reg +import GHC.CmmToAsm.Reg.Linear.State +import GHC.CmmToAsm.Reg.Linear.Base +import GHC.CmmToAsm.Reg.Linear.FreeRegs +import GHC.CmmToAsm.Reg.Liveness +import GHC.CmmToAsm.Instr +import GHC.Platform.Reg import GHC.Cmm.BlockId import GHC.Cmm.Dataflow.Collections diff --git a/compiler/nativeGen/RegAlloc/Linear/PPC/FreeRegs.hs b/compiler/GHC/CmmToAsm/Reg/Linear/PPC.hs index 1239380ba2..ce0a187647 100644 --- a/compiler/nativeGen/RegAlloc/Linear/PPC/FreeRegs.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/PPC.hs @@ -1,12 +1,11 @@ -- | Free regs map for PowerPC -module RegAlloc.Linear.PPC.FreeRegs -where +module GHC.CmmToAsm.Reg.Linear.PPC where import GhcPrelude -import PPC.Regs -import RegClass -import Reg +import GHC.CmmToAsm.PPC.Regs +import GHC.Platform.Reg.Class +import GHC.Platform.Reg import Outputable import GHC.Platform diff --git a/compiler/nativeGen/RegAlloc/Linear/SPARC/FreeRegs.hs b/compiler/GHC/CmmToAsm/Reg/Linear/SPARC.hs index fc67159f0f..7fa85f0913 100644 --- a/compiler/nativeGen/RegAlloc/Linear/SPARC/FreeRegs.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/SPARC.hs @@ -1,14 +1,13 @@ {-# LANGUAGE CPP #-} -- | Free regs map for SPARC -module RegAlloc.Linear.SPARC.FreeRegs -where +module GHC.CmmToAsm.Reg.Linear.SPARC where import GhcPrelude -import SPARC.Regs -import RegClass -import Reg +import GHC.CmmToAsm.SPARC.Regs +import GHC.Platform.Reg.Class +import GHC.Platform.Reg import GHC.Platform.Regs import Outputable diff --git a/compiler/nativeGen/RegAlloc/Linear/StackMap.hs b/compiler/GHC/CmmToAsm/Reg/Linear/StackMap.hs index 79496c6e43..630b101fc7 100644 --- a/compiler/nativeGen/RegAlloc/Linear/StackMap.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/StackMap.hs @@ -10,7 +10,7 @@ -- associated, a stack slot is never "freed" or removed from the StackMap again, -- it remains associated until we are done with the current CmmProc. -- -module RegAlloc.Linear.StackMap ( +module GHC.CmmToAsm.Reg.Linear.StackMap ( StackSlot, StackMap(..), emptyStackMap, diff --git a/compiler/nativeGen/RegAlloc/Linear/State.hs b/compiler/GHC/CmmToAsm/Reg/Linear/State.hs index 9e5efa5f7f..a167cc7e00 100644 --- a/compiler/nativeGen/RegAlloc/Linear/State.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/State.hs @@ -9,7 +9,7 @@ -- Here we keep all the state that the register allocator keeps track -- of as it walks the instructions in a basic block. -module RegAlloc.Linear.State ( +module GHC.CmmToAsm.Reg.Linear.State ( RA_State(..), RegM, runR, @@ -38,12 +38,12 @@ where import GhcPrelude -import RegAlloc.Linear.Stats -import RegAlloc.Linear.StackMap -import RegAlloc.Linear.Base -import RegAlloc.Liveness -import Instruction -import Reg +import GHC.CmmToAsm.Reg.Linear.Stats +import GHC.CmmToAsm.Reg.Linear.StackMap +import GHC.CmmToAsm.Reg.Linear.Base +import GHC.CmmToAsm.Reg.Liveness +import GHC.CmmToAsm.Instr +import GHC.Platform.Reg import GHC.Cmm.BlockId import GHC.Driver.Session diff --git a/compiler/nativeGen/RegAlloc/Linear/Stats.hs b/compiler/GHC/CmmToAsm/Reg/Linear/Stats.hs index 74f3c834d0..1176b220a3 100644 --- a/compiler/nativeGen/RegAlloc/Linear/Stats.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/Stats.hs @@ -1,4 +1,4 @@ -module RegAlloc.Linear.Stats ( +module GHC.CmmToAsm.Reg.Linear.Stats ( binSpillReasons, countRegRegMovesNat, pprStats @@ -8,9 +8,9 @@ where import GhcPrelude -import RegAlloc.Linear.Base -import RegAlloc.Liveness -import Instruction +import GHC.CmmToAsm.Reg.Linear.Base +import GHC.CmmToAsm.Reg.Liveness +import GHC.CmmToAsm.Instr import UniqFM import Outputable diff --git a/compiler/nativeGen/RegAlloc/Linear/X86/FreeRegs.hs b/compiler/GHC/CmmToAsm/Reg/Linear/X86.hs index e7f8cb4a63..ce103bd6b2 100644 --- a/compiler/nativeGen/RegAlloc/Linear/X86/FreeRegs.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/X86.hs @@ -1,13 +1,12 @@ -- | Free regs map for i386 -module RegAlloc.Linear.X86.FreeRegs -where +module GHC.CmmToAsm.Reg.Linear.X86 where import GhcPrelude -import X86.Regs -import RegClass -import Reg +import GHC.CmmToAsm.X86.Regs +import GHC.Platform.Reg.Class +import GHC.Platform.Reg import Panic import GHC.Platform diff --git a/compiler/nativeGen/RegAlloc/Linear/X86_64/FreeRegs.hs b/compiler/GHC/CmmToAsm/Reg/Linear/X86_64.hs index 44a3bbb306..322ddd6bdd 100644 --- a/compiler/nativeGen/RegAlloc/Linear/X86_64/FreeRegs.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/X86_64.hs @@ -1,13 +1,12 @@ -- | Free regs map for x86_64 -module RegAlloc.Linear.X86_64.FreeRegs -where +module GHC.CmmToAsm.Reg.Linear.X86_64 where import GhcPrelude -import X86.Regs -import RegClass -import Reg +import GHC.CmmToAsm.X86.Regs +import GHC.Platform.Reg.Class +import GHC.Platform.Reg import Panic import GHC.Platform diff --git a/compiler/nativeGen/RegAlloc/Liveness.hs b/compiler/GHC/CmmToAsm/Reg/Liveness.hs index b6fd3b3937..03b8123f93 100644 --- a/compiler/nativeGen/RegAlloc/Liveness.hs +++ b/compiler/GHC/CmmToAsm/Reg/Liveness.hs @@ -13,7 +13,7 @@ -- ----------------------------------------------------------------------------- -module RegAlloc.Liveness ( +module GHC.CmmToAsm.Reg.Liveness ( RegSet, RegMap, emptyRegMap, BlockMap, mapEmpty, @@ -39,11 +39,11 @@ module RegAlloc.Liveness ( ) where import GhcPrelude -import Reg -import Instruction +import GHC.Platform.Reg +import GHC.CmmToAsm.Instr import GHC.Cmm.BlockId -import CFG +import GHC.CmmToAsm.CFG import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow.Label import GHC.Cmm hiding (RegSet, emptyRegSet) diff --git a/compiler/nativeGen/TargetReg.hs b/compiler/GHC/CmmToAsm/Reg/Target.hs index e0eca9235d..a45d70c826 100644 --- a/compiler/nativeGen/TargetReg.hs +++ b/compiler/GHC/CmmToAsm/Reg/Target.hs @@ -8,7 +8,7 @@ -- Instruction somehow. -- -- TODO: We should also make arch specific versions of RegAlloc.Graph.TrivColorable -module TargetReg ( +module GHC.CmmToAsm.Reg.Target ( targetVirtualRegSqueeze, targetRealRegSqueeze, targetClassOfRealReg, @@ -23,20 +23,18 @@ where import GhcPrelude -import Reg -import RegClass -import Format +import GHC.Platform.Reg +import GHC.Platform.Reg.Class +import GHC.CmmToAsm.Format import Outputable import Unique import GHC.Platform -import qualified X86.Regs as X86 -import qualified X86.RegInfo as X86 - -import qualified PPC.Regs as PPC - -import qualified SPARC.Regs as SPARC +import qualified GHC.CmmToAsm.X86.Regs as X86 +import qualified GHC.CmmToAsm.X86.RegInfo as X86 +import qualified GHC.CmmToAsm.PPC.Regs as PPC +import qualified GHC.CmmToAsm.SPARC.Regs as SPARC targetVirtualRegSqueeze :: Platform -> RegClass -> VirtualReg -> Int targetVirtualRegSqueeze platform diff --git a/compiler/nativeGen/SPARC/AddrMode.hs b/compiler/GHC/CmmToAsm/SPARC/AddrMode.hs index ee40843351..6cc660bba9 100644 --- a/compiler/nativeGen/SPARC/AddrMode.hs +++ b/compiler/GHC/CmmToAsm/SPARC/AddrMode.hs @@ -1,5 +1,5 @@ -module SPARC.AddrMode ( +module GHC.CmmToAsm.SPARC.AddrMode ( AddrMode(..), addrOffset ) @@ -8,9 +8,9 @@ where import GhcPrelude -import SPARC.Imm -import SPARC.Base -import Reg +import GHC.CmmToAsm.SPARC.Imm +import GHC.CmmToAsm.SPARC.Base +import GHC.Platform.Reg -- addressing modes ------------------------------------------------------------ diff --git a/compiler/nativeGen/SPARC/Base.hs b/compiler/GHC/CmmToAsm/SPARC/Base.hs index 4b3b7c984c..86a897dacb 100644 --- a/compiler/nativeGen/SPARC/Base.hs +++ b/compiler/GHC/CmmToAsm/SPARC/Base.hs @@ -5,7 +5,7 @@ -- In the interests of cross-compilation, we want to free ourselves -- from the autoconf generated modules like main/Constants -module SPARC.Base ( +module GHC.CmmToAsm.SPARC.Base ( wordLength, wordLengthInBits, spillAreaLength, diff --git a/compiler/nativeGen/SPARC/CodeGen.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen.hs index b9f79a6b9f..2580ea4014 100644 --- a/compiler/nativeGen/SPARC/CodeGen.hs +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen.hs @@ -9,7 +9,7 @@ ----------------------------------------------------------------------------- {-# LANGUAGE GADTs #-} -module SPARC.CodeGen ( +module GHC.CmmToAsm.SPARC.CodeGen ( cmmTopCodeGen, generateJumpTableForInstr, InstrBlock @@ -22,21 +22,21 @@ where -- NCG stuff: import GhcPrelude -import SPARC.Base -import SPARC.CodeGen.Sanity -import SPARC.CodeGen.Amode -import SPARC.CodeGen.CondCode -import SPARC.CodeGen.Gen64 -import SPARC.CodeGen.Gen32 -import SPARC.CodeGen.Base -import SPARC.Instr -import SPARC.Imm -import SPARC.AddrMode -import SPARC.Regs -import SPARC.Stack -import Instruction -import Format -import NCGMonad ( NatM, getNewRegNat, getNewLabelNat ) +import GHC.CmmToAsm.SPARC.Base +import GHC.CmmToAsm.SPARC.CodeGen.Sanity +import GHC.CmmToAsm.SPARC.CodeGen.Amode +import GHC.CmmToAsm.SPARC.CodeGen.CondCode +import GHC.CmmToAsm.SPARC.CodeGen.Gen64 +import GHC.CmmToAsm.SPARC.CodeGen.Gen32 +import GHC.CmmToAsm.SPARC.CodeGen.Base +import GHC.CmmToAsm.SPARC.Instr +import GHC.CmmToAsm.SPARC.Imm +import GHC.CmmToAsm.SPARC.AddrMode +import GHC.CmmToAsm.SPARC.Regs +import GHC.CmmToAsm.SPARC.Stack +import GHC.CmmToAsm.Instr +import GHC.CmmToAsm.Format +import GHC.CmmToAsm.Monad ( NatM, getNewRegNat, getNewLabelNat ) -- Our intermediate code: import GHC.Cmm.BlockId @@ -45,10 +45,10 @@ import GHC.Cmm.Utils import GHC.Cmm.Switch import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import PIC -import Reg +import GHC.CmmToAsm.PIC +import GHC.Platform.Reg import GHC.Cmm.CLabel -import CPrim +import GHC.CmmToAsm.CPrim -- The rest: import BasicTypes diff --git a/compiler/nativeGen/SPARC/CodeGen/Amode.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Amode.hs index 5351fc054b..d6c9d7b360 100644 --- a/compiler/nativeGen/SPARC/CodeGen/Amode.hs +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Amode.hs @@ -1,4 +1,4 @@ -module SPARC.CodeGen.Amode ( +module GHC.CmmToAsm.SPARC.CodeGen.Amode ( getAmode ) @@ -6,15 +6,15 @@ where import GhcPrelude -import {-# SOURCE #-} SPARC.CodeGen.Gen32 -import SPARC.CodeGen.Base -import SPARC.AddrMode -import SPARC.Imm -import SPARC.Instr -import SPARC.Regs -import SPARC.Base -import NCGMonad -import Format +import {-# SOURCE #-} GHC.CmmToAsm.SPARC.CodeGen.Gen32 +import GHC.CmmToAsm.SPARC.CodeGen.Base +import GHC.CmmToAsm.SPARC.AddrMode +import GHC.CmmToAsm.SPARC.Imm +import GHC.CmmToAsm.SPARC.Instr +import GHC.CmmToAsm.SPARC.Regs +import GHC.CmmToAsm.SPARC.Base +import GHC.CmmToAsm.Monad +import GHC.CmmToAsm.Format import GHC.Cmm diff --git a/compiler/nativeGen/SPARC/CodeGen/Base.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Base.hs index ba07f2311d..cf249303e4 100644 --- a/compiler/nativeGen/SPARC/CodeGen/Base.hs +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Base.hs @@ -1,4 +1,4 @@ -module SPARC.CodeGen.Base ( +module GHC.CmmToAsm.SPARC.CodeGen.Base ( InstrBlock, CondCode(..), ChildCode64(..), @@ -15,12 +15,12 @@ where import GhcPrelude -import SPARC.Instr -import SPARC.Cond -import SPARC.AddrMode -import SPARC.Regs -import Format -import Reg +import GHC.CmmToAsm.SPARC.Instr +import GHC.CmmToAsm.SPARC.Cond +import GHC.CmmToAsm.SPARC.AddrMode +import GHC.CmmToAsm.SPARC.Regs +import GHC.CmmToAsm.Format +import GHC.Platform.Reg import GHC.Platform.Regs import GHC.Driver.Session diff --git a/compiler/nativeGen/SPARC/CodeGen/CondCode.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/CondCode.hs index 892cbb1a8f..e501d799f2 100644 --- a/compiler/nativeGen/SPARC/CodeGen/CondCode.hs +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/CondCode.hs @@ -1,4 +1,4 @@ -module SPARC.CodeGen.CondCode ( +module GHC.CmmToAsm.SPARC.CodeGen.CondCode ( getCondCode, condIntCode, condFltCode @@ -8,15 +8,15 @@ where import GhcPrelude -import {-# SOURCE #-} SPARC.CodeGen.Gen32 -import SPARC.CodeGen.Base -import SPARC.Instr -import SPARC.Regs -import SPARC.Cond -import SPARC.Imm -import SPARC.Base -import NCGMonad -import Format +import {-# SOURCE #-} GHC.CmmToAsm.SPARC.CodeGen.Gen32 +import GHC.CmmToAsm.SPARC.CodeGen.Base +import GHC.CmmToAsm.SPARC.Instr +import GHC.CmmToAsm.SPARC.Regs +import GHC.CmmToAsm.SPARC.Cond +import GHC.CmmToAsm.SPARC.Imm +import GHC.CmmToAsm.SPARC.Base +import GHC.CmmToAsm.Monad +import GHC.CmmToAsm.Format import GHC.Cmm diff --git a/compiler/nativeGen/SPARC/CodeGen/Expand.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Expand.hs index b6d78a9f79..77732cf70c 100644 --- a/compiler/nativeGen/SPARC/CodeGen/Expand.hs +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Expand.hs @@ -1,7 +1,7 @@ {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} -- | Expand out synthetic instructions into single machine instrs. -module SPARC.CodeGen.Expand ( +module GHC.CmmToAsm.SPARC.CodeGen.Expand ( expandTop ) @@ -9,13 +9,13 @@ where import GhcPrelude -import SPARC.Instr -import SPARC.Imm -import SPARC.AddrMode -import SPARC.Regs -import Instruction -import Reg -import Format +import GHC.CmmToAsm.SPARC.Instr +import GHC.CmmToAsm.SPARC.Imm +import GHC.CmmToAsm.SPARC.AddrMode +import GHC.CmmToAsm.SPARC.Regs +import GHC.CmmToAsm.Instr +import GHC.Platform.Reg +import GHC.CmmToAsm.Format import GHC.Cmm diff --git a/compiler/nativeGen/SPARC/CodeGen/Gen32.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen32.hs index 4f3409ebc5..ee67bd4a9d 100644 --- a/compiler/nativeGen/SPARC/CodeGen/Gen32.hs +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen32.hs @@ -1,5 +1,5 @@ -- | Evaluation of 32 bit values. -module SPARC.CodeGen.Gen32 ( +module GHC.CmmToAsm.SPARC.CodeGen.Gen32 ( getSomeReg, getRegister ) @@ -8,20 +8,20 @@ where import GhcPrelude -import SPARC.CodeGen.CondCode -import SPARC.CodeGen.Amode -import SPARC.CodeGen.Gen64 -import SPARC.CodeGen.Base -import SPARC.Stack -import SPARC.Instr -import SPARC.Cond -import SPARC.AddrMode -import SPARC.Imm -import SPARC.Regs -import SPARC.Base -import NCGMonad -import Format -import Reg +import GHC.CmmToAsm.SPARC.CodeGen.CondCode +import GHC.CmmToAsm.SPARC.CodeGen.Amode +import GHC.CmmToAsm.SPARC.CodeGen.Gen64 +import GHC.CmmToAsm.SPARC.CodeGen.Base +import GHC.CmmToAsm.SPARC.Stack +import GHC.CmmToAsm.SPARC.Instr +import GHC.CmmToAsm.SPARC.Cond +import GHC.CmmToAsm.SPARC.AddrMode +import GHC.CmmToAsm.SPARC.Imm +import GHC.CmmToAsm.SPARC.Regs +import GHC.CmmToAsm.SPARC.Base +import GHC.CmmToAsm.Monad +import GHC.CmmToAsm.Format +import GHC.Platform.Reg import GHC.Cmm diff --git a/compiler/nativeGen/SPARC/CodeGen/Gen32.hs-boot b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen32.hs-boot index 1dbd2d3612..cf9553a63c 100644 --- a/compiler/nativeGen/SPARC/CodeGen/Gen32.hs-boot +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen32.hs-boot @@ -1,14 +1,14 @@ -module SPARC.CodeGen.Gen32 ( +module GHC.CmmToAsm.SPARC.CodeGen.Gen32 ( getSomeReg, getRegister ) where -import SPARC.CodeGen.Base -import NCGMonad -import Reg +import GHC.CmmToAsm.SPARC.CodeGen.Base +import GHC.CmmToAsm.Monad +import GHC.Platform.Reg import GHC.Cmm diff --git a/compiler/nativeGen/SPARC/CodeGen/Gen64.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen64.hs index 7c04101ec4..43807ec027 100644 --- a/compiler/nativeGen/SPARC/CodeGen/Gen64.hs +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen64.hs @@ -1,5 +1,5 @@ -- | Evaluation of 64 bit values on 32 bit platforms. -module SPARC.CodeGen.Gen64 ( +module GHC.CmmToAsm.SPARC.CodeGen.Gen64 ( assignMem_I64Code, assignReg_I64Code, iselExpr64 @@ -9,18 +9,18 @@ where import GhcPrelude -import {-# SOURCE #-} SPARC.CodeGen.Gen32 -import SPARC.CodeGen.Base -import SPARC.CodeGen.Amode -import SPARC.Regs -import SPARC.AddrMode -import SPARC.Imm -import SPARC.Instr --- import SPARC.Ppr() -import NCGMonad -import Instruction -import Format -import Reg +import {-# SOURCE #-} GHC.CmmToAsm.SPARC.CodeGen.Gen32 +import GHC.CmmToAsm.SPARC.CodeGen.Base +import GHC.CmmToAsm.SPARC.CodeGen.Amode +import GHC.CmmToAsm.SPARC.Regs +import GHC.CmmToAsm.SPARC.AddrMode +import GHC.CmmToAsm.SPARC.Imm +import GHC.CmmToAsm.SPARC.Instr +-- GHC.CmmToAsm.SPARC.Ppr() +import GHC.CmmToAsm.Monad +import GHC.CmmToAsm.Instr +import GHC.CmmToAsm.Format +import GHC.Platform.Reg import GHC.Cmm diff --git a/compiler/nativeGen/SPARC/CodeGen/Sanity.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Sanity.hs index b60c958a73..f8648c4549 100644 --- a/compiler/nativeGen/SPARC/CodeGen/Sanity.hs +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Sanity.hs @@ -1,6 +1,6 @@ -- | One ounce of sanity checking is worth 10000000000000000 ounces -- of staring blindly at assembly code trying to find the problem.. -module SPARC.CodeGen.Sanity ( +module GHC.CmmToAsm.SPARC.CodeGen.Sanity ( checkBlock ) @@ -8,9 +8,9 @@ where import GhcPrelude -import SPARC.Instr -import SPARC.Ppr () -- For Outputable instances -import Instruction +import GHC.CmmToAsm.SPARC.Instr +import GHC.CmmToAsm.SPARC.Ppr () -- For Outputable instances +import GHC.CmmToAsm.Instr import GHC.Cmm diff --git a/compiler/nativeGen/SPARC/Cond.hs b/compiler/GHC/CmmToAsm/SPARC/Cond.hs index 3fbfb8603f..89b64b7c3a 100644 --- a/compiler/nativeGen/SPARC/Cond.hs +++ b/compiler/GHC/CmmToAsm/SPARC/Cond.hs @@ -1,4 +1,4 @@ -module SPARC.Cond ( +module GHC.CmmToAsm.SPARC.Cond ( Cond(..), condUnsigned, condToSigned, diff --git a/compiler/nativeGen/SPARC/Imm.hs b/compiler/GHC/CmmToAsm/SPARC/Imm.hs index 78b6612bbf..71b0257ac5 100644 --- a/compiler/nativeGen/SPARC/Imm.hs +++ b/compiler/GHC/CmmToAsm/SPARC/Imm.hs @@ -1,4 +1,4 @@ -module SPARC.Imm ( +module GHC.CmmToAsm.SPARC.Imm ( -- immediate values Imm(..), strImmLit, diff --git a/compiler/nativeGen/SPARC/Instr.hs b/compiler/GHC/CmmToAsm/SPARC/Instr.hs index d49d82fa7e..ec74d3723b 100644 --- a/compiler/nativeGen/SPARC/Instr.hs +++ b/compiler/GHC/CmmToAsm/SPARC/Instr.hs @@ -9,7 +9,7 @@ ----------------------------------------------------------------------------- #include "HsVersions.h" -module SPARC.Instr ( +module GHC.CmmToAsm.SPARC.Instr ( RI(..), riZero, @@ -26,17 +26,17 @@ where import GhcPrelude -import SPARC.Stack -import SPARC.Imm -import SPARC.AddrMode -import SPARC.Cond -import SPARC.Regs -import SPARC.Base -import TargetReg -import Instruction -import RegClass -import Reg -import Format +import GHC.CmmToAsm.SPARC.Stack +import GHC.CmmToAsm.SPARC.Imm +import GHC.CmmToAsm.SPARC.AddrMode +import GHC.CmmToAsm.SPARC.Cond +import GHC.CmmToAsm.SPARC.Regs +import GHC.CmmToAsm.SPARC.Base +import GHC.CmmToAsm.Reg.Target +import GHC.CmmToAsm.Instr +import GHC.Platform.Reg.Class +import GHC.Platform.Reg +import GHC.CmmToAsm.Format import GHC.Cmm.CLabel import GHC.Platform.Regs diff --git a/compiler/nativeGen/SPARC/Ppr.hs b/compiler/GHC/CmmToAsm/SPARC/Ppr.hs index 566f438403..2f3ea778f7 100644 --- a/compiler/nativeGen/SPARC/Ppr.hs +++ b/compiler/GHC/CmmToAsm/SPARC/Ppr.hs @@ -10,7 +10,7 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} -module SPARC.Ppr ( +module GHC.CmmToAsm.SPARC.Ppr ( pprNatCmmDecl, pprBasicBlock, pprData, @@ -26,16 +26,16 @@ where import GhcPrelude -import SPARC.Regs -import SPARC.Instr -import SPARC.Cond -import SPARC.Imm -import SPARC.AddrMode -import SPARC.Base -import Instruction -import Reg -import Format -import PprBase +import GHC.CmmToAsm.SPARC.Regs +import GHC.CmmToAsm.SPARC.Instr +import GHC.CmmToAsm.SPARC.Cond +import GHC.CmmToAsm.SPARC.Imm +import GHC.CmmToAsm.SPARC.AddrMode +import GHC.CmmToAsm.SPARC.Base +import GHC.CmmToAsm.Instr +import GHC.Platform.Reg +import GHC.CmmToAsm.Format +import GHC.CmmToAsm.Ppr import GHC.Cmm hiding (topInfoTable) import GHC.Cmm.Ppr() -- For Outputable instances diff --git a/compiler/nativeGen/SPARC/Regs.hs b/compiler/GHC/CmmToAsm/SPARC/Regs.hs index 8f470ad79d..ba22470912 100644 --- a/compiler/nativeGen/SPARC/Regs.hs +++ b/compiler/GHC/CmmToAsm/SPARC/Regs.hs @@ -4,7 +4,7 @@ -- -- ----------------------------------------------------------------------------- -module SPARC.Regs ( +module GHC.CmmToAsm.SPARC.Regs ( -- registers showReg, virtualRegSqueeze, @@ -35,9 +35,9 @@ where import GhcPrelude import GHC.Platform.SPARC -import Reg -import RegClass -import Format +import GHC.Platform.Reg +import GHC.Platform.Reg.Class +import GHC.CmmToAsm.Format import Unique import Outputable diff --git a/compiler/nativeGen/SPARC/ShortcutJump.hs b/compiler/GHC/CmmToAsm/SPARC/ShortcutJump.hs index 35604b0b7e..2d1f77d737 100644 --- a/compiler/nativeGen/SPARC/ShortcutJump.hs +++ b/compiler/GHC/CmmToAsm/SPARC/ShortcutJump.hs @@ -1,4 +1,4 @@ -module SPARC.ShortcutJump ( +module GHC.CmmToAsm.SPARC.ShortcutJump ( JumpDest(..), getJumpDestBlockId, canShortcut, shortcutJump, @@ -10,8 +10,8 @@ where import GhcPrelude -import SPARC.Instr -import SPARC.Imm +import GHC.CmmToAsm.SPARC.Instr +import GHC.CmmToAsm.SPARC.Imm import GHC.Cmm.CLabel import GHC.Cmm.BlockId diff --git a/compiler/nativeGen/SPARC/Stack.hs b/compiler/GHC/CmmToAsm/SPARC/Stack.hs index 2553c6135d..d9a0ffd7cf 100644 --- a/compiler/nativeGen/SPARC/Stack.hs +++ b/compiler/GHC/CmmToAsm/SPARC/Stack.hs @@ -1,4 +1,4 @@ -module SPARC.Stack ( +module GHC.CmmToAsm.SPARC.Stack ( spRel, fpRel, spillSlotToOffset, @@ -9,10 +9,10 @@ where import GhcPrelude -import SPARC.AddrMode -import SPARC.Regs -import SPARC.Base -import SPARC.Imm +import GHC.CmmToAsm.SPARC.AddrMode +import GHC.CmmToAsm.SPARC.Regs +import GHC.CmmToAsm.SPARC.Base +import GHC.CmmToAsm.SPARC.Imm import GHC.Driver.Session import Outputable diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/GHC/CmmToAsm/X86/CodeGen.hs index 26797949f4..f3b20c19e1 100644 --- a/compiler/nativeGen/X86/CodeGen.hs +++ b/compiler/GHC/CmmToAsm/X86/CodeGen.hs @@ -23,7 +23,7 @@ -- (a) the sectioning, and (b) the type signatures, the -- structure should not be too overwhelming. -module X86.CodeGen ( +module GHC.CmmToAsm.X86.CodeGen ( cmmTopCodeGen, generateJumpTableForInstr, extractUnwindPoints, @@ -38,25 +38,29 @@ where -- NCG stuff: import GhcPrelude -import X86.Instr -import X86.Cond -import X86.Regs -import X86.Ppr ( ) -import X86.RegInfo +import GHC.CmmToAsm.X86.Instr +import GHC.CmmToAsm.X86.Cond +import GHC.CmmToAsm.X86.Regs +import GHC.CmmToAsm.X86.Ppr ( ) +import GHC.CmmToAsm.X86.RegInfo import GHC.Platform.Regs -import CPrim -import GHC.Cmm.DebugBlock ( DebugBlock(..), UnwindPoint(..), UnwindTable - , UnwindExpr(UwReg), toUnwindExpr ) -import Instruction -import PIC -import NCGMonad ( NatM, getNewRegNat, getNewLabelNat, setDeltaNat - , getDeltaNat, getBlockIdNat, getPicBaseNat, getNewRegPairNat - , getPicBaseMaybeNat, getDebugBlock, getFileId - , addImmediateSuccessorNat, updateCfgNat) -import CFG -import Format -import Reg +import GHC.CmmToAsm.CPrim +import GHC.Cmm.DebugBlock + ( DebugBlock(..), UnwindPoint(..), UnwindTable + , UnwindExpr(UwReg), toUnwindExpr + ) +import GHC.CmmToAsm.Instr +import GHC.CmmToAsm.PIC +import GHC.CmmToAsm.Monad + ( NatM, getNewRegNat, getNewLabelNat, setDeltaNat + , getDeltaNat, getBlockIdNat, getPicBaseNat, getNewRegPairNat + , getPicBaseMaybeNat, getDebugBlock, getFileId + , addImmediateSuccessorNat, updateCfgNat + ) +import GHC.CmmToAsm.CFG +import GHC.CmmToAsm.Format +import GHC.Platform.Reg import GHC.Platform -- Our intermediate code: diff --git a/compiler/nativeGen/X86/Cond.hs b/compiler/GHC/CmmToAsm/X86/Cond.hs index 49e3ce9254..bb8f61438b 100644 --- a/compiler/nativeGen/X86/Cond.hs +++ b/compiler/GHC/CmmToAsm/X86/Cond.hs @@ -1,4 +1,4 @@ -module X86.Cond ( +module GHC.CmmToAsm.X86.Cond ( Cond(..), condUnsigned, condToSigned, diff --git a/compiler/nativeGen/X86/Instr.hs b/compiler/GHC/CmmToAsm/X86/Instr.hs index 099437265c..4171806695 100644 --- a/compiler/nativeGen/X86/Instr.hs +++ b/compiler/GHC/CmmToAsm/X86/Instr.hs @@ -8,23 +8,25 @@ -- ----------------------------------------------------------------------------- -module X86.Instr (Instr(..), Operand(..), PrefetchVariant(..), JumpDest(..), - getJumpDestBlockId, canShortcut, shortcutStatics, - shortcutJump, allocMoreStack, - maxSpillSlots, archWordFormat ) +module GHC.CmmToAsm.X86.Instr + ( Instr(..), Operand(..), PrefetchVariant(..), JumpDest(..) + , getJumpDestBlockId, canShortcut, shortcutStatics + , shortcutJump, allocMoreStack + , maxSpillSlots, archWordFormat + ) where #include "HsVersions.h" import GhcPrelude -import X86.Cond -import X86.Regs -import Instruction -import Format -import RegClass -import Reg -import TargetReg +import GHC.CmmToAsm.X86.Cond +import GHC.CmmToAsm.X86.Regs +import GHC.CmmToAsm.Instr +import GHC.CmmToAsm.Format +import GHC.Platform.Reg.Class +import GHC.Platform.Reg +import GHC.CmmToAsm.Reg.Target import GHC.Cmm.BlockId import GHC.Cmm.Dataflow.Collections @@ -935,8 +937,8 @@ x86_mkStackDeallocInstr platform amount allocMoreStack :: Platform -> Int - -> NatCmmDecl statics X86.Instr.Instr - -> UniqSM (NatCmmDecl statics X86.Instr.Instr, [(BlockId,BlockId)]) + -> NatCmmDecl statics GHC.CmmToAsm.X86.Instr.Instr + -> UniqSM (NatCmmDecl statics GHC.CmmToAsm.X86.Instr.Instr, [(BlockId,BlockId)]) allocMoreStack _ _ top@(CmmData _ _) = return (top,[]) allocMoreStack platform slots proc@(CmmProc info lbl live (ListGraph code)) = do diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/GHC/CmmToAsm/X86/Ppr.hs index 4abc15cedd..a5b9041974 100644 --- a/compiler/nativeGen/X86/Ppr.hs +++ b/compiler/GHC/CmmToAsm/X86/Ppr.hs @@ -9,7 +9,7 @@ ----------------------------------------------------------------------------- {-# OPTIONS_GHC -fno-warn-orphans #-} -module X86.Ppr ( +module GHC.CmmToAsm.X86.Ppr ( pprNatCmmDecl, pprData, pprInstr, @@ -24,13 +24,13 @@ where import GhcPrelude -import X86.Regs -import X86.Instr -import X86.Cond -import Instruction -import Format -import Reg -import PprBase +import GHC.CmmToAsm.X86.Regs +import GHC.CmmToAsm.X86.Instr +import GHC.CmmToAsm.X86.Cond +import GHC.CmmToAsm.Instr +import GHC.CmmToAsm.Format +import GHC.Platform.Reg +import GHC.CmmToAsm.Ppr import GHC.Cmm.Dataflow.Collections diff --git a/compiler/nativeGen/X86/RegInfo.hs b/compiler/GHC/CmmToAsm/X86/RegInfo.hs index eb5e9bc7fc..597efe1c3e 100644 --- a/compiler/nativeGen/X86/RegInfo.hs +++ b/compiler/GHC/CmmToAsm/X86/RegInfo.hs @@ -1,5 +1,5 @@ {-# LANGUAGE CPP #-} -module X86.RegInfo ( +module GHC.CmmToAsm.X86.RegInfo ( mkVirtualReg, regDotColor ) @@ -10,15 +10,15 @@ where import GhcPrelude -import Format -import Reg +import GHC.CmmToAsm.Format +import GHC.Platform.Reg import Outputable import GHC.Platform import Unique import UniqFM -import X86.Regs +import GHC.CmmToAsm.X86.Regs mkVirtualReg :: Unique -> Format -> VirtualReg diff --git a/compiler/nativeGen/X86/Regs.hs b/compiler/GHC/CmmToAsm/X86/Regs.hs index 4c8943a284..87e31a1428 100644 --- a/compiler/nativeGen/X86/Regs.hs +++ b/compiler/GHC/CmmToAsm/X86/Regs.hs @@ -1,6 +1,6 @@ {-# LANGUAGE CPP #-} -module X86.Regs ( +module GHC.CmmToAsm.X86.Regs ( -- squeese functions for the graph allocator virtualRegSqueeze, realRegSqueeze, @@ -52,8 +52,8 @@ where import GhcPrelude import GHC.Platform.Regs -import Reg -import RegClass +import GHC.Platform.Reg +import GHC.Platform.Reg.Class import GHC.Cmm import GHC.Cmm.CLabel ( CLabel ) diff --git a/compiler/GHC/CmmToC.hs b/compiler/GHC/CmmToC.hs index f7245f5c30..6e6f58ba7d 100644 --- a/compiler/GHC/CmmToC.hs +++ b/compiler/GHC/CmmToC.hs @@ -39,7 +39,7 @@ import GHC.Cmm.Utils import GHC.Cmm.Switch -- Utils -import CPrim +import GHC.CmmToAsm.CPrim import GHC.Driver.Session import FastString import Outputable diff --git a/compiler/GHC/Driver/CodeOutput.hs b/compiler/GHC/Driver/CodeOutput.hs index e52d3216d5..507311c039 100644 --- a/compiler/GHC/Driver/CodeOutput.hs +++ b/compiler/GHC/Driver/CodeOutput.hs @@ -12,7 +12,7 @@ module GHC.Driver.CodeOutput ( codeOutput, outputForeignStubs ) where import GhcPrelude -import AsmCodeGen ( nativeCodeGen ) +import GHC.CmmToAsm ( nativeCodeGen ) import GHC.CmmToLlvm ( llvmCodeGen ) import UniqSupply ( mkSplitUniqSupply ) diff --git a/compiler/GHC/Llvm/Types.hs b/compiler/GHC/Llvm/Types.hs index f8ca0c826c..3e320634d0 100644 --- a/compiler/GHC/Llvm/Types.hs +++ b/compiler/GHC/Llvm/Types.hs @@ -20,7 +20,7 @@ import Outputable import Unique -- from NCG -import PprBase +import GHC.CmmToAsm.Ppr import GHC.Float diff --git a/compiler/nativeGen/Reg.hs b/compiler/GHC/Platform/Reg.hs index 3808434d62..b856d7c3af 100644 --- a/compiler/nativeGen/Reg.hs +++ b/compiler/GHC/Platform/Reg.hs @@ -3,7 +3,7 @@ -- by NCGMonad and the register allocators, which are shared -- by all architectures. -- -module Reg ( +module GHC.Platform.Reg ( RegNo, Reg(..), regPair, @@ -30,7 +30,7 @@ import GhcPrelude import Outputable import Unique -import RegClass +import GHC.Platform.Reg.Class import Data.List (intersect) -- | An identifier for a primitive real machine register. diff --git a/compiler/nativeGen/RegClass.hs b/compiler/GHC/Platform/Reg/Class.hs index f4170cca94..225ad05be5 100644 --- a/compiler/nativeGen/RegClass.hs +++ b/compiler/GHC/Platform/Reg/Class.hs @@ -1,5 +1,5 @@ -- | An architecture independent description of a register's class. -module RegClass +module GHC.Platform.Reg.Class ( RegClass (..) ) where diff --git a/compiler/GHC/Platform/Regs.hs b/compiler/GHC/Platform/Regs.hs index 51f7658db2..d214b0d89f 100644 --- a/compiler/GHC/Platform/Regs.hs +++ b/compiler/GHC/Platform/Regs.hs @@ -7,7 +7,7 @@ import GhcPrelude import GHC.Cmm.Expr import GHC.Platform -import Reg +import GHC.Platform.Reg import qualified GHC.Platform.ARM as ARM import qualified GHC.Platform.ARM64 as ARM64 diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in index 5ee1e8a15c..f42fc72d4e 100644 --- a/compiler/ghc.cabal.in +++ b/compiler/ghc.cabal.in @@ -165,7 +165,6 @@ Library coreSyn iface main - nativeGen parser prelude profiling @@ -268,7 +267,7 @@ Library GhcNameVersion FileSettings GHC.Cmm.Graph - PprBase + GHC.CmmToAsm.Ppr GHC.CmmToC GHC.Cmm.Ppr GHC.Cmm.Ppr.Decl @@ -582,71 +581,71 @@ Library GHC.Cmm.Dataflow.Label Exposed-Modules: - AsmCodeGen - TargetReg - NCGMonad - Instruction - BlockLayout - CFG - Dominators - Format - Reg - RegClass - PIC - CPrim - X86.Regs - X86.RegInfo - X86.Instr - X86.Cond - X86.Ppr - X86.CodeGen - PPC.Regs - PPC.RegInfo - PPC.Instr - PPC.Cond - PPC.Ppr - PPC.CodeGen - SPARC.Base - SPARC.Regs - SPARC.Imm - SPARC.AddrMode - SPARC.Cond - SPARC.Instr - SPARC.Stack - SPARC.ShortcutJump - SPARC.Ppr - SPARC.CodeGen - SPARC.CodeGen.Amode - SPARC.CodeGen.Base - SPARC.CodeGen.CondCode - SPARC.CodeGen.Gen32 - SPARC.CodeGen.Gen64 - SPARC.CodeGen.Sanity - SPARC.CodeGen.Expand - RegAlloc.Liveness - RegAlloc.Graph.Main - RegAlloc.Graph.Stats - RegAlloc.Graph.ArchBase - RegAlloc.Graph.ArchX86 - RegAlloc.Graph.Coalesce - RegAlloc.Graph.Spill - RegAlloc.Graph.SpillClean - RegAlloc.Graph.SpillCost - RegAlloc.Graph.TrivColorable - RegAlloc.Linear.Main - RegAlloc.Linear.JoinToTargets - RegAlloc.Linear.State - RegAlloc.Linear.Stats - RegAlloc.Linear.FreeRegs - RegAlloc.Linear.StackMap - RegAlloc.Linear.Base - RegAlloc.Linear.X86.FreeRegs - RegAlloc.Linear.X86_64.FreeRegs - RegAlloc.Linear.PPC.FreeRegs - RegAlloc.Linear.SPARC.FreeRegs - Dwarf - Dwarf.Types - Dwarf.Constants + GHC.CmmToAsm + GHC.CmmToAsm.Reg.Target + GHC.CmmToAsm.Monad + GHC.CmmToAsm.Instr + GHC.CmmToAsm.BlockLayout + GHC.CmmToAsm.CFG + GHC.CmmToAsm.CFG.Dominators + GHC.CmmToAsm.Format + GHC.Platform.Reg + GHC.Platform.Reg.Class + GHC.CmmToAsm.PIC + GHC.CmmToAsm.CPrim + GHC.CmmToAsm.X86.Regs + GHC.CmmToAsm.X86.RegInfo + GHC.CmmToAsm.X86.Instr + GHC.CmmToAsm.X86.Cond + GHC.CmmToAsm.X86.Ppr + GHC.CmmToAsm.X86.CodeGen + GHC.CmmToAsm.PPC.Regs + GHC.CmmToAsm.PPC.RegInfo + GHC.CmmToAsm.PPC.Instr + GHC.CmmToAsm.PPC.Cond + GHC.CmmToAsm.PPC.Ppr + GHC.CmmToAsm.PPC.CodeGen + GHC.CmmToAsm.SPARC.Base + GHC.CmmToAsm.SPARC.Regs + GHC.CmmToAsm.SPARC.Imm + GHC.CmmToAsm.SPARC.AddrMode + GHC.CmmToAsm.SPARC.Cond + GHC.CmmToAsm.SPARC.Instr + GHC.CmmToAsm.SPARC.Stack + GHC.CmmToAsm.SPARC.ShortcutJump + GHC.CmmToAsm.SPARC.Ppr + GHC.CmmToAsm.SPARC.CodeGen + GHC.CmmToAsm.SPARC.CodeGen.Amode + GHC.CmmToAsm.SPARC.CodeGen.Base + GHC.CmmToAsm.SPARC.CodeGen.CondCode + GHC.CmmToAsm.SPARC.CodeGen.Gen32 + GHC.CmmToAsm.SPARC.CodeGen.Gen64 + GHC.CmmToAsm.SPARC.CodeGen.Sanity + GHC.CmmToAsm.SPARC.CodeGen.Expand + GHC.CmmToAsm.Reg.Liveness + GHC.CmmToAsm.Reg.Graph + GHC.CmmToAsm.Reg.Graph.Stats + GHC.CmmToAsm.Reg.Graph.Base + GHC.CmmToAsm.Reg.Graph.X86 + GHC.CmmToAsm.Reg.Graph.Coalesce + GHC.CmmToAsm.Reg.Graph.Spill + GHC.CmmToAsm.Reg.Graph.SpillClean + GHC.CmmToAsm.Reg.Graph.SpillCost + GHC.CmmToAsm.Reg.Graph.TrivColorable + GHC.CmmToAsm.Reg.Linear + GHC.CmmToAsm.Reg.Linear.JoinToTargets + GHC.CmmToAsm.Reg.Linear.State + GHC.CmmToAsm.Reg.Linear.Stats + GHC.CmmToAsm.Reg.Linear.FreeRegs + GHC.CmmToAsm.Reg.Linear.StackMap + GHC.CmmToAsm.Reg.Linear.Base + GHC.CmmToAsm.Reg.Linear.X86 + GHC.CmmToAsm.Reg.Linear.X86_64 + GHC.CmmToAsm.Reg.Linear.PPC + GHC.CmmToAsm.Reg.Linear.SPARC + GHC.CmmToAsm.Dwarf + GHC.CmmToAsm.Dwarf.Types + GHC.CmmToAsm.Dwarf.Constants GHC.ThToHs GHC.ByteCode.Types GHC.ByteCode.Asm diff --git a/compiler/nativeGen/NOTES b/compiler/nativeGen/NOTES deleted file mode 100644 index 9068a7fc2c..0000000000 --- a/compiler/nativeGen/NOTES +++ /dev/null @@ -1,41 +0,0 @@ -TODO in new NCG -~~~~~~~~~~~~~~~ - -- Are we being careful enough about narrowing those out-of-range CmmInts? - -- Register allocator: - - fixup code - - keep track of free stack slots - - Optimisations: - - - picking the assignment on entry to a block: better to defer this - until we know all the assignments. In a loop, we should pick - the assignment from the looping jump (fixpointing?), so that any - fixup code ends up *outside* the loop. Otherwise, we should - pick the assignment that results in the least fixup code. - -- splitting? - --- ----------------------------------------------------------------------------- --- x86 ToDos - -- x86 genCCall needs to tack on the @size for stdcalls (might not be in the - foreignlabel). - -- x86: should really clean up that IMUL64 stuff, and tell the code gen about - Intel imul instructions. - -- x86: we're not careful enough about making sure that we only use - byte-addressable registers in byte instructions. Should we do it this - way, or stick to using 32-bit registers everywhere? - -- Use SSE for floating point, optionally. - ------------------------------------------------------------------------------- --- Further optimisations: - -- We might be able to extend the scope of the inlining phase so it can - skip over more statements that don't affect the value of the inlined - expr. - |