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:
Wed Apr 12 16:07:08 2017 +0100
Revision:
140:97feb9bacc10
Parent:
100:cbbeb26dbd92
Release 140 of the mbed library

Ports for Upcoming Targets

3841: Add nRf52840 target https://github.com/ARMmbed/mbed-os/pull/3841
3992: Introducing UBLOX_C030 platform. https://github.com/ARMmbed/mbed-os/pull/3992

Fixes and Changes

3951: [NUCLEO_F303ZE] Correct ARDUINO pin https://github.com/ARMmbed/mbed-os/pull/3951
4021: Fixing a macro to detect when RTOS was in use for the NRF52840_DK https://github.com/ARMmbed/mbed-os/pull/4021
3979: KW24D: Add missing SPI defines and Arduino connector definitions https://github.com/ARMmbed/mbed-os/pull/3979
3990: UBLOX_C027: construct a ticker-based wait, rather than calling wait_ms(), in the https://github.com/ARMmbed/mbed-os/pull/3990
4003: Fixed OBOE in async serial tx for NRF52 target, fixes #4002 https://github.com/ARMmbed/mbed-os/pull/4003
4012: STM32: Correct I2C master error handling https://github.com/ARMmbed/mbed-os/pull/4012
4020: NUCLEO_L011K4 remove unsupported tool chain files https://github.com/ARMmbed/mbed-os/pull/4020
4065: K66F: Move bss section to m_data_2 Section https://github.com/ARMmbed/mbed-os/pull/4065
4014: Issue 3763: Reduce heap allocation in the GCC linker file https://github.com/ARMmbed/mbed-os/pull/4014
4030: [STM32L0] reduce IAR heap and stack size for small targets https://github.com/ARMmbed/mbed-os/pull/4030
4109: NUCLEO_L476RG : minor serial pin update https://github.com/ARMmbed/mbed-os/pull/4109
3982: Ticker - kl25z bugfix for handling events in the past https://github.com/ARMmbed/mbed-os/pull/3982

Who changed what in which revision?

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