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

📄 fft16_mac.s.list

📁 freescale MAC DSP的算法库(FFT
💻 LIST
📖 第 1 页 / 共 5 页
字号:
0x000000f0: 48c6                                ext.l        d6               ;d6 = bi0
0x000000f2: 48c7                                ext.l        d7               ;d7 = bi1
0x000000f4: 2440                                movea.l      d0,a2            ;a2 = ar0
0x000000f6: 2641                                movea.l      d1,a3            ;a3 = ar1
0x000000f8: 2844                                movea.l      d4,a4            ;a4 = ai0
0x000000fa: 2a45                                movea.l      d5,a5            ;a5 = ai1
0x000000fc: d082                                add.l        d2,d0            ;xr0 = ar0 + br0
0x000000fe: 30c0                                move.w       d0,(a0)+         
0x00000100: d287                                add.l        d7,d1            ;xr1 = ar1 + bi1
0x00000102: 30c1                                move.w       d1,(a0)+         
0x00000104: 95c2                                suba.l       d2,a2            ;yr0 = ar0 - br0
0x00000106: 30ca                                move.w       a2,(a0)+         
0x00000108: 97c7                                suba.l       d7,a3            ;yr1 = ar1 - bi1
0x0000010a: 30cb                                move.w       a3,(a0)+         
0x0000010c: d886                                add.l        d6,d4            ;xi0 = ai0 + bi0
0x0000010e: 32c4                                move.w       d4,(a1)+         
0x00000110: 9a83                                sub.l        d3,d5            ;xi1 = ai1 - br1
0x00000112: 32c5                                move.w       d5,(a1)+         
0x00000114: 99c6                                suba.l       d6,a4            ;yi0 = ai0 - bi0
0x00000116: 32cc                                move.w       a4,(a1)+         
0x00000118: dbc3                                adda.l       d3,a5            ;yi1 = ai1 + br1
0x0000011a: 32cd                                move.w       a5,(a1)+         
0x0000011c: 528e                                addq.l       #1,a6            ;
0x0000011e: bdfc00000080                        cmpa.l       #128,a6          
0x00000124: 65a2                                bcs.b        second_stage     
0x00000126: 203c00000040                        move.l       #64,d0           ;FFT for complex values
0x0000012c: 2f400040                            move.l       d0,(64,a7)       ;starts from 3-rd stage
0x00000130: 7002                                moveq.l      #2,d0            
0x00000132: 2f400044                            move.l       d0,(68,a7)       ;stage loop counter (starts from 3rd stage)
0x00000136: 2a7c00000008                        movea.l      #8,a5            ;a5 contains the number of butterflies
                                                                              ;per one sub DFT multiplied
                                                                              ;by 2 (the size of values)
0x0000013c: 2c3c00000200                        move.l       #512,d6          ;step in the table of twiddle factors
                                                                              ;(multiplied by 2 because of the size
                                                                              ;of coefficients)
0x00000142: 2c7c00000000                        movea.l      #0,a6            ;counter for butterfly loop
                                                                              ;from MSW to LSW to store it correctly
                                                                              ;into the memory)
0x00000148: a93c00000070                        move.l       #0x00000070,MACSR 
0x0000014e: 4282                                clr.l        d2               
0x00000150: 4287                                clr.l        d7               


                             next_stage                                       ;start of stages loop
0x00000152: 7000                                moveq.l      #0,d0            
0x00000154: 2f40003c                            move.l       d0,(60,a7)       ;sub DFT loop counter
0x00000158: 4cef0300004c                        movem.l      (76,a7),a0-a1    ;a0 points to ar0, a1 points to ai0
0x0000015e: 2448                                movea.l      a0,a2            
0x00000160: 2649                                movea.l      a1,a3            
0x00000162: d5cd                                adda.l       a5,a2            ;a2 points to br0
0x00000164: d7cd                                adda.l       a5,a3            ;a3 points to bi0
                             next_subDFT                                      ;start of sub DFTs loop
0x00000166: 287c00000000                        movea.l      #TF_table,a4     ;a4 points to the beginning of the table
                             next_bf                                          ;start of butterflies loop
0x0000016c: 2014                                move.l       (a4),d0          ;wr -> MSW of d0
                                                                              ;wi -> LSW of d0
0x0000016e: 3410                                move.w       (a0),d2          ;ar -> MSW of d2
0x00000170: 2812                                move.l       (a2),d4          ;br -> MSW of d4
0x00000172: 3e11                                move.w       (a1),d7          

0x00000174: a13c00000000                        move.l       #0,ACC           
0x0000017a: aa9343c0                            msacl.w      d0.u,d4.u,<<,(a3),d5 ;ar-br*wr -> ACC, bi -> MSW of d5
0x0000017e: aa000380                            msac.w       d0.l,d5.u,<<,ACC ;ar-br*wr-bi*wi = xr -> ACC, ai -> MSW of d7
0x00000182: a183                                move.l       ACC,d3           

0x00000184: d682                                add.l        d2,d3            ;ar -> ACC
0x00000186: 30c3                                move.w       d3,(a0)+         ;xr -> memory
0x00000188: d482                                add.l        d2,d2            ;2*ar -> d2
0x0000018a: 9483                                sub.l        d3,d2            ;2*ar-xr = yr -> d2
0x0000018c: 34c2                                move.w       d2,(a2)+         ;yr -> memory
0x0000018e: a13c00000000                        move.l       #0,ACC           
0x00000194: a8000280                            mac.w        d0.l,d4.u,<<     ;ai+br*wi -> ACC, ar -> MSW of d2
0x00000198: aa0003c0                            msac.w       d0.u,d5.u,<<     ;ai+br*wi-bi*wr = xi -> ACC, br -> MSW of d4

0x0000019c: a183                                move.l       ACC,d3           
0x0000019e: d687                                add.l        d7,d3            
0x000001a0: 32c3                                move.w       d3,(a1)+         ;xi -> memory
0x000001a2: de87                                add.l        d7,d7            ;2*ai -> d7
0x000001a4: 9e83                                sub.l        d3,d7            ;2*ai-xi = yi -> d7
0x000001a6: 36c7                                move.w       d7,(a3)+         ;yi -> memory
0x000001a8: d9c6                                adda.l       d6,a4            ;modify pointer to the twiddle factor
                                                                              ;for the next butterfly
0x000001aa: 548e                                addq.l       #2,a6            
0x000001ac: bdcd                                cmpa.l       a5,a6            
0x000001ae: 65bc                                bcs.b        next_bf          ;end of butterflies loop
                                                                              ;of the current sub DFT
0x000001b0: 2c7c00000000                        move.l       #0,a6            
0x000001b6: d1cd                                adda.l       a5,a0            ;a0 - a3 point to the input values
0x000001b8: d3cd                                adda.l       a5,a1            ;for the first butterfly
0x000001ba: d5cd                                adda.l       a5,a2            ;of the next sub DFT
0x000001bc: d7cd                                adda.l       a5,a3            
0x000001be: 202f003c                            move.l       (60,a7),d0       
0x000001c2: 5280                                addq.l       #1,d0            
0x000001c4: 2f40003c                            move.l       d0,(60,a7)       ;increment sub DFT loop counter
0x000001c8: b0af0040                            cmp.l        (64,a7),d0       ;compare sub DFT loop counter with
                                                                              ;the number of sub DFTs on this stage
0x000001cc: 6500ff98                            bcs.w        next_subDFT      ;end of sub DFTs loop

0x000001d0: 7000                                moveq.l      #0,d0            
0x000001d2: 2f40003c                            move.l       d0,(60,a7)       ;store 0 to the sub DFT loop counter
0x000001d6: dbcd                                adda.l       a5,a5            ;multiply contents of a5 (the number of
                                                                              ;butterflies per one sub DFT) by 2 for the
                                                                              ;next stage
0x000001d8: e28e                                lsr.l        #1,d6            ;divide step in the table of twiddle
                                                                              ;factors by 2
0x000001da: 202f0040                            move.l       (64,a7),d0       ;divide the number of sub DFTs for the
0x000001de: e288                                lsr.l        #1,d0            ;next stage by 2
0x000001e0: 2f400040                            move.l       d0,(64,a7)       
0x000001e4: 202f0044                            move.l       (68,a7),d0       ;increment stage loop counter
0x000001e8: 5280                                addq.l       #1,d0            
0x000001ea: 2f400044                            move.l       d0,(68,a7)       
0x000001ee: 0c8000000009                        cmpi.l       #9,d0            
0x000001f4: 6500ff5c                            bcs.w        next_stage       ;end of stage loop
                             ;even/odd frequency domain decomposition	
                             ;Corresponding C code:
                                                                              ;nm1=smpl_num-1;
                                                                              ;nd2=smpl_num>>1;
                                                                              ;n4=(smpl_num>>2);
                                                                              ;for (i=1;i<n4;i++){
                                                                              ;    im=nd2-i;
                                                                              ;    ip2=i+nd2;
                                                                              ;    ipm=im+nd2;
                                                                              ;
                                                                              ;    ReX[ip2]=(ImX[i]+ImX[im])/2;
                                                                              ;    ReX[ipm]=ReX[ip2];
                                                                              ;
                                                                              ;    ImX[ip2]=(ReX[im]-ReX[i])/2;
                                                                              ;    ImX[ipm]=-ImX[ip2];
                                                                              ;
                                                                              ;    ReX[i]=(ReX[i]+ReX[im])/2;
                                                                              ;    ReX[im]=ReX[i];
                                                                              ;
                                                                              ;    ImX[i]=(ImX[i]-ImX[im])/2;
                                                                              ;    ImX[im]=-ImX[i];
                                                                              ;}
                                                                              ;n34=(smpl_num*3)>>2;
                                                                              ;ReX[n34]=ImX[n4];
                                                                              ;ReX[nd2]=ImX[0];
                                                                              ;ImX[n34]=0;
                                                                              ;ImX[nd2]=0;
                                                                              ;ImX[n4]=0;
                                                                              ;ImX[0]=0;

0x000001f8: 4cef0300004c                        movem.l      (76,a7),a0/a1    ;even/odd frequency domain decomposition
0x000001fe: 45e80002                            lea          (2,a0),a2        
0x00000202: 47e90002                            lea          (2,a1),a3        
0x00000206: 49e80400                            lea          (1024,a0),a4     
0x0000020a: 4be90400                            lea          (1024,a1),a5     
0x0000020e: 4de80402                            lea          (1026,a0),a6     
0x00000212: 203c00000402                        move.l       #1026,d0         
0x00000218: 2c3c000007fe                        move.l       #2046,d6         
0x0000021e: 3613             adjust             move.w       (a3),d3          ;d3 = ImX[i]
0x00000220: 48c3                                ext.l        d3               
0x00000222: 2203                                move.l       d3,d1            ;d1 = ImX[i]

⌨️ 快捷键说明

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