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