On 14.07.2016 08:36, Denis Chertykov wrote:
2016-07-13 14:12 GMT+03:00 Georg-Johann Lay <a...@gjlay.de>:
This patch contains some unrelated tweaks
- Supplying no-ldregs variant for andqi3, iorqi3 where a const_int mask affects
only 1 bit
- Some patterns that match situations with zero_extend that can be performed
with less instructions / register pressure.
- comparing HI against -1
Ok for trunk?
Johann
gcc/
Minor tweaks for QImode.
* config/avr/predicates.md (const_m255_to_m1_operand): New.
* config/avr/constraints.md (Cn8, Ca1, Co1, Yx2): New constraints.
* config/avr/avr.md (add<mode>3) <ALL1>: Make "r,0,r" more
expensive.
(*cmphi.zero-extend.0, *cmphi.zero-extend.1)
(*usum_widenqihi3, *udiff_widenqihi3)
(*addhi3_zero_extend.const): New combiner insns.
(andqi3, iorqi3): Provide "l" (NO_LD_REGS) alternative if
just 1 bit is affected.
* config/avr/avr.c (avr_out_bitop) <QImode>: Don't access xop[3].
(avr_out_compare) [EQ,NE]: Tweak comparing d-regs against -1.
Please apply.
Also applied this addendum; not wrong code but to match the comments.
Johann
* config/avr/avr.c (avr_out_compare): Use const0_rtx instead of 0
when testing for compares against constants of the form 0xabab.
Index: config/avr/avr.c
===================================================================
--- config/avr/avr.c (revision 238878)
+++ config/avr/avr.c (revision 238879)
@@ -5357,7 +5357,7 @@ avr_out_compare (rtx_insn *insn, rtx *xo
the constant is of the form 0xabab. */
if (n_bytes == 2
- && xval != 0
+ && xval != const0_rtx
&& test_hard_reg_class (LD_REGS, xreg)
&& compare_eq_p (insn)
&& !reg_unused_after (insn, xreg))