public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Stubbs <ams@codesourcery.com>
To: Richard Earnshaw <rearnsha@arm.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [patch][ARM] Fix 16-bit -> 64-bit multiply and accumulate
Date: Fri, 28 Jan 2011 13:06:00 -0000	[thread overview]
Message-ID: <4D42955C.1060707@codesourcery.com> (raw)
In-Reply-To: <1296153619.9738.16.camel@e102346-lin.cambridge.arm.com>

On 27/01/11 18:40, Richard Earnshaw wrote:
> I'm worried about this change.  The proposed RTL might be what GCC
> generates for this particular case, but the pattern hardly looks
> canonical: a sign-extend of a multiply that contained sign-extended
> operands.
>
> Are you sure that fixing this particular case doesn't introduce a
> regression elsewhere?
>
> Alternatively, is there some part of the manual that describes the form
> you have as the correct canonical form?

I don't think I said it was the canonical form (although the other 
similar smulbb patch was about that), but if it weren't in the canonical 
form then combine would not work (which it does with my patch), so I 
don't believe that's the problem here.

Anyway, combine only canonicalizes the *order* or the expressions, not 
the modes, which is what I'm adjusting here. Or have I missed something?

The problem here is that the expand pass used mulhisi3 which has the 
'internal' modes set one way, and then combine tries to insert that into 
a multiply-and-accumulate form, but recog rejects it because the 
'internal' modes of maddhidi4 are set a different way.

Now, mulhisi3 is currently written using MULT:SI mode, and I can't see 
how this could be any other way - it's an SI mode insn. If we want to be 
able to insert that into maddhidi4, and we do, I don't see any way to do 
that if it uses a MULT:DI - it just isn't compatible.

I have regression tested the patch for correctness, but I haven't proven 
that I haven't produced worse code in some other case.

I could introduce a second pattern, say "*maddhidi4_2", so that both 
patterns match and then there could be no regressions, right? However, I 
don't believe it's necessary.

Andrew

  reply	other threads:[~2011-01-28 10:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09 16:45 Andrew Stubbs
2011-01-27  2:09 ` Ramana Radhakrishnan
2011-01-27 10:46   ` Andrew Stubbs
2011-01-27 19:22 ` Richard Earnshaw
2011-01-28 13:06   ` Andrew Stubbs [this message]
2011-01-28 15:08     ` Richard Earnshaw
2011-01-28 15:55       ` Andrew Stubbs
2011-01-28 16:01         ` Richard Earnshaw
2011-03-25 16:27           ` Andrew Stubbs
2011-04-15 11:23             ` Andrew Stubbs
2011-05-03  9:08               ` Bernd Schmidt
2011-05-03  9:36                 ` Andrew Stubbs
2011-05-18 15:32                 ` [patch][combine] " Andrew Stubbs
2011-05-19 13:06                   ` Bernd Schmidt
2011-05-24 17:51                 ` [patch][simplify-rtx] " Andrew Stubbs
2011-05-24 21:00                   ` Joseph S. Myers
2011-05-25  9:47                     ` Andrew Stubbs
2011-05-25 12:34                       ` Joseph S. Myers
2011-05-25 13:42                     ` Andrew Stubbs
2011-05-25 13:48                       ` Joseph S. Myers
2011-05-25 14:01                         ` Andrew Stubbs
2011-05-25 14:27                           ` Joseph S. Myers
2011-05-26 13:57                             ` Andrew Stubbs
2011-05-26 14:47                               ` Joseph S. Myers
2011-06-02  9:46                               ` Richard Earnshaw
2011-06-07 11:05                                 ` Andrew Stubbs
2011-02-09  6:31       ` [patch][ARM] " Hans-Peter Nilsson

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=4D42955C.1060707@codesourcery.com \
    --to=ams@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rearnsha@arm.com \
    /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).