This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH (3/7)] Widening multiply-and-accumulate pattern matching
- From: "Stubbs, Andrew" <Andrew_Stubbs at mentor dot com>
- To: "Paolo Bonzini" <bonzini at gnu dot org>
- Cc: "Michael Matz" <matz at suse dot de>, "Richard Guenther" <richard dot guenther at gmail dot com>, <gcc-patches at gcc dot gnu dot org>, <patches at linaro dot org>
- Date: Fri, 1 Jul 2011 15:55:03 +0100
- Subject: Re: [PATCH (3/7)] Widening multiply-and-accumulate pattern matching
- References: <4E034EF2.3070503@codesourcery.com> <4E03504B.9060305@codesourcery.com> <BANLkTi=a8B-DZZdG2bmOWQ8A+-pCSEsAbQ@mail.gmail.com> <4E044559.5000105@linaro.org> <BANLkTimfKyrARS+eRy+MWYVO2gLqp85JsQ@mail.gmail.com> <1A77B5B39081C241A68E6CF16983025F020906F6@EU1-MAIL.mgc.mentorg.com> <BANLkTi=1TRM7uHWxLD3Se=S-ibe0C13T-Q@mail.gmail.com> <4E09B142.4020402@codesourcery.com> <BANLkTim0wLcSTgAL9isO+dVXxgq-U8B4Sw@mail.gmail.com> <Pine.LNX.4.64.1106281741170.17115@wotan.suse.de> <4E09FDEA.3000004@gmail.com> <Pine.LNX.4.64.1106281827230.17115@wotan.suse.de> <1A77B5B39081C241A68E6CF16983025F0209071D@EU1-MAIL.mgc.mentorg.com> <4E0DBE96.4000809@gnu.org> <1A77B5B39081C241A68E6CF16983025F0209072A@EU1-MAIL.mgc.mentorg.com> <4E0DDC65.70701@gnu.org>
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
you're talking about? I only see one multiply?
Andrew