Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8434
Modified Files: Tag: devel_0_38 d_ctl.c Log Message: minor speedup for line~
Index: d_ctl.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_ctl.c,v retrieving revision 1.3.4.2 retrieving revision 1.3.4.3 diff -C2 -d -r1.3.4.2 -r1.3.4.3 *** d_ctl.c 22 Nov 2004 20:25:11 -0000 1.3.4.2 --- d_ctl.c 8 Jan 2005 09:41:02 -0000 1.3.4.3 *************** *** 143,147 **** }
! /* TB: vectorized version */ static t_int *line_tilde_perf8(t_int *w) { --- 143,147 ---- }
! /* tb: vectorized / simd version { */ static t_int *line_tilde_perf8(t_int *w) { *************** *** 157,160 **** --- 157,161 ---- int nticks = x->x_inletwas * x->x_dspticktomsec; if (!nticks) nticks = 1; + post("nticks %d", nticks); x->x_ticksleft = nticks; x->x_biginc = (x->x_target - x->x_value)/(float)nticks; *************** *** 165,169 **** { float f = x->x_value; ! while (n--) *out++ = f, f += x->x_inc; x->x_value += x->x_biginc; x->x_ticksleft--; --- 166,190 ---- { float f = x->x_value; ! n >>= 3; ! while (n--) ! { ! *out++ = f; ! f += x->x_inc; ! *out++ = f; ! f += x->x_inc; ! *out++ = f; ! f += x->x_inc; ! *out++ = f; ! f += x->x_inc; ! *out++ = f; ! f += x->x_inc; ! *out++ = f; ! f += x->x_inc; ! *out++ = f; ! f += x->x_inc; ! *out++ = f; ! f += x->x_inc; ! } ! x->x_value += x->x_biginc; x->x_ticksleft--; *************** *** 172,184 **** { float f = x->x_value = x->x_target; ! for (; n; n -= 8, out += 8) ! { ! out[0] = f; out[1] = f; out[2] = f; out[3] = f; ! out[4] = f; out[5] = f; out[6] = f; out[7] = f; ! } } return (w+4); }
static void line_tilde_float(t_line *x, t_float f) { --- 193,256 ---- { float f = x->x_value = x->x_target; ! setvec_8(out,f,n); ! } ! return (w+4); ! } ! ! ! static t_int *line_tilde_perfsimd(t_int *w) ! { ! t_line *x = (t_line *)(w[1]); ! t_float *out = (t_float *)(w[2]); ! int n = (int)(w[3]); ! float f = x->x_value; ! ! if (PD_BIGORSMALL(f)) ! x->x_value = f = 0; ! if (x->x_retarget) ! { ! int nticks = x->x_inletwas * x->x_dspticktomsec; ! if (!nticks) nticks = 1; ! x->x_ticksleft = nticks; ! x->x_biginc = (x->x_target - x->x_value)/(float)nticks; ! x->x_inc = x->x_1overn * x->x_biginc; ! x->x_retarget = 0; ! } ! if (x->x_ticksleft) ! { ! float f = x->x_value; ! n >>= 3; ! while (n--) ! { ! *out++ = f; ! f += x->x_inc; ! *out++ = f; ! f += x->x_inc; ! *out++ = f; ! f += x->x_inc; ! *out++ = f; ! f += x->x_inc; ! *out++ = f; ! f += x->x_inc; ! *out++ = f; ! f += x->x_inc; ! *out++ = f; ! f += x->x_inc; ! *out++ = f; ! f += x->x_inc; ! } ! x->x_value += x->x_biginc; ! x->x_ticksleft--; ! } ! else ! { ! float f = x->x_value = x->x_target; ! setvec_8(out,f,n); } return (w+4); }
+ /* tb } */ + static void line_tilde_float(t_line *x, t_float f) { *************** *** 207,212 **** if(sp[0]->s_n&7) dsp_add(line_tilde_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); ! else ! dsp_add(line_tilde_perf8, 3, x, sp[0]->s_vec, sp[0]->s_n); x->x_1overn = 1./sp[0]->s_n; x->x_dspticktomsec = sp[0]->s_sr / (1000 * sp[0]->s_n); --- 279,288 ---- if(sp[0]->s_n&7) dsp_add(line_tilde_perform, 3, x, sp[0]->s_vec, sp[0]->s_n); ! else ! if (SIMD_CHECK1(sp[0]->s_n,sp[0]->s_vec)) ! dsp_add(line_tilde_perfsimd, 3, x, sp[0]->s_vec, sp[0]->s_n); ! else ! dsp_add(line_tilde_perf8, 3, x, sp[0]->s_vec, sp[0]->s_n); ! x->x_1overn = 1./sp[0]->s_n; x->x_dspticktomsec = sp[0]->s_sr / (1000 * sp[0]->s_n);