Motorola DSP96002 User Manual page 637

32-bit digital signal processor
Table of Contents

Advertisement

move
B.1.49 Power Function X ** Y
X = Single Precision Float, Y = 5 Bit Integer
;
;
d1.s = d4.s ** d0.l
;
andi
move
or
move
fmpy.x
fmpy.x
fmpy.x
fmpy.x
fmpy.x
fmpy.x
fmpy.x
fmpy.x
fmpy.s
X = Single Precision Float, Y = 32 Bit Unsigned Integer
;
;
d1.s = d4.s ** d0.l
;
move
do
lsr
fmpy.x
B-118
fsub.s d2,d3
d3.s,x:(r1)+
Power Function X ** Y
#0,ccr
sr,d3.l
d0,d3
#1.0,d1.s
d3.l,sr
d1,d4,d1
ifcs
;bit 0, carry
d4,d4,d4
ifal
;do multiply w/o ccr update
d1,d4,d1
ifvs
;bit 1, overflow
d4,d4,d4
ifal
;do multiply w/o ccr update
d1,d4,d1
ifeq
;bit 2, zero
d4,d4,d4
ifal
;do multiply w/o ccr update
d1,d4,d1
ifmi
;bit 3, negative
d4,d4,d4
ifal
;do multiply w/o ccr update
d1,d4,d1
ffinf
;bit 4, infinity
Power Function X ** Y
#1.0,d1.s
#32,pwr
d0
d1,d4,d1
ifcs
DSP96002 USER'S MANUAL
;clear ccr bits
;get sr
;set ccr bits
;move power to CCR bits
Totals:
;initialize power
;get lsb
;multiply if bit set
;
1
1
;cz
1
1
--- ---
Totals:
10
10
Program
ICycles
Words
1
1
1
1
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
---
---
14
14
Program
ICycles
Words
2
2
2
3
1
1
1
1
MOTOROLA

Advertisement

Table of Contents
loading

Table of Contents