This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to clean up i386 machine description?
- To: m dot hayes at elec dot canterbury dot ac dot nz (Michael Hayes)
- Subject: Re: How to clean up i386 machine description?
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Mon, 16 Nov 1998 04:31:54 +0000 (GMT)
- Cc: howell at cs dot stanford dot edu, amylaar at cygnus dot co dot uk, hubicka at horac dot ta dot jcu dot cz, rth at cygnus dot com, law at cygnus dot com, pcg at goof dot com, egcs at cygnus dot com
> Colin Douglas Howell writes:
>
> > This gives me a interesting thought. We have several requirements
> > here. One is to write the instruction patterns so that we know what
> > type of instruction has been selected for scheduling and output
> > purposes. A second is to tighten the operand predicates so we
> > minimize the amount of work done by reload. Finally, we must write
> > the patterns so that reload can do a good job of fixing up operands at
> > minimal cost. Since in many cases the type of instruction we will
> > select depends greatly on the operands, and since reload is modifying
> > the operands, these requirements may be in conflict.
> >
> > Suppose we solve them by replacing each pattern with three sets of
> > patterns, one to be used before reload, one during reload, and one
> > after.
>
> Hmmm, this looks like a pattern explosion! I haven't been following
> this thread too closely so I might have the wrong end of the stick.
> I gather you're wanting to tighten up the operand predicates for the
> x86 and are having trouble with the weird combination of valid
> operands.
>
> If this is the case, what I suggest you do is to use the extra
> condition field of the patterns to reject invalid combinations of the
> operands. I did this with the C4x target where I wanted to minimise
> the amount of reloading. On the x86 you'll probably find that the
> predicates match almost anything but that there are limited
> combinations of valid operands.
This is a good approach for machine-specific patterns, but you can't apply
it to standard patterns like movsi or addsi, since the predicates of these
must be evaluable independent of the instruction.