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