The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
AnnaBridge
Date:
Fri May 26 12:30:20 2017 +0100
Revision:
143:86740a56073b
Parent:
107:4f6c30876dfa
Release 143 of the mbed library.

Who changed what in which revision?

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