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]

Re: [PATCH, midlevel]: Convert (int)floor -> lfloor


Uros Bizjak wrote:

To enable this conversion, a little help from midlevel is needed. There is already a (int)round -> lround conversion implemented in convert.c to handle BUILT_IN_ROUND -> BUILT_IN_{L,LL}ROUND conversion. To implement similar "floor" conversions, we need similar new gcc internal builtin function, BUILT_IN_{L,LL}FLOOR.
However, there is no lfloor() or llfloor() function in libc. To overcome this problem, we look into machine instruction set and enable this transformation iff appropriate instruction is available (in addition to flag_unsafe_math_optimizations). This way, we won't fall back into (non-existing) library call.

Ugh. If you have an expander it could still fail, couldn't it? Wouldn't it be cleaner to just add the necessary library functions to libgcc2?



Bernd



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