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: [committed] mips.md macroisation (19/n)


On Wed, 2004-08-25 at 20:35, Richard Sandiford wrote:
> Part 19 of the mips.md macroisation process.  This patch just fixes
> a thinko in the macroisation of the conditional move patterns.
> I realised last night that I'd forgotten to qualify the use of
> the <ccreg> mode attribute.
> 
> This didn't make any difference in practice because the :MOVECC macro
> gets expanded first, and everything works out OK.  However, the md.texi
> documentation says that :GPR should have been expanded first, not :MOVECC.
> That's not happening here because I'd forgotten that htab_traverse doesn't
> guarantee a particular ordering.
> 
> In hindsight, it would probably be better if read-rtl.c required the
> MODE: prefix when a pattern uses more than one mode macro.  I'm still
> thinking about the ins and outs of that.

Not directly related to this change, but more some general
observations.  I did some brief experiments last night with the ARM
description to find out how this all worked.

1) There seems to be a small bug in the expansion of macros.  If the
last insn in the machine description contains macro expansions then only
the very first permutation is generated and none of the others (very
confusing for a beginner who just happens to be experimenting by adding
dummy patterns at the end of the description :-)

2) It would be useful if the iterators could be named explicitly rather
than taking the name of the macro.  I'd like to be able to do something
like

(define_code_macro f [plus minus ior xor])

(define_insn "*xxx_<f.outer:code>_<f.inner:code>"
  (set (match ...)
        (f.outer:SI (f.inner:SI (match ...) ...) ...))
  ""
  "...")

and get all the permutations of plus plus, plus minus, plus ior etc

At present to achieve this I have to define the macro twice, once for
each iterator:

(define_code_macro f1 [plus minus ior xor])
(define_code_macro f2 [plus minus ior xor])

(define_insn "*xxx_<f1:code>_<f2:code>"
  (set (match ...)
        (f1:SI (f2:SI (match ...) ...) ...))
  ""
  "...")

It might also be useful with some expansions if there was a way of
saying "skip permutation xxx in the following insn".

Anyway, this is just general feedback; I haven't yet reached a
conclusion as to whether it's going to be beneficial to try and convert
the ARM md to this form.

R.


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