The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
<>
Date:
Mon Jan 16 12:05:23 2017 +0000
Revision:
134:ad3be0349dc5
Parent:
99:dbbf35b96557
Release 134 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3488: Dev stm i2c v2 unitary functions https://github.com/ARMmbed/mbed-os/pull/3488
3492: Fix #3463 CAN read() return value https://github.com/ARMmbed/mbed-os/pull/3492
3503: [LPC15xx] Ensure that PWM=1 is resolved correctly https://github.com/ARMmbed/mbed-os/pull/3503
3504: [LPC15xx] CAN implementation improvements https://github.com/ARMmbed/mbed-os/pull/3504
3539: NUCLEO_F412ZG - Add support of TRNG peripheral https://github.com/ARMmbed/mbed-os/pull/3539
3540: STM: SPI: Initialize Rx in spi_master_write https://github.com/ARMmbed/mbed-os/pull/3540
3438: K64F: Add support for SERIAL ASYNCH API https://github.com/ARMmbed/mbed-os/pull/3438
3519: MCUXpresso: Fix ENET driver to enable interrupts after interrupt handler is set https://github.com/ARMmbed/mbed-os/pull/3519
3544: STM32L4 deepsleep improvement https://github.com/ARMmbed/mbed-os/pull/3544
3546: NUCLEO-F412ZG - Add CAN peripheral https://github.com/ARMmbed/mbed-os/pull/3546
3551: Fix I2C driver for RZ/A1H https://github.com/ARMmbed/mbed-os/pull/3551
3558: K64F UART Asynch API: Fix synchronization issue https://github.com/ARMmbed/mbed-os/pull/3558
3563: LPC4088 - Fix vector checksum https://github.com/ARMmbed/mbed-os/pull/3563
3567: Dev stm32 F0 v1.7.0 https://github.com/ARMmbed/mbed-os/pull/3567
3577: Fixes linking errors when building with debug profile https://github.com/ARMmbed/mbed-os/pull/3577

Who changed what in which revision?

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