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:
Kojto
Date:
Tue Feb 14 11:24:20 2017 +0000
Revision:
136:ef9c61f8c49f
Parent:
112:6f327212ef96
Release 136 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3432: Target STM USBHOST support https://github.com/ARMmbed/mbed-os/pull/3432
3181: NUCLEO_F207ZG extending PeripheralPins.c: all available alternate functions can be used now https://github.com/ARMmbed/mbed-os/pull/3181
3626: NUCLEO_F412ZG : Add USB Device +Host https://github.com/ARMmbed/mbed-os/pull/3626
3628: Fix warnings https://github.com/ARMmbed/mbed-os/pull/3628
3629: STM32: L0 LL layer https://github.com/ARMmbed/mbed-os/pull/3629
3632: IDE Export support for platform VK_RZ_A1H https://github.com/ARMmbed/mbed-os/pull/3632
3642: Missing IRQ pin fix for platform VK_RZ_A1H https://github.com/ARMmbed/mbed-os/pull/3642
3664: Fix ncs36510 sleep definitions https://github.com/ARMmbed/mbed-os/pull/3664
3655: [STM32F4] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3655
3657: [STM32L4] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3657
3658: [STM32F3] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3658
3685: STM32: I2C: reset state machine https://github.com/ARMmbed/mbed-os/pull/3685
3692: uVisor: Standardize available legacy heap and stack https://github.com/ARMmbed/mbed-os/pull/3692
3621: Fix for #2884, LPC824: export to LPCXpresso, target running with wron https://github.com/ARMmbed/mbed-os/pull/3621
3649: [STM32F7] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3649
3695: Enforce device_name is valid in targets.json https://github.com/ARMmbed/mbed-os/pull/3695
3723: NCS36510: spi_format function bug fix https://github.com/ARMmbed/mbed-os/pull/3723

Who changed what in which revision?

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