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