NCG: Split up the native code generator into arch specific modules
authorBen.Lippmeier@anu.edu.au <unknown>
Sun, 15 Feb 2009 05:51:58 +0000 (05:51 +0000)
committerBen.Lippmeier@anu.edu.au <unknown>
Sun, 15 Feb 2009 05:51:58 +0000 (05:51 +0000)
commitb04a210e26ca57242fd052f2aa91011a80b76299
tree6f26993cc3ef37f4555087bd80da4195edcda4ed
parent77ed23d51b968505b3ad8541c075657ae94f0ea3
NCG: Split up the native code generator into arch specific modules

  - nativeGen/Instruction defines a type class for a generic
    instruction set. Each of the instruction sets we have,
    X86, PPC and SPARC are instances of it.

  - The register alloctors use this type class when they need
    info about a certain register or instruction, such as
    regUsage, mkSpillInstr, mkJumpInstr, patchRegs..

  - nativeGen/Platform defines some data types enumerating
    the architectures and operating systems supported by the
    native code generator.

  - DynFlags now keeps track of the current build platform, and
    the PositionIndependentCode module uses this to decide what
    to do instead of relying of #ifdefs.

  - It's not totally retargetable yet. Some info info about the
    build target is still hardwired, but I've tried to contain
    most of it to a single module, TargetRegs.

  - Moved the SPILL and RELOAD instructions into LiveInstr.

  - Reg and RegClass now have their own modules, and are shared
    across all architectures.
55 files changed:
compiler/ghc.cabal.in
compiler/main/DynFlags.hs
compiler/nativeGen/Alpha/CodeGen.hs [new file with mode: 0644]
compiler/nativeGen/Alpha/Instr.hs
compiler/nativeGen/ArchReg.hs [new file with mode: 0644]
compiler/nativeGen/AsmCodeGen.lhs
compiler/nativeGen/Instrs.hs [deleted file]
compiler/nativeGen/Instruction.hs [new file with mode: 0644]
compiler/nativeGen/MachCodeGen.hs [deleted file]
compiler/nativeGen/NCGMonad.hs
compiler/nativeGen/PIC.hs [moved from compiler/nativeGen/PositionIndependentCode.hs with 57% similarity]
compiler/nativeGen/PPC/CodeGen.hs [new file with mode: 0644]
compiler/nativeGen/PPC/Cond.hs [new file with mode: 0644]
compiler/nativeGen/PPC/Instr.hs
compiler/nativeGen/PPC/Ppr.hs
compiler/nativeGen/PPC/RegInfo.hs
compiler/nativeGen/PPC/Regs.hs
compiler/nativeGen/Platform.hs [new file with mode: 0644]
compiler/nativeGen/PprMach.hs [deleted file]
compiler/nativeGen/Reg.hs [new file with mode: 0644]
compiler/nativeGen/RegAlloc/Graph/Coalesce.hs
compiler/nativeGen/RegAlloc/Graph/Main.hs
compiler/nativeGen/RegAlloc/Graph/Spill.hs
compiler/nativeGen/RegAlloc/Graph/SpillClean.hs
compiler/nativeGen/RegAlloc/Graph/SpillCost.hs
compiler/nativeGen/RegAlloc/Graph/Stats.hs
compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs [moved from compiler/nativeGen/Regs.hs with 55% similarity]
compiler/nativeGen/RegAlloc/Linear/Base.hs
compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs
compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs
compiler/nativeGen/RegAlloc/Linear/Main.hs
compiler/nativeGen/RegAlloc/Linear/PPC/FreeRegs.hs
compiler/nativeGen/RegAlloc/Linear/SPARC/FreeRegs.hs
compiler/nativeGen/RegAlloc/Linear/StackMap.hs
compiler/nativeGen/RegAlloc/Linear/State.hs
compiler/nativeGen/RegAlloc/Linear/Stats.hs
compiler/nativeGen/RegAlloc/Linear/X86/FreeRegs.hs
compiler/nativeGen/RegAlloc/Liveness.hs
compiler/nativeGen/RegAllocInfo.hs [deleted file]
compiler/nativeGen/RegClass.hs [new file with mode: 0644]
compiler/nativeGen/RegsBase.hs [deleted file]
compiler/nativeGen/SPARC/CodeGen.hs [new file with mode: 0644]
compiler/nativeGen/SPARC/Cond.hs [new file with mode: 0644]
compiler/nativeGen/SPARC/Instr.hs
compiler/nativeGen/SPARC/Ppr.hs
compiler/nativeGen/SPARC/RegInfo.hs
compiler/nativeGen/SPARC/Regs.hs
compiler/nativeGen/Size.hs [new file with mode: 0644]
compiler/nativeGen/TargetReg.hs [new file with mode: 0644]
compiler/nativeGen/X86/CodeGen.hs [new file with mode: 0644]
compiler/nativeGen/X86/Cond.hs [new file with mode: 0644]
compiler/nativeGen/X86/Instr.hs
compiler/nativeGen/X86/Ppr.hs
compiler/nativeGen/X86/RegInfo.hs
compiler/nativeGen/X86/Regs.hs