summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/PIC.hs
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2014-02-28 18:33:13 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2014-02-28 16:31:05 +1100
commit67029f200c5512f8ba5b9b7c25a5d1131422ef8e (patch)
treeea82b075dd06f252c0c4f93795b747d0e425e494 /compiler/nativeGen/PIC.hs
parentaf6746fb6b5adb5ba5be6e0f647c4ebe767ce084 (diff)
downloadhaskell-67029f200c5512f8ba5b9b7c25a5d1131422ef8e.tar.gz
PPC: Fix loads of PIC data with > 16 bit offsets (#7830).
Loads should now handle up to 32 bit offsets.
Diffstat (limited to 'compiler/nativeGen/PIC.hs')
-rw-r--r--compiler/nativeGen/PIC.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/nativeGen/PIC.hs b/compiler/nativeGen/PIC.hs
index f988bf73c7..9b5c080b5b 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)