(loader '((title |fft.lo|)))
(loader'((fentry check-fft subr0)
(entry check-fft subr0)
(mov '7 a2)
(mov '(test-fft 1) a1)
(jmp check-value)
))
(loader'((fentry meter-fft subr0)
(entry meter-fft subr0)
(mov 'fft a2)
(mov '(fft-bench) a1)
(jmp perform-meter)
))
(loader'((fentry test-fft subr1)
(entry test-fft subr1)
(cabne a1 '1 104)
(bra fft-bench)
103
(push a1)
(call fft-bench)
(pop a1)
104
(sobgez a1 103)
(mov 't a1)
(return)
))
(defvar *re* (makevector 1025 0.))
(defvar *im* (makevector 1025 0.))
(defvar pi 3.141593)
(if (not (boundp 'verif)) (progn (defvar verif ())))
(loader'((entry ipower subr2)
(push a1)
(cnbne a2 '1 101)
(adjstk '1)
(return)
101
(diff '1 a2)
(call ipower)
(times (& 0) a1)
(adjstk '1)
(return)
))
(loader'((entry fft subr2)
(push a2)
(push a1)
(hgsize a1 a4)
(diff '1 a4)
(push a4)
(quo '2 a4)
(mov (& 0) a3)
(diff '1 a3)
(push '0)
(push '1)
(push nil)
(push a4)
101
(cnbge (& 2) (& 4) 102)
(mov (& 3) a4)
(plus '1 a4)
(mov a4 (& 3))
(mov (& 2) a4)
(plus (& 2) a4)
(mov a4 (& 2))
(bra 101)
102
(mov (& 3) a2)
(mov '2 a1)
(call ipower)
(cnbeq (& 4) a1 103)
(push (@ 105))
(push '"error ... array size not a power of two.")
(mov '1 a4)
(jmp prin)
105
(eval ())
(jcall read)
(push (@ 106))
(mov '0 a4)
(jmp terpri)
106
(eval ())
(bra 104)
103
(mov '1 (& 1))
(mov '1 (& 2))
107
(cnbge (& 2) (& 4) 108)
(cnbge (& 2) (& 1) 110)
(hpxmov (& 5) (& 1) a4)
(hpxmov (& 6) (& 1) a3)
(hpxmov (& 5) (& 2) a2)
(hpmovx a2 (& 5) (& 1))
(hpxmov (& 6) (& 2) a2)
(hpmovx a2 (& 6) (& 1))
(hpmovx a4 (& 5) (& 2))
(hpmovx a3 (& 6) (& 2))
110
(push (& 0))
111
(cnbge (& 0) (& 2) 112)
(mov (& 2) a4)
(diff (& 0) a4)
(mov a4 (& 2))
(mov (& 0) a4)
(quo '2 a4)
(mov a4 (& 0))
(bra 111)
112
(mov (& 2) a4)
(plus (& 0) a4)
(mov a4 (& 2))
(mov (& 3) a4)
(plus '1 a4)
(mov a4 (& 3))
(adjstk '1)
(bra 107)
108
(push '1)
113
(cnbgt (& 0) (& 4) 114)
(mov (& 0) a2)
(mov '2 a1)
(call ipower)
(push '1.)
(push '0.)
(push a1)
(quo '2 a1)
(push a1)
(jcall float)
(mov (cvalq pi) a4)
(fquo a1 a4)
(mov a4 a1)
(jcall cos)
(push a1)
(mov (& 1) a1)
(jcall float)
(mov (cvalq pi) a4)
(fquo a1 a4)
(mov a4 a1)
(jcall sin)
(push a1)
(push '1)
115
(cnbgt (& 0) (& 3) 116)
(push (& 0))
117
(cnbgt (& 0) (& 13) 118)
(mov (& 0) a4)
(plus (& 4) a4)
(hpxmov (& 14) a4 a3)
(ftimes (& 7) a3)
(hpxmov (& 15) a4 a2)
(ftimes (& 6) a2)
(fdiff a2 a3)
(hpxmov (& 14) a4 a2)
(ftimes (& 7) a2)
(hpxmov (& 15) a4 a1)
(ftimes (& 6) a1)
(fplus a1 a2)
(hpxmov (& 14) (& 0) a1)
(fdiff a3 a1)
(hpmovx a1 (& 14) a4)
(hpxmov (& 15) (& 0) a1)
(fdiff a2 a1)
(hpmovx a1 (& 15) a4)
(hpxmov (& 14) (& 0) a1)
(fplus a3 a1)
(hpmovx a1 (& 14) (& 0))
(hpxmov (& 15) (& 0) a1)
(fplus a2 a1)
(hpmovx a1 (& 15) (& 0))
(mov (& 0) a4)
(plus (& 5) a4)
(mov a4 (& 0))
(bra 117)
118
(adjstk '1)
(mov (& 0) a4)
(plus '1 a4)
(mov a4 (& 0))
(bra 115)
116
(adjstk '1)
(mov (& 5) a4)
(ftimes (& 1) a4)
(mov (& 4) a3)
(ftimes (& 0) a3)
(fdiff a3 a4)
(mov (& 5) a3)
(ftimes (& 0) a3)
(mov (& 4) a2)
(ftimes (& 1) a2)
(fplus a2 a3)
(mov a3 (& 4))
(mov a4 (& 5))
(adjstk '6)
(mov (& 0) a4)
(plus '1 a4)
(mov a4 (& 0))
(bra 113)
114
(adjstk '1)
104
(adjstk '5)
(mov 't a1)
(adjstk '2)
(return)
))
(loader'((entry fft-bench subr0)
(mov '10 a4)
(bra 102)
101
(push a4)
(mov (cvalq *im*) a2)
(mov (cvalq *re*) a1)
(call fft)
(pop a4)
102
(sobgez a4 101)
(mov 't a1)
(return)
))
(loader'((fentry fft-test subr0)
(entry fft-test subr0)
(mov 't (cvalq verif))
(mov '("fft2.ll") a1)
(jcall load)
(mov (cvalq *im*) a2)
(mov (cvalq *re*) a1)
(call fft)
(push (@ 101))
(push '"Ces resultats sont a` comparer avec la Re'fe'rence ci-apre`s:")
(mov '1 a4)
(jmp print)
101
(eval ())
(push (@ 102))
(push '"End of DO: ur=-1., ui=1.509958e-07")
(mov '1 a4)
(jmp print)
102
(eval ())
(push (@ 103))
(push '"End of DO: ur=7.549789e-08, ui=1.")
(mov '1 a4)
(jmp print)
103
(eval ())
(push (@ 104))
(push '"End of DO: ur=.7071068, ui=.7071067")
(mov '1 a4)
(jmp print)
104
(eval ())
(push (@ 105))
(push '"End of DO: ur=.9238795, ui=.3826834")
(mov '1 a4)
(jmp print)
105
(eval ())
(push (@ 106))
(push '"End of DO: ur=.9807853, ui=.1950903")
(mov '1 a4)
(jmp print)
106
(eval ())
(push (@ 107))
(push '"End of DO: ur=.9951847, ui=.09801713")
(mov '1 a4)
(jmp print)
107
(eval ())
(push (@ 108))
(push '"End of DO: ur=.9987954, ui=.04906767")
(mov '1 a4)
(jmp print)
108
(eval ())
(push (@ 109))
(push '"End of DO: ur=.9996988, ui=.02454123")
(mov '1 a4)
(jmp print)
109
(eval ())
(push (@ 110))
(push '"End of DO: ur=.9999247, ui=.01227154")
(mov '1 a4)
(jmp print)
110
(eval ())
(push (@ 111))
(push '"End of DO: ur=.9999812, ui=.006135884")
(mov '1 a4)
(jmp print)
111
(eval ())
(mov nil (cvalq verif))
(mov nil a1)
(return)
))
(loader '((end)))