From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27521 invoked by alias); 1 Jul 2011 14:55:25 -0000 Received: (qmail 27508 invoked by uid 22791); 1 Jul 2011 14:55:24 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_00,RCVD_NUMERIC_HELO X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Jul 2011 14:55:09 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Qcf7c-0004HR-1d from Andrew_Stubbs@mentor.com ; Fri, 01 Jul 2011 07:55:08 -0700 Received: from 82.32.123.61 ([82.32.123.61]) by EU1-MAIL.mgc.mentorg.com ([137.202.20.52]) via Exchange Front-End Server webmail.mentor.com ([192.94.38.218]) with Microsoft Exchange Server HTTP-DAV ; Fri, 1 Jul 2011 14:55:06 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10 Content-class: urn:content-classes:message Subject: Re: [PATCH (3/7)] Widening multiply-and-accumulate pattern matching Date: Fri, 01 Jul 2011 14:55:00 -0000 Message-ID: <1A77B5B39081C241A68E6CF16983025F0209072B@EU1-MAIL.mgc.mentorg.com> In-Reply-To: <4E0DDC65.70701@gnu.org> 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> <4E0DBE96.4000809@gnu.org> <1A77B5B39081C241A68E6CF16983025F0209072A@EU1-MAIL.mgc.mentorg.com> <4E0DDC65.70701@gnu.org> From: "Stubbs, Andrew" To: "Paolo Bonzini" Cc: "Michael Matz" , "Richard Guenther" , , 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/msg00046.txt.bz2 On 01/07/11 15:40, Paolo Bonzini wrote: > On 07/01/2011 03:30 PM, Stubbs, Andrew wrote: >>> > However, perhaps there is a catch. We can do the following thought >>> > experiment. What would happen if you had multiple widening multiplies? >>> > Like 8-bit signed to 64-bit unsigned and then 64-bit unsigned to >>> 128-bit >>> > unsigned? I believe in this case you couldn't optimize 8-bit signed to >>> > 128-bit unsigned. Would your code do it? >> My code does not attempt to combine multiple multiplies. In any case, if >> you have two multiplications, surely you have at least three input >> values, so they can't be combined? > > What about (u128)c + (u64)((s8)a * (s8)b)? You cannot convert this to > (u128)c + (u128)((s8)a * (s8)b). Oh I see, sorry. Yes, that's exactly what I'm trying to do here. No, wait, I don't see. Where are these multiple widening multiplies=20 you're talking about? I only see one multiply? Andrew