[MPlayer-dev-eng] lrintf detection patch

Rich Felker dalias at aerifal.cx
Fri May 20 23:48:07 CEST 2005


On Fri, May 20, 2005 at 10:54:46PM +0200, Michael Niedermayer wrote:
> Hi
> 
> On Friday 20 May 2005 22:42, Rich Felker wrote:
> > On Fri, May 20, 2005 at 09:50:15PM +0200, Joerg Sonnenberger wrote:
> > > Hi all,
> > > the default CFLAGS settings include -ffast-math and GCC 3.4.3 therefore
> > > optimizes the lrintf call in the test away, effectively turning it into
> > > a NOP. The attached patch forces -ffast-math of for this test.
> >
> > IMO a compiler could still optimize it away with intrinsics. :(
> > Try something like:
> >
> > int main(void) { long (*foo)(double); foo = lrintf; (void)foo(); return 0;
> > }
> 
> hmm, why not something like
> int main(int argc,char* argv[]){ return lrintf(atof(argv[1]));}

You missed the point. It's not about optimizing out a constant. It's
about replacing a function call with an intrinsic.

Rich





More information about the MPlayer-dev-eng mailing list