This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [patch] add trace capabilities to arm sim


> 
> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]