1 /* ----------------------------------------------------------------------
2 * Copyright (C) 2010 ARM Limited. All rights reserved.
7 * Project: CMSIS DSP Library
8 * Title: arm_mult_f32.c
10 * Description: Floating-point vector multiplication.
12 * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
14 * Version 1.0.10 2011/7/15
15 * Big Endian support added and Merged M0 and M3/M4 Source code.
17 * Version 1.0.3 2010/11/29
18 * Re-organized the CMSIS folders and updated documentation.
20 * Version 1.0.2 2010/11/11
21 * Documentation updated.
23 * Version 1.0.1 2010/10/05
24 * Production release and review comments incorporated.
26 * Version 1.0.0 2010/09/20
27 * Production release and review comments incorporated.
29 * Version 0.0.5 2010/04/26
30 * incorporated review comments and updated with latest CMSIS layer
32 * Version 0.0.3 2010/03/10
34 * -------------------------------------------------------------------- */
43 * @defgroup BasicMult Vector Multiplication
45 * Element-by-element multiplication of two vectors.
48 * pDst[n] = pSrcA[n] * pSrcB[n], 0 <= n < blockSize.
51 * There are separate functions for floating-point, Q7, Q15, and Q31 data types.
55 * @addtogroup BasicMult
60 * @brief Floating-point vector multiplication.
61 * @param[in] *pSrcA points to the first input vector
62 * @param[in] *pSrcB points to the second input vector
63 * @param[out] *pDst points to the output vector
64 * @param[in] blockSize number of samples in each vector
74 uint32_t blkCnt; /* loop counters */
78 /* Run the below code for Cortex-M4 and Cortex-M3 */
81 blkCnt = blockSize >> 2u;
83 /* First part of the processing with loop unrolling. Compute 4 outputs at a time.
84 ** a second loop below computes the remaining 1 to 3 samples. */
88 /* Multiply the inputs and store the results in output buffer */
89 *pDst++ = (*pSrcA++) * (*pSrcB++);
90 *pDst++ = (*pSrcA++) * (*pSrcB++);
91 *pDst++ = (*pSrcA++) * (*pSrcB++);
92 *pDst++ = (*pSrcA++) * (*pSrcB++);
94 /* Decrement the blockSize loop counter */
98 /* If the blockSize is not a multiple of 4, compute any remaining output samples here.
99 ** No loop unrolling is used. */
100 blkCnt = blockSize % 0x4u;
104 /* Run the below code for Cortex-M0 */
106 /* Initialize blkCnt with number of samples */
109 #endif /* #ifndef ARM_MATH_CM0 */
115 /* Multiply the inputs and store the results in output buffer */
116 *pDst++ = (*pSrcA++) * (*pSrcB++);
118 /* Decrement the blockSize loop counter */
125 * @} end of BasicMult group