atom feed13 messages in at.iem.pd-listRe: [PD] Lost at compilig cyclone ;-((((
FromSent OnAttachments
luigi.rensinghoffJun 25, 2004 5:25 am 
Frank BarknechtJun 25, 2004 5:57 am 
Krzysztof CzajaJun 25, 2004 6:18 am 
guenter geigerJun 25, 2004 6:26 am 
Frank BarknechtJun 25, 2004 7:26 am 
guenter geigerJun 25, 2004 9:31 am 
guenter geigerJun 25, 2004 1:13 pm 
Krzysztof CzajaJun 26, 2004 8:14 am 
Frank BarknechtJun 26, 2004 10:04 am 
Thomas GrillJun 26, 2004 10:17 am 
Tim BlechmannJun 26, 2004 11:37 am 
Tim BlechmannJun 26, 2004 12:59 pm 
Thomas GrillJun 27, 2004 4:11 am 
Subject:Re: [PD] Lost at compilig cyclone ;-((((
From:Thomas Grill (gr@grrrr.org)
Date:Jun 26, 2004 10:17:26 am
List:at.iem.pd-list

Hi all,

am i right suspecting that only the first half of the PD_BADFLOAT macro is optimized away? (because otherwise the optimizer were buggy, weren't it?) Then, there's another possibility to test for almost denormals, suggested on the musicdsp site:

#define IS_ALMOST_DENORMAL(f) (fabs(f) < 3.e-34)

probably that's not much slower on modern cpus... should be profiled though

best, Thomas

----- Original Message ----- From: "Krzysztof Czaja" <cza@chopin.edu.pl> To: "guenter geiger" <gei@xdv.org> Cc: <pd-l@iem.at> Sent: Saturday, June 26, 2004 5:14 PM Subject: Re: [PD] Lost at compilig cyclone ;-((((

hi Guenter,

this fails, though:

int result[25];

void pass1(void) { int i; float f = 0.0001, *fp = &f;

for (i=0;i<25;i++) { *fp*=0.0001; if (PD_BADFLOAT(*fp)) result[i] = 1; else result[i] = 0; } }

void pass2(void) { int i; float f = 0.0001; for (i=0;i<25;i++) { f*=0.0001; if (result[i]) printf("%d badfloat %g %08x\n",i,f,*(int*)&f); else printf("%d goodfloat %g %08x\n",i,f,*(int*)&f); } }

If compiled with "gcc-3.3 -O6...", you will get:

... 8 goodfloat 9.99995e-41 000116c2 9 goodfloat 9.80909e-45 00000007 ...

while without "-O6" it works ok. The bottom line is, that I do not know the rules (if there are any).

guenter geiger wrote: ...

I just tested this with gcc 3.3.4 from Debian and it seems to work.