public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Georg-Johann Lay <avr@gjlay.de>
To: Denis Chertykov <chertykov@gmail.com>
Cc: Richard Henderson <rth@redhat.com>,
	gcc-patches@gcc.gnu.org,  Anatoly Sokolov <aesok@post.ru>,
	"Eric B. Weddington" <eric.weddington@atmel.com>
Subject: Re: [Patch, AVR]: Fix PR46779
Date: Mon, 27 Jun 2011 09:19:00 -0000	[thread overview]
Message-ID: <4E084291.4030300@gjlay.de> (raw)
In-Reply-To: <BANLkTim3q=v5dc-ja6bHjvzVAtAf-PVy0g@mail.gmail.com>

Denis Chertykov wrote:
> 2011/6/26 Georg-Johann Lay <avr@gjlay.de>:
>> Denis Chertykov schrieb:
>>> 2011/6/24 Richard Henderson <rth@redhat.com>:
>>>
>>>> On 06/23/2011 01:15 PM, Denis Chertykov wrote:
>>>>
>>>>>>  text    data     bss     dec     hex filename
>>>>>> 10032      25       0   10057    2749 bld-avr-orig/gcc/z.o
>>>>>>  5816      25       0    5841    16d1 bld-avr-new/gcc/z.o
>>>>> Richard, can you send me this z.c file ?
>>>>> Right now I'm notice that new code is worse.
>>>> That's gcc.c-torture/compile/950612-1.c.
>>> I have founded that postreload optimizations can't handle results of
>>> new L_R_A code.
>>> I think that it's can be handled by CSE (postreload).
>> Did you try to add constraint alternative to *addhi3?
>> Like "*!d,d,n" or even "*!r,r,n"
>>
>> I saw some code improvement with that alternative.
> 
> I'm trying:
> 
> (define_insn "*addhi3"
>   [(set (match_operand:HI 0 "register_operand" "=r,!w,!w,d,r,r,!d")
>  	(plus:HI
>  	 (match_operand:HI 1 "register_operand" "%0,0,0,0,0,0,!r")
>  	 (match_operand:HI 2 "nonmemory_operand" "r,I,J,i,P,N,!ri")))]
>   ""
>   "@
>  	add %A0,%A2\;adc %B0,%B2
>  	adiw %A0,%2
>  	sbiw %A0,%n2
>  	subi %A0,lo8(-(%2))\;sbci %B0,hi8(-(%2))
>  	sec\;adc %A0,__zero_reg__\;adc %B0,__zero_reg__
>  	sec\;sbc %A0,__zero_reg__\;sbc %B0,__zero_reg__
>         #"
>   [(set_attr "length" "2,1,1,2,3,3,4")
>    (set_attr "cc" "set_n,set_czn,set_czn,set_czn,set_n,set_n,set_n")])
> 

That split will split always:

> ;; Special split three addressing addhi3
> ;; to make postreload optimization possible
> (define_split ; addhi3 !d,!r,!ri
>   [(set (match_operand:HI 0 "d_register_operand" "")
> 	(plus:HI (match_operand:HI 1 "register_operand" "")
> 		 (match_operand:HI 2 "nonmemory_operand" "")))]
>   "reload_completed"
     && REGNO(operands[0]) != REGNO(operands[1])"
>   [(set (match_dup 0) (match_dup 2))
>    (set (match_dup 0) (plus:HI (match_dup 0) (match_dup 1)))]
>   "")
Maybe it can also restrict to const_int_operand in #2 and then it's
best to
    (set (match_dup 0)
         (match_dup 1))
    (set (match_dup 0)
         (plus:HI (match_dup 0)
                  (match_dup 2)))
> 
> The main problem for me is that the new addressing mode produce a
> worse code in many tests.

You have an example source?

> Although, results for gcc.c-torture/compile/950612-1.c is
> significantly better with new addressing.

That testcase is pathologic for AVR...

> 
> Denis.
> 

Johann

  reply	other threads:[~2011-06-27  8:43 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 17:24 Georg-Johann Lay
2011-06-09 18:50 ` Denis Chertykov
2011-06-09 19:43   ` Georg-Johann Lay
2011-06-09 19:51     ` Denis Chertykov
2011-06-10 10:23       ` Georg-Johann Lay
2011-06-12 10:34         ` Denis Chertykov
2011-06-13 18:10           ` Georg-Johann Lay
2011-06-13 22:37             ` Denis Chertykov
2011-06-14 10:39               ` Georg-Johann Lay
2011-06-14 11:38                 ` Denis Chertykov
2011-06-14 21:38                   ` Georg-Johann Lay
2011-06-14 23:04                     ` Richard Henderson
2011-06-15 17:58                     ` Richard Henderson
2011-06-15 21:58                       ` Georg-Johann Lay
2011-06-15 22:20                         ` Richard Henderson
2011-06-16  3:46                           ` Richard Henderson
2011-06-16 11:37                             ` Denis Chertykov
2011-06-16 12:01                               ` Denis Chertykov
2011-06-16 14:07                                 ` Richard Henderson
2011-06-16 18:18                                   ` Denis Chertykov
2011-06-16 18:57                                     ` Richard Henderson
2011-06-16 19:33                                       ` Denis Chertykov
2011-06-16 19:42                                         ` Richard Henderson
2011-06-16 20:04                                           ` Denis Chertykov
2011-06-16 14:36                               ` Richard Henderson
2011-06-16 14:52                                 ` Bernd Schmidt
2011-06-16 15:13                                   ` Richard Henderson
2011-06-16 18:57                                 ` Denis Chertykov
2011-06-23 20:48                             ` Denis Chertykov
2011-06-23 22:04                               ` Richard Henderson
2011-06-26 20:03                                 ` Denis Chertykov
2011-06-26 20:51                                   ` Georg-Johann Lay
2011-06-27  8:41                                     ` Denis Chertykov
2011-06-27  9:19                                       ` Georg-Johann Lay [this message]
2011-06-27 10:17                                         ` Denis Chertykov
2011-07-07  9:59                                           ` Georg-Johann Lay
2011-07-07 18:21                                             ` Denis Chertykov
2011-07-08 10:12                                               ` Georg-Johann Lay
2011-07-08 10:25                                                 ` Denis Chertykov
2011-07-08 12:16                                                   ` Georg-Johann Lay
2011-06-22  3:28             ` Hans-Peter Nilsson
2011-06-22 17:03               ` Georg-Johann Lay
2011-06-23 12:51                 ` Hans-Peter Nilsson
2011-06-23 13:00                 ` Hans-Peter Nilsson
2011-06-09 20:03     ` Georg-Johann Lay
2011-06-10  9:27   ` Georg-Johann Lay
2011-06-21 17:17     ` Georg-Johann Lay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E084291.4030300@gjlay.de \
    --to=avr@gjlay.de \
    --cc=aesok@post.ru \
    --cc=chertykov@gmail.com \
    --cc=eric.weddington@atmel.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).