From d98b11f74546cee30484f1841da97bacb1085007 Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 21 Aug 2000 14:11:35 +0000 Subject: [PATCH] [project @ 2000-08-21 14:11:35 by simonmar] make this file independent of the actual word size. --- ghc/compiler/prelude/PrimRep.lhs | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/ghc/compiler/prelude/PrimRep.lhs b/ghc/compiler/prelude/PrimRep.lhs index 6c479d1..2a84114 100644 --- a/ghc/compiler/prelude/PrimRep.lhs +++ b/ghc/compiler/prelude/PrimRep.lhs @@ -25,8 +25,7 @@ module PrimRep #include "HsVersions.h" -import Constants ( dOUBLE_SIZE, iNT64_SIZE, wORD64_SIZE ) -import Util +import Constants ( dOUBLE_SIZE, iNT64_SIZE, wORD64_SIZE, wORD_SIZE ) import Outputable \end{code} @@ -175,7 +174,7 @@ getPrimRepSize other = 1 retPrimRepSize = getPrimRepSize RetRep --- size in bytes, ToDo: cpp in the right vals. +-- sizes in bytes. -- (used in some settings to figure out how many bytes -- we have to push onto the stack when calling external -- entry points (e.g., stdcalling on win32) @@ -184,19 +183,19 @@ getPrimRepSizeInBytes pr = case pr of CharRep -> 4 Int8Rep -> 1 - IntRep -> 4 - AddrRep -> 4 - FloatRep -> 4 - DoubleRep -> 8 - Word64Rep -> 8 - Int64Rep -> 8 - WeakPtrRep -> 4 - ForeignObjRep -> 4 - StablePtrRep -> 4 - StableNameRep -> 4 - ArrayRep -> 4 - ByteArrayRep -> 4 - _ -> panic "getPrimRepSize: ouch - this wasn't supposed to happen!" + IntRep -> wORD_SIZE + AddrRep -> wORD_SIZE + FloatRep -> wORD_SIZE + DoubleRep -> dOUBLE_SIZE * wORD_SIZE + Word64Rep -> wORD64_SIZE * wORD_SIZE + Int64Rep -> iNT64_SIZE * wORD_SIZE + WeakPtrRep -> wORD_SIZE + ForeignObjRep -> wORD_SIZE + StablePtrRep -> wORD_SIZE + StableNameRep -> wORD_SIZE + ArrayRep -> wORD_SIZE + ByteArrayRep -> wORD_SIZE + _ -> panic "getPrimRepSize: ouch - this wasn't supposed to happen!" \end{code} -- 1.7.10.4