2011/9/23 Georg-Johann Lay <a...@gjlay.de>: > This is the compare part to fix PR50447. > > Just like the preceding changes to fix PR50447 it's a micro-optimization to > smarter print-out of instructions. > > The patch covers comparisons against HI and SI integers. > > The byte-wide comparison allows reusing the value in the scratch register and > individual treatment of zero. Moreover, ADIW can be used in some rare > situations. > > And there is a bit of code clean-up. > > Tested without regressions. > > Ok to commit? > > Johann > > PR target/50447 > * config/avr/avr.md (adjust_len): Add alternatives "tsthi", > "tstsi", "compare". > (*cmpqi_sign_extend): Use s8_operand. > (*cmphi, *cmpsi): Rewrite using avr_out_compare. > * config/avr/avr-protos.h (compare_diff_p, compare_eq_p): Remove > prototypes. > (out_tsthi, out_tstsi): Remove prototypes. > (avr_out_tsthi, avr_out_tstsi): New prototypes. > * config/avr/avr.c (out_tsthi, out_tstsi): Remove functions. > (avr_asm_len): Negative length now sets *plen to -length. > (compare_sign_p): Return bool instead of int. > (compare_diff_p, compare_eq_p): Ditto and make static. > (avr_out_tsthi): New function. > (avr_out_tstsi): New function. > (avr_out_compare): New function. > (adjust_insn_length): Handle ADJUST_LEN_TSTHI, ADJUST_LEN_TSTSI, > ADJUST_LEN_COMPARE. >
Please commit it with previous patch. Denis.