home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / arch / 10958 < prev    next >
Encoding:
Internet Message Format  |  1992-11-19  |  3.4 KB

  1. Xref: sparky comp.arch:10958 comp.lang.misc:3812
  2. Newsgroups: comp.arch,comp.lang.misc
  3. Path: sparky!uunet!spool.mu.edu!news.nd.edu!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubin
  4. From: hrubin@pop.stat.purdue.edu (Herman Rubin)
  5. Subject: Re: how to advocate new software/hardware features (Re: Hardware Support for Numeric Algorithms)
  6. Message-ID: <By0oBF.94H@mentor.cc.purdue.edu>
  7. Sender: news@mentor.cc.purdue.edu (USENET News)
  8. Organization: Purdue University Statistics Department
  9. References: <id.HJ1V.BTG@ferranti.com> <1992Nov19.034325.3864@technix.mn.org> <PRENER.92Nov20014621@prener.watson.ibm.com>
  10. Date: Fri, 20 Nov 1992 13:33:15 GMT
  11. Lines: 52
  12.  
  13. In article <PRENER.92Nov20014621@prener.watson.ibm.com> prener@watson.ibm.com (Dan Prener) writes:
  14. >In article <1992Nov19.034325.3864@technix.mn.org> bret@technix.mn.org (Bret Indrelee) writes:
  15.  
  16. >>    In article <id.HJ1V.BTG@ferranti.com> peter@ferranti.com (peter da silva) writes:
  17. >>    >In article <BxtA6v.CE8@mentor.cc.purdue.edu> hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
  18. >>    >> But it is.  The operations often use register arguments and the results
  19. >>    >> are wanted in registers.
  20.  
  21. >>    >What's a register? Most modern compilers ignore "register", or use it as a
  22. >>    >hint "this is a frequently used value".
  23.  
  24. >>    >And how is an inline library part of the language more than a subroutine
  25. >>    >or an include file?
  26.  
  27.             ............................
  28.  
  29. >Which leads to the optimization issue.  Compilers don't have to be
  30. >completely pessimistic about what might be changed by pointer references.
  31. >With a suitable definition of what it means for a variable to have its
  32. >address taken, pointer references can only change those variables that
  33. >have had their addresses taken.
  34.  
  35. >So, while it is true that register variables may lead to better optimization,
  36. >that is because they never have their addresses taken.  So, with a compiler
  37. >that keeps track of which variables have their addresses taken, the
  38. >performance improvements resulting from the use of register variables remain,
  39. >even after you delete the "register" declaration.
  40.  
  41. On most machines, one can do little with objects not in registers other than
  42. read them, either placing the results in registers, or using the results as
  43. instructions.  This means that it something is not in a register, using it
  44. means first reading it.  If it is not kept in a register but stored, this
  45. applies to using it again.  Some machines even restrict register movement;
  46. memory access is unlikely to ever compete favorably with computation again.
  47.  
  48. If hardware/software designers and compiler writers would take the position
  49. that load/store generally means waste unless the stuff being loaded/stored
  50. is large, we may not have too much of a problem.  But there is one problem
  51. with registers; I know of no current machines on which much use can be made
  52. of the ordering of registers.  There have been a few machines on which 
  53. registers WERE addressable, and this has considerable advantages.  
  54.  
  55. Some of the posters have suggested having a struct as a return when multiple
  56. returns are wanted.  This is quite difficult to manage in a register file,
  57. precisely because of the non-addressability.  It would even be a problem if
  58. registers were addressible, because the locations wanted are unlikely to be
  59. in a "struct" format.
  60. -- 
  61. Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
  62. Phone: (317)494-6054
  63. hrubin@snap.stat.purdue.edu (Internet, bitnet)  
  64. {purdue,pur-ee}!snap.stat!hrubin(UUCP)
  65.