[PD-cvs] pd/src m_simd.c,NONE,1.1.2.1

Thomas Grill xovo at users.sourceforge.net
Wed Oct 6 20:31:21 CEST 2004


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3278

Added Files:
      Tag: devel_0_37
	m_simd.c 
Log Message:
more functions using SIMD instructions
functions for aligned memory allocation (also public in m_pd.h)
added new file m_simd.c !!!


--- NEW FILE: m_simd.c ---
/* 
    Implementation of general vectorized functions
    added by T.Grill
*/

#include "m_pd.h"
#include "m_simd.h"

void zerovec_8(t_float *dst,int n)
{
    for(n >>= 3; n--; dst += 8) {
        dst[0] = dst[1] = dst[2] = dst[3] = dst[4] = dst[5] = dst[6] = dst[7] = 0;
    }
}

void setvec_8(t_float *dst,t_float v,int n)
{
    for(n >>= 3; n--; dst += 8) {
        dst[0] = dst[1] = dst[2] = dst[3] = dst[4] = dst[5] = dst[6] = dst[7] = v;
    }
}

void copyvec_8(t_float *dst,const t_float *src,int n)
{
    for(n >>= 3; n--; src += 8,dst += 8) {
        dst[0] = src[0],dst[1] = src[1],dst[2] = src[2],dst[3] = src[3];
        dst[4] = src[4],dst[5] = src[5],dst[6] = src[6],dst[7] = src[7];
    }
}

void addvec_8(t_float *dst,const t_float *src,int n)
{
    for(n >>= 3; n--; src += 8,dst += 8) {
        dst[0] += src[0],dst[1] += src[1],dst[2] += src[2],dst[3] += src[3];
        dst[4] += src[4],dst[5] += src[5],dst[6] += src[6],dst[7] += src[7];
    }
}

void testcopyvec_8(t_float *dst,const t_float *src,int n)
{
    while(n--) {
        *(dst++) = (PD_BIGORSMALL(*src) ? 0 : *src); src++;
	}
}

void testaddvec_8(t_float *dst,const t_float *src,int n)
{
    while(n--) {
        *(dst++) += (PD_BIGORSMALL(*src) ? 0 : *src); src++;
	}
}





More information about the Pd-cvs mailing list