home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.arch
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!sdd.hp.com!usc!rpi!scott.skidmore.edu!psinntp!psinntp!ficc!peter
- From: peter@ferranti.com (Peter da Silva)
- Subject: Re: 32 => 64 Transition
- Message-ID: <id.X1JS.KFC@ferranti.com>
- Organization: Xenix Support, FICC
- References: <1992Aug11.125326.16719@email.tuwien.ac.at> <id.UHAS.9TA@ferranti.com> <MARC.92Aug19170300@marc.watson.ibm.com>
- Date: Thu, 20 Aug 1992 18:18:40 GMT
- Lines: 70
-
- In article <MARC.92Aug19170300@marc.watson.ibm.com> marc@watson.ibm.com (Marc Auslander) writes:
- > The intent of ANSI C appears to be that int is the "natural"
- > arithmetic of the machine. This is reflected in the integer promotion
- > rules, which promote to int but NOT to long.
-
- Well, is 64 bits the natural arithmetic of Alpha? The 68000 was a "32 bit"
- processor, but the best code was generated with 16 bit ints. In any case,
- making int larger than long is explicitly contrary to the standard.
-
- [long = int * int;]
-
- > is defined to do its arithmetic in int, producing an int result, and
- > then convert to long at the assignment. If i+j overflows (as int) the
- > results are undefined.
-
- This is true, and is the way existing C compilers on non-vaxian systems
- behave. But [32 = 16 * 16] *is* the natural multiplication mode, and a
- good compiler will use a single 16-32 multiply here.
-
- Personally, I think long should have been 64 bits all along, from the VAX
- on, to allow [64 = 32 * 32], the natural VAX multiply.
-
- In any case:
- PDP 68K 286 VAX VAX+
- char 8 8 8 8 8
- short 16 16 16 16 16
- int 16 16 16 32 32
- long 32 32 32 32 64
- char* 16 32 16/32 32 32
-
- We have some people noting that long==32, and assuming that's the important
- non-variant, giving this sort of model:
-
- VAXist
- char 8
- short 16
- int 64
- long 32
- char* 64
-
- Another useful property is that all word sizes be available. This is what DEC
- seems to have chosen:
-
- Alpha
- char 8
- short 16
- int 32
- long 64
- char* 64
-
- So long as you don't want a single addressible object over 2 GB, this should
- create no problems.
-
- I don't have the instruction set in front of me, but this would appear to
- imply a [64 = 32 * 32] instruction exists, but not a [128 = 64 * 64] one.
- If it did, then you'd want to do this:
-
- Beta
- char 8
- short 16 or 32
- int 64
- long 128
- char* 64
-
- But what size should short be?
- --
- Peter da Silva `-_-'
- $ EDIT/TECO LOVE 'U`
- %TECO-W-OLDJOKE Not war? Have you hugged your wolf today?
- Ferranti Intl. Ctls. Corp. Sugar Land, TX 77487-5012 +1 713 274 5180
-