Motorola DSP96002 User Manual
Page 632
MOTOROLA
DSP96002 USER’S MANUAL
B-113
move d2.s,y:(r0)+ ;save dif 2
_firststage
nop
nop
move #data,r0 ;point to data
move #n/2-1,m0 ;mod n/2
move #n/4,n0 ;offset to next group
move #data+n/4,r4 ;point to lower leg of half
move #n/4,n4 ;offset to next group
move #1,d8.l ;number of groups/stage
move #n/8,d9.l ;number of bflys/group
do #iord-2,_mid ;do middle part of transform
move d8.l,d7.l ;get group count
do d7.l,_grps ;do groups
move d9.l,d7.l ;get bfly count
do d7.l,_bfly ;do bflys
move x:(r0)+,d0.s y:,d4.s ;upper x,y #1
move x:(r4)+,d1.s y:,d5.s ;lower x,y #1
faddsub.s d0,d1 x:(r0)-,d2.s y:,d6.s ;upper x,y #2
faddsub.s d4,d5 x:(r4)-,d3.s y:,d7.s ;lower x,y #2
faddsub.s d2,d3 d1.s,x:(r0)+ d5.s,y: ;save sum x,y #1
faddsub.s d6,d7 d0.s,x:(r4)+ d4.s,y: ;save dif x,y #1
move d3.s,x:(r0)+ d7.s,y: ;save sum x,y #2
move d2.s,x:(r4)+ d6.s,y: ;save dif x,y #2
_bfly
move x:(r0)+n0,d0.s y:(r4)+n4,d1.s ;adj r0,r4
_grps
move d9.l,d7.l ;get # bflys/stage
lsr d7 d7.l,n0 ;divide # bflys by 2, divide offset by 2
move d7.l,d9.l ;save # bflys/stage
move d8.l,d6.l ;get # of groups/stage
lsl d6 n0,n4 ;multiply # groups by 2,copy offset
move d6.l,d8.l ;save new # groups/stage
lea (r0)+n0,r4 ;update other pointer