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

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!biosci!agate!ames!sun-barr!news2me.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. Message-ID: <lgqbs2INNfh3@exodus.Eng.Sun.COM>
  6. Date: 20 Nov 92 18:33:38 GMT
  7. References: <1992Nov18.112407.2518@doug.cae.wisc.edu> <1992Nov18.191730.1044@meiko.com> <lgnojjINN627@exodus.Eng.Sun.COM> <1992Nov19.204729.24714@crl.dec.com>
  8. Organization: Sun Microsystems, Mt. View, Ca.
  9. Lines: 48
  10. NNTP-Posting-Host: flayout
  11.  
  12. In article <1992Nov19.204729.24714@crl.dec.com> payne@crl.dec.com (Andrew Payne) writes:
  13. >>The last sentence is key here. If branches can be predicted with decent
  14. >>accuracy then it is hard to obtain benefits from conditional moves
  15. >>over using conditional branches. 
  16. >
  17. >Do you have any data to back up this claim?
  18.  
  19. Sure do. If branches can be predicted with 100% accuracy then the
  20. version with conditional branches may run up to twice as fast. :-)
  21. Seriously, the silly example above should nonetheless show that if
  22. there are many instructions to guard, then potentially only half of the 
  23. functional units will accomplish useful work while running the code
  24. surrounded with conditional moves. 
  25.  
  26. As a previous poster mentioned, it would be nice to get some
  27. numbers on the impact of conditional moves on a superscalar processor
  28. with good branch prediction. Not on a 10 line function but on a large
  29. integer program (some of the SPECint92 programs).
  30.  
  31. >Don't forget that conditional move sequences can be shorter than the 
  32. >corresponding branch sequence.  In other words, the two instruction
  33. >sequence branch/op can sometimes be replaced with a single conditional move 
  34. >instruction.
  35.  
  36. True. I have seen some great little examples where conditional moves
  37. perform very well [e.g. if (a>b) then c=3 else c=5] or finding max (a,b).
  38. Notice that in most examples, either the guarded code is very small
  39. and/or the branches could not be predicted well.
  40.  
  41. >Second, I believe the second order effect of providing larger basic blocks
  42. >is the conditional move's greatest benefit.  Larger basic blocks offer
  43. >more scheduling opportunities.  I don't have any data (yet), but I've 
  44. >certainly seen it happen.
  45.  
  46. Since conditional moves won't replace all of the conditional branches,
  47. a good compiler will have to handle moving instructions across
  48. conditional branches anyway, otherwise performance will be low.
  49. Large basic blocks can be created through several methods
  50. (e.g.superblocks from Illinois) that basically group basic blocks together.
  51. Conditional moves will help wherever branches were hard to predict
  52. or where the trace did not show any definite direction for the branch
  53. (once again, hard to predict branches).
  54.  
  55. Finally, as you may know, SPARC V9 (64-bit) does include conditional moves
  56. and we do think that we can get some benefits out of them.
  57.  
  58. - Marc Tremblay.
  59. Sun Microsystems.
  60.