search for: cpu_clips_neg

Displaying 3 results from an estimated 3 matches for "cpu_clips_neg".

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
...648 -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 out. > Do they affect all code or just highly-optimized code? The float -> int issue affects all code w...
2007 May 03
2
[patch] Mac Universal Binaries
...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, only > the second gets optimised out. Sounds a bit dangerous to be considering what I wrote above. I tend to consider the f...