⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fft_1024.asm

📁 ofdm调制中用到的1024点FFT源码
💻 ASM
📖 第 1 页 / 共 2 页
字号:
// 5                 m = c*g (1) | D1 = D0,     o:p = k+:-l | write w        | abcNefgqOP stuv// 6 D0 = addr(d),   m = c*g (2) |                          | write v        | abMnef qop stu// 7                 l = b*f (1) |              u:w = p+:-s | write u        | abMnef qo   tU W// 8 jump,           l = b*f (2) |              t:v = o+:-q | write t        | a mne       TuVw// J5 is the input/output buffer.J15 = 4;;           // J15 = number of radix-4 stages remainingK14 = K14 - K31;    R8 = 0x6341;;       // R8 = permutation control for multiply by -jif nkle; do, R8 = 0x2705;   K3 = J6;;   // R8 = permutation control for multiply by j; K3 = fft_configK6 = K31 + 12;;     // K6 = twiddles table size (for current stage)R9 = [K3+0];;       // R9 = twiddles(0), equals scale_factorKB3 = K3;;          // KB3, KL3 = circular buffer of twiddles for current stageKL3 = K6;;                    // 'step' is the distance between butterfly inputs; equal to 4 in stage 2.J1 = J31 + -4;;     // J1 = -stepK1 = K31 + -4;;     // K1 = -stepJ3 = J31 + 12;;     // J3 = step*3J2 = J3 + 4;;       // J2 = step*3 + 4J8 = J31 +  1;;     // J8 = step/4J6 = J31 + 64;;     // J6 = N/step/4#if 1   // This code for stage two can be disabled and the function will still        // be correct.  However, it will run slower.//stage 2 begins here//-------------------LC1 = J6;   J0 = J5 + J3;;  // J0 = input and output address of first butterfly (points to fourth point)            J4 = J0 + 4;;   // J4 and K4 point to safe place where trash is written on first two loop iterations            K4 = J4;;       //           (Correct data is written to this address in the third iteration).align_code 4;bfly_loop2:    //-- Read data and twiddles ------------- //-- Multiply --------------------- //-- Radix-4 butterflies ------------------------- //-- Write data ----    R07:06 = Q[J0+=J1];  R21:20=CB Q[K3+=4];  R18= MR1:0, MR1:0 += R1 ** R9(CR);  SR15:14 = R05:04+R07:06, SR23:22 = R05:04-R07:06;;    R05:04 = Q[J0+=J1];  R13:12=CB Q[K3+=4];  R17= MR1:0, MR1:0 += R0 ** R9(CR);;    R03:02 = Q[J0+=J1];  R11:10=CB Q[K3+=4];  R16= MR1:0, MR1:0 += R7 ** R21(CR);;    R01:00 = Q[J0+=J2];                       R07= MR1:0, MR1:0 += R6 ** R20(CR); R23:20 = permute (R23:22, -R23:22, R8);            K2 = K4 - 4;;    K4 = J4;                                  R06= MR1:0, MR1:0 += R5 ** R13(CR); SR17:16 = R17:16+R19:18, SR19:18 = R17:16-R19:18;  Q[K2+=K1] = R31:30;;    J4 = J0;                                  R05= MR1:0, MR1:0 += R4 ** R12(CR);                                                    Q[K2+=K1] = R29:28;;    J0 = J0 + J3;                             R04= MR1:0, MR1:0 += R3 ** R11(CR); SR27:26 = R19:18+R21:20, SR31:30 = R19:18-R21:20;  Q[K2+=K1] = R27:26;;.align_code 4;if nlc1e, jump bfly_loop2;                    R19= MR1:0, MR1:0 += R2 ** R10(CR); SR25:24 = R17:16+R15:14, SR29:28 = R17:16-R15:14;  Q[K2+=0 ] = R25:24;;//-- Advance to next stage ------------------ //-- Butterfly loop epilogue ------------------------------------------------------------------------------                                              R18= MR1:0, MR1:0 += R1 ** R9(CR);  SR15:14 = R05:04+R07:06, SR23:22 = R05:04-R07:06;  K0 = J4;;K3 = K3 + K6;                                 R17= MR1:0, MR1:0 += R0 ** R9(CR);;K6 = K31 + 48;                                R16= MR1:0, MR1:0 += R0 ** R9(CR);;KB3 = K3;                                                                         R23:20 = permute (R23:22, -R23:22, R8);            K2 = K4 - 4;;KL3 = K6;                                                                         SR17:16 = R17:16+R19:18, SR19:18 = R17:16-R19:18;  Q[K2+=K1] = R31:30;;J1 = J31 + -16;                                                                                                                      Q[K2+=K1] = R29:28;;J3 = J31 + 48;                                                                    SR27:26 = R19:18+R21:20, SR31:30 = R19:18-R21:20;  Q[K2+=K1] = R27:26;;J2 = J3 + 4;                                                                      SR25:24 = R17:16+R15:14, SR29:28 = R17:16-R15:14;  Q[K2+=0 ] = R25:24;;J8 = J31 + 4;                                                                                                                        K2 = K0 - 4;;J6 = J31 + 16;                                                                                                                       Q[K2+=K1] = R31:30;;                                                                                                                                     Q[K2+=K1] = R29:28;;                                                                                                                                     Q[K2+=K1] = R27:26;;                                                                                                                                     Q[K2+=0 ] = R25:24;;K1 = K31 + -16;     j15 = J15 - 1;;#endif// --------------------------------------------------------------------------//stages 3-5 begin here//---------------------stage_loop:LC1 = J6;   J0 = J5 + J3;;  // J0 = input and output address of first butterfly (points to fourth point)LC0 = J8;   J4 = J0 + 4;;   // J4 and K4 point to safe place where trash is written on first two loop iterations            K4 = J4;;       //           (Correct data is written to this address in the third iteration).align_code 4;group_loop:bfly_loop:    //-- Read data and twiddles ------------- //-- Multiply --------------------- //-- Radix-4 butterflies ------------------------- //-- Write data ----    R07:06 = Q[J0+=J1];  R21:20=CB Q[K3+=4];  R18= MR1:0, MR1:0 += R1 ** R9(CR);  SR15:14 = R05:04+R07:06, SR23:22 = R05:04-R07:06;;    R05:04 = Q[J0+=J1];  R13:12=CB Q[K3+=4];  R17= MR1:0, MR1:0 += R0 ** R9(CR);;    R03:02 = Q[J0+=J1];  R11:10=CB Q[K3+=4];  R16= MR1:0, MR1:0 += R7 ** R21(CR);;    R01:00 = Q[J0+=J2];                       R07= MR1:0, MR1:0 += R6 ** R20(CR); R23:20 = permute (R23:22, -R23:22, R8);            K2 = K4 - 4;;    K4 = J4;                                  R06= MR1:0, MR1:0 += R5 ** R13(CR); SR17:16 = R17:16+R19:18, SR19:18 = R17:16-R19:18;  Q[K2+=K1] = R31:30;;    J4 = J0;                                  R05= MR1:0, MR1:0 += R4 ** R12(CR);                                                    Q[K2+=K1] = R29:28;;                                              R04= MR1:0, MR1:0 += R3 ** R11(CR); SR27:26 = R19:18+R21:20, SR31:30 = R19:18-R21:20;  Q[K2+=K1] = R27:26;;.align_code 4;if nlc0e, jump bfly_loop;                     R19= MR1:0, MR1:0 += R2 ** R10(CR); SR25:24 = R17:16+R15:14, SR29:28 = R17:16-R15:14;  Q[K2+=0 ] = R25:24;;.align_code 4;if nlc1e, jump group_loop;  J0 = J0 + J3;   LC0 = J8;;//-- Advance to next stage ------------------ //-- Butterfly loop epilogue ------------------------------------------------------------------------------                                              R18= MR1:0, MR1:0 += R1 ** R9(CR);  SR15:14 = R05:04+R07:06, SR23:22 = R05:04-R07:06;  K0 = J4;;K3 = K3 + K6;                                 R17= MR1:0, MR1:0 += R0 ** R9(CR);;K6 = K6 + K6;                                 R16= MR1:0, MR1:0 += R0 ** R9(CR);;K6 = K6 + K6;;KB3 = K3;                                                                         R23:20 = permute (R23:22, -R23:22, R8);            K2 = K4 - 4;;KL3 = K6;                                                                         SR17:16 = R17:16+R19:18, SR19:18 = R17:16-R19:18;  Q[K2+=K1] = R31:30;;J1 = J1 + J1;                                                                                                                        Q[K2+=K1] = R29:28;;J1 = J1 + J1;                                                                     SR27:26 = R19:18+R21:20, SR31:30 = R19:18-R21:20;  Q[K2+=K1] = R27:26;;J3 = J3 + J3;                                                                     SR25:24 = R17:16+R15:14, SR29:28 = R17:16-R15:14;  Q[K2+=0 ] = R25:24;;J3 = J3 + J3;                                                                                                                        K2 = K0 - 4;;J2 = J3 + 4;                                                                                                                         Q[K2+=K1] = R31:30;;J8 = J8 + J8;                                                                                                                        Q[K2+=K1] = R29:28;;J8 = J8 + J8;                                                                                                                        Q[K2+=K1] = R27:26;;J6 = lshiftr J6;                                                                                                                     Q[K2+=0 ] = R25:24;;J6 = lshiftr J6;    K1 = K1 + K1;;j15 = J15 - 1;      K1 = K1 + K1;;.align_code 4;if njeq, jump stage_loop;;// --------------------------------------------------------------------------    // Restore R24..31 from stack...    XR31:28 = Q[J27 + 0x4];     YR31:28 = Q[K27 + 0x4];;    XR27:24 = Q[J27 + 0x8];     YR27:24 = Q[K27 + 0x8];;.align_code 4;    cjmp (abs);     J27 = J27 + 8;      K27 = K27 + 8;;_fft_1024.end:/***** EOF***/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -