Question about insn lengths

Richard Sandiford rsandifo@redhat.com
Tue Nov 2 10:49:00 GMT 2004


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.

> 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.

Richard



More information about the Gcc mailing list