[ep-processor-libraries/dsplib.git] / ti / dsplib / src / DSPF_sp_vecsum_sq / c674 / DSPF_sp_vecsum_sq.h
1 /* ======================================================================= */
2 /* DSPF_sp_vecsum_sq.h -- Vector Sum Squared */
3 /* Optimized C Implementation (w/ Intrinsics) */
4 /* */
5 /* Rev 0.0.1 */
6 /* */
7 /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ */
8 /* */
9 /* */
10 /* Redistribution and use in source and binary forms, with or without */
11 /* modification, are permitted provided that the following conditions */
12 /* are met: */
13 /* */
14 /* Redistributions of source code must retain the above copyright */
15 /* notice, this list of conditions and the following disclaimer. */
16 /* */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in the */
19 /* documentation and/or other materials provided with the */
20 /* distribution. */
21 /* */
22 /* Neither the name of Texas Instruments Incorporated nor the names of */
23 /* its contributors may be used to endorse or promote products derived */
24 /* from this software without specific prior written permission. */
25 /* */
26 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
27 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
28 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
29 /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
30 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
31 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
32 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
33 /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
34 /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
35 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
36 /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
37 /* */
38 /* ======================================================================= */
40 #ifndef DSPF_SP_VECSUM_SQ_H_
41 #define DSPF_SP_VECSUM_SQ_H_
43 #ifndef __TI_COMPILER_VERSION__ // for non TI compiler
44 #include "assert.h" // intrinsics prototypes
45 #include "C6xSimulator.h" // intrinsics prototypes
46 #include "C6xSimulator_type_modifiers.h" // define/undefine typing keywords
47 #endif
49 /** @ingroup MATH */
50 /* @{ */
52 /** @defgroup DSPF_sp_vecsum_sq */
53 /** @ingroup DSPF_sp_vecsum_sq */
54 /* @{ */
56 /**
57 * This routine performs a sum of squares of the elements of the array x and returns the sum.
58 *
59 * @param x Pointer to input array.
60 * @param nx Number of elements in arrays.
61 *
62 * @par Algorithm:
63 * DSPF_sp_vecsum_sq_cn.c is the natural C equivalent of the optimized
64 * linear assembly code without restrictions. Note that the linear
65 * assembly code is optimized and restrictions may apply.
66 *
67 * @par Assumptions:
68 * Since loads of 8 floats beyond the array occur, a pad must be provided <BR>
69 * The x array must be double-word aligned <BR>
70 *
71 * @par Implementation Notes:
72 * @b Interruptibility: The code is interruptible. <BR>
73 * @b Endian Support: The code supports both big and little endian modes. <BR>
74 *
75 */
77 float DSPF_sp_vecsum_sq(const float * x, const int nx);
79 #endif /* DSPF_SP_VECSUM_SQ_H_ */
81 /* ======================================================================= */
82 /* End of file: DSPF_sp_vecsum_sq.h */
83 /* ----------------------------------------------------------------------- */
84 /* Copyright (c) 2011 Texas Instruments, Incorporated. */
85 /* All Rights Reserved. */
86 /* ======================================================================= */