#if i386_TARGET_ARCH
-x86fp_kludge :: NatCmmTop -> NatCmmTop
+x86fp_kludge :: NatCmmTop Instr -> NatCmmTop Instr
x86fp_kludge top@(CmmData _ _) = top
x86fp_kludge top@(CmmProc info lbl params (ListGraph code)) =
CmmProc info lbl params (ListGraph $ i386_insert_ffrees code)
import Data.Int
import Data.Word
+#if darwin_TARGET_OS || linux_TARGET_OS
+import BasicTypes
+import FastString
+#endif
+
-- -----------------------------------------------------------------------------
-- Top-level of the instruction selector
do
dflags <- getDynFlagsNat
mopExpr <- cmmMakeDynamicReference dflags addImportNat CallReference $
- mkForeignLabel functionName Nothing True
+ mkForeignLabel functionName Nothing True IsFunction
let mopLabelOrExpr = case mopExpr of
CmmLit (CmmLabel lbl) -> Left lbl
_ -> Right mopExpr
| OFLO
| PARITY
| NOTPARITY
-
+ deriving Eq
condUnsigned :: Cond -> Bool
condUnsigned GU = True
import Cmm
import FastString
import FastBool
+import Outputable
+import Constants (rESERVED_C_STACK_BYTES)
import CLabel
import Panic
= panic "X86.RegInfo.mkLoadInstr: not defined for this architecture."
#endif
+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)
--------------------------------------------------------------------------------
RelocatableReadOnlyData -> ptext (sLit ".const_data\n.align 2")
UninitialisedData -> ptext (sLit ".data\n\t.align 2")
ReadOnlyData16 -> ptext (sLit ".const\n.align 4")
- OtherSection sec -> panic "X86.Ppr.pprSectionHeader: unknown section"
+ OtherSection _ -> panic "X86.Ppr.pprSectionHeader: unknown section"
# else
pprSectionHeader seg
RelocatableReadOnlyData -> ptext (sLit ".section .data\n\t.align 4")
UninitialisedData -> ptext (sLit ".section .bss\n\t.align 4")
ReadOnlyData16 -> ptext (sLit ".section .rodata\n\t.align 16")
- OtherSection sec -> panic "X86.Ppr.pprSectionHeader: unknown section"
+ OtherSection _ -> panic "X86.Ppr.pprSectionHeader: unknown section"
# endif
RelocatableReadOnlyData -> ptext (sLit ".const_data\n.align 3")
UninitialisedData -> ptext (sLit ".data\n\t.align 3")
ReadOnlyData16 -> ptext (sLit ".const\n.align 4")
- OtherSection sec -> panic "PprMach.pprSectionHeader: unknown section"
+ OtherSection _ -> panic "PprMach.pprSectionHeader: unknown section"
# else
pprSectionHeader seg
RelocatableReadOnlyData -> ptext (sLit ".section .data\n\t.align 8")
UninitialisedData -> ptext (sLit ".section .bss\n\t.align 8")
ReadOnlyData16 -> ptext (sLit ".section .rodata.cst16\n\t.align 16")
- OtherSection sec -> panic "PprMach.pprSectionHeader: unknown section"
+ OtherSection _ -> panic "PprMach.pprSectionHeader: unknown section"
# endif
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")
#if defined(i386_TARGET_ARCH) || defined(x86_64_TARGET_ARCH)
import Constants
+import Outputable (ppr, pprPanic)
#endif