From patchwork Mon Jan 28 13:45:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 216190 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 244B92C0084 for ; Tue, 29 Jan 2013 00:46:19 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1359985580; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=T4AiEmkEp6LnMX6O3xb0 CYABtTU=; b=EYuqzt5d3PFgBPabMhC549lwsdjVIH5A5hq3eD4TgEkTellZpgqf fMyoSfK8oCWowJNv0tHstF6q/8J/AfnxEWXj71QtklCeYPK6mddHP1jWXlDJ96il FP/mGEz7Of9y2xLX/jGaURxxSE5Q0Podc8+iTbdAqC/Z9mXUdIyUVbc= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:X-RZG-AUTH:X-RZG-CLASS-ID:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=ANJQAKUrC8SE8KVQvAdBdGA2AhxwcfE4eCgKo8tdsfw93aZOmuCsj6hG8MVXxH 3YQpuRKBnT+s2nqKD3kpd0VYTDNietTX06pwLYewosJWD6vatFK5tAAVK9DVTsjq GO3O3hcO4bqoV1fZRMq+5Arks+QsW6yeaRKfJbhfoDnnU=; Received: (qmail 26571 invoked by alias); 28 Jan 2013 13:46:07 -0000 Received: (qmail 26556 invoked by uid 22791); 28 Jan 2013 13:46:05 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, KHOP_SPAMHAUS_DROP, KHOP_THREADED, RCVD_IN_DNSWL_NONE, TW_OV X-Spam-Check-By: sourceware.org Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.161) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Jan 2013 13:45:53 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT2k715jHQaJercGObUOFkj18odoYNahU4Q== X-RZG-CLASS-ID: mo00 Received: from [192.168.0.22] (business-188-111-022-002.static.arcor-ip.net [188.111.22.2]) by smtp.strato.de (joses mo29) (RZmta 31.13 AUTH) with ESMTPA id u07709p0SCoMyQ ; Mon, 28 Jan 2013 14:45:48 +0100 (CET) Message-ID: <5106810C.10106@gjlay.de> Date: Mon, 28 Jan 2013 14:45:48 +0100 From: Georg-Johann Lay User-Agent: Thunderbird 2.0.0.24 (X11/20100302) MIME-Version: 1.0 To: Gerald Pfeifer CC: gcc-patches@gcc.gnu.org, Denis Chertykov , Eric Weddington Subject: Re: [avr,committed] Fix fixed-point conversion References: <510139A1.1050309@gjlay.de> In-Reply-To: X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Gerald Pfeifer wrote: > On Thu, 24 Jan 2013, Georg-Johann Lay wrote: >> Committed the following change: >> >> http://gcc.gnu.org/r195424 >> >> * config/avr/avr.c (avr_out_fract): Make register numbers that >> might be outside of source operand signed. > > Can you still post patches to the list, and not just the reference? > > Thanks, > Gerald Thinks for pointing this out. I will follow the guideline in the future. Here is the change: Index: config/avr/avr.c =================================================================== --- config/avr/avr.c (revision 195423) +++ config/avr/avr.c (revision 195424) @@ -7114,13 +7114,13 @@ avr_out_fract (rtx insn, rtx operands[], unsigned d1 = d0 + step; // Current and next regno of source - unsigned s0 = d0 - offset; - unsigned s1 = s0 + step; + signed s0 = d0 - offset; + signed s1 = s0 + step; // Must current resp. next regno be CLRed? This applies to the low // bytes of the destination that have no associated source bytes. - bool clr0 = s0 < src.regno; - bool clr1 = s1 < src.regno && d1 >= dest.regno; + bool clr0 = s0 < (signed) src.regno; + bool clr1 = s1 < (signed) src.regno && d1 >= dest.regno; // First gather what code to emit (if any) and additional step to // apply if a MOVW is in use. xop[2] is destination rtx and xop[3] @@ -7150,12 +7150,12 @@ avr_out_fract (rtx insn, rtx operands[], } } } - else if (offset && s0 <= src.regno_msb) + else if (offset && s0 <= (signed) src.regno_msb) { int movw = AVR_HAVE_MOVW && offset % 2 == 0 && d0 % 2 == (offset > 0) && d1 <= dest.regno_msb && d1 >= dest.regno - && s1 <= src.regno_msb && s1 >= src.regno; + && s1 <= (signed) src.regno_msb && s1 >= (signed) src.regno; xop[2] = all_regs_rtx[d0 & ~movw]; xop[3] = all_regs_rtx[s0 & ~movw];