Fri, 28 Jul 2000 08:23:52 -0700, Simon Marlow <[EMAIL PROTECTED]> pisze:

> It perhaps should be, but Int8 isn't a primitive type: it's implemented in
> terms of Int#.  There should really be 8-bit, 16-bit and 32-bit primitive
> types in GHC

It's not a problem: writeInt8OffAddr could take Int#. I think that
the overhead of an allocated object makes the exact representation
of Int8 irrelevant. What matters is the ability to pack them tightly
in arrays, or index pointers by multiplies of 8/16/32/64 bits -
for talking with C.

I have read Intel docs about IA-64. Almost everything is being computed
on 64 bits, smaller sizes are only in memory. Maybe having only Int#,
Word#, plus on a 32-bit arch also Int64#, Word64#, would be easier.
It does not require a lot of arithmetic, relational and conversion
primops for example. NCG would be easier for a single size of integers;
it does not handle {Int,Word}64# yet.

But maybe they should be true types. If so, Int and Word module could
be more regular - maybe even producing versions for varying sizes
from a single template. It's more correct but requires more work.

Anyway, I will need 32-bit array indexing for PackedString containing
characters outside '\1'..'\xFF'. {Int,Word}{8,16,32,64} will be more
often used in practice in mirrors of C types. IMHO pointer indexing
of these types should definitely be integrated into the RTS, but I
have no opinion about types themselves. I can try to do that myself
in any of the two ways, except the NCG.

-- 
 __("<  Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
 \__/            GCS/M d- s+:-- a23 C+++$ UL++>++++$ P+++ L++>++++$ E-
  ^^                W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP+ t
QRCZAK                5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-


Reply via email to