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

  1. Path: sparky!uunet!know!mips2!news.bbn.com!usc!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!lanl!cochiti.lanl.gov!jlg
  2. From: jlg@cochiti.lanl.gov (J. Giles)
  3. Newsgroups: comp.lang.misc
  4. Subject: Re: languages which allow the introduction of new operators
  5. Message-ID: <1992Nov18.224354.27492@newshost.lanl.gov>
  6. Date: 18 Nov 92 22:43:54 GMT
  7. References: <BxMCxA.3nM@mentor.cc.purdue.edu> <1992Nov15.032459.3069@udel.edu> <Bxr9vx.KBD@mentor.cc.purdue.edu> <1992Nov18.154754.1848@udel.edu>
  8. Sender: news@newshost.lanl.gov
  9. Organization: Los Alamos National Laboratory
  10. Lines: 44
  11.  
  12. In article <1992Nov18.154754.1848@udel.edu>, carroll@dori.cis.udel.edu (Mark C. Carroll) writes:
  13. |> [...]
  14. |> Optimization is a _very_ difficult business. Any optimization has
  15. |> interactions with other optimizations, in terribly complex (and not
  16. |> necessarily well-understood) ways. Making any change to the
  17. |> optimization process can have broad affects on the entire process.
  18. |> [...]
  19.  
  20. Yes.  Consider, for example, the last three things done by the 
  21. compiler: 1) instruction selection; 2) register allocation; and
  22. 3) instruction scheduling.  On a CISC machine, this could be *very*
  23. difficult.  For example, a memory/memory instruction doesn't
  24. need any registers, but may alter the optimal instruction order,
  25. which alters the optimal register allocation, which may mean that
  26. you should now use a register/memory instruction instead.  Each
  27. of these three parts of compilation feed-back into the other two
  28. in compilicated ways.  (This is one of the reasons that CISC
  29. machines are harder to write compilers for than RISC machines
  30. are.)
  31.  
  32. |> Any optimization, particularly on modern architectures, has got to
  33. |> consider its affect on pipeline fills, branch predictions, register
  34. |> allocations, memory and cache uses, and dozens of other factors.  Do
  35. |> you think that you're qualified to judge what affect your two-cycle
  36. |> savings will have on the rest of your program? If so, you're in the
  37. |> wrong field - you should be designing compilers.
  38.  
  39. To be fair to Dr. Rubin, he wants to be able to specify information
  40. that the high-level language cannot directly represent.  In particular, 
  41. many high level languages don't have the capability to directly express 
  42. operations that modern machines can do.  In these instances, the machine's 
  43. assembly language is higher-level than the so-called high-level language 
  44. you're compiling from.  You need to be able to tell the compiler what to 
  45. do.  For example, on vector machines there are often vector merges based 
  46. on the vector mask - but C doesn't have a way to directly instruct that 
  47. a given integer be stored into (or read from) the vector mask!  Coding 
  48. around this in C would require that you rely on the compiler being able 
  49. to *infer* from some standard C construct that the vector mask is what 
  50. you're after.  Most compilers aren't up to it.  But, if you could just
  51. say: "use the vector mask", the code would, very likely, run much
  52. faster.
  53.  
  54. -- 
  55. J. Giles
  56.