public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@arm.com>
To: Andrew Stubbs <ams@codesourcery.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	 Richard Sandiford <rsandifo@nildram.co.uk>
Subject: Re: [patch, tree-ssa] PR54295 Incorrect value extension in widening multiply-accumulate
Date: Fri, 17 Aug 2012 15:20:00 -0000	[thread overview]
Message-ID: <502E612E.60706@arm.com> (raw)
In-Reply-To: <502E5DE6.8090806@codesourcery.com>

On 17/08/12 16:06, Andrew Stubbs wrote:
> On 17/08/12 15:47, Richard Earnshaw wrote:
>> If we don't have a 16x16->64 mult operation then after step 1 we'll
>> still have a MULT_EXPR, not a WIDEN_MULT_EXPR, so when we reach step2
>> there's nothing to short circuit.
>>
>> Unless, of course, you're expecting us to get
>>
>> step1 -> 16x16->32 widen mult
>> step2 -> widen64(step1) + acc64
> 
> No, given a u16xu16->u64 operation in the code, and that the arch 
> doesn't have such an opcode, I'd expect to get
> 
> step1 -> (u32)u16 x (u32)u16 -> u64

Hmm, I would have thought that would be more costly than

	(u64)(u16 x u16 -> u32)

> 
> Likewise, 8x8->32 might give (16)8x(16)8->32.
> 
> The code can't see that the widening operation is non-optimal without 
> looking beyond into its inputs.

Ok, in which case we have to give is_widening_mult_rhs_p enough smarts
to not strip

	(s32)u32

and return u32.

I'll have another think about it.

R.




  reply	other threads:[~2012-08-17 15:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-17 14:04 Richard Earnshaw
2012-08-17 14:22 ` Andrew Stubbs
2012-08-17 14:31   ` Richard Earnshaw
2012-08-17 14:40     ` Andrew Stubbs
2012-08-17 14:48       ` Richard Earnshaw
2012-08-17 15:06         ` Andrew Stubbs
2012-08-17 15:20           ` Richard Earnshaw [this message]
2012-08-17 17:05             ` Richard Earnshaw
2012-08-17 19:21               ` Andrew Stubbs
2012-08-20 11:36               ` Richard Guenther
2012-09-07  8:36                 ` Richard Earnshaw
2012-09-07  9:20                   ` Richard Guenther
2012-08-20 14:02               ` Tobias Burnus
2012-08-20 14:14                 ` Richard Earnshaw
2012-08-17 18:57             ` Andrew Stubbs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=502E612E.60706@arm.com \
    --to=rearnsha@arm.com \
    --cc=ams@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rsandifo@nildram.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).