projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Whitespace only in nativeGen/RegAlloc/Graph/TrivColorable.hs
[ghc-hetmet.git]
/
compiler
/
nativeGen
/
PPC
/
RegInfo.hs
diff --git
a/compiler/nativeGen/PPC/RegInfo.hs
b/compiler/nativeGen/PPC/RegInfo.hs
index
719d76c
..
bfc712a
100644
(file)
--- a/
compiler/nativeGen/PPC/RegInfo.hs
+++ b/
compiler/nativeGen/PPC/RegInfo.hs
@@
-7,14
+7,11
@@
-----------------------------------------------------------------------------
module PPC.RegInfo (
-----------------------------------------------------------------------------
module PPC.RegInfo (
- mkVReg,
-
- JumpDest,
+ JumpDest( DestBlockId ), getJumpDestBlockId,
canShortcut,
shortcutJump,
canShortcut,
shortcutJump,
- shortcutStatic,
- regDotColor
+ shortcutStatic
)
where
)
where
@@
-24,31
+21,20
@@
where
import PPC.Regs
import PPC.Instr
import PPC.Regs
import PPC.Instr
-import RegClass
-import Reg
-import Size
import BlockId
import BlockId
-import Cmm
+import OldCmm
import CLabel
import Outputable
import Unique
import CLabel
import Outputable
import Unique
-mkVReg :: Unique -> Size -> Reg
-mkVReg u size
- | not (isFloatSize size) = RegVirtual $ VirtualRegI u
- | otherwise
- = case size of
- FF32 -> RegVirtual $ VirtualRegD u
- FF64 -> RegVirtual $ VirtualRegD u
- _ -> panic "mkVReg"
-
-
-
-
data JumpDest = DestBlockId BlockId | DestImm Imm
data JumpDest = DestBlockId BlockId | DestImm Imm
+getJumpDestBlockId :: JumpDest -> Maybe BlockId
+getJumpDestBlockId (DestBlockId bid) = Just bid
+getJumpDestBlockId _ = Nothing
+
canShortcut :: Instr -> Maybe JumpDest
canShortcut _ = Nothing
canShortcut :: Instr -> Maybe JumpDest
canShortcut _ = Nothing
@@
-61,11
+47,11
@@
shortcutStatic :: (BlockId -> Maybe JumpDest) -> CmmStatic -> CmmStatic
shortcutStatic fn (CmmStaticLit (CmmLabel lab))
| Just uq <- maybeAsmTemp lab
shortcutStatic fn (CmmStaticLit (CmmLabel lab))
| Just uq <- maybeAsmTemp lab
- = CmmStaticLit (CmmLabel (shortBlockId fn (BlockId uq)))
+ = CmmStaticLit (CmmLabel (shortBlockId fn (mkBlockId uq)))
shortcutStatic fn (CmmStaticLit (CmmLabelDiffOff lbl1 lbl2 off))
| Just uq <- maybeAsmTemp lbl1
shortcutStatic fn (CmmStaticLit (CmmLabelDiffOff lbl1 lbl2 off))
| Just uq <- maybeAsmTemp lbl1
- = CmmStaticLit (CmmLabelDiffOff (shortBlockId fn (BlockId uq)) lbl2 off)
+ = CmmStaticLit (CmmLabelDiffOff (shortBlockId fn (mkBlockId uq)) lbl2 off)
-- slightly dodgy, we're ignoring the second label, but this
-- works with the way we use CmmLabelDiffOff for jump tables now.
-- slightly dodgy, we're ignoring the second label, but this
-- works with the way we use CmmLabelDiffOff for jump tables now.
@@
-77,18
+63,11
@@
shortBlockId
-> BlockId
-> CLabel
-> BlockId
-> CLabel
-shortBlockId fn blockid@(BlockId uq) =
+shortBlockId fn blockid =
case fn blockid of
Nothing -> mkAsmTempLabel uq
Just (DestBlockId blockid') -> shortBlockId fn blockid'
Just (DestImm (ImmCLbl lbl)) -> lbl
_other -> panic "shortBlockId"
case fn blockid of
Nothing -> mkAsmTempLabel uq
Just (DestBlockId blockid') -> shortBlockId fn blockid'
Just (DestImm (ImmCLbl lbl)) -> lbl
_other -> panic "shortBlockId"
+ where uq = getUnique blockid
-
-
-regDotColor :: Reg -> SDoc
-regDotColor reg
- = case regClass reg of
- RcInteger -> text "blue"
- RcFloat -> text "red"
- RcDouble -> text "green"