mirror of
https://github.com/mborgerding/kissfft.git
synced 2026-02-23 23:42:57 -05:00
Added USE_SIMD compatibility for Visual Studio
This commit is contained in:
50
kiss_fft.c
50
kiss_fft.c
@ -69,15 +69,15 @@ static void kf_bfly4(
|
||||
C_ADDTO( *Fout , scratch[3] );
|
||||
|
||||
if(st->inverse) {
|
||||
Fout[m].r = scratch[5].r - scratch[4].i;
|
||||
Fout[m].i = scratch[5].i + scratch[4].r;
|
||||
Fout[m3].r = scratch[5].r + scratch[4].i;
|
||||
Fout[m3].i = scratch[5].i - scratch[4].r;
|
||||
Fout[m].r = S_SUB(scratch[5].r, scratch[4].i);
|
||||
Fout[m].i = S_ADD(scratch[5].i, scratch[4].r);
|
||||
Fout[m3].r = S_ADD(scratch[5].r, scratch[4].i);
|
||||
Fout[m3].i = S_SUB(scratch[5].i, scratch[4].r);
|
||||
}else{
|
||||
Fout[m].r = scratch[5].r + scratch[4].i;
|
||||
Fout[m].i = scratch[5].i - scratch[4].r;
|
||||
Fout[m3].r = scratch[5].r - scratch[4].i;
|
||||
Fout[m3].i = scratch[5].i + scratch[4].r;
|
||||
Fout[m].r = S_ADD(scratch[5].r, scratch[4].i);
|
||||
Fout[m].i = S_SUB(scratch[5].i, scratch[4].r);
|
||||
Fout[m3].r = S_SUB(scratch[5].r, scratch[4].i);
|
||||
Fout[m3].i = S_ADD(scratch[5].i, scratch[4].r);
|
||||
}
|
||||
++Fout;
|
||||
}while(--k);
|
||||
@ -110,18 +110,18 @@ static void kf_bfly3(
|
||||
tw1 += fstride;
|
||||
tw2 += fstride*2;
|
||||
|
||||
Fout[m].r = Fout->r - HALF_OF(scratch[3].r);
|
||||
Fout[m].i = Fout->i - HALF_OF(scratch[3].i);
|
||||
Fout[m].r = S_SUB(Fout->r, HALF_OF(scratch[3].r));
|
||||
Fout[m].i = S_SUB(Fout->i, HALF_OF(scratch[3].i));
|
||||
|
||||
C_MULBYSCALAR( scratch[0] , epi3.i );
|
||||
|
||||
C_ADDTO(*Fout,scratch[3]);
|
||||
|
||||
Fout[m2].r = Fout[m].r + scratch[0].i;
|
||||
Fout[m2].i = Fout[m].i - scratch[0].r;
|
||||
Fout[m2].r = S_ADD(Fout[m].r, scratch[0].i);
|
||||
Fout[m2].i = S_SUB(Fout[m].i, scratch[0].r);
|
||||
|
||||
Fout[m].r -= scratch[0].i;
|
||||
Fout[m].i += scratch[0].r;
|
||||
Fout[m].r = S_SUB(Fout[m].r, scratch[0].i);
|
||||
Fout[m].i = S_ADD(Fout[m].i, scratch[0].r);
|
||||
|
||||
++Fout;
|
||||
}while(--k);
|
||||
@ -164,22 +164,22 @@ static void kf_bfly5(
|
||||
C_ADD( scratch[8],scratch[2],scratch[3]);
|
||||
C_SUB( scratch[9],scratch[2],scratch[3]);
|
||||
|
||||
Fout0->r += scratch[7].r + scratch[8].r;
|
||||
Fout0->i += scratch[7].i + scratch[8].i;
|
||||
Fout0->r = S_ADD3(Fout0->r, scratch[7].r, scratch[8].r);
|
||||
Fout0->i = S_ADD3(Fout0->i, scratch[7].i, scratch[8].i);
|
||||
|
||||
scratch[5].r = scratch[0].r + S_MUL(scratch[7].r,ya.r) + S_MUL(scratch[8].r,yb.r);
|
||||
scratch[5].i = scratch[0].i + S_MUL(scratch[7].i,ya.r) + S_MUL(scratch[8].i,yb.r);
|
||||
scratch[5].r = S_ADD3(scratch[0].r, S_MUL(scratch[7].r,ya.r), S_MUL(scratch[8].r,yb.r));
|
||||
scratch[5].i = S_ADD3(scratch[0].i, S_MUL(scratch[7].i,ya.r), S_MUL(scratch[8].i,yb.r));
|
||||
|
||||
scratch[6].r = S_MUL(scratch[10].i,ya.i) + S_MUL(scratch[9].i,yb.i);
|
||||
scratch[6].i = -S_MUL(scratch[10].r,ya.i) - S_MUL(scratch[9].r,yb.i);
|
||||
scratch[6].r = S_ADD(S_MUL(scratch[10].i,ya.i), S_MUL(scratch[9].i,yb.i));
|
||||
scratch[6].i = S_SUB(S_INV_SIGN(S_MUL(scratch[10].r,ya.i)), S_MUL(scratch[9].r,yb.i));
|
||||
|
||||
C_SUB(*Fout1,scratch[5],scratch[6]);
|
||||
C_ADD(*Fout4,scratch[5],scratch[6]);
|
||||
|
||||
scratch[11].r = scratch[0].r + S_MUL(scratch[7].r,yb.r) + S_MUL(scratch[8].r,ya.r);
|
||||
scratch[11].i = scratch[0].i + S_MUL(scratch[7].i,yb.r) + S_MUL(scratch[8].i,ya.r);
|
||||
scratch[12].r = - S_MUL(scratch[10].i,yb.i) + S_MUL(scratch[9].i,ya.i);
|
||||
scratch[12].i = S_MUL(scratch[10].r,yb.i) - S_MUL(scratch[9].r,ya.i);
|
||||
scratch[11].r = S_ADD3(scratch[0].r, S_MUL(scratch[7].r,yb.r), S_MUL(scratch[8].r,ya.r));
|
||||
scratch[11].i = S_ADD3(scratch[0].i, S_MUL(scratch[7].i,yb.r), S_MUL(scratch[8].i,ya.r));
|
||||
scratch[12].r = S_ADD(S_INV_SIGN(S_MUL(scratch[10].i,yb.i)), S_MUL(scratch[9].i,ya.i));
|
||||
scratch[12].i = S_SUB(S_MUL(scratch[10].r,yb.i), S_MUL(scratch[9].r,ya.i));
|
||||
|
||||
C_ADD(*Fout2,scratch[11],scratch[12]);
|
||||
C_SUB(*Fout3,scratch[11],scratch[12]);
|
||||
@ -217,7 +217,7 @@ static void kf_bfly_generic(
|
||||
int twidx=0;
|
||||
Fout[ k ] = scratch[0];
|
||||
for (q=1;q<p;++q ) {
|
||||
twidx += fstride * k;
|
||||
twidx += (int)(fstride * k);
|
||||
if (twidx>=Norig) twidx-=Norig;
|
||||
C_MUL(t,scratch[q] , twiddles[twidx] );
|
||||
C_ADDTO( Fout[ k ] ,t);
|
||||
|
||||
Reference in New Issue
Block a user