diff options
Diffstat (limited to 'compiler/GHC/CmmToAsm/PPC.hs')
-rw-r--r-- | compiler/GHC/CmmToAsm/PPC.hs | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/compiler/GHC/CmmToAsm/PPC.hs b/compiler/GHC/CmmToAsm/PPC.hs new file mode 100644 index 0000000000..148fd1b4b2 --- /dev/null +++ b/compiler/GHC/CmmToAsm/PPC.hs @@ -0,0 +1,61 @@ +{-# OPTIONS_GHC -fno-warn-orphans #-} + +-- | Native code generator for PPC architectures +module GHC.CmmToAsm.PPC + ( ncgPPC + ) +where + +import GHC.Prelude + +import GHC.CmmToAsm.Instr +import GHC.CmmToAsm.Monad +import GHC.CmmToAsm.Config +import GHC.CmmToAsm.Types + +import qualified GHC.CmmToAsm.PPC.Instr as PPC +import qualified GHC.CmmToAsm.PPC.Ppr as PPC +import qualified GHC.CmmToAsm.PPC.CodeGen as PPC +import qualified GHC.CmmToAsm.PPC.Regs as PPC +import qualified GHC.CmmToAsm.PPC.RegInfo as PPC + +ncgPPC :: NCGConfig -> NcgImpl RawCmmStatics PPC.Instr PPC.JumpDest +ncgPPC config = NcgImpl + { ncgConfig = config + , cmmTopCodeGen = PPC.cmmTopCodeGen + , generateJumpTableForInstr = PPC.generateJumpTableForInstr config + , getJumpDestBlockId = PPC.getJumpDestBlockId + , canShortcut = PPC.canShortcut + , shortcutStatics = PPC.shortcutStatics + , shortcutJump = PPC.shortcutJump + , pprNatCmmDecl = PPC.pprNatCmmDecl config + , maxSpillSlots = PPC.maxSpillSlots config + , allocatableRegs = PPC.allocatableRegs platform + , ncgAllocMoreStack = PPC.allocMoreStack platform + , ncgExpandTop = id + , ncgMakeFarBranches = PPC.makeFarBranches + , extractUnwindPoints = const [] + , invertCondBranches = \_ _ -> id + } + where + platform = ncgPlatform config + +-- | Instruction instance for powerpc +instance Instruction PPC.Instr where + regUsageOfInstr = PPC.regUsageOfInstr + patchRegsOfInstr = PPC.patchRegsOfInstr + isJumpishInstr = PPC.isJumpishInstr + jumpDestsOfInstr = PPC.jumpDestsOfInstr + patchJumpInstr = PPC.patchJumpInstr + mkSpillInstr = PPC.mkSpillInstr + mkLoadInstr = PPC.mkLoadInstr + takeDeltaInstr = PPC.takeDeltaInstr + isMetaInstr = PPC.isMetaInstr + mkRegRegMoveInstr _ = PPC.mkRegRegMoveInstr + takeRegRegMoveInstr = PPC.takeRegRegMoveInstr + mkJumpInstr = PPC.mkJumpInstr + mkStackAllocInstr = PPC.mkStackAllocInstr + mkStackDeallocInstr = PPC.mkStackDeallocInstr + pprInstr = PPC.pprInstr + + |