/* This C language subroutine is the core Floating point, real valued input, Discrete Fourier Transform (DFT) routine called by various library routines. The Run Time Library for the C Language. Gordon A. Sterling (617) 461 - 3076 DSP Development Tools Engineering Created on 5/10/90 Updated on 5/94 by AS #include
float *___rdftcore(float real_in[], \ float real_out[], float imag_out[]) */ #include "lib_glob.h" #include "trn_glob.h" .SEGMENT/CODE Code_Space_Name; .FILE RTL_FILENAME; .GLOBAL ____rdftcore; ____rdftcore: R2=dma_i; put(R2); R2=dma_m; put(R2); R2=dma_l; put(R2); R2=dmb_i; put(R2); R2=dmb_l; put(R2); R2=pma_i; put(R2); R2=pma_l; put(R2); R2=MODE1; R12=PASS R4, put(R2); put(R3); put(R5); put(R6); put(R7); put(R9); R9=PASS R12, put(R10); R10=PASS R8, put(R11); put(R13); R13=PASS R8, put(R14); R14=LSHIFT R4 BY -2, put(R15); /*Compute N/4*/ BIT CLR MODE1 65536; /*Set 40-bit mode*/ R15=PASS R4, dm_lnt=dm_0; /*Hold N (set by caller), clr length reg*/ R14=R8+R14, dma_l=dm_0; /*Hold real coeffs ptr, clr length reg*/ dmb_l=0; /*Clear length registers*/ dm_ptr=R12; /*Point to real input data*/ dma_i=R10; /*Point to real output array*/ dmb_i=R9; /*Point to imag output array*/ pm_bse=R14; /*Point to real twiddle factors*/ pma_b=R13; /*Point to imag twiddle factors*/ R11=LSHIFT R15 BY -1; /*Compute N/2*/ R7=R7-R7, pma_l=R11; /*Two DAGs are needed for twids*/ R11=R14-1,pm_lnt=R11; /*Inner loop-1, Set length register for twids*/ LCNTR=R14, DO bin_loop UNTIL LCE; R8=R8-R8, pm_mdf=R7; /*Clear imag accumulator, set modify*/ R9=R9-R9, F0=DM(dm_ptr,dm_1), F5=PM(pm_ptr, pm_mdf);/*Clear real accumulator*/ F12=F0*F5, F4=PM(pma_i, pm_mdf); /*Compute C*X*/ LCNTR=R11, DO compute_bin_loop UNTIL LCE; /*Inner loop N-1 times*/ F13=F0*F4, F9=F9+F12, F0=DM(dm_ptr, dm_1), F5=PM(pm_ptr, pm_mdf);/*Compute S*X, real += CX*/ compute_bin_loop: F12=F0*F5, F8=F8-F13, F4=PM(pma_i, pm_mdf); /*Compute C*X, imag += SX*/ F13=F0*F4, F9=F9+F12; /*Compute SX, Real_Result = real + CX*/ F8=F8-F13, DM(dma_i, dm_1)=F9; /*Store real result*/ bin_loop: R7=R7+1, DM(dmb_i, dm_1)=F8; /*Store imag result*/ JUMP (PC, restore_state) (DB); pm_lnt=0; pma_l=0; restore_state: R0=PASS R10, FETCH_RETURN; /*Point to real output*/ get(R15,1); get(R14,2); get(R13,3); get(R11,4); get(R10,5); get(R9,6); get(R7,7); get(R6,8); get(R5,9); get(R3,10); get(MODE1,11); get(R2,12); pma_l=R2; get(R2,13); pma_i=R2; get(R2,14); dmb_l=R2; get(R2,15); dmb_i=R2; get(R2,16); dma_l=R2; get(R2,17); dma_m=R2; get(R2,18); dma_i=R2; RETURN (DB); RESTORE_STACK RESTORE_FRAME .ENDSEG;