summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/PositionIndependentCode.hs
diff options
context:
space:
mode:
authordias@eecs.harvard.edu <unknown>2008-08-14 12:40:27 +0000
committerdias@eecs.harvard.edu <unknown>2008-08-14 12:40:27 +0000
commit176fa33f17dd78355cc572e006d2ab26898e2c69 (patch)
tree54f951a515eac57626f8f15d57f7bc75f1096a7a /compiler/nativeGen/PositionIndependentCode.hs
parente06951a75a1f519e8f015880c363a8dedc08ff9c (diff)
downloadhaskell-176fa33f17dd78355cc572e006d2ab26898e2c69.tar.gz
Merging in the new codegen branch
This merge does not turn on the new codegen (which only compiles a select few programs at this point), but it does introduce some changes to the old code generator. The high bits: 1. The Rep Swamp patch is finally here. The highlight is that the representation of types at the machine level has changed. Consequently, this patch contains updates across several back ends. 2. The new Stg -> Cmm path is here, although it appears to have a fair number of bugs lurking. 3. Many improvements along the CmmCPSZ path, including: o stack layout o some code for infotables, half of which is right and half wrong o proc-point splitting
Diffstat (limited to 'compiler/nativeGen/PositionIndependentCode.hs')
-rw-r--r--compiler/nativeGen/PositionIndependentCode.hs17
1 files changed, 8 insertions, 9 deletions
diff --git a/compiler/nativeGen/PositionIndependentCode.hs b/compiler/nativeGen/PositionIndependentCode.hs
index 0473d91da2..edb884677f 100644
--- a/compiler/nativeGen/PositionIndependentCode.hs
+++ b/compiler/nativeGen/PositionIndependentCode.hs
@@ -56,7 +56,6 @@ module PositionIndependentCode (
#include "nativeGen/NCG.h"
import Cmm
-import MachOp ( MachOp(MO_Add), wordRep, MachRep(..) )
import CLabel ( CLabel, pprCLabel,
mkDynamicLinkerLabel, DynamicLinkerLabelInfo(..),
dynamicLinkerLabelInfo, mkPicBaseLabel,
@@ -118,7 +117,7 @@ cmmMakeDynamicReference dflags addImport referenceKind lbl
AccessViaSymbolPtr -> do
let symbolPtr = mkDynamicLinkerLabel SymbolPtr lbl
addImport symbolPtr
- return $ CmmLoad (cmmMakePicReference symbolPtr) wordRep
+ return $ CmmLoad (cmmMakePicReference symbolPtr) bWord
AccessDirectly -> case referenceKind of
-- for data, we might have to make some calculations:
DataReference -> return $ cmmMakePicReference lbl
@@ -142,7 +141,7 @@ cmmMakePicReference :: CLabel -> CmmExpr
-- everything gets relocated at runtime
cmmMakePicReference lbl
- | (opt_PIC || not opt_Static) && absoluteLabel lbl = CmmMachOp (MO_Add wordRep) [
+ | (opt_PIC || not opt_Static) && absoluteLabel lbl = CmmMachOp (MO_Add wordWidth) [
CmmReg (CmmGlobal PicBaseReg),
CmmLit $ picRelative lbl
]
@@ -552,12 +551,12 @@ pprImportedSymbol importedLbl
ptext symbolSize <+> pprCLabel_asm lbl
]
--- PLT code stubs are generated automatically be the dynamic linker.
+-- PLT code stubs are generated automatically by the dynamic linker.
| otherwise = empty
where
- symbolSize = case wordRep of
- I32 -> sLit "\t.long"
- I64 -> sLit "\t.quad"
+ symbolSize = case wordWidth of
+ W32 -> sLit "\t.long"
+ W64 -> sLit "\t.quad"
_ -> panic "Unknown wordRep in pprImportedSymbol"
#else
@@ -616,7 +615,7 @@ initializePicBase picReg
(CmmProc info lab params (ListGraph blocks) : statics)
= do
gotOffLabel <- getNewLabelNat
- tmp <- getNewRegNat wordRep
+ tmp <- getNewRegNat $ intSize wordWidth
let
gotOffset = CmmData Text [
CmmDataLabel gotOffLabel,
@@ -628,7 +627,7 @@ initializePicBase picReg
(ImmCLbl mkPicBaseLabel)
BasicBlock bID insns = head blocks
b' = BasicBlock bID (FETCHPC picReg
- : LD wordRep tmp
+ : LD wordSize tmp
(AddrRegImm picReg offsetToOffset)
: ADD picReg picReg (RIReg tmp)
: insns)