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]

Question about insn lengths


Pontus Lidman writes:
 > 
 > I'm wondering: how, when and where can I find out the exact length of
 > an insn?
 > 
 > I'm working on support for the Toshiba MIPS R5900. It has an errata
 > related to short loops ; loops must not be less than 6 instructions in
 > length. One solution is to insert nops until the loop is long
 > enough. To determine the amount of nops, I need to know the exact
 > number of instruction words that will be generated from a given RTL
 > insn.
 > 
 > I have a loop lengthening pass based on patches for earlier gcc
 > versions. I adapted it and inserted it after branch shortening, and I
 > re-run branch shortening afterwards. This works for most, but not all
 > cases. The problem seems to be that the instruction lengths returned
 > by get_attr_length() can sometimes overestimate the length of an insn.
 > 
 > For example, I noticed that the 'mfhilo_si' insn has length attribute
 > 12 (because of possible future nops due to hazards I gather), but
 > generates only one instruction word (mflo, for example), so the value
 > I need for this insn is 4.

Where do the hazard nops get inserted?  The assembler?

Andrew.


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