|
|
|
|
@ -2,12 +2,12 @@
|
|
|
|
|
* Copyright (C) 2010-2014 ARM Limited. All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* $Date: 19. March 2015
|
|
|
|
|
* $Revision: V.1.4.5
|
|
|
|
|
* $Revision: V.1.4.5a
|
|
|
|
|
*
|
|
|
|
|
* Project: CMSIS DSP Library
|
|
|
|
|
* Title: arm_mat_mult_q15.c
|
|
|
|
|
* Project: CMSIS DSP Library
|
|
|
|
|
* Title: arm_mat_mult_q15.c
|
|
|
|
|
*
|
|
|
|
|
* Description: Q15 matrix multiplication.
|
|
|
|
|
* Description: Q15 matrix multiplication.
|
|
|
|
|
*
|
|
|
|
|
* Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
|
|
|
|
|
*
|
|
|
|
|
@ -55,8 +55,8 @@
|
|
|
|
|
* @param[in] *pSrcA points to the first input matrix structure
|
|
|
|
|
* @param[in] *pSrcB points to the second input matrix structure
|
|
|
|
|
* @param[out] *pDst points to output matrix structure
|
|
|
|
|
* @param[in] *pState points to the array for storing intermediate results (Unused)
|
|
|
|
|
* @return The function returns either
|
|
|
|
|
* @param[in] *pState points to the array for storing intermediate results (Unused)
|
|
|
|
|
* @return The function returns either
|
|
|
|
|
* <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
|
|
|
|
|
*
|
|
|
|
|
* @details
|
|
|
|
|
@ -80,7 +80,7 @@ arm_status arm_mat_mult_q15(
|
|
|
|
|
const arm_matrix_instance_q15 * pSrcA,
|
|
|
|
|
const arm_matrix_instance_q15 * pSrcB,
|
|
|
|
|
arm_matrix_instance_q15 * pDst,
|
|
|
|
|
q15_t * pState CMSIS_UNUSED)
|
|
|
|
|
q15_t * pState)
|
|
|
|
|
{
|
|
|
|
|
q63_t sum; /* accumulator */
|
|
|
|
|
|
|
|
|
|
@ -109,7 +109,7 @@ arm_status arm_mat_mult_q15(
|
|
|
|
|
q15_t in; /* Temporary variable to hold the input value */
|
|
|
|
|
q15_t inA1, inB1, inA2, inB2;
|
|
|
|
|
|
|
|
|
|
#endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */
|
|
|
|
|
#endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */
|
|
|
|
|
|
|
|
|
|
#ifdef ARM_MATH_MATRIX_CHECK
|
|
|
|
|
/* Check for matrix mismatch condition */
|
|
|
|
|
@ -149,7 +149,7 @@ arm_status arm_mat_mult_q15(
|
|
|
|
|
|
|
|
|
|
*px = (q15_t) ((in & (q31_t) 0xffff0000) >> 16);
|
|
|
|
|
|
|
|
|
|
#endif /* #ifndef ARM_MATH_BIG_ENDIAN */
|
|
|
|
|
#endif /* #ifndef ARM_MATH_BIG_ENDIAN */
|
|
|
|
|
|
|
|
|
|
/* Update the pointer px to point to the next row of the transposed matrix */
|
|
|
|
|
px += numRowsB;
|
|
|
|
|
@ -163,7 +163,7 @@ arm_status arm_mat_mult_q15(
|
|
|
|
|
|
|
|
|
|
*px = (q15_t) in;
|
|
|
|
|
|
|
|
|
|
#endif /* #ifndef ARM_MATH_BIG_ENDIAN */
|
|
|
|
|
#endif /* #ifndef ARM_MATH_BIG_ENDIAN */
|
|
|
|
|
|
|
|
|
|
/* Update the pointer px to point to the next row of the transposed matrix */
|
|
|
|
|
px += numRowsB;
|
|
|
|
|
@ -180,7 +180,7 @@ arm_status arm_mat_mult_q15(
|
|
|
|
|
|
|
|
|
|
*px = (q15_t) ((in & (q31_t) 0xffff0000) >> 16);
|
|
|
|
|
|
|
|
|
|
#endif /* #ifndef ARM_MATH_BIG_ENDIAN */
|
|
|
|
|
#endif /* #ifndef ARM_MATH_BIG_ENDIAN */
|
|
|
|
|
|
|
|
|
|
/* Update the pointer px to point to the next row of the transposed matrix */
|
|
|
|
|
px += numRowsB;
|
|
|
|
|
@ -195,7 +195,7 @@ arm_status arm_mat_mult_q15(
|
|
|
|
|
|
|
|
|
|
*px = (q15_t) in;
|
|
|
|
|
|
|
|
|
|
#endif /* #ifndef ARM_MATH_BIG_ENDIAN */
|
|
|
|
|
#endif /* #ifndef ARM_MATH_BIG_ENDIAN */
|
|
|
|
|
|
|
|
|
|
/* Update the pointer px to point to the next row of the transposed matrix */
|
|
|
|
|
px += numRowsB;
|
|
|
|
|
@ -238,7 +238,7 @@ arm_status arm_mat_mult_q15(
|
|
|
|
|
/* Update the pointer px to point to the next row of the transposed matrix */
|
|
|
|
|
px += numRowsB;
|
|
|
|
|
|
|
|
|
|
#endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */
|
|
|
|
|
#endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */
|
|
|
|
|
|
|
|
|
|
/* Decrement the column loop counter */
|
|
|
|
|
col--;
|
|
|
|
|
@ -333,7 +333,7 @@ arm_status arm_mat_mult_q15(
|
|
|
|
|
sum += inA1 * inB1;
|
|
|
|
|
sum += inA2 * inB2;
|
|
|
|
|
|
|
|
|
|
#endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */
|
|
|
|
|
#endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */
|
|
|
|
|
|
|
|
|
|
/* Decrement the loop counter */
|
|
|
|
|
colCnt--;
|
|
|
|
|
@ -393,7 +393,7 @@ arm_status arm_mat_mult_q15(
|
|
|
|
|
status = ARM_MATH_SIZE_MISMATCH;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
#endif /* #ifdef ARM_MATH_MATRIX_CHECK */
|
|
|
|
|
#endif /* #ifdef ARM_MATH_MATRIX_CHECK */
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
/* The following loop performs the dot-product of each row in pSrcA with each column in pSrcB */
|
|
|
|
|
|