From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42252 invoked by alias); 10 Nov 2015 21:04:35 -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 42240 invoked by uid 89); 10 Nov 2015 21:04:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 10 Nov 2015 21:04:32 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id A5E5596E3; Tue, 10 Nov 2015 21:04:31 +0000 (UTC) Received: from localhost.localdomain (vpn1-6-250.ams2.redhat.com [10.36.6.250]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAAL4U51004464; Tue, 10 Nov 2015 16:04:30 -0500 Subject: Re: [PATCH 1/2] simplify-rtx: Simplify trunc of and of shiftrt To: Segher Boessenkool References: <1d3e9ff999e20e4eb13a5825ac084074bd05a397.1447053652.git.segher@kernel.crashing.org> <5641D1F9.3090104@redhat.com> <20151110174411.GB23305@gate.crashing.org> Cc: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com From: Bernd Schmidt Message-ID: <56425BDE.9040604@redhat.com> Date: Tue, 10 Nov 2015 21:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151110174411.GB23305@gate.crashing.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg01284.txt.bz2 On 11/10/2015 06:44 PM, Segher Boessenkool wrote: > Yes I know. All the rest of the code around is it like this though. > Do you want this written in a saner way? I won't object to leaving it as-is for now, but in the future it would be good to keep this in mind. >> I'm not entirely sure what the >> last condition here is supposed to test. > > It tests whether moving the truncate inside will give the same result. > It essentially looks if it works for an x with all bits set; if that > works, it works for any x. Yeah, I figured afterwards that must have been the purpose of the test but I was thinking of other constants because of the trunc_int_for_mode thing. (I probably would have written "(and_const >> shift_amount) & ~small_mask == 0" but yours should be ok too). You might want to use your description as a comment. >> ... the fact that here I think you'd have to trunc_int_for_mode the AND >> amount for the smaller mode? > > Ugh yes, I still have to do that for it to be valid RTL in all cases. > Thanks for catching it. So FAOD the patch is OK with that change. Bernd