[commit: ghc] master: Only use real XMM registers when assigning arguments. (3e598fe)

Geoffrey Mainland gmainlan at ghc.haskell.org
Tue Aug 6 10:53:24 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/3e598fe0b01f4692f50c377ac91010040227e7ce

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

commit 3e598fe0b01f4692f50c377ac91010040227e7ce
Author: Geoffrey Mainland <mainland at apeiron.net>
Date:   Tue Aug 6 08:27:50 2013 +0100

    Only use real XMM registers when assigning arguments.
    
    My original change to the calling convention mistakenly used all 6 XMM
    registers---which live in the global register table---on x86 (32 bit). This
    royally screwed up the floating point code generated for that platform because
    floating point arguments were passed in global registers instead of on the
    stack!

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

 compiler/cmm/CmmCallConv.hs |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/compiler/cmm/CmmCallConv.hs b/compiler/cmm/CmmCallConv.hs
index 2dd381e..eeca0b4 100644
--- a/compiler/cmm/CmmCallConv.hs
+++ b/compiler/cmm/CmmCallConv.hs
@@ -128,7 +128,7 @@ getRegsWithoutNode dflags =
   , realFloatRegs dflags
   , realDoubleRegs dflags
   , realLongRegs dflags
-  , xmmRegNos dflags)
+  , realXmmRegNos dflags)
 
 -- getRegsWithNode uses R1/node even if it isn't a register
 getRegsWithNode dflags =
@@ -138,7 +138,7 @@ getRegsWithNode dflags =
   , realFloatRegs dflags
   , realDoubleRegs dflags
   , realLongRegs dflags
-  , xmmRegNos dflags)
+  , realXmmRegNos dflags)
 
 allFloatRegs, allDoubleRegs, allLongRegs :: DynFlags -> [GlobalReg]
 allVanillaRegs :: DynFlags -> [VGcPtr -> GlobalReg]
@@ -152,14 +152,13 @@ allXmmRegs     dflags =                  regList (mAX_XMM_REG     dflags)
 
 realFloatRegs, realDoubleRegs, realLongRegs :: DynFlags -> [GlobalReg]
 realVanillaRegs :: DynFlags -> [VGcPtr -> GlobalReg]
+realXmmRegNos :: DynFlags -> [Int]
 
 realVanillaRegs dflags = map VanillaReg $ regList (mAX_Real_Vanilla_REG dflags)
 realFloatRegs   dflags = map FloatReg   $ regList (mAX_Real_Float_REG   dflags)
 realDoubleRegs  dflags = map DoubleReg  $ regList (mAX_Real_Double_REG  dflags)
 realLongRegs    dflags = map LongReg    $ regList (mAX_Real_Long_REG    dflags)
-
-xmmRegNos :: DynFlags -> [Int]
-xmmRegNos dflags =regList (mAX_XMM_REG dflags)
+realXmmRegNos   dflags =                  regList (mAX_Real_XMM_REG     dflags)
 
 regList :: Int -> [Int]
 regList n = [1 .. n]






More information about the ghc-commits mailing list