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

  1. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!west.West.Sun.COM!male.EBay.Sun.COM!exodus.Eng.Sun.COM!flayout.Eng.Sun.COM!tremblay
  2. From: tremblay@flayout.Eng.Sun.COM (Marc Tremblay)
  3. Newsgroups: comp.arch
  4. Subject: Re: DEC Alpha architecture issues
  5. Date: 23 Nov 1992 17:52:26 GMT
  6. Organization: Sun Microsystems, Mt. View, Ca.
  7. Lines: 50
  8. Message-ID: <lh26iqINN917@exodus.Eng.Sun.COM>
  9. References: <1992Nov18.112407.2518@doug.cae.wisc.edu> <1992Nov18.191730.1044@meiko.com> <lgnojjINN627@exodus.Eng.Sun.COM> <1992Nov19.204729.24714@crl.dec.com> <lgqbs2INNfh3@exodus.Eng.Sun.COM> <1992Nov23.122727.12708@odin.diku.dk>
  10. NNTP-Posting-Host: flayout
  11.  
  12. In article <1992Nov23.122727.12708@odin.diku.dk> torbenm@diku.dk (Torben AEgidius Mogensen) writes:
  13. >If you can predict conditional branches, surely you can predict
  14. >conditional moves and other conditional instructions as well, even
  15. >using much the same techniques. In general any technique that can be
  16. >used to optimize conditional branches can also be used to optimize
  17. >other conditional instructions, so I can't see that using conditional
  18. >instructions in general can ever be worse than using conditional
  19. >branches only. One can then discuss how to reduce the penalty of
  20. >having conditions only on branches.
  21.  
  22. Let me try to explain one more time what needs to be considered when
  23. conditional moves and conditional branches are evaluated.
  24.  
  25. Conditional moves allow the program counter to progress sequentially.
  26. Since the flow of instructions is unconditional (only the register file
  27. update and the bypasses attached to the conditional move are conditional),
  28. no repair is needed to correct the flow of instructions.
  29. Usually conditional moves are used to eliminate conditional branches
  30. that jump over a small piece of code. That is usually done by executing
  31. *both* pieces of code (the part associated with the taken branch and the
  32. one associated with the non-taken branch) simultaneously. By simultaneously
  33. I mean in the same basic block (could be simultaneously in time on a 
  34. superscalar processor).
  35.  
  36. That works well if the number of instructions that are "guarded" is small,
  37. since you may need to set up only one register, do a compare, and do a
  38. single conditional move. If the number of instructions to guard is large,
  39. then several instructions are needed to do the set up, several compares
  40. may be needed (unless all instructions can be based on the original compare)
  41. and several conditional moves are required. One can generalize and say
  42. that in the "conditional move mode", twice as many instructions are needed,
  43. reducing the throughput by one half. Clever tricks can be used, for example
  44. using logical operations to merge both streams into one stream, but that
  45. usually works only for small pieces of code. The throughput is not
  46. reduced by one half for these, but it would certainly be degraded
  47. significantly.
  48.  
  49. If conditional branches can be predicted accurately, then the break in the
  50. flow of instructions can be hidden through a smart pre-fetcher (no magic here).
  51. After the branch is executed, 100% of the hardware can be dedicated to
  52. execute the correct path (versus ~50% for conditional moves). With a
  53. smart processor front-end it would seem that it is always better to
  54. use conditional branches, except that the prediction is not always correct
  55. and a penalty of a few cycles is associated with the misprediction.
  56. That is why the accuracy of the prediction and the efficiency of the
  57. prefetcher is important when evaluating conditional moves vs.
  58. conditional branches.
  59.  
  60. - Marc Tremblay.
  61. Sun Microsystems.
  62.