Path: utzoo!mnetor!uunet!husc6!hao!noao!mcdsun!fnf From: fnf@mcdsun.UUCP (Fred Fish) Newsgroups: comp.arch Subject: Re: taken -vs- untaken branches Message-ID: <637@mcdsun.UUCP> Date: 11 Jan 88 18:22:11 GMT References: <496@cresswell.quintus.UUCP> <638@l.cc.purdue.edu> <20339@amdahl.amdahl.com> <588@PT.CS.CMU.EDU> Reply-To: fnf@mcdsun.UUCP (Fred Fish) Organization: Motorola Microcomputer Division Lines: 31 In article <588@PT.CS.CMU.EDU> lindsay@K.GP.CS.CMU.EDU (Donald Lindsay) writes: >In article <20339@amdahl.amdahl.com> chuck@amdahl.amdahl.com (Charles Simmons) writes: >>One method of allowing a compiler to automagically guess whether >>a branch will usually be taken or not, would be ... > >The best heuristics use high-level context. For example, a loop construct >is liable go around again. An IF-part is more likely to be executed than an >ELSE part. I'm not so sure about the above generalization, it probably has a lot to do with individual style. For example, I almost always tend to write code with the following if(){}else{} style: if () { } else { . . . } Thus the above generalization would be almost always 100% wrong for my style, unless lots of unexpected things happened to me... -Fred -- # Fred Fish hao!noao!mcdsun!fnf (602) 438-3614 # Motorola Computer Division, 2900 S. Diablo Way, Tempe, Az 85282 USA