Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/f1f1659da0b6c43c46eef2109e456f84e6956a52

>---------------------------------------------------------------

commit f1f1659da0b6c43c46eef2109e456f84e6956a52
Author: Ian Lynagh <[email protected]>
Date:   Wed Aug 22 00:43:41 2012 +0100

    More CPP removal in nativeGen/X86/Regs.hs

>---------------------------------------------------------------

 compiler/nativeGen/X86/Regs.hs |   25 ++++++++++---------------
 1 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/compiler/nativeGen/X86/Regs.hs b/compiler/nativeGen/X86/Regs.hs
index b0e5acf..1affca7 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.



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to