I2C_EEPROM

Committer:
jhon309
Date:
Thu Aug 13 00:23:16 2015 +0000
Revision:
0:ac8863619623
I2C

Who changed what in which revision?

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