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]

Re: 2.95, x86: severe performance problems with short arithmetic


>On Tue, Aug 10, 1999 at 03:43:53PM -0400, John Wehle wrote:
>>   1) A 16 bit write to a register immediately followed by a 32 bit read
>>      of the register.  This will cause a stall.  Converting the 16 bit
>>      write to a 32 bit write avoids the stall, however this may cause a
>>      stall with an earlier instruction (if I recall correctly).
>
> No, writes don't stall -- only reads.

Most of the 16 bit patterns in i386.md perform a read prior to the write.
Converting (for example) addw to addl means in addition to the write being
32 bits that the read is 32 bits.  The stall with an earlier instruction
can occur due to the 32 bit read.

>>   2) A 16 bit write to a register followed by several other instructions
>>      which don't reference the register followed by a 32 bit read of the
>>      register.  This will not stall.
>
> Incorrect.  The 16-bit write instruction has to _retire_ before
> the 32-bit read can _issue_.  With reorder buffers the size that
> they are, this is 20 odd cycles, worst case.

I'll grant you that my response wasn't as precise as it could have been,
however I'm not sure where it's * incorrect *.  As a practical matter if
I separate a 16 bit write to a register with enough instructions (which
hopefully don't have any inherent stall issues of their own :-) doesn't
this allow the write to retire which avoids a partial register stall when
the 32 bit read instruction is encountered?  What did I miss?

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


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