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: PPro patch for egcs



  In message <m0yhQH5-000268C@ocean.lucon.org>you write:
  > > Not to be completely thick .... but why are only GT and LE relevant?
  > > 
  > 
  > That is because of how CC works on x86. I believe you can find the
  > answer in x86 reference manual. You can do
  > 
  > # cd gcc/config/i386
  > # grep CC_NO_OVERFLOW i386.c i386.h
  > 
  > to see how it is used. Basically, we have to duplicate its usage
  > for integer conditional moves.
Yup.  HJ is right.  This comes up once in a while on ports that
use cc0.

Basically, instructions may not set overflow/carry in a manner that
mimics a compare instruction.  The compiler may remove the compare
instruction because it is believed to be redundant, when in fact, it
is not redundant because the later test needs to look at the 
overflow or carry flags.

Depending on exactly how the overflow & carry bits are set, you
may have to restore the comparison if the condition is GT, GE,
LE or LT.  I don't know the x86 well enough to know if only
a subset of those conditions need to be handled.


jeff


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