From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16239 invoked by alias); 14 Jan 2015 09:10:29 -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 16204 invoked by uid 89); 14 Jan 2015 09:10:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f46.google.com Received: from mail-oi0-f46.google.com (HELO mail-oi0-f46.google.com) (209.85.218.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 14 Jan 2015 09:10:26 +0000 Received: by mail-oi0-f46.google.com with SMTP id a3so6439267oib.5 for ; Wed, 14 Jan 2015 01:10:24 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.202.91.138 with SMTP id p132mr1629956oib.47.1421226624112; Wed, 14 Jan 2015 01:10:24 -0800 (PST) Received: by 10.76.69.196 with HTTP; Wed, 14 Jan 2015 01:10:24 -0800 (PST) In-Reply-To: <20150113173834.GA6963@gate.crashing.org> References: <8F47DDC3-F9FE-4E94-90F7-3A16A3FD47CE@comcast.net> <54B446B2.6080909@redhat.com> <20150113173834.GA6963@gate.crashing.org> Date: Wed, 14 Jan 2015 09:24:00 -0000 Message-ID: Subject: Re: shift/extract SHIFT_COUNT_TRUNCATED combine bug From: Richard Biener To: Segher Boessenkool Cc: Jeff Law , Mike Stump , GCC Patches , Richard Sandiford , Eric Botcazou Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-01/txt/msg00986.txt.bz2 On Tue, Jan 13, 2015 at 6:38 PM, Segher Boessenkool wrote: > On Tue, Jan 13, 2015 at 10:51:27AM +0100, Richard Biener wrote: >> IMHO SHIFT_COUNT_TRUNCATED should be removed and instead >> backends should provide shift patterns with a (and:QI ...) for the >> shift amount which simply will omit that operation if suitable. > > Note that that catches less though, e.g. in > > int f(int x, int n) { return x << ((2*n) & 31); } > > without SHIFT_COUNT_TRUNCATED it will try to match an AND with 30, > not with 31. But even with SHIFT_COUNT_TRUNCATED you cannot omit the and as it clears the LSB. Only at a higher level we might be tempted to drop the & 31 while it still persists in its original form (not sure if fold does that - I don't see SHIFT_COUNT_TRUNCATED mentioned there). Richard. > > Segher