Hi Richard, > Yeah, somewhat. But won't we go on to test has_lse2 anyway, due to: > > # elif defined (LSE2_LRCPC3_ATOP) > # define IFUNC_NCOND(N) 2 > # define IFUNC_COND_1 (has_rcpc3 (hwcap, features)) > # define IFUNC_COND_2 (has_lse2 (hwcap, features)) > > If we want to reduce the number of registers reads, it feels like we > should be able to rework the infrastructure so that a single function > returns 0 for !lse2, 2 for lse2 and 1 for rcpc3 (or swap the numbering, > since 1 should no longer need to be the highest priority with that change).
But then you'd get 2 calls of the more complex function unless you cache the result. If we had a better interface that required us to return the number of the ifunc to select it would be easier indeed. However overall it is much better to always inline atomics rather than calling libatomic (far less overhead and complexity). So that's what I am looking into. Cheers, Wilco