Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
arm_copy_f32.c
00001 /* ---------------------------------------------------------------------- 00002 * Project: CMSIS DSP Library 00003 * Title: arm_copy_f32.c 00004 * Description: Copies the elements of a floating-point vector 00005 * 00006 * $Date: 27. January 2017 00007 * $Revision: V.1.5.1 00008 * 00009 * Target Processor: Cortex-M cores 00010 * -------------------------------------------------------------------- */ 00011 /* 00012 * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. 00013 * 00014 * SPDX-License-Identifier: Apache-2.0 00015 * 00016 * Licensed under the Apache License, Version 2.0 (the License); you may 00017 * not use this file except in compliance with the License. 00018 * You may obtain a copy of the License at 00019 * 00020 * www.apache.org/licenses/LICENSE-2.0 00021 * 00022 * Unless required by applicable law or agreed to in writing, software 00023 * distributed under the License is distributed on an AS IS BASIS, WITHOUT 00024 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00025 * See the License for the specific language governing permissions and 00026 * limitations under the License. 00027 */ 00028 00029 #include "arm_math.h" 00030 00031 /** 00032 * @ingroup groupSupport 00033 */ 00034 00035 /** 00036 * @defgroup copy Vector Copy 00037 * 00038 * Copies sample by sample from source vector to destination vector. 00039 * 00040 * <pre> 00041 * pDst[n] = pSrc[n]; 0 <= n < blockSize. 00042 * </pre> 00043 * 00044 * There are separate functions for floating point, Q31, Q15, and Q7 data types. 00045 */ 00046 00047 /** 00048 * @addtogroup copy 00049 * @{ 00050 */ 00051 00052 /** 00053 * @brief Copies the elements of a floating-point vector. 00054 * @param[in] *pSrc points to input vector 00055 * @param[out] *pDst points to output vector 00056 * @param[in] blockSize length of the input vector 00057 * @return none. 00058 * 00059 */ 00060 00061 00062 void arm_copy_f32( 00063 float32_t * pSrc, 00064 float32_t * pDst, 00065 uint32_t blockSize) 00066 { 00067 uint32_t blkCnt; /* loop counter */ 00068 00069 #if defined (ARM_MATH_DSP) 00070 00071 /* Run the below code for Cortex-M4 and Cortex-M3 */ 00072 float32_t in1, in2, in3, in4; 00073 00074 /*loop Unrolling */ 00075 blkCnt = blockSize >> 2U; 00076 00077 /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 00078 ** a second loop below computes the remaining 1 to 3 samples. */ 00079 while (blkCnt > 0U) 00080 { 00081 /* C = A */ 00082 /* Copy and then store the results in the destination buffer */ 00083 in1 = *pSrc++; 00084 in2 = *pSrc++; 00085 in3 = *pSrc++; 00086 in4 = *pSrc++; 00087 00088 *pDst++ = in1; 00089 *pDst++ = in2; 00090 *pDst++ = in3; 00091 *pDst++ = in4; 00092 00093 /* Decrement the loop counter */ 00094 blkCnt--; 00095 } 00096 00097 /* If the blockSize is not a multiple of 4, compute any remaining output samples here. 00098 ** No loop unrolling is used. */ 00099 blkCnt = blockSize % 0x4U; 00100 00101 #else 00102 00103 /* Run the below code for Cortex-M0 */ 00104 00105 /* Loop over blockSize number of values */ 00106 blkCnt = blockSize; 00107 00108 #endif /* #if defined (ARM_MATH_DSP) */ 00109 00110 while (blkCnt > 0U) 00111 { 00112 /* C = A */ 00113 /* Copy and then store the results in the destination buffer */ 00114 *pDst++ = *pSrc++; 00115 00116 /* Decrement the loop counter */ 00117 blkCnt--; 00118 } 00119 } 00120 00121 /** 00122 * @} end of BasicCopy group 00123 */ 00124
Generated on Tue Jul 12 2022 16:46:23 by
1.7.2