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_fill_f32.c 00009 * 00010 * Description: Fills a constant value into a floating-point 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 00057 void arm_fill_f32( 00058 float32_t value, 00059 float32_t * pDst, 00060 uint32_t blockSize) 00061 { 00062 uint32_t blkCnt; /* loop counter */ 00063 float32_t value1 = value; 00064 float32_t value2 = value; 00065 float32_t value3 = value; 00066 float32_t value4 = value; 00067 00068 00069 /*loop Unrolling */ 00070 blkCnt = blockSize >> 3u; 00071 00072 /* First part of the processing with loop unrolling. Compute 8 outputs at a time. 00073 ** a second loop below computes the remaining 1 to 7 samples. */ 00074 while(blkCnt > 0u) 00075 { 00076 /* C = value */ 00077 /* Fill the value in the destination buffer */ 00078 pDst[0] = value1; 00079 pDst[1] = value2; 00080 pDst[2] = value3; 00081 pDst[3] = value4; 00082 pDst[4] = value1; 00083 pDst[5] = value2; 00084 pDst[6] = value3; 00085 pDst[7] = value4; 00086 pDst += 8u; 00087 00088 /* Decrement the loop counter */ 00089 blkCnt--; 00090 } 00091 00092 /* If the blockSize is not a multiple of 8, compute any remaining output samples here. 00093 ** No loop unrolling is used. */ 00094 blkCnt = blockSize % 0x8u; 00095 00096 while(blkCnt > 0u) 00097 { 00098 /* C = value */ 00099 /* Fill the value in the destination buffer */ 00100 *pDst++ = value; 00101 00102 /* Decrement the loop counter */ 00103 blkCnt--; 00104 } 00105 } 00106