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