/* This C language subroutine computes the subtrahend of two floating point matricies. z(i,j) = x(i,j) - y(i,j) The Run Time Library for the C Language. Gordon A. Sterling (617) 461 - 3076 DSP Development Tools Engineering Created on 5/25/90 Updated on 5/94 by AS Updated on 1/95 by AS - separated polymorphic functions #include
float matsub(float z[][], float x[][], float y[][], int r, int s); */ #include "lib_glob.h" #include "mat_glob.h" .SEGMENT/CODE Code_Space_Name; .FILE RTL_FILENAME; .GLOBAL ___matsubDPD; ___matsubDPD: sub_core: readparam4(R1); readparam5(R2); dpd_sub: dm_mdf=dma_i; R8=PASS R4, pm_ptr=R8; R0=R1-1, dma_i=R12; /*Test for vector*/ IF EQ R2=PASS R1, R1=R2; /*If so, switch registers*/ R1=R1-1, dm_ptr=R4; IF EQ JUMP (PC, dpd_one); /*Single point!*/ LCNTR=R2, DO dpd_sub_row UNTIL LCE; R2=DM(dma_i, dm_1), R4=PM(pm_ptr,pm_1); LCNTR=R1, DO dpd_sub_col UNTIL LCE; F0=F4-F2, R2=DM(dma_i, dm_1), R4=PM(pm_ptr, pm_1); dpd_sub_col: F0=F4-F2, DM(dm_ptr,dm_1)=R0; dpd_sub_row: DM(dm_ptr,dm_1)=R0; dpd_done: dma_i=dm_mdf; finish_up: R0=PASS R8, FETCH_RETURN /*Set ptr for return*/ restore_state: RETURN (DB); RESTORE_STACK RESTORE_FRAME dpd_one: R2=DM(dma_i, dm_1), R4=PM(pm_ptr, pm_1); JUMP (PC, finish_up) (DB); F0=F4-F2, dma_i=R10; DM(dm_ptr, dm_1)=R0; .ENDSEG;