Motorola DSP96002 User Manual
Page 664
MOTOROLA
DSP96002 USER’S MANUAL
B-145
SP
→
I
Program ICycles
Words
i nt d0 ;convert to integer 1 1
jset #20,sr,_error ;jump if invalid op set 2 3
--- --
- 3 4
SP
→
U
Program ICycles
Words
intu d0 ;convert to integer 1 1
jset #20,sr,_error ;jump if invalid op set 2 3
--- ---
3 4
B.3
IEEE RECOMMENDED FUNCTIONS AND PREDICATES
The following functions are recommended by the IEEE-754 standard but are not required.
Functions that require explicit knowledge of the variable precision and may lead to families of functions on
high level languages are 4, 5, and 10. Functions 1 and 2 have an arithmetic form (signals IOP if the source
is a NaN) and a non-arithmetic form.
B.3.1 Copysign(x,y)
Copysign(x,y) returns y with the sign of x.
Arithmetic Implementation Of
Copysign(d1,d0)
Program ICycles
Words
fcopys.s d1,d0 ;copy sign of d1 to d0 1 1
--- ---
Totals: 1 1
Non-Arithmetic Implementation Of
Copysign(d1,d0)
Program ICycles
Words
bclr #31,d0.h ;clear sign bit 2 2
jclr #31,d1.h,_bitclr ;sign bit clear 2 3
bset #31,d0.h ;set sign bit 2 2
_bitclr --- ---
Totals: 6 7
43