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