DHT11

Committer:
jhon309
Date:
Thu Aug 13 00:21:57 2015 +0000
Revision:
0:c52df770855b
DHT11

Who changed what in which revision?

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