This patch generates cmn instruction when comparing a short int with minus
ldrh w8, [x0]
orr w9, wzr, #0xffff
cmp w8, w9
to
ldrsh w8, [x0]
cmn w8, #1
This patch fixes the issue by signed extending the operand.The performance test shows there are some improvements:
spec.cpu2000.ref.253_perlbmk -2.15%,
spec.cpu2006.ref.482_sphinx3 -1.59%.
As to why this patch just deals with short int, please look at the comments in the patch.
Please have a look.
David
int16_t would be better here.