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]
Other format: [Raw text]

Re: Question about insn lengths


Richard Sandiford <rsandifo@redhat.com> writes:

> Pontus Lidman <pontus@lysator.liu.se> writes:
> > For example, I noticed that the 'mfhilo_si' insn has length attribute
> > 12 (because of possible future nops due to hazards I gather)
> 
> Yes, the lengths are intended to be conservative.  The length will
> eventually be reduced to 4 if gcc is doing hazard avoidance itself,
> but will stay at 12 if the assembler is doing it.

I see. I guess if hazard avoidance is such a special case, I could
special case it in my code too and remove the 'hazard cost'. Then I
the loop would only be suboptimal if the hazard nops are actually
needed.

> > the value I need for this insn is 4.
> 
> Couldn't your pass treat every instruction with a nonzero length as
> having length 4?  Of course, doing that will be unnecessarily pessimise
> loops that use compound instruction patterns, but it sounds like you're
> using a recent compiler, and there are relatively few compound patterns
> left.

Yes, I might have to settle for that solution, though those short
loops is precisely where I would like to save cycles... or put the
feature in the assembler, seeing as this situation is somewhat like
the hazard nops.

Anyway, I feel I have a better handle on my options now thanks to your
input and that of Mr. Delorie and Mr. Haley. I'm very grateful for
all of your responses.

-- 
Pontus Lidman, pontus@lysator.liu.se, Software Engineer
No matter how cynical you get, it's impossible to keep up.
Scene: www.dc-s.com | MUD: tyme.envy.com 6969 | irc: irc.quakenet.eu.org


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