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