This is the mail archive of the gcc@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]

Re: Whats wrong with this pattern?


> > Is converted into mulhi with subregs.
> > I've attempted to avoid this by adding new pattern for subreg case and then
> > split it ino mulqi or mulsi. For some purpose this don't work. The patterns
> > are still matched with mulhi3 even when it is after my attern.
> > Interestingly enought when I disable the pattern code works. Can someone
> > please describe me whats wrong?
> 
> combine only cares about the instruction count, not about the cost of
> the instructions involved.
> When it forms a combined pattern, it tries to recognize it.  Thus, when
> it has generated an HImode mult, it can only match an HImode mult.
Yes, I know. I do not expect combine to do any clever decision, I only expect
recog matches (as documented) first pattern that can match
the instruction so if you write two consetuctive pattens with different
condition that both maches given instruction, I would expect it first try to
match first and if condition fails try the second.

So if I write subreg aware HImode mult pattern first, it ought to match it,
not match the non-subreg version that appears in the file later.
(when insn have the subregs)
The pattern itself seems to be correct, because once I disable the later (mulhi)
pattern, everything works smoothly.
ALso when I reverse order of patterns (HImode multiply goes first and
disable the subreged patterns by condition "0", HImode multiply pattern
never match.) So it looks like recog always try only the later of the patterns!
Why?

-- 
                       OK. Lets make a signature file.
+-------------------------------------------------------------------------+
|        Jan Hubicka (Jan Hubi\v{c}ka in TeX) hubicka@freesoft.cz         |
|         Czech free software foundation: http://www.freesoft.cz          |
|AA project - the new way for computer graphics - http://www.ta.jcu.cz/aa |
|  homepage: http://www.paru.cas.cz/~hubicka/, games koules, Xonix, fast  |
|  fractal zoomer XaoS, index of Czech GNU/Linux/UN*X documentation etc.  | 
+-------------------------------------------------------------------------+


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