-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Description
This example has multiple uses on the AND:
int and(int num) {
num = num & 0xff;
if (num > 1)
return call(num)+1;
return 0;
}
and becomes
and w0, w0, #0xff
cmp w0, #2
b.lo .LBB1_2
If this example used a tst it could start a cycle earlier, not having to wait for the result of the and, like in
int tst(int num) {
num = num & 0xff;
if (num > 1)
return call(0)+1;
return 0;
}
which becomes
tst w0, #0xfe
b.eq .LBB0_2