[Vorbis-dev] libvorbis 1.2.1 release?

Markus Ewald cygon at nuclex.org
Sun Jun 8 23:30:44 PDT 2008


xiphmont at xiph.org schrieb:
> On Thu, Jun 5, 2008 at 9:36 AM, Erik de Castro Lopo
> <mle+la at mega-nerd.com> wrote:
>> Ivo Emanuel Gonçalves wrote:
>>
>>> The win64 people have posted a final patch[1] and they are both
>>> advocating it, which is a good sign.  What about committing it,
>>> putting out a RC and three or four days later get this release finally
>>> out?
>>>
>>> -Ivo
>>>
>>> [1] https://trac.xiph.org/attachment/ticket/1361/libvorbis-1.2.0-x64-revised.3.patch
>> I've had a look. Its pretty simple and there's nothing obviously wrong
>> so I think its probably ok. However, I'm not willing to commit it myself
>> because svn annotate never forgets :-).
>
> The change at the end of the patch is wrong.  It assumes your compiler
> sets up a round-toward-zero convention.  It's pretty unusual that
> (if?) MSVC does this actually, that will give incorrect behavior on
> GCC.  GCC leves the FPU in the default OS setup and on most UNIXes
> that will be truncate-to-int.  (int)(f+.5) is the correct in this
> case.
>
> Does MSVC/Win *really* do round-toward zero?
Yes, most definitely. So does gcc 4.1.2 on my Gentoo Linux (2.6.17) box 
and mingw32 (gcc 3.4.5) on Win32.

Checked it for you:


Configuration                +2.4    +2.9    -2.4    -2.9
------------------------------------------------------------
gcc 4.1.2 (libvorbis asm)      2       3      -2      -3
gcc 4.1.2 (always +0.5)        2       3      -1      -2 (!)
gcc 4.1.2 (new patch def)      2       3      -2      -3

msvc 9.0 (existing msvc asm)   2       3      -2      -3
msvc 9.0 (new patch SSE asm)   2       3      -2      -3
msvc 9.0 (always +0.5)         2       3      -1      -2 (!)
msvc 9.0 (new patch def)       2       3      -2      -3

mingw32 3.4.5 (always +0.5)    2       3      -1      -2 (!)
mingw32 3.4.5 (new patch def)  2       3      -2      -3
------------------------------------------------------------


To my knowledge, -0.9 truncated to an int would be 0. If you always add 
+0.5 to a number then eg. -2.4 would become -1.9 which would be 
truncated to -1.

If that truly was the intention of vorbis_ftoi() (highly doubt it), then 
the existing asm optimizations (both gcc _and_ msvc) are already 
inconsistent with the default code path on all compilers listed above!

>
> Monty
-Markus-

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20080609/4dda30b8/attachment.htm 


More information about the Vorbis-dev mailing list