summaryrefslogtreecommitdiff
path: root/ghc/lib/std/PrelGHC.hi-boot.pp
diff options
context:
space:
mode:
authorapt <unknown>2001-08-17 17:18:54 +0000
committerapt <unknown>2001-08-17 17:18:54 +0000
commit1dfaee318171836b32f6b33a14231c69adfdef2f (patch)
tree5a130da45e21740751393ca2dc3bef8ab14db3a2 /ghc/lib/std/PrelGHC.hi-boot.pp
parentd30f8fc14ae1fb699a4b4d2e4bbb03fbc7f88d04 (diff)
downloadhaskell-1dfaee318171836b32f6b33a14231c69adfdef2f.tar.gz
[project @ 2001-08-17 17:18:51 by apt]
How I spent my summer vacation. Primops ------- The format of the primops.txt.pp file has been enhanced to allow (latex-style) primop descriptions to be included. There is a new flag to genprimopcode that generates documentation including these descriptions. A first cut at descriptions of the more interesting primops has been made, and the file has been reordered a bit. 31-bit words ------------ The front end now can cope with the possibility of 31-bit (or even 30-bit) Int# and Word# types. The only current use of this is to generate external .core files that can be translated into OCAML source files (OCAML uses a one-bit tag to distinguish integers from pointers). The only way to get this right now is by hand-defining the preprocessor symbol WORD_SIZE_IN_BITS, which is normally set automatically from the familiar WORD_SIZE_IN_BYTES. Just in case 31-bit words are used, we now have Int32# and Word32# primitive types and an associated family of operators, paralleling the existing 64-bit stuff. Of course, none of the operators actually need to be implemented in the absence of a 31-bit backend. There has also been some minor re-jigging of the 32 vs. 64 bit stuff. See the description at the top of primops.txt.pp file for more details. Note that, for the first time, the *type* of a primop can now depend on the target word size. Also, the family of primops intToInt8#, intToInt16#, etc. have been renamed narrow8Int#, narrow16Int#, etc., to emphasize that they work on Int#'s and don't actually convert between types. Addresses --------- As another part of coping with the possibility of 31-bit ints, the addr2Int# and int2Addr# primops are now thoroughly deprecated (and not even defined in the 31-bit case) and all uses of them have been removed except from the (deprecated) module hslibs/lang/Addr Addr# should now be treated as a proper abstract type, and has these suitable operators: nullAddr# : Int# -> Addr# (ignores its argument; nullary primops cause problems at various places) plusAddr# : Addr# -> Int# -> Addr# minusAddr : Addr# -> Addr# -> Int# remAddr# : Addr# -> Int# -> Int# Obviously, these don't allow completely arbitrary offsets if 31-bit ints are in use, but they should do for all practical purposes. It is also still possible to generate an address constant, and there is a built-in rule that makes use of this to remove the nullAddr# calls. Misc ---- There is a new compile flag -fno-code that causes GHC to quit after generating .hi files and .core files (if requested) but before generating STG. Z-encoded names for tuples have been rationalized; e.g., Z3H now means an unboxed 3-tuple, rather than an unboxed tuple with 3 commas (i.e., a 4-tuple)! Removed misc. litlits in hslibs/lang Misc. small changes to external core format. The external core description has also been substantially updated, and incorporates the automatically-generated primop documentation; its in the repository at /papers/ext-core/core.tex. A little make-system addition to allow passing CPP options to compiler and library builds.
Diffstat (limited to 'ghc/lib/std/PrelGHC.hi-boot.pp')
-rw-r--r--ghc/lib/std/PrelGHC.hi-boot.pp70
1 files changed, 30 insertions, 40 deletions
diff --git a/ghc/lib/std/PrelGHC.hi-boot.pp b/ghc/lib/std/PrelGHC.hi-boot.pp
index 3dbacc3085..5880ec1a8c 100644
--- a/ghc/lib/std/PrelGHC.hi-boot.pp
+++ b/ghc/lib/std/PrelGHC.hi-boot.pp
@@ -5,8 +5,7 @@
-- primitive operations and types that GHC knows about.
---------------------------------------------------------------------------
-#include "config.h"
-#include "Derived.h"
+#include "MachDeps.h"
__interface "std" PrelGHC 1 0 where
@@ -116,25 +115,38 @@ __export PrelGHC
int2Wordzh
word2Intzh
+ narrow8Intzh
+ narrow16Intzh
+ narrow32Intzh
+ narrow8Wordzh
+ narrow16Wordzh
+ narrow32Wordzh
+
+#if WORD_SIZE_IN_BITS < 32
+ Int32zh
+ Word32zh
+#endif
+
+#if WORD_SIZE_IN_BITS < 64
Int64zh
Word64zh
-
- intToInt8zh
- intToInt16zh
- intToInt32zh
- wordToWord8zh
- wordToWord16zh
- wordToWord32zh
+#endif
Addrzh
+ nullAddrzh
+ plusAddrzh
+ minusAddrzh
+ remAddrzh
+#if (WORD_SIZE_IN_BITS == 32 || WORD_SIZE_IN_BITS == 64)
+ addr2Intzh
+ int2Addrzh
+#endif
gtAddrzh
geAddrzh
eqAddrzh
neAddrzh
ltAddrzh
leAddrzh
- int2Addrzh
- addr2Intzh
Floatzh
gtFloatzh
@@ -213,7 +225,13 @@ __export PrelGHC
integer2Wordzh
int2Integerzh
word2Integerzh
-#ifdef SUPPORT_LONG_LONGS
+#if WORD_SIZE_IN_BITS < 32
+ integerToInt32zh
+ integerToWord32zh
+ int32ToIntegerzh
+ word32ToIntegerzh
+#endif
+#if WORD_SIZE_IN_BITS < 64
integerToInt64zh
integerToWord64zh
int64ToIntegerzh
@@ -247,15 +265,11 @@ __export PrelGHC
indexInt8Arrayzh
indexInt16Arrayzh
indexInt32Arrayzh
-#ifdef SUPPORT_LONG_LONGS
indexInt64Arrayzh
-#endif
indexWord8Arrayzh
indexWord16Arrayzh
indexWord32Arrayzh
-#ifdef SUPPORT_LONG_LONGS
indexWord64Arrayzh
-#endif
readArrayzh
readCharArrayzh
@@ -269,15 +283,11 @@ __export PrelGHC
readInt8Arrayzh
readInt16Arrayzh
readInt32Arrayzh
-#ifdef SUPPORT_LONG_LONGS
readInt64Arrayzh
-#endif
readWord8Arrayzh
readWord16Arrayzh
readWord32Arrayzh
-#ifdef SUPPORT_LONG_LONGS
readWord64Arrayzh
-#endif
writeArrayzh
writeCharArrayzh
@@ -291,15 +301,11 @@ __export PrelGHC
writeInt8Arrayzh
writeInt16Arrayzh
writeInt32Arrayzh
-#ifdef SUPPORT_LONG_LONGS
writeInt64Arrayzh
-#endif
writeWord8Arrayzh
writeWord16Arrayzh
writeWord32Arrayzh
-#ifdef SUPPORT_LONG_LONGS
writeWord64Arrayzh
-#endif
indexCharOffAddrzh
indexWideCharOffAddrzh
@@ -312,15 +318,11 @@ __export PrelGHC
indexInt8OffAddrzh
indexInt16OffAddrzh
indexInt32OffAddrzh
-#ifdef SUPPORT_LONG_LONGS
indexInt64OffAddrzh
-#endif
indexWord8OffAddrzh
indexWord16OffAddrzh
indexWord32OffAddrzh
-#ifdef SUPPORT_LONG_LONGS
indexWord64OffAddrzh
-#endif
readCharOffAddrzh
readWideCharOffAddrzh
@@ -333,15 +335,11 @@ __export PrelGHC
readInt8OffAddrzh
readInt16OffAddrzh
readInt32OffAddrzh
-#ifdef SUPPORT_LONG_LONGS
readInt64OffAddrzh
-#endif
readWord8OffAddrzh
readWord16OffAddrzh
readWord32OffAddrzh
-#ifdef SUPPORT_LONG_LONGS
readWord64OffAddrzh
-#endif
writeCharOffAddrzh
writeWideCharOffAddrzh
@@ -355,15 +353,11 @@ __export PrelGHC
writeInt8OffAddrzh
writeInt16OffAddrzh
writeInt32OffAddrzh
-#ifdef SUPPORT_LONG_LONGS
writeInt64OffAddrzh
-#endif
writeWord8OffAddrzh
writeWord16OffAddrzh
writeWord32OffAddrzh
-#ifdef SUPPORT_LONG_LONGS
writeWord64OffAddrzh
-#endif
eqForeignObjzh
indexCharOffForeignObjzh
@@ -377,15 +371,11 @@ __export PrelGHC
indexInt8OffForeignObjzh
indexInt16OffForeignObjzh
indexInt32OffForeignObjzh
-#ifdef SUPPORT_LONG_LONGS
indexInt64OffForeignObjzh
-#endif
indexWord8OffForeignObjzh
indexWord16OffForeignObjzh
indexWord32OffForeignObjzh
-#ifdef SUPPORT_LONG_LONGS
indexWord64OffForeignObjzh
-#endif
unsafeFreezzeArrayzh -- Note zz in the middle
unsafeFreezzeByteArrayzh -- Ditto