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