]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ep-processor-libraries/dsplib.git/blob - ti/dsplib/src/DSP_blk_eswap16/c64P/DSP_blk_eswap16.h
DSPLIB: optimized signal processing functions for TI DSPs
[ep-processor-libraries/dsplib.git] / ti / dsplib / src / DSP_blk_eswap16 / c64P / DSP_blk_eswap16.h
1 /* ======================================================================= */
2 /* DSP_blk_eswap16.h -- Endian-swap a block of 16-bit values               */
3 /*                      Intrinsic C Implementation                         */
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 DSP_BLK_ESWAP16_H_
41 #define DSP_BLK_ESWAP16_H_ 1
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 MISC */
50 /* @{ */
52 /** @defgroup DSP_blk_eswap16 */
53 /** @ingroup DSP_blk_eswap16 */
54 /* @{ */
56 /**
57  *         The data in the x[] array is endian swapped, meaning that 
58  *     the byte-order of the bytes within each half-word of the r[] 
59  *     array is reversed. This facilitates moving big-endian data 
60  *     to a little-endian system or vice-versa.
61  *     When the r pointer is non-NULL, the endian-swap occurs out-of-place, 
62  *     similar to a block move. When the r pointer is NULL, the endian-swap 
63  *     occurs in-place, allowing the swap to occur without using any 
64  *     additional storage.
65  * 
66  *                      @param src      = Source data, must be double-word aligned.
67  *                      @param dst      = Destination data, must be double-word aligned.
68  *                      @param n_hwords = Number of 16-bit elements to swap.
69  * 
70  * @par Algorithm:
71  * DSP_blk_eswap16_cn.c is the natural C equivalent of the optimized 
72  * intrinsic C code without restrictions note that the intrinsic C code 
73  * is optimized and restrictions may apply.
74  * 
75  * @par Assumptions:
76  *              Input and output arrays do not overlap, except when \93dst == NULL\94 so that
77  *      the operation occurs in-place. <BR>
78  *              The input array and output array are double-word aligned. <BR>
79  *              nx is a multiple of 8. <BR>
80  * 
81  * @par Implementation notes:
82  * @b Endian Support: The code supports both big and little endian modes. <BR> 
83  * @b Interruptibility: The code is interruptible. <BR> 
84  * 
85  */
86  
87  /* }@ */ /* ingroup */
88  /* }@ */ /* ingroup */
90 void DSP_blk_eswap16 (
91     void *restrict src,
92     void *restrict dst,
93     int  n_hwords
94 );
96 #endif
98 /* ======================================================================== */
99 /*  End of file:  DSP_blk_eswap16.h                                         */
100 /* ------------------------------------------------------------------------ */
101 /*            Copyright (c) 2011 Texas Instruments, Incorporated.           */
102 /*                           All Rights Reserved.                           */
103 /* ======================================================================== */