Hmm. It appears to be easy to do with machine-dependent builtins. E.g.
int x;
__asm__ __volatile__(LOCK "subl %1,%0"
: "=m"(v->counter) : "ir"(i) : "memory");
x = __builtin_ia32_sete();
if (x) {
...
}
Now, you'd have to be careful in where that __builtin_ia32_sete
gets placed, but I'd guess that immediately after an asm would
be relatively safe. No 100% guarantees on that, unfortunately.
And the sete _ought_ to get merged with the if test by combine
or cse with no extra code.
It wouldn't take too much effort to try this out either...
r~
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/