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