Path: utzoo!attcan!uunet!cbmvax!jesup From: jesup@cbmvax.UUCP (Randell Jesup) Newsgroups: comp.arch Subject: Re: Branch Delay Annullment Message-ID: <4053@cbmvax.UUCP> Date: 17 Jun 88 21:06:37 GMT References: <22065@amdcad.AMD.COM> <12211@apple.Apple.COM> <27527@pyramid.pyramid.com> <12300@apple.Apple.COM> Reply-To: jesup@cbmvax.UUCP (Randell Jesup) Organization: Commodore Technology, West Chester, PA Lines: 22 In article <12300@apple.Apple.COM> baum@apple.UUCP (Allen Baum) writes: >Oops. Its been so long since I've looked at this that I forgot about a second >part of the argument. You're absolutely right that there is a lot of code of >the form: If (error-condition( {handle it}; and that this code is executed >infrequently. If this is the case, it would pay to have this code be executed >out of line; that is, you would like to branch to it, and then branch back >to the main line code. The most frequently executed code is then straight-line, >a real win in situtations where you benefit from bust mode i-fetches. I don't know about you, but I tend to write code that looks more like: if (!error) { ... } [else { ... }] Especially useful when doing resource allocations, like "if (!(ptr = (struct ptr *) malloc(xyzzy))) { use ptr } else { return error }". It comes down to both the type of application and the individual coding style (and of course language). Randell Jesup, Commodore Engineering {uunet|rutgers|ihnp4|allegra}!cbmvax!jesup