[ad_1]
x |= -(x == 0);x |= -!x;x = x ? x : 0xFFFFFFFF;if (x == 0)
x = 0xFFFFFFFF;…
Benchmark and choose what’s appropriate for you
4
[ad_2]
solved Bithack for: if x is 0, then x should be -1, else x should be untouched
[ad_1]
x |= -(x == 0);x |= -!x;x = x ? x : 0xFFFFFFFF;if (x == 0)
x = 0xFFFFFFFF;
…
Benchmark and choose what’s appropriate for you
4
[ad_2]
solved Bithack for: if x is 0, then x should be -1, else x should be untouched