/* This C language subroutine computes the multiplication of a matrix by a scaler. z(i,j) = a*x(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 2/95 by AS - separated polymorphic functions #include
float matscalmult(float z[][], float x[][], float a, int r, int s); */ #include "lib_glob.h" #include "mat_glob.h" .SEGMENT/CODE Code_Space_Name; .FILE RTL_FILENAME; .GLOBAL _matscalmult; .GLOBAL ___matscalmultDD; _matscalmult: ___matscalmultDD: smlt_core: R1=dma_i; readparam4(R0); readparam5(R2); R0=R0*R2 (SSI), R2=pma_i; dd_smlt: IF EQ JUMP (PC, restore_state) (DB);/* Err, input is 0 sized*/ dm_ptr=R8; /* Point to input */ dma_i=R4; /* Point to output */ R0=R0-1, F8=DM(dm_ptr, dm_1); /* Compute size of matrix*/ IF EQ JUMP dd_finished; /* Only one element! */ LCNTR=R0, DO matrix_smultdd UNTIL LCE; F0=F8*F12, F8=DM(dm_ptr, dm_1); matrix_smultdd: DM(dma_i, dm_1)=F0; dd_finished: F0=F8*F12; DM(dma_i, dm_1)=F0; restore_state: R0=PASS R4, FETCH_RETURN dma_i=R1; pma_i=R2; RETURN (DB); RESTORE_STACK RESTORE_FRAME .ENDSEG;