From patchwork Fri Jul 29 16:14:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 654163 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3s1DML6y19z9syB for ; Sat, 30 Jul 2016 02:14:38 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=o2OMfqE0; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; q=dns; s= default; b=FAtHRxr7B6iwiANtHV7WmZfS4vNDRL9Jt1EGpJxsvYZmXu5IT2Enu doSJiDClzODFQX+zlMPz8KDT6RRFG6mUV2B+pmU5hVcgowZOjjSEHp/oeKROgXFJ UXJ51+OWw+yg/dBJE4EaqRjD7EnafBc8s9u2/E+dGDcA6rkkasKUZc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=default; bh=KFaGN4yc1N/9OH+W8h8q3Xi6yl4=; b=o2OMfqE0TUfViL9u5hTB2LF+lqPD yDLv+CeaFKxv80tTMmVQk828go4oP4RYBnww4QV85FOR8TbhgR8TtolZ5KpQbZfm Ox/2eEg9P/52Vx7qfjHFZ42ji4VpWoujwqg+1DyXAuNNKFvSrMR7mWQ+0mhvgbzF YwKebt8wSXvecPA= Received: (qmail 77574 invoked by alias); 29 Jul 2016 16:14:30 -0000 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 Received: (qmail 77563 invoked by uid 89); 29 Jul 2016 16:14:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=D*gjlay.de, avr@gjlay.de, U*avr, avrgjlayde X-HELO: mo4-p00-ob.smtp.rzone.de Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.217) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 29 Jul 2016 16:14:16 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT3ol15ykJcYwTPLBCxG2PwtgsgUwIw== X-RZG-CLASS-ID: mo00 Received: from [192.168.0.123] (ip5f581faf.dynamic.kabel-deutschland.de [95.88.31.175]) by smtp.strato.de (RZmta 38.13 DYNA|AUTH) with ESMTPSA id Q08a36s6TGEAxzZ (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Fri, 29 Jul 2016 18:14:10 +0200 (CEST) Subject: Re: [patch,avr] minor tweaks for 8-bit operations To: Denis Chertykov References: <14737e83-d5dc-3096-2d12-686c42da1aa9@gjlay.de> Cc: GCC Patches From: Georg-Johann Lay Message-ID: <3c05a06c-444c-cc51-8cb5-0ab50fd8a98b@gjlay.de> Date: Fri, 29 Jul 2016 18:14:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: X-IsSubscribed: yes On 14.07.2016 08:36, Denis Chertykov wrote: > 2016-07-13 14:12 GMT+03:00 Georg-Johann Lay : >> >> This patch contains some unrelated tweaks >> >> - Supplying no-ldregs variant for andqi3, iorqi3 where a const_int mask affects only 1 bit >> >> - Some patterns that match situations with zero_extend that can be performed with less instructions / register pressure. >> >> - comparing HI against -1 >> >> Ok for trunk? >> >> Johann >> >> >> gcc/ >> Minor tweaks for QImode. >> >> * config/avr/predicates.md (const_m255_to_m1_operand): New. >> * config/avr/constraints.md (Cn8, Ca1, Co1, Yx2): New constraints. >> * config/avr/avr.md (add3) : Make "r,0,r" more >> expensive. >> (*cmphi.zero-extend.0, *cmphi.zero-extend.1) >> (*usum_widenqihi3, *udiff_widenqihi3) >> (*addhi3_zero_extend.const): New combiner insns. >> (andqi3, iorqi3): Provide "l" (NO_LD_REGS) alternative if >> just 1 bit is affected. >> * config/avr/avr.c (avr_out_bitop) : Don't access xop[3]. >> (avr_out_compare) [EQ,NE]: Tweak comparing d-regs against -1. > > > > Please apply. > Also applied this addendum; not wrong code but to match the comments. Johann * config/avr/avr.c (avr_out_compare): Use const0_rtx instead of 0 when testing for compares against constants of the form 0xabab. Index: config/avr/avr.c =================================================================== --- config/avr/avr.c (revision 238878) +++ config/avr/avr.c (revision 238879) @@ -5357,7 +5357,7 @@ avr_out_compare (rtx_insn *insn, rtx *xo the constant is of the form 0xabab. */ if (n_bytes == 2 - && xval != 0 + && xval != const0_rtx && test_hard_reg_class (LD_REGS, xreg) && compare_eq_p (insn) && !reg_unused_after (insn, xreg))