Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-27 Thread Tim Goetze
[Tim Blechmann] On Fri, 25 Jun 2004 17:38:24 -0500 Jan Depner [EMAIL PROTECTED] wrote: On Fri, 2004-06-25 at 13:49, Tim Blechmann wrote: I have a denormal fix without a branch but you probably don't want to see it ;-) It's pretty simple, just OR the bits of the exponent together

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-27 Thread Simon Jenkins
Tim Goetze wrote: [Tim Blechmann] On Fri, 25 Jun 2004 17:38:24 -0500 Jan Depner [EMAIL PROTECTED] wrote: On Fri, 2004-06-25 at 13:49, Tim Blechmann wrote: I have a denormal fix without a branch but you probably don't want to see it ;-) It's pretty simple, just OR the bits of the

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-27 Thread Tim Goetze
[Simon Jenkins] Tim Goetze wrote: 8-bit exponent and no assumption about its value made, 8 binary 'shift', 7 'or' and 1 'and' statement if i'm not badly mistaken. and if i'm not, a branch will probably hurt less. Three shifts, three copys, three 'or's and an 'and': copy = value; value |=

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-27 Thread Simon Jenkins
Tim Goetze wrote: [Simon Jenkins] Tim Goetze wrote: 8-bit exponent and no assumption about its value made, 8 binary 'shift', 7 'or' and 1 'and' statement if i'm not badly mistaken. and if i'm not, a branch will probably hurt less. Three shifts, three copys, three 'or's and an 'and':

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-27 Thread Jan Depner
On Sun, 2004-06-27 at 07:43, Tim Goetze wrote: [Tim Blechmann] On Fri, 25 Jun 2004 17:38:24 -0500 Jan Depner [EMAIL PROTECTED] wrote: On Fri, 2004-06-25 at 13:49, Tim Blechmann wrote: I have a denormal fix without a branch but you probably don't want to see it ;-) It's pretty

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-27 Thread Jan Depner
On Sun, 2004-06-27 at 08:30, Tim Goetze wrote: [Simon Jenkins] Tim Goetze wrote: 8-bit exponent and no assumption about its value made, 8 binary 'shift', 7 'or' and 1 'and' statement if i'm not badly mistaken. and if i'm not, a branch will probably hurt less. Three shifts, three copys,

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-26 Thread Tim Blechmann
On Fri, 25 Jun 2004 17:38:24 -0500 Jan Depner [EMAIL PROTECTED] wrote: On Fri, 2004-06-25 at 13:49, Tim Blechmann wrote: I have a denormal fix without a branch but you probably don't want to see it ;-) It's pretty simple, just OR the bits of the exponent together which gives either

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-25 Thread Tim Blechmann
I have a denormal fix without a branch but you probably don't want to see it ;-) It's pretty simple, just OR the bits of the exponent together which gives either 0 (denormal) or 1, typecast that to float, and then multiply the original float by that (0.0 or 1.0). Voila, no branch, but it

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-24 Thread Erik de Castro Lopo
On Thu, 24 Jun 2004 02:11:34 -0300 Juan Linietsky [EMAIL PROTECTED] wrote: Sorry for not checking, but I guess it could be good for the record (and people googling for it) to ask here.. The macro for dealing denormals that I have is: #define undenormalise(sample) if(((*(unsigned

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-24 Thread Tim Blechmann
Since the problem is denormalised numbers, has anybody thought of adding a small DC offset (1e-15) or alternating the addition/subraction of a small value? of course it is possible to add a small dc offset ... but what if we are working in a feedback loop? or even worse with a high pass filter?

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-24 Thread Simon Jenkins
Erik de Castro Lopo wrote: On Thu, 24 Jun 2004 02:11:34 -0300 Juan Linietsky [EMAIL PROTECTED] wrote: Sorry for not checking, but I guess it could be good for the record (and people googling for it) to ask here.. The macro for dealing denormals that I have is: #define undenormalise(sample)

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-24 Thread Erik de Castro Lopo
On Thu, 24 Jun 2004 10:37:35 +0100 Simon Jenkins [EMAIL PROTECTED] wrote: inline float FlushToZero( volatile float f ) { f += 9.8607615E-32f; return f - 9.8607615E-32f; } /* end */ The people who discovered it first call this method Elimination by Quantification. Its slightly

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-24 Thread Dave Griffiths
On Thu, 24 Jun 2004 11:03:34 +0200, Tim Blechmann wrote Since the problem is denormalised numbers, has anybody thought of adding a small DC offset (1e-15) or alternating the addition/subraction of a small value? of course it is possible to add a small dc offset ... but what if we are

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-24 Thread Steve Harris
On Thu, Jun 24, 2004 at 06:36:47 +1000, Erik de Castro Lopo wrote: On Thu, 24 Jun 2004 10:37:35 +0100 Simon Jenkins [EMAIL PROTECTED] wrote: inline float FlushToZero( volatile float f ) { f += 9.8607615E-32f; return f - 9.8607615E-32f; } There we go!!! That is an elegant

Re: [linux-audio-user] Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-24 Thread Steve Harris
On Thu, Jun 24, 2004 at 02:11:34AM -0300, Juan Linietsky wrote: #define undenormalise(sample) if(((*(unsigned int*)sample)0x7f80)==0) sample=0.0f however gcc 3.3 and 3.4 seem to produce an undesired effect when the optimizer is turned on, rendering this macro unusable.. this breaks

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-24 Thread Clemens Ladisch
Steve Harris wrote: You can do y += delta y -= delta but youre at the mercy of the optimiser. The IEEE standard specifies exactly what happens with denormals, so, in theory, the compiler must not optimize this away. However, optimization options for speed often disable strict IEEE

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-24 Thread Steve Harris
On Thu, Jun 24, 2004 at 01:20:34 +0200, Clemens Ladisch wrote: The IEEE standard specifies exactly what happens with denormals, so, in theory, the compiler must not optimize this away. However, optimization options for speed often disable strict IEEE compatibility. (I don't know how gcc's

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-24 Thread eviltwin69
I have a denormal fix without a branch but you probably don't want to see it ;-) It's pretty simple, just OR the bits of the exponent together which gives either 0 (denormal) or 1, typecast that to float, and then multiply the original float by that (0.0 or 1.0). Voila, no branch, but it is

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-24 Thread Juan Linietsky
On Thursday 24 June 2004 06:21, Steve Harris wrote: On Thu, Jun 24, 2004 at 06:36:47 +1000, Erik de Castro Lopo wrote: On Thu, 24 Jun 2004 10:37:35 +0100 Simon Jenkins [EMAIL PROTECTED] wrote: inline float FlushToZero( volatile float f ) { f += 9.8607615E-32f; return f -

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-24 Thread Steve Harris
On Thu, Jun 24, 2004 at 01:10:37 -0300, Juan Linietsky wrote: inline float FlushToZero( volatile float f ) { f += 9.8607615E-32f; return f - 9.8607615E-32f; } That actually looks nice... since thanks to writing volatile float f, the optimizer should not touch it.. it'

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-24 Thread Simon Jenkins
Steve Harris wrote: On Thu, Jun 24, 2004 at 01:10:37 -0300, Juan Linietsky wrote: inline float FlushToZero( volatile float f ) { f += 9.8607615E-32f; return f - 9.8607615E-32f; } That actually looks nice... since thanks to writing volatile float f, the optimizer should not touch

Re: [linux-audio-dev] swh plugins and fixing undenormalize

2004-06-23 Thread Juan Linietsky
On Wednesday 23 June 2004 15:54, Steve Harris wrote: http://plugin.org.uk/releases/0.4.4/ * Fixes to build on recent gcc * New limiter for beter performance in JAMin * Denomal fixes from Tim Blechmann (general and specifially the flanger) * Many other things I've forgotten :( This release