From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15616 invoked by alias); 12 Nov 2012 17:56:34 -0000 Received: (qmail 15606 invoked by uid 22791); 12 Nov 2012 17:56:34 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_CP,TW_CX,TW_XB X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Nov 2012 17:56:28 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qACHuNZI001636 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 12 Nov 2012 12:56:23 -0500 Received: from anchor.twiddle.home (vpn-229-154.phx2.redhat.com [10.3.229.154]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qACHuLR3024997; Mon, 12 Nov 2012 12:56:22 -0500 Message-ID: <50A13845.6030300@redhat.com> Date: Mon, 12 Nov 2012 17:56:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 MIME-Version: 1.0 To: David Miller CC: gcc-patches@gcc.gnu.org, ebotcazou@adacore.com, ro@cebitec.uni-bielefeld.de Subject: Re: [PATCH v3] Add support for sparc compare-and-branch References: <20121022.233923.1683656545305450956.davem@davemloft.net> In-Reply-To: <20121022.233923.1683656545305450956.davem@davemloft.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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: 2012-11/txt/msg00925.txt.bz2 On 10/22/2012 08:39 PM, David Miller wrote: > + /* Compare and Branch is limited to +-2KB. If it is too far away, > + change > + > + cxbne X, Y, .LC30 > + > + to > + > + cxbe X, Y, .+12 > + ba,pt xcc, .LC30 > + nop */ Based on your no-control-after cbcond comment at the top of the patch, surely this should contain another nop as well. > + *p++ = '\t'; > + *p++ = '%'; > + *p++ = '1'; > + *p++ = ','; > + *p++ = ' '; > + *p++ = '%'; > + *p++ = '2'; > + *p++ = ','; > + *p++ = ' '; And surely all this code isn't so performance sensitive that it needs to be written in such an unreadable way. p = stpcpy (p, "\t%1, %2, "); is at least a little better. Though really there's just 3 variable portions of the pattern, so I wonder if a lesser number of snprintf calls might be good enough. if (far) { if (veryfar) snprintf (buf, sizeof(buf), "c%cb%s\t%%1, %%2, .+16\n\t" "b\t%%l3\n\t nop", size_char, cond_str); else snprintf (buf, sizeof(buf), "c%cb%s\t%%1, %%2, .+16\n\t" "ba,pt\t%%xcc,%%l3\n\t nop", size_char, cond_str); } else snprintf (buf, sizeof(buf), "c%cb%s\t%%1, %%2, %%l3", size_char, cond_str); r~