[commit: ghc] ghc-7.8: PPC: Fix loads of PIC data with > 16 bit offsets (#7830). (c0c055e)

git at git.haskell.org git at git.haskell.org
Fri Feb 28 23:39:23 UTC 2014


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

On branch  : ghc-7.8
Link       : http://ghc.haskell.org/trac/ghc/changeset/c0c055e907f34316cc77dc91ce30a3a701d20e92/ghc

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

commit c0c055e907f34316cc77dc91ce30a3a701d20e92
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Fri Feb 28 18:33:13 2014 +1100

    PPC: Fix loads of PIC data with > 16 bit offsets (#7830).
    
    Loads should now handle up to 32 bit offsets.
    
    (cherry picked from commit 67029f200c5512f8ba5b9b7c25a5d1131422ef8e)


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

c0c055e907f34316cc77dc91ce30a3a701d20e92
 compiler/nativeGen/PIC.hs |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/nativeGen/PIC.hs b/compiler/nativeGen/PIC.hs
index f988bf7..9b5c080 100644
--- a/compiler/nativeGen/PIC.hs
+++ b/compiler/nativeGen/PIC.hs
@@ -728,9 +728,10 @@ initializePicBase_ppc ArchPPC os picReg
 
             fetchPC (BasicBlock bID insns) =
               BasicBlock bID (PPC.FETCHPC picReg
+                              : PPC.ADDIS tmp picReg (PPC.HI offsetToOffset)
                               : PPC.LD PPC.archWordSize tmp
-                                   (PPC.AddrRegImm picReg offsetToOffset)
-                              : PPC.ADD picReg picReg (PPC.RIReg tmp)
+                                   (PPC.AddrRegImm tmp (PPC.LO offsetToOffset))
+                              : PPC.ADD picReg picReg (PPC.RIReg picReg)
                               : insns)
 
         return (CmmProc info lab live (ListGraph blocks') : gotOffset : statics)



More information about the ghc-commits mailing list