From 34a2ba5cba836ebc1211b33381c648160ca71ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 3 Jan 2008 11:15:25 +0000 Subject: use t_float/t_sample instead of "float" and where appropriate svn path=/trunk/externals/zexy/; revision=9111 --- src/0x3e0x7e.c | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'src/0x3e0x7e.c') diff --git a/src/0x3e0x7e.c b/src/0x3e0x7e.c index fd1e6be..03522ee 100644 --- a/src/0x3e0x7e.c +++ b/src/0x3e0x7e.c @@ -30,13 +30,13 @@ static t_class *gt_tilde_class, *scalargt_tilde_class; typedef struct _gt_tilde { t_object x_obj; - float x_f; + t_float x_f; } t_gt_tilde; typedef struct _scalargt_tilde { t_object x_obj; - float x_f; + t_float x_f; t_float x_g; /* inlet value */ } t_scalargt_tilde; @@ -65,9 +65,9 @@ static void *gt_tilde_new(t_symbol *s, int argc, t_atom *argv) static t_int *gt_tilde_perform(t_int *w) { - t_float *in1 = (t_float *)(w[1]); - t_float *in2 = (t_float *)(w[2]); - t_float *out = (t_float *)(w[3]); + t_sample *in1 = (t_sample *)(w[1]); + t_sample *in2 = (t_sample *)(w[2]); + t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); while (n--) *out++ = *in1++ > *in2++; return (w+5); @@ -75,17 +75,17 @@ static t_int *gt_tilde_perform(t_int *w) static t_int *gt_tilde_perf8(t_int *w) { - t_float *in1 = (t_float *)(w[1]); - t_float *in2 = (t_float *)(w[2]); - t_float *out = (t_float *)(w[3]); + t_sample *in1 = (t_sample *)(w[1]); + t_sample *in2 = (t_sample *)(w[2]); + t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); for (; n; n -= 8, in1 += 8, in2 += 8, out += 8) { - float f0 = in1[0], f1 = in1[1], f2 = in1[2], f3 = in1[3]; - float f4 = in1[4], f5 = in1[5], f6 = in1[6], f7 = in1[7]; + t_sample f0 = in1[0], f1 = in1[1], f2 = in1[2], f3 = in1[3]; + t_sample f4 = in1[4], f5 = in1[5], f6 = in1[6], f7 = in1[7]; - float g0 = in2[0], g1 = in2[1], g2 = in2[2], g3 = in2[3]; - float g4 = in2[4], g5 = in2[5], g6 = in2[6], g7 = in2[7]; + t_sample g0 = in2[0], g1 = in2[1], g2 = in2[2], g3 = in2[3]; + t_sample g4 = in2[4], g5 = in2[5], g6 = in2[6], g7 = in2[7]; out[0] = f0 > g0; out[1] = f1 > g1; out[2] = f2 > g2; out[3] = f3 > g3; out[4] = f4 > g4; out[5] = f5 > g5; out[6] = f6 > g6; out[7] = f7 > g7; @@ -95,9 +95,9 @@ static t_int *gt_tilde_perf8(t_int *w) static t_int *scalargt_tilde_perform(t_int *w) { - t_float *in = (t_float *)(w[1]); - t_float f = *(t_float *)(w[2]); - t_float *out = (t_float *)(w[3]); + t_sample *in = (t_sample *)(w[1]); + t_sample f = *(t_float *)(w[2]); + t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); while (n--) *out++ = *in++ > f; return (w+5); @@ -105,14 +105,14 @@ static t_int *scalargt_tilde_perform(t_int *w) static t_int *scalargt_tilde_perf8(t_int *w) { - t_float *in = (t_float *)(w[1]); - t_float g = *(t_float *)(w[2]); - t_float *out = (t_float *)(w[3]); + t_sample *in = (t_sample *)(w[1]); + t_sample g = *(t_float *)(w[2]); + t_sample *out = (t_sample *)(w[3]); int n = (int)(w[4]); for (; n; n -= 8, in += 8, out += 8) { - float f0 = in[0], f1 = in[1], f2 = in[2], f3 = in[3]; - float f4 = in[4], f5 = in[5], f6 = in[6], f7 = in[7]; + t_sample f0 = in[0], f1 = in[1], f2 = in[2], f3 = in[3]; + t_sample f4 = in[4], f5 = in[5], f6 = in[6], f7 = in[7]; out[0] = f0 > g; out[1] = f1 > g; out[2] = f2 > g; out[3] = f3 > g; out[4] = f4 > g; out[5] = f5 > g; out[6] = f6 > g; out[7] = f7 > g; @@ -153,7 +153,7 @@ static t_int *scalargt_tilde_performSSE(t_int *w) { __m128 *in = (__m128 *)(w[1]); __m128 *out = (__m128 *)(w[3]); - t_float f = *(t_float *)(w[2]); + float f = *(t_float *)(w[2]); __m128 scalar = _mm_set1_ps(f); int n = (int)(w[4])>>4; const __m128 one = _mm_set1_ps(1.f); @@ -195,7 +195,8 @@ static void gt_tilde_dsp(t_gt_tilde *x, t_signal **sp) Z_SIMD_CHKBLOCKSIZE(n)&& Z_SIMD_CHKALIGN(in1)&& Z_SIMD_CHKALIGN(in2)&& - Z_SIMD_CHKALIGN(out) + Z_SIMD_CHKALIGN(out)&& + ZEXY_TYPE_EQUAL(t_sample, float) ) { dsp_add(gt_tilde_performSSE, 4, in1, in2, out, n); @@ -217,7 +218,8 @@ static void scalargt_tilde_dsp(t_scalargt_tilde *x, t_signal **sp) if( Z_SIMD_CHKBLOCKSIZE(n)&& Z_SIMD_CHKALIGN(in)&& - Z_SIMD_CHKALIGN(out) + Z_SIMD_CHKALIGN(out)&& + ZEXY_TYPE_EQUAL(t_sample, float) ) { dsp_add(scalargt_tilde_performSSE, 4, in, &x->x_g, out, n); -- cgit v1.2.1