[project @ 2001-08-17 17:18:51 by apt]
authorapt <unknown>
Fri, 17 Aug 2001 17:18:54 +0000 (17:18 +0000)
committerapt <unknown>
Fri, 17 Aug 2001 17:18:54 +0000 (17:18 +0000)
commit1dfaee318171836b32f6b33a14231c69adfdef2f
tree5a130da45e21740751393ca2dc3bef8ab14db3a2
parentd30f8fc14ae1fb699a4b4d2e4bbb03fbc7f88d04
[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.
35 files changed:
ghc/compiler/Makefile
ghc/compiler/absCSyn/PprAbsC.lhs
ghc/compiler/basicTypes/Literal.lhs
ghc/compiler/basicTypes/OccName.lhs
ghc/compiler/codeGen/CgRetConv.lhs
ghc/compiler/coreSyn/ExternalCore.lhs
ghc/compiler/coreSyn/MkExternalCore.lhs
ghc/compiler/coreSyn/PprExternalCore.lhs
ghc/compiler/main/CmdLineOpts.lhs
ghc/compiler/main/DriverFlags.hs
ghc/compiler/main/DriverPipeline.hs
ghc/compiler/main/HscMain.lhs
ghc/compiler/nativeGen/MachCode.lhs
ghc/compiler/nativeGen/StixPrim.lhs
ghc/compiler/prelude/PrelNames.lhs
ghc/compiler/prelude/PrelRules.lhs
ghc/compiler/prelude/PrimOp.lhs
ghc/compiler/prelude/TysPrim.lhs
ghc/compiler/prelude/primops.txt [new file with mode: 0644]
ghc/compiler/prelude/primops.txt.pp
ghc/compiler/typecheck/TcForeign.lhs
ghc/includes/MachDeps.h
ghc/includes/PrimOps.h
ghc/lib/std/Makefile
ghc/lib/std/PrelBase.lhs
ghc/lib/std/PrelBits.lhs
ghc/lib/std/PrelEnum.lhs
ghc/lib/std/PrelGHC.hi-boot [new file with mode: 0644]
ghc/lib/std/PrelGHC.hi-boot.pp
ghc/lib/std/PrelInt.lhs
ghc/lib/std/PrelPtr.lhs
ghc/lib/std/PrelStorable.lhs
ghc/lib/std/PrelWord.lhs
ghc/tests/mk/boilerplate.mk
ghc/utils/genprimopcode/Main.hs