📄 fft16_emac.s.list
字号:
0x0000026c: 2f400044 move.l d0,(68,a7)
0x00000270: 0c8000000009 cmpi.l #9,d0
0x00000276: 6500ff68 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;
0x0000027a: 4cef0300004c movem.l (76,a7),a0/a1 ;even/odd frequency domain decomposition
0x00000280: 45e80002 lea (2,a0),a2
0x00000284: 47e90002 lea (2,a1),a3
0x00000288: 49e80400 lea (1024,a0),a4
0x0000028c: 4be90400 lea (1024,a1),a5
0x00000290: 4de80402 lea (1026,a0),a6
0x00000294: 203c00000402 move.l #1026,d0
0x0000029a: 2c3c000007fe move.l #2046,d6
0x000002a0: 3613 adjust move.w (a3),d3 ;d3 = ImX[i]
0x000002a2: 48c3 ext.l d3
0x000002a4: 2203 move.l d3,d1 ;d1 = ImX[i]
0x000002a6: 3a25 move.w -(a5),d5 ;d5 = ImX[im]
0x000002a8: 48c5 ext.l d5
0x000002aa: d685 add.l d5,d3 ;d3 = ImX[i] + ImX[im]
0x000002ac: e283 asr.l #1,d3 ;d3 = (ImX[i] + ImX[im]) / 2
0x000002ae: 3cc3 move.w d3,(a6)+ ;ReX[ip2] = d3
0x000002b0: 31836800 move.w d3,(a0,d6.l) ;ReX[ipm] = ReX[ip2]
0x000002b4: 3824 move.w -(a4),d4 ;d4 = ReX[im]
0x000002b6: 48c4 ext.l d4
0x000002b8: 2e04 move.l d4,d7 ;d7 = ReX[im]
0x000002ba: 3412 move.w (a2),d2 ;d2 = ReX[i]
0x000002bc: 48c2 ext.l d2
0x000002be: 9882 sub.l d2,d4 ;d4 = ReX[im] - ReX[i]
0x000002c0: e284 asr.l #1,d4 ;d4 = (ReX[im] - ReX[i]) / 2
0x000002c2: 33840800 move.w d4,(a1,d0.l) ;ImX[ip2] = d4
0x000002c6: 4484 neg.l d4 ;d4 = -d4
0x000002c8: 33846800 move.w d4,(a1,d6.l) ;ImX[ipm] = -ImX[ip2]
0x000002cc: d487 add.l d7,d2 ;d2 = ReX[i] + ReX[im]
0x000002ce: e282 asr.l #1,d2 ;d2 = (ReX[i] + ReX[im]) / 2
0x000002d0: 34c2 move.w d2,(a2)+ ;ReX[i] = d2
0x000002d2: 3882 move.w d2,(a4) ;ReX[im] = ReX[i]
0x000002d4: 9285 sub.l d5,d1 ;d1 = ImX[i] - ImX[im]
0x000002d6: e281 asr.l #1,d1 ;d1 = (ImX[i] - ImX[im]) / 2
0x000002d8: 36c1 move.w d1,(a3)+ ;ImX[i] = d1
0x000002da: 4481 neg.l d1 ;d1 = -d1
0x000002dc: 3a81 move.w d1,(a5) ;ImX[im]=-ImX[i];
0x000002de: 5480 addq.l #2,d0 ;loop processing
0x000002e0: 5586 subq.l #2,d6
0x000002e2: 0c8000000600 cmpi.l #1536,d0
0x000002e8: 65b6 bcs.b adjust
0x000002ea: 7000 moveq.l #0,d0
0x000002ec: 316902000600 move.w (512,a1),(1536,a0) ;ReX[n34]=ImX[n4];
0x000002f2: 31510400 move.w (a1),(1024,a0) ;ReX[nd2]=ImX[0];
0x000002f6: 33400600 move.w d0,(1536,a1) ;ImX[n34]=0;
0x000002fa: 33400400 move.w d0,(1024,a1) ;ImX[nd2]=0;
0x000002fe: 33400200 move.w d0,(512,a1) ;ImX[n4]=0;
0x00000302: 3280 move.w d0,(a1) ;ImX[0]=0;
0x00000304: 2a7c00000400 movea.l #1024,a5 ;the last stage of FFT
0x0000030a: 287c00000000 movea.l #TF_table,a4 ;a4 points to the first twiddle factor
0x00000310: 2448 movea.l a0,a2 ;a0 points to ar0
0x00000312: 2649 movea.l a1,a3 ;a1 points to ai0
0x00000314: d5cd adda.l a5,a2 ;a2 points to br0
0x00000316: d7cd adda.l a5,a3 ;a3 points to bi0
0x00000318: 2c7c00000000 move.l #0,a6 ;counter for butterfly loop
0x0000031e: a13c00000000 move.l #0,ACC0
0x00000324: a33c00000000 move.l #0,ACC1
fin_stage
0x0000032a: 201c move.l (a4)+,d0 ;wr -> MSW of d0
;wi -> LSW of d0
0x0000032c: 2812 move.l (a2),d4
0x0000032e: 3410 move.w (a0),d2
0x00000330: 3e11 move.w (a1),d7
0x00000332: 48c2 ext.l d2
0x00000334: 48c7 ext.l d7
0x00000336: aa9341c0 msacl.w d0.u,d4.u,(a3),d5,ACC0 ;ar-br*wr -> ACC, bi -> MSW of d5
0x0000033a: aa000180 msac.w d0.l,d5.u,ACC0 ;ar-br*wr-bi*wi = xr -> ACC, ai -> MSW of d7
0x0000033e: a8800080 mac.w d0.l,d4.u,ACC1 ;ai+br*wi -> ACC, ar -> MSW of d2
0x00000342: aa8001c0 msac.w d0.u,d5.u,ACC1 ;ai+br*wi-bi*wr = xi -> ACC, br -> MSW of d4
0x00000346: a1c3 movclr.l ACC0,d3
0x00000348: a3c1 movclr.l ACC1,d1
0x0000034a: d682 add.l d2,d3
0x0000034c: 48c3 ext.l d3
0x0000034e: e283 asr.l #1,d3
0x00000350: 30c3 move.w d3,(a0)+ ;xr -> memory
0x00000352: 9483 sub.l d3,d2 ;2*ar-xr = yr -> d2
0x00000354: 34c2 move.w d2,(a2)+ ;yr -> memory
0x00000356: d287 add.l d7,d1
0x00000358: 48c1 ext.l d1
0x0000035a: e281 asr.l #1,d1
0x0000035c: 32c1 move.w d1,(a1)+ ;xi -> memory
0x0000035e: 9e81 sub.l d1,d7 ;2*ai-xi = yi -> d7
0x00000360: 36c7 move.w d7,(a3)+ ;yi -> memory
0x00000362: ddfc00000002 adda.l #2,a6
0x00000368: bdcd cmpa.l a5,a6
0x0000036a: 65be bcs.b fin_stage ;end of butterfly loop
;turn off fractional mode
0x0000036c: a980 move.l MACSR,d0
0x0000036e: 0280ffffff8f and.l #0xffffff8f,d0
0x00000374: a900 move.l d0,MACSR
0x00000376: 4cd77fff movem.l (a7),d0-d7/a0-a6
0x0000037a: 4fef0048 lea +72(a7),a7
0x0000037e: 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_emac
;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];
;}
0x00000380: 7200 moveq.l #0,d1 ;make frequency domain
0x00000382: 4cef03000004 movem.l (4,a7),a0-a1 ;symmetrical
0x00000388: 45e80400 lea (1024,a0),a2
0x0000038c: 47e90400 lea (1024,a1),a3
0x00000390: 41e80402 lea (1026,a0),a0
0x00000394: 43e90402 lea (1026,a1),a1
movneg
0x00000398: 30e2 move.w -(a2),(a0)+ ;ReX[i]=ReX[n-i];
0x0000039a: 3023 move.w -(a3),d0
0x0000039c: 4480 neg.l d0
0x0000039e: 32c0 move.w d0,(a1)+ ;ImX[i]=-ImX[n-i];
0x000003a0: 5281 addq.l #1,d1 ;loop processing
0x000003a2: 0c81000001ff cmp.l #511,d1
0x000003a8: 65ee bcs.b movneg
;add real and imaginary
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -