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