]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ep-processor-libraries/dsplib.git/blob - ti/dsplib/src/DSPF_blk_eswap64/c674/DSPF_blk_eswap64.h
DSPLIB: optimized signal processing functions for TI DSPs
[ep-processor-libraries/dsplib.git] / ti / dsplib / src / DSPF_blk_eswap64 / c674 / DSPF_blk_eswap64.h
1 /* ======================================================================= */
2 /* DSPF_blk_eswap64.h -- Endian-swap a block of 64-bit values              */
3 /*                      Intrinsic C Implementation                         */
4 /*                                                                         */
5 /* Rev 0.0.1                                                               */
6 /*                                                                         */
7 /*                                                                         */
8 /* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/  */ 
9 /*                                                                         */
10 /*                                                                         */
11 /*  Redistribution and use in source and binary forms, with or without     */
12 /*  modification, are permitted provided that the following conditions     */
13 /*  are met:                                                               */
14 /*                                                                         */
15 /*    Redistributions of source code must retain the above copyright       */
16 /*    notice, this list of conditions and the following disclaimer.        */
17 /*                                                                         */
18 /*    Redistributions in binary form must reproduce the above copyright    */
19 /*    notice, this list of conditions and the following disclaimer in the  */
20 /*    documentation and/or other materials provided with the               */
21 /*    distribution.                                                        */
22 /*                                                                         */
23 /*    Neither the name of Texas Instruments Incorporated nor the names of  */
24 /*    its contributors may be used to endorse or promote products derived  */
25 /*    from this software without specific prior written permission.        */
26 /*                                                                         */
27 /*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS    */
28 /*  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT      */
29 /*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR  */
30 /*  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT   */
31 /*  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,  */
32 /*  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT       */
33 /*  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,  */
34 /*  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY  */
35 /*  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT    */
36 /*  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE  */
37 /*  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   */
38 /*                                                                         */
39 /* ======================================================================= */
41 #ifndef DSPF_BLK_ESWAP64_H_
42 #define DSPF_BLK_ESWAP64_H_ 1
44 #ifndef __TI_COMPILER_VERSION__           // for non TI compiler
45 #include "assert.h"                       // intrinsics prototypes
46 #include "C6xSimulator.h"                 // intrinsics prototypes
47 #include "C6xSimulator_type_modifiers.h"  // define/undefine typing keywords
48 #endif
50 /** @ingroup MISC */
51 /* @{ */
53 /** @defgroup DSPF_blk_eswap64 */
54 /** @ingroup DSPF_blk_eswap64 */
55 /* @{ */
57 /**
58  *     The data in the x[] array is endian swapped, meaning that the 
59  *     byte-order of the bytes within each double-word of the r[] array 
60  *     is reversed. This facilitates moving big-endian data to a 
61  *     little-endian system or vice-versa.
62  *     When the r pointer is non-NULL, the endian-swap occurs out-of-place, 
63  *     similar to a block move. When the r pointer is NULL, the endian-swap 
64  *     occurs in-place, allowing the swap to occur without using any 
65  *     additional storage.
66  * 
67  *      @param src    = Source data, must be double-word aligned.
68  *      @param dst    = Destination data, must be double-word aligned.
69  *      @param n_dbls = Number of 64-bit elements to swap.
70  * 
71  * @par Algorithm:
72  * DSPF_blk_eswap64_cn.c is the natural C equivalent of the optimized 
73  * intrinsic C code without restrictions note that the intrinsic C code 
74  * is optimized and restrictions may apply.
75  * 
76  * @par Assumptions:
77  *    Input and output arrays do not overlap, except when \93dst == NULL\94 so that
78  *      the operation occurs in-place. <BR>
79  *    The input array and output array are double-word aligned. <BR>
80  *    nx is a multiple of 2. <BR>
81  * 
82  * @par Implementation notes:
83  * @b Endian Support: The code supports both big and little endian modes. <BR> 
84  * @b Interruptibility: The code is interruptible. <BR> 
85  * 
86  */
87  
88  /* }@ */ /* ingroup */
89  /* }@ */ /* ingroup */
91 void DSPF_blk_eswap64 (
92     void *restrict src,
93     void *restrict dst,
94     int   n_dbls
95 );
97 #endif
99 /* ======================================================================== */
100 /*  End of file:  DSPF_blk_eswap64.h                                        */
101 /* ------------------------------------------------------------------------ */
102 /*            Copyright (c) 2011 Texas Instruments, Incorporated.           */
103 /*                           All Rights Reserved.                           */
104 /* ======================================================================== */