X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FnativeGen%2FX86%2FRegInfo.hs;fp=compiler%2FnativeGen%2FX86%2FRegInfo.hs;h=a3bf8e4655e0a196a50b1ac28217f4c4d7f3cba8;hb=20c0e6ccf28b0961d2c5f6516b57e52fa2c13b33;hp=58d063bd88e71361b3aa4585a5b6bcd140c43c16;hpb=17839aa386be663260622e5b86980e6fd9bb89a4;p=ghc-hetmet.git diff --git a/compiler/nativeGen/X86/RegInfo.hs b/compiler/nativeGen/X86/RegInfo.hs index 58d063b..a3bf8e4 100644 --- a/compiler/nativeGen/X86/RegInfo.hs +++ b/compiler/nativeGen/X86/RegInfo.hs @@ -5,10 +5,6 @@ module X86.RegInfo ( JumpDest, canShortcut, shortcutJump, - - spillSlotSize, - maxSpillSlots, - spillSlotToOffset, shortcutStatic, regDotColor @@ -29,9 +25,13 @@ import Cmm 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 @@ -61,26 +61,6 @@ shortcutJump fn insn@(JXX cc id) = 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)) @@ -116,6 +96,7 @@ regDotColor reg = let Just str = lookupUFM regColors reg in text str +regColors :: UniqFM [Char] regColors = listToUFM $ [ (eax, "#00ff00") @@ -138,6 +119,7 @@ regDotColor reg = let Just str = lookupUFM regColors reg in text str +regColors :: UniqFM [Char] regColors = listToUFM $ [ (rax, "#00ff00"), (eax, "#00ff00")