This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch,AVR]: Fix PR50447
- From: Denis Chertykov <chertykov at gmail dot com>
- To: Georg-Johann Lay <avr at gjlay dot de>
- Cc: gcc-patches at gcc dot gnu dot org, Eric Weddington <eric dot weddington at atmel dot com>, Anatoly Sokolov <aesok at post dot ru>
- Date: Fri, 23 Sep 2011 09:59:07 +0400
- Subject: Re: [Patch,AVR]: Fix PR50447
- References: <4E7B73A4.4060508@gjlay.de>
2011/9/22 Georg-Johann Lay <avr@gjlay.de>:
> This patch adds the PLUS part to fix the PR.
>
> addsi3 has a 8-bit scratch register now so that constants that are not covered
> by the constraints won't force a reload of the constant.
>
> The output routine tries adding the constant and subtracting the negated
> constant and then chooses the shortest sequence. ÂMoreover, if the lower bytes
> of the constant are zero, there is no need to add them.
>
> Besides that, the patch adds some add-and-zero-extend patterns.
>
> Passed without regressions.
Why you removed immediate operand from subsi3:
(define_insn "subsi3"
- [(set (match_operand:SI 0 "register_operand" "=r,d")
- (minus:SI (match_operand:SI 1 "register_operand" "0,0")
- (match_operand:SI 2 "nonmemory_operand" "r,i")))]
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (minus:SI (match_operand:SI 1 "register_operand" "0")
+ (match_operand:SI 2 "register_operand" "r")))]
""
- "@
- sub %0,%2\;sbc %B0,%B2\;sbc %C0,%C2\;sbc %D0,%D2
- subi %A0,lo8(%2)\;sbci %B0,hi8(%2)\;sbci %C0,hlo8(%2)\;sbci %D0,hhi8(%2)"
- [(set_attr "length" "4,4")
- (set_attr "cc" "set_czn,set_czn")])
+ "sub %0,%2\;sbc %B0,%B2\;sbc %C0,%C2\;sbc %D0,%D2"
+ [(set_attr "length" "4")
+ (set_attr "cc" "set_czn")])
Denis.