beautypg.com

Motorola DSP96002 User Manual

Page 666

background image

MOTOROLA

DSP96002 USER’S MANUAL

B-147

move #ninf,d0.s ;set -infinity result 2 2

ori #2,er ;set DZ in ER 1 1

ori #2,ier ;set DZ in IER 1 1

jmp _done ;done 2 2

_notzero

getexp d1,d0 #-126,d3.l ;get exponent 2 2

cmp d3,d0 ;cmp to SP exp min 1 1

tfr d3,d0 iflt ;limit if denorm 1 1

float.s d0 ;convert to SP FP 1 1

_done --- ---

Totals: 18 *

Execution Time:

Nan 4

Infinity 7

Zero 16

In-range 15

B.3.5 Nextafter(x,y)

Nextafter(x,y) returns the next representable neighbor of x in the direction toward y. The following special

cases arise: if x=y, then the result is x without any exception being signaled; otherwise, if either x or y is a

quiet NaN, then the result is one or the other input NaNs. Overflow is signaled when x is finite but nex-

tafter(x,y) is infinite; underflow is signaled when nextafter(x,y) lies strictly between +/-2**(Emin); in both
cases, inexact is signaled.

The x argument of the nextafter(x,y) must be a single precision number and not a single-extended number.

This is an arithmetic function.