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:
<>
Date:
Tue Mar 14 16:20:51 2017 +0000
Revision:
138:093f2bd7b9eb
Parent:
113:f141b2784e32
Release 138 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3716: fix for issue #3715: correction in startup files for ARM and IAR, alignment of system_stm32f429xx.c files https://github.com/ARMmbed/mbed-os/pull/3716
3741: STM32 remove warning in hal_tick_32b.c file https://github.com/ARMmbed/mbed-os/pull/3741
3780: STM32L4 : Fix GPIO G port compatibility https://github.com/ARMmbed/mbed-os/pull/3780
3831: NCS36510: SPISLAVE enabled (Conflict resolved) https://github.com/ARMmbed/mbed-os/pull/3831
3836: Allow to redefine nRF's PSTORAGE_NUM_OF_PAGES outside of the mbed-os https://github.com/ARMmbed/mbed-os/pull/3836
3840: STM32: gpio SPEED - always set High Speed by default https://github.com/ARMmbed/mbed-os/pull/3840
3844: STM32 GPIO: Typo correction. Update comment (GPIO_IP_WITHOUT_BRR) https://github.com/ARMmbed/mbed-os/pull/3844
3850: STM32: change spi error to debug warning https://github.com/ARMmbed/mbed-os/pull/3850
3860: Define GPIO_IP_WITHOUT_BRR for xDot platform https://github.com/ARMmbed/mbed-os/pull/3860
3880: DISCO_F469NI: allow the use of CAN2 instance when CAN1 is not activated https://github.com/ARMmbed/mbed-os/pull/3880
3795: Fix pwm period calc https://github.com/ARMmbed/mbed-os/pull/3795
3828: STM32 CAN API: correct format and type https://github.com/ARMmbed/mbed-os/pull/3828
3842: TARGET_NRF: corrected spi_init() to properly handle re-initialization https://github.com/ARMmbed/mbed-os/pull/3842
3843: STM32L476xG: set APB2 clock to 80MHz (instead of 40MHz) https://github.com/ARMmbed/mbed-os/pull/3843
3879: NUCLEO_F446ZE: Add missing AnalogIn pins on PF_3, PF_5 and PF_10. https://github.com/ARMmbed/mbed-os/pull/3879
3902: Fix heap and stack size for NUCLEO_F746ZG https://github.com/ARMmbed/mbed-os/pull/3902
3829: can_write(): return error code when no tx mailboxes are available https://github.com/ARMmbed/mbed-os/pull/3829

Who changed what in which revision?

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