Displaying 3 results from an estimated 3 matches for "cpu_clips_posit".
2007 May 03
2
[patch] Mac Universal Binaries
On 5/3/07, Erik de Castro Lopo <mle+la@mega-nerd.com> wrote:
> Peter Grayson wrote:
>
> Personally I think universal binaries are a bad idea.
They have obviously served some purpose, but I tend to agree that the
concept does not seem to scale well once outside the Apple microcosm.
> For one of my projects, libsndfile, endian issues is not the only
> think that breaks in
2007 May 03
0
[patch] Mac Universal Binaries
...147483648 -2147483648
-2147483649.0 -2147483648 -2147483648 (0x80000000)
-2147483650.0 -2147483648 -2147483648
As you can see out of range floats are correctly clipped on PPC,
but only correctly clipped for negative floats on x86.
libsndfile has code a bit like this:
if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= 1.0 * 0x7FFFFFFF)
int_value = 0x7fffffff ;
if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000))
int_value = 0x80000000 ;
On PPC, the above two lines get optimised out. On Intel x86, only
the second gets optimised...
2007 May 03
2
[patch] Mac Universal Binaries
...etermine at compile time that a conversion somewhere
will overflow and 2) optimise it out (since it's undefined anyway) or do
other funny things with it. That's why I wouldn't depend on the right
thing happening, even on PPC.
> libsndfile has code a bit like this:
>
> if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= 1.0 * 0x7FFFFFFF)
> int_value = 0x7fffffff ;
>
> if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000))
> int_value = 0x80000000 ;
>
> On PPC, the above two lines get optimised out. On Intel x86, o...