home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / arch / 9003 < prev    next >
Encoding:
Text File  |  1992-08-21  |  2.6 KB  |  81 lines

  1. Newsgroups: comp.arch
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!sdd.hp.com!usc!rpi!scott.skidmore.edu!psinntp!psinntp!ficc!peter
  3. From: peter@ferranti.com (Peter da Silva)
  4. Subject: Re: 32 => 64 Transition
  5. Message-ID: <id.X1JS.KFC@ferranti.com>
  6. Organization: Xenix Support, FICC
  7. References: <1992Aug11.125326.16719@email.tuwien.ac.at> <id.UHAS.9TA@ferranti.com> <MARC.92Aug19170300@marc.watson.ibm.com>
  8. Date: Thu, 20 Aug 1992 18:18:40 GMT
  9. Lines: 70
  10.  
  11. In article <MARC.92Aug19170300@marc.watson.ibm.com> marc@watson.ibm.com (Marc Auslander) writes:
  12. > The intent of ANSI C appears to be that int is the "natural"
  13. > arithmetic of the machine.  This is reflected in the integer promotion
  14. > rules, which promote to int but NOT to long.
  15.  
  16. Well, is 64 bits the natural arithmetic of Alpha? The 68000 was a "32 bit"
  17. processor, but the best code was generated with 16 bit ints. In any case,
  18. making int larger than long is explicitly contrary to the standard.
  19.  
  20.     [long = int * int;]
  21.  
  22. > is defined to do its arithmetic in int, producing an int result, and
  23. > then convert to long at the assignment.  If i+j overflows (as int) the
  24. > results are undefined.
  25.  
  26. This is true, and is the way existing C compilers on non-vaxian systems
  27. behave. But [32 = 16 * 16] *is* the natural multiplication mode, and a
  28. good compiler will use a single 16-32 multiply here.
  29.  
  30. Personally, I think long should have been 64 bits all along, from the VAX
  31. on, to allow [64 = 32 * 32], the natural VAX multiply.
  32.  
  33. In any case:
  34.         PDP    68K    286    VAX    VAX+
  35.     char     8     8     8     8     8
  36.     short    16    16    16    16    16
  37.     int    16    16    16    32    32
  38.     long    32    32    32    32    64
  39.     char*    16    32    16/32    32    32
  40.  
  41. We have some people noting that long==32, and assuming that's the important
  42. non-variant, giving this sort of model:
  43.  
  44.         VAXist
  45.     char     8
  46.     short    16
  47.     int    64
  48.     long    32
  49.     char*    64
  50.  
  51. Another useful property is that all word sizes be available. This is what DEC
  52. seems to have chosen:
  53.  
  54.         Alpha
  55.     char     8
  56.     short    16
  57.     int    32
  58.     long    64
  59.     char*    64
  60.  
  61. So long as you don't want a single addressible object over 2 GB, this should
  62. create no problems.
  63.  
  64. I don't have the instruction set in front of me, but this would appear to
  65. imply a [64 = 32 * 32] instruction exists, but not a [128 = 64 * 64] one.
  66. If it did, then you'd want to do this:
  67.  
  68.         Beta
  69.     char     8
  70.     short    16 or 32
  71.     int    64
  72.     long    128
  73.     char*    64
  74.  
  75. But what size should short be?
  76. -- 
  77. Peter da Silva                                               `-_-'
  78. $ EDIT/TECO LOVE                                              'U` 
  79. %TECO-W-OLDJOKE Not war?                        Have you hugged your wolf today?
  80. Ferranti Intl. Ctls. Corp.      Sugar Land, TX  77487-5012       +1 713 274 5180
  81.