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


> Looks like it would suffice to rip out the entire if block - but there
> was a reason it was put there in the first place, right?

ix86 word instructions generally require a prefix which makes the
resulting instruction larger and complicates decoding.  ix86 word
instructions also can cause partial register stalls on P6 class
processors (as you have apparentally noticed :-).  The various
ix86 patterns in i386.md attempt to avoid word instructions
when possible so to hopefully produce better code, however at
times they just make the situation worse.  Consider the following:

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

  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.

Really the code needs to do more analysis and scheduling to properly handle
the issue of avoiding the prefix and partial register stalls.  Any takers? :-)

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