From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Earnshaw To: fche@redhat.com (Frank Ch. Eigler) Cc: Richard.Earnshaw@arm.com, DJ Delorie , gdb-patches@sources.redhat.com Subject: Re: [patch] add trace capabilities to arm sim Date: Tue, 27 Feb 2001 06:26:00 -0000 Message-id: <200102271425.OAA17433@cam-mail2.cambridge.arm.com> References: X-SW-Source: 2001-02/msg00478.html > > Richard Earnshaw writes: > > : I haven't seen anyone else comment on this, so I'll stick my nose in ;-) > : I can't approve or reject this patch, but: > > Thanks - your input is always appreciated. > > > : [...] > : > if (state->Exception) > : > { /* Any exceptions */ > : > : and then bump state->Exception (which behaves pretty much like a semaphore > : count on the number of extra things to go look at) when tracing needs to > : run. > > An interesting technique! Have you tried using gcc's __builtin_expect > function to provide branch (un)likelihood hints to the compiler, > instead of this method? Well, it would have a marginal benefit on those hosts that support branch prediction, but you would still need to do each check. As long as we don't get to the point where state->Exception is more often true than false, it is still a benefit to wrap them all up into a single pre-check. R.