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