PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)

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?

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