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