home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / sgi / 12349 < prev    next >
Encoding:
Internet Message Format  |  1992-08-13  |  4.7 KB

  1. Path: sparky!uunet!caen!sdd.hp.com!mips!mash
  2. From: mash@mips.com (John Mashey)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Re: R4000 compiler directive, is there one ???
  5. Date: 13 Aug 1992 16:39:05 GMT
  6. Organization: MIPS Computer Systems, Inc.
  7. Lines: 80
  8. Message-ID: <l8l419INNj3e@spim.mips.com>
  9. References: <ob1oc18@zuni.esd.sgi.com> <1992Aug12.195518.12380@megatek.uucp> <ogn3in4@zuni.esd.sgi.com>
  10. NNTP-Posting-Host: winchester.mips.com
  11.  
  12. In article <ogn3in4@zuni.esd.sgi.com> olson@anchor.esd.sgi.com (Dave Olson) writes:
  13. >| I seem to remember seeing in some version or other of the compiler
  14. >| (sorry, I don't know if it was beta, release, or what) that there
  15. >| was a switch -r4000. The switch had no effect on the output code,
  16. >| but was used by the instruction scheduler in the assembler.
  17. >| To check to see if you have it (other then just trying it) you can
  18. >| do a strings /usr/bin/cc|grep 4000 and see what shows up.
  19.  
  20. >It is passed on to the assembler untouched, and the comments there
  21. >lead me to believe your recollection about instruction scheduling
  22. >is correct, but I don't know enough about compilers to know what
  23. >exactly (if anything!) it is doing.
  24.  
  25. As I noted earlier, the compilersthemselves typically know little or
  26. nothing about the specific chip type they are using, and they generate
  27. some pseudo-ops to the assembler, which then converts them to the best code
  28. for the specific chip if requested.  Anyway, there are 2 orthogonal issues,
  29. neither of which matters much to people producing code to run on every
  30. machine, as they should avoid these features.  people seeking max performance
  31. on a specific machine, or else doing kernel work, shared library work where
  32. the code can be tuned, have some interest in this.
  33.  
  34. -mips2 says that the assembler should use the -mips2 instructions, such
  35. as load/store double floating, square root, branch-likely, etc.
  36. These instructions are supported by R4000s *and* R6000s.
  37. If any such instructions are used, the resulting code will not generally
  38. run on R3000s.  (I say, not generally, because occasionally, there are
  39. binaries that see which CPU they are on, and do the right thing. For example
  40. a sqrt function can dynamically decide to use the old code or else
  41. just use the sqrt instruction.)
  42.  
  43. A flag (like -r4000) that specifies the chip does *not* select -r4000-specific
  44. instructions, but simply says to tune the scheduling of instructions
  45. for best code on an r4000.  Quite often, there are minor differences in
  46. latencies, repeat rates, etc, especially in floating point, where
  47. the scheduler can do better.  Unless I've missed something, such
  48. code, for example, would work fine on an R6000 as well.
  49.  
  50. In a related topic, -mips3, whenever it becomes available, will only run on
  51. R4000s and later chips (R4000A, R5000, TFP, VRX, T5) as it uses the
  52. 64-bit model.  Note that there are indeed some algorithms (as Dave Olson
  53. mentioned) whose performance is improved by 64-bit integers; in particular,
  54. anything dominated by logical operations on long bit vectors, multiprecision
  55. integer multiplies and divides, etc,  will be improved.
  56.  
  57. (September 1991 BYTE has an article I wrote on this whole topic, rather
  58. than repeat it here).
  59.  
  60. Programs that are perfectly happy in 32-bit mode, when recompiled into
  61. 64-bit mode without change, will more often get slower than faster....
  62. because:
  63.     1) Some 32-bit multiplies/divides turn into 64-bit ones (slower).
  64.     2) There's more pressure on the data cache, as pointers, longs,
  65.     and register save/restores use more space.  this won't bother some
  66.     programs at all, others will have highe data cache miss rates.
  67.  
  68. Of course, the compelling reason for this technology is that some programs
  69. are *not* happy with 32-bits.  In particular:
  70.     1) Some ECAD chip simulations are pressing on our existing 2GB
  71.     limit, and will rapidly go >4GB virtual in the next few years.
  72.     (One phase of R4000 simulation takes 1.5GB ... for 1.3M transistors.
  73.     Want to guess what a 6M transistor chip might take?  Want to guess
  74.     how much fun it is to try to split these things up?  People talk about
  75.     the huge new chips that the industry is going to build....  but only
  76.     if they can be properly simulated first...)
  77.     2) DBMS
  78.     3) MCAD
  79.     4) G.I.S.
  80.     5) Scientific codes
  81.     6) Some financial modeling
  82.  
  83. It is guaranteed that the same day people get -mips3, there will be
  84. FORTRAN programs whose array sizes get drastically expanded, yielding
  85. 8GB of virtual memory-sized programs ... and trouble reports that
  86. these seem to page a bit on their Indigos, and why are they slow?  :-)
  87. -- 
  88. -john mashey    DISCLAIMER: <generic disclaimer, I speak for me only, etc>
  89. UUCP:      mash@mips.com [soon to be mash@sgi.com, but not quite moved yet].
  90. DDD:      408-524-7015,  or 524-8253
  91. USPS:    (soon) Silicon Graphics, 2011 N. Shoreline Blvd, Mountain View, CA 94043
  92.