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