[commit: ghc] wip/carter/remove_x87Registers: fixing some bad bugs (a1223a9)

git at git.haskell.org git at git.haskell.org
Thu Dec 27 16:59:39 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/carter/remove_x87Registers
Link       : http://ghc.haskell.org/trac/ghc/changeset/a1223a931210921aaba003ffe6d5c7bdf5e446c8/ghc

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

commit a1223a931210921aaba003ffe6d5c7bdf5e446c8
Author: Carter Tazio Schonwald <carter.schonwald at gmail.com>
Date:   Fri Dec 21 19:30:50 2018 -0500

    fixing some bad bugs


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

a1223a931210921aaba003ffe6d5c7bdf5e446c8
 compiler/nativeGen/X86/Regs.hs | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/compiler/nativeGen/X86/Regs.hs b/compiler/nativeGen/X86/Regs.hs
index 4c667c6..ef55d18 100644
--- a/compiler/nativeGen/X86/Regs.hs
+++ b/compiler/nativeGen/X86/Regs.hs
@@ -205,6 +205,8 @@ spRel dflags n
 
 firstxmm :: RegNo
 firstxmm  = 16
+
+--  on 32bit platformOSs, only the first 8 XMM/YMM/ZMM registers are available
 lastxmm :: Platform -> RegNo
 lastxmm platform
  | target32Bit platform = firstxmm + 7  -- xmm0 - xmmm7
@@ -254,9 +256,8 @@ classOfRealReg platform reg
 -- | Get the name of the register with this number.
 showReg :: Platform -> RegNo -> String
 showReg platform n
-        | n >= firstxmm  = "%xmm" ++ show (n-firstxmm)
-
-        | n >= 8         = "%r" ++ show n
+        | n >= firstxmm && n <= lastxmm  platform = "%xmm" ++ show (n-firstxmm)
+        | n >= 8   && n < firstxmm      = "%r" ++ show n
         | otherwise      = regNames platform A.! n
 
 regNames :: Platform -> A.Array Int String



More information about the ghc-commits mailing list