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