> From: Kalle A. Sandstr"om <[EMAIL PROTECTED]>
>
> Maybe someone used the -ffast-math switch in the Makefile when compiling
> the other version? This, IIRC, violates the ANSI C floating-point rounding
> rules by omitting a round-to-zero instruction in float->int conversion on
> some architectures.

ISO C doesn't require round-to-zero, it only requires consistency
(FLT_ROUNDS). I think -ffast-math is more to do with error checking, order
of evaluation and the precision of temporaries.

The consistency implied by FLT_ROUNDS does create efficiency problems,
though. For example, MSVC's internal fotl (double to long) function stores,
resets and restores the rounding mode on every call. This is very slow,
because AFAIK a change in rounding mode requires the FP pipes to be flushed.
I'm not sure how glibc's equivalent is implemented, but I
suppose -ffast-math might disable a similar check.

-- Mat.


--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to