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

📄 fft16_mac.s.list

📁 freescale MAC DSP的算法库(FFT
💻 LIST
📖 第 1 页 / 共 5 页
字号:
0x00000224: 3a25                                move.w       -(a5),d5         ;d5 = ImX[im]
0x00000226: 48c5                                ext.l        d5               
0x00000228: d685                                add.l        d5,d3            ;d3 = ImX[i] + ImX[im]
0x0000022a: e283                                asr.l        #1,d3            ;d3 = (ImX[i] + ImX[im]) / 2
0x0000022c: 3cc3                                move.w       d3,(a6)+         ;ReX[ip2] = d3
0x0000022e: 31836800                            move.w       d3,(a0,d6.l)     ;ReX[ipm] = ReX[ip2]
0x00000232: 3824                                move.w       -(a4),d4         ;d4 = ReX[im]
0x00000234: 48c4                                ext.l        d4               
0x00000236: 2e04                                move.l       d4,d7            ;d7 = ReX[im]
0x00000238: 3412                                move.w       (a2),d2          ;d2 = ReX[i]
0x0000023a: 48c2                                ext.l        d2               
0x0000023c: 9882                                sub.l        d2,d4            ;d4 = ReX[im] - ReX[i]
0x0000023e: e284                                asr.l        #1,d4            ;d4 = (ReX[im] - ReX[i]) / 2
0x00000240: 33840800                            move.w       d4,(a1,d0.l)     ;ImX[ip2] = d4
0x00000244: 4484                                neg.l        d4               ;d4 = -d4
0x00000246: 33846800                            move.w       d4,(a1,d6.l)     ;ImX[ipm] = -ImX[ip2]
0x0000024a: d487                                add.l        d7,d2            ;d2 = ReX[i] + ReX[im]
0x0000024c: e282                                asr.l        #1,d2            ;d2 = (ReX[i] + ReX[im]) / 2
0x0000024e: 34c2                                move.w       d2,(a2)+         ;ReX[i] = d2
0x00000250: 3882                                move.w       d2,(a4)          ;ReX[im] = ReX[i]
0x00000252: 9285                                sub.l        d5,d1            ;d1 = ImX[i] - ImX[im]
0x00000254: e281                                asr.l        #1,d1            ;d1 = (ImX[i] - ImX[im]) / 2
0x00000256: 36c1                                move.w       d1,(a3)+         ;ImX[i] = d1
0x00000258: 4481                                neg.l        d1               ;d1 = -d1
0x0000025a: 3a81                                move.w       d1,(a5)          ;ImX[im]=-ImX[i];
0x0000025c: 5480                                addq.l       #2,d0            ;loop processing
0x0000025e: 5586                                subq.l       #2,d6            
0x00000260: 0c8000000600                        cmpi.l       #1536,d0         
0x00000266: 65b6                                bcs.b        adjust           
0x00000268: 7000                                moveq.l      #0,d0            
0x0000026a: 316902000600                        move.w       (512,a1),(1536,a0) ;ReX[n34]=ImX[n4];
0x00000270: 31510400                            move.w       (a1),(1024,a0)   ;ReX[nd2]=ImX[0];
0x00000274: 33400600                            move.w       d0,(1536,a1)     ;ImX[n34]=0;
0x00000278: 33400400                            move.w       d0,(1024,a1)     ;ImX[nd2]=0;
0x0000027c: 33400200                            move.w       d0,(512,a1)      ;ImX[n4]=0;
0x00000280: 3280                                move.w       d0,(a1)          ;ImX[0]=0;
0x00000282: 2a7c00000400                        movea.l      #1024,a5         ;the last stage of FFT
0x00000288: 287c00000000                        movea.l      #TF_table,a4     ;a4 points to the first twiddle factor
0x0000028e: 2448                                movea.l      a0,a2            ;a0 points to ar0
0x00000290: 2649                                movea.l      a1,a3            ;a1 points to ai0
0x00000292: d5cd                                adda.l       a5,a2            ;a2 points to br0
0x00000294: d7cd                                adda.l       a5,a3            ;a3 points to bi0
0x00000296: 2c7c00000000                        move.l       #0,a6            ;counter for butterfly loop
                             fin_stage                                        
0x0000029c: 201c                                move.l       (a4)+,d0         ;wr -> MSW of d0
                                                                              ;wi -> LSW of d0
0x0000029e: 2812                                move.l       (a2),d4          
0x000002a0: 3410                                move.w       (a0),d2          
0x000002a2: 3e11                                move.w       (a1),d7          
0x000002a4: 48c2                                ext.l        d2               
0x000002a6: 48c7                                ext.l        d7               
0x000002a8: a13c00000000                        move.l       #0,ACC           
0x000002ae: aa9341c0                            msacl.w      d0.u,d4.u,(a3),d5 ;ar-br*wr -> ACC, bi -> MSW of d5
0x000002b2: aa000180                            msac.w       d0.l,d5.u        ;ar-br*wr-bi*wi = xr -> ACC, ai -> MSW of d6
0x000002b6: a183                                move.l       ACC,d3           

0x000002b8: d682                                add.l        d2,d3            
0x000002ba: 48c3                                ext.l        d3               
0x000002bc: e283                                asr.l        #1,d3            
0x000002be: 30c3                                move.w       d3,(a0)+         
0x000002c0: 9483                                sub.l        d3,d2            ;2*ar-xr = yr -> d2
0x000002c2: 34c2                                move.w       d2,(a2)+         ;yr -> memory
0x000002c4: a13c00000000                        move.l       #0,ACC           ;ai -> ACC
0x000002ca: a8000280                            mac.w        d0.l,d4.u,<<     ;ai+br*wi -> ACC, ar -> MSW of d2
0x000002ce: aa0003c0                            msac.w       d0.u,d5.u,<<     ;ai+br*wi-bi*wr = xi -> ACC, br -> MSW of d4
0x000002d2: a183                                move.l       ACC,d3           

0x000002d4: d687                                add.l        d7,d3            
0x000002d6: 48c3                                ext.l        d3               
0x000002d8: e283                                asr.l        #1,d3            
0x000002da: 32c3                                move.w       d3,(a1)+         ;xi -> memory

0x000002dc: 9e83                                sub.l        d3,d7            ;2*ai-xi = yi -> d6
0x000002de: 36c7                                move.w       d7,(a3)+         ;yi -> memory
0x000002e0: ddfc00000002                        adda.l       #2,a6            
0x000002e6: bdcd                                cmpa.l       a5,a6            
0x000002e8: 65b2                                bcs.b        fin_stage        ;end of butterfly loop
0x000002ea: a93c00000000                        move.l       #0x00000000,MACSR 

0x000002f0: 4cd77fff                            movem.l      (a7),d0-d7/a0-a6 
0x000002f4: 4fef0048                            lea          +72(a7),a7       
0x000002f8: 4e75                                rts                           
                             ;******************************************************************************
                             ;Inversed Real FFT
                             ;******************************************************************************
                             ;Upon entry, REX[ ] and IMX[ ] contain the real and imaginary parts of the
                             ;frequency domain running from index 0 to 512. The remaining samples in
                             ;REX[ ] and IMX[ ] are ignored.
                             ;Upon return, REX[ ] contains the real time domain.
                             ;******************************************************************************
                             _inv_fft16_mac                                   
                             ;make frequency domain symmetrical
                             ;Corresponding C code:
                                                                              ;n=smpl_num;
                                                                              ;for (i=((n>>1)+1);i<n;i++){
                                                                              ;    ReX[i]=ReX[n-i];
                                                                              ;    ImX[i]=-ImX[n-i];
                                                                              ;}
0x000002fa: 7200                                moveq.l      #0,d1            ;make frequency domain
0x000002fc: 4cef03000004                        movem.l      (4,a7),a0-a1     ;symmetrical
0x00000302: 45e80400                            lea          (1024,a0),a2     
0x00000306: 47e90400                            lea          (1024,a1),a3     
0x0000030a: 41e80402                            lea          (1026,a0),a0     
0x0000030e: 43e90402                            lea          (1026,a1),a1     
                             movneg                                           
0x00000312: 30e2                                move.w       -(a2),(a0)+      ;ReX[i]=ReX[n-i];
0x00000314: 3023                                move.w       -(a3),d0         
0x00000316: 4480                                neg.l        d0               
0x00000318: 32c0                                move.w       d0,(a1)+         ;ImX[i]=-ImX[n-i];
0x0000031a: 5281                                addq.l       #1,d1            ;loop processing
0x0000031c: 0c81000001ff                        cmp.l        #511,d1          
0x00000322: 65ee                                bcs.b        movneg           
                             ;add real and imaginary parts together
                             ;Corresponding C code:
                                                                              ;for (i=0;i<n;i++){
                                                                              ;    ReX[i]=ReX[i]+ImX[i];
                                                                              ;}
0x00000324: 7000                                moveq.l      #0,d0            ;add real and imaginary parts
0x00000326: 4cef03000004                        movem.l      (4,a7),a0-a1     ;together
                             sum                                              
0x0000032c: 3210                                move.w       (a0),d1          ;d1 = ReX[i]
0x0000032e: 48c1                                ext.l        d1               
0x00000330: 3419                                move.w       (a1)+,d2         ;d2 = ImX[i]
0x00000332: 48c2                                ext.l        d2               
0x00000334: d282                                add.l        d2,d1            ;d1 = ReX[i] + ImX[i]
0x00000336: 30c1                                move.w       d1,(a0)+         ;ReX[i] = d1
0x00000338: 5280                                addq.l       #1,d0            ;loop processing
0x0000033a: 0c8000000400                        cmp.l        #1024,d0         
0x00000340: 65ea                                bcs.b        sum              
0x00000342: 2f2f000c                            move.l       (12,a7),-(a7)    ;calculate forward real FFT
0x00000346: 2f2f000c                            move.l       (12,a7),-(a7)    
0x0000034a: 2f2f000c                            move.l       (12,a7),-(a7)    
0x0000034e: 4eb90000004e                        jsr          _fft16_mac       
0x00000354: dffc0000000c                        add.l        #12,a7           
                             ;add real and imaginary parts together
                             ;Corresponding C code:
                             ;for (i=0;i<n;i++){
                             ;    ReX[i]=(ReX[i]+ImX[i])/n;
                             ;}
0x0000035a: 7000                                moveq.l      #0,d0            ;add real and imaginary parts
0x0000035c: 4cef03000004                        movem.l      (4,a7),a0-a1     ;together
                             norm                                             
0x00000362: 3210                                move.w       (a0),d1          ;d1 = ReX[i]
0x00000364: 3419                                move.w       (a1)+,d2         ;d2 = ImX[i]
0x00000366: d282                                add.l        d2,d1            ;d1 = ReX[i] + ImX[i]
0x00000368: 30c1                                move.w       d1,(a0)+         ;ReX[i] = d1
0x0000036a: 5280                                addq.l       #1,d0            ;loop processing
0x0000036c: 0c8000000400                        cmp.l        #1024,d0         
0x00000372: 65ee                                bcs.b        norm             
0x00000374: 4e75                                rts                           

⌨️ 快捷键说明

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