From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19111 invoked by alias); 12 Jul 2011 10:52:15 -0000 Received: (qmail 19103 invoked by uid 22791); 12 Jul 2011 10:52:15 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-yx0-f175.google.com (HELO mail-yx0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Jul 2011 10:52:01 +0000 Received: by yxi19 with SMTP id 19so2185819yxi.20 for ; Tue, 12 Jul 2011 03:52:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.114.11 with SMTP id m11mr4987395ybc.137.1310467920956; Tue, 12 Jul 2011 03:52:00 -0700 (PDT) Received: by 10.151.144.19 with HTTP; Tue, 12 Jul 2011 03:52:00 -0700 (PDT) In-Reply-To: <4E1B2B08.6070305@codesourcery.com> References: <4E034EF2.3070503@codesourcery.com> <4E03504B.9060305@codesourcery.com> <4E044559.5000105@linaro.org> <1A77B5B39081C241A68E6CF16983025F020906F6@EU1-MAIL.mgc.mentorg.com> <4E09B142.4020402@codesourcery.com> <4E09FDEA.3000004@gmail.com> <1A77B5B39081C241A68E6CF16983025F0209071D@EU1-MAIL.mgc.mentorg.com> <4E11CCD1.4010505@codesourcery.com> <4E1B2B08.6070305@codesourcery.com> Date: Tue, 12 Jul 2011 11:05:00 -0000 Message-ID: Subject: Re: [PATCH (3/7)] Widening multiply-and-accumulate pattern matching From: Richard Guenther To: Andrew Stubbs Cc: Michael Matz , gcc-patches@gcc.gnu.org, patches@linaro.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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 X-SW-Source: 2011-07/txt/msg00891.txt.bz2 On Mon, Jul 11, 2011 at 6:55 PM, Andrew Stubbs wrote: > On 07/07/11 10:58, Richard Guenther wrote: >> >> I think you should assume that series of widenings, >> (int)(short)char_variable >> are already combined. =A0Thus I believe you only need to consider a sing= le >> conversion in valid_types_for_madd_p. > > Ok, here's my new patch. > > This version only allows one conversion between the multiply and addition, > so assumes that VRP has eliminated any needless ones. > > That one conversion may either be a truncate, if the mode was too large f= or > the meaningful data, or an extend, which must be of the right flavour. > > This means that this patch now has the same effect as the last patch, for > all valid cases (following you VRP patch), but rejects the cases where th= e C > language (unhelpfully) requires an intermediate temporary to be of the > 'wrong' signedness. > > Hopefully the output will now be the same between both -O0 and -O2, and > programmers will continue to have to be careful about casting unsigned > variables whenever they expect purely unsigned math. :( > > Is this one ok? Ok. Thanks, Richard. > Andrew >