never executed always true always false
1 {-# OPTIONS_GHC -fno-warn-orphans #-}
2
3 -- | Native code generator for PPC architectures
4 module GHC.CmmToAsm.PPC
5 ( ncgPPC
6 )
7 where
8
9 import GHC.Prelude
10
11 import GHC.CmmToAsm.Instr
12 import GHC.CmmToAsm.Monad
13 import GHC.CmmToAsm.Config
14 import GHC.CmmToAsm.Types
15
16 import qualified GHC.CmmToAsm.PPC.Instr as PPC
17 import qualified GHC.CmmToAsm.PPC.Ppr as PPC
18 import qualified GHC.CmmToAsm.PPC.CodeGen as PPC
19 import qualified GHC.CmmToAsm.PPC.Regs as PPC
20 import qualified GHC.CmmToAsm.PPC.RegInfo as PPC
21
22 ncgPPC :: NCGConfig -> NcgImpl RawCmmStatics PPC.Instr PPC.JumpDest
23 ncgPPC config = NcgImpl
24 { ncgConfig = config
25 , cmmTopCodeGen = PPC.cmmTopCodeGen
26 , generateJumpTableForInstr = PPC.generateJumpTableForInstr config
27 , getJumpDestBlockId = PPC.getJumpDestBlockId
28 , canShortcut = PPC.canShortcut
29 , shortcutStatics = PPC.shortcutStatics
30 , shortcutJump = PPC.shortcutJump
31 , pprNatCmmDecl = PPC.pprNatCmmDecl config
32 , maxSpillSlots = PPC.maxSpillSlots config
33 , allocatableRegs = PPC.allocatableRegs platform
34 , ncgAllocMoreStack = PPC.allocMoreStack platform
35 , ncgExpandTop = id
36 , ncgMakeFarBranches = PPC.makeFarBranches
37 , extractUnwindPoints = const []
38 , invertCondBranches = \_ _ -> id
39 }
40 where
41 platform = ncgPlatform config
42
43 -- | Instruction instance for powerpc
44 instance Instruction PPC.Instr where
45 regUsageOfInstr = PPC.regUsageOfInstr
46 patchRegsOfInstr = PPC.patchRegsOfInstr
47 isJumpishInstr = PPC.isJumpishInstr
48 jumpDestsOfInstr = PPC.jumpDestsOfInstr
49 patchJumpInstr = PPC.patchJumpInstr
50 mkSpillInstr = PPC.mkSpillInstr
51 mkLoadInstr = PPC.mkLoadInstr
52 takeDeltaInstr = PPC.takeDeltaInstr
53 isMetaInstr = PPC.isMetaInstr
54 mkRegRegMoveInstr _ = PPC.mkRegRegMoveInstr
55 takeRegRegMoveInstr = PPC.takeRegRegMoveInstr
56 mkJumpInstr = PPC.mkJumpInstr
57 mkStackAllocInstr = PPC.mkStackAllocInstr
58 mkStackDeallocInstr = PPC.mkStackDeallocInstr
59 pprInstr = PPC.pprInstr
60 mkComment = pure . PPC.COMMENT