[MPlayer-dev-eng] Patch for gcc 3.4 against MPlayer-1.0pre5

Martin Simmons vyslnqaaxytp at spammotel.com
Thu Sep 2 02:20:23 CEST 2004


>>>>> On Sat, 28 Aug 2004 11:34:03 +0900, Attila Kinali <attila at kinali.ch> said:

> > On Mon, Aug 23, 2004 at 08:55:46PM -0500, Joey Parrish wrote:
> > > > > According to the original mail, this is already done in some place in
> > > > > MPlayer (IIRC).  But the point is that someone should create a proper
> > > > > replacement in the case of a system without one.  We should not put
> > > > > code everywhere to define lrintf over and over again.
> > > > 
> > > > You just volunteered :)
> > 
> > Okay, here's my first try.
> > I took code from MPlayer's copy of libfaad2 for x86 asm lrintf.
> > The fallback version doesn't give the same results for lrintf(0.5)
> > as the asm version, though.
> > 
> > For the asm version:
> > lrintf(0.5) == 0
> > lrintf(-0.5) == 0
> > 
> > For the C version:
> > lrintf(0.5) == 1
> > lrintf(-0.5) == -1
> > 
> > Is this a problem, or is that behavior even defined?
> > Any other comments?

> IMHO this is a bug, the asm version should round 0.5 to 1.

Based on what spec?  It is normal for floating point rounding of an exact half
to generate an even integer, i.e.

-2.5 -> -2
-1.5 -> -2
-0.5 ->  0
 0.5 ->  0
 1.5 ->  2
 2.5 ->  2

etc.  I think this is done to give symmetry about 0.0.

__Martin




More information about the MPlayer-dev-eng mailing list