[PD-dev] amd64: rsqrt~

Tim Blechmann TimBlechmann at gmx.net
Sat Sep 10 23:36:27 CEST 2005


hi miller, hi devs ...

the current implementation of rsqrt~ is most likely broken.
i was sshing to carmen's amd64 machine ... looked like that filling the
lookup table isn't really working ...

static void init_rsqrt(void)
{
    int i;
    for (i = 0; i < DUMTAB1SIZE; i++)
    {
        float f;
        long l = (i ? (i == DUMTAB1SIZE-1 ? DUMTAB1SIZE-2 : i) : 1)<< 23;
        *(long *)(&f) = l;
        rsqrt_exptab[i] = 1./sqrt(f);   
    }
    for (i = 0; i < DUMTAB2SIZE; i++)
    {
        float f = 1 + (1./DUMTAB2SIZE) * i;
        rsqrt_mantissatab[i] = 1./sqrt(f);      
    }
}

couldn't really look into it, but i guess, the wild cast in
        *(long *)(&f) = l;
might be a problem on th x86_64 architecture ...

not really a problem for devel, since devel most likely uses sse
instructions to do the rsqrt computation ... 
but someone who is into vanilla pd might be interested in having a look
at it ..

cheers ... tim

-- 
mailto:TimBlechmann at gmx.de    ICQ: 96771783
http://www.mokabar.tk

latest mp3: kMW.mp3
http://mattin.org/mp3.html

latest cd: Gohü Lee Kwang & Tim Blechmann: Drone
http://www.geocities.com/gohleekwangtimblechmannduo/

After one look at this planet any visitor from outer space 
would say "I want to see the manager."
				      William S. Burroughs




More information about the Pd-dev mailing list