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]

Re: Floating point comparison


Richard Henderson writes:
 > On Tue, Dec 03, 2002 at 09:24:40AM +1030, Ian Dall wrote:
 > > a) is the MI code correct in doing this re-order for floating point
 > >    compare?  I raise the question because it never seems to happen
 > >    when optimization is enabled.
 > 
 > No.  In which pass did this happen?

I think it is the "ce1" pass, but the dump has a file extension of "bp"
because, it appears, the DFI_* and the dump_file table have gotten out
of sync:

(gdb) print dump_file[DFI_ce1]
$18 = {extension = 0x8349970 "bp", debug_switch = 98 'b', 
  graph_dump_p = 1 '\001', enabled = 1 '\001', initialized = 1 '\001'}
(gdb) print dump_file[DFI_cfg]
$19 = {extension = 0x8349968 "ce1", debug_switch = 67 'C', 
  graph_dump_p = 1 '\001', enabled = 1 '\001', initialized = 1 '\001'}
(gdb) print dump_file[DFI_bp]
$20 = {extension = 0x834996c "cfg", debug_switch = 102 'f', 
  graph_dump_p = 1 '\001', enabled = 1 '\001', initialized = 0 '\0'}


Geoff Keating writes:
 > That's the problem: it shouldn't result in this.
 > 
 > (if_then_else (lt (cc0) (const_int 0) (pc) (label_ref)))
 > 
 > is not the same as
 > 
 > (if_then_else (ge (cc0) (const_int 0) (label_ref) (pc)))
 > 
 > for FP comparisons.  I think your port is making an assumption it shouldn't.

Possible, but I can't see where.

 > The MI code is _not_ allowed to switch between GE and LT unless it
 > knows that this is safe.

So not for ieee float, right?

 > I'm pretty sure it doesn't, because if it
 > tried the rs6000 port would abort (rs6000 doesn't have a bge
 > instruction for floating point).
 > 
 > The rs6000 port uses CCFPmode to track whether a branch is from a FP
 > conditional or an integer conditional (although not for this reason);
 > that may help you here.

Maybe that is why the rs6000 port doesn't see this problem?

Richard Henderson writes:
 > We may have not been able to figure out that this was an fp
 > comparison, somehow, but we're supposed to have guessed 
 > pessimistically if we couldn't tell.

Ian


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