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

  1. Xref: sparky comp.arch:10873 comp.lang.misc:3762
  2. Path: sparky!uunet!kithrup!stanford.edu!agate!biosci!uwm.edu!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!psinntp!psinntp!dg-rtp!sheol!throopw
  3. From: throopw@sheol.UUCP (Wayne Throop)
  4. Newsgroups: comp.arch,comp.lang.misc
  5. Subject: clean notation or speed: choose one
  6. Message-ID: <722061181@sheol.UUCP>
  7. Date: 18 Nov 92 01:44:06 GMT
  8. References: <TMB.92Nov13144057@arolla.idiap.ch> <1992Nov13.155126.3660@linus.mitre.org> <1992Nov13.200222.23955@sal.wisc.edu> <BxpnrA.Eqp@mentor.cc.purdue.edu>
  9. Lines: 47
  10.  
  11. : From: hrubin@mentor.cc.purdue.edu (Herman Rubin)
  12. : Message-ID: <BxpnrA.Eqp@mentor.cc.purdue.edu>
  13. : This is already clumsy, and difficult for a mathematician to read.  And it
  14. : fails to use mathematical syntax; in use, simple syntax is more important
  15. : than obscure semantics.  We prefer to write
  16. :       x = y - z       rather than       sub3(x, y, z)
  17.  
  18. That's all very well, but when you start to want to say
  19.  
  20.               h = (o^2 + a^2)^.5
  21.  
  22. or even just
  23.  
  24.               x = y - c*z
  25.  
  26. then issues arise of register allocation, instruction scheduling, type
  27. compabibility and/or conversions, peephole optimizations like
  28. substituting a square root routine for the ^.5 operation, 
  29. and so on and on.
  30.  
  31. NOW tell me... is "simple syntax" or "obscure semantics" more important
  32. to  you?  The two are simply not compatible.  Ultimately, you MUST tell
  33. the computer exactly what instructions to generate if you want to
  34. squeeze the last gasp of performance.  And you simply *can't* hide
  35. behind any simple notation when you do it, because that notation
  36. *doesn't* *contain* *enough* *information* about what machine
  37. operations you wish to generate.
  38.  
  39. On the other hand, I've seen assemblers that do use
  40.  
  41.               x = y - z
  42.  
  43. instead of
  44.  
  45.               sub3 x y z
  46.  
  47. And sure enough allowing infix operators and symbolic descriptions
  48. of what each instruction does is a trivial thing to provide if you
  49. want it.  But there's no escaping spelling out each instruction,
  50. each register use, each "committed slot" allocation *by hand* if
  51. you really want to squeeze the last drop of performance.
  52.  
  53. Herman's mixing of the goals of istream control and abstract notational
  54. convenience means that he can never be satisfied with *any* solution to
  55. his problem, because the problem has self-contradictory goals.
  56. --
  57. Wayne Throop  ...!mcnc!dg-rtp!sheol!throopw
  58.