JumpDest,
canShortcut,
shortcutJump,
-
- spillSlotSize,
- maxSpillSlots,
- spillSlotToOffset,
shortcutStatic,
regDotColor
import CLabel
import BlockId
import Outputable
-import Constants ( rESERVED_C_STACK_BYTES )
import Unique
+#if i386_TARGET_ARCH || x86_64_TARGET_ARCH
+import UniqFM
+#endif
+
+
mkVReg :: Unique -> Size -> Reg
mkVReg u size
| not (isFloatSize size) = VirtualRegI u
shortcutJump _ other = other
-
-spillSlotSize :: Int
-spillSlotSize = IF_ARCH_i386(12, 8)
-
-maxSpillSlots :: Int
-maxSpillSlots = ((rESERVED_C_STACK_BYTES - 64) `div` spillSlotSize) - 1
-
--- convert a spill slot number to a *byte* offset, with no sign:
--- decide on a per arch basis whether you are spilling above or below
--- the C stack pointer.
-spillSlotToOffset :: Int -> Int
-spillSlotToOffset slot
- | slot >= 0 && slot < maxSpillSlots
- = 64 + spillSlotSize * slot
- | otherwise
- = pprPanic "spillSlotToOffset:"
- ( text "invalid spill location: " <> int slot
- $$ text "maxSpillSlots: " <> int maxSpillSlots)
-
-
-- Here because it knows about JumpDest
shortcutStatic :: (BlockId -> Maybe JumpDest) -> CmmStatic -> CmmStatic
shortcutStatic fn (CmmStaticLit (CmmLabel lab))
= let Just str = lookupUFM regColors reg
in text str
+regColors :: UniqFM [Char]
regColors
= listToUFM
$ [ (eax, "#00ff00")
= let Just str = lookupUFM regColors reg
in text str
+regColors :: UniqFM [Char]
regColors
= listToUFM
$ [ (rax, "#00ff00"), (eax, "#00ff00")