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?
Hi
>
> If all these variants were broken out into different instruction patterns,
> at least initially, we very negatively affect the options open to reload.
> And even defining post-reload splitters may be intractable because of the
> number of extra patterns that would be required.
>
> So my thought was to define instruction attributes that select the
> instruction variant and determine the scheduling class, and use this
> information directly by the scheduler, and by the insn output routines.
> In this way we have no duplicated code (for the scheduler and for the
> output routines) to get out of sync.
Well, I was thinking about implementation of this idea. But it should IMO
require large amount of attributes and complex testing. Many tests can not
be done in the md file conditions so special predicates needs to be wrote.
This should result in not very well readable code.
Actually many alternative solutions exist. For instance in add case
we should write special patterns for incrementation and decrementation.
The handling of different opcode for eax should be done using multiple
alternatives. Such solution is IMO more readable. I plan to rewirte
the C statements into @ output patterns or case (alternative) where
possible.
Probably everyone adding new alternative to the insn pattern will verify
that attribute setting is correct. So I am trying to apply this alternative
strategies and use solution you've suggested as the last way.
Also in some cases using attrubutes should be impossible. For example
in many cases the non-prefix opcode is emited when cc0_probably_useless
function is true. This decision is cotext depenedent. I think scheduler
should be very confused if functions were changing their scheduling parameters
after they are reordered.
So prefixes are probably the largest problem for me.
Honza
>
>
> r~
--
------------------------------------------------------------------------------
Have you browsed my www pages? Look at:
http://www.paru.cas.cz/~hubicka
Koules-the game for Svgalib,X11 and OS/2, Xonix-the game for X11
czech documentation for linux index, original 2D computer art and
funny 100 years old photos and articles are there!