beautypg.com

Motorola DSP96002 User Manual

Page 621

background image

B-102

DSP96002 USER’S MANUAL

MOTOROLA

; y = w boundary

_clip1_yp

move y:(r1),d4.s ;W1 1 1

fmpy.s d2,d4,d3 x:(r1)-,d5.s d2.s,d7.s ;Y1 1 1

fsub.s d5,d4 x:(r1),d5.s ;X1 1 1

fmpy.s d1,d4,d1 ; 1 1

fmpy d0,d4,d2 fsub.s d3,d1 ; 1 1

fmpy.s d5,d7,d3 ; 1 1

fmpy d4,d6,d3 fsub.s d3,d2 y:(r1)+,d4.s ;Z1 1 1

fmpy.s d4,d7,d2 d2.s,d0.s ; 1 1

fsub.s d2,d3 d1.s,d5.s ; 1 1

move d3.s,d6.s ; 1 1

rts ; 2 2

; y = -w boundary

_clip1_yn

move y:(r1),d4.s ;W1 1 1

fmpy.s d1,d4,d3 x:(r1)-,d5.s d1.s,d7.s ;Y1 1 1

fadd.s d5,d4 x:(r1),d5.s ;X1 1 1

fmpy.s d2,d4,d2 ; 1 1

fmpy d0,d4,d1 fsub.s d3,d2 ; 1 1

fmpy.s d5,d7,d3 ; 1 1

fmpy d4,d6,d3 fsub.s d3,d1 y:(r1)+,d4.s ;Z1 1 1

fmpy.s d4,d7,d1 d1.s,d0.s ; 1 1

fsub.s d1,d3 d2.s,d5.s ; 1 1

fneg.s d5 d3.s,d6.s ; 1 1

rts ; 2 2

; Clip at z = w boundary

_clip1_zp

move y:(r1)-,d4.s ;W1 1 1