Description[arm64] Use CMN for cmp(a,sub(0,b)) only when checking equality/inequality.
We were previously incorrectly changing:
sub r0, 0, r1
cmp r2, r0
b.cond <addr>
to:
cmn r2, r1
b.cond <addr>
for all conditions. This is incorrect for conditions involving the C (carry)
and V (overflow) flags, and in particular in the case where r1 = INT_MIN.
The optimization is still safe to perform for Equal and NotEqual since they
do not depend on the C and V flags.
BUG=
Committed: https://crrev.com/fdb0f07887ef70fa8e5fbb077d75687eb4b0aebe
Cr-Commit-Position: refs/heads/master@{#39246}
Patch Set 1 #
Messages
Total messages: 8 (3 generated)
|