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