This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch][ARM] Fix 16-bit -> 64-bit multiply and accumulate


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]