/* 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 by 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 ___matsubPPD; ___matsubPPD: sub_core: readparam4(R1); readparam5(R2); ppd_sub: dm_mdf=pma_i; R0=R1-1, dm_ptr=R12; /*Test for vector*/ IF EQ R2=PASS R1, R1=R2; /*If so, switch regs*/ R1=R1-1, pma_i=R8; IF EQ JUMP (PC, ppd_one); /*Single point!*/ R8=PASS R4, pm_ptr=R4; LCNTR=R2, DO ppd_sub_row UNTIL LCE; R2=DM(dm_ptr, dm_1), R4=PM(pma_i, pm_1); LCNTR=R1, DO ppd_sub_col UNTIL LCE; F0=F4-F2, R2=DM(dm_ptr, dm_1), R4=PM(pma_i, pm_1); ppd_sub_col: F0=F4-F2, PM(pm_ptr,pm_1)=R0; ppd_sub_row: PM(pm_ptr,pm_1)=R0; ppd_done: pma_i=dm_mdf; finish_up: R0=PASS R8, FETCH_RETURN /*Set ptr for return*/ restore_state: RETURN (DB); RESTORE_STACK RESTORE_FRAME ppd_one: R2=DM(dm_ptr, dm_1), R4=PM(pma_i, pm_1); JUMP (PC, finish_up) (DB); F0=F4-F2, pma_i=dm_mdf; PM(pm_ptr, pm_1)=R0; .ENDSEG;