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

Bernd Schmidt bernds_cb1@t-online.de
Tue Apr 5 14:58:00 GMT 2005


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



More information about the Gcc-patches mailing list