00001 /* ---------------------------------------------------------------------- 00002 * Copyright (C) 2011 ARM Limited. All rights reserved. 00003 * 00004 * $Date: 15. December 2011 00005 * $Revision: V2.0.0 00006 * 00007 * Project: Cortex-R DSP Library 00008 * Title: arm_copy_q7.c 00009 * 00010 * Description: Copies the elements of a Q7 vector. 00011 * 00012 * Target Processor: Cortex-R4/R5 00013 * 00014 * Version 1.0.0 2011/03/08 00015 * Alpha release. 00016 * 00017 * Version 1.0.1 2011/09/30 00018 * Beta release. 00019 * 00020 * Version 2.0.0 2011/12/15 00021 * Final release. 00022 * 00023 * -------------------------------------------------------------------- */ 00024 #include "arm_math.h" 00025 00048 void arm_copy_q7( 00049 q7_t * pSrc, 00050 q7_t * pDst, 00051 uint32_t blockSize) 00052 { 00053 uint32_t blkCnt; /* loop counter */ 00054 q31_t in1, in2; 00055 00056 /*loop Unrolling */ 00057 blkCnt = blockSize >> 3u; 00058 00059 /* First part of the processing with loop unrolling. Compute 8 outputs at a time. 00060 ** a second loop below computes the remaining 1 to 7 samples. */ 00061 while(blkCnt > 0u) 00062 { 00063 /* C = A */ 00064 /* Copy and then store the results in the destination buffer */ 00065 /* 4 samples are copied and stored at a time using SIMD */ 00066 in1 = *__SIMD32(pSrc)++; 00067 *__SIMD32(pDst)++ = in1; 00068 in2 = *__SIMD32(pSrc)++; 00069 *__SIMD32(pDst)++ = in2; 00070 00071 /* Decrement the loop counter */ 00072 blkCnt--; 00073 } 00074 00075 /* If the blockSize is not a multiple of 8, compute any remaining output samples here. 00076 ** No loop unrolling is used. */ 00077 blkCnt = blockSize % 0x8u; 00078 00079 while(blkCnt > 0u) 00080 { 00081 /* C = A */ 00082 /* Copy and then store the results in the destination buffer */ 00083 *pDst++ = *pSrc++; 00084 00085 /* Decrement the loop counter */ 00086 blkCnt--; 00087 } 00088 } 00089