Dataloger

Committer:
jhon309
Date:
Thu Aug 20 00:37:14 2015 +0000
Revision:
0:666850d06c9f
ok

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jhon309 0:666850d06c9f 1 /**************************************************************************//**
jhon309 0:666850d06c9f 2 * @file core_cm4_simd.h
jhon309 0:666850d06c9f 3 * @brief CMSIS Cortex-M4 SIMD Header File
jhon309 0:666850d06c9f 4 * @version V3.20
jhon309 0:666850d06c9f 5 * @date 25. February 2013
jhon309 0:666850d06c9f 6 *
jhon309 0:666850d06c9f 7 * @note
jhon309 0:666850d06c9f 8 *
jhon309 0:666850d06c9f 9 ******************************************************************************/
jhon309 0:666850d06c9f 10 /* Copyright (c) 2009 - 2013 ARM LIMITED
jhon309 0:666850d06c9f 11
jhon309 0:666850d06c9f 12 All rights reserved.
jhon309 0:666850d06c9f 13 Redistribution and use in source and binary forms, with or without
jhon309 0:666850d06c9f 14 modification, are permitted provided that the following conditions are met:
jhon309 0:666850d06c9f 15 - Redistributions of source code must retain the above copyright
jhon309 0:666850d06c9f 16 notice, this list of conditions and the following disclaimer.
jhon309 0:666850d06c9f 17 - Redistributions in binary form must reproduce the above copyright
jhon309 0:666850d06c9f 18 notice, this list of conditions and the following disclaimer in the
jhon309 0:666850d06c9f 19 documentation and/or other materials provided with the distribution.
jhon309 0:666850d06c9f 20 - Neither the name of ARM nor the names of its contributors may be used
jhon309 0:666850d06c9f 21 to endorse or promote products derived from this software without
jhon309 0:666850d06c9f 22 specific prior written permission.
jhon309 0:666850d06c9f 23 *
jhon309 0:666850d06c9f 24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
jhon309 0:666850d06c9f 25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
jhon309 0:666850d06c9f 26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
jhon309 0:666850d06c9f 27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
jhon309 0:666850d06c9f 28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
jhon309 0:666850d06c9f 29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
jhon309 0:666850d06c9f 30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
jhon309 0:666850d06c9f 31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
jhon309 0:666850d06c9f 32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
jhon309 0:666850d06c9f 33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
jhon309 0:666850d06c9f 34 POSSIBILITY OF SUCH DAMAGE.
jhon309 0:666850d06c9f 35 ---------------------------------------------------------------------------*/
jhon309 0:666850d06c9f 36
jhon309 0:666850d06c9f 37
jhon309 0:666850d06c9f 38 #ifdef __cplusplus
jhon309 0:666850d06c9f 39 extern "C" {
jhon309 0:666850d06c9f 40 #endif
jhon309 0:666850d06c9f 41
jhon309 0:666850d06c9f 42 #ifndef __CORE_CM4_SIMD_H
jhon309 0:666850d06c9f 43 #define __CORE_CM4_SIMD_H
jhon309 0:666850d06c9f 44
jhon309 0:666850d06c9f 45
jhon309 0:666850d06c9f 46 /*******************************************************************************
jhon309 0:666850d06c9f 47 * Hardware Abstraction Layer
jhon309 0:666850d06c9f 48 ******************************************************************************/
jhon309 0:666850d06c9f 49
jhon309 0:666850d06c9f 50
jhon309 0:666850d06c9f 51 /* ################### Compiler specific Intrinsics ########################### */
jhon309 0:666850d06c9f 52 /** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics
jhon309 0:666850d06c9f 53 Access to dedicated SIMD instructions
jhon309 0:666850d06c9f 54 @{
jhon309 0:666850d06c9f 55 */
jhon309 0:666850d06c9f 56
jhon309 0:666850d06c9f 57 #if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
jhon309 0:666850d06c9f 58 /* ARM armcc specific functions */
jhon309 0:666850d06c9f 59
jhon309 0:666850d06c9f 60 /*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
jhon309 0:666850d06c9f 61 #define __SADD8 __sadd8
jhon309 0:666850d06c9f 62 #define __QADD8 __qadd8
jhon309 0:666850d06c9f 63 #define __SHADD8 __shadd8
jhon309 0:666850d06c9f 64 #define __UADD8 __uadd8
jhon309 0:666850d06c9f 65 #define __UQADD8 __uqadd8
jhon309 0:666850d06c9f 66 #define __UHADD8 __uhadd8
jhon309 0:666850d06c9f 67 #define __SSUB8 __ssub8
jhon309 0:666850d06c9f 68 #define __QSUB8 __qsub8
jhon309 0:666850d06c9f 69 #define __SHSUB8 __shsub8
jhon309 0:666850d06c9f 70 #define __USUB8 __usub8
jhon309 0:666850d06c9f 71 #define __UQSUB8 __uqsub8
jhon309 0:666850d06c9f 72 #define __UHSUB8 __uhsub8
jhon309 0:666850d06c9f 73 #define __SADD16 __sadd16
jhon309 0:666850d06c9f 74 #define __QADD16 __qadd16
jhon309 0:666850d06c9f 75 #define __SHADD16 __shadd16
jhon309 0:666850d06c9f 76 #define __UADD16 __uadd16
jhon309 0:666850d06c9f 77 #define __UQADD16 __uqadd16
jhon309 0:666850d06c9f 78 #define __UHADD16 __uhadd16
jhon309 0:666850d06c9f 79 #define __SSUB16 __ssub16
jhon309 0:666850d06c9f 80 #define __QSUB16 __qsub16
jhon309 0:666850d06c9f 81 #define __SHSUB16 __shsub16
jhon309 0:666850d06c9f 82 #define __USUB16 __usub16
jhon309 0:666850d06c9f 83 #define __UQSUB16 __uqsub16
jhon309 0:666850d06c9f 84 #define __UHSUB16 __uhsub16
jhon309 0:666850d06c9f 85 #define __SASX __sasx
jhon309 0:666850d06c9f 86 #define __QASX __qasx
jhon309 0:666850d06c9f 87 #define __SHASX __shasx
jhon309 0:666850d06c9f 88 #define __UASX __uasx
jhon309 0:666850d06c9f 89 #define __UQASX __uqasx
jhon309 0:666850d06c9f 90 #define __UHASX __uhasx
jhon309 0:666850d06c9f 91 #define __SSAX __ssax
jhon309 0:666850d06c9f 92 #define __QSAX __qsax
jhon309 0:666850d06c9f 93 #define __SHSAX __shsax
jhon309 0:666850d06c9f 94 #define __USAX __usax
jhon309 0:666850d06c9f 95 #define __UQSAX __uqsax
jhon309 0:666850d06c9f 96 #define __UHSAX __uhsax
jhon309 0:666850d06c9f 97 #define __USAD8 __usad8
jhon309 0:666850d06c9f 98 #define __USADA8 __usada8
jhon309 0:666850d06c9f 99 #define __SSAT16 __ssat16
jhon309 0:666850d06c9f 100 #define __USAT16 __usat16
jhon309 0:666850d06c9f 101 #define __UXTB16 __uxtb16
jhon309 0:666850d06c9f 102 #define __UXTAB16 __uxtab16
jhon309 0:666850d06c9f 103 #define __SXTB16 __sxtb16
jhon309 0:666850d06c9f 104 #define __SXTAB16 __sxtab16
jhon309 0:666850d06c9f 105 #define __SMUAD __smuad
jhon309 0:666850d06c9f 106 #define __SMUADX __smuadx
jhon309 0:666850d06c9f 107 #define __SMLAD __smlad
jhon309 0:666850d06c9f 108 #define __SMLADX __smladx
jhon309 0:666850d06c9f 109 #define __SMLALD __smlald
jhon309 0:666850d06c9f 110 #define __SMLALDX __smlaldx
jhon309 0:666850d06c9f 111 #define __SMUSD __smusd
jhon309 0:666850d06c9f 112 #define __SMUSDX __smusdx
jhon309 0:666850d06c9f 113 #define __SMLSD __smlsd
jhon309 0:666850d06c9f 114 #define __SMLSDX __smlsdx
jhon309 0:666850d06c9f 115 #define __SMLSLD __smlsld
jhon309 0:666850d06c9f 116 #define __SMLSLDX __smlsldx
jhon309 0:666850d06c9f 117 #define __SEL __sel
jhon309 0:666850d06c9f 118 #define __QADD __qadd
jhon309 0:666850d06c9f 119 #define __QSUB __qsub
jhon309 0:666850d06c9f 120
jhon309 0:666850d06c9f 121 #define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \
jhon309 0:666850d06c9f 122 ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) )
jhon309 0:666850d06c9f 123
jhon309 0:666850d06c9f 124 #define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \
jhon309 0:666850d06c9f 125 ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) )
jhon309 0:666850d06c9f 126
jhon309 0:666850d06c9f 127 #define __SMMLA(ARG1,ARG2,ARG3) ( (int32_t)((((int64_t)(ARG1) * (ARG2)) + \
jhon309 0:666850d06c9f 128 ((int64_t)(ARG3) << 32) ) >> 32))
jhon309 0:666850d06c9f 129
jhon309 0:666850d06c9f 130 /*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
jhon309 0:666850d06c9f 131
jhon309 0:666850d06c9f 132
jhon309 0:666850d06c9f 133
jhon309 0:666850d06c9f 134 #elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/
jhon309 0:666850d06c9f 135 /* IAR iccarm specific functions */
jhon309 0:666850d06c9f 136
jhon309 0:666850d06c9f 137 /*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
jhon309 0:666850d06c9f 138 #include <cmsis_iar.h>
jhon309 0:666850d06c9f 139
jhon309 0:666850d06c9f 140 /*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
jhon309 0:666850d06c9f 141
jhon309 0:666850d06c9f 142
jhon309 0:666850d06c9f 143
jhon309 0:666850d06c9f 144 #elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/
jhon309 0:666850d06c9f 145 /* TI CCS specific functions */
jhon309 0:666850d06c9f 146
jhon309 0:666850d06c9f 147 /*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
jhon309 0:666850d06c9f 148 #include <cmsis_ccs.h>
jhon309 0:666850d06c9f 149
jhon309 0:666850d06c9f 150 /*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
jhon309 0:666850d06c9f 151
jhon309 0:666850d06c9f 152
jhon309 0:666850d06c9f 153
jhon309 0:666850d06c9f 154 #elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/
jhon309 0:666850d06c9f 155 /* GNU gcc specific functions */
jhon309 0:666850d06c9f 156
jhon309 0:666850d06c9f 157 /*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
jhon309 0:666850d06c9f 158 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SADD8(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 159 {
jhon309 0:666850d06c9f 160 uint32_t result;
jhon309 0:666850d06c9f 161
jhon309 0:666850d06c9f 162 __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 163 return(result);
jhon309 0:666850d06c9f 164 }
jhon309 0:666850d06c9f 165
jhon309 0:666850d06c9f 166 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD8(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 167 {
jhon309 0:666850d06c9f 168 uint32_t result;
jhon309 0:666850d06c9f 169
jhon309 0:666850d06c9f 170 __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 171 return(result);
jhon309 0:666850d06c9f 172 }
jhon309 0:666850d06c9f 173
jhon309 0:666850d06c9f 174 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 175 {
jhon309 0:666850d06c9f 176 uint32_t result;
jhon309 0:666850d06c9f 177
jhon309 0:666850d06c9f 178 __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 179 return(result);
jhon309 0:666850d06c9f 180 }
jhon309 0:666850d06c9f 181
jhon309 0:666850d06c9f 182 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UADD8(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 183 {
jhon309 0:666850d06c9f 184 uint32_t result;
jhon309 0:666850d06c9f 185
jhon309 0:666850d06c9f 186 __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 187 return(result);
jhon309 0:666850d06c9f 188 }
jhon309 0:666850d06c9f 189
jhon309 0:666850d06c9f 190 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 191 {
jhon309 0:666850d06c9f 192 uint32_t result;
jhon309 0:666850d06c9f 193
jhon309 0:666850d06c9f 194 __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 195 return(result);
jhon309 0:666850d06c9f 196 }
jhon309 0:666850d06c9f 197
jhon309 0:666850d06c9f 198 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 199 {
jhon309 0:666850d06c9f 200 uint32_t result;
jhon309 0:666850d06c9f 201
jhon309 0:666850d06c9f 202 __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 203 return(result);
jhon309 0:666850d06c9f 204 }
jhon309 0:666850d06c9f 205
jhon309 0:666850d06c9f 206
jhon309 0:666850d06c9f 207 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 208 {
jhon309 0:666850d06c9f 209 uint32_t result;
jhon309 0:666850d06c9f 210
jhon309 0:666850d06c9f 211 __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 212 return(result);
jhon309 0:666850d06c9f 213 }
jhon309 0:666850d06c9f 214
jhon309 0:666850d06c9f 215 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 216 {
jhon309 0:666850d06c9f 217 uint32_t result;
jhon309 0:666850d06c9f 218
jhon309 0:666850d06c9f 219 __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 220 return(result);
jhon309 0:666850d06c9f 221 }
jhon309 0:666850d06c9f 222
jhon309 0:666850d06c9f 223 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 224 {
jhon309 0:666850d06c9f 225 uint32_t result;
jhon309 0:666850d06c9f 226
jhon309 0:666850d06c9f 227 __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 228 return(result);
jhon309 0:666850d06c9f 229 }
jhon309 0:666850d06c9f 230
jhon309 0:666850d06c9f 231 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USUB8(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 232 {
jhon309 0:666850d06c9f 233 uint32_t result;
jhon309 0:666850d06c9f 234
jhon309 0:666850d06c9f 235 __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 236 return(result);
jhon309 0:666850d06c9f 237 }
jhon309 0:666850d06c9f 238
jhon309 0:666850d06c9f 239 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 240 {
jhon309 0:666850d06c9f 241 uint32_t result;
jhon309 0:666850d06c9f 242
jhon309 0:666850d06c9f 243 __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 244 return(result);
jhon309 0:666850d06c9f 245 }
jhon309 0:666850d06c9f 246
jhon309 0:666850d06c9f 247 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 248 {
jhon309 0:666850d06c9f 249 uint32_t result;
jhon309 0:666850d06c9f 250
jhon309 0:666850d06c9f 251 __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 252 return(result);
jhon309 0:666850d06c9f 253 }
jhon309 0:666850d06c9f 254
jhon309 0:666850d06c9f 255
jhon309 0:666850d06c9f 256 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SADD16(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 257 {
jhon309 0:666850d06c9f 258 uint32_t result;
jhon309 0:666850d06c9f 259
jhon309 0:666850d06c9f 260 __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 261 return(result);
jhon309 0:666850d06c9f 262 }
jhon309 0:666850d06c9f 263
jhon309 0:666850d06c9f 264 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD16(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 265 {
jhon309 0:666850d06c9f 266 uint32_t result;
jhon309 0:666850d06c9f 267
jhon309 0:666850d06c9f 268 __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 269 return(result);
jhon309 0:666850d06c9f 270 }
jhon309 0:666850d06c9f 271
jhon309 0:666850d06c9f 272 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 273 {
jhon309 0:666850d06c9f 274 uint32_t result;
jhon309 0:666850d06c9f 275
jhon309 0:666850d06c9f 276 __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 277 return(result);
jhon309 0:666850d06c9f 278 }
jhon309 0:666850d06c9f 279
jhon309 0:666850d06c9f 280 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UADD16(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 281 {
jhon309 0:666850d06c9f 282 uint32_t result;
jhon309 0:666850d06c9f 283
jhon309 0:666850d06c9f 284 __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 285 return(result);
jhon309 0:666850d06c9f 286 }
jhon309 0:666850d06c9f 287
jhon309 0:666850d06c9f 288 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 289 {
jhon309 0:666850d06c9f 290 uint32_t result;
jhon309 0:666850d06c9f 291
jhon309 0:666850d06c9f 292 __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 293 return(result);
jhon309 0:666850d06c9f 294 }
jhon309 0:666850d06c9f 295
jhon309 0:666850d06c9f 296 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 297 {
jhon309 0:666850d06c9f 298 uint32_t result;
jhon309 0:666850d06c9f 299
jhon309 0:666850d06c9f 300 __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 301 return(result);
jhon309 0:666850d06c9f 302 }
jhon309 0:666850d06c9f 303
jhon309 0:666850d06c9f 304 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 305 {
jhon309 0:666850d06c9f 306 uint32_t result;
jhon309 0:666850d06c9f 307
jhon309 0:666850d06c9f 308 __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 309 return(result);
jhon309 0:666850d06c9f 310 }
jhon309 0:666850d06c9f 311
jhon309 0:666850d06c9f 312 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 313 {
jhon309 0:666850d06c9f 314 uint32_t result;
jhon309 0:666850d06c9f 315
jhon309 0:666850d06c9f 316 __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 317 return(result);
jhon309 0:666850d06c9f 318 }
jhon309 0:666850d06c9f 319
jhon309 0:666850d06c9f 320 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 321 {
jhon309 0:666850d06c9f 322 uint32_t result;
jhon309 0:666850d06c9f 323
jhon309 0:666850d06c9f 324 __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 325 return(result);
jhon309 0:666850d06c9f 326 }
jhon309 0:666850d06c9f 327
jhon309 0:666850d06c9f 328 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USUB16(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 329 {
jhon309 0:666850d06c9f 330 uint32_t result;
jhon309 0:666850d06c9f 331
jhon309 0:666850d06c9f 332 __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 333 return(result);
jhon309 0:666850d06c9f 334 }
jhon309 0:666850d06c9f 335
jhon309 0:666850d06c9f 336 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 337 {
jhon309 0:666850d06c9f 338 uint32_t result;
jhon309 0:666850d06c9f 339
jhon309 0:666850d06c9f 340 __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 341 return(result);
jhon309 0:666850d06c9f 342 }
jhon309 0:666850d06c9f 343
jhon309 0:666850d06c9f 344 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 345 {
jhon309 0:666850d06c9f 346 uint32_t result;
jhon309 0:666850d06c9f 347
jhon309 0:666850d06c9f 348 __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 349 return(result);
jhon309 0:666850d06c9f 350 }
jhon309 0:666850d06c9f 351
jhon309 0:666850d06c9f 352 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SASX(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 353 {
jhon309 0:666850d06c9f 354 uint32_t result;
jhon309 0:666850d06c9f 355
jhon309 0:666850d06c9f 356 __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 357 return(result);
jhon309 0:666850d06c9f 358 }
jhon309 0:666850d06c9f 359
jhon309 0:666850d06c9f 360 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QASX(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 361 {
jhon309 0:666850d06c9f 362 uint32_t result;
jhon309 0:666850d06c9f 363
jhon309 0:666850d06c9f 364 __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 365 return(result);
jhon309 0:666850d06c9f 366 }
jhon309 0:666850d06c9f 367
jhon309 0:666850d06c9f 368 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHASX(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 369 {
jhon309 0:666850d06c9f 370 uint32_t result;
jhon309 0:666850d06c9f 371
jhon309 0:666850d06c9f 372 __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 373 return(result);
jhon309 0:666850d06c9f 374 }
jhon309 0:666850d06c9f 375
jhon309 0:666850d06c9f 376 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UASX(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 377 {
jhon309 0:666850d06c9f 378 uint32_t result;
jhon309 0:666850d06c9f 379
jhon309 0:666850d06c9f 380 __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 381 return(result);
jhon309 0:666850d06c9f 382 }
jhon309 0:666850d06c9f 383
jhon309 0:666850d06c9f 384 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQASX(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 385 {
jhon309 0:666850d06c9f 386 uint32_t result;
jhon309 0:666850d06c9f 387
jhon309 0:666850d06c9f 388 __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 389 return(result);
jhon309 0:666850d06c9f 390 }
jhon309 0:666850d06c9f 391
jhon309 0:666850d06c9f 392 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHASX(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 393 {
jhon309 0:666850d06c9f 394 uint32_t result;
jhon309 0:666850d06c9f 395
jhon309 0:666850d06c9f 396 __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 397 return(result);
jhon309 0:666850d06c9f 398 }
jhon309 0:666850d06c9f 399
jhon309 0:666850d06c9f 400 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSAX(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 401 {
jhon309 0:666850d06c9f 402 uint32_t result;
jhon309 0:666850d06c9f 403
jhon309 0:666850d06c9f 404 __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 405 return(result);
jhon309 0:666850d06c9f 406 }
jhon309 0:666850d06c9f 407
jhon309 0:666850d06c9f 408 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSAX(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 409 {
jhon309 0:666850d06c9f 410 uint32_t result;
jhon309 0:666850d06c9f 411
jhon309 0:666850d06c9f 412 __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 413 return(result);
jhon309 0:666850d06c9f 414 }
jhon309 0:666850d06c9f 415
jhon309 0:666850d06c9f 416 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 417 {
jhon309 0:666850d06c9f 418 uint32_t result;
jhon309 0:666850d06c9f 419
jhon309 0:666850d06c9f 420 __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 421 return(result);
jhon309 0:666850d06c9f 422 }
jhon309 0:666850d06c9f 423
jhon309 0:666850d06c9f 424 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USAX(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 425 {
jhon309 0:666850d06c9f 426 uint32_t result;
jhon309 0:666850d06c9f 427
jhon309 0:666850d06c9f 428 __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 429 return(result);
jhon309 0:666850d06c9f 430 }
jhon309 0:666850d06c9f 431
jhon309 0:666850d06c9f 432 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 433 {
jhon309 0:666850d06c9f 434 uint32_t result;
jhon309 0:666850d06c9f 435
jhon309 0:666850d06c9f 436 __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 437 return(result);
jhon309 0:666850d06c9f 438 }
jhon309 0:666850d06c9f 439
jhon309 0:666850d06c9f 440 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 441 {
jhon309 0:666850d06c9f 442 uint32_t result;
jhon309 0:666850d06c9f 443
jhon309 0:666850d06c9f 444 __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 445 return(result);
jhon309 0:666850d06c9f 446 }
jhon309 0:666850d06c9f 447
jhon309 0:666850d06c9f 448 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USAD8(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 449 {
jhon309 0:666850d06c9f 450 uint32_t result;
jhon309 0:666850d06c9f 451
jhon309 0:666850d06c9f 452 __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 453 return(result);
jhon309 0:666850d06c9f 454 }
jhon309 0:666850d06c9f 455
jhon309 0:666850d06c9f 456 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3)
jhon309 0:666850d06c9f 457 {
jhon309 0:666850d06c9f 458 uint32_t result;
jhon309 0:666850d06c9f 459
jhon309 0:666850d06c9f 460 __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
jhon309 0:666850d06c9f 461 return(result);
jhon309 0:666850d06c9f 462 }
jhon309 0:666850d06c9f 463
jhon309 0:666850d06c9f 464 #define __SSAT16(ARG1,ARG2) \
jhon309 0:666850d06c9f 465 ({ \
jhon309 0:666850d06c9f 466 uint32_t __RES, __ARG1 = (ARG1); \
jhon309 0:666850d06c9f 467 __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
jhon309 0:666850d06c9f 468 __RES; \
jhon309 0:666850d06c9f 469 })
jhon309 0:666850d06c9f 470
jhon309 0:666850d06c9f 471 #define __USAT16(ARG1,ARG2) \
jhon309 0:666850d06c9f 472 ({ \
jhon309 0:666850d06c9f 473 uint32_t __RES, __ARG1 = (ARG1); \
jhon309 0:666850d06c9f 474 __ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \
jhon309 0:666850d06c9f 475 __RES; \
jhon309 0:666850d06c9f 476 })
jhon309 0:666850d06c9f 477
jhon309 0:666850d06c9f 478 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1)
jhon309 0:666850d06c9f 479 {
jhon309 0:666850d06c9f 480 uint32_t result;
jhon309 0:666850d06c9f 481
jhon309 0:666850d06c9f 482 __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1));
jhon309 0:666850d06c9f 483 return(result);
jhon309 0:666850d06c9f 484 }
jhon309 0:666850d06c9f 485
jhon309 0:666850d06c9f 486 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 487 {
jhon309 0:666850d06c9f 488 uint32_t result;
jhon309 0:666850d06c9f 489
jhon309 0:666850d06c9f 490 __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 491 return(result);
jhon309 0:666850d06c9f 492 }
jhon309 0:666850d06c9f 493
jhon309 0:666850d06c9f 494 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1)
jhon309 0:666850d06c9f 495 {
jhon309 0:666850d06c9f 496 uint32_t result;
jhon309 0:666850d06c9f 497
jhon309 0:666850d06c9f 498 __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1));
jhon309 0:666850d06c9f 499 return(result);
jhon309 0:666850d06c9f 500 }
jhon309 0:666850d06c9f 501
jhon309 0:666850d06c9f 502 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 503 {
jhon309 0:666850d06c9f 504 uint32_t result;
jhon309 0:666850d06c9f 505
jhon309 0:666850d06c9f 506 __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 507 return(result);
jhon309 0:666850d06c9f 508 }
jhon309 0:666850d06c9f 509
jhon309 0:666850d06c9f 510 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 511 {
jhon309 0:666850d06c9f 512 uint32_t result;
jhon309 0:666850d06c9f 513
jhon309 0:666850d06c9f 514 __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 515 return(result);
jhon309 0:666850d06c9f 516 }
jhon309 0:666850d06c9f 517
jhon309 0:666850d06c9f 518 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 519 {
jhon309 0:666850d06c9f 520 uint32_t result;
jhon309 0:666850d06c9f 521
jhon309 0:666850d06c9f 522 __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 523 return(result);
jhon309 0:666850d06c9f 524 }
jhon309 0:666850d06c9f 525
jhon309 0:666850d06c9f 526 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3)
jhon309 0:666850d06c9f 527 {
jhon309 0:666850d06c9f 528 uint32_t result;
jhon309 0:666850d06c9f 529
jhon309 0:666850d06c9f 530 __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
jhon309 0:666850d06c9f 531 return(result);
jhon309 0:666850d06c9f 532 }
jhon309 0:666850d06c9f 533
jhon309 0:666850d06c9f 534 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3)
jhon309 0:666850d06c9f 535 {
jhon309 0:666850d06c9f 536 uint32_t result;
jhon309 0:666850d06c9f 537
jhon309 0:666850d06c9f 538 __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
jhon309 0:666850d06c9f 539 return(result);
jhon309 0:666850d06c9f 540 }
jhon309 0:666850d06c9f 541
jhon309 0:666850d06c9f 542 #define __SMLALD(ARG1,ARG2,ARG3) \
jhon309 0:666850d06c9f 543 ({ \
jhon309 0:666850d06c9f 544 uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((uint64_t)(ARG3) >> 32), __ARG3_L = (uint32_t)((uint64_t)(ARG3) & 0xFFFFFFFFUL); \
jhon309 0:666850d06c9f 545 __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \
jhon309 0:666850d06c9f 546 (uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \
jhon309 0:666850d06c9f 547 })
jhon309 0:666850d06c9f 548
jhon309 0:666850d06c9f 549 #define __SMLALDX(ARG1,ARG2,ARG3) \
jhon309 0:666850d06c9f 550 ({ \
jhon309 0:666850d06c9f 551 uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((uint64_t)(ARG3) >> 32), __ARG3_L = (uint32_t)((uint64_t)(ARG3) & 0xFFFFFFFFUL); \
jhon309 0:666850d06c9f 552 __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \
jhon309 0:666850d06c9f 553 (uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \
jhon309 0:666850d06c9f 554 })
jhon309 0:666850d06c9f 555
jhon309 0:666850d06c9f 556 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 557 {
jhon309 0:666850d06c9f 558 uint32_t result;
jhon309 0:666850d06c9f 559
jhon309 0:666850d06c9f 560 __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 561 return(result);
jhon309 0:666850d06c9f 562 }
jhon309 0:666850d06c9f 563
jhon309 0:666850d06c9f 564 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 565 {
jhon309 0:666850d06c9f 566 uint32_t result;
jhon309 0:666850d06c9f 567
jhon309 0:666850d06c9f 568 __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 569 return(result);
jhon309 0:666850d06c9f 570 }
jhon309 0:666850d06c9f 571
jhon309 0:666850d06c9f 572 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3)
jhon309 0:666850d06c9f 573 {
jhon309 0:666850d06c9f 574 uint32_t result;
jhon309 0:666850d06c9f 575
jhon309 0:666850d06c9f 576 __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
jhon309 0:666850d06c9f 577 return(result);
jhon309 0:666850d06c9f 578 }
jhon309 0:666850d06c9f 579
jhon309 0:666850d06c9f 580 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3)
jhon309 0:666850d06c9f 581 {
jhon309 0:666850d06c9f 582 uint32_t result;
jhon309 0:666850d06c9f 583
jhon309 0:666850d06c9f 584 __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
jhon309 0:666850d06c9f 585 return(result);
jhon309 0:666850d06c9f 586 }
jhon309 0:666850d06c9f 587
jhon309 0:666850d06c9f 588 #define __SMLSLD(ARG1,ARG2,ARG3) \
jhon309 0:666850d06c9f 589 ({ \
jhon309 0:666850d06c9f 590 uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((ARG3) >> 32), __ARG3_L = (uint32_t)((ARG3) & 0xFFFFFFFFUL); \
jhon309 0:666850d06c9f 591 __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \
jhon309 0:666850d06c9f 592 (uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \
jhon309 0:666850d06c9f 593 })
jhon309 0:666850d06c9f 594
jhon309 0:666850d06c9f 595 #define __SMLSLDX(ARG1,ARG2,ARG3) \
jhon309 0:666850d06c9f 596 ({ \
jhon309 0:666850d06c9f 597 uint32_t __ARG1 = (ARG1), __ARG2 = (ARG2), __ARG3_H = (uint32_t)((ARG3) >> 32), __ARG3_L = (uint32_t)((ARG3) & 0xFFFFFFFFUL); \
jhon309 0:666850d06c9f 598 __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (__ARG3_L), "=r" (__ARG3_H) : "r" (__ARG1), "r" (__ARG2), "0" (__ARG3_L), "1" (__ARG3_H) ); \
jhon309 0:666850d06c9f 599 (uint64_t)(((uint64_t)__ARG3_H << 32) | __ARG3_L); \
jhon309 0:666850d06c9f 600 })
jhon309 0:666850d06c9f 601
jhon309 0:666850d06c9f 602 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SEL (uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 603 {
jhon309 0:666850d06c9f 604 uint32_t result;
jhon309 0:666850d06c9f 605
jhon309 0:666850d06c9f 606 __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 607 return(result);
jhon309 0:666850d06c9f 608 }
jhon309 0:666850d06c9f 609
jhon309 0:666850d06c9f 610 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 611 {
jhon309 0:666850d06c9f 612 uint32_t result;
jhon309 0:666850d06c9f 613
jhon309 0:666850d06c9f 614 __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 615 return(result);
jhon309 0:666850d06c9f 616 }
jhon309 0:666850d06c9f 617
jhon309 0:666850d06c9f 618 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB(uint32_t op1, uint32_t op2)
jhon309 0:666850d06c9f 619 {
jhon309 0:666850d06c9f 620 uint32_t result;
jhon309 0:666850d06c9f 621
jhon309 0:666850d06c9f 622 __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
jhon309 0:666850d06c9f 623 return(result);
jhon309 0:666850d06c9f 624 }
jhon309 0:666850d06c9f 625
jhon309 0:666850d06c9f 626 #define __PKHBT(ARG1,ARG2,ARG3) \
jhon309 0:666850d06c9f 627 ({ \
jhon309 0:666850d06c9f 628 uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \
jhon309 0:666850d06c9f 629 __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \
jhon309 0:666850d06c9f 630 __RES; \
jhon309 0:666850d06c9f 631 })
jhon309 0:666850d06c9f 632
jhon309 0:666850d06c9f 633 #define __PKHTB(ARG1,ARG2,ARG3) \
jhon309 0:666850d06c9f 634 ({ \
jhon309 0:666850d06c9f 635 uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \
jhon309 0:666850d06c9f 636 if (ARG3 == 0) \
jhon309 0:666850d06c9f 637 __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2) ); \
jhon309 0:666850d06c9f 638 else \
jhon309 0:666850d06c9f 639 __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \
jhon309 0:666850d06c9f 640 __RES; \
jhon309 0:666850d06c9f 641 })
jhon309 0:666850d06c9f 642
jhon309 0:666850d06c9f 643 __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3)
jhon309 0:666850d06c9f 644 {
jhon309 0:666850d06c9f 645 int32_t result;
jhon309 0:666850d06c9f 646
jhon309 0:666850d06c9f 647 __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) );
jhon309 0:666850d06c9f 648 return(result);
jhon309 0:666850d06c9f 649 }
jhon309 0:666850d06c9f 650
jhon309 0:666850d06c9f 651 /*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
jhon309 0:666850d06c9f 652
jhon309 0:666850d06c9f 653
jhon309 0:666850d06c9f 654
jhon309 0:666850d06c9f 655 #elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/
jhon309 0:666850d06c9f 656 /* TASKING carm specific functions */
jhon309 0:666850d06c9f 657
jhon309 0:666850d06c9f 658
jhon309 0:666850d06c9f 659 /*------ CM4 SIMD Intrinsics -----------------------------------------------------*/
jhon309 0:666850d06c9f 660 /* not yet supported */
jhon309 0:666850d06c9f 661 /*-- End CM4 SIMD Intrinsics -----------------------------------------------------*/
jhon309 0:666850d06c9f 662
jhon309 0:666850d06c9f 663
jhon309 0:666850d06c9f 664 #endif
jhon309 0:666850d06c9f 665
jhon309 0:666850d06c9f 666 /*@} end of group CMSIS_SIMD_intrinsics */
jhon309 0:666850d06c9f 667
jhon309 0:666850d06c9f 668
jhon309 0:666850d06c9f 669 #endif /* __CORE_CM4_SIMD_H */
jhon309 0:666850d06c9f 670
jhon309 0:666850d06c9f 671 #ifdef __cplusplus
jhon309 0:666850d06c9f 672 }
jhon309 0:666850d06c9f 673 #endif