BENCHMARK PROGRAMS
MOTOROLA
BENCHMARK PROGRAMS B - 23
move #twiddle+1,r7 ;r7 always points to start location of twiddle
lua (r0)+n0,r1 ;r1 = ptr to b
move r0,r4 ;r4 points to c
move r1,r5 ;r5 points to d,with predecrement
move #1,r3 ;group per pass, double at ea pass
move x:(r0),A y:(r4),y0 ;A=a, y0=c
do n0,pass1 ;first pass is trivial, no multiplications
; ------------------------------------------------
; First Pass -- W(n) = 1
;
; A---\ /---A’= Re[ A + jB + (C + jD) ] = A + C
; B----\_|_/----B’= Im[ A + jB + (C + jD) ] =j(D + B)
; C----/ | \----C’= Re[ A + jB - (C + jD) ] = A - C
; D---/ \---D’= Im[-A - jB + (C + jD) ] =j(D - B)
;-------------------------------------------------
;sub y0,A x:(r1),x0 y:(r5),B ;A=a-c=c’,B=d,x0=b,
add x0,B A,x:(r1)+ y:(r5),A ;B=d+b=b’, A=d,PUT c’ to x:b
sub x0,A x:(r0)+,B B,y:(r4)+ ;A=d-b=d’,B=a,PUT b’ to y:c
add y0,B x:(r0)-, A A,y:(r5)+ ;B=a+c=a’, A=next a,PUT d’
move B,x:(r0)+ y:(r4),y0 ;y0=next c, PUT a’
pass1
move #idata,r0 ;r0 = ptr to a
do #binlogsz-3,end_pass ;do all passes except first and last
move r7,r2 ;r2 points to real twiddle
move r2,r6 ;r6 points to imag twiddle
move n0,A ;half bflys per group
lsr A r3,B ;double group per pass
lsl A,n0
move B,r3 ;r3 is temp reg.
lua (r0)+n0,r1 ;r1 = ptr to b
move r0,r4 ;r4 points to c
move r1,r5 ;r5 points to d
lua (r3)-,n2 ;n2=group per pass -1
move x:(r0),A y:(r4),y0 ;A=a, y0=c
do n0,FirstGroupInPass ;first group in a pass
sub y0,A x:(r1),x0 y:(r5),B ;A=a-c=c’,B=d,x0=b,
add x0,B A,x:(r1)+ y:(r5),A ;B=d+b=b’, A=d,PUT c’ to x:b
sub x0,A x:(r0)+,B B,y:(r4)+ ;A=d-b=d’,B=a,PUT b’ to y:c
add y0,B x:(r0)-,A A,y:(r5)+ ;B=a+c=a’, A=next a,PUT d’
move B,x:(r0)+ y:(r4),y0 ;y0=next c, PUT a’
FirstGroupInPass
do n2,end_group ;rest groups in this pass
move r5,r0 ;r0 ptr to next group a
move r0,r4 ;r4 ptr to next group c