This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch] add trace capabilities to arm sim
- To: fche at redhat dot com (Frank Ch. Eigler)
- Subject: Re: [patch] add trace capabilities to arm sim
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Tue, 27 Feb 2001 14:25:40 +0000
- cc: Richard dot Earnshaw at arm dot com, DJ Delorie <dj at redhat dot com>, gdb-patches at sources dot redhat dot com
- Organization: ARM Ltd.
- Reply-To: Richard dot Earnshaw at arm dot com
>
> Richard Earnshaw <rearnsha@arm.com> 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.