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