Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4786
Modified Files:
Tag: devel_0_38
d_ctl.c d_delay.c g_array.c g_canvas.h g_text.c m_pd.h
m_simd.c m_simd_def.h m_simd_sse_gcc.h m_simd_sse_vc.h
m_simd_ve_gcc.h s_audio.c s_audio_asio.cpp s_main.c
Log Message:
first simd cleanup
Index: s_audio_asio.cpp
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/s_audio_asio.cpp,v
retrieving revision 1.1.4.20
retrieving revision 1.1.4.21
diff -C2 -d -r1.1.4.20 -r1.1.4.21
*** s_audio_asio.cpp 14 Dec 2004 09:48:08 -0000 1.1.4.20
--- s_audio_asio.cpp 14 Jan 2005 18:34:13 -0000 1.1.4.21
***************
*** 57,63 ****
/* public function prototypes */
! extern "C" void asio_open_audio(int naudioindev, int *audioindev, int nchindev,
! int *chindev, int naudiooutdev, int *audiooutdev,
! int nchoutdev, int *choutdev, int srate, int scheduler);
extern "C" void asio_close_audio(void);
extern "C" void asio_getdevs(char *indevlist, int *nindevs,
--- 57,63 ----
/* public function prototypes */
! // extern "C" void asio_open_audio(int naudioindev, int *audioindev, int nchindev,
! // int *chindev, int naudiooutdev, int *audiooutdev,
! // int nchoutdev, int *choutdev, int srate, int scheduler);
extern "C" void asio_close_audio(void);
extern "C" void asio_getdevs(char *indevlist, int *nindevs,
Index: s_main.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_main.c,v
retrieving revision 1.7.4.6
retrieving revision 1.7.4.7
diff -C2 -d -r1.7.4.6 -r1.7.4.7
*** s_main.c 3 Jan 2005 17:46:40 -0000 1.7.4.6
--- s_main.c 14 Jan 2005 18:34:14 -0000 1.7.4.7
***************
*** 8,12 ****
*/
! char pd_version[] = "Pd version 0.38.0 devel\n";
char pd_compiletime[] = __TIME__;
char pd_compiledate[] = __DATE__;
--- 8,12 ----
*/
! char pd_version[] = "Pd version 0.38.1 devel\n";
char pd_compiletime[] = __TIME__;
char pd_compiledate[] = __DATE__;
***************
*** 61,65 ****
static t_symbol *sys_guidir;
t_namelist *sys_externlist;
! static t_namelist *sys_openlist;
static t_namelist *sys_messagelist;
static int sys_version;
--- 61,65 ----
static t_symbol *sys_guidir;
t_namelist *sys_externlist;
! static t_namelist *sys_openlist=NULL;
static t_namelist *sys_messagelist;
static int sys_version;
Index: m_simd.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/m_simd.c,v
retrieving revision 1.1.4.4
retrieving revision 1.1.4.5
diff -C2 -d -r1.1.4.4 -r1.1.4.5
*** m_simd.c 11 Jan 2005 21:41:14 -0000 1.1.4.4
--- m_simd.c 14 Jan 2005 18:34:13 -0000 1.1.4.5
***************
*** 37,41 ****
}
-
void copyvec(t_float *dst,const t_float *src,int n)
{
--- 37,40 ----
***************
*** 112,182 ****
}
- float env_tilde_accum_8(t_float* in, t_float* hp, t_int n)
- {
- float ret = 0;
- int i;
-
- n>>=3;
- for (i = 0; i !=n; ++i)
- {
- in--;
- ret += *hp++ * (*in * *in);
- in--;
- ret += *hp++ * (*in * *in);
- in--;
- ret += *hp++ * (*in * *in);
- in--;
- ret += *hp++ * (*in * *in);
- in--;
- ret += *hp++ * (*in * *in);
- in--;
- ret += *hp++ * (*in * *in);
- in--;
- ret += *hp++ * (*in * *in);
- in--;
- ret += *hp++ * (*in * *in);
- }
- return ret;
- }
-
- float peakvec(t_float* vec, t_int n, t_float cur_max)
- {
- int i;
- for (i = 0; i != n; ++i)
- {
- float f = *vec++;
- if (f > cur_max) cur_max = f;
- else if (-f > cur_max) cur_max = -f;
- }
- return cur_max;
- }
-
- void line_tilde_slope(t_float* out, t_int n, t_float* value,
- t_float* slopes, t_float* slopestep)
- {
- n>>=3;
- t_float slope = slopes[0];
- t_float f = *value;
- while (n--)
- {
- *out++ = f;
- f += slope;
- *out++ = f;
- f += slope;
- *out++ = f;
- f += slope;
- *out++ = f;
- f += slope;
- *out++ = f;
- f += slope;
- *out++ = f;
- f += slope;
- *out++ = f;
- f += slope;
- *out++ = f;
- f += slope;
- }
- }
-
#ifdef DONTUSESIMD
--- 111,114 ----
***************
*** 227,246 ****
}
- float env_tilde_accum_simd(t_float* in, t_float* hp, t_int n)
- {
- return env_tilde_accum_8(in, hp, n);
- }
-
- float peakvec_simd(t_float* vec, t_int n, t_float cur_max)
- {
- return peakvec(vec, n, cur_max);
- }
-
-
- /* float testfloat_simd(t_float f) */
- /* { */
- /* testfloat(f); */
- /* } */
-
#endif /* DONTUSESIMD */
--- 159,162 ----
Index: s_audio.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_audio.c,v
retrieving revision 1.5.4.6
retrieving revision 1.5.4.7
diff -C2 -d -r1.5.4.6 -r1.5.4.7
*** s_audio.c 11 Jan 2005 21:41:14 -0000 1.5.4.6
--- s_audio.c 14 Jan 2005 18:34:13 -0000 1.5.4.7
***************
*** 68,74 ****
extern int sys_callbackscheduler;
- float peakvec_simd(t_float* vec, t_int n, t_float cur_max);
float peakvec(t_float* vec, t_int n, t_float cur_max);
-
static float (*peak_fp)(t_float*, t_int, t_float) = peakvec;
--- 68,72 ----
***************
*** 458,461 ****
--- 456,473 ----
}
+ /* tb: default value of peak_fp {*/
+ float peakvec(t_float* vec, t_int n, t_float cur_max)
+ {
+ int i;
+ for (i = 0; i != n; ++i)
+ {
+ float f = *vec++;
+ if (f > cur_max) cur_max = f;
+ else if (-f > cur_max) cur_max = -f;
+ }
+ return cur_max;
+ }
+ /* } */
+
int sys_send_dacs(void)
{
Index: g_text.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_text.c,v
retrieving revision 1.5.4.1
retrieving revision 1.5.4.2
diff -C2 -d -r1.5.4.1 -r1.5.4.2
*** g_text.c 5 Nov 2004 14:27:46 -0000 1.5.4.1
--- g_text.c 14 Jan 2005 18:34:13 -0000 1.5.4.2
***************
*** 753,762 ****
"black");
}
! else
! {
! sys_vgui(".x%lx.c delete %lx.l\n", glist_getcanvas(glist), x);
! sys_unqueuegui(x);
! }
}
}
--- 753,760 ----
"black");
}
! else sys_vgui(".x%lx.c delete %lx.l\n", glist_getcanvas(glist), x);
}
+ if (!vis)
+ sys_unqueuegui(x);
}
Index: d_ctl.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/d_ctl.c,v
retrieving revision 1.3.4.8
retrieving revision 1.3.4.9
diff -C2 -d -r1.3.4.8 -r1.3.4.9
*** d_ctl.c 14 Jan 2005 17:33:19 -0000 1.3.4.8
--- d_ctl.c 14 Jan 2005 18:34:12 -0000 1.3.4.9
***************
*** 108,112 ****
int x_retarget;
float* x_slopes; /* tb: for simd-optimized line */
! float x_slopestep; /* tb: 4*x->x_inc */
} t_line;
--- 108,112 ----
int x_retarget;
float* x_slopes; /* tb: for simd-optimized line */
! float x_slopestep; /* tb: 4*x->x_inc */
} t_line;
***************
*** 147,150 ****
--- 147,177 ----
/* tb: vectorized / simd version { */
+ static void line_tilde_slope(t_float* out, t_int n, t_float* value,
+ t_float* slopes, t_float* slopestep)
+ {
+ t_float slope = slopes[0];
+ t_float f = *value;
+ n>>=3;
+ while (n--)
+ {
+ *out++ = f;
+ f += slope;
+ *out++ = f;
+ f += slope;
+ *out++ = f;
+ f += slope;
+ *out++ = f;
+ f += slope;
+ *out++ = f;
+ f += slope;
+ *out++ = f;
+ f += slope;
+ *out++ = f;
+ f += slope;
+ *out++ = f;
+ f += slope;
+ }
+ }
+
static t_int *line_tilde_perf8(t_int *w)
{
***************
*** 169,194 ****
{
float f = x->x_value;
! float slope = x->x_inc;
! n >>= 3;
! while (n--)
! {
! *out++ = f;
! f += slope;
! *out++ = f;
! f += slope;
! *out++ = f;
! f += slope;
! *out++ = f;
! f += slope;
! *out++ = f;
! f += slope;
! *out++ = f;
! f += slope;
! *out++ = f;
! f += slope;
! *out++ = f;
! f += slope;
! }
!
x->x_value += x->x_biginc;
x->x_ticksleft--;
--- 196,200 ----
{
float f = x->x_value;
! line_tilde_slope_simd(out, n, &x->x_value, x->x_slopes, &x->x_slopestep);
x->x_value += x->x_biginc;
x->x_ticksleft--;
***************
*** 232,238 ****
{
float f = x->x_value;
-
line_tilde_slope_simd(out, n, &x->x_value, x->x_slopes, &x->x_slopestep);
-
x->x_value += x->x_biginc;
x->x_ticksleft--;
--- 238,242 ----
***************
*** 732,736 ****
/* tb: loop unrolling and simd */
! float env_tilde_accum_8(t_float* in, t_float* hp, t_int n);
static t_int *env_tilde_perf8(t_int *w)
--- 736,767 ----
/* tb: loop unrolling and simd */
! static float env_tilde_accum_8(t_float* in, t_float* hp, t_int n)
! {
! float ret = 0;
! int i;
!
! n>>=3;
! for (i = 0; i !=n; ++i)
! {
! in--;
! ret += *hp++ * (*in * *in);
! in--;
! ret += *hp++ * (*in * *in);
! in--;
! ret += *hp++ * (*in * *in);
! in--;
! ret += *hp++ * (*in * *in);
! in--;
! ret += *hp++ * (*in * *in);
! in--;
! ret += *hp++ * (*in * *in);
! in--;
! ret += *hp++ * (*in * *in);
! in--;
! ret += *hp++ * (*in * *in);
! }
! return ret;
! }
!
static t_int *env_tilde_perf8(t_int *w)
Index: m_pd.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v
retrieving revision 1.4.4.7
retrieving revision 1.4.4.8
diff -C2 -d -r1.4.4.7 -r1.4.4.8
*** m_pd.h 11 Jan 2005 21:41:14 -0000 1.4.4.7
--- m_pd.h 14 Jan 2005 18:34:13 -0000 1.4.4.8
***************
*** 671,675 ****
EXTERN void copyvec_simd_unalignedsrc(t_float *dst,const t_float *src,int n);
! /* general, non-simd functions */
EXTERN void copyvec(t_float *dst,const t_float *src,int n);
EXTERN void addvec(t_float *dst,const t_float *src,int n);
--- 671,675 ----
EXTERN void copyvec_simd_unalignedsrc(t_float *dst,const t_float *src,int n);
! /* not vectorized, not simd functions */
EXTERN void copyvec(t_float *dst,const t_float *src,int n);
EXTERN void addvec(t_float *dst,const t_float *src,int n);
Index: g_array.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_array.c,v
retrieving revision 1.3.4.3
retrieving revision 1.3.4.4
diff -C2 -d -r1.3.4.3 -r1.3.4.4
*** g_array.c 14 Dec 2004 09:32:43 -0000 1.3.4.3
--- g_array.c 14 Jan 2005 18:34:13 -0000 1.3.4.4
***************
*** 976,1012 ****
- /* /\* add user to t_garray list *\/ */
- /* static void garray_adduser(t_garray *x, int *size, t_float **vec) */
- /* { */
- /* t_arrayuser * list = x->a_user */
- /* t_arrayuser * elem = getbytes (sizeof (t_arrayuser)); */
-
- /* elem->n_ptr = size; */
- /* elem->vec_prt = vec; */
- /* elem->next = NULL; */
-
- /* while(list->next != NULL) list = list->next; */
-
- /* list->next = elem; */
-
- /* return; */
- /* } */
-
- /* /\* add user to t_garray list *\/ */
- /* static void garray_updateusers(t_garray *x) */
- /* { */
- /* t_arrayuser * list = x->a_user */
- /* t_arrayuser * elem = getbytes (sizeof (t_arrayuser)); */
-
- /* elem->n_ptr = size; */
- /* elem->vec_prt = vec; */
- /* elem->next = NULL; */
-
- /* while(list->next != NULL) list = list->next; */
-
- /* list->next = elem; */
-
- /* return; */
- /* } */
/* routine that checks if we're just an array of floats and if
--- 976,979 ----
***************
*** 1031,1036 ****
else
{
- /* garray_adduser(x, size, vec); */
-
*size = garray_npoints(x);
*vec = (float *)garray_vec(x);
--- 998,1001 ----
Index: g_canvas.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_canvas.h,v
retrieving revision 1.3.4.2
retrieving revision 1.3.4.3
diff -C2 -d -r1.3.4.2 -r1.3.4.3
*** g_canvas.h 14 Dec 2004 09:36:08 -0000 1.3.4.2
--- g_canvas.h 14 Jan 2005 18:34:13 -0000 1.3.4.3
***************
*** 215,226 ****
- /* /\* tb: for easy updating when array changes *\/ */
- /* typedef struct _arrayuser */
- /* { */
- /* char** vec_prt; /\* pointer pointing to _array.a_vec *\/ */
- /* t_int* n_prt; /\* pointer pointing to _array.a_n *\/ */
- /* struct _arrayusers* next; /\* next element in list *\/ */
- /* } t_arrayuser; */
-
struct _array
{
--- 215,218 ----
***************
*** 232,236 ****
t_gpointer a_gp; /* pointer to scalar or array element we're in */
t_gstub *a_stub;
- /* t_arrayuser * a_user; */
};
--- 224,227 ----
Index: m_simd_sse_gcc.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/m_simd_sse_gcc.h,v
retrieving revision 1.1.4.6
retrieving revision 1.1.4.7
diff -C2 -d -r1.1.4.6 -r1.1.4.7
*** m_simd_sse_gcc.h 11 Jan 2005 21:41:14 -0000 1.1.4.6
--- m_simd_sse_gcc.h 14 Jan 2005 18:34:13 -0000 1.1.4.7
***************
*** 44,51 ****
t_int *sigrsqrt_perf_simd(t_int *w);
! float sumvec_simd(t_float* in, t_int n);
! //#define sum_vecsimd sumvec_8
! #define sigwrap_perf_simd sigwrap_perform /* SIMD not implemented */
#endif /* __M_SIMD_SSE_GCC_H */
--- 44,55 ----
t_int *sigrsqrt_perf_simd(t_int *w);
! /* functions in s_audio.c */
! float peakvec_simd(t_float* vec, t_int n, t_float cur_max);
! /* SIMD not implemented */
! #define sigwrap_perf_simd sigwrap_perform
!
! /* random dsp: */
! float sumvec_simd(t_float* in, t_int n);
#endif /* __M_SIMD_SSE_GCC_H */
Index: m_simd_sse_vc.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/m_simd_sse_vc.h,v
retrieving revision 1.1.4.7
retrieving revision 1.1.4.8
diff -C2 -d -r1.1.4.7 -r1.1.4.8
*** m_simd_sse_vc.h 12 Jan 2005 15:20:25 -0000 1.1.4.7
--- m_simd_sse_vc.h 14 Jan 2005 18:34:13 -0000 1.1.4.8
***************
*** 41,49 ****
t_int *sigrsqrt_perf_simd(t_int *w);
! #define sum_vecsimd sumvec_8 /* SIMD not implemented */
! #define env_tilde_accum_simd env_tilde_accum_8 /* SIMD not implemented */
! #define copyvec_simd_unalignedsrc copyvec_8 /* SIMD not implemented */
! #define sigwrap_perf_simd sigwrap_perform /* SIMD not implemented */
! #define line_tilde_slope_simd line_tilde_slope /* SIMD not implemented */
--- 41,53 ----
t_int *sigrsqrt_perf_simd(t_int *w);
! /* functions in s_audio.c */
! #define peakvec_simd peakvec
!
! /* SIMD not implemented: */
! #define sum_vecsimd sumvec_8
! #define env_tilde_accum_simd env_tilde_accum_8
! #define copyvec_simd_unalignedsrc copyvec_8
! #define sigwrap_perf_simd sigwrap_perform
! #define line_tilde_slope_simd line_tilde_slope
Index: m_simd_def.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/m_simd_def.h,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -C2 -d -r1.1.4.1 -r1.1.4.2
*** m_simd_def.h 5 Nov 2004 13:33:19 -0000 1.1.4.1
--- m_simd_def.h 14 Jan 2005 18:34:13 -0000 1.1.4.2
***************
*** 20,23 ****
--- 20,25 ----
/* functions in d_ctl.c */
#define sig_tilde_perf_simd sig_tilde_perf8
+ #define sigwrap_perf_simd sigwrap_perform
+ #define line_tilde_slope_simd line_tilde_slope
/* functions in d_arithmetic.c */
***************
*** 42,44 ****
--- 44,51 ----
#define sigrsqrt_perf_simd sigrsqrt_perform /* SIMD not implemented */
+ /* functions in s_audio.c */
+ #define peakvec_simd peakvec
+
+ #define sum_vecsimd sumvec_8
+
#endif /* __M_SIMD_DEF_H */
Index: m_simd_ve_gcc.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/m_simd_ve_gcc.h,v
retrieving revision 1.1.4.5
retrieving revision 1.1.4.6
diff -C2 -d -r1.1.4.5 -r1.1.4.6
*** m_simd_ve_gcc.h 12 Jan 2005 15:18:33 -0000 1.1.4.5
--- m_simd_ve_gcc.h 14 Jan 2005 18:34:13 -0000 1.1.4.6
***************
*** 41,49 ****
t_int *sigrsqrt_perf_simd(t_int *w);
! #define env_tilde_accum_simd env_tilde_accum_8 /* SIMD not implemented */
! #define copyvec_simd_unalignedsrc copyvec_8 /* SIMD not implemented */
! #define sum_vecsimd sumvec_8 /* SIMD not implemented */
! #define line_tilde_slope_simd line_tilde_slope /* SIMD not implemented */
! #define peakvec_simd peakvec /* SIMD not implemented */
#endif /* __M_SIMD_VE_GCC_H */
--- 41,51 ----
t_int *sigrsqrt_perf_simd(t_int *w);
! /* SIMD not implemented */
! #define env_tilde_accum_simd env_tilde_accum_8
! #define copyvec_simd_unalignedsrc copyvec_8
! #define sum_vecsimd sumvec_8
! #define line_tilde_slope_simd line_tilde_slope
! #define peakvec_simd peakvec
!
#endif /* __M_SIMD_VE_GCC_H */
Index: d_delay.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/d_delay.c,v
retrieving revision 1.2.4.4
retrieving revision 1.2.4.5
diff -C2 -d -r1.2.4.4 -r1.2.4.5
*** d_delay.c 11 Jan 2005 21:41:14 -0000 1.2.4.4
--- d_delay.c 14 Jan 2005 18:34:13 -0000 1.2.4.5
***************
*** 8,12 ****
#include "m_simd.h"
- #define DEL_SIMD
extern int ugen_getsortno(void);
--- 8,11 ----
***************
*** 68,74 ****
nsamps += ((- nsamps) & (SAMPBLK - 1));
nsamps += DEFDELVS;
! #ifdef DEL_SIMD
! nsamps += (SIMD_BYTEALIGN - nsamps) % SIMD_BYTEALIGN;
#endif
x->x_cspace.c_n = nsamps;
x->x_cspace.c_vec =
--- 67,75 ----
nsamps += ((- nsamps) & (SAMPBLK - 1));
nsamps += DEFDELVS;
!
! #ifdef SIMD_BYTEALIGN
! nsamps += (SIMD_BYTEALIGN - nsamps) % SIMD_BYTEALIGN; /* tb: for simd */
#endif
+
x->x_cspace.c_n = nsamps;
x->x_cspace.c_vec =