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]
Other format: [Raw text]

[PING, middle end]: Convert (int)logb() into ilogb().


Hello!

http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02580.html

The problem with this patch is, that the conversion is implemented in
convert.c, together wit all other similar fp->int conversions (such as
rint->lrint). It was suggested to move all these conversions to
fold-const.c, and a RFC patch for this was implemented [1], but the
patch hit some problems with current infrastructure, for which there
is no straighforward solution in the middle end.

As this patch implements logb->ilogb conversion exactly in the same
way and in the same place as rint->lrint conversion, I'd like to ask
middle-end maintainers to accept this patch into the mainline. The
problem with wrong place could be addressed later for whole pack of
conversions that currently live in convert.c.

The transformation itself works without problems and its effect is,
that (int) logb function is called in much more optimal way. The
integer return value of ilogb() is passed in integer reg, where logb()
return value is passed FP reg and a separate fp->int conversion is
necessary in this case. By accepting this patch, gcc would implement
this transformation now, without need to wait for middle-end
infrastructure fix.

[1]: http://gcc.gnu.org/ml/gcc-patches/2007-02/msg01032.html
[2]: http://gcc.gnu.org/ml/gcc-patches/2007-02/msg01033.html

Uros.


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