Commit 152f1eb2 authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Remove some CPP from nativeGen/PPC/Regs.h

parent dae766b3
......@@ -908,7 +908,8 @@ genCCall' platform gcp target dest_regs argsAndHints
do
(finalStack,passArgumentsCode,usedRegs) <- passArguments
(zip args argReps)
allArgRegs allFPArgRegs
allArgRegs
(allFPArgRegs platform)
initialStackOffset
(toOL []) []
......
......@@ -194,8 +194,8 @@ ppc_regUsageOfInstr platform instr
BCCFAR _ _ -> noUsage
MTCTR reg -> usage ([reg],[])
BCTR _ _ -> noUsage
BL _ params -> usage (params, callClobberedRegs)
BCTRL params -> usage (params, callClobberedRegs)
BL _ params -> usage (params, callClobberedRegs platform)
BCTRL params -> usage (params, callClobberedRegs platform)
ADD reg1 reg2 ri -> usage (reg2 : regRI ri, [reg1])
ADDC reg1 reg2 reg3-> usage ([reg2,reg3], [reg1])
ADDE reg1 reg2 reg3-> usage ([reg2,reg3], [reg1])
......
......@@ -221,19 +221,12 @@ allArgRegs = map regSingle [3..10]
-- these are the regs which we cannot assume stay alive over a C call.
callClobberedRegs :: [Reg]
#if defined(darwin_TARGET_OS)
callClobberedRegs
= map regSingle (0:[2..12] ++ map fReg [0..13])
#elif defined(linux_TARGET_OS)
callClobberedRegs
= map regSingle (0:[2..13] ++ map fReg [0..13])
#else
callClobberedRegs
= panic "PPC.Regs.callClobberedRegs: not defined for this architecture"
#endif
callClobberedRegs :: Platform -> [Reg]
callClobberedRegs platform
= case platformOS platform of
OSDarwin -> map regSingle (0:[2..12] ++ map fReg [0..13])
OSLinux -> map regSingle (0:[2..13] ++ map fReg [0..13])
_ -> panic "PPC.Regs.callClobberedRegs: not defined for this architecture"
allMachRegNos :: [RegNo]
......@@ -259,17 +252,12 @@ showReg n
-- machine specific ------------------------------------------------------------
allFPArgRegs :: [Reg]
#if defined(darwin_TARGET_OS)
allFPArgRegs = map (regSingle . fReg) [1..13]
#elif defined(linux_TARGET_OS)
allFPArgRegs = map (regSingle . fReg) [1..8]
#else
allFPArgRegs = panic "PPC.Regs.allFPArgRegs: not defined for this architecture"
#endif
allFPArgRegs :: Platform -> [Reg]
allFPArgRegs platform
= case platformOS platform of
OSDarwin -> map (regSingle . fReg) [1..13]
OSLinux -> map (regSingle . fReg) [1..8]
_ -> panic "PPC.Regs.allFPArgRegs: not defined for this architecture"
fits16Bits :: Integral a => a -> Bool
fits16Bits x = x >= -32768 && x < 32768
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment