Motorola DSP96002 User Manual
Page 667
B-148
DSP96002 USER’S MANUAL
MOTOROLA
Implementation of nextafter(d0,d4)
d0 for single precision numbers:
Program ICycles
Words
ftst d4 1 1
ftfr.s d4,d0 ffun 1 1
ftst d0 d0.s,d1.l 1 1
fjor _not_nan 2 2
move #$7fffffff,d0.s 2 2
jmp _ok 2 2 _not_nan
fjinf _ok 2 2
bclr #31,d1.l 2 2
neg d1 ifcs 1 1
fcmp d0,d4 #$00800000,d3.s 2 2
inc d1 ffgt 1 1
dec d1 fflt 1 1
tst d1 #$80000000,d2.l 2 2
neg d1 ifmi 1 1
or d2,d1 ifmi 1 1
move d1.l,d0.s 1 1
fcmpm d3,d0 1 1
fjge _not_denorm 2 2
ori #$5,er 1 1
ori #$5,ier 1 1
_not_denorm
fjninf _ok 2 2
ori #$9,er 1 1
ori #$9,ier 1 1
_ok --- ---
Totals: 32 *
Execution Timing in ICycles
Either operand a NaN: 9
X is + or - infinity: 7
Result is normalized: 26
Result denormalized: 24
Result overflowed: 26