summaryrefslogtreecommitdiffstats
path: root/src/macros.h
diff options
context:
space:
mode:
authorAnthony Blake <anthonix@me.com>2012-11-15 15:31:39 +1300
committerAnthony Blake <anthonix@me.com>2012-11-15 15:31:39 +1300
commit09beffbe4a15a1d9ff4eab718f7e077ad52f9181 (patch)
tree9cbb15bd31bb00ce4f0f1df85b8aaa2f3760c29d /src/macros.h
parent3c5f840a17c20a20eeb09f6628c1e2f16b8b9ca9 (diff)
downloadffts-09beffbe4a15a1d9ff4eab718f7e077ad52f9181.zip
ffts-09beffbe4a15a1d9ff4eab718f7e077ad52f9181.tar.gz
Fixed some compiler warnings, generalized transform interface (in prep for double etc)
Diffstat (limited to 'src/macros.h')
-rw-r--r--src/macros.h96
1 files changed, 54 insertions, 42 deletions
diff --git a/src/macros.h b/src/macros.h
index e645b11..effc87d 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -221,99 +221,111 @@ L_4_2(int inv, const data_t * restrict i0, const data_t * restrict i1, const dat
}
__INLINE void
-firstpass_16_f(ffts_plan_t * p, const data_t * in, data_t * out) {
+firstpass_16_f(ffts_plan_t * p, const void * in, void * out) {
+ const data_t *din = (const data_t *)in;
+ data_t *dout = (data_t *)out;
V r0_1,r2_3,r4_5,r6_7,r8_9,r10_11,r12_13,r14_15;
float *LUT8 = p->ws ;
- L_4_4(0, in+0,in+16,in+8,in+24,&r0_1,&r2_3,&r8_9,&r10_11);
- L_2_4(0, in+4,in+20,in+28,in+12,&r4_5,&r6_7,&r14_15,&r12_13);
+ L_4_4(0, din+0,din+16,din+8,din+24,&r0_1,&r2_3,&r8_9,&r10_11);
+ L_2_4(0, din+4,din+20,din+28,din+12,&r4_5,&r6_7,&r14_15,&r12_13);
K_N(0, VLD(LUT8),VLD(LUT8+4),&r0_1,&r2_3,&r4_5,&r6_7);
K_N(0, VLD(LUT8+8),VLD(LUT8+12),&r0_1,&r4_5,&r8_9,&r12_13);
- S_4(r0_1,r4_5,r8_9,r12_13,out+0,out+8,out+16,out+24);
+ S_4(r0_1,r4_5,r8_9,r12_13,dout+0,dout+8,dout+16,dout+24);
K_N(0, VLD(LUT8+16),VLD(LUT8+20),&r2_3,&r6_7,&r10_11,&r14_15);
- S_4(r2_3,r6_7,r10_11,r14_15,out+4,out+12,out+20,out+28);
+ S_4(r2_3,r6_7,r10_11,r14_15,dout+4,dout+12,dout+20,dout+28);
}
__INLINE void
-firstpass_16_b(ffts_plan_t * p, const data_t * in, data_t * out) {
+firstpass_16_b(ffts_plan_t * p, const void * in, void * out) {
+ const data_t *din = (const data_t *)in;
+ data_t *dout = (data_t *)out;
V r0_1,r2_3,r4_5,r6_7,r8_9,r10_11,r12_13,r14_15;
float *LUT8 = p->ws ;
- L_4_4(1, in+0,in+16,in+8,in+24,&r0_1,&r2_3,&r8_9,&r10_11);
- L_2_4(1, in+4,in+20,in+28,in+12,&r4_5,&r6_7,&r14_15,&r12_13);
+ L_4_4(1, din+0,din+16,din+8,din+24,&r0_1,&r2_3,&r8_9,&r10_11);
+ L_2_4(1, din+4,din+20,din+28,din+12,&r4_5,&r6_7,&r14_15,&r12_13);
K_N(1, VLD(LUT8),VLD(LUT8+4),&r0_1,&r2_3,&r4_5,&r6_7);
K_N(1, VLD(LUT8+8),VLD(LUT8+12),&r0_1,&r4_5,&r8_9,&r12_13);
- S_4(r0_1,r4_5,r8_9,r12_13,out+0,out+8,out+16,out+24);
+ S_4(r0_1,r4_5,r8_9,r12_13,dout+0,dout+8,dout+16,dout+24);
K_N(1, VLD(LUT8+16),VLD(LUT8+20),&r2_3,&r6_7,&r10_11,&r14_15);
- S_4(r2_3,r6_7,r10_11,r14_15,out+4,out+12,out+20,out+28);
+ S_4(r2_3,r6_7,r10_11,r14_15,dout+4,dout+12,dout+20,dout+28);
}
__INLINE void
-firstpass_8_f(ffts_plan_t * p, const data_t * in, data_t * out) {
+firstpass_8_f(ffts_plan_t * p, const void * in, void * out) {
+ const data_t *din = (const data_t *)in;
+ data_t *dout = (data_t *)out;
V r0_1,r2_3,r4_5,r6_7;
float *LUT8 = p->ws + p->ws_is[0];
- L_4_2(0, in+0,in+8,in+4,in+12,&r0_1,&r2_3,&r4_5,&r6_7);
+ L_4_2(0, din+0,din+8,din+4,din+12,&r0_1,&r2_3,&r4_5,&r6_7);
K_N(0, VLD(LUT8),VLD(LUT8+4),&r0_1,&r2_3,&r4_5,&r6_7);
- S_4(r0_1,r2_3,r4_5,r6_7,out+0,out+4,out+8,out+12);
+ S_4(r0_1,r2_3,r4_5,r6_7,dout+0,dout+4,dout+8,dout+12);
}
__INLINE void
-firstpass_8_b(ffts_plan_t * p, const data_t * in, data_t * out) {
+firstpass_8_b(ffts_plan_t * p, const void * in, void * out) {
+ const data_t *din = (const data_t *)in;
+ data_t *dout = (data_t *)out;
V r0_1,r2_3,r4_5,r6_7;
float *LUT8 = p->ws + p->ws_is[0];
- L_4_2(1, in+0,in+8,in+4,in+12,&r0_1,&r2_3,&r4_5,&r6_7);
+ L_4_2(1, din+0,din+8,din+4,din+12,&r0_1,&r2_3,&r4_5,&r6_7);
K_N(1, VLD(LUT8),VLD(LUT8+4),&r0_1,&r2_3,&r4_5,&r6_7);
- S_4(r0_1,r2_3,r4_5,r6_7,out+0,out+4,out+8,out+12);
+ S_4(r0_1,r2_3,r4_5,r6_7,dout+0,dout+4,dout+8,dout+12);
}
__INLINE void
-firstpass_4_f(ffts_plan_t * p, const data_t * in, data_t * out) {
- cdata_t *i = (cdata_t *)in, *o = (cdata_t *)out;
+firstpass_4_f(ffts_plan_t * p, const void * in, void * out) {
+ const data_t *din = (const data_t *)in;
+ data_t *dout = (data_t *)out;
cdata_t t0, t1, t2, t3, t4, t5, t6, t7;
- t0[0] = in[0]; t0[1] = in[1];
- t1[0] = in[4]; t1[1] = in[5];
- t2[0] = in[2]; t2[1] = in[3];
- t3[0] = in[6]; t3[1] = in[7];
+ t0[0] = din[0]; t0[1] = din[1];
+ t1[0] = din[4]; t1[1] = din[5];
+ t2[0] = din[2]; t2[1] = din[3];
+ t3[0] = din[6]; t3[1] = din[7];
t4[0] = t0[0] + t1[0]; t4[1] = t0[1] + t1[1];
t5[0] = t0[0] - t1[0]; t5[1] = t0[1] - t1[1];
t6[0] = t2[0] + t3[0]; t6[1] = t2[1] + t3[1];
t7[0] = t2[0] - t3[0]; t7[1] = t2[1] - t3[1];
- out[0] = t4[0] + t6[0]; out[1] = t4[1] + t6[1];
- out[4] = t4[0] - t6[0]; out[5] = t4[1] - t6[1];
- out[2] = t5[0] + t7[1]; out[3] = t5[1] - t7[0];
- out[6] = t5[0] - t7[1]; out[7] = t5[1] + t7[0];
+ dout[0] = t4[0] + t6[0]; dout[1] = t4[1] + t6[1];
+ dout[4] = t4[0] - t6[0]; dout[5] = t4[1] - t6[1];
+ dout[2] = t5[0] + t7[1]; dout[3] = t5[1] - t7[0];
+ dout[6] = t5[0] - t7[1]; dout[7] = t5[1] + t7[0];
}
__INLINE void
-firstpass_4_b(ffts_plan_t * p, const data_t * in, data_t * out) {
- cdata_t *i = (cdata_t *)in, *o = (cdata_t *)out;
+firstpass_4_b(ffts_plan_t * p, const void * in, void * out) {
+ const data_t *din = (const data_t *)in;
+ data_t *dout = (data_t *)out;
cdata_t t0, t1, t2, t3, t4, t5, t6, t7;
- t0[0] = in[0]; t0[1] = in[1];
- t1[0] = in[4]; t1[1] = in[5];
- t2[0] = in[2]; t2[1] = in[3];
- t3[0] = in[6]; t3[1] = in[7];
+ t0[0] = din[0]; t0[1] = din[1];
+ t1[0] = din[4]; t1[1] = din[5];
+ t2[0] = din[2]; t2[1] = din[3];
+ t3[0] = din[6]; t3[1] = din[7];
t4[0] = t0[0] + t1[0]; t4[1] = t0[1] + t1[1];
t5[0] = t0[0] - t1[0]; t5[1] = t0[1] - t1[1];
t6[0] = t2[0] + t3[0]; t6[1] = t2[1] + t3[1];
t7[0] = t2[0] - t3[0]; t7[1] = t2[1] - t3[1];
- out[0] = t4[0] + t6[0]; out[1] = t4[1] + t6[1];
- out[4] = t4[0] - t6[0]; out[5] = t4[1] - t6[1];
- out[2] = t5[0] - t7[1]; out[3] = t5[1] + t7[0];
- out[6] = t5[0] + t7[1]; out[7] = t5[1] - t7[0];
+ dout[0] = t4[0] + t6[0]; dout[1] = t4[1] + t6[1];
+ dout[4] = t4[0] - t6[0]; dout[5] = t4[1] - t6[1];
+ dout[2] = t5[0] - t7[1]; dout[3] = t5[1] + t7[0];
+ dout[6] = t5[0] + t7[1]; dout[7] = t5[1] - t7[0];
}
__INLINE void
-firstpass_2(ffts_plan_t * p, const data_t * in, data_t * out) {
- cdata_t t0, t1, r0,r1;
- t0[0] = in[0]; t0[1] = in[1];
- t1[0] = in[2]; t1[1] = in[3];
+firstpass_2(ffts_plan_t * p, const void * in, void * out) {
+ const data_t *din = (const data_t *)in;
+ data_t *dout = (data_t *)out;
+ cdata_t t0, t1, r0,r1;
+ t0[0] = din[0]; t0[1] = din[1];
+ t1[0] = din[2]; t1[1] = din[3];
r0[0] = t0[0] + t1[0];
r0[1] = t0[1] + t1[1];
r1[0] = t0[0] - t1[0];
r1[1] = t0[1] - t1[1];
- out[0] = r0[0]; out[1] = r0[1];
- out[2] = r1[0]; out[3] = r1[1];
+ dout[0] = r0[0]; dout[1] = r0[1];
+ dout[2] = r1[0]; dout[3] = r1[1];
}
#endif
OpenPOWER on IntegriCloud