summaryrefslogtreecommitdiff
path: root/compiler/codeGen/SMRep.lhs
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/codeGen/SMRep.lhs
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/codeGen/SMRep.lhs')
-rw-r--r--compiler/codeGen/SMRep.lhs33
1 files changed, 10 insertions, 23 deletions
diff --git a/compiler/codeGen/SMRep.lhs b/compiler/codeGen/SMRep.lhs
index 28d17079e5..987562c364 100644
--- a/compiler/codeGen/SMRep.lhs
+++ b/compiler/codeGen/SMRep.lhs
@@ -24,14 +24,15 @@ module SMRep (
-- Argument/return representations
CgRep(..), nonVoidArg,
- argMachRep, primRepToCgRep, primRepHint,
+ argMachRep, primRepToCgRep,
+-- Temp primRepHint, typeHint,
isFollowableArg, isVoidArg,
isFloatingArg, is64BitArg,
separateByPtrFollowness,
cgRepSizeW, cgRepSizeB,
retAddrSizeW,
- typeCgRep, idCgRep, tyConCgRep, typeHint,
+ typeCgRep, idCgRep, tyConCgRep,
-- Closure repesentation
SMRep(..), ClosureType(..),
@@ -45,10 +46,10 @@ module SMRep (
#include "../includes/MachDeps.h"
+import CmmExpr -- CmmType and friends
import Id
import Type
import TyCon
-import MachOp
import StaticFlags
import Constants
import Outputable
@@ -136,12 +137,12 @@ instance Outputable CgRep where
ppr FloatArg = ptext (sLit "F_")
ppr DoubleArg = ptext (sLit "D_")
-argMachRep :: CgRep -> MachRep
-argMachRep PtrArg = wordRep
-argMachRep NonPtrArg = wordRep
-argMachRep LongArg = I64
-argMachRep FloatArg = F32
-argMachRep DoubleArg = F64
+argMachRep :: CgRep -> CmmType
+argMachRep PtrArg = gcWord
+argMachRep NonPtrArg = bWord
+argMachRep LongArg = b64
+argMachRep FloatArg = f32
+argMachRep DoubleArg = f64
argMachRep VoidArg = panic "argMachRep:VoidRep"
primRepToCgRep :: PrimRep -> CgRep
@@ -155,17 +156,6 @@ primRepToCgRep AddrRep = NonPtrArg
primRepToCgRep FloatRep = FloatArg
primRepToCgRep DoubleRep = DoubleArg
-primRepHint :: PrimRep -> MachHint
-primRepHint VoidRep = panic "primRepHint:VoidRep"
-primRepHint PtrRep = PtrHint
-primRepHint IntRep = SignedHint
-primRepHint WordRep = NoHint
-primRepHint Int64Rep = SignedHint
-primRepHint Word64Rep = NoHint
-primRepHint AddrRep = PtrHint -- NB! PtrHint, but NonPtrArg
-primRepHint FloatRep = FloatHint
-primRepHint DoubleRep = FloatHint
-
idCgRep :: Id -> CgRep
idCgRep x = typeCgRep . idType $ x
@@ -174,9 +164,6 @@ tyConCgRep = primRepToCgRep . tyConPrimRep
typeCgRep :: Type -> CgRep
typeCgRep = primRepToCgRep . typePrimRep
-
-typeHint :: Type -> MachHint
-typeHint = primRepHint . typePrimRep
\end{code}
Whether or not the thing is a pointer that the garbage-collector