Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13304
Modified Files: Tag: desiredata builtins_dsp.c Log Message: added [>~] [<~]
Index: builtins_dsp.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/builtins_dsp.c,v retrieving revision 1.1.2.31 retrieving revision 1.1.2.32 diff -C2 -d -r1.1.2.31 -r1.1.2.32 *** builtins_dsp.c 19 Jul 2007 19:57:15 -0000 1.1.2.31 --- builtins_dsp.c 4 Oct 2007 07:09:34 -0000 1.1.2.32 *************** *** 48,57 ****
/* ----------------------------- plus ----------------------------- */ - static t_class *plus_class, *scalarplus_class; - static t_class *minus_class, *scalarminus_class; - static t_class *times_class, *scalartimes_class; - static t_class *over_class, *scalarover_class; - static t_class *max_class, *scalarmax_class; - static t_class *min_class, *scalarmin_class;
struct t_dop : t_object { --- 48,51 ---- *************** *** 60,69 **** };
! typedef t_dop t_plus, t_scalarplus; ! typedef t_dop t_min, t_scalarmin; ! typedef t_dop t_max, t_scalarmax; ! typedef t_dop t_over, t_scalarover; ! typedef t_dop t_times, t_scalartimes; ! typedef t_dop t_minus, t_scalarminus;
#define DSPNEW(NAME,SYM) \ --- 54,66 ---- };
! #define DSPDECL(NAME) static t_class *NAME##_class, *scalar##NAME##_class; typedef t_dop t_##NAME, t_scalar##NAME; ! DSPDECL(plus) ! DSPDECL(minus) ! DSPDECL(times) ! DSPDECL(over) ! DSPDECL(max) ! DSPDECL(min) ! DSPDECL(lt) ! DSPDECL(gt)
#define DSPNEW(NAME,SYM) \ *************** *** 88,91 **** --- 85,89 ---- class_sethelpsymbol(scalar##NAME##_class, gensym("sigbinops"));}
+ /* use when simd functions are present */ #define DSPDSP(NAME) \ static void NAME##_dsp(t_minus *x, t_signal **sp) { \ *************** *** 102,105 **** --- 100,114 ---- else dsp_add(scalar##NAME##_perf8, 4, sp[0]->v, &x->b, sp[1]->v, n);}
+ /* use when simd functions are missing */ + #define DSPDSP2(NAME) \ + static void NAME##_dsp(t_minus *x, t_signal **sp) { \ + const int n = sp[0]->n; \ + if(n&7) dsp_add(NAME##_perform, 4, sp[0]->v, sp[1]->v, sp[2]->v, n); \ + else dsp_add(NAME##_perf8, 4, sp[0]->v, sp[1]->v, sp[2]->v, n);} \ + static void scalar##NAME##_dsp(t_scalarminus *x, t_signal **sp) { \ + const int n = sp[0]->n;\ + if(n&7) dsp_add(scalar##NAME##_perform, 4, sp[0]->v, &x->b,sp[1]->v, n);\ + else dsp_add(scalar##NAME##_perf8, 4, sp[0]->v, &x->b, sp[1]->v, n);} + #define PERFORM(NAME,EXPR) \ t_int *NAME##_perform(t_int *w) { \ *************** *** 188,191 **** --- 197,202 ---- PERFORM(min ,a<b?a:b) DSPDSP(min) DSPNEW(min ,"min~") PERFORM(max ,a>b?a:b) DSPDSP(max) DSPNEW(max ,"max~") + PERFORM(lt ,a<b) DSPDSP2(lt) DSPNEW(lt ,"<~") + PERFORM(gt ,a>b) DSPDSP2(gt) DSPNEW(gt ,">~")
t_int *over_perform(t_int *w) { *************** *** 3762,3765 **** --- 3773,3778 ---- max_setup(); min_setup(); + lt_setup(); + gt_setup();
tab_tilde_setup();