This is the mail archive of the gcc-patches@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: A new patch for floating point conditional mov on PPo


> > it doesn't assume that a integer comparison clobbers cc0.  When you
> > emit the integer comparison you look ahead to see if a floating point
> > conditional move is being performed in which case you setup cc0
> > so that it reflects if the move should be performed or not.  Notice
> > that at this point cc0 doesn't reflect the integer comparison mentioned
> > in the RTL ... it instead merely reflects if the conditional move should
> > be performed.
> 
> That is not a problem, see above.

Yes it is a problem.

Consider a smarter notice_update_cc which realizes that integer
conditional moves don't clobber cc0 and the following bit of code:

  int a;
  int b;
  int c;
  int d;
  double e;
  double f;

  if (a < b)
    d = c;

  if (a < b)
    f = e;

In this example the second comparison which you are depending on to
muck cc0 will be eliminated.  It is probably safer to leave the
integer comparison patterns alone and muck cc0 as part of outputting
the FP conditional move.

> > I would imagine that it's desirable to make notice_update_cc smarter
> > about integer conditional moves.  I don't believe that cc0 has to be
> > clobbered even in the case of floating point conditional moves based
> > on unsigned integer comparisons or signed EQ / NE comparisons.
> 
> It may not be hard to do. But it is an optimization which we can
> implement after signed integer comparison is fixed.

A patch has been applied which prevents bad code from being generated
in the case of a FP conditional move based signed integer comparisons
so I believe that you have time to refine your patch if you're interested
in pursuing it.

BTW, I'll probably be supplying a patch to make notice_update_cc0 smarter
about integer conditional moves so it is kind of a real concern. :-)

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