[commit: ghc] wip/carter/remove_x87Registers: adding some fall throughs for earlier termination (e3130c7)
git at git.haskell.org
git at git.haskell.org
Thu Dec 27 16:59:36 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/carter/remove_x87Registers
Link : http://ghc.haskell.org/trac/ghc/changeset/e3130c7c80ad24daf451229197c6d6840d823809/ghc
>---------------------------------------------------------------
commit e3130c7c80ad24daf451229197c6d6840d823809
Author: Carter Tazio Schonwald <carter.schonwald at gmail.com>
Date: Fri Dec 21 19:57:31 2018 -0500
adding some fall throughs for earlier termination
>---------------------------------------------------------------
e3130c7c80ad24daf451229197c6d6840d823809
compiler/nativeGen/RegAlloc/Linear/X86_64/FreeRegs.hs | 5 +++++
compiler/nativeGen/X86/Regs.hs | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/compiler/nativeGen/RegAlloc/Linear/X86_64/FreeRegs.hs b/compiler/nativeGen/RegAlloc/Linear/X86_64/FreeRegs.hs
index 3a6e340..07b0e56 100644
--- a/compiler/nativeGen/RegAlloc/Linear/X86_64/FreeRegs.hs
+++ b/compiler/nativeGen/RegAlloc/Linear/X86_64/FreeRegs.hs
@@ -39,10 +39,15 @@ getFreeRegs platform cls (FreeRegs f) = go f 0
| n .&. 1 /= 0 && classOfRealReg platform (RealRegSingle m) == cls
= RealRegSingle m : (go (n `shiftR` 1) $! (m+1))
+ | m > finalRegister = []
+
| otherwise
= go (n `shiftR` 1) $! (m+1)
-- ToDo: there's no point looking through all the integer registers
-- in order to find a floating-point one.
+ -- Because they're seperate subintervals. A problem for another day.
+
+ finalRegister = lastxmm platform
allocateReg :: RealReg -> FreeRegs -> FreeRegs
allocateReg (RealRegSingle r) (FreeRegs f)
diff --git a/compiler/nativeGen/X86/Regs.hs b/compiler/nativeGen/X86/Regs.hs
index ef55d18..14870b4 100644
--- a/compiler/nativeGen/X86/Regs.hs
+++ b/compiler/nativeGen/X86/Regs.hs
@@ -254,6 +254,7 @@ classOfRealReg platform reg
_ -> panic "X86.Regs.classOfRealReg: RegPairs on this arch"
-- | Get the name of the register with this number.
+-- NOTE: fixme, we dont track which "way" the XMM registers are used
showReg :: Platform -> RegNo -> String
showReg platform n
| n >= firstxmm && n <= lastxmm platform = "%xmm" ++ show (n-firstxmm)
@@ -358,7 +359,7 @@ xmm11 = regSingle 27
xmm12 = regSingle 28
xmm13 = regSingle 29
xmm14 = regSingle 30
-xmm15 = regSingle 21
+xmm15 = regSingle 31
ripRel :: Displacement -> AddrMode
ripRel imm = AddrBaseIndex EABaseRip EAIndexNone imm
More information about the ghc-commits
mailing list