[commit: ghc] master: PPC: Fix loads of PIC data with > 16 bit offsets (#7830). (67029f2)

git at git.haskell.org git at git.haskell.org
Fri Feb 28 08:10:11 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/67029f200c5512f8ba5b9b7c25a5d1131422ef8e/ghc

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

commit 67029f200c5512f8ba5b9b7c25a5d1131422ef8e
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.


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

67029f200c5512f8ba5b9b7c25a5d1131422ef8e
 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