If we have the following instructions
add w0, w0, w1
cmp w0, #0
cset w0, gt
we would like to use the adds instruction so that the flags are set during the adds and we don't need a separate cmp instruction.
The issue is that without changing the cset suffix we will get an incorrect results if the add results in an overflow. We would need to check that the result is positive and not zero.
See these 2 comments:
#121380 (comment)
#121380 (comment)
This should also be done for subs and negs.