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