unsigned add_v5(unsigned x, unsigned y) {
if (x == y) return 2 * x;
return x + y;
}
Results in: add_v5(unsigned int, unsigned int):
lsl w8, w0, #1
add w9, w1, w0
cmp w0, w1
csel w0, w8, w9, eq
ret
(armv8-a clang 21.1.0 with O3)
I wouldn't consider this "a few buttons", it's enough to turn off the less savvy users