From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13549 invoked by alias); 27 Jun 2011 05:08:04 -0000 Received: (qmail 13540 invoked by uid 22791); 27 Jun 2011 05:08:03 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ey0-f175.google.com (HELO mail-ey0-f175.google.com) (209.85.215.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 27 Jun 2011 05:07:49 +0000 Received: by eye27 with SMTP id 27so1682923eye.20 for ; Sun, 26 Jun 2011 22:07:48 -0700 (PDT) Received: by 10.14.27.140 with SMTP id e12mr3608952eea.185.1309151268234; Sun, 26 Jun 2011 22:07:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.14.101.12 with HTTP; Sun, 26 Jun 2011 22:07:28 -0700 (PDT) In-Reply-To: <4E078F93.7060901@gjlay.de> References: <4DF0FAB5.6070704@gjlay.de> <4DF11D20.4030907@gjlay.de> <4DF1ED76.4030507@gjlay.de> <4DF650B7.3030705@gjlay.de> <4DF73490.2080709@gjlay.de> <4DF7D2B5.1090708@gjlay.de> <4DF8ED42.1030706@redhat.com> <4DF918A9.4070003@gjlay.de> <4DF92AEA.4000906@redhat.com> <4DF93B17.8020008@redhat.com> <4E03B658.8020509@redhat.com> <4E078F93.7060901@gjlay.de> From: Denis Chertykov Date: Mon, 27 Jun 2011 08:41:00 -0000 Message-ID: Subject: Re: [Patch, AVR]: Fix PR46779 To: Georg-Johann Lay Cc: Richard Henderson , gcc-patches@gcc.gnu.org, Anatoly Sokolov , "Eric B. Weddington" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg01957.txt.bz2 2011/6/26 Georg-Johann Lay : > Denis Chertykov schrieb: >> >> 2011/6/24 Richard Henderson : >> >>> On 06/23/2011 01:15 PM, Denis Chertykov wrote: >>> >>>>> =C2=A0text =C2=A0 =C2=A0data =C2=A0 =C2=A0 bss =C2=A0 =C2=A0 dec =C2= =A0 =C2=A0 hex filename >>>>> 10032 =C2=A0 =C2=A0 =C2=A025 =C2=A0 =C2=A0 =C2=A0 0 =C2=A0 10057 =C2= =A0 =C2=A02749 bld-avr-orig/gcc/z.o >>>>> =C2=A05816 =C2=A0 =C2=A0 =C2=A025 =C2=A0 =C2=A0 =C2=A0 0 =C2=A0 =C2= =A05841 =C2=A0 =C2=A016d1 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" "=3Dr,!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")]) ;; 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" [(set (match_dup 0) (match_dup 2)) (set (match_dup 0) (plus:HI (match_dup 0) (match_dup 1)))] "") The main problem for me is that the new addressing mode produce a worse code in many tests. Although, results for gcc.c-torture/compile/950612-1.c is significantly better with new addressing. Denis.