summaryrefslogtreecommitdiff
path: root/compiler/nativeGen
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-08-22 00:43:41 +0100
committerIan Lynagh <ian@well-typed.com>2012-08-22 00:43:41 +0100
commitf1f1659da0b6c43c46eef2109e456f84e6956a52 (patch)
treebab457293042c1d207d4e49973c1fd409ad028a2 /compiler/nativeGen
parent23efe668b1dbd7a8a2b9c3a3ce3ad0ec84a3e464 (diff)
downloadhaskell-f1f1659da0b6c43c46eef2109e456f84e6956a52.tar.gz
More CPP removal in nativeGen/X86/Regs.hs
Diffstat (limited to 'compiler/nativeGen')
-rw-r--r--compiler/nativeGen/X86/Regs.hs25
1 files changed, 10 insertions, 15 deletions
diff --git a/compiler/nativeGen/X86/Regs.hs b/compiler/nativeGen/X86/Regs.hs
index b0e5acff04..1affca7480 100644
--- a/compiler/nativeGen/X86/Regs.hs
+++ b/compiler/nativeGen/X86/Regs.hs
@@ -421,7 +421,17 @@ xmm n = regSingle (firstxmm+n)
-- horror show -----------------------------------------------------------------
freeReg :: RegNo -> FastBool
globalRegMaybe :: GlobalReg -> Maybe RealReg
+
+-- | these are the regs which we cannot assume stay alive over a C call.
callClobberedRegs :: Platform -> [Reg]
+-- caller-saves registers
+callClobberedRegs platform
+ | target32Bit platform = [eax,ecx,edx] ++ map regSingle (floatregnos platform)
+ | otherwise
+ -- all xmm regs are caller-saves
+ -- caller-saves registers
+ = [rax,rcx,rdx,rsi,rdi,r8,r9,r10,r11]
+ ++ map regSingle (floatregnos platform)
allArgRegs :: Platform -> [(Reg, Reg)]
allArgRegs platform
@@ -630,21 +640,6 @@ instrClobberedRegs = map RealRegSingle [ eax, ecx, edx ]
instrClobberedRegs = map RealRegSingle [ rax, rcx, rdx ]
#endif
--- | these are the regs which we cannot assume stay alive over a C call.
-
-#if i386_TARGET_ARCH
--- caller-saves registers
-callClobberedRegs platform
- = map regSingle ([eax,ecx,edx] ++ floatregnos platform)
-
-#else
--- all xmm regs are caller-saves
--- caller-saves registers
-callClobberedRegs platform
- = map regSingle ([rax,rcx,rdx,rsi,rdi,r8,r9,r10,r11] ++ floatregnos platform)
-
-#endif
-
-- allocatableRegs is allMachRegNos with the fixed-use regs removed.
-- i.e., these are the regs for which we are prepared to allow the
-- register allocator to attempt to map VRegs to.