From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10153 invoked by alias); 24 Oct 2014 13:58:52 -0000 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 Received: (qmail 10142 invoked by uid 89); 24 Oct 2014 13:58:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yh0-f47.google.com Received: from mail-yh0-f47.google.com (HELO mail-yh0-f47.google.com) (209.85.213.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 24 Oct 2014 13:58:50 +0000 Received: by mail-yh0-f47.google.com with SMTP id c41so799913yho.34 for ; Fri, 24 Oct 2014 06:58:48 -0700 (PDT) X-Received: by 10.236.231.225 with SMTP id l91mr5096016yhq.166.1414159128221; Fri, 24 Oct 2014 06:58:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.170.38.12 with HTTP; Fri, 24 Oct 2014 06:58:27 -0700 (PDT) In-Reply-To: <544A2BEE.4030106@gjlay.de> References: <5449071E.8040909@gjlay.de> <544A2BEE.4030106@gjlay.de> From: Denis Chertykov Date: Fri, 24 Oct 2014 14:03:00 -0000 Message-ID: Subject: Re: [patch,avr] tweak sign extensions, take #2 To: Georg-Johann Lay Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2014-10/txt/msg02555.txt.bz2 2014-10-24 14:37 GMT+04:00 Georg-Johann Lay : > Am 10/23/2014 08:16 PM schrieb Denis Chertykov: >>> >>> This optimization makes most sign-extensions one instruction shorter in >>> the >>> case when the source register may be clobbered and the register numbers >>> are >>> different. Source and destination may overlap. >>> >>> Ok for trunk? >>> >>> Johann >>> >>> gcc/ >>> * config/avr/avr.md (extendqihi2, extendqipsi2, extendqisi2) >>> (extendhipsi2, extendhisi2): Optimize if source reg is unused >>> after the insns and has different REGNO than destination. >> >> >> Approved. >> >> Denis. > > > Finally I switched to a solution that avoids all the ugly asm snippets and > special casing, and which is exact w.r.t code size. So allow me drop the > patch from above and to propose this one for trunk. Sorry for the > inconvenience. > > In any case it uses LSL/SBC idiom instead of the old CLR/SBRC/COM. > > > Johann > > * avr-protos.h (avr_out_sign_extend): New. > * avr.c (avr_adjust_insn_length) [ADJUST_LEN_SEXT]: Handle. > (avr_out_sign_extend): New function. > * avr.md (extendqihi2, extendqipsi2, extendqisi2, extendhipsi2) > (extendhisi2, extendpsisi2): Use it. > (adjust_len) [sext]: New. > > > I'm agree with you. It's better. Approved. Denis.