On 10 March 2012 03:44, Rusty Russell <rusty at rustcorp.com.au> wrote: > +/* extern bool kvm_cond_match(u32 flags, u32 cond); */ > +ENTRY(kvm_cond_match) > +.arm > + ? ? ? /* First, set our condition flags to the arg. */ > + ? ? ? mrs ? ? r2, cpsr > + ? ? ? and ? ? r2, r2, #0x07FFFFFF > + ? ? ? orr ? ? r2, r2, r0 > + ? ? ? msr ? ? cpsr, r2 > + > + ? ? ? /* Now, jump to table depending on cond, return via there. */ > + ? ? ? mov ? ? r0, #0 > + ? ? ? add ? ? r2, r0, r1, LSL #3 > + ? ? ? sub ? ? r2, #4 > + ? ? ? add ? ? pc, r2 So is this better or worse than the way nwfpe does a condition check? http://lxr.linux.no/#linux+v3.2.9/arch/arm/nwfpe/fpopcode.c#L64 I think I prefer the pure-C implementation myself. -- PMM