|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] code question?
Jerone Young wrote:
Seems more likely to have been intended as:
#define hypercall_preempt_check() (unlikely( \
softirq_pending(smp_processor_id()) || \
(current->vcpu_info->evtchn_upcall_pending && \
!current->vcpu_info->evtchn_upcall_mask) \
))
Keir wrote:
> Forming compound predicates for bitwise operators can be faster than using the
> logical operators because they are non 'short circuiting'. This means you end
> up with fewer branches in the generated code and end up with nice
straight-line
> code that should execute fast.
If that's true on a given platform, the compiler can optimize it. Note that
in this case "(current->vcpu_info->evtchn_upcall_pending &&
!current->vcpu_info->evtchn_upcall_mask)" has no side effects (unless current
or current->vcpu_info are not valid pointers, which is undefined behaviour so
still optimizable).
--
David Hopwood <david.nospam.hopwood@xxxxxxxxxxxxxxxx>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |