<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<tt><a class="moz-txt-link-abbreviated" href="mailto:xiphmont@xiph.org">xiphmont@xiph.org</a> schrieb:</tt>
<blockquote
 cite="mid:806dafc20806081521q60b89b78wbfd1954bf069ac46@mail.gmail.com"
 type="cite">
  <pre wrap=""><tt>On Thu, Jun 5, 2008 at 9:36 AM, Erik de Castro Lopo
<a class="moz-txt-link-rfc2396E" href="mailto:mle+la@mega-nerd.com">&lt;mle+la@mega-nerd.com&gt;</a> wrote:
</tt></pre>
  <blockquote type="cite">
    <pre wrap=""><tt>Ivo Emanuel Gon&ccedil;alves wrote:

</tt></pre>
    <blockquote type="cite">
      <pre wrap=""><tt>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] <a class="moz-txt-link-freetext" href="https://trac.xiph.org/attachment/ticket/1361/libvorbis-1.2.0-x64-revised.3.patch">https://trac.xiph.org/attachment/ticket/1361/libvorbis-1.2.0-x64-revised.3.patch</a>
</tt></pre>
    </blockquote>
    <pre wrap=""><tt>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 :-).
</tt></pre>
  </blockquote>
  <pre wrap=""><!----><tt>
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?
</tt></pre>
</blockquote>
<tt>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.<br>
<br>
Checked it for you:<br>
<br>
<br>
Configuration &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; +2.4&nbsp;&nbsp;&nbsp; +2.9&nbsp;&nbsp;&nbsp; -2.4&nbsp;&nbsp;&nbsp; -2.9<br>
------------------------------------------------------------<br>
gcc 4.1.2 (libvorbis asm)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -3<br>
gcc 4.1.2 (always +0.5)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3 &nbsp;&nbsp;&nbsp;&nbsp; -1 &nbsp;&nbsp;&nbsp;&nbsp; -2 (!)<br>
</tt><tt>gcc 4.1.2 (new patch def)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3 &nbsp;&nbsp;&nbsp;&nbsp; -2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -3<br>
<br>
msvc 9.0 (existing msvc asm)&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -3<br>
msvc 9.0 (new patch SSE asm) &nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -3<br>
msvc 9.0 (always +0.5)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -2 (!)<br>
msvc 9.0 (new patch def)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -3<br>
<br>
mingw32 3.4.5 (always +0.5)&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -2 (!)<br>
mingw32 3.4.5 (new patch def)&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -3<br>
------------------------------------------------------------<br>
<br>
<br>
</tt><tt>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.<br>
<br>
</tt><tt>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!</tt><tt><br>
<br>
</tt>
<blockquote
 cite="mid:806dafc20806081521q60b89b78wbfd1954bf069ac46@mail.gmail.com"
 type="cite">
  <pre wrap=""><tt>
Monty
</tt></pre>
</blockquote>
<tt>-Markus-<br>
<br>
</tt>
</body>
</html>