diff --git a/CMakeLists.txt b/CMakeLists.txt index fe45c1f..1ddaef3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,14 @@ add_executable(ei_rp2040_firmware src/main.cpp ) +# Define options for different boards +OPTION(BOARD_MICROMOD "Select MicroMod board" OFF) + +# Conditionally define macros based on the selected board +if (BOARD_MICROMOD) + target_compile_definitions(ei_rp2040_firmware PRIVATE BOARD_MICROMOD=1) +endif() + OPTION(DEFINE_PIN_UART "Only use TX/RX pins and not USB UART" OFF) @@ -100,6 +108,7 @@ target_include_directories(ei_rp2040_firmware PRIVATE ThirdParty/Seeed_Arduino_UltrasonicRanger ThirdParty/Wire/src ThirdParty/Arduino_LSM6DSOX/src + ThirdParty/LIS2DH12/src ThirdParty/rp2040_DHT11_lib ThirdParty/PDM/src/include ) diff --git a/ThirdParty/LIS2DH12/src/LIS2DH12.cpp b/ThirdParty/LIS2DH12/src/LIS2DH12.cpp new file mode 100644 index 0000000..4fd4ee6 --- /dev/null +++ b/ThirdParty/LIS2DH12/src/LIS2DH12.cpp @@ -0,0 +1,161 @@ +/* Include ----------------------------------------------------------------- */ +#include "LIS2DH12.h" + +/* Constant defines -------------------------------------------------------- */ +// Registers +#define LIS2DH12_STATUS_REG_AUX 0x07U +#define LIS2DH12_OUT_TEMP_L 0x0CU +#define LIS2DH12_WHO_AM_I_REG 0X0FU +#define LIS2DH12_TEMP_CFG_REG 0x1FU +#define LIS2DH12_CTRL_REG1 0x20U +#define LIS2DH12_CTRL_REG4 0x23U +#define LIS2DH12_STATUS_REG 0x27U +#define LIS2DH12_OUT_X_L 0x28U + +// Register masks +#define LIS2DH12_STATUS_REG_ZYXOR_MASK 0x80u +#define LIS2DH12_STATUS_REG_AUX_TDA_MASK 0x04u + +LIS2DH12Class::LIS2DH12Class(TwoWire& wire, uint8_t slaveAddress) : + _wire(&wire), + _slaveAddress(slaveAddress) +{ +} + +LIS2DH12Class::~LIS2DH12Class() { /* Nothing to do */ } + +int LIS2DH12Class::begin() +{ + int8_t type; + uint8_t ret; + _wire->begin(); + + type = readRegister(LIS2DH12_WHO_AM_I_REG); + if (type != MOTION_SENSOR_LIS2DH12) { + return 0; + } + + // Data rate: 100Hz, enable all axis, high-resolution mode + writeRegister(LIS2DH12_CTRL_REG1, 0x57); + + //Enable block data update, full-scale 2g, hr 1 + writeRegister(LIS2DH12_CTRL_REG4, 0x88); + + //Enable temperature sensor + writeRegister(LIS2DH12_TEMP_CFG_REG, 0xC0); + + return type; +} + +void LIS2DH12Class::end() +{ + _wire->end(); +} + +int LIS2DH12Class::readAcceleration(float& x, float& y, float& z) +{ + int16_t data[3]; + + if (!readRegisters(LIS2DH12_OUT_X_L, (uint8_t*)data, sizeof(data))) { + x = NAN; + y = NAN; + z = NAN; + + return 0; + } + + /* First convert fs2 hr to mg and then to g */ + x = ((data[0] / 16.0f) * 1.0f) / 1000.0f; + y = ((data[1] / 16.0f) * 1.0f) / 1000.0f; + z = ((data[2] / 16.0f) * 1.0f) / 1000.0f; + + return 1; +} + +int LIS2DH12Class::accelerationAvailable() +{ + uint8_t data; + if (readRegisters(LIS2DH12_STATUS_REG, &data, 1) != 1) { + return 0; + } + + return (data & LIS2DH12_STATUS_REG_ZYXOR_MASK) ? 1 : 0; +} + +float LIS2DH12Class::accelerationSampleRate() +{ + return 100.0F; +} + +int LIS2DH12Class::readTemperature(int & temperature_deg) +{ + /* Read the raw temperature from the sensor. */ + int16_t temperature_raw = 0; + + if (readRegisters(LIS2DH12_OUT_TEMP_L, reinterpret_cast(&temperature_raw), sizeof(temperature_raw)) != 1) { + return 0; + } + + temperature_deg = (((float)temperature_raw / 64.0f ) / 4.0f ) + 25.0f; + + return 1; +} + +int LIS2DH12Class::temperatureAvailable() +{ + uint8_t data; + + if (readRegisters(LIS2DH12_STATUS_REG_AUX, &data, 1) != 1) { + return 0; + } + return (data & LIS2DH12_STATUS_REG_AUX_TDA_MASK) ? 1 : 0; +} + +int LIS2DH12Class::readRegister(uint8_t address) +{ +uint8_t value; + +if (readRegisters(address, &value, sizeof(value)) != 1) { + return -1; +} + +return value; +} + +int LIS2DH12Class::readRegisters(uint8_t address, uint8_t* data, size_t length) +{ + if (length > 1) + { + //For multi byte reads we must set the first bit to 1 + address |= 0x80; + } + + _wire->beginTransmission(_slaveAddress); + _wire->write(address); + + if (_wire->endTransmission(false) != 0) { + return -1; + } + + if (_wire->requestFrom(_slaveAddress, length) != length) { + return 0; + } + + for (size_t i = 0; i < length; i++) { + *data++ = _wire->read(); + } + return 1; +} + +int LIS2DH12Class::writeRegister(uint8_t address, uint8_t value) +{ + _wire->beginTransmission(_slaveAddress); + _wire->write(address); + _wire->write(value); + if (_wire->endTransmission() != 0) { + return 0; + } + return 1; +} + +LIS2DH12Class MOTION(Wire, LIS2DH12_ADDRESS); diff --git a/ThirdParty/LIS2DH12/src/LIS2DH12.h b/ThirdParty/LIS2DH12/src/LIS2DH12.h new file mode 100644 index 0000000..83ec317 --- /dev/null +++ b/ThirdParty/LIS2DH12/src/LIS2DH12.h @@ -0,0 +1,58 @@ + /* + This file is part of the Arduino_LIS2DH12 library. + Copyright (c) 2021 Arduino SA. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + + #include + #include + #include + #include + #include + #include + + #define MOTION_SENSOR_LIS2DH12 0x33 + #define LIS2DH12_ADDRESS 0x19U + + class LIS2DH12Class { + public: + LIS2DH12Class(TwoWire& wire, uint8_t slaveAddress); + ~LIS2DH12Class(); + + int begin(); + void end(); + + // Accelerometer + int readAcceleration(float& x, float& y, float& z); + float accelerationSampleRate(); + int accelerationAvailable(); + + // Temperature + int readTemperature(int & temperature_deg); + int temperatureAvailable(); + + private: + int readRegister(uint8_t address); + int readRegisters(uint8_t address, uint8_t* data, size_t length); + int writeRegister(uint8_t address, uint8_t value); + + + private: + TwoWire* _wire; + uint8_t _slaveAddress; + }; + + extern LIS2DH12Class MOTION; diff --git a/ThirdParty/Wire/src/Wire.h b/ThirdParty/Wire/src/Wire.h index 9db4868..de6e919 100644 --- a/ThirdParty/Wire/src/Wire.h +++ b/ThirdParty/Wire/src/Wire.h @@ -46,12 +46,19 @@ constexpr uint32_t __bitset(const int (&a)[N], size_t i = 0U) { #define WIRE_BUFFER_SIZE 128 #endif +#ifdef BOARD_MICROMOD +#define SDA 4 +#define SCL 5 +#define PIN_WIRE1_SDA 26 +#define PIN_WIRE1_SCL 27 +#else // Wire #define SDA 12 #define SCL 13 #define PIN_WIRE1_SDA 6 #define PIN_WIRE1_SCL 7 +#endif class TwoWire { public: diff --git a/edge-impulse-sdk/.gitignore b/edge-impulse-sdk/.gitignore index b071295..ce7014e 100644 --- a/edge-impulse-sdk/.gitignore +++ b/edge-impulse-sdk/.gitignore @@ -7,3 +7,7 @@ utensor.lib utensor/libutensor.a *.o *.d +doc/ +node_modules/ +package-lock.json +package.json \ No newline at end of file diff --git a/edge-impulse-sdk/CMSIS/Core/Include/cachel1_armv7.h b/edge-impulse-sdk/CMSIS/Core/Include/cachel1_armv7.h index d2c3e22..e8f4002 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/cachel1_armv7.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/cachel1_armv7.h @@ -1,11 +1,11 @@ /****************************************************************************** * @file cachel1_armv7.h * @brief CMSIS Level 1 Cache API for Armv7-M and later - * @version V1.0.0 - * @date 03. March 2020 + * @version V1.0.2 + * @date 22. June 2022 ******************************************************************************/ /* - * Copyright (c) 2020 Arm Limited. All rights reserved. + * Copyright (c) 2020-2021 Arm Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -48,7 +48,7 @@ #ifndef __SCB_ICACHE_LINE_SIZE #define __SCB_ICACHE_LINE_SIZE 32U /*!< Cortex-M7 cache line size is fixed to 32 bytes (8 words). See also register SCB_CCSIDR */ -#endif +#endif /** \brief Enable I-Cache @@ -112,7 +112,7 @@ __STATIC_FORCEINLINE void SCB_InvalidateICache (void) \param[in] addr address \param[in] isize size of memory block (in number of bytes) */ -__STATIC_FORCEINLINE void SCB_InvalidateICache_by_Addr (void *addr, int32_t isize) +__STATIC_FORCEINLINE void SCB_InvalidateICache_by_Addr (volatile void *addr, int32_t isize) { #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) if ( isize > 0 ) { @@ -181,9 +181,15 @@ __STATIC_FORCEINLINE void SCB_EnableDCache (void) __STATIC_FORCEINLINE void SCB_DisableDCache (void) { #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - uint32_t ccsidr; - uint32_t sets; - uint32_t ways; + struct { + uint32_t ccsidr; + uint32_t sets; + uint32_t ways; + } locals + #if ((defined(__GNUC__) || defined(__clang__)) && !defined(__OPTIMIZE__)) + __ALIGNED(__SCB_DCACHE_LINE_SIZE) + #endif + ; SCB->CSSELR = 0U; /* select Level 1 data cache */ __DSB(); @@ -191,20 +197,37 @@ __STATIC_FORCEINLINE void SCB_DisableDCache (void) SCB->CCR &= ~(uint32_t)SCB_CCR_DC_Msk; /* disable D-Cache */ __DSB(); - ccsidr = SCB->CCSIDR; + #if ((defined(__GNUC__) || defined(__clang__)) && !defined(__OPTIMIZE__)) + /* + * For the endless loop issue with GCC and clang with O0. + * More details, see https://github.com/ARM-software/CMSIS_5/issues/620 + * + * The issue only happens when local variables are in stack (GCC/clang O0). If + * local variables are saved in general purpose register, then the function + * is OK. + * + * When local variables are in stack, after disabling the cache, flush the + * local variables cache line for data consistency. + */ + /* Clean and invalidate the local variable cache. */ + SCB->DCCIMVAC = (uint32_t)&locals; + __DSB(); + __ISB(); + #endif + locals.ccsidr = SCB->CCSIDR; /* clean & invalidate D-Cache */ - sets = (uint32_t)(CCSIDR_SETS(ccsidr)); + locals.sets = (uint32_t)(CCSIDR_SETS(locals.ccsidr)); do { - ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); + locals.ways = (uint32_t)(CCSIDR_WAYS(locals.ccsidr)); do { - SCB->DCCISW = (((sets << SCB_DCCISW_SET_Pos) & SCB_DCCISW_SET_Msk) | - ((ways << SCB_DCCISW_WAY_Pos) & SCB_DCCISW_WAY_Msk) ); + SCB->DCCISW = (((locals.sets << SCB_DCCISW_SET_Pos) & SCB_DCCISW_SET_Msk) | + ((locals.ways << SCB_DCCISW_WAY_Pos) & SCB_DCCISW_WAY_Msk) ); #if defined ( __CC_ARM ) __schedule_barrier(); #endif - } while (ways-- != 0U); - } while(sets-- != 0U); + } while (locals.ways-- != 0U); + } while(locals.sets-- != 0U); __DSB(); __ISB(); @@ -325,13 +348,13 @@ __STATIC_FORCEINLINE void SCB_CleanInvalidateDCache (void) \param[in] addr address \param[in] dsize size of memory block (in number of bytes) */ -__STATIC_FORCEINLINE void SCB_InvalidateDCache_by_Addr (void *addr, int32_t dsize) +__STATIC_FORCEINLINE void SCB_InvalidateDCache_by_Addr (volatile void *addr, int32_t dsize) { #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - if ( dsize > 0 ) { + if ( dsize > 0 ) { int32_t op_size = dsize + (((uint32_t)addr) & (__SCB_DCACHE_LINE_SIZE - 1U)); uint32_t op_addr = (uint32_t)addr /* & ~(__SCB_DCACHE_LINE_SIZE - 1U) */; - + __DSB(); do { @@ -355,13 +378,13 @@ __STATIC_FORCEINLINE void SCB_InvalidateDCache_by_Addr (void *addr, int32_t dsiz \param[in] addr address \param[in] dsize size of memory block (in number of bytes) */ -__STATIC_FORCEINLINE void SCB_CleanDCache_by_Addr (uint32_t *addr, int32_t dsize) +__STATIC_FORCEINLINE void SCB_CleanDCache_by_Addr (volatile void *addr, int32_t dsize) { #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - if ( dsize > 0 ) { + if ( dsize > 0 ) { int32_t op_size = dsize + (((uint32_t)addr) & (__SCB_DCACHE_LINE_SIZE - 1U)); uint32_t op_addr = (uint32_t)addr /* & ~(__SCB_DCACHE_LINE_SIZE - 1U) */; - + __DSB(); do { @@ -385,13 +408,13 @@ __STATIC_FORCEINLINE void SCB_CleanDCache_by_Addr (uint32_t *addr, int32_t dsize \param[in] addr address (aligned to 32-byte boundary) \param[in] dsize size of memory block (in number of bytes) */ -__STATIC_FORCEINLINE void SCB_CleanInvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize) +__STATIC_FORCEINLINE void SCB_CleanInvalidateDCache_by_Addr (volatile void *addr, int32_t dsize) { #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) - if ( dsize > 0 ) { + if ( dsize > 0 ) { int32_t op_size = dsize + (((uint32_t)addr) & (__SCB_DCACHE_LINE_SIZE - 1U)); uint32_t op_addr = (uint32_t)addr /* & ~(__SCB_DCACHE_LINE_SIZE - 1U) */; - + __DSB(); do { diff --git a/edge-impulse-sdk/CMSIS/Core/Include/cmsis_armcc.h b/edge-impulse-sdk/CMSIS/Core/Include/cmsis_armcc.h index ced0a2c..a955d47 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/cmsis_armcc.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/cmsis_armcc.h @@ -1,8 +1,8 @@ /**************************************************************************//** * @file cmsis_armcc.h * @brief CMSIS compiler ARMCC (Arm Compiler 5) header file - * @version V5.3.0 - * @date 19. February 2021 + * @version V5.3.2 + * @date 27. May 2021 ******************************************************************************/ /* * Copyright (c) 2009-2021 Arm Limited. All rights reserved. @@ -131,672 +131,673 @@ #define __VECTOR_TABLE_ATTRIBUTE __attribute__((used, section("RESET"))) #endif -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions @{ - */ +*/ /** - \brief Enable IRQ Interrupts - \details Enables IRQ interrupts by clearing the I-bit in the CPSR. - Can only be executed in Privileged modes. + \brief No Operation + \details No Operation does nothing. This instruction can be used for code alignment purposes. */ -/* intrinsic void __enable_irq(); */ +#define __NOP __nop /** - \brief Disable IRQ Interrupts - \details Disables IRQ interrupts by setting the I-bit in the CPSR. - Can only be executed in Privileged modes. + \brief Wait For Interrupt + \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. */ -/* intrinsic void __disable_irq(); */ +#define __WFI __wfi + /** - \brief Get Control Register - \details Returns the content of the Control Register. - \return Control Register value + \brief Wait For Event + \details Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. */ -__STATIC_INLINE uint32_t __get_CONTROL(void) -{ - register uint32_t __regControl __ASM("control"); - return(__regControl); -} +#define __WFE __wfe /** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set + \brief Send Event + \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. */ -__STATIC_INLINE void __set_CONTROL(uint32_t control) -{ - register uint32_t __regControl __ASM("control"); - __regControl = control; -} +#define __SEV __sev /** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value + \brief Instruction Synchronization Barrier + \details Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or memory, + after the instruction has been completed. */ -__STATIC_INLINE uint32_t __get_IPSR(void) -{ - register uint32_t __regIPSR __ASM("ipsr"); - return(__regIPSR); -} +#define __ISB() __isb(0xF) +/** + \brief Data Synchronization Barrier + \details Acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. + */ +#define __DSB() __dsb(0xF) /** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value + \brief Data Memory Barrier + \details Ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. */ -__STATIC_INLINE uint32_t __get_APSR(void) -{ - register uint32_t __regAPSR __ASM("apsr"); - return(__regAPSR); -} +#define __DMB() __dmb(0xF) /** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value + \brief Reverse byte order (32 bit) + \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. + \param [in] value Value to reverse + \return Reversed value */ -__STATIC_INLINE uint32_t __get_xPSR(void) -{ - register uint32_t __regXPSR __ASM("xpsr"); - return(__regXPSR); -} +#define __REV __rev /** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value + \brief Reverse byte order (16 bit) + \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. + \param [in] value Value to reverse + \return Reversed value */ -__STATIC_INLINE uint32_t __get_PSP(void) +#ifndef __NO_EMBEDDED_ASM +__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value) { - register uint32_t __regProcessStackPointer __ASM("psp"); - return(__regProcessStackPointer); + rev16 r0, r0 + bx lr } +#endif /** - \brief Set Process Stack Pointer - \details Assigns the given value to the Process Stack Pointer (PSP). - \param [in] topOfProcStack Process Stack Pointer value to set + \brief Reverse byte order (16 bit) + \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. + \param [in] value Value to reverse + \return Reversed value */ -__STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) +#ifndef __NO_EMBEDDED_ASM +__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int16_t __REVSH(int16_t value) { - register uint32_t __regProcessStackPointer __ASM("psp"); - __regProcessStackPointer = topOfProcStack; + revsh r0, r0 + bx lr } +#endif /** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value + \brief Rotate Right in unsigned value (32 bit) + \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + \param [in] op1 Value to rotate + \param [in] op2 Number of Bits to rotate + \return Rotated value */ -__STATIC_INLINE uint32_t __get_MSP(void) -{ - register uint32_t __regMainStackPointer __ASM("msp"); - return(__regMainStackPointer); -} +#define __ROR __ror /** - \brief Set Main Stack Pointer - \details Assigns the given value to the Main Stack Pointer (MSP). - \param [in] topOfMainStack Main Stack Pointer value to set + \brief Breakpoint + \details Causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. */ -__STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) -{ - register uint32_t __regMainStackPointer __ASM("msp"); - __regMainStackPointer = topOfMainStack; -} +#define __BKPT(value) __breakpoint(value) /** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value + \brief Reverse bit order of value + \details Reverses the bit order of the given value. + \param [in] value Value to reverse + \return Reversed value */ -__STATIC_INLINE uint32_t __get_PRIMASK(void) +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) + #define __RBIT __rbit +#else +__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) { - register uint32_t __regPriMask __ASM("primask"); - return(__regPriMask); + uint32_t result; + uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */ + + result = value; /* r will be reversed bits of v; first get LSB of v */ + for (value >>= 1U; value != 0U; value >>= 1U) + { + result <<= 1U; + result |= value & 1U; + s--; + } + result <<= s; /* shift when v's highest bits are zero */ + return result; } +#endif /** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask + \brief Count leading zeros + \details Counts the number of leading zeros of a data value. + \param [in] value Value to count the leading zeros + \return number of leading zeros in value */ -__STATIC_INLINE void __set_PRIMASK(uint32_t priMask) -{ - register uint32_t __regPriMask __ASM("primask"); - __regPriMask = (priMask); -} +#define __CLZ __clz #if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) /** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing the F-bit in the CPSR. - Can only be executed in Privileged modes. + \brief LDR Exclusive (8 bit) + \details Executes a exclusive LDR instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) */ -#define __enable_fault_irq __enable_fiq +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr)) +#else + #define __LDREXB(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint8_t ) __ldrex(ptr)) _Pragma("pop") +#endif /** - \brief Disable FIQ - \details Disables FIQ interrupts by setting the F-bit in the CPSR. - Can only be executed in Privileged modes. + \brief LDR Exclusive (16 bit) + \details Executes a exclusive LDR instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) */ -#define __disable_fault_irq __disable_fiq +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __LDREXH(ptr) ((uint16_t) __ldrex(ptr)) +#else + #define __LDREXH(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint16_t) __ldrex(ptr)) _Pragma("pop") +#endif /** - \brief Get Base Priority - \details Returns the current value of the Base Priority register. - \return Base Priority register value + \brief LDR Exclusive (32 bit) + \details Executes a exclusive LDR instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) */ -__STATIC_INLINE uint32_t __get_BASEPRI(void) -{ - register uint32_t __regBasePri __ASM("basepri"); - return(__regBasePri); -} +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr)) +#else + #define __LDREXW(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint32_t ) __ldrex(ptr)) _Pragma("pop") +#endif /** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set + \brief STR Exclusive (8 bit) + \details Executes a exclusive STR instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed */ -__STATIC_INLINE void __set_BASEPRI(uint32_t basePri) -{ - register uint32_t __regBasePri __ASM("basepri"); - __regBasePri = (basePri & 0xFFU); -} +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __STREXB(value, ptr) __strex(value, ptr) +#else + #define __STREXB(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") +#endif /** - \brief Set Base Priority with condition - \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__STATIC_INLINE void __set_BASEPRI_MAX(uint32_t basePri) -{ - register uint32_t __regBasePriMax __ASM("basepri_max"); - __regBasePriMax = (basePri & 0xFFU); -} + \brief STR Exclusive (16 bit) + \details Executes a exclusive STR instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __STREXH(value, ptr) __strex(value, ptr) +#else + #define __STREXH(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") +#endif /** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value + \brief STR Exclusive (32 bit) + \details Executes a exclusive STR instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed */ -__STATIC_INLINE uint32_t __get_FAULTMASK(void) -{ - register uint32_t __regFaultMask __ASM("faultmask"); - return(__regFaultMask); -} +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __STREXW(value, ptr) __strex(value, ptr) +#else + #define __STREXW(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") +#endif /** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set + \brief Remove the exclusive lock + \details Removes the exclusive lock which is created by LDREX. */ -__STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) -{ - register uint32_t __regFaultMask __ASM("faultmask"); - __regFaultMask = (faultMask & (uint32_t)1U); -} - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ +#define __CLREX __clrex /** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value */ -__STATIC_INLINE uint32_t __get_FPSCR(void) -{ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) - register uint32_t __regfpscr __ASM("fpscr"); - return(__regfpscr); -#else - return(0U); -#endif -} +#define __SSAT __ssat /** - \brief Set FPSCR - \details Assigns the given value to the Floating Point Status/Control register. - \param [in] fpscr Floating Point Status/Control value to set + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value */ -__STATIC_INLINE void __set_FPSCR(uint32_t fpscr) -{ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) - register uint32_t __regfpscr __ASM("fpscr"); - __regfpscr = (fpscr); -#else - (void)fpscr; -#endif -} - - -/*@} end of CMSIS_Core_RegAccFunctions */ - +#define __USAT __usat -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ /** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. + \brief Rotate Right with Extend (32 bit) + \details Moves each bit of a bitstring right by one bit. + The carry input is shifted in at the left end of the bitstring. + \param [in] value Value to rotate + \return Rotated value */ -#define __NOP __nop +#ifndef __NO_EMBEDDED_ASM +__attribute__((section(".rrx_text"))) __STATIC_INLINE __ASM uint32_t __RRX(uint32_t value) +{ + rrx r0, r0 + bx lr +} +#endif /** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. + \brief LDRT Unprivileged (8 bit) + \details Executes a Unprivileged LDRT instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) */ -#define __WFI __wfi +#define __LDRBT(ptr) ((uint8_t ) __ldrt(ptr)) /** - \brief Wait For Event - \details Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. + \brief LDRT Unprivileged (16 bit) + \details Executes a Unprivileged LDRT instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) */ -#define __WFE __wfe +#define __LDRHT(ptr) ((uint16_t) __ldrt(ptr)) /** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. + \brief LDRT Unprivileged (32 bit) + \details Executes a Unprivileged LDRT instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) */ -#define __SEV __sev +#define __LDRT(ptr) ((uint32_t ) __ldrt(ptr)) /** - \brief Instruction Synchronization Barrier - \details Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or memory, - after the instruction has been completed. + \brief STRT Unprivileged (8 bit) + \details Executes a Unprivileged STRT instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -#define __ISB() __isb(0xF) +#define __STRBT(value, ptr) __strt(value, ptr) -/** - \brief Data Synchronization Barrier - \details Acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. - */ -#define __DSB() __dsb(0xF) /** - \brief Data Memory Barrier - \details Ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. + \brief STRT Unprivileged (16 bit) + \details Executes a Unprivileged STRT instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -#define __DMB() __dmb(0xF) +#define __STRHT(value, ptr) __strt(value, ptr) /** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. - \param [in] value Value to reverse - \return Reversed value + \brief STRT Unprivileged (32 bit) + \details Executes a Unprivileged STRT instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -#define __REV __rev +#define __STRT(value, ptr) __strt(value, ptr) +#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ /** - \brief Reverse byte order (16 bit) - \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. - \param [in] value Value to reverse - \return Reversed value + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value */ -#ifndef __NO_EMBEDDED_ASM -__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value) +__attribute__((always_inline)) __STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat) { - rev16 r0, r0 - bx lr + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; } -#endif - /** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. - \param [in] value Value to reverse - \return Reversed value + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value */ -#ifndef __NO_EMBEDDED_ASM -__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int16_t __REVSH(int16_t value) +__attribute__((always_inline)) __STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat) { - revsh r0, r0 - bx lr + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; } -#endif +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ -/** - \brief Rotate Right in unsigned value (32 bit) - \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - \param [in] op1 Value to rotate - \param [in] op2 Number of Bits to rotate - \return Rotated value - */ -#define __ROR __ror +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ -/** - \brief Breakpoint - \details Causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions + @{ */ -#define __BKPT(value) __breakpoint(value) - /** - \brief Reverse bit order of value - \details Reverses the bit order of the given value. - \param [in] value Value to reverse - \return Reversed value + \brief Enable IRQ Interrupts + \details Enables IRQ interrupts by clearing special-purpose register PRIMASK. + Can only be executed in Privileged modes. */ -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) - #define __RBIT __rbit -#else -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value != 0U; value >>= 1U) - { - result <<= 1U; - result |= value & 1U; - s--; - } - result <<= s; /* shift when v's highest bits are zero */ - return result; -} -#endif +/* intrinsic void __enable_irq(); */ /** - \brief Count leading zeros - \details Counts the number of leading zeros of a data value. - \param [in] value Value to count the leading zeros - \return number of leading zeros in value + \brief Disable IRQ Interrupts + \details Disables IRQ interrupts by setting special-purpose register PRIMASK. + Can only be executed in Privileged modes. */ -#define __CLZ __clz - - -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) +/* intrinsic void __disable_irq(); */ /** - \brief LDR Exclusive (8 bit) - \details Executes a exclusive LDR instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) + \brief Get Control Register + \details Returns the content of the Control Register. + \return Control Register value */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) - #define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr)) -#else - #define __LDREXB(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint8_t ) __ldrex(ptr)) _Pragma("pop") -#endif +__STATIC_INLINE uint32_t __get_CONTROL(void) +{ + register uint32_t __regControl __ASM("control"); + return(__regControl); +} /** - \brief LDR Exclusive (16 bit) - \details Executes a exclusive LDR instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) + \brief Set Control Register + \details Writes the given value to the Control Register. + \param [in] control Control Register value to set */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) - #define __LDREXH(ptr) ((uint16_t) __ldrex(ptr)) -#else - #define __LDREXH(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint16_t) __ldrex(ptr)) _Pragma("pop") -#endif +__STATIC_INLINE void __set_CONTROL(uint32_t control) +{ + register uint32_t __regControl __ASM("control"); + __regControl = control; + __ISB(); +} /** - \brief LDR Exclusive (32 bit) - \details Executes a exclusive LDR instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) + \brief Get IPSR Register + \details Returns the content of the IPSR Register. + \return IPSR Register value */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) - #define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr)) -#else - #define __LDREXW(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint32_t ) __ldrex(ptr)) _Pragma("pop") -#endif +__STATIC_INLINE uint32_t __get_IPSR(void) +{ + register uint32_t __regIPSR __ASM("ipsr"); + return(__regIPSR); +} /** - \brief STR Exclusive (8 bit) - \details Executes a exclusive STR instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Get APSR Register + \details Returns the content of the APSR Register. + \return APSR Register value */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) - #define __STREXB(value, ptr) __strex(value, ptr) -#else - #define __STREXB(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") -#endif +__STATIC_INLINE uint32_t __get_APSR(void) +{ + register uint32_t __regAPSR __ASM("apsr"); + return(__regAPSR); +} /** - \brief STR Exclusive (16 bit) - \details Executes a exclusive STR instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Get xPSR Register + \details Returns the content of the xPSR Register. + \return xPSR Register value */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) - #define __STREXH(value, ptr) __strex(value, ptr) -#else - #define __STREXH(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") -#endif +__STATIC_INLINE uint32_t __get_xPSR(void) +{ + register uint32_t __regXPSR __ASM("xpsr"); + return(__regXPSR); +} /** - \brief STR Exclusive (32 bit) - \details Executes a exclusive STR instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Get Process Stack Pointer + \details Returns the current value of the Process Stack Pointer (PSP). + \return PSP Register value */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) - #define __STREXW(value, ptr) __strex(value, ptr) -#else - #define __STREXW(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") -#endif +__STATIC_INLINE uint32_t __get_PSP(void) +{ + register uint32_t __regProcessStackPointer __ASM("psp"); + return(__regProcessStackPointer); +} /** - \brief Remove the exclusive lock - \details Removes the exclusive lock which is created by LDREX. + \brief Set Process Stack Pointer + \details Assigns the given value to the Process Stack Pointer (PSP). + \param [in] topOfProcStack Process Stack Pointer value to set */ -#define __CLREX __clrex +__STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) +{ + register uint32_t __regProcessStackPointer __ASM("psp"); + __regProcessStackPointer = topOfProcStack; +} /** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value + \brief Get Main Stack Pointer + \details Returns the current value of the Main Stack Pointer (MSP). + \return MSP Register value */ -#define __SSAT __ssat +__STATIC_INLINE uint32_t __get_MSP(void) +{ + register uint32_t __regMainStackPointer __ASM("msp"); + return(__regMainStackPointer); +} /** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value + \brief Set Main Stack Pointer + \details Assigns the given value to the Main Stack Pointer (MSP). + \param [in] topOfMainStack Main Stack Pointer value to set */ -#define __USAT __usat +__STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) +{ + register uint32_t __regMainStackPointer __ASM("msp"); + __regMainStackPointer = topOfMainStack; +} /** - \brief Rotate Right with Extend (32 bit) - \details Moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - \param [in] value Value to rotate - \return Rotated value + \brief Get Priority Mask + \details Returns the current state of the priority mask bit from the Priority Mask Register. + \return Priority Mask value */ -#ifndef __NO_EMBEDDED_ASM -__attribute__((section(".rrx_text"))) __STATIC_INLINE __ASM uint32_t __RRX(uint32_t value) +__STATIC_INLINE uint32_t __get_PRIMASK(void) { - rrx r0, r0 - bx lr + register uint32_t __regPriMask __ASM("primask"); + return(__regPriMask); } -#endif /** - \brief LDRT Unprivileged (8 bit) - \details Executes a Unprivileged LDRT instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) + \brief Set Priority Mask + \details Assigns the given value to the Priority Mask Register. + \param [in] priMask Priority Mask */ -#define __LDRBT(ptr) ((uint8_t ) __ldrt(ptr)) +__STATIC_INLINE void __set_PRIMASK(uint32_t priMask) +{ + register uint32_t __regPriMask __ASM("primask"); + __regPriMask = (priMask); +} +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) + /** - \brief LDRT Unprivileged (16 bit) - \details Executes a Unprivileged LDRT instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) + \brief Enable FIQ + \details Enables FIQ interrupts by clearing special-purpose register FAULTMASK. + Can only be executed in Privileged modes. */ -#define __LDRHT(ptr) ((uint16_t) __ldrt(ptr)) +#define __enable_fault_irq __enable_fiq /** - \brief LDRT Unprivileged (32 bit) - \details Executes a Unprivileged LDRT instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) + \brief Disable FIQ + \details Disables FIQ interrupts by setting special-purpose register FAULTMASK. + Can only be executed in Privileged modes. */ -#define __LDRT(ptr) ((uint32_t ) __ldrt(ptr)) +#define __disable_fault_irq __disable_fiq /** - \brief STRT Unprivileged (8 bit) - \details Executes a Unprivileged STRT instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Get Base Priority + \details Returns the current value of the Base Priority register. + \return Base Priority register value */ -#define __STRBT(value, ptr) __strt(value, ptr) +__STATIC_INLINE uint32_t __get_BASEPRI(void) +{ + register uint32_t __regBasePri __ASM("basepri"); + return(__regBasePri); +} /** - \brief STRT Unprivileged (16 bit) - \details Executes a Unprivileged STRT instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Set Base Priority + \details Assigns the given value to the Base Priority register. + \param [in] basePri Base Priority value to set */ -#define __STRHT(value, ptr) __strt(value, ptr) +__STATIC_INLINE void __set_BASEPRI(uint32_t basePri) +{ + register uint32_t __regBasePri __ASM("basepri"); + __regBasePri = (basePri & 0xFFU); +} /** - \brief STRT Unprivileged (32 bit) - \details Executes a Unprivileged STRT instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Set Base Priority with condition + \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, + or the new value increases the BASEPRI priority level. + \param [in] basePri Base Priority value to set */ -#define __STRT(value, ptr) __strt(value, ptr) +__STATIC_INLINE void __set_BASEPRI_MAX(uint32_t basePri) +{ + register uint32_t __regBasePriMax __ASM("basepri_max"); + __regBasePriMax = (basePri & 0xFFU); +} -#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ /** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value + \brief Get Fault Mask + \details Returns the current value of the Fault Mask register. + \return Fault Mask register value */ -__attribute__((always_inline)) __STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat) +__STATIC_INLINE uint32_t __get_FAULTMASK(void) { - if ((sat >= 1U) && (sat <= 32U)) - { - const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); - const int32_t min = -1 - max ; - if (val > max) - { - return max; - } - else if (val < min) - { - return min; - } - } - return val; + register uint32_t __regFaultMask __ASM("faultmask"); + return(__regFaultMask); } + /** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value + \brief Set Fault Mask + \details Assigns the given value to the Fault Mask register. + \param [in] faultMask Fault Mask value to set */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat) +__STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) { - if (sat <= 31U) - { - const uint32_t max = ((1U << sat) - 1U); - if (val > (int32_t)max) - { - return max; - } - else if (val < 0) - { - return 0U; - } - } - return (uint32_t)val; + register uint32_t __regFaultMask __ASM("faultmask"); + __regFaultMask = (faultMask & (uint32_t)1U); } #endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ + +/** + \brief Get FPSCR + \details Returns the current value of the Floating Point Status/Control register. + \return Floating Point Status/Control register value + */ +__STATIC_INLINE uint32_t __get_FPSCR(void) +{ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) + register uint32_t __regfpscr __ASM("fpscr"); + return(__regfpscr); +#else + return(0U); +#endif +} + + +/** + \brief Set FPSCR + \details Assigns the given value to the Floating Point Status/Control register. + \param [in] fpscr Floating Point Status/Control value to set + */ +__STATIC_INLINE void __set_FPSCR(uint32_t fpscr) +{ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) + register uint32_t __regfpscr __ASM("fpscr"); + __regfpscr = (fpscr); +#else + (void)fpscr; +#endif +} + + +/*@} end of CMSIS_Core_RegAccFunctions */ /* ################### Compiler specific Intrinsics ########################### */ diff --git a/edge-impulse-sdk/CMSIS/Core/Include/cmsis_armclang.h b/edge-impulse-sdk/CMSIS/Core/Include/cmsis_armclang.h index b14038c..b4a1200 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/cmsis_armclang.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/cmsis_armclang.h @@ -1,11 +1,11 @@ /**************************************************************************//** * @file cmsis_armclang.h * @brief CMSIS compiler armclang (Arm Compiler 6) header file - * @version V5.4.0 - * @date 19. February 2020 + * @version V5.4.4 + * @date 30. May 2022 ******************************************************************************/ /* - * Copyright (c) 2009-2021 Arm Limited. All rights reserved. + * Copyright (c) 2009-2022 Arm Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -29,10 +29,6 @@ #pragma clang system_header /* treat file as system include file */ -#ifndef __ARM_COMPAT_H -#include /* Compatibility header for Arm Compiler 5 intrinsics */ -#endif - /* CMSIS compiler specific defines */ #ifndef __ASM #define __ASM __asm @@ -156,456 +152,423 @@ __STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S (uint32_t* stackTop) { #endif -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions @{ - */ +*/ + +/* Define macros for porting to both thumb1 and thumb2. + * For thumb1, use low register (r0-r7), specified by constraint "l" + * Otherwise, use general registers, specified by constraint "r" */ +#if defined (__thumb__) && !defined (__thumb2__) +#define __CMSIS_GCC_OUT_REG(r) "=l" (r) +#define __CMSIS_GCC_RW_REG(r) "+l" (r) +#define __CMSIS_GCC_USE_REG(r) "l" (r) +#else +#define __CMSIS_GCC_OUT_REG(r) "=r" (r) +#define __CMSIS_GCC_RW_REG(r) "+r" (r) +#define __CMSIS_GCC_USE_REG(r) "r" (r) +#endif /** - \brief Enable IRQ Interrupts - \details Enables IRQ interrupts by clearing the I-bit in the CPSR. - Can only be executed in Privileged modes. + \brief No Operation + \details No Operation does nothing. This instruction can be used for code alignment purposes. */ -/* intrinsic void __enable_irq(); see arm_compat.h */ - +#define __NOP __builtin_arm_nop /** - \brief Disable IRQ Interrupts - \details Disables IRQ interrupts by setting the I-bit in the CPSR. - Can only be executed in Privileged modes. + \brief Wait For Interrupt + \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. */ -/* intrinsic void __disable_irq(); see arm_compat.h */ +#define __WFI __builtin_arm_wfi /** - \brief Get Control Register - \details Returns the content of the Control Register. - \return Control Register value + \brief Wait For Event + \details Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. */ -__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} +#define __WFE __builtin_arm_wfe -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Control Register (non-secure) - \details Returns the content of the non-secure Control Register when in secure mode. - \return non-secure Control Register value + \brief Send Event + \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. */ -__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) -{ - uint32_t result; +#define __SEV __builtin_arm_sev - __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); - return(result); -} -#endif +/** + \brief Instruction Synchronization Barrier + \details Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or memory, + after the instruction has been completed. + */ +#define __ISB() __builtin_arm_isb(0xF) /** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set + \brief Data Synchronization Barrier + \details Acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. */ -__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); -} +#define __DSB() __builtin_arm_dsb(0xF) -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Control Register (non-secure) - \details Writes the given value to the non-secure Control Register when in secure state. - \param [in] control Control Register value to set + \brief Data Memory Barrier + \details Ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. */ -__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) -{ - __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); -} -#endif +#define __DMB() __builtin_arm_dmb(0xF) /** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value + \brief Reverse byte order (32 bit) + \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. + \param [in] value Value to reverse + \return Reversed value */ -__STATIC_FORCEINLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); - return(result); -} +#define __REV(value) __builtin_bswap32(value) /** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value + \brief Reverse byte order (16 bit) + \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. + \param [in] value Value to reverse + \return Reversed value */ -__STATIC_FORCEINLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, apsr" : "=r" (result) ); - return(result); -} +#define __REV16(value) __ROR(__REV(value), 16) /** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value + \brief Reverse byte order (16 bit) + \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. + \param [in] value Value to reverse + \return Reversed value */ -__STATIC_FORCEINLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); - return(result); -} +#define __REVSH(value) (int16_t)__builtin_bswap16(value) /** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value + \brief Rotate Right in unsigned value (32 bit) + \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + \param [in] op1 Value to rotate + \param [in] op2 Number of Bits to rotate + \return Rotated value */ -__STATIC_FORCEINLINE uint32_t __get_PSP(void) +__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) { - uint32_t result; - - __ASM volatile ("MRS %0, psp" : "=r" (result) ); - return(result); + op2 %= 32U; + if (op2 == 0U) + { + return op1; + } + return (op1 >> op2) | (op1 << (32U - op2)); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Process Stack Pointer (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. - \return PSP Register value + \brief Breakpoint + \details Causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); - return(result); -} -#endif +#define __BKPT(value) __ASM volatile ("bkpt "#value) /** - \brief Set Process Stack Pointer - \details Assigns the given value to the Process Stack Pointer (PSP). - \param [in] topOfProcStack Process Stack Pointer value to set + \brief Reverse bit order of value + \details Reverses the bit order of the given value. + \param [in] value Value to reverse + \return Reversed value */ -__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); -} - +#define __RBIT __builtin_arm_rbit -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Process Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. - \param [in] topOfProcStack Process Stack Pointer value to set + \brief Count leading zeros + \details Counts the number of leading zeros of a data value. + \param [in] value Value to count the leading zeros + \return number of leading zeros in value */ -__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) +__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) { - __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); + /* Even though __builtin_clz produces a CLZ instruction on ARM, formally + __builtin_clz(0) is undefined behaviour, so handle this case specially. + This guarantees ARM-compatible results if happening to compile on a non-ARM + target, and ensures the compiler doesn't decide to activate any + optimisations using the logic "value was passed to __builtin_clz, so it + is non-zero". + ARM Compiler 6.10 and possibly earlier will optimise this test away, leaving a + single CLZ instruction. + */ + if (value == 0U) + { + return 32U; + } + return __builtin_clz(value); } -#endif +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ + (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) + /** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value + \brief LDR Exclusive (8 bit) + \details Executes a exclusive LDR instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __get_MSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp" : "=r" (result) ); - return(result); -} +#define __LDREXB (uint8_t)__builtin_arm_ldrex -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Main Stack Pointer (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. - \return MSP Register value + \brief LDR Exclusive (16 bit) + \details Executes a exclusive LDR instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); - return(result); -} -#endif +#define __LDREXH (uint16_t)__builtin_arm_ldrex /** - \brief Set Main Stack Pointer - \details Assigns the given value to the Main Stack Pointer (MSP). - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); -} -#endif - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Stack Pointer (non-secure) - \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. - \return SP Register value + \brief LDR Exclusive (32 bit) + \details Executes a exclusive LDR instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); - return(result); -} +#define __LDREXW (uint32_t)__builtin_arm_ldrex /** - \brief Set Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. - \param [in] topOfStack Stack Pointer value to set + \brief STR Exclusive (8 bit) + \details Executes a exclusive STR instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed */ -__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) -{ - __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); -} -#endif +#define __STREXB (uint32_t)__builtin_arm_strex /** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value + \brief STR Exclusive (16 bit) + \details Executes a exclusive STR instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed */ -__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); -} +#define __STREXH (uint32_t)__builtin_arm_strex -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Priority Mask (non-secure) - \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. - \return Priority Mask value + \brief STR Exclusive (32 bit) + \details Executes a exclusive STR instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); - return(result); -} -#endif +#define __STREXW (uint32_t)__builtin_arm_strex /** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask + \brief Remove the exclusive lock + \details Removes the exclusive lock which is created by LDREX. */ -__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); -} - +#define __CLREX __builtin_arm_clrex -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Priority Mask (non-secure) - \details Assigns the given value to the non-secure Priority Mask Register when in secure state. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); -} -#endif +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ + (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ #if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) + /** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing the F-bit in the CPSR. - Can only be executed in Privileged modes. + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value */ -#define __enable_fault_irq __enable_fiq /* see arm_compat.h */ +#define __SSAT __builtin_arm_ssat /** - \brief Disable FIQ - \details Disables FIQ interrupts by setting the F-bit in the CPSR. - Can only be executed in Privileged modes. + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value */ -#define __disable_fault_irq __disable_fiq /* see arm_compat.h */ +#define __USAT __builtin_arm_usat /** - \brief Get Base Priority - \details Returns the current value of the Base Priority register. - \return Base Priority register value + \brief Rotate Right with Extend (32 bit) + \details Moves each bit of a bitstring right by one bit. + The carry input is shifted in at the left end of the bitstring. + \param [in] value Value to rotate + \return Rotated value */ -__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) +__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) { uint32_t result; - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); + __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); return(result); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Base Priority (non-secure) - \details Returns the current value of the non-secure Base Priority register when in secure state. - \return Base Priority register value + \brief LDRT Unprivileged (8 bit) + \details Executes a Unprivileged LDRT instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) +__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) { uint32_t result; - __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); + __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint8_t) result); /* Add explicit type cast here */ } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Base Priority (non-secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state. - \param [in] basePri Base Priority value to set + \brief LDRT Unprivileged (16 bit) + \details Executes a Unprivileged LDRT instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) */ -__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) +__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) { - __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); -} -#endif - + uint32_t result; -/** - \brief Set Base Priority with condition - \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); + __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint16_t) result); /* Add explicit type cast here */ } /** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value + \brief LDRT Unprivileged (32 bit) + \details Executes a Unprivileged LDRT instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) +__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) { uint32_t result; - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); + __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); return(result); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Fault Mask (non-secure) - \details Returns the current value of the non-secure Fault Mask register when in secure state. - \return Fault Mask register value + \brief STRT Unprivileged (8 bit) + \details Executes a Unprivileged STRT instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) +__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) { - uint32_t result; - - __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); - return(result); + __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); } -#endif /** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set + \brief STRT Unprivileged (16 bit) + \details Executes a Unprivileged STRT instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) +__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) { - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); + __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Fault Mask (non-secure) - \details Assigns the given value to the non-secure Fault Mask register when in secure state. - \param [in] faultMask Fault Mask value to set + \brief STRT Unprivileged (32 bit) + \details Executes a Unprivileged STRT instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) +__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) { - __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); + __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); } -#endif -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ +#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) +{ + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; +} + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) +{ + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ #if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ @@ -613,631 +576,615 @@ __STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) /** - \brief Get Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value + \brief Load-Acquire (8 bit) + \details Executes a LDAB instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) +__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) { -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else uint32_t result; - __ASM volatile ("MRS %0, psplim" : "=r" (result) ); - return result; -#endif + + __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return ((uint8_t) result); } -#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value +/** + \brief Load-Acquire (16 bit) + \details Executes a LDAH instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) +__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) { -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else uint32_t result; - __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); - return result; -#endif + + __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return ((uint16_t) result); } -#endif /** - \brief Set Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + \brief Load-Acquire (32 bit) + \details Executes a LDA instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) */ -__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) +__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) { -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); -#endif + uint32_t result; + + __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return(result); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Process Stack Pointer (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + \brief Store-Release (8 bit) + \details Executes a STLB instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) +__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) { -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); -#endif + __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); } -#endif /** - \brief Get Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value + \brief Store-Release (16 bit) + \details Executes a STLH instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) +__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) { -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim" : "=r" (result) ); - return result; -#endif + __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value + \brief Store-Release (32 bit) + \details Executes a STL instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) +__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) { -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); - return result; -#endif + __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); } -#endif /** - \brief Set Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. + \brief Load-Acquire Exclusive (8 bit) + \details Executes a LDAB exclusive instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#define __LDAEXB (uint8_t)__builtin_arm_ldaex - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set + +/** + \brief Load-Acquire Exclusive (16 bit) + \details Executes a LDAH exclusive instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) */ -__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); -#endif -} +#define __LDAEXH (uint16_t)__builtin_arm_ldaex -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. + \brief Load-Acquire Exclusive (32 bit) + \details Executes a LDA exclusive instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDAEX (uint32_t)__builtin_arm_ldaex - \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. - \param [in] MainStackPtrLimit Main Stack Pointer value to set + +/** + \brief Store-Release Exclusive (8 bit) + \details Executes a STLB exclusive instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed */ -__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ -#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); -#endif -} -#endif +#define __STLEXB (uint32_t)__builtin_arm_stlex -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ /** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value + \brief Store-Release Exclusive (16 bit) + \details Executes a STLH exclusive instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed */ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr -#else -#define __get_FPSCR() ((uint32_t)0U) -#endif +#define __STLEXH (uint32_t)__builtin_arm_stlex + /** - \brief Set FPSCR - \details Assigns the given value to the Floating Point Status/Control register. - \param [in] fpscr Floating Point Status/Control value to set + \brief Store-Release Exclusive (32 bit) + \details Executes a STL exclusive instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed */ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#define __set_FPSCR __builtin_arm_set_fpscr -#else -#define __set_FPSCR(x) ((void)(x)) -#endif +#define __STLEX (uint32_t)__builtin_arm_stlex +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ + (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ -/*@} end of CMSIS_Core_RegAccFunctions */ +/** @}*/ /* end of group CMSIS_Core_InstructionInterface */ -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions @{ -*/ + */ -/* Define macros for porting to both thumb1 and thumb2. - * For thumb1, use low register (r0-r7), specified by constraint "l" - * Otherwise, use general registers, specified by constraint "r" */ -#if defined (__thumb__) && !defined (__thumb2__) -#define __CMSIS_GCC_OUT_REG(r) "=l" (r) -#define __CMSIS_GCC_RW_REG(r) "+l" (r) -#define __CMSIS_GCC_USE_REG(r) "l" (r) -#else -#define __CMSIS_GCC_OUT_REG(r) "=r" (r) -#define __CMSIS_GCC_RW_REG(r) "+r" (r) -#define __CMSIS_GCC_USE_REG(r) "r" (r) +/** + \brief Enable IRQ Interrupts + \details Enables IRQ interrupts by clearing special-purpose register PRIMASK. + Can only be executed in Privileged modes. + */ +#ifndef __ARM_COMPAT_H +__STATIC_FORCEINLINE void __enable_irq(void) +{ + __ASM volatile ("cpsie i" : : : "memory"); +} +#endif + + +/** + \brief Disable IRQ Interrupts + \details Disables IRQ interrupts by setting special-purpose register PRIMASK. + Can only be executed in Privileged modes. + */ +#ifndef __ARM_COMPAT_H +__STATIC_FORCEINLINE void __disable_irq(void) +{ + __ASM volatile ("cpsid i" : : : "memory"); +} #endif + /** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. + \brief Get Control Register + \details Returns the content of the Control Register. + \return Control Register value */ -#define __NOP __builtin_arm_nop +__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control" : "=r" (result) ); + return(result); +} + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. + \brief Get Control Register (non-secure) + \details Returns the content of the non-secure Control Register when in secure mode. + \return non-secure Control Register value */ -#define __WFI __builtin_arm_wfi +__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); + return(result); +} +#endif /** - \brief Wait For Event - \details Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. + \brief Set Control Register + \details Writes the given value to the Control Register. + \param [in] control Control Register value to set */ -#define __WFE __builtin_arm_wfe +__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) +{ + __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); + __ISB(); +} +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. + \brief Set Control Register (non-secure) + \details Writes the given value to the non-secure Control Register when in secure state. + \param [in] control Control Register value to set */ -#define __SEV __builtin_arm_sev +__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) +{ + __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); + __ISB(); +} +#endif /** - \brief Instruction Synchronization Barrier - \details Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or memory, - after the instruction has been completed. + \brief Get IPSR Register + \details Returns the content of the IPSR Register. + \return IPSR Register value */ -#define __ISB() __builtin_arm_isb(0xF) +__STATIC_FORCEINLINE uint32_t __get_IPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); + return(result); +} + /** - \brief Data Synchronization Barrier - \details Acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. + \brief Get APSR Register + \details Returns the content of the APSR Register. + \return APSR Register value */ -#define __DSB() __builtin_arm_dsb(0xF) +__STATIC_FORCEINLINE uint32_t __get_APSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, apsr" : "=r" (result) ); + return(result); +} /** - \brief Data Memory Barrier - \details Ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. + \brief Get xPSR Register + \details Returns the content of the xPSR Register. + \return xPSR Register value */ -#define __DMB() __builtin_arm_dmb(0xF) +__STATIC_FORCEINLINE uint32_t __get_xPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); + return(result); +} /** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. - \param [in] value Value to reverse - \return Reversed value + \brief Get Process Stack Pointer + \details Returns the current value of the Process Stack Pointer (PSP). + \return PSP Register value */ -#define __REV(value) __builtin_bswap32(value) +__STATIC_FORCEINLINE uint32_t __get_PSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp" : "=r" (result) ); + return(result); +} +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Reverse byte order (16 bit) - \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. - \param [in] value Value to reverse - \return Reversed value + \brief Get Process Stack Pointer (non-secure) + \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. + \return PSP Register value */ -#define __REV16(value) __ROR(__REV(value), 16) +__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); + return(result); +} +#endif /** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. - \param [in] value Value to reverse - \return Reversed value + \brief Set Process Stack Pointer + \details Assigns the given value to the Process Stack Pointer (PSP). + \param [in] topOfProcStack Process Stack Pointer value to set */ -#define __REVSH(value) (int16_t)__builtin_bswap16(value) +__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); +} +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Rotate Right in unsigned value (32 bit) - \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - \param [in] op1 Value to rotate - \param [in] op2 Number of Bits to rotate - \return Rotated value + \brief Set Process Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. + \param [in] topOfProcStack Process Stack Pointer value to set */ -__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) +__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) { - op2 %= 32U; - if (op2 == 0U) - { - return op1; - } - return (op1 >> op2) | (op1 << (32U - op2)); + __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); } +#endif /** - \brief Breakpoint - \details Causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. + \brief Get Main Stack Pointer + \details Returns the current value of the Main Stack Pointer (MSP). + \return MSP Register value */ -#define __BKPT(value) __ASM volatile ("bkpt "#value) +__STATIC_FORCEINLINE uint32_t __get_MSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp" : "=r" (result) ); + return(result); +} +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Reverse bit order of value - \details Reverses the bit order of the given value. - \param [in] value Value to reverse - \return Reversed value + \brief Get Main Stack Pointer (non-secure) + \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. + \return MSP Register value */ -#define __RBIT __builtin_arm_rbit +__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); + return(result); +} +#endif + /** - \brief Count leading zeros - \details Counts the number of leading zeros of a data value. - \param [in] value Value to count the leading zeros - \return number of leading zeros in value + \brief Set Main Stack Pointer + \details Assigns the given value to the Main Stack Pointer (MSP). + \param [in] topOfMainStack Main Stack Pointer value to set */ -__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) +__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) { - /* Even though __builtin_clz produces a CLZ instruction on ARM, formally - __builtin_clz(0) is undefined behaviour, so handle this case specially. - This guarantees ARM-compatible results if happening to compile on a non-ARM - target, and ensures the compiler doesn't decide to activate any - optimisations using the logic "value was passed to __builtin_clz, so it - is non-zero". - ARM Compiler 6.10 and possibly earlier will optimise this test away, leaving a - single CLZ instruction. - */ - if (value == 0U) - { - return 32U; - } - return __builtin_clz(value); + __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); } -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) - +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief LDR Exclusive (8 bit) - \details Executes a exclusive LDR instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) + \brief Set Main Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. + \param [in] topOfMainStack Main Stack Pointer value to set */ -#define __LDREXB (uint8_t)__builtin_arm_ldrex +__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); +} +#endif +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief LDR Exclusive (16 bit) - \details Executes a exclusive LDR instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) + \brief Get Stack Pointer (non-secure) + \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. + \return SP Register value */ -#define __LDREXH (uint16_t)__builtin_arm_ldrex +__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); + return(result); +} /** - \brief LDR Exclusive (32 bit) - \details Executes a exclusive LDR instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) + \brief Set Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. + \param [in] topOfStack Stack Pointer value to set */ -#define __LDREXW (uint32_t)__builtin_arm_ldrex +__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) +{ + __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); +} +#endif /** - \brief STR Exclusive (8 bit) - \details Executes a exclusive STR instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Get Priority Mask + \details Returns the current state of the priority mask bit from the Priority Mask Register. + \return Priority Mask value */ -#define __STREXB (uint32_t)__builtin_arm_strex +__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask" : "=r" (result) ); + return(result); +} +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief STR Exclusive (16 bit) - \details Executes a exclusive STR instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Get Priority Mask (non-secure) + \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. + \return Priority Mask value */ -#define __STREXH (uint32_t)__builtin_arm_strex +__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); + return(result); +} +#endif /** - \brief STR Exclusive (32 bit) - \details Executes a exclusive STR instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Set Priority Mask + \details Assigns the given value to the Priority Mask Register. + \param [in] priMask Priority Mask */ -#define __STREXW (uint32_t)__builtin_arm_strex +__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) +{ + __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); +} +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Remove the exclusive lock - \details Removes the exclusive lock which is created by LDREX. + \brief Set Priority Mask (non-secure) + \details Assigns the given value to the non-secure Priority Mask Register when in secure state. + \param [in] priMask Priority Mask */ -#define __CLREX __builtin_arm_clrex - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ +__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) +{ + __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); +} +#endif #if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) - /** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value + \brief Enable FIQ + \details Enables FIQ interrupts by clearing special-purpose register FAULTMASK. + Can only be executed in Privileged modes. */ -#define __SSAT __builtin_arm_ssat +__STATIC_FORCEINLINE void __enable_fault_irq(void) +{ + __ASM volatile ("cpsie f" : : : "memory"); +} /** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value + \brief Disable FIQ + \details Disables FIQ interrupts by setting special-purpose register FAULTMASK. + Can only be executed in Privileged modes. */ -#define __USAT __builtin_arm_usat +__STATIC_FORCEINLINE void __disable_fault_irq(void) +{ + __ASM volatile ("cpsid f" : : : "memory"); +} /** - \brief Rotate Right with Extend (32 bit) - \details Moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - \param [in] value Value to rotate - \return Rotated value + \brief Get Base Priority + \details Returns the current value of the Base Priority register. + \return Base Priority register value */ -__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) +__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) { uint32_t result; - __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + __ASM volatile ("MRS %0, basepri" : "=r" (result) ); return(result); } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief LDRT Unprivileged (8 bit) - \details Executes a Unprivileged LDRT instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) + \brief Get Base Priority (non-secure) + \details Returns the current value of the non-secure Base Priority register when in secure state. + \return Base Priority register value */ -__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) +__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) { uint32_t result; - __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint8_t) result); /* Add explicit type cast here */ + __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); + return(result); } +#endif /** - \brief LDRT Unprivileged (16 bit) - \details Executes a Unprivileged LDRT instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) + \brief Set Base Priority + \details Assigns the given value to the Base Priority register. + \param [in] basePri Base Priority value to set */ -__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) +__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) { - uint32_t result; - - __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint16_t) result); /* Add explicit type cast here */ + __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief LDRT Unprivileged (32 bit) - \details Executes a Unprivileged LDRT instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) + \brief Set Base Priority (non-secure) + \details Assigns the given value to the non-secure Base Priority register when in secure state. + \param [in] basePri Base Priority value to set */ -__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) +__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) { - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return(result); + __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); } +#endif /** - \brief STRT Unprivileged (8 bit) - \details Executes a Unprivileged STRT instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Set Base Priority with condition + \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, + or the new value increases the BASEPRI priority level. + \param [in] basePri Base Priority value to set */ -__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) +__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) { - __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); + __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); } /** - \brief STRT Unprivileged (16 bit) - \details Executes a Unprivileged STRT instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Get Fault Mask + \details Returns the current value of the Fault Mask register. + \return Fault Mask register value */ -__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) +__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) { - __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); + uint32_t result; + + __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); + return(result); } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief STRT Unprivileged (32 bit) - \details Executes a Unprivileged STRT instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Get Fault Mask (non-secure) + \details Returns the current value of the non-secure Fault Mask register when in secure state. + \return Fault Mask register value */ -__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) +__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) { - __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); + uint32_t result; + + __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); + return(result); } +#endif -#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ /** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value + \brief Set Fault Mask + \details Assigns the given value to the Fault Mask register. + \param [in] faultMask Fault Mask value to set */ -__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) +__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) { - if ((sat >= 1U) && (sat <= 32U)) - { - const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); - const int32_t min = -1 - max ; - if (val > max) - { - return max; - } - else if (val < min) - { - return min; - } - } - return val; + __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); } -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) -{ - if (sat <= 31U) - { - const uint32_t max = ((1U << sat) - 1U); - if (val > (int32_t)max) - { - return max; - } - else if (val < 0) - { - return 0U; - } - } - return (uint32_t)val; + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Fault Mask (non-secure) + \details Assigns the given value to the non-secure Fault Mask register when in secure state. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); } +#endif #endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ @@ -1250,150 +1197,217 @@ __STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) /** - \brief Load-Acquire (8 bit) - \details Executes a LDAB instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) + \brief Get Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). + \return PSPLIM Register value */ -__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) +__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) { +#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else uint32_t result; - - __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint8_t) result); + __ASM volatile ("MRS %0, psplim" : "=r" (result) ); + return result; +#endif } - +#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Load-Acquire (16 bit) - \details Executes a LDAH instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) + \brief Get Process Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \return PSPLIM Register value */ -__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) +__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) { +#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else uint32_t result; - - __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint16_t) result); + __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); + return result; +#endif } +#endif /** - \brief Load-Acquire (32 bit) - \details Executes a LDA instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) + \brief Set Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set */ -__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) +__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) { - uint32_t result; - - __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return(result); +#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); +#endif } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Store-Release (8 bit) - \details Executes a STLB instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Set Process Stack Pointer (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set */ -__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) +__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) { - __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); +#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); +#endif } +#endif /** - \brief Store-Release (16 bit) - \details Executes a STLH instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Get Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). + \return MSPLIM Register value */ -__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) +__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) { - __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); +#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim" : "=r" (result) ); + return result; +#endif } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Store-Release (32 bit) - \details Executes a STL instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Get Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. + \return MSPLIM Register value */ -__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) +__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) { - __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); +#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); + return result; +#endif } +#endif /** - \brief Load-Acquire Exclusive (8 bit) - \details Executes a LDAB exclusive instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDAEXB (uint8_t)__builtin_arm_ldaex - + \brief Set Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. -/** - \brief Load-Acquire Exclusive (16 bit) - \details Executes a LDAH exclusive instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) + \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). + \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set */ -#define __LDAEXH (uint16_t)__builtin_arm_ldaex +__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) +{ +#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); +#endif +} +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Load-Acquire Exclusive (32 bit) - \details Executes a LDA exclusive instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDAEX (uint32_t)__builtin_arm_ldaex - + \brief Set Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. -/** - \brief Store-Release Exclusive (8 bit) - \details Executes a STLB exclusive instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. + \param [in] MainStackPtrLimit Main Stack Pointer value to set */ -#define __STLEXB (uint32_t)__builtin_arm_stlex +__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) +{ +#if (!((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) ) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); +#endif +} +#endif +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ + (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ /** - \brief Store-Release Exclusive (16 bit) - \details Executes a STLH exclusive instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Get FPSCR + \details Returns the current value of the Floating Point Status/Control register. + \return Floating Point Status/Control register value */ -#define __STLEXH (uint32_t)__builtin_arm_stlex - +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr +#else +#define __get_FPSCR() ((uint32_t)0U) +#endif /** - \brief Store-Release Exclusive (32 bit) - \details Executes a STL exclusive instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Set FPSCR + \details Assigns the given value to the Floating Point Status/Control register. + \param [in] fpscr Floating Point Status/Control value to set */ -#define __STLEX (uint32_t)__builtin_arm_stlex +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#define __set_FPSCR __builtin_arm_set_fpscr +#else +#define __set_FPSCR(fpscr) ((void)(fpscr)) +#endif -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) || \ - (defined (__ARM_ARCH_8_1M_MAIN__) && (__ARM_ARCH_8_1M_MAIN__ == 1)) ) */ -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ +/** @} end of CMSIS_Core_RegAccFunctions */ /* ################### Compiler specific Intrinsics ########################### */ @@ -1483,7 +1497,7 @@ __STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) } #endif /* (__ARM_FEATURE_DSP == 1) */ -/*@} end of group CMSIS_SIMD_intrinsics */ +/** @} end of group CMSIS_SIMD_intrinsics */ #endif /* __CMSIS_ARMCLANG_H */ diff --git a/edge-impulse-sdk/CMSIS/Core/Include/cmsis_armclang_ltm.h b/edge-impulse-sdk/CMSIS/Core/Include/cmsis_armclang_ltm.h index 3972d01..1e255d5 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/cmsis_armclang_ltm.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/cmsis_armclang_ltm.h @@ -1,8 +1,8 @@ /**************************************************************************//** * @file cmsis_armclang_ltm.h * @brief CMSIS compiler armclang (Arm Compiler 6) header file - * @version V1.5.0 - * @date 19. February 2021 + * @version V1.5.3 + * @date 27. May 2021 ******************************************************************************/ /* * Copyright (c) 2018-2021 Arm Limited. All rights reserved. @@ -29,10 +29,6 @@ #pragma clang system_header /* treat file as system include file */ -#ifndef __ARM_COMPAT_H -#include /* Compatibility header for Arm Compiler 5 intrinsics */ -#endif - /* CMSIS compiler specific defines */ #ifndef __ASM #define __ASM __asm @@ -156,1069 +152,1027 @@ __STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S (uint32_t* stackTop) { #endif -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions @{ - */ +*/ + +/* Define macros for porting to both thumb1 and thumb2. + * For thumb1, use low register (r0-r7), specified by constraint "l" + * Otherwise, use general registers, specified by constraint "r" */ +#if defined (__thumb__) && !defined (__thumb2__) +#define __CMSIS_GCC_OUT_REG(r) "=l" (r) +#define __CMSIS_GCC_USE_REG(r) "l" (r) +#else +#define __CMSIS_GCC_OUT_REG(r) "=r" (r) +#define __CMSIS_GCC_USE_REG(r) "r" (r) +#endif /** - \brief Enable IRQ Interrupts - \details Enables IRQ interrupts by clearing the I-bit in the CPSR. - Can only be executed in Privileged modes. + \brief No Operation + \details No Operation does nothing. This instruction can be used for code alignment purposes. */ -/* intrinsic void __enable_irq(); see arm_compat.h */ - +#define __NOP __builtin_arm_nop /** - \brief Disable IRQ Interrupts - \details Disables IRQ interrupts by setting the I-bit in the CPSR. - Can only be executed in Privileged modes. + \brief Wait For Interrupt + \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. */ -/* intrinsic void __disable_irq(); see arm_compat.h */ +#define __WFI __builtin_arm_wfi /** - \brief Get Control Register - \details Returns the content of the Control Register. - \return Control Register value + \brief Wait For Event + \details Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. */ -__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} +#define __WFE __builtin_arm_wfe -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Control Register (non-secure) - \details Returns the content of the non-secure Control Register when in secure mode. - \return non-secure Control Register value + \brief Send Event + \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. */ -__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) -{ - uint32_t result; +#define __SEV __builtin_arm_sev - __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); - return(result); -} -#endif +/** + \brief Instruction Synchronization Barrier + \details Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or memory, + after the instruction has been completed. + */ +#define __ISB() __builtin_arm_isb(0xF) /** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set + \brief Data Synchronization Barrier + \details Acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. */ -__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); -} +#define __DSB() __builtin_arm_dsb(0xF) -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Control Register (non-secure) - \details Writes the given value to the non-secure Control Register when in secure state. - \param [in] control Control Register value to set + \brief Data Memory Barrier + \details Ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. */ -__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) -{ - __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); -} -#endif +#define __DMB() __builtin_arm_dmb(0xF) /** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value + \brief Reverse byte order (32 bit) + \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. + \param [in] value Value to reverse + \return Reversed value */ -__STATIC_FORCEINLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); - return(result); -} +#define __REV(value) __builtin_bswap32(value) /** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value + \brief Reverse byte order (16 bit) + \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. + \param [in] value Value to reverse + \return Reversed value */ -__STATIC_FORCEINLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, apsr" : "=r" (result) ); - return(result); -} +#define __REV16(value) __ROR(__REV(value), 16) /** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value + \brief Reverse byte order (16 bit) + \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. + \param [in] value Value to reverse + \return Reversed value */ -__STATIC_FORCEINLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); - return(result); -} +#define __REVSH(value) (int16_t)__builtin_bswap16(value) /** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value + \brief Rotate Right in unsigned value (32 bit) + \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + \param [in] op1 Value to rotate + \param [in] op2 Number of Bits to rotate + \return Rotated value */ -__STATIC_FORCEINLINE uint32_t __get_PSP(void) +__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) { - uint32_t result; - - __ASM volatile ("MRS %0, psp" : "=r" (result) ); - return(result); + op2 %= 32U; + if (op2 == 0U) + { + return op1; + } + return (op1 >> op2) | (op1 << (32U - op2)); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Process Stack Pointer (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. - \return PSP Register value + \brief Breakpoint + \details Causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) -{ - uint32_t result; +#define __BKPT(value) __ASM volatile ("bkpt "#value) - __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); - return(result); -} -#endif +/** + \brief Reverse bit order of value + \details Reverses the bit order of the given value. + \param [in] value Value to reverse + \return Reversed value + */ +#define __RBIT __builtin_arm_rbit /** - \brief Set Process Stack Pointer - \details Assigns the given value to the Process Stack Pointer (PSP). - \param [in] topOfProcStack Process Stack Pointer value to set + \brief Count leading zeros + \details Counts the number of leading zeros of a data value. + \param [in] value Value to count the leading zeros + \return number of leading zeros in value */ -__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) +__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) { - __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); + /* Even though __builtin_clz produces a CLZ instruction on ARM, formally + __builtin_clz(0) is undefined behaviour, so handle this case specially. + This guarantees ARM-compatible results if happening to compile on a non-ARM + target, and ensures the compiler doesn't decide to activate any + optimisations using the logic "value was passed to __builtin_clz, so it + is non-zero". + ARM Compiler 6.10 and possibly earlier will optimise this test away, leaving a + single CLZ instruction. + */ + if (value == 0U) + { + return 32U; + } + return __builtin_clz(value); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) /** - \brief Set Process Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. - \param [in] topOfProcStack Process Stack Pointer value to set + \brief LDR Exclusive (8 bit) + \details Executes a exclusive LDR instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) */ -__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); -} -#endif +#define __LDREXB (uint8_t)__builtin_arm_ldrex /** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value + \brief LDR Exclusive (16 bit) + \details Executes a exclusive LDR instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __get_MSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp" : "=r" (result) ); - return(result); -} +#define __LDREXH (uint16_t)__builtin_arm_ldrex -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Main Stack Pointer (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. - \return MSP Register value + \brief LDR Exclusive (32 bit) + \details Executes a exclusive LDR instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); - return(result); -} -#endif +#define __LDREXW (uint32_t)__builtin_arm_ldrex /** - \brief Set Main Stack Pointer - \details Assigns the given value to the Main Stack Pointer (MSP). - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); -} - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Main Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); -} -#endif - - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Stack Pointer (non-secure) - \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. - \return SP Register value - */ -__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. - \param [in] topOfStack Stack Pointer value to set + \brief STR Exclusive (8 bit) + \details Executes a exclusive STR instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed */ -__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) -{ - __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); -} -#endif +#define __STREXB (uint32_t)__builtin_arm_strex /** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value + \brief STR Exclusive (16 bit) + \details Executes a exclusive STR instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed */ -__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); -} +#define __STREXH (uint32_t)__builtin_arm_strex -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Priority Mask (non-secure) - \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. - \return Priority Mask value + \brief STR Exclusive (32 bit) + \details Executes a exclusive STR instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); - return(result); -} -#endif +#define __STREXW (uint32_t)__builtin_arm_strex /** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask + \brief Remove the exclusive lock + \details Removes the exclusive lock which is created by LDREX. */ -__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); -} - +#define __CLREX __builtin_arm_clrex -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Set Priority Mask (non-secure) - \details Assigns the given value to the non-secure Priority Mask Register when in secure state. - \param [in] priMask Priority Mask - */ -__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); -} -#endif +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ #if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) + /** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing the F-bit in the CPSR. - Can only be executed in Privileged modes. + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value */ -#define __enable_fault_irq __enable_fiq /* see arm_compat.h */ +#define __SSAT __builtin_arm_ssat /** - \brief Disable FIQ - \details Disables FIQ interrupts by setting the F-bit in the CPSR. - Can only be executed in Privileged modes. + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value */ -#define __disable_fault_irq __disable_fiq /* see arm_compat.h */ +#define __USAT __builtin_arm_usat /** - \brief Get Base Priority - \details Returns the current value of the Base Priority register. - \return Base Priority register value + \brief Rotate Right with Extend (32 bit) + \details Moves each bit of a bitstring right by one bit. + The carry input is shifted in at the left end of the bitstring. + \param [in] value Value to rotate + \return Rotated value */ -__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) +__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) { uint32_t result; - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); + __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); return(result); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Base Priority (non-secure) - \details Returns the current value of the non-secure Base Priority register when in secure state. - \return Base Priority register value + \brief LDRT Unprivileged (8 bit) + \details Executes a Unprivileged LDRT instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) +__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) { uint32_t result; - __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); + __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint8_t) result); /* Add explicit type cast here */ } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Base Priority (non-secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state. - \param [in] basePri Base Priority value to set + \brief LDRT Unprivileged (16 bit) + \details Executes a Unprivileged LDRT instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) */ -__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) +__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) { - __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); -} -#endif - + uint32_t result; -/** - \brief Set Base Priority with condition - \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) -{ - __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); + __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint16_t) result); /* Add explicit type cast here */ } /** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value + \brief LDRT Unprivileged (32 bit) + \details Executes a Unprivileged LDRT instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) +__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) { uint32_t result; - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); + __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); return(result); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Fault Mask (non-secure) - \details Returns the current value of the non-secure Fault Mask register when in secure state. - \return Fault Mask register value + \brief STRT Unprivileged (8 bit) + \details Executes a Unprivileged STRT instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) +__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) { - uint32_t result; - - __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); - return(result); + __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); } -#endif /** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set + \brief STRT Unprivileged (16 bit) + \details Executes a Unprivileged STRT instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) +__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) { - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); + __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Fault Mask (non-secure) - \details Assigns the given value to the non-secure Fault Mask register when in secure state. - \param [in] faultMask Fault Mask value to set + \brief STRT Unprivileged (32 bit) + \details Executes a Unprivileged STRT instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) +__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) { - __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); + __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); } -#endif -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ +#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) - /** - \brief Get Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value */ -__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) +__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) { -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim" : "=r" (result) ); - return result; -#endif + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; } -#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Process Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) +__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) { -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); - return result; -#endif + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; } -#endif +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ -/** - \brief Set Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief Load-Acquire (8 bit) + \details Executes a LDAB instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) */ -__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) +__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) { -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); -#endif + uint32_t result; + + __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return ((uint8_t) result); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Process Stack Pointer (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + \brief Load-Acquire (16 bit) + \details Executes a LDAH instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) */ -__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) +__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) { -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); -#endif + uint32_t result; + + __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return ((uint16_t) result); } -#endif /** - \brief Get Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value + \brief Load-Acquire (32 bit) + \details Executes a LDA instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) +__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) { -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else uint32_t result; - __ASM volatile ("MRS %0, msplim" : "=r" (result) ); - return result; -#endif + + __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return(result); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value + \brief Store-Release (8 bit) + \details Executes a STLB instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) +__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) { -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); - return result; -#endif + __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); } -#endif /** - \brief Set Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set + \brief Store-Release (16 bit) + \details Executes a STLH instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) +__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) { -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); -#endif + __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. - \param [in] MainStackPtrLimit Main Stack Pointer value to set + \brief Store-Release (32 bit) + \details Executes a STL instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) +__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) { -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); -#endif + __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); } -#endif -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ /** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value + \brief Load-Acquire Exclusive (8 bit) + \details Executes a LDAB exclusive instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) */ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr -#else -#define __get_FPSCR() ((uint32_t)0U) -#endif +#define __LDAEXB (uint8_t)__builtin_arm_ldaex + /** - \brief Set FPSCR - \details Assigns the given value to the Floating Point Status/Control register. - \param [in] fpscr Floating Point Status/Control value to set + \brief Load-Acquire Exclusive (16 bit) + \details Executes a LDAH exclusive instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) */ -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#define __set_FPSCR __builtin_arm_set_fpscr -#else -#define __set_FPSCR(x) ((void)(x)) -#endif +#define __LDAEXH (uint16_t)__builtin_arm_ldaex -/*@} end of CMSIS_Core_RegAccFunctions */ +/** + \brief Load-Acquire Exclusive (32 bit) + \details Executes a LDA exclusive instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDAEX (uint32_t)__builtin_arm_ldaex + + +/** + \brief Store-Release Exclusive (8 bit) + \details Executes a STLB exclusive instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEXB (uint32_t)__builtin_arm_stlex + + +/** + \brief Store-Release Exclusive (16 bit) + \details Executes a STLH exclusive instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEXH (uint32_t)__builtin_arm_stlex + + +/** + \brief Store-Release Exclusive (32 bit) + \details Executes a STL exclusive instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEX (uint32_t)__builtin_arm_stlex + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ + +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions + @{ + */ + +/** + \brief Enable IRQ Interrupts + \details Enables IRQ interrupts by clearing special-purpose register PRIMASK. + Can only be executed in Privileged modes. + */ +#ifndef __ARM_COMPAT_H +__STATIC_FORCEINLINE void __enable_irq(void) +{ + __ASM volatile ("cpsie i" : : : "memory"); +} +#endif -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ -/* Define macros for porting to both thumb1 and thumb2. - * For thumb1, use low register (r0-r7), specified by constraint "l" - * Otherwise, use general registers, specified by constraint "r" */ -#if defined (__thumb__) && !defined (__thumb2__) -#define __CMSIS_GCC_OUT_REG(r) "=l" (r) -#define __CMSIS_GCC_USE_REG(r) "l" (r) -#else -#define __CMSIS_GCC_OUT_REG(r) "=r" (r) -#define __CMSIS_GCC_USE_REG(r) "r" (r) +/** + \brief Disable IRQ Interrupts + \details Disables IRQ interrupts by setting special-purpose register PRIMASK. + Can only be executed in Privileged modes. + */ +#ifndef __ARM_COMPAT_H +__STATIC_FORCEINLINE void __disable_irq(void) +{ + __ASM volatile ("cpsid i" : : : "memory"); +} #endif + /** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. + \brief Get Control Register + \details Returns the content of the Control Register. + \return Control Register value */ -#define __NOP __builtin_arm_nop +__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control" : "=r" (result) ); + return(result); +} + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. + \brief Get Control Register (non-secure) + \details Returns the content of the non-secure Control Register when in secure mode. + \return non-secure Control Register value */ -#define __WFI __builtin_arm_wfi +__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); + return(result); +} +#endif /** - \brief Wait For Event - \details Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. + \brief Set Control Register + \details Writes the given value to the Control Register. + \param [in] control Control Register value to set */ -#define __WFE __builtin_arm_wfe +__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) +{ + __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); + __ISB(); +} +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. + \brief Set Control Register (non-secure) + \details Writes the given value to the non-secure Control Register when in secure state. + \param [in] control Control Register value to set */ -#define __SEV __builtin_arm_sev +__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) +{ + __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); + __ISB(); +} +#endif /** - \brief Instruction Synchronization Barrier - \details Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or memory, - after the instruction has been completed. + \brief Get IPSR Register + \details Returns the content of the IPSR Register. + \return IPSR Register value */ -#define __ISB() __builtin_arm_isb(0xF) +__STATIC_FORCEINLINE uint32_t __get_IPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); + return(result); +} + /** - \brief Data Synchronization Barrier - \details Acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. + \brief Get APSR Register + \details Returns the content of the APSR Register. + \return APSR Register value */ -#define __DSB() __builtin_arm_dsb(0xF) +__STATIC_FORCEINLINE uint32_t __get_APSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, apsr" : "=r" (result) ); + return(result); +} /** - \brief Data Memory Barrier - \details Ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. + \brief Get xPSR Register + \details Returns the content of the xPSR Register. + \return xPSR Register value */ -#define __DMB() __builtin_arm_dmb(0xF) +__STATIC_FORCEINLINE uint32_t __get_xPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); + return(result); +} /** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. - \param [in] value Value to reverse - \return Reversed value + \brief Get Process Stack Pointer + \details Returns the current value of the Process Stack Pointer (PSP). + \return PSP Register value */ -#define __REV(value) __builtin_bswap32(value) +__STATIC_FORCEINLINE uint32_t __get_PSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp" : "=r" (result) ); + return(result); +} +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Reverse byte order (16 bit) - \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. - \param [in] value Value to reverse - \return Reversed value + \brief Get Process Stack Pointer (non-secure) + \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. + \return PSP Register value */ -#define __REV16(value) __ROR(__REV(value), 16) +__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); + return(result); +} +#endif /** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. - \param [in] value Value to reverse - \return Reversed value + \brief Set Process Stack Pointer + \details Assigns the given value to the Process Stack Pointer (PSP). + \param [in] topOfProcStack Process Stack Pointer value to set */ -#define __REVSH(value) (int16_t)__builtin_bswap16(value) +__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); +} +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Rotate Right in unsigned value (32 bit) - \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - \param [in] op1 Value to rotate - \param [in] op2 Number of Bits to rotate - \return Rotated value + \brief Set Process Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. + \param [in] topOfProcStack Process Stack Pointer value to set */ -__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) +__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) { - op2 %= 32U; - if (op2 == 0U) - { - return op1; - } - return (op1 >> op2) | (op1 << (32U - op2)); + __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); } +#endif /** - \brief Breakpoint - \details Causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. + \brief Get Main Stack Pointer + \details Returns the current value of the Main Stack Pointer (MSP). + \return MSP Register value */ -#define __BKPT(value) __ASM volatile ("bkpt "#value) +__STATIC_FORCEINLINE uint32_t __get_MSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp" : "=r" (result) ); + return(result); +} +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Reverse bit order of value - \details Reverses the bit order of the given value. - \param [in] value Value to reverse - \return Reversed value + \brief Get Main Stack Pointer (non-secure) + \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. + \return MSP Register value */ -#define __RBIT __builtin_arm_rbit +__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); + return(result); +} +#endif + /** - \brief Count leading zeros - \details Counts the number of leading zeros of a data value. - \param [in] value Value to count the leading zeros - \return number of leading zeros in value + \brief Set Main Stack Pointer + \details Assigns the given value to the Main Stack Pointer (MSP). + \param [in] topOfMainStack Main Stack Pointer value to set */ -__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) +__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) { - /* Even though __builtin_clz produces a CLZ instruction on ARM, formally - __builtin_clz(0) is undefined behaviour, so handle this case specially. - This guarantees ARM-compatible results if happening to compile on a non-ARM - target, and ensures the compiler doesn't decide to activate any - optimisations using the logic "value was passed to __builtin_clz, so it - is non-zero". - ARM Compiler 6.10 and possibly earlier will optimise this test away, leaving a - single CLZ instruction. - */ - if (value == 0U) - { - return 32U; - } - return __builtin_clz(value); + __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); } -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief LDR Exclusive (8 bit) - \details Executes a exclusive LDR instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) + \brief Set Main Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. + \param [in] topOfMainStack Main Stack Pointer value to set */ -#define __LDREXB (uint8_t)__builtin_arm_ldrex +__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); +} +#endif +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief LDR Exclusive (16 bit) - \details Executes a exclusive LDR instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) + \brief Get Stack Pointer (non-secure) + \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. + \return SP Register value */ -#define __LDREXH (uint16_t)__builtin_arm_ldrex +__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); + return(result); +} /** - \brief LDR Exclusive (32 bit) - \details Executes a exclusive LDR instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) + \brief Set Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. + \param [in] topOfStack Stack Pointer value to set */ -#define __LDREXW (uint32_t)__builtin_arm_ldrex +__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) +{ + __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); +} +#endif /** - \brief STR Exclusive (8 bit) - \details Executes a exclusive STR instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Get Priority Mask + \details Returns the current state of the priority mask bit from the Priority Mask Register. + \return Priority Mask value */ -#define __STREXB (uint32_t)__builtin_arm_strex +__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask" : "=r" (result) ); + return(result); +} +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief STR Exclusive (16 bit) - \details Executes a exclusive STR instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Get Priority Mask (non-secure) + \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. + \return Priority Mask value */ -#define __STREXH (uint32_t)__builtin_arm_strex +__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); + return(result); +} +#endif /** - \brief STR Exclusive (32 bit) - \details Executes a exclusive STR instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Set Priority Mask + \details Assigns the given value to the Priority Mask Register. + \param [in] priMask Priority Mask */ -#define __STREXW (uint32_t)__builtin_arm_strex +__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) +{ + __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); +} +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Remove the exclusive lock - \details Removes the exclusive lock which is created by LDREX. + \brief Set Priority Mask (non-secure) + \details Assigns the given value to the non-secure Priority Mask Register when in secure state. + \param [in] priMask Priority Mask */ -#define __CLREX __builtin_arm_clrex - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ +__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) +{ + __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); +} +#endif #if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) - /** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value + \brief Enable FIQ + \details Enables FIQ interrupts by clearing special-purpose register FAULTMASK. + Can only be executed in Privileged modes. */ -#define __SSAT __builtin_arm_ssat +__STATIC_FORCEINLINE void __enable_fault_irq(void) +{ + __ASM volatile ("cpsie f" : : : "memory"); +} /** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value + \brief Disable FIQ + \details Disables FIQ interrupts by setting special-purpose register FAULTMASK. + Can only be executed in Privileged modes. */ -#define __USAT __builtin_arm_usat +__STATIC_FORCEINLINE void __disable_fault_irq(void) +{ + __ASM volatile ("cpsid f" : : : "memory"); +} /** - \brief Rotate Right with Extend (32 bit) - \details Moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - \param [in] value Value to rotate - \return Rotated value + \brief Get Base Priority + \details Returns the current value of the Base Priority register. + \return Base Priority register value */ -__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) +__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) { uint32_t result; - __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + __ASM volatile ("MRS %0, basepri" : "=r" (result) ); return(result); } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief LDRT Unprivileged (8 bit) - \details Executes a Unprivileged LDRT instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) + \brief Get Base Priority (non-secure) + \details Returns the current value of the non-secure Base Priority register when in secure state. + \return Base Priority register value */ -__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) +__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) { uint32_t result; - __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint8_t) result); /* Add explicit type cast here */ + __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); + return(result); } +#endif /** - \brief LDRT Unprivileged (16 bit) - \details Executes a Unprivileged LDRT instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) + \brief Set Base Priority + \details Assigns the given value to the Base Priority register. + \param [in] basePri Base Priority value to set */ -__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) +__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) { - uint32_t result; - - __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint16_t) result); /* Add explicit type cast here */ + __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief LDRT Unprivileged (32 bit) - \details Executes a Unprivileged LDRT instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) + \brief Set Base Priority (non-secure) + \details Assigns the given value to the non-secure Base Priority register when in secure state. + \param [in] basePri Base Priority value to set */ -__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) +__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) { - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return(result); + __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); } +#endif /** - \brief STRT Unprivileged (8 bit) - \details Executes a Unprivileged STRT instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Set Base Priority with condition + \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, + or the new value increases the BASEPRI priority level. + \param [in] basePri Base Priority value to set */ -__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) +__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) { - __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); + __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); } /** - \brief STRT Unprivileged (16 bit) - \details Executes a Unprivileged STRT instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Get Fault Mask + \details Returns the current value of the Fault Mask register. + \return Fault Mask register value */ -__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) +__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) { - __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); + uint32_t result; + + __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); + return(result); } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief STRT Unprivileged (32 bit) - \details Executes a Unprivileged STRT instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Get Fault Mask (non-secure) + \details Returns the current value of the non-secure Fault Mask register when in secure state. + \return Fault Mask register value */ -__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) +__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) { - __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); + uint32_t result; + + __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); + return(result); } +#endif -#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ /** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value + \brief Set Fault Mask + \details Assigns the given value to the Fault Mask register. + \param [in] faultMask Fault Mask value to set */ -__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) +__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) { - if ((sat >= 1U) && (sat <= 32U)) - { - const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); - const int32_t min = -1 - max ; - if (val > max) - { - return max; - } - else if (val < min) - { - return min; - } - } - return val; + __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); } + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value + \brief Set Fault Mask (non-secure) + \details Assigns the given value to the non-secure Fault Mask register when in secure state. + \param [in] faultMask Fault Mask value to set */ -__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) +__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) { - if (sat <= 31U) - { - const uint32_t max = ((1U << sat) - 1U); - if (val > (int32_t)max) - { - return max; - } - else if (val < 0) - { - return 0U; - } - } - return (uint32_t)val; + __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); } +#endif #endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ @@ -1227,150 +1181,210 @@ __STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) #if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) + /** - \brief Load-Acquire (8 bit) - \details Executes a LDAB instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) + \brief Get Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). + \return PSPLIM Register value */ -__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) +__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) { +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else uint32_t result; - - __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint8_t) result); + __ASM volatile ("MRS %0, psplim" : "=r" (result) ); + return result; +#endif } - +#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Load-Acquire (16 bit) - \details Executes a LDAH instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) + \brief Get Process Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \return PSPLIM Register value */ -__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) +__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) { +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else uint32_t result; - - __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint16_t) result); + __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); + return result; +#endif } +#endif /** - \brief Load-Acquire (32 bit) - \details Executes a LDA instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) + \brief Set Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set */ -__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) +__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) { - uint32_t result; - - __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return(result); +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); +#endif } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Store-Release (8 bit) - \details Executes a STLB instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Set Process Stack Pointer (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set */ -__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) +__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) { - __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); +#endif } +#endif /** - \brief Store-Release (16 bit) - \details Executes a STLH instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Get Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). + \return MSPLIM Register value */ -__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) +__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) { - __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim" : "=r" (result) ); + return result; +#endif } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Store-Release (32 bit) - \details Executes a STL instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Get Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. + \return MSPLIM Register value */ -__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) +__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) { - __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); + return result; +#endif } +#endif /** - \brief Load-Acquire Exclusive (8 bit) - \details Executes a LDAB exclusive instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDAEXB (uint8_t)__builtin_arm_ldaex - + \brief Set Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. -/** - \brief Load-Acquire Exclusive (16 bit) - \details Executes a LDAH exclusive instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) + \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). + \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set */ -#define __LDAEXH (uint16_t)__builtin_arm_ldaex +__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); +#endif +} +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Load-Acquire Exclusive (32 bit) - \details Executes a LDA exclusive instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDAEX (uint32_t)__builtin_arm_ldaex - + \brief Set Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. -/** - \brief Store-Release Exclusive (8 bit) - \details Executes a STLB exclusive instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. + \param [in] MainStackPtrLimit Main Stack Pointer value to set */ -#define __STLEXB (uint32_t)__builtin_arm_stlex +__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); +#endif +} +#endif +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ /** - \brief Store-Release Exclusive (16 bit) - \details Executes a STLH exclusive instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Get FPSCR + \details Returns the current value of the Floating Point Status/Control register. + \return Floating Point Status/Control register value */ -#define __STLEXH (uint32_t)__builtin_arm_stlex - +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr +#else +#define __get_FPSCR() ((uint32_t)0U) +#endif /** - \brief Store-Release Exclusive (32 bit) - \details Executes a STL exclusive instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Set FPSCR + \details Assigns the given value to the Floating Point Status/Control register. + \param [in] fpscr Floating Point Status/Control value to set */ -#define __STLEX (uint32_t)__builtin_arm_stlex +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#define __set_FPSCR __builtin_arm_set_fpscr +#else +#define __set_FPSCR(x) ((void)(x)) +#endif -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ +/*@} end of CMSIS_Core_RegAccFunctions */ /* ################### Compiler specific Intrinsics ########################### */ diff --git a/edge-impulse-sdk/CMSIS/Core/Include/cmsis_gcc.h b/edge-impulse-sdk/CMSIS/Core/Include/cmsis_gcc.h index edc9f86..bf7cd11 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/cmsis_gcc.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/cmsis_gcc.h @@ -1,8 +1,8 @@ /**************************************************************************//** * @file cmsis_gcc.h * @brief CMSIS compiler GCC header file - * @version V5.3.2 - * @date 25. January 2021 + * @version V5.4.1 + * @date 27. May 2021 ******************************************************************************/ /* * Copyright (c) 2009-2021 Arm Limited. All rights reserved. @@ -202,468 +202,549 @@ __STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S (uint32_t* stackTop) { #endif -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions @{ - */ +*/ -/** - \brief Enable IRQ Interrupts - \details Enables IRQ interrupts by clearing the I-bit in the CPSR. - Can only be executed in Privileged modes. - */ -// Patched by Edge Impulse, fix for targets that already have __enable_irq -#ifndef __enable_irq -__STATIC_FORCEINLINE void __enable_irq(void) -{ - __ASM volatile ("cpsie i" : : : "memory"); -} +/* Define macros for porting to both thumb1 and thumb2. + * For thumb1, use low register (r0-r7), specified by constraint "l" + * Otherwise, use general registers, specified by constraint "r" */ +#if defined (__thumb__) && !defined (__thumb2__) +#define __CMSIS_GCC_OUT_REG(r) "=l" (r) +#define __CMSIS_GCC_RW_REG(r) "+l" (r) +#define __CMSIS_GCC_USE_REG(r) "l" (r) +#else +#define __CMSIS_GCC_OUT_REG(r) "=r" (r) +#define __CMSIS_GCC_RW_REG(r) "+r" (r) +#define __CMSIS_GCC_USE_REG(r) "r" (r) #endif - /** - \brief Disable IRQ Interrupts - \details Disables IRQ interrupts by setting the I-bit in the CPSR. - Can only be executed in Privileged modes. + \brief No Operation + \details No Operation does nothing. This instruction can be used for code alignment purposes. */ -// Patched by Edge Impulse, fix for targets that already have __disable_irq -#ifndef __disable_irq -__STATIC_FORCEINLINE void __disable_irq(void) -{ - __ASM volatile ("cpsid i" : : : "memory"); -} -#endif - +#define __NOP() __ASM volatile ("nop") /** - \brief Get Control Register - \details Returns the content of the Control Register. - \return Control Register value + \brief Wait For Interrupt + \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. */ -__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} +#define __WFI() __ASM volatile ("wfi":::"memory") -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Control Register (non-secure) - \details Returns the content of the non-secure Control Register when in secure mode. - \return non-secure Control Register value + \brief Wait For Event + \details Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. */ -__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); - return(result); -} -#endif +#define __WFE() __ASM volatile ("wfe":::"memory") /** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set + \brief Send Event + \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. */ -__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); -} +#define __SEV() __ASM volatile ("sev") -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Control Register (non-secure) - \details Writes the given value to the non-secure Control Register when in secure state. - \param [in] control Control Register value to set + \brief Instruction Synchronization Barrier + \details Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or memory, + after the instruction has been completed. */ -__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) +__STATIC_FORCEINLINE void __ISB(void) { - __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); + __ASM volatile ("isb 0xF":::"memory"); } -#endif /** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value + \brief Data Synchronization Barrier + \details Acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. */ -__STATIC_FORCEINLINE uint32_t __get_IPSR(void) +__STATIC_FORCEINLINE void __DSB(void) { - uint32_t result; - - __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); - return(result); + __ASM volatile ("dsb 0xF":::"memory"); } /** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value + \brief Data Memory Barrier + \details Ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. */ -__STATIC_FORCEINLINE uint32_t __get_APSR(void) +__STATIC_FORCEINLINE void __DMB(void) { - uint32_t result; - - __ASM volatile ("MRS %0, apsr" : "=r" (result) ); - return(result); + __ASM volatile ("dmb 0xF":::"memory"); } /** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value + \brief Reverse byte order (32 bit) + \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. + \param [in] value Value to reverse + \return Reversed value */ -__STATIC_FORCEINLINE uint32_t __get_xPSR(void) +__STATIC_FORCEINLINE uint32_t __REV(uint32_t value) { +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) + return __builtin_bswap32(value); +#else uint32_t result; - __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); - return(result); + __ASM ("rev %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return result; +#endif } /** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value + \brief Reverse byte order (16 bit) + \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. + \param [in] value Value to reverse + \return Reversed value */ -__STATIC_FORCEINLINE uint32_t __get_PSP(void) +__STATIC_FORCEINLINE uint32_t __REV16(uint32_t value) { uint32_t result; - __ASM volatile ("MRS %0, psp" : "=r" (result) ); - return(result); + __ASM ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return result; } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Process Stack Pointer (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. - \return PSP Register value + \brief Reverse byte order (16 bit) + \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. + \param [in] value Value to reverse + \return Reversed value */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) +__STATIC_FORCEINLINE int16_t __REVSH(int16_t value) { - uint32_t result; +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + return (int16_t)__builtin_bswap16(value); +#else + int16_t result; - __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); - return(result); -} + __ASM ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return result; #endif - - -/** - \brief Set Process Stack Pointer - \details Assigns the given value to the Process Stack Pointer (PSP). - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Process Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. - \param [in] topOfProcStack Process Stack Pointer value to set + \brief Rotate Right in unsigned value (32 bit) + \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + \param [in] op1 Value to rotate + \param [in] op2 Number of Bits to rotate + \return Rotated value */ -__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) +__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) { - __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); + op2 %= 32U; + if (op2 == 0U) + { + return op1; + } + return (op1 >> op2) | (op1 << (32U - op2)); } -#endif /** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value + \brief Breakpoint + \details Causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. */ -__STATIC_FORCEINLINE uint32_t __get_MSP(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, msp" : "=r" (result) ); - return(result); -} +#define __BKPT(value) __ASM volatile ("bkpt "#value) -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Main Stack Pointer (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. - \return MSP Register value + \brief Reverse bit order of value + \details Reverses the bit order of the given value. + \param [in] value Value to reverse + \return Reversed value */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) +__STATIC_FORCEINLINE uint32_t __RBIT(uint32_t value) { uint32_t result; - __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); - return(result); -} +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) + __ASM ("rbit %0, %1" : "=r" (result) : "r" (value) ); +#else + uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */ + + result = value; /* r will be reversed bits of v; first get LSB of v */ + for (value >>= 1U; value != 0U; value >>= 1U) + { + result <<= 1U; + result |= value & 1U; + s--; + } + result <<= s; /* shift when v's highest bits are zero */ #endif + return result; +} /** - \brief Set Main Stack Pointer - \details Assigns the given value to the Main Stack Pointer (MSP). - \param [in] topOfMainStack Main Stack Pointer value to set + \brief Count leading zeros + \details Counts the number of leading zeros of a data value. + \param [in] value Value to count the leading zeros + \return number of leading zeros in value */ -__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) +__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) { - __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); + /* Even though __builtin_clz produces a CLZ instruction on ARM, formally + __builtin_clz(0) is undefined behaviour, so handle this case specially. + This guarantees ARM-compatible results if happening to compile on a non-ARM + target, and ensures the compiler doesn't decide to activate any + optimisations using the logic "value was passed to __builtin_clz, so it + is non-zero". + ARM GCC 7.3 and possibly earlier will optimise this test away, leaving a + single CLZ instruction. + */ + if (value == 0U) + { + return 32U; + } + return __builtin_clz(value); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) /** - \brief Set Main Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. - \param [in] topOfMainStack Main Stack Pointer value to set + \brief LDR Exclusive (8 bit) + \details Executes a exclusive LDR instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) */ -__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) +__STATIC_FORCEINLINE uint8_t __LDREXB(volatile uint8_t *addr) { - __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); -} + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); #endif + return ((uint8_t) result); /* Add explicit type cast here */ +} -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Stack Pointer (non-secure) - \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. - \return SP Register value + \brief LDR Exclusive (16 bit) + \details Executes a exclusive LDR instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) +__STATIC_FORCEINLINE uint16_t __LDREXH(volatile uint16_t *addr) { - uint32_t result; + uint32_t result; - __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); - return(result); +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); +#endif + return ((uint16_t) result); /* Add explicit type cast here */ } /** - \brief Set Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. - \param [in] topOfStack Stack Pointer value to set + \brief LDR Exclusive (32 bit) + \details Executes a exclusive LDR instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) */ -__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) +__STATIC_FORCEINLINE uint32_t __LDREXW(volatile uint32_t *addr) { - __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); + uint32_t result; + + __ASM volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) ); + return(result); } -#endif /** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value + \brief STR Exclusive (8 bit) + \details Executes a exclusive STR instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed */ -__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) +__STATIC_FORCEINLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr) { - uint32_t result; + uint32_t result; - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); + __ASM volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); + return(result); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Priority Mask (non-secure) - \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. - \return Priority Mask value + \brief STR Exclusive (16 bit) + \details Executes a exclusive STR instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) +__STATIC_FORCEINLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr) { - uint32_t result; + uint32_t result; - __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); - return(result); + __ASM volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); + return(result); } -#endif /** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask + \brief STR Exclusive (32 bit) + \details Executes a exclusive STR instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed */ -__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) +__STATIC_FORCEINLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr) { - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); + uint32_t result; + + __ASM volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) ); + return(result); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Priority Mask (non-secure) - \details Assigns the given value to the non-secure Priority Mask Register when in secure state. - \param [in] priMask Priority Mask + \brief Remove the exclusive lock + \details Removes the exclusive lock which is created by LDREX. */ -__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) +__STATIC_FORCEINLINE void __CLREX(void) { - __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); + __ASM volatile ("clrex" ::: "memory"); } -#endif + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ #if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) /** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing the F-bit in the CPSR. - Can only be executed in Privileged modes. + \brief Signed Saturate + \details Saturates a signed value. + \param [in] ARG1 Value to be saturated + \param [in] ARG2 Bit position to saturate to (1..32) + \return Saturated value */ -__STATIC_FORCEINLINE void __enable_fault_irq(void) -{ - __ASM volatile ("cpsie f" : : : "memory"); -} +#define __SSAT(ARG1, ARG2) \ +__extension__ \ +({ \ + int32_t __RES, __ARG1 = (ARG1); \ + __ASM volatile ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ + __RES; \ + }) /** - \brief Disable FIQ - \details Disables FIQ interrupts by setting the F-bit in the CPSR. - Can only be executed in Privileged modes. + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] ARG1 Value to be saturated + \param [in] ARG2 Bit position to saturate to (0..31) + \return Saturated value */ -__STATIC_FORCEINLINE void __disable_fault_irq(void) -{ - __ASM volatile ("cpsid f" : : : "memory"); -} +#define __USAT(ARG1, ARG2) \ +__extension__ \ +({ \ + uint32_t __RES, __ARG1 = (ARG1); \ + __ASM volatile ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ + __RES; \ + }) /** - \brief Get Base Priority - \details Returns the current value of the Base Priority register. - \return Base Priority register value + \brief Rotate Right with Extend (32 bit) + \details Moves each bit of a bitstring right by one bit. + The carry input is shifted in at the left end of the bitstring. + \param [in] value Value to rotate + \return Rotated value */ -__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) +__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) { uint32_t result; - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); + __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); return(result); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Base Priority (non-secure) - \details Returns the current value of the non-secure Base Priority register when in secure state. - \return Base Priority register value + \brief LDRT Unprivileged (8 bit) + \details Executes a Unprivileged LDRT instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) +__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) { - uint32_t result; + uint32_t result; - __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); - return(result); -} +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrbt %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); #endif + return ((uint8_t) result); /* Add explicit type cast here */ +} /** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set + \brief LDRT Unprivileged (16 bit) + \details Executes a Unprivileged LDRT instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) */ -__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) +__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) { - __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrht %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); +#endif + return ((uint16_t) result); /* Add explicit type cast here */ } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Base Priority (non-secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state. - \param [in] basePri Base Priority value to set + \brief LDRT Unprivileged (32 bit) + \details Executes a Unprivileged LDRT instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) */ -__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) +__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) { - __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); + uint32_t result; + + __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); } -#endif /** - \brief Set Base Priority with condition - \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set + \brief STRT Unprivileged (8 bit) + \details Executes a Unprivileged STRT instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) +__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) { - __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); + __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); } /** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value + \brief STRT Unprivileged (16 bit) + \details Executes a Unprivileged STRT instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) +__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) { - uint32_t result; - - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); - return(result); + __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Fault Mask (non-secure) - \details Returns the current value of the non-secure Fault Mask register when in secure state. - \return Fault Mask register value + \brief STRT Unprivileged (32 bit) + \details Executes a Unprivileged STRT instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) +__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) { - uint32_t result; - - __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); - return(result); + __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); } -#endif +#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ /** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value */ -__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) +__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) { - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; } - -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Fault Mask (non-secure) - \details Assigns the given value to the non-secure Fault Mask register when in secure state. - \param [in] faultMask Fault Mask value to set + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value */ -__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) +__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) { - __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; } -#endif #endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ @@ -672,968 +753,889 @@ __STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) #if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) - /** - \brief Get Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value + \brief Load-Acquire (8 bit) + \details Executes a LDAB instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) +__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) { -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim" : "=r" (result) ); - return result; -#endif + uint32_t result; + + __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return ((uint8_t) result); } -#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) -/** - \brief Get Process Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value +/** + \brief Load-Acquire (16 bit) + \details Executes a LDAH instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) +__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) { -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); - return result; -#endif + uint32_t result; + + __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return ((uint16_t) result); } -#endif /** - \brief Set Process Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + \brief Load-Acquire (32 bit) + \details Executes a LDA instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) */ -__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) +__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) { -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); -#endif + uint32_t result; + + __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return(result); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Process Stack Pointer (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + \brief Store-Release (8 bit) + \details Executes a STLB instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) +__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) { -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure PSPLIM is RAZ/WI - (void)ProcStackPtrLimit; -#else - __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); -#endif + __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); } -#endif /** - \brief Get Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always in non-secure - mode. - - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value + \brief Store-Release (16 bit) + \details Executes a STLH instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) +__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) { -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim" : "=r" (result) ); - return result; -#endif + __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Get Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence zero is returned always. - - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value + \brief Store-Release (32 bit) + \details Executes a STL instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location */ -__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) +__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) { -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - return 0U; -#else - uint32_t result; - __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); - return result; -#endif + __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); } -#endif /** - \brief Set Main Stack Pointer Limit - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored in non-secure - mode. - - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set + \brief Load-Acquire Exclusive (8 bit) + \details Executes a LDAB exclusive instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) */ -__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) +__STATIC_FORCEINLINE uint8_t __LDAEXB(volatile uint8_t *ptr) { -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ - (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); -#endif + uint32_t result; + + __ASM volatile ("ldaexb %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return ((uint8_t) result); } -#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Set Main Stack Pointer Limit (non-secure) - Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure - Stack Pointer Limit register hence the write is silently ignored. - - \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. - \param [in] MainStackPtrLimit Main Stack Pointer value to set + \brief Load-Acquire Exclusive (16 bit) + \details Executes a LDAH exclusive instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) */ -__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) +__STATIC_FORCEINLINE uint16_t __LDAEXH(volatile uint16_t *ptr) { -#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) - // without main extensions, the non-secure MSPLIM is RAZ/WI - (void)MainStackPtrLimit; -#else - __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); -#endif -} -#endif + uint32_t result; -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + __ASM volatile ("ldaexh %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return ((uint16_t) result); +} /** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value + \brief Load-Acquire Exclusive (32 bit) + \details Executes a LDA exclusive instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) */ -__STATIC_FORCEINLINE uint32_t __get_FPSCR(void) +__STATIC_FORCEINLINE uint32_t __LDAEX(volatile uint32_t *ptr) { -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#if __has_builtin(__builtin_arm_get_fpscr) -// Re-enable using built-in when GCC has been fixed -// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2) - /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */ - return __builtin_arm_get_fpscr(); -#else - uint32_t result; + uint32_t result; - __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); - return(result); -#endif -#else - return(0U); -#endif + __ASM volatile ("ldaex %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); + return(result); } /** - \brief Set FPSCR - \details Assigns the given value to the Floating Point Status/Control register. - \param [in] fpscr Floating Point Status/Control value to set + \brief Store-Release Exclusive (8 bit) + \details Executes a STLB exclusive instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed */ -__STATIC_FORCEINLINE void __set_FPSCR(uint32_t fpscr) +__STATIC_FORCEINLINE uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr) { -#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ - (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) -#if __has_builtin(__builtin_arm_set_fpscr) -// Re-enable using built-in when GCC has been fixed -// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2) - /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */ - __builtin_arm_set_fpscr(fpscr); -#else - __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc", "memory"); -#endif -#else - (void)fpscr; -#endif -} + uint32_t result; + __ASM volatile ("stlexb %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); + return(result); +} -/*@} end of CMSIS_Core_RegAccFunctions */ +/** + \brief Store-Release Exclusive (16 bit) + \details Executes a STLH exclusive instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr) +{ + uint32_t result; -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ + __ASM volatile ("stlexh %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); + return(result); +} -/* Define macros for porting to both thumb1 and thumb2. - * For thumb1, use low register (r0-r7), specified by constraint "l" - * Otherwise, use general registers, specified by constraint "r" */ -#if defined (__thumb__) && !defined (__thumb2__) -#define __CMSIS_GCC_OUT_REG(r) "=l" (r) -#define __CMSIS_GCC_RW_REG(r) "+l" (r) -#define __CMSIS_GCC_USE_REG(r) "l" (r) -#else -#define __CMSIS_GCC_OUT_REG(r) "=r" (r) -#define __CMSIS_GCC_RW_REG(r) "+r" (r) -#define __CMSIS_GCC_USE_REG(r) "r" (r) -#endif /** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. + \brief Store-Release Exclusive (32 bit) + \details Executes a STL exclusive instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed */ -#define __NOP() __ASM volatile ("nop") +__STATIC_FORCEINLINE uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr) +{ + uint32_t result; -/** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. - */ -#define __WFI() __ASM volatile ("wfi":::"memory") + __ASM volatile ("stlex %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); + return(result); +} +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ -/** - \brief Wait For Event - \details Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. - */ -#define __WFE() __ASM volatile ("wfe":::"memory") +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions + @{ */ -#define __SEV() __ASM volatile ("sev") - /** - \brief Instruction Synchronization Barrier - \details Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or memory, - after the instruction has been completed. + \brief Enable IRQ Interrupts + \details Enables IRQ interrupts by clearing special-purpose register PRIMASK. + Can only be executed in Privileged modes. */ -__STATIC_FORCEINLINE void __ISB(void) +// Patched by Edge Impulse, fix for targets that already have __enable_irq +#ifndef __enable_irq +__STATIC_FORCEINLINE void __enable_irq(void) { - __ASM volatile ("isb 0xF":::"memory"); + __ASM volatile ("cpsie i" : : : "memory"); } +#endif /** - \brief Data Synchronization Barrier - \details Acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. + \brief Disable IRQ Interrupts + \details Disables IRQ interrupts by setting special-purpose register PRIMASK. + Can only be executed in Privileged modes. */ -__STATIC_FORCEINLINE void __DSB(void) +// Patched by Edge Impulse, fix for targets that already have __disable_irq +#ifndef __disable_irq +__STATIC_FORCEINLINE void __disable_irq(void) { - __ASM volatile ("dsb 0xF":::"memory"); + __ASM volatile ("cpsid i" : : : "memory"); } +#endif /** - \brief Data Memory Barrier - \details Ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. + \brief Get Control Register + \details Returns the content of the Control Register. + \return Control Register value */ -__STATIC_FORCEINLINE void __DMB(void) +__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) { - __ASM volatile ("dmb 0xF":::"memory"); + uint32_t result; + + __ASM volatile ("MRS %0, control" : "=r" (result) ); + return(result); } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. - \param [in] value Value to reverse - \return Reversed value + \brief Get Control Register (non-secure) + \details Returns the content of the non-secure Control Register when in secure mode. + \return non-secure Control Register value */ -__STATIC_FORCEINLINE uint32_t __REV(uint32_t value) +__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) { -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) - return __builtin_bswap32(value); -#else uint32_t result; - __ASM ("rev %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return result; -#endif + __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); + return(result); } +#endif /** - \brief Reverse byte order (16 bit) - \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. - \param [in] value Value to reverse - \return Reversed value + \brief Set Control Register + \details Writes the given value to the Control Register. + \param [in] control Control Register value to set */ -__STATIC_FORCEINLINE uint32_t __REV16(uint32_t value) +__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) { - uint32_t result; - - __ASM ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return result; + __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); + __ISB(); } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. - \param [in] value Value to reverse - \return Reversed value + \brief Set Control Register (non-secure) + \details Writes the given value to the non-secure Control Register when in secure state. + \param [in] control Control Register value to set */ -__STATIC_FORCEINLINE int16_t __REVSH(int16_t value) +__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) { -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - return (int16_t)__builtin_bswap16(value); -#else - int16_t result; - - __ASM ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return result; -#endif + __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); + __ISB(); } +#endif /** - \brief Rotate Right in unsigned value (32 bit) - \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - \param [in] op1 Value to rotate - \param [in] op2 Number of Bits to rotate - \return Rotated value + \brief Get IPSR Register + \details Returns the content of the IPSR Register. + \return IPSR Register value */ -__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) +__STATIC_FORCEINLINE uint32_t __get_IPSR(void) { - op2 %= 32U; - if (op2 == 0U) - { - return op1; - } - return (op1 >> op2) | (op1 << (32U - op2)); + uint32_t result; + + __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); + return(result); } /** - \brief Breakpoint - \details Causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. + \brief Get APSR Register + \details Returns the content of the APSR Register. + \return APSR Register value */ -#define __BKPT(value) __ASM volatile ("bkpt "#value) +__STATIC_FORCEINLINE uint32_t __get_APSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, apsr" : "=r" (result) ); + return(result); +} /** - \brief Reverse bit order of value - \details Reverses the bit order of the given value. - \param [in] value Value to reverse - \return Reversed value + \brief Get xPSR Register + \details Returns the content of the xPSR Register. + \return xPSR Register value */ -__STATIC_FORCEINLINE uint32_t __RBIT(uint32_t value) +__STATIC_FORCEINLINE uint32_t __get_xPSR(void) { uint32_t result; -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) - __ASM ("rbit %0, %1" : "=r" (result) : "r" (value) ); -#else - uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value != 0U; value >>= 1U) - { - result <<= 1U; - result |= value & 1U; - s--; - } - result <<= s; /* shift when v's highest bits are zero */ -#endif - return result; + __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); + return(result); } /** - \brief Count leading zeros - \details Counts the number of leading zeros of a data value. - \param [in] value Value to count the leading zeros - \return number of leading zeros in value + \brief Get Process Stack Pointer + \details Returns the current value of the Process Stack Pointer (PSP). + \return PSP Register value */ -__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) +__STATIC_FORCEINLINE uint32_t __get_PSP(void) { - /* Even though __builtin_clz produces a CLZ instruction on ARM, formally - __builtin_clz(0) is undefined behaviour, so handle this case specially. - This guarantees ARM-compatible results if happening to compile on a non-ARM - target, and ensures the compiler doesn't decide to activate any - optimisations using the logic "value was passed to __builtin_clz, so it - is non-zero". - ARM GCC 7.3 and possibly earlier will optimise this test away, leaving a - single CLZ instruction. - */ - if (value == 0U) - { - return 32U; - } - return __builtin_clz(value); + uint32_t result; + + __ASM volatile ("MRS %0, psp" : "=r" (result) ); + return(result); } -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief LDR Exclusive (8 bit) - \details Executes a exclusive LDR instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) + \brief Get Process Stack Pointer (non-secure) + \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. + \return PSP Register value */ -__STATIC_FORCEINLINE uint8_t __LDREXB(volatile uint8_t *addr) +__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) { - uint32_t result; + uint32_t result; -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); -#endif - return ((uint8_t) result); /* Add explicit type cast here */ + __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); + return(result); } +#endif /** - \brief LDR Exclusive (16 bit) - \details Executes a exclusive LDR instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) + \brief Set Process Stack Pointer + \details Assigns the given value to the Process Stack Pointer (PSP). + \param [in] topOfProcStack Process Stack Pointer value to set */ -__STATIC_FORCEINLINE uint16_t __LDREXH(volatile uint16_t *addr) +__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) { - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); -#endif - return ((uint16_t) result); /* Add explicit type cast here */ + __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief LDR Exclusive (32 bit) - \details Executes a exclusive LDR instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) + \brief Set Process Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. + \param [in] topOfProcStack Process Stack Pointer value to set */ -__STATIC_FORCEINLINE uint32_t __LDREXW(volatile uint32_t *addr) +__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) { - uint32_t result; - - __ASM volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) ); - return(result); + __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); } +#endif /** - \brief STR Exclusive (8 bit) - \details Executes a exclusive STR instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Get Main Stack Pointer + \details Returns the current value of the Main Stack Pointer (MSP). + \return MSP Register value */ -__STATIC_FORCEINLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr) +__STATIC_FORCEINLINE uint32_t __get_MSP(void) { - uint32_t result; + uint32_t result; - __ASM volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); - return(result); + __ASM volatile ("MRS %0, msp" : "=r" (result) ); + return(result); } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief STR Exclusive (16 bit) - \details Executes a exclusive STR instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Get Main Stack Pointer (non-secure) + \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. + \return MSP Register value */ -__STATIC_FORCEINLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr) +__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) { - uint32_t result; + uint32_t result; - __ASM volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); - return(result); + __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); + return(result); } +#endif /** - \brief STR Exclusive (32 bit) - \details Executes a exclusive STR instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Set Main Stack Pointer + \details Assigns the given value to the Main Stack Pointer (MSP). + \param [in] topOfMainStack Main Stack Pointer value to set */ -__STATIC_FORCEINLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr) +__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) { - uint32_t result; - - __ASM volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) ); - return(result); + __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Remove the exclusive lock - \details Removes the exclusive lock which is created by LDREX. + \brief Set Main Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. + \param [in] topOfMainStack Main Stack Pointer value to set */ -__STATIC_FORCEINLINE void __CLREX(void) +__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) { - __ASM volatile ("clrex" ::: "memory"); + __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); } - -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ +#endif -#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] ARG1 Value to be saturated - \param [in] ARG2 Bit position to saturate to (1..32) - \return Saturated value + \brief Get Stack Pointer (non-secure) + \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. + \return SP Register value */ -#define __SSAT(ARG1, ARG2) \ -__extension__ \ -({ \ - int32_t __RES, __ARG1 = (ARG1); \ - __ASM volatile ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ - __RES; \ - }) +__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); + return(result); +} /** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] ARG1 Value to be saturated - \param [in] ARG2 Bit position to saturate to (0..31) - \return Saturated value + \brief Set Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. + \param [in] topOfStack Stack Pointer value to set */ -#define __USAT(ARG1, ARG2) \ -__extension__ \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM volatile ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) : "cc" ); \ - __RES; \ - }) +__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) +{ + __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); +} +#endif /** - \brief Rotate Right with Extend (32 bit) - \details Moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - \param [in] value Value to rotate - \return Rotated value + \brief Get Priority Mask + \details Returns the current state of the priority mask bit from the Priority Mask Register. + \return Priority Mask value */ -__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) +__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) { uint32_t result; - __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + __ASM volatile ("MRS %0, primask" : "=r" (result) ); return(result); } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief LDRT Unprivileged (8 bit) - \details Executes a Unprivileged LDRT instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) + \brief Get Priority Mask (non-secure) + \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. + \return Priority Mask value */ -__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) +__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) { - uint32_t result; + uint32_t result; -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrbt %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); -#endif - return ((uint8_t) result); /* Add explicit type cast here */ + __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); + return(result); } +#endif /** - \brief LDRT Unprivileged (16 bit) - \details Executes a Unprivileged LDRT instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) + \brief Set Priority Mask + \details Assigns the given value to the Priority Mask Register. + \param [in] priMask Priority Mask */ -__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) +__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) { - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrht %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); -#endif - return ((uint16_t) result); /* Add explicit type cast here */ + __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief LDRT Unprivileged (32 bit) - \details Executes a Unprivileged LDRT instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) + \brief Set Priority Mask (non-secure) + \details Assigns the given value to the non-secure Priority Mask Register when in secure state. + \param [in] priMask Priority Mask */ -__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) +__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) { - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return(result); + __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); } +#endif +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) /** - \brief STRT Unprivileged (8 bit) - \details Executes a Unprivileged STRT instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Enable FIQ + \details Enables FIQ interrupts by clearing special-purpose register FAULTMASK. + Can only be executed in Privileged modes. */ -__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) +__STATIC_FORCEINLINE void __enable_fault_irq(void) { - __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); + __ASM volatile ("cpsie f" : : : "memory"); } /** - \brief STRT Unprivileged (16 bit) - \details Executes a Unprivileged STRT instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Disable FIQ + \details Disables FIQ interrupts by setting special-purpose register FAULTMASK. + Can only be executed in Privileged modes. */ -__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) +__STATIC_FORCEINLINE void __disable_fault_irq(void) { - __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); + __ASM volatile ("cpsid f" : : : "memory"); } /** - \brief STRT Unprivileged (32 bit) - \details Executes a Unprivileged STRT instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Get Base Priority + \details Returns the current value of the Base Priority register. + \return Base Priority register value */ -__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) +__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) { - __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); + uint32_t result; + + __ASM volatile ("MRS %0, basepri" : "=r" (result) ); + return(result); } -#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value + \brief Get Base Priority (non-secure) + \details Returns the current value of the non-secure Base Priority register when in secure state. + \return Base Priority register value */ -__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) +__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) { - if ((sat >= 1U) && (sat <= 32U)) - { - const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); - const int32_t min = -1 - max ; - if (val > max) - { - return max; - } - else if (val < min) - { - return min; - } - } - return val; + uint32_t result; + + __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); + return(result); } +#endif + /** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value + \brief Set Base Priority + \details Assigns the given value to the Base Priority register. + \param [in] basePri Base Priority value to set */ -__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) +__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) { - if (sat <= 31U) - { - const uint32_t max = ((1U << sat) - 1U); - if (val > (int32_t)max) - { - return max; - } - else if (val < 0) - { - return 0U; - } - } - return (uint32_t)val; + __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); } -#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ - (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ - (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ - -#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Load-Acquire (8 bit) - \details Executes a LDAB instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) + \brief Set Base Priority (non-secure) + \details Assigns the given value to the non-secure Base Priority register when in secure state. + \param [in] basePri Base Priority value to set */ -__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) +__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) { - uint32_t result; + __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); +} +#endif - __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint8_t) result); + +/** + \brief Set Base Priority with condition + \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, + or the new value increases the BASEPRI priority level. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); } /** - \brief Load-Acquire (16 bit) - \details Executes a LDAH instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) + \brief Get Fault Mask + \details Returns the current value of the Fault Mask register. + \return Fault Mask register value */ -__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) +__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) { - uint32_t result; + uint32_t result; - __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint16_t) result); + __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); + return(result); } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Load-Acquire (32 bit) - \details Executes a LDA instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) + \brief Get Fault Mask (non-secure) + \details Returns the current value of the non-secure Fault Mask register when in secure state. + \return Fault Mask register value */ -__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) +__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) { - uint32_t result; + uint32_t result; - __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return(result); + __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); + return(result); } +#endif /** - \brief Store-Release (8 bit) - \details Executes a STLB instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Set Fault Mask + \details Assigns the given value to the Fault Mask register. + \param [in] faultMask Fault Mask value to set */ -__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) +__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) { - __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); + __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); } +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Store-Release (16 bit) - \details Executes a STLH instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Set Fault Mask (non-secure) + \details Assigns the given value to the non-secure Fault Mask register when in secure state. + \param [in] faultMask Fault Mask value to set */ -__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) +__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) { - __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); + __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); } +#endif + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) /** - \brief Store-Release (32 bit) - \details Executes a STL instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location + \brief Get Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). + \return PSPLIM Register value */ -__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) +__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) { - __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim" : "=r" (result) ); + return result; +#endif } - +#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) /** - \brief Load-Acquire Exclusive (8 bit) - \details Executes a LDAB exclusive instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) + \brief Get Process Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \return PSPLIM Register value */ -__STATIC_FORCEINLINE uint8_t __LDAEXB(volatile uint8_t *ptr) +__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) { - uint32_t result; - - __ASM volatile ("ldaexb %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint8_t) result); +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); + return result; +#endif } +#endif /** - \brief Load-Acquire Exclusive (16 bit) - \details Executes a LDAH exclusive instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) + \brief Set Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set */ -__STATIC_FORCEINLINE uint16_t __LDAEXH(volatile uint16_t *ptr) +__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) { - uint32_t result; +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); +#endif +} - __ASM volatile ("ldaexh %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return ((uint16_t) result); + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); +#endif } +#endif /** - \brief Load-Acquire Exclusive (32 bit) - \details Executes a LDA exclusive instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) + \brief Get Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). + \return MSPLIM Register value */ -__STATIC_FORCEINLINE uint32_t __LDAEX(volatile uint32_t *ptr) +__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) { - uint32_t result; +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim" : "=r" (result) ); + return result; +#endif +} - __ASM volatile ("ldaex %0, %1" : "=r" (result) : "Q" (*ptr) : "memory" ); - return(result); + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); + return result; +#endif } +#endif /** - \brief Store-Release Exclusive (8 bit) - \details Executes a STLB exclusive instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Set Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). + \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set */ -__STATIC_FORCEINLINE uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr) +__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) { - uint32_t result; +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); +#endif +} - __ASM volatile ("stlexb %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); - return(result); + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. + \param [in] MainStackPtrLimit Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); +#endif } +#endif + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ /** - \brief Store-Release Exclusive (16 bit) - \details Executes a STLH exclusive instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Get FPSCR + \details Returns the current value of the Floating Point Status/Control register. + \return Floating Point Status/Control register value */ -__STATIC_FORCEINLINE uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr) +__STATIC_FORCEINLINE uint32_t __get_FPSCR(void) { - uint32_t result; +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#if __has_builtin(__builtin_arm_get_fpscr) +// Re-enable using built-in when GCC has been fixed +// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2) + /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */ + return __builtin_arm_get_fpscr(); +#else + uint32_t result; - __ASM volatile ("stlexh %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); - return(result); + __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); + return(result); +#endif +#else + return(0U); +#endif } /** - \brief Store-Release Exclusive (32 bit) - \details Executes a STL exclusive instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed + \brief Set FPSCR + \details Assigns the given value to the Floating Point Status/Control register. + \param [in] fpscr Floating Point Status/Control value to set */ -__STATIC_FORCEINLINE uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr) +__STATIC_FORCEINLINE void __set_FPSCR(uint32_t fpscr) { - uint32_t result; - - __ASM volatile ("stlex %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) : "memory" ); - return(result); +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#if __has_builtin(__builtin_arm_set_fpscr) +// Re-enable using built-in when GCC has been fixed +// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2) + /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */ + __builtin_arm_set_fpscr(fpscr); +#else + __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc", "memory"); +#endif +#else + (void)fpscr; +#endif } -#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ - (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ +/*@} end of CMSIS_Core_RegAccFunctions */ /* ################### Compiler specific Intrinsics ########################### */ diff --git a/edge-impulse-sdk/CMSIS/Core/Include/cmsis_iccarm.h b/edge-impulse-sdk/CMSIS/Core/Include/cmsis_iccarm.h index 45e90af..65b824b 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/cmsis_iccarm.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/cmsis_iccarm.h @@ -1,14 +1,14 @@ /**************************************************************************//** * @file cmsis_iccarm.h * @brief CMSIS compiler ICCARM (IAR Compiler for Arm) header file - * @version V5.2.0 - * @date 28. January 2020 + * @version V5.3.0 + * @date 14. April 2021 ******************************************************************************/ //------------------------------------------------------------------------------ // -// Copyright (c) 2017-2020 IAR Systems -// Copyright (c) 2017-2019 Arm Limited. All rights reserved. +// Copyright (c) 2017-2021 IAR Systems +// Copyright (c) 2017-2021 Arm Limited. All rights reserved. // // SPDX-License-Identifier: Apache-2.0 // @@ -267,6 +267,24 @@ __packed struct __iar_u32 { uint32_t v; }; #define __VECTOR_TABLE_ATTRIBUTE @".intvec" #endif +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +#ifndef __STACK_SEAL +#define __STACK_SEAL STACKSEAL$$Base +#endif + +#ifndef __TZ_STACK_SEAL_SIZE +#define __TZ_STACK_SEAL_SIZE 8U +#endif + +#ifndef __TZ_STACK_SEAL_VALUE +#define __TZ_STACK_SEAL_VALUE 0xFEF5EDA5FEF5EDA5ULL +#endif + +__STATIC_FORCEINLINE void __TZ_set_STACKSEAL_S (uint32_t* stackTop) { + *((uint64_t *)stackTop) = __TZ_STACK_SEAL_VALUE; +} +#endif + #ifndef __ICCARM_INTRINSICS_VERSION__ #define __ICCARM_INTRINSICS_VERSION__ 0 #endif @@ -337,7 +355,13 @@ __packed struct __iar_u32 { uint32_t v; }; #define __set_BASEPRI(VALUE) (__arm_wsr("BASEPRI", (VALUE))) #define __set_BASEPRI_MAX(VALUE) (__arm_wsr("BASEPRI_MAX", (VALUE))) - #define __set_CONTROL(VALUE) (__arm_wsr("CONTROL", (VALUE))) + +__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) +{ + __arm_wsr("CONTROL", control); + __iar_builtin_ISB(); +} + #define __set_FAULTMASK(VALUE) (__arm_wsr("FAULTMASK", (VALUE))) #define __set_MSP(VALUE) (__arm_wsr("MSP", (VALUE))) @@ -359,7 +383,13 @@ __packed struct __iar_u32 { uint32_t v; }; #endif #define __TZ_get_CONTROL_NS() (__arm_rsr("CONTROL_NS")) - #define __TZ_set_CONTROL_NS(VALUE) (__arm_wsr("CONTROL_NS", (VALUE))) + +__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) +{ + __arm_wsr("CONTROL_NS", control); + __iar_builtin_ISB(); +} + #define __TZ_get_PSP_NS() (__arm_rsr("PSP_NS")) #define __TZ_set_PSP_NS(VALUE) (__arm_wsr("PSP_NS", (VALUE))) #define __TZ_get_MSP_NS() (__arm_rsr("MSP_NS")) @@ -681,6 +711,7 @@ __packed struct __iar_u32 { uint32_t v; }; __IAR_FT void __TZ_set_CONTROL_NS(uint32_t value) { __asm volatile("MSR CONTROL_NS,%0" :: "r" (value)); + __iar_builtin_ISB(); } __IAR_FT uint32_t __TZ_get_PSP_NS(void) diff --git a/edge-impulse-sdk/CMSIS/Core/Include/cmsis_version.h b/edge-impulse-sdk/CMSIS/Core/Include/cmsis_version.h index 2f048e4..8b4765f 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/cmsis_version.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/cmsis_version.h @@ -1,11 +1,11 @@ /**************************************************************************//** * @file cmsis_version.h * @brief CMSIS Core(M) Version definitions - * @version V5.0.4 - * @date 23. July 2019 + * @version V5.0.5 + * @date 02. February 2022 ******************************************************************************/ /* - * Copyright (c) 2009-2019 ARM Limited. All rights reserved. + * Copyright (c) 2009-2022 ARM Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -33,7 +33,7 @@ /* CMSIS Version definitions */ #define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ -#define __CM_CMSIS_VERSION_SUB ( 4U) /*!< [15:0] CMSIS Core(M) sub version */ +#define __CM_CMSIS_VERSION_SUB ( 6U) /*!< [15:0] CMSIS Core(M) sub version */ #define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ #endif diff --git a/edge-impulse-sdk/CMSIS/Core/Include/core_armv81mml.h b/edge-impulse-sdk/CMSIS/Core/Include/core_armv81mml.h index 18bcb04..fa1afb8 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/core_armv81mml.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/core_armv81mml.h @@ -1,11 +1,11 @@ /**************************************************************************//** * @file core_armv81mml.h * @brief CMSIS Armv8.1-M Mainline Core Peripheral Access Layer Header File - * @version V1.4.0 - * @date 15. April 2020 + * @version V1.4.2 + * @date 13. October 2021 ******************************************************************************/ /* - * Copyright (c) 2018-2020 Arm Limited. All rights reserved. + * Copyright (c) 2018-2021 Arm Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -210,14 +210,14 @@ #define __FPU_PRESENT 0U #warning "__FPU_PRESENT not defined in device header file; using default!" #endif - + #if __FPU_PRESENT != 0U #ifndef __FPU_DP #define __FPU_DP 0U #warning "__FPU_DP not defined in device header file; using default!" #endif #endif - + #ifndef __MPU_PRESENT #define __MPU_PRESENT 0U #warning "__MPU_PRESENT not defined in device header file; using default!" @@ -232,7 +232,7 @@ #define __DCACHE_PRESENT 0U #warning "__DCACHE_PRESENT not defined in device header file; using default!" #endif - + #ifndef __PMU_PRESENT #define __PMU_PRESENT 0U #warning "__PMU_PRESENT not defined in device header file; using default!" @@ -261,7 +261,7 @@ #define __VTOR_PRESENT 1U #warning "__VTOR_PRESENT not defined in device header file; using default!" #endif - + #ifndef __NVIC_PRIO_BITS #define __NVIC_PRIO_BITS 3U #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" @@ -526,7 +526,7 @@ typedef struct __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ - __IM uint32_t ID_ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t ID_AFR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ __IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ @@ -535,7 +535,10 @@ typedef struct __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */ - uint32_t RESERVED3[92U]; + uint32_t RESERVED7[21U]; + __IOM uint32_t SFSR; /*!< Offset: 0x0E4 (R/W) Secure Fault Status Register */ + __IOM uint32_t SFAR; /*!< Offset: 0x0E8 (R/W) Secure Fault Address Register */ + uint32_t RESERVED3[69U]; __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ __IOM uint32_t RFSR; /*!< Offset: 0x204 (R/W) RAS Fault Status Register */ uint32_t RESERVED4[14U]; @@ -766,22 +769,22 @@ typedef struct #define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ /* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ -#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Pos (SCB_CFSR_MEMFAULTSR_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ #define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ -#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ #define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ -#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ #define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ -#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ #define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ -#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ #define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ -#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ #define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ /* BusFault Status Register (part of SCB Configurable Fault Status Register) */ @@ -1490,15 +1493,14 @@ typedef struct uint32_t RESERVED11[108]; __IOM uint32_t AUTHSTATUS; /*!< Offset: 0xFB8 (R/W) PMU Authentication Status Register */ __IOM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/W) PMU Device Architecture Register */ - uint32_t RESERVED12[4]; + uint32_t RESERVED12[3]; __IOM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/W) PMU Device Type Register */ __IOM uint32_t PIDR4; /*!< Offset: 0xFD0 (R/W) PMU Peripheral Identification Register 4 */ uint32_t RESERVED13[3]; __IOM uint32_t PIDR0; /*!< Offset: 0xFE0 (R/W) PMU Peripheral Identification Register 0 */ - __IOM uint32_t PIDR1; /*!< Offset: 0xFE0 (R/W) PMU Peripheral Identification Register 1 */ - __IOM uint32_t PIDR2; /*!< Offset: 0xFE0 (R/W) PMU Peripheral Identification Register 2 */ - __IOM uint32_t PIDR3; /*!< Offset: 0xFE0 (R/W) PMU Peripheral Identification Register 3 */ - uint32_t RESERVED14[3]; + __IOM uint32_t PIDR1; /*!< Offset: 0xFE4 (R/W) PMU Peripheral Identification Register 1 */ + __IOM uint32_t PIDR2; /*!< Offset: 0xFE8 (R/W) PMU Peripheral Identification Register 2 */ + __IOM uint32_t PIDR3; /*!< Offset: 0xFEC (R/W) PMU Peripheral Identification Register 3 */ __IOM uint32_t CIDR0; /*!< Offset: 0xFF0 (R/W) PMU Component Identification Register 0 */ __IOM uint32_t CIDR1; /*!< Offset: 0xFF4 (R/W) PMU Component Identification Register 1 */ __IOM uint32_t CIDR2; /*!< Offset: 0xFF8 (R/W) PMU Component Identification Register 2 */ @@ -3158,6 +3160,15 @@ typedef struct /*@} */ +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_register_aliases Backwards Compatibility Aliases + \brief Register alias definitions for backwards compatibility. + @{ + */ +#define ID_ADR (ID_AFR) /*!< SCB Auxiliary Feature Register */ +/*@} */ + /******************************************************************************* * Hardware Abstraction Layer diff --git a/edge-impulse-sdk/CMSIS/Core/Include/core_armv8mml.h b/edge-impulse-sdk/CMSIS/Core/Include/core_armv8mml.h index 0632732..ede72ec 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/core_armv8mml.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/core_armv8mml.h @@ -1,11 +1,11 @@ /**************************************************************************//** * @file core_armv8mml.h * @brief CMSIS Armv8-M Mainline Core Peripheral Access Layer Header File - * @version V5.2.1 - * @date 19. August 2020 + * @version V5.2.4 + * @date 30. May 2022 ******************************************************************************/ /* - * Copyright (c) 2009-2020 Arm Limited. All rights reserved. + * Copyright (c) 2009-2022 Arm Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -254,7 +254,7 @@ #define __VTOR_PRESENT 1U #warning "__VTOR_PRESENT not defined in device header file; using default!" #endif - + #ifndef __NVIC_PRIO_BITS #define __NVIC_PRIO_BITS 3U #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" @@ -287,7 +287,7 @@ #define __OM volatile /*! Defines 'write only' structure member permissions */ #define __IOM volatile /*! Defines 'read / write' structure member permissions */ -/*@} end of group ARMv8MML */ +/** @} end of group ARMv8MML */ @@ -452,7 +452,7 @@ typedef union #define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ #define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ -/*@} end of group CMSIS_CORE */ +/** @} end of group CMSIS_CORE */ /** @@ -488,7 +488,7 @@ typedef struct #define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ #define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ -/*@} end of group CMSIS_NVIC */ +/** @} end of group CMSIS_NVIC */ /** @@ -519,7 +519,7 @@ typedef struct __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ - __IM uint32_t ID_ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t ID_AFR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ __IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ @@ -528,7 +528,10 @@ typedef struct __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */ - uint32_t RESERVED3[92U]; + uint32_t RESERVED7[21U]; + __IOM uint32_t SFSR; /*!< Offset: 0x0E4 (R/W) Secure Fault Status Register */ + __IOM uint32_t SFAR; /*!< Offset: 0x0E8 (R/W) Secure Fault Address Register */ + uint32_t RESERVED3[69U]; __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ uint32_t RESERVED4[15U]; __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */ @@ -746,22 +749,22 @@ typedef struct #define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ /* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ -#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Pos (SCB_CFSR_MEMFAULTSR_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ #define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ -#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ #define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ -#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ #define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ -#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ #define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ -#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ #define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ -#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ #define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ /* BusFault Status Register (part of SCB Configurable Fault Status Register) */ @@ -921,7 +924,7 @@ typedef struct #define SCB_DCCISW_SET_Pos 5U /*!< SCB DCCISW: Set Position */ #define SCB_DCCISW_SET_Msk (0x1FFUL << SCB_DCCISW_SET_Pos) /*!< SCB DCCISW: Set Mask */ -/*@} end of group CMSIS_SCB */ +/** @} end of group CMSIS_SCB */ /** @@ -946,7 +949,7 @@ typedef struct #define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ #define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ -/*@} end of group CMSIS_SCnotSCB */ +/** @} end of group CMSIS_SCnotSCB */ /** @@ -998,7 +1001,7 @@ typedef struct #define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ #define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ -/*@} end of group CMSIS_SysTick */ +/** @} end of group CMSIS_SysTick */ /** @@ -1098,7 +1101,7 @@ typedef struct #define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ #define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ -/*@}*/ /* end of group CMSIS_ITM */ +/** @}*/ /* end of group CMSIS_ITM */ /** @@ -1284,7 +1287,7 @@ typedef struct #define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */ #define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */ -/*@}*/ /* end of group CMSIS_DWT */ +/** @}*/ /* end of group CMSIS_DWT */ /** @@ -1382,7 +1385,7 @@ typedef struct #define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ #define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ -/*@}*/ /* end of group CMSIS_TPI */ +/** @}*/ /* end of group CMSIS_TPI */ #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) @@ -1494,7 +1497,7 @@ typedef struct #define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */ #define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */ -/*@} end of group CMSIS_MPU */ +/** @} end of group CMSIS_MPU */ #endif @@ -1581,7 +1584,7 @@ typedef struct #define SAU_SFSR_INVEP_Pos 0U /*!< SAU SFSR: INVEP Position */ #define SAU_SFSR_INVEP_Msk (1UL /*<< SAU_SFSR_INVEP_Pos*/) /*!< SAU SFSR: INVEP Mask */ -/*@} end of group CMSIS_SAU */ +/** @} end of group CMSIS_SAU */ #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ @@ -1717,7 +1720,7 @@ typedef struct #define FPU_MVFR2_FPMisc_Pos 4U /*!< MVFR2: FPMisc bits Position */ #define FPU_MVFR2_FPMisc_Msk (0xFUL << FPU_MVFR2_FPMisc_Pos) /*!< MVFR2: FPMisc bits Mask */ -/*@} end of group CMSIS_FPU */ +/** @} end of group CMSIS_FPU */ /* CoreDebug is deprecated. replaced by DCB (Debug Control Block) */ /** @@ -1851,7 +1854,7 @@ typedef struct #define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< \deprecated CoreDebug DSCSR: SBRSELEN Position */ #define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< \deprecated CoreDebug DSCSR: SBRSELEN Mask */ -/*@} end of group CMSIS_CoreDebug */ +/** @} end of group CMSIS_CoreDebug */ /** @@ -2007,7 +2010,7 @@ typedef struct #define DCB_DSCSR_SBRSELEN_Pos 0U /*!< DCB DSCSR: Secure banked register select enable Position */ #define DCB_DSCSR_SBRSELEN_Msk (0x1UL /*<< DCB_DSCSR_SBRSELEN_Pos*/) /*!< DCB DSCSR: Secure banked register select enable Mask */ -/*@} end of group CMSIS_DCB */ +/** @} end of group CMSIS_DCB */ @@ -2081,7 +2084,7 @@ typedef struct #define DIB_DDEVTYPE_MAJOR_Msk (0xFUL /*<< DIB_DDEVTYPE_MAJOR_Pos*/) /*!< DIB DDEVTYPE: Major type Mask */ -/*@} end of group CMSIS_DIB */ +/** @} end of group CMSIS_DIB */ /** @@ -2107,7 +2110,7 @@ typedef struct */ #define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) -/*@} end of group CMSIS_core_bitfield */ +/** @} end of group CMSIS_core_bitfield */ /** @@ -2179,8 +2182,17 @@ typedef struct #define FPU_NS ((FPU_Type *) FPU_BASE_NS ) /*!< Floating Point Unit (non-secure address space) */ #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ -/*@} */ +/** @} */ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_register_aliases Backwards Compatibility Aliases + \brief Register alias definitions for backwards compatibility. + @{ + */ +#define ID_ADR (ID_AFR) /*!< SCB Auxiliary Feature Register */ +/*@} */ /******************************************************************************* @@ -2838,7 +2850,7 @@ __STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn) } #endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ -/*@} end of CMSIS_Core_NVICFunctions */ +/** @} end of CMSIS_Core_NVICFunctions */ /* ########################## MPU functions #################################### */ @@ -2884,7 +2896,7 @@ __STATIC_INLINE uint32_t SCB_GetFPUType(void) } -/*@} end of CMSIS_Core_FpuFunctions */ +/** @} end of CMSIS_Core_FpuFunctions */ /* ########################## Cache functions #################################### */ @@ -2927,7 +2939,7 @@ __STATIC_INLINE void TZ_SAU_Disable(void) #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ -/*@} end of CMSIS_Core_SAUFunctions */ +/** @} end of CMSIS_Core_SAUFunctions */ @@ -2940,7 +2952,7 @@ __STATIC_INLINE void TZ_SAU_Disable(void) @{ */ - + /** \brief Set Debug Authentication Control Register \details writes to Debug Authentication Control register. @@ -2994,7 +3006,7 @@ __STATIC_INLINE uint32_t TZ_DCB_GetAuthCtrl_NS(void) } #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ -/*@} end of CMSIS_Core_DCBFunctions */ +/** @} end of CMSIS_Core_DCBFunctions */ @@ -3007,7 +3019,7 @@ __STATIC_INLINE uint32_t TZ_DCB_GetAuthCtrl_NS(void) @{ */ - + /** \brief Get Debug Authentication Status Register \details Reads Debug Authentication Status register. @@ -3031,7 +3043,7 @@ __STATIC_INLINE uint32_t TZ_DIB_GetAuthStatus_NS(void) } #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ -/*@} end of CMSIS_Core_DCBFunctions */ +/** @} end of CMSIS_Core_DCBFunctions */ @@ -3105,7 +3117,7 @@ __STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks) #endif -/*@} end of CMSIS_Core_SysTickFunctions */ +/** @} end of CMSIS_Core_SysTickFunctions */ @@ -3183,7 +3195,7 @@ __STATIC_INLINE int32_t ITM_CheckChar (void) } } -/*@} end of CMSIS_core_DebugFunctions */ +/** @} end of CMSIS_core_DebugFunctions */ diff --git a/edge-impulse-sdk/CMSIS/Core/Include/core_cm3.h b/edge-impulse-sdk/CMSIS/Core/Include/core_cm3.h index 33c0f57..b73615f 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/core_cm3.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/core_cm3.h @@ -1,11 +1,11 @@ /**************************************************************************//** * @file core_cm3.h * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File - * @version V5.1.1 - * @date 27. March 2020 + * @version V5.1.2 + * @date 04. June 2021 ******************************************************************************/ /* - * Copyright (c) 2009-2020 Arm Limited. All rights reserved. + * Copyright (c) 2009-2021 Arm Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -146,7 +146,7 @@ #define __VTOR_PRESENT 1U #warning "__VTOR_PRESENT not defined in device header file; using default!" #endif - + #ifndef __NVIC_PRIO_BITS #define __NVIC_PRIO_BITS 3U #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" @@ -565,19 +565,19 @@ typedef struct #define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ /* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ -#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Pos (SCB_CFSR_MEMFAULTSR_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ #define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ -#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ #define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ -#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ #define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ -#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ #define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ -#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ #define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ /* BusFault Status Register (part of SCB Configurable Fault Status Register) */ diff --git a/edge-impulse-sdk/CMSIS/Core/Include/core_cm33.h b/edge-impulse-sdk/CMSIS/Core/Include/core_cm33.h index 6294184..f964b15 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/core_cm33.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/core_cm33.h @@ -1,11 +1,11 @@ /**************************************************************************//** * @file core_cm33.h * @brief CMSIS Cortex-M33 Core Peripheral Access Layer Header File - * @version V5.2.1 - * @date 19. August 2020 + * @version V5.2.3 + * @date 13. October 2021 ******************************************************************************/ /* - * Copyright (c) 2009-2020 Arm Limited. All rights reserved. + * Copyright (c) 2009-2021 Arm Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -254,7 +254,7 @@ #define __VTOR_PRESENT 1U #warning "__VTOR_PRESENT not defined in device header file; using default!" #endif - + #ifndef __NVIC_PRIO_BITS #define __NVIC_PRIO_BITS 3U #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" @@ -519,7 +519,7 @@ typedef struct __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ - __IM uint32_t ID_ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t ID_AFR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ __IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ @@ -528,7 +528,10 @@ typedef struct __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */ - uint32_t RESERVED3[92U]; + uint32_t RESERVED7[21U]; + __IOM uint32_t SFSR; /*!< Offset: 0x0E4 (R/W) Secure Fault Status Register */ + __IOM uint32_t SFAR; /*!< Offset: 0x0E8 (R/W) Secure Fault Address Register */ + uint32_t RESERVED3[69U]; __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ uint32_t RESERVED4[15U]; __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */ @@ -746,22 +749,22 @@ typedef struct #define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ /* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ -#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Pos (SCB_CFSR_MEMFAULTSR_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ #define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ -#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ #define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ -#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ #define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ -#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ #define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ -#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ #define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ -#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ #define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ /* BusFault Status Register (part of SCB Configurable Fault Status Register) */ @@ -2257,6 +2260,15 @@ typedef struct /*@} */ +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_register_aliases Backwards Compatibility Aliases + \brief Register alias definitions for backwards compatibility. + @{ + */ +#define ID_ADR (ID_AFR) /*!< SCB Auxiliary Feature Register */ +/*@} */ + /******************************************************************************* * Hardware Abstraction Layer @@ -3008,7 +3020,7 @@ __STATIC_INLINE void TZ_SAU_Disable(void) @{ */ - + /** \brief Set Debug Authentication Control Register \details writes to Debug Authentication Control register. @@ -3075,7 +3087,7 @@ __STATIC_INLINE uint32_t TZ_DCB_GetAuthCtrl_NS(void) @{ */ - + /** \brief Get Debug Authentication Status Register \details Reads Debug Authentication Status register. diff --git a/edge-impulse-sdk/CMSIS/Core/Include/core_cm35p.h b/edge-impulse-sdk/CMSIS/Core/Include/core_cm35p.h index a1e51ad..c8bfddd 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/core_cm35p.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/core_cm35p.h @@ -1,11 +1,11 @@ /**************************************************************************//** * @file core_cm35p.h * @brief CMSIS Cortex-M35P Core Peripheral Access Layer Header File - * @version V1.1.1 - * @date 19. August 2020 + * @version V1.1.3 + * @date 13. October 2021 ******************************************************************************/ /* - * Copyright (c) 2018-2020 Arm Limited. All rights reserved. + * Copyright (c) 2018-2021 Arm Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -249,12 +249,12 @@ #define __DSP_PRESENT 0U #warning "__DSP_PRESENT not defined in device header file; using default!" #endif - + #ifndef __VTOR_PRESENT #define __VTOR_PRESENT 1U #warning "__VTOR_PRESENT not defined in device header file; using default!" #endif - + #ifndef __NVIC_PRIO_BITS #define __NVIC_PRIO_BITS 3U #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" @@ -519,7 +519,7 @@ typedef struct __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ - __IM uint32_t ID_ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t ID_AFR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ __IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ @@ -528,7 +528,10 @@ typedef struct __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */ - uint32_t RESERVED3[92U]; + uint32_t RESERVED7[21U]; + __IOM uint32_t SFSR; /*!< Offset: 0x0E4 (R/W) Secure Fault Status Register */ + __IOM uint32_t SFAR; /*!< Offset: 0x0E8 (R/W) Secure Fault Address Register */ + uint32_t RESERVED3[69U]; __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ uint32_t RESERVED4[15U]; __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */ @@ -746,22 +749,22 @@ typedef struct #define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ /* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ -#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Pos (SCB_CFSR_MEMFAULTSR_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ #define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ -#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ #define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ -#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ #define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ -#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ #define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ -#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ #define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ -#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ #define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ /* BusFault Status Register (part of SCB Configurable Fault Status Register) */ @@ -2257,6 +2260,15 @@ typedef struct /*@} */ +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_register_aliases Backwards Compatibility Aliases + \brief Register alias definitions for backwards compatibility. + @{ + */ +#define ID_ADR (ID_AFR) /*!< SCB Auxiliary Feature Register */ +/*@} */ + /******************************************************************************* * Hardware Abstraction Layer @@ -3008,7 +3020,7 @@ __STATIC_INLINE void TZ_SAU_Disable(void) @{ */ - + /** \brief Set Debug Authentication Control Register \details writes to Debug Authentication Control register. @@ -3075,7 +3087,7 @@ __STATIC_INLINE uint32_t TZ_DCB_GetAuthCtrl_NS(void) @{ */ - + /** \brief Get Debug Authentication Status Register \details Reads Debug Authentication Status register. diff --git a/edge-impulse-sdk/CMSIS/Core/Include/core_cm4.h b/edge-impulse-sdk/CMSIS/Core/Include/core_cm4.h index dfdc41a..a347f36 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/core_cm4.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/core_cm4.h @@ -1,8 +1,8 @@ /**************************************************************************//** * @file core_cm4.h * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File - * @version V5.1.1 - * @date 27. March 2020 + * @version V5.1.2 + * @date 04. June 2021 ******************************************************************************/ /* * Copyright (c) 2009-2020 Arm Limited. All rights reserved. @@ -198,7 +198,7 @@ #define __VTOR_PRESENT 1U #warning "__VTOR_PRESENT not defined in device header file; using default!" #endif - + #ifndef __NVIC_PRIO_BITS #define __NVIC_PRIO_BITS 3U #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" @@ -623,22 +623,22 @@ typedef struct #define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ /* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ -#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Pos (SCB_CFSR_MEMFAULTSR_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ #define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ -#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ #define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ -#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ #define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ -#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ #define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ -#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ #define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ -#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ #define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ /* BusFault Status Register (part of SCB Configurable Fault Status Register) */ diff --git a/edge-impulse-sdk/CMSIS/Core/Include/core_cm55.h b/edge-impulse-sdk/CMSIS/Core/Include/core_cm55.h index 03c1aa5..2f40d61 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/core_cm55.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/core_cm55.h @@ -1,11 +1,11 @@ /**************************************************************************//** * @file core_cm55.h * @brief CMSIS Cortex-M55 Core Peripheral Access Layer Header File - * @version V1.1.0 - * @date 15. April 2020 + * @version V1.2.5 + * @date 12. May 2022 ******************************************************************************/ /* - * Copyright (c) 2018-2020 Arm Limited. All rights reserved. + * Copyright (c) 2018-2022 Arm Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -58,7 +58,7 @@ * CMSIS definitions ******************************************************************************/ /** - \ingroup Cortex_CM55 + \ingroup Cortex_M55 @{ */ @@ -210,7 +210,7 @@ #define __FPU_PRESENT 0U #warning "__FPU_PRESENT not defined in device header file; using default!" #endif - + #if __FPU_PRESENT != 0U #ifndef __FPU_DP #define __FPU_DP 0U @@ -232,12 +232,12 @@ #define __DCACHE_PRESENT 0U #warning "__DCACHE_PRESENT not defined in device header file; using default!" #endif - + #ifndef __VTOR_PRESENT #define __VTOR_PRESENT 1U #warning "__VTOR_PRESENT not defined in device header file; using default!" #endif - + #ifndef __PMU_PRESENT #define __PMU_PRESENT 0U #warning "__PMU_PRESENT not defined in device header file; using default!" @@ -303,9 +303,11 @@ Core Register contain: - Core Register - Core NVIC Register + - Core EWIC Register - Core SCB Register - Core SysTick Register - Core Debug Register + - Core PMU Register - Core MPU Register - Core SAU Register - Core FPU Register @@ -526,7 +528,7 @@ typedef struct __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ - __IM uint32_t ID_ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t ID_AFR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ __IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ @@ -535,7 +537,10 @@ typedef struct __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */ - uint32_t RESERVED3[92U]; + uint32_t RESERVED7[21U]; + __IOM uint32_t SFSR; /*!< Offset: 0x0E4 (R/W) Secure Fault Status Register */ + __IOM uint32_t SFAR; /*!< Offset: 0x0E8 (R/W) Secure Fault Address Register */ + uint32_t RESERVED3[69U]; __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ __IOM uint32_t RFSR; /*!< Offset: 0x204 (R/W) RAS Fault Status Register */ uint32_t RESERVED4[14U]; @@ -766,22 +771,22 @@ typedef struct #define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ /* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ -#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Pos (SCB_CFSR_MEMFAULTSR_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ #define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ -#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ #define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ -#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ #define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ -#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ #define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ -#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ #define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ -#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ #define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ /* BusFault Status Register (part of SCB Configurable Fault Status Register) */ @@ -987,13 +992,13 @@ typedef struct /** \ingroup CMSIS_core_register - \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) - \brief Type definitions for the System Control and ID Register not in the SCB + \defgroup CMSIS_ICB Implementation Control Block register (ICB) + \brief Type definitions for the Implementation Control Block Register @{ */ /** - \brief Structure type to access the System Control and ID Register not in the SCB. + \brief Structure type to access the Implementation Control Block (ICB). */ typedef struct { @@ -1001,13 +1006,56 @@ typedef struct __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ __IOM uint32_t CPPWR; /*!< Offset: 0x00C (R/W) Coprocessor Power Control Register */ -} SCnSCB_Type; +} ICB_Type; + +/* Auxiliary Control Register Definitions */ +#define ICB_ACTLR_DISCRITAXIRUW_Pos 27U /*!< ACTLR: DISCRITAXIRUW Position */ +#define ICB_ACTLR_DISCRITAXIRUW_Msk (1UL << ICB_ACTLR_DISCRITAXIRUW_Pos) /*!< ACTLR: DISCRITAXIRUW Mask */ + +#define ICB_ACTLR_DISDI_Pos 16U /*!< ACTLR: DISDI Position */ +#define ICB_ACTLR_DISDI_Msk (3UL << ICB_ACTLR_DISDI_Pos) /*!< ACTLR: DISDI Mask */ + +#define ICB_ACTLR_DISCRITAXIRUR_Pos 15U /*!< ACTLR: DISCRITAXIRUR Position */ +#define ICB_ACTLR_DISCRITAXIRUR_Msk (1UL << ICB_ACTLR_DISCRITAXIRUR_Pos) /*!< ACTLR: DISCRITAXIRUR Mask */ + +#define ICB_ACTLR_EVENTBUSEN_Pos 14U /*!< ACTLR: EVENTBUSEN Position */ +#define ICB_ACTLR_EVENTBUSEN_Msk (1UL << ICB_ACTLR_EVENTBUSEN_Pos) /*!< ACTLR: EVENTBUSEN Mask */ + +#define ICB_ACTLR_EVENTBUSEN_S_Pos 13U /*!< ACTLR: EVENTBUSEN_S Position */ +#define ICB_ACTLR_EVENTBUSEN_S_Msk (1UL << ICB_ACTLR_EVENTBUSEN_S_Pos) /*!< ACTLR: EVENTBUSEN_S Mask */ + +#define ICB_ACTLR_DISITMATBFLUSH_Pos 12U /*!< ACTLR: DISITMATBFLUSH Position */ +#define ICB_ACTLR_DISITMATBFLUSH_Msk (1UL << ICB_ACTLR_DISITMATBFLUSH_Pos) /*!< ACTLR: DISITMATBFLUSH Mask */ + +#define ICB_ACTLR_DISNWAMODE_Pos 11U /*!< ACTLR: DISNWAMODE Position */ +#define ICB_ACTLR_DISNWAMODE_Msk (1UL << ICB_ACTLR_DISNWAMODE_Pos) /*!< ACTLR: DISNWAMODE Mask */ + +#define ICB_ACTLR_FPEXCODIS_Pos 10U /*!< ACTLR: FPEXCODIS Position */ +#define ICB_ACTLR_FPEXCODIS_Msk (1UL << ICB_ACTLR_FPEXCODIS_Pos) /*!< ACTLR: FPEXCODIS Mask */ + +#define ICB_ACTLR_DISOLAP_Pos 7U /*!< ACTLR: DISOLAP Position */ +#define ICB_ACTLR_DISOLAP_Msk (1UL << ICB_ACTLR_DISOLAP_Pos) /*!< ACTLR: DISOLAP Mask */ + +#define ICB_ACTLR_DISOLAPS_Pos 6U /*!< ACTLR: DISOLAPS Position */ +#define ICB_ACTLR_DISOLAPS_Msk (1UL << ICB_ACTLR_DISOLAPS_Pos) /*!< ACTLR: DISOLAPS Mask */ + +#define ICB_ACTLR_DISLOBR_Pos 5U /*!< ACTLR: DISLOBR Position */ +#define ICB_ACTLR_DISLOBR_Msk (1UL << ICB_ACTLR_DISLOBR_Pos) /*!< ACTLR: DISLOBR Mask */ + +#define ICB_ACTLR_DISLO_Pos 4U /*!< ACTLR: DISLO Position */ +#define ICB_ACTLR_DISLO_Msk (1UL << ICB_ACTLR_DISLO_Pos) /*!< ACTLR: DISLO Mask */ + +#define ICB_ACTLR_DISLOLEP_Pos 3U /*!< ACTLR: DISLOLEP Position */ +#define ICB_ACTLR_DISLOLEP_Msk (1UL << ICB_ACTLR_DISLOLEP_Pos) /*!< ACTLR: DISLOLEP Mask */ + +#define ICB_ACTLR_DISFOLD_Pos 2U /*!< ACTLR: DISFOLD Position */ +#define ICB_ACTLR_DISFOLD_Msk (1UL << ICB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */ /* Interrupt Controller Type Register Definitions */ -#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ -#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ +#define ICB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define ICB_ICTR_INTLINESNUM_Msk (0xFUL /*<< ICB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ -/*@} end of group CMSIS_SCnotSCB */ +/*@} end of group CMSIS_ICB */ /** @@ -1086,13 +1134,15 @@ typedef struct __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ uint32_t RESERVED2[15U]; __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ - uint32_t RESERVED3[32U]; - uint32_t RESERVED4[43U]; - __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ - __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED3[27U]; + __IM uint32_t ITREAD; /*!< Offset: 0xEF0 (R/ ) ITM Integration Read Register */ + uint32_t RESERVED4[1U]; + __OM uint32_t ITWRITE; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */ uint32_t RESERVED5[1U]; + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */ + uint32_t RESERVED6[46U]; __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) ITM Device Architecture Register */ - uint32_t RESERVED6[3U]; + uint32_t RESERVED7[3U]; __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) ITM Device Type Register */ __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ @@ -1150,15 +1200,23 @@ typedef struct #define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ #define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ -/* ITM Lock Status Register Definitions */ -#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ -#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ +/* ITM Integration Read Register Definitions */ +#define ITM_ITREAD_AFVALID_Pos 1U /*!< ITM ITREAD: AFVALID Position */ +#define ITM_ITREAD_AFVALID_Msk (0x1UL << ITM_ITREAD_AFVALID_Pos) /*!< ITM ITREAD: AFVALID Mask */ + +#define ITM_ITREAD_ATREADY_Pos 0U /*!< ITM ITREAD: ATREADY Position */ +#define ITM_ITREAD_ATREADY_Msk (0x1UL /*<< ITM_ITREAD_ATREADY_Pos*/) /*!< ITM ITREAD: ATREADY Mask */ + +/* ITM Integration Write Register Definitions */ +#define ITM_ITWRITE_AFVALID_Pos 1U /*!< ITM ITWRITE: AFVALID Position */ +#define ITM_ITWRITE_AFVALID_Msk (0x1UL << ITM_ITWRITE_AFVALID_Pos) /*!< ITM ITWRITE: AFVALID Mask */ -#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ -#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ +#define ITM_ITWRITE_ATREADY_Pos 0U /*!< ITM ITWRITE: ATREADY Position */ +#define ITM_ITWRITE_ATREADY_Msk (0x1UL /*<< ITM_ITWRITE_ATREADY_Pos*/) /*!< ITM ITWRITE: ATREADY Mask */ -#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ -#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ +/* ITM Integration Mode Control Register Definitions */ +#define ITM_ITCTRL_IME_Pos 0U /*!< ITM ITCTRL: IME Position */ +#define ITM_ITCTRL_IME_Msk (0x1UL /*<< ITM_ITCTRL_IME_Pos*/) /*!< ITM ITCTRL: IME Mask */ /*@}*/ /* end of group CMSIS_ITM */ @@ -1190,66 +1248,34 @@ typedef struct __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ uint32_t RESERVED3[1U]; __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ - uint32_t RESERVED4[1U]; + __IOM uint32_t VMASK1; /*!< Offset: 0x03C (R/W) Comparator Value Mask 1 */ __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ - uint32_t RESERVED5[1U]; + uint32_t RESERVED4[1U]; __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ - uint32_t RESERVED6[1U]; + uint32_t RESERVED5[1U]; __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ - uint32_t RESERVED7[1U]; + uint32_t RESERVED6[1U]; __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ - uint32_t RESERVED8[1U]; + __IOM uint32_t VMASK3; /*!< Offset: 0x05C (R/W) Comparator Value Mask 3 */ __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */ - uint32_t RESERVED9[1U]; + uint32_t RESERVED7[1U]; __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */ - uint32_t RESERVED10[1U]; + uint32_t RESERVED8[1U]; __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */ - uint32_t RESERVED11[1U]; + uint32_t RESERVED9[1U]; __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */ - uint32_t RESERVED12[1U]; + uint32_t RESERVED10[1U]; __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */ - uint32_t RESERVED13[1U]; + uint32_t RESERVED11[1U]; __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */ - uint32_t RESERVED14[1U]; + uint32_t RESERVED12[1U]; __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */ - uint32_t RESERVED15[1U]; + uint32_t RESERVED13[1U]; __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */ - uint32_t RESERVED16[1U]; - __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */ - uint32_t RESERVED17[1U]; - __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */ - uint32_t RESERVED18[1U]; - __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */ - uint32_t RESERVED19[1U]; - __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */ - uint32_t RESERVED20[1U]; - __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */ - uint32_t RESERVED21[1U]; - __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */ - uint32_t RESERVED22[1U]; - __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */ - uint32_t RESERVED23[1U]; - __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */ - uint32_t RESERVED24[1U]; - __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */ - uint32_t RESERVED25[1U]; - __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */ - uint32_t RESERVED26[1U]; - __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */ - uint32_t RESERVED27[1U]; - __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */ - uint32_t RESERVED28[1U]; - __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */ - uint32_t RESERVED29[1U]; - __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */ - uint32_t RESERVED30[1U]; - __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */ - uint32_t RESERVED31[1U]; - __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */ - uint32_t RESERVED32[934U]; - __IM uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */ - uint32_t RESERVED33[1U]; - __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) Device Architecture Register */ + uint32_t RESERVED14[968U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) Device Type Architecture Register */ + uint32_t RESERVED15[3U]; + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Identifier Register */ } DWT_Type; /* DWT Control Register Definitions */ @@ -1341,7 +1367,7 @@ typedef struct #define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ #define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */ -#define DWT_FUNCTION_ACTION_Msk (0x1UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */ +#define DWT_FUNCTION_ACTION_Msk (0x3UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */ #define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */ #define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */ @@ -1349,6 +1375,456 @@ typedef struct /*@}*/ /* end of group CMSIS_DWT */ +/** + \ingroup CMSIS_core_register + \defgroup MemSysCtl_Type Memory System Control Registers (IMPLEMENTATION DEFINED) + \brief Type definitions for the Memory System Control Registers (MEMSYSCTL) + @{ + */ + +/** + \brief Structure type to access the Memory System Control Registers (MEMSYSCTL). + */ +typedef struct +{ + __IOM uint32_t MSCR; /*!< Offset: 0x000 (R/W) Memory System Control Register */ + __IOM uint32_t PFCR; /*!< Offset: 0x004 (R/W) Prefetcher Control Register */ + uint32_t RESERVED1[2U]; + __IOM uint32_t ITCMCR; /*!< Offset: 0x010 (R/W) ITCM Control Register */ + __IOM uint32_t DTCMCR; /*!< Offset: 0x014 (R/W) DTCM Control Register */ + __IOM uint32_t PAHBCR; /*!< Offset: 0x018 (R/W) P-AHB Control Register */ + uint32_t RESERVED2[313U]; + __IOM uint32_t ITGU_CTRL; /*!< Offset: 0x500 (R/W) ITGU Control Register */ + __IOM uint32_t ITGU_CFG; /*!< Offset: 0x504 (R/W) ITGU Configuration Register */ + uint32_t RESERVED3[2U]; + __IOM uint32_t ITGU_LUT[16U]; /*!< Offset: 0x510 (R/W) ITGU Look Up Table Register */ + uint32_t RESERVED4[44U]; + __IOM uint32_t DTGU_CTRL; /*!< Offset: 0x600 (R/W) DTGU Control Registers */ + __IOM uint32_t DTGU_CFG; /*!< Offset: 0x604 (R/W) DTGU Configuration Register */ + uint32_t RESERVED5[2U]; + __IOM uint32_t DTGU_LUT[16U]; /*!< Offset: 0x610 (R/W) DTGU Look Up Table Register */ +} MemSysCtl_Type; + +/* MEMSYSCTL Memory System Control Register (MSCR) Register Definitions */ +#define MEMSYSCTL_MSCR_CPWRDN_Pos 17U /*!< MEMSYSCTL MSCR: CPWRDN Position */ +#define MEMSYSCTL_MSCR_CPWRDN_Msk (0x1UL << MEMSYSCTL_MSCR_CPWRDN_Pos) /*!< MEMSYSCTL MSCR: CPWRDN Mask */ + +#define MEMSYSCTL_MSCR_DCCLEAN_Pos 16U /*!< MEMSYSCTL MSCR: DCCLEAN Position */ +#define MEMSYSCTL_MSCR_DCCLEAN_Msk (0x1UL << MEMSYSCTL_MSCR_DCCLEAN_Pos) /*!< MEMSYSCTL MSCR: DCCLEAN Mask */ + +#define MEMSYSCTL_MSCR_ICACTIVE_Pos 13U /*!< MEMSYSCTL MSCR: ICACTIVE Position */ +#define MEMSYSCTL_MSCR_ICACTIVE_Msk (0x1UL << MEMSYSCTL_MSCR_ICACTIVE_Pos) /*!< MEMSYSCTL MSCR: ICACTIVE Mask */ + +#define MEMSYSCTL_MSCR_DCACTIVE_Pos 12U /*!< MEMSYSCTL MSCR: DCACTIVE Position */ +#define MEMSYSCTL_MSCR_DCACTIVE_Msk (0x1UL << MEMSYSCTL_MSCR_DCACTIVE_Pos) /*!< MEMSYSCTL MSCR: DCACTIVE Mask */ + +#define MEMSYSCTL_MSCR_TECCCHKDIS_Pos 4U /*!< MEMSYSCTL MSCR: TECCCHKDIS Position */ +#define MEMSYSCTL_MSCR_TECCCHKDIS_Msk (0x1UL << MEMSYSCTL_MSCR_TECCCHKDIS_Pos) /*!< MEMSYSCTL MSCR: TECCCHKDIS Mask */ + +#define MEMSYSCTL_MSCR_EVECCFAULT_Pos 3U /*!< MEMSYSCTL MSCR: EVECCFAULT Position */ +#define MEMSYSCTL_MSCR_EVECCFAULT_Msk (0x1UL << MEMSYSCTL_MSCR_EVECCFAULT_Pos) /*!< MEMSYSCTL MSCR: EVECCFAULT Mask */ + +#define MEMSYSCTL_MSCR_FORCEWT_Pos 2U /*!< MEMSYSCTL MSCR: FORCEWT Position */ +#define MEMSYSCTL_MSCR_FORCEWT_Msk (0x1UL << MEMSYSCTL_MSCR_FORCEWT_Pos) /*!< MEMSYSCTL MSCR: FORCEWT Mask */ + +#define MEMSYSCTL_MSCR_ECCEN_Pos 1U /*!< MEMSYSCTL MSCR: ECCEN Position */ +#define MEMSYSCTL_MSCR_ECCEN_Msk (0x1UL << MEMSYSCTL_MSCR_ECCEN_Pos) /*!< MEMSYSCTL MSCR: ECCEN Mask */ + +/* MEMSYSCTL Prefetcher Control Register (PFCR) Register Definitions */ +#define MEMSYSCTL_PFCR_MAX_OS_Pos 7U /*!< MEMSYSCTL PFCR: MAX_OS Position */ +#define MEMSYSCTL_PFCR_MAX_OS_Msk (0x7UL << MEMSYSCTL_PFCR_MAX_OS_Pos) /*!< MEMSYSCTL PFCR: MAX_OS Mask */ + +#define MEMSYSCTL_PFCR_MAX_LA_Pos 4U /*!< MEMSYSCTL PFCR: MAX_LA Position */ +#define MEMSYSCTL_PFCR_MAX_LA_Msk (0x7UL << MEMSYSCTL_PFCR_MAX_LA_Pos) /*!< MEMSYSCTL PFCR: MAX_LA Mask */ + +#define MEMSYSCTL_PFCR_MIN_LA_Pos 1U /*!< MEMSYSCTL PFCR: MIN_LA Position */ +#define MEMSYSCTL_PFCR_MIN_LA_Msk (0x7UL << MEMSYSCTL_PFCR_MIN_LA_Pos) /*!< MEMSYSCTL PFCR: MIN_LA Mask */ + +#define MEMSYSCTL_PFCR_ENABLE_Pos 0U /*!< MEMSYSCTL PFCR: ENABLE Position */ +#define MEMSYSCTL_PFCR_ENABLE_Msk (0x1UL /*<< MEMSYSCTL_PFCR_ENABLE_Pos*/) /*!< MEMSYSCTL PFCR: ENABLE Mask */ + +/* MEMSYSCTL ITCM Control Register (ITCMCR) Register Definitions */ +#define MEMSYSCTL_ITCMCR_SZ_Pos 3U /*!< MEMSYSCTL ITCMCR: SZ Position */ +#define MEMSYSCTL_ITCMCR_SZ_Msk (0xFUL << MEMSYSCTL_ITCMCR_SZ_Pos) /*!< MEMSYSCTL ITCMCR: SZ Mask */ + +#define MEMSYSCTL_ITCMCR_EN_Pos 0U /*!< MEMSYSCTL ITCMCR: EN Position */ +#define MEMSYSCTL_ITCMCR_EN_Msk (0x1UL /*<< MEMSYSCTL_ITCMCR_EN_Pos*/) /*!< MEMSYSCTL ITCMCR: EN Mask */ + +/* MEMSYSCTL DTCM Control Register (DTCMCR) Register Definitions */ +#define MEMSYSCTL_DTCMCR_SZ_Pos 3U /*!< MEMSYSCTL DTCMCR: SZ Position */ +#define MEMSYSCTL_DTCMCR_SZ_Msk (0xFUL << MEMSYSCTL_DTCMCR_SZ_Pos) /*!< MEMSYSCTL DTCMCR: SZ Mask */ + +#define MEMSYSCTL_DTCMCR_EN_Pos 0U /*!< MEMSYSCTL DTCMCR: EN Position */ +#define MEMSYSCTL_DTCMCR_EN_Msk (0x1UL /*<< MEMSYSCTL_DTCMCR_EN_Pos*/) /*!< MEMSYSCTL DTCMCR: EN Mask */ + +/* MEMSYSCTL P-AHB Control Register (PAHBCR) Register Definitions */ +#define MEMSYSCTL_PAHBCR_SZ_Pos 1U /*!< MEMSYSCTL PAHBCR: SZ Position */ +#define MEMSYSCTL_PAHBCR_SZ_Msk (0x7UL << MEMSYSCTL_PAHBCR_SZ_Pos) /*!< MEMSYSCTL PAHBCR: SZ Mask */ + +#define MEMSYSCTL_PAHBCR_EN_Pos 0U /*!< MEMSYSCTL PAHBCR: EN Position */ +#define MEMSYSCTL_PAHBCR_EN_Msk (0x1UL /*<< MEMSYSCTL_PAHBCR_EN_Pos*/) /*!< MEMSYSCTL PAHBCR: EN Mask */ + +/* MEMSYSCTL ITGU Control Register (ITGU_CTRL) Register Definitions */ +#define MEMSYSCTL_ITGU_CTRL_DEREN_Pos 1U /*!< MEMSYSCTL ITGU_CTRL: DEREN Position */ +#define MEMSYSCTL_ITGU_CTRL_DEREN_Msk (0x1UL << MEMSYSCTL_ITGU_CTRL_DEREN_Pos) /*!< MEMSYSCTL ITGU_CTRL: DEREN Mask */ + +#define MEMSYSCTL_ITGU_CTRL_DBFEN_Pos 0U /*!< MEMSYSCTL ITGU_CTRL: DBFEN Position */ +#define MEMSYSCTL_ITGU_CTRL_DBFEN_Msk (0x1UL /*<< MEMSYSCTL_ITGU_CTRL_DBFEN_Pos*/) /*!< MEMSYSCTL ITGU_CTRL: DBFEN Mask */ + +/* MEMSYSCTL ITGU Configuration Register (ITGU_CFG) Register Definitions */ +#define MEMSYSCTL_ITGU_CFG_PRESENT_Pos 31U /*!< MEMSYSCTL ITGU_CFG: PRESENT Position */ +#define MEMSYSCTL_ITGU_CFG_PRESENT_Msk (0x1UL << MEMSYSCTL_ITGU_CFG_PRESENT_Pos) /*!< MEMSYSCTL ITGU_CFG: PRESENT Mask */ + +#define MEMSYSCTL_ITGU_CFG_NUMBLKS_Pos 8U /*!< MEMSYSCTL ITGU_CFG: NUMBLKS Position */ +#define MEMSYSCTL_ITGU_CFG_NUMBLKS_Msk (0xFUL << MEMSYSCTL_ITGU_CFG_NUMBLKS_Pos) /*!< MEMSYSCTL ITGU_CFG: NUMBLKS Mask */ + +#define MEMSYSCTL_ITGU_CFG_BLKSZ_Pos 0U /*!< MEMSYSCTL ITGU_CFG: BLKSZ Position */ +#define MEMSYSCTL_ITGU_CFG_BLKSZ_Msk (0xFUL /*<< MEMSYSCTL_ITGU_CFG_BLKSZ_Pos*/) /*!< MEMSYSCTL ITGU_CFG: BLKSZ Mask */ + +/* MEMSYSCTL DTGU Control Registers (DTGU_CTRL) Register Definitions */ +#define MEMSYSCTL_DTGU_CTRL_DEREN_Pos 1U /*!< MEMSYSCTL DTGU_CTRL: DEREN Position */ +#define MEMSYSCTL_DTGU_CTRL_DEREN_Msk (0x1UL << MEMSYSCTL_DTGU_CTRL_DEREN_Pos) /*!< MEMSYSCTL DTGU_CTRL: DEREN Mask */ + +#define MEMSYSCTL_DTGU_CTRL_DBFEN_Pos 0U /*!< MEMSYSCTL DTGU_CTRL: DBFEN Position */ +#define MEMSYSCTL_DTGU_CTRL_DBFEN_Msk (0x1UL /*<< MEMSYSCTL_DTGU_CTRL_DBFEN_Pos*/) /*!< MEMSYSCTL DTGU_CTRL: DBFEN Mask */ + +/* MEMSYSCTL DTGU Configuration Register (DTGU_CFG) Register Definitions */ +#define MEMSYSCTL_DTGU_CFG_PRESENT_Pos 31U /*!< MEMSYSCTL DTGU_CFG: PRESENT Position */ +#define MEMSYSCTL_DTGU_CFG_PRESENT_Msk (0x1UL << MEMSYSCTL_DTGU_CFG_PRESENT_Pos) /*!< MEMSYSCTL DTGU_CFG: PRESENT Mask */ + +#define MEMSYSCTL_DTGU_CFG_NUMBLKS_Pos 8U /*!< MEMSYSCTL DTGU_CFG: NUMBLKS Position */ +#define MEMSYSCTL_DTGU_CFG_NUMBLKS_Msk (0xFUL << MEMSYSCTL_DTGU_CFG_NUMBLKS_Pos) /*!< MEMSYSCTL DTGU_CFG: NUMBLKS Mask */ + +#define MEMSYSCTL_DTGU_CFG_BLKSZ_Pos 0U /*!< MEMSYSCTL DTGU_CFG: BLKSZ Position */ +#define MEMSYSCTL_DTGU_CFG_BLKSZ_Msk (0xFUL /*<< MEMSYSCTL_DTGU_CFG_BLKSZ_Pos*/) /*!< MEMSYSCTL DTGU_CFG: BLKSZ Mask */ + + +/*@}*/ /* end of group MemSysCtl_Type */ + + +/** + \ingroup CMSIS_core_register + \defgroup PwrModCtl_Type Power Mode Control Registers + \brief Type definitions for the Power Mode Control Registers (PWRMODCTL) + @{ + */ + +/** + \brief Structure type to access the Power Mode Control Registers (PWRMODCTL). + */ +typedef struct +{ + __IOM uint32_t CPDLPSTATE; /*!< Offset: 0x000 (R/W) Core Power Domain Low Power State Register */ + __IOM uint32_t DPDLPSTATE; /*!< Offset: 0x004 (R/W) Debug Power Domain Low Power State Register */ +} PwrModCtl_Type; + +/* PWRMODCTL Core Power Domain Low Power State (CPDLPSTATE) Register Definitions */ +#define PWRMODCTL_CPDLPSTATE_RLPSTATE_Pos 8U /*!< PWRMODCTL CPDLPSTATE: RLPSTATE Position */ +#define PWRMODCTL_CPDLPSTATE_RLPSTATE_Msk (0x3UL << PWRMODCTL_CPDLPSTATE_RLPSTATE_Pos) /*!< PWRMODCTL CPDLPSTATE: RLPSTATE Mask */ + +#define PWRMODCTL_CPDLPSTATE_ELPSTATE_Pos 4U /*!< PWRMODCTL CPDLPSTATE: ELPSTATE Position */ +#define PWRMODCTL_CPDLPSTATE_ELPSTATE_Msk (0x3UL << PWRMODCTL_CPDLPSTATE_ELPSTATE_Pos) /*!< PWRMODCTL CPDLPSTATE: ELPSTATE Mask */ + +#define PWRMODCTL_CPDLPSTATE_CLPSTATE_Pos 0U /*!< PWRMODCTL CPDLPSTATE: CLPSTATE Position */ +#define PWRMODCTL_CPDLPSTATE_CLPSTATE_Msk (0x3UL /*<< PWRMODCTL_CPDLPSTATE_CLPSTATE_Pos*/) /*!< PWRMODCTL CPDLPSTATE: CLPSTATE Mask */ + +/* PWRMODCTL Debug Power Domain Low Power State (DPDLPSTATE) Register Definitions */ +#define PWRMODCTL_DPDLPSTATE_DLPSTATE_Pos 0U /*!< PWRMODCTL DPDLPSTATE: DLPSTATE Position */ +#define PWRMODCTL_DPDLPSTATE_DLPSTATE_Msk (0x3UL /*<< PWRMODCTL_DPDLPSTATE_DLPSTATE_Pos*/) /*!< PWRMODCTL DPDLPSTATE: DLPSTATE Mask */ + +/*@}*/ /* end of group PwrModCtl_Type */ + + +/** + \ingroup CMSIS_core_register + \defgroup EWIC_Type External Wakeup Interrupt Controller Registers + \brief Type definitions for the External Wakeup Interrupt Controller Registers (EWIC) + @{ + */ + +/** + \brief Structure type to access the External Wakeup Interrupt Controller Registers (EWIC). + */ +typedef struct +{ + __OM uint32_t EVENTSPR; /*!< Offset: 0x000 ( /W) Event Set Pending Register */ + uint32_t RESERVED0[31U]; + __IM uint32_t EVENTMASKA; /*!< Offset: 0x080 (R/W) Event Mask A Register */ + __IM uint32_t EVENTMASK[15]; /*!< Offset: 0x084 (R/W) Event Mask Register */ +} EWIC_Type; + +/* EWIC External Wakeup Interrupt Controller (EVENTSPR) Register Definitions */ +#define EWIC_EVENTSPR_EDBGREQ_Pos 2U /*!< EWIC EVENTSPR: EDBGREQ Position */ +#define EWIC_EVENTSPR_EDBGREQ_Msk (0x1UL << EWIC_EVENTSPR_EDBGREQ_Pos) /*!< EWIC EVENTSPR: EDBGREQ Mask */ + +#define EWIC_EVENTSPR_NMI_Pos 1U /*!< EWIC EVENTSPR: NMI Position */ +#define EWIC_EVENTSPR_NMI_Msk (0x1UL << EWIC_EVENTSPR_NMI_Pos) /*!< EWIC EVENTSPR: NMI Mask */ + +#define EWIC_EVENTSPR_EVENT_Pos 0U /*!< EWIC EVENTSPR: EVENT Position */ +#define EWIC_EVENTSPR_EVENT_Msk (0x1UL /*<< EWIC_EVENTSPR_EVENT_Pos*/) /*!< EWIC EVENTSPR: EVENT Mask */ + +/* EWIC External Wakeup Interrupt Controller (EVENTMASKA) Register Definitions */ +#define EWIC_EVENTMASKA_EDBGREQ_Pos 2U /*!< EWIC EVENTMASKA: EDBGREQ Position */ +#define EWIC_EVENTMASKA_EDBGREQ_Msk (0x1UL << EWIC_EVENTMASKA_EDBGREQ_Pos) /*!< EWIC EVENTMASKA: EDBGREQ Mask */ + +#define EWIC_EVENTMASKA_NMI_Pos 1U /*!< EWIC EVENTMASKA: NMI Position */ +#define EWIC_EVENTMASKA_NMI_Msk (0x1UL << EWIC_EVENTMASKA_NMI_Pos) /*!< EWIC EVENTMASKA: NMI Mask */ + +#define EWIC_EVENTMASKA_EVENT_Pos 0U /*!< EWIC EVENTMASKA: EVENT Position */ +#define EWIC_EVENTMASKA_EVENT_Msk (0x1UL /*<< EWIC_EVENTMASKA_EVENT_Pos*/) /*!< EWIC EVENTMASKA: EVENT Mask */ + +/* EWIC External Wakeup Interrupt Controller (EVENTMASK) Register Definitions */ +#define EWIC_EVENTMASK_IRQ_Pos 0U /*!< EWIC EVENTMASKA: IRQ Position */ +#define EWIC_EVENTMASK_IRQ_Msk (0xFFFFFFFFUL /*<< EWIC_EVENTMASKA_IRQ_Pos*/) /*!< EWIC EVENTMASKA: IRQ Mask */ + +/*@}*/ /* end of group EWIC_Type */ + + +/** + \ingroup CMSIS_core_register + \defgroup ErrBnk_Type Error Banking Registers (IMPLEMENTATION DEFINED) + \brief Type definitions for the Error Banking Registers (ERRBNK) + @{ + */ + +/** + \brief Structure type to access the Error Banking Registers (ERRBNK). + */ +typedef struct +{ + __IOM uint32_t IEBR0; /*!< Offset: 0x000 (R/W) Instruction Cache Error Bank Register 0 */ + __IOM uint32_t IEBR1; /*!< Offset: 0x004 (R/W) Instruction Cache Error Bank Register 1 */ + uint32_t RESERVED0[2U]; + __IOM uint32_t DEBR0; /*!< Offset: 0x010 (R/W) Data Cache Error Bank Register 0 */ + __IOM uint32_t DEBR1; /*!< Offset: 0x014 (R/W) Data Cache Error Bank Register 1 */ + uint32_t RESERVED1[2U]; + __IOM uint32_t TEBR0; /*!< Offset: 0x020 (R/W) TCM Error Bank Register 0 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t TEBR1; /*!< Offset: 0x028 (R/W) TCM Error Bank Register 1 */ +} ErrBnk_Type; + +/* ERRBNK Instruction Cache Error Bank Register 0 (IEBR0) Register Definitions */ +#define ERRBNK_IEBR0_SWDEF_Pos 30U /*!< ERRBNK IEBR0: SWDEF Position */ +#define ERRBNK_IEBR0_SWDEF_Msk (0x3UL << ERRBNK_IEBR0_SWDEF_Pos) /*!< ERRBNK IEBR0: SWDEF Mask */ + +#define ERRBNK_IEBR0_BANK_Pos 16U /*!< ERRBNK IEBR0: BANK Position */ +#define ERRBNK_IEBR0_BANK_Msk (0x1UL << ERRBNK_IEBR0_BANK_Pos) /*!< ERRBNK IEBR0: BANK Mask */ + +#define ERRBNK_IEBR0_LOCATION_Pos 2U /*!< ERRBNK IEBR0: LOCATION Position */ +#define ERRBNK_IEBR0_LOCATION_Msk (0x3FFFUL << ERRBNK_IEBR0_LOCATION_Pos) /*!< ERRBNK IEBR0: LOCATION Mask */ + +#define ERRBNK_IEBR0_LOCKED_Pos 1U /*!< ERRBNK IEBR0: LOCKED Position */ +#define ERRBNK_IEBR0_LOCKED_Msk (0x1UL << ERRBNK_IEBR0_LOCKED_Pos) /*!< ERRBNK IEBR0: LOCKED Mask */ + +#define ERRBNK_IEBR0_VALID_Pos 0U /*!< ERRBNK IEBR0: VALID Position */ +#define ERRBNK_IEBR0_VALID_Msk (0x1UL << /*ERRBNK_IEBR0_VALID_Pos*/) /*!< ERRBNK IEBR0: VALID Mask */ + +/* ERRBNK Instruction Cache Error Bank Register 1 (IEBR1) Register Definitions */ +#define ERRBNK_IEBR1_SWDEF_Pos 30U /*!< ERRBNK IEBR1: SWDEF Position */ +#define ERRBNK_IEBR1_SWDEF_Msk (0x3UL << ERRBNK_IEBR1_SWDEF_Pos) /*!< ERRBNK IEBR1: SWDEF Mask */ + +#define ERRBNK_IEBR1_BANK_Pos 16U /*!< ERRBNK IEBR1: BANK Position */ +#define ERRBNK_IEBR1_BANK_Msk (0x1UL << ERRBNK_IEBR1_BANK_Pos) /*!< ERRBNK IEBR1: BANK Mask */ + +#define ERRBNK_IEBR1_LOCATION_Pos 2U /*!< ERRBNK IEBR1: LOCATION Position */ +#define ERRBNK_IEBR1_LOCATION_Msk (0x3FFFUL << ERRBNK_IEBR1_LOCATION_Pos) /*!< ERRBNK IEBR1: LOCATION Mask */ + +#define ERRBNK_IEBR1_LOCKED_Pos 1U /*!< ERRBNK IEBR1: LOCKED Position */ +#define ERRBNK_IEBR1_LOCKED_Msk (0x1UL << ERRBNK_IEBR1_LOCKED_Pos) /*!< ERRBNK IEBR1: LOCKED Mask */ + +#define ERRBNK_IEBR1_VALID_Pos 0U /*!< ERRBNK IEBR1: VALID Position */ +#define ERRBNK_IEBR1_VALID_Msk (0x1UL << /*ERRBNK_IEBR1_VALID_Pos*/) /*!< ERRBNK IEBR1: VALID Mask */ + +/* ERRBNK Data Cache Error Bank Register 0 (DEBR0) Register Definitions */ +#define ERRBNK_DEBR0_SWDEF_Pos 30U /*!< ERRBNK DEBR0: SWDEF Position */ +#define ERRBNK_DEBR0_SWDEF_Msk (0x3UL << ERRBNK_DEBR0_SWDEF_Pos) /*!< ERRBNK DEBR0: SWDEF Mask */ + +#define ERRBNK_DEBR0_TYPE_Pos 17U /*!< ERRBNK DEBR0: TYPE Position */ +#define ERRBNK_DEBR0_TYPE_Msk (0x1UL << ERRBNK_DEBR0_TYPE_Pos) /*!< ERRBNK DEBR0: TYPE Mask */ + +#define ERRBNK_DEBR0_BANK_Pos 16U /*!< ERRBNK DEBR0: BANK Position */ +#define ERRBNK_DEBR0_BANK_Msk (0x1UL << ERRBNK_DEBR0_BANK_Pos) /*!< ERRBNK DEBR0: BANK Mask */ + +#define ERRBNK_DEBR0_LOCATION_Pos 2U /*!< ERRBNK DEBR0: LOCATION Position */ +#define ERRBNK_DEBR0_LOCATION_Msk (0x3FFFUL << ERRBNK_DEBR0_LOCATION_Pos) /*!< ERRBNK DEBR0: LOCATION Mask */ + +#define ERRBNK_DEBR0_LOCKED_Pos 1U /*!< ERRBNK DEBR0: LOCKED Position */ +#define ERRBNK_DEBR0_LOCKED_Msk (0x1UL << ERRBNK_DEBR0_LOCKED_Pos) /*!< ERRBNK DEBR0: LOCKED Mask */ + +#define ERRBNK_DEBR0_VALID_Pos 0U /*!< ERRBNK DEBR0: VALID Position */ +#define ERRBNK_DEBR0_VALID_Msk (0x1UL << /*ERRBNK_DEBR0_VALID_Pos*/) /*!< ERRBNK DEBR0: VALID Mask */ + +/* ERRBNK Data Cache Error Bank Register 1 (DEBR1) Register Definitions */ +#define ERRBNK_DEBR1_SWDEF_Pos 30U /*!< ERRBNK DEBR1: SWDEF Position */ +#define ERRBNK_DEBR1_SWDEF_Msk (0x3UL << ERRBNK_DEBR1_SWDEF_Pos) /*!< ERRBNK DEBR1: SWDEF Mask */ + +#define ERRBNK_DEBR1_TYPE_Pos 17U /*!< ERRBNK DEBR1: TYPE Position */ +#define ERRBNK_DEBR1_TYPE_Msk (0x1UL << ERRBNK_DEBR1_TYPE_Pos) /*!< ERRBNK DEBR1: TYPE Mask */ + +#define ERRBNK_DEBR1_BANK_Pos 16U /*!< ERRBNK DEBR1: BANK Position */ +#define ERRBNK_DEBR1_BANK_Msk (0x1UL << ERRBNK_DEBR1_BANK_Pos) /*!< ERRBNK DEBR1: BANK Mask */ + +#define ERRBNK_DEBR1_LOCATION_Pos 2U /*!< ERRBNK DEBR1: LOCATION Position */ +#define ERRBNK_DEBR1_LOCATION_Msk (0x3FFFUL << ERRBNK_DEBR1_LOCATION_Pos) /*!< ERRBNK DEBR1: LOCATION Mask */ + +#define ERRBNK_DEBR1_LOCKED_Pos 1U /*!< ERRBNK DEBR1: LOCKED Position */ +#define ERRBNK_DEBR1_LOCKED_Msk (0x1UL << ERRBNK_DEBR1_LOCKED_Pos) /*!< ERRBNK DEBR1: LOCKED Mask */ + +#define ERRBNK_DEBR1_VALID_Pos 0U /*!< ERRBNK DEBR1: VALID Position */ +#define ERRBNK_DEBR1_VALID_Msk (0x1UL << /*ERRBNK_DEBR1_VALID_Pos*/) /*!< ERRBNK DEBR1: VALID Mask */ + +/* ERRBNK TCM Error Bank Register 0 (TEBR0) Register Definitions */ +#define ERRBNK_TEBR0_SWDEF_Pos 30U /*!< ERRBNK TEBR0: SWDEF Position */ +#define ERRBNK_TEBR0_SWDEF_Msk (0x3UL << ERRBNK_TEBR0_SWDEF_Pos) /*!< ERRBNK TEBR0: SWDEF Mask */ + +#define ERRBNK_TEBR0_POISON_Pos 28U /*!< ERRBNK TEBR0: POISON Position */ +#define ERRBNK_TEBR0_POISON_Msk (0x1UL << ERRBNK_TEBR0_POISON_Pos) /*!< ERRBNK TEBR0: POISON Mask */ + +#define ERRBNK_TEBR0_TYPE_Pos 27U /*!< ERRBNK TEBR0: TYPE Position */ +#define ERRBNK_TEBR0_TYPE_Msk (0x1UL << ERRBNK_TEBR0_TYPE_Pos) /*!< ERRBNK TEBR0: TYPE Mask */ + +#define ERRBNK_TEBR0_BANK_Pos 24U /*!< ERRBNK TEBR0: BANK Position */ +#define ERRBNK_TEBR0_BANK_Msk (0x3UL << ERRBNK_TEBR0_BANK_Pos) /*!< ERRBNK TEBR0: BANK Mask */ + +#define ERRBNK_TEBR0_LOCATION_Pos 2U /*!< ERRBNK TEBR0: LOCATION Position */ +#define ERRBNK_TEBR0_LOCATION_Msk (0x3FFFFFUL << ERRBNK_TEBR0_LOCATION_Pos) /*!< ERRBNK TEBR0: LOCATION Mask */ + +#define ERRBNK_TEBR0_LOCKED_Pos 1U /*!< ERRBNK TEBR0: LOCKED Position */ +#define ERRBNK_TEBR0_LOCKED_Msk (0x1UL << ERRBNK_TEBR0_LOCKED_Pos) /*!< ERRBNK TEBR0: LOCKED Mask */ + +#define ERRBNK_TEBR0_VALID_Pos 0U /*!< ERRBNK TEBR0: VALID Position */ +#define ERRBNK_TEBR0_VALID_Msk (0x1UL << /*ERRBNK_TEBR0_VALID_Pos*/) /*!< ERRBNK TEBR0: VALID Mask */ + +/* ERRBNK TCM Error Bank Register 1 (TEBR1) Register Definitions */ +#define ERRBNK_TEBR1_SWDEF_Pos 30U /*!< ERRBNK TEBR1: SWDEF Position */ +#define ERRBNK_TEBR1_SWDEF_Msk (0x3UL << ERRBNK_TEBR1_SWDEF_Pos) /*!< ERRBNK TEBR1: SWDEF Mask */ + +#define ERRBNK_TEBR1_POISON_Pos 28U /*!< ERRBNK TEBR1: POISON Position */ +#define ERRBNK_TEBR1_POISON_Msk (0x1UL << ERRBNK_TEBR1_POISON_Pos) /*!< ERRBNK TEBR1: POISON Mask */ + +#define ERRBNK_TEBR1_TYPE_Pos 27U /*!< ERRBNK TEBR1: TYPE Position */ +#define ERRBNK_TEBR1_TYPE_Msk (0x1UL << ERRBNK_TEBR1_TYPE_Pos) /*!< ERRBNK TEBR1: TYPE Mask */ + +#define ERRBNK_TEBR1_BANK_Pos 24U /*!< ERRBNK TEBR1: BANK Position */ +#define ERRBNK_TEBR1_BANK_Msk (0x3UL << ERRBNK_TEBR1_BANK_Pos) /*!< ERRBNK TEBR1: BANK Mask */ + +#define ERRBNK_TEBR1_LOCATION_Pos 2U /*!< ERRBNK TEBR1: LOCATION Position */ +#define ERRBNK_TEBR1_LOCATION_Msk (0x3FFFFFUL << ERRBNK_TEBR1_LOCATION_Pos) /*!< ERRBNK TEBR1: LOCATION Mask */ + +#define ERRBNK_TEBR1_LOCKED_Pos 1U /*!< ERRBNK TEBR1: LOCKED Position */ +#define ERRBNK_TEBR1_LOCKED_Msk (0x1UL << ERRBNK_TEBR1_LOCKED_Pos) /*!< ERRBNK TEBR1: LOCKED Mask */ + +#define ERRBNK_TEBR1_VALID_Pos 0U /*!< ERRBNK TEBR1: VALID Position */ +#define ERRBNK_TEBR1_VALID_Msk (0x1UL << /*ERRBNK_TEBR1_VALID_Pos*/) /*!< ERRBNK TEBR1: VALID Mask */ + +/*@}*/ /* end of group ErrBnk_Type */ + + +/** + \ingroup CMSIS_core_register + \defgroup PrcCfgInf_Type Processor Configuration Information Registers (IMPLEMENTATION DEFINED) + \brief Type definitions for the Processor Configuration Information Registerss (PRCCFGINF) + @{ + */ + +/** + \brief Structure type to access the Processor Configuration Information Registerss (PRCCFGINF). + */ +typedef struct +{ + __OM uint32_t CFGINFOSEL; /*!< Offset: 0x000 ( /W) Processor Configuration Information Selection Register */ + __IM uint32_t CFGINFORD; /*!< Offset: 0x004 (R/ ) Processor Configuration Information Read Data Register */ +} PrcCfgInf_Type; + +/* PRCCFGINF Processor Configuration Information Selection Register (CFGINFOSEL) Definitions */ + +/* PRCCFGINF Processor Configuration Information Read Data Register (CFGINFORD) Definitions */ + +/*@}*/ /* end of group PrcCfgInf_Type */ + + +/** + \ingroup CMSIS_core_register + \defgroup STL_Type Software Test Library Observation Registers + \brief Type definitions for the Software Test Library Observation Registerss (STL) + @{ + */ + +/** + \brief Structure type to access the Software Test Library Observation Registerss (STL). + */ +typedef struct +{ + __IM uint32_t STLNVICPENDOR; /*!< Offset: 0x000 (R/ ) NVIC Pending Priority Tree Register */ + __IM uint32_t STLNVICACTVOR; /*!< Offset: 0x004 (R/ ) NVIC Active Priority Tree Register */ + uint32_t RESERVED0[2U]; + __OM uint32_t STLIDMPUSR; /*!< Offset: 0x010 ( /W) MPU Sanple Register */ + __IM uint32_t STLIMPUOR; /*!< Offset: 0x014 (R/ ) MPU Region Hit Register */ + __IM uint32_t STLD0MPUOR; /*!< Offset: 0x018 (R/ ) MPU Memory Attributes Register 0 */ + __IM uint32_t STLD1MPUOR; /*!< Offset: 0x01C (R/ ) MPU Memory Attributes Register 1 */ + +} STL_Type; + +/* STL Software Test Library Observation Register (STLNVICPENDOR) Definitions */ +#define STL_STLNVICPENDOR_VALID_Pos 18U /*!< STL STLNVICPENDOR: VALID Position */ +#define STL_STLNVICPENDOR_VALID_Msk (0x1UL << STL_STLNVICPENDOR_VALID_Pos) /*!< STL STLNVICPENDOR: VALID Mask */ + +#define STL_STLNVICPENDOR_TARGET_Pos 17U /*!< STL STLNVICPENDOR: TARGET Position */ +#define STL_STLNVICPENDOR_TARGET_Msk (0x1UL << STL_STLNVICPENDOR_TARGET_Pos) /*!< STL STLNVICPENDOR: TARGET Mask */ + +#define STL_STLNVICPENDOR_PRIORITY_Pos 9U /*!< STL STLNVICPENDOR: PRIORITY Position */ +#define STL_STLNVICPENDOR_PRIORITY_Msk (0xFFUL << STL_STLNVICPENDOR_PRIORITY_Pos) /*!< STL STLNVICPENDOR: PRIORITY Mask */ + +#define STL_STLNVICPENDOR_INTNUM_Pos 0U /*!< STL STLNVICPENDOR: INTNUM Position */ +#define STL_STLNVICPENDOR_INTNUM_Msk (0x1FFUL /*<< STL_STLNVICPENDOR_INTNUM_Pos*/) /*!< STL STLNVICPENDOR: INTNUM Mask */ + +/* STL Software Test Library Observation Register (STLNVICACTVOR) Definitions */ +#define STL_STLNVICACTVOR_VALID_Pos 18U /*!< STL STLNVICACTVOR: VALID Position */ +#define STL_STLNVICACTVOR_VALID_Msk (0x1UL << STL_STLNVICACTVOR_VALID_Pos) /*!< STL STLNVICACTVOR: VALID Mask */ + +#define STL_STLNVICACTVOR_TARGET_Pos 17U /*!< STL STLNVICACTVOR: TARGET Position */ +#define STL_STLNVICACTVOR_TARGET_Msk (0x1UL << STL_STLNVICACTVOR_TARGET_Pos) /*!< STL STLNVICACTVOR: TARGET Mask */ + +#define STL_STLNVICACTVOR_PRIORITY_Pos 9U /*!< STL STLNVICACTVOR: PRIORITY Position */ +#define STL_STLNVICACTVOR_PRIORITY_Msk (0xFFUL << STL_STLNVICACTVOR_PRIORITY_Pos) /*!< STL STLNVICACTVOR: PRIORITY Mask */ + +#define STL_STLNVICACTVOR_INTNUM_Pos 0U /*!< STL STLNVICACTVOR: INTNUM Position */ +#define STL_STLNVICACTVOR_INTNUM_Msk (0x1FFUL /*<< STL_STLNVICACTVOR_INTNUM_Pos*/) /*!< STL STLNVICACTVOR: INTNUM Mask */ + +/* STL Software Test Library Observation Register (STLIDMPUSR) Definitions */ +#define STL_STLIDMPUSR_ADDR_Pos 5U /*!< STL STLIDMPUSR: ADDR Position */ +#define STL_STLIDMPUSR_ADDR_Msk (0x7FFFFFFUL << STL_STLIDMPUSR_ADDR_Pos) /*!< STL STLIDMPUSR: ADDR Mask */ + +#define STL_STLIDMPUSR_INSTR_Pos 2U /*!< STL STLIDMPUSR: INSTR Position */ +#define STL_STLIDMPUSR_INSTR_Msk (0x1UL << STL_STLIDMPUSR_INSTR_Pos) /*!< STL STLIDMPUSR: INSTR Mask */ + +#define STL_STLIDMPUSR_DATA_Pos 1U /*!< STL STLIDMPUSR: DATA Position */ +#define STL_STLIDMPUSR_DATA_Msk (0x1UL << STL_STLIDMPUSR_DATA_Pos) /*!< STL STLIDMPUSR: DATA Mask */ + +/* STL Software Test Library Observation Register (STLIMPUOR) Definitions */ +#define STL_STLIMPUOR_HITREGION_Pos 9U /*!< STL STLIMPUOR: HITREGION Position */ +#define STL_STLIMPUOR_HITREGION_Msk (0xFFUL << STL_STLIMPUOR_HITREGION_Pos) /*!< STL STLIMPUOR: HITREGION Mask */ + +#define STL_STLIMPUOR_ATTR_Pos 0U /*!< STL STLIMPUOR: ATTR Position */ +#define STL_STLIMPUOR_ATTR_Msk (0x1FFUL /*<< STL_STLIMPUOR_ATTR_Pos*/) /*!< STL STLIMPUOR: ATTR Mask */ + +/* STL Software Test Library Observation Register (STLD0MPUOR) Definitions */ +#define STL_STLD0MPUOR_HITREGION_Pos 9U /*!< STL STLD0MPUOR: HITREGION Position */ +#define STL_STLD0MPUOR_HITREGION_Msk (0xFFUL << STL_STLD0MPUOR_HITREGION_Pos) /*!< STL STLD0MPUOR: HITREGION Mask */ + +#define STL_STLD0MPUOR_ATTR_Pos 0U /*!< STL STLD0MPUOR: ATTR Position */ +#define STL_STLD0MPUOR_ATTR_Msk (0x1FFUL /*<< STL_STLD0MPUOR_ATTR_Pos*/) /*!< STL STLD0MPUOR: ATTR Mask */ + +/* STL Software Test Library Observation Register (STLD1MPUOR) Definitions */ +#define STL_STLD1MPUOR_HITREGION_Pos 9U /*!< STL STLD1MPUOR: HITREGION Position */ +#define STL_STLD1MPUOR_HITREGION_Msk (0xFFUL << STL_STLD1MPUOR_HITREGION_Pos) /*!< STL STLD1MPUOR: HITREGION Mask */ + +#define STL_STLD1MPUOR_ATTR_Pos 0U /*!< STL STLD1MPUOR: ATTR Position */ +#define STL_STLD1MPUOR_ATTR_Msk (0x1FFUL /*<< STL_STLD1MPUOR_ATTR_Pos*/) /*!< STL STLD1MPUOR: ATTR Mask */ + +/*@}*/ /* end of group STL_Type */ + + /** \ingroup CMSIS_core_register \defgroup CMSIS_TPI Trace Port Interface (TPI) @@ -1490,15 +1966,14 @@ typedef struct uint32_t RESERVED11[108]; __IOM uint32_t AUTHSTATUS; /*!< Offset: 0xFB8 (R/W) PMU Authentication Status Register */ __IOM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/W) PMU Device Architecture Register */ - uint32_t RESERVED12[4]; + uint32_t RESERVED12[3]; __IOM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/W) PMU Device Type Register */ __IOM uint32_t PIDR4; /*!< Offset: 0xFD0 (R/W) PMU Peripheral Identification Register 4 */ uint32_t RESERVED13[3]; __IOM uint32_t PIDR0; /*!< Offset: 0xFE0 (R/W) PMU Peripheral Identification Register 0 */ - __IOM uint32_t PIDR1; /*!< Offset: 0xFE0 (R/W) PMU Peripheral Identification Register 1 */ - __IOM uint32_t PIDR2; /*!< Offset: 0xFE0 (R/W) PMU Peripheral Identification Register 2 */ - __IOM uint32_t PIDR3; /*!< Offset: 0xFE0 (R/W) PMU Peripheral Identification Register 3 */ - uint32_t RESERVED14[3]; + __IOM uint32_t PIDR1; /*!< Offset: 0xFE4 (R/W) PMU Peripheral Identification Register 1 */ + __IOM uint32_t PIDR2; /*!< Offset: 0xFE8 (R/W) PMU Peripheral Identification Register 2 */ + __IOM uint32_t PIDR3; /*!< Offset: 0xFEC (R/W) PMU Peripheral Identification Register 3 */ __IOM uint32_t CIDR0; /*!< Offset: 0xFF0 (R/W) PMU Component Identification Register 0 */ __IOM uint32_t CIDR1; /*!< Offset: 0xFF4 (R/W) PMU Component Identification Register 1 */ __IOM uint32_t CIDR2; /*!< Offset: 0xFF8 (R/W) PMU Component Identification Register 2 */ @@ -2983,27 +3458,13 @@ typedef struct */ typedef struct { - __OM uint32_t DLAR; /*!< Offset: 0x000 ( /W) SCS Software Lock Access Register */ - __IM uint32_t DLSR; /*!< Offset: 0x004 (R/ ) SCS Software Lock Status Register */ + uint32_t RESERVED0[2U]; __IM uint32_t DAUTHSTATUS; /*!< Offset: 0x008 (R/ ) Debug Authentication Status Register */ __IM uint32_t DDEVARCH; /*!< Offset: 0x00C (R/ ) SCS Device Architecture Register */ - __IM uint32_t DDEVTYPE; /*!< Offset: 0x010 (R/ ) SCS Device Type Register */ + uint32_t RESERVED1[3U]; + __IM uint32_t DDEVTYPE; /*!< Offset: 0x01C (R/ ) SCS Device Type Register */ } DIB_Type; -/* DLAR, SCS Software Lock Access Register Definitions */ -#define DIB_DLAR_KEY_Pos 0U /*!< DIB DLAR: KEY Position */ -#define DIB_DLAR_KEY_Msk (0xFFFFFFFFUL /*<< DIB_DLAR_KEY_Pos */) /*!< DIB DLAR: KEY Mask */ - -/* DLSR, SCS Software Lock Status Register Definitions */ -#define DIB_DLSR_nTT_Pos 2U /*!< DIB DLSR: Not thirty-two bit Position */ -#define DIB_DLSR_nTT_Msk (0x1UL << DIB_DLSR_nTT_Pos ) /*!< DIB DLSR: Not thirty-two bit Mask */ - -#define DIB_DLSR_SLK_Pos 1U /*!< DIB DLSR: Software Lock status Position */ -#define DIB_DLSR_SLK_Msk (0x1UL << DIB_DLSR_SLK_Pos ) /*!< DIB DLSR: Software Lock status Mask */ - -#define DIB_DLSR_SLI_Pos 0U /*!< DIB DLSR: Software Lock implemented Position */ -#define DIB_DLSR_SLI_Msk (0x1UL /*<< DIB_DLSR_SLI_Pos*/) /*!< DIB DLSR: Software Lock implemented Mask */ - /* DAUTHSTATUS, Debug Authentication Status Register Definitions */ #define DIB_DAUTHSTATUS_SUNID_Pos 22U /*!< DIB DAUTHSTATUS: Secure Unprivileged Non-invasive Debug Allowed Position */ #define DIB_DAUTHSTATUS_SUNID_Msk (0x3UL << DIB_DAUTHSTATUS_SUNID_Pos ) /*!< DIB DAUTHSTATUS: Secure Unprivileged Non-invasive Debug Allowed Mask */ @@ -3093,6 +3554,12 @@ typedef struct #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ #define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ + #define MEMSYSCTL_BASE (0xE001E000UL) /*!< Memory System Control Base Address */ + #define ERRBNK_BASE (0xE001E100UL) /*!< Error Banking Base Address */ + #define PWRMODCTL_BASE (0xE001E300UL) /*!< Power Mode Control Base Address */ + #define EWIC_BASE (0xE001E400UL) /*!< External Wakeup Interrupt Controller Base Address */ + #define PRCCFGINF_BASE (0xE001E700UL) /*!< Processor Configuration Information Base Address */ + #define STL_BASE (0xE001E800UL) /*!< Software Test Library Base Address */ #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ #define CoreDebug_BASE (0xE000EDF0UL) /*!< \deprecated Core Debug Base Address */ #define DCB_BASE (0xE000EDF0UL) /*!< DCB Base Address */ @@ -3101,13 +3568,19 @@ typedef struct #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ - #define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ + #define ICB ((ICB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ #define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ #define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ + #define MEMSYSCTL ((MemSysCtl_Type *) MEMSYSCTL_BASE ) /*!< Memory System Control configuration struct */ + #define ERRBNK ((ErrBnk_Type *) ERRBNK_BASE ) /*!< Error Banking configuration struct */ + #define PWRMODCTL ((PwrModCtl_Type *) PWRMODCTL_BASE ) /*!< Power Mode Control configuration struct */ + #define EWIC ((EWIC_Type *) EWIC_BASE ) /*!< EWIC configuration struct */ + #define PRCCFGINF ((PrcCfgInf_Type *) PRCCFGINF_BASE ) /*!< Processor Configuration Information configuration struct */ + #define STL ((STL_Type *) STL_BASE ) /*!< Software Test Library configuration struct */ #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE ) /*!< \deprecated Core Debug configuration struct */ #define DCB ((DCB_Type *) DCB_BASE ) /*!< DCB configuration struct */ #define DIB ((DIB_Type *) DIB_BASE ) /*!< DIB configuration struct */ @@ -3139,7 +3612,7 @@ typedef struct #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */ #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */ - #define SCnSCB_NS ((SCnSCB_Type *) SCS_BASE_NS ) /*!< System control Register not in SCB(non-secure address space) */ + #define ICB_NS ((ICB_Type *) SCS_BASE_NS ) /*!< System control Register not in SCB(non-secure address space) */ #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */ #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */ #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */ @@ -3159,6 +3632,69 @@ typedef struct /*@} */ +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_register_aliases Backwards Compatibility Aliases + \brief Register alias definitions for backwards compatibility. + @{ + */ +#define ID_ADR (ID_AFR) /*!< SCB Auxiliary Feature Register */ + +/* 'SCnSCB' is deprecated and replaced by 'ICB' */ +typedef ICB_Type SCnSCB_Type; + +/* Auxiliary Control Register Definitions */ +#define SCnSCB_ACTLR_DISCRITAXIRUW_Pos (ICB_ACTLR_DISCRITAXIRUW_Pos) +#define SCnSCB_ACTLR_DISCRITAXIRUW_Msk (ICB_ACTLR_DISCRITAXIRUW_Msk) + +#define SCnSCB_ACTLR_DISDI_Pos (ICB_ACTLR_DISDI_Pos) +#define SCnSCB_ACTLR_DISDI_Msk (ICB_ACTLR_DISDI_Msk) + +#define SCnSCB_ACTLR_DISCRITAXIRUR_Pos (ICB_ACTLR_DISCRITAXIRUR_Pos) +#define SCnSCB_ACTLR_DISCRITAXIRUR_Msk (ICB_ACTLR_DISCRITAXIRUR_Msk) + +#define SCnSCB_ACTLR_EVENTBUSEN_Pos (ICB_ACTLR_EVENTBUSEN_Pos) +#define SCnSCB_ACTLR_EVENTBUSEN_Msk (ICB_ACTLR_EVENTBUSEN_Msk) + +#define SCnSCB_ACTLR_EVENTBUSEN_S_Pos (ICB_ACTLR_EVENTBUSEN_S_Pos) +#define SCnSCB_ACTLR_EVENTBUSEN_S_Msk (ICB_ACTLR_EVENTBUSEN_S_Msk) + +#define SCnSCB_ACTLR_DISITMATBFLUSH_Pos (ICB_ACTLR_DISITMATBFLUSH_Pos) +#define SCnSCB_ACTLR_DISITMATBFLUSH_Msk (ICB_ACTLR_DISITMATBFLUSH_Msk) + +#define SCnSCB_ACTLR_DISNWAMODE_Pos (ICB_ACTLR_DISNWAMODE_Pos) +#define SCnSCB_ACTLR_DISNWAMODE_Msk (ICB_ACTLR_DISNWAMODE_Msk) + +#define SCnSCB_ACTLR_FPEXCODIS_Pos (ICB_ACTLR_FPEXCODIS_Pos) +#define SCnSCB_ACTLR_FPEXCODIS_Msk (ICB_ACTLR_FPEXCODIS_Msk) + +#define SCnSCB_ACTLR_DISOLAP_Pos (ICB_ACTLR_DISOLAP_Pos) +#define SCnSCB_ACTLR_DISOLAP_Msk (ICB_ACTLR_DISOLAP_Msk) + +#define SCnSCB_ACTLR_DISOLAPS_Pos (ICB_ACTLR_DISOLAPS_Pos) +#define SCnSCB_ACTLR_DISOLAPS_Msk (ICB_ACTLR_DISOLAPS_Msk) + +#define SCnSCB_ACTLR_DISLOBR_Pos (ICB_ACTLR_DISLOBR_Pos) +#define SCnSCB_ACTLR_DISLOBR_Msk (ICB_ACTLR_DISLOBR_Msk) + +#define SCnSCB_ACTLR_DISLO_Pos (ICB_ACTLR_DISLO_Pos) +#define SCnSCB_ACTLR_DISLO_Msk (ICB_ACTLR_DISLO_Msk) + +#define SCnSCB_ACTLR_DISLOLEP_Pos (ICB_ACTLR_DISLOLEP_Pos) +#define SCnSCB_ACTLR_DISLOLEP_Msk (ICB_ACTLR_DISLOLEP_Msk) + +#define SCnSCB_ACTLR_DISFOLD_Pos (ICB_ACTLR_DISFOLD_Pos) +#define SCnSCB_ACTLR_DISFOLD_Msk (ICB_ACTLR_DISFOLD_Msk) + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos (ICB_ICTR_INTLINESNUM_Pos) +#define SCnSCB_ICTR_INTLINESNUM_Msk (ICB_ICTR_INTLINESNUM_Msk) + +#define SCnSCB (ICB) +#define SCnSCB_NS (ICB_NS) + +/*@} */ + /******************************************************************************* * Hardware Abstraction Layer @@ -3852,6 +4388,9 @@ __STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn) #define ARMCM55_PMU_NWAMODE_ENTER 0xC200 /*!< No write-allocate mode entry */ #define ARMCM55_PMU_NWAMODE 0xC201 /*!< Write-allocate store is not allocated into the data cache due to no-write-allocate mode */ #define ARMCM55_PMU_SAHB_ACCESS 0xC300 /*!< Read or write access on the S-AHB interface to the TCM */ +#define ARMCM55_PMU_PAHB_ACCESS 0xC301 /*!< Read or write access to the P-AHB write interface */ +#define ARMCM55_PMU_AXI_WRITE_ACCESS 0xC302 /*!< Any beat access to M-AXI write interface */ +#define ARMCM55_PMU_AXI_READ_ACCESS 0xC303 /*!< Any beat access to M-AXI read interface */ #define ARMCM55_PMU_DOSTIMEOUT_DOUBLE 0xC400 /*!< Denial of Service timeout has fired twice and caused buffers to drain to allow forward progress */ #define ARMCM55_PMU_DOSTIMEOUT_TRIPLE 0xC401 /*!< Denial of Service timeout has fired three times and blocked the LSU to force forward progress */ diff --git a/edge-impulse-sdk/CMSIS/Core/Include/core_cm7.h b/edge-impulse-sdk/CMSIS/Core/Include/core_cm7.h index a82367a..649894a 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/core_cm7.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/core_cm7.h @@ -1,11 +1,11 @@ /**************************************************************************//** * @file core_cm7.h * @brief CMSIS Cortex-M7 Core Peripheral Access Layer Header File - * @version V5.1.5 - * @date 03. November 2020 + * @version V5.1.6 + * @date 04. June 2021 ******************************************************************************/ /* - * Copyright (c) 2009-2020 Arm Limited. All rights reserved. + * Copyright (c) 2009-2021 Arm Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -213,7 +213,7 @@ #define __VTOR_PRESENT 1U #warning "__VTOR_PRESENT not defined in device header file; using default!" #endif - + #ifndef __NVIC_PRIO_BITS #define __NVIC_PRIO_BITS 3U #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" @@ -677,22 +677,22 @@ typedef struct #define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ /* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ -#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Pos (SCB_CFSR_MEMFAULTSR_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ #define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ -#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ #define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ -#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ #define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ -#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ #define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ -#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ #define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ -#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ #define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ /* BusFault Status Register (part of SCB Configurable Fault Status Register) */ diff --git a/edge-impulse-sdk/CMSIS/Core/Include/core_cm85.h b/edge-impulse-sdk/CMSIS/Core/Include/core_cm85.h new file mode 100644 index 0000000..acb2eb1 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/Core/Include/core_cm85.h @@ -0,0 +1,4636 @@ +/**************************************************************************//** + * @file core_cm85.h + * @brief CMSIS Cortex-M85 Core Peripheral Access Layer Header File + * @version V1.0.5 + * @date 12. May 2022 + ******************************************************************************/ +/* + * Copyright (c) 2022 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#elif defined ( __GNUC__ ) + #pragma GCC diagnostic ignored "-Wpedantic" /* disable pedantic warning due to unnamed structs/unions */ +#endif + +#ifndef __CORE_CM85_H_GENERIC +#define __CORE_CM85_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M85 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM85 definitions */ + +#define __CORTEX_M (85U) /*!< Cortex-M Core */ + +#if defined ( __CC_ARM ) + #error Legacy Arm Compiler does not support Armv8.1-M target architecture. +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_FP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined(__ARM_FEATURE_DSP) + #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined(__ARM_FEATURE_DSP) + #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined(__ARM_FEATURE_DSP) + #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#endif + +#include "edge-impulse-sdk/CMSIS/Core/Include/cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM85_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM85_H_DEPENDANT +#define __CORE_CM85_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM85_REV + #define __CM85_REV 0x0001U + #warning "__CM85_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #if __FPU_PRESENT != 0U + #ifndef __FPU_DP + #define __FPU_DP 0U + #warning "__FPU_DP not defined in device header file; using default!" + #endif + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __ICACHE_PRESENT + #define __ICACHE_PRESENT 0U + #warning "__ICACHE_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __DCACHE_PRESENT + #define __DCACHE_PRESENT 0U + #warning "__DCACHE_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __VTOR_PRESENT + #define __VTOR_PRESENT 1U + #warning "__VTOR_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __PMU_PRESENT + #define __PMU_PRESENT 0U + #warning "__PMU_PRESENT not defined in device header file; using default!" + #endif + + #if __PMU_PRESENT != 0U + #ifndef __PMU_NUM_EVENTCNT + #define __PMU_NUM_EVENTCNT 8U + #warning "__PMU_NUM_EVENTCNT not defined in device header file; using default!" + #elif (__PMU_NUM_EVENTCNT > 8 || __PMU_NUM_EVENTCNT < 2) + #error "__PMU_NUM_EVENTCNT is out of range in device header file!" */ + #endif + #endif + + #ifndef __SAUREGION_PRESENT + #define __SAUREGION_PRESENT 0U + #warning "__SAUREGION_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __DSP_PRESENT + #define __DSP_PRESENT 0U + #warning "__DSP_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M85 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core EWIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core PMU Register + - Core MPU Register + - Core SAU Register + - Core FPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + +#define APSR_GE_Pos 16U /*!< APSR: GE Position */ +#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:1; /*!< bit: 20 Reserved */ + uint32_t B:1; /*!< bit: 21 BTI active (read 0) */ + uint32_t _reserved2:2; /*!< bit: 22..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_IT_Pos 25U /*!< xPSR: IT Position */ +#define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_B_Pos 21U /*!< xPSR: B Position */ +#define xPSR_B_Msk (1UL << xPSR_B_Pos) /*!< xPSR: B Mask */ + +#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */ +#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack-pointer select */ + uint32_t FPCA:1; /*!< bit: 2 Floating-point context active */ + uint32_t SFPA:1; /*!< bit: 3 Secure floating-point active */ + uint32_t BTI_EN:1; /*!< bit: 4 Privileged branch target identification enable */ + uint32_t UBTI_EN:1; /*!< bit: 5 Unprivileged branch target identification enable */ + uint32_t PAC_EN:1; /*!< bit: 6 Privileged pointer authentication enable */ + uint32_t UPAC_EN:1; /*!< bit: 7 Unprivileged pointer authentication enable */ + uint32_t _reserved1:24; /*!< bit: 8..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_UPAC_EN_Pos 7U /*!< CONTROL: UPAC_EN Position */ +#define CONTROL_UPAC_EN_Msk (1UL << CONTROL_UPAC_EN_Pos) /*!< CONTROL: UPAC_EN Mask */ + +#define CONTROL_PAC_EN_Pos 6U /*!< CONTROL: PAC_EN Position */ +#define CONTROL_PAC_EN_Msk (1UL << CONTROL_PAC_EN_Pos) /*!< CONTROL: PAC_EN Mask */ + +#define CONTROL_UBTI_EN_Pos 5U /*!< CONTROL: UBTI_EN Position */ +#define CONTROL_UBTI_EN_Msk (1UL << CONTROL_UBTI_EN_Pos) /*!< CONTROL: UBTI_EN Mask */ + +#define CONTROL_BTI_EN_Pos 4U /*!< CONTROL: BTI_EN Position */ +#define CONTROL_BTI_EN_Msk (1UL << CONTROL_BTI_EN_Pos) /*!< CONTROL: BTI_EN Mask */ + +#define CONTROL_SFPA_Pos 3U /*!< CONTROL: SFPA Position */ +#define CONTROL_SFPA_Msk (1UL << CONTROL_SFPA_Pos) /*!< CONTROL: SFPA Mask */ + +#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */ +#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ + +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[16U]; + __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[16U]; + __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[16U]; + __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[16U]; + __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[16U]; + __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */ + uint32_t RESERVED5[16U]; + __IOM uint8_t IPR[496U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED6[580U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHPR[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ID_AFR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ + __IM uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */ + __IM uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */ + __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ + __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */ + uint32_t RESERVED7[21U]; + __IOM uint32_t SFSR; /*!< Offset: 0x0E4 (R/W) Secure Fault Status Register */ + __IOM uint32_t SFAR; /*!< Offset: 0x0E8 (R/W) Secure Fault Address Register */ + uint32_t RESERVED3[69U]; + __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ + __IOM uint32_t RFSR; /*!< Offset: 0x204 (R/W) RAS Fault Status Register */ + uint32_t RESERVED4[14U]; + __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */ + __IM uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 2 */ + uint32_t RESERVED5[1U]; + __OM uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */ + uint32_t RESERVED6[1U]; + __OM uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */ + __OM uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */ + __OM uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */ + __OM uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */ + __OM uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */ + __OM uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */ + __OM uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */ + __OM uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */ + __OM uint32_t BPIALL; /*!< Offset: 0x278 ( /W) Branch Predictor Invalidate All */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */ +#define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */ + +#define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */ +#define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */ + +#define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */ +#define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */ +#define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */ +#define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */ + +#define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */ +#define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_IESB_Pos 5U /*!< SCB AIRCR: Implicit ESB Enable Position */ +#define SCB_AIRCR_IESB_Msk (1UL << SCB_AIRCR_IESB_Pos) /*!< SCB AIRCR: Implicit ESB Enable Mask */ + +#define SCB_AIRCR_DIT_Pos 4U /*!< SCB AIRCR: Data Independent Timing Position */ +#define SCB_AIRCR_DIT_Msk (1UL << SCB_AIRCR_DIT_Pos) /*!< SCB AIRCR: Data Independent Timing Mask */ + +#define SCB_AIRCR_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */ +#define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */ +#define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_TRD_Pos 20U /*!< SCB CCR: TRD Position */ +#define SCB_CCR_TRD_Msk (1UL << SCB_CCR_TRD_Pos) /*!< SCB CCR: TRD Mask */ + +#define SCB_CCR_LOB_Pos 19U /*!< SCB CCR: LOB Position */ +#define SCB_CCR_LOB_Msk (1UL << SCB_CCR_LOB_Pos) /*!< SCB CCR: LOB Mask */ + +#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: BP Position */ +#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */ + +#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */ +#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */ + +#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */ +#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */ + +#define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */ +#define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */ +#define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */ + +#define SCB_SHCSR_SECUREFAULTPENDED_Pos 20U /*!< SCB SHCSR: SECUREFAULTPENDED Position */ +#define SCB_SHCSR_SECUREFAULTPENDED_Msk (1UL << SCB_SHCSR_SECUREFAULTPENDED_Pos) /*!< SCB SHCSR: SECUREFAULTPENDED Mask */ + +#define SCB_SHCSR_SECUREFAULTENA_Pos 19U /*!< SCB SHCSR: SECUREFAULTENA Position */ +#define SCB_SHCSR_SECUREFAULTENA_Msk (1UL << SCB_SHCSR_SECUREFAULTENA_Pos) /*!< SCB SHCSR: SECUREFAULTENA Mask */ + +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */ +#define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */ + +#define SCB_SHCSR_SECUREFAULTACT_Pos 4U /*!< SCB SHCSR: SECUREFAULTACT Position */ +#define SCB_SHCSR_SECUREFAULTACT_Msk (1UL << SCB_SHCSR_SECUREFAULTACT_Pos) /*!< SCB SHCSR: SECUREFAULTACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */ +#define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_CFSR_MEMFAULTSR_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MLSPERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */ +#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_STKOF_Pos (SCB_CFSR_USGFAULTSR_Pos + 4U) /*!< SCB CFSR (UFSR): STKOF Position */ +#define SCB_CFSR_STKOF_Msk (1UL << SCB_CFSR_STKOF_Pos) /*!< SCB CFSR (UFSR): STKOF Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_PMU_Pos 5U /*!< SCB DFSR: PMU Position */ +#define SCB_DFSR_PMU_Msk (1UL << SCB_DFSR_PMU_Pos) /*!< SCB DFSR: PMU Mask */ + +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/* SCB Non-Secure Access Control Register Definitions */ +#define SCB_NSACR_CP11_Pos 11U /*!< SCB NSACR: CP11 Position */ +#define SCB_NSACR_CP11_Msk (1UL << SCB_NSACR_CP11_Pos) /*!< SCB NSACR: CP11 Mask */ + +#define SCB_NSACR_CP10_Pos 10U /*!< SCB NSACR: CP10 Position */ +#define SCB_NSACR_CP10_Msk (1UL << SCB_NSACR_CP10_Pos) /*!< SCB NSACR: CP10 Mask */ + +#define SCB_NSACR_CP7_Pos 7U /*!< SCB NSACR: CP7 Position */ +#define SCB_NSACR_CP7_Msk (1UL << SCB_NSACR_CP7_Pos) /*!< SCB NSACR: CP7 Mask */ + +#define SCB_NSACR_CP6_Pos 6U /*!< SCB NSACR: CP6 Position */ +#define SCB_NSACR_CP6_Msk (1UL << SCB_NSACR_CP6_Pos) /*!< SCB NSACR: CP6 Mask */ + +#define SCB_NSACR_CP5_Pos 5U /*!< SCB NSACR: CP5 Position */ +#define SCB_NSACR_CP5_Msk (1UL << SCB_NSACR_CP5_Pos) /*!< SCB NSACR: CP5 Mask */ + +#define SCB_NSACR_CP4_Pos 4U /*!< SCB NSACR: CP4 Position */ +#define SCB_NSACR_CP4_Msk (1UL << SCB_NSACR_CP4_Pos) /*!< SCB NSACR: CP4 Mask */ + +#define SCB_NSACR_CP3_Pos 3U /*!< SCB NSACR: CP3 Position */ +#define SCB_NSACR_CP3_Msk (1UL << SCB_NSACR_CP3_Pos) /*!< SCB NSACR: CP3 Mask */ + +#define SCB_NSACR_CP2_Pos 2U /*!< SCB NSACR: CP2 Position */ +#define SCB_NSACR_CP2_Msk (1UL << SCB_NSACR_CP2_Pos) /*!< SCB NSACR: CP2 Mask */ + +#define SCB_NSACR_CP1_Pos 1U /*!< SCB NSACR: CP1 Position */ +#define SCB_NSACR_CP1_Msk (1UL << SCB_NSACR_CP1_Pos) /*!< SCB NSACR: CP1 Mask */ + +#define SCB_NSACR_CP0_Pos 0U /*!< SCB NSACR: CP0 Position */ +#define SCB_NSACR_CP0_Msk (1UL /*<< SCB_NSACR_CP0_Pos*/) /*!< SCB NSACR: CP0 Mask */ + +/* SCB Debug Feature Register 0 Definitions */ +#define SCB_ID_DFR_UDE_Pos 28U /*!< SCB ID_DFR: UDE Position */ +#define SCB_ID_DFR_UDE_Msk (0xFUL << SCB_ID_DFR_UDE_Pos) /*!< SCB ID_DFR: UDE Mask */ + +#define SCB_ID_DFR_MProfDbg_Pos 20U /*!< SCB ID_DFR: MProfDbg Position */ +#define SCB_ID_DFR_MProfDbg_Msk (0xFUL << SCB_ID_DFR_MProfDbg_Pos) /*!< SCB ID_DFR: MProfDbg Mask */ + +/* SCB Cache Level ID Register Definitions */ +#define SCB_CLIDR_LOUU_Pos 27U /*!< SCB CLIDR: LoUU Position */ +#define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */ + +#define SCB_CLIDR_LOC_Pos 24U /*!< SCB CLIDR: LoC Position */ +#define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_LOC_Pos) /*!< SCB CLIDR: LoC Mask */ + +/* SCB Cache Type Register Definitions */ +#define SCB_CTR_FORMAT_Pos 29U /*!< SCB CTR: Format Position */ +#define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */ + +#define SCB_CTR_CWG_Pos 24U /*!< SCB CTR: CWG Position */ +#define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */ + +#define SCB_CTR_ERG_Pos 20U /*!< SCB CTR: ERG Position */ +#define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */ + +#define SCB_CTR_DMINLINE_Pos 16U /*!< SCB CTR: DminLine Position */ +#define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */ + +#define SCB_CTR_IMINLINE_Pos 0U /*!< SCB CTR: ImInLine Position */ +#define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */ + +/* SCB Cache Size ID Register Definitions */ +#define SCB_CCSIDR_WT_Pos 31U /*!< SCB CCSIDR: WT Position */ +#define SCB_CCSIDR_WT_Msk (1UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */ + +#define SCB_CCSIDR_WB_Pos 30U /*!< SCB CCSIDR: WB Position */ +#define SCB_CCSIDR_WB_Msk (1UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */ + +#define SCB_CCSIDR_RA_Pos 29U /*!< SCB CCSIDR: RA Position */ +#define SCB_CCSIDR_RA_Msk (1UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */ + +#define SCB_CCSIDR_WA_Pos 28U /*!< SCB CCSIDR: WA Position */ +#define SCB_CCSIDR_WA_Msk (1UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */ + +#define SCB_CCSIDR_NUMSETS_Pos 13U /*!< SCB CCSIDR: NumSets Position */ +#define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */ + +#define SCB_CCSIDR_ASSOCIATIVITY_Pos 3U /*!< SCB CCSIDR: Associativity Position */ +#define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */ + +#define SCB_CCSIDR_LINESIZE_Pos 0U /*!< SCB CCSIDR: LineSize Position */ +#define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */ + +/* SCB Cache Size Selection Register Definitions */ +#define SCB_CSSELR_LEVEL_Pos 1U /*!< SCB CSSELR: Level Position */ +#define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */ + +#define SCB_CSSELR_IND_Pos 0U /*!< SCB CSSELR: InD Position */ +#define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */ + +/* SCB Software Triggered Interrupt Register Definitions */ +#define SCB_STIR_INTID_Pos 0U /*!< SCB STIR: INTID Position */ +#define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */ + +/* SCB RAS Fault Status Register Definitions */ +#define SCB_RFSR_V_Pos 31U /*!< SCB RFSR: V Position */ +#define SCB_RFSR_V_Msk (1UL << SCB_RFSR_V_Pos) /*!< SCB RFSR: V Mask */ + +#define SCB_RFSR_IS_Pos 16U /*!< SCB RFSR: IS Position */ +#define SCB_RFSR_IS_Msk (0x7FFFUL << SCB_RFSR_IS_Pos) /*!< SCB RFSR: IS Mask */ + +#define SCB_RFSR_UET_Pos 0U /*!< SCB RFSR: UET Position */ +#define SCB_RFSR_UET_Msk (3UL /*<< SCB_RFSR_UET_Pos*/) /*!< SCB RFSR: UET Mask */ + +/* SCB D-Cache Invalidate by Set-way Register Definitions */ +#define SCB_DCISW_WAY_Pos 30U /*!< SCB DCISW: Way Position */ +#define SCB_DCISW_WAY_Msk (3UL << SCB_DCISW_WAY_Pos) /*!< SCB DCISW: Way Mask */ + +#define SCB_DCISW_SET_Pos 5U /*!< SCB DCISW: Set Position */ +#define SCB_DCISW_SET_Msk (0x1FFUL << SCB_DCISW_SET_Pos) /*!< SCB DCISW: Set Mask */ + +/* SCB D-Cache Clean by Set-way Register Definitions */ +#define SCB_DCCSW_WAY_Pos 30U /*!< SCB DCCSW: Way Position */ +#define SCB_DCCSW_WAY_Msk (3UL << SCB_DCCSW_WAY_Pos) /*!< SCB DCCSW: Way Mask */ + +#define SCB_DCCSW_SET_Pos 5U /*!< SCB DCCSW: Set Position */ +#define SCB_DCCSW_SET_Msk (0x1FFUL << SCB_DCCSW_SET_Pos) /*!< SCB DCCSW: Set Mask */ + +/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */ +#define SCB_DCCISW_WAY_Pos 30U /*!< SCB DCCISW: Way Position */ +#define SCB_DCCISW_WAY_Msk (3UL << SCB_DCCISW_WAY_Pos) /*!< SCB DCCISW: Way Mask */ + +#define SCB_DCCISW_SET_Pos 5U /*!< SCB DCCISW: Set Position */ +#define SCB_DCCISW_SET_Msk (0x1FFUL << SCB_DCCISW_SET_Pos) /*!< SCB DCCISW: Set Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ICB Implementation Control Block register (ICB) + \brief Type definitions for the Implementation Control Block Register + @{ + */ + +/** + \brief Structure type to access the Implementation Control Block (ICB). + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ + __IOM uint32_t CPPWR; /*!< Offset: 0x00C (R/W) Coprocessor Power Control Register */ +} ICB_Type; + +/* Auxiliary Control Register Definitions */ +#define ICB_ACTLR_DISCRITAXIRUW_Pos 27U /*!< ACTLR: DISCRITAXIRUW Position */ +#define ICB_ACTLR_DISCRITAXIRUW_Msk (1UL << ICB_ACTLR_DISCRITAXIRUW_Pos) /*!< ACTLR: DISCRITAXIRUW Mask */ + +#define ICB_ACTLR_DISCRITAXIRUR_Pos 15U /*!< ACTLR: DISCRITAXIRUR Position */ +#define ICB_ACTLR_DISCRITAXIRUR_Msk (1UL << ICB_ACTLR_DISCRITAXIRUR_Pos) /*!< ACTLR: DISCRITAXIRUR Mask */ + +#define ICB_ACTLR_EVENTBUSEN_Pos 14U /*!< ACTLR: EVENTBUSEN Position */ +#define ICB_ACTLR_EVENTBUSEN_Msk (1UL << ICB_ACTLR_EVENTBUSEN_Pos) /*!< ACTLR: EVENTBUSEN Mask */ + +#define ICB_ACTLR_EVENTBUSEN_S_Pos 13U /*!< ACTLR: EVENTBUSEN_S Position */ +#define ICB_ACTLR_EVENTBUSEN_S_Msk (1UL << ICB_ACTLR_EVENTBUSEN_S_Pos) /*!< ACTLR: EVENTBUSEN_S Mask */ + +#define ICB_ACTLR_DISITMATBFLUSH_Pos 12U /*!< ACTLR: DISITMATBFLUSH Position */ +#define ICB_ACTLR_DISITMATBFLUSH_Msk (1UL << ICB_ACTLR_DISITMATBFLUSH_Pos) /*!< ACTLR: DISITMATBFLUSH Mask */ + +#define ICB_ACTLR_DISNWAMODE_Pos 11U /*!< ACTLR: DISNWAMODE Position */ +#define ICB_ACTLR_DISNWAMODE_Msk (1UL << ICB_ACTLR_DISNWAMODE_Pos) /*!< ACTLR: DISNWAMODE Mask */ + +#define ICB_ACTLR_FPEXCODIS_Pos 10U /*!< ACTLR: FPEXCODIS Position */ +#define ICB_ACTLR_FPEXCODIS_Msk (1UL << ICB_ACTLR_FPEXCODIS_Pos) /*!< ACTLR: FPEXCODIS Mask */ + +/* Interrupt Controller Type Register Definitions */ +#define ICB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define ICB_ICTR_INTLINESNUM_Msk (0xFUL /*<< ICB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_ICB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[27U]; + __IM uint32_t ITREAD; /*!< Offset: 0xEF0 (R/ ) ITM Integration Read Register */ + uint32_t RESERVED4[1U]; + __OM uint32_t ITWRITE; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */ + uint32_t RESERVED5[1U]; + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */ + uint32_t RESERVED6[46U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) ITM Device Architecture Register */ + uint32_t RESERVED7[3U]; + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) ITM Device Type Register */ + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Stimulus Port Register Definitions */ +#define ITM_STIM_DISABLED_Pos 1U /*!< ITM STIM: DISABLED Position */ +#define ITM_STIM_DISABLED_Msk (0x1UL << ITM_STIM_DISABLED_Pos) /*!< ITM STIM: DISABLED Mask */ + +#define ITM_STIM_FIFOREADY_Pos 0U /*!< ITM STIM: FIFOREADY Position */ +#define ITM_STIM_FIFOREADY_Msk (0x1UL /*<< ITM_STIM_FIFOREADY_Pos*/) /*!< ITM STIM: FIFOREADY Mask */ + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TRACEBUSID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TRACEBUSID_Msk (0x7FUL << ITM_TCR_TRACEBUSID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPRESCALE_Pos 8U /*!< ITM TCR: TSPRESCALE Position */ +#define ITM_TCR_TSPRESCALE_Msk (3UL << ITM_TCR_TSPRESCALE_Pos) /*!< ITM TCR: TSPRESCALE Mask */ + +#define ITM_TCR_STALLENA_Pos 5U /*!< ITM TCR: STALLENA Position */ +#define ITM_TCR_STALLENA_Msk (1UL << ITM_TCR_STALLENA_Pos) /*!< ITM TCR: STALLENA Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Integration Read Register Definitions */ +#define ITM_ITREAD_AFVALID_Pos 1U /*!< ITM ITREAD: AFVALID Position */ +#define ITM_ITREAD_AFVALID_Msk (0x1UL << ITM_ITREAD_AFVALID_Pos) /*!< ITM ITREAD: AFVALID Mask */ + +#define ITM_ITREAD_ATREADY_Pos 0U /*!< ITM ITREAD: ATREADY Position */ +#define ITM_ITREAD_ATREADY_Msk (0x1UL /*<< ITM_ITREAD_ATREADY_Pos*/) /*!< ITM ITREAD: ATREADY Mask */ + +/* ITM Integration Write Register Definitions */ +#define ITM_ITWRITE_AFVALID_Pos 1U /*!< ITM ITWRITE: AFVALID Position */ +#define ITM_ITWRITE_AFVALID_Msk (0x1UL << ITM_ITWRITE_AFVALID_Pos) /*!< ITM ITWRITE: AFVALID Mask */ + +#define ITM_ITWRITE_ATREADY_Pos 0U /*!< ITM ITWRITE: ATREADY Position */ +#define ITM_ITWRITE_ATREADY_Msk (0x1UL /*<< ITM_ITWRITE_ATREADY_Pos*/) /*!< ITM ITWRITE: ATREADY Mask */ + +/* ITM Integration Mode Control Register Definitions */ +#define ITM_ITCTRL_IME_Pos 0U /*!< ITM ITCTRL: IME Position */ +#define ITM_ITCTRL_IME_Msk (0x1UL /*<< ITM_ITCTRL_IME_Pos*/) /*!< ITM ITCTRL: IME Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + uint32_t RESERVED3[1U]; + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + __IOM uint32_t VMASK1; /*!< Offset: 0x03C (R/W) Comparator Value Mask 1 */ + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + uint32_t RESERVED4[1U]; + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED5[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + uint32_t RESERVED6[1U]; + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ + __IOM uint32_t VMASK3; /*!< Offset: 0x05C (R/W) Comparator Value Mask 3 */ + __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */ + uint32_t RESERVED7[1U]; + __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */ + uint32_t RESERVED8[1U]; + __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */ + uint32_t RESERVED9[1U]; + __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */ + uint32_t RESERVED10[1U]; + __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */ + uint32_t RESERVED11[1U]; + __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */ + uint32_t RESERVED12[1U]; + __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */ + uint32_t RESERVED13[1U]; + __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */ + uint32_t RESERVED14[968U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) Device Type Architecture Register */ + uint32_t RESERVED15[3U]; + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Identifier Register */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCDISS_Pos 23U /*!< DWT CTRL: CYCDISS Position */ +#define DWT_CTRL_CYCDISS_Msk (0x1UL << DWT_CTRL_CYCDISS_Pos) /*!< DWT CTRL: CYCDISS Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */ +#define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */ + +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */ +#define DWT_FUNCTION_ACTION_Msk (0x3UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */ + +#define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */ +#define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup MemSysCtl_Type Memory System Control Registers (IMPLEMENTATION DEFINED) + \brief Type definitions for the Memory System Control Registers (MEMSYSCTL) + @{ + */ + +/** + \brief Structure type to access the Memory System Control Registers (MEMSYSCTL). + */ +typedef struct +{ + __IOM uint32_t MSCR; /*!< Offset: 0x000 (R/W) Memory System Control Register */ + __IOM uint32_t PFCR; /*!< Offset: 0x004 (R/W) Prefetcher Control Register */ + uint32_t RESERVED1[2U]; + __IOM uint32_t ITCMCR; /*!< Offset: 0x010 (R/W) ITCM Control Register */ + __IOM uint32_t DTCMCR; /*!< Offset: 0x014 (R/W) DTCM Control Register */ + __IOM uint32_t PAHBCR; /*!< Offset: 0x018 (R/W) P-AHB Control Register */ + uint32_t RESERVED2[313U]; + __IOM uint32_t ITGU_CTRL; /*!< Offset: 0x500 (R/W) ITGU Control Register */ + __IOM uint32_t ITGU_CFG; /*!< Offset: 0x504 (R/W) ITGU Configuration Register */ + uint32_t RESERVED3[2U]; + __IOM uint32_t ITGU_LUT[16U]; /*!< Offset: 0x510 (R/W) ITGU Look Up Table Register */ + uint32_t RESERVED4[44U]; + __IOM uint32_t DTGU_CTRL; /*!< Offset: 0x600 (R/W) DTGU Control Registers */ + __IOM uint32_t DTGU_CFG; /*!< Offset: 0x604 (R/W) DTGU Configuration Register */ + uint32_t RESERVED5[2U]; + __IOM uint32_t DTGU_LUT[16U]; /*!< Offset: 0x610 (R/W) DTGU Look Up Table Register */ +} MemSysCtl_Type; + +/* MEMSYSCTL Memory System Control Register (MSCR) Register Definitions */ +#define MEMSYSCTL_MSCR_CPWRDN_Pos 17U /*!< MEMSYSCTL MSCR: CPWRDN Position */ +#define MEMSYSCTL_MSCR_CPWRDN_Msk (0x1UL << MEMSYSCTL_MSCR_CPWRDN_Pos) /*!< MEMSYSCTL MSCR: CPWRDN Mask */ + +#define MEMSYSCTL_MSCR_DCCLEAN_Pos 16U /*!< MEMSYSCTL MSCR: DCCLEAN Position */ +#define MEMSYSCTL_MSCR_DCCLEAN_Msk (0x1UL << MEMSYSCTL_MSCR_DCCLEAN_Pos) /*!< MEMSYSCTL MSCR: DCCLEAN Mask */ + +#define MEMSYSCTL_MSCR_ICACTIVE_Pos 13U /*!< MEMSYSCTL MSCR: ICACTIVE Position */ +#define MEMSYSCTL_MSCR_ICACTIVE_Msk (0x1UL << MEMSYSCTL_MSCR_ICACTIVE_Pos) /*!< MEMSYSCTL MSCR: ICACTIVE Mask */ + +#define MEMSYSCTL_MSCR_DCACTIVE_Pos 12U /*!< MEMSYSCTL MSCR: DCACTIVE Position */ +#define MEMSYSCTL_MSCR_DCACTIVE_Msk (0x1UL << MEMSYSCTL_MSCR_DCACTIVE_Pos) /*!< MEMSYSCTL MSCR: DCACTIVE Mask */ + +#define MEMSYSCTL_MSCR_EVECCFAULT_Pos 3U /*!< MEMSYSCTL MSCR: EVECCFAULT Position */ +#define MEMSYSCTL_MSCR_EVECCFAULT_Msk (0x1UL << MEMSYSCTL_MSCR_EVECCFAULT_Pos) /*!< MEMSYSCTL MSCR: EVECCFAULT Mask */ + +#define MEMSYSCTL_MSCR_FORCEWT_Pos 2U /*!< MEMSYSCTL MSCR: FORCEWT Position */ +#define MEMSYSCTL_MSCR_FORCEWT_Msk (0x1UL << MEMSYSCTL_MSCR_FORCEWT_Pos) /*!< MEMSYSCTL MSCR: FORCEWT Mask */ + +#define MEMSYSCTL_MSCR_ECCEN_Pos 1U /*!< MEMSYSCTL MSCR: ECCEN Position */ +#define MEMSYSCTL_MSCR_ECCEN_Msk (0x1UL << MEMSYSCTL_MSCR_ECCEN_Pos) /*!< MEMSYSCTL MSCR: ECCEN Mask */ + +/* MEMSYSCTL Prefetcher Control Register (PFCR) Register Definitions */ +#define MEMSYSCTL_PFCR_DIS_NLP_Pos 7U /*!< MEMSYSCTL PFCR: DIS_NLP Position */ +#define MEMSYSCTL_PFCR_DIS_NLP_Msk (0x1UL << MEMSYSCTL_PFCR_DIS_NLP_Pos) /*!< MEMSYSCTL PFCR: DIS_NLP Mask */ + +#define MEMSYSCTL_PFCR_ENABLE_Pos 0U /*!< MEMSYSCTL PFCR: ENABLE Position */ +#define MEMSYSCTL_PFCR_ENABLE_Msk (0x1UL /*<< MEMSYSCTL_PFCR_ENABLE_Pos*/) /*!< MEMSYSCTL PFCR: ENABLE Mask */ + +/* MEMSYSCTL ITCM Control Register (ITCMCR) Register Definitions */ +#define MEMSYSCTL_ITCMCR_SZ_Pos 3U /*!< MEMSYSCTL ITCMCR: SZ Position */ +#define MEMSYSCTL_ITCMCR_SZ_Msk (0xFUL << MEMSYSCTL_ITCMCR_SZ_Pos) /*!< MEMSYSCTL ITCMCR: SZ Mask */ + +#define MEMSYSCTL_ITCMCR_EN_Pos 0U /*!< MEMSYSCTL ITCMCR: EN Position */ +#define MEMSYSCTL_ITCMCR_EN_Msk (0x1UL /*<< MEMSYSCTL_ITCMCR_EN_Pos*/) /*!< MEMSYSCTL ITCMCR: EN Mask */ + +/* MEMSYSCTL DTCM Control Register (DTCMCR) Register Definitions */ +#define MEMSYSCTL_DTCMCR_SZ_Pos 3U /*!< MEMSYSCTL DTCMCR: SZ Position */ +#define MEMSYSCTL_DTCMCR_SZ_Msk (0xFUL << MEMSYSCTL_DTCMCR_SZ_Pos) /*!< MEMSYSCTL DTCMCR: SZ Mask */ + +#define MEMSYSCTL_DTCMCR_EN_Pos 0U /*!< MEMSYSCTL DTCMCR: EN Position */ +#define MEMSYSCTL_DTCMCR_EN_Msk (0x1UL /*<< MEMSYSCTL_DTCMCR_EN_Pos*/) /*!< MEMSYSCTL DTCMCR: EN Mask */ + +/* MEMSYSCTL P-AHB Control Register (PAHBCR) Register Definitions */ +#define MEMSYSCTL_PAHBCR_SZ_Pos 1U /*!< MEMSYSCTL PAHBCR: SZ Position */ +#define MEMSYSCTL_PAHBCR_SZ_Msk (0x7UL << MEMSYSCTL_PAHBCR_SZ_Pos) /*!< MEMSYSCTL PAHBCR: SZ Mask */ + +#define MEMSYSCTL_PAHBCR_EN_Pos 0U /*!< MEMSYSCTL PAHBCR: EN Position */ +#define MEMSYSCTL_PAHBCR_EN_Msk (0x1UL /*<< MEMSYSCTL_PAHBCR_EN_Pos*/) /*!< MEMSYSCTL PAHBCR: EN Mask */ + +/* MEMSYSCTL ITGU Control Register (ITGU_CTRL) Register Definitions */ +#define MEMSYSCTL_ITGU_CTRL_DEREN_Pos 1U /*!< MEMSYSCTL ITGU_CTRL: DEREN Position */ +#define MEMSYSCTL_ITGU_CTRL_DEREN_Msk (0x1UL << MEMSYSCTL_ITGU_CTRL_DEREN_Pos) /*!< MEMSYSCTL ITGU_CTRL: DEREN Mask */ + +#define MEMSYSCTL_ITGU_CTRL_DBFEN_Pos 0U /*!< MEMSYSCTL ITGU_CTRL: DBFEN Position */ +#define MEMSYSCTL_ITGU_CTRL_DBFEN_Msk (0x1UL /*<< MEMSYSCTL_ITGU_CTRL_DBFEN_Pos*/) /*!< MEMSYSCTL ITGU_CTRL: DBFEN Mask */ + +/* MEMSYSCTL ITGU Configuration Register (ITGU_CFG) Register Definitions */ +#define MEMSYSCTL_ITGU_CFG_PRESENT_Pos 31U /*!< MEMSYSCTL ITGU_CFG: PRESENT Position */ +#define MEMSYSCTL_ITGU_CFG_PRESENT_Msk (0x1UL << MEMSYSCTL_ITGU_CFG_PRESENT_Pos) /*!< MEMSYSCTL ITGU_CFG: PRESENT Mask */ + +#define MEMSYSCTL_ITGU_CFG_NUMBLKS_Pos 8U /*!< MEMSYSCTL ITGU_CFG: NUMBLKS Position */ +#define MEMSYSCTL_ITGU_CFG_NUMBLKS_Msk (0xFUL << MEMSYSCTL_ITGU_CFG_NUMBLKS_Pos) /*!< MEMSYSCTL ITGU_CFG: NUMBLKS Mask */ + +#define MEMSYSCTL_ITGU_CFG_BLKSZ_Pos 0U /*!< MEMSYSCTL ITGU_CFG: BLKSZ Position */ +#define MEMSYSCTL_ITGU_CFG_BLKSZ_Msk (0xFUL /*<< MEMSYSCTL_ITGU_CFG_BLKSZ_Pos*/) /*!< MEMSYSCTL ITGU_CFG: BLKSZ Mask */ + +/* MEMSYSCTL DTGU Control Registers (DTGU_CTRL) Register Definitions */ +#define MEMSYSCTL_DTGU_CTRL_DEREN_Pos 1U /*!< MEMSYSCTL DTGU_CTRL: DEREN Position */ +#define MEMSYSCTL_DTGU_CTRL_DEREN_Msk (0x1UL << MEMSYSCTL_DTGU_CTRL_DEREN_Pos) /*!< MEMSYSCTL DTGU_CTRL: DEREN Mask */ + +#define MEMSYSCTL_DTGU_CTRL_DBFEN_Pos 0U /*!< MEMSYSCTL DTGU_CTRL: DBFEN Position */ +#define MEMSYSCTL_DTGU_CTRL_DBFEN_Msk (0x1UL /*<< MEMSYSCTL_DTGU_CTRL_DBFEN_Pos*/) /*!< MEMSYSCTL DTGU_CTRL: DBFEN Mask */ + +/* MEMSYSCTL DTGU Configuration Register (DTGU_CFG) Register Definitions */ +#define MEMSYSCTL_DTGU_CFG_PRESENT_Pos 31U /*!< MEMSYSCTL DTGU_CFG: PRESENT Position */ +#define MEMSYSCTL_DTGU_CFG_PRESENT_Msk (0x1UL << MEMSYSCTL_DTGU_CFG_PRESENT_Pos) /*!< MEMSYSCTL DTGU_CFG: PRESENT Mask */ + +#define MEMSYSCTL_DTGU_CFG_NUMBLKS_Pos 8U /*!< MEMSYSCTL DTGU_CFG: NUMBLKS Position */ +#define MEMSYSCTL_DTGU_CFG_NUMBLKS_Msk (0xFUL << MEMSYSCTL_DTGU_CFG_NUMBLKS_Pos) /*!< MEMSYSCTL DTGU_CFG: NUMBLKS Mask */ + +#define MEMSYSCTL_DTGU_CFG_BLKSZ_Pos 0U /*!< MEMSYSCTL DTGU_CFG: BLKSZ Position */ +#define MEMSYSCTL_DTGU_CFG_BLKSZ_Msk (0xFUL /*<< MEMSYSCTL_DTGU_CFG_BLKSZ_Pos*/) /*!< MEMSYSCTL DTGU_CFG: BLKSZ Mask */ + + +/*@}*/ /* end of group MemSysCtl_Type */ + + +/** + \ingroup CMSIS_core_register + \defgroup PwrModCtl_Type Power Mode Control Registers + \brief Type definitions for the Power Mode Control Registers (PWRMODCTL) + @{ + */ + +/** + \brief Structure type to access the Power Mode Control Registers (PWRMODCTL). + */ +typedef struct +{ + __IOM uint32_t CPDLPSTATE; /*!< Offset: 0x000 (R/W) Core Power Domain Low Power State Register */ + __IOM uint32_t DPDLPSTATE; /*!< Offset: 0x004 (R/W) Debug Power Domain Low Power State Register */ +} PwrModCtl_Type; + +/* PWRMODCTL Core Power Domain Low Power State (CPDLPSTATE) Register Definitions */ +#define PWRMODCTL_CPDLPSTATE_RLPSTATE_Pos 8U /*!< PWRMODCTL CPDLPSTATE: RLPSTATE Position */ +#define PWRMODCTL_CPDLPSTATE_RLPSTATE_Msk (0x3UL << PWRMODCTL_CPDLPSTATE_RLPSTATE_Pos) /*!< PWRMODCTL CPDLPSTATE: RLPSTATE Mask */ + +#define PWRMODCTL_CPDLPSTATE_ELPSTATE_Pos 4U /*!< PWRMODCTL CPDLPSTATE: ELPSTATE Position */ +#define PWRMODCTL_CPDLPSTATE_ELPSTATE_Msk (0x3UL << PWRMODCTL_CPDLPSTATE_ELPSTATE_Pos) /*!< PWRMODCTL CPDLPSTATE: ELPSTATE Mask */ + +#define PWRMODCTL_CPDLPSTATE_CLPSTATE_Pos 0U /*!< PWRMODCTL CPDLPSTATE: CLPSTATE Position */ +#define PWRMODCTL_CPDLPSTATE_CLPSTATE_Msk (0x3UL /*<< PWRMODCTL_CPDLPSTATE_CLPSTATE_Pos*/) /*!< PWRMODCTL CPDLPSTATE: CLPSTATE Mask */ + +/* PWRMODCTL Debug Power Domain Low Power State (DPDLPSTATE) Register Definitions */ +#define PWRMODCTL_DPDLPSTATE_DLPSTATE_Pos 0U /*!< PWRMODCTL DPDLPSTATE: DLPSTATE Position */ +#define PWRMODCTL_DPDLPSTATE_DLPSTATE_Msk (0x3UL /*<< PWRMODCTL_DPDLPSTATE_DLPSTATE_Pos*/) /*!< PWRMODCTL DPDLPSTATE: DLPSTATE Mask */ + +/*@}*/ /* end of group PwrModCtl_Type */ + + +/** + \ingroup CMSIS_core_register + \defgroup EWIC_Type External Wakeup Interrupt Controller Registers + \brief Type definitions for the External Wakeup Interrupt Controller Registers (EWIC) + @{ + */ + +/** + \brief Structure type to access the External Wakeup Interrupt Controller Registers (EWIC). + */ +typedef struct +{ + __OM uint32_t EVENTSPR; /*!< Offset: 0x000 ( /W) Event Set Pending Register */ + uint32_t RESERVED0[31U]; + __IM uint32_t EVENTMASKA; /*!< Offset: 0x080 (R/W) Event Mask A Register */ + __IM uint32_t EVENTMASK[15]; /*!< Offset: 0x084 (R/W) Event Mask Register */ +} EWIC_Type; + +/* EWIC External Wakeup Interrupt Controller (EVENTSPR) Register Definitions */ +#define EWIC_EVENTSPR_EDBGREQ_Pos 2U /*!< EWIC EVENTSPR: EDBGREQ Position */ +#define EWIC_EVENTSPR_EDBGREQ_Msk (0x1UL << EWIC_EVENTSPR_EDBGREQ_Pos) /*!< EWIC EVENTSPR: EDBGREQ Mask */ + +#define EWIC_EVENTSPR_NMI_Pos 1U /*!< EWIC EVENTSPR: NMI Position */ +#define EWIC_EVENTSPR_NMI_Msk (0x1UL << EWIC_EVENTSPR_NMI_Pos) /*!< EWIC EVENTSPR: NMI Mask */ + +#define EWIC_EVENTSPR_EVENT_Pos 0U /*!< EWIC EVENTSPR: EVENT Position */ +#define EWIC_EVENTSPR_EVENT_Msk (0x1UL /*<< EWIC_EVENTSPR_EVENT_Pos*/) /*!< EWIC EVENTSPR: EVENT Mask */ + +/* EWIC External Wakeup Interrupt Controller (EVENTMASKA) Register Definitions */ +#define EWIC_EVENTMASKA_EDBGREQ_Pos 2U /*!< EWIC EVENTMASKA: EDBGREQ Position */ +#define EWIC_EVENTMASKA_EDBGREQ_Msk (0x1UL << EWIC_EVENTMASKA_EDBGREQ_Pos) /*!< EWIC EVENTMASKA: EDBGREQ Mask */ + +#define EWIC_EVENTMASKA_NMI_Pos 1U /*!< EWIC EVENTMASKA: NMI Position */ +#define EWIC_EVENTMASKA_NMI_Msk (0x1UL << EWIC_EVENTMASKA_NMI_Pos) /*!< EWIC EVENTMASKA: NMI Mask */ + +#define EWIC_EVENTMASKA_EVENT_Pos 0U /*!< EWIC EVENTMASKA: EVENT Position */ +#define EWIC_EVENTMASKA_EVENT_Msk (0x1UL /*<< EWIC_EVENTMASKA_EVENT_Pos*/) /*!< EWIC EVENTMASKA: EVENT Mask */ + +/* EWIC External Wakeup Interrupt Controller (EVENTMASK) Register Definitions */ +#define EWIC_EVENTMASK_IRQ_Pos 0U /*!< EWIC EVENTMASKA: IRQ Position */ +#define EWIC_EVENTMASK_IRQ_Msk (0xFFFFFFFFUL /*<< EWIC_EVENTMASKA_IRQ_Pos*/) /*!< EWIC EVENTMASKA: IRQ Mask */ + +/*@}*/ /* end of group EWIC_Type */ + + +/** + \ingroup CMSIS_core_register + \defgroup ErrBnk_Type Error Banking Registers (IMPLEMENTATION DEFINED) + \brief Type definitions for the Error Banking Registers (ERRBNK) + @{ + */ + +/** + \brief Structure type to access the Error Banking Registers (ERRBNK). + */ +typedef struct +{ + __IOM uint32_t IEBR0; /*!< Offset: 0x000 (R/W) Instruction Cache Error Bank Register 0 */ + __IOM uint32_t IEBR1; /*!< Offset: 0x004 (R/W) Instruction Cache Error Bank Register 1 */ + uint32_t RESERVED0[2U]; + __IOM uint32_t DEBR0; /*!< Offset: 0x010 (R/W) Data Cache Error Bank Register 0 */ + __IOM uint32_t DEBR1; /*!< Offset: 0x014 (R/W) Data Cache Error Bank Register 1 */ + uint32_t RESERVED1[2U]; + __IOM uint32_t TEBR0; /*!< Offset: 0x020 (R/W) TCM Error Bank Register 0 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t TEBR1; /*!< Offset: 0x028 (R/W) TCM Error Bank Register 1 */ +} ErrBnk_Type; + +/* ERRBNK Instruction Cache Error Bank Register 0 (IEBR0) Register Definitions */ +#define ERRBNK_IEBR0_SWDEF_Pos 30U /*!< ERRBNK IEBR0: SWDEF Position */ +#define ERRBNK_IEBR0_SWDEF_Msk (0x3UL << ERRBNK_IEBR0_SWDEF_Pos) /*!< ERRBNK IEBR0: SWDEF Mask */ + +#define ERRBNK_IEBR0_BANK_Pos 16U /*!< ERRBNK IEBR0: BANK Position */ +#define ERRBNK_IEBR0_BANK_Msk (0x1UL << ERRBNK_IEBR0_BANK_Pos) /*!< ERRBNK IEBR0: BANK Mask */ + +#define ERRBNK_IEBR0_LOCATION_Pos 2U /*!< ERRBNK IEBR0: LOCATION Position */ +#define ERRBNK_IEBR0_LOCATION_Msk (0x3FFFUL << ERRBNK_IEBR0_LOCATION_Pos) /*!< ERRBNK IEBR0: LOCATION Mask */ + +#define ERRBNK_IEBR0_LOCKED_Pos 1U /*!< ERRBNK IEBR0: LOCKED Position */ +#define ERRBNK_IEBR0_LOCKED_Msk (0x1UL << ERRBNK_IEBR0_LOCKED_Pos) /*!< ERRBNK IEBR0: LOCKED Mask */ + +#define ERRBNK_IEBR0_VALID_Pos 0U /*!< ERRBNK IEBR0: VALID Position */ +#define ERRBNK_IEBR0_VALID_Msk (0x1UL << /*ERRBNK_IEBR0_VALID_Pos*/) /*!< ERRBNK IEBR0: VALID Mask */ + +/* ERRBNK Instruction Cache Error Bank Register 1 (IEBR1) Register Definitions */ +#define ERRBNK_IEBR1_SWDEF_Pos 30U /*!< ERRBNK IEBR1: SWDEF Position */ +#define ERRBNK_IEBR1_SWDEF_Msk (0x3UL << ERRBNK_IEBR1_SWDEF_Pos) /*!< ERRBNK IEBR1: SWDEF Mask */ + +#define ERRBNK_IEBR1_BANK_Pos 16U /*!< ERRBNK IEBR1: BANK Position */ +#define ERRBNK_IEBR1_BANK_Msk (0x1UL << ERRBNK_IEBR1_BANK_Pos) /*!< ERRBNK IEBR1: BANK Mask */ + +#define ERRBNK_IEBR1_LOCATION_Pos 2U /*!< ERRBNK IEBR1: LOCATION Position */ +#define ERRBNK_IEBR1_LOCATION_Msk (0x3FFFUL << ERRBNK_IEBR1_LOCATION_Pos) /*!< ERRBNK IEBR1: LOCATION Mask */ + +#define ERRBNK_IEBR1_LOCKED_Pos 1U /*!< ERRBNK IEBR1: LOCKED Position */ +#define ERRBNK_IEBR1_LOCKED_Msk (0x1UL << ERRBNK_IEBR1_LOCKED_Pos) /*!< ERRBNK IEBR1: LOCKED Mask */ + +#define ERRBNK_IEBR1_VALID_Pos 0U /*!< ERRBNK IEBR1: VALID Position */ +#define ERRBNK_IEBR1_VALID_Msk (0x1UL << /*ERRBNK_IEBR1_VALID_Pos*/) /*!< ERRBNK IEBR1: VALID Mask */ + +/* ERRBNK Data Cache Error Bank Register 0 (DEBR0) Register Definitions */ +#define ERRBNK_DEBR0_SWDEF_Pos 30U /*!< ERRBNK DEBR0: SWDEF Position */ +#define ERRBNK_DEBR0_SWDEF_Msk (0x3UL << ERRBNK_DEBR0_SWDEF_Pos) /*!< ERRBNK DEBR0: SWDEF Mask */ + +#define ERRBNK_DEBR0_TYPE_Pos 17U /*!< ERRBNK DEBR0: TYPE Position */ +#define ERRBNK_DEBR0_TYPE_Msk (0x1UL << ERRBNK_DEBR0_TYPE_Pos) /*!< ERRBNK DEBR0: TYPE Mask */ + +#define ERRBNK_DEBR0_BANK_Pos 16U /*!< ERRBNK DEBR0: BANK Position */ +#define ERRBNK_DEBR0_BANK_Msk (0x1UL << ERRBNK_DEBR0_BANK_Pos) /*!< ERRBNK DEBR0: BANK Mask */ + +#define ERRBNK_DEBR0_LOCATION_Pos 2U /*!< ERRBNK DEBR0: LOCATION Position */ +#define ERRBNK_DEBR0_LOCATION_Msk (0x3FFFUL << ERRBNK_DEBR0_LOCATION_Pos) /*!< ERRBNK DEBR0: LOCATION Mask */ + +#define ERRBNK_DEBR0_LOCKED_Pos 1U /*!< ERRBNK DEBR0: LOCKED Position */ +#define ERRBNK_DEBR0_LOCKED_Msk (0x1UL << ERRBNK_DEBR0_LOCKED_Pos) /*!< ERRBNK DEBR0: LOCKED Mask */ + +#define ERRBNK_DEBR0_VALID_Pos 0U /*!< ERRBNK DEBR0: VALID Position */ +#define ERRBNK_DEBR0_VALID_Msk (0x1UL << /*ERRBNK_DEBR0_VALID_Pos*/) /*!< ERRBNK DEBR0: VALID Mask */ + +/* ERRBNK Data Cache Error Bank Register 1 (DEBR1) Register Definitions */ +#define ERRBNK_DEBR1_SWDEF_Pos 30U /*!< ERRBNK DEBR1: SWDEF Position */ +#define ERRBNK_DEBR1_SWDEF_Msk (0x3UL << ERRBNK_DEBR1_SWDEF_Pos) /*!< ERRBNK DEBR1: SWDEF Mask */ + +#define ERRBNK_DEBR1_TYPE_Pos 17U /*!< ERRBNK DEBR1: TYPE Position */ +#define ERRBNK_DEBR1_TYPE_Msk (0x1UL << ERRBNK_DEBR1_TYPE_Pos) /*!< ERRBNK DEBR1: TYPE Mask */ + +#define ERRBNK_DEBR1_BANK_Pos 16U /*!< ERRBNK DEBR1: BANK Position */ +#define ERRBNK_DEBR1_BANK_Msk (0x1UL << ERRBNK_DEBR1_BANK_Pos) /*!< ERRBNK DEBR1: BANK Mask */ + +#define ERRBNK_DEBR1_LOCATION_Pos 2U /*!< ERRBNK DEBR1: LOCATION Position */ +#define ERRBNK_DEBR1_LOCATION_Msk (0x3FFFUL << ERRBNK_DEBR1_LOCATION_Pos) /*!< ERRBNK DEBR1: LOCATION Mask */ + +#define ERRBNK_DEBR1_LOCKED_Pos 1U /*!< ERRBNK DEBR1: LOCKED Position */ +#define ERRBNK_DEBR1_LOCKED_Msk (0x1UL << ERRBNK_DEBR1_LOCKED_Pos) /*!< ERRBNK DEBR1: LOCKED Mask */ + +#define ERRBNK_DEBR1_VALID_Pos 0U /*!< ERRBNK DEBR1: VALID Position */ +#define ERRBNK_DEBR1_VALID_Msk (0x1UL << /*ERRBNK_DEBR1_VALID_Pos*/) /*!< ERRBNK DEBR1: VALID Mask */ + +/* ERRBNK TCM Error Bank Register 0 (TEBR0) Register Definitions */ +#define ERRBNK_TEBR0_SWDEF_Pos 30U /*!< ERRBNK TEBR0: SWDEF Position */ +#define ERRBNK_TEBR0_SWDEF_Msk (0x3UL << ERRBNK_TEBR0_SWDEF_Pos) /*!< ERRBNK TEBR0: SWDEF Mask */ + +#define ERRBNK_TEBR0_POISON_Pos 28U /*!< ERRBNK TEBR0: POISON Position */ +#define ERRBNK_TEBR0_POISON_Msk (0x1UL << ERRBNK_TEBR0_POISON_Pos) /*!< ERRBNK TEBR0: POISON Mask */ + +#define ERRBNK_TEBR0_TYPE_Pos 27U /*!< ERRBNK TEBR0: TYPE Position */ +#define ERRBNK_TEBR0_TYPE_Msk (0x1UL << ERRBNK_TEBR0_TYPE_Pos) /*!< ERRBNK TEBR0: TYPE Mask */ + +#define ERRBNK_TEBR0_BANK_Pos 24U /*!< ERRBNK TEBR0: BANK Position */ +#define ERRBNK_TEBR0_BANK_Msk (0x3UL << ERRBNK_TEBR0_BANK_Pos) /*!< ERRBNK TEBR0: BANK Mask */ + +#define ERRBNK_TEBR0_LOCATION_Pos 2U /*!< ERRBNK TEBR0: LOCATION Position */ +#define ERRBNK_TEBR0_LOCATION_Msk (0x3FFFFFUL << ERRBNK_TEBR0_LOCATION_Pos) /*!< ERRBNK TEBR0: LOCATION Mask */ + +#define ERRBNK_TEBR0_LOCKED_Pos 1U /*!< ERRBNK TEBR0: LOCKED Position */ +#define ERRBNK_TEBR0_LOCKED_Msk (0x1UL << ERRBNK_TEBR0_LOCKED_Pos) /*!< ERRBNK TEBR0: LOCKED Mask */ + +#define ERRBNK_TEBR0_VALID_Pos 0U /*!< ERRBNK TEBR0: VALID Position */ +#define ERRBNK_TEBR0_VALID_Msk (0x1UL << /*ERRBNK_TEBR0_VALID_Pos*/) /*!< ERRBNK TEBR0: VALID Mask */ + +/* ERRBNK TCM Error Bank Register 1 (TEBR1) Register Definitions */ +#define ERRBNK_TEBR1_SWDEF_Pos 30U /*!< ERRBNK TEBR1: SWDEF Position */ +#define ERRBNK_TEBR1_SWDEF_Msk (0x3UL << ERRBNK_TEBR1_SWDEF_Pos) /*!< ERRBNK TEBR1: SWDEF Mask */ + +#define ERRBNK_TEBR1_POISON_Pos 28U /*!< ERRBNK TEBR1: POISON Position */ +#define ERRBNK_TEBR1_POISON_Msk (0x1UL << ERRBNK_TEBR1_POISON_Pos) /*!< ERRBNK TEBR1: POISON Mask */ + +#define ERRBNK_TEBR1_TYPE_Pos 27U /*!< ERRBNK TEBR1: TYPE Position */ +#define ERRBNK_TEBR1_TYPE_Msk (0x1UL << ERRBNK_TEBR1_TYPE_Pos) /*!< ERRBNK TEBR1: TYPE Mask */ + +#define ERRBNK_TEBR1_BANK_Pos 24U /*!< ERRBNK TEBR1: BANK Position */ +#define ERRBNK_TEBR1_BANK_Msk (0x3UL << ERRBNK_TEBR1_BANK_Pos) /*!< ERRBNK TEBR1: BANK Mask */ + +#define ERRBNK_TEBR1_LOCATION_Pos 2U /*!< ERRBNK TEBR1: LOCATION Position */ +#define ERRBNK_TEBR1_LOCATION_Msk (0x3FFFFFUL << ERRBNK_TEBR1_LOCATION_Pos) /*!< ERRBNK TEBR1: LOCATION Mask */ + +#define ERRBNK_TEBR1_LOCKED_Pos 1U /*!< ERRBNK TEBR1: LOCKED Position */ +#define ERRBNK_TEBR1_LOCKED_Msk (0x1UL << ERRBNK_TEBR1_LOCKED_Pos) /*!< ERRBNK TEBR1: LOCKED Mask */ + +#define ERRBNK_TEBR1_VALID_Pos 0U /*!< ERRBNK TEBR1: VALID Position */ +#define ERRBNK_TEBR1_VALID_Msk (0x1UL << /*ERRBNK_TEBR1_VALID_Pos*/) /*!< ERRBNK TEBR1: VALID Mask */ + +/*@}*/ /* end of group ErrBnk_Type */ + + +/** + \ingroup CMSIS_core_register + \defgroup PrcCfgInf_Type Processor Configuration Information Registers (IMPLEMENTATION DEFINED) + \brief Type definitions for the Processor Configuration Information Registerss (PRCCFGINF) + @{ + */ + +/** + \brief Structure type to access the Processor Configuration Information Registerss (PRCCFGINF). + */ +typedef struct +{ + __OM uint32_t CFGINFOSEL; /*!< Offset: 0x000 ( /W) Processor Configuration Information Selection Register */ + __IM uint32_t CFGINFORD; /*!< Offset: 0x004 (R/ ) Processor Configuration Information Read Data Register */ +} PrcCfgInf_Type; + +/* PRCCFGINF Processor Configuration Information Selection Register (CFGINFOSEL) Definitions */ + +/* PRCCFGINF Processor Configuration Information Read Data Register (CFGINFORD) Definitions */ + +/*@}*/ /* end of group PrcCfgInf_Type */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Sizes Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Sizes Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IOM uint32_t PSCR; /*!< Offset: 0x308 (R/W) Periodic Synchronization Control Register */ + uint32_t RESERVED3[809U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) Software Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) Software Lock Status Register */ + uint32_t RESERVED4[4U]; + __IM uint32_t TYPE; /*!< Offset: 0xFC8 (R/ ) Device Identifier Register */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Register */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_SWOSCALER_Pos 0U /*!< TPI ACPR: SWOSCALER Position */ +#define TPI_ACPR_SWOSCALER_Msk (0xFFFFUL /*<< TPI_ACPR_SWOSCALER_Pos*/) /*!< TPI ACPR: SWOSCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_FOnMan_Pos 6U /*!< TPI FFCR: FOnMan Position */ +#define TPI_FFCR_FOnMan_Msk (0x1UL << TPI_FFCR_FOnMan_Pos) /*!< TPI FFCR: FOnMan Mask */ + +#define TPI_FFCR_EnFmt_Pos 0U /*!< TPI FFCR: EnFmt Position */ +#define TPI_FFCR_EnFmt_Msk (0x3UL << /*TPI_FFCR_EnFmt_Pos*/) /*!< TPI FFCR: EnFmt Mask */ + +/* TPI Periodic Synchronization Control Register Definitions */ +#define TPI_PSCR_PSCount_Pos 0U /*!< TPI PSCR: PSCount Position */ +#define TPI_PSCR_PSCount_Msk (0x1FUL /*<< TPI_PSCR_PSCount_Pos*/) /*!< TPI PSCR: TPSCount Mask */ + +/* TPI Software Lock Status Register Definitions */ +#define TPI_LSR_nTT_Pos 1U /*!< TPI LSR: Not thirty-two bit. Position */ +#define TPI_LSR_nTT_Msk (0x1UL << TPI_LSR_nTT_Pos) /*!< TPI LSR: Not thirty-two bit. Mask */ + +#define TPI_LSR_SLK_Pos 1U /*!< TPI LSR: Software Lock status Position */ +#define TPI_LSR_SLK_Msk (0x1UL << TPI_LSR_SLK_Pos) /*!< TPI LSR: Software Lock status Mask */ + +#define TPI_LSR_SLI_Pos 0U /*!< TPI LSR: Software Lock implemented Position */ +#define TPI_LSR_SLI_Msk (0x1UL /*<< TPI_LSR_SLI_Pos*/) /*!< TPI LSR: Software Lock implemented Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_FIFOSZ_Pos 6U /*!< TPI DEVID: FIFO depth Position */ +#define TPI_DEVID_FIFOSZ_Msk (0x7UL << TPI_DEVID_FIFOSZ_Pos) /*!< TPI DEVID: FIFO depth Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + +#if defined (__PMU_PRESENT) && (__PMU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_PMU Performance Monitoring Unit (PMU) + \brief Type definitions for the Performance Monitoring Unit (PMU) + @{ + */ + +/** + \brief Structure type to access the Performance Monitoring Unit (PMU). + */ +typedef struct +{ + __IOM uint32_t EVCNTR[__PMU_NUM_EVENTCNT]; /*!< Offset: 0x0 (R/W) PMU Event Counter Registers */ +#if __PMU_NUM_EVENTCNT<31 + uint32_t RESERVED0[31U-__PMU_NUM_EVENTCNT]; +#endif + __IOM uint32_t CCNTR; /*!< Offset: 0x7C (R/W) PMU Cycle Counter Register */ + uint32_t RESERVED1[224]; + __IOM uint32_t EVTYPER[__PMU_NUM_EVENTCNT]; /*!< Offset: 0x400 (R/W) PMU Event Type and Filter Registers */ +#if __PMU_NUM_EVENTCNT<31 + uint32_t RESERVED2[31U-__PMU_NUM_EVENTCNT]; +#endif + __IOM uint32_t CCFILTR; /*!< Offset: 0x47C (R/W) PMU Cycle Counter Filter Register */ + uint32_t RESERVED3[480]; + __IOM uint32_t CNTENSET; /*!< Offset: 0xC00 (R/W) PMU Count Enable Set Register */ + uint32_t RESERVED4[7]; + __IOM uint32_t CNTENCLR; /*!< Offset: 0xC20 (R/W) PMU Count Enable Clear Register */ + uint32_t RESERVED5[7]; + __IOM uint32_t INTENSET; /*!< Offset: 0xC40 (R/W) PMU Interrupt Enable Set Register */ + uint32_t RESERVED6[7]; + __IOM uint32_t INTENCLR; /*!< Offset: 0xC60 (R/W) PMU Interrupt Enable Clear Register */ + uint32_t RESERVED7[7]; + __IOM uint32_t OVSCLR; /*!< Offset: 0xC80 (R/W) PMU Overflow Flag Status Clear Register */ + uint32_t RESERVED8[7]; + __IOM uint32_t SWINC; /*!< Offset: 0xCA0 (R/W) PMU Software Increment Register */ + uint32_t RESERVED9[7]; + __IOM uint32_t OVSSET; /*!< Offset: 0xCC0 (R/W) PMU Overflow Flag Status Set Register */ + uint32_t RESERVED10[79]; + __IOM uint32_t TYPE; /*!< Offset: 0xE00 (R/W) PMU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0xE04 (R/W) PMU Control Register */ + uint32_t RESERVED11[108]; + __IOM uint32_t AUTHSTATUS; /*!< Offset: 0xFB8 (R/W) PMU Authentication Status Register */ + __IOM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/W) PMU Device Architecture Register */ + uint32_t RESERVED12[3]; + __IOM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/W) PMU Device Type Register */ + __IOM uint32_t PIDR4; /*!< Offset: 0xFD0 (R/W) PMU Peripheral Identification Register 4 */ + uint32_t RESERVED13[3]; + __IOM uint32_t PIDR0; /*!< Offset: 0xFE0 (R/W) PMU Peripheral Identification Register 0 */ + __IOM uint32_t PIDR1; /*!< Offset: 0xFE4 (R/W) PMU Peripheral Identification Register 1 */ + __IOM uint32_t PIDR2; /*!< Offset: 0xFE8 (R/W) PMU Peripheral Identification Register 2 */ + __IOM uint32_t PIDR3; /*!< Offset: 0xFEC (R/W) PMU Peripheral Identification Register 3 */ + __IOM uint32_t CIDR0; /*!< Offset: 0xFF0 (R/W) PMU Component Identification Register 0 */ + __IOM uint32_t CIDR1; /*!< Offset: 0xFF4 (R/W) PMU Component Identification Register 1 */ + __IOM uint32_t CIDR2; /*!< Offset: 0xFF8 (R/W) PMU Component Identification Register 2 */ + __IOM uint32_t CIDR3; /*!< Offset: 0xFFC (R/W) PMU Component Identification Register 3 */ +} PMU_Type; + +/** \brief PMU Event Counter Registers (0-30) Definitions */ + +#define PMU_EVCNTR_CNT_Pos 0U /*!< PMU EVCNTR: Counter Position */ +#define PMU_EVCNTR_CNT_Msk (0xFFFFUL /*<< PMU_EVCNTRx_CNT_Pos*/) /*!< PMU EVCNTR: Counter Mask */ + +/** \brief PMU Event Type and Filter Registers (0-30) Definitions */ + +#define PMU_EVTYPER_EVENTTOCNT_Pos 0U /*!< PMU EVTYPER: Event to Count Position */ +#define PMU_EVTYPER_EVENTTOCNT_Msk (0xFFFFUL /*<< EVTYPERx_EVENTTOCNT_Pos*/) /*!< PMU EVTYPER: Event to Count Mask */ + +/** \brief PMU Count Enable Set Register Definitions */ + +#define PMU_CNTENSET_CNT0_ENABLE_Pos 0U /*!< PMU CNTENSET: Event Counter 0 Enable Set Position */ +#define PMU_CNTENSET_CNT0_ENABLE_Msk (1UL /*<< PMU_CNTENSET_CNT0_ENABLE_Pos*/) /*!< PMU CNTENSET: Event Counter 0 Enable Set Mask */ + +#define PMU_CNTENSET_CNT1_ENABLE_Pos 1U /*!< PMU CNTENSET: Event Counter 1 Enable Set Position */ +#define PMU_CNTENSET_CNT1_ENABLE_Msk (1UL << PMU_CNTENSET_CNT1_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 1 Enable Set Mask */ + +#define PMU_CNTENSET_CNT2_ENABLE_Pos 2U /*!< PMU CNTENSET: Event Counter 2 Enable Set Position */ +#define PMU_CNTENSET_CNT2_ENABLE_Msk (1UL << PMU_CNTENSET_CNT2_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 2 Enable Set Mask */ + +#define PMU_CNTENSET_CNT3_ENABLE_Pos 3U /*!< PMU CNTENSET: Event Counter 3 Enable Set Position */ +#define PMU_CNTENSET_CNT3_ENABLE_Msk (1UL << PMU_CNTENSET_CNT3_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 3 Enable Set Mask */ + +#define PMU_CNTENSET_CNT4_ENABLE_Pos 4U /*!< PMU CNTENSET: Event Counter 4 Enable Set Position */ +#define PMU_CNTENSET_CNT4_ENABLE_Msk (1UL << PMU_CNTENSET_CNT4_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 4 Enable Set Mask */ + +#define PMU_CNTENSET_CNT5_ENABLE_Pos 5U /*!< PMU CNTENSET: Event Counter 5 Enable Set Position */ +#define PMU_CNTENSET_CNT5_ENABLE_Msk (1UL << PMU_CNTENSET_CNT5_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 5 Enable Set Mask */ + +#define PMU_CNTENSET_CNT6_ENABLE_Pos 6U /*!< PMU CNTENSET: Event Counter 6 Enable Set Position */ +#define PMU_CNTENSET_CNT6_ENABLE_Msk (1UL << PMU_CNTENSET_CNT6_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 6 Enable Set Mask */ + +#define PMU_CNTENSET_CNT7_ENABLE_Pos 7U /*!< PMU CNTENSET: Event Counter 7 Enable Set Position */ +#define PMU_CNTENSET_CNT7_ENABLE_Msk (1UL << PMU_CNTENSET_CNT7_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 7 Enable Set Mask */ + +#define PMU_CNTENSET_CNT8_ENABLE_Pos 8U /*!< PMU CNTENSET: Event Counter 8 Enable Set Position */ +#define PMU_CNTENSET_CNT8_ENABLE_Msk (1UL << PMU_CNTENSET_CNT8_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 8 Enable Set Mask */ + +#define PMU_CNTENSET_CNT9_ENABLE_Pos 9U /*!< PMU CNTENSET: Event Counter 9 Enable Set Position */ +#define PMU_CNTENSET_CNT9_ENABLE_Msk (1UL << PMU_CNTENSET_CNT9_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 9 Enable Set Mask */ + +#define PMU_CNTENSET_CNT10_ENABLE_Pos 10U /*!< PMU CNTENSET: Event Counter 10 Enable Set Position */ +#define PMU_CNTENSET_CNT10_ENABLE_Msk (1UL << PMU_CNTENSET_CNT10_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 10 Enable Set Mask */ + +#define PMU_CNTENSET_CNT11_ENABLE_Pos 11U /*!< PMU CNTENSET: Event Counter 11 Enable Set Position */ +#define PMU_CNTENSET_CNT11_ENABLE_Msk (1UL << PMU_CNTENSET_CNT11_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 11 Enable Set Mask */ + +#define PMU_CNTENSET_CNT12_ENABLE_Pos 12U /*!< PMU CNTENSET: Event Counter 12 Enable Set Position */ +#define PMU_CNTENSET_CNT12_ENABLE_Msk (1UL << PMU_CNTENSET_CNT12_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 12 Enable Set Mask */ + +#define PMU_CNTENSET_CNT13_ENABLE_Pos 13U /*!< PMU CNTENSET: Event Counter 13 Enable Set Position */ +#define PMU_CNTENSET_CNT13_ENABLE_Msk (1UL << PMU_CNTENSET_CNT13_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 13 Enable Set Mask */ + +#define PMU_CNTENSET_CNT14_ENABLE_Pos 14U /*!< PMU CNTENSET: Event Counter 14 Enable Set Position */ +#define PMU_CNTENSET_CNT14_ENABLE_Msk (1UL << PMU_CNTENSET_CNT14_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 14 Enable Set Mask */ + +#define PMU_CNTENSET_CNT15_ENABLE_Pos 15U /*!< PMU CNTENSET: Event Counter 15 Enable Set Position */ +#define PMU_CNTENSET_CNT15_ENABLE_Msk (1UL << PMU_CNTENSET_CNT15_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 15 Enable Set Mask */ + +#define PMU_CNTENSET_CNT16_ENABLE_Pos 16U /*!< PMU CNTENSET: Event Counter 16 Enable Set Position */ +#define PMU_CNTENSET_CNT16_ENABLE_Msk (1UL << PMU_CNTENSET_CNT16_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 16 Enable Set Mask */ + +#define PMU_CNTENSET_CNT17_ENABLE_Pos 17U /*!< PMU CNTENSET: Event Counter 17 Enable Set Position */ +#define PMU_CNTENSET_CNT17_ENABLE_Msk (1UL << PMU_CNTENSET_CNT17_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 17 Enable Set Mask */ + +#define PMU_CNTENSET_CNT18_ENABLE_Pos 18U /*!< PMU CNTENSET: Event Counter 18 Enable Set Position */ +#define PMU_CNTENSET_CNT18_ENABLE_Msk (1UL << PMU_CNTENSET_CNT18_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 18 Enable Set Mask */ + +#define PMU_CNTENSET_CNT19_ENABLE_Pos 19U /*!< PMU CNTENSET: Event Counter 19 Enable Set Position */ +#define PMU_CNTENSET_CNT19_ENABLE_Msk (1UL << PMU_CNTENSET_CNT19_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 19 Enable Set Mask */ + +#define PMU_CNTENSET_CNT20_ENABLE_Pos 20U /*!< PMU CNTENSET: Event Counter 20 Enable Set Position */ +#define PMU_CNTENSET_CNT20_ENABLE_Msk (1UL << PMU_CNTENSET_CNT20_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 20 Enable Set Mask */ + +#define PMU_CNTENSET_CNT21_ENABLE_Pos 21U /*!< PMU CNTENSET: Event Counter 21 Enable Set Position */ +#define PMU_CNTENSET_CNT21_ENABLE_Msk (1UL << PMU_CNTENSET_CNT21_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 21 Enable Set Mask */ + +#define PMU_CNTENSET_CNT22_ENABLE_Pos 22U /*!< PMU CNTENSET: Event Counter 22 Enable Set Position */ +#define PMU_CNTENSET_CNT22_ENABLE_Msk (1UL << PMU_CNTENSET_CNT22_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 22 Enable Set Mask */ + +#define PMU_CNTENSET_CNT23_ENABLE_Pos 23U /*!< PMU CNTENSET: Event Counter 23 Enable Set Position */ +#define PMU_CNTENSET_CNT23_ENABLE_Msk (1UL << PMU_CNTENSET_CNT23_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 23 Enable Set Mask */ + +#define PMU_CNTENSET_CNT24_ENABLE_Pos 24U /*!< PMU CNTENSET: Event Counter 24 Enable Set Position */ +#define PMU_CNTENSET_CNT24_ENABLE_Msk (1UL << PMU_CNTENSET_CNT24_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 24 Enable Set Mask */ + +#define PMU_CNTENSET_CNT25_ENABLE_Pos 25U /*!< PMU CNTENSET: Event Counter 25 Enable Set Position */ +#define PMU_CNTENSET_CNT25_ENABLE_Msk (1UL << PMU_CNTENSET_CNT25_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 25 Enable Set Mask */ + +#define PMU_CNTENSET_CNT26_ENABLE_Pos 26U /*!< PMU CNTENSET: Event Counter 26 Enable Set Position */ +#define PMU_CNTENSET_CNT26_ENABLE_Msk (1UL << PMU_CNTENSET_CNT26_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 26 Enable Set Mask */ + +#define PMU_CNTENSET_CNT27_ENABLE_Pos 27U /*!< PMU CNTENSET: Event Counter 27 Enable Set Position */ +#define PMU_CNTENSET_CNT27_ENABLE_Msk (1UL << PMU_CNTENSET_CNT27_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 27 Enable Set Mask */ + +#define PMU_CNTENSET_CNT28_ENABLE_Pos 28U /*!< PMU CNTENSET: Event Counter 28 Enable Set Position */ +#define PMU_CNTENSET_CNT28_ENABLE_Msk (1UL << PMU_CNTENSET_CNT28_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 28 Enable Set Mask */ + +#define PMU_CNTENSET_CNT29_ENABLE_Pos 29U /*!< PMU CNTENSET: Event Counter 29 Enable Set Position */ +#define PMU_CNTENSET_CNT29_ENABLE_Msk (1UL << PMU_CNTENSET_CNT29_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 29 Enable Set Mask */ + +#define PMU_CNTENSET_CNT30_ENABLE_Pos 30U /*!< PMU CNTENSET: Event Counter 30 Enable Set Position */ +#define PMU_CNTENSET_CNT30_ENABLE_Msk (1UL << PMU_CNTENSET_CNT30_ENABLE_Pos) /*!< PMU CNTENSET: Event Counter 30 Enable Set Mask */ + +#define PMU_CNTENSET_CCNTR_ENABLE_Pos 31U /*!< PMU CNTENSET: Cycle Counter Enable Set Position */ +#define PMU_CNTENSET_CCNTR_ENABLE_Msk (1UL << PMU_CNTENSET_CCNTR_ENABLE_Pos) /*!< PMU CNTENSET: Cycle Counter Enable Set Mask */ + +/** \brief PMU Count Enable Clear Register Definitions */ + +#define PMU_CNTENSET_CNT0_ENABLE_Pos 0U /*!< PMU CNTENCLR: Event Counter 0 Enable Clear Position */ +#define PMU_CNTENCLR_CNT0_ENABLE_Msk (1UL /*<< PMU_CNTENCLR_CNT0_ENABLE_Pos*/) /*!< PMU CNTENCLR: Event Counter 0 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT1_ENABLE_Pos 1U /*!< PMU CNTENCLR: Event Counter 1 Enable Clear Position */ +#define PMU_CNTENCLR_CNT1_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT1_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 1 Enable Clear */ + +#define PMU_CNTENCLR_CNT2_ENABLE_Pos 2U /*!< PMU CNTENCLR: Event Counter 2 Enable Clear Position */ +#define PMU_CNTENCLR_CNT2_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT2_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 2 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT3_ENABLE_Pos 3U /*!< PMU CNTENCLR: Event Counter 3 Enable Clear Position */ +#define PMU_CNTENCLR_CNT3_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT3_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 3 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT4_ENABLE_Pos 4U /*!< PMU CNTENCLR: Event Counter 4 Enable Clear Position */ +#define PMU_CNTENCLR_CNT4_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT4_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 4 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT5_ENABLE_Pos 5U /*!< PMU CNTENCLR: Event Counter 5 Enable Clear Position */ +#define PMU_CNTENCLR_CNT5_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT5_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 5 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT6_ENABLE_Pos 6U /*!< PMU CNTENCLR: Event Counter 6 Enable Clear Position */ +#define PMU_CNTENCLR_CNT6_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT6_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 6 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT7_ENABLE_Pos 7U /*!< PMU CNTENCLR: Event Counter 7 Enable Clear Position */ +#define PMU_CNTENCLR_CNT7_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT7_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 7 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT8_ENABLE_Pos 8U /*!< PMU CNTENCLR: Event Counter 8 Enable Clear Position */ +#define PMU_CNTENCLR_CNT8_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT8_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 8 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT9_ENABLE_Pos 9U /*!< PMU CNTENCLR: Event Counter 9 Enable Clear Position */ +#define PMU_CNTENCLR_CNT9_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT9_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 9 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT10_ENABLE_Pos 10U /*!< PMU CNTENCLR: Event Counter 10 Enable Clear Position */ +#define PMU_CNTENCLR_CNT10_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT10_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 10 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT11_ENABLE_Pos 11U /*!< PMU CNTENCLR: Event Counter 11 Enable Clear Position */ +#define PMU_CNTENCLR_CNT11_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT11_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 11 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT12_ENABLE_Pos 12U /*!< PMU CNTENCLR: Event Counter 12 Enable Clear Position */ +#define PMU_CNTENCLR_CNT12_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT12_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 12 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT13_ENABLE_Pos 13U /*!< PMU CNTENCLR: Event Counter 13 Enable Clear Position */ +#define PMU_CNTENCLR_CNT13_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT13_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 13 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT14_ENABLE_Pos 14U /*!< PMU CNTENCLR: Event Counter 14 Enable Clear Position */ +#define PMU_CNTENCLR_CNT14_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT14_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 14 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT15_ENABLE_Pos 15U /*!< PMU CNTENCLR: Event Counter 15 Enable Clear Position */ +#define PMU_CNTENCLR_CNT15_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT15_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 15 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT16_ENABLE_Pos 16U /*!< PMU CNTENCLR: Event Counter 16 Enable Clear Position */ +#define PMU_CNTENCLR_CNT16_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT16_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 16 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT17_ENABLE_Pos 17U /*!< PMU CNTENCLR: Event Counter 17 Enable Clear Position */ +#define PMU_CNTENCLR_CNT17_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT17_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 17 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT18_ENABLE_Pos 18U /*!< PMU CNTENCLR: Event Counter 18 Enable Clear Position */ +#define PMU_CNTENCLR_CNT18_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT18_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 18 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT19_ENABLE_Pos 19U /*!< PMU CNTENCLR: Event Counter 19 Enable Clear Position */ +#define PMU_CNTENCLR_CNT19_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT19_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 19 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT20_ENABLE_Pos 20U /*!< PMU CNTENCLR: Event Counter 20 Enable Clear Position */ +#define PMU_CNTENCLR_CNT20_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT20_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 20 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT21_ENABLE_Pos 21U /*!< PMU CNTENCLR: Event Counter 21 Enable Clear Position */ +#define PMU_CNTENCLR_CNT21_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT21_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 21 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT22_ENABLE_Pos 22U /*!< PMU CNTENCLR: Event Counter 22 Enable Clear Position */ +#define PMU_CNTENCLR_CNT22_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT22_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 22 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT23_ENABLE_Pos 23U /*!< PMU CNTENCLR: Event Counter 23 Enable Clear Position */ +#define PMU_CNTENCLR_CNT23_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT23_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 23 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT24_ENABLE_Pos 24U /*!< PMU CNTENCLR: Event Counter 24 Enable Clear Position */ +#define PMU_CNTENCLR_CNT24_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT24_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 24 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT25_ENABLE_Pos 25U /*!< PMU CNTENCLR: Event Counter 25 Enable Clear Position */ +#define PMU_CNTENCLR_CNT25_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT25_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 25 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT26_ENABLE_Pos 26U /*!< PMU CNTENCLR: Event Counter 26 Enable Clear Position */ +#define PMU_CNTENCLR_CNT26_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT26_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 26 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT27_ENABLE_Pos 27U /*!< PMU CNTENCLR: Event Counter 27 Enable Clear Position */ +#define PMU_CNTENCLR_CNT27_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT27_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 27 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT28_ENABLE_Pos 28U /*!< PMU CNTENCLR: Event Counter 28 Enable Clear Position */ +#define PMU_CNTENCLR_CNT28_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT28_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 28 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT29_ENABLE_Pos 29U /*!< PMU CNTENCLR: Event Counter 29 Enable Clear Position */ +#define PMU_CNTENCLR_CNT29_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT29_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 29 Enable Clear Mask */ + +#define PMU_CNTENCLR_CNT30_ENABLE_Pos 30U /*!< PMU CNTENCLR: Event Counter 30 Enable Clear Position */ +#define PMU_CNTENCLR_CNT30_ENABLE_Msk (1UL << PMU_CNTENCLR_CNT30_ENABLE_Pos) /*!< PMU CNTENCLR: Event Counter 30 Enable Clear Mask */ + +#define PMU_CNTENCLR_CCNTR_ENABLE_Pos 31U /*!< PMU CNTENCLR: Cycle Counter Enable Clear Position */ +#define PMU_CNTENCLR_CCNTR_ENABLE_Msk (1UL << PMU_CNTENCLR_CCNTR_ENABLE_Pos) /*!< PMU CNTENCLR: Cycle Counter Enable Clear Mask */ + +/** \brief PMU Interrupt Enable Set Register Definitions */ + +#define PMU_INTENSET_CNT0_ENABLE_Pos 0U /*!< PMU INTENSET: Event Counter 0 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT0_ENABLE_Msk (1UL /*<< PMU_INTENSET_CNT0_ENABLE_Pos*/) /*!< PMU INTENSET: Event Counter 0 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT1_ENABLE_Pos 1U /*!< PMU INTENSET: Event Counter 1 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT1_ENABLE_Msk (1UL << PMU_INTENSET_CNT1_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 1 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT2_ENABLE_Pos 2U /*!< PMU INTENSET: Event Counter 2 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT2_ENABLE_Msk (1UL << PMU_INTENSET_CNT2_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 2 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT3_ENABLE_Pos 3U /*!< PMU INTENSET: Event Counter 3 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT3_ENABLE_Msk (1UL << PMU_INTENSET_CNT3_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 3 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT4_ENABLE_Pos 4U /*!< PMU INTENSET: Event Counter 4 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT4_ENABLE_Msk (1UL << PMU_INTENSET_CNT4_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 4 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT5_ENABLE_Pos 5U /*!< PMU INTENSET: Event Counter 5 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT5_ENABLE_Msk (1UL << PMU_INTENSET_CNT5_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 5 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT6_ENABLE_Pos 6U /*!< PMU INTENSET: Event Counter 6 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT6_ENABLE_Msk (1UL << PMU_INTENSET_CNT6_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 6 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT7_ENABLE_Pos 7U /*!< PMU INTENSET: Event Counter 7 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT7_ENABLE_Msk (1UL << PMU_INTENSET_CNT7_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 7 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT8_ENABLE_Pos 8U /*!< PMU INTENSET: Event Counter 8 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT8_ENABLE_Msk (1UL << PMU_INTENSET_CNT8_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 8 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT9_ENABLE_Pos 9U /*!< PMU INTENSET: Event Counter 9 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT9_ENABLE_Msk (1UL << PMU_INTENSET_CNT9_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 9 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT10_ENABLE_Pos 10U /*!< PMU INTENSET: Event Counter 10 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT10_ENABLE_Msk (1UL << PMU_INTENSET_CNT10_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 10 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT11_ENABLE_Pos 11U /*!< PMU INTENSET: Event Counter 11 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT11_ENABLE_Msk (1UL << PMU_INTENSET_CNT11_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 11 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT12_ENABLE_Pos 12U /*!< PMU INTENSET: Event Counter 12 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT12_ENABLE_Msk (1UL << PMU_INTENSET_CNT12_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 12 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT13_ENABLE_Pos 13U /*!< PMU INTENSET: Event Counter 13 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT13_ENABLE_Msk (1UL << PMU_INTENSET_CNT13_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 13 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT14_ENABLE_Pos 14U /*!< PMU INTENSET: Event Counter 14 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT14_ENABLE_Msk (1UL << PMU_INTENSET_CNT14_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 14 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT15_ENABLE_Pos 15U /*!< PMU INTENSET: Event Counter 15 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT15_ENABLE_Msk (1UL << PMU_INTENSET_CNT15_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 15 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT16_ENABLE_Pos 16U /*!< PMU INTENSET: Event Counter 16 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT16_ENABLE_Msk (1UL << PMU_INTENSET_CNT16_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 16 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT17_ENABLE_Pos 17U /*!< PMU INTENSET: Event Counter 17 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT17_ENABLE_Msk (1UL << PMU_INTENSET_CNT17_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 17 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT18_ENABLE_Pos 18U /*!< PMU INTENSET: Event Counter 18 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT18_ENABLE_Msk (1UL << PMU_INTENSET_CNT18_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 18 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT19_ENABLE_Pos 19U /*!< PMU INTENSET: Event Counter 19 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT19_ENABLE_Msk (1UL << PMU_INTENSET_CNT19_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 19 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT20_ENABLE_Pos 20U /*!< PMU INTENSET: Event Counter 20 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT20_ENABLE_Msk (1UL << PMU_INTENSET_CNT20_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 20 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT21_ENABLE_Pos 21U /*!< PMU INTENSET: Event Counter 21 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT21_ENABLE_Msk (1UL << PMU_INTENSET_CNT21_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 21 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT22_ENABLE_Pos 22U /*!< PMU INTENSET: Event Counter 22 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT22_ENABLE_Msk (1UL << PMU_INTENSET_CNT22_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 22 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT23_ENABLE_Pos 23U /*!< PMU INTENSET: Event Counter 23 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT23_ENABLE_Msk (1UL << PMU_INTENSET_CNT23_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 23 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT24_ENABLE_Pos 24U /*!< PMU INTENSET: Event Counter 24 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT24_ENABLE_Msk (1UL << PMU_INTENSET_CNT24_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 24 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT25_ENABLE_Pos 25U /*!< PMU INTENSET: Event Counter 25 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT25_ENABLE_Msk (1UL << PMU_INTENSET_CNT25_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 25 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT26_ENABLE_Pos 26U /*!< PMU INTENSET: Event Counter 26 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT26_ENABLE_Msk (1UL << PMU_INTENSET_CNT26_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 26 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT27_ENABLE_Pos 27U /*!< PMU INTENSET: Event Counter 27 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT27_ENABLE_Msk (1UL << PMU_INTENSET_CNT27_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 27 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT28_ENABLE_Pos 28U /*!< PMU INTENSET: Event Counter 28 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT28_ENABLE_Msk (1UL << PMU_INTENSET_CNT28_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 28 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT29_ENABLE_Pos 29U /*!< PMU INTENSET: Event Counter 29 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT29_ENABLE_Msk (1UL << PMU_INTENSET_CNT29_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 29 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CNT30_ENABLE_Pos 30U /*!< PMU INTENSET: Event Counter 30 Interrupt Enable Set Position */ +#define PMU_INTENSET_CNT30_ENABLE_Msk (1UL << PMU_INTENSET_CNT30_ENABLE_Pos) /*!< PMU INTENSET: Event Counter 30 Interrupt Enable Set Mask */ + +#define PMU_INTENSET_CYCCNT_ENABLE_Pos 31U /*!< PMU INTENSET: Cycle Counter Interrupt Enable Set Position */ +#define PMU_INTENSET_CCYCNT_ENABLE_Msk (1UL << PMU_INTENSET_CYCCNT_ENABLE_Pos) /*!< PMU INTENSET: Cycle Counter Interrupt Enable Set Mask */ + +/** \brief PMU Interrupt Enable Clear Register Definitions */ + +#define PMU_INTENSET_CNT0_ENABLE_Pos 0U /*!< PMU INTENCLR: Event Counter 0 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT0_ENABLE_Msk (1UL /*<< PMU_INTENCLR_CNT0_ENABLE_Pos*/) /*!< PMU INTENCLR: Event Counter 0 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT1_ENABLE_Pos 1U /*!< PMU INTENCLR: Event Counter 1 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT1_ENABLE_Msk (1UL << PMU_INTENCLR_CNT1_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 1 Interrupt Enable Clear */ + +#define PMU_INTENCLR_CNT2_ENABLE_Pos 2U /*!< PMU INTENCLR: Event Counter 2 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT2_ENABLE_Msk (1UL << PMU_INTENCLR_CNT2_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 2 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT3_ENABLE_Pos 3U /*!< PMU INTENCLR: Event Counter 3 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT3_ENABLE_Msk (1UL << PMU_INTENCLR_CNT3_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 3 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT4_ENABLE_Pos 4U /*!< PMU INTENCLR: Event Counter 4 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT4_ENABLE_Msk (1UL << PMU_INTENCLR_CNT4_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 4 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT5_ENABLE_Pos 5U /*!< PMU INTENCLR: Event Counter 5 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT5_ENABLE_Msk (1UL << PMU_INTENCLR_CNT5_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 5 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT6_ENABLE_Pos 6U /*!< PMU INTENCLR: Event Counter 6 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT6_ENABLE_Msk (1UL << PMU_INTENCLR_CNT6_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 6 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT7_ENABLE_Pos 7U /*!< PMU INTENCLR: Event Counter 7 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT7_ENABLE_Msk (1UL << PMU_INTENCLR_CNT7_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 7 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT8_ENABLE_Pos 8U /*!< PMU INTENCLR: Event Counter 8 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT8_ENABLE_Msk (1UL << PMU_INTENCLR_CNT8_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 8 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT9_ENABLE_Pos 9U /*!< PMU INTENCLR: Event Counter 9 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT9_ENABLE_Msk (1UL << PMU_INTENCLR_CNT9_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 9 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT10_ENABLE_Pos 10U /*!< PMU INTENCLR: Event Counter 10 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT10_ENABLE_Msk (1UL << PMU_INTENCLR_CNT10_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 10 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT11_ENABLE_Pos 11U /*!< PMU INTENCLR: Event Counter 11 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT11_ENABLE_Msk (1UL << PMU_INTENCLR_CNT11_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 11 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT12_ENABLE_Pos 12U /*!< PMU INTENCLR: Event Counter 12 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT12_ENABLE_Msk (1UL << PMU_INTENCLR_CNT12_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 12 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT13_ENABLE_Pos 13U /*!< PMU INTENCLR: Event Counter 13 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT13_ENABLE_Msk (1UL << PMU_INTENCLR_CNT13_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 13 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT14_ENABLE_Pos 14U /*!< PMU INTENCLR: Event Counter 14 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT14_ENABLE_Msk (1UL << PMU_INTENCLR_CNT14_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 14 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT15_ENABLE_Pos 15U /*!< PMU INTENCLR: Event Counter 15 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT15_ENABLE_Msk (1UL << PMU_INTENCLR_CNT15_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 15 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT16_ENABLE_Pos 16U /*!< PMU INTENCLR: Event Counter 16 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT16_ENABLE_Msk (1UL << PMU_INTENCLR_CNT16_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 16 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT17_ENABLE_Pos 17U /*!< PMU INTENCLR: Event Counter 17 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT17_ENABLE_Msk (1UL << PMU_INTENCLR_CNT17_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 17 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT18_ENABLE_Pos 18U /*!< PMU INTENCLR: Event Counter 18 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT18_ENABLE_Msk (1UL << PMU_INTENCLR_CNT18_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 18 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT19_ENABLE_Pos 19U /*!< PMU INTENCLR: Event Counter 19 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT19_ENABLE_Msk (1UL << PMU_INTENCLR_CNT19_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 19 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT20_ENABLE_Pos 20U /*!< PMU INTENCLR: Event Counter 20 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT20_ENABLE_Msk (1UL << PMU_INTENCLR_CNT20_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 20 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT21_ENABLE_Pos 21U /*!< PMU INTENCLR: Event Counter 21 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT21_ENABLE_Msk (1UL << PMU_INTENCLR_CNT21_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 21 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT22_ENABLE_Pos 22U /*!< PMU INTENCLR: Event Counter 22 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT22_ENABLE_Msk (1UL << PMU_INTENCLR_CNT22_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 22 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT23_ENABLE_Pos 23U /*!< PMU INTENCLR: Event Counter 23 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT23_ENABLE_Msk (1UL << PMU_INTENCLR_CNT23_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 23 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT24_ENABLE_Pos 24U /*!< PMU INTENCLR: Event Counter 24 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT24_ENABLE_Msk (1UL << PMU_INTENCLR_CNT24_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 24 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT25_ENABLE_Pos 25U /*!< PMU INTENCLR: Event Counter 25 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT25_ENABLE_Msk (1UL << PMU_INTENCLR_CNT25_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 25 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT26_ENABLE_Pos 26U /*!< PMU INTENCLR: Event Counter 26 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT26_ENABLE_Msk (1UL << PMU_INTENCLR_CNT26_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 26 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT27_ENABLE_Pos 27U /*!< PMU INTENCLR: Event Counter 27 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT27_ENABLE_Msk (1UL << PMU_INTENCLR_CNT27_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 27 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT28_ENABLE_Pos 28U /*!< PMU INTENCLR: Event Counter 28 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT28_ENABLE_Msk (1UL << PMU_INTENCLR_CNT28_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 28 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT29_ENABLE_Pos 29U /*!< PMU INTENCLR: Event Counter 29 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT29_ENABLE_Msk (1UL << PMU_INTENCLR_CNT29_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 29 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CNT30_ENABLE_Pos 30U /*!< PMU INTENCLR: Event Counter 30 Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CNT30_ENABLE_Msk (1UL << PMU_INTENCLR_CNT30_ENABLE_Pos) /*!< PMU INTENCLR: Event Counter 30 Interrupt Enable Clear Mask */ + +#define PMU_INTENCLR_CYCCNT_ENABLE_Pos 31U /*!< PMU INTENCLR: Cycle Counter Interrupt Enable Clear Position */ +#define PMU_INTENCLR_CYCCNT_ENABLE_Msk (1UL << PMU_INTENCLR_CYCCNT_ENABLE_Pos) /*!< PMU INTENCLR: Cycle Counter Interrupt Enable Clear Mask */ + +/** \brief PMU Overflow Flag Status Set Register Definitions */ + +#define PMU_OVSSET_CNT0_STATUS_Pos 0U /*!< PMU OVSSET: Event Counter 0 Overflow Set Position */ +#define PMU_OVSSET_CNT0_STATUS_Msk (1UL /*<< PMU_OVSSET_CNT0_STATUS_Pos*/) /*!< PMU OVSSET: Event Counter 0 Overflow Set Mask */ + +#define PMU_OVSSET_CNT1_STATUS_Pos 1U /*!< PMU OVSSET: Event Counter 1 Overflow Set Position */ +#define PMU_OVSSET_CNT1_STATUS_Msk (1UL << PMU_OVSSET_CNT1_STATUS_Pos) /*!< PMU OVSSET: Event Counter 1 Overflow Set Mask */ + +#define PMU_OVSSET_CNT2_STATUS_Pos 2U /*!< PMU OVSSET: Event Counter 2 Overflow Set Position */ +#define PMU_OVSSET_CNT2_STATUS_Msk (1UL << PMU_OVSSET_CNT2_STATUS_Pos) /*!< PMU OVSSET: Event Counter 2 Overflow Set Mask */ + +#define PMU_OVSSET_CNT3_STATUS_Pos 3U /*!< PMU OVSSET: Event Counter 3 Overflow Set Position */ +#define PMU_OVSSET_CNT3_STATUS_Msk (1UL << PMU_OVSSET_CNT3_STATUS_Pos) /*!< PMU OVSSET: Event Counter 3 Overflow Set Mask */ + +#define PMU_OVSSET_CNT4_STATUS_Pos 4U /*!< PMU OVSSET: Event Counter 4 Overflow Set Position */ +#define PMU_OVSSET_CNT4_STATUS_Msk (1UL << PMU_OVSSET_CNT4_STATUS_Pos) /*!< PMU OVSSET: Event Counter 4 Overflow Set Mask */ + +#define PMU_OVSSET_CNT5_STATUS_Pos 5U /*!< PMU OVSSET: Event Counter 5 Overflow Set Position */ +#define PMU_OVSSET_CNT5_STATUS_Msk (1UL << PMU_OVSSET_CNT5_STATUS_Pos) /*!< PMU OVSSET: Event Counter 5 Overflow Set Mask */ + +#define PMU_OVSSET_CNT6_STATUS_Pos 6U /*!< PMU OVSSET: Event Counter 6 Overflow Set Position */ +#define PMU_OVSSET_CNT6_STATUS_Msk (1UL << PMU_OVSSET_CNT6_STATUS_Pos) /*!< PMU OVSSET: Event Counter 6 Overflow Set Mask */ + +#define PMU_OVSSET_CNT7_STATUS_Pos 7U /*!< PMU OVSSET: Event Counter 7 Overflow Set Position */ +#define PMU_OVSSET_CNT7_STATUS_Msk (1UL << PMU_OVSSET_CNT7_STATUS_Pos) /*!< PMU OVSSET: Event Counter 7 Overflow Set Mask */ + +#define PMU_OVSSET_CNT8_STATUS_Pos 8U /*!< PMU OVSSET: Event Counter 8 Overflow Set Position */ +#define PMU_OVSSET_CNT8_STATUS_Msk (1UL << PMU_OVSSET_CNT8_STATUS_Pos) /*!< PMU OVSSET: Event Counter 8 Overflow Set Mask */ + +#define PMU_OVSSET_CNT9_STATUS_Pos 9U /*!< PMU OVSSET: Event Counter 9 Overflow Set Position */ +#define PMU_OVSSET_CNT9_STATUS_Msk (1UL << PMU_OVSSET_CNT9_STATUS_Pos) /*!< PMU OVSSET: Event Counter 9 Overflow Set Mask */ + +#define PMU_OVSSET_CNT10_STATUS_Pos 10U /*!< PMU OVSSET: Event Counter 10 Overflow Set Position */ +#define PMU_OVSSET_CNT10_STATUS_Msk (1UL << PMU_OVSSET_CNT10_STATUS_Pos) /*!< PMU OVSSET: Event Counter 10 Overflow Set Mask */ + +#define PMU_OVSSET_CNT11_STATUS_Pos 11U /*!< PMU OVSSET: Event Counter 11 Overflow Set Position */ +#define PMU_OVSSET_CNT11_STATUS_Msk (1UL << PMU_OVSSET_CNT11_STATUS_Pos) /*!< PMU OVSSET: Event Counter 11 Overflow Set Mask */ + +#define PMU_OVSSET_CNT12_STATUS_Pos 12U /*!< PMU OVSSET: Event Counter 12 Overflow Set Position */ +#define PMU_OVSSET_CNT12_STATUS_Msk (1UL << PMU_OVSSET_CNT12_STATUS_Pos) /*!< PMU OVSSET: Event Counter 12 Overflow Set Mask */ + +#define PMU_OVSSET_CNT13_STATUS_Pos 13U /*!< PMU OVSSET: Event Counter 13 Overflow Set Position */ +#define PMU_OVSSET_CNT13_STATUS_Msk (1UL << PMU_OVSSET_CNT13_STATUS_Pos) /*!< PMU OVSSET: Event Counter 13 Overflow Set Mask */ + +#define PMU_OVSSET_CNT14_STATUS_Pos 14U /*!< PMU OVSSET: Event Counter 14 Overflow Set Position */ +#define PMU_OVSSET_CNT14_STATUS_Msk (1UL << PMU_OVSSET_CNT14_STATUS_Pos) /*!< PMU OVSSET: Event Counter 14 Overflow Set Mask */ + +#define PMU_OVSSET_CNT15_STATUS_Pos 15U /*!< PMU OVSSET: Event Counter 15 Overflow Set Position */ +#define PMU_OVSSET_CNT15_STATUS_Msk (1UL << PMU_OVSSET_CNT15_STATUS_Pos) /*!< PMU OVSSET: Event Counter 15 Overflow Set Mask */ + +#define PMU_OVSSET_CNT16_STATUS_Pos 16U /*!< PMU OVSSET: Event Counter 16 Overflow Set Position */ +#define PMU_OVSSET_CNT16_STATUS_Msk (1UL << PMU_OVSSET_CNT16_STATUS_Pos) /*!< PMU OVSSET: Event Counter 16 Overflow Set Mask */ + +#define PMU_OVSSET_CNT17_STATUS_Pos 17U /*!< PMU OVSSET: Event Counter 17 Overflow Set Position */ +#define PMU_OVSSET_CNT17_STATUS_Msk (1UL << PMU_OVSSET_CNT17_STATUS_Pos) /*!< PMU OVSSET: Event Counter 17 Overflow Set Mask */ + +#define PMU_OVSSET_CNT18_STATUS_Pos 18U /*!< PMU OVSSET: Event Counter 18 Overflow Set Position */ +#define PMU_OVSSET_CNT18_STATUS_Msk (1UL << PMU_OVSSET_CNT18_STATUS_Pos) /*!< PMU OVSSET: Event Counter 18 Overflow Set Mask */ + +#define PMU_OVSSET_CNT19_STATUS_Pos 19U /*!< PMU OVSSET: Event Counter 19 Overflow Set Position */ +#define PMU_OVSSET_CNT19_STATUS_Msk (1UL << PMU_OVSSET_CNT19_STATUS_Pos) /*!< PMU OVSSET: Event Counter 19 Overflow Set Mask */ + +#define PMU_OVSSET_CNT20_STATUS_Pos 20U /*!< PMU OVSSET: Event Counter 20 Overflow Set Position */ +#define PMU_OVSSET_CNT20_STATUS_Msk (1UL << PMU_OVSSET_CNT20_STATUS_Pos) /*!< PMU OVSSET: Event Counter 20 Overflow Set Mask */ + +#define PMU_OVSSET_CNT21_STATUS_Pos 21U /*!< PMU OVSSET: Event Counter 21 Overflow Set Position */ +#define PMU_OVSSET_CNT21_STATUS_Msk (1UL << PMU_OVSSET_CNT21_STATUS_Pos) /*!< PMU OVSSET: Event Counter 21 Overflow Set Mask */ + +#define PMU_OVSSET_CNT22_STATUS_Pos 22U /*!< PMU OVSSET: Event Counter 22 Overflow Set Position */ +#define PMU_OVSSET_CNT22_STATUS_Msk (1UL << PMU_OVSSET_CNT22_STATUS_Pos) /*!< PMU OVSSET: Event Counter 22 Overflow Set Mask */ + +#define PMU_OVSSET_CNT23_STATUS_Pos 23U /*!< PMU OVSSET: Event Counter 23 Overflow Set Position */ +#define PMU_OVSSET_CNT23_STATUS_Msk (1UL << PMU_OVSSET_CNT23_STATUS_Pos) /*!< PMU OVSSET: Event Counter 23 Overflow Set Mask */ + +#define PMU_OVSSET_CNT24_STATUS_Pos 24U /*!< PMU OVSSET: Event Counter 24 Overflow Set Position */ +#define PMU_OVSSET_CNT24_STATUS_Msk (1UL << PMU_OVSSET_CNT24_STATUS_Pos) /*!< PMU OVSSET: Event Counter 24 Overflow Set Mask */ + +#define PMU_OVSSET_CNT25_STATUS_Pos 25U /*!< PMU OVSSET: Event Counter 25 Overflow Set Position */ +#define PMU_OVSSET_CNT25_STATUS_Msk (1UL << PMU_OVSSET_CNT25_STATUS_Pos) /*!< PMU OVSSET: Event Counter 25 Overflow Set Mask */ + +#define PMU_OVSSET_CNT26_STATUS_Pos 26U /*!< PMU OVSSET: Event Counter 26 Overflow Set Position */ +#define PMU_OVSSET_CNT26_STATUS_Msk (1UL << PMU_OVSSET_CNT26_STATUS_Pos) /*!< PMU OVSSET: Event Counter 26 Overflow Set Mask */ + +#define PMU_OVSSET_CNT27_STATUS_Pos 27U /*!< PMU OVSSET: Event Counter 27 Overflow Set Position */ +#define PMU_OVSSET_CNT27_STATUS_Msk (1UL << PMU_OVSSET_CNT27_STATUS_Pos) /*!< PMU OVSSET: Event Counter 27 Overflow Set Mask */ + +#define PMU_OVSSET_CNT28_STATUS_Pos 28U /*!< PMU OVSSET: Event Counter 28 Overflow Set Position */ +#define PMU_OVSSET_CNT28_STATUS_Msk (1UL << PMU_OVSSET_CNT28_STATUS_Pos) /*!< PMU OVSSET: Event Counter 28 Overflow Set Mask */ + +#define PMU_OVSSET_CNT29_STATUS_Pos 29U /*!< PMU OVSSET: Event Counter 29 Overflow Set Position */ +#define PMU_OVSSET_CNT29_STATUS_Msk (1UL << PMU_OVSSET_CNT29_STATUS_Pos) /*!< PMU OVSSET: Event Counter 29 Overflow Set Mask */ + +#define PMU_OVSSET_CNT30_STATUS_Pos 30U /*!< PMU OVSSET: Event Counter 30 Overflow Set Position */ +#define PMU_OVSSET_CNT30_STATUS_Msk (1UL << PMU_OVSSET_CNT30_STATUS_Pos) /*!< PMU OVSSET: Event Counter 30 Overflow Set Mask */ + +#define PMU_OVSSET_CYCCNT_STATUS_Pos 31U /*!< PMU OVSSET: Cycle Counter Overflow Set Position */ +#define PMU_OVSSET_CYCCNT_STATUS_Msk (1UL << PMU_OVSSET_CYCCNT_STATUS_Pos) /*!< PMU OVSSET: Cycle Counter Overflow Set Mask */ + +/** \brief PMU Overflow Flag Status Clear Register Definitions */ + +#define PMU_OVSCLR_CNT0_STATUS_Pos 0U /*!< PMU OVSCLR: Event Counter 0 Overflow Clear Position */ +#define PMU_OVSCLR_CNT0_STATUS_Msk (1UL /*<< PMU_OVSCLR_CNT0_STATUS_Pos*/) /*!< PMU OVSCLR: Event Counter 0 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT1_STATUS_Pos 1U /*!< PMU OVSCLR: Event Counter 1 Overflow Clear Position */ +#define PMU_OVSCLR_CNT1_STATUS_Msk (1UL << PMU_OVSCLR_CNT1_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 1 Overflow Clear */ + +#define PMU_OVSCLR_CNT2_STATUS_Pos 2U /*!< PMU OVSCLR: Event Counter 2 Overflow Clear Position */ +#define PMU_OVSCLR_CNT2_STATUS_Msk (1UL << PMU_OVSCLR_CNT2_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 2 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT3_STATUS_Pos 3U /*!< PMU OVSCLR: Event Counter 3 Overflow Clear Position */ +#define PMU_OVSCLR_CNT3_STATUS_Msk (1UL << PMU_OVSCLR_CNT3_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 3 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT4_STATUS_Pos 4U /*!< PMU OVSCLR: Event Counter 4 Overflow Clear Position */ +#define PMU_OVSCLR_CNT4_STATUS_Msk (1UL << PMU_OVSCLR_CNT4_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 4 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT5_STATUS_Pos 5U /*!< PMU OVSCLR: Event Counter 5 Overflow Clear Position */ +#define PMU_OVSCLR_CNT5_STATUS_Msk (1UL << PMU_OVSCLR_CNT5_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 5 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT6_STATUS_Pos 6U /*!< PMU OVSCLR: Event Counter 6 Overflow Clear Position */ +#define PMU_OVSCLR_CNT6_STATUS_Msk (1UL << PMU_OVSCLR_CNT6_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 6 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT7_STATUS_Pos 7U /*!< PMU OVSCLR: Event Counter 7 Overflow Clear Position */ +#define PMU_OVSCLR_CNT7_STATUS_Msk (1UL << PMU_OVSCLR_CNT7_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 7 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT8_STATUS_Pos 8U /*!< PMU OVSCLR: Event Counter 8 Overflow Clear Position */ +#define PMU_OVSCLR_CNT8_STATUS_Msk (1UL << PMU_OVSCLR_CNT8_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 8 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT9_STATUS_Pos 9U /*!< PMU OVSCLR: Event Counter 9 Overflow Clear Position */ +#define PMU_OVSCLR_CNT9_STATUS_Msk (1UL << PMU_OVSCLR_CNT9_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 9 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT10_STATUS_Pos 10U /*!< PMU OVSCLR: Event Counter 10 Overflow Clear Position */ +#define PMU_OVSCLR_CNT10_STATUS_Msk (1UL << PMU_OVSCLR_CNT10_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 10 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT11_STATUS_Pos 11U /*!< PMU OVSCLR: Event Counter 11 Overflow Clear Position */ +#define PMU_OVSCLR_CNT11_STATUS_Msk (1UL << PMU_OVSCLR_CNT11_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 11 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT12_STATUS_Pos 12U /*!< PMU OVSCLR: Event Counter 12 Overflow Clear Position */ +#define PMU_OVSCLR_CNT12_STATUS_Msk (1UL << PMU_OVSCLR_CNT12_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 12 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT13_STATUS_Pos 13U /*!< PMU OVSCLR: Event Counter 13 Overflow Clear Position */ +#define PMU_OVSCLR_CNT13_STATUS_Msk (1UL << PMU_OVSCLR_CNT13_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 13 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT14_STATUS_Pos 14U /*!< PMU OVSCLR: Event Counter 14 Overflow Clear Position */ +#define PMU_OVSCLR_CNT14_STATUS_Msk (1UL << PMU_OVSCLR_CNT14_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 14 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT15_STATUS_Pos 15U /*!< PMU OVSCLR: Event Counter 15 Overflow Clear Position */ +#define PMU_OVSCLR_CNT15_STATUS_Msk (1UL << PMU_OVSCLR_CNT15_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 15 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT16_STATUS_Pos 16U /*!< PMU OVSCLR: Event Counter 16 Overflow Clear Position */ +#define PMU_OVSCLR_CNT16_STATUS_Msk (1UL << PMU_OVSCLR_CNT16_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 16 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT17_STATUS_Pos 17U /*!< PMU OVSCLR: Event Counter 17 Overflow Clear Position */ +#define PMU_OVSCLR_CNT17_STATUS_Msk (1UL << PMU_OVSCLR_CNT17_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 17 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT18_STATUS_Pos 18U /*!< PMU OVSCLR: Event Counter 18 Overflow Clear Position */ +#define PMU_OVSCLR_CNT18_STATUS_Msk (1UL << PMU_OVSCLR_CNT18_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 18 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT19_STATUS_Pos 19U /*!< PMU OVSCLR: Event Counter 19 Overflow Clear Position */ +#define PMU_OVSCLR_CNT19_STATUS_Msk (1UL << PMU_OVSCLR_CNT19_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 19 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT20_STATUS_Pos 20U /*!< PMU OVSCLR: Event Counter 20 Overflow Clear Position */ +#define PMU_OVSCLR_CNT20_STATUS_Msk (1UL << PMU_OVSCLR_CNT20_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 20 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT21_STATUS_Pos 21U /*!< PMU OVSCLR: Event Counter 21 Overflow Clear Position */ +#define PMU_OVSCLR_CNT21_STATUS_Msk (1UL << PMU_OVSCLR_CNT21_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 21 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT22_STATUS_Pos 22U /*!< PMU OVSCLR: Event Counter 22 Overflow Clear Position */ +#define PMU_OVSCLR_CNT22_STATUS_Msk (1UL << PMU_OVSCLR_CNT22_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 22 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT23_STATUS_Pos 23U /*!< PMU OVSCLR: Event Counter 23 Overflow Clear Position */ +#define PMU_OVSCLR_CNT23_STATUS_Msk (1UL << PMU_OVSCLR_CNT23_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 23 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT24_STATUS_Pos 24U /*!< PMU OVSCLR: Event Counter 24 Overflow Clear Position */ +#define PMU_OVSCLR_CNT24_STATUS_Msk (1UL << PMU_OVSCLR_CNT24_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 24 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT25_STATUS_Pos 25U /*!< PMU OVSCLR: Event Counter 25 Overflow Clear Position */ +#define PMU_OVSCLR_CNT25_STATUS_Msk (1UL << PMU_OVSCLR_CNT25_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 25 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT26_STATUS_Pos 26U /*!< PMU OVSCLR: Event Counter 26 Overflow Clear Position */ +#define PMU_OVSCLR_CNT26_STATUS_Msk (1UL << PMU_OVSCLR_CNT26_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 26 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT27_STATUS_Pos 27U /*!< PMU OVSCLR: Event Counter 27 Overflow Clear Position */ +#define PMU_OVSCLR_CNT27_STATUS_Msk (1UL << PMU_OVSCLR_CNT27_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 27 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT28_STATUS_Pos 28U /*!< PMU OVSCLR: Event Counter 28 Overflow Clear Position */ +#define PMU_OVSCLR_CNT28_STATUS_Msk (1UL << PMU_OVSCLR_CNT28_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 28 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT29_STATUS_Pos 29U /*!< PMU OVSCLR: Event Counter 29 Overflow Clear Position */ +#define PMU_OVSCLR_CNT29_STATUS_Msk (1UL << PMU_OVSCLR_CNT29_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 29 Overflow Clear Mask */ + +#define PMU_OVSCLR_CNT30_STATUS_Pos 30U /*!< PMU OVSCLR: Event Counter 30 Overflow Clear Position */ +#define PMU_OVSCLR_CNT30_STATUS_Msk (1UL << PMU_OVSCLR_CNT30_STATUS_Pos) /*!< PMU OVSCLR: Event Counter 30 Overflow Clear Mask */ + +#define PMU_OVSCLR_CYCCNT_STATUS_Pos 31U /*!< PMU OVSCLR: Cycle Counter Overflow Clear Position */ +#define PMU_OVSCLR_CYCCNT_STATUS_Msk (1UL << PMU_OVSCLR_CYCCNT_STATUS_Pos) /*!< PMU OVSCLR: Cycle Counter Overflow Clear Mask */ + +/** \brief PMU Software Increment Counter */ + +#define PMU_SWINC_CNT0_Pos 0U /*!< PMU SWINC: Event Counter 0 Software Increment Position */ +#define PMU_SWINC_CNT0_Msk (1UL /*<< PMU_SWINC_CNT0_Pos */) /*!< PMU SWINC: Event Counter 0 Software Increment Mask */ + +#define PMU_SWINC_CNT1_Pos 1U /*!< PMU SWINC: Event Counter 1 Software Increment Position */ +#define PMU_SWINC_CNT1_Msk (1UL << PMU_SWINC_CNT1_Pos) /*!< PMU SWINC: Event Counter 1 Software Increment Mask */ + +#define PMU_SWINC_CNT2_Pos 2U /*!< PMU SWINC: Event Counter 2 Software Increment Position */ +#define PMU_SWINC_CNT2_Msk (1UL << PMU_SWINC_CNT2_Pos) /*!< PMU SWINC: Event Counter 2 Software Increment Mask */ + +#define PMU_SWINC_CNT3_Pos 3U /*!< PMU SWINC: Event Counter 3 Software Increment Position */ +#define PMU_SWINC_CNT3_Msk (1UL << PMU_SWINC_CNT3_Pos) /*!< PMU SWINC: Event Counter 3 Software Increment Mask */ + +#define PMU_SWINC_CNT4_Pos 4U /*!< PMU SWINC: Event Counter 4 Software Increment Position */ +#define PMU_SWINC_CNT4_Msk (1UL << PMU_SWINC_CNT4_Pos) /*!< PMU SWINC: Event Counter 4 Software Increment Mask */ + +#define PMU_SWINC_CNT5_Pos 5U /*!< PMU SWINC: Event Counter 5 Software Increment Position */ +#define PMU_SWINC_CNT5_Msk (1UL << PMU_SWINC_CNT5_Pos) /*!< PMU SWINC: Event Counter 5 Software Increment Mask */ + +#define PMU_SWINC_CNT6_Pos 6U /*!< PMU SWINC: Event Counter 6 Software Increment Position */ +#define PMU_SWINC_CNT6_Msk (1UL << PMU_SWINC_CNT6_Pos) /*!< PMU SWINC: Event Counter 6 Software Increment Mask */ + +#define PMU_SWINC_CNT7_Pos 7U /*!< PMU SWINC: Event Counter 7 Software Increment Position */ +#define PMU_SWINC_CNT7_Msk (1UL << PMU_SWINC_CNT7_Pos) /*!< PMU SWINC: Event Counter 7 Software Increment Mask */ + +#define PMU_SWINC_CNT8_Pos 8U /*!< PMU SWINC: Event Counter 8 Software Increment Position */ +#define PMU_SWINC_CNT8_Msk (1UL << PMU_SWINC_CNT8_Pos) /*!< PMU SWINC: Event Counter 8 Software Increment Mask */ + +#define PMU_SWINC_CNT9_Pos 9U /*!< PMU SWINC: Event Counter 9 Software Increment Position */ +#define PMU_SWINC_CNT9_Msk (1UL << PMU_SWINC_CNT9_Pos) /*!< PMU SWINC: Event Counter 9 Software Increment Mask */ + +#define PMU_SWINC_CNT10_Pos 10U /*!< PMU SWINC: Event Counter 10 Software Increment Position */ +#define PMU_SWINC_CNT10_Msk (1UL << PMU_SWINC_CNT10_Pos) /*!< PMU SWINC: Event Counter 10 Software Increment Mask */ + +#define PMU_SWINC_CNT11_Pos 11U /*!< PMU SWINC: Event Counter 11 Software Increment Position */ +#define PMU_SWINC_CNT11_Msk (1UL << PMU_SWINC_CNT11_Pos) /*!< PMU SWINC: Event Counter 11 Software Increment Mask */ + +#define PMU_SWINC_CNT12_Pos 12U /*!< PMU SWINC: Event Counter 12 Software Increment Position */ +#define PMU_SWINC_CNT12_Msk (1UL << PMU_SWINC_CNT12_Pos) /*!< PMU SWINC: Event Counter 12 Software Increment Mask */ + +#define PMU_SWINC_CNT13_Pos 13U /*!< PMU SWINC: Event Counter 13 Software Increment Position */ +#define PMU_SWINC_CNT13_Msk (1UL << PMU_SWINC_CNT13_Pos) /*!< PMU SWINC: Event Counter 13 Software Increment Mask */ + +#define PMU_SWINC_CNT14_Pos 14U /*!< PMU SWINC: Event Counter 14 Software Increment Position */ +#define PMU_SWINC_CNT14_Msk (1UL << PMU_SWINC_CNT14_Pos) /*!< PMU SWINC: Event Counter 14 Software Increment Mask */ + +#define PMU_SWINC_CNT15_Pos 15U /*!< PMU SWINC: Event Counter 15 Software Increment Position */ +#define PMU_SWINC_CNT15_Msk (1UL << PMU_SWINC_CNT15_Pos) /*!< PMU SWINC: Event Counter 15 Software Increment Mask */ + +#define PMU_SWINC_CNT16_Pos 16U /*!< PMU SWINC: Event Counter 16 Software Increment Position */ +#define PMU_SWINC_CNT16_Msk (1UL << PMU_SWINC_CNT16_Pos) /*!< PMU SWINC: Event Counter 16 Software Increment Mask */ + +#define PMU_SWINC_CNT17_Pos 17U /*!< PMU SWINC: Event Counter 17 Software Increment Position */ +#define PMU_SWINC_CNT17_Msk (1UL << PMU_SWINC_CNT17_Pos) /*!< PMU SWINC: Event Counter 17 Software Increment Mask */ + +#define PMU_SWINC_CNT18_Pos 18U /*!< PMU SWINC: Event Counter 18 Software Increment Position */ +#define PMU_SWINC_CNT18_Msk (1UL << PMU_SWINC_CNT18_Pos) /*!< PMU SWINC: Event Counter 18 Software Increment Mask */ + +#define PMU_SWINC_CNT19_Pos 19U /*!< PMU SWINC: Event Counter 19 Software Increment Position */ +#define PMU_SWINC_CNT19_Msk (1UL << PMU_SWINC_CNT19_Pos) /*!< PMU SWINC: Event Counter 19 Software Increment Mask */ + +#define PMU_SWINC_CNT20_Pos 20U /*!< PMU SWINC: Event Counter 20 Software Increment Position */ +#define PMU_SWINC_CNT20_Msk (1UL << PMU_SWINC_CNT20_Pos) /*!< PMU SWINC: Event Counter 20 Software Increment Mask */ + +#define PMU_SWINC_CNT21_Pos 21U /*!< PMU SWINC: Event Counter 21 Software Increment Position */ +#define PMU_SWINC_CNT21_Msk (1UL << PMU_SWINC_CNT21_Pos) /*!< PMU SWINC: Event Counter 21 Software Increment Mask */ + +#define PMU_SWINC_CNT22_Pos 22U /*!< PMU SWINC: Event Counter 22 Software Increment Position */ +#define PMU_SWINC_CNT22_Msk (1UL << PMU_SWINC_CNT22_Pos) /*!< PMU SWINC: Event Counter 22 Software Increment Mask */ + +#define PMU_SWINC_CNT23_Pos 23U /*!< PMU SWINC: Event Counter 23 Software Increment Position */ +#define PMU_SWINC_CNT23_Msk (1UL << PMU_SWINC_CNT23_Pos) /*!< PMU SWINC: Event Counter 23 Software Increment Mask */ + +#define PMU_SWINC_CNT24_Pos 24U /*!< PMU SWINC: Event Counter 24 Software Increment Position */ +#define PMU_SWINC_CNT24_Msk (1UL << PMU_SWINC_CNT24_Pos) /*!< PMU SWINC: Event Counter 24 Software Increment Mask */ + +#define PMU_SWINC_CNT25_Pos 25U /*!< PMU SWINC: Event Counter 25 Software Increment Position */ +#define PMU_SWINC_CNT25_Msk (1UL << PMU_SWINC_CNT25_Pos) /*!< PMU SWINC: Event Counter 25 Software Increment Mask */ + +#define PMU_SWINC_CNT26_Pos 26U /*!< PMU SWINC: Event Counter 26 Software Increment Position */ +#define PMU_SWINC_CNT26_Msk (1UL << PMU_SWINC_CNT26_Pos) /*!< PMU SWINC: Event Counter 26 Software Increment Mask */ + +#define PMU_SWINC_CNT27_Pos 27U /*!< PMU SWINC: Event Counter 27 Software Increment Position */ +#define PMU_SWINC_CNT27_Msk (1UL << PMU_SWINC_CNT27_Pos) /*!< PMU SWINC: Event Counter 27 Software Increment Mask */ + +#define PMU_SWINC_CNT28_Pos 28U /*!< PMU SWINC: Event Counter 28 Software Increment Position */ +#define PMU_SWINC_CNT28_Msk (1UL << PMU_SWINC_CNT28_Pos) /*!< PMU SWINC: Event Counter 28 Software Increment Mask */ + +#define PMU_SWINC_CNT29_Pos 29U /*!< PMU SWINC: Event Counter 29 Software Increment Position */ +#define PMU_SWINC_CNT29_Msk (1UL << PMU_SWINC_CNT29_Pos) /*!< PMU SWINC: Event Counter 29 Software Increment Mask */ + +#define PMU_SWINC_CNT30_Pos 30U /*!< PMU SWINC: Event Counter 30 Software Increment Position */ +#define PMU_SWINC_CNT30_Msk (1UL << PMU_SWINC_CNT30_Pos) /*!< PMU SWINC: Event Counter 30 Software Increment Mask */ + +/** \brief PMU Control Register Definitions */ + +#define PMU_CTRL_ENABLE_Pos 0U /*!< PMU CTRL: ENABLE Position */ +#define PMU_CTRL_ENABLE_Msk (1UL /*<< PMU_CTRL_ENABLE_Pos*/) /*!< PMU CTRL: ENABLE Mask */ + +#define PMU_CTRL_EVENTCNT_RESET_Pos 1U /*!< PMU CTRL: Event Counter Reset Position */ +#define PMU_CTRL_EVENTCNT_RESET_Msk (1UL << PMU_CTRL_EVENTCNT_RESET_Pos) /*!< PMU CTRL: Event Counter Reset Mask */ + +#define PMU_CTRL_CYCCNT_RESET_Pos 2U /*!< PMU CTRL: Cycle Counter Reset Position */ +#define PMU_CTRL_CYCCNT_RESET_Msk (1UL << PMU_CTRL_CYCCNT_RESET_Pos) /*!< PMU CTRL: Cycle Counter Reset Mask */ + +#define PMU_CTRL_CYCCNT_DISABLE_Pos 5U /*!< PMU CTRL: Disable Cycle Counter Position */ +#define PMU_CTRL_CYCCNT_DISABLE_Msk (1UL << PMU_CTRL_CYCCNT_DISABLE_Pos) /*!< PMU CTRL: Disable Cycle Counter Mask */ + +#define PMU_CTRL_FRZ_ON_OV_Pos 9U /*!< PMU CTRL: Freeze-on-overflow Position */ +#define PMU_CTRL_FRZ_ON_OV_Msk (1UL << PMU_CTRL_FRZ_ON_OVERFLOW_Pos) /*!< PMU CTRL: Freeze-on-overflow Mask */ + +#define PMU_CTRL_TRACE_ON_OV_Pos 11U /*!< PMU CTRL: Trace-on-overflow Position */ +#define PMU_CTRL_TRACE_ON_OV_Msk (1UL << PMU_CTRL_TRACE_ON_OVERFLOW_Pos) /*!< PMU CTRL: Trace-on-overflow Mask */ + +/** \brief PMU Type Register Definitions */ + +#define PMU_TYPE_NUM_CNTS_Pos 0U /*!< PMU TYPE: Number of Counters Position */ +#define PMU_TYPE_NUM_CNTS_Msk (0xFFUL /*<< PMU_TYPE_NUM_CNTS_Pos*/) /*!< PMU TYPE: Number of Counters Mask */ + +#define PMU_TYPE_SIZE_CNTS_Pos 8U /*!< PMU TYPE: Size of Counters Position */ +#define PMU_TYPE_SIZE_CNTS_Msk (0x3FUL << PMU_TYPE_SIZE_CNTS_Pos) /*!< PMU TYPE: Size of Counters Mask */ + +#define PMU_TYPE_CYCCNT_PRESENT_Pos 14U /*!< PMU TYPE: Cycle Counter Present Position */ +#define PMU_TYPE_CYCCNT_PRESENT_Msk (1UL << PMU_TYPE_CYCCNT_PRESENT_Pos) /*!< PMU TYPE: Cycle Counter Present Mask */ + +#define PMU_TYPE_FRZ_OV_SUPPORT_Pos 21U /*!< PMU TYPE: Freeze-on-overflow Support Position */ +#define PMU_TYPE_FRZ_OV_SUPPORT_Msk (1UL << PMU_TYPE_FRZ_OV_SUPPORT_Pos) /*!< PMU TYPE: Freeze-on-overflow Support Mask */ + +#define PMU_TYPE_TRACE_ON_OV_SUPPORT_Pos 23U /*!< PMU TYPE: Trace-on-overflow Support Position */ +#define PMU_TYPE_TRACE_ON_OV_SUPPORT_Msk (1UL << PMU_TYPE_FRZ_OV_SUPPORT_Pos) /*!< PMU TYPE: Trace-on-overflow Support Mask */ + +/** \brief PMU Authentication Status Register Definitions */ + +#define PMU_AUTHSTATUS_NSID_Pos 0U /*!< PMU AUTHSTATUS: Non-secure Invasive Debug Position */ +#define PMU_AUTHSTATUS_NSID_Msk (0x3UL /*<< PMU_AUTHSTATUS_NSID_Pos*/) /*!< PMU AUTHSTATUS: Non-secure Invasive Debug Mask */ + +#define PMU_AUTHSTATUS_NSNID_Pos 2U /*!< PMU AUTHSTATUS: Non-secure Non-invasive Debug Position */ +#define PMU_AUTHSTATUS_NSNID_Msk (0x3UL << PMU_AUTHSTATUS_NSNID_Pos) /*!< PMU AUTHSTATUS: Non-secure Non-invasive Debug Mask */ + +#define PMU_AUTHSTATUS_SID_Pos 4U /*!< PMU AUTHSTATUS: Secure Invasive Debug Position */ +#define PMU_AUTHSTATUS_SID_Msk (0x3UL << PMU_AUTHSTATUS_SID_Pos) /*!< PMU AUTHSTATUS: Secure Invasive Debug Mask */ + +#define PMU_AUTHSTATUS_SNID_Pos 6U /*!< PMU AUTHSTATUS: Secure Non-invasive Debug Position */ +#define PMU_AUTHSTATUS_SNID_Msk (0x3UL << PMU_AUTHSTATUS_SNID_Pos) /*!< PMU AUTHSTATUS: Secure Non-invasive Debug Mask */ + +#define PMU_AUTHSTATUS_NSUID_Pos 16U /*!< PMU AUTHSTATUS: Non-secure Unprivileged Invasive Debug Position */ +#define PMU_AUTHSTATUS_NSUID_Msk (0x3UL << PMU_AUTHSTATUS_NSUID_Pos) /*!< PMU AUTHSTATUS: Non-secure Unprivileged Invasive Debug Mask */ + +#define PMU_AUTHSTATUS_NSUNID_Pos 18U /*!< PMU AUTHSTATUS: Non-secure Unprivileged Non-invasive Debug Position */ +#define PMU_AUTHSTATUS_NSUNID_Msk (0x3UL << PMU_AUTHSTATUS_NSUNID_Pos) /*!< PMU AUTHSTATUS: Non-secure Unprivileged Non-invasive Debug Mask */ + +#define PMU_AUTHSTATUS_SUID_Pos 20U /*!< PMU AUTHSTATUS: Secure Unprivileged Invasive Debug Position */ +#define PMU_AUTHSTATUS_SUID_Msk (0x3UL << PMU_AUTHSTATUS_SUID_Pos) /*!< PMU AUTHSTATUS: Secure Unprivileged Invasive Debug Mask */ + +#define PMU_AUTHSTATUS_SUNID_Pos 22U /*!< PMU AUTHSTATUS: Secure Unprivileged Non-invasive Debug Position */ +#define PMU_AUTHSTATUS_SUNID_Msk (0x3UL << PMU_AUTHSTATUS_SUNID_Pos) /*!< PMU AUTHSTATUS: Secure Unprivileged Non-invasive Debug Mask */ + + +/*@} end of group CMSIS_PMU */ +#endif + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Region Base Address Register Alias 1 */ + __IOM uint32_t RLAR_A1; /*!< Offset: 0x018 (R/W) MPU Region Limit Address Register Alias 1 */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Region Base Address Register Alias 2 */ + __IOM uint32_t RLAR_A2; /*!< Offset: 0x020 (R/W) MPU Region Limit Address Register Alias 2 */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Region Base Address Register Alias 3 */ + __IOM uint32_t RLAR_A3; /*!< Offset: 0x028 (R/W) MPU Region Limit Address Register Alias 3 */ + uint32_t RESERVED0[1]; + union { + __IOM uint32_t MAIR[2]; + struct { + __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */ + __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */ + }; + }; +} MPU_Type; + +#define MPU_TYPE_RALIASES 4U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_BASE_Pos 5U /*!< MPU RBAR: BASE Position */ +#define MPU_RBAR_BASE_Msk (0x7FFFFFFUL << MPU_RBAR_BASE_Pos) /*!< MPU RBAR: BASE Mask */ + +#define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */ +#define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */ + +#define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */ +#define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */ + +#define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */ +#define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */ + +/* MPU Region Limit Address Register Definitions */ +#define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */ +#define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */ + +#define MPU_RLAR_PXN_Pos 4U /*!< MPU RLAR: PXN Position */ +#define MPU_RLAR_PXN_Msk (1UL << MPU_RLAR_PXN_Pos) /*!< MPU RLAR: PXN Mask */ + +#define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */ +#define MPU_RLAR_AttrIndx_Msk (7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */ + +#define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: Region enable bit Position */ +#define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: Region enable bit Disable Mask */ + +/* MPU Memory Attribute Indirection Register 0 Definitions */ +#define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */ +#define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */ + +#define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */ +#define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */ + +#define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */ +#define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */ + +#define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */ +#define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */ + +/* MPU Memory Attribute Indirection Register 1 Definitions */ +#define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */ +#define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */ + +#define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */ +#define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */ + +#define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */ +#define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */ + +#define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */ +#define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SAU Security Attribution Unit (SAU) + \brief Type definitions for the Security Attribution Unit (SAU) + @{ + */ + +/** + \brief Structure type to access the Security Attribution Unit (SAU). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */ + __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */ +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */ +#else + uint32_t RESERVED0[3]; +#endif + __IOM uint32_t SFSR; /*!< Offset: 0x014 (R/W) Secure Fault Status Register */ + __IOM uint32_t SFAR; /*!< Offset: 0x018 (R/W) Secure Fault Address Register */ +} SAU_Type; + +/* SAU Control Register Definitions */ +#define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */ +#define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */ + +#define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */ +#define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */ + +/* SAU Type Register Definitions */ +#define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */ +#define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */ + +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) +/* SAU Region Number Register Definitions */ +#define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */ +#define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */ + +/* SAU Region Base Address Register Definitions */ +#define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */ +#define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */ + +/* SAU Region Limit Address Register Definitions */ +#define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */ +#define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */ + +#define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */ +#define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */ + +#define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */ +#define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */ + +#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */ + +/* Secure Fault Status Register Definitions */ +#define SAU_SFSR_LSERR_Pos 7U /*!< SAU SFSR: LSERR Position */ +#define SAU_SFSR_LSERR_Msk (1UL << SAU_SFSR_LSERR_Pos) /*!< SAU SFSR: LSERR Mask */ + +#define SAU_SFSR_SFARVALID_Pos 6U /*!< SAU SFSR: SFARVALID Position */ +#define SAU_SFSR_SFARVALID_Msk (1UL << SAU_SFSR_SFARVALID_Pos) /*!< SAU SFSR: SFARVALID Mask */ + +#define SAU_SFSR_LSPERR_Pos 5U /*!< SAU SFSR: LSPERR Position */ +#define SAU_SFSR_LSPERR_Msk (1UL << SAU_SFSR_LSPERR_Pos) /*!< SAU SFSR: LSPERR Mask */ + +#define SAU_SFSR_INVTRAN_Pos 4U /*!< SAU SFSR: INVTRAN Position */ +#define SAU_SFSR_INVTRAN_Msk (1UL << SAU_SFSR_INVTRAN_Pos) /*!< SAU SFSR: INVTRAN Mask */ + +#define SAU_SFSR_AUVIOL_Pos 3U /*!< SAU SFSR: AUVIOL Position */ +#define SAU_SFSR_AUVIOL_Msk (1UL << SAU_SFSR_AUVIOL_Pos) /*!< SAU SFSR: AUVIOL Mask */ + +#define SAU_SFSR_INVER_Pos 2U /*!< SAU SFSR: INVER Position */ +#define SAU_SFSR_INVER_Msk (1UL << SAU_SFSR_INVER_Pos) /*!< SAU SFSR: INVER Mask */ + +#define SAU_SFSR_INVIS_Pos 1U /*!< SAU SFSR: INVIS Position */ +#define SAU_SFSR_INVIS_Msk (1UL << SAU_SFSR_INVIS_Pos) /*!< SAU SFSR: INVIS Mask */ + +#define SAU_SFSR_INVEP_Pos 0U /*!< SAU SFSR: INVEP Position */ +#define SAU_SFSR_INVEP_Msk (1UL /*<< SAU_SFSR_INVEP_Pos*/) /*!< SAU SFSR: INVEP Mask */ + +/*@} end of group CMSIS_SAU */ +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_FPU Floating Point Unit (FPU) + \brief Type definitions for the Floating Point Unit (FPU) + @{ + */ + +/** + \brief Structure type to access the Floating Point Unit (FPU). + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ + __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ + __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ + __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and VFP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and VFP Feature Register 1 */ + __IM uint32_t MVFR2; /*!< Offset: 0x018 (R/ ) Media and VFP Feature Register 2 */ +} FPU_Type; + +/* Floating-Point Context Control Register Definitions */ +#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */ +#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ + +#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */ +#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ + +#define FPU_FPCCR_LSPENS_Pos 29U /*!< FPCCR: LSPENS Position */ +#define FPU_FPCCR_LSPENS_Msk (1UL << FPU_FPCCR_LSPENS_Pos) /*!< FPCCR: LSPENS bit Mask */ + +#define FPU_FPCCR_CLRONRET_Pos 28U /*!< FPCCR: CLRONRET Position */ +#define FPU_FPCCR_CLRONRET_Msk (1UL << FPU_FPCCR_CLRONRET_Pos) /*!< FPCCR: CLRONRET bit Mask */ + +#define FPU_FPCCR_CLRONRETS_Pos 27U /*!< FPCCR: CLRONRETS Position */ +#define FPU_FPCCR_CLRONRETS_Msk (1UL << FPU_FPCCR_CLRONRETS_Pos) /*!< FPCCR: CLRONRETS bit Mask */ + +#define FPU_FPCCR_TS_Pos 26U /*!< FPCCR: TS Position */ +#define FPU_FPCCR_TS_Msk (1UL << FPU_FPCCR_TS_Pos) /*!< FPCCR: TS bit Mask */ + +#define FPU_FPCCR_UFRDY_Pos 10U /*!< FPCCR: UFRDY Position */ +#define FPU_FPCCR_UFRDY_Msk (1UL << FPU_FPCCR_UFRDY_Pos) /*!< FPCCR: UFRDY bit Mask */ + +#define FPU_FPCCR_SPLIMVIOL_Pos 9U /*!< FPCCR: SPLIMVIOL Position */ +#define FPU_FPCCR_SPLIMVIOL_Msk (1UL << FPU_FPCCR_SPLIMVIOL_Pos) /*!< FPCCR: SPLIMVIOL bit Mask */ + +#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */ +#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ + +#define FPU_FPCCR_SFRDY_Pos 7U /*!< FPCCR: SFRDY Position */ +#define FPU_FPCCR_SFRDY_Msk (1UL << FPU_FPCCR_SFRDY_Pos) /*!< FPCCR: SFRDY bit Mask */ + +#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */ +#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ + +#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */ +#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ + +#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */ +#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ + +#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */ +#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ + +#define FPU_FPCCR_S_Pos 2U /*!< FPCCR: Security status of the FP context bit Position */ +#define FPU_FPCCR_S_Msk (1UL << FPU_FPCCR_S_Pos) /*!< FPCCR: Security status of the FP context bit Mask */ + +#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */ +#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ + +#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */ +#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ + +/* Floating-Point Context Address Register Definitions */ +#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */ +#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ + +/* Floating-Point Default Status Control Register Definitions */ +#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */ +#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ + +#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */ +#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ + +#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */ +#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ + +#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */ +#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ + +#define FPU_FPDSCR_FZ16_Pos 19U /*!< FPDSCR: FZ16 bit Position */ +#define FPU_FPDSCR_FZ16_Msk (1UL << FPU_FPDSCR_FZ16_Pos) /*!< FPDSCR: FZ16 bit Mask */ + +#define FPU_FPDSCR_LTPSIZE_Pos 16U /*!< FPDSCR: LTPSIZE bit Position */ +#define FPU_FPDSCR_LTPSIZE_Msk (7UL << FPU_FPDSCR_LTPSIZE_Pos) /*!< FPDSCR: LTPSIZE bit Mask */ + +/* Media and VFP Feature Register 0 Definitions */ +#define FPU_MVFR0_FPRound_Pos 28U /*!< MVFR0: FPRound bits Position */ +#define FPU_MVFR0_FPRound_Msk (0xFUL << FPU_MVFR0_FPRound_Pos) /*!< MVFR0: FPRound bits Mask */ + +#define FPU_MVFR0_FPSqrt_Pos 20U /*!< MVFR0: FPSqrt bits Position */ +#define FPU_MVFR0_FPSqrt_Msk (0xFUL << FPU_MVFR0_FPSqrt_Pos) /*!< MVFR0: FPSqrt bits Mask */ + +#define FPU_MVFR0_FPDivide_Pos 16U /*!< MVFR0: FPDivide bits Position */ +#define FPU_MVFR0_FPDivide_Msk (0xFUL << FPU_MVFR0_FPDivide_Pos) /*!< MVFR0: Divide bits Mask */ + +#define FPU_MVFR0_FPDP_Pos 8U /*!< MVFR0: FPDP bits Position */ +#define FPU_MVFR0_FPDP_Msk (0xFUL << FPU_MVFR0_FPDP_Pos) /*!< MVFR0: FPDP bits Mask */ + +#define FPU_MVFR0_FPSP_Pos 4U /*!< MVFR0: FPSP bits Position */ +#define FPU_MVFR0_FPSP_Msk (0xFUL << FPU_MVFR0_FPSP_Pos) /*!< MVFR0: FPSP bits Mask */ + +#define FPU_MVFR0_SIMDReg_Pos 0U /*!< MVFR0: SIMDReg bits Position */ +#define FPU_MVFR0_SIMDReg_Msk (0xFUL /*<< FPU_MVFR0_SIMDReg_Pos*/) /*!< MVFR0: SIMDReg bits Mask */ + +/* Media and VFP Feature Register 1 Definitions */ +#define FPU_MVFR1_FMAC_Pos 28U /*!< MVFR1: FMAC bits Position */ +#define FPU_MVFR1_FMAC_Msk (0xFUL << FPU_MVFR1_FMAC_Pos) /*!< MVFR1: FMAC bits Mask */ + +#define FPU_MVFR1_FPHP_Pos 24U /*!< MVFR1: FPHP bits Position */ +#define FPU_MVFR1_FPHP_Msk (0xFUL << FPU_MVFR1_FPHP_Pos) /*!< MVFR1: FPHP bits Mask */ + +#define FPU_MVFR1_FP16_Pos 20U /*!< MVFR1: FP16 bits Position */ +#define FPU_MVFR1_FP16_Msk (0xFUL << FPU_MVFR1_FP16_Pos) /*!< MVFR1: FP16 bits Mask */ + +#define FPU_MVFR1_MVE_Pos 8U /*!< MVFR1: MVE bits Position */ +#define FPU_MVFR1_MVE_Msk (0xFUL << FPU_MVFR1_MVE_Pos) /*!< MVFR1: MVE bits Mask */ + +#define FPU_MVFR1_FPDNaN_Pos 4U /*!< MVFR1: FPDNaN bits Position */ +#define FPU_MVFR1_FPDNaN_Msk (0xFUL << FPU_MVFR1_FPDNaN_Pos) /*!< MVFR1: FPDNaN bits Mask */ + +#define FPU_MVFR1_FPFtZ_Pos 0U /*!< MVFR1: FPFtZ bits Position */ +#define FPU_MVFR1_FPFtZ_Msk (0xFUL /*<< FPU_MVFR1_FPFtZ_Pos*/) /*!< MVFR1: FPFtZ bits Mask */ + +/* Media and VFP Feature Register 2 Definitions */ +#define FPU_MVFR2_FPMisc_Pos 4U /*!< MVFR2: FPMisc bits Position */ +#define FPU_MVFR2_FPMisc_Msk (0xFUL << FPU_MVFR2_FPMisc_Pos) /*!< MVFR2: FPMisc bits Mask */ + +/*@} end of group CMSIS_FPU */ + +/* CoreDebug is deprecated. replaced by DCB (Debug Control Block) */ +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief \deprecated Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ + __OM uint32_t DSCEMCR; /*!< Offset: 0x010 ( /W) Debug Set Clear Exception and Monitor Control Register */ + __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ + __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< \deprecated CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< \deprecated CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESTART_ST_Pos 26U /*!< \deprecated CoreDebug DHCSR: S_RESTART_ST Position */ +#define CoreDebug_DHCSR_S_RESTART_ST_Msk (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos) /*!< \deprecated CoreDebug DHCSR: S_RESTART_ST Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< \deprecated CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< \deprecated CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< \deprecated CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< \deprecated CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_FPD_Pos 23U /*!< \deprecated CoreDebug DHCSR: S_FPD Position */ +#define CoreDebug_DHCSR_S_FPD_Msk (1UL << CoreDebug_DHCSR_S_FPD_Pos) /*!< \deprecated CoreDebug DHCSR: S_FPD Mask */ + +#define CoreDebug_DHCSR_S_SUIDE_Pos 22U /*!< \deprecated CoreDebug DHCSR: S_SUIDE Position */ +#define CoreDebug_DHCSR_S_SUIDE_Msk (1UL << CoreDebug_DHCSR_S_SUIDE_Pos) /*!< \deprecated CoreDebug DHCSR: S_SUIDE Mask */ + +#define CoreDebug_DHCSR_S_NSUIDE_Pos 21U /*!< \deprecated CoreDebug DHCSR: S_NSUIDE Position */ +#define CoreDebug_DHCSR_S_NSUIDE_Msk (1UL << CoreDebug_DHCSR_S_NSUIDE_Pos) /*!< \deprecated CoreDebug DHCSR: S_NSUIDE Mask */ + +#define CoreDebug_DHCSR_S_SDE_Pos 20U /*!< \deprecated CoreDebug DHCSR: S_SDE Position */ +#define CoreDebug_DHCSR_S_SDE_Msk (1UL << CoreDebug_DHCSR_S_SDE_Pos) /*!< \deprecated CoreDebug DHCSR: S_SDE Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< \deprecated CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< \deprecated CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< \deprecated CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< \deprecated CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< \deprecated CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< \deprecated CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< \deprecated CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< \deprecated CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_PMOV_Pos 6U /*!< \deprecated CoreDebug DHCSR: C_PMOV Position */ +#define CoreDebug_DHCSR_C_PMOV_Msk (1UL << CoreDebug_DHCSR_C_PMOV_Pos) /*!< \deprecated CoreDebug DHCSR: C_PMOV Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< \deprecated CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< \deprecated CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< \deprecated CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< \deprecated CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< \deprecated CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< \deprecated CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< \deprecated CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< \deprecated CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< \deprecated CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< \deprecated CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< \deprecated CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< \deprecated CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< \deprecated CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< \deprecated CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< \deprecated CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< \deprecated CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< \deprecated CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< \deprecated CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< \deprecated CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< \deprecated CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< \deprecated CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< \deprecated CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< \deprecated CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< \deprecated CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< \deprecated CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< \deprecated CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< \deprecated CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< \deprecated CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< \deprecated CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< \deprecated CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< \deprecated CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< \deprecated CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< \deprecated CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< \deprecated CoreDebug DEMCR: VC_CORERESET Mask */ + +/* Debug Set Clear Exception and Monitor Control Register Definitions */ +#define CoreDebug_DSCEMCR_CLR_MON_REQ_Pos 19U /*!< \deprecated CoreDebug DSCEMCR: CLR_MON_REQ, Position */ +#define CoreDebug_DSCEMCR_CLR_MON_REQ_Msk (1UL << CoreDebug_DSCEMCR_CLR_MON_REQ_Pos) /*!< \deprecated CoreDebug DSCEMCR: CLR_MON_REQ, Mask */ + +#define CoreDebug_DSCEMCR_CLR_MON_PEND_Pos 17U /*!< \deprecated CoreDebug DSCEMCR: CLR_MON_PEND, Position */ +#define CoreDebug_DSCEMCR_CLR_MON_PEND_Msk (1UL << CoreDebug_DSCEMCR_CLR_MON_PEND_Pos) /*!< \deprecated CoreDebug DSCEMCR: CLR_MON_PEND, Mask */ + +#define CoreDebug_DSCEMCR_SET_MON_REQ_Pos 3U /*!< \deprecated CoreDebug DSCEMCR: SET_MON_REQ, Position */ +#define CoreDebug_DSCEMCR_SET_MON_REQ_Msk (1UL << CoreDebug_DSCEMCR_SET_MON_REQ_Pos) /*!< \deprecated CoreDebug DSCEMCR: SET_MON_REQ, Mask */ + +#define CoreDebug_DSCEMCR_SET_MON_PEND_Pos 1U /*!< \deprecated CoreDebug DSCEMCR: SET_MON_PEND, Position */ +#define CoreDebug_DSCEMCR_SET_MON_PEND_Msk (1UL << CoreDebug_DSCEMCR_SET_MON_PEND_Pos) /*!< \deprecated CoreDebug DSCEMCR: SET_MON_PEND, Mask */ + +/* Debug Authentication Control Register Definitions */ +#define CoreDebug_DAUTHCTRL_UIDEN_Pos 10U /*!< \deprecated CoreDebug DAUTHCTRL: UIDEN, Position */ +#define CoreDebug_DAUTHCTRL_UIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_UIDEN_Pos) /*!< \deprecated CoreDebug DAUTHCTRL: UIDEN, Mask */ + +#define CoreDebug_DAUTHCTRL_UIDAPEN_Pos 9U /*!< \deprecated CoreDebug DAUTHCTRL: UIDAPEN, Position */ +#define CoreDebug_DAUTHCTRL_UIDAPEN_Msk (1UL << CoreDebug_DAUTHCTRL_UIDAPEN_Pos) /*!< \deprecated CoreDebug DAUTHCTRL: UIDAPEN, Mask */ + +#define CoreDebug_DAUTHCTRL_FSDMA_Pos 8U /*!< \deprecated CoreDebug DAUTHCTRL: FSDMA, Position */ +#define CoreDebug_DAUTHCTRL_FSDMA_Msk (1UL << CoreDebug_DAUTHCTRL_FSDMA_Pos) /*!< \deprecated CoreDebug DAUTHCTRL: FSDMA, Mask */ + +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< \deprecated CoreDebug DAUTHCTRL: INTSPNIDEN, Position */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos) /*!< \deprecated CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */ + +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< \deprecated CoreDebug DAUTHCTRL: SPNIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos) /*!< \deprecated CoreDebug DAUTHCTRL: SPNIDENSEL Mask */ + +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< \deprecated CoreDebug DAUTHCTRL: INTSPIDEN Position */ +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos) /*!< \deprecated CoreDebug DAUTHCTRL: INTSPIDEN Mask */ + +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< \deprecated CoreDebug DAUTHCTRL: SPIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< \deprecated CoreDebug DAUTHCTRL: SPIDENSEL Mask */ + +/* Debug Security Control and Status Register Definitions */ +#define CoreDebug_DSCSR_CDS_Pos 16U /*!< \deprecated CoreDebug DSCSR: CDS Position */ +#define CoreDebug_DSCSR_CDS_Msk (1UL << CoreDebug_DSCSR_CDS_Pos) /*!< \deprecated CoreDebug DSCSR: CDS Mask */ + +#define CoreDebug_DSCSR_SBRSEL_Pos 1U /*!< \deprecated CoreDebug DSCSR: SBRSEL Position */ +#define CoreDebug_DSCSR_SBRSEL_Msk (1UL << CoreDebug_DSCSR_SBRSEL_Pos) /*!< \deprecated CoreDebug DSCSR: SBRSEL Mask */ + +#define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< \deprecated CoreDebug DSCSR: SBRSELEN Position */ +#define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< \deprecated CoreDebug DSCSR: SBRSELEN Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DCB Debug Control Block + \brief Type definitions for the Debug Control Block Registers + @{ + */ + +/** + \brief Structure type to access the Debug Control Block Registers (DCB). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ + __OM uint32_t DSCEMCR; /*!< Offset: 0x010 ( /W) Debug Set Clear Exception and Monitor Control Register */ + __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ + __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ +} DCB_Type; + +/* DHCSR, Debug Halting Control and Status Register Definitions */ +#define DCB_DHCSR_DBGKEY_Pos 16U /*!< DCB DHCSR: Debug key Position */ +#define DCB_DHCSR_DBGKEY_Msk (0xFFFFUL << DCB_DHCSR_DBGKEY_Pos) /*!< DCB DHCSR: Debug key Mask */ + +#define DCB_DHCSR_S_RESTART_ST_Pos 26U /*!< DCB DHCSR: Restart sticky status Position */ +#define DCB_DHCSR_S_RESTART_ST_Msk (0x1UL << DCB_DHCSR_S_RESTART_ST_Pos) /*!< DCB DHCSR: Restart sticky status Mask */ + +#define DCB_DHCSR_S_RESET_ST_Pos 25U /*!< DCB DHCSR: Reset sticky status Position */ +#define DCB_DHCSR_S_RESET_ST_Msk (0x1UL << DCB_DHCSR_S_RESET_ST_Pos) /*!< DCB DHCSR: Reset sticky status Mask */ + +#define DCB_DHCSR_S_RETIRE_ST_Pos 24U /*!< DCB DHCSR: Retire sticky status Position */ +#define DCB_DHCSR_S_RETIRE_ST_Msk (0x1UL << DCB_DHCSR_S_RETIRE_ST_Pos) /*!< DCB DHCSR: Retire sticky status Mask */ + +#define DCB_DHCSR_S_FPD_Pos 23U /*!< DCB DHCSR: Floating-point registers Debuggable Position */ +#define DCB_DHCSR_S_FPD_Msk (0x1UL << DCB_DHCSR_S_FPD_Pos) /*!< DCB DHCSR: Floating-point registers Debuggable Mask */ + +#define DCB_DHCSR_S_SUIDE_Pos 22U /*!< DCB DHCSR: Secure unprivileged halting debug enabled Position */ +#define DCB_DHCSR_S_SUIDE_Msk (0x1UL << DCB_DHCSR_S_SUIDE_Pos) /*!< DCB DHCSR: Secure unprivileged halting debug enabled Mask */ + +#define DCB_DHCSR_S_NSUIDE_Pos 21U /*!< DCB DHCSR: Non-secure unprivileged halting debug enabled Position */ +#define DCB_DHCSR_S_NSUIDE_Msk (0x1UL << DCB_DHCSR_S_NSUIDE_Pos) /*!< DCB DHCSR: Non-secure unprivileged halting debug enabled Mask */ + +#define DCB_DHCSR_S_SDE_Pos 20U /*!< DCB DHCSR: Secure debug enabled Position */ +#define DCB_DHCSR_S_SDE_Msk (0x1UL << DCB_DHCSR_S_SDE_Pos) /*!< DCB DHCSR: Secure debug enabled Mask */ + +#define DCB_DHCSR_S_LOCKUP_Pos 19U /*!< DCB DHCSR: Lockup status Position */ +#define DCB_DHCSR_S_LOCKUP_Msk (0x1UL << DCB_DHCSR_S_LOCKUP_Pos) /*!< DCB DHCSR: Lockup status Mask */ + +#define DCB_DHCSR_S_SLEEP_Pos 18U /*!< DCB DHCSR: Sleeping status Position */ +#define DCB_DHCSR_S_SLEEP_Msk (0x1UL << DCB_DHCSR_S_SLEEP_Pos) /*!< DCB DHCSR: Sleeping status Mask */ + +#define DCB_DHCSR_S_HALT_Pos 17U /*!< DCB DHCSR: Halted status Position */ +#define DCB_DHCSR_S_HALT_Msk (0x1UL << DCB_DHCSR_S_HALT_Pos) /*!< DCB DHCSR: Halted status Mask */ + +#define DCB_DHCSR_S_REGRDY_Pos 16U /*!< DCB DHCSR: Register ready status Position */ +#define DCB_DHCSR_S_REGRDY_Msk (0x1UL << DCB_DHCSR_S_REGRDY_Pos) /*!< DCB DHCSR: Register ready status Mask */ + +#define DCB_DHCSR_C_PMOV_Pos 6U /*!< DCB DHCSR: Halt on PMU overflow control Position */ +#define DCB_DHCSR_C_PMOV_Msk (0x1UL << DCB_DHCSR_C_PMOV_Pos) /*!< DCB DHCSR: Halt on PMU overflow control Mask */ + +#define DCB_DHCSR_C_SNAPSTALL_Pos 5U /*!< DCB DHCSR: Snap stall control Position */ +#define DCB_DHCSR_C_SNAPSTALL_Msk (0x1UL << DCB_DHCSR_C_SNAPSTALL_Pos) /*!< DCB DHCSR: Snap stall control Mask */ + +#define DCB_DHCSR_C_MASKINTS_Pos 3U /*!< DCB DHCSR: Mask interrupts control Position */ +#define DCB_DHCSR_C_MASKINTS_Msk (0x1UL << DCB_DHCSR_C_MASKINTS_Pos) /*!< DCB DHCSR: Mask interrupts control Mask */ + +#define DCB_DHCSR_C_STEP_Pos 2U /*!< DCB DHCSR: Step control Position */ +#define DCB_DHCSR_C_STEP_Msk (0x1UL << DCB_DHCSR_C_STEP_Pos) /*!< DCB DHCSR: Step control Mask */ + +#define DCB_DHCSR_C_HALT_Pos 1U /*!< DCB DHCSR: Halt control Position */ +#define DCB_DHCSR_C_HALT_Msk (0x1UL << DCB_DHCSR_C_HALT_Pos) /*!< DCB DHCSR: Halt control Mask */ + +#define DCB_DHCSR_C_DEBUGEN_Pos 0U /*!< DCB DHCSR: Debug enable control Position */ +#define DCB_DHCSR_C_DEBUGEN_Msk (0x1UL /*<< DCB_DHCSR_C_DEBUGEN_Pos*/) /*!< DCB DHCSR: Debug enable control Mask */ + +/* DCRSR, Debug Core Register Select Register Definitions */ +#define DCB_DCRSR_REGWnR_Pos 16U /*!< DCB DCRSR: Register write/not-read Position */ +#define DCB_DCRSR_REGWnR_Msk (0x1UL << DCB_DCRSR_REGWnR_Pos) /*!< DCB DCRSR: Register write/not-read Mask */ + +#define DCB_DCRSR_REGSEL_Pos 0U /*!< DCB DCRSR: Register selector Position */ +#define DCB_DCRSR_REGSEL_Msk (0x7FUL /*<< DCB_DCRSR_REGSEL_Pos*/) /*!< DCB DCRSR: Register selector Mask */ + +/* DCRDR, Debug Core Register Data Register Definitions */ +#define DCB_DCRDR_DBGTMP_Pos 0U /*!< DCB DCRDR: Data temporary buffer Position */ +#define DCB_DCRDR_DBGTMP_Msk (0xFFFFFFFFUL /*<< DCB_DCRDR_DBGTMP_Pos*/) /*!< DCB DCRDR: Data temporary buffer Mask */ + +/* DEMCR, Debug Exception and Monitor Control Register Definitions */ +#define DCB_DEMCR_TRCENA_Pos 24U /*!< DCB DEMCR: Trace enable Position */ +#define DCB_DEMCR_TRCENA_Msk (0x1UL << DCB_DEMCR_TRCENA_Pos) /*!< DCB DEMCR: Trace enable Mask */ + +#define DCB_DEMCR_MONPRKEY_Pos 23U /*!< DCB DEMCR: Monitor pend req key Position */ +#define DCB_DEMCR_MONPRKEY_Msk (0x1UL << DCB_DEMCR_MONPRKEY_Pos) /*!< DCB DEMCR: Monitor pend req key Mask */ + +#define DCB_DEMCR_UMON_EN_Pos 21U /*!< DCB DEMCR: Unprivileged monitor enable Position */ +#define DCB_DEMCR_UMON_EN_Msk (0x1UL << DCB_DEMCR_UMON_EN_Pos) /*!< DCB DEMCR: Unprivileged monitor enable Mask */ + +#define DCB_DEMCR_SDME_Pos 20U /*!< DCB DEMCR: Secure DebugMonitor enable Position */ +#define DCB_DEMCR_SDME_Msk (0x1UL << DCB_DEMCR_SDME_Pos) /*!< DCB DEMCR: Secure DebugMonitor enable Mask */ + +#define DCB_DEMCR_MON_REQ_Pos 19U /*!< DCB DEMCR: Monitor request Position */ +#define DCB_DEMCR_MON_REQ_Msk (0x1UL << DCB_DEMCR_MON_REQ_Pos) /*!< DCB DEMCR: Monitor request Mask */ + +#define DCB_DEMCR_MON_STEP_Pos 18U /*!< DCB DEMCR: Monitor step Position */ +#define DCB_DEMCR_MON_STEP_Msk (0x1UL << DCB_DEMCR_MON_STEP_Pos) /*!< DCB DEMCR: Monitor step Mask */ + +#define DCB_DEMCR_MON_PEND_Pos 17U /*!< DCB DEMCR: Monitor pend Position */ +#define DCB_DEMCR_MON_PEND_Msk (0x1UL << DCB_DEMCR_MON_PEND_Pos) /*!< DCB DEMCR: Monitor pend Mask */ + +#define DCB_DEMCR_MON_EN_Pos 16U /*!< DCB DEMCR: Monitor enable Position */ +#define DCB_DEMCR_MON_EN_Msk (0x1UL << DCB_DEMCR_MON_EN_Pos) /*!< DCB DEMCR: Monitor enable Mask */ + +#define DCB_DEMCR_VC_SFERR_Pos 11U /*!< DCB DEMCR: Vector Catch SecureFault Position */ +#define DCB_DEMCR_VC_SFERR_Msk (0x1UL << DCB_DEMCR_VC_SFERR_Pos) /*!< DCB DEMCR: Vector Catch SecureFault Mask */ + +#define DCB_DEMCR_VC_HARDERR_Pos 10U /*!< DCB DEMCR: Vector Catch HardFault errors Position */ +#define DCB_DEMCR_VC_HARDERR_Msk (0x1UL << DCB_DEMCR_VC_HARDERR_Pos) /*!< DCB DEMCR: Vector Catch HardFault errors Mask */ + +#define DCB_DEMCR_VC_INTERR_Pos 9U /*!< DCB DEMCR: Vector Catch interrupt errors Position */ +#define DCB_DEMCR_VC_INTERR_Msk (0x1UL << DCB_DEMCR_VC_INTERR_Pos) /*!< DCB DEMCR: Vector Catch interrupt errors Mask */ + +#define DCB_DEMCR_VC_BUSERR_Pos 8U /*!< DCB DEMCR: Vector Catch BusFault errors Position */ +#define DCB_DEMCR_VC_BUSERR_Msk (0x1UL << DCB_DEMCR_VC_BUSERR_Pos) /*!< DCB DEMCR: Vector Catch BusFault errors Mask */ + +#define DCB_DEMCR_VC_STATERR_Pos 7U /*!< DCB DEMCR: Vector Catch state errors Position */ +#define DCB_DEMCR_VC_STATERR_Msk (0x1UL << DCB_DEMCR_VC_STATERR_Pos) /*!< DCB DEMCR: Vector Catch state errors Mask */ + +#define DCB_DEMCR_VC_CHKERR_Pos 6U /*!< DCB DEMCR: Vector Catch check errors Position */ +#define DCB_DEMCR_VC_CHKERR_Msk (0x1UL << DCB_DEMCR_VC_CHKERR_Pos) /*!< DCB DEMCR: Vector Catch check errors Mask */ + +#define DCB_DEMCR_VC_NOCPERR_Pos 5U /*!< DCB DEMCR: Vector Catch NOCP errors Position */ +#define DCB_DEMCR_VC_NOCPERR_Msk (0x1UL << DCB_DEMCR_VC_NOCPERR_Pos) /*!< DCB DEMCR: Vector Catch NOCP errors Mask */ + +#define DCB_DEMCR_VC_MMERR_Pos 4U /*!< DCB DEMCR: Vector Catch MemManage errors Position */ +#define DCB_DEMCR_VC_MMERR_Msk (0x1UL << DCB_DEMCR_VC_MMERR_Pos) /*!< DCB DEMCR: Vector Catch MemManage errors Mask */ + +#define DCB_DEMCR_VC_CORERESET_Pos 0U /*!< DCB DEMCR: Vector Catch Core reset Position */ +#define DCB_DEMCR_VC_CORERESET_Msk (0x1UL /*<< DCB_DEMCR_VC_CORERESET_Pos*/) /*!< DCB DEMCR: Vector Catch Core reset Mask */ + +/* DSCEMCR, Debug Set Clear Exception and Monitor Control Register Definitions */ +#define DCB_DSCEMCR_CLR_MON_REQ_Pos 19U /*!< DCB DSCEMCR: Clear monitor request Position */ +#define DCB_DSCEMCR_CLR_MON_REQ_Msk (0x1UL << DCB_DSCEMCR_CLR_MON_REQ_Pos) /*!< DCB DSCEMCR: Clear monitor request Mask */ + +#define DCB_DSCEMCR_CLR_MON_PEND_Pos 17U /*!< DCB DSCEMCR: Clear monitor pend Position */ +#define DCB_DSCEMCR_CLR_MON_PEND_Msk (0x1UL << DCB_DSCEMCR_CLR_MON_PEND_Pos) /*!< DCB DSCEMCR: Clear monitor pend Mask */ + +#define DCB_DSCEMCR_SET_MON_REQ_Pos 3U /*!< DCB DSCEMCR: Set monitor request Position */ +#define DCB_DSCEMCR_SET_MON_REQ_Msk (0x1UL << DCB_DSCEMCR_SET_MON_REQ_Pos) /*!< DCB DSCEMCR: Set monitor request Mask */ + +#define DCB_DSCEMCR_SET_MON_PEND_Pos 1U /*!< DCB DSCEMCR: Set monitor pend Position */ +#define DCB_DSCEMCR_SET_MON_PEND_Msk (0x1UL << DCB_DSCEMCR_SET_MON_PEND_Pos) /*!< DCB DSCEMCR: Set monitor pend Mask */ + +/* DAUTHCTRL, Debug Authentication Control Register Definitions */ +#define DCB_DAUTHCTRL_UIDEN_Pos 10U /*!< DCB DAUTHCTRL: Unprivileged Invasive Debug Enable Position */ +#define DCB_DAUTHCTRL_UIDEN_Msk (0x1UL << DCB_DAUTHCTRL_UIDEN_Pos) /*!< DCB DAUTHCTRL: Unprivileged Invasive Debug Enable Mask */ + +#define DCB_DAUTHCTRL_UIDAPEN_Pos 9U /*!< DCB DAUTHCTRL: Unprivileged Invasive DAP Access Enable Position */ +#define DCB_DAUTHCTRL_UIDAPEN_Msk (0x1UL << DCB_DAUTHCTRL_UIDAPEN_Pos) /*!< DCB DAUTHCTRL: Unprivileged Invasive DAP Access Enable Mask */ + +#define DCB_DAUTHCTRL_FSDMA_Pos 8U /*!< DCB DAUTHCTRL: Force Secure DebugMonitor Allowed Position */ +#define DCB_DAUTHCTRL_FSDMA_Msk (0x1UL << DCB_DAUTHCTRL_FSDMA_Pos) /*!< DCB DAUTHCTRL: Force Secure DebugMonitor Allowed Mask */ + +#define DCB_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< DCB DAUTHCTRL: Internal Secure non-invasive debug enable Position */ +#define DCB_DAUTHCTRL_INTSPNIDEN_Msk (0x1UL << DCB_DAUTHCTRL_INTSPNIDEN_Pos) /*!< DCB DAUTHCTRL: Internal Secure non-invasive debug enable Mask */ + +#define DCB_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< DCB DAUTHCTRL: Secure non-invasive debug enable select Position */ +#define DCB_DAUTHCTRL_SPNIDENSEL_Msk (0x1UL << DCB_DAUTHCTRL_SPNIDENSEL_Pos) /*!< DCB DAUTHCTRL: Secure non-invasive debug enable select Mask */ + +#define DCB_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< DCB DAUTHCTRL: Internal Secure invasive debug enable Position */ +#define DCB_DAUTHCTRL_INTSPIDEN_Msk (0x1UL << DCB_DAUTHCTRL_INTSPIDEN_Pos) /*!< DCB DAUTHCTRL: Internal Secure invasive debug enable Mask */ + +#define DCB_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< DCB DAUTHCTRL: Secure invasive debug enable select Position */ +#define DCB_DAUTHCTRL_SPIDENSEL_Msk (0x1UL /*<< DCB_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< DCB DAUTHCTRL: Secure invasive debug enable select Mask */ + +/* DSCSR, Debug Security Control and Status Register Definitions */ +#define DCB_DSCSR_CDSKEY_Pos 17U /*!< DCB DSCSR: CDS write-enable key Position */ +#define DCB_DSCSR_CDSKEY_Msk (0x1UL << DCB_DSCSR_CDSKEY_Pos) /*!< DCB DSCSR: CDS write-enable key Mask */ + +#define DCB_DSCSR_CDS_Pos 16U /*!< DCB DSCSR: Current domain Secure Position */ +#define DCB_DSCSR_CDS_Msk (0x1UL << DCB_DSCSR_CDS_Pos) /*!< DCB DSCSR: Current domain Secure Mask */ + +#define DCB_DSCSR_SBRSEL_Pos 1U /*!< DCB DSCSR: Secure banked register select Position */ +#define DCB_DSCSR_SBRSEL_Msk (0x1UL << DCB_DSCSR_SBRSEL_Pos) /*!< DCB DSCSR: Secure banked register select Mask */ + +#define DCB_DSCSR_SBRSELEN_Pos 0U /*!< DCB DSCSR: Secure banked register select enable Position */ +#define DCB_DSCSR_SBRSELEN_Msk (0x1UL /*<< DCB_DSCSR_SBRSELEN_Pos*/) /*!< DCB DSCSR: Secure banked register select enable Mask */ + +/*@} end of group CMSIS_DCB */ + + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DIB Debug Identification Block + \brief Type definitions for the Debug Identification Block Registers + @{ + */ + +/** + \brief Structure type to access the Debug Identification Block Registers (DIB). + */ +typedef struct +{ + uint32_t RESERVED0[2U]; + __IM uint32_t DAUTHSTATUS; /*!< Offset: 0x008 (R/ ) Debug Authentication Status Register */ + __IM uint32_t DDEVARCH; /*!< Offset: 0x00C (R/ ) SCS Device Architecture Register */ + uint32_t RESERVED1[3U]; + __IM uint32_t DDEVTYPE; /*!< Offset: 0x01C (R/ ) SCS Device Type Register */ +} DIB_Type; + +/* DAUTHSTATUS, Debug Authentication Status Register Definitions */ +#define DIB_DAUTHSTATUS_SUNID_Pos 22U /*!< DIB DAUTHSTATUS: Secure Unprivileged Non-invasive Debug Allowed Position */ +#define DIB_DAUTHSTATUS_SUNID_Msk (0x3UL << DIB_DAUTHSTATUS_SUNID_Pos ) /*!< DIB DAUTHSTATUS: Secure Unprivileged Non-invasive Debug Allowed Mask */ + +#define DIB_DAUTHSTATUS_SUID_Pos 20U /*!< DIB DAUTHSTATUS: Secure Unprivileged Invasive Debug Allowed Position */ +#define DIB_DAUTHSTATUS_SUID_Msk (0x3UL << DIB_DAUTHSTATUS_SUID_Pos ) /*!< DIB DAUTHSTATUS: Secure Unprivileged Invasive Debug Allowed Mask */ + +#define DIB_DAUTHSTATUS_NSUNID_Pos 18U /*!< DIB DAUTHSTATUS: Non-secure Unprivileged Non-invasive Debug Allo Position */ +#define DIB_DAUTHSTATUS_NSUNID_Msk (0x3UL << DIB_DAUTHSTATUS_NSUNID_Pos ) /*!< DIB DAUTHSTATUS: Non-secure Unprivileged Non-invasive Debug Allo Mask */ + +#define DIB_DAUTHSTATUS_NSUID_Pos 16U /*!< DIB DAUTHSTATUS: Non-secure Unprivileged Invasive Debug Allowed Position */ +#define DIB_DAUTHSTATUS_NSUID_Msk (0x3UL << DIB_DAUTHSTATUS_NSUID_Pos ) /*!< DIB DAUTHSTATUS: Non-secure Unprivileged Invasive Debug Allowed Mask */ + +#define DIB_DAUTHSTATUS_SNID_Pos 6U /*!< DIB DAUTHSTATUS: Secure Non-invasive Debug Position */ +#define DIB_DAUTHSTATUS_SNID_Msk (0x3UL << DIB_DAUTHSTATUS_SNID_Pos ) /*!< DIB DAUTHSTATUS: Secure Non-invasive Debug Mask */ + +#define DIB_DAUTHSTATUS_SID_Pos 4U /*!< DIB DAUTHSTATUS: Secure Invasive Debug Position */ +#define DIB_DAUTHSTATUS_SID_Msk (0x3UL << DIB_DAUTHSTATUS_SID_Pos ) /*!< DIB DAUTHSTATUS: Secure Invasive Debug Mask */ + +#define DIB_DAUTHSTATUS_NSNID_Pos 2U /*!< DIB DAUTHSTATUS: Non-secure Non-invasive Debug Position */ +#define DIB_DAUTHSTATUS_NSNID_Msk (0x3UL << DIB_DAUTHSTATUS_NSNID_Pos ) /*!< DIB DAUTHSTATUS: Non-secure Non-invasive Debug Mask */ + +#define DIB_DAUTHSTATUS_NSID_Pos 0U /*!< DIB DAUTHSTATUS: Non-secure Invasive Debug Position */ +#define DIB_DAUTHSTATUS_NSID_Msk (0x3UL /*<< DIB_DAUTHSTATUS_NSID_Pos*/) /*!< DIB DAUTHSTATUS: Non-secure Invasive Debug Mask */ + +/* DDEVARCH, SCS Device Architecture Register Definitions */ +#define DIB_DDEVARCH_ARCHITECT_Pos 21U /*!< DIB DDEVARCH: Architect Position */ +#define DIB_DDEVARCH_ARCHITECT_Msk (0x7FFUL << DIB_DDEVARCH_ARCHITECT_Pos ) /*!< DIB DDEVARCH: Architect Mask */ + +#define DIB_DDEVARCH_PRESENT_Pos 20U /*!< DIB DDEVARCH: DEVARCH Present Position */ +#define DIB_DDEVARCH_PRESENT_Msk (0x1FUL << DIB_DDEVARCH_PRESENT_Pos ) /*!< DIB DDEVARCH: DEVARCH Present Mask */ + +#define DIB_DDEVARCH_REVISION_Pos 16U /*!< DIB DDEVARCH: Revision Position */ +#define DIB_DDEVARCH_REVISION_Msk (0xFUL << DIB_DDEVARCH_REVISION_Pos ) /*!< DIB DDEVARCH: Revision Mask */ + +#define DIB_DDEVARCH_ARCHVER_Pos 12U /*!< DIB DDEVARCH: Architecture Version Position */ +#define DIB_DDEVARCH_ARCHVER_Msk (0xFUL << DIB_DDEVARCH_ARCHVER_Pos ) /*!< DIB DDEVARCH: Architecture Version Mask */ + +#define DIB_DDEVARCH_ARCHPART_Pos 0U /*!< DIB DDEVARCH: Architecture Part Position */ +#define DIB_DDEVARCH_ARCHPART_Msk (0xFFFUL /*<< DIB_DDEVARCH_ARCHPART_Pos*/) /*!< DIB DDEVARCH: Architecture Part Mask */ + +/* DDEVTYPE, SCS Device Type Register Definitions */ +#define DIB_DDEVTYPE_SUB_Pos 4U /*!< DIB DDEVTYPE: Sub-type Position */ +#define DIB_DDEVTYPE_SUB_Msk (0xFUL << DIB_DDEVTYPE_SUB_Pos ) /*!< DIB DDEVTYPE: Sub-type Mask */ + +#define DIB_DDEVTYPE_MAJOR_Pos 0U /*!< DIB DDEVTYPE: Major type Position */ +#define DIB_DDEVTYPE_MAJOR_Msk (0xFUL /*<< DIB_DDEVTYPE_MAJOR_Pos*/) /*!< DIB DDEVTYPE: Major type Mask */ + + +/*@} end of group CMSIS_DIB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ + #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ + #define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ + #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ + #define MEMSYSCTL_BASE (0xE001E000UL) /*!< Memory System Control Base Address */ + #define ERRBNK_BASE (0xE001E100UL) /*!< Error Banking Base Address */ + #define PWRMODCTL_BASE (0xE001E300UL) /*!< Power Mode Control Base Address */ + #define EWIC_BASE (0xE001E400UL) /*!< External Wakeup Interrupt Controller Base Address */ + #define PRCCFGINF_BASE (0xE001E700UL) /*!< Processor Configuration Information Base Address */ + #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ + #define CoreDebug_BASE (0xE000EDF0UL) /*!< \deprecated Core Debug Base Address */ + #define DCB_BASE (0xE000EDF0UL) /*!< DCB Base Address */ + #define DIB_BASE (0xE000EFB0UL) /*!< DIB Base Address */ + #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ + #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ + #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + + #define ICB ((ICB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ + #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ + #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ + #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + #define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ + #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ + #define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ + #define MEMSYSCTL ((MemSysCtl_Type *) MEMSYSCTL_BASE ) /*!< Memory System Control configuration struct */ + #define ERRBNK ((ErrBnk_Type *) ERRBNK_BASE ) /*!< Error Banking configuration struct */ + #define PWRMODCTL ((PwrModCtl_Type *) PWRMODCTL_BASE ) /*!< Power Mode Control configuration struct */ + #define EWIC ((EWIC_Type *) EWIC_BASE ) /*!< EWIC configuration struct */ + #define PRCCFGINF ((PrcCfgInf_Type *) PRCCFGINF_BASE ) /*!< Processor Configuration Information configuration struct */ + #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE ) /*!< \deprecated Core Debug configuration struct */ + #define DCB ((DCB_Type *) DCB_BASE ) /*!< DCB configuration struct */ + #define DIB ((DIB_Type *) DIB_BASE ) /*!< DIB configuration struct */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ + #endif + + #if defined (__PMU_PRESENT) && (__PMU_PRESENT == 1U) + #define PMU_BASE (0xE0003000UL) /*!< PMU Base Address */ + #define PMU ((PMU_Type *) PMU_BASE ) /*!< PMU configuration struct */ + #endif + + #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SAU_BASE (SCS_BASE + 0x0DD0UL) /*!< Security Attribution Unit */ + #define SAU ((SAU_Type *) SAU_BASE ) /*!< Security Attribution Unit */ + #endif + + #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ + #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SCS_BASE_NS (0xE002E000UL) /*!< System Control Space Base Address (non-secure address space) */ + #define CoreDebug_BASE_NS (0xE002EDF0UL) /*!< \deprecated Core Debug Base Address (non-secure address space) */ + #define DCB_BASE_NS (0xE002EDF0UL) /*!< DCB Base Address (non-secure address space) */ + #define DIB_BASE_NS (0xE002EFB0UL) /*!< DIB Base Address (non-secure address space) */ + #define SysTick_BASE_NS (SCS_BASE_NS + 0x0010UL) /*!< SysTick Base Address (non-secure address space) */ + #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */ + #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */ + + #define ICB_NS ((ICB_Type *) SCS_BASE_NS ) /*!< System control Register not in SCB(non-secure address space) */ + #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */ + #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */ + #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */ + #define CoreDebug_NS ((CoreDebug_Type *) CoreDebug_BASE_NS) /*!< \deprecated Core Debug configuration struct (non-secure address space) */ + #define DCB_NS ((DCB_Type *) DCB_BASE_NS ) /*!< DCB configuration struct (non-secure address space) */ + #define DIB_NS ((DIB_Type *) DIB_BASE_NS ) /*!< DIB configuration struct (non-secure address space) */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE_NS (SCS_BASE_NS + 0x0D90UL) /*!< Memory Protection Unit (non-secure address space) */ + #define MPU_NS ((MPU_Type *) MPU_BASE_NS ) /*!< Memory Protection Unit (non-secure address space) */ + #endif + + #define FPU_BASE_NS (SCS_BASE_NS + 0x0F30UL) /*!< Floating Point Unit (non-secure address space) */ + #define FPU_NS ((FPU_Type *) FPU_BASE_NS ) /*!< Floating Point Unit (non-secure address space) */ + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ +/*@} */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_register_aliases Backwards Compatibility Aliases + \brief Register alias definitions for backwards compatibility. + @{ + */ + +/*@} */ + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* Special LR values for Secure/Non-Secure call handling and exception handling */ + +/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS */ +#define FNC_RETURN (0xFEFFFFFFUL) /* bit [0] ignored when processing a branch */ + +/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */ +#define EXC_RETURN_PREFIX (0xFF000000UL) /* bits [31:24] set to indicate an EXC_RETURN value */ +#define EXC_RETURN_S (0x00000040UL) /* bit [6] stack used to push registers: 0=Non-secure 1=Secure */ +#define EXC_RETURN_DCRS (0x00000020UL) /* bit [5] stacking rules for called registers: 0=skipped 1=saved */ +#define EXC_RETURN_FTYPE (0x00000010UL) /* bit [4] allocate stack for floating-point context: 0=done 1=skipped */ +#define EXC_RETURN_MODE (0x00000008UL) /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode */ +#define EXC_RETURN_SPSEL (0x00000004UL) /* bit [2] stack pointer used to restore context: 0=MSP 1=PSP */ +#define EXC_RETURN_ES (0x00000001UL) /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */ + +/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking */ +#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) /* Value for processors with floating-point extension: */ +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125AUL) /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE */ +#else +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125BUL) /* Value for processors without floating-point extension */ +#endif + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + __COMPILER_BARRIER(); + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __COMPILER_BARRIER(); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Get Interrupt Target State + \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + \return 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Target State + \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Clear Interrupt Target State + \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; + __DSB(); +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Set Priority Grouping (non-secure) + \details Sets the non-secure priority grouping field when in secure state using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB_NS->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB_NS->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping (non-secure) + \details Reads the priority grouping field from the non-secure NVIC when in secure state. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriorityGrouping_NS(void) +{ + return ((uint32_t)((SCB_NS->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt (non-secure) + \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status (non-secure) + \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt (non-secure) + \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Pending Interrupt (non-secure) + \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt (non-secure) + \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt (non-secure) + \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt (non-secure) + \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority (non-secure) + \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every non-secure processor exception. + */ +__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority (non-secure) + \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC_NS->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv8.h" + +#endif + +/* ########################## PMU functions and events #################################### */ + +#if defined (__PMU_PRESENT) && (__PMU_PRESENT == 1U) + +#include "pmu_armv8.h" + +/** + \brief Cortex-M85 PMU events + \note Architectural PMU events can be found in pmu_armv8.h +*/ + +#define ARMCM85_PMU_ECC_ERR 0xC000 /*!< One or more Error Correcting Code (ECC) errors detected */ +#define ARMCM85_PMU_ECC_ERR_MBIT 0xC001 /*!< One or more multi-bit ECC errors detected */ +#define ARMCM85_PMU_ECC_ERR_DCACHE 0xC010 /*!< One or more ECC errors in the data cache */ +#define ARMCM85_PMU_ECC_ERR_ICACHE 0xC011 /*!< One or more ECC errors in the instruction cache */ +#define ARMCM85_PMU_ECC_ERR_MBIT_DCACHE 0xC012 /*!< One or more multi-bit ECC errors in the data cache */ +#define ARMCM85_PMU_ECC_ERR_MBIT_ICACHE 0xC013 /*!< One or more multi-bit ECC errors in the instruction cache */ +#define ARMCM85_PMU_ECC_ERR_DTCM 0xC020 /*!< One or more ECC errors in the Data Tightly Coupled Memory (DTCM) */ +#define ARMCM85_PMU_ECC_ERR_ITCM 0xC021 /*!< One or more ECC errors in the Instruction Tightly Coupled Memory (ITCM) */ +#define ARMCM85_PMU_ECC_ERR_MBIT_DTCM 0xC022 /*!< One or more multi-bit ECC errors in the DTCM */ +#define ARMCM85_PMU_ECC_ERR_MBIT_ITCM 0xC023 /*!< One or more multi-bit ECC errors in the ITCM */ +#define ARMCM85_PMU_PF_LINEFILL 0xC100 /*!< The prefetcher starts a line-fill */ +#define ARMCM85_PMU_PF_CANCEL 0xC101 /*!< The prefetcher stops prefetching */ +#define ARMCM85_PMU_PF_DROP_LINEFILL 0xC102 /*!< A linefill triggered by a prefetcher has been dropped because of lack of buffering */ +#define ARMCM85_PMU_NWAMODE_ENTER 0xC200 /*!< No write-allocate mode entry */ +#define ARMCM85_PMU_NWAMODE 0xC201 /*!< Write-allocate store is not allocated into the data cache due to no-write-allocate mode */ +#define ARMCM85_PMU_SAHB_ACCESS 0xC300 /*!< Read or write access on the S-AHB interface to the TCM */ +#define ARMCM85_PMU_PAHB_ACCESS 0xC301 /*!< Read or write access on the P-AHB write interface */ +#define ARMCM85_PMU_AXI_WRITE_ACCESS 0xC302 /*!< Any beat access to M-AXI write interface */ +#define ARMCM85_PMU_AXI_READ_ACCESS 0xC303 /*!< Any beat access to M-AXI read interface */ +#define ARMCM85_PMU_DOSTIMEOUT_DOUBLE 0xC400 /*!< Denial of Service timeout has fired twice and caused buffers to drain to allow forward progress */ +#define ARMCM85_PMU_DOSTIMEOUT_TRIPLE 0xC401 /*!< Denial of Service timeout has fired three times and blocked the LSU to force forward progress */ + +#endif + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + uint32_t mvfr0; + + mvfr0 = FPU->MVFR0; + if ((mvfr0 & (FPU_MVFR0_FPSP_Msk | FPU_MVFR0_FPDP_Msk)) == 0x220U) + { + return 2U; /* Double + Single precision FPU */ + } + else if ((mvfr0 & (FPU_MVFR0_FPSP_Msk | FPU_MVFR0_FPDP_Msk)) == 0x020U) + { + return 1U; /* Single precision FPU */ + } + else + { + return 0U; /* No FPU */ + } +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + +/* ########################## MVE functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_MveFunctions MVE Functions + \brief Function that provides MVE type. + @{ + */ + +/** + \brief get MVE type + \details returns the MVE type + \returns + - \b 0: No Vector Extension (MVE) + - \b 1: Integer Vector Extension (MVE-I) + - \b 2: Floating-point Vector Extension (MVE-F) + */ +__STATIC_INLINE uint32_t SCB_GetMVEType(void) +{ + const uint32_t mvfr1 = FPU->MVFR1; + if ((mvfr1 & FPU_MVFR1_MVE_Msk) == (0x2U << FPU_MVFR1_MVE_Pos)) + { + return 2U; + } + else if ((mvfr1 & FPU_MVFR1_MVE_Msk) == (0x1U << FPU_MVFR1_MVE_Pos)) + { + return 1U; + } + else + { + return 0U; + } +} + + +/*@} end of CMSIS_Core_MveFunctions */ + + +/* ########################## Cache functions #################################### */ + +#if ((defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U)) || \ + (defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U))) +#include "cachel1_armv7.h" +#endif + + +/* ########################## SAU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SAUFunctions SAU Functions + \brief Functions that configure the SAU. + @{ + */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + +/** + \brief Enable SAU + \details Enables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Enable(void) +{ + SAU->CTRL |= (SAU_CTRL_ENABLE_Msk); +} + + + +/** + \brief Disable SAU + \details Disables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Disable(void) +{ + SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk); +} + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_SAUFunctions */ + + + +/* ################### PAC Key functions ########################### */ + +#if (defined (__ARM_FEATURE_PAUTH) && (__ARM_FEATURE_PAUTH == 1)) +#include "pac_armv81.h" +#endif + + +/* ################################## Debug Control function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_DCBFunctions Debug Control Functions + \brief Functions that access the Debug Control Block. + @{ + */ + + +/** + \brief Set Debug Authentication Control Register + \details writes to Debug Authentication Control register. + \param [in] value value to be writen. + */ +__STATIC_INLINE void DCB_SetAuthCtrl(uint32_t value) +{ + __DSB(); + __ISB(); + DCB->DAUTHCTRL = value; + __DSB(); + __ISB(); +} + + +/** + \brief Get Debug Authentication Control Register + \details Reads Debug Authentication Control register. + \return Debug Authentication Control Register. + */ +__STATIC_INLINE uint32_t DCB_GetAuthCtrl(void) +{ + return (DCB->DAUTHCTRL); +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Set Debug Authentication Control Register (non-secure) + \details writes to non-secure Debug Authentication Control register when in secure state. + \param [in] value value to be writen + */ +__STATIC_INLINE void TZ_DCB_SetAuthCtrl_NS(uint32_t value) +{ + __DSB(); + __ISB(); + DCB_NS->DAUTHCTRL = value; + __DSB(); + __ISB(); +} + + +/** + \brief Get Debug Authentication Control Register (non-secure) + \details Reads non-secure Debug Authentication Control register when in secure state. + \return Debug Authentication Control Register. + */ +__STATIC_INLINE uint32_t TZ_DCB_GetAuthCtrl_NS(void) +{ + return (DCB_NS->DAUTHCTRL); +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_DCBFunctions */ + + + + +/* ################################## Debug Identification function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_DIBFunctions Debug Identification Functions + \brief Functions that access the Debug Identification Block. + @{ + */ + + +/** + \brief Get Debug Authentication Status Register + \details Reads Debug Authentication Status register. + \return Debug Authentication Status Register. + */ +__STATIC_INLINE uint32_t DIB_GetAuthStatus(void) +{ + return (DIB->DAUTHSTATUS); +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Get Debug Authentication Status Register (non-secure) + \details Reads non-secure Debug Authentication Status register when in secure state. + \return Debug Authentication Status Register. + */ +__STATIC_INLINE uint32_t TZ_DIB_GetAuthStatus_NS(void) +{ + return (DIB_NS->DAUTHSTATUS); +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_DCBFunctions */ + + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief System Tick Configuration (non-secure) + \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function TZ_SysTick_Config_NS is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + + */ +__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM85_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/edge-impulse-sdk/CMSIS/Core/Include/core_sc300.h b/edge-impulse-sdk/CMSIS/Core/Include/core_sc300.h index 03a02cc..f6c3bfd 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/core_sc300.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/core_sc300.h @@ -1,11 +1,11 @@ /**************************************************************************//** * @file core_sc300.h * @brief CMSIS SC300 Core Peripheral Access Layer Header File - * @version V5.0.9 - * @date 27. March 2020 + * @version V5.0.10 + * @date 04. June 2021 ******************************************************************************/ /* - * Copyright (c) 2009-2020 Arm Limited. All rights reserved. + * Copyright (c) 2009-2021 Arm Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -562,19 +562,19 @@ typedef struct #define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ /* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ -#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Pos (SCB_CFSR_MEMFAULTSR_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ #define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ -#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ #define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ -#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ #define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ -#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ #define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ -#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ #define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ /* BusFault Status Register (part of SCB Configurable Fault Status Register) */ diff --git a/edge-impulse-sdk/CMSIS/Core/Include/core_starmc1.h b/edge-impulse-sdk/CMSIS/Core/Include/core_starmc1.h new file mode 100644 index 0000000..a6a399d --- /dev/null +++ b/edge-impulse-sdk/CMSIS/Core/Include/core_starmc1.h @@ -0,0 +1,3592 @@ +/**************************************************************************//** + * @file core_starmc1.h + * @brief CMSIS ArmChina STAR-MC1 Core Peripheral Access Layer Header File + * @version V1.0.2 + * @date 07. April 2022 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. + * Copyright (c) 2018-2022 Arm China. + * All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#elif defined ( __GNUC__ ) + #pragma GCC diagnostic ignored "-Wpedantic" /* disable pedantic warning due to unnamed structs/unions */ +#endif + +#ifndef __CORE_STAR_H_GENERIC +#define __CORE_STAR_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup STAR-MC1 + @{ + */ + +#include "cmsis_version.h" + +/* Macro Define for STAR-MC1 */ +#define __STAR_MC (1U) /*!< STAR-MC Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. +*/ +#if defined ( __CC_ARM ) + #if defined (__TARGET_FPU_VFP) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) + #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined (__ARM_FP) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) + #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) + #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __ICCARM__ ) + #if defined (__ARMVFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) + #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __TI_ARM__ ) + #if defined (__TI_VFP_SUPPORT__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TASKING__ ) + #if defined (__FPU_VFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#endif + +#include "edge-impulse-sdk/CMSIS/Core/Include/cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_STAR_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_STAR_H_DEPENDANT +#define __CORE_STAR_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __STAR_REV + #define __STAR_REV 0x0000U + #warning "__STAR_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __SAUREGION_PRESENT + #define __SAUREGION_PRESENT 0U + #warning "__SAUREGION_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __DSP_PRESENT + #define __DSP_PRESENT 0U + #warning "__DSP_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __ICACHE_PRESENT + #define __ICACHE_PRESENT 0U + #warning "__ICACHE_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __DCACHE_PRESENT + #define __DCACHE_PRESENT 0U + #warning "__DCACHE_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __DTCM_PRESENT + #define __DTCM_PRESENT 0U + #warning "__DTCM_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group STAR-MC1 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core SAU Register + - Core FPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for STAR-MC1 processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + +#define APSR_GE_Pos 16U /*!< APSR: GE Position */ +#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_IT_Pos 25U /*!< xPSR: IT Position */ +#define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */ +#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack-pointer select */ + uint32_t FPCA:1; /*!< bit: 2 Floating-point context active */ + uint32_t SFPA:1; /*!< bit: 3 Secure floating-point active */ + uint32_t _reserved1:28; /*!< bit: 4..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SFPA_Pos 3U /*!< CONTROL: SFPA Position */ +#define CONTROL_SFPA_Msk (1UL << CONTROL_SFPA_Pos) /*!< CONTROL: SFPA Mask */ + +#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */ +#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ + +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[16U]; + __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[16U]; + __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[16U]; + __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[16U]; + __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[16U]; + __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */ + uint32_t RESERVED5[16U]; + __IOM uint8_t IPR[496U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED6[580U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHPR[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ID_AFR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ID_ISAR[5U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + uint32_t RESERVED0[1U]; + __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ + __IM uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */ + __IM uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */ + __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ + __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */ + uint32_t RESERVED_ADD1[21U]; + __IOM uint32_t SFSR; /*!< Offset: 0x0E4 (R/W) Secure Fault Status Register */ + __IOM uint32_t SFAR; /*!< Offset: 0x0E8 (R/W) Secure Fault Address Register */ + uint32_t RESERVED3[69U]; + __OM uint32_t STIR; /*!< Offset: F00-D00=0x200 ( /W) Software Triggered Interrupt Register */ + uint32_t RESERVED4[15U]; + __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */ + __IM uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 2 */ + uint32_t RESERVED5[1U]; + __OM uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */ + uint32_t RESERVED6[1U]; + __OM uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */ + __OM uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */ + __OM uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */ + __OM uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */ + __OM uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */ + __OM uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */ + __OM uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */ + __OM uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */ +} SCB_Type; + +typedef struct +{ + __IOM uint32_t CACR; /*!< Offset: 0x0 (R/W) L1 Cache Control Register */ + __IOM uint32_t ITCMCR; /*!< Offset: 0x10 (R/W) Instruction Tightly-Coupled Memory Control Register */ + __IOM uint32_t DTCMCR; /*!< Offset: 0x14 (R/W) Data Tightly-Coupled Memory Control Registers */ +}EMSS_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */ +#define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */ + +#define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */ +#define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */ + +#define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */ +#define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */ +#define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */ +#define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */ + +#define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */ +#define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */ +#define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */ +#define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: BP Position */ +#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */ + +#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */ +#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */ + +#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */ +#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */ + +#define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */ +#define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */ +#define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */ + +#define SCB_SHCSR_SECUREFAULTPENDED_Pos 20U /*!< SCB SHCSR: SECUREFAULTPENDED Position */ +#define SCB_SHCSR_SECUREFAULTPENDED_Msk (1UL << SCB_SHCSR_SECUREFAULTPENDED_Pos) /*!< SCB SHCSR: SECUREFAULTPENDED Mask */ + +#define SCB_SHCSR_SECUREFAULTENA_Pos 19U /*!< SCB SHCSR: SECUREFAULTENA Position */ +#define SCB_SHCSR_SECUREFAULTENA_Msk (1UL << SCB_SHCSR_SECUREFAULTENA_Pos) /*!< SCB SHCSR: SECUREFAULTENA Mask */ + +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */ +#define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */ + +#define SCB_SHCSR_SECUREFAULTACT_Pos 4U /*!< SCB SHCSR: SECUREFAULTACT Position */ +#define SCB_SHCSR_SECUREFAULTACT_Msk (1UL << SCB_SHCSR_SECUREFAULTACT_Pos) /*!< SCB SHCSR: SECUREFAULTACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */ +#define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_CFSR_MEMFAULTSR_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MLSPERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */ +#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_STKOF_Pos (SCB_CFSR_USGFAULTSR_Pos + 4U) /*!< SCB CFSR (UFSR): STKOF Position */ +#define SCB_CFSR_STKOF_Msk (1UL << SCB_CFSR_STKOF_Pos) /*!< SCB CFSR (UFSR): STKOF Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/* SCB Non-Secure Access Control Register Definitions */ +#define SCB_NSACR_CP11_Pos 11U /*!< SCB NSACR: CP11 Position */ +#define SCB_NSACR_CP11_Msk (1UL << SCB_NSACR_CP11_Pos) /*!< SCB NSACR: CP11 Mask */ + +#define SCB_NSACR_CP10_Pos 10U /*!< SCB NSACR: CP10 Position */ +#define SCB_NSACR_CP10_Msk (1UL << SCB_NSACR_CP10_Pos) /*!< SCB NSACR: CP10 Mask */ + +#define SCB_NSACR_CPn_Pos 0U /*!< SCB NSACR: CPn Position */ +#define SCB_NSACR_CPn_Msk (1UL /*<< SCB_NSACR_CPn_Pos*/) /*!< SCB NSACR: CPn Mask */ + +/* SCB Cache Level ID Register Definitions */ +#define SCB_CLIDR_LOUU_Pos 27U /*!< SCB CLIDR: LoUU Position */ +#define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */ + +#define SCB_CLIDR_LOC_Pos 24U /*!< SCB CLIDR: LoC Position */ +#define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_LOC_Pos) /*!< SCB CLIDR: LoC Mask */ + +#define SCB_CLIDR_IC_Pos 0U /*!< SCB CLIDR: IC Position */ +#define SCB_CLIDR_IC_Msk (1UL << SCB_CLIDR_IC_Pos) /*!< SCB CLIDR: IC Mask */ + +#define SCB_CLIDR_DC_Pos 1U /*!< SCB CLIDR: DC Position */ +#define SCB_CLIDR_DC_Msk (1UL << SCB_CLIDR_DC_Pos) /*!< SCB CLIDR: DC Mask */ + + + +/* SCB Cache Type Register Definitions */ +#define SCB_CTR_FORMAT_Pos 29U /*!< SCB CTR: Format Position */ +#define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */ + +#define SCB_CTR_CWG_Pos 24U /*!< SCB CTR: CWG Position */ +#define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */ + +#define SCB_CTR_ERG_Pos 20U /*!< SCB CTR: ERG Position */ +#define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */ + +#define SCB_CTR_DMINLINE_Pos 16U /*!< SCB CTR: DminLine Position */ +#define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */ + +#define SCB_CTR_IMINLINE_Pos 0U /*!< SCB CTR: ImInLine Position */ +#define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */ + +/* SCB Cache Size ID Register Definitions */ +#define SCB_CCSIDR_WT_Pos 31U /*!< SCB CCSIDR: WT Position */ +#define SCB_CCSIDR_WT_Msk (1UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */ + +#define SCB_CCSIDR_WB_Pos 30U /*!< SCB CCSIDR: WB Position */ +#define SCB_CCSIDR_WB_Msk (1UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */ + +#define SCB_CCSIDR_RA_Pos 29U /*!< SCB CCSIDR: RA Position */ +#define SCB_CCSIDR_RA_Msk (1UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */ + +#define SCB_CCSIDR_WA_Pos 28U /*!< SCB CCSIDR: WA Position */ +#define SCB_CCSIDR_WA_Msk (1UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */ + +#define SCB_CCSIDR_NUMSETS_Pos 13U /*!< SCB CCSIDR: NumSets Position */ +#define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */ + +#define SCB_CCSIDR_ASSOCIATIVITY_Pos 3U /*!< SCB CCSIDR: Associativity Position */ +#define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */ + +#define SCB_CCSIDR_LINESIZE_Pos 0U /*!< SCB CCSIDR: LineSize Position */ +#define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */ + +/* SCB Cache Size Selection Register Definitions */ +#define SCB_CSSELR_LEVEL_Pos 1U /*!< SCB CSSELR: Level Position */ +#define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */ + +#define SCB_CSSELR_IND_Pos 0U /*!< SCB CSSELR: InD Position */ +#define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */ + +/* SCB Software Triggered Interrupt Register Definitions */ +#define SCB_STIR_INTID_Pos 0U /*!< SCB STIR: INTID Position */ +#define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */ + +/* SCB D-Cache line Invalidate by Set-way Register Definitions */ +#define SCB_DCISW_LEVEL_Pos 1U /*!< SCB DCISW: Level Position */ +#define SCB_DCISW_LEVEL_Msk (7UL << SCB_DCISW_LEVEL_Pos) /*!< SCB DCISW: Level Mask */ + +#define SCB_DCISW_WAY_Pos 30U /*!< SCB DCISW: Way Position */ +#define SCB_DCISW_WAY_Msk (3UL << SCB_DCISW_WAY_Pos) /*!< SCB DCISW: Way Mask */ + +#define SCB_DCISW_SET_Pos 5U /*!< SCB DCISW: Set Position */ +#define SCB_DCISW_SET_Msk (0xFFUL << SCB_DCISW_SET_Pos) /*!< SCB DCISW: Set Mask */ + +/* SCB D-Cache Clean line by Set-way Register Definitions */ +#define SCB_DCCSW_LEVEL_Pos 1U /*!< SCB DCCSW: Level Position */ +#define SCB_DCCSW_LEVEL_Msk (7UL << SCB_DCCSW_LEVEL_Pos) /*!< SCB DCCSW: Level Mask */ + +#define SCB_DCCSW_WAY_Pos 30U /*!< SCB DCCSW: Way Position */ +#define SCB_DCCSW_WAY_Msk (3UL << SCB_DCCSW_WAY_Pos) /*!< SCB DCCSW: Way Mask */ + +#define SCB_DCCSW_SET_Pos 5U /*!< SCB DCCSW: Set Position */ +#define SCB_DCCSW_SET_Msk (0xFFUL << SCB_DCCSW_SET_Pos) /*!< SCB DCCSW: Set Mask */ + +/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */ +#define SCB_DCCISW_LEVEL_Pos 1U /*!< SCB DCCISW: Level Position */ +#define SCB_DCCISW_LEVEL_Msk (7UL << SCB_DCCISW_LEVEL_Pos) /*!< SCB DCCISW: Level Mask */ + +#define SCB_DCCISW_WAY_Pos 30U /*!< SCB DCCISW: Way Position */ +#define SCB_DCCISW_WAY_Msk (3UL << SCB_DCCISW_WAY_Pos) /*!< SCB DCCISW: Way Mask */ + +#define SCB_DCCISW_SET_Pos 5U /*!< SCB DCCISW: Set Position */ +#define SCB_DCCISW_SET_Msk (0xFFUL << SCB_DCCISW_SET_Pos) /*!< SCB DCCISW: Set Mask */ + +/* ArmChina: Implementation Defined */ +/* Instruction Tightly-Coupled Memory Control Register Definitions */ +#define SCB_ITCMCR_SZ_Pos 3U /*!< SCB ITCMCR: SZ Position */ +#define SCB_ITCMCR_SZ_Msk (0xFUL << SCB_ITCMCR_SZ_Pos) /*!< SCB ITCMCR: SZ Mask */ + +#define SCB_ITCMCR_EN_Pos 0U /*!< SCB ITCMCR: EN Position */ +#define SCB_ITCMCR_EN_Msk (1UL /*<< SCB_ITCMCR_EN_Pos*/) /*!< SCB ITCMCR: EN Mask */ + +/* Data Tightly-Coupled Memory Control Register Definitions */ +#define SCB_DTCMCR_SZ_Pos 3U /*!< SCB DTCMCR: SZ Position */ +#define SCB_DTCMCR_SZ_Msk (0xFUL << SCB_DTCMCR_SZ_Pos) /*!< SCB DTCMCR: SZ Mask */ + +#define SCB_DTCMCR_EN_Pos 0U /*!< SCB DTCMCR: EN Position */ +#define SCB_DTCMCR_EN_Msk (1UL /*<< SCB_DTCMCR_EN_Pos*/) /*!< SCB DTCMCR: EN Mask */ + +/* L1 Cache Control Register Definitions */ +#define SCB_CACR_DCCLEAN_Pos 16U /*!< SCB CACR: DCCLEAN Position */ +#define SCB_CACR_DCCLEAN_Msk (1UL << SCB_CACR_FORCEWT_Pos) /*!< SCB CACR: DCCLEAN Mask */ + +#define SCB_CACR_ICACTIVE_Pos 13U /*!< SCB CACR: ICACTIVE Position */ +#define SCB_CACR_ICACTIVE_Msk (1UL << SCB_CACR_FORCEWT_Pos) /*!< SCB CACR: ICACTIVE Mask */ + +#define SCB_CACR_DCACTIVE_Pos 12U /*!< SCB CACR: DCACTIVE Position */ +#define SCB_CACR_DCACTIVE_Msk (1UL << SCB_CACR_FORCEWT_Pos) /*!< SCB CACR: DCACTIVE Mask */ + +#define SCB_CACR_FORCEWT_Pos 2U /*!< SCB CACR: FORCEWT Position */ +#define SCB_CACR_FORCEWT_Msk (1UL << SCB_CACR_FORCEWT_Pos) /*!< SCB CACR: FORCEWT Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ + __IOM uint32_t CPPWR; /*!< Offset: 0x00C (R/W) Coprocessor Power Control Register */ +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[32U]; + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[1U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) ITM Device Architecture Register */ + uint32_t RESERVED6[4U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Stimulus Port Register Definitions */ +#define ITM_STIM_DISABLED_Pos 1U /*!< ITM STIM: DISABLED Position */ +#define ITM_STIM_DISABLED_Msk (0x1UL << ITM_STIM_DISABLED_Pos) /*!< ITM STIM: DISABLED Mask */ + +#define ITM_STIM_FIFOREADY_Pos 0U /*!< ITM STIM: FIFOREADY Position */ +#define ITM_STIM_FIFOREADY_Msk (0x1UL /*<< ITM_STIM_FIFOREADY_Pos*/) /*!< ITM STIM: FIFOREADY Mask */ + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TRACEBUSID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TRACEBUSID_Msk (0x7FUL << ITM_TCR_TRACEBUSID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPRESCALE_Pos 8U /*!< ITM TCR: TSPRESCALE Position */ +#define ITM_TCR_TSPRESCALE_Msk (3UL << ITM_TCR_TSPRESCALE_Pos) /*!< ITM TCR: TSPRESCALE Mask */ + +#define ITM_TCR_STALLENA_Pos 5U /*!< ITM TCR: STALLENA Position */ +#define ITM_TCR_STALLENA_Msk (1UL << ITM_TCR_STALLENA_Pos) /*!< ITM TCR: STALLENA Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + uint32_t RESERVED3[1U]; + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED4[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + uint32_t RESERVED5[1U]; + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED6[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + uint32_t RESERVED7[1U]; + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ + uint32_t RESERVED8[1U]; + __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */ + uint32_t RESERVED9[1U]; + __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */ + uint32_t RESERVED10[1U]; + __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */ + uint32_t RESERVED11[1U]; + __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */ + uint32_t RESERVED12[1U]; + __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */ + uint32_t RESERVED13[1U]; + __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */ + uint32_t RESERVED14[1U]; + __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */ + uint32_t RESERVED15[1U]; + __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */ + uint32_t RESERVED16[1U]; + __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */ + uint32_t RESERVED17[1U]; + __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */ + uint32_t RESERVED18[1U]; + __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */ + uint32_t RESERVED19[1U]; + __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */ + uint32_t RESERVED20[1U]; + __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */ + uint32_t RESERVED21[1U]; + __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */ + uint32_t RESERVED22[1U]; + __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */ + uint32_t RESERVED23[1U]; + __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */ + uint32_t RESERVED24[1U]; + __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */ + uint32_t RESERVED25[1U]; + __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */ + uint32_t RESERVED26[1U]; + __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */ + uint32_t RESERVED27[1U]; + __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */ + uint32_t RESERVED28[1U]; + __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */ + uint32_t RESERVED29[1U]; + __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */ + uint32_t RESERVED30[1U]; + __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */ + uint32_t RESERVED31[1U]; + __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */ + uint32_t RESERVED32[934U]; + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */ + uint32_t RESERVED33[1U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) Device Architecture Register */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCDISS_Pos 23U /*!< DWT CTRL: CYCDISS Position */ +#define DWT_CTRL_CYCDISS_Msk (0x1UL << DWT_CTRL_CYCDISS_Pos) /*!< DWT CTRL: CYCDISS Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */ +#define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */ + +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */ +#define DWT_FUNCTION_ACTION_Msk (0x1UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */ + +#define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */ +#define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IOM uint32_t PSCR; /*!< Offset: 0x308 (R/W) Periodic Synchronization Control Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ + __IM uint32_t ITFTTD0; /*!< Offset: 0xEEC (R/ ) Integration Test FIFO Test Data 0 Register */ + __IOM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/W) Integration Test ATB Control Register 2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) Integration Test ATB Control Register 0 */ + __IM uint32_t ITFTTD1; /*!< Offset: 0xEFC (R/ ) Integration Test FIFO Test Data 1 Register */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) Device Configuration Register */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Identifier Register */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_FOnMan_Pos 6U /*!< TPI FFCR: FOnMan Position */ +#define TPI_FFCR_FOnMan_Msk (0x1UL << TPI_FFCR_FOnMan_Pos) /*!< TPI FFCR: FOnMan Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration Test FIFO Test Data 0 Register Definitions */ +#define TPI_ITFTTD0_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD0: ATB Interface 2 ATVALIDPosition */ +#define TPI_ITFTTD0_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 2 ATVALID Mask */ + +#define TPI_ITFTTD0_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD0: ATB Interface 2 byte count Position */ +#define TPI_ITFTTD0_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 2 byte count Mask */ + +#define TPI_ITFTTD0_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Position */ +#define TPI_ITFTTD0_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Mask */ + +#define TPI_ITFTTD0_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD0: ATB Interface 1 byte count Position */ +#define TPI_ITFTTD0_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 1 byte countt Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data2_Pos 16U /*!< TPI ITFTTD0: ATB Interface 1 data2 Position */ +#define TPI_ITFTTD0_ATB_IF1_data2_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data2 Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data1_Pos 8U /*!< TPI ITFTTD0: ATB Interface 1 data1 Position */ +#define TPI_ITFTTD0_ATB_IF1_data1_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data1 Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data0_Pos 0U /*!< TPI ITFTTD0: ATB Interface 1 data0 Position */ +#define TPI_ITFTTD0_ATB_IF1_data0_Msk (0xFFUL /*<< TPI_ITFTTD0_ATB_IF1_data0_Pos*/) /*!< TPI ITFTTD0: ATB Interface 1 data0 Mask */ + +/* TPI Integration Test ATB Control Register 2 Register Definitions */ +#define TPI_ITATBCTR2_AFVALID2S_Pos 1U /*!< TPI ITATBCTR2: AFVALID2S Position */ +#define TPI_ITATBCTR2_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID2S_Pos) /*!< TPI ITATBCTR2: AFVALID2SS Mask */ + +#define TPI_ITATBCTR2_AFVALID1S_Pos 1U /*!< TPI ITATBCTR2: AFVALID1S Position */ +#define TPI_ITATBCTR2_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID1S_Pos) /*!< TPI ITATBCTR2: AFVALID1SS Mask */ + +#define TPI_ITATBCTR2_ATREADY2S_Pos 0U /*!< TPI ITATBCTR2: ATREADY2S Position */ +#define TPI_ITATBCTR2_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2S_Pos*/) /*!< TPI ITATBCTR2: ATREADY2S Mask */ + +#define TPI_ITATBCTR2_ATREADY1S_Pos 0U /*!< TPI ITATBCTR2: ATREADY1S Position */ +#define TPI_ITATBCTR2_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1S_Pos*/) /*!< TPI ITATBCTR2: ATREADY1S Mask */ + +/* TPI Integration Test FIFO Test Data 1 Register Definitions */ +#define TPI_ITFTTD1_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Position */ +#define TPI_ITFTTD1_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Mask */ + +#define TPI_ITFTTD1_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD1: ATB Interface 2 byte count Position */ +#define TPI_ITFTTD1_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 2 byte count Mask */ + +#define TPI_ITFTTD1_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Position */ +#define TPI_ITFTTD1_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Mask */ + +#define TPI_ITFTTD1_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD1: ATB Interface 1 byte count Position */ +#define TPI_ITFTTD1_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 1 byte countt Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data2_Pos 16U /*!< TPI ITFTTD1: ATB Interface 2 data2 Position */ +#define TPI_ITFTTD1_ATB_IF2_data2_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data2 Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data1_Pos 8U /*!< TPI ITFTTD1: ATB Interface 2 data1 Position */ +#define TPI_ITFTTD1_ATB_IF2_data1_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data1 Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data0_Pos 0U /*!< TPI ITFTTD1: ATB Interface 2 data0 Position */ +#define TPI_ITFTTD1_ATB_IF2_data0_Msk (0xFFUL /*<< TPI_ITFTTD1_ATB_IF2_data0_Pos*/) /*!< TPI ITFTTD1: ATB Interface 2 data0 Mask */ + +/* TPI Integration Test ATB Control Register 0 Definitions */ +#define TPI_ITATBCTR0_AFVALID2S_Pos 1U /*!< TPI ITATBCTR0: AFVALID2S Position */ +#define TPI_ITATBCTR0_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID2S_Pos) /*!< TPI ITATBCTR0: AFVALID2SS Mask */ + +#define TPI_ITATBCTR0_AFVALID1S_Pos 1U /*!< TPI ITATBCTR0: AFVALID1S Position */ +#define TPI_ITATBCTR0_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID1S_Pos) /*!< TPI ITATBCTR0: AFVALID1SS Mask */ + +#define TPI_ITATBCTR0_ATREADY2S_Pos 0U /*!< TPI ITATBCTR0: ATREADY2S Position */ +#define TPI_ITATBCTR0_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2S_Pos*/) /*!< TPI ITATBCTR0: ATREADY2S Mask */ + +#define TPI_ITATBCTR0_ATREADY1S_Pos 0U /*!< TPI ITATBCTR0: ATREADY1S Position */ +#define TPI_ITATBCTR0_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1S_Pos*/) /*!< TPI ITATBCTR0: ATREADY1S Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_FIFOSZ_Pos 6U /*!< TPI DEVID: FIFOSZ Position */ +#define TPI_DEVID_FIFOSZ_Msk (0x7UL << TPI_DEVID_FIFOSZ_Pos) /*!< TPI DEVID: FIFOSZ Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x3FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Region Base Address Register Alias 1 */ + __IOM uint32_t RLAR_A1; /*!< Offset: 0x018 (R/W) MPU Region Limit Address Register Alias 1 */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Region Base Address Register Alias 2 */ + __IOM uint32_t RLAR_A2; /*!< Offset: 0x020 (R/W) MPU Region Limit Address Register Alias 2 */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Region Base Address Register Alias 3 */ + __IOM uint32_t RLAR_A3; /*!< Offset: 0x028 (R/W) MPU Region Limit Address Register Alias 3 */ + uint32_t RESERVED0[1]; + union { + __IOM uint32_t MAIR[2]; + struct { + __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */ + __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */ + }; + }; +} MPU_Type; + +#define MPU_TYPE_RALIASES 4U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_BASE_Pos 5U /*!< MPU RBAR: BASE Position */ +#define MPU_RBAR_BASE_Msk (0x7FFFFFFUL << MPU_RBAR_BASE_Pos) /*!< MPU RBAR: BASE Mask */ + +#define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */ +#define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */ + +#define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */ +#define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */ + +#define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */ +#define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */ + +/* MPU Region Limit Address Register Definitions */ +#define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */ +#define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */ + +#define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */ +#define MPU_RLAR_AttrIndx_Msk (0x7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */ + +#define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: Region enable bit Position */ +#define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: Region enable bit Disable Mask */ + +/* MPU Memory Attribute Indirection Register 0 Definitions */ +#define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */ +#define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */ + +#define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */ +#define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */ + +#define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */ +#define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */ + +#define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */ +#define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */ + +/* MPU Memory Attribute Indirection Register 1 Definitions */ +#define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */ +#define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */ + +#define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */ +#define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */ + +#define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */ +#define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */ + +#define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */ +#define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SAU Security Attribution Unit (SAU) + \brief Type definitions for the Security Attribution Unit (SAU) + @{ + */ + +/** + \brief Structure type to access the Security Attribution Unit (SAU). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */ + __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */ +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */ +#else + uint32_t RESERVED0[3]; +#endif + __IOM uint32_t SFSR; /*!< Offset: 0x014 (R/W) Secure Fault Status Register */ + __IOM uint32_t SFAR; /*!< Offset: 0x018 (R/W) Secure Fault Address Register */ +} SAU_Type; + +/* SAU Control Register Definitions */ +#define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */ +#define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */ + +#define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */ +#define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */ + +/* SAU Type Register Definitions */ +#define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */ +#define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */ + +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) +/* SAU Region Number Register Definitions */ +#define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */ +#define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */ + +/* SAU Region Base Address Register Definitions */ +#define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */ +#define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */ + +/* SAU Region Limit Address Register Definitions */ +#define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */ +#define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */ + +#define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */ +#define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */ + +#define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */ +#define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */ + +#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */ + +/* Secure Fault Status Register Definitions */ +#define SAU_SFSR_LSERR_Pos 7U /*!< SAU SFSR: LSERR Position */ +#define SAU_SFSR_LSERR_Msk (1UL << SAU_SFSR_LSERR_Pos) /*!< SAU SFSR: LSERR Mask */ + +#define SAU_SFSR_SFARVALID_Pos 6U /*!< SAU SFSR: SFARVALID Position */ +#define SAU_SFSR_SFARVALID_Msk (1UL << SAU_SFSR_SFARVALID_Pos) /*!< SAU SFSR: SFARVALID Mask */ + +#define SAU_SFSR_LSPERR_Pos 5U /*!< SAU SFSR: LSPERR Position */ +#define SAU_SFSR_LSPERR_Msk (1UL << SAU_SFSR_LSPERR_Pos) /*!< SAU SFSR: LSPERR Mask */ + +#define SAU_SFSR_INVTRAN_Pos 4U /*!< SAU SFSR: INVTRAN Position */ +#define SAU_SFSR_INVTRAN_Msk (1UL << SAU_SFSR_INVTRAN_Pos) /*!< SAU SFSR: INVTRAN Mask */ + +#define SAU_SFSR_AUVIOL_Pos 3U /*!< SAU SFSR: AUVIOL Position */ +#define SAU_SFSR_AUVIOL_Msk (1UL << SAU_SFSR_AUVIOL_Pos) /*!< SAU SFSR: AUVIOL Mask */ + +#define SAU_SFSR_INVER_Pos 2U /*!< SAU SFSR: INVER Position */ +#define SAU_SFSR_INVER_Msk (1UL << SAU_SFSR_INVER_Pos) /*!< SAU SFSR: INVER Mask */ + +#define SAU_SFSR_INVIS_Pos 1U /*!< SAU SFSR: INVIS Position */ +#define SAU_SFSR_INVIS_Msk (1UL << SAU_SFSR_INVIS_Pos) /*!< SAU SFSR: INVIS Mask */ + +#define SAU_SFSR_INVEP_Pos 0U /*!< SAU SFSR: INVEP Position */ +#define SAU_SFSR_INVEP_Msk (1UL /*<< SAU_SFSR_INVEP_Pos*/) /*!< SAU SFSR: INVEP Mask */ + +/*@} end of group CMSIS_SAU */ +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_FPU Floating Point Unit (FPU) + \brief Type definitions for the Floating Point Unit (FPU) + @{ + */ + +/** + \brief Structure type to access the Floating Point Unit (FPU). + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ + __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ + __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ + __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and VFP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and VFP Feature Register 1 */ + __IM uint32_t MVFR2; /*!< Offset: 0x018 (R/ ) Media and VFP Feature Register 2 */ +} FPU_Type; + +/* Floating-Point Context Control Register Definitions */ +#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */ +#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ + +#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */ +#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ + +#define FPU_FPCCR_LSPENS_Pos 29U /*!< FPCCR: LSPENS Position */ +#define FPU_FPCCR_LSPENS_Msk (1UL << FPU_FPCCR_LSPENS_Pos) /*!< FPCCR: LSPENS bit Mask */ + +#define FPU_FPCCR_CLRONRET_Pos 28U /*!< FPCCR: CLRONRET Position */ +#define FPU_FPCCR_CLRONRET_Msk (1UL << FPU_FPCCR_CLRONRET_Pos) /*!< FPCCR: CLRONRET bit Mask */ + +#define FPU_FPCCR_CLRONRETS_Pos 27U /*!< FPCCR: CLRONRETS Position */ +#define FPU_FPCCR_CLRONRETS_Msk (1UL << FPU_FPCCR_CLRONRETS_Pos) /*!< FPCCR: CLRONRETS bit Mask */ + +#define FPU_FPCCR_TS_Pos 26U /*!< FPCCR: TS Position */ +#define FPU_FPCCR_TS_Msk (1UL << FPU_FPCCR_TS_Pos) /*!< FPCCR: TS bit Mask */ + +#define FPU_FPCCR_UFRDY_Pos 10U /*!< FPCCR: UFRDY Position */ +#define FPU_FPCCR_UFRDY_Msk (1UL << FPU_FPCCR_UFRDY_Pos) /*!< FPCCR: UFRDY bit Mask */ + +#define FPU_FPCCR_SPLIMVIOL_Pos 9U /*!< FPCCR: SPLIMVIOL Position */ +#define FPU_FPCCR_SPLIMVIOL_Msk (1UL << FPU_FPCCR_SPLIMVIOL_Pos) /*!< FPCCR: SPLIMVIOL bit Mask */ + +#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */ +#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ + +#define FPU_FPCCR_SFRDY_Pos 7U /*!< FPCCR: SFRDY Position */ +#define FPU_FPCCR_SFRDY_Msk (1UL << FPU_FPCCR_SFRDY_Pos) /*!< FPCCR: SFRDY bit Mask */ + +#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */ +#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ + +#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */ +#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ + +#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */ +#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ + +#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */ +#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ + +#define FPU_FPCCR_S_Pos 2U /*!< FPCCR: Security status of the FP context bit Position */ +#define FPU_FPCCR_S_Msk (1UL << FPU_FPCCR_S_Pos) /*!< FPCCR: Security status of the FP context bit Mask */ + +#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */ +#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ + +#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */ +#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ + +/* Floating-Point Context Address Register Definitions */ +#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */ +#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ + +/* Floating-Point Default Status Control Register Definitions */ +#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */ +#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ + +#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */ +#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ + +#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */ +#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ + +#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */ +#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ + +/* Media and VFP Feature Register 0 Definitions */ +#define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */ +#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ + +#define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */ +#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ + +#define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */ +#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ + +#define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */ +#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ + +#define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */ +#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ + +#define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */ +#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ + +#define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */ +#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ + +#define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */ +#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ + +/* Media and VFP Feature Register 1 Definitions */ +#define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */ +#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ + +#define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */ +#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ + +#define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */ +#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ + +#define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */ +#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ + +/* Media and VFP Feature Register 2 Definitions */ +#define FPU_MVFR2_FPMisc_Pos 4U /*!< MVFR2: FPMisc bits Position */ +#define FPU_MVFR2_FPMisc_Msk (0xFUL << FPU_MVFR2_FPMisc_Pos) /*!< MVFR2: FPMisc bits Mask */ + +/*@} end of group CMSIS_FPU */ + + + + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DCB Debug Control Block + \brief Type definitions for the Debug Control Block Registers + @{ + */ + +/** + \brief Structure type to access the Debug Control Block Registers (DCB). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ + uint32_t RESERVED0[1U]; + __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ + __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ +} DCB_Type; + +/* DHCSR, Debug Halting Control and Status Register Definitions */ +#define DCB_DHCSR_DBGKEY_Pos 16U /*!< DCB DHCSR: Debug key Position */ +#define DCB_DHCSR_DBGKEY_Msk (0xFFFFUL << DCB_DHCSR_DBGKEY_Pos) /*!< DCB DHCSR: Debug key Mask */ + +#define DCB_DHCSR_S_RESTART_ST_Pos 26U /*!< DCB DHCSR: Restart sticky status Position */ +#define DCB_DHCSR_S_RESTART_ST_Msk (0x1UL << DCB_DHCSR_S_RESTART_ST_Pos) /*!< DCB DHCSR: Restart sticky status Mask */ + +#define DCB_DHCSR_S_RESET_ST_Pos 25U /*!< DCB DHCSR: Reset sticky status Position */ +#define DCB_DHCSR_S_RESET_ST_Msk (0x1UL << DCB_DHCSR_S_RESET_ST_Pos) /*!< DCB DHCSR: Reset sticky status Mask */ + +#define DCB_DHCSR_S_RETIRE_ST_Pos 24U /*!< DCB DHCSR: Retire sticky status Position */ +#define DCB_DHCSR_S_RETIRE_ST_Msk (0x1UL << DCB_DHCSR_S_RETIRE_ST_Pos) /*!< DCB DHCSR: Retire sticky status Mask */ + +#define DCB_DHCSR_S_SDE_Pos 20U /*!< DCB DHCSR: Secure debug enabled Position */ +#define DCB_DHCSR_S_SDE_Msk (0x1UL << DCB_DHCSR_S_SDE_Pos) /*!< DCB DHCSR: Secure debug enabled Mask */ + +#define DCB_DHCSR_S_LOCKUP_Pos 19U /*!< DCB DHCSR: Lockup status Position */ +#define DCB_DHCSR_S_LOCKUP_Msk (0x1UL << DCB_DHCSR_S_LOCKUP_Pos) /*!< DCB DHCSR: Lockup status Mask */ + +#define DCB_DHCSR_S_SLEEP_Pos 18U /*!< DCB DHCSR: Sleeping status Position */ +#define DCB_DHCSR_S_SLEEP_Msk (0x1UL << DCB_DHCSR_S_SLEEP_Pos) /*!< DCB DHCSR: Sleeping status Mask */ + +#define DCB_DHCSR_S_HALT_Pos 17U /*!< DCB DHCSR: Halted status Position */ +#define DCB_DHCSR_S_HALT_Msk (0x1UL << DCB_DHCSR_S_HALT_Pos) /*!< DCB DHCSR: Halted status Mask */ + +#define DCB_DHCSR_S_REGRDY_Pos 16U /*!< DCB DHCSR: Register ready status Position */ +#define DCB_DHCSR_S_REGRDY_Msk (0x1UL << DCB_DHCSR_S_REGRDY_Pos) /*!< DCB DHCSR: Register ready status Mask */ + +#define DCB_DHCSR_C_SNAPSTALL_Pos 5U /*!< DCB DHCSR: Snap stall control Position */ +#define DCB_DHCSR_C_SNAPSTALL_Msk (0x1UL << DCB_DHCSR_C_SNAPSTALL_Pos) /*!< DCB DHCSR: Snap stall control Mask */ + +#define DCB_DHCSR_C_MASKINTS_Pos 3U /*!< DCB DHCSR: Mask interrupts control Position */ +#define DCB_DHCSR_C_MASKINTS_Msk (0x1UL << DCB_DHCSR_C_MASKINTS_Pos) /*!< DCB DHCSR: Mask interrupts control Mask */ + +#define DCB_DHCSR_C_STEP_Pos 2U /*!< DCB DHCSR: Step control Position */ +#define DCB_DHCSR_C_STEP_Msk (0x1UL << DCB_DHCSR_C_STEP_Pos) /*!< DCB DHCSR: Step control Mask */ + +#define DCB_DHCSR_C_HALT_Pos 1U /*!< DCB DHCSR: Halt control Position */ +#define DCB_DHCSR_C_HALT_Msk (0x1UL << DCB_DHCSR_C_HALT_Pos) /*!< DCB DHCSR: Halt control Mask */ + +#define DCB_DHCSR_C_DEBUGEN_Pos 0U /*!< DCB DHCSR: Debug enable control Position */ +#define DCB_DHCSR_C_DEBUGEN_Msk (0x1UL /*<< DCB_DHCSR_C_DEBUGEN_Pos*/) /*!< DCB DHCSR: Debug enable control Mask */ + +/* DCRSR, Debug Core Register Select Register Definitions */ +#define DCB_DCRSR_REGWnR_Pos 16U /*!< DCB DCRSR: Register write/not-read Position */ +#define DCB_DCRSR_REGWnR_Msk (0x1UL << DCB_DCRSR_REGWnR_Pos) /*!< DCB DCRSR: Register write/not-read Mask */ + +#define DCB_DCRSR_REGSEL_Pos 0U /*!< DCB DCRSR: Register selector Position */ +#define DCB_DCRSR_REGSEL_Msk (0x7FUL /*<< DCB_DCRSR_REGSEL_Pos*/) /*!< DCB DCRSR: Register selector Mask */ + +/* DCRDR, Debug Core Register Data Register Definitions */ +#define DCB_DCRDR_DBGTMP_Pos 0U /*!< DCB DCRDR: Data temporary buffer Position */ +#define DCB_DCRDR_DBGTMP_Msk (0xFFFFFFFFUL /*<< DCB_DCRDR_DBGTMP_Pos*/) /*!< DCB DCRDR: Data temporary buffer Mask */ + +/* DEMCR, Debug Exception and Monitor Control Register Definitions */ +#define DCB_DEMCR_TRCENA_Pos 24U /*!< DCB DEMCR: Trace enable Position */ +#define DCB_DEMCR_TRCENA_Msk (0x1UL << DCB_DEMCR_TRCENA_Pos) /*!< DCB DEMCR: Trace enable Mask */ + +#define DCB_DEMCR_MONPRKEY_Pos 23U /*!< DCB DEMCR: Monitor pend req key Position */ +#define DCB_DEMCR_MONPRKEY_Msk (0x1UL << DCB_DEMCR_MONPRKEY_Pos) /*!< DCB DEMCR: Monitor pend req key Mask */ + +#define DCB_DEMCR_UMON_EN_Pos 21U /*!< DCB DEMCR: Unprivileged monitor enable Position */ +#define DCB_DEMCR_UMON_EN_Msk (0x1UL << DCB_DEMCR_UMON_EN_Pos) /*!< DCB DEMCR: Unprivileged monitor enable Mask */ + +#define DCB_DEMCR_SDME_Pos 20U /*!< DCB DEMCR: Secure DebugMonitor enable Position */ +#define DCB_DEMCR_SDME_Msk (0x1UL << DCB_DEMCR_SDME_Pos) /*!< DCB DEMCR: Secure DebugMonitor enable Mask */ + +#define DCB_DEMCR_MON_REQ_Pos 19U /*!< DCB DEMCR: Monitor request Position */ +#define DCB_DEMCR_MON_REQ_Msk (0x1UL << DCB_DEMCR_MON_REQ_Pos) /*!< DCB DEMCR: Monitor request Mask */ + +#define DCB_DEMCR_MON_STEP_Pos 18U /*!< DCB DEMCR: Monitor step Position */ +#define DCB_DEMCR_MON_STEP_Msk (0x1UL << DCB_DEMCR_MON_STEP_Pos) /*!< DCB DEMCR: Monitor step Mask */ + +#define DCB_DEMCR_MON_PEND_Pos 17U /*!< DCB DEMCR: Monitor pend Position */ +#define DCB_DEMCR_MON_PEND_Msk (0x1UL << DCB_DEMCR_MON_PEND_Pos) /*!< DCB DEMCR: Monitor pend Mask */ + +#define DCB_DEMCR_MON_EN_Pos 16U /*!< DCB DEMCR: Monitor enable Position */ +#define DCB_DEMCR_MON_EN_Msk (0x1UL << DCB_DEMCR_MON_EN_Pos) /*!< DCB DEMCR: Monitor enable Mask */ + +#define DCB_DEMCR_VC_SFERR_Pos 11U /*!< DCB DEMCR: Vector Catch SecureFault Position */ +#define DCB_DEMCR_VC_SFERR_Msk (0x1UL << DCB_DEMCR_VC_SFERR_Pos) /*!< DCB DEMCR: Vector Catch SecureFault Mask */ + +#define DCB_DEMCR_VC_HARDERR_Pos 10U /*!< DCB DEMCR: Vector Catch HardFault errors Position */ +#define DCB_DEMCR_VC_HARDERR_Msk (0x1UL << DCB_DEMCR_VC_HARDERR_Pos) /*!< DCB DEMCR: Vector Catch HardFault errors Mask */ + +#define DCB_DEMCR_VC_INTERR_Pos 9U /*!< DCB DEMCR: Vector Catch interrupt errors Position */ +#define DCB_DEMCR_VC_INTERR_Msk (0x1UL << DCB_DEMCR_VC_INTERR_Pos) /*!< DCB DEMCR: Vector Catch interrupt errors Mask */ + +#define DCB_DEMCR_VC_BUSERR_Pos 8U /*!< DCB DEMCR: Vector Catch BusFault errors Position */ +#define DCB_DEMCR_VC_BUSERR_Msk (0x1UL << DCB_DEMCR_VC_BUSERR_Pos) /*!< DCB DEMCR: Vector Catch BusFault errors Mask */ + +#define DCB_DEMCR_VC_STATERR_Pos 7U /*!< DCB DEMCR: Vector Catch state errors Position */ +#define DCB_DEMCR_VC_STATERR_Msk (0x1UL << DCB_DEMCR_VC_STATERR_Pos) /*!< DCB DEMCR: Vector Catch state errors Mask */ + +#define DCB_DEMCR_VC_CHKERR_Pos 6U /*!< DCB DEMCR: Vector Catch check errors Position */ +#define DCB_DEMCR_VC_CHKERR_Msk (0x1UL << DCB_DEMCR_VC_CHKERR_Pos) /*!< DCB DEMCR: Vector Catch check errors Mask */ + +#define DCB_DEMCR_VC_NOCPERR_Pos 5U /*!< DCB DEMCR: Vector Catch NOCP errors Position */ +#define DCB_DEMCR_VC_NOCPERR_Msk (0x1UL << DCB_DEMCR_VC_NOCPERR_Pos) /*!< DCB DEMCR: Vector Catch NOCP errors Mask */ + +#define DCB_DEMCR_VC_MMERR_Pos 4U /*!< DCB DEMCR: Vector Catch MemManage errors Position */ +#define DCB_DEMCR_VC_MMERR_Msk (0x1UL << DCB_DEMCR_VC_MMERR_Pos) /*!< DCB DEMCR: Vector Catch MemManage errors Mask */ + +#define DCB_DEMCR_VC_CORERESET_Pos 0U /*!< DCB DEMCR: Vector Catch Core reset Position */ +#define DCB_DEMCR_VC_CORERESET_Msk (0x1UL /*<< DCB_DEMCR_VC_CORERESET_Pos*/) /*!< DCB DEMCR: Vector Catch Core reset Mask */ + +/* DAUTHCTRL, Debug Authentication Control Register Definitions */ +#define DCB_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< DCB DAUTHCTRL: Internal Secure non-invasive debug enable Position */ +#define DCB_DAUTHCTRL_INTSPNIDEN_Msk (0x1UL << DCB_DAUTHCTRL_INTSPNIDEN_Pos) /*!< DCB DAUTHCTRL: Internal Secure non-invasive debug enable Mask */ + +#define DCB_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< DCB DAUTHCTRL: Secure non-invasive debug enable select Position */ +#define DCB_DAUTHCTRL_SPNIDENSEL_Msk (0x1UL << DCB_DAUTHCTRL_SPNIDENSEL_Pos) /*!< DCB DAUTHCTRL: Secure non-invasive debug enable select Mask */ + +#define DCB_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< DCB DAUTHCTRL: Internal Secure invasive debug enable Position */ +#define DCB_DAUTHCTRL_INTSPIDEN_Msk (0x1UL << DCB_DAUTHCTRL_INTSPIDEN_Pos) /*!< DCB DAUTHCTRL: Internal Secure invasive debug enable Mask */ + +#define DCB_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< DCB DAUTHCTRL: Secure invasive debug enable select Position */ +#define DCB_DAUTHCTRL_SPIDENSEL_Msk (0x1UL /*<< DCB_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< DCB DAUTHCTRL: Secure invasive debug enable select Mask */ + +/* DSCSR, Debug Security Control and Status Register Definitions */ +#define DCB_DSCSR_CDSKEY_Pos 17U /*!< DCB DSCSR: CDS write-enable key Position */ +#define DCB_DSCSR_CDSKEY_Msk (0x1UL << DCB_DSCSR_CDSKEY_Pos) /*!< DCB DSCSR: CDS write-enable key Mask */ + +#define DCB_DSCSR_CDS_Pos 16U /*!< DCB DSCSR: Current domain Secure Position */ +#define DCB_DSCSR_CDS_Msk (0x1UL << DCB_DSCSR_CDS_Pos) /*!< DCB DSCSR: Current domain Secure Mask */ + +#define DCB_DSCSR_SBRSEL_Pos 1U /*!< DCB DSCSR: Secure banked register select Position */ +#define DCB_DSCSR_SBRSEL_Msk (0x1UL << DCB_DSCSR_SBRSEL_Pos) /*!< DCB DSCSR: Secure banked register select Mask */ + +#define DCB_DSCSR_SBRSELEN_Pos 0U /*!< DCB DSCSR: Secure banked register select enable Position */ +#define DCB_DSCSR_SBRSELEN_Msk (0x1UL /*<< DCB_DSCSR_SBRSELEN_Pos*/) /*!< DCB DSCSR: Secure banked register select enable Mask */ + +/*@} end of group CMSIS_DCB */ + + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DIB Debug Identification Block + \brief Type definitions for the Debug Identification Block Registers + @{ + */ + +/** + \brief Structure type to access the Debug Identification Block Registers (DIB). + */ +typedef struct +{ + __OM uint32_t DLAR; /*!< Offset: 0x000 ( /W) SCS Software Lock Access Register */ + __IM uint32_t DLSR; /*!< Offset: 0x004 (R/ ) SCS Software Lock Status Register */ + __IM uint32_t DAUTHSTATUS; /*!< Offset: 0x008 (R/ ) Debug Authentication Status Register */ + __IM uint32_t DDEVARCH; /*!< Offset: 0x00C (R/ ) SCS Device Architecture Register */ + __IM uint32_t DDEVTYPE; /*!< Offset: 0x010 (R/ ) SCS Device Type Register */ +} DIB_Type; + +/* DLAR, SCS Software Lock Access Register Definitions */ +#define DIB_DLAR_KEY_Pos 0U /*!< DIB DLAR: KEY Position */ +#define DIB_DLAR_KEY_Msk (0xFFFFFFFFUL /*<< DIB_DLAR_KEY_Pos */) /*!< DIB DLAR: KEY Mask */ + +/* DLSR, SCS Software Lock Status Register Definitions */ +#define DIB_DLSR_nTT_Pos 2U /*!< DIB DLSR: Not thirty-two bit Position */ +#define DIB_DLSR_nTT_Msk (0x1UL << DIB_DLSR_nTT_Pos ) /*!< DIB DLSR: Not thirty-two bit Mask */ + +#define DIB_DLSR_SLK_Pos 1U /*!< DIB DLSR: Software Lock status Position */ +#define DIB_DLSR_SLK_Msk (0x1UL << DIB_DLSR_SLK_Pos ) /*!< DIB DLSR: Software Lock status Mask */ + +#define DIB_DLSR_SLI_Pos 0U /*!< DIB DLSR: Software Lock implemented Position */ +#define DIB_DLSR_SLI_Msk (0x1UL /*<< DIB_DLSR_SLI_Pos*/) /*!< DIB DLSR: Software Lock implemented Mask */ + +/* DAUTHSTATUS, Debug Authentication Status Register Definitions */ +#define DIB_DAUTHSTATUS_SNID_Pos 6U /*!< DIB DAUTHSTATUS: Secure Non-invasive Debug Position */ +#define DIB_DAUTHSTATUS_SNID_Msk (0x3UL << DIB_DAUTHSTATUS_SNID_Pos ) /*!< DIB DAUTHSTATUS: Secure Non-invasive Debug Mask */ + +#define DIB_DAUTHSTATUS_SID_Pos 4U /*!< DIB DAUTHSTATUS: Secure Invasive Debug Position */ +#define DIB_DAUTHSTATUS_SID_Msk (0x3UL << DIB_DAUTHSTATUS_SID_Pos ) /*!< DIB DAUTHSTATUS: Secure Invasive Debug Mask */ + +#define DIB_DAUTHSTATUS_NSNID_Pos 2U /*!< DIB DAUTHSTATUS: Non-secure Non-invasive Debug Position */ +#define DIB_DAUTHSTATUS_NSNID_Msk (0x3UL << DIB_DAUTHSTATUS_NSNID_Pos ) /*!< DIB DAUTHSTATUS: Non-secure Non-invasive Debug Mask */ + +#define DIB_DAUTHSTATUS_NSID_Pos 0U /*!< DIB DAUTHSTATUS: Non-secure Invasive Debug Position */ +#define DIB_DAUTHSTATUS_NSID_Msk (0x3UL /*<< DIB_DAUTHSTATUS_NSID_Pos*/) /*!< DIB DAUTHSTATUS: Non-secure Invasive Debug Mask */ + +/* DDEVARCH, SCS Device Architecture Register Definitions */ +#define DIB_DDEVARCH_ARCHITECT_Pos 21U /*!< DIB DDEVARCH: Architect Position */ +#define DIB_DDEVARCH_ARCHITECT_Msk (0x7FFUL << DIB_DDEVARCH_ARCHITECT_Pos ) /*!< DIB DDEVARCH: Architect Mask */ + +#define DIB_DDEVARCH_PRESENT_Pos 20U /*!< DIB DDEVARCH: DEVARCH Present Position */ +#define DIB_DDEVARCH_PRESENT_Msk (0x1FUL << DIB_DDEVARCH_PRESENT_Pos ) /*!< DIB DDEVARCH: DEVARCH Present Mask */ + +#define DIB_DDEVARCH_REVISION_Pos 16U /*!< DIB DDEVARCH: Revision Position */ +#define DIB_DDEVARCH_REVISION_Msk (0xFUL << DIB_DDEVARCH_REVISION_Pos ) /*!< DIB DDEVARCH: Revision Mask */ + +#define DIB_DDEVARCH_ARCHVER_Pos 12U /*!< DIB DDEVARCH: Architecture Version Position */ +#define DIB_DDEVARCH_ARCHVER_Msk (0xFUL << DIB_DDEVARCH_ARCHVER_Pos ) /*!< DIB DDEVARCH: Architecture Version Mask */ + +#define DIB_DDEVARCH_ARCHPART_Pos 0U /*!< DIB DDEVARCH: Architecture Part Position */ +#define DIB_DDEVARCH_ARCHPART_Msk (0xFFFUL /*<< DIB_DDEVARCH_ARCHPART_Pos*/) /*!< DIB DDEVARCH: Architecture Part Mask */ + +/* DDEVTYPE, SCS Device Type Register Definitions */ +#define DIB_DDEVTYPE_SUB_Pos 4U /*!< DIB DDEVTYPE: Sub-type Position */ +#define DIB_DDEVTYPE_SUB_Msk (0xFUL << DIB_DDEVTYPE_SUB_Pos ) /*!< DIB DDEVTYPE: Sub-type Mask */ + +#define DIB_DDEVTYPE_MAJOR_Pos 0U /*!< DIB DDEVTYPE: Major type Position */ +#define DIB_DDEVTYPE_MAJOR_Msk (0xFUL /*<< DIB_DDEVTYPE_MAJOR_Pos*/) /*!< DIB DDEVTYPE: Major type Mask */ + + +/*@} end of group CMSIS_DIB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ + #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ + #define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ + #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ + #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ + #define DCB_BASE (0xE000EDF0UL) /*!< DCB Base Address */ + #define DIB_BASE (0xE000EFB0UL) /*!< DIB Base Address */ + #define EMSS_BASE (0xE001E000UL) /*!AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + __COMPILER_BARRIER(); + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __COMPILER_BARRIER(); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Get Interrupt Target State + \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + \return 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Target State + \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Clear Interrupt Target State + \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; + __DSB(); +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses including + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/** + \brief Software Reset + \details Initiates a system reset request to reset the CPU. + */ +__NO_RETURN __STATIC_INLINE void __SW_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses including + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_BFHFNMINS_Msk) | /* Keep BFHFNMINS unchanged. Use this Reset function in case your case need to keep it */ + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | /* Keep priority group unchanged */ + SCB_AIRCR_SYSRESETREQ_Msk ); + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Set Priority Grouping (non-secure) + \details Sets the non-secure priority grouping field when in secure state using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB_NS->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB_NS->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping (non-secure) + \details Reads the priority grouping field from the non-secure NVIC when in secure state. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriorityGrouping_NS(void) +{ + return ((uint32_t)((SCB_NS->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt (non-secure) + \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status (non-secure) + \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt (non-secure) + \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Pending Interrupt (non-secure) + \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt (non-secure) + \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt (non-secure) + \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt (non-secure) + \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority (non-secure) + \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every non-secure processor exception. + */ +__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority (non-secure) + \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC_NS->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv8.h" + +#endif + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + uint32_t mvfr0; + + mvfr0 = FPU->MVFR0; + if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U) + { + return 2U; /* Double + Single precision FPU */ + } + else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U) + { + return 1U; /* Single precision FPU */ + } + else + { + return 0U; /* No FPU */ + } +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ########################## SAU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SAUFunctions SAU Functions + \brief Functions that configure the SAU. + @{ + */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + +/** + \brief Enable SAU + \details Enables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Enable(void) +{ + SAU->CTRL |= (SAU_CTRL_ENABLE_Msk); +} + + + +/** + \brief Disable SAU + \details Disables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Disable(void) +{ + SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk); +} + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_SAUFunctions */ + + + +/* ################################## Debug Control function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_DCBFunctions Debug Control Functions + \brief Functions that access the Debug Control Block. + @{ + */ + + +/** + \brief Set Debug Authentication Control Register + \details writes to Debug Authentication Control register. + \param [in] value value to be writen. + */ +__STATIC_INLINE void DCB_SetAuthCtrl(uint32_t value) +{ + __DSB(); + __ISB(); + DCB->DAUTHCTRL = value; + __DSB(); + __ISB(); +} + + +/** + \brief Get Debug Authentication Control Register + \details Reads Debug Authentication Control register. + \return Debug Authentication Control Register. + */ +__STATIC_INLINE uint32_t DCB_GetAuthCtrl(void) +{ + return (DCB->DAUTHCTRL); +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Set Debug Authentication Control Register (non-secure) + \details writes to non-secure Debug Authentication Control register when in secure state. + \param [in] value value to be writen + */ +__STATIC_INLINE void TZ_DCB_SetAuthCtrl_NS(uint32_t value) +{ + __DSB(); + __ISB(); + DCB_NS->DAUTHCTRL = value; + __DSB(); + __ISB(); +} + + +/** + \brief Get Debug Authentication Control Register (non-secure) + \details Reads non-secure Debug Authentication Control register when in secure state. + \return Debug Authentication Control Register. + */ +__STATIC_INLINE uint32_t TZ_DCB_GetAuthCtrl_NS(void) +{ + return (DCB_NS->DAUTHCTRL); +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_DCBFunctions */ + + + + +/* ################################## Debug Identification function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_DIBFunctions Debug Identification Functions + \brief Functions that access the Debug Identification Block. + @{ + */ + + +/** + \brief Get Debug Authentication Status Register + \details Reads Debug Authentication Status register. + \return Debug Authentication Status Register. + */ +__STATIC_INLINE uint32_t DIB_GetAuthStatus(void) +{ + return (DIB->DAUTHSTATUS); +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Get Debug Authentication Status Register (non-secure) + \details Reads non-secure Debug Authentication Status register when in secure state. + \return Debug Authentication Status Register. + */ +__STATIC_INLINE uint32_t TZ_DIB_GetAuthStatus_NS(void) +{ + return (DIB_NS->DAUTHSTATUS); +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_DCBFunctions */ + + +#if ((defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U)) || \ + (defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U))) + +/* ########################## Cache functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_CacheFunctions Cache Functions + \brief Functions that configure Instruction and Data cache. + @{ + */ + +/* Cache Size ID Register Macros */ +#define CCSIDR_WAYS(x) (((x) & SCB_CCSIDR_ASSOCIATIVITY_Msk) >> SCB_CCSIDR_ASSOCIATIVITY_Pos) +#define CCSIDR_SETS(x) (((x) & SCB_CCSIDR_NUMSETS_Msk ) >> SCB_CCSIDR_NUMSETS_Pos ) + +#define __SCB_DCACHE_LINE_SIZE 32U /*!< STAR-MC1 cache line size is fixed to 32 bytes (8 words). See also register SCB_CCSIDR */ +#define __SCB_ICACHE_LINE_SIZE 32U /*!< STAR-MC1 cache line size is fixed to 32 bytes (8 words). See also register SCB_CCSIDR */ + +/** + \brief Enable I-Cache + \details Turns on I-Cache + */ +__STATIC_FORCEINLINE void SCB_EnableICache (void) +{ + #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) + if (SCB->CCR & SCB_CCR_IC_Msk) return; /* return if ICache is already enabled */ + + __DSB(); + __ISB(); + SCB->ICIALLU = 0UL; /* invalidate I-Cache */ + __DSB(); + __ISB(); + SCB->CCR |= (uint32_t)SCB_CCR_IC_Msk; /* enable I-Cache */ + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Disable I-Cache + \details Turns off I-Cache + */ +__STATIC_FORCEINLINE void SCB_DisableICache (void) +{ + #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) + __DSB(); + __ISB(); + SCB->CCR &= ~(uint32_t)SCB_CCR_IC_Msk; /* disable I-Cache */ + SCB->ICIALLU = 0UL; /* invalidate I-Cache */ + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Invalidate I-Cache + \details Invalidates I-Cache + */ +__STATIC_FORCEINLINE void SCB_InvalidateICache (void) +{ + #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) + __DSB(); + __ISB(); + SCB->ICIALLU = 0UL; + __DSB(); + __ISB(); + #endif +} + + +/** + \brief I-Cache Invalidate by address + \details Invalidates I-Cache for the given address. + I-Cache is invalidated starting from a 32 byte aligned address in 32 byte granularity. + I-Cache memory blocks which are part of given address + given size are invalidated. + \param[in] addr address + \param[in] isize size of memory block (in number of bytes) +*/ +__STATIC_FORCEINLINE void SCB_InvalidateICache_by_Addr (void *addr, int32_t isize) +{ + #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) + if ( isize > 0 ) { + int32_t op_size = isize + (((uint32_t)addr) & (__SCB_ICACHE_LINE_SIZE - 1U)); + uint32_t op_addr = (uint32_t)addr /* & ~(__SCB_ICACHE_LINE_SIZE - 1U) */; + + __DSB(); + + do { + SCB->ICIMVAU = op_addr; /* register accepts only 32byte aligned values, only bits 31..5 are valid */ + op_addr += __SCB_ICACHE_LINE_SIZE; + op_size -= __SCB_ICACHE_LINE_SIZE; + } while ( op_size > 0 ); + + __DSB(); + __ISB(); + } + #endif +} + + +/** + \brief Enable D-Cache + \details Turns on D-Cache + */ +__STATIC_FORCEINLINE void SCB_EnableDCache (void) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + uint32_t ccsidr; + uint32_t sets; + uint32_t ways; + + if (SCB->CCR & SCB_CCR_DC_Msk) return; /* return if DCache is already enabled */ + + SCB->CSSELR = 0U; /* select Level 1 data cache */ + __DSB(); + + ccsidr = SCB->CCSIDR; + + /* invalidate D-Cache */ + sets = (uint32_t)(CCSIDR_SETS(ccsidr)); + do { + ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); + do { + SCB->DCISW = (((sets << SCB_DCISW_SET_Pos) & SCB_DCISW_SET_Msk) | + ((ways << SCB_DCISW_WAY_Pos) & SCB_DCISW_WAY_Msk) ); + #if defined ( __CC_ARM ) + __schedule_barrier(); + #endif + } while (ways-- != 0U); + } while(sets-- != 0U); + __DSB(); + + SCB->CCR |= (uint32_t)SCB_CCR_DC_Msk; /* enable D-Cache */ + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Disable D-Cache + \details Turns off D-Cache + */ +__STATIC_FORCEINLINE void SCB_DisableDCache (void) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + uint32_t ccsidr; + uint32_t sets; + uint32_t ways; + + SCB->CSSELR = 0U; /* select Level 1 data cache */ + __DSB(); + + SCB->CCR &= ~(uint32_t)SCB_CCR_DC_Msk; /* disable D-Cache */ + __DSB(); + + ccsidr = SCB->CCSIDR; + + /* clean & invalidate D-Cache */ + sets = (uint32_t)(CCSIDR_SETS(ccsidr)); + do { + ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); + do { + SCB->DCCISW = (((sets << SCB_DCCISW_SET_Pos) & SCB_DCCISW_SET_Msk) | + ((ways << SCB_DCCISW_WAY_Pos) & SCB_DCCISW_WAY_Msk) ); + #if defined ( __CC_ARM ) + __schedule_barrier(); + #endif + } while (ways-- != 0U); + } while(sets-- != 0U); + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Invalidate D-Cache + \details Invalidates D-Cache + */ +__STATIC_FORCEINLINE void SCB_InvalidateDCache (void) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + uint32_t ccsidr; + uint32_t sets; + uint32_t ways; + + SCB->CSSELR = 0U; /* select Level 1 data cache */ + __DSB(); + + ccsidr = SCB->CCSIDR; + + /* invalidate D-Cache */ + sets = (uint32_t)(CCSIDR_SETS(ccsidr)); + do { + ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); + do { + SCB->DCISW = (((sets << SCB_DCISW_SET_Pos) & SCB_DCISW_SET_Msk) | + ((ways << SCB_DCISW_WAY_Pos) & SCB_DCISW_WAY_Msk) ); + #if defined ( __CC_ARM ) + __schedule_barrier(); + #endif + } while (ways-- != 0U); + } while(sets-- != 0U); + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Clean D-Cache + \details Cleans D-Cache + */ +__STATIC_FORCEINLINE void SCB_CleanDCache (void) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + uint32_t ccsidr; + uint32_t sets; + uint32_t ways; + + SCB->CSSELR = 0U; /* select Level 1 data cache */ + __DSB(); + + ccsidr = SCB->CCSIDR; + + /* clean D-Cache */ + sets = (uint32_t)(CCSIDR_SETS(ccsidr)); + do { + ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); + do { + SCB->DCCSW = (((sets << SCB_DCCSW_SET_Pos) & SCB_DCCSW_SET_Msk) | + ((ways << SCB_DCCSW_WAY_Pos) & SCB_DCCSW_WAY_Msk) ); + #if defined ( __CC_ARM ) + __schedule_barrier(); + #endif + } while (ways-- != 0U); + } while(sets-- != 0U); + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Clean & Invalidate D-Cache + \details Cleans and Invalidates D-Cache + */ +__STATIC_FORCEINLINE void SCB_CleanInvalidateDCache (void) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + uint32_t ccsidr; + uint32_t sets; + uint32_t ways; + + SCB->CSSELR = 0U; /* select Level 1 data cache */ + __DSB(); + + ccsidr = SCB->CCSIDR; + + /* clean & invalidate D-Cache */ + sets = (uint32_t)(CCSIDR_SETS(ccsidr)); + do { + ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); + do { + SCB->DCCISW = (((sets << SCB_DCCISW_SET_Pos) & SCB_DCCISW_SET_Msk) | + ((ways << SCB_DCCISW_WAY_Pos) & SCB_DCCISW_WAY_Msk) ); + #if defined ( __CC_ARM ) + __schedule_barrier(); + #endif + } while (ways-- != 0U); + } while(sets-- != 0U); + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief D-Cache Invalidate by address + \details Invalidates D-Cache for the given address. + D-Cache is invalidated starting from a 32 byte aligned address in 32 byte granularity. + D-Cache memory blocks which are part of given address + given size are invalidated. + \param[in] addr address + \param[in] dsize size of memory block (in number of bytes) +*/ +__STATIC_FORCEINLINE void SCB_InvalidateDCache_by_Addr (void *addr, int32_t dsize) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + if ( dsize > 0 ) { + int32_t op_size = dsize + (((uint32_t)addr) & (__SCB_DCACHE_LINE_SIZE - 1U)); + uint32_t op_addr = (uint32_t)addr /* & ~(__SCB_DCACHE_LINE_SIZE - 1U) */; + + __DSB(); + + do { + SCB->DCIMVAC = op_addr; /* register accepts only 32byte aligned values, only bits 31..5 are valid */ + op_addr += __SCB_DCACHE_LINE_SIZE; + op_size -= __SCB_DCACHE_LINE_SIZE; + } while ( op_size > 0 ); + + __DSB(); + __ISB(); + } + #endif +} + + +/** + \brief D-Cache Clean by address + \details Cleans D-Cache for the given address + D-Cache is cleaned starting from a 32 byte aligned address in 32 byte granularity. + D-Cache memory blocks which are part of given address + given size are cleaned. + \param[in] addr address + \param[in] dsize size of memory block (in number of bytes) +*/ +__STATIC_FORCEINLINE void SCB_CleanDCache_by_Addr (uint32_t *addr, int32_t dsize) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + if ( dsize > 0 ) { + int32_t op_size = dsize + (((uint32_t)addr) & (__SCB_DCACHE_LINE_SIZE - 1U)); + uint32_t op_addr = (uint32_t)addr /* & ~(__SCB_DCACHE_LINE_SIZE - 1U) */; + + __DSB(); + + do { + SCB->DCCMVAC = op_addr; /* register accepts only 32byte aligned values, only bits 31..5 are valid */ + op_addr += __SCB_DCACHE_LINE_SIZE; + op_size -= __SCB_DCACHE_LINE_SIZE; + } while ( op_size > 0 ); + + __DSB(); + __ISB(); + } + #endif +} + + +/** + \brief D-Cache Clean and Invalidate by address + \details Cleans and invalidates D_Cache for the given address + D-Cache is cleaned and invalidated starting from a 32 byte aligned address in 32 byte granularity. + D-Cache memory blocks which are part of given address + given size are cleaned and invalidated. + \param[in] addr address (aligned to 32-byte boundary) + \param[in] dsize size of memory block (in number of bytes) +*/ +__STATIC_FORCEINLINE void SCB_CleanInvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + if ( dsize > 0 ) { + int32_t op_size = dsize + (((uint32_t)addr) & (__SCB_DCACHE_LINE_SIZE - 1U)); + uint32_t op_addr = (uint32_t)addr /* & ~(__SCB_DCACHE_LINE_SIZE - 1U) */; + + __DSB(); + + do { + SCB->DCCIMVAC = op_addr; /* register accepts only 32byte aligned values, only bits 31..5 are valid */ + op_addr += __SCB_DCACHE_LINE_SIZE; + op_size -= __SCB_DCACHE_LINE_SIZE; + } while ( op_size > 0 ); + + __DSB(); + __ISB(); + } + #endif +} + +/*@} end of CMSIS_Core_CacheFunctions */ +#endif + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief System Tick Configuration (non-secure) + \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function TZ_SysTick_Config_NS is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + + */ +__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_STAR_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/edge-impulse-sdk/CMSIS/Core/Include/mpu_armv8.h b/edge-impulse-sdk/CMSIS/Core/Include/mpu_armv8.h index d4c6f7b..cb04a57 100644 --- a/edge-impulse-sdk/CMSIS/Core/Include/mpu_armv8.h +++ b/edge-impulse-sdk/CMSIS/Core/Include/mpu_armv8.h @@ -1,11 +1,11 @@ /****************************************************************************** * @file mpu_armv8.h * @brief CMSIS MPU API for Armv8-M and Armv8.1-M MPU - * @version V5.1.2 - * @date 10. February 2020 + * @version V5.1.4 + * @date 30. May 2022 ******************************************************************************/ /* - * Copyright (c) 2017-2020 Arm Limited. All rights reserved. + * Copyright (c) 2017-2022 Arm Limited. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -84,7 +84,7 @@ * \param SH Defines the Shareability domain for this memory region. * \param RO Read-Only: Set to 1 for a read-only memory region. * \param NP Non-Privileged: Set to 1 for a non-privileged memory region. -* \oaram XN eXecute Never: Set to 1 for a non-executable memory region. +* \param XN eXecute Never: Set to 1 for a non-executable memory region. */ #define ARM_MPU_RBAR(BASE, SH, RO, NP, XN) \ (((BASE) & MPU_RBAR_BASE_Msk) | \ diff --git a/edge-impulse-sdk/CMSIS/Core/Include/pac_armv81.h b/edge-impulse-sdk/CMSIS/Core/Include/pac_armv81.h new file mode 100644 index 0000000..854b60a --- /dev/null +++ b/edge-impulse-sdk/CMSIS/Core/Include/pac_armv81.h @@ -0,0 +1,206 @@ +/****************************************************************************** + * @file pac_armv81.h + * @brief CMSIS PAC key functions for Armv8.1-M PAC extension + * @version V1.0.0 + * @date 23. March 2022 + ******************************************************************************/ +/* + * Copyright (c) 2022 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef PAC_ARMV81_H +#define PAC_ARMV81_H + + +/* ################### PAC Key functions ########################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_PacKeyFunctions PAC Key functions + \brief Functions that access the PAC keys. + @{ + */ + +#if (defined (__ARM_FEATURE_PAUTH) && (__ARM_FEATURE_PAUTH == 1)) + +/** + \brief read the PAC key used for privileged mode + \details Reads the PAC key stored in the PAC_KEY_P registers. + \param [out] pPacKey 128bit PAC key + */ +__STATIC_FORCEINLINE void __get_PAC_KEY_P (uint32_t* pPacKey) { + __ASM volatile ( + "mrs r1, pac_key_p_0\n" + "str r1,[%0,#0]\n" + "mrs r1, pac_key_p_1\n" + "str r1,[%0,#4]\n" + "mrs r1, pac_key_p_2\n" + "str r1,[%0,#8]\n" + "mrs r1, pac_key_p_3\n" + "str r1,[%0,#12]\n" + : : "r" (pPacKey) : "memory", "r1" + ); +} + +/** + \brief write the PAC key used for privileged mode + \details writes the given PAC key to the PAC_KEY_P registers. + \param [in] pPacKey 128bit PAC key + */ +__STATIC_FORCEINLINE void __set_PAC_KEY_P (uint32_t* pPacKey) { + __ASM volatile ( + "ldr r1,[%0,#0]\n" + "msr pac_key_p_0, r1\n" + "ldr r1,[%0,#4]\n" + "msr pac_key_p_1, r1\n" + "ldr r1,[%0,#8]\n" + "msr pac_key_p_2, r1\n" + "ldr r1,[%0,#12]\n" + "msr pac_key_p_3, r1\n" + : : "r" (pPacKey) : "memory", "r1" + ); +} + +/** + \brief read the PAC key used for unprivileged mode + \details Reads the PAC key stored in the PAC_KEY_U registers. + \param [out] pPacKey 128bit PAC key + */ +__STATIC_FORCEINLINE void __get_PAC_KEY_U (uint32_t* pPacKey) { + __ASM volatile ( + "mrs r1, pac_key_u_0\n" + "str r1,[%0,#0]\n" + "mrs r1, pac_key_u_1\n" + "str r1,[%0,#4]\n" + "mrs r1, pac_key_u_2\n" + "str r1,[%0,#8]\n" + "mrs r1, pac_key_u_3\n" + "str r1,[%0,#12]\n" + : : "r" (pPacKey) : "memory", "r1" + ); +} + +/** + \brief write the PAC key used for unprivileged mode + \details writes the given PAC key to the PAC_KEY_U registers. + \param [in] pPacKey 128bit PAC key + */ +__STATIC_FORCEINLINE void __set_PAC_KEY_U (uint32_t* pPacKey) { + __ASM volatile ( + "ldr r1,[%0,#0]\n" + "msr pac_key_u_0, r1\n" + "ldr r1,[%0,#4]\n" + "msr pac_key_u_1, r1\n" + "ldr r1,[%0,#8]\n" + "msr pac_key_u_2, r1\n" + "ldr r1,[%0,#12]\n" + "msr pac_key_u_3, r1\n" + : : "r" (pPacKey) : "memory", "r1" + ); +} + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) + +/** + \brief read the PAC key used for privileged mode (non-secure) + \details Reads the PAC key stored in the non-secure PAC_KEY_P registers when in secure mode. + \param [out] pPacKey 128bit PAC key + */ +__STATIC_FORCEINLINE void __TZ_get_PAC_KEY_P_NS (uint32_t* pPacKey) { + __ASM volatile ( + "mrs r1, pac_key_p_0_ns\n" + "str r1,[%0,#0]\n" + "mrs r1, pac_key_p_1_ns\n" + "str r1,[%0,#4]\n" + "mrs r1, pac_key_p_2_ns\n" + "str r1,[%0,#8]\n" + "mrs r1, pac_key_p_3_ns\n" + "str r1,[%0,#12]\n" + : : "r" (pPacKey) : "memory", "r1" + ); +} + +/** + \brief write the PAC key used for privileged mode (non-secure) + \details writes the given PAC key to the non-secure PAC_KEY_P registers when in secure mode. + \param [in] pPacKey 128bit PAC key + */ +__STATIC_FORCEINLINE void __TZ_set_PAC_KEY_P_NS (uint32_t* pPacKey) { + __ASM volatile ( + "ldr r1,[%0,#0]\n" + "msr pac_key_p_0_ns, r1\n" + "ldr r1,[%0,#4]\n" + "msr pac_key_p_1_ns, r1\n" + "ldr r1,[%0,#8]\n" + "msr pac_key_p_2_ns, r1\n" + "ldr r1,[%0,#12]\n" + "msr pac_key_p_3_ns, r1\n" + : : "r" (pPacKey) : "memory", "r1" + ); +} + +/** + \brief read the PAC key used for unprivileged mode (non-secure) + \details Reads the PAC key stored in the non-secure PAC_KEY_U registers when in secure mode. + \param [out] pPacKey 128bit PAC key + */ +__STATIC_FORCEINLINE void __TZ_get_PAC_KEY_U_NS (uint32_t* pPacKey) { + __ASM volatile ( + "mrs r1, pac_key_u_0_ns\n" + "str r1,[%0,#0]\n" + "mrs r1, pac_key_u_1_ns\n" + "str r1,[%0,#4]\n" + "mrs r1, pac_key_u_2_ns\n" + "str r1,[%0,#8]\n" + "mrs r1, pac_key_u_3_ns\n" + "str r1,[%0,#12]\n" + : : "r" (pPacKey) : "memory", "r1" + ); +} + +/** + \brief write the PAC key used for unprivileged mode (non-secure) + \details writes the given PAC key to the non-secure PAC_KEY_U registers when in secure mode. + \param [in] pPacKey 128bit PAC key + */ +__STATIC_FORCEINLINE void __TZ_set_PAC_KEY_U_NS (uint32_t* pPacKey) { + __ASM volatile ( + "ldr r1,[%0,#0]\n" + "msr pac_key_u_0_ns, r1\n" + "ldr r1,[%0,#4]\n" + "msr pac_key_u_1_ns, r1\n" + "ldr r1,[%0,#8]\n" + "msr pac_key_u_2_ns, r1\n" + "ldr r1,[%0,#12]\n" + "msr pac_key_u_3_ns, r1\n" + : : "r" (pPacKey) : "memory", "r1" + ); +} + +#endif /* (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) */ + +#endif /* (defined (__ARM_FEATURE_PAUTH) && (__ARM_FEATURE_PAUTH == 1)) */ + +/*@} end of CMSIS_Core_PacKeyFunctions */ + + +#endif /* PAC_ARMV81_H */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables.h b/edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables.h index 4f7a5c7..55b789e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables.h @@ -3,13 +3,13 @@ * Title: arm_common_tables.h * Description: Extern declaration for common tables * - * $Date: 27. January 2017 - * $Revision: V.1.5.1 + * @version V1.10.0 + * @date 08 July 2021 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -498,10 +498,20 @@ extern "C" extern const q15_t sinTable_q15[FAST_MATH_TABLE_SIZE + 1]; #endif /* !defined(ARM_DSP_CONFIG_TABLES) defined(ARM_ALL_FAST_TABLES) */ + /* Fast vector sqrt */ #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_FAST_SQRT_Q31_MVE) extern const q31_t sqrtTable_Q31[256]; #endif /* !defined(ARM_DSP_CONFIG_TABLES) defined(ARM_ALL_FAST_TABLES) */ + #endif + + /* Accurate scalar sqrt */ + #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SQRT_Q31) + extern const q31_t sqrt_initial_lut_q31[32]; + #endif + + #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SQRT_Q15) + extern const q15_t sqrt_initial_lut_q15[16]; #endif #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables_f16.h index a5b9454..9c48086 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables_f16.h @@ -3,13 +3,13 @@ * Title: arm_common_tables_f16.h * Description: Extern declaration for common tables * - * $Date: 27. January 2017 - * $Revision: V.1.5.1 + * @version V1.10.0 + * @date 08 July 2021 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/arm_const_structs.h b/edge-impulse-sdk/CMSIS/DSP/Include/arm_const_structs.h index 2a0659f..2efc0a1 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Include/arm_const_structs.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/arm_const_structs.h @@ -4,13 +4,13 @@ * Description: Constant structs that are initialized for user convenience. * For example, some can be given as arguments to the arm_cfft_f32() function. * - * $Date: 27. January 2017 - * $Revision: V.1.5.1 + * @version V1.10.0 + * @date 08 July 2021 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/arm_const_structs_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/arm_const_structs_f16.h index 13f7b59..843f50e 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/arm_const_structs_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/arm_const_structs_f16.h @@ -4,13 +4,13 @@ * Description: Constant structs that are initialized for user convenience. * For example, some can be given as arguments to the arm_cfft_f16() function. * - * $Date: 20. April 2020 - * $Revision: V.1.5.1 + * @version V1.10.0 + * @date 08 July 2021 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -74,4 +74,4 @@ extern "C" } #endif -#endif \ No newline at end of file +#endif diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h b/edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h index 1479611..8706197 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h @@ -3,13 +3,13 @@ * Title: arm_helium_utils.h * Description: Utility functions for Helium development * - * $Date: 09. September 2019 - * $Revision: V.1.5.1 + * @version V1.10.0 + * @date 08 July 2021 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -335,7 +335,7 @@ __STATIC_INLINE arm_status arm_mat_cmplx_trans_32bit( /* * Set status as ARM_MATH_SIZE_MISMATCH */ - return = ARM_MATH_SIZE_MISMATCH; + return ARM_MATH_SIZE_MISMATCH; } #else (void)dstRows; @@ -535,7 +535,7 @@ __STATIC_INLINE arm_status arm_mat_cmplx_trans_16bit( /* * Set status as ARM_MATH_SIZE_MISMATCH */ - return = ARM_MATH_SIZE_MISMATCH; + return ARM_MATH_SIZE_MISMATCH; } #else (void)dstRows; @@ -620,7 +620,7 @@ __STATIC_INLINE q31x4_t FAST_VSQRT_Q31(q31x4_t vecIn) vecSignBits = vclsq(vecIn); - vecSignBits = vbicq(vecSignBits, 1); + vecSignBits = vbicq_n_s32(vecSignBits, 1); /* * in = in << no_of_sign_bits; */ @@ -687,7 +687,7 @@ __STATIC_INLINE q15x8_t FAST_VSQRT_Q15(q15x8_t vecIn) vecDst = vuninitializedq_s16(); vecSignBits = vclsq(vecIn); - vecSignBits = vbicq(vecSignBits, 1); + vecSignBits = vbicq_n_s16(vecSignBits, 1); /* * in = in << no_of_sign_bits; */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/arm_math.h b/edge-impulse-sdk/CMSIS/DSP/Include/arm_math.h index d1e68e5..989ba29 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Include/arm_math.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/arm_math.h @@ -1,11 +1,12 @@ /****************************************************************************** * @file arm_math.h * @brief Public header file for CMSIS DSP Library - * @version V1.7.0 - * @date 18. March 2019 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* - * Copyright (c) 2010-2019 Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2010-2021 Arm Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -32,20 +33,20 @@ * based devices. * * The library is divided into a number of functions each covering a specific category: - * - Basic math functions - * - Fast math functions - * - Complex math functions - * - Filtering functions - * - Matrix functions - * - Transform functions - * - Motor control functions - * - Statistical functions - * - Support functions - * - Interpolation functions - * - Support Vector Machine functions (SVM) - * - Bayes classifier functions - * - Distance functions - * - Quaternion functions + * - \ref groupMath "Basic math functions" + * - \ref groupFastMath "Fast math functions" + * - \ref groupCmplxMath "Complex math functions" + * - \ref groupFilters "Filtering functions" + * - \ref groupMatrix "Matrix functions" + * - \ref groupTransforms "Transform functions" + * - \ref groupController "Motor control functions" + * - \ref groupStats "Statistical functions" + * - \ref groupSupport "Support functions" + * - \ref groupInterpolation "Interpolation functions" + * - \ref groupSVM "Support Vector Machine functions (SVM)" + * - \ref groupBayes "Bayes classifier functions" + * - \ref groupDistance "Distance functions" + * - \ref groupQuaternionMath "Quaternion functions" * * The library has generally separate functions for operating on 8-bit integers, 16-bit integers, * 32-bit integer and 32-bit floating-point values. @@ -60,129 +61,95 @@ * * \section using Using the Library * - * The library installer contains prebuilt versions of the libraries in the Lib folder. - * - * Here is the list of pre-built libraries : - * - arm_cortexM7lfdp_math.lib (Cortex-M7, Little endian, Double Precision Floating Point Unit) - * - arm_cortexM7bfdp_math.lib (Cortex-M7, Big endian, Double Precision Floating Point Unit) - * - arm_cortexM7lfsp_math.lib (Cortex-M7, Little endian, Single Precision Floating Point Unit) - * - arm_cortexM7bfsp_math.lib (Cortex-M7, Big endian and Single Precision Floating Point Unit on) - * - arm_cortexM7l_math.lib (Cortex-M7, Little endian) - * - arm_cortexM7b_math.lib (Cortex-M7, Big endian) - * - arm_cortexM4lf_math.lib (Cortex-M4, Little endian, Floating Point Unit) - * - arm_cortexM4bf_math.lib (Cortex-M4, Big endian, Floating Point Unit) - * - arm_cortexM4l_math.lib (Cortex-M4, Little endian) - * - arm_cortexM4b_math.lib (Cortex-M4, Big endian) - * - arm_cortexM3l_math.lib (Cortex-M3, Little endian) - * - arm_cortexM3b_math.lib (Cortex-M3, Big endian) - * - arm_cortexM0l_math.lib (Cortex-M0 / Cortex-M0+, Little endian) - * - arm_cortexM0b_math.lib (Cortex-M0 / Cortex-M0+, Big endian) - * - arm_ARMv8MBLl_math.lib (Armv8-M Baseline, Little endian) - * - arm_ARMv8MMLl_math.lib (Armv8-M Mainline, Little endian) - * - arm_ARMv8MMLlfsp_math.lib (Armv8-M Mainline, Little endian, Single Precision Floating Point Unit) - * - arm_ARMv8MMLld_math.lib (Armv8-M Mainline, Little endian, DSP instructions) - * - arm_ARMv8MMLldfsp_math.lib (Armv8-M Mainline, Little endian, DSP instructions, Single Precision Floating Point Unit) - * - * The library functions are declared in the public file arm_math.h which is placed in the Include folder. - * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single - * public header file arm_math.h for Cortex-M cores with little endian and big endian. Same header file will be used for floating point unit(FPU) variants. + * The library is released in source form. It is strongly advised to compile the library using -Ofast to + * have the best performances. * + * The library functions are declared in the public file `arm_math.h` which is placed in the `Include` folder. + * Simply include this file. If you don't want to include everything, you can also rely + * on headers in `Include/dsp` folder and use only what you need. * * \section example Examples * - * The library ships with a number of examples which demonstrate how to use the library functions. + * The library ships with a number of examples which demonstrate how to use the library functions. Please refer to \ref groupExamples. * * \section toolchain Toolchain Support * * The library is now tested on Fast Models building with cmake. - * Core M0, M7, A5 are tested. - * - * - * - * \section building Building the Library - * - * The library installer contains a project file to rebuild libraries on MDK toolchain in the CMSIS\\DSP\\Projects\\ARM folder. - * - arm_cortexM_math.uvprojx - * - * - * The libraries can be built by opening the arm_cortexM_math.uvprojx project in MDK-ARM, selecting a specific target, and defining the optional preprocessor macros detailed above. + * Core M0, M4, M7, M33, M55, A32 are tested. * - * There is also a work in progress cmake build. The README file is giving more details. * * \section preprocessor Preprocessor Macros * - * Each library project have different preprocessor macros. - * - * - ARM_MATH_BIG_ENDIAN: - * - * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets. - * - * - ARM_MATH_MATRIX_CHECK: - * - * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices - * - * - ARM_MATH_ROUNDING: - * - * Define macro ARM_MATH_ROUNDING for rounding on support functions - * - * - ARM_MATH_LOOPUNROLL: - * - * Define macro ARM_MATH_LOOPUNROLL to enable manual loop unrolling in DSP functions - * - * - ARM_MATH_NEON: - * - * Define macro ARM_MATH_NEON to enable Neon versions of the DSP functions. + * Each library project has different preprocessor macros. + * + * - `ARM_MATH_BIG_ENDIAN`: + * - Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets. + * . + * - `ARM_MATH_MATRIX_CHECK`: + * - Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices + * . + * - `ARM_MATH_ROUNDING`: + * - Define macro ARM_MATH_ROUNDING for rounding on support functions + * . + * - `ARM_MATH_LOOPUNROLL`: + * - Define macro ARM_MATH_LOOPUNROLL to enable manual loop unrolling in DSP functions + * . + * - `ARM_MATH_NEON`: + * - Define macro ARM_MATH_NEON to enable Neon versions of the DSP functions. * It is not enabled by default when Neon is available because performances are * dependent on the compiler and target architecture. - * - * - ARM_MATH_NEON_EXPERIMENTAL: - * - * Define macro ARM_MATH_NEON_EXPERIMENTAL to enable experimental Neon versions of + * . + * - `ARM_MATH_NEON_EXPERIMENTAL`: + * - Define macro ARM_MATH_NEON_EXPERIMENTAL to enable experimental Neon versions of * of some DSP functions. Experimental Neon versions currently do not have better * performances than the scalar versions. - * - * - ARM_MATH_HELIUM: - * - * It implies the flags ARM_MATH_MVEF and ARM_MATH_MVEI and ARM_MATH_FLOAT16. - * - * - ARM_MATH_MVEF: - * - * Select Helium versions of the f32 algorithms. + * . + * - `ARM_MATH_HELIUM`: + * - It implies the flags ARM_MATH_MVEF and ARM_MATH_MVEI and ARM_MATH_MVE_FLOAT16. + * . + * - `ARM_MATH_HELIUM_EXPERIMENTAL`: + * - Only taken into account when ARM_MATH_MVEF, ARM_MATH_MVEI or ARM_MATH_MVE_FLOAT16 are defined. + * Enable some vector versions which may have worse performance than scalar + * depending on the core / compiler configuration. + * . + * - `ARM_MATH_MVEF`: + * - Select Helium versions of the f32 algorithms. * It implies ARM_MATH_FLOAT16 and ARM_MATH_MVEI. - * - * - ARM_MATH_MVEI: - * - * Select Helium versions of the int and fixed point algorithms. - * - * - ARM_MATH_MVE_FLOAT16: - * - * MVE Float16 implementations of some algorithms (Requires MVE extension). - * - * - DISABLEFLOAT16: - * - * Disable float16 algorithms when __fp16 is not supported for a + * . + * - `ARM_MATH_MVEI`: + * - Select Helium versions of the int and fixed point algorithms. + * . + * - `ARM_MATH_MVE_FLOAT16`: + * - MVE Float16 implementations of some algorithms (Requires MVE extension). + * . + * - `DISABLEFLOAT16`: + * - Disable float16 algorithms when __fp16 is not supported for a * specific compiler / core configuration. * This is only valid for scalar. When vector architecture is * supporting f16 then it can't be disabled. + * . + * - `ARM_MATH_AUTOVECTORIZE`: + * - With Helium or Neon, disable the use of vectorized code with C intrinsics + * and use pure C instead. The vectorization is then done by the compiler. * - *
* \section pack CMSIS-DSP in ARM::CMSIS Pack * * The following files relevant to CMSIS-DSP are present in the ARM::CMSIS Pack directories: * |File/Folder |Content | * |---------------------------------|------------------------------------------------------------------------| * |\b CMSIS\\Documentation\\DSP | This documentation | - * |\b CMSIS\\DSP\\DSP_Lib_TestSuite | DSP_Lib deprecated test suite | * |\b CMSIS\\DSP\\Examples | Example projects demonstrating the usage of the library functions | - * |\b CMSIS\\DSP\\Include | DSP_Lib include files for using and building the lib - * |\b CMSIS\\DSP\\PrivateInclude | DSP_Lib private include files for building the lib | - * |\b CMSIS\\DSP\\Lib | DSP_Lib binaries | - * |\b CMSIS\\DSP\\Projects | Projects to rebuild DSP_Lib binaries | - * |\b CMSIS\\DSP\\Source | DSP_Lib source files | + * |\b CMSIS\\DSP\\ComputeLibrary | Small Neon kernels when building on Cortex-A + * |\b CMSIS\\DSP\\Include | include files for using and building the lib + * |\b CMSIS\\DSP\\PrivateInclude | private include files for building the lib | + * |\b CMSIS\\DSP\\Source | source files | * - *
* \section rev Revision History of CMSIS-DSP * Please refer to \ref ChangeLog_pg. + * + * \section license License + * + * The CMSIS-DSP is provided free of charge under the Apache 2.0 License. */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_f16.h index 85b20df..166d7d6 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_f16.h @@ -1,11 +1,12 @@ /****************************************************************************** * @file arm_math_f16.h * @brief Public header file for f16 function of the CMSIS DSP Library - * @version V1.8.1 - * @date 20. April 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* - * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2010-2021 Arm Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_memory.h b/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_memory.h index e750a8f..850d51e 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_memory.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_memory.h @@ -1,11 +1,12 @@ /****************************************************************************** * @file arm_math_memory.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* - * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2010-2021 Arm Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -73,7 +74,7 @@ extern "C" @return Q31 value */ __STATIC_FORCEINLINE q31_t read_q15x2 ( - q15_t * pQ15) + q15_t const * pQ15) { q31_t val; @@ -91,40 +92,14 @@ __STATIC_FORCEINLINE q31_t read_q15x2 ( @param[in] pQ15 points to input value @return Q31 value */ -__STATIC_FORCEINLINE q31_t read_q15x2_ia ( - q15_t ** pQ15) -{ - q31_t val; - -#ifdef __ARM_FEATURE_UNALIGNED - memcpy (&val, *pQ15, 4); -#else - val = ((*pQ15)[1] << 16) | ((*pQ15)[0] & 0x0FFFF); -#endif - - *pQ15 += 2; - return (val); -} +#define read_q15x2_ia(pQ15) read_q15x2((*(pQ15) += 2) - 2) /** @brief Read 2 Q15 from Q15 pointer and decrement pointer afterwards. @param[in] pQ15 points to input value @return Q31 value */ -__STATIC_FORCEINLINE q31_t read_q15x2_da ( - q15_t ** pQ15) -{ - q31_t val; - -#ifdef __ARM_FEATURE_UNALIGNED - memcpy (&val, *pQ15, 4); -#else - val = ((*pQ15)[1] << 16) | ((*pQ15)[0] & 0x0FFFF); -#endif - - *pQ15 -= 2; - return (val); -} +#define read_q15x2_da(pQ15) read_q15x2((*(pQ15) -= 2) + 2) /** @brief Write 2 Q15 to Q15 pointer and increment pointer afterwards. @@ -140,8 +115,8 @@ __STATIC_FORCEINLINE void write_q15x2_ia ( #ifdef __ARM_FEATURE_UNALIGNED memcpy (*pQ15, &val, 4); #else - (*pQ15)[0] = (val & 0x0FFFF); - (*pQ15)[1] = (val >> 16) & 0x0FFFF; + (*pQ15)[0] = (q15_t)(val & 0x0FFFF); + (*pQ15)[1] = (q15_t)((val >> 16) & 0x0FFFF); #endif *pQ15 += 2; @@ -162,52 +137,43 @@ __STATIC_FORCEINLINE void write_q15x2 ( #ifdef __ARM_FEATURE_UNALIGNED memcpy (pQ15, &val, 4); #else - pQ15[0] = val & 0x0FFFF; - pQ15[1] = val >> 16; + pQ15[0] = (q15_t)(val & 0x0FFFF); + pQ15[1] = (q15_t)(val >> 16); #endif } /** - @brief Read 4 Q7 from Q7 pointer and increment pointer afterwards. + @brief Read 4 Q7 from Q7 pointer @param[in] pQ7 points to input value @return Q31 value */ -__STATIC_FORCEINLINE q31_t read_q7x4_ia ( - q7_t ** pQ7) +__STATIC_FORCEINLINE q31_t read_q7x4 ( + q7_t const * pQ7) { q31_t val; - #ifdef __ARM_FEATURE_UNALIGNED - memcpy (&val, *pQ7, 4); + memcpy (&val, pQ7, 4); #else - val =(((*pQ7)[3] & 0x0FF) << 24) | (((*pQ7)[2] & 0x0FF) << 16) | (((*pQ7)[1] & 0x0FF) << 8) | ((*pQ7)[0] & 0x0FF); + val =((pQ7[3] & 0x0FF) << 24) | ((pQ7[2] & 0x0FF) << 16) | ((pQ7[1] & 0x0FF) << 8) | (pQ7[0] & 0x0FF); #endif - - *pQ7 += 4; - return (val); } /** - @brief Read 4 Q7 from Q7 pointer and decrement pointer afterwards. + @brief Read 4 Q7 from Q7 pointer and increment pointer afterwards. @param[in] pQ7 points to input value @return Q31 value */ -__STATIC_FORCEINLINE q31_t read_q7x4_da ( - q7_t ** pQ7) -{ - q31_t val; -#ifdef __ARM_FEATURE_UNALIGNED - memcpy (&val, *pQ7, 4); -#else - val = ((((*pQ7)[3]) & 0x0FF) << 24) | ((((*pQ7)[2]) & 0x0FF) << 16) | ((((*pQ7)[1]) & 0x0FF) << 8) | ((*pQ7)[0] & 0x0FF); -#endif - *pQ7 -= 4; +#define read_q7x4_ia(pQ7) read_q7x4((*(pQ7) += 4) - 4) - return (val); -} +/** + @brief Read 4 Q7 from Q7 pointer and decrement pointer afterwards. + @param[in] pQ7 points to input value + @return Q31 value + */ +#define read_q7x4_da(pQ7) read_q7x4((*(pQ7) -= 4) + 4) /** @brief Write 4 Q7 to Q7 pointer and increment pointer afterwards. @@ -223,10 +189,10 @@ __STATIC_FORCEINLINE void write_q7x4_ia ( #ifdef __ARM_FEATURE_UNALIGNED memcpy (*pQ7, &val, 4); #else - (*pQ7)[0] = val & 0x0FF; - (*pQ7)[1] = (val >> 8) & 0x0FF; - (*pQ7)[2] = (val >> 16) & 0x0FF; - (*pQ7)[3] = (val >> 24) & 0x0FF; + (*pQ7)[0] = (q7_t)(val & 0x0FF); + (*pQ7)[1] = (q7_t)((val >> 8) & 0x0FF); + (*pQ7)[2] = (q7_t)((val >> 16) & 0x0FF); + (*pQ7)[3] = (q7_t)((val >> 24) & 0x0FF); #endif *pQ7 += 4; diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types.h b/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types.h index a48b659..b3db6f7 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types.h @@ -1,11 +1,12 @@ /****************************************************************************** * @file arm_math_types.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* - * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2010-2021 Arm Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -36,6 +37,9 @@ extern "C" #elif defined ( __ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) +#elif defined ( __APPLE_CC__ ) + #pragma GCC diagnostic ignored "-Wold-style-cast" + #elif defined ( __GNUC__ ) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsign-conversion" @@ -63,7 +67,11 @@ extern "C" #define __STATIC_FORCEINLINE static __forceinline #define __STATIC_INLINE static __inline #define __ALIGNED(x) __declspec(align(x)) - +#elif defined ( __APPLE_CC__ ) +#include +#define __ALIGNED(x) __attribute__((aligned(x))) +#define __STATIC_FORCEINLINE static inline __attribute__((always_inline)) +#define __STATIC_INLINE static inline #elif defined (__GNUC_PYTHON__) #include #define __ALIGNED(x) __attribute__((aligned(x))) @@ -87,16 +95,22 @@ extern "C" #endif #if defined(ARM_MATH_NEON) -#include -#if __ARM_FEATURE_FP16_VECTOR_ARITHMETIC - #if !defined(ARM_MATH_NEON_FLOAT16) - #define ARM_MATH_NEON_FLOAT16 + #if defined(_MSC_VER) && defined(_M_ARM64EC) + #include + #else + #include + #endif + #if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && __ARM_FEATURE_FP16_VECTOR_ARITHMETIC + #if !defined(ARM_MATH_NEON_FLOAT16) + #define ARM_MATH_NEON_FLOAT16 + #endif #endif -#endif #endif #if !defined(ARM_MATH_AUTOVECTORIZE) + +#if defined(__ARM_FEATURE_MVE) #if __ARM_FEATURE_MVE #if !defined(ARM_MATH_MVEI) #define ARM_MATH_MVEI @@ -112,6 +126,7 @@ extern "C" #endif #endif +#endif /*defined(__ARM_FEATURE_MVE)*/ #endif /*!defined(ARM_MATH_AUTOVECTORIZE)*/ @@ -160,6 +175,12 @@ extern "C" #define LOW_OPTIMIZATION_EXIT #define IAR_ONLY_LOW_OPTIMIZATION_ENTER #define IAR_ONLY_LOW_OPTIMIZATION_EXIT + +#elif defined ( __APPLE_CC__ ) + #define LOW_OPTIMIZATION_ENTER + #define LOW_OPTIMIZATION_EXIT + #define IAR_ONLY_LOW_OPTIMIZATION_ENTER + #define IAR_ONLY_LOW_OPTIMIZATION_EXIT #elif defined ( __GNUC__ ) #define LOW_OPTIMIZATION_ENTER \ @@ -223,6 +244,8 @@ extern "C" #elif defined ( __ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) +#elif defined ( __APPLE_CC__ ) + #elif defined ( __GNUC__ ) #pragma GCC diagnostic pop @@ -244,7 +267,7 @@ extern "C" } #endif -#if __ARM_FEATURE_MVE +#if defined(__ARM_FEATURE_MVE) && __ARM_FEATURE_MVE #include #endif @@ -276,7 +299,9 @@ extern "C" /** * @brief 32-bit floating-point type definition. */ +#if !defined(__ICCARM__) || !(__ARM_FEATURE_MVE & 2) typedef float float32_t; +#endif /** * @brief 64-bit floating-point type definition. @@ -298,12 +323,12 @@ extern "C" typedef int32x4_t q31x4_t; /** - * @brief 16-bit fractional 128-bit vector data type with 16-bit alignement in 1.15 format. + * @brief 16-bit fractional 128-bit vector data type with 16-bit alignment in 1.15 format. */ typedef __ALIGNED(2) int16x8_t q15x8_t; /** - * @brief 8-bit fractional 128-bit vector data type with 8-bit alignement in 1.7 format. + * @brief 8-bit fractional 128-bit vector data type with 8-bit alignment in 1.7 format. */ typedef __ALIGNED(1) int8x16_t q7x16_t; diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types_f16.h index c83f761..771af5c 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types_f16.h @@ -1,11 +1,12 @@ /****************************************************************************** * @file arm_math_types_f16.h * @brief Public header file for f16 function of the CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* - * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2010-2021 Arm Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -61,7 +62,7 @@ won't be built. #endif #if defined(ARM_MATH_NEON) || (defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE)) /* floating point vector*/ - + #if defined(ARM_MATH_MVE_FLOAT16) || defined(ARM_MATH_NEON_FLOAT16) /** @@ -92,7 +93,7 @@ won't be built. #endif #if defined(ARM_MATH_NEON) - + #if defined(ARM_MATH_NEON_FLOAT16) /** @@ -128,21 +129,30 @@ won't be built. float16x4_t f; int16x4_t i; } any16x4_t; -#endif +#endif #endif #if defined(ARM_FLOAT16_SUPPORTED) + +#if defined(__ICCARM__) + +#define F16INFINITY ((float16_t) INFINITY) + +#else + +#define F16INFINITY ((float16_t)__builtin_inf()) + +#endif + #define F16_MAX ((float16_t)__FLT16_MAX__) -#define F16_MIN (-(float16_t)__FLT16_MAX__) +#define F16_MIN (-(_Float16)__FLT16_MAX__) #define F16_ABSMAX ((float16_t)__FLT16_MAX__) #define F16_ABSMIN ((float16_t)0.0f16) -#define F16INFINITY ((float16_t)__builtin_inf()) - #endif /* ARM_FLOAT16_SUPPORTED*/ #endif /* !defined( __CC_ARM ) */ @@ -151,5 +161,3 @@ won't be built. #endif #endif /* _ARM_MATH_F16_H */ - - diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/arm_mve_tables.h b/edge-impulse-sdk/CMSIS/DSP/Include/arm_mve_tables.h index 74f51b2..43456f0 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/arm_mve_tables.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/arm_mve_tables.h @@ -4,12 +4,13 @@ * Description: common tables like fft twiddle factors, Bitreverse, reciprocal etc * used for MVE implementation only * - * $Date: 14. April 2020 + * @version V1.10.0 + * @date 04 October 2021 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/arm_mve_tables_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/arm_mve_tables_f16.h index 171a391..62b8d9b 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/arm_mve_tables_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/arm_mve_tables_f16.h @@ -4,12 +4,13 @@ * Description: common tables like fft twiddle factors, Bitreverse, reciprocal etc * used for MVE implementation only * - * $Date: 14. April 2020 + * @version V1.10.0 + * @date 04 October 2021 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -39,7 +40,7 @@ extern "C" -#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) @@ -96,7 +97,7 @@ extern float16_t rearranged_twiddle_stride3_4096_f16[2728]; #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) */ -#endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ +#endif /* defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_fft.h b/edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_fft.h index 4d15381..4994892 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_fft.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_fft.h @@ -40,13 +40,280 @@ extern "C" #define MVE_CMPLX_MULT_FLT_AxB(A,B) vcmlaq_rot90(vcmulq(A, B), A, B) #define MVE_CMPLX_MULT_FLT_Conj_AxB(A,B) vcmlaq_rot270(vcmulq(A, B), A, B) -#define MVE_CMPLX_MULT_FX_AxB(A,B) vqdmladhxq(vqdmlsdhq((__typeof(A))vuninitializedq_s32(), A, B), A, B) -#define MVE_CMPLX_MULT_FX_AxConjB(A,B) vqdmladhq(vqdmlsdhxq((__typeof(A))vuninitializedq_s32(), A, B), A, B) +#define MVE_CMPLX_MULT_FX_AxB(A,B,TyA) vqdmladhxq(vqdmlsdhq((TyA)vuninitializedq_s32(), A, B), A, B) +#define MVE_CMPLX_MULT_FX_AxConjB(A,B,TyA) vqdmladhq(vqdmlsdhxq((TyA)vuninitializedq_s32(), A, B), A, B) #define MVE_CMPLX_ADD_FX_A_ixB(A, B) vhcaddq_rot90(A,B) #define MVE_CMPLX_SUB_FX_A_ixB(A,B) vhcaddq_rot270(A,B) +/** + @brief In-place 32 bit reversal function for helium + @param[in,out] pSrc points to in-place buffer of unknown 32-bit data type + @param[in] bitRevLen bit reversal table length + @param[in] pBitRevTab points to bit reversal table + @return none +*/ + +__STATIC_INLINE void arm_bitreversal_32_inpl_mve( + uint32_t *pSrc, + const uint16_t bitRevLen, + const uint16_t *pBitRevTab) + +{ + uint64_t *src = (uint64_t *) pSrc; + int32_t blkCnt; /* loop counters */ + uint32x4_t bitRevTabOff; + uint32x4_t one = vdupq_n_u32(1); + uint64x2_t inLow, inHigh; + uint64x2_t bitRevOff1Low, bitRevOff0Low; + uint64x2_t bitRevOff1High, bitRevOff0High; + + /* load scheduling to increase gather load idx update / gather load distance */ + bitRevTabOff = vldrhq_u32(pBitRevTab); + pBitRevTab += 4; + + bitRevOff0Low = vmullbq_int_u32(bitRevTabOff, one); + bitRevOff0High = vmulltq_int_u32(bitRevTabOff, one); + + + blkCnt = bitRevLen / 8; + while (blkCnt > 0) { + bitRevTabOff = vldrhq_u32(pBitRevTab); + pBitRevTab += 4; + + /* 64-bit index expansion */ + bitRevOff1Low = vmullbq_int_u32(bitRevTabOff, one); + bitRevOff1High = vmulltq_int_u32(bitRevTabOff, one); + + inLow = vldrdq_gather_offset_u64(src, bitRevOff0Low); + inHigh = vldrdq_gather_offset_u64(src, bitRevOff0High); + + vstrdq_scatter_offset_u64(src, bitRevOff0Low, inHigh); + vstrdq_scatter_offset_u64(src, bitRevOff0High, inLow); + + + /* unrolled */ + bitRevTabOff = vldrhq_u32(pBitRevTab); + pBitRevTab += 4; + + bitRevOff0Low = vmullbq_int_u32(bitRevTabOff, one); + bitRevOff0High = vmulltq_int_u32(bitRevTabOff, one); + + inLow = vldrdq_gather_offset_u64(src, bitRevOff1Low); + inHigh = vldrdq_gather_offset_u64(src, bitRevOff1High); + + vstrdq_scatter_offset_u64(src, bitRevOff1Low, inHigh); + vstrdq_scatter_offset_u64(src, bitRevOff1High, inLow); + + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + + if (bitRevLen & 7) { + /* FFT size = 16 */ + inLow = vldrdq_gather_offset_u64(src, bitRevOff0Low); + inHigh = vldrdq_gather_offset_u64(src, bitRevOff0High); + + vstrdq_scatter_offset_u64(src, bitRevOff0Low, inHigh); + vstrdq_scatter_offset_u64(src, bitRevOff0High, inLow); + } +} + + + +/** + @brief In-place 16 bit reversal function for helium + @param[in,out] pSrc points to in-place buffer of unknown 16-bit data type + @param[in] bitRevLen bit reversal table length + @param[in] pBitRevTab points to bit reversal table + @return none +*/ + +__STATIC_INLINE void arm_bitreversal_16_inpl_mve( + uint16_t *pSrc, + const uint16_t bitRevLen, + const uint16_t *pBitRevTab) + +{ + uint32_t *src = (uint32_t *) pSrc; + int32_t blkCnt; /* loop counters */ + uint32x4_t bitRevTabOff; + uint16x8_t one = vdupq_n_u16(1); + uint32x4_t bitRevOff1Low, bitRevOff0Low; + uint32x4_t bitRevOff1High, bitRevOff0High; + uint32x4_t inLow, inHigh; + + /* load scheduling to increase gather load idx update / gather load distance */ + bitRevTabOff = vldrhq_u16(pBitRevTab); + pBitRevTab += 8; + + bitRevOff0Low = vmullbq_int_u16((uint16x8_t)bitRevTabOff, one); + bitRevOff0High = vmulltq_int_u16((uint16x8_t)bitRevTabOff, one); + bitRevOff0Low = vshrq_n_u16((uint16x8_t)bitRevOff0Low, 3); + bitRevOff0High = vshrq_n_u16((uint16x8_t)bitRevOff0High, 3); + + blkCnt = (bitRevLen / 16); + while (blkCnt > 0) { + bitRevTabOff = vldrhq_u16(pBitRevTab); + pBitRevTab += 8; + + bitRevOff1Low = vmullbq_int_u16((uint16x8_t)bitRevTabOff, one); + bitRevOff1High = vmulltq_int_u16((uint16x8_t)bitRevTabOff, one); + bitRevOff1Low = vshrq_n_u16((uint16x8_t)bitRevOff1Low, 3); + bitRevOff1High = vshrq_n_u16((uint16x8_t)bitRevOff1High, 3); + + inLow = vldrwq_gather_shifted_offset_u32(src, bitRevOff0Low); + inHigh = vldrwq_gather_shifted_offset_u32(src, bitRevOff0High); + + vstrwq_scatter_shifted_offset_u32(src, bitRevOff0Low, inHigh); + vstrwq_scatter_shifted_offset_u32(src, bitRevOff0High, inLow); + + /* loop unrolling */ + bitRevTabOff = vldrhq_u16(pBitRevTab); + pBitRevTab += 8; + + bitRevOff0Low = vmullbq_int_u16((uint16x8_t)bitRevTabOff, one); + bitRevOff0High = vmulltq_int_u16((uint16x8_t)bitRevTabOff, one); + bitRevOff0Low = vshrq_n_u16((uint16x8_t)bitRevOff0Low, 3); + bitRevOff0High = vshrq_n_u16((uint16x8_t)bitRevOff0High, 3); + + inLow = vldrwq_gather_shifted_offset_u32(src, bitRevOff1Low); + inHigh = vldrwq_gather_shifted_offset_u32(src, bitRevOff1High); + + vstrwq_scatter_shifted_offset_u32(src, bitRevOff1Low, inHigh); + vstrwq_scatter_shifted_offset_u32(src, bitRevOff1High, inLow); + + blkCnt--; + } + + /* tail handling */ + blkCnt = bitRevLen & 0xf; + if (blkCnt == 8) { + inLow = vldrwq_gather_shifted_offset_u32(src, bitRevOff0Low); + inHigh = vldrwq_gather_shifted_offset_u32(src, bitRevOff0High); + + vstrwq_scatter_shifted_offset_u32(src, bitRevOff0Low, inHigh); + vstrwq_scatter_shifted_offset_u32(src, bitRevOff0High, inLow); + } else if (blkCnt == 12) { + /* FFT 16 special case */ + mve_pred16_t p = vctp16q(4); + + bitRevTabOff = vldrhq_z_u16(pBitRevTab, p); + + inLow = vldrwq_gather_shifted_offset_u32(src, bitRevOff0Low); + inHigh = vldrwq_gather_shifted_offset_u32(src, bitRevOff0High); + + vstrwq_scatter_shifted_offset_u32(src, bitRevOff0Low, inHigh); + vstrwq_scatter_shifted_offset_u32(src, bitRevOff0High, inLow); + + bitRevOff0Low = vmullbq_int_u16((uint16x8_t)bitRevTabOff, one); + bitRevOff0High = vmulltq_int_u16((uint16x8_t)bitRevTabOff, one); + bitRevOff0Low = vshrq_n_u16((uint16x8_t)bitRevOff0Low, 3); + bitRevOff0High = vshrq_n_u16((uint16x8_t)bitRevOff0High, 3); + + inLow = vldrwq_gather_shifted_offset_z_u32(src, bitRevOff0Low, p); + inHigh = vldrwq_gather_shifted_offset_z_u32(src, bitRevOff0High, p); + + vstrwq_scatter_shifted_offset_p_u32(src, bitRevOff0Low, inHigh, p); + vstrwq_scatter_shifted_offset_p_u32(src, bitRevOff0High, inLow, p); + } +} + +/** + @brief Out-of-place 32 bit reversal function for helium + @param[out] pDst points to destination buffer of unknown 32-bit data type + @param[in] pSrc points to input buffer of unknown 32-bit data type + @param[in] fftLen FFT length + @return none +*/ +__STATIC_INLINE void arm_bitreversal_32_outpl_mve(void *pDst, void *pSrc, uint32_t fftLen) +{ + uint32x4_t idxOffs0, idxOffs1, bitRevOffs0, bitRevOffs1; + uint32_t bitRevPos, blkCnt; + uint32_t *pDst32 = (uint32_t *) pDst; + + /* fwd indexes */ + idxOffs0 = vdupq_n_u32(0); + idxOffs1 = vdupq_n_u32(0); + idxOffs0[0] = 0; idxOffs0[2] = 4; + idxOffs1[0] = 8; idxOffs1[2] = 12; + + bitRevPos = (31 - __CLZ(fftLen)) + 5; + blkCnt = fftLen >> 2; + + /* issued earlier to increase gather load idx update / gather load distance */ + /* bit-reverse fwd indexes */ + bitRevOffs0 = vbrsrq(idxOffs0, bitRevPos); + bitRevOffs1 = vbrsrq(idxOffs1, bitRevPos); + while (blkCnt > 0) { + uint64x2_t vecIn; + + vecIn = vldrdq_gather_offset_u64(pSrc, (uint64x2_t) bitRevOffs0); + idxOffs0 = idxOffs0 + 16; + vst1q(pDst32, (uint32x4_t) vecIn); + pDst32 += 4; + bitRevOffs0 = vbrsrq(idxOffs0, bitRevPos); + + vecIn = vldrdq_gather_offset_u64(pSrc, (uint64x2_t) bitRevOffs1); + idxOffs1 = idxOffs1 + 16; + vst1q(pDst32, (uint32x4_t) vecIn); + pDst32 += 4; + bitRevOffs1 = vbrsrq(idxOffs1, bitRevPos); + + blkCnt--; + } +} + + +/** + @brief Out-of-place 16 bit reversal function for helium + @param[out] pDst points to destination buffer of unknown 16-bit data type + @param[in] pSrc points to input buffer of unknown 16-bit data type + @param[in] fftLen FFT length + @return none +*/ + +__STATIC_INLINE void arm_bitreversal_16_outpl_mve(void *pDst, void *pSrc, uint32_t fftLen) +{ + uint32x4_t idxOffs0, idxOffs1, bitRevOffs0, bitRevOffs1; + uint32_t bitRevPos, blkCnt; + uint16_t *pDst16 = (uint16_t *) pDst; + uint32_t incrIdx = 0; + + /* fwd indexes */ + idxOffs0 = vidupq_wb_u32(&incrIdx, 4); // {0, 4, 8, 12} + idxOffs1 = vidupq_wb_u32(&incrIdx, 4); // {16, 20, 24, 28} + + bitRevPos = (31 - __CLZ(fftLen)) + 4; + blkCnt = fftLen >> 3; + + /* issued earlier to increase gather load idx update / gather load distance */ + /* bit-reverse fwd indexes */ + bitRevOffs0 = vbrsrq(idxOffs0, bitRevPos); + bitRevOffs1 = vbrsrq(idxOffs1, bitRevPos); + while (blkCnt > 0) { + uint32x4_t vecIn; + + vecIn = vldrwq_gather_offset_s32(pSrc, bitRevOffs0); + idxOffs0 = idxOffs0 + 32; + vst1q(pDst16, (uint16x8_t) vecIn); + pDst16 += 8; + bitRevOffs0 = vbrsrq(idxOffs0, bitRevPos); + + vecIn = vldrwq_gather_offset_s32(pSrc, bitRevOffs1); + idxOffs1 = idxOffs1 + 32; + vst1q(pDst16, (uint16x8_t) vecIn); + pDst16 += 8; + bitRevOffs1 = vbrsrq(idxOffs1, bitRevPos); + + blkCnt--; + } +} + + #endif /* (defined(ARM_MATH_MVEF) || defined(ARM_MATH_HELIUM)) && !defined(ARM_MATH_AUTOVECTORIZE)*/ @@ -55,4 +322,4 @@ extern "C" #endif -#endif /* _ARM_VEC_FFT_H_ */ \ No newline at end of file +#endif /* _ARM_VEC_FFT_H_ */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_math.h b/edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_math.h index 43d8f46..dc32ca6 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_math.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_math.h @@ -1,11 +1,12 @@ /****************************************************************************** * @file arm_vec_math.h * @brief Public header file for CMSIS DSP Library - * @version V1.7.0 - * @date 15. October 2019 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* - * Copyright (c) 2010-2019 Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2010-2021 Arm Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_math_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_math_f16.h index 71ff75d..bca9ef8 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_math_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_math_f16.h @@ -1,9 +1,12 @@ /****************************************************************************** * @file arm_vec_math_f16.h * @brief Public header file for CMSIS DSP Library + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* - * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2010-2021 Arm Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -65,11 +68,11 @@ __STATIC_INLINE f16x8_t vrecip_medprec_f16( b = 2.0f16 - xinv.f * ax; xinv.f = xinv.f * b; - xinv.f = vdupq_m(xinv.f, F16INFINITY, vcmpeqq(x, 0.0f)); + xinv.f = vdupq_m_n_f16(xinv.f, F16INFINITY, vcmpeqq_n_f16(x, 0.0f)); /* * restore sign */ - xinv.f = vnegq_m(xinv.f, xinv.f, vcmpltq(x, 0.0f)); + xinv.f = vnegq_m(xinv.f, xinv.f, vcmpltq_n_f16(x, 0.0f)); return xinv.f; } @@ -102,11 +105,11 @@ __STATIC_INLINE f16x8_t vrecip_hiprec_f16( b = 2.0f16 - xinv.f * ax; xinv.f = xinv.f * b; - xinv.f = vdupq_m(xinv.f, F16INFINITY, vcmpeqq(x, 0.0f)); + xinv.f = vdupq_m_n_f16(xinv.f, F16INFINITY, vcmpeqq_n_f16(x, 0.0f)); /* * restore sign */ - xinv.f = vnegq_m(xinv.f, xinv.f, vcmpltq(x, 0.0f)); + xinv.f = vnegq_m(xinv.f, xinv.f, vcmpltq_n_f16(x, 0.0f)); return xinv.f; } @@ -140,22 +143,17 @@ __STATIC_INLINE float16x8_t vtaylor_polyq_f16( return res; } -__STATIC_INLINE float16x8_t vmant_exp_f16( - float16x8_t x, - int16x8_t * e) -{ - any16x8_t r; - int16x8_t n; - - r.f = x; - n = r.i >> 10; - n = n - 15; - r.i = r.i - (n << 10); - - *e = n; - return r.f; -} - +#define VMANT_EXP_F16(x) \ + any16x8_t r; \ + int16x8_t n; \ + \ + r.f = x; \ + n = r.i >> 10; \ + n = n - 15; \ + r.i = r.i - (n << 10);\ + \ + vecExpUnBiased = n; \ + vecTmpFlt1 = r.f; __STATIC_INLINE float16x8_t vlogq_f16(float16x8_t vecIn) { @@ -167,7 +165,7 @@ __STATIC_INLINE float16x8_t vlogq_f16(float16x8_t vecIn) /* * extract exponent */ - vecTmpFlt1 = vmant_exp_f16(vecIn, &vecExpUnBiased); + VMANT_EXP_F16(vecIn); vecTmpFlt0 = vecTmpFlt1 * vecTmpFlt1; /* @@ -213,7 +211,7 @@ __STATIC_INLINE float16x8_t vlogq_f16(float16x8_t vecIn) */ vecAcc0 = vfmaq(vecAcc0, vecExpUnBiasedFlt, __logf_rng_f16); // set log0 down to -inf - vecAcc0 = vdupq_m(vecAcc0, -F16INFINITY, vcmpeqq(vecIn, 0.0f)); + vecAcc0 = vdupq_m_n_f16(vecAcc0, -(_Float16)F16INFINITY, vcmpeqq_n_f16(vecIn, 0.0f)); return vecAcc0; } @@ -230,7 +228,7 @@ __STATIC_INLINE float16x8_t vexpq_f16( // Reconstruct poly = (float16x8_t) (vqaddq_s16((int16x8_t) (poly), vqshlq_n_s16(m, 10))); - poly = vdupq_m(poly, 0.0f, vcmpltq_n_s16(m, -14)); + poly = vdupq_m_n_f16(poly, 0.0f16, vcmpltq_n_s16(m, -14)); return poly; } @@ -267,20 +265,20 @@ __STATIC_INLINE f16x8_t vrecip_f16(f16x8_t vecIn) vecW = vmulq(vecSx, v.f); // v.f = v.f * (8 + w * (-28 + w * (56 + w * (-70 + w *(56 + w * (-28 + w * (8 - w))))))); - vecTmp = vsubq(vdupq_n_f16(8.0f), vecW); - vecTmp = vfmasq(vecW, vecTmp, -28.0f); - vecTmp = vfmasq(vecW, vecTmp, 56.0f); - vecTmp = vfmasq(vecW, vecTmp, -70.0f); - vecTmp = vfmasq(vecW, vecTmp, 56.0f); - vecTmp = vfmasq(vecW, vecTmp, -28.0f); - vecTmp = vfmasq(vecW, vecTmp, 8.0f); + vecTmp = vsubq(vdupq_n_f16(8.0f16), vecW); + vecTmp = vfmasq_n_f16(vecW, vecTmp, -28.0f16); + vecTmp = vfmasq_n_f16(vecW, vecTmp, 56.0f16); + vecTmp = vfmasq_n_f16(vecW, vecTmp, -70.0f16); + vecTmp = vfmasq_n_f16(vecW, vecTmp, 56.0f16); + vecTmp = vfmasq_n_f16(vecW, vecTmp, -28.0f16); + vecTmp = vfmasq_n_f16(vecW, vecTmp, 8.0f16); v.f = vmulq(v.f, vecTmp); - v.f = vdupq_m(v.f, F16INFINITY, vcmpeqq(vecIn, 0.0f)); + v.f = vdupq_m_n_f16(v.f, F16INFINITY, vcmpeqq_n_f16(vecIn, 0.0f)); /* * restore sign */ - v.f = vnegq_m(v.f, v.f, vcmpltq(vecIn, 0.0f)); + v.f = vnegq_m(v.f, v.f, vcmpltq_n_f16(vecIn, 0.0f)); return v.f; } @@ -288,10 +286,10 @@ __STATIC_INLINE f16x8_t vtanhq_f16( f16x8_t val) { f16x8_t x = - vminnmq_f16(vmaxnmq_f16(val, vdupq_n_f16(-10.f)), vdupq_n_f16(10.0f)); - f16x8_t exp2x = vexpq_f16(vmulq_n_f16(x, 2.f)); - f16x8_t num = vsubq_n_f16(exp2x, 1.f); - f16x8_t den = vaddq_n_f16(exp2x, 1.f); + vminnmq_f16(vmaxnmq_f16(val, vdupq_n_f16(-10.f16)), vdupq_n_f16(10.0f16)); + f16x8_t exp2x = vexpq_f16(vmulq_n_f16(x, 2.f16)); + f16x8_t num = vsubq_n_f16(exp2x, 1.f16); + f16x8_t den = vaddq_n_f16(exp2x, 1.f16); f16x8_t tanh = vmulq_f16(num, vrecip_f16(den)); return tanh; } diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h index fe20c48..30ad98d 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file basic_math_functions.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -99,6 +100,21 @@ extern "C" +/** + * @brief Floating-point vector multiplication. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in each vector + */ +void arm_mult_f64( +const float64_t * pSrcA, +const float64_t * pSrcB, + float64_t * pDst, + uint32_t blockSize); + + + /** * @brief Floating-point vector addition. * @param[in] pSrcA points to the first input vector @@ -114,6 +130,21 @@ extern "C" +/** + * @brief Floating-point vector addition. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in each vector + */ + void arm_add_f64( + const float64_t * pSrcA, + const float64_t * pSrcB, + float64_t * pDst, + uint32_t blockSize); + + + /** * @brief Q7 vector addition. * @param[in] pSrcA points to the first input vector @@ -171,6 +202,21 @@ extern "C" + /** + * @brief Floating-point vector subtraction. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in each vector + */ + void arm_sub_f64( + const float64_t * pSrcA, + const float64_t * pSrcB, + float64_t * pDst, + uint32_t blockSize); + + + /** * @brief Q7 vector subtraction. * @param[in] pSrcA points to the first input vector @@ -228,6 +274,21 @@ extern "C" + /** + * @brief Multiplies a floating-point vector by a scalar. + * @param[in] pSrc points to the input vector + * @param[in] scale scale factor to be applied + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ + void arm_scale_f64( + const float64_t * pSrc, + float64_t scale, + float64_t * pDst, + uint32_t blockSize); + + + /** * @brief Multiplies a Q7 vector by a scalar. * @param[in] pSrc points to the input vector @@ -301,6 +362,18 @@ extern "C" +/** + * @brief Floating-point vector absolute value. + * @param[in] pSrc points to the input buffer + * @param[out] pDst points to the output buffer + * @param[in] blockSize number of samples in each vector + */ +void arm_abs_f64( +const float64_t * pSrc, + float64_t * pDst, + uint32_t blockSize); + + /** * @brief Q15 vector absolute value. @@ -341,6 +414,21 @@ extern "C" +/** + * @brief Dot product of floating-point vectors. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[in] blockSize number of samples in each vector + * @param[out] result output result returned here + */ +void arm_dot_prod_f64( +const float64_t * pSrcA, +const float64_t * pSrcB, + uint32_t blockSize, + float64_t * result); + + + /** * @brief Dot product of Q7 vectors. * @param[in] pSrcA points to the first input vector @@ -425,6 +513,21 @@ extern "C" uint32_t blockSize); +/** + * @brief Adds a constant offset to a floating-point vector. + * @param[in] pSrc points to the input vector + * @param[in] offset is the offset to be added + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ +void arm_offset_f64( +const float64_t * pSrc, + float64_t offset, + float64_t * pDst, + uint32_t blockSize); + + + /** * @brief Adds a constant offset to a floating-point vector. * @param[in] pSrc points to the input vector @@ -494,6 +597,20 @@ extern "C" uint32_t blockSize); + +/** + * @brief Negates the elements of a floating-point vector. + * @param[in] pSrc points to the input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ +void arm_negate_f64( +const float64_t * pSrc, + float64_t * pDst, + uint32_t blockSize); + + + /** * @brief Negates the elements of a Q7 vector. * @param[in] pSrc points to the input vector diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions_f16.h index f1d4aae..92f11da 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions_f16.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file basic_math_functions_f16.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/bayes_functions.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/bayes_functions.h index c527018..0d6d58b 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/bayes_functions.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/bayes_functions.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file bayes_functions.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -66,9 +67,10 @@ typedef struct /** * @brief Naive Gaussian Bayesian Estimator * - * @param[in] S points to a naive bayes instance structure - * @param[in] in points to the elements of the input vector. - * @param[in] pBuffer points to a buffer of length numberOfClasses + * @param[in] S points to a naive bayes instance structure + * @param[in] in points to the elements of the input vector. + * @param[out] *pOutputProbabilities points to a buffer of length numberOfClasses containing estimated probabilities + * @param[out] *pBufferB points to a temporary buffer of length numberOfClasses * @return The predicted class * */ @@ -76,7 +78,8 @@ typedef struct uint32_t arm_gaussian_naive_bayes_predict_f32(const arm_gaussian_naive_bayes_instance_f32 *S, const float32_t * in, - float32_t *pBuffer); + float32_t *pOutputProbabilities, + float32_t *pBufferB); #ifdef __cplusplus diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/bayes_functions_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/bayes_functions_f16.h index 46dabab..a16c49b 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/bayes_functions_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/bayes_functions_f16.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file bayes_functions_f16.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -57,9 +58,10 @@ typedef struct /** * @brief Naive Gaussian Bayesian Estimator * - * @param[in] S points to a naive bayes instance structure - * @param[in] in points to the elements of the input vector. - * @param[in] pBuffer points to a buffer of length numberOfClasses + * @param[in] S points to a naive bayes instance structure + * @param[in] in points to the elements of the input vector. + * @param[out] *pOutputProbabilities points to a buffer of length numberOfClasses containing estimated probabilities + * @param[out] *pBufferB points to a temporary buffer of length numberOfClasses * @return The predicted class * */ @@ -67,7 +69,8 @@ typedef struct uint32_t arm_gaussian_naive_bayes_predict_f16(const arm_gaussian_naive_bayes_instance_f16 *S, const float16_t * in, - float16_t *pBuffer); + float16_t *pOutputProbabilities, + float16_t *pBufferB); #endif /*defined(ARM_FLOAT16_SUPPORTED)*/ #ifdef __cplusplus diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/complex_math_functions.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/complex_math_functions.h index 5589a06..b4394de 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/complex_math_functions.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/complex_math_functions.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file complex_math_functions.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -95,6 +96,18 @@ extern "C" uint32_t numSamples); + /** + * @brief Floating-point complex magnitude squared + * @param[in] pSrc points to the complex input vector + * @param[out] pDst points to the real output vector + * @param[in] numSamples number of complex samples in the input vector + */ + void arm_cmplx_mag_squared_f64( + const float64_t * pSrc, + float64_t * pDst, + uint32_t numSamples); + + /** * @brief Q31 complex magnitude squared * @param[in] pSrc points to the complex input vector @@ -131,6 +144,18 @@ extern "C" uint32_t numSamples); +/** + * @brief Floating-point complex magnitude + * @param[in] pSrc points to the complex input vector + * @param[out] pDst points to the real output vector + * @param[in] numSamples number of complex samples in the input vector + */ + void arm_cmplx_mag_f64( + const float64_t * pSrc, + float64_t * pDst, + uint32_t numSamples); + + /** * @brief Q31 complex magnitude * @param[in] pSrc points to the complex input vector @@ -154,6 +179,17 @@ extern "C" q15_t * pDst, uint32_t numSamples); + /** + * @brief Q15 complex magnitude + * @param[in] pSrc points to the complex input vector + * @param[out] pDst points to the real output vector + * @param[in] numSamples number of complex samples in the input vector + */ + void arm_cmplx_mag_fast_q15( + const q15_t * pSrc, + q15_t * pDst, + uint32_t numSamples); + /** * @brief Q15 complex dot product @@ -287,6 +323,21 @@ extern "C" +/** + * @brief Floating-point complex-by-complex multiplication + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] numSamples number of complex samples in each vector + */ +void arm_cmplx_mult_cmplx_f64( +const float64_t * pSrcA, +const float64_t * pSrcB, + float64_t * pDst, + uint32_t numSamples); + + + #ifdef __cplusplus } #endif diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/complex_math_functions_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/complex_math_functions_f16.h index 39d9fa9..e0baa6f 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/complex_math_functions_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/complex_math_functions_f16.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file complex_math_functions_f16.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h index 39218ba..886a23c 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file controller_functions.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -51,15 +52,35 @@ extern "C" */ - /** - * @ingroup groupController - */ - - /** - * @addtogroup SinCos - * @{ - */ +/** + @ingroup groupController + */ +/** + @defgroup SinCos Sine Cosine + + Computes the trigonometric sine and cosine values using a combination of table lookup + and linear interpolation. + There are separate functions for Q31 and floating-point data types. + The input to the floating-point version is in degrees while the + fixed-point Q31 have a scaled input with the range + [-1 0.9999] mapping to [-180 +180] degrees. + + The floating point function also allows values that are out of the usual range. When this happens, the function will + take extra time to adjust the input value to the range of [-180 180]. + + The result is accurate to 5 digits after the decimal point. + + The implementation is based on table lookup using 360 values together with linear interpolation. + The steps used are: + -# Calculation of the nearest integer table index. + -# Compute the fractional portion (fract) of the input. + -# Fetch the value corresponding to \c index from sine table to \c y0 and also value from \c index+1 to \c y1. + -# Sine value is computed as *psinVal = y0 + (fract * (y1 - y0)). + -# Fetch the value corresponding to \c index from cosine table to \c y0 and also value from \c index+1 to \c y1. + -# Cosine value is computed as *pcosVal = y0 + (fract * (y1 - y0)). + */ + /** * @brief Floating-point sin_cos function. * @param[in] theta input value in degrees @@ -83,14 +104,11 @@ extern "C" q31_t * pSinVal, q31_t * pCosVal); - /** - * @} end of SinCos group - */ - - /** - * @ingroup groupController - */ +/** + @ingroup groupController + */ + /** * @defgroup PID PID Motor Control * @@ -151,6 +169,7 @@ extern "C" /** + * @ingroup PID * @brief Instance structure for the Q15 PID Control. */ typedef struct @@ -169,6 +188,7 @@ extern "C" } arm_pid_instance_q15; /** + * @ingroup PID * @brief Instance structure for the Q31 PID Control. */ typedef struct @@ -183,6 +203,7 @@ extern "C" } arm_pid_instance_q31; /** + * @ingroup PID * @brief Instance structure for the floating-point PID Control. */ typedef struct @@ -254,12 +275,10 @@ extern "C" - /** - * @addtogroup PID - * @{ - */ + /** + * @ingroup PID * @brief Process function for the floating-point PID Control. * @param[in,out] S is an instance of the floating-point PID Control structure * @param[in] in input sample to process @@ -286,6 +305,7 @@ extern "C" } /** + @ingroup PID @brief Process function for the Q31 PID Control. @param[in,out] S points to an instance of the Q31 PID Control structure @param[in] in input sample to process @@ -331,6 +351,7 @@ __STATIC_FORCEINLINE q31_t arm_pid_q31( /** + @ingroup PID @brief Process function for the Q15 PID Control. @param[in,out] S points to an instance of the Q15 PID Control structure @param[in] in input sample to process @@ -383,9 +404,7 @@ __STATIC_FORCEINLINE q15_t arm_pid_q15( return (out); } - /** - * @} end of PID group - */ + /** * @ingroup groupController @@ -415,12 +434,10 @@ __STATIC_FORCEINLINE q15_t arm_pid_q15( * Refer to the function specific documentation below for usage guidelines. */ - /** - * @addtogroup park - * @{ - */ + /** + * @ingroup park * @brief Floating-point Park transform * @param[in] Ialpha input two-phase vector coordinate alpha * @param[in] Ibeta input two-phase vector coordinate beta @@ -450,6 +467,7 @@ __STATIC_FORCEINLINE q15_t arm_pid_q15( /** + @ingroup park @brief Park transform for Q31 version @param[in] Ialpha input two-phase vector coordinate alpha @param[in] Ibeta input two-phase vector coordinate beta @@ -495,9 +513,6 @@ __STATIC_FORCEINLINE void arm_park_q31( *pIq = __QSUB(product4, product3); } - /** - * @} end of park group - */ /** @@ -521,12 +536,10 @@ __STATIC_FORCEINLINE void arm_park_q31( * Refer to the function specific documentation below for usage guidelines. */ - /** - * @addtogroup inv_park - * @{ - */ + /** + * @ingroup inv_park * @brief Floating-point Inverse Park transform * @param[in] Id input coordinate of rotor reference frame d * @param[in] Iq input coordinate of rotor reference frame q @@ -553,6 +566,7 @@ __STATIC_FORCEINLINE void arm_park_q31( /** + @ingroup inv_park @brief Inverse Park transform for Q31 version @param[in] Id input coordinate of rotor reference frame d @param[in] Iq input coordinate of rotor reference frame q @@ -598,9 +612,6 @@ __STATIC_FORCEINLINE void arm_inv_park_q31( *pIbeta = __QADD(product4, product3); } - /** - * @} end of Inverse park group - */ /** * @ingroup groupController @@ -628,13 +639,10 @@ __STATIC_FORCEINLINE void arm_inv_park_q31( * Refer to the function specific documentation below for usage guidelines. */ - /** - * @addtogroup clarke - * @{ - */ /** * + * @ingroup clarke * @brief Floating-point Clarke transform * @param[in] Ia input three-phase coordinate a * @param[in] Ib input three-phase coordinate b @@ -657,6 +665,7 @@ __STATIC_FORCEINLINE void arm_inv_park_q31( /** + @ingroup clarke @brief Clarke transform for Q31 version @param[in] Ia input three-phase coordinate a @param[in] Ib input three-phase coordinate b @@ -690,9 +699,6 @@ __STATIC_FORCEINLINE void arm_clarke_q31( *pIbeta = __QADD(product1, product2); } - /** - * @} end of clarke group - */ /** @@ -715,12 +721,10 @@ __STATIC_FORCEINLINE void arm_clarke_q31( * Refer to the function specific documentation below for usage guidelines. */ - /** - * @addtogroup inv_clarke - * @{ - */ + /** + * @ingroup inv_clarke * @brief Floating-point Inverse Clarke transform * @param[in] Ialpha input two-phase orthogonal vector axis alpha * @param[in] Ibeta input two-phase orthogonal vector axis beta @@ -743,6 +747,7 @@ __STATIC_FORCEINLINE void arm_clarke_q31( /** + @ingroup inv_clarke @brief Inverse Clarke transform for Q31 version @param[in] Ialpha input two-phase orthogonal vector axis alpha @param[in] Ibeta input two-phase orthogonal vector axis beta @@ -776,9 +781,7 @@ __STATIC_FORCEINLINE void arm_inv_clarke_q31( *pIb = __QSUB(product2, product1); } - /** - * @} end of inv_clarke group - */ + diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions_f16.h index a76e1f6..8fae483 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions_f16.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file controller_functions_f16.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/debug.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/debug.h new file mode 100644 index 0000000..6fb7183 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/debug.h @@ -0,0 +1,146 @@ +/****************************************************************************** + * @file basic_math_functions.h + * @brief Public header file for CMSIS DSP Library + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores + ******************************************************************************/ +/* + * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef _DEBUG_FUNCTIONS_H_ +#define _DEBUG_FUNCTIONS_H_ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_math_memory.h" + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/none.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/utils.h" + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions_f16.h" + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +#if defined(ARM_FLOAT16_SUPPORTED) +#define PROW_f16(S,NB) \ +{ \ + printf("{%f",(double)(S)[0]); \ + for(unsigned int i=1;i<(NB) ;i++) \ + { \ + printf(",%f",(double)(S)[i]);\ + } \ + printf("}"); \ +}; + +#define PV_f16(S,V,NB)\ +{ \ + printf("%s=",(S)); \ + PROW_f16((V),(NB)); \ + printf(";\n"); \ +}; + +#define PM_f16(S,M) \ +{ \ + printf("%s={",(S)); \ + for(unsigned int row=0;row<(M)->numRows;row++) \ + { \ + if (row != 0) \ + { \ + printf("\n,"); \ + } \ + PROW_f16((M)->pData + row * (M)->numCols, (M)->numCols);\ + } \ + printf("};\n"); \ +} + +#endif + +#define PROW_f32(S,NB) \ +{ \ + printf("{%f",(double)(S)[0]); \ + for(unsigned int i=1;i<(NB) ;i++) \ + { \ + printf(",%f",(double)(S)[i]);\ + } \ + printf("}"); \ +}; + +#define PV_f32(S,V,NB)\ +{ \ + printf("%s=",(S)); \ + PROW_f32((V),(NB)); \ + printf(";\n"); \ +}; + +#define PM_f32(S,M) \ +{ \ + printf("%s={",(S)); \ + for(unsigned int row=0;row<(M)->numRows;row++) \ + { \ + if (row != 0) \ + { \ + printf("\n,"); \ + } \ + PROW_f32((M)->pData + row * (M)->numCols, (M)->numCols);\ + } \ + printf("};\n"); \ +} + +#define PROW_f64(S,NB) \ +{ \ + printf("{%.20g",(double)(S)[0]); \ + for(unsigned int i=1;i<(NB) ;i++) \ + { \ + printf(",%.20g",(double)(S)[i]);\ + } \ + printf("}"); \ +}; + +#define PV_f64(S,V,NB) \ +{ \ + printf("%s=",(S)); \ + PROW_f64((V),(NB));\ + printf(";\n"); \ +}; + +#define PM_f64(S,M) \ +{ \ + printf("%s={",(S)); \ + for(unsigned int row=0;row<(M)->numRows;row++) \ + { \ + if (row != 0) \ + { \ + printf("\n,"); \ + } \ + PROW_f64((M)->pData + row * (M)->numCols, (M)->numCols);\ + } \ + printf("};\n"); \ +} + +#ifdef __cplusplus +} +#endif + +#endif /* ifndef _DEBUG_FUNCTIONS_H_ */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/distance_functions.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/distance_functions.h index c1580cb..a8cc19d 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/distance_functions.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/distance_functions.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file distance_functions.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -68,6 +69,17 @@ __attribute__((weak)) float __powisf2(float a, int b); float32_t arm_euclidean_distance_f32(const float32_t *pA,const float32_t *pB, uint32_t blockSize); +/** + * @brief Euclidean distance between two vectors + * @param[in] pA First vector + * @param[in] pB Second vector + * @param[in] blockSize vector length + * @return distance + * + */ + +float64_t arm_euclidean_distance_f64(const float64_t *pA,const float64_t *pB, uint32_t blockSize); + /** * @brief Bray-Curtis distance between two vectors * @param[in] pA First vector @@ -105,6 +117,17 @@ float32_t arm_canberra_distance_f32(const float32_t *pA,const float32_t *pB, uin float32_t arm_chebyshev_distance_f32(const float32_t *pA,const float32_t *pB, uint32_t blockSize); +/** + * @brief Chebyshev distance between two vectors + * @param[in] pA First vector + * @param[in] pB Second vector + * @param[in] blockSize vector length + * @return distance + * + */ +float64_t arm_chebyshev_distance_f64(const float64_t *pA,const float64_t *pB, uint32_t blockSize); + + /** * @brief Cityblock (Manhattan) distance between two vectors * @param[in] pA First vector @@ -115,6 +138,16 @@ float32_t arm_chebyshev_distance_f32(const float32_t *pA,const float32_t *pB, ui */ float32_t arm_cityblock_distance_f32(const float32_t *pA,const float32_t *pB, uint32_t blockSize); +/** + * @brief Cityblock (Manhattan) distance between two vectors + * @param[in] pA First vector + * @param[in] pB Second vector + * @param[in] blockSize vector length + * @return distance + * + */ +float64_t arm_cityblock_distance_f64(const float64_t *pA,const float64_t *pB, uint32_t blockSize); + /** * @brief Correlation distance between two vectors * @@ -140,6 +173,18 @@ float32_t arm_correlation_distance_f32(float32_t *pA,float32_t *pB, uint32_t blo float32_t arm_cosine_distance_f32(const float32_t *pA,const float32_t *pB, uint32_t blockSize); +/** + * @brief Cosine distance between two vectors + * + * @param[in] pA First vector + * @param[in] pB Second vector + * @param[in] blockSize vector length + * @return distance + * + */ + +float64_t arm_cosine_distance_f64(const float64_t *pA,const float64_t *pB, uint32_t blockSize); + /** * @brief Jensen-Shannon distance between two vectors * diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/distance_functions_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/distance_functions_f16.h index 0d71b6b..46ad233 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/distance_functions_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/distance_functions_f16.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file distance_functions_f16.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h index 1828f3f..758b0fb 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file fast_math_functions.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -32,6 +33,9 @@ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/none.h" #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/utils.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h" + + #ifdef __cplusplus extern "C" { @@ -59,17 +63,8 @@ extern "C" * */ - /** - * @ingroup groupFastMath - */ - -/** - @addtogroup sin - @{ - */ - -/** + /** * @brief Fast approximation to the trigonometric sine function for floating-point data. * @param[in] x input value in radians. * @return sin(x). @@ -86,7 +81,6 @@ extern "C" q31_t arm_sin_q31( q31_t x); - /** * @brief Fast approximation to the trigonometric sine function for Q15 data. * @param[in] x Scaled input value in radians. @@ -95,14 +89,6 @@ extern "C" q15_t arm_sin_q15( q15_t x); -/** - @} end of sin group - */ - -/** - @addtogroup cos - @{ - */ /** * @brief Fast approximation to the trigonometric cosine function for floating-point data. @@ -130,10 +116,6 @@ extern "C" q15_t arm_cos_q15( q15_t x); -/** - @} end of cos group - */ - /** @brief Floating-point vector of log values. @@ -147,6 +129,46 @@ extern "C" float32_t * pDst, uint32_t blockSize); + + +/** + @brief Floating-point vector of log values. + @param[in] pSrc points to the input vector + @param[out] pDst points to the output vector + @param[in] blockSize number of samples in each vector + @return none + */ + void arm_vlog_f64( + const float64_t * pSrc, + float64_t * pDst, + uint32_t blockSize); + + + + /** + * @brief q31 vector of log values. + * @param[in] pSrc points to the input vector in q31 + * @param[out] pDst points to the output vector in q5.26 + * @param[in] blockSize number of samples in each vector + * @return none + */ + void arm_vlog_q31(const q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + /** + * @brief q15 vector of log values. + * @param[in] pSrc points to the input vector in q15 + * @param[out] pDst points to the output vector in q4.11 + * @param[in] blockSize number of samples in each vector + * @return none + */ + void arm_vlog_q15(const q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + /** @brief Floating-point vector of exp values. @param[in] pSrc points to the input vector @@ -159,6 +181,22 @@ extern "C" float32_t * pDst, uint32_t blockSize); + + +/** + @brief Floating-point vector of exp values. + @param[in] pSrc points to the input vector + @param[out] pDst points to the output vector + @param[in] blockSize number of samples in each vector + @return none + */ + void arm_vexp_f64( + const float64_t * pSrc, + float64_t * pDst, + uint32_t blockSize); + + + /** * @defgroup SQRT Square Root * @@ -194,7 +232,7 @@ extern "C" - \ref ARM_MATH_ARGUMENT_ERROR : input value is negative; *pOut is set to 0 */ __STATIC_FORCEINLINE arm_status arm_sqrt_f32( - float32_t in, + const float32_t in, float32_t * pOut) { if (in >= 0.0f) @@ -252,33 +290,75 @@ arm_status arm_sqrt_q15( q15_t in, q15_t * pOut); + + /** - * @brief Vector Floating-point square root function. - * @param[in] pIn input vector. - * @param[out] pOut vector of square roots of input elements. - * @param[in] len length of input vector. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. + * @} end of SQRT group */ - void arm_vsqrt_f32( - float32_t * pIn, - float32_t * pOut, - uint16_t len); - void arm_vsqrt_q31( - q31_t * pIn, - q31_t * pOut, - uint16_t len); + /** + @brief Fixed point division + @param[in] numerator Numerator + @param[in] denominator Denominator + @param[out] quotient Quotient value normalized between -1.0 and 1.0 + @param[out] shift Shift left value to get the unnormalized quotient + @return error status + + When dividing by 0, an error ARM_MATH_NANINF is returned. And the quotient is forced + to the saturated negative or positive value. + */ - void arm_vsqrt_q15( - q15_t * pIn, - q15_t * pOut, - uint16_t len); +arm_status arm_divide_q15(q15_t numerator, + q15_t denominator, + q15_t *quotient, + int16_t *shift); /** - * @} end of SQRT group + @brief Fixed point division + @param[in] numerator Numerator + @param[in] denominator Denominator + @param[out] quotient Quotient value normalized between -1.0 and 1.0 + @param[out] shift Shift left value to get the unnormalized quotient + @return error status + + When dividing by 0, an error ARM_MATH_NANINF is returned. And the quotient is forced + to the saturated negative or positive value. + */ + +arm_status arm_divide_q31(q31_t numerator, + q31_t denominator, + q31_t *quotient, + int16_t *shift); + + + + /** + @brief Arc tangent in radian of y/x using sign of x and y to determine right quadrant. + @param[in] y y coordinate + @param[in] x x coordinate + @param[out] result Result + @return error status. + */ + arm_status arm_atan2_f32(float32_t y,float32_t x,float32_t *result); + + + /** + @brief Arc tangent in radian of y/x using sign of x and y to determine right quadrant. + @param[in] y y coordinate + @param[in] x x coordinate + @param[out] result Result in Q2.29 + @return error status. */ + arm_status arm_atan2_q31(q31_t y,q31_t x,q31_t *result); + /** + @brief Arc tangent in radian of y/x using sign of x and y to determine right quadrant. + @param[in] y y coordinate + @param[in] x x coordinate + @param[out] result Result in Q2.13 + @return error status. + */ + arm_status arm_atan2_q15(q15_t y,q15_t x,q15_t *result); #ifdef __cplusplus } diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions_f16.h index 3be576e..c97ec64 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions_f16.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file fast_math_functions_f16.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -107,6 +108,15 @@ __STATIC_FORCEINLINE arm_status arm_sqrt_f16( float16_t * pDst, uint32_t blockSize); + /** + @brief Arc tangent in radian of y/x using sign of x and y to determine right quadrant. + @param[in] y y coordinate + @param[in] x x coordinate + @param[out] result Result + @return error status. + */ + arm_status arm_atan2_f16(float16_t y,float16_t x,float16_t *result); + #endif /*defined(ARM_FLOAT16_SUPPORTED)*/ #ifdef __cplusplus } diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/filtering_functions.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/filtering_functions.h index 4d41606..38a40ba 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/filtering_functions.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/filtering_functions.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file filtering_functions.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -33,6 +34,7 @@ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/utils.h" #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/support_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" #ifdef __cplusplus extern "C" @@ -88,6 +90,16 @@ extern "C" const float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ } arm_fir_instance_f32; + /** + * @brief Instance structure for the floating-point FIR filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of filter coefficients in the filter. */ + float64_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + const float64_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + } arm_fir_instance_f64; + /** * @brief Processing function for the Q7 FIR filter. * @param[in] S points to an instance of the Q7 FIR filter structure. @@ -224,6 +236,19 @@ extern "C" float32_t * pDst, uint32_t blockSize); + /** + * @brief Processing function for the floating-point FIR filter. + * @param[in] S points to an instance of the floating-point FIR structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + */ + void arm_fir_f64( + const arm_fir_instance_f64 * S, + const float64_t * pSrc, + float64_t * pDst, + uint32_t blockSize); + /** * @brief Initialization function for the floating-point FIR filter. * @param[in,out] S points to an instance of the floating-point FIR filter structure. @@ -239,6 +264,21 @@ extern "C" float32_t * pState, uint32_t blockSize); + /** + * @brief Initialization function for the floating-point FIR filter. + * @param[in,out] S points to an instance of the floating-point FIR filter structure. + * @param[in] numTaps Number of filter coefficients in the filter. + * @param[in] pCoeffs points to the filter coefficients. + * @param[in] pState points to the state buffer. + * @param[in] blockSize number of samples that are processed at a time. + */ + void arm_fir_init_f64( + arm_fir_instance_f64 * S, + uint16_t numTaps, + const float64_t * pCoeffs, + float64_t * pState, + uint32_t blockSize); + /** * @brief Instance structure for the Q15 Biquad cascade filter. */ @@ -1171,10 +1211,17 @@ arm_status arm_fir_decimate_init_f32( #if defined(ARM_MATH_NEON) +/** + @brief Compute new coefficient arrays for use in vectorized filter (Neon only). + @param[in] numStages number of 2nd order stages in the filter. + @param[in] pCoeffs points to the original filter coefficients. + @param[in] pComputedCoeffs points to the new computed coefficients for the vectorized version. + @return none +*/ void arm_biquad_cascade_df2T_compute_coefs_f32( - arm_biquad_cascade_df2T_instance_f32 * S, uint8_t numStages, - float32_t * pCoeffs); + const float32_t * pCoeffs, + float32_t * pComputedCoeffs); #endif /** * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. @@ -1787,6 +1834,22 @@ void arm_biquad_cascade_df2T_compute_coefs_f32( float32_t * pDst); + /** + * @brief Correlation of floating-point sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. + */ + void arm_correlate_f64( + const float64_t * pSrcA, + uint32_t srcALen, + const float64_t * pSrcB, + uint32_t srcBLen, + float64_t * pDst); + + /** @brief Correlation of Q15 sequences @param[in] pSrcA points to the first input sequence @@ -2432,8 +2495,33 @@ void arm_correlate_fast_q31( } +/** + @brief Levinson Durbin + @param[in] phi autocovariance vector starting with lag 0 (length is nbCoefs + 1) + @param[out] a autoregressive coefficients + @param[out] err prediction error (variance) + @param[in] nbCoefs number of autoregressive coefficients + @return none + */ +void arm_levinson_durbin_f32(const float32_t *phi, + float32_t *a, + float32_t *err, + int nbCoefs); + + +/** + @brief Levinson Durbin + @param[in] phi autocovariance vector starting with lag 0 (length is nbCoefs + 1) + @param[out] a autoregressive coefficients + @param[out] err prediction error (variance) + @param[in] nbCoefs number of autoregressive coefficients + @return none + */ +void arm_levinson_durbin_q31(const q31_t *phi, + q31_t *a, + q31_t *err, + int nbCoefs); - #ifdef __cplusplus } #endif diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/filtering_functions_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/filtering_functions_f16.h index 9abb53a..21f33f4 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/filtering_functions_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/filtering_functions_f16.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file filtering_functions_f16.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -214,6 +215,20 @@ extern "C" uint32_t srcBLen, float16_t * pDst); + +/** + @brief Levinson Durbin + @param[in] phi autocovariance vector starting with lag 0 (length is nbCoefs + 1) + @param[out] a autoregressive coefficients + @param[out] err prediction error (variance) + @param[in] nbCoefs number of autoregressive coefficients + @return none + */ +void arm_levinson_durbin_f16(const float16_t *phi, + float16_t *a, + float16_t *err, + int nbCoefs); + #endif /*defined(ARM_FLOAT16_SUPPORTED)*/ #ifdef __cplusplus } diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/interpolation_functions.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/interpolation_functions.h index e7cf537..a650fe8 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/interpolation_functions.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/interpolation_functions.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file interpolation_functions.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -120,18 +121,6 @@ extern "C" } arm_spline_instance_f32; - - - /** - * @ingroup groupInterpolation - */ - - /** - * @addtogroup SplineInterpolate - * @{ - */ - - /** * @brief Processing function for the floating-point cubic spline interpolation. * @param[in] S points to an instance of the floating-point spline structure. @@ -165,18 +154,7 @@ extern "C" float32_t * tempBuffer); - /** - * @} end of SplineInterpolate group - */ - - - - /** - * @addtogroup LinearInterpolate - * @{ - */ - - /** + /** * @brief Process function for the floating-point Linear Interpolation Function. * @param[in,out] S is an instance of the floating-point Linear Interpolation structure * @param[in] x input sample to process @@ -201,7 +179,7 @@ extern "C" * */ q31_t arm_linear_interp_q31( - q31_t * pYData, + const q31_t * pYData, q31_t x, uint32_t nValues); @@ -219,7 +197,7 @@ extern "C" * */ q15_t arm_linear_interp_q15( - q15_t * pYData, + const q15_t * pYData, q31_t x, uint32_t nValues); @@ -236,27 +214,10 @@ extern "C" * This function can support maximum of table size 2^12. */ q7_t arm_linear_interp_q7( - q7_t * pYData, + const q7_t * pYData, q31_t x, uint32_t nValues); - /** - * @} end of LinearInterpolate group - */ - - - - - /** - * @ingroup groupInterpolation - */ - - - /** - * @addtogroup BilinearInterpolate - * @{ - */ - /** * @brief Floating-point bilinear interpolation. * @param[in,out] S points to an instance of the interpolation structure. @@ -305,10 +266,6 @@ q7_t arm_linear_interp_q7( arm_bilinear_interp_instance_q7 * S, q31_t X, q31_t Y); - /** - * @} end of BilinearInterpolate group - */ - #ifdef __cplusplus diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/interpolation_functions_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/interpolation_functions_f16.h index 46abd32..227ecb0 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/interpolation_functions_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/interpolation_functions_f16.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file interpolation_functions_f16.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h index e5dce74..9bab8e6 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file matrix_functions.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -108,6 +109,9 @@ extern "C" * return ARM_MATH_SUCCESS. */ + #define DEFAULT_HOUSEHOLDER_THRESHOLD_F64 (1.0e-16) + #define DEFAULT_HOUSEHOLDER_THRESHOLD_F32 (1.0e-12f) + /** * @brief Instance structure for the floating-point matrix structure. */ @@ -443,6 +447,21 @@ arm_status arm_mat_mult_q31( const arm_matrix_instance_q31 * pSrcB, arm_matrix_instance_q31 * pDst); + /** + * @brief Q31 matrix multiplication + * @param[in] pSrcA points to the first input matrix structure + * @param[in] pSrcB points to the second input matrix structure + * @param[out] pDst points to output matrix structure + * @param[in] pState points to the array for storing intermediate results + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ +arm_status arm_mat_mult_opt_q31( + const arm_matrix_instance_q31 * pSrcA, + const arm_matrix_instance_q31 * pSrcB, + arm_matrix_instance_q31 * pDst, + q31_t *pState); + /** * @brief Q31 matrix and vector multiplication * @param[in] pSrcMat points to the input matrix structure @@ -734,6 +753,88 @@ void arm_mat_init_f32( arm_matrix_instance_f64 * d, uint16_t * pp); +/** + @brief QR decomposition of a m x n floating point matrix with m >= n. + @param[in] pSrc points to input matrix structure. The source matrix is modified by the function. + @param[in] threshold norm2 threshold. + @param[out] pOutR points to output R matrix structure of dimension m x n + @param[out] pOutQ points to output Q matrix structure of dimension m x m + @param[out] pOutTau points to Householder scaling factors of dimension n + @param[inout] pTmpA points to a temporary vector of dimension m. + @param[inout] pTmpB points to a temporary vector of dimension n. + @return execution status + - \ref ARM_MATH_SUCCESS : Operation successful + - \ref ARM_MATH_SIZE_MISMATCH : Matrix size check failed + - \ref ARM_MATH_SINGULAR : Input matrix is found to be singular (non-invertible) + */ + +arm_status arm_mat_qr_f32( + const arm_matrix_instance_f32 * pSrc, + const float32_t threshold, + arm_matrix_instance_f32 * pOutR, + arm_matrix_instance_f32 * pOutQ, + float32_t * pOutTau, + float32_t *pTmpA, + float32_t *pTmpB + ); + +/** + @brief QR decomposition of a m x n floating point matrix with m >= n. + @param[in] pSrc points to input matrix structure. The source matrix is modified by the function. + @param[in] threshold norm2 threshold. + @param[out] pOutR points to output R matrix structure of dimension m x n + @param[out] pOutQ points to output Q matrix structure of dimension m x m + @param[out] pOutTau points to Householder scaling factors of dimension n + @param[inout] pTmpA points to a temporary vector of dimension m. + @param[inout] pTmpB points to a temporary vector of dimension n. + @return execution status + - \ref ARM_MATH_SUCCESS : Operation successful + - \ref ARM_MATH_SIZE_MISMATCH : Matrix size check failed + - \ref ARM_MATH_SINGULAR : Input matrix is found to be singular (non-invertible) + */ + +arm_status arm_mat_qr_f64( + const arm_matrix_instance_f64 * pSrc, + const float64_t threshold, + arm_matrix_instance_f64 * pOutR, + arm_matrix_instance_f64 * pOutQ, + float64_t * pOutTau, + float64_t *pTmpA, + float64_t *pTmpB + ); + +/** + @brief Householder transform of a floating point vector. + @param[in] pSrc points to the input vector. + @param[in] threshold norm2 threshold. + @param[in] blockSize dimension of the vector space. + @param[outQ] pOut points to the output vector. + @return beta return the scaling factor beta + */ + +float32_t arm_householder_f32( + const float32_t * pSrc, + const float32_t threshold, + uint32_t blockSize, + float32_t * pOut + ); + +/** + @brief Householder transform of a double floating point vector. + @param[in] pSrc points to the input vector. + @param[in] threshold norm2 threshold. + @param[in] blockSize dimension of the vector space. + @param[outQ] pOut points to the output vector. + @return beta return the scaling factor beta + */ + +float64_t arm_householder_f64( + const float64_t * pSrc, + const float64_t threshold, + uint32_t blockSize, + float64_t * pOut + ); + #ifdef __cplusplus } #endif diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions_f16.h index 0bc32b9..3f54651 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions_f16.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file matrix_functions_f16.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -40,6 +41,8 @@ extern "C" #if defined(ARM_FLOAT16_SUPPORTED) + #define DEFAULT_HOUSEHOLDER_THRESHOLD_F16 (1.0e-3f) + /** * @brief Instance structure for the floating-point matrix structure. */ @@ -211,6 +214,46 @@ void arm_mat_init_f16( arm_matrix_instance_f16 * dst); +/** + @brief QR decomposition of a m x n floating point matrix with m >= n. + @param[in] pSrc points to input matrix structure. The source matrix is modified by the function. + @param[in] threshold norm2 threshold. + @param[out] pOutR points to output R matrix structure of dimension m x n + @param[out] pOutQ points to output Q matrix structure of dimension m x m + @param[out] pOutTau points to Householder scaling factors of dimension n + @param[inout] pTmpA points to a temporary vector of dimension m. + @param[inout] pTmpB points to a temporary vector of dimension n. + @return execution status + - \ref ARM_MATH_SUCCESS : Operation successful + - \ref ARM_MATH_SIZE_MISMATCH : Matrix size check failed + - \ref ARM_MATH_SINGULAR : Input matrix is found to be singular (non-invertible) + */ + +arm_status arm_mat_qr_f16( + const arm_matrix_instance_f16 * pSrc, + const float16_t threshold, + arm_matrix_instance_f16 * pOutR, + arm_matrix_instance_f16 * pOutQ, + float16_t * pOutTau, + float16_t *pTmpA, + float16_t *pTmpB + ); + +/** + @brief Householder transform of a half floating point vector. + @param[in] pSrc points to the input vector. + @param[in] threshold norm2 threshold. + @param[in] blockSize dimension of the vector space. + @param[outQ] pOut points to the output vector. + @return beta return the scaling factor beta + */ + +float16_t arm_householder_f16( + const float16_t * pSrc, + const float16_t threshold, + uint32_t blockSize, + float16_t * pOut + ); #endif /*defined(ARM_FLOAT16_SUPPORTED)*/ #ifdef __cplusplus diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h new file mode 100644 index 0000000..5b0f55d --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h @@ -0,0 +1,640 @@ +/****************************************************************************** + * @file matrix_utils.h + * @brief Public header file for CMSIS DSP Library + * @version V1.11.0 + * @date 30 May 2022 + * Target Processor: Cortex-M and Cortex-A cores + ******************************************************************************/ +/* + * Copyright (c) 2010-2022 Arm Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef _MATRIX_UTILS_H_ +#define _MATRIX_UTILS_H_ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_math_memory.h" + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/none.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/utils.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define ELEM(A,ROW,COL) &((A)->pData[(A)->numCols* (ROW) + (COL)]) + +#define SCALE_COL_T(T,CAST,A,ROW,v,i) \ +{ \ + int32_t w; \ + T *data = (A)->pData; \ + const int32_t numCols = (A)->numCols; \ + const int32_t nb = (A)->numRows - ROW;\ + \ + data += i + numCols * (ROW); \ + \ + for(w=0;w < nb; w++) \ + { \ + *data *= CAST v; \ + data += numCols; \ + } \ +} + +#define COPY_COL_T(T,A,ROW,COL,DST) \ +{ \ + uint32_t row; \ + T *pb=DST; \ + T *pa = (A)->pData + ROW * (A)->numCols + COL;\ + for(row = ROW; row < (A)->numRows; row ++) \ + { \ + *pb++ = *pa; \ + pa += (A)->numCols; \ + } \ +} + +#if defined(ARM_FLOAT16_SUPPORTED) +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) + +#define SWAP_ROWS_F16(A,COL,i,j) \ + { \ + int cnt = ((A)->numCols)-(COL); \ + int32_t w; \ + float16_t *data = (A)->pData; \ + const int32_t numCols = (A)->numCols; \ + \ + for(w=(COL);w < numCols; w+=8) \ + { \ + f16x8_t tmpa,tmpb; \ + mve_pred16_t p0 = vctp16q(cnt); \ + \ + tmpa=vldrhq_z_f16(&data[i*numCols + w],p0);\ + tmpb=vldrhq_z_f16(&data[j*numCols + w],p0);\ + \ + vstrhq_p(&data[i*numCols + w], tmpb, p0); \ + vstrhq_p(&data[j*numCols + w], tmpa, p0); \ + \ + cnt -= 8; \ + } \ + } + +#define SCALE_ROW_F16(A,COL,v,i) \ +{ \ + int cnt = ((A)->numCols)-(COL); \ + int32_t w; \ + float16_t *data = (A)->pData; \ + const int32_t numCols = (A)->numCols; \ + \ + for(w=(COL);w < numCols; w+=8) \ + { \ + f16x8_t tmpa; \ + mve_pred16_t p0 = vctp16q(cnt); \ + tmpa = vldrhq_z_f16(&data[i*numCols + w],p0);\ + tmpa = vmulq_n_f16(tmpa,(_Float16)v); \ + vstrhq_p(&data[i*numCols + w], tmpa, p0); \ + cnt -= 8; \ + } \ + \ +} + +#define MAC_ROW_F16(COL,A,i,v,B,j) \ +{ \ + int cnt = ((A)->numCols)-(COL); \ + int32_t w; \ + float16_t *dataA = (A)->pData; \ + float16_t *dataB = (B)->pData; \ + const int32_t numCols = (A)->numCols; \ + \ + for(w=(COL);w < numCols; w+=8) \ + { \ + f16x8_t tmpa,tmpb; \ + mve_pred16_t p0 = vctp16q(cnt); \ + tmpa = vldrhq_z_f16(&dataA[i*numCols + w],p0);\ + tmpb = vldrhq_z_f16(&dataB[j*numCols + w],p0);\ + tmpa = vfmaq_n_f16(tmpa,tmpb,v); \ + vstrhq_p(&dataA[i*numCols + w], tmpa, p0); \ + cnt -= 8; \ + } \ + \ +} + +#define MAS_ROW_F16(COL,A,i,v,B,j) \ +{ \ + int cnt = ((A)->numCols)-(COL); \ + int32_t w; \ + float16_t *dataA = (A)->pData; \ + float16_t *dataB = (B)->pData; \ + const int32_t numCols = (A)->numCols; \ + f16x8_t vec=vdupq_n_f16(v); \ + \ + for(w=(COL);w < numCols; w+=8) \ + { \ + f16x8_t tmpa,tmpb; \ + mve_pred16_t p0 = vctp16q(cnt); \ + tmpa = vldrhq_z_f16(&dataA[i*numCols + w],p0);\ + tmpb = vldrhq_z_f16(&dataB[j*numCols + w],p0);\ + tmpa = vfmsq_f16(tmpa,tmpb,vec); \ + vstrhq_p(&dataA[i*numCols + w], tmpa, p0); \ + cnt -= 8; \ + } \ + \ +} + +#else + + +#define SWAP_ROWS_F16(A,COL,i,j) \ +{ \ + int32_t w; \ + float16_t *dataI = (A)->pData; \ + float16_t *dataJ = (A)->pData; \ + const int32_t numCols = (A)->numCols;\ + const int32_t nb = numCols-(COL); \ + \ + dataI += i*numCols + (COL); \ + dataJ += j*numCols + (COL); \ + \ + for(w=0;w < nb; w++) \ + { \ + float16_t tmp; \ + tmp = *dataI; \ + *dataI++ = *dataJ; \ + *dataJ++ = tmp; \ + } \ +} + +#define SCALE_ROW_F16(A,COL,v,i) \ +{ \ + int32_t w; \ + float16_t *data = (A)->pData; \ + const int32_t numCols = (A)->numCols;\ + const int32_t nb = numCols-(COL); \ + \ + data += i*numCols + (COL); \ + \ + for(w=0;w < nb; w++) \ + { \ + *data++ *= (_Float16)v; \ + } \ +} + + +#define MAC_ROW_F16(COL,A,i,v,B,j) \ +{ \ + int32_t w; \ + float16_t *dataA = (A)->pData; \ + float16_t *dataB = (B)->pData; \ + const int32_t numCols = (A)->numCols; \ + const int32_t nb = numCols-(COL); \ + \ + dataA += i*numCols + (COL); \ + dataB += j*numCols + (COL); \ + \ + for(w=0;w < nb; w++) \ + { \ + *dataA++ += (_Float16)v * (_Float16)*dataB++;\ + } \ +} + +#define MAS_ROW_F16(COL,A,i,v,B,j) \ +{ \ + int32_t w; \ + float16_t *dataA = (A)->pData; \ + float16_t *dataB = (B)->pData; \ + const int32_t numCols = (A)->numCols; \ + const int32_t nb = numCols-(COL); \ + \ + dataA += i*numCols + (COL); \ + dataB += j*numCols + (COL); \ + \ + for(w=0;w < nb; w++) \ + { \ + *dataA++ -= (_Float16)v * (_Float16)*dataB++;\ + } \ +} + +#endif /*defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE)*/ + +/* Functions with only a scalar version */ +#define COPY_COL_F16(A,ROW,COL,DST) \ + COPY_COL_T(float16_t,A,ROW,COL,DST) + +#define SCALE_COL_F16(A,ROW,v,i) \ + SCALE_COL_T(float16_t,(_Float16),A,ROW,v,i) + +#endif /* defined(ARM_FLOAT16_SUPPORTED)*/ + +#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) + +#define SWAP_ROWS_F32(A,COL,i,j) \ + { \ + int cnt = ((A)->numCols)-(COL); \ + float32_t *data = (A)->pData; \ + const int32_t numCols = (A)->numCols; \ + int32_t w; \ + \ + for(w=(COL);w < numCols; w+=4) \ + { \ + f32x4_t tmpa,tmpb; \ + mve_pred16_t p0 = vctp32q(cnt); \ + \ + tmpa=vldrwq_z_f32(&data[i*numCols + w],p0);\ + tmpb=vldrwq_z_f32(&data[j*numCols + w],p0);\ + \ + vstrwq_p(&data[i*numCols + w], tmpb, p0); \ + vstrwq_p(&data[j*numCols + w], tmpa, p0); \ + \ + cnt -= 4; \ + } \ + } + +#define MAC_ROW_F32(COL,A,i,v,B,j) \ +{ \ + int cnt = ((A)->numCols)-(COL); \ + float32_t *dataA = (A)->pData; \ + float32_t *dataB = (B)->pData; \ + const int32_t numCols = (A)->numCols; \ + int32_t w; \ + \ + for(w=(COL);w < numCols; w+=4) \ + { \ + f32x4_t tmpa,tmpb; \ + mve_pred16_t p0 = vctp32q(cnt); \ + tmpa = vldrwq_z_f32(&dataA[i*numCols + w],p0);\ + tmpb = vldrwq_z_f32(&dataB[j*numCols + w],p0);\ + tmpa = vfmaq_n_f32(tmpa,tmpb,v); \ + vstrwq_p(&dataA[i*numCols + w], tmpa, p0); \ + cnt -= 4; \ + } \ + \ +} + +#define MAS_ROW_F32(COL,A,i,v,B,j) \ +{ \ + int cnt = ((A)->numCols)-(COL); \ + float32_t *dataA = (A)->pData; \ + float32_t *dataB = (B)->pData; \ + const int32_t numCols = (A)->numCols; \ + int32_t w; \ + f32x4_t vec=vdupq_n_f32(v); \ + \ + for(w=(COL);w < numCols; w+=4) \ + { \ + f32x4_t tmpa,tmpb; \ + mve_pred16_t p0 = vctp32q(cnt); \ + tmpa = vldrwq_z_f32(&dataA[i*numCols + w],p0);\ + tmpb = vldrwq_z_f32(&dataB[j*numCols + w],p0);\ + tmpa = vfmsq_f32(tmpa,tmpb,vec); \ + vstrwq_p(&dataA[i*numCols + w], tmpa, p0); \ + cnt -= 4; \ + } \ + \ +} + +#define SCALE_ROW_F32(A,COL,v,i) \ +{ \ + int cnt = ((A)->numCols)-(COL); \ + float32_t *data = (A)->pData; \ + const int32_t numCols = (A)->numCols; \ + int32_t w; \ + \ + for(w=(COL);w < numCols; w+=4) \ + { \ + f32x4_t tmpa; \ + mve_pred16_t p0 = vctp32q(cnt); \ + tmpa = vldrwq_z_f32(&data[i*numCols + w],p0);\ + tmpa = vmulq_n_f32(tmpa,v); \ + vstrwq_p(&data[i*numCols + w], tmpa, p0); \ + cnt -= 4; \ + } \ + \ +} + +#elif defined(ARM_MATH_NEON) && !defined(ARM_MATH_AUTOVECTORIZE) + +#define SWAP_ROWS_F32(A,COL,i,j) \ +{ \ + int32_t w; \ + float32_t *dataI = (A)->pData; \ + float32_t *dataJ = (A)->pData; \ + const int32_t numCols = (A)->numCols;\ + const int32_t nb = numCols - COL; \ + \ + dataI += i*numCols + (COL); \ + dataJ += j*numCols + (COL); \ + \ + float32_t tmp; \ + \ + for(w=0;w < nb; w++) \ + { \ + tmp = *dataI; \ + *dataI++ = *dataJ; \ + *dataJ++ = tmp; \ + } \ +} + +#define MAC_ROW_F32(COL,A,i,v,B,j) \ +{ \ + float32_t *dataA = (A)->pData; \ + float32_t *dataB = (B)->pData; \ + const int32_t numCols = (A)->numCols;\ + const int32_t nb = numCols - (COL); \ + int32_t nbElems; \ + f32x4_t vec = vdupq_n_f32(v); \ + \ + nbElems = nb >> 2; \ + \ + dataA += i*numCols + (COL); \ + dataB += j*numCols + (COL); \ + \ + while(nbElems>0) \ + { \ + f32x4_t tmpa,tmpb; \ + tmpa = vld1q_f32(dataA,p0); \ + tmpb = vld1q_f32(dataB,p0); \ + tmpa = vmlaq_f32(tmpa,tmpb,vec);\ + vst1q_f32(dataA, tmpa, p0); \ + nbElems--; \ + dataA += 4; \ + dataB += 4; \ + } \ + \ + nbElems = nb & 3; \ + while(nbElems > 0) \ + { \ + *dataA++ += v* *dataB++; \ + nbElems--; \ + } \ +} + +#define MAS_ROW_F32(COL,A,i,v,B,j) \ +{ \ + float32_t *dataA = (A)->pData; \ + float32_t *dataB = (B)->pData; \ + const int32_t numCols = (A)->numCols;\ + const int32_t nb = numCols - (COL); \ + int32_t nbElems; \ + f32x4_t vec = vdupq_n_f32(v); \ + \ + nbElems = nb >> 2; \ + \ + dataA += i*numCols + (COL); \ + dataB += j*numCols + (COL); \ + \ + while(nbElems>0) \ + { \ + f32x4_t tmpa,tmpb; \ + tmpa = vld1q_f32(dataA); \ + tmpb = vld1q_f32(dataB); \ + tmpa = vmlsq_f32(tmpa,tmpb,vec);\ + vst1q_f32(dataA, tmpa); \ + nbElems--; \ + dataA += 4; \ + dataB += 4; \ + } \ + \ + nbElems = nb & 3; \ + while(nbElems > 0) \ + { \ + *dataA++ -= v* *dataB++; \ + nbElems--; \ + } \ +} + +#define SCALE_ROW_F32(A,COL,v,i) \ +{ \ + float32_t *data = (A)->pData; \ + const int32_t numCols = (A)->numCols; \ + const int32_t nb = numCols - (COL); \ + int32_t nbElems; \ + f32x4_t vec = vdupq_n_f32(v); \ + \ + nbElems = nb >> 2; \ + \ + data += i*numCols + (COL); \ + while(nbElems>0) \ + { \ + f32x4_t tmpa; \ + tmpa = vld1q_f32(data); \ + tmpa = vmulq_f32(tmpa,vec); \ + vst1q_f32(data, tmpa); \ + data += 4; \ + nbElems --; \ + } \ + \ + nbElems = nb & 3; \ + while(nbElems > 0) \ + { \ + *data++ *= v; \ + nbElems--; \ + } \ + \ +} + +#else + +#define SWAP_ROWS_F32(A,COL,i,j) \ +{ \ + int32_t w; \ + float32_t tmp; \ + float32_t *dataI = (A)->pData; \ + float32_t *dataJ = (A)->pData; \ + const int32_t numCols = (A)->numCols;\ + const int32_t nb = numCols - COL; \ + \ + dataI += i*numCols + (COL); \ + dataJ += j*numCols + (COL); \ + \ + \ + for(w=0;w < nb; w++) \ + { \ + tmp = *dataI; \ + *dataI++ = *dataJ; \ + *dataJ++ = tmp; \ + } \ +} + +#define SCALE_ROW_F32(A,COL,v,i) \ +{ \ + int32_t w; \ + float32_t *data = (A)->pData; \ + const int32_t numCols = (A)->numCols;\ + const int32_t nb = numCols - COL; \ + \ + data += i*numCols + (COL); \ + \ + for(w=0;w < nb; w++) \ + { \ + *data++ *= v; \ + } \ +} + + +#define MAC_ROW_F32(COL,A,i,v,B,j) \ +{ \ + int32_t w; \ + float32_t *dataA = (A)->pData; \ + float32_t *dataB = (B)->pData; \ + const int32_t numCols = (A)->numCols;\ + const int32_t nb = numCols-(COL); \ + \ + dataA = dataA + i*numCols + (COL); \ + dataB = dataB + j*numCols + (COL); \ + \ + for(w=0;w < nb; w++) \ + { \ + *dataA++ += v* *dataB++; \ + } \ +} + +#define MAS_ROW_F32(COL,A,i,v,B,j) \ +{ \ + int32_t w; \ + float32_t *dataA = (A)->pData; \ + float32_t *dataB = (B)->pData; \ + const int32_t numCols = (A)->numCols;\ + const int32_t nb = numCols-(COL); \ + \ + dataA = dataA + i*numCols + (COL); \ + dataB = dataB + j*numCols + (COL); \ + \ + for(w=0;w < nb; w++) \ + { \ + *dataA++ -= v* *dataB++; \ + } \ +} + +#endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ + + +/* Functions with only a scalar version */ + +#define COPY_COL_F32(A,ROW,COL,DST) \ + COPY_COL_T(float32_t,A,ROW,COL,DST) + +#define COPY_COL_F64(A,ROW,COL,DST) \ + COPY_COL_T(float64_t,A,ROW,COL,DST) + +#define SWAP_COLS_F32(A,COL,i,j) \ +{ \ + int32_t w; \ + float32_t *data = (A)->pData; \ + const int32_t numCols = (A)->numCols; \ + for(w=(COL);w < numCols; w++) \ + { \ + float32_t tmp; \ + tmp = data[w*numCols + i]; \ + data[w*numCols + i] = data[w*numCols + j];\ + data[w*numCols + j] = tmp; \ + } \ +} + +#define SCALE_COL_F32(A,ROW,v,i) \ + SCALE_COL_T(float32_t,,A,ROW,v,i) + +#define SWAP_ROWS_F64(A,COL,i,j) \ +{ \ + int32_t w; \ + float64_t *dataI = (A)->pData; \ + float64_t *dataJ = (A)->pData; \ + const int32_t numCols = (A)->numCols;\ + const int32_t nb = numCols-(COL); \ + \ + dataI += i*numCols + (COL); \ + dataJ += j*numCols + (COL); \ + \ + for(w=0;w < nb; w++) \ + { \ + float64_t tmp; \ + tmp = *dataI; \ + *dataI++ = *dataJ; \ + *dataJ++ = tmp; \ + } \ +} + +#define SWAP_COLS_F64(A,COL,i,j) \ +{ \ + int32_t w; \ + float64_t *data = (A)->pData; \ + const int32_t numCols = (A)->numCols; \ + for(w=(COL);w < numCols; w++) \ + { \ + float64_t tmp; \ + tmp = data[w*numCols + i]; \ + data[w*numCols + i] = data[w*numCols + j];\ + data[w*numCols + j] = tmp; \ + } \ +} + +#define SCALE_ROW_F64(A,COL,v,i) \ +{ \ + int32_t w; \ + float64_t *data = (A)->pData; \ + const int32_t numCols = (A)->numCols;\ + const int32_t nb = numCols-(COL); \ + \ + data += i*numCols + (COL); \ + \ + for(w=0;w < nb; w++) \ + { \ + *data++ *= v; \ + } \ +} + +#define SCALE_COL_F64(A,ROW,v,i) \ + SCALE_COL_T(float64_t,,A,ROW,v,i) + +#define MAC_ROW_F64(COL,A,i,v,B,j) \ +{ \ + int32_t w; \ + float64_t *dataA = (A)->pData; \ + float64_t *dataB = (B)->pData; \ + const int32_t numCols = (A)->numCols;\ + const int32_t nb = numCols-(COL); \ + \ + dataA += i*numCols + (COL); \ + dataB += j*numCols + (COL); \ + \ + for(w=0;w < nb; w++) \ + { \ + *dataA++ += v* *dataB++; \ + } \ +} + +#define MAS_ROW_F64(COL,A,i,v,B,j) \ +{ \ + int32_t w; \ + float64_t *dataA = (A)->pData; \ + float64_t *dataB = (B)->pData; \ + const int32_t numCols = (A)->numCols;\ + const int32_t nb = numCols-(COL); \ + \ + dataA += i*numCols + (COL); \ + dataB += j*numCols + (COL); \ + \ + for(w=0;w < nb; w++) \ + { \ + *dataA++ -= v* *dataB++; \ + } \ +} + +#ifdef __cplusplus +} +#endif + +#endif /* ifndef _MATRIX_UTILS_H_ */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/none.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/none.h index 332d3bd..1e36a51 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/none.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/none.h @@ -59,7 +59,7 @@ MSVC is not going to be used to cross-compile to ARM. So, having a MSVC compiler file in Core or Core_A would not make sense. */ -#if defined ( _MSC_VER ) || defined(__GNUC_PYTHON__) +#if defined ( _MSC_VER ) || defined(__GNUC_PYTHON__) || defined(__APPLE_CC__) __STATIC_FORCEINLINE uint8_t __CLZ(uint32_t data) { if (data == 0U) { return 32U; } @@ -215,6 +215,7 @@ __STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) #define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \ (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) ) + #define __SXTAB16_RORn(ARG1, ARG2, ARG3) __SXTAB16(ARG1, __ROR(ARG2, ARG3)) /* * @brief C custom defined SADD16 (by Edge Impulse) @@ -584,10 +585,11 @@ __STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) { return (sum + (int32_t) (((int64_t) x * y) >> 32)); } - +#if defined ( _MSC_VER ) || defined(__GNUC_PYTHON__) || defined(__APPLE_CC__) // Rotate right, dual extract 8-bits and sign extend each to 16-bits. // rotate value must be 8,16 or 24 // Patched by Edge Impulse to polyfill x86 support + // Patched by Edge Impulse for IAR Workbench __STATIC_FORCEINLINE uint32_t __SXTB16_RORn(uint32_t val1, uint32_t rotate) { uint32_t ret; @@ -601,7 +603,7 @@ __STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) ret |= ((uint32_t)a16 & 0xffff); return ret; } - +#endif // Dual sign-extended 8 to 16-bit addition // Patched by Edge Impulse to polyfill x86 support __STATIC_FORCEINLINE uint32_t __SXTAB16(uint32_t val1, uint32_t val2) diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/quaternion_math_functions.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/quaternion_math_functions.h index e7d08e9..8192cd8 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/quaternion_math_functions.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/quaternion_math_functions.h @@ -1,6 +1,10 @@ /****************************************************************************** * @file quaternion_math_functions.h * @brief Public header file for CMSIS DSP Library + * @version V1.10.0 + * @date 08 July 2021 + * + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2021 Arm Limited or its affiliates. All rights reserved. diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h index 337057a..866e467 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file statistics_functions.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.1 + * @date 14 July 2022 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -169,6 +170,18 @@ float64_t arm_kullback_leibler_f64(const float64_t * pSrcA, float32_t * pResult); + /** + * @brief Sum of the squares of the elements of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_power_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult); + + /** * @brief Sum of the squares of the elements of a Q15 vector. * @param[in] pSrc is input pointer @@ -241,6 +254,18 @@ float64_t arm_kullback_leibler_f64(const float64_t * pSrcA, float32_t * pResult); + /** + * @brief Mean value of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_mean_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult); + + /** * @brief Variance of the elements of a floating-point vector. * @param[in] pSrc is input pointer @@ -253,6 +278,18 @@ float64_t arm_kullback_leibler_f64(const float64_t * pSrcA, float32_t * pResult); + /** + * @brief Variance of the elements of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_var_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult); + + /** * @brief Variance of the elements of a Q31 vector. * @param[in] pSrc is input pointer @@ -325,6 +362,18 @@ float64_t arm_kullback_leibler_f64(const float64_t * pSrcA, float32_t * pResult); + /** + * @brief Standard deviation of the elements of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_std_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult); + + /** * @brief Standard deviation of the elements of a Q31 vector. * @param[in] pSrc is input pointer @@ -363,6 +412,30 @@ float64_t arm_kullback_leibler_f64(const float64_t * pSrcA, q7_t * result, uint32_t * index); + /** + * @brief Minimum value of absolute values of a Q7 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] result is output pointer + * @param[in] index is the array index of the minimum value in the input buffer. + */ + void arm_absmin_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * result, + uint32_t * index); + + /** + * @brief Minimum value of absolute values of a Q7 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] result is output pointer + */ + void arm_absmin_no_idx_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * result); + /** * @brief Minimum value of a Q15 vector. @@ -377,6 +450,30 @@ float64_t arm_kullback_leibler_f64(const float64_t * pSrcA, q15_t * pResult, uint32_t * pIndex); +/** + * @brief Minimum value of absolute values of a Q15 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output pointer + * @param[in] pIndex is the array index of the minimum value in the input buffer. + */ + void arm_absmin_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult, + uint32_t * pIndex); + + /** + * @brief Minimum value of absolute values of a Q15 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output pointer + */ + void arm_absmin_no_idx_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult); + /** * @brief Minimum value of a Q31 vector. @@ -391,6 +488,30 @@ float64_t arm_kullback_leibler_f64(const float64_t * pSrcA, q31_t * pResult, uint32_t * pIndex); + /** + * @brief Minimum value of absolute values of a Q31 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output pointer + * @param[out] pIndex is the array index of the minimum value in the input buffer. + */ + void arm_absmin_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult, + uint32_t * pIndex); + + /** + * @brief Minimum value of absolute values of a Q31 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output pointer + */ + void arm_absmin_no_idx_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult); + /** * @brief Minimum value of a floating-point vector. @@ -405,6 +526,68 @@ float64_t arm_kullback_leibler_f64(const float64_t * pSrcA, float32_t * pResult, uint32_t * pIndex); + /** + * @brief Minimum value of absolute values of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output pointer + * @param[out] pIndex is the array index of the minimum value in the input buffer. + */ + void arm_absmin_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult, + uint32_t * pIndex); + + /** + * @brief Minimum value of absolute values of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output pointer + */ + void arm_absmin_no_idx_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult); + + + /** + * @brief Minimum value of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output pointer + * @param[out] pIndex is the array index of the minimum value in the input buffer. + */ + void arm_min_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult, + uint32_t * pIndex); + + /** + * @brief Minimum value of absolute values of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output pointer + * @param[out] pIndex is the array index of the minimum value in the input buffer. + */ + void arm_absmin_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult, + uint32_t * pIndex); + + /** + * @brief Minimum value of absolute values of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output pointer + */ + void arm_absmin_no_idx_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult); + /** * @brief Maximum value of a Q7 vector. @@ -419,6 +602,30 @@ float64_t arm_kullback_leibler_f64(const float64_t * pSrcA, q7_t * pResult, uint32_t * pIndex); +/** + * @brief Maximum value of absolute values of a Q7 vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + * @param[out] pIndex index of maximum value returned here + */ + void arm_absmax_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult, + uint32_t * pIndex); + +/** + * @brief Maximum value of absolute values of a Q7 vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + */ + void arm_absmax_no_idx_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult); + /** * @brief Maximum value of a Q15 vector. @@ -433,6 +640,29 @@ float64_t arm_kullback_leibler_f64(const float64_t * pSrcA, q15_t * pResult, uint32_t * pIndex); +/** + * @brief Maximum value of absolute values of a Q15 vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + * @param[out] pIndex index of maximum value returned here + */ + void arm_absmax_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult, + uint32_t * pIndex); + + /** + * @brief Maximum value of absolute values of a Q15 vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + */ + void arm_absmax_no_idx_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult); /** * @brief Maximum value of a Q31 vector. @@ -447,6 +677,29 @@ float64_t arm_kullback_leibler_f64(const float64_t * pSrcA, q31_t * pResult, uint32_t * pIndex); +/** + * @brief Maximum value of absolute values of a Q31 vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + * @param[out] pIndex index of maximum value returned here + */ + void arm_absmax_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult, + uint32_t * pIndex); + + /** + * @brief Maximum value of absolute values of a Q31 vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + */ + void arm_absmax_no_idx_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult); /** * @brief Maximum value of a floating-point vector. @@ -461,6 +714,67 @@ float64_t arm_kullback_leibler_f64(const float64_t * pSrcA, float32_t * pResult, uint32_t * pIndex); +/** + * @brief Maximum value of absolute values of a floating-point vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + * @param[out] pIndex index of maximum value returned here + */ + void arm_absmax_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult, + uint32_t * pIndex); + + /** + * @brief Maximum value of absolute values of a floating-point vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + */ + void arm_absmax_no_idx_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult); + +/** + * @brief Maximum value of a floating-point vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + * @param[out] pIndex index of maximum value returned here + */ + void arm_max_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult, + uint32_t * pIndex); + +/** + * @brief Maximum value of absolute values of a floating-point vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + * @param[out] pIndex index of maximum value returned here + */ + void arm_absmax_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult, + uint32_t * pIndex); + +/** + * @brief Maximum value of absolute values of a floating-point vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + */ + void arm_absmax_no_idx_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult); + /** @brief Maximum value of a floating-point vector. @param[in] pSrc points to the input vector @@ -473,7 +787,213 @@ float64_t arm_kullback_leibler_f64(const float64_t * pSrcA, uint32_t blockSize, float32_t *pResult); + /** + @brief Minimum value of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ + void arm_min_no_idx_f32( + const float32_t *pSrc, + uint32_t blockSize, + float32_t *pResult); + + /** + @brief Maximum value of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @return none + */ + void arm_max_no_idx_f64( + const float64_t *pSrc, + uint32_t blockSize, + float64_t *pResult); + + /** + @brief Maximum value of a q31 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @return none + */ + void arm_max_no_idx_q31( + const q31_t *pSrc, + uint32_t blockSize, + q31_t *pResult); + + /** + @brief Maximum value of a q15 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @return none + */ + void arm_max_no_idx_q15( + const q15_t *pSrc, + uint32_t blockSize, + q15_t *pResult); + + /** + @brief Maximum value of a q7 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @return none + */ + void arm_max_no_idx_q7( + const q7_t *pSrc, + uint32_t blockSize, + q7_t *pResult); + + /** + @brief Minimum value of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ + void arm_min_no_idx_f64( + const float64_t *pSrc, + uint32_t blockSize, + float64_t *pResult); + +/** + @brief Minimum value of a q31 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ + void arm_min_no_idx_q31( + const q31_t *pSrc, + uint32_t blockSize, + q31_t *pResult); + + /** + @brief Minimum value of a q15 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ + void arm_min_no_idx_q15( + const q15_t *pSrc, + uint32_t blockSize, + q15_t *pResult); + + /** + @brief Minimum value of a q7 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ + void arm_min_no_idx_q7( + const q7_t *pSrc, + uint32_t blockSize, + q7_t *pResult); + +/** + @brief Mean square error between two Q7 vectors. + @param[in] pSrcA points to the first input vector + @param[in] pSrcB points to the second input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult mean square error + @return none +*/ + +void arm_mse_q7( + const q7_t * pSrcA, + const q7_t * pSrcB, + uint32_t blockSize, + q7_t * pResult); + +/** + @brief Mean square error between two Q15 vectors. + @param[in] pSrcA points to the first input vector + @param[in] pSrcB points to the second input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult mean square error + @return none +*/ + +void arm_mse_q15( + const q15_t * pSrcA, + const q15_t * pSrcB, + uint32_t blockSize, + q15_t * pResult); + +/** + @brief Mean square error between two Q31 vectors. + @param[in] pSrcA points to the first input vector + @param[in] pSrcB points to the second input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult mean square error + @return none +*/ + +void arm_mse_q31( + const q31_t * pSrcA, + const q31_t * pSrcB, + uint32_t blockSize, + q31_t * pResult); + +/** + @brief Mean square error between two single precision float vectors. + @param[in] pSrcA points to the first input vector + @param[in] pSrcB points to the second input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult mean square error + @return none +*/ + +void arm_mse_f32( + const float32_t * pSrcA, + const float32_t * pSrcB, + uint32_t blockSize, + float32_t * pResult); + +/** + @brief Mean square error between two double precision float vectors. + @param[in] pSrcA points to the first input vector + @param[in] pSrcB points to the second input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult mean square error + @return none +*/ + +void arm_mse_f64( + const float64_t * pSrcA, + const float64_t * pSrcB, + uint32_t blockSize, + float64_t * pResult); + + +/** + * @brief Accumulation value of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + +void arm_accumulate_f32( +const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult); + +/** + * @brief Accumulation value of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ +void arm_accumulate_f64( +const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult); #ifdef __cplusplus diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions_f16.h index 055040f..a3db3ee 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions_f16.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file statistics_functions_f16.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.1 + * @date 14 July 2022 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -110,6 +111,19 @@ extern "C" float16_t * pResult, uint32_t * pIndex); + /** + * @brief Minimum value of absolute values of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output pointer + * @param[out] pIndex is the array index of the minimum value in the input buffer. + */ + void arm_absmin_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult, + uint32_t * pIndex); + /** * @brief Maximum value of a floating-point vector. * @param[in] pSrc points to the input buffer @@ -123,6 +137,42 @@ extern "C" float16_t * pResult, uint32_t * pIndex); +/** + * @brief Maximum value of absolute values of a floating-point vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + * @param[out] pIndex index of maximum value returned here + */ + void arm_absmax_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult, + uint32_t * pIndex); + + /** + * @brief Minimum value of absolute values of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output pointer + */ + void arm_absmin_no_idx_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult); + +/** + * @brief Maximum value of a floating-point vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + */ + void arm_absmax_no_idx_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult); + + /** * @brief Entropy * @@ -181,6 +231,44 @@ float16_t arm_kullback_leibler_f16(const float16_t * pSrcA uint32_t blockSize, float16_t *pResult); +/** + @brief Minimum value of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ + void arm_min_no_idx_f16( + const float16_t *pSrc, + uint32_t blockSize, + float16_t *pResult); + +/** + @brief Mean square error between two half precision float vectors. + @param[in] pSrcA points to the first input vector + @param[in] pSrcB points to the second input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult mean square error + @return none +*/ + +void arm_mse_f16( + const float16_t * pSrcA, + const float16_t * pSrcB, + uint32_t blockSize, + float16_t * pResult); + + +/** + * @brief Sum value of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_accumulate_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult); #endif /*defined(ARM_FLOAT16_SUPPORTED)*/ diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/support_functions.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/support_functions.h index 3a2e333..7b586e3 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/support_functions.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/support_functions.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file support_functions.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -294,6 +295,20 @@ extern "C" float32_t * pDst, uint32_t blockSize); + + + /** + * @brief Copies the elements of a floating-point vector. + * @param[in] pSrc input pointer + * @param[out] pDst output pointer + * @param[in] blockSize number of samples to process + */ + void arm_copy_f64( + const float64_t * pSrc, + float64_t * pDst, + uint32_t blockSize); + + /** * @brief Copies the elements of a Q7 vector. @@ -343,6 +358,18 @@ extern "C" uint32_t blockSize); + /** + * @brief Fills a constant value into a floating-point vector. + * @param[in] value input value to be filled + * @param[out] pDst output pointer + * @param[in] blockSize number of samples to process + */ + void arm_fill_f64( + float64_t value, + float64_t * pDst, + uint32_t blockSize); + + /** * @brief Fills a constant value into a Q7 vector. * @param[in] value input value to be filled diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/support_functions_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/support_functions_f16.h index 6858f82..f36d06f 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/support_functions_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/support_functions_f16.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file support_functions_f16.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -120,6 +121,64 @@ void arm_barycenter_f16(const float16_t *in , uint32_t nbVectors , uint32_t vecDim); + +/** + @ingroup groupSupport + */ + +/** + * @defgroup typecast Typecasting + */ + +/** + @addtogroup typecast + @{ + */ + +/** + * @brief Interpret a f16 as an s16 value + * @param[in] x input value. + * @return return value. + * + * @par Description + * It is a typecast. No conversion of the float to int is done. + * The memcpy will be optimized out by the compiler. + * memcpy is used to prevent type punning issues. + * With gcc, -fno-builtins MUST not be used or the + * memcpy will not be optimized out. + */ +__STATIC_INLINE int16_t arm_typecast_s16_f16(float16_t x) +{ + int16_t res; + res=*(int16_t*)memcpy((char*)&res,(char*)&x,sizeof(float16_t)); + return(res); +} + +/** + * @brief Interpret an s16 as an f16 value + * @param[in] x input value. + * @return return value. + * + * @par Description + * It is a typecast. No conversion of the int to float is done. + * The memcpy will be optimized out by the compiler. + * memcpy is used to prevent type punning issues. + * With gcc, -fno-builtins MUST not be used or the + * memcpy will not be optimized out. + */ +__STATIC_INLINE float16_t arm_typecast_f16_s16(int16_t x) +{ + float16_t res; + res=*(float16_t*)memcpy((char*)&res,(char*)&x,sizeof(int16_t)); + return(res); +} + + +/** + @} end of typecast group + */ + + #endif /*defined(ARM_FLOAT16_SUPPORTED)*/ #ifdef __cplusplus } diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/svm_defines.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/svm_defines.h index 71ad2f7..f93e953 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/svm_defines.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/svm_defines.h @@ -1,6 +1,10 @@ /****************************************************************************** * @file svm_defines.h * @brief Public header file for CMSIS DSP Library + * @version V1.10.0 + * @date 08 July 2021 + * + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/svm_functions.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/svm_functions.h index 3e1038c..6576c93 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/svm_functions.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/svm_functions.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file svm_functions.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -132,7 +133,7 @@ typedef struct const float32_t *dualCoefficients; /**< Dual coefficients */ const float32_t *supportVectors; /**< Support vectors */ const int32_t *classes; /**< The two SVM classes */ - float32_t coef0; /**< Independant constant */ + float32_t coef0; /**< Independent constant */ float32_t gamma; /**< Gamma factor */ } arm_svm_sigmoid_instance_f32; diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/svm_functions_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/svm_functions_f16.h index 9d28c74..67c97aa 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/svm_functions_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/svm_functions_f16.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file svm_functions_f16.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -33,6 +34,7 @@ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/utils.h" #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/svm_defines.h" + #ifdef __cplusplus extern "C" { @@ -56,24 +58,6 @@ extern "C" * */ -/** - * @brief Integer exponentiation - * @param[in] x value - * @param[in] nb integer exponent >= 1 - * @return x^nb - * - */ -__STATIC_INLINE float16_t arm_exponent_f16(float16_t x, int32_t nb) -{ - float16_t r = x; - nb --; - while(nb > 0) - { - r = r * x; - nb--; - } - return(r); -} /** @@ -131,7 +115,7 @@ typedef struct const float16_t *dualCoefficients; /**< Dual coefficients */ const float16_t *supportVectors; /**< Support vectors */ const int32_t *classes; /**< The two SVM classes */ - float16_t coef0; /**< Independant constant */ + float16_t coef0; /**< Independent constant */ float16_t gamma; /**< Gamma factor */ } arm_svm_sigmoid_instance_f16; diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/transform_functions.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/transform_functions.h index f64f5a4..2722620 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/transform_functions.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/transform_functions.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file transform_functions.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -598,6 +599,149 @@ typedef struct q15_t * pState, q15_t * pInlineBuffer); + /** + * @brief Instance structure for the Floating-point MFCC function. + */ +typedef struct + { + const float32_t *dctCoefs; /**< Internal DCT coefficients */ + const float32_t *filterCoefs; /**< Internal Mel filter coefficients */ + const float32_t *windowCoefs; /**< Windowing coefficients */ + const uint32_t *filterPos; /**< Internal Mel filter positions in spectrum */ + const uint32_t *filterLengths; /**< Internal Mel filter lengths */ + uint32_t fftLen; /**< FFT length */ + uint32_t nbMelFilters; /**< Number of Mel filters */ + uint32_t nbDctOutputs; /**< Number of DCT outputs */ +#if defined(ARM_MFCC_CFFT_BASED) + /* Implementation of the MFCC is using a CFFT */ + arm_cfft_instance_f32 cfft; /**< Internal CFFT instance */ +#else + /* Implementation of the MFCC is using a RFFT (default) */ + arm_rfft_fast_instance_f32 rfft; +#endif + } arm_mfcc_instance_f32 ; + +arm_status arm_mfcc_init_f32( + arm_mfcc_instance_f32 * S, + uint32_t fftLen, + uint32_t nbMelFilters, + uint32_t nbDctOutputs, + const float32_t *dctCoefs, + const uint32_t *filterPos, + const uint32_t *filterLengths, + const float32_t *filterCoefs, + const float32_t *windowCoefs + ); + + +/** + @brief MFCC F32 + @param[in] S points to the mfcc instance structure + @param[in] pSrc points to the input samples + @param[out] pDst points to the output MFCC values + @param[inout] pTmp points to a temporary buffer of complex + @return none + */ + void arm_mfcc_f32( + const arm_mfcc_instance_f32 * S, + float32_t *pSrc, + float32_t *pDst, + float32_t *pTmp + ); + +typedef struct + { + const q31_t *dctCoefs; /**< Internal DCT coefficients */ + const q31_t *filterCoefs; /**< Internal Mel filter coefficients */ + const q31_t *windowCoefs; /**< Windowing coefficients */ + const uint32_t *filterPos; /**< Internal Mel filter positions in spectrum */ + const uint32_t *filterLengths; /**< Internal Mel filter lengths */ + uint32_t fftLen; /**< FFT length */ + uint32_t nbMelFilters; /**< Number of Mel filters */ + uint32_t nbDctOutputs; /**< Number of DCT outputs */ +#if defined(ARM_MFCC_CFFT_BASED) + /* Implementation of the MFCC is using a CFFT */ + arm_cfft_instance_q31 cfft; /**< Internal CFFT instance */ +#else + /* Implementation of the MFCC is using a RFFT (default) */ + arm_rfft_instance_q31 rfft; +#endif + } arm_mfcc_instance_q31 ; + +arm_status arm_mfcc_init_q31( + arm_mfcc_instance_q31 * S, + uint32_t fftLen, + uint32_t nbMelFilters, + uint32_t nbDctOutputs, + const q31_t *dctCoefs, + const uint32_t *filterPos, + const uint32_t *filterLengths, + const q31_t *filterCoefs, + const q31_t *windowCoefs + ); + + +/** + @brief MFCC Q31 + @param[in] S points to the mfcc instance structure + @param[in] pSrc points to the input samples + @param[out] pDst points to the output MFCC values + @param[inout] pTmp points to a temporary buffer of complex + @return none + */ + arm_status arm_mfcc_q31( + const arm_mfcc_instance_q31 * S, + q31_t *pSrc, + q31_t *pDst, + q31_t *pTmp + ); + +typedef struct + { + const q15_t *dctCoefs; /**< Internal DCT coefficients */ + const q15_t *filterCoefs; /**< Internal Mel filter coefficients */ + const q15_t *windowCoefs; /**< Windowing coefficients */ + const uint32_t *filterPos; /**< Internal Mel filter positions in spectrum */ + const uint32_t *filterLengths; /**< Internal Mel filter lengths */ + uint32_t fftLen; /**< FFT length */ + uint32_t nbMelFilters; /**< Number of Mel filters */ + uint32_t nbDctOutputs; /**< Number of DCT outputs */ +#if defined(ARM_MFCC_CFFT_BASED) + /* Implementation of the MFCC is using a CFFT */ + arm_cfft_instance_q15 cfft; /**< Internal CFFT instance */ +#else + /* Implementation of the MFCC is using a RFFT (default) */ + arm_rfft_instance_q15 rfft; +#endif + } arm_mfcc_instance_q15 ; + +arm_status arm_mfcc_init_q15( + arm_mfcc_instance_q15 * S, + uint32_t fftLen, + uint32_t nbMelFilters, + uint32_t nbDctOutputs, + const q15_t *dctCoefs, + const uint32_t *filterPos, + const uint32_t *filterLengths, + const q15_t *filterCoefs, + const q15_t *windowCoefs + ); + + +/** + @brief MFCC Q15 + @param[in] S points to the mfcc instance structure + @param[in] pSrc points to the input samples + @param[out] pDst points to the output MFCC values in q8.7 format + @param[inout] pTmp points to a temporary buffer of complex + @return error status + */ + arm_status arm_mfcc_q15( + const arm_mfcc_instance_q15 * S, + q15_t *pSrc, + q15_t *pDst, + q31_t *pTmp + ); #ifdef __cplusplus diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/transform_functions_f16.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/transform_functions_f16.h index cb2419a..b38a587 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/transform_functions_f16.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/transform_functions_f16.h @@ -1,8 +1,9 @@ /****************************************************************************** * @file transform_functions_f16.h * @brief Public header file for CMSIS DSP Library - * @version V1.9.0 - * @date 20. July 2020 + * @version V1.10.0 + * @date 08 July 2021 + * Target Processor: Cortex-M and Cortex-A cores ******************************************************************************/ /* * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. @@ -146,6 +147,57 @@ arm_status arm_rfft_fast_init_f16 ( void arm_cfft_radix2_f16( const arm_cfft_radix2_instance_f16 * S, float16_t * pSrc); + + /** + * @brief Instance structure for the Floating-point MFCC function. + */ +typedef struct + { + const float16_t *dctCoefs; /**< Internal DCT coefficients */ + const float16_t *filterCoefs; /**< Internal Mel filter coefficients */ + const float16_t *windowCoefs; /**< Windowing coefficients */ + const uint32_t *filterPos; /**< Internal Mel filter positions in spectrum */ + const uint32_t *filterLengths; /**< Internal Mel filter lengths */ + uint32_t fftLen; /**< FFT length */ + uint32_t nbMelFilters; /**< Number of Mel filters */ + uint32_t nbDctOutputs; /**< Number of DCT outputs */ +#if defined(ARM_MFCC_CFFT_BASED) + /* Implementation of the MFCC is using a CFFT */ + arm_cfft_instance_f16 cfft; /**< Internal CFFT instance */ +#else + /* Implementation of the MFCC is using a RFFT (default) */ + arm_rfft_fast_instance_f16 rfft; +#endif + } arm_mfcc_instance_f16 ; + +arm_status arm_mfcc_init_f16( + arm_mfcc_instance_f16 * S, + uint32_t fftLen, + uint32_t nbMelFilters, + uint32_t nbDctOutputs, + const float16_t *dctCoefs, + const uint32_t *filterPos, + const uint32_t *filterLengths, + const float16_t *filterCoefs, + const float16_t *windowCoefs + ); + + +/** + @brief MFCC F16 + @param[in] S points to the mfcc instance structure + @param[in] pSrc points to the input samples + @param[out] pDst points to the output MFCC values + @param[inout] pTmp points to a temporary buffer of complex + @return none + */ + void arm_mfcc_f16( + const arm_mfcc_instance_f16 * S, + float16_t *pSrc, + float16_t *pDst, + float16_t *pTmp + ); + #endif /* defined(ARM_FLOAT16_SUPPORTED)*/ diff --git a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/utils.h b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/utils.h index e83da70..e6e24df 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Include/dsp/utils.h +++ b/edge-impulse-sdk/CMSIS/DSP/Include/dsp/utils.h @@ -27,6 +27,7 @@ #define _ARM_MATH_UTILS_H_ #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types.h" +#include #ifdef __cplusplus extern "C" @@ -47,6 +48,7 @@ extern "C" /** * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type. + It should not be used with negative values. */ __STATIC_FORCEINLINE uint32_t arm_recip_q31( q31_t in, @@ -60,11 +62,11 @@ extern "C" if (in > 0) { - signBits = ((uint32_t) (__CLZ( in) - 1)); + signBits = ((uint32_t) (__CLZ( (uint32_t)in) - 1)); } else { - signBits = ((uint32_t) (__CLZ(-in) - 1)); + signBits = ((uint32_t) (__CLZ((uint32_t)(-in)) - 1)); } /* Convert input sample to 1.31 format */ @@ -98,6 +100,7 @@ extern "C" /** * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type. + It should not be used with negative values. */ __STATIC_FORCEINLINE uint32_t arm_recip_q15( q15_t in, @@ -105,21 +108,21 @@ extern "C" const q15_t * pRecipTable) { q15_t out = 0; - uint32_t tempVal = 0; + int32_t tempVal = 0; uint32_t index = 0, i = 0; uint32_t signBits = 0; if (in > 0) { - signBits = ((uint32_t)(__CLZ( in) - 17)); + signBits = ((uint32_t)(__CLZ( (uint32_t)in) - 17)); } else { - signBits = ((uint32_t)(__CLZ(-in) - 17)); + signBits = ((uint32_t)(__CLZ((uint32_t)(-in)) - 17)); } /* Convert input sample to 1.15 format */ - in = (in << signBits); + in = (q15_t)(in << signBits); /* calculation of index for initial approximated Val */ index = (uint32_t)(in >> 8); @@ -132,8 +135,8 @@ extern "C" /* running approximation for two iterations */ for (i = 0U; i < 2U; i++) { - tempVal = (uint32_t) (((q31_t) in * out) >> 15); - tempVal = 0x7FFFu - tempVal; + tempVal = (((q31_t) in * out) >> 15); + tempVal = 0x7FFF - tempVal; /* 1.15 with exp 1 */ out = (q15_t) (((q31_t) out * tempVal) >> 14); /* out = clip_q31_to_q15(((q31_t) out * tempVal) >> 14); */ @@ -159,13 +162,13 @@ __STATIC_INLINE void arm_norm_64_to_32u(uint64_t in, int32_t * normalized, int3 int32_t hi = (int32_t) (in >> 32); int32_t lo = (int32_t) ((in << 32) >> 32); - n1 = __CLZ(hi) - 32; + n1 = __CLZ((uint32_t)hi) - 32; if (!n1) { /* * input fits in 32-bit */ - n1 = __CLZ(lo); + n1 = __CLZ((uint32_t)lo); if (!n1) { /* @@ -201,13 +204,13 @@ __STATIC_INLINE void arm_norm_64_to_32u(uint64_t in, int32_t * normalized, int3 /* * 64 bit normalization */ - *normalized = (((uint32_t) lo) >> n1) | (hi << (32 - n1)); + *normalized = (int32_t)(((uint32_t)lo) >> n1) | (hi << (32 - n1)); } } -__STATIC_INLINE q31_t arm_div_q63_to_q31(q63_t num, q31_t den) +__STATIC_INLINE int32_t arm_div_int64_to_int32(int64_t num, int32_t den) { - q31_t result; + int32_t result; uint64_t absNum; int32_t normalized; int32_t norm; @@ -216,18 +219,25 @@ __STATIC_INLINE q31_t arm_div_q63_to_q31(q63_t num, q31_t den) * if sum fits in 32bits * avoid costly 64-bit division */ - absNum = num > 0 ? num : -num; + if (num == (int64_t)LONG_MIN) + { + absNum = LONG_MAX; + } + else + { + absNum = (uint64_t) (num > 0 ? num : -num); + } arm_norm_64_to_32u(absNum, &normalized, &norm); if (norm > 0) /* * 32-bit division */ - result = (q31_t) num / den; + result = (int32_t) num / den; else /* * 64-bit division */ - result = (q31_t) (num / den); + result = (int32_t) (num / den); return result; } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_f16.c index 7df97b9..e974c82 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_f16.c @@ -5,11 +5,13 @@ * Title: arm_abs_f16.c * Description: Floating-point vector absolute value * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -33,19 +35,6 @@ @ingroup groupMath */ -/** - @defgroup BasicAbs Vector Absolute Value - - Computes the absolute value of a vector on an element-by-element basis. - -
-      pDst[n] = abs(pSrc[n]),   0 <= n < blockSize.
-  
- - The functions support in-place computation allowing the source and - destination pointers to reference the same memory buffer. - There are separate functions for floating-point, Q7, Q15, and Q31 data types. - */ /** @addtogroup BasicAbs @@ -156,13 +145,13 @@ void arm_abs_f16( /* C = |A| */ /* Calculate absolute and store result in destination buffer. */ - *pDst++ = fabsf(*pSrc++); + *pDst++ = (_Float16)fabsf((float32_t)*pSrc++); - *pDst++ = fabsf(*pSrc++); + *pDst++ = (_Float16)fabsf((float32_t)*pSrc++); - *pDst++ = fabsf(*pSrc++); + *pDst++ = (_Float16)fabsf((float32_t)*pSrc++); - *pDst++ = fabsf(*pSrc++); + *pDst++ = (_Float16)fabsf((float32_t)*pSrc++); /* Decrement loop counter */ blkCnt--; @@ -184,7 +173,7 @@ void arm_abs_f16( /* C = |A| */ /* Calculate absolute and store result in destination buffer. */ - *pDst++ = fabsf(*pSrc++); + *pDst++ = (_Float16)fabsf((float32_t)*pSrc++); /* Decrement loop counter */ blkCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_f32.c index fde9ea5..3d27210 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_f32.c @@ -5,13 +5,13 @@ * Title: arm_abs_f32.c * Description: Floating-point vector absolute value * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_f64.c new file mode 100644 index 0000000..a0bd5f0 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_f64.c @@ -0,0 +1,78 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_abs_f64.c + * Description: Floating-point vector absolute value + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h" +#include + +/** + @ingroup groupMath + */ + +/** + @addtogroup BasicAbs + @{ + */ + +/** + @brief Floating-point vector absolute value. + @param[in] pSrc points to the input vector + @param[out] pDst points to the output vector + @param[in] blockSize number of samples in each vector + @return none + */ + +void arm_abs_f64( + const float64_t * pSrc, + float64_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; /* Loop counter */ + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = |A| */ + + /* Calculate absolute and store result in destination buffer. */ + *pDst++ = fabs(*pSrc++); + + /* Decrement loop counter */ + blkCnt--; + } + +} + +/** + @} end of BasicAbs group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_q15.c index cce4f60..7c8ec53 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_q15.c @@ -5,13 +5,13 @@ * Title: arm_abs_q15.c * Description: Q15 vector absolute value * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_q31.c index 368e23e..fab95f2 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_q31.c @@ -5,13 +5,13 @@ * Title: arm_abs_q31.c * Description: Q31 vector absolute value * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_q7.c index 8915683..f62d67a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_abs_q7.c @@ -5,13 +5,13 @@ * Title: arm_abs_q7.c * Description: Q7 vector absolute value * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_f16.c index 8f825c7..d9d6226 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_f16.c @@ -5,11 +5,13 @@ * Title: arm_add_f16.c * Description: Floating-point vector addition * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -32,17 +34,6 @@ @ingroup groupMath */ -/** - @defgroup BasicAdd Vector Addition - - Element-by-element addition of two vectors. - -
-      pDst[n] = pSrcA[n] + pSrcB[n],   0 <= n < blockSize.
-  
- - There are separate functions for floating-point, Q7, Q15, and Q31 data types. - */ /** @addtogroup BasicAdd @@ -130,10 +121,10 @@ void arm_add_f16( /* C = A + B */ /* Add and store result in destination buffer. */ - *pDst++ = (*pSrcA++) + (*pSrcB++); - *pDst++ = (*pSrcA++) + (*pSrcB++); - *pDst++ = (*pSrcA++) + (*pSrcB++); - *pDst++ = (*pSrcA++) + (*pSrcB++); + *pDst++ = (_Float16)(*pSrcA++) + (_Float16)(*pSrcB++); + *pDst++ = (_Float16)(*pSrcA++) + (_Float16)(*pSrcB++); + *pDst++ = (_Float16)(*pSrcA++) + (_Float16)(*pSrcB++); + *pDst++ = (_Float16)(*pSrcA++) + (_Float16)(*pSrcB++); /* Decrement loop counter */ blkCnt--; @@ -154,7 +145,7 @@ void arm_add_f16( /* C = A + B */ /* Add and store result in destination buffer. */ - *pDst++ = (*pSrcA++) + (*pSrcB++); + *pDst++ = (_Float16)(*pSrcA++) + (_Float16)(*pSrcB++); /* Decrement loop counter */ blkCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_f32.c index 2a56f0a..4e854f5 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_f32.c @@ -5,13 +5,13 @@ * Title: arm_add_f32.c * Description: Floating-point vector addition * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_f64.c new file mode 100644 index 0000000..a1f01a7 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_f64.c @@ -0,0 +1,79 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_add_f64.c + * Description: Floating-point vector addition + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h" + +/** + @ingroup groupMath + */ + +/** + @addtogroup BasicAdd + @{ + */ + +/** + @brief Floating-point vector addition. + @param[in] pSrcA points to first input vector + @param[in] pSrcB points to second input vector + @param[out] pDst points to output vector + @param[in] blockSize number of samples in each vector + @return none + */ + +void arm_add_f64( + const float64_t * pSrcA, + const float64_t * pSrcB, + float64_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; /* Loop counter */ + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = A + B */ + + /* Add and store result in destination buffer. */ + *pDst++ = (*pSrcA++) + (*pSrcB++); + + /* Decrement loop counter */ + blkCnt--; + } + +} + +/** + @} end of BasicAdd group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_q15.c index a1b6d84..6265058 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_q15.c @@ -5,13 +5,13 @@ * Title: arm_add_q15.c * Description: Q15 vector addition * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -126,11 +126,11 @@ void arm_add_q15( #if defined (ARM_MATH_DSP) /* read 2 times 2 samples at a time from sourceA */ - inA1 = read_q15x2_ia ((q15_t **) &pSrcA); - inA2 = read_q15x2_ia ((q15_t **) &pSrcA); + inA1 = read_q15x2_ia (&pSrcA); + inA2 = read_q15x2_ia (&pSrcA); /* read 2 times 2 samples at a time from sourceB */ - inB1 = read_q15x2_ia ((q15_t **) &pSrcB); - inB2 = read_q15x2_ia ((q15_t **) &pSrcB); + inB1 = read_q15x2_ia (&pSrcB); + inB2 = read_q15x2_ia (&pSrcB); /* Add and store 2 times 2 samples at a time */ write_q15x2_ia (&pDst, __QADD16(inA1, inB1)); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_q31.c index fe85869..2d6e791 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_q31.c @@ -5,13 +5,13 @@ * Title: arm_add_q31.c * Description: Q31 vector addition * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_q7.c index 488b45d..46446c7 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_add_q7.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/dsp/config.hpp" #if EIDSP_LOAD_CMSIS_DSP_SOURCES /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -23,10 +23,10 @@ * Title: arm_add_q7.c * Description: Q7 vector addition * - * $Date: May 29, 2020 - * $Revision: V1.6.1 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h" @@ -121,7 +121,7 @@ void arm_add_q7( #if defined (ARM_MATH_DSP) /* Add and store result in destination buffer (4 samples at a time). */ - write_q7x4_ia (&pDst, __QADD8 (read_q7x4_ia ((q7_t **) &pSrcA), read_q7x4_ia ((q7_t **) &pSrcB))); + write_q7x4_ia (&pDst, __QADD8 (read_q7x4_ia (&pSrcA), read_q7x4_ia (&pSrcB))); #else *pDst++ = (q7_t) __SSAT ((q15_t) *pSrcA++ + *pSrcB++, 8); *pDst++ = (q7_t) __SSAT ((q15_t) *pSrcA++ + *pSrcB++, 8); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_and_u16.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_and_u16.c index fb90af6..82aabc8 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_and_u16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_and_u16.c @@ -5,13 +5,13 @@ * Title: arm_and_u16.c * Description: uint16_t bitwise AND * - * $Date: 14 November 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_and_u32.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_and_u32.c index 73b8087..0c4b090 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_and_u32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_and_u32.c @@ -5,13 +5,13 @@ * Title: arm_and_u32.c * Description: uint32_t bitwise AND * - * $Date: 14 November 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_and_u8.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_and_u8.c index f68e992..52ac33e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_and_u8.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_and_u8.c @@ -5,13 +5,13 @@ * Title: arm_and_u8.c * Description: uint8_t bitwise AND * - * $Date: 14 November 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_f16.c index 38bae53..bc4e732 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_f16.c @@ -5,8 +5,10 @@ * Title: arm_clip_f16.c * Description: Floating-point vector addition * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. @@ -123,9 +125,9 @@ void arm_clip_f16(const float16_t * pSrc, { for (uint32_t i = 0; i < numSamples; i++) { - if (pSrc[i] > high) + if ((_Float16)pSrc[i] > (_Float16)high) pDst[i] = high; - else if (pSrc[i] < low) + else if ((_Float16)pSrc[i] < (_Float16)low) pDst[i] = low; else pDst[i] = pSrc[i]; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_f32.c index b25896a..b2b1374 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_f32.c @@ -5,8 +5,10 @@ * Title: arm_clip_f32.c * Description: Floating-point vector addition * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. @@ -126,7 +128,8 @@ void arm_clip_f32(const float32_t * pSrc, float32_t high, uint32_t numSamples) { - for (uint32_t i = 0; i < numSamples; i++) + uint32_t i; + for (i = 0; i < numSamples; i++) { if (pSrc[i] > high) pDst[i] = high; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_q15.c index 1ba2cfc..287109a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_q15.c @@ -5,8 +5,10 @@ * Title: arm_clip_q15.c * Description: Floating-point vector addition * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. @@ -116,7 +118,8 @@ void arm_clip_q15(const q15_t * pSrc, q15_t high, uint32_t numSamples) { - for (uint32_t i = 0; i < numSamples; i++) + uint32_t i; + for (i = 0; i < numSamples; i++) { if (pSrc[i] > high) pDst[i] = high; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_q31.c index 70d6d59..a82d2df 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_q31.c @@ -5,8 +5,10 @@ * Title: arm_clip_q31.c * Description: Floating-point vector addition * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. @@ -116,7 +118,8 @@ void arm_clip_q31(const q31_t * pSrc, q31_t high, uint32_t numSamples) { - for (uint32_t i = 0; i < numSamples; i++) + uint32_t i; + for (i = 0; i < numSamples; i++) { if (pSrc[i] > high) pDst[i] = high; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_q7.c index 006a7dc..f28678c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_clip_q7.c @@ -5,8 +5,10 @@ * Title: arm_clip_q7.c * Description: Floating-point vector addition * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. @@ -116,7 +118,8 @@ void arm_clip_q7(const q7_t * pSrc, q7_t high, uint32_t numSamples) { - for (uint32_t i = 0; i < numSamples; i++) + uint32_t i; + for (i = 0; i < numSamples; i++) { if (pSrc[i] > high) pDst[i] = high; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_f16.c index 11cbf9e..71ea70d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_f16.c @@ -5,13 +5,13 @@ * Title: arm_dot_prod_f16.c * Description: Floating-point dot product * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -34,18 +34,6 @@ @ingroup groupMath */ -/** - @defgroup BasicDotProd Vector Dot Product - - Computes the dot product of two vectors. - The vectors are multiplied element-by-element and then summed. - -
-      sum = pSrcA[0]*pSrcB[0] + pSrcA[1]*pSrcB[1] + ... + pSrcA[blockSize-1]*pSrcB[blockSize-1]
-  
- - There are separate functions for floating-point, Q7, Q15, and Q31 data types. - */ /** @addtogroup BasicDotProd diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_f32.c index cd3b4f0..6f5e421 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_f32.c @@ -5,13 +5,13 @@ * Title: arm_dot_prod_f32.c * Description: Floating-point dot product * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 05 October 2021 + * $Revision: V1.9.1 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -134,7 +134,9 @@ void arm_dot_prod_f32( f32x4_t vec1; f32x4_t vec2; f32x4_t accum = vdupq_n_f32(0); - f32x2_t tmp = vdup_n_f32(0); +#if !defined(__aarch64__) + f32x2_t tmp = vdup_n_f32(0); +#endif /* Compute 4 outputs at a time */ blkCnt = blockSize >> 2U; @@ -160,7 +162,7 @@ void arm_dot_prod_f32( blkCnt--; } -#if __aarch64__ +#if defined(__aarch64__) sum = vpadds_f32(vpadd_f32(vget_low_f32(accum), vget_high_f32(accum))); #else tmp = vpadd_f32(vget_low_f32(accum), vget_high_f32(accum)); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_f64.c new file mode 100644 index 0000000..821931f --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_f64.c @@ -0,0 +1,82 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_dot_prod_f64.c + * Description: Floating-point dot product + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h" + +/** + @ingroup groupMath + */ + +/** + @addtogroup BasicDotProd + @{ + */ + +/** + @brief Dot product of floating-point vectors. + @param[in] pSrcA points to the first input vector. + @param[in] pSrcB points to the second input vector. + @param[in] blockSize number of samples in each vector. + @param[out] result output result returned here. + @return none + */ + +void arm_dot_prod_f64( + const float64_t * pSrcA, + const float64_t * pSrcB, + uint32_t blockSize, + float64_t * result) +{ + uint32_t blkCnt; /* Loop counter */ + float64_t sum = 0.; /* Temporary return variable */ + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = A[0]* B[0] + A[1]* B[1] + A[2]* B[2] + .....+ A[blockSize-1]* B[blockSize-1] */ + + /* Calculate dot product and store result in a temporary buffer. */ + sum += (*pSrcA++) * (*pSrcB++); + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store result in destination buffer */ + *result = sum; +} + +/** + @} end of BasicDotProd group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_q15.c index be944f3..a8faebc 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_q15.c @@ -5,13 +5,13 @@ * Title: arm_dot_prod_q15.c * Description: Q15 dot product * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -126,8 +126,8 @@ void arm_dot_prod_q15( #if defined (ARM_MATH_DSP) /* Calculate dot product and store result in a temporary buffer. */ - sum = __SMLALD(read_q15x2_ia ((q15_t **) &pSrcA), read_q15x2_ia ((q15_t **) &pSrcB), sum); - sum = __SMLALD(read_q15x2_ia ((q15_t **) &pSrcA), read_q15x2_ia ((q15_t **) &pSrcB), sum); + sum = __SMLALD(read_q15x2_ia (&pSrcA), read_q15x2_ia (&pSrcB), sum); + sum = __SMLALD(read_q15x2_ia (&pSrcA), read_q15x2_ia (&pSrcB), sum); #else sum += (q63_t)((q31_t) *pSrcA++ * *pSrcB++); sum += (q63_t)((q31_t) *pSrcA++ * *pSrcB++); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_q31.c index ee2d26d..bced7e8 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_q31.c @@ -5,13 +5,13 @@ * Title: arm_dot_prod_q31.c * Description: Q31 dot product * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_q7.c index d17f129..594bd01 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_dot_prod_q7.c @@ -5,13 +5,13 @@ * Title: arm_dot_prod_q7.c * Description: Q7 dot product * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -131,9 +131,9 @@ void arm_dot_prod_q7( #if defined (ARM_MATH_DSP) /* read 4 samples at a time from sourceA */ - input1 = read_q7x4_ia ((q7_t **) &pSrcA); + input1 = read_q7x4_ia (&pSrcA); /* read 4 samples at a time from sourceB */ - input2 = read_q7x4_ia ((q7_t **) &pSrcB); + input2 = read_q7x4_ia (&pSrcB); /* extract two q7_t samples to q15_t samples */ inA1 = __SXTB16(__ROR(input1, 8)); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_f16.c index 9fc66e4..0b5994b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_f16.c @@ -5,11 +5,13 @@ * Title: arm_mult_f16.c * Description: Floating-point vector multiplication * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -32,17 +34,6 @@ @ingroup groupMath */ -/** - @defgroup BasicMult Vector Multiplication - - Element-by-element multiplication of two vectors. - -
-      pDst[n] = pSrcA[n] * pSrcB[n],   0 <= n < blockSize.
-  
- - There are separate functions for floating-point, Q7, Q15, and Q31 data types. - */ /** @addtogroup BasicMult @@ -129,13 +120,13 @@ void arm_mult_f16( /* C = A * B */ /* Multiply inputs and store result in destination buffer. */ - *pDst++ = (*pSrcA++) * (*pSrcB++); + *pDst++ = (_Float16)(*pSrcA++) * (_Float16)(*pSrcB++); - *pDst++ = (*pSrcA++) * (*pSrcB++); + *pDst++ = (_Float16)(*pSrcA++) * (_Float16)(*pSrcB++); - *pDst++ = (*pSrcA++) * (*pSrcB++); + *pDst++ = (_Float16)(*pSrcA++) * (_Float16)(*pSrcB++); - *pDst++ = (*pSrcA++) * (*pSrcB++); + *pDst++ = (_Float16)(*pSrcA++) * (_Float16)(*pSrcB++); /* Decrement loop counter */ blkCnt--; @@ -156,7 +147,7 @@ void arm_mult_f16( /* C = A * B */ /* Multiply input and store result in destination buffer. */ - *pDst++ = (*pSrcA++) * (*pSrcB++); + *pDst++ = (_Float16)(*pSrcA++) * (_Float16)(*pSrcB++); /* Decrement loop counter */ blkCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_f32.c index 6441b3b..0744ac5 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_f32.c @@ -5,13 +5,13 @@ * Title: arm_mult_f32.c * Description: Floating-point vector multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_f64.c new file mode 100644 index 0000000..9b914aa --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_f64.c @@ -0,0 +1,79 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mult_f64.c + * Description: Floating-point vector multiplication + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h" + +/** + @ingroup groupMath + */ + +/** + @addtogroup BasicMult + @{ + */ + +/** + @brief Floating-point vector multiplication. + @param[in] pSrcA points to the first input vector. + @param[in] pSrcB points to the second input vector. + @param[out] pDst points to the output vector. + @param[in] blockSize number of samples in each vector. + @return none + */ + +void arm_mult_f64( + const float64_t * pSrcA, + const float64_t * pSrcB, + float64_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; /* Loop counter */ + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = A * B */ + + /* Multiply input and store result in destination buffer. */ + *pDst++ = (*pSrcA++) * (*pSrcB++); + + /* Decrement loop counter */ + blkCnt--; + } + +} + +/** + @} end of BasicMult group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_q15.c index 079059b..d6ec9ec 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_q15.c @@ -5,13 +5,13 @@ * Title: arm_mult_q15.c * Description: Q15 vector multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -125,13 +125,13 @@ void arm_mult_q15( #if defined (ARM_MATH_DSP) /* read 2 samples at a time from sourceA */ - inA1 = read_q15x2_ia ((q15_t **) &pSrcA); + inA1 = read_q15x2_ia (&pSrcA); /* read 2 samples at a time from sourceB */ - inB1 = read_q15x2_ia ((q15_t **) &pSrcB); + inB1 = read_q15x2_ia (&pSrcB); /* read 2 samples at a time from sourceA */ - inA2 = read_q15x2_ia ((q15_t **) &pSrcA); + inA2 = read_q15x2_ia (&pSrcA); /* read 2 samples at a time from sourceB */ - inB2 = read_q15x2_ia ((q15_t **) &pSrcB); + inB2 = read_q15x2_ia (&pSrcB); /* multiply mul = sourceA * sourceB */ mul1 = (q31_t) ((q15_t) (inA1 >> 16) * (q15_t) (inB1 >> 16)); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_q31.c index 9598133..60c103c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_q31.c @@ -5,13 +5,13 @@ * Title: arm_mult_q31.c * Description: Q31 vector multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_q7.c index ce3f4a7..fd0bc3b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_mult_q7.c @@ -5,13 +5,13 @@ * Title: arm_mult_q7.c * Description: Q7 vector multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_f16.c index 36e2a88..c4d6ca0 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_f16.c @@ -5,11 +5,13 @@ * Title: arm_negate_f16.c * Description: Negates floating-point vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -32,19 +34,6 @@ @ingroup groupMath */ -/** - @defgroup BasicNegate Vector Negate - - Negates the elements of a vector. - -
-      pDst[n] = -pSrc[n],   0 <= n < blockSize.
-  
- - The functions support in-place computation allowing the source and - destination pointers to reference the same memory buffer. - There are separate functions for floating-point, Q7, Q15, and Q31 data types. - */ /** @addtogroup BasicNegate @@ -124,13 +113,13 @@ void arm_negate_f16( /* C = -A */ /* Negate and store result in destination buffer. */ - *pDst++ = -*pSrc++; + *pDst++ = -(_Float16)*pSrc++; - *pDst++ = -*pSrc++; + *pDst++ = -(_Float16)*pSrc++; - *pDst++ = -*pSrc++; + *pDst++ = -(_Float16)*pSrc++; - *pDst++ = -*pSrc++; + *pDst++ = -(_Float16)*pSrc++; /* Decrement loop counter */ blkCnt--; @@ -151,7 +140,7 @@ void arm_negate_f16( /* C = -A */ /* Negate and store result in destination buffer. */ - *pDst++ = -*pSrc++; + *pDst++ = -(_Float16)*pSrc++; /* Decrement loop counter */ blkCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_f32.c index 3eec34e..e4df7ad 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_f32.c @@ -5,13 +5,13 @@ * Title: arm_negate_f32.c * Description: Negates floating-point vectors * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_f64.c new file mode 100644 index 0000000..870a767 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_f64.c @@ -0,0 +1,77 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_negate_f64.c + * Description: Negates floating-point vectors + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h" + +/** + @ingroup groupMath + */ + +/** + @addtogroup BasicNegate + @{ + */ + +/** + @brief Negates the elements of a floating-point vector. + @param[in] pSrc points to input vector. + @param[out] pDst points to output vector. + @param[in] blockSize number of samples in each vector. + @return none + */ + +void arm_negate_f64( + const float64_t * pSrc, + float64_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; /* Loop counter */ + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = -A */ + + /* Negate and store result in destination buffer. */ + *pDst++ = -*pSrc++; + + /* Decrement loop counter */ + blkCnt--; + } + +} + +/** + @} end of BasicNegate group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_q15.c index 72d964b..c642c24 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_q15.c @@ -5,13 +5,13 @@ * Title: arm_negate_q15.c * Description: Negates Q15 vectors * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -120,10 +120,10 @@ void arm_negate_q15( #if defined (ARM_MATH_DSP) /* Negate and store result in destination buffer (2 samples at a time). */ - in1 = read_q15x2_ia ((q15_t **) &pSrc); + in1 = read_q15x2_ia (&pSrc); write_q15x2_ia (&pDst, __QSUB16(0, in1)); - in1 = read_q15x2_ia ((q15_t **) &pSrc); + in1 = read_q15x2_ia (&pSrc); write_q15x2_ia (&pDst, __QSUB16(0, in1)); #else in = *pSrc++; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_q31.c index 539f890..e0048e7 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_q31.c @@ -5,13 +5,13 @@ * Title: arm_negate_q31.c * Description: Negates Q31 vectors * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_q7.c index 181896f..3d3cae1 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_negate_q7.c @@ -5,13 +5,13 @@ * Title: arm_negate_q7.c * Description: Negates Q7 vectors * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -118,7 +118,7 @@ void arm_negate_q7( #if defined (ARM_MATH_DSP) /* Negate and store result in destination buffer (4 samples at a time). */ - in1 = read_q7x4_ia ((q7_t **) &pSrc); + in1 = read_q7x4_ia (&pSrc); write_q7x4_ia (&pDst, __QSUB8(0, in1)); #else in = *pSrc++; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_not_u16.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_not_u16.c index e583e49..5e58873 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_not_u16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_not_u16.c @@ -5,13 +5,13 @@ * Title: arm_not_u16.c * Description: uint16_t bitwise NOT * - * $Date: 14 November 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_not_u32.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_not_u32.c index ce702dd..634800a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_not_u32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_not_u32.c @@ -5,13 +5,13 @@ * Title: arm_not_u32.c * Description: uint32_t bitwise NOT * - * $Date: 14 November 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_not_u8.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_not_u8.c index 87a417d..b83fb0f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_not_u8.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_not_u8.c @@ -5,13 +5,13 @@ * Title: arm_not_u8.c * Description: uint8_t bitwise NOT * - * $Date: 14 November 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_f16.c index a8a9bd9..4bb665c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_f16.c @@ -5,11 +5,13 @@ * Title: arm_offset_f16.c * Description: Floating-point vector offset * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -32,20 +34,6 @@ @ingroup groupMath */ -/** - @defgroup BasicOffset Vector Offset - - Adds a constant offset to each element of a vector. - -
-      pDst[n] = pSrc[n] + offset,   0 <= n < blockSize.
-  
- - The functions support in-place computation allowing the source and - destination pointers to reference the same memory buffer. - There are separate functions for floating-point, Q7, Q15, and Q31 data types. - */ - /** @addtogroup BasicOffset @{ @@ -128,13 +116,13 @@ void arm_offset_f16( /* C = A + offset */ /* Add offset and store result in destination buffer. */ - *pDst++ = (*pSrc++) + offset; + *pDst++ = (_Float16)(*pSrc++) + (_Float16)offset; - *pDst++ = (*pSrc++) + offset; + *pDst++ = (_Float16)(*pSrc++) + (_Float16)offset; - *pDst++ = (*pSrc++) + offset; + *pDst++ = (_Float16)(*pSrc++) + (_Float16)offset; - *pDst++ = (*pSrc++) + offset; + *pDst++ = (_Float16)(*pSrc++) + (_Float16)offset; /* Decrement loop counter */ blkCnt--; @@ -155,7 +143,7 @@ void arm_offset_f16( /* C = A + offset */ /* Add offset and store result in destination buffer. */ - *pDst++ = (*pSrc++) + offset; + *pDst++ = (_Float16)(*pSrc++) + (_Float16)offset; /* Decrement loop counter */ blkCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_f32.c index c32e7e4..3033def 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_f32.c @@ -5,13 +5,13 @@ * Title: arm_offset_f32.c * Description: Floating-point vector offset * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_f64.c new file mode 100644 index 0000000..36b9007 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_f64.c @@ -0,0 +1,79 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_offset_f64.c + * Description: Floating-point vector offset + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h" + +/** + @ingroup groupMath + */ + +/** + @addtogroup BasicOffset + @{ + */ + +/** + @brief Adds a constant offset to a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] offset is the offset to be added + @param[out] pDst points to the output vector + @param[in] blockSize number of samples in each vector + @return none + */ + +void arm_offset_f64( + const float64_t * pSrc, + float64_t offset, + float64_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; /* Loop counter */ + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = A + offset */ + + /* Add offset and store result in destination buffer. */ + *pDst++ = (*pSrc++) + offset; + + /* Decrement loop counter */ + blkCnt--; + } + +} + +/** + @} end of BasicOffset group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_q15.c index ecf0829..9423730 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_q15.c @@ -5,13 +5,13 @@ * Title: arm_offset_q15.c * Description: Q15 vector offset * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -124,8 +124,8 @@ void arm_offset_q15( #if defined (ARM_MATH_DSP) /* Add offset and store result in destination buffer (2 samples at a time). */ - write_q15x2_ia (&pDst, __QADD16(read_q15x2_ia ((q15_t **) &pSrc), offset_packed)); - write_q15x2_ia (&pDst, __QADD16(read_q15x2_ia ((q15_t **) &pSrc), offset_packed)); + write_q15x2_ia (&pDst, __QADD16(read_q15x2_ia (&pSrc), offset_packed)); + write_q15x2_ia (&pDst, __QADD16(read_q15x2_ia (&pSrc), offset_packed)); #else *pDst++ = (q15_t) __SSAT(((q31_t) *pSrc++ + offset), 16); *pDst++ = (q15_t) __SSAT(((q31_t) *pSrc++ + offset), 16); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_q31.c index b6ecb9c..b0a1c99 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_q31.c @@ -5,13 +5,13 @@ * Title: arm_offset_q31.c * Description: Q31 vector offset * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_q7.c index 452cdb2..dacfe48 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_offset_q7.c @@ -5,13 +5,13 @@ * Title: arm_offset_q7.c * Description: Q7 vector offset * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -123,7 +123,7 @@ void arm_offset_q7( #if defined (ARM_MATH_DSP) /* Add offset and store result in destination buffer (4 samples at a time). */ - write_q7x4_ia (&pDst, __QADD8(read_q7x4_ia ((q7_t **) &pSrc), offset_packed)); + write_q7x4_ia (&pDst, __QADD8(read_q7x4_ia (&pSrc), offset_packed)); #else *pDst++ = (q7_t) __SSAT((q15_t) *pSrc++ + offset, 8); *pDst++ = (q7_t) __SSAT((q15_t) *pSrc++ + offset, 8); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_or_u16.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_or_u16.c index c7d12ba..2de542a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_or_u16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_or_u16.c @@ -5,13 +5,13 @@ * Title: arm_or_u16.c * Description: uint16_t bitwise inclusive OR * - * $Date: 14 November 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_or_u32.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_or_u32.c index 655b925..6e285dc 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_or_u32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_or_u32.c @@ -5,13 +5,13 @@ * Title: arm_or_u32.c * Description: uint32_t bitwise inclusive OR * - * $Date: 14 November 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_or_u8.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_or_u8.c index 3eb9058..b9014a3 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_or_u8.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_or_u8.c @@ -5,13 +5,13 @@ * Title: arm_or_u8.c * Description: uint8_t bitwise inclusive OR * - * $Date: 14 November 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_f16.c index 240881a..ecd4180 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_f16.c @@ -5,13 +5,13 @@ * Title: arm_scale_f16.c * Description: Multiplies a floating-point vector by a scalar * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -34,32 +34,7 @@ @ingroup groupMath */ -/** - @defgroup BasicScale Vector Scale - - Multiply a vector by a scalar value. For floating-point data, the algorithm used is: - -
-      pDst[n] = pSrc[n] * scale,   0 <= n < blockSize.
-  
- - In the fixed-point Q7, Q15, and Q31 functions, scale is represented by - a fractional multiplication scaleFract and an arithmetic shift shift. - The shift allows the gain of the scaling operation to exceed 1.0. - The algorithm used with fixed-point data is: -
-      pDst[n] = (pSrc[n] * scaleFract) << shift,   0 <= n < blockSize.
-  
- - The overall scale factor applied to the fixed-point data is -
-      scale = scaleFract * 2^shift.
-  
- - The functions support in-place computation allowing the source and destination - pointers to reference the same memory buffer. - */ /** @addtogroup BasicScale @@ -143,13 +118,13 @@ void arm_scale_f16( /* C = A * scale */ /* Scale input and store result in destination buffer. */ - *pDst++ = (*pSrc++) * scale; + *pDst++ = (_Float16)(*pSrc++) * (_Float16)scale; - *pDst++ = (*pSrc++) * scale; + *pDst++ = (_Float16)(*pSrc++) * (_Float16)scale; - *pDst++ = (*pSrc++) * scale; + *pDst++ = (_Float16)(*pSrc++) * (_Float16)scale; - *pDst++ = (*pSrc++) * scale; + *pDst++ = (_Float16)(*pSrc++) * (_Float16)scale; /* Decrement loop counter */ blkCnt--; @@ -170,7 +145,7 @@ void arm_scale_f16( /* C = A * scale */ /* Scale input and store result in destination buffer. */ - *pDst++ = (*pSrc++) * scale; + *pDst++ = (_Float16)(*pSrc++) * (_Float16)scale; /* Decrement loop counter */ blkCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_f32.c index 342b656..c5c5479 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_f32.c @@ -5,13 +5,13 @@ * Title: arm_scale_f32.c * Description: Multiplies a floating-point vector by a scalar * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_f64.c new file mode 100644 index 0000000..747f06b --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_f64.c @@ -0,0 +1,79 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_scale_f64.c + * Description: Multiplies a floating-point vector by a scalar + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h" + +/** + @ingroup groupMath + */ + +/** + @addtogroup BasicScale + @{ + */ + +/** + @brief Multiplies a floating-point vector by a scalar. + @param[in] pSrc points to the input vector + @param[in] scale scale factor to be applied + @param[out] pDst points to the output vector + @param[in] blockSize number of samples in each vector + @return none + */ + +void arm_scale_f64( + const float64_t *pSrc, + float64_t scale, + float64_t *pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; /* Loop counter */ + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = A * scale */ + + /* Scale input and store result in destination buffer. */ + *pDst++ = (*pSrc++) * scale; + + /* Decrement loop counter */ + blkCnt--; + } + +} + +/** + @} end of BasicScale group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_q15.c index 5a53708..3443de5 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_q15.c @@ -5,13 +5,13 @@ * Title: arm_scale_q15.c * Description: Multiplies a Q15 vector by a scalar * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -138,8 +138,8 @@ void arm_scale_q15( #if defined (ARM_MATH_DSP) /* read 2 times 2 samples at a time from source */ - inA1 = read_q15x2_ia ((q15_t **) &pSrc); - inA2 = read_q15x2_ia ((q15_t **) &pSrc); + inA1 = read_q15x2_ia (&pSrc); + inA2 = read_q15x2_ia (&pSrc); /* Scale inputs and store result in temporary variables * in single cycle by packing the outputs */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_q31.c index 6d0f7c7..271278b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_q31.c @@ -5,13 +5,13 @@ * Title: arm_scale_q31.c * Description: Multiplies a Q31 vector by a scalar * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_q7.c index 5847500..f4383ee 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_scale_q7.c @@ -5,13 +5,13 @@ * Title: arm_scale_q7.c * Description: Multiplies a Q7 vector by a scalar * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_shift_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_shift_q15.c index ce677b3..3579dad 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_shift_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_shift_q15.c @@ -5,13 +5,13 @@ * Title: arm_shift_q15.c * Description: Shifts the elements of a Q15 vector by a specified number of bits * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_shift_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_shift_q31.c index 53f01cd..c2fc8fb 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_shift_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_shift_q31.c @@ -5,13 +5,13 @@ * Title: arm_shift_q31.c * Description: Shifts the elements of a Q31 vector by a specified number of bits * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_shift_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_shift_q7.c index eedb7eb..87ef339 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_shift_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_shift_q7.c @@ -5,13 +5,13 @@ * Title: arm_shift_q7.c * Description: Processing function for the Q7 Shifting * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_f16.c index 0cba4bf..571fe5f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_f16.c @@ -5,13 +5,13 @@ * Title: arm_sub_f16.c * Description: Floating-point vector subtraction * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -34,17 +34,6 @@ @ingroup groupMath */ -/** - @defgroup BasicSub Vector Subtraction - - Element-by-element subtraction of two vectors. - -
-      pDst[n] = pSrcA[n] - pSrcB[n],   0 <= n < blockSize.
-  
- - There are separate functions for floating-point, Q7, Q15, and Q31 data types. - */ /** @addtogroup BasicSub @@ -131,13 +120,13 @@ void arm_sub_f16( /* C = A - B */ /* Subtract and store result in destination buffer. */ - *pDst++ = (*pSrcA++) - (*pSrcB++); + *pDst++ = (_Float16)(*pSrcA++) - (_Float16)(*pSrcB++); - *pDst++ = (*pSrcA++) - (*pSrcB++); + *pDst++ = (_Float16)(*pSrcA++) - (_Float16)(*pSrcB++); - *pDst++ = (*pSrcA++) - (*pSrcB++); + *pDst++ = (_Float16)(*pSrcA++) - (_Float16)(*pSrcB++); - *pDst++ = (*pSrcA++) - (*pSrcB++); + *pDst++ = (_Float16)(*pSrcA++) - (_Float16)(*pSrcB++); /* Decrement loop counter */ blkCnt--; @@ -158,7 +147,7 @@ void arm_sub_f16( /* C = A - B */ /* Subtract and store result in destination buffer. */ - *pDst++ = (*pSrcA++) - (*pSrcB++); + *pDst++ = (_Float16)(*pSrcA++) - (_Float16)(*pSrcB++); /* Decrement loop counter */ blkCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_f32.c index 5dbd231..476d7ee 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_f32.c @@ -5,13 +5,13 @@ * Title: arm_sub_f32.c * Description: Floating-point vector subtraction * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_f64.c new file mode 100644 index 0000000..a956a14 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_f64.c @@ -0,0 +1,79 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_sub_f64.c + * Description: Floating-point vector subtraction + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h" + +/** + @ingroup groupMath + */ + +/** + @addtogroup BasicSub + @{ + */ + +/** + @brief Floating-point vector subtraction. + @param[in] pSrcA points to the first input vector + @param[in] pSrcB points to the second input vector + @param[out] pDst points to the output vector + @param[in] blockSize number of samples in each vector + @return none + */ + +void arm_sub_f64( + const float64_t * pSrcA, + const float64_t * pSrcB, + float64_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; /* Loop counter */ + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = A - B */ + + /* Subtract and store result in destination buffer. */ + *pDst++ = (*pSrcA++) - (*pSrcB++); + + /* Decrement loop counter */ + blkCnt--; + } + +} + +/** + @} end of BasicSub group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_q15.c index f5a2d2c..0892988 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_q15.c @@ -5,13 +5,13 @@ * Title: arm_sub_q15.c * Description: Q15 vector subtraction * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -127,11 +127,11 @@ void arm_sub_q15( #if defined (ARM_MATH_DSP) /* read 2 times 2 samples at a time from sourceA */ - inA1 = read_q15x2_ia ((q15_t **) &pSrcA); - inA2 = read_q15x2_ia ((q15_t **) &pSrcA); + inA1 = read_q15x2_ia (&pSrcA); + inA2 = read_q15x2_ia (&pSrcA); /* read 2 times 2 samples at a time from sourceB */ - inB1 = read_q15x2_ia ((q15_t **) &pSrcB); - inB2 = read_q15x2_ia ((q15_t **) &pSrcB); + inB1 = read_q15x2_ia (&pSrcB); + inB2 = read_q15x2_ia (&pSrcB); /* Subtract and store 2 times 2 samples at a time */ write_q15x2_ia (&pDst, __QSUB16(inA1, inB1)); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_q31.c index 79c291e..8aaae08 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_q31.c @@ -5,13 +5,13 @@ * Title: arm_sub_q31.c * Description: Q31 vector subtraction * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_q7.c index e2c1ecb..c2aea32 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_sub_q7.c @@ -5,13 +5,13 @@ * Title: arm_sub_q7.c * Description: Q7 vector subtraction * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -119,7 +119,7 @@ void arm_sub_q7( #if defined (ARM_MATH_DSP) /* Subtract and store result in destination buffer (4 samples at a time). */ - write_q7x4_ia (&pDst, __QSUB8(read_q7x4_ia ((q7_t **) &pSrcA), read_q7x4_ia ((q7_t **) &pSrcB))); + write_q7x4_ia (&pDst, __QSUB8(read_q7x4_ia (&pSrcA), read_q7x4_ia (&pSrcB))); #else *pDst++ = (q7_t) __SSAT((q15_t) *pSrcA++ - *pSrcB++, 8); *pDst++ = (q7_t) __SSAT((q15_t) *pSrcA++ - *pSrcB++, 8); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_xor_u16.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_xor_u16.c index 002edf5..def6516 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_xor_u16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_xor_u16.c @@ -5,13 +5,13 @@ * Title: arm_xor_u16.c * Description: uint16_t bitwise exclusive OR * - * $Date: 14 November 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_xor_u32.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_xor_u32.c index f835b1f..74c3d1c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_xor_u32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_xor_u32.c @@ -5,13 +5,13 @@ * Title: arm_xor_u32.c * Description: uint32_t bitwise exclusive OR * - * $Date: 14 November 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_xor_u8.c b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_xor_u8.c index 6d57e3e..c1c8615 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_xor_u8.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BasicMathFunctions/arm_xor_u8.c @@ -5,13 +5,13 @@ * Title: arm_xor_u8.c * Description: uint8_t bitwise exclusive OR * - * $Date: 14 November 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BayesFunctions/arm_gaussian_naive_bayes_predict_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/BayesFunctions/arm_gaussian_naive_bayes_predict_f16.c index 1db5cfe..bfe2e28 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BayesFunctions/arm_gaussian_naive_bayes_predict_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BayesFunctions/arm_gaussian_naive_bayes_predict_f16.c @@ -5,11 +5,13 @@ * Title: arm_naive_gaussian_bayes_predict_f16 * Description: Naive Gaussian Bayesian Estimator * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -33,7 +35,6 @@ #include #include -#define PI_F 3.1415926535897932384626433832795f16 /** * @addtogroup groupBayes @@ -43,13 +44,12 @@ /** * @brief Naive Gaussian Bayesian Estimator * - * @param[in] *S points to a naive bayes instance structure - * @param[in] *in points to the elements of the input vector. - * @param[in] *pBuffer points to a buffer of length numberOfClasses + * @param[in] *S points to a naive bayes instance structure + * @param[in] *in points to the elements of the input vector. + * @param[out] *pOutputProbabilities points to a buffer of length numberOfClasses containing estimated probabilities + * @param[out] *pBufferB points to a temporary buffer of length numberOfClasses * @return The predicted class * - * @par If the number of classes is big, MVE version will consume lot of - * stack since the log prior are computed on the stack. * */ @@ -60,19 +60,21 @@ uint32_t arm_gaussian_naive_bayes_predict_f16(const arm_gaussian_naive_bayes_instance_f16 *S, const float16_t * in, - float16_t *pBuffer) + float16_t *pOutputProbabilities, + float16_t *pBufferB + ) { uint32_t nbClass; const float16_t *pTheta = S->theta; const float16_t *pSigma = S->sigma; - float16_t *buffer = pBuffer; + float16_t *buffer = pOutputProbabilities; const float16_t *pIn = in; float16_t result; f16x8_t vsigma; _Float16 tmp; f16x8_t vacc1, vacc2; uint32_t index; - float16_t logclassPriors[S->numberOfClasses]; + float16_t *logclassPriors=pBufferB; float16_t *pLogPrior = logclassPriors; arm_vlog_f16((float16_t *) S->classPriors, logclassPriors, S->numberOfClasses); @@ -131,42 +133,35 @@ uint32_t arm_gaussian_naive_bayes_predict_f16(const arm_gaussian_naive_bayes_ins tmp = -0.5f16 * (_Float16)vecAddAcrossF16Mve(vacc1); tmp -= 0.5f16 * (_Float16)vecAddAcrossF16Mve(vacc2); - *buffer = tmp + *pLogPrior++; + *buffer = (_Float16)tmp + (_Float16)*pLogPrior++; buffer++; } - arm_max_f16(pBuffer, S->numberOfClasses, &result, &index); + arm_max_f16(pOutputProbabilities, S->numberOfClasses, &result, &index); return (index); } #else -/** - * @brief Naive Gaussian Bayesian Estimator - * - * @param[in] *S points to a naive bayes instance structure - * @param[in] *in points to the elements of the input vector. - * @param[in] *pBuffer points to a buffer of length numberOfClasses - * @return The predicted class - * - */ uint32_t arm_gaussian_naive_bayes_predict_f16(const arm_gaussian_naive_bayes_instance_f16 *S, const float16_t * in, - float16_t *pBuffer) + float16_t *pOutputProbabilities, + float16_t *pBufferB) { uint32_t nbClass; uint32_t nbDim; const float16_t *pPrior = S->classPriors; const float16_t *pTheta = S->theta; const float16_t *pSigma = S->sigma; - float16_t *buffer = pBuffer; + float16_t *buffer = pOutputProbabilities; const float16_t *pIn=in; float16_t result; _Float16 sigma; _Float16 tmp; _Float16 acc1,acc2; uint32_t index; + (void)pBufferB; pTheta=S->theta; pSigma=S->sigma; @@ -182,24 +177,24 @@ uint32_t arm_gaussian_naive_bayes_predict_f16(const arm_gaussian_naive_bayes_ins acc2 = 0.0f16; for(nbDim = 0; nbDim < S->vectorDimension; nbDim++) { - sigma = *pSigma + S->epsilon; - acc1 += logf(2.0f16 * (_Float16)PI_F * sigma); - acc2 += (*pIn - *pTheta) * (*pIn - *pTheta) / sigma; + sigma = (_Float16)*pSigma + (_Float16)S->epsilon; + acc1 += (_Float16)logf(2.0f * PI * (float32_t)sigma); + acc2 += ((_Float16)*pIn - (_Float16)*pTheta) * ((_Float16)*pIn - (_Float16)*pTheta) / (_Float16)sigma; pIn++; pTheta++; pSigma++; } - tmp = -0.5f16 * acc1; - tmp -= 0.5f16 * acc2; + tmp = -0.5f16 * (_Float16)acc1; + tmp -= 0.5f16 * (_Float16)acc2; - *buffer = tmp + logf(*pPrior++); + *buffer = (_Float16)tmp + (_Float16)logf((float32_t)*pPrior++); buffer++; } - arm_max_f16(pBuffer,S->numberOfClasses,&result,&index); + arm_max_f16(pOutputProbabilities,S->numberOfClasses,&result,&index); return(index); } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/BayesFunctions/arm_gaussian_naive_bayes_predict_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/BayesFunctions/arm_gaussian_naive_bayes_predict_f32.c index 24b89e7..30d1ab9 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/BayesFunctions/arm_gaussian_naive_bayes_predict_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/BayesFunctions/arm_gaussian_naive_bayes_predict_f32.c @@ -5,11 +5,13 @@ * Title: arm_naive_gaussian_bayes_predict_f32 * Description: Naive Gaussian Bayesian Estimator * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -41,13 +43,12 @@ /** * @brief Naive Gaussian Bayesian Estimator * - * @param[in] *S points to a naive bayes instance structure - * @param[in] *in points to the elements of the input vector. - * @param[in] *pBuffer points to a buffer of length numberOfClasses + * @param[in] *S points to a naive bayes instance structure + * @param[in] *in points to the elements of the input vector. + * @param[out] *pOutputProbabilities points to a buffer of length numberOfClasses containing estimated probabilities + * @param[out] *pBufferB points to a temporary buffer of length numberOfClasses * @return The predicted class * - * @par If the number of classes is big, MVE version will consume lot of - * stack since the log prior are computed on the stack. * */ @@ -58,19 +59,21 @@ uint32_t arm_gaussian_naive_bayes_predict_f32(const arm_gaussian_naive_bayes_instance_f32 *S, const float32_t * in, - float32_t *pBuffer) + float32_t *pOutputProbabilities, + float32_t *pBufferB + ) { uint32_t nbClass; const float32_t *pTheta = S->theta; const float32_t *pSigma = S->sigma; - float32_t *buffer = pBuffer; + float32_t *buffer = pOutputProbabilities; const float32_t *pIn = in; float32_t result; f32x4_t vsigma; float32_t tmp; f32x4_t vacc1, vacc2; uint32_t index; - float32_t logclassPriors[S->numberOfClasses]; + float32_t *logclassPriors=pBufferB; float32_t *pLogPrior = logclassPriors; arm_vlog_f32((float32_t *) S->classPriors, logclassPriors, S->numberOfClasses); @@ -133,7 +136,7 @@ uint32_t arm_gaussian_naive_bayes_predict_f32(const arm_gaussian_naive_bayes_ins buffer++; } - arm_max_f32(pBuffer, S->numberOfClasses, &result, &index); + arm_max_f32(pOutputProbabilities, S->numberOfClasses, &result, &index); return (index); } @@ -148,7 +151,8 @@ uint32_t arm_gaussian_naive_bayes_predict_f32(const arm_gaussian_naive_bayes_ins uint32_t arm_gaussian_naive_bayes_predict_f32(const arm_gaussian_naive_bayes_instance_f32 *S, const float32_t * in, - float32_t *pBuffer) + float32_t *pOutputProbabilities, + float32_t *pBufferB) { const float32_t *pPrior = S->classPriors; @@ -159,7 +163,7 @@ uint32_t arm_gaussian_naive_bayes_predict_f32(const arm_gaussian_naive_bayes_ins const float32_t *pTheta1 = S->theta + S->vectorDimension; const float32_t *pSigma1 = S->sigma + S->vectorDimension; - float32_t *buffer = pBuffer; + float32_t *buffer = pOutputProbabilities; const float32_t *pIn=in; float32_t result; @@ -174,6 +178,7 @@ uint32_t arm_gaussian_naive_bayes_predict_f32(const arm_gaussian_naive_bayes_ins float32x2_t tmpV2; float32x4_t thetaV,thetaV1; float32x4_t inV; + (void)pBufferB; epsilonV = vdupq_n_f32(S->epsilon); @@ -322,32 +327,24 @@ uint32_t arm_gaussian_naive_bayes_predict_f32(const arm_gaussian_naive_bayes_ins classBlkCnt--; } - arm_max_f32(pBuffer,S->numberOfClasses,&result,&index); + arm_max_f32(pOutputProbabilities,S->numberOfClasses,&result,&index); return(index); } #else -/** - * @brief Naive Gaussian Bayesian Estimator - * - * @param[in] *S points to a naive bayes instance structure - * @param[in] *in points to the elements of the input vector. - * @param[in] *pBuffer points to a buffer of length numberOfClasses - * @return The predicted class - * - */ uint32_t arm_gaussian_naive_bayes_predict_f32(const arm_gaussian_naive_bayes_instance_f32 *S, const float32_t * in, - float32_t *pBuffer) + float32_t *pOutputProbabilities, + float32_t *pBufferB) { uint32_t nbClass; uint32_t nbDim; const float32_t *pPrior = S->classPriors; const float32_t *pTheta = S->theta; const float32_t *pSigma = S->sigma; - float32_t *buffer = pBuffer; + float32_t *buffer = pOutputProbabilities; const float32_t *pIn=in; float32_t result; float32_t sigma; @@ -355,6 +352,8 @@ uint32_t arm_gaussian_naive_bayes_predict_f32(const arm_gaussian_naive_bayes_ins float32_t acc1,acc2; uint32_t index; + (void)pBufferB; + pTheta=S->theta; pSigma=S->sigma; @@ -386,7 +385,7 @@ uint32_t arm_gaussian_naive_bayes_predict_f32(const arm_gaussian_naive_bayes_ins buffer++; } - arm_max_f32(pBuffer,S->numberOfClasses,&result,&index); + arm_max_f32(pOutputProbabilities,S->numberOfClasses,&result,&index); return(index); } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_common_tables.c b/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_common_tables.c index c059075..28a2085 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_common_tables.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_common_tables.c @@ -5,13 +5,13 @@ * Title: arm_common_tables.c * Description: common tables like fft twiddle factors, Bitreverse, reciprocal etc * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -70509,8 +70509,36 @@ const q15_t sqrtTable_Q15[256] = { #endif #endif /* defined(ARM_MATH_MVEI) */ +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SQRT_Q31) +/* +ClearAll[tofix]; +tofix[q_][a_] := With[{r = Round[a*2^q]}, + If[r > (2^q - 1), 2^q - 1, r] + ]; + +(* For q = format, 2^nb is length of the table *) +With[{q = 15, nb = 4, q12quarter = 16^^2000}, + With[{shift = Echo[q - nb]}, + Table[tofix[q][1.0/Sqrt[1.0*i/2^q]/8.0], {i, 2^(q - 2), + 2^q + q12quarter - 1, 2^shift}]] + ] // CopyToClipboard + +*/ +const q31_t sqrt_initial_lut_q31[32]={536870912, 506166750, 480191942, 457845052, 438353264, 421156193, \ +405836263, 392075079, 379625062, 368290407, 357913941, 348367849, \ +339546978, 331363921, 323745341, 316629190, 309962566, 303700050, \ +297802400, 292235509, 286969573, 281978417, 277238947, 272730696, \ +268435456, 264336964, 260420644, 256673389, 253083375, 249639903, \ +246333269, 243154642}; +#endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SQRT_Q31) */ + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SQRT_Q15) +const q15_t sqrt_initial_lut_q15[16]={8192, 7327, 6689, 6193, 5793, 5461, 5181, 4940, 4730, 4544, 4379, \ +4230, 4096, 3974, 3862, 3759}; +#endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SQRT_Q15) */ + -#endif /* if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FAST_TABLES) */ +#endif /* #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FAST_ALLOW_TABLES) */ #if (defined(ARM_MATH_MVEF) || defined(ARM_MATH_HELIUM)) && !defined(ARM_MATH_AUTOVECTORIZE) const float32_t exp_tab[8] = { diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_common_tables_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_common_tables_f16.c index 9541c33..d71efb8 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_common_tables_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_common_tables_f16.c @@ -5,13 +5,13 @@ * Title: arm_common_tables_f16.c * Description: common tables like fft twiddle factors, Bitreverse, reciprocal etc * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_const_structs.c b/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_const_structs.c index 9dd7af5..30b810a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_const_structs.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_const_structs.c @@ -6,13 +6,13 @@ * Description: Constant structs that are initialized for user convenience. * For example, some can be given as arguments to the arm_cfft_f32() or arm_rfft_f32() functions. * - * $Date: 27. January 2017 - * $Revision: V.1.5.1 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_const_structs_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_const_structs_f16.c index 5e326cb..603e423 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_const_structs_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_const_structs_f16.c @@ -6,13 +6,13 @@ * Description: Constant structs that are initialized for user convenience. * For example, some can be given as arguments to the arm_cfft_f32() or arm_rfft_f32() functions. * - * $Date: 27. January 2017 - * $Revision: V.1.5.1 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_mve_tables.c b/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_mve_tables.c index b6c845c..ba5aa16 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_mve_tables.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_mve_tables.c @@ -6,12 +6,13 @@ * Description: common tables like fft twiddle factors, Bitreverse, reciprocal etc * used for MVE implementation only * - * $Date: 14. April 2020 + * @version V1.10.0 + * @date 04 October 2021 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -28,8 +29,10 @@ * limitations under the License. */ + #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types.h" + -#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types.h" + #if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) @@ -47,19 +50,19 @@ uint32_t rearranged_twiddle_tab_stride3_arr_16_f32[2]={ 0,0,}; float32_t rearranged_twiddle_stride1_16_f32[8]={ -1.00000000000000000000f,0.00000000000000000000f,0.92387953251128673848f, -0.38268343236508978178f,0.70710678118654757274f,0.70710678118654757274f, -0.38268343236508983729f,0.92387953251128673848f,}; +1.00000000000000000000f,0.00000000000000000000f,0.92387950420379638672f, +0.38268342614173889160f,0.70710676908493041992f,0.70710676908493041992f, +0.38268342614173889160f,0.92387950420379638672f,}; float32_t rearranged_twiddle_stride2_16_f32[8]={ -1.00000000000000000000f,0.00000000000000000000f,0.70710678118654757274f, -0.70710678118654757274f,0.00000000000000006123f,1.00000000000000000000f, --0.70710678118654746172f,0.70710678118654757274f,}; +1.00000000000000000000f,0.00000000000000000000f,0.70710676908493041992f, +0.70710676908493041992f,0.00000000000000006123f,1.00000000000000000000f, +-0.70710676908493041992f,0.70710676908493041992f,}; float32_t rearranged_twiddle_stride3_16_f32[8]={ -1.00000000000000000000f,0.00000000000000000000f,0.38268343236508983729f, -0.92387953251128673848f,-0.70710678118654746172f,0.70710678118654757274f, --0.92387953251128684951f,-0.38268343236508967076f,}; +1.00000000000000000000f,0.00000000000000000000f,0.38268342614173889160f, +0.92387950420379638672f,-0.70710676908493041992f,0.70710676908493041992f, +-0.92387950420379638672f,-0.38268342614173889160f,}; #endif @@ -75,52 +78,52 @@ uint32_t rearranged_twiddle_tab_stride3_arr_64_f32[3]={ 0,32,0,}; float32_t rearranged_twiddle_stride1_64_f32[40]={ -1.00000000000000000000f,0.00000000000000000000f,0.99518472667219692873f, -0.09801714032956060363f,0.98078528040323043058f,0.19509032201612824808f, -0.95694033573220882438f,0.29028467725446233105f,0.92387953251128673848f, -0.38268343236508978178f,0.88192126434835504956f,0.47139673682599764204f, -0.83146961230254523567f,0.55557023301960217765f,0.77301045336273699338f, -0.63439328416364548779f,0.70710678118654757274f,0.70710678118654757274f, -0.63439328416364548779f,0.77301045336273688235f,0.55557023301960228867f, -0.83146961230254523567f,0.47139673682599780857f,0.88192126434835493853f, -0.38268343236508983729f,0.92387953251128673848f,0.29028467725446233105f, -0.95694033573220893540f,0.19509032201612833135f,0.98078528040323043058f, -0.09801714032956077016f,0.99518472667219681771f,1.00000000000000000000f, -0.00000000000000000000f,0.92387953251128673848f,0.38268343236508978178f, -0.70710678118654757274f,0.70710678118654757274f,0.38268343236508983729f, -0.92387953251128673848f,}; +1.00000000000000000000f,0.00000000000000000000f,0.99518471956253051758f, +0.09801714122295379639f,0.98078525066375732422f,0.19509032368659973145f, +0.95694035291671752930f,0.29028466343879699707f,0.92387950420379638672f, +0.38268342614173889160f,0.88192129135131835938f,0.47139674425125122070f, +0.83146959543228149414f,0.55557024478912353516f,0.77301043272018432617f, +0.63439327478408813477f,0.70710676908493041992f,0.70710676908493041992f, +0.63439327478408813477f,0.77301043272018432617f,0.55557024478912353516f, +0.83146959543228149414f,0.47139674425125122070f,0.88192129135131835938f, +0.38268342614173889160f,0.92387950420379638672f,0.29028466343879699707f, +0.95694035291671752930f,0.19509032368659973145f,0.98078525066375732422f, +0.09801714122295379639f,0.99518471956253051758f,1.00000000000000000000f, +0.00000000000000000000f,0.92387950420379638672f,0.38268342614173889160f, +0.70710676908493041992f,0.70710676908493041992f,0.38268342614173889160f, +0.92387950420379638672f,}; float32_t rearranged_twiddle_stride2_64_f32[40]={ -1.00000000000000000000f,0.00000000000000000000f,0.98078528040323043058f, -0.19509032201612824808f,0.92387953251128673848f,0.38268343236508978178f, -0.83146961230254523567f,0.55557023301960217765f,0.70710678118654757274f, -0.70710678118654757274f,0.55557023301960228867f,0.83146961230254523567f, -0.38268343236508983729f,0.92387953251128673848f,0.19509032201612833135f, -0.98078528040323043058f,0.00000000000000006123f,1.00000000000000000000f, --0.19509032201612819257f,0.98078528040323043058f,-0.38268343236508972627f, -0.92387953251128673848f,-0.55557023301960195560f,0.83146961230254534669f, --0.70710678118654746172f,0.70710678118654757274f,-0.83146961230254534669f, -0.55557023301960217765f,-0.92387953251128673848f,0.38268343236508989280f, --0.98078528040323043058f,0.19509032201612860891f,1.00000000000000000000f, -0.00000000000000000000f,0.70710678118654757274f,0.70710678118654757274f, -0.00000000000000006123f,1.00000000000000000000f,-0.70710678118654746172f, -0.70710678118654757274f,}; +1.00000000000000000000f,0.00000000000000000000f,0.98078525066375732422f, +0.19509032368659973145f,0.92387950420379638672f,0.38268342614173889160f, +0.83146959543228149414f,0.55557024478912353516f,0.70710676908493041992f, +0.70710676908493041992f,0.55557024478912353516f,0.83146959543228149414f, +0.38268342614173889160f,0.92387950420379638672f,0.19509032368659973145f, +0.98078525066375732422f,0.00000000000000006123f,1.00000000000000000000f, +-0.19509032368659973145f,0.98078525066375732422f,-0.38268342614173889160f, +0.92387950420379638672f,-0.55557024478912353516f,0.83146959543228149414f, +-0.70710676908493041992f,0.70710676908493041992f,-0.83146959543228149414f, +0.55557024478912353516f,-0.92387950420379638672f,0.38268342614173889160f, +-0.98078525066375732422f,0.19509032368659973145f,1.00000000000000000000f, +0.00000000000000000000f,0.70710676908493041992f,0.70710676908493041992f, +0.00000000000000006123f,1.00000000000000000000f,-0.70710676908493041992f, +0.70710676908493041992f,}; float32_t rearranged_twiddle_stride3_64_f32[40]={ -1.00000000000000000000f,0.00000000000000000000f,0.95694033573220882438f, -0.29028467725446233105f,0.83146961230254523567f,0.55557023301960217765f, -0.63439328416364548779f,0.77301045336273688235f,0.38268343236508983729f, -0.92387953251128673848f,0.09801714032956077016f,0.99518472667219681771f, --0.19509032201612819257f,0.98078528040323043058f,-0.47139673682599769755f, -0.88192126434835504956f,-0.70710678118654746172f,0.70710678118654757274f, --0.88192126434835493853f,0.47139673682599780857f,-0.98078528040323043058f, -0.19509032201612860891f,-0.99518472667219692873f,-0.09801714032956058975f, --0.92387953251128684951f,-0.38268343236508967076f,-0.77301045336273710440f, --0.63439328416364526575f,-0.55557023301960217765f,-0.83146961230254523567f, --0.29028467725446244208f,-0.95694033573220882438f,1.00000000000000000000f, -0.00000000000000000000f,0.38268343236508983729f,0.92387953251128673848f, --0.70710678118654746172f,0.70710678118654757274f,-0.92387953251128684951f, --0.38268343236508967076f,}; +1.00000000000000000000f,0.00000000000000000000f,0.95694035291671752930f, +0.29028466343879699707f,0.83146959543228149414f,0.55557024478912353516f, +0.63439327478408813477f,0.77301043272018432617f,0.38268342614173889160f, +0.92387950420379638672f,0.09801714122295379639f,0.99518471956253051758f, +-0.19509032368659973145f,0.98078525066375732422f,-0.47139674425125122070f, +0.88192129135131835938f,-0.70710676908493041992f,0.70710676908493041992f, +-0.88192129135131835938f,0.47139674425125122070f,-0.98078525066375732422f, +0.19509032368659973145f,-0.99518471956253051758f,-0.09801714122295379639f, +-0.92387950420379638672f,-0.38268342614173889160f,-0.77301043272018432617f, +-0.63439327478408813477f,-0.55557024478912353516f,-0.83146959543228149414f, +-0.29028466343879699707f,-0.95694035291671752930f,1.00000000000000000000f, +0.00000000000000000000f,0.38268342614173889160f,0.92387950420379638672f, +-0.70710676908493041992f,0.70710676908493041992f,-0.92387950420379638672f, +-0.38268342614173889160f,}; #endif @@ -136,178 +139,178 @@ uint32_t rearranged_twiddle_tab_stride3_arr_256_f32[4]={ 0,128,160,0,}; float32_t rearranged_twiddle_stride1_256_f32[168]={ -1.00000000000000000000f,0.00000000000000000000f,0.99969881869620424997f, -0.02454122852291228812f,0.99879545620517240501f,0.04906767432741801493f, -0.99729045667869020697f,0.07356456359966742631f,0.99518472667219692873f, -0.09801714032956060363f,0.99247953459870996706f,0.12241067519921619566f, -0.98917650996478101444f,0.14673047445536174793f,0.98527764238894122162f, -0.17096188876030121717f,0.98078528040323043058f,0.19509032201612824808f, -0.97570213003852857003f,0.21910124015686979759f,0.97003125319454397424f, -0.24298017990326387094f,0.96377606579543984022f,0.26671275747489836538f, -0.95694033573220882438f,0.29028467725446233105f,0.94952818059303667475f, -0.31368174039889151761f,0.94154406518302080631f,0.33688985339222005111f, -0.93299279883473895669f,0.35989503653498811087f,0.92387953251128673848f, -0.38268343236508978178f,0.91420975570353069095f,0.40524131400498986100f, -0.90398929312344333820f,0.42755509343028208491f,0.89322430119551532446f, -0.44961132965460653965f,0.88192126434835504956f,0.47139673682599764204f, -0.87008699110871146054f,0.49289819222978403790f,0.85772861000027211809f, -0.51410274419322166128f,0.84485356524970711689f,0.53499761988709715332f, -0.83146961230254523567f,0.55557023301960217765f,0.81758481315158371139f, -0.57580819141784533866f,0.80320753148064494287f,0.59569930449243335691f, -0.78834642762660622761f,0.61523159058062681925f,0.77301045336273699338f, -0.63439328416364548779f,0.75720884650648456748f,0.65317284295377675551f, -0.74095112535495921691f,0.67155895484701833009f,0.72424708295146700276f, -0.68954054473706682948f,0.70710678118654757274f,0.70710678118654757274f, -0.68954054473706694051f,0.72424708295146689174f,0.67155895484701833009f, -0.74095112535495910588f,0.65317284295377686654f,0.75720884650648456748f, -0.63439328416364548779f,0.77301045336273688235f,0.61523159058062681925f, -0.78834642762660622761f,0.59569930449243346793f,0.80320753148064483184f, -0.57580819141784533866f,0.81758481315158371139f,0.55557023301960228867f, -0.83146961230254523567f,0.53499761988709726435f,0.84485356524970700587f, -0.51410274419322166128f,0.85772861000027211809f,0.49289819222978409341f, -0.87008699110871134952f,0.47139673682599780857f,0.88192126434835493853f, -0.44961132965460659516f,0.89322430119551532446f,0.42755509343028219593f, -0.90398929312344333820f,0.40524131400498986100f,0.91420975570353069095f, -0.38268343236508983729f,0.92387953251128673848f,0.35989503653498827740f, -0.93299279883473884567f,0.33688985339222005111f,0.94154406518302080631f, -0.31368174039889157312f,0.94952818059303667475f,0.29028467725446233105f, -0.95694033573220893540f,0.26671275747489842090f,0.96377606579543984022f, -0.24298017990326398197f,0.97003125319454397424f,0.21910124015686976984f, -0.97570213003852857003f,0.19509032201612833135f,0.98078528040323043058f, -0.17096188876030135595f,0.98527764238894122162f,0.14673047445536174793f, -0.98917650996478101444f,0.12241067519921627893f,0.99247953459870996706f, -0.09801714032956077016f,0.99518472667219681771f,0.07356456359966745406f, -0.99729045667869020697f,0.04906767432741812596f,0.99879545620517240501f, -0.02454122852291226384f,0.99969881869620424997f,1.00000000000000000000f, -0.00000000000000000000f,0.99518472667219692873f,0.09801714032956060363f, -0.98078528040323043058f,0.19509032201612824808f,0.95694033573220882438f, -0.29028467725446233105f,0.92387953251128673848f,0.38268343236508978178f, -0.88192126434835504956f,0.47139673682599764204f,0.83146961230254523567f, -0.55557023301960217765f,0.77301045336273699338f,0.63439328416364548779f, -0.70710678118654757274f,0.70710678118654757274f,0.63439328416364548779f, -0.77301045336273688235f,0.55557023301960228867f,0.83146961230254523567f, -0.47139673682599780857f,0.88192126434835493853f,0.38268343236508983729f, -0.92387953251128673848f,0.29028467725446233105f,0.95694033573220893540f, -0.19509032201612833135f,0.98078528040323043058f,0.09801714032956077016f, -0.99518472667219681771f,1.00000000000000000000f,0.00000000000000000000f, -0.92387953251128673848f,0.38268343236508978178f,0.70710678118654757274f, -0.70710678118654757274f,0.38268343236508983729f,0.92387953251128673848f,}; +1.00000000000000000000f,0.00000000000000000000f,0.99969881772994995117f, +0.02454122900962829590f,0.99879544973373413086f,0.04906767606735229492f, +0.99729043245315551758f,0.07356456667184829712f,0.99518471956253051758f, +0.09801714122295379639f,0.99247956275939941406f,0.12241067737340927124f, +0.98917651176452636719f,0.14673046767711639404f,0.98527765274047851562f, +0.17096188664436340332f,0.98078525066375732422f,0.19509032368659973145f, +0.97570210695266723633f,0.21910123527050018311f,0.97003126144409179688f, +0.24298018217086791992f,0.96377605199813842773f,0.26671275496482849121f, +0.95694035291671752930f,0.29028466343879699707f,0.94952815771102905273f, +0.31368175148963928223f,0.94154405593872070312f,0.33688986301422119141f, +0.93299281597137451172f,0.35989505052566528320f,0.92387950420379638672f, +0.38268342614173889160f,0.91420978307723999023f,0.40524131059646606445f, +0.90398931503295898438f,0.42755508422851562500f,0.89322429895401000977f, +0.44961133599281311035f,0.88192129135131835938f,0.47139674425125122070f, +0.87008696794509887695f,0.49289819598197937012f,0.85772860050201416016f, +0.51410275697708129883f,0.84485357999801635742f,0.53499764204025268555f, +0.83146959543228149414f,0.55557024478912353516f,0.81758481264114379883f, +0.57580816745758056641f,0.80320751667022705078f,0.59569931030273437500f, +0.78834640979766845703f,0.61523157358169555664f,0.77301043272018432617f, +0.63439327478408813477f,0.75720882415771484375f,0.65317285060882568359f, +0.74095112085342407227f,0.67155897617340087891f,0.72424709796905517578f, +0.68954056501388549805f,0.70710676908493041992f,0.70710676908493041992f, +0.68954056501388549805f,0.72424709796905517578f,0.67155897617340087891f, +0.74095112085342407227f,0.65317285060882568359f,0.75720882415771484375f, +0.63439327478408813477f,0.77301043272018432617f,0.61523157358169555664f, +0.78834640979766845703f,0.59569931030273437500f,0.80320751667022705078f, +0.57580816745758056641f,0.81758481264114379883f,0.55557024478912353516f, +0.83146959543228149414f,0.53499764204025268555f,0.84485357999801635742f, +0.51410275697708129883f,0.85772860050201416016f,0.49289819598197937012f, +0.87008696794509887695f,0.47139674425125122070f,0.88192129135131835938f, +0.44961133599281311035f,0.89322429895401000977f,0.42755508422851562500f, +0.90398931503295898438f,0.40524131059646606445f,0.91420978307723999023f, +0.38268342614173889160f,0.92387950420379638672f,0.35989505052566528320f, +0.93299281597137451172f,0.33688986301422119141f,0.94154405593872070312f, +0.31368175148963928223f,0.94952815771102905273f,0.29028466343879699707f, +0.95694035291671752930f,0.26671275496482849121f,0.96377605199813842773f, +0.24298018217086791992f,0.97003126144409179688f,0.21910123527050018311f, +0.97570210695266723633f,0.19509032368659973145f,0.98078525066375732422f, +0.17096188664436340332f,0.98527765274047851562f,0.14673046767711639404f, +0.98917651176452636719f,0.12241067737340927124f,0.99247956275939941406f, +0.09801714122295379639f,0.99518471956253051758f,0.07356456667184829712f, +0.99729043245315551758f,0.04906767606735229492f,0.99879544973373413086f, +0.02454122900962829590f,0.99969881772994995117f,1.00000000000000000000f, +0.00000000000000000000f,0.99518471956253051758f,0.09801714122295379639f, +0.98078525066375732422f,0.19509032368659973145f,0.95694035291671752930f, +0.29028466343879699707f,0.92387950420379638672f,0.38268342614173889160f, +0.88192129135131835938f,0.47139674425125122070f,0.83146959543228149414f, +0.55557024478912353516f,0.77301043272018432617f,0.63439327478408813477f, +0.70710676908493041992f,0.70710676908493041992f,0.63439327478408813477f, +0.77301043272018432617f,0.55557024478912353516f,0.83146959543228149414f, +0.47139674425125122070f,0.88192129135131835938f,0.38268342614173889160f, +0.92387950420379638672f,0.29028466343879699707f,0.95694035291671752930f, +0.19509032368659973145f,0.98078525066375732422f,0.09801714122295379639f, +0.99518471956253051758f,1.00000000000000000000f,0.00000000000000000000f, +0.92387950420379638672f,0.38268342614173889160f,0.70710676908493041992f, +0.70710676908493041992f,0.38268342614173889160f,0.92387950420379638672f,}; float32_t rearranged_twiddle_stride2_256_f32[168]={ -1.00000000000000000000f,0.00000000000000000000f,0.99879545620517240501f, -0.04906767432741801493f,0.99518472667219692873f,0.09801714032956060363f, -0.98917650996478101444f,0.14673047445536174793f,0.98078528040323043058f, -0.19509032201612824808f,0.97003125319454397424f,0.24298017990326387094f, -0.95694033573220882438f,0.29028467725446233105f,0.94154406518302080631f, -0.33688985339222005111f,0.92387953251128673848f,0.38268343236508978178f, -0.90398929312344333820f,0.42755509343028208491f,0.88192126434835504956f, -0.47139673682599764204f,0.85772861000027211809f,0.51410274419322166128f, -0.83146961230254523567f,0.55557023301960217765f,0.80320753148064494287f, -0.59569930449243335691f,0.77301045336273699338f,0.63439328416364548779f, -0.74095112535495921691f,0.67155895484701833009f,0.70710678118654757274f, -0.70710678118654757274f,0.67155895484701833009f,0.74095112535495910588f, -0.63439328416364548779f,0.77301045336273688235f,0.59569930449243346793f, -0.80320753148064483184f,0.55557023301960228867f,0.83146961230254523567f, -0.51410274419322166128f,0.85772861000027211809f,0.47139673682599780857f, -0.88192126434835493853f,0.42755509343028219593f,0.90398929312344333820f, -0.38268343236508983729f,0.92387953251128673848f,0.33688985339222005111f, -0.94154406518302080631f,0.29028467725446233105f,0.95694033573220893540f, -0.24298017990326398197f,0.97003125319454397424f,0.19509032201612833135f, -0.98078528040323043058f,0.14673047445536174793f,0.98917650996478101444f, -0.09801714032956077016f,0.99518472667219681771f,0.04906767432741812596f, -0.99879545620517240501f,0.00000000000000006123f,1.00000000000000000000f, --0.04906767432741800800f,0.99879545620517240501f,-0.09801714032956064526f, -0.99518472667219692873f,-0.14673047445536163691f,0.98917650996478101444f, --0.19509032201612819257f,0.98078528040323043058f,-0.24298017990326387094f, -0.97003125319454397424f,-0.29028467725446216452f,0.95694033573220893540f, --0.33688985339221994009f,0.94154406518302080631f,-0.38268343236508972627f, -0.92387953251128673848f,-0.42755509343028186287f,0.90398929312344344922f, --0.47139673682599769755f,0.88192126434835504956f,-0.51410274419322155026f, -0.85772861000027211809f,-0.55557023301960195560f,0.83146961230254534669f, --0.59569930449243335691f,0.80320753148064494287f,-0.63439328416364537677f, -0.77301045336273710440f,-0.67155895484701844111f,0.74095112535495899486f, --0.70710678118654746172f,0.70710678118654757274f,-0.74095112535495888384f, -0.67155895484701855214f,-0.77301045336273699338f,0.63439328416364548779f, --0.80320753148064483184f,0.59569930449243346793f,-0.83146961230254534669f, -0.55557023301960217765f,-0.85772861000027200706f,0.51410274419322177231f, --0.88192126434835493853f,0.47139673682599780857f,-0.90398929312344333820f, -0.42755509343028202940f,-0.92387953251128673848f,0.38268343236508989280f, --0.94154406518302069529f,0.33688985339222032867f,-0.95694033573220882438f, -0.29028467725446238656f,-0.97003125319454397424f,0.24298017990326406523f, --0.98078528040323043058f,0.19509032201612860891f,-0.98917650996478101444f, -0.14673047445536180344f,-0.99518472667219681771f,0.09801714032956082567f, --0.99879545620517240501f,0.04906767432741796636f,1.00000000000000000000f, -0.00000000000000000000f,0.98078528040323043058f,0.19509032201612824808f, -0.92387953251128673848f,0.38268343236508978178f,0.83146961230254523567f, -0.55557023301960217765f,0.70710678118654757274f,0.70710678118654757274f, -0.55557023301960228867f,0.83146961230254523567f,0.38268343236508983729f, -0.92387953251128673848f,0.19509032201612833135f,0.98078528040323043058f, -0.00000000000000006123f,1.00000000000000000000f,-0.19509032201612819257f, -0.98078528040323043058f,-0.38268343236508972627f,0.92387953251128673848f, --0.55557023301960195560f,0.83146961230254534669f,-0.70710678118654746172f, -0.70710678118654757274f,-0.83146961230254534669f,0.55557023301960217765f, --0.92387953251128673848f,0.38268343236508989280f,-0.98078528040323043058f, -0.19509032201612860891f,1.00000000000000000000f,0.00000000000000000000f, -0.70710678118654757274f,0.70710678118654757274f,0.00000000000000006123f, -1.00000000000000000000f,-0.70710678118654746172f,0.70710678118654757274f,}; +1.00000000000000000000f,0.00000000000000000000f,0.99879544973373413086f, +0.04906767606735229492f,0.99518471956253051758f,0.09801714122295379639f, +0.98917651176452636719f,0.14673046767711639404f,0.98078525066375732422f, +0.19509032368659973145f,0.97003126144409179688f,0.24298018217086791992f, +0.95694035291671752930f,0.29028466343879699707f,0.94154405593872070312f, +0.33688986301422119141f,0.92387950420379638672f,0.38268342614173889160f, +0.90398931503295898438f,0.42755508422851562500f,0.88192129135131835938f, +0.47139674425125122070f,0.85772860050201416016f,0.51410275697708129883f, +0.83146959543228149414f,0.55557024478912353516f,0.80320751667022705078f, +0.59569931030273437500f,0.77301043272018432617f,0.63439327478408813477f, +0.74095112085342407227f,0.67155897617340087891f,0.70710676908493041992f, +0.70710676908493041992f,0.67155897617340087891f,0.74095112085342407227f, +0.63439327478408813477f,0.77301043272018432617f,0.59569931030273437500f, +0.80320751667022705078f,0.55557024478912353516f,0.83146959543228149414f, +0.51410275697708129883f,0.85772860050201416016f,0.47139674425125122070f, +0.88192129135131835938f,0.42755508422851562500f,0.90398931503295898438f, +0.38268342614173889160f,0.92387950420379638672f,0.33688986301422119141f, +0.94154405593872070312f,0.29028466343879699707f,0.95694035291671752930f, +0.24298018217086791992f,0.97003126144409179688f,0.19509032368659973145f, +0.98078525066375732422f,0.14673046767711639404f,0.98917651176452636719f, +0.09801714122295379639f,0.99518471956253051758f,0.04906767606735229492f, +0.99879544973373413086f,0.00000000000000006123f,1.00000000000000000000f, +-0.04906767606735229492f,0.99879544973373413086f,-0.09801714122295379639f, +0.99518471956253051758f,-0.14673046767711639404f,0.98917651176452636719f, +-0.19509032368659973145f,0.98078525066375732422f,-0.24298018217086791992f, +0.97003126144409179688f,-0.29028466343879699707f,0.95694035291671752930f, +-0.33688986301422119141f,0.94154405593872070312f,-0.38268342614173889160f, +0.92387950420379638672f,-0.42755508422851562500f,0.90398931503295898438f, +-0.47139674425125122070f,0.88192129135131835938f,-0.51410275697708129883f, +0.85772860050201416016f,-0.55557024478912353516f,0.83146959543228149414f, +-0.59569931030273437500f,0.80320751667022705078f,-0.63439327478408813477f, +0.77301043272018432617f,-0.67155897617340087891f,0.74095112085342407227f, +-0.70710676908493041992f,0.70710676908493041992f,-0.74095112085342407227f, +0.67155897617340087891f,-0.77301043272018432617f,0.63439327478408813477f, +-0.80320751667022705078f,0.59569931030273437500f,-0.83146959543228149414f, +0.55557024478912353516f,-0.85772860050201416016f,0.51410275697708129883f, +-0.88192129135131835938f,0.47139674425125122070f,-0.90398931503295898438f, +0.42755508422851562500f,-0.92387950420379638672f,0.38268342614173889160f, +-0.94154405593872070312f,0.33688986301422119141f,-0.95694035291671752930f, +0.29028466343879699707f,-0.97003126144409179688f,0.24298018217086791992f, +-0.98078525066375732422f,0.19509032368659973145f,-0.98917651176452636719f, +0.14673046767711639404f,-0.99518471956253051758f,0.09801714122295379639f, +-0.99879544973373413086f,0.04906767606735229492f,1.00000000000000000000f, +0.00000000000000000000f,0.98078525066375732422f,0.19509032368659973145f, +0.92387950420379638672f,0.38268342614173889160f,0.83146959543228149414f, +0.55557024478912353516f,0.70710676908493041992f,0.70710676908493041992f, +0.55557024478912353516f,0.83146959543228149414f,0.38268342614173889160f, +0.92387950420379638672f,0.19509032368659973145f,0.98078525066375732422f, +0.00000000000000006123f,1.00000000000000000000f,-0.19509032368659973145f, +0.98078525066375732422f,-0.38268342614173889160f,0.92387950420379638672f, +-0.55557024478912353516f,0.83146959543228149414f,-0.70710676908493041992f, +0.70710676908493041992f,-0.83146959543228149414f,0.55557024478912353516f, +-0.92387950420379638672f,0.38268342614173889160f,-0.98078525066375732422f, +0.19509032368659973145f,1.00000000000000000000f,0.00000000000000000000f, +0.70710676908493041992f,0.70710676908493041992f,0.00000000000000006123f, +1.00000000000000000000f,-0.70710676908493041992f,0.70710676908493041992f,}; float32_t rearranged_twiddle_stride3_256_f32[168]={ -1.00000000000000000000f,0.00000000000000000000f,0.99729045667869020697f, -0.07356456359966742631f,0.98917650996478101444f,0.14673047445536174793f, -0.97570213003852857003f,0.21910124015686979759f,0.95694033573220882438f, -0.29028467725446233105f,0.93299279883473895669f,0.35989503653498811087f, -0.90398929312344333820f,0.42755509343028208491f,0.87008699110871146054f, -0.49289819222978403790f,0.83146961230254523567f,0.55557023301960217765f, -0.78834642762660622761f,0.61523159058062681925f,0.74095112535495921691f, -0.67155895484701833009f,0.68954054473706694051f,0.72424708295146689174f, -0.63439328416364548779f,0.77301045336273688235f,0.57580819141784533866f, -0.81758481315158371139f,0.51410274419322166128f,0.85772861000027211809f, -0.44961132965460659516f,0.89322430119551532446f,0.38268343236508983729f, -0.92387953251128673848f,0.31368174039889157312f,0.94952818059303667475f, -0.24298017990326398197f,0.97003125319454397424f,0.17096188876030135595f, -0.98527764238894122162f,0.09801714032956077016f,0.99518472667219681771f, -0.02454122852291226384f,0.99969881869620424997f,-0.04906767432741800800f, -0.99879545620517240501f,-0.12241067519921615403f,0.99247953459870996706f, --0.19509032201612819257f,0.98078528040323043058f,-0.26671275747489830987f, -0.96377606579543984022f,-0.33688985339221994009f,0.94154406518302080631f, --0.40524131400498974998f,0.91420975570353069095f,-0.47139673682599769755f, -0.88192126434835504956f,-0.53499761988709704230f,0.84485356524970722791f, --0.59569930449243335691f,0.80320753148064494287f,-0.65317284295377653347f, -0.75720884650648467851f,-0.70710678118654746172f,0.70710678118654757274f, --0.75720884650648467851f,0.65317284295377664449f,-0.80320753148064483184f, -0.59569930449243346793f,-0.84485356524970711689f,0.53499761988709715332f, --0.88192126434835493853f,0.47139673682599780857f,-0.91420975570353069095f, -0.40524131400498991651f,-0.94154406518302069529f,0.33688985339222032867f, --0.96377606579543984022f,0.26671275747489847641f,-0.98078528040323043058f, -0.19509032201612860891f,-0.99247953459870996706f,0.12241067519921634832f, --0.99879545620517240501f,0.04906767432741796636f,-0.99969881869620424997f, --0.02454122852291207996f,-0.99518472667219692873f,-0.09801714032956058975f, --0.98527764238894133264f,-0.17096188876030096737f,-0.97003125319454397424f, --0.24298017990326381543f,-0.94952818059303678577f,-0.31368174039889118454f, --0.92387953251128684951f,-0.38268343236508967076f,-0.89322430119551532446f, --0.44961132965460665067f,-0.85772861000027211809f,-0.51410274419322155026f, --0.81758481315158371139f,-0.57580819141784533866f,-0.77301045336273710440f, --0.63439328416364526575f,-0.72424708295146700276f,-0.68954054473706682948f, --0.67155895484701866316f,-0.74095112535495888384f,-0.61523159058062726334f, --0.78834642762660589455f,-0.55557023301960217765f,-0.83146961230254523567f, --0.49289819222978420443f,-0.87008699110871134952f,-0.42755509343028247349f, --0.90398929312344311615f,-0.35989503653498794433f,-0.93299279883473895669f, --0.29028467725446244208f,-0.95694033573220882438f,-0.21910124015687010290f, --0.97570213003852845901f,-0.14673047445536230304f,-0.98917650996478090342f, --0.07356456359966735692f,-0.99729045667869020697f,1.00000000000000000000f, -0.00000000000000000000f,0.95694033573220882438f,0.29028467725446233105f, -0.83146961230254523567f,0.55557023301960217765f,0.63439328416364548779f, -0.77301045336273688235f,0.38268343236508983729f,0.92387953251128673848f, -0.09801714032956077016f,0.99518472667219681771f,-0.19509032201612819257f, -0.98078528040323043058f,-0.47139673682599769755f,0.88192126434835504956f, --0.70710678118654746172f,0.70710678118654757274f,-0.88192126434835493853f, -0.47139673682599780857f,-0.98078528040323043058f,0.19509032201612860891f, --0.99518472667219692873f,-0.09801714032956058975f,-0.92387953251128684951f, --0.38268343236508967076f,-0.77301045336273710440f,-0.63439328416364526575f, --0.55557023301960217765f,-0.83146961230254523567f,-0.29028467725446244208f, --0.95694033573220882438f,1.00000000000000000000f,0.00000000000000000000f, -0.38268343236508983729f,0.92387953251128673848f,-0.70710678118654746172f, -0.70710678118654757274f,-0.92387953251128684951f,-0.38268343236508967076f,}; +1.00000000000000000000f,0.00000000000000000000f,0.99729043245315551758f, +0.07356456667184829712f,0.98917651176452636719f,0.14673046767711639404f, +0.97570210695266723633f,0.21910123527050018311f,0.95694035291671752930f, +0.29028466343879699707f,0.93299281597137451172f,0.35989505052566528320f, +0.90398931503295898438f,0.42755508422851562500f,0.87008696794509887695f, +0.49289819598197937012f,0.83146959543228149414f,0.55557024478912353516f, +0.78834640979766845703f,0.61523157358169555664f,0.74095112085342407227f, +0.67155897617340087891f,0.68954056501388549805f,0.72424709796905517578f, +0.63439327478408813477f,0.77301043272018432617f,0.57580816745758056641f, +0.81758481264114379883f,0.51410275697708129883f,0.85772860050201416016f, +0.44961133599281311035f,0.89322429895401000977f,0.38268342614173889160f, +0.92387950420379638672f,0.31368175148963928223f,0.94952815771102905273f, +0.24298018217086791992f,0.97003126144409179688f,0.17096188664436340332f, +0.98527765274047851562f,0.09801714122295379639f,0.99518471956253051758f, +0.02454122900962829590f,0.99969881772994995117f,-0.04906767606735229492f, +0.99879544973373413086f,-0.12241067737340927124f,0.99247956275939941406f, +-0.19509032368659973145f,0.98078525066375732422f,-0.26671275496482849121f, +0.96377605199813842773f,-0.33688986301422119141f,0.94154405593872070312f, +-0.40524131059646606445f,0.91420978307723999023f,-0.47139674425125122070f, +0.88192129135131835938f,-0.53499764204025268555f,0.84485357999801635742f, +-0.59569931030273437500f,0.80320751667022705078f,-0.65317285060882568359f, +0.75720882415771484375f,-0.70710676908493041992f,0.70710676908493041992f, +-0.75720882415771484375f,0.65317285060882568359f,-0.80320751667022705078f, +0.59569931030273437500f,-0.84485357999801635742f,0.53499764204025268555f, +-0.88192129135131835938f,0.47139674425125122070f,-0.91420978307723999023f, +0.40524131059646606445f,-0.94154405593872070312f,0.33688986301422119141f, +-0.96377605199813842773f,0.26671275496482849121f,-0.98078525066375732422f, +0.19509032368659973145f,-0.99247956275939941406f,0.12241067737340927124f, +-0.99879544973373413086f,0.04906767606735229492f,-0.99969881772994995117f, +-0.02454122900962829590f,-0.99518471956253051758f,-0.09801714122295379639f, +-0.98527765274047851562f,-0.17096188664436340332f,-0.97003126144409179688f, +-0.24298018217086791992f,-0.94952815771102905273f,-0.31368175148963928223f, +-0.92387950420379638672f,-0.38268342614173889160f,-0.89322429895401000977f, +-0.44961133599281311035f,-0.85772860050201416016f,-0.51410275697708129883f, +-0.81758481264114379883f,-0.57580816745758056641f,-0.77301043272018432617f, +-0.63439327478408813477f,-0.72424709796905517578f,-0.68954056501388549805f, +-0.67155897617340087891f,-0.74095112085342407227f,-0.61523157358169555664f, +-0.78834640979766845703f,-0.55557024478912353516f,-0.83146959543228149414f, +-0.49289819598197937012f,-0.87008696794509887695f,-0.42755508422851562500f, +-0.90398931503295898438f,-0.35989505052566528320f,-0.93299281597137451172f, +-0.29028466343879699707f,-0.95694035291671752930f,-0.21910123527050018311f, +-0.97570210695266723633f,-0.14673046767711639404f,-0.98917651176452636719f, +-0.07356456667184829712f,-0.99729043245315551758f,1.00000000000000000000f, +0.00000000000000000000f,0.95694035291671752930f,0.29028466343879699707f, +0.83146959543228149414f,0.55557024478912353516f,0.63439327478408813477f, +0.77301043272018432617f,0.38268342614173889160f,0.92387950420379638672f, +0.09801714122295379639f,0.99518471956253051758f,-0.19509032368659973145f, +0.98078525066375732422f,-0.47139674425125122070f,0.88192129135131835938f, +-0.70710676908493041992f,0.70710676908493041992f,-0.88192129135131835938f, +0.47139674425125122070f,-0.98078525066375732422f,0.19509032368659973145f, +-0.99518471956253051758f,-0.09801714122295379639f,-0.92387950420379638672f, +-0.38268342614173889160f,-0.77301043272018432617f,-0.63439327478408813477f, +-0.55557024478912353516f,-0.83146959543228149414f,-0.29028466343879699707f, +-0.95694035291671752930f,1.00000000000000000000f,0.00000000000000000000f, +0.38268342614173889160f,0.92387950420379638672f,-0.70710676908493041992f, +0.70710676908493041992f,-0.92387950420379638672f,-0.38268342614173889160f,}; #endif @@ -323,691 +326,691 @@ uint32_t rearranged_twiddle_tab_stride3_arr_1024_f32[5]={ 0,512,640,672,0,}; float32_t rearranged_twiddle_stride1_1024_f32[680]={ -1.00000000000000000000f,0.00000000000000000000f,0.99998117528260110909f, -0.00613588464915447527f,0.99992470183914450299f,0.01227153828571992539f, -0.99983058179582340319f,0.01840672990580482019f,0.99969881869620424997f, -0.02454122852291228812f,0.99952941750109314256f,0.03067480317663662595f, -0.99932238458834954375f,0.03680722294135883171f,0.99907772775264536147f, -0.04293825693494082024f,0.99879545620517240501f,0.04906767432741801493f, -0.99847558057329477421f,0.05519524434968993420f,0.99811811290014917919f, -0.06132073630220857829f,0.99772306664419163624f,0.06744391956366405094f, -0.99729045667869020697f,0.07356456359966742631f,0.99682029929116566791f, -0.07968243797143012563f,0.99631261218277800129f,0.08579731234443989385f, -0.99576741446765981713f,0.09190895649713272386f,0.99518472667219692873f, -0.09801714032956060363f,0.99456457073425541537f,0.10412163387205458642f, -0.99390697000235606051f,0.11022220729388305938f,0.99321194923479450001f, -0.11631863091190475235f,0.99247953459870996706f,0.12241067519921619566f, -0.99170975366909952520f,0.12849811079379316880f,0.99090263542778000971f, -0.13458070850712616773f,0.99005821026229712256f,0.14065823933284921088f, -0.98917650996478101444f,0.14673047445536174793f,0.98825756773074946437f, -0.15279718525844343535f,0.98730141815785843473f,0.15885814333386144570f, -0.98630809724459866938f,0.16491312048996989437f,0.98527764238894122162f, -0.17096188876030121717f,0.98421009238692902521f,0.17700422041214874946f, -0.98310548743121628501f,0.18303988795514095078f,0.98196386910955524296f, -0.18906866414980619262f,0.98078528040323043058f,0.19509032201612824808f, -0.97956976568544051887f,0.20110463484209190055f,0.97831737071962765473f, -0.20711137619221856032f,0.97702814265775439484f,0.21311031991609136194f, -0.97570213003852857003f,0.21910124015686979759f,0.97433938278557585821f, -0.22508391135979283204f,0.97293995220556017678f,0.23105810828067110951f, -0.97150389098625178352f,0.23702360599436719801f,0.97003125319454397424f, -0.24298017990326387094f,0.96852209427441737777f,0.24892760574572014853f, -0.96697647104485207059f,0.25486565960451457169f,0.96539444169768939830f, -0.26079411791527551401f,0.96377606579543984022f,0.26671275747489836538f, -0.96212140426904158019f,0.27262135544994897662f,0.96043051941556578655f, -0.27851968938505305973f,0.95870347489587159906f,0.28440753721127187692f, -0.95694033573220882438f,0.29028467725446233105f,0.95514116830577078243f, -0.29615088824362378883f,0.95330604035419386211f,0.30200594931922808417f, -0.95143502096900833820f,0.30784964004153486661f,0.94952818059303667475f, -0.31368174039889151761f,0.94758559101774109124f,0.31950203081601569188f, -0.94560732538052127971f,0.32531029216226292622f,0.94359345816196038559f, -0.33110630575987642921f,0.94154406518302080631f,0.33688985339222005111f, -0.93945922360218991898f,0.34266071731199437833f,0.93733901191257495977f, -0.34841868024943456472f,0.93518350993894761025f,0.35416352542049034380f, -0.93299279883473895669f,0.35989503653498811087f,0.93076696107898371224f, -0.36561299780477385379f,0.92850608047321558924f,0.37131719395183754306f, -0.92621024213831137928f,0.37700741021641825945f,0.92387953251128673848f, -0.38268343236508978178f,0.92151403934204190183f,0.38834504669882624617f, -0.91911385169005777040f,0.39399204006104809883f,0.91667905992104270485f, -0.39962419984564678810f,0.91420975570353069095f,0.40524131400498986100f, -0.91170603200542987832f,0.41084317105790391089f,0.90916798309052238025f, -0.41642956009763715253f,0.90659570451491533483f,0.42200027079979968159f, -0.90398929312344333820f,0.42755509343028208491f,0.90134884704602202810f, -0.43309381885315195726f,0.89867446569395381673f,0.43861623853852765853f, -0.89596624975618521791f,0.44412214457042920035f,0.89322430119551532446f, -0.44961132965460653965f,0.89044872324475787817f,0.45508358712634383592f, -0.88763962040285393496f,0.46053871095824000514f,0.88479709843093778954f, -0.46597649576796618121f,0.88192126434835504956f,0.47139673682599764204f, -0.87901222642863352519f,0.47679923006332208812f,0.87607009419540660122f, -0.48218377207912271887f,0.87309497841829009079f,0.48755016014843599592f, -0.87008699110871146054f,0.49289819222978403790f,0.86704624551569264845f, -0.49822766697278181303f,0.86397285612158669643f,0.50353838372571757542f, -0.86086693863776730939f,0.50883014254310698909f,0.85772861000027211809f, -0.51410274419322166128f,0.85455798836540053376f,0.51935599016558964269f, -0.85135519310526519554f,0.52458968267846894928f,0.84812034480329723252f, -0.52980362468629460526f,0.84485356524970711689f,0.53499761988709715332f, -0.84155497743689844370f,0.54017147272989285423f,0.83822470555483807875f, -0.54532498842204646383f,0.83486287498638001026f,0.55045797293660481131f, -0.83146961230254523567f,0.55557023301960217765f,0.82804504525775579626f, -0.56066157619733603124f,0.82458930278502529099f,0.56573181078361312046f, -0.82110251499110464835f,0.57078074588696725566f,0.81758481315158371139f, -0.57580819141784533866f,0.81403632970594841378f,0.58081395809576452649f, -0.81045719825259476821f,0.58579785745643886408f,0.80684755354379933401f, -0.59075970185887416442f,0.80320753148064494287f,0.59569930449243335691f, -0.79953726910790501314f,0.60061647938386897305f,0.79583690460888356633f, -0.60551104140432554512f,0.79210657730021238887f,0.61038280627630947528f, -0.78834642762660622761f,0.61523159058062681925f,0.78455659715557524159f, -0.62005721176328909561f,0.78073722857209448822f,0.62485948814238634341f, -0.77688846567323244230f,0.62963823891492698426f,0.77301045336273699338f, -0.63439328416364548779f,0.76910333764557969882f,0.63912444486377573138f, -0.76516726562245895860f,0.64383154288979138613f,0.76120238548426177871f, -0.64851440102211244110f,0.75720884650648456748f,0.65317284295377675551f, -0.75318679904361252042f,0.65780669329707863735f,0.74913639452345937020f, -0.66241577759017178373f,0.74505778544146594733f,0.66699992230363747137f, -0.74095112535495921691f,0.67155895484701833009f,0.73681656887736979300f, -0.67609270357531592310f,0.73265427167241281570f,0.68060099779545302212f, -0.72846439044822519637f,0.68508366777270035541f,0.72424708295146700276f, -0.68954054473706682948f,0.72000250796138165477f,0.69397146088965389055f, -0.71573082528381870571f,0.69837624940897280457f,0.71143219574521643356f, -0.70275474445722529993f,0.70710678118654757274f,0.70710678118654757274f, -0.70275474445722529993f,0.71143219574521643356f,0.69837624940897291559f, -0.71573082528381859468f,0.69397146088965400157f,0.72000250796138165477f, -0.68954054473706694051f,0.72424708295146689174f,0.68508366777270035541f, -0.72846439044822519637f,0.68060099779545302212f,0.73265427167241281570f, -0.67609270357531603413f,0.73681656887736979300f,0.67155895484701833009f, -0.74095112535495910588f,0.66699992230363747137f,0.74505778544146594733f, -0.66241577759017178373f,0.74913639452345925918f,0.65780669329707874837f, -0.75318679904361252042f,0.65317284295377686654f,0.75720884650648456748f, -0.64851440102211255212f,0.76120238548426177871f,0.64383154288979149715f, -0.76516726562245895860f,0.63912444486377573138f,0.76910333764557958780f, -0.63439328416364548779f,0.77301045336273688235f,0.62963823891492709528f, -0.77688846567323244230f,0.62485948814238645443f,0.78073722857209448822f, -0.62005721176328920663f,0.78455659715557524159f,0.61523159058062681925f, -0.78834642762660622761f,0.61038280627630947528f,0.79210657730021227785f, -0.60551104140432554512f,0.79583690460888345530f,0.60061647938386897305f, -0.79953726910790501314f,0.59569930449243346793f,0.80320753148064483184f, -0.59075970185887427544f,0.80684755354379922299f,0.58579785745643886408f, -0.81045719825259476821f,0.58081395809576452649f,0.81403632970594830276f, -0.57580819141784533866f,0.81758481315158371139f,0.57078074588696736669f, -0.82110251499110464835f,0.56573181078361323149f,0.82458930278502529099f, -0.56066157619733603124f,0.82804504525775579626f,0.55557023301960228867f, -0.83146961230254523567f,0.55045797293660481131f,0.83486287498638001026f, -0.54532498842204646383f,0.83822470555483796772f,0.54017147272989296525f, -0.84155497743689833268f,0.53499761988709726435f,0.84485356524970700587f, -0.52980362468629482731f,0.84812034480329712149f,0.52458968267846883826f, -0.85135519310526519554f,0.51935599016558953167f,0.85455798836540053376f, -0.51410274419322166128f,0.85772861000027211809f,0.50883014254310698909f, -0.86086693863776730939f,0.50353838372571757542f,0.86397285612158669643f, -0.49822766697278186854f,0.86704624551569264845f,0.49289819222978409341f, -0.87008699110871134952f,0.48755016014843605143f,0.87309497841829009079f, -0.48218377207912282989f,0.87607009419540660122f,0.47679923006332225466f, -0.87901222642863341417f,0.47139673682599780857f,0.88192126434835493853f, -0.46597649576796612569f,0.88479709843093778954f,0.46053871095824000514f, -0.88763962040285393496f,0.45508358712634383592f,0.89044872324475787817f, -0.44961132965460659516f,0.89322430119551532446f,0.44412214457042925586f, -0.89596624975618510689f,0.43861623853852771404f,0.89867446569395381673f, -0.43309381885315201277f,0.90134884704602202810f,0.42755509343028219593f, -0.90398929312344333820f,0.42200027079979979261f,0.90659570451491533483f, -0.41642956009763731906f,0.90916798309052226923f,0.41084317105790391089f, -0.91170603200542987832f,0.40524131400498986100f,0.91420975570353069095f, -0.39962419984564678810f,0.91667905992104270485f,0.39399204006104809883f, -0.91911385169005777040f,0.38834504669882630168f,0.92151403934204190183f, -0.38268343236508983729f,0.92387953251128673848f,0.37700741021641831496f, -0.92621024213831126826f,0.37131719395183759858f,0.92850608047321558924f, -0.36561299780477396482f,0.93076696107898371224f,0.35989503653498827740f, -0.93299279883473884567f,0.35416352542049051033f,0.93518350993894749923f, -0.34841868024943450921f,0.93733901191257495977f,0.34266071731199437833f, -0.93945922360218991898f,0.33688985339222005111f,0.94154406518302080631f, -0.33110630575987642921f,0.94359345816196038559f,0.32531029216226298173f, -0.94560732538052127971f,0.31950203081601574739f,0.94758559101774109124f, -0.31368174039889157312f,0.94952818059303667475f,0.30784964004153497763f, -0.95143502096900833820f,0.30200594931922819519f,0.95330604035419375109f, -0.29615088824362395536f,0.95514116830577067141f,0.29028467725446233105f, -0.95694033573220893540f,0.28440753721127182141f,0.95870347489587159906f, -0.27851968938505305973f,0.96043051941556578655f,0.27262135544994897662f, -0.96212140426904158019f,0.26671275747489842090f,0.96377606579543984022f, -0.26079411791527556952f,0.96539444169768939830f,0.25486565960451462720f, -0.96697647104485207059f,0.24892760574572025956f,0.96852209427441726675f, -0.24298017990326398197f,0.97003125319454397424f,0.23702360599436733679f, -0.97150389098625178352f,0.23105810828067127605f,0.97293995220556006576f, -0.22508391135979277653f,0.97433938278557585821f,0.21910124015686976984f, -0.97570213003852857003f,0.21311031991609136194f,0.97702814265775439484f, -0.20711137619221856032f,0.97831737071962765473f,0.20110463484209195606f, -0.97956976568544051887f,0.19509032201612833135f,0.98078528040323043058f, -0.18906866414980627589f,0.98196386910955524296f,0.18303988795514106180f, -0.98310548743121628501f,0.17700422041214886049f,0.98421009238692902521f, -0.17096188876030135595f,0.98527764238894122162f,0.16491312048997008866f, -0.98630809724459866938f,0.15885814333386139019f,0.98730141815785843473f, -0.15279718525844340760f,0.98825756773074946437f,0.14673047445536174793f, -0.98917650996478101444f,0.14065823933284923863f,0.99005821026229712256f, -0.13458070850712622324f,0.99090263542778000971f,0.12849811079379322432f, -0.99170975366909952520f,0.12241067519921627893f,0.99247953459870996706f, -0.11631863091190487725f,0.99321194923479450001f,0.11022220729388318428f, -0.99390697000235606051f,0.10412163387205472520f,0.99456457073425541537f, -0.09801714032956077016f,0.99518472667219681771f,0.09190895649713269611f, -0.99576741446765981713f,0.08579731234443987997f,0.99631261218277800129f, -0.07968243797143012563f,0.99682029929116566791f,0.07356456359966745406f, -0.99729045667869020697f,0.06744391956366410645f,0.99772306664419163624f, -0.06132073630220864768f,0.99811811290014917919f,0.05519524434969003135f, -0.99847558057329477421f,0.04906767432741812596f,0.99879545620517240501f, -0.04293825693494095902f,0.99907772775264536147f,0.03680722294135899131f, -0.99932238458834954375f,0.03067480317663658085f,0.99952941750109314256f, -0.02454122852291226384f,0.99969881869620424997f,0.01840672990580482019f, -0.99983058179582340319f,0.01227153828571994447f,0.99992470183914450299f, -0.00613588464915451517f,0.99998117528260110909f,1.00000000000000000000f, -0.00000000000000000000f,0.99969881869620424997f,0.02454122852291228812f, -0.99879545620517240501f,0.04906767432741801493f,0.99729045667869020697f, -0.07356456359966742631f,0.99518472667219692873f,0.09801714032956060363f, -0.99247953459870996706f,0.12241067519921619566f,0.98917650996478101444f, -0.14673047445536174793f,0.98527764238894122162f,0.17096188876030121717f, -0.98078528040323043058f,0.19509032201612824808f,0.97570213003852857003f, -0.21910124015686979759f,0.97003125319454397424f,0.24298017990326387094f, -0.96377606579543984022f,0.26671275747489836538f,0.95694033573220882438f, -0.29028467725446233105f,0.94952818059303667475f,0.31368174039889151761f, -0.94154406518302080631f,0.33688985339222005111f,0.93299279883473895669f, -0.35989503653498811087f,0.92387953251128673848f,0.38268343236508978178f, -0.91420975570353069095f,0.40524131400498986100f,0.90398929312344333820f, -0.42755509343028208491f,0.89322430119551532446f,0.44961132965460653965f, -0.88192126434835504956f,0.47139673682599764204f,0.87008699110871146054f, -0.49289819222978403790f,0.85772861000027211809f,0.51410274419322166128f, -0.84485356524970711689f,0.53499761988709715332f,0.83146961230254523567f, -0.55557023301960217765f,0.81758481315158371139f,0.57580819141784533866f, -0.80320753148064494287f,0.59569930449243335691f,0.78834642762660622761f, -0.61523159058062681925f,0.77301045336273699338f,0.63439328416364548779f, -0.75720884650648456748f,0.65317284295377675551f,0.74095112535495921691f, -0.67155895484701833009f,0.72424708295146700276f,0.68954054473706682948f, -0.70710678118654757274f,0.70710678118654757274f,0.68954054473706694051f, -0.72424708295146689174f,0.67155895484701833009f,0.74095112535495910588f, -0.65317284295377686654f,0.75720884650648456748f,0.63439328416364548779f, -0.77301045336273688235f,0.61523159058062681925f,0.78834642762660622761f, -0.59569930449243346793f,0.80320753148064483184f,0.57580819141784533866f, -0.81758481315158371139f,0.55557023301960228867f,0.83146961230254523567f, -0.53499761988709726435f,0.84485356524970700587f,0.51410274419322166128f, -0.85772861000027211809f,0.49289819222978409341f,0.87008699110871134952f, -0.47139673682599780857f,0.88192126434835493853f,0.44961132965460659516f, -0.89322430119551532446f,0.42755509343028219593f,0.90398929312344333820f, -0.40524131400498986100f,0.91420975570353069095f,0.38268343236508983729f, -0.92387953251128673848f,0.35989503653498827740f,0.93299279883473884567f, -0.33688985339222005111f,0.94154406518302080631f,0.31368174039889157312f, -0.94952818059303667475f,0.29028467725446233105f,0.95694033573220893540f, -0.26671275747489842090f,0.96377606579543984022f,0.24298017990326398197f, -0.97003125319454397424f,0.21910124015686976984f,0.97570213003852857003f, -0.19509032201612833135f,0.98078528040323043058f,0.17096188876030135595f, -0.98527764238894122162f,0.14673047445536174793f,0.98917650996478101444f, -0.12241067519921627893f,0.99247953459870996706f,0.09801714032956077016f, -0.99518472667219681771f,0.07356456359966745406f,0.99729045667869020697f, -0.04906767432741812596f,0.99879545620517240501f,0.02454122852291226384f, -0.99969881869620424997f,1.00000000000000000000f,0.00000000000000000000f, -0.99518472667219692873f,0.09801714032956060363f,0.98078528040323043058f, -0.19509032201612824808f,0.95694033573220882438f,0.29028467725446233105f, -0.92387953251128673848f,0.38268343236508978178f,0.88192126434835504956f, -0.47139673682599764204f,0.83146961230254523567f,0.55557023301960217765f, -0.77301045336273699338f,0.63439328416364548779f,0.70710678118654757274f, -0.70710678118654757274f,0.63439328416364548779f,0.77301045336273688235f, -0.55557023301960228867f,0.83146961230254523567f,0.47139673682599780857f, -0.88192126434835493853f,0.38268343236508983729f,0.92387953251128673848f, -0.29028467725446233105f,0.95694033573220893540f,0.19509032201612833135f, -0.98078528040323043058f,0.09801714032956077016f,0.99518472667219681771f, -1.00000000000000000000f,0.00000000000000000000f,0.92387953251128673848f, -0.38268343236508978178f,0.70710678118654757274f,0.70710678118654757274f, -0.38268343236508983729f,0.92387953251128673848f,}; +1.00000000000000000000f,0.00000000000000000000f,0.99998116493225097656f, +0.00613588467240333557f,0.99992471933364868164f,0.01227153837680816650f, +0.99983060359954833984f,0.01840673014521598816f,0.99969881772994995117f, +0.02454122900962829590f,0.99952942132949829102f,0.03067480400204658508f, +0.99932235479354858398f,0.03680722415447235107f,0.99907773733139038086f, +0.04293825849890708923f,0.99879544973373413086f,0.04906767606735229492f, +0.99847555160522460938f,0.05519524589180946350f,0.99811810255050659180f, +0.06132073700428009033f,0.99772304296493530273f,0.06744392216205596924f, +0.99729043245315551758f,0.07356456667184829712f,0.99682027101516723633f, +0.07968243956565856934f,0.99631261825561523438f,0.08579730987548828125f, +0.99576741456985473633f,0.09190895408391952515f,0.99518471956253051758f, +0.09801714122295379639f,0.99456459283828735352f,0.10412163287401199341f, +0.99390697479248046875f,0.11022220551967620850f,0.99321192502975463867f, +0.11631862819194793701f,0.99247956275939941406f,0.12241067737340927124f, +0.99170976877212524414f,0.12849810719490051270f,0.99090266227722167969f, +0.13458070158958435059f,0.99005818367004394531f,0.14065824449062347412f, +0.98917651176452636719f,0.14673046767711639404f,0.98825758695602416992f, +0.15279719233512878418f,0.98730140924453735352f,0.15885815024375915527f, +0.98630809783935546875f,0.16491311788558959961f,0.98527765274047851562f, +0.17096188664436340332f,0.98421007394790649414f,0.17700421810150146484f, +0.98310548067092895508f,0.18303988873958587646f,0.98196387290954589844f, +0.18906866014003753662f,0.98078525066375732422f,0.19509032368659973145f, +0.97956979274749755859f,0.20110464096069335938f,0.97831737995147705078f, +0.20711137354373931885f,0.97702813148498535156f,0.21311031281948089600f, +0.97570210695266723633f,0.21910123527050018311f,0.97433936595916748047f, +0.22508391737937927246f,0.97293996810913085938f,0.23105810582637786865f, +0.97150391340255737305f,0.23702360689640045166f,0.97003126144409179688f, +0.24298018217086791992f,0.96852207183837890625f,0.24892760813236236572f, +0.96697646379470825195f,0.25486564636230468750f,0.96539443731307983398f, +0.26079410314559936523f,0.96377605199813842773f,0.26671275496482849121f, +0.96212142705917358398f,0.27262136340141296387f,0.96043050289154052734f, +0.27851969003677368164f,0.95870345830917358398f,0.28440752625465393066f, +0.95694035291671752930f,0.29028466343879699707f,0.95514118671417236328f, +0.29615089297294616699f,0.95330601930618286133f,0.30200594663619995117f, +0.95143502950668334961f,0.30784964561462402344f,0.94952815771102905273f, +0.31368175148963928223f,0.94758558273315429688f,0.31950202584266662598f, +0.94560730457305908203f,0.32531028985977172852f,0.94359344244003295898f, +0.33110630512237548828f,0.94154405593872070312f,0.33688986301422119141f, +0.93945920467376708984f,0.34266072511672973633f,0.93733900785446166992f, +0.34841868281364440918f,0.93518352508544921875f,0.35416352748870849609f, +0.93299281597137451172f,0.35989505052566528320f,0.93076694011688232422f, +0.36561298370361328125f,0.92850607633590698242f,0.37131720781326293945f, +0.92621022462844848633f,0.37700742483139038086f,0.92387950420379638672f, +0.38268342614173889160f,0.92151403427124023438f,0.38834503293037414551f, +0.91911387443542480469f,0.39399203658103942871f,0.91667908430099487305f, +0.39962419867515563965f,0.91420978307723999023f,0.40524131059646606445f, +0.91170603036880493164f,0.41084316372871398926f,0.90916800498962402344f, +0.41642954945564270020f,0.90659570693969726562f,0.42200025916099548340f, +0.90398931503295898438f,0.42755508422851562500f,0.90134882926940917969f, +0.43309381604194641113f,0.89867448806762695312f,0.43861624598503112793f, +0.89596623182296752930f,0.44412213563919067383f,0.89322429895401000977f, +0.44961133599281311035f,0.89044874906539916992f,0.45508357882499694824f, +0.88763964176177978516f,0.46053871512413024902f,0.88479709625244140625f, +0.46597650647163391113f,0.88192129135131835938f,0.47139674425125122070f, +0.87901222705841064453f,0.47679921984672546387f,0.87607008218765258789f, +0.48218378424644470215f,0.87309497594833374023f,0.48755016922950744629f, +0.87008696794509887695f,0.49289819598197937012f,0.86704623699188232422f, +0.49822765588760375977f,0.86397284269332885742f,0.50353837013244628906f, +0.86086696386337280273f,0.50883013010025024414f,0.85772860050201416016f, +0.51410275697708129883f,0.85455799102783203125f,0.51935601234436035156f, +0.85135519504547119141f,0.52458965778350830078f,0.84812033176422119141f, +0.52980363368988037109f,0.84485357999801635742f,0.53499764204025268555f, +0.84155499935150146484f,0.54017144441604614258f,0.83822470903396606445f, +0.54532498121261596680f,0.83486288785934448242f,0.55045795440673828125f, +0.83146959543228149414f,0.55557024478912353516f,0.82804507017135620117f, +0.56066155433654785156f,0.82458931207656860352f,0.56573182344436645508f, +0.82110249996185302734f,0.57078075408935546875f,0.81758481264114379883f, +0.57580816745758056641f,0.81403630971908569336f,0.58081394433975219727f, +0.81045717000961303711f,0.58579784631729125977f,0.80684757232666015625f, +0.59075969457626342773f,0.80320751667022705078f,0.59569931030273437500f, +0.79953724145889282227f,0.60061645507812500000f,0.79583692550659179688f, +0.60551106929779052734f,0.79210656881332397461f,0.61038279533386230469f, +0.78834640979766845703f,0.61523157358169555664f,0.78455656766891479492f, +0.62005722522735595703f,0.78073722124099731445f,0.62485951185226440430f, +0.77688848972320556641f,0.62963825464248657227f,0.77301043272018432617f, +0.63439327478408813477f,0.76910334825515747070f,0.63912445306777954102f, +0.76516723632812500000f,0.64383155107498168945f,0.76120239496231079102f, +0.64851438999176025391f,0.75720882415771484375f,0.65317285060882568359f, +0.75318682193756103516f,0.65780669450759887695f,0.74913638830184936523f, +0.66241580247879028320f,0.74505776166915893555f,0.66699993610382080078f, +0.74095112085342407227f,0.67155897617340087891f,0.73681658506393432617f, +0.67609268426895141602f,0.73265427350997924805f,0.68060100078582763672f, +0.72846436500549316406f,0.68508368730545043945f,0.72424709796905517578f, +0.68954056501388549805f,0.72000253200531005859f,0.69397145509719848633f, +0.71573084592819213867f,0.69837623834609985352f,0.71143221855163574219f, +0.70275473594665527344f,0.70710676908493041992f,0.70710676908493041992f, +0.70275473594665527344f,0.71143221855163574219f,0.69837623834609985352f, +0.71573084592819213867f,0.69397145509719848633f,0.72000253200531005859f, +0.68954056501388549805f,0.72424709796905517578f,0.68508368730545043945f, +0.72846436500549316406f,0.68060100078582763672f,0.73265427350997924805f, +0.67609268426895141602f,0.73681658506393432617f,0.67155897617340087891f, +0.74095112085342407227f,0.66699993610382080078f,0.74505776166915893555f, +0.66241580247879028320f,0.74913638830184936523f,0.65780669450759887695f, +0.75318682193756103516f,0.65317285060882568359f,0.75720882415771484375f, +0.64851438999176025391f,0.76120239496231079102f,0.64383155107498168945f, +0.76516723632812500000f,0.63912445306777954102f,0.76910334825515747070f, +0.63439327478408813477f,0.77301043272018432617f,0.62963825464248657227f, +0.77688848972320556641f,0.62485951185226440430f,0.78073722124099731445f, +0.62005722522735595703f,0.78455656766891479492f,0.61523157358169555664f, +0.78834640979766845703f,0.61038279533386230469f,0.79210656881332397461f, +0.60551106929779052734f,0.79583692550659179688f,0.60061645507812500000f, +0.79953724145889282227f,0.59569931030273437500f,0.80320751667022705078f, +0.59075969457626342773f,0.80684757232666015625f,0.58579784631729125977f, +0.81045717000961303711f,0.58081394433975219727f,0.81403630971908569336f, +0.57580816745758056641f,0.81758481264114379883f,0.57078075408935546875f, +0.82110249996185302734f,0.56573182344436645508f,0.82458931207656860352f, +0.56066155433654785156f,0.82804507017135620117f,0.55557024478912353516f, +0.83146959543228149414f,0.55045795440673828125f,0.83486288785934448242f, +0.54532498121261596680f,0.83822470903396606445f,0.54017144441604614258f, +0.84155499935150146484f,0.53499764204025268555f,0.84485357999801635742f, +0.52980363368988037109f,0.84812033176422119141f,0.52458965778350830078f, +0.85135519504547119141f,0.51935601234436035156f,0.85455799102783203125f, +0.51410275697708129883f,0.85772860050201416016f,0.50883013010025024414f, +0.86086696386337280273f,0.50353837013244628906f,0.86397284269332885742f, +0.49822765588760375977f,0.86704623699188232422f,0.49289819598197937012f, +0.87008696794509887695f,0.48755016922950744629f,0.87309497594833374023f, +0.48218378424644470215f,0.87607008218765258789f,0.47679921984672546387f, +0.87901222705841064453f,0.47139674425125122070f,0.88192129135131835938f, +0.46597650647163391113f,0.88479709625244140625f,0.46053871512413024902f, +0.88763964176177978516f,0.45508357882499694824f,0.89044874906539916992f, +0.44961133599281311035f,0.89322429895401000977f,0.44412213563919067383f, +0.89596623182296752930f,0.43861624598503112793f,0.89867448806762695312f, +0.43309381604194641113f,0.90134882926940917969f,0.42755508422851562500f, +0.90398931503295898438f,0.42200025916099548340f,0.90659570693969726562f, +0.41642954945564270020f,0.90916800498962402344f,0.41084316372871398926f, +0.91170603036880493164f,0.40524131059646606445f,0.91420978307723999023f, +0.39962419867515563965f,0.91667908430099487305f,0.39399203658103942871f, +0.91911387443542480469f,0.38834503293037414551f,0.92151403427124023438f, +0.38268342614173889160f,0.92387950420379638672f,0.37700742483139038086f, +0.92621022462844848633f,0.37131720781326293945f,0.92850607633590698242f, +0.36561298370361328125f,0.93076694011688232422f,0.35989505052566528320f, +0.93299281597137451172f,0.35416352748870849609f,0.93518352508544921875f, +0.34841868281364440918f,0.93733900785446166992f,0.34266072511672973633f, +0.93945920467376708984f,0.33688986301422119141f,0.94154405593872070312f, +0.33110630512237548828f,0.94359344244003295898f,0.32531028985977172852f, +0.94560730457305908203f,0.31950202584266662598f,0.94758558273315429688f, +0.31368175148963928223f,0.94952815771102905273f,0.30784964561462402344f, +0.95143502950668334961f,0.30200594663619995117f,0.95330601930618286133f, +0.29615089297294616699f,0.95514118671417236328f,0.29028466343879699707f, +0.95694035291671752930f,0.28440752625465393066f,0.95870345830917358398f, +0.27851969003677368164f,0.96043050289154052734f,0.27262136340141296387f, +0.96212142705917358398f,0.26671275496482849121f,0.96377605199813842773f, +0.26079410314559936523f,0.96539443731307983398f,0.25486564636230468750f, +0.96697646379470825195f,0.24892760813236236572f,0.96852207183837890625f, +0.24298018217086791992f,0.97003126144409179688f,0.23702360689640045166f, +0.97150391340255737305f,0.23105810582637786865f,0.97293996810913085938f, +0.22508391737937927246f,0.97433936595916748047f,0.21910123527050018311f, +0.97570210695266723633f,0.21311031281948089600f,0.97702813148498535156f, +0.20711137354373931885f,0.97831737995147705078f,0.20110464096069335938f, +0.97956979274749755859f,0.19509032368659973145f,0.98078525066375732422f, +0.18906866014003753662f,0.98196387290954589844f,0.18303988873958587646f, +0.98310548067092895508f,0.17700421810150146484f,0.98421007394790649414f, +0.17096188664436340332f,0.98527765274047851562f,0.16491311788558959961f, +0.98630809783935546875f,0.15885815024375915527f,0.98730140924453735352f, +0.15279719233512878418f,0.98825758695602416992f,0.14673046767711639404f, +0.98917651176452636719f,0.14065824449062347412f,0.99005818367004394531f, +0.13458070158958435059f,0.99090266227722167969f,0.12849810719490051270f, +0.99170976877212524414f,0.12241067737340927124f,0.99247956275939941406f, +0.11631862819194793701f,0.99321192502975463867f,0.11022220551967620850f, +0.99390697479248046875f,0.10412163287401199341f,0.99456459283828735352f, +0.09801714122295379639f,0.99518471956253051758f,0.09190895408391952515f, +0.99576741456985473633f,0.08579730987548828125f,0.99631261825561523438f, +0.07968243956565856934f,0.99682027101516723633f,0.07356456667184829712f, +0.99729043245315551758f,0.06744392216205596924f,0.99772304296493530273f, +0.06132073700428009033f,0.99811810255050659180f,0.05519524589180946350f, +0.99847555160522460938f,0.04906767606735229492f,0.99879544973373413086f, +0.04293825849890708923f,0.99907773733139038086f,0.03680722415447235107f, +0.99932235479354858398f,0.03067480400204658508f,0.99952942132949829102f, +0.02454122900962829590f,0.99969881772994995117f,0.01840673014521598816f, +0.99983060359954833984f,0.01227153837680816650f,0.99992471933364868164f, +0.00613588467240333557f,0.99998116493225097656f,1.00000000000000000000f, +0.00000000000000000000f,0.99969881772994995117f,0.02454122900962829590f, +0.99879544973373413086f,0.04906767606735229492f,0.99729043245315551758f, +0.07356456667184829712f,0.99518471956253051758f,0.09801714122295379639f, +0.99247956275939941406f,0.12241067737340927124f,0.98917651176452636719f, +0.14673046767711639404f,0.98527765274047851562f,0.17096188664436340332f, +0.98078525066375732422f,0.19509032368659973145f,0.97570210695266723633f, +0.21910123527050018311f,0.97003126144409179688f,0.24298018217086791992f, +0.96377605199813842773f,0.26671275496482849121f,0.95694035291671752930f, +0.29028466343879699707f,0.94952815771102905273f,0.31368175148963928223f, +0.94154405593872070312f,0.33688986301422119141f,0.93299281597137451172f, +0.35989505052566528320f,0.92387950420379638672f,0.38268342614173889160f, +0.91420978307723999023f,0.40524131059646606445f,0.90398931503295898438f, +0.42755508422851562500f,0.89322429895401000977f,0.44961133599281311035f, +0.88192129135131835938f,0.47139674425125122070f,0.87008696794509887695f, +0.49289819598197937012f,0.85772860050201416016f,0.51410275697708129883f, +0.84485357999801635742f,0.53499764204025268555f,0.83146959543228149414f, +0.55557024478912353516f,0.81758481264114379883f,0.57580816745758056641f, +0.80320751667022705078f,0.59569931030273437500f,0.78834640979766845703f, +0.61523157358169555664f,0.77301043272018432617f,0.63439327478408813477f, +0.75720882415771484375f,0.65317285060882568359f,0.74095112085342407227f, +0.67155897617340087891f,0.72424709796905517578f,0.68954056501388549805f, +0.70710676908493041992f,0.70710676908493041992f,0.68954056501388549805f, +0.72424709796905517578f,0.67155897617340087891f,0.74095112085342407227f, +0.65317285060882568359f,0.75720882415771484375f,0.63439327478408813477f, +0.77301043272018432617f,0.61523157358169555664f,0.78834640979766845703f, +0.59569931030273437500f,0.80320751667022705078f,0.57580816745758056641f, +0.81758481264114379883f,0.55557024478912353516f,0.83146959543228149414f, +0.53499764204025268555f,0.84485357999801635742f,0.51410275697708129883f, +0.85772860050201416016f,0.49289819598197937012f,0.87008696794509887695f, +0.47139674425125122070f,0.88192129135131835938f,0.44961133599281311035f, +0.89322429895401000977f,0.42755508422851562500f,0.90398931503295898438f, +0.40524131059646606445f,0.91420978307723999023f,0.38268342614173889160f, +0.92387950420379638672f,0.35989505052566528320f,0.93299281597137451172f, +0.33688986301422119141f,0.94154405593872070312f,0.31368175148963928223f, +0.94952815771102905273f,0.29028466343879699707f,0.95694035291671752930f, +0.26671275496482849121f,0.96377605199813842773f,0.24298018217086791992f, +0.97003126144409179688f,0.21910123527050018311f,0.97570210695266723633f, +0.19509032368659973145f,0.98078525066375732422f,0.17096188664436340332f, +0.98527765274047851562f,0.14673046767711639404f,0.98917651176452636719f, +0.12241067737340927124f,0.99247956275939941406f,0.09801714122295379639f, +0.99518471956253051758f,0.07356456667184829712f,0.99729043245315551758f, +0.04906767606735229492f,0.99879544973373413086f,0.02454122900962829590f, +0.99969881772994995117f,1.00000000000000000000f,0.00000000000000000000f, +0.99518471956253051758f,0.09801714122295379639f,0.98078525066375732422f, +0.19509032368659973145f,0.95694035291671752930f,0.29028466343879699707f, +0.92387950420379638672f,0.38268342614173889160f,0.88192129135131835938f, +0.47139674425125122070f,0.83146959543228149414f,0.55557024478912353516f, +0.77301043272018432617f,0.63439327478408813477f,0.70710676908493041992f, +0.70710676908493041992f,0.63439327478408813477f,0.77301043272018432617f, +0.55557024478912353516f,0.83146959543228149414f,0.47139674425125122070f, +0.88192129135131835938f,0.38268342614173889160f,0.92387950420379638672f, +0.29028466343879699707f,0.95694035291671752930f,0.19509032368659973145f, +0.98078525066375732422f,0.09801714122295379639f,0.99518471956253051758f, +1.00000000000000000000f,0.00000000000000000000f,0.92387950420379638672f, +0.38268342614173889160f,0.70710676908493041992f,0.70710676908493041992f, +0.38268342614173889160f,0.92387950420379638672f,}; float32_t rearranged_twiddle_stride2_1024_f32[680]={ -1.00000000000000000000f,0.00000000000000000000f,0.99992470183914450299f, -0.01227153828571992539f,0.99969881869620424997f,0.02454122852291228812f, -0.99932238458834954375f,0.03680722294135883171f,0.99879545620517240501f, -0.04906767432741801493f,0.99811811290014917919f,0.06132073630220857829f, -0.99729045667869020697f,0.07356456359966742631f,0.99631261218277800129f, -0.08579731234443989385f,0.99518472667219692873f,0.09801714032956060363f, -0.99390697000235606051f,0.11022220729388305938f,0.99247953459870996706f, -0.12241067519921619566f,0.99090263542778000971f,0.13458070850712616773f, -0.98917650996478101444f,0.14673047445536174793f,0.98730141815785843473f, -0.15885814333386144570f,0.98527764238894122162f,0.17096188876030121717f, -0.98310548743121628501f,0.18303988795514095078f,0.98078528040323043058f, -0.19509032201612824808f,0.97831737071962765473f,0.20711137619221856032f, -0.97570213003852857003f,0.21910124015686979759f,0.97293995220556017678f, -0.23105810828067110951f,0.97003125319454397424f,0.24298017990326387094f, -0.96697647104485207059f,0.25486565960451457169f,0.96377606579543984022f, -0.26671275747489836538f,0.96043051941556578655f,0.27851968938505305973f, -0.95694033573220882438f,0.29028467725446233105f,0.95330604035419386211f, -0.30200594931922808417f,0.94952818059303667475f,0.31368174039889151761f, -0.94560732538052127971f,0.32531029216226292622f,0.94154406518302080631f, -0.33688985339222005111f,0.93733901191257495977f,0.34841868024943456472f, -0.93299279883473895669f,0.35989503653498811087f,0.92850608047321558924f, -0.37131719395183754306f,0.92387953251128673848f,0.38268343236508978178f, -0.91911385169005777040f,0.39399204006104809883f,0.91420975570353069095f, -0.40524131400498986100f,0.90916798309052238025f,0.41642956009763715253f, -0.90398929312344333820f,0.42755509343028208491f,0.89867446569395381673f, -0.43861623853852765853f,0.89322430119551532446f,0.44961132965460653965f, -0.88763962040285393496f,0.46053871095824000514f,0.88192126434835504956f, -0.47139673682599764204f,0.87607009419540660122f,0.48218377207912271887f, -0.87008699110871146054f,0.49289819222978403790f,0.86397285612158669643f, -0.50353838372571757542f,0.85772861000027211809f,0.51410274419322166128f, -0.85135519310526519554f,0.52458968267846894928f,0.84485356524970711689f, -0.53499761988709715332f,0.83822470555483807875f,0.54532498842204646383f, -0.83146961230254523567f,0.55557023301960217765f,0.82458930278502529099f, -0.56573181078361312046f,0.81758481315158371139f,0.57580819141784533866f, -0.81045719825259476821f,0.58579785745643886408f,0.80320753148064494287f, -0.59569930449243335691f,0.79583690460888356633f,0.60551104140432554512f, -0.78834642762660622761f,0.61523159058062681925f,0.78073722857209448822f, -0.62485948814238634341f,0.77301045336273699338f,0.63439328416364548779f, -0.76516726562245895860f,0.64383154288979138613f,0.75720884650648456748f, -0.65317284295377675551f,0.74913639452345937020f,0.66241577759017178373f, -0.74095112535495921691f,0.67155895484701833009f,0.73265427167241281570f, -0.68060099779545302212f,0.72424708295146700276f,0.68954054473706682948f, -0.71573082528381870571f,0.69837624940897280457f,0.70710678118654757274f, -0.70710678118654757274f,0.69837624940897291559f,0.71573082528381859468f, -0.68954054473706694051f,0.72424708295146689174f,0.68060099779545302212f, -0.73265427167241281570f,0.67155895484701833009f,0.74095112535495910588f, -0.66241577759017178373f,0.74913639452345925918f,0.65317284295377686654f, -0.75720884650648456748f,0.64383154288979149715f,0.76516726562245895860f, -0.63439328416364548779f,0.77301045336273688235f,0.62485948814238645443f, -0.78073722857209448822f,0.61523159058062681925f,0.78834642762660622761f, -0.60551104140432554512f,0.79583690460888345530f,0.59569930449243346793f, -0.80320753148064483184f,0.58579785745643886408f,0.81045719825259476821f, -0.57580819141784533866f,0.81758481315158371139f,0.56573181078361323149f, -0.82458930278502529099f,0.55557023301960228867f,0.83146961230254523567f, -0.54532498842204646383f,0.83822470555483796772f,0.53499761988709726435f, -0.84485356524970700587f,0.52458968267846883826f,0.85135519310526519554f, -0.51410274419322166128f,0.85772861000027211809f,0.50353838372571757542f, -0.86397285612158669643f,0.49289819222978409341f,0.87008699110871134952f, -0.48218377207912282989f,0.87607009419540660122f,0.47139673682599780857f, -0.88192126434835493853f,0.46053871095824000514f,0.88763962040285393496f, -0.44961132965460659516f,0.89322430119551532446f,0.43861623853852771404f, -0.89867446569395381673f,0.42755509343028219593f,0.90398929312344333820f, -0.41642956009763731906f,0.90916798309052226923f,0.40524131400498986100f, -0.91420975570353069095f,0.39399204006104809883f,0.91911385169005777040f, -0.38268343236508983729f,0.92387953251128673848f,0.37131719395183759858f, -0.92850608047321558924f,0.35989503653498827740f,0.93299279883473884567f, -0.34841868024943450921f,0.93733901191257495977f,0.33688985339222005111f, -0.94154406518302080631f,0.32531029216226298173f,0.94560732538052127971f, -0.31368174039889157312f,0.94952818059303667475f,0.30200594931922819519f, -0.95330604035419375109f,0.29028467725446233105f,0.95694033573220893540f, -0.27851968938505305973f,0.96043051941556578655f,0.26671275747489842090f, -0.96377606579543984022f,0.25486565960451462720f,0.96697647104485207059f, -0.24298017990326398197f,0.97003125319454397424f,0.23105810828067127605f, -0.97293995220556006576f,0.21910124015686976984f,0.97570213003852857003f, -0.20711137619221856032f,0.97831737071962765473f,0.19509032201612833135f, -0.98078528040323043058f,0.18303988795514106180f,0.98310548743121628501f, -0.17096188876030135595f,0.98527764238894122162f,0.15885814333386139019f, -0.98730141815785843473f,0.14673047445536174793f,0.98917650996478101444f, -0.13458070850712622324f,0.99090263542778000971f,0.12241067519921627893f, -0.99247953459870996706f,0.11022220729388318428f,0.99390697000235606051f, -0.09801714032956077016f,0.99518472667219681771f,0.08579731234443987997f, -0.99631261218277800129f,0.07356456359966745406f,0.99729045667869020697f, -0.06132073630220864768f,0.99811811290014917919f,0.04906767432741812596f, -0.99879545620517240501f,0.03680722294135899131f,0.99932238458834954375f, -0.02454122852291226384f,0.99969881869620424997f,0.01227153828571994447f, -0.99992470183914450299f,0.00000000000000006123f,1.00000000000000000000f, --0.01227153828571982304f,0.99992470183914450299f,-0.02454122852291214241f, -0.99969881869620424997f,-0.03680722294135886641f,0.99932238458834954375f, --0.04906767432741800800f,0.99879545620517240501f,-0.06132073630220852972f, -0.99811811290014917919f,-0.07356456359966732916f,0.99729045667869020697f, --0.08579731234443975507f,0.99631261218277800129f,-0.09801714032956064526f, -0.99518472667219692873f,-0.11022220729388305938f,0.99390697000235606051f, --0.12241067519921615403f,0.99247953459870996706f,-0.13458070850712611222f, -0.99090263542778000971f,-0.14673047445536163691f,0.98917650996478101444f, --0.15885814333386127917f,0.98730141815785843473f,-0.17096188876030124493f, -0.98527764238894122162f,-0.18303988795514092303f,0.98310548743121628501f, --0.19509032201612819257f,0.98078528040323043058f,-0.20711137619221844930f, -0.97831737071962765473f,-0.21910124015686965881f,0.97570213003852857003f, --0.23105810828067113727f,0.97293995220556017678f,-0.24298017990326387094f, -0.97003125319454397424f,-0.25486565960451451618f,0.96697647104485207059f, --0.26671275747489830987f,0.96377606579543984022f,-0.27851968938505294870f, -0.96043051941556589757f,-0.29028467725446216452f,0.95694033573220893540f, --0.30200594931922808417f,0.95330604035419386211f,-0.31368174039889140658f, -0.94952818059303667475f,-0.32531029216226287071f,0.94560732538052139073f, --0.33688985339221994009f,0.94154406518302080631f,-0.34841868024943439819f, -0.93733901191257495977f,-0.35989503653498816638f,0.93299279883473884567f, --0.37131719395183748755f,0.92850608047321558924f,-0.38268343236508972627f, -0.92387953251128673848f,-0.39399204006104798781f,0.91911385169005777040f, --0.40524131400498974998f,0.91420975570353069095f,-0.41642956009763698599f, -0.90916798309052249127f,-0.42755509343028186287f,0.90398929312344344922f, --0.43861623853852738097f,0.89867446569395392775f,-0.44961132965460670619f, -0.89322430119551521344f,-0.46053871095824006066f,0.88763962040285393496f, --0.47139673682599769755f,0.88192126434835504956f,-0.48218377207912271887f, -0.87607009419540660122f,-0.49289819222978398239f,0.87008699110871146054f, --0.50353838372571746440f,0.86397285612158680745f,-0.51410274419322155026f, -0.85772861000027211809f,-0.52458968267846872724f,0.85135519310526519554f, --0.53499761988709704230f,0.84485356524970722791f,-0.54532498842204624179f, -0.83822470555483818977f,-0.55557023301960195560f,0.83146961230254534669f, --0.56573181078361323149f,0.82458930278502517996f,-0.57580819141784533866f, -0.81758481315158371139f,-0.58579785745643886408f,0.81045719825259476821f, --0.59569930449243335691f,0.80320753148064494287f,-0.60551104140432543410f, -0.79583690460888356633f,-0.61523159058062670823f,0.78834642762660633863f, --0.62485948814238623239f,0.78073722857209459924f,-0.63439328416364537677f, -0.77301045336273710440f,-0.64383154288979127511f,0.76516726562245906962f, --0.65317284295377653347f,0.75720884650648467851f,-0.66241577759017189475f, -0.74913639452345925918f,-0.67155895484701844111f,0.74095112535495899486f, --0.68060099779545302212f,0.73265427167241281570f,-0.68954054473706694051f, -0.72424708295146689174f,-0.69837624940897280457f,0.71573082528381870571f, --0.70710678118654746172f,0.70710678118654757274f,-0.71573082528381859468f, -0.69837624940897291559f,-0.72424708295146678072f,0.68954054473706705153f, --0.73265427167241270467f,0.68060099779545324417f,-0.74095112535495888384f, -0.67155895484701855214f,-0.74913639452345914815f,0.66241577759017200577f, --0.75720884650648467851f,0.65317284295377664449f,-0.76516726562245895860f, -0.64383154288979138613f,-0.77301045336273699338f,0.63439328416364548779f, --0.78073722857209448822f,0.62485948814238634341f,-0.78834642762660622761f, -0.61523159058062693028f,-0.79583690460888345530f,0.60551104140432565615f, --0.80320753148064483184f,0.59569930449243346793f,-0.81045719825259465718f, -0.58579785745643897510f,-0.81758481315158360037f,0.57580819141784544968f, --0.82458930278502506894f,0.56573181078361345353f,-0.83146961230254534669f, -0.55557023301960217765f,-0.83822470555483807875f,0.54532498842204635281f, --0.84485356524970711689f,0.53499761988709715332f,-0.85135519310526519554f, -0.52458968267846894928f,-0.85772861000027200706f,0.51410274419322177231f, --0.86397285612158669643f,0.50353838372571757542f,-0.87008699110871134952f, -0.49289819222978414892f,-0.87607009419540649020f,0.48218377207912288540f, --0.88192126434835493853f,0.47139673682599780857f,-0.88763962040285382393f, -0.46053871095824022719f,-0.89322430119551521344f,0.44961132965460687272f, --0.89867446569395392775f,0.43861623853852754751f,-0.90398929312344333820f, -0.42755509343028202940f,-0.90916798309052238025f,0.41642956009763715253f, --0.91420975570353069095f,0.40524131400498991651f,-0.91911385169005777040f, -0.39399204006104815434f,-0.92387953251128673848f,0.38268343236508989280f, --0.92850608047321547822f,0.37131719395183770960f,-0.93299279883473884567f, -0.35989503653498833291f,-0.93733901191257484875f,0.34841868024943478677f, --0.94154406518302069529f,0.33688985339222032867f,-0.94560732538052116869f, -0.32531029216226325929f,-0.94952818059303667475f,0.31368174039889140658f, --0.95330604035419386211f,0.30200594931922802866f,-0.95694033573220882438f, -0.29028467725446238656f,-0.96043051941556578655f,0.27851968938505317075f, --0.96377606579543984022f,0.26671275747489847641f,-0.96697647104485207059f, -0.25486565960451468271f,-0.97003125319454397424f,0.24298017990326406523f, --0.97293995220556006576f,0.23105810828067133156f,-0.97570213003852845901f, -0.21910124015687004739f,-0.97831737071962754371f,0.20711137619221883788f, --0.98078528040323043058f,0.19509032201612860891f,-0.98310548743121628501f, -0.18303988795514089527f,-0.98527764238894122162f,0.17096188876030121717f, --0.98730141815785843473f,0.15885814333386147346f,-0.98917650996478101444f, -0.14673047445536180344f,-0.99090263542778000971f,0.13458070850712627875f, --0.99247953459870996706f,0.12241067519921634832f,-0.99390697000235606051f, -0.11022220729388323979f,-0.99518472667219681771f,0.09801714032956082567f, --0.99631261218277800129f,0.08579731234444015753f,-0.99729045667869020697f, -0.07356456359966773162f,-0.99811811290014917919f,0.06132073630220848809f, --0.99879545620517240501f,0.04906767432741796636f,-0.99932238458834954375f, -0.03680722294135883171f,-0.99969881869620424997f,0.02454122852291232629f, --0.99992470183914450299f,0.01227153828572000692f,1.00000000000000000000f, -0.00000000000000000000f,0.99879545620517240501f,0.04906767432741801493f, -0.99518472667219692873f,0.09801714032956060363f,0.98917650996478101444f, -0.14673047445536174793f,0.98078528040323043058f,0.19509032201612824808f, -0.97003125319454397424f,0.24298017990326387094f,0.95694033573220882438f, -0.29028467725446233105f,0.94154406518302080631f,0.33688985339222005111f, -0.92387953251128673848f,0.38268343236508978178f,0.90398929312344333820f, -0.42755509343028208491f,0.88192126434835504956f,0.47139673682599764204f, -0.85772861000027211809f,0.51410274419322166128f,0.83146961230254523567f, -0.55557023301960217765f,0.80320753148064494287f,0.59569930449243335691f, -0.77301045336273699338f,0.63439328416364548779f,0.74095112535495921691f, -0.67155895484701833009f,0.70710678118654757274f,0.70710678118654757274f, -0.67155895484701833009f,0.74095112535495910588f,0.63439328416364548779f, -0.77301045336273688235f,0.59569930449243346793f,0.80320753148064483184f, -0.55557023301960228867f,0.83146961230254523567f,0.51410274419322166128f, -0.85772861000027211809f,0.47139673682599780857f,0.88192126434835493853f, -0.42755509343028219593f,0.90398929312344333820f,0.38268343236508983729f, -0.92387953251128673848f,0.33688985339222005111f,0.94154406518302080631f, -0.29028467725446233105f,0.95694033573220893540f,0.24298017990326398197f, -0.97003125319454397424f,0.19509032201612833135f,0.98078528040323043058f, -0.14673047445536174793f,0.98917650996478101444f,0.09801714032956077016f, -0.99518472667219681771f,0.04906767432741812596f,0.99879545620517240501f, -0.00000000000000006123f,1.00000000000000000000f,-0.04906767432741800800f, -0.99879545620517240501f,-0.09801714032956064526f,0.99518472667219692873f, --0.14673047445536163691f,0.98917650996478101444f,-0.19509032201612819257f, -0.98078528040323043058f,-0.24298017990326387094f,0.97003125319454397424f, --0.29028467725446216452f,0.95694033573220893540f,-0.33688985339221994009f, -0.94154406518302080631f,-0.38268343236508972627f,0.92387953251128673848f, --0.42755509343028186287f,0.90398929312344344922f,-0.47139673682599769755f, -0.88192126434835504956f,-0.51410274419322155026f,0.85772861000027211809f, --0.55557023301960195560f,0.83146961230254534669f,-0.59569930449243335691f, -0.80320753148064494287f,-0.63439328416364537677f,0.77301045336273710440f, --0.67155895484701844111f,0.74095112535495899486f,-0.70710678118654746172f, -0.70710678118654757274f,-0.74095112535495888384f,0.67155895484701855214f, --0.77301045336273699338f,0.63439328416364548779f,-0.80320753148064483184f, -0.59569930449243346793f,-0.83146961230254534669f,0.55557023301960217765f, --0.85772861000027200706f,0.51410274419322177231f,-0.88192126434835493853f, -0.47139673682599780857f,-0.90398929312344333820f,0.42755509343028202940f, --0.92387953251128673848f,0.38268343236508989280f,-0.94154406518302069529f, -0.33688985339222032867f,-0.95694033573220882438f,0.29028467725446238656f, --0.97003125319454397424f,0.24298017990326406523f,-0.98078528040323043058f, -0.19509032201612860891f,-0.98917650996478101444f,0.14673047445536180344f, --0.99518472667219681771f,0.09801714032956082567f,-0.99879545620517240501f, -0.04906767432741796636f,1.00000000000000000000f,0.00000000000000000000f, -0.98078528040323043058f,0.19509032201612824808f,0.92387953251128673848f, -0.38268343236508978178f,0.83146961230254523567f,0.55557023301960217765f, -0.70710678118654757274f,0.70710678118654757274f,0.55557023301960228867f, -0.83146961230254523567f,0.38268343236508983729f,0.92387953251128673848f, -0.19509032201612833135f,0.98078528040323043058f,0.00000000000000006123f, -1.00000000000000000000f,-0.19509032201612819257f,0.98078528040323043058f, --0.38268343236508972627f,0.92387953251128673848f,-0.55557023301960195560f, -0.83146961230254534669f,-0.70710678118654746172f,0.70710678118654757274f, --0.83146961230254534669f,0.55557023301960217765f,-0.92387953251128673848f, -0.38268343236508989280f,-0.98078528040323043058f,0.19509032201612860891f, -1.00000000000000000000f,0.00000000000000000000f,0.70710678118654757274f, -0.70710678118654757274f,0.00000000000000006123f,1.00000000000000000000f, --0.70710678118654746172f,0.70710678118654757274f,}; +1.00000000000000000000f,0.00000000000000000000f,0.99992471933364868164f, +0.01227153837680816650f,0.99969881772994995117f,0.02454122900962829590f, +0.99932235479354858398f,0.03680722415447235107f,0.99879544973373413086f, +0.04906767606735229492f,0.99811810255050659180f,0.06132073700428009033f, +0.99729043245315551758f,0.07356456667184829712f,0.99631261825561523438f, +0.08579730987548828125f,0.99518471956253051758f,0.09801714122295379639f, +0.99390697479248046875f,0.11022220551967620850f,0.99247956275939941406f, +0.12241067737340927124f,0.99090266227722167969f,0.13458070158958435059f, +0.98917651176452636719f,0.14673046767711639404f,0.98730140924453735352f, +0.15885815024375915527f,0.98527765274047851562f,0.17096188664436340332f, +0.98310548067092895508f,0.18303988873958587646f,0.98078525066375732422f, +0.19509032368659973145f,0.97831737995147705078f,0.20711137354373931885f, +0.97570210695266723633f,0.21910123527050018311f,0.97293996810913085938f, +0.23105810582637786865f,0.97003126144409179688f,0.24298018217086791992f, +0.96697646379470825195f,0.25486564636230468750f,0.96377605199813842773f, +0.26671275496482849121f,0.96043050289154052734f,0.27851969003677368164f, +0.95694035291671752930f,0.29028466343879699707f,0.95330601930618286133f, +0.30200594663619995117f,0.94952815771102905273f,0.31368175148963928223f, +0.94560730457305908203f,0.32531028985977172852f,0.94154405593872070312f, +0.33688986301422119141f,0.93733900785446166992f,0.34841868281364440918f, +0.93299281597137451172f,0.35989505052566528320f,0.92850607633590698242f, +0.37131720781326293945f,0.92387950420379638672f,0.38268342614173889160f, +0.91911387443542480469f,0.39399203658103942871f,0.91420978307723999023f, +0.40524131059646606445f,0.90916800498962402344f,0.41642954945564270020f, +0.90398931503295898438f,0.42755508422851562500f,0.89867448806762695312f, +0.43861624598503112793f,0.89322429895401000977f,0.44961133599281311035f, +0.88763964176177978516f,0.46053871512413024902f,0.88192129135131835938f, +0.47139674425125122070f,0.87607008218765258789f,0.48218378424644470215f, +0.87008696794509887695f,0.49289819598197937012f,0.86397284269332885742f, +0.50353837013244628906f,0.85772860050201416016f,0.51410275697708129883f, +0.85135519504547119141f,0.52458965778350830078f,0.84485357999801635742f, +0.53499764204025268555f,0.83822470903396606445f,0.54532498121261596680f, +0.83146959543228149414f,0.55557024478912353516f,0.82458931207656860352f, +0.56573182344436645508f,0.81758481264114379883f,0.57580816745758056641f, +0.81045717000961303711f,0.58579784631729125977f,0.80320751667022705078f, +0.59569931030273437500f,0.79583692550659179688f,0.60551106929779052734f, +0.78834640979766845703f,0.61523157358169555664f,0.78073722124099731445f, +0.62485951185226440430f,0.77301043272018432617f,0.63439327478408813477f, +0.76516723632812500000f,0.64383155107498168945f,0.75720882415771484375f, +0.65317285060882568359f,0.74913638830184936523f,0.66241580247879028320f, +0.74095112085342407227f,0.67155897617340087891f,0.73265427350997924805f, +0.68060100078582763672f,0.72424709796905517578f,0.68954056501388549805f, +0.71573084592819213867f,0.69837623834609985352f,0.70710676908493041992f, +0.70710676908493041992f,0.69837623834609985352f,0.71573084592819213867f, +0.68954056501388549805f,0.72424709796905517578f,0.68060100078582763672f, +0.73265427350997924805f,0.67155897617340087891f,0.74095112085342407227f, +0.66241580247879028320f,0.74913638830184936523f,0.65317285060882568359f, +0.75720882415771484375f,0.64383155107498168945f,0.76516723632812500000f, +0.63439327478408813477f,0.77301043272018432617f,0.62485951185226440430f, +0.78073722124099731445f,0.61523157358169555664f,0.78834640979766845703f, +0.60551106929779052734f,0.79583692550659179688f,0.59569931030273437500f, +0.80320751667022705078f,0.58579784631729125977f,0.81045717000961303711f, +0.57580816745758056641f,0.81758481264114379883f,0.56573182344436645508f, +0.82458931207656860352f,0.55557024478912353516f,0.83146959543228149414f, +0.54532498121261596680f,0.83822470903396606445f,0.53499764204025268555f, +0.84485357999801635742f,0.52458965778350830078f,0.85135519504547119141f, +0.51410275697708129883f,0.85772860050201416016f,0.50353837013244628906f, +0.86397284269332885742f,0.49289819598197937012f,0.87008696794509887695f, +0.48218378424644470215f,0.87607008218765258789f,0.47139674425125122070f, +0.88192129135131835938f,0.46053871512413024902f,0.88763964176177978516f, +0.44961133599281311035f,0.89322429895401000977f,0.43861624598503112793f, +0.89867448806762695312f,0.42755508422851562500f,0.90398931503295898438f, +0.41642954945564270020f,0.90916800498962402344f,0.40524131059646606445f, +0.91420978307723999023f,0.39399203658103942871f,0.91911387443542480469f, +0.38268342614173889160f,0.92387950420379638672f,0.37131720781326293945f, +0.92850607633590698242f,0.35989505052566528320f,0.93299281597137451172f, +0.34841868281364440918f,0.93733900785446166992f,0.33688986301422119141f, +0.94154405593872070312f,0.32531028985977172852f,0.94560730457305908203f, +0.31368175148963928223f,0.94952815771102905273f,0.30200594663619995117f, +0.95330601930618286133f,0.29028466343879699707f,0.95694035291671752930f, +0.27851969003677368164f,0.96043050289154052734f,0.26671275496482849121f, +0.96377605199813842773f,0.25486564636230468750f,0.96697646379470825195f, +0.24298018217086791992f,0.97003126144409179688f,0.23105810582637786865f, +0.97293996810913085938f,0.21910123527050018311f,0.97570210695266723633f, +0.20711137354373931885f,0.97831737995147705078f,0.19509032368659973145f, +0.98078525066375732422f,0.18303988873958587646f,0.98310548067092895508f, +0.17096188664436340332f,0.98527765274047851562f,0.15885815024375915527f, +0.98730140924453735352f,0.14673046767711639404f,0.98917651176452636719f, +0.13458070158958435059f,0.99090266227722167969f,0.12241067737340927124f, +0.99247956275939941406f,0.11022220551967620850f,0.99390697479248046875f, +0.09801714122295379639f,0.99518471956253051758f,0.08579730987548828125f, +0.99631261825561523438f,0.07356456667184829712f,0.99729043245315551758f, +0.06132073700428009033f,0.99811810255050659180f,0.04906767606735229492f, +0.99879544973373413086f,0.03680722415447235107f,0.99932235479354858398f, +0.02454122900962829590f,0.99969881772994995117f,0.01227153837680816650f, +0.99992471933364868164f,0.00000000000000006123f,1.00000000000000000000f, +-0.01227153837680816650f,0.99992471933364868164f,-0.02454122900962829590f, +0.99969881772994995117f,-0.03680722415447235107f,0.99932235479354858398f, +-0.04906767606735229492f,0.99879544973373413086f,-0.06132073700428009033f, +0.99811810255050659180f,-0.07356456667184829712f,0.99729043245315551758f, +-0.08579730987548828125f,0.99631261825561523438f,-0.09801714122295379639f, +0.99518471956253051758f,-0.11022220551967620850f,0.99390697479248046875f, +-0.12241067737340927124f,0.99247956275939941406f,-0.13458070158958435059f, +0.99090266227722167969f,-0.14673046767711639404f,0.98917651176452636719f, +-0.15885815024375915527f,0.98730140924453735352f,-0.17096188664436340332f, +0.98527765274047851562f,-0.18303988873958587646f,0.98310548067092895508f, +-0.19509032368659973145f,0.98078525066375732422f,-0.20711137354373931885f, +0.97831737995147705078f,-0.21910123527050018311f,0.97570210695266723633f, +-0.23105810582637786865f,0.97293996810913085938f,-0.24298018217086791992f, +0.97003126144409179688f,-0.25486564636230468750f,0.96697646379470825195f, +-0.26671275496482849121f,0.96377605199813842773f,-0.27851969003677368164f, +0.96043050289154052734f,-0.29028466343879699707f,0.95694035291671752930f, +-0.30200594663619995117f,0.95330601930618286133f,-0.31368175148963928223f, +0.94952815771102905273f,-0.32531028985977172852f,0.94560730457305908203f, +-0.33688986301422119141f,0.94154405593872070312f,-0.34841868281364440918f, +0.93733900785446166992f,-0.35989505052566528320f,0.93299281597137451172f, +-0.37131720781326293945f,0.92850607633590698242f,-0.38268342614173889160f, +0.92387950420379638672f,-0.39399203658103942871f,0.91911387443542480469f, +-0.40524131059646606445f,0.91420978307723999023f,-0.41642954945564270020f, +0.90916800498962402344f,-0.42755508422851562500f,0.90398931503295898438f, +-0.43861624598503112793f,0.89867448806762695312f,-0.44961133599281311035f, +0.89322429895401000977f,-0.46053871512413024902f,0.88763964176177978516f, +-0.47139674425125122070f,0.88192129135131835938f,-0.48218378424644470215f, +0.87607008218765258789f,-0.49289819598197937012f,0.87008696794509887695f, +-0.50353837013244628906f,0.86397284269332885742f,-0.51410275697708129883f, +0.85772860050201416016f,-0.52458965778350830078f,0.85135519504547119141f, +-0.53499764204025268555f,0.84485357999801635742f,-0.54532498121261596680f, +0.83822470903396606445f,-0.55557024478912353516f,0.83146959543228149414f, +-0.56573182344436645508f,0.82458931207656860352f,-0.57580816745758056641f, +0.81758481264114379883f,-0.58579784631729125977f,0.81045717000961303711f, +-0.59569931030273437500f,0.80320751667022705078f,-0.60551106929779052734f, +0.79583692550659179688f,-0.61523157358169555664f,0.78834640979766845703f, +-0.62485951185226440430f,0.78073722124099731445f,-0.63439327478408813477f, +0.77301043272018432617f,-0.64383155107498168945f,0.76516723632812500000f, +-0.65317285060882568359f,0.75720882415771484375f,-0.66241580247879028320f, +0.74913638830184936523f,-0.67155897617340087891f,0.74095112085342407227f, +-0.68060100078582763672f,0.73265427350997924805f,-0.68954056501388549805f, +0.72424709796905517578f,-0.69837623834609985352f,0.71573084592819213867f, +-0.70710676908493041992f,0.70710676908493041992f,-0.71573084592819213867f, +0.69837623834609985352f,-0.72424709796905517578f,0.68954056501388549805f, +-0.73265427350997924805f,0.68060100078582763672f,-0.74095112085342407227f, +0.67155897617340087891f,-0.74913638830184936523f,0.66241580247879028320f, +-0.75720882415771484375f,0.65317285060882568359f,-0.76516723632812500000f, +0.64383155107498168945f,-0.77301043272018432617f,0.63439327478408813477f, +-0.78073722124099731445f,0.62485951185226440430f,-0.78834640979766845703f, +0.61523157358169555664f,-0.79583692550659179688f,0.60551106929779052734f, +-0.80320751667022705078f,0.59569931030273437500f,-0.81045717000961303711f, +0.58579784631729125977f,-0.81758481264114379883f,0.57580816745758056641f, +-0.82458931207656860352f,0.56573182344436645508f,-0.83146959543228149414f, +0.55557024478912353516f,-0.83822470903396606445f,0.54532498121261596680f, +-0.84485357999801635742f,0.53499764204025268555f,-0.85135519504547119141f, +0.52458965778350830078f,-0.85772860050201416016f,0.51410275697708129883f, +-0.86397284269332885742f,0.50353837013244628906f,-0.87008696794509887695f, +0.49289819598197937012f,-0.87607008218765258789f,0.48218378424644470215f, +-0.88192129135131835938f,0.47139674425125122070f,-0.88763964176177978516f, +0.46053871512413024902f,-0.89322429895401000977f,0.44961133599281311035f, +-0.89867448806762695312f,0.43861624598503112793f,-0.90398931503295898438f, +0.42755508422851562500f,-0.90916800498962402344f,0.41642954945564270020f, +-0.91420978307723999023f,0.40524131059646606445f,-0.91911387443542480469f, +0.39399203658103942871f,-0.92387950420379638672f,0.38268342614173889160f, +-0.92850607633590698242f,0.37131720781326293945f,-0.93299281597137451172f, +0.35989505052566528320f,-0.93733900785446166992f,0.34841868281364440918f, +-0.94154405593872070312f,0.33688986301422119141f,-0.94560730457305908203f, +0.32531028985977172852f,-0.94952815771102905273f,0.31368175148963928223f, +-0.95330601930618286133f,0.30200594663619995117f,-0.95694035291671752930f, +0.29028466343879699707f,-0.96043050289154052734f,0.27851969003677368164f, +-0.96377605199813842773f,0.26671275496482849121f,-0.96697646379470825195f, +0.25486564636230468750f,-0.97003126144409179688f,0.24298018217086791992f, +-0.97293996810913085938f,0.23105810582637786865f,-0.97570210695266723633f, +0.21910123527050018311f,-0.97831737995147705078f,0.20711137354373931885f, +-0.98078525066375732422f,0.19509032368659973145f,-0.98310548067092895508f, +0.18303988873958587646f,-0.98527765274047851562f,0.17096188664436340332f, +-0.98730140924453735352f,0.15885815024375915527f,-0.98917651176452636719f, +0.14673046767711639404f,-0.99090266227722167969f,0.13458070158958435059f, +-0.99247956275939941406f,0.12241067737340927124f,-0.99390697479248046875f, +0.11022220551967620850f,-0.99518471956253051758f,0.09801714122295379639f, +-0.99631261825561523438f,0.08579730987548828125f,-0.99729043245315551758f, +0.07356456667184829712f,-0.99811810255050659180f,0.06132073700428009033f, +-0.99879544973373413086f,0.04906767606735229492f,-0.99932235479354858398f, +0.03680722415447235107f,-0.99969881772994995117f,0.02454122900962829590f, +-0.99992471933364868164f,0.01227153837680816650f,1.00000000000000000000f, +0.00000000000000000000f,0.99879544973373413086f,0.04906767606735229492f, +0.99518471956253051758f,0.09801714122295379639f,0.98917651176452636719f, +0.14673046767711639404f,0.98078525066375732422f,0.19509032368659973145f, +0.97003126144409179688f,0.24298018217086791992f,0.95694035291671752930f, +0.29028466343879699707f,0.94154405593872070312f,0.33688986301422119141f, +0.92387950420379638672f,0.38268342614173889160f,0.90398931503295898438f, +0.42755508422851562500f,0.88192129135131835938f,0.47139674425125122070f, +0.85772860050201416016f,0.51410275697708129883f,0.83146959543228149414f, +0.55557024478912353516f,0.80320751667022705078f,0.59569931030273437500f, +0.77301043272018432617f,0.63439327478408813477f,0.74095112085342407227f, +0.67155897617340087891f,0.70710676908493041992f,0.70710676908493041992f, +0.67155897617340087891f,0.74095112085342407227f,0.63439327478408813477f, +0.77301043272018432617f,0.59569931030273437500f,0.80320751667022705078f, +0.55557024478912353516f,0.83146959543228149414f,0.51410275697708129883f, +0.85772860050201416016f,0.47139674425125122070f,0.88192129135131835938f, +0.42755508422851562500f,0.90398931503295898438f,0.38268342614173889160f, +0.92387950420379638672f,0.33688986301422119141f,0.94154405593872070312f, +0.29028466343879699707f,0.95694035291671752930f,0.24298018217086791992f, +0.97003126144409179688f,0.19509032368659973145f,0.98078525066375732422f, +0.14673046767711639404f,0.98917651176452636719f,0.09801714122295379639f, +0.99518471956253051758f,0.04906767606735229492f,0.99879544973373413086f, +0.00000000000000006123f,1.00000000000000000000f,-0.04906767606735229492f, +0.99879544973373413086f,-0.09801714122295379639f,0.99518471956253051758f, +-0.14673046767711639404f,0.98917651176452636719f,-0.19509032368659973145f, +0.98078525066375732422f,-0.24298018217086791992f,0.97003126144409179688f, +-0.29028466343879699707f,0.95694035291671752930f,-0.33688986301422119141f, +0.94154405593872070312f,-0.38268342614173889160f,0.92387950420379638672f, +-0.42755508422851562500f,0.90398931503295898438f,-0.47139674425125122070f, +0.88192129135131835938f,-0.51410275697708129883f,0.85772860050201416016f, +-0.55557024478912353516f,0.83146959543228149414f,-0.59569931030273437500f, +0.80320751667022705078f,-0.63439327478408813477f,0.77301043272018432617f, +-0.67155897617340087891f,0.74095112085342407227f,-0.70710676908493041992f, +0.70710676908493041992f,-0.74095112085342407227f,0.67155897617340087891f, +-0.77301043272018432617f,0.63439327478408813477f,-0.80320751667022705078f, +0.59569931030273437500f,-0.83146959543228149414f,0.55557024478912353516f, +-0.85772860050201416016f,0.51410275697708129883f,-0.88192129135131835938f, +0.47139674425125122070f,-0.90398931503295898438f,0.42755508422851562500f, +-0.92387950420379638672f,0.38268342614173889160f,-0.94154405593872070312f, +0.33688986301422119141f,-0.95694035291671752930f,0.29028466343879699707f, +-0.97003126144409179688f,0.24298018217086791992f,-0.98078525066375732422f, +0.19509032368659973145f,-0.98917651176452636719f,0.14673046767711639404f, +-0.99518471956253051758f,0.09801714122295379639f,-0.99879544973373413086f, +0.04906767606735229492f,1.00000000000000000000f,0.00000000000000000000f, +0.98078525066375732422f,0.19509032368659973145f,0.92387950420379638672f, +0.38268342614173889160f,0.83146959543228149414f,0.55557024478912353516f, +0.70710676908493041992f,0.70710676908493041992f,0.55557024478912353516f, +0.83146959543228149414f,0.38268342614173889160f,0.92387950420379638672f, +0.19509032368659973145f,0.98078525066375732422f,0.00000000000000006123f, +1.00000000000000000000f,-0.19509032368659973145f,0.98078525066375732422f, +-0.38268342614173889160f,0.92387950420379638672f,-0.55557024478912353516f, +0.83146959543228149414f,-0.70710676908493041992f,0.70710676908493041992f, +-0.83146959543228149414f,0.55557024478912353516f,-0.92387950420379638672f, +0.38268342614173889160f,-0.98078525066375732422f,0.19509032368659973145f, +1.00000000000000000000f,0.00000000000000000000f,0.70710676908493041992f, +0.70710676908493041992f,0.00000000000000006123f,1.00000000000000000000f, +-0.70710676908493041992f,0.70710676908493041992f,}; float32_t rearranged_twiddle_stride3_1024_f32[680]={ -1.00000000000000000000f,0.00000000000000000000f,0.99983058179582340319f, -0.01840672990580482019f,0.99932238458834954375f,0.03680722294135883171f, -0.99847558057329477421f,0.05519524434968993420f,0.99729045667869020697f, -0.07356456359966742631f,0.99576741446765981713f,0.09190895649713272386f, -0.99390697000235606051f,0.11022220729388305938f,0.99170975366909952520f, -0.12849811079379316880f,0.98917650996478101444f,0.14673047445536174793f, -0.98630809724459866938f,0.16491312048996989437f,0.98310548743121628501f, -0.18303988795514095078f,0.97956976568544051887f,0.20110463484209190055f, -0.97570213003852857003f,0.21910124015686979759f,0.97150389098625178352f, -0.23702360599436719801f,0.96697647104485207059f,0.25486565960451457169f, -0.96212140426904158019f,0.27262135544994897662f,0.95694033573220882438f, -0.29028467725446233105f,0.95143502096900833820f,0.30784964004153486661f, -0.94560732538052127971f,0.32531029216226292622f,0.93945922360218991898f, -0.34266071731199437833f,0.93299279883473895669f,0.35989503653498811087f, -0.92621024213831137928f,0.37700741021641825945f,0.91911385169005777040f, -0.39399204006104809883f,0.91170603200542987832f,0.41084317105790391089f, -0.90398929312344333820f,0.42755509343028208491f,0.89596624975618521791f, -0.44412214457042920035f,0.88763962040285393496f,0.46053871095824000514f, -0.87901222642863352519f,0.47679923006332208812f,0.87008699110871146054f, -0.49289819222978403790f,0.86086693863776730939f,0.50883014254310698909f, -0.85135519310526519554f,0.52458968267846894928f,0.84155497743689844370f, -0.54017147272989285423f,0.83146961230254523567f,0.55557023301960217765f, -0.82110251499110464835f,0.57078074588696725566f,0.81045719825259476821f, -0.58579785745643886408f,0.79953726910790501314f,0.60061647938386897305f, -0.78834642762660622761f,0.61523159058062681925f,0.77688846567323244230f, -0.62963823891492698426f,0.76516726562245895860f,0.64383154288979138613f, -0.75318679904361252042f,0.65780669329707863735f,0.74095112535495921691f, -0.67155895484701833009f,0.72846439044822519637f,0.68508366777270035541f, -0.71573082528381870571f,0.69837624940897280457f,0.70275474445722529993f, -0.71143219574521643356f,0.68954054473706694051f,0.72424708295146689174f, -0.67609270357531603413f,0.73681656887736979300f,0.66241577759017178373f, -0.74913639452345925918f,0.64851440102211255212f,0.76120238548426177871f, -0.63439328416364548779f,0.77301045336273688235f,0.62005721176328920663f, -0.78455659715557524159f,0.60551104140432554512f,0.79583690460888345530f, -0.59075970185887427544f,0.80684755354379922299f,0.57580819141784533866f, -0.81758481315158371139f,0.56066157619733603124f,0.82804504525775579626f, -0.54532498842204646383f,0.83822470555483796772f,0.52980362468629482731f, -0.84812034480329712149f,0.51410274419322166128f,0.85772861000027211809f, -0.49822766697278186854f,0.86704624551569264845f,0.48218377207912282989f, -0.87607009419540660122f,0.46597649576796612569f,0.88479709843093778954f, -0.44961132965460659516f,0.89322430119551532446f,0.43309381885315201277f, -0.90134884704602202810f,0.41642956009763731906f,0.90916798309052226923f, -0.39962419984564678810f,0.91667905992104270485f,0.38268343236508983729f, -0.92387953251128673848f,0.36561299780477396482f,0.93076696107898371224f, -0.34841868024943450921f,0.93733901191257495977f,0.33110630575987642921f, -0.94359345816196038559f,0.31368174039889157312f,0.94952818059303667475f, -0.29615088824362395536f,0.95514116830577067141f,0.27851968938505305973f, -0.96043051941556578655f,0.26079411791527556952f,0.96539444169768939830f, -0.24298017990326398197f,0.97003125319454397424f,0.22508391135979277653f, -0.97433938278557585821f,0.20711137619221856032f,0.97831737071962765473f, -0.18906866414980627589f,0.98196386910955524296f,0.17096188876030135595f, -0.98527764238894122162f,0.15279718525844340760f,0.98825756773074946437f, -0.13458070850712622324f,0.99090263542778000971f,0.11631863091190487725f, -0.99321194923479450001f,0.09801714032956077016f,0.99518472667219681771f, -0.07968243797143012563f,0.99682029929116566791f,0.06132073630220864768f, -0.99811811290014917919f,0.04293825693494095902f,0.99907772775264536147f, -0.02454122852291226384f,0.99969881869620424997f,0.00613588464915451517f, -0.99998117528260110909f,-0.01227153828571982304f,0.99992470183914450299f, --0.03067480317663645942f,0.99952941750109314256f,-0.04906767432741800800f, -0.99879545620517240501f,-0.06744391956366398155f,0.99772306664419163624f, --0.08579731234443975507f,0.99631261218277800129f,-0.10412163387205460030f, -0.99456457073425541537f,-0.12241067519921615403f,0.99247953459870996706f, --0.14065823933284912761f,0.99005821026229712256f,-0.15885814333386127917f, -0.98730141815785843473f,-0.17700422041214874946f,0.98421009238692902521f, --0.19509032201612819257f,0.98078528040323043058f,-0.21311031991609125091f, -0.97702814265775439484f,-0.23105810828067113727f,0.97293995220556017678f, --0.24892760574572012078f,0.96852209427441737777f,-0.26671275747489830987f, -0.96377606579543984022f,-0.28440753721127171039f,0.95870347489587159906f, --0.30200594931922808417f,0.95330604035419386211f,-0.31950203081601563637f, -0.94758559101774120226f,-0.33688985339221994009f,0.94154406518302080631f, --0.35416352542049039931f,0.93518350993894761025f,-0.37131719395183748755f, -0.92850608047321558924f,-0.38834504669882619066f,0.92151403934204201285f, --0.40524131400498974998f,0.91420975570353069095f,-0.42200027079979968159f, -0.90659570451491533483f,-0.43861623853852738097f,0.89867446569395392775f, --0.45508358712634372489f,0.89044872324475798919f,-0.47139673682599769755f, -0.88192126434835504956f,-0.48755016014843571837f,0.87309497841829020182f, --0.50353838372571746440f,0.86397285612158680745f,-0.51935599016558964269f, -0.85455798836540053376f,-0.53499761988709704230f,0.84485356524970722791f, --0.55045797293660470029f,0.83486287498638012128f,-0.56573181078361323149f, -0.82458930278502517996f,-0.58081395809576441547f,0.81403632970594852480f, --0.59569930449243335691f,0.80320753148064494287f,-0.61038280627630958630f, -0.79210657730021227785f,-0.62485948814238623239f,0.78073722857209459924f, --0.63912444486377573138f,0.76910333764557958780f,-0.65317284295377653347f, -0.75720884650648467851f,-0.66699992230363736034f,0.74505778544146605835f, --0.68060099779545302212f,0.73265427167241281570f,-0.69397146088965377952f, -0.72000250796138176579f,-0.70710678118654746172f,0.70710678118654757274f, --0.72000250796138165477f,0.69397146088965389055f,-0.73265427167241270467f, -0.68060099779545324417f,-0.74505778544146594733f,0.66699992230363758239f, --0.75720884650648467851f,0.65317284295377664449f,-0.76910333764557947678f, -0.63912444486377584241f,-0.78073722857209448822f,0.62485948814238634341f, --0.79210657730021216683f,0.61038280627630969732f,-0.80320753148064483184f, -0.59569930449243346793f,-0.81403632970594841378f,0.58081395809576452649f, --0.82458930278502506894f,0.56573181078361345353f,-0.83486287498638001026f, -0.55045797293660492233f,-0.84485356524970711689f,0.53499761988709715332f, --0.85455798836540042274f,0.51935599016558975372f,-0.86397285612158669643f, -0.50353838372571757542f,-0.87309497841829009079f,0.48755016014843588490f, --0.88192126434835493853f,0.47139673682599780857f,-0.89044872324475787817f, -0.45508358712634389143f,-0.89867446569395392775f,0.43861623853852754751f, --0.90659570451491533483f,0.42200027079979984812f,-0.91420975570353069095f, -0.40524131400498991651f,-0.92151403934204179080f,0.38834504669882657923f, --0.92850608047321547822f,0.37131719395183770960f,-0.93518350993894761025f, -0.35416352542049039931f,-0.94154406518302069529f,0.33688985339222032867f, --0.94758559101774109124f,0.31950203081601580291f,-0.95330604035419386211f, -0.30200594931922802866f,-0.95870347489587148804f,0.28440753721127209896f, --0.96377606579543984022f,0.26671275747489847641f,-0.96852209427441737777f, -0.24892760574572009302f,-0.97293995220556006576f,0.23105810828067133156f, --0.97702814265775439484f,0.21311031991609141745f,-0.98078528040323043058f, -0.19509032201612860891f,-0.98421009238692902521f,0.17700422041214894375f, --0.98730141815785843473f,0.15885814333386147346f,-0.99005821026229701154f, -0.14065823933284954395f,-0.99247953459870996706f,0.12241067519921634832f, --0.99456457073425541537f,0.10412163387205457254f,-0.99631261218277800129f, -0.08579731234444015753f,-0.99772306664419163624f,0.06744391956366417584f, --0.99879545620517240501f,0.04906767432741796636f,-0.99952941750109314256f, -0.03067480317663686534f,-0.99992470183914450299f,0.01227153828572000692f, --0.99998117528260110909f,-0.00613588464915455420f,-0.99969881869620424997f, --0.02454122852291207996f,-0.99907772775264536147f,-0.04293825693494077861f, --0.99811811290014917919f,-0.06132073630220824523f,-0.99682029929116577893f, --0.07968243797142994522f,-0.99518472667219692873f,-0.09801714032956058975f, --0.99321194923479461103f,-0.11631863091190447479f,-0.99090263542778000971f, --0.13458070850712605671f,-0.98825756773074946437f,-0.15279718525844343535f, --0.98527764238894133264f,-0.17096188876030096737f,-0.98196386910955524296f, --0.18906866414980610935f,-0.97831737071962765473f,-0.20711137619221858808f, --0.97433938278557585821f,-0.22508391135979261000f,-0.97003125319454397424f, --0.24298017990326381543f,-0.96539444169768939830f,-0.26079411791527562503f, --0.96043051941556589757f,-0.27851968938505289319f,-0.95514116830577078243f, --0.29615088824362378883f,-0.94952818059303678577f,-0.31368174039889118454f, --0.94359345816196038559f,-0.33110630575987626267f,-0.93733901191257495977f, --0.34841868024943456472f,-0.93076696107898382326f,-0.36561299780477357624f, --0.92387953251128684951f,-0.38268343236508967076f,-0.91667905992104270485f, --0.39962419984564684361f,-0.90916798309052249127f,-0.41642956009763693048f, --0.90134884704602202810f,-0.43309381885315184624f,-0.89322430119551532446f, --0.44961132965460665067f,-0.88479709843093790056f,-0.46597649576796595916f, --0.87607009419540660122f,-0.48218377207912266336f,-0.86704624551569287050f, --0.49822766697278153547f,-0.85772861000027211809f,-0.51410274419322155026f, --0.84812034480329723252f,-0.52980362468629460526f,-0.83822470555483818977f, --0.54532498842204613076f,-0.82804504525775590729f,-0.56066157619733592021f, --0.81758481315158371139f,-0.57580819141784533866f,-0.80684755354379944503f, --0.59075970185887394237f,-0.79583690460888356633f,-0.60551104140432543410f, --0.78455659715557524159f,-0.62005721176328920663f,-0.77301045336273710440f, --0.63439328416364526575f,-0.76120238548426188974f,-0.64851440102211233008f, --0.74913639452345925918f,-0.66241577759017178373f,-0.73681656887737001504f, --0.67609270357531581208f,-0.72424708295146700276f,-0.68954054473706682948f, --0.71143219574521665560f,-0.70275474445722507788f,-0.69837624940897302661f, --0.71573082528381848366f,-0.68508366777270035541f,-0.72846439044822519637f, --0.67155895484701866316f,-0.74095112535495888384f,-0.65780669329707874837f, --0.75318679904361240940f,-0.64383154288979149715f,-0.76516726562245895860f, --0.62963823891492687324f,-0.77688846567323255332f,-0.61523159058062726334f, --0.78834642762660589455f,-0.60061647938386930612f,-0.79953726910790479110f, --0.58579785745643908612f,-0.81045719825259465718f,-0.57078074588696736669f, --0.82110251499110464835f,-0.55557023301960217765f,-0.83146961230254523567f, --0.54017147272989274320f,-0.84155497743689855472f,-0.52458968267846928235f, --0.85135519310526486247f,-0.50883014254310732216f,-0.86086693863776708735f, --0.49289819222978420443f,-0.87008699110871134952f,-0.47679923006332214364f, --0.87901222642863341417f,-0.46053871095823989412f,-0.88763962040285404598f, --0.44412214457042975546f,-0.89596624975618488484f,-0.42755509343028247349f, --0.90398929312344311615f,-0.41084317105790418845f,-0.91170603200542976730f, --0.39399204006104820985f,-0.91911385169005765938f,-0.37700741021641820394f, --0.92621024213831137928f,-0.35989503653498794433f,-0.93299279883473895669f, --0.34266071731199487793f,-0.93945922360218969693f,-0.32531029216226331480f, --0.94560732538052116869f,-0.30784964004153508865f,-0.95143502096900833820f, --0.29028467725446244208f,-0.95694033573220882438f,-0.27262135544994886560f, --0.96212140426904158019f,-0.25486565960451434965f,-0.96697647104485218161f, --0.23702360599436766986f,-0.97150389098625167250f,-0.21910124015687010290f, --0.97570213003852845901f,-0.20110463484209206708f,-0.97956976568544051887f, --0.18303988795514095078f,-0.98310548743121628501f,-0.16491312048996975559f, --0.98630809724459866938f,-0.14673047445536230304f,-0.98917650996478090342f, --0.12849811079379358514f,-0.99170975366909952520f,-0.11022220729388330918f, --0.99390697000235606051f,-0.09190895649713282101f,-0.99576741446765981713f, --0.07356456359966735692f,-0.99729045667869020697f,-0.05519524434968971216f, --0.99847558057329477421f,-0.03680722294135933131f,-0.99932238458834943273f, --0.01840672990580516366f,-0.99983058179582340319f,1.00000000000000000000f, -0.00000000000000000000f,0.99729045667869020697f,0.07356456359966742631f, -0.98917650996478101444f,0.14673047445536174793f,0.97570213003852857003f, -0.21910124015686979759f,0.95694033573220882438f,0.29028467725446233105f, -0.93299279883473895669f,0.35989503653498811087f,0.90398929312344333820f, -0.42755509343028208491f,0.87008699110871146054f,0.49289819222978403790f, -0.83146961230254523567f,0.55557023301960217765f,0.78834642762660622761f, -0.61523159058062681925f,0.74095112535495921691f,0.67155895484701833009f, -0.68954054473706694051f,0.72424708295146689174f,0.63439328416364548779f, -0.77301045336273688235f,0.57580819141784533866f,0.81758481315158371139f, -0.51410274419322166128f,0.85772861000027211809f,0.44961132965460659516f, -0.89322430119551532446f,0.38268343236508983729f,0.92387953251128673848f, -0.31368174039889157312f,0.94952818059303667475f,0.24298017990326398197f, -0.97003125319454397424f,0.17096188876030135595f,0.98527764238894122162f, -0.09801714032956077016f,0.99518472667219681771f,0.02454122852291226384f, -0.99969881869620424997f,-0.04906767432741800800f,0.99879545620517240501f, --0.12241067519921615403f,0.99247953459870996706f,-0.19509032201612819257f, -0.98078528040323043058f,-0.26671275747489830987f,0.96377606579543984022f, --0.33688985339221994009f,0.94154406518302080631f,-0.40524131400498974998f, -0.91420975570353069095f,-0.47139673682599769755f,0.88192126434835504956f, --0.53499761988709704230f,0.84485356524970722791f,-0.59569930449243335691f, -0.80320753148064494287f,-0.65317284295377653347f,0.75720884650648467851f, --0.70710678118654746172f,0.70710678118654757274f,-0.75720884650648467851f, -0.65317284295377664449f,-0.80320753148064483184f,0.59569930449243346793f, --0.84485356524970711689f,0.53499761988709715332f,-0.88192126434835493853f, -0.47139673682599780857f,-0.91420975570353069095f,0.40524131400498991651f, --0.94154406518302069529f,0.33688985339222032867f,-0.96377606579543984022f, -0.26671275747489847641f,-0.98078528040323043058f,0.19509032201612860891f, --0.99247953459870996706f,0.12241067519921634832f,-0.99879545620517240501f, -0.04906767432741796636f,-0.99969881869620424997f,-0.02454122852291207996f, --0.99518472667219692873f,-0.09801714032956058975f,-0.98527764238894133264f, --0.17096188876030096737f,-0.97003125319454397424f,-0.24298017990326381543f, --0.94952818059303678577f,-0.31368174039889118454f,-0.92387953251128684951f, --0.38268343236508967076f,-0.89322430119551532446f,-0.44961132965460665067f, --0.85772861000027211809f,-0.51410274419322155026f,-0.81758481315158371139f, --0.57580819141784533866f,-0.77301045336273710440f,-0.63439328416364526575f, --0.72424708295146700276f,-0.68954054473706682948f,-0.67155895484701866316f, --0.74095112535495888384f,-0.61523159058062726334f,-0.78834642762660589455f, --0.55557023301960217765f,-0.83146961230254523567f,-0.49289819222978420443f, --0.87008699110871134952f,-0.42755509343028247349f,-0.90398929312344311615f, --0.35989503653498794433f,-0.93299279883473895669f,-0.29028467725446244208f, --0.95694033573220882438f,-0.21910124015687010290f,-0.97570213003852845901f, --0.14673047445536230304f,-0.98917650996478090342f,-0.07356456359966735692f, --0.99729045667869020697f,1.00000000000000000000f,0.00000000000000000000f, -0.95694033573220882438f,0.29028467725446233105f,0.83146961230254523567f, -0.55557023301960217765f,0.63439328416364548779f,0.77301045336273688235f, -0.38268343236508983729f,0.92387953251128673848f,0.09801714032956077016f, -0.99518472667219681771f,-0.19509032201612819257f,0.98078528040323043058f, --0.47139673682599769755f,0.88192126434835504956f,-0.70710678118654746172f, -0.70710678118654757274f,-0.88192126434835493853f,0.47139673682599780857f, --0.98078528040323043058f,0.19509032201612860891f,-0.99518472667219692873f, --0.09801714032956058975f,-0.92387953251128684951f,-0.38268343236508967076f, --0.77301045336273710440f,-0.63439328416364526575f,-0.55557023301960217765f, --0.83146961230254523567f,-0.29028467725446244208f,-0.95694033573220882438f, -1.00000000000000000000f,0.00000000000000000000f,0.38268343236508983729f, -0.92387953251128673848f,-0.70710678118654746172f,0.70710678118654757274f, --0.92387953251128684951f,-0.38268343236508967076f,}; +1.00000000000000000000f,0.00000000000000000000f,0.99983060359954833984f, +0.01840673014521598816f,0.99932235479354858398f,0.03680722415447235107f, +0.99847555160522460938f,0.05519524589180946350f,0.99729043245315551758f, +0.07356456667184829712f,0.99576741456985473633f,0.09190895408391952515f, +0.99390697479248046875f,0.11022220551967620850f,0.99170976877212524414f, +0.12849810719490051270f,0.98917651176452636719f,0.14673046767711639404f, +0.98630809783935546875f,0.16491311788558959961f,0.98310548067092895508f, +0.18303988873958587646f,0.97956979274749755859f,0.20110464096069335938f, +0.97570210695266723633f,0.21910123527050018311f,0.97150391340255737305f, +0.23702360689640045166f,0.96697646379470825195f,0.25486564636230468750f, +0.96212142705917358398f,0.27262136340141296387f,0.95694035291671752930f, +0.29028466343879699707f,0.95143502950668334961f,0.30784964561462402344f, +0.94560730457305908203f,0.32531028985977172852f,0.93945920467376708984f, +0.34266072511672973633f,0.93299281597137451172f,0.35989505052566528320f, +0.92621022462844848633f,0.37700742483139038086f,0.91911387443542480469f, +0.39399203658103942871f,0.91170603036880493164f,0.41084316372871398926f, +0.90398931503295898438f,0.42755508422851562500f,0.89596623182296752930f, +0.44412213563919067383f,0.88763964176177978516f,0.46053871512413024902f, +0.87901222705841064453f,0.47679921984672546387f,0.87008696794509887695f, +0.49289819598197937012f,0.86086696386337280273f,0.50883013010025024414f, +0.85135519504547119141f,0.52458965778350830078f,0.84155499935150146484f, +0.54017144441604614258f,0.83146959543228149414f,0.55557024478912353516f, +0.82110249996185302734f,0.57078075408935546875f,0.81045717000961303711f, +0.58579784631729125977f,0.79953724145889282227f,0.60061645507812500000f, +0.78834640979766845703f,0.61523157358169555664f,0.77688848972320556641f, +0.62963825464248657227f,0.76516723632812500000f,0.64383155107498168945f, +0.75318682193756103516f,0.65780669450759887695f,0.74095112085342407227f, +0.67155897617340087891f,0.72846436500549316406f,0.68508368730545043945f, +0.71573084592819213867f,0.69837623834609985352f,0.70275473594665527344f, +0.71143221855163574219f,0.68954056501388549805f,0.72424709796905517578f, +0.67609268426895141602f,0.73681658506393432617f,0.66241580247879028320f, +0.74913638830184936523f,0.64851438999176025391f,0.76120239496231079102f, +0.63439327478408813477f,0.77301043272018432617f,0.62005722522735595703f, +0.78455656766891479492f,0.60551106929779052734f,0.79583692550659179688f, +0.59075969457626342773f,0.80684757232666015625f,0.57580816745758056641f, +0.81758481264114379883f,0.56066155433654785156f,0.82804507017135620117f, +0.54532498121261596680f,0.83822470903396606445f,0.52980363368988037109f, +0.84812033176422119141f,0.51410275697708129883f,0.85772860050201416016f, +0.49822765588760375977f,0.86704623699188232422f,0.48218378424644470215f, +0.87607008218765258789f,0.46597650647163391113f,0.88479709625244140625f, +0.44961133599281311035f,0.89322429895401000977f,0.43309381604194641113f, +0.90134882926940917969f,0.41642954945564270020f,0.90916800498962402344f, +0.39962419867515563965f,0.91667908430099487305f,0.38268342614173889160f, +0.92387950420379638672f,0.36561298370361328125f,0.93076694011688232422f, +0.34841868281364440918f,0.93733900785446166992f,0.33110630512237548828f, +0.94359344244003295898f,0.31368175148963928223f,0.94952815771102905273f, +0.29615089297294616699f,0.95514118671417236328f,0.27851969003677368164f, +0.96043050289154052734f,0.26079410314559936523f,0.96539443731307983398f, +0.24298018217086791992f,0.97003126144409179688f,0.22508391737937927246f, +0.97433936595916748047f,0.20711137354373931885f,0.97831737995147705078f, +0.18906866014003753662f,0.98196387290954589844f,0.17096188664436340332f, +0.98527765274047851562f,0.15279719233512878418f,0.98825758695602416992f, +0.13458070158958435059f,0.99090266227722167969f,0.11631862819194793701f, +0.99321192502975463867f,0.09801714122295379639f,0.99518471956253051758f, +0.07968243956565856934f,0.99682027101516723633f,0.06132073700428009033f, +0.99811810255050659180f,0.04293825849890708923f,0.99907773733139038086f, +0.02454122900962829590f,0.99969881772994995117f,0.00613588467240333557f, +0.99998116493225097656f,-0.01227153837680816650f,0.99992471933364868164f, +-0.03067480400204658508f,0.99952942132949829102f,-0.04906767606735229492f, +0.99879544973373413086f,-0.06744392216205596924f,0.99772304296493530273f, +-0.08579730987548828125f,0.99631261825561523438f,-0.10412163287401199341f, +0.99456459283828735352f,-0.12241067737340927124f,0.99247956275939941406f, +-0.14065824449062347412f,0.99005818367004394531f,-0.15885815024375915527f, +0.98730140924453735352f,-0.17700421810150146484f,0.98421007394790649414f, +-0.19509032368659973145f,0.98078525066375732422f,-0.21311031281948089600f, +0.97702813148498535156f,-0.23105810582637786865f,0.97293996810913085938f, +-0.24892760813236236572f,0.96852207183837890625f,-0.26671275496482849121f, +0.96377605199813842773f,-0.28440752625465393066f,0.95870345830917358398f, +-0.30200594663619995117f,0.95330601930618286133f,-0.31950202584266662598f, +0.94758558273315429688f,-0.33688986301422119141f,0.94154405593872070312f, +-0.35416352748870849609f,0.93518352508544921875f,-0.37131720781326293945f, +0.92850607633590698242f,-0.38834503293037414551f,0.92151403427124023438f, +-0.40524131059646606445f,0.91420978307723999023f,-0.42200025916099548340f, +0.90659570693969726562f,-0.43861624598503112793f,0.89867448806762695312f, +-0.45508357882499694824f,0.89044874906539916992f,-0.47139674425125122070f, +0.88192129135131835938f,-0.48755016922950744629f,0.87309497594833374023f, +-0.50353837013244628906f,0.86397284269332885742f,-0.51935601234436035156f, +0.85455799102783203125f,-0.53499764204025268555f,0.84485357999801635742f, +-0.55045795440673828125f,0.83486288785934448242f,-0.56573182344436645508f, +0.82458931207656860352f,-0.58081394433975219727f,0.81403630971908569336f, +-0.59569931030273437500f,0.80320751667022705078f,-0.61038279533386230469f, +0.79210656881332397461f,-0.62485951185226440430f,0.78073722124099731445f, +-0.63912445306777954102f,0.76910334825515747070f,-0.65317285060882568359f, +0.75720882415771484375f,-0.66699993610382080078f,0.74505776166915893555f, +-0.68060100078582763672f,0.73265427350997924805f,-0.69397145509719848633f, +0.72000253200531005859f,-0.70710676908493041992f,0.70710676908493041992f, +-0.72000253200531005859f,0.69397145509719848633f,-0.73265427350997924805f, +0.68060100078582763672f,-0.74505776166915893555f,0.66699993610382080078f, +-0.75720882415771484375f,0.65317285060882568359f,-0.76910334825515747070f, +0.63912445306777954102f,-0.78073722124099731445f,0.62485951185226440430f, +-0.79210656881332397461f,0.61038279533386230469f,-0.80320751667022705078f, +0.59569931030273437500f,-0.81403630971908569336f,0.58081394433975219727f, +-0.82458931207656860352f,0.56573182344436645508f,-0.83486288785934448242f, +0.55045795440673828125f,-0.84485357999801635742f,0.53499764204025268555f, +-0.85455799102783203125f,0.51935601234436035156f,-0.86397284269332885742f, +0.50353837013244628906f,-0.87309497594833374023f,0.48755016922950744629f, +-0.88192129135131835938f,0.47139674425125122070f,-0.89044874906539916992f, +0.45508357882499694824f,-0.89867448806762695312f,0.43861624598503112793f, +-0.90659570693969726562f,0.42200025916099548340f,-0.91420978307723999023f, +0.40524131059646606445f,-0.92151403427124023438f,0.38834503293037414551f, +-0.92850607633590698242f,0.37131720781326293945f,-0.93518352508544921875f, +0.35416352748870849609f,-0.94154405593872070312f,0.33688986301422119141f, +-0.94758558273315429688f,0.31950202584266662598f,-0.95330601930618286133f, +0.30200594663619995117f,-0.95870345830917358398f,0.28440752625465393066f, +-0.96377605199813842773f,0.26671275496482849121f,-0.96852207183837890625f, +0.24892760813236236572f,-0.97293996810913085938f,0.23105810582637786865f, +-0.97702813148498535156f,0.21311031281948089600f,-0.98078525066375732422f, +0.19509032368659973145f,-0.98421007394790649414f,0.17700421810150146484f, +-0.98730140924453735352f,0.15885815024375915527f,-0.99005818367004394531f, +0.14065824449062347412f,-0.99247956275939941406f,0.12241067737340927124f, +-0.99456459283828735352f,0.10412163287401199341f,-0.99631261825561523438f, +0.08579730987548828125f,-0.99772304296493530273f,0.06744392216205596924f, +-0.99879544973373413086f,0.04906767606735229492f,-0.99952942132949829102f, +0.03067480400204658508f,-0.99992471933364868164f,0.01227153837680816650f, +-0.99998116493225097656f,-0.00613588467240333557f,-0.99969881772994995117f, +-0.02454122900962829590f,-0.99907773733139038086f,-0.04293825849890708923f, +-0.99811810255050659180f,-0.06132073700428009033f,-0.99682027101516723633f, +-0.07968243956565856934f,-0.99518471956253051758f,-0.09801714122295379639f, +-0.99321192502975463867f,-0.11631862819194793701f,-0.99090266227722167969f, +-0.13458070158958435059f,-0.98825758695602416992f,-0.15279719233512878418f, +-0.98527765274047851562f,-0.17096188664436340332f,-0.98196387290954589844f, +-0.18906866014003753662f,-0.97831737995147705078f,-0.20711137354373931885f, +-0.97433936595916748047f,-0.22508391737937927246f,-0.97003126144409179688f, +-0.24298018217086791992f,-0.96539443731307983398f,-0.26079410314559936523f, +-0.96043050289154052734f,-0.27851969003677368164f,-0.95514118671417236328f, +-0.29615089297294616699f,-0.94952815771102905273f,-0.31368175148963928223f, +-0.94359344244003295898f,-0.33110630512237548828f,-0.93733900785446166992f, +-0.34841868281364440918f,-0.93076694011688232422f,-0.36561298370361328125f, +-0.92387950420379638672f,-0.38268342614173889160f,-0.91667908430099487305f, +-0.39962419867515563965f,-0.90916800498962402344f,-0.41642954945564270020f, +-0.90134882926940917969f,-0.43309381604194641113f,-0.89322429895401000977f, +-0.44961133599281311035f,-0.88479709625244140625f,-0.46597650647163391113f, +-0.87607008218765258789f,-0.48218378424644470215f,-0.86704623699188232422f, +-0.49822765588760375977f,-0.85772860050201416016f,-0.51410275697708129883f, +-0.84812033176422119141f,-0.52980363368988037109f,-0.83822470903396606445f, +-0.54532498121261596680f,-0.82804507017135620117f,-0.56066155433654785156f, +-0.81758481264114379883f,-0.57580816745758056641f,-0.80684757232666015625f, +-0.59075969457626342773f,-0.79583692550659179688f,-0.60551106929779052734f, +-0.78455656766891479492f,-0.62005722522735595703f,-0.77301043272018432617f, +-0.63439327478408813477f,-0.76120239496231079102f,-0.64851438999176025391f, +-0.74913638830184936523f,-0.66241580247879028320f,-0.73681658506393432617f, +-0.67609268426895141602f,-0.72424709796905517578f,-0.68954056501388549805f, +-0.71143221855163574219f,-0.70275473594665527344f,-0.69837623834609985352f, +-0.71573084592819213867f,-0.68508368730545043945f,-0.72846436500549316406f, +-0.67155897617340087891f,-0.74095112085342407227f,-0.65780669450759887695f, +-0.75318682193756103516f,-0.64383155107498168945f,-0.76516723632812500000f, +-0.62963825464248657227f,-0.77688848972320556641f,-0.61523157358169555664f, +-0.78834640979766845703f,-0.60061645507812500000f,-0.79953724145889282227f, +-0.58579784631729125977f,-0.81045717000961303711f,-0.57078075408935546875f, +-0.82110249996185302734f,-0.55557024478912353516f,-0.83146959543228149414f, +-0.54017144441604614258f,-0.84155499935150146484f,-0.52458965778350830078f, +-0.85135519504547119141f,-0.50883013010025024414f,-0.86086696386337280273f, +-0.49289819598197937012f,-0.87008696794509887695f,-0.47679921984672546387f, +-0.87901222705841064453f,-0.46053871512413024902f,-0.88763964176177978516f, +-0.44412213563919067383f,-0.89596623182296752930f,-0.42755508422851562500f, +-0.90398931503295898438f,-0.41084316372871398926f,-0.91170603036880493164f, +-0.39399203658103942871f,-0.91911387443542480469f,-0.37700742483139038086f, +-0.92621022462844848633f,-0.35989505052566528320f,-0.93299281597137451172f, +-0.34266072511672973633f,-0.93945920467376708984f,-0.32531028985977172852f, +-0.94560730457305908203f,-0.30784964561462402344f,-0.95143502950668334961f, +-0.29028466343879699707f,-0.95694035291671752930f,-0.27262136340141296387f, +-0.96212142705917358398f,-0.25486564636230468750f,-0.96697646379470825195f, +-0.23702360689640045166f,-0.97150391340255737305f,-0.21910123527050018311f, +-0.97570210695266723633f,-0.20110464096069335938f,-0.97956979274749755859f, +-0.18303988873958587646f,-0.98310548067092895508f,-0.16491311788558959961f, +-0.98630809783935546875f,-0.14673046767711639404f,-0.98917651176452636719f, +-0.12849810719490051270f,-0.99170976877212524414f,-0.11022220551967620850f, +-0.99390697479248046875f,-0.09190895408391952515f,-0.99576741456985473633f, +-0.07356456667184829712f,-0.99729043245315551758f,-0.05519524589180946350f, +-0.99847555160522460938f,-0.03680722415447235107f,-0.99932235479354858398f, +-0.01840673014521598816f,-0.99983060359954833984f,1.00000000000000000000f, +0.00000000000000000000f,0.99729043245315551758f,0.07356456667184829712f, +0.98917651176452636719f,0.14673046767711639404f,0.97570210695266723633f, +0.21910123527050018311f,0.95694035291671752930f,0.29028466343879699707f, +0.93299281597137451172f,0.35989505052566528320f,0.90398931503295898438f, +0.42755508422851562500f,0.87008696794509887695f,0.49289819598197937012f, +0.83146959543228149414f,0.55557024478912353516f,0.78834640979766845703f, +0.61523157358169555664f,0.74095112085342407227f,0.67155897617340087891f, +0.68954056501388549805f,0.72424709796905517578f,0.63439327478408813477f, +0.77301043272018432617f,0.57580816745758056641f,0.81758481264114379883f, +0.51410275697708129883f,0.85772860050201416016f,0.44961133599281311035f, +0.89322429895401000977f,0.38268342614173889160f,0.92387950420379638672f, +0.31368175148963928223f,0.94952815771102905273f,0.24298018217086791992f, +0.97003126144409179688f,0.17096188664436340332f,0.98527765274047851562f, +0.09801714122295379639f,0.99518471956253051758f,0.02454122900962829590f, +0.99969881772994995117f,-0.04906767606735229492f,0.99879544973373413086f, +-0.12241067737340927124f,0.99247956275939941406f,-0.19509032368659973145f, +0.98078525066375732422f,-0.26671275496482849121f,0.96377605199813842773f, +-0.33688986301422119141f,0.94154405593872070312f,-0.40524131059646606445f, +0.91420978307723999023f,-0.47139674425125122070f,0.88192129135131835938f, +-0.53499764204025268555f,0.84485357999801635742f,-0.59569931030273437500f, +0.80320751667022705078f,-0.65317285060882568359f,0.75720882415771484375f, +-0.70710676908493041992f,0.70710676908493041992f,-0.75720882415771484375f, +0.65317285060882568359f,-0.80320751667022705078f,0.59569931030273437500f, +-0.84485357999801635742f,0.53499764204025268555f,-0.88192129135131835938f, +0.47139674425125122070f,-0.91420978307723999023f,0.40524131059646606445f, +-0.94154405593872070312f,0.33688986301422119141f,-0.96377605199813842773f, +0.26671275496482849121f,-0.98078525066375732422f,0.19509032368659973145f, +-0.99247956275939941406f,0.12241067737340927124f,-0.99879544973373413086f, +0.04906767606735229492f,-0.99969881772994995117f,-0.02454122900962829590f, +-0.99518471956253051758f,-0.09801714122295379639f,-0.98527765274047851562f, +-0.17096188664436340332f,-0.97003126144409179688f,-0.24298018217086791992f, +-0.94952815771102905273f,-0.31368175148963928223f,-0.92387950420379638672f, +-0.38268342614173889160f,-0.89322429895401000977f,-0.44961133599281311035f, +-0.85772860050201416016f,-0.51410275697708129883f,-0.81758481264114379883f, +-0.57580816745758056641f,-0.77301043272018432617f,-0.63439327478408813477f, +-0.72424709796905517578f,-0.68954056501388549805f,-0.67155897617340087891f, +-0.74095112085342407227f,-0.61523157358169555664f,-0.78834640979766845703f, +-0.55557024478912353516f,-0.83146959543228149414f,-0.49289819598197937012f, +-0.87008696794509887695f,-0.42755508422851562500f,-0.90398931503295898438f, +-0.35989505052566528320f,-0.93299281597137451172f,-0.29028466343879699707f, +-0.95694035291671752930f,-0.21910123527050018311f,-0.97570210695266723633f, +-0.14673046767711639404f,-0.98917651176452636719f,-0.07356456667184829712f, +-0.99729043245315551758f,1.00000000000000000000f,0.00000000000000000000f, +0.95694035291671752930f,0.29028466343879699707f,0.83146959543228149414f, +0.55557024478912353516f,0.63439327478408813477f,0.77301043272018432617f, +0.38268342614173889160f,0.92387950420379638672f,0.09801714122295379639f, +0.99518471956253051758f,-0.19509032368659973145f,0.98078525066375732422f, +-0.47139674425125122070f,0.88192129135131835938f,-0.70710676908493041992f, +0.70710676908493041992f,-0.88192129135131835938f,0.47139674425125122070f, +-0.98078525066375732422f,0.19509032368659973145f,-0.99518471956253051758f, +-0.09801714122295379639f,-0.92387950420379638672f,-0.38268342614173889160f, +-0.77301043272018432617f,-0.63439327478408813477f,-0.55557024478912353516f, +-0.83146959543228149414f,-0.29028466343879699707f,-0.95694035291671752930f, +1.00000000000000000000f,0.00000000000000000000f,0.38268342614173889160f, +0.92387950420379638672f,-0.70710676908493041992f,0.70710676908493041992f, +-0.92387950420379638672f,-0.38268342614173889160f,}; #endif @@ -1023,2740 +1026,2740 @@ uint32_t rearranged_twiddle_tab_stride3_arr_4096_f32[6]={ 0,2048,2560,2688,2720,0,}; float32_t rearranged_twiddle_stride1_4096_f32[2728]={ -1.00000000000000000000f,0.00000000000000000000f,0.99999882345170187925f, -0.00153398018628476550f,0.99999529380957619118f,0.00306795676296597614f, -0.99998941108192840321f,0.00460192612044857050f,0.99998117528260110909f, -0.00613588464915447527f,0.99997058643097413988f,0.00766982873953109701f, -0.99995764455196389786f,0.00920375478205981944f,0.99994234967602391162f, -0.01073765916726449055f,0.99992470183914450299f,0.01227153828571992539f, -0.99990470108285289808f,0.01380538852806039059f,0.99988234745421256111f, -0.01533920628498810015f,0.99985764100582386060f,0.01687298794728171042f, -0.99983058179582340319f,0.01840672990580482019f,0.99980116988788425569f, -0.01994042855151444138f,0.99976940535121527898f,0.02147408027546950787f, -0.99973528826056168306f,0.02300768146883936868f,0.99969881869620424997f, -0.02454122852291228812f,0.99965999674395922270f,0.02607471782910390085f, -0.99961882249517863830f,0.02760814577896573974f,0.99957529604674921764f, -0.02914150876419372219f,0.99952941750109314256f,0.03067480317663662595f, -0.99948118696616694567f,0.03220802540830458582f,0.99943060455546173237f, -0.03374117185137757990f,0.99937767038800284780f,0.03527423889821394709f, -0.99932238458834954375f,0.03680722294135883171f,0.99926474728659442359f, -0.03834012037355269409f,0.99920475861836388631f,0.03987292758773981066f, -0.99914241872481690532f,0.04140564097707673946f,0.99907772775264536147f, -0.04293825693494082024f,0.99901068585407337697f,0.04447077185493866769f, -0.99894129318685687124f,0.04600318213091462299f,0.99886954991428356099f, -0.04753548415695930257f,0.99879545620517240501f,0.04906767432741801493f, -0.99871901223387293811f,0.05059974903689928166f,0.99864021818026527111f, -0.05213170468028332366f,0.99855907422975931365f,0.05366353765273051968f, -0.99847558057329477421f,0.05519524434968993420f,0.99838973740734016094f, -0.05672682116690774823f,0.99830154493389289261f,0.05825826450043575244f, -0.99821100336047818846f,0.05978957074663986820f,0.99811811290014917919f, -0.06132073630220857829f,0.99802287377148624081f,0.06285175756416140624f, -0.99792528619859599548f,0.06438263092985746505f,0.99782535041111164453f, -0.06591335279700380467f,0.99772306664419163624f,0.06744391956366405094f, -0.99761843513851955478f,0.06897432762826674613f,0.99751145614030345410f, -0.07050457338961385600f,0.99740212990127530279f,0.07203465324688933247f, -0.99729045667869020697f,0.07356456359966742631f,0.99717643673532618820f, -0.07509430084792130533f,0.99706007033948296225f,0.07662386139203149205f, -0.99694135776498216117f,0.07815324163279423197f,0.99682029929116566791f, -0.07968243797143012563f,0.99669689520289606044f,0.08121144680959244133f, -0.99657114579055483539f,0.08274026454937569164f,0.99644305135004263008f, -0.08426888759332407108f,0.99631261218277800129f,0.08579731234443989385f, -0.99617982859569698117f,0.08732553520619205922f,0.99604470090125196702f, -0.08885355258252460031f,0.99590722941741172125f,0.09038136087786498296f, -0.99576741446765981713f,0.09190895649713272386f,0.99562525638099430569f, -0.09343633584574778661f,0.99548075549192693856f,0.09496349532963899165f, -0.99533391214048227980f,0.09649043135525259274f,0.99518472667219692873f, -0.09801714032956060363f,0.99503319943811863180f,0.09954361866006931903f, -0.99487933079480561638f,0.10106986275482782167f,0.99472312110432570265f, -0.10259586902243628126f,0.99456457073425541537f,0.10412163387205458642f, -0.99440368005767909576f,0.10564715371341061589f,0.99424044945318790223f, -0.10717242495680884273f,0.99407487930487936634f,0.10869744401313871651f, -0.99390697000235606051f,0.11022220729388305938f,0.99373672194072459884f, -0.11174671121112658700f,0.99356413552059530403f,0.11327095217756434631f, -0.99338921114808065305f,0.11479492660651008373f,0.99321194923479450001f, -0.11631863091190475235f,0.99303235019785141002f,0.11784206150832497728f, -0.99285041445986510489f,0.11936521481099135467f,0.99266614244894801899f, -0.12088808723577708359f,0.99247953459870996706f,0.12241067519921619566f, -0.99229059134825736699f,0.12393297511851215920f,0.99209931314219179654f, -0.12545498341154623367f,0.99190570043060932726f,0.12697669649688586579f, -0.99170975366909952520f,0.12849811079379316880f,0.99151147331874389668f, -0.13001922272223334631f,0.99131085984611544415f,0.13154002870288311611f, -0.99110791372327688986f,0.13306052515713906459f,0.99090263542778000971f, -0.13458070850712616773f,0.99069502544266463406f,0.13610057517570620100f, -0.99048508425645709341f,0.13762012158648603832f,0.99027281236316910817f, -0.13913934416382620074f,0.99005821026229712256f,0.14065823933284921088f, -0.98984127845882052821f,0.14217680351944803063f,0.98962201746320088702f, -0.14369503315029447110f,0.98940042779138037687f,0.14521292465284746376f, -0.98917650996478101444f,0.14673047445536174793f,0.98895026451030298986f, -0.14824767898689603096f,0.98872169196032377858f,0.14976453467732150915f, -0.98849079285269658701f,0.15128103795733022219f,0.98825756773074946437f, -0.15279718525844343535f,0.98802201714328352633f,0.15431297301302010494f, -0.98778414164457217783f,0.15582839765426523271f,0.98754394179435922574f, -0.15734345561623824805f,0.98730141815785843473f,0.15885814333386144570f, -0.98705657130575097380f,0.16037245724292828464f,0.98680940181418552726f, -0.16188639378011182579f,0.98655991026477540817f,0.16339994938297322524f, -0.98630809724459866938f,0.16491312048996989437f,0.98605396334619543897f, -0.16642590354046410406f,0.98579750916756747614f,0.16793829497473117263f, -0.98553873531217606185f,0.16945029123396795900f,0.98527764238894122162f, -0.17096188876030121717f,0.98501423101223983814f,0.17247308399679595059f, -0.98474850180190420801f,0.17398387338746382214f,0.98448045538322093151f, -0.17549425337727142526f,0.98421009238692902521f,0.17700422041214874946f, -0.98393741344921892278f,0.17851377093899750692f,0.98366241921173025453f, -0.18002290140569951471f,0.98338511032155118130f,0.18153160826112496595f, -0.98310548743121628501f,0.18303988795514095078f,0.98282355119870523641f, -0.18454773693861961648f,0.98253930228744124076f,0.18605515166344663291f, -0.98225274136628937249f,0.18756212858252960252f,0.98196386910955524296f, -0.18906866414980619262f,0.98167268619698311305f,0.19057475482025273972f, -0.98137919331375456089f,0.19208039704989243734f,0.98108339115048670553f, -0.19358558729580360724f,0.98078528040323043058f,0.19509032201612824808f, -0.98048486177346938497f,0.19659459767008022335f,0.98018213596811742949f, -0.19809841071795356027f,0.97987710369951763756f,0.19960175762113097075f, -0.97956976568544051887f,0.20110463484209190055f,0.97926012264908202098f, -0.20260703884442113343f,0.97894817531906219710f,0.20410896609281686809f, -0.97863392442942320759f,0.20561041305309923910f,0.97831737071962765473f, -0.20711137619221856032f,0.97799851493455713936f,0.20861185197826348503f, -0.97767735782450992943f,0.21011183688046961016f,0.97735390014519996082f, -0.21161132736922755315f,0.97702814265775439484f,0.21311031991609136194f, -0.97670008612871184184f,0.21460881099378675829f,0.97636973133002114000f, -0.21610679707621952006f,0.97603707903903902388f,0.21760427463848364127f, -0.97570213003852857003f,0.21910124015686979759f,0.97536488511665697665f, -0.22059769010887350649f,0.97502534506699412020f,0.22209362097320350937f, -0.97468351068851066810f,0.22358902922978998729f,0.97433938278557585821f, -0.22508391135979283204f,0.97399296216795583359f,0.22657826384561000066f, -0.97364424965081197705f,0.22807208317088573102f,0.97329324605469824672f, -0.22956536582051886852f,0.97293995220556017678f,0.23105810828067110951f, -0.97258436893473221296f,0.23255030703877524467f,0.97222649707893626925f, -0.23404195858354343018f,0.97186633748027939639f,0.23553305940497548665f, -0.97150389098625178352f,0.23702360599436719801f,0.97113915844972509284f, -0.23851359484431841618f,0.97077214072895035013f,0.24000302244874149871f, -0.97040283868755550234f,0.24149188530286933019f,0.97003125319454397424f, -0.24298017990326387094f,0.96965738512429244800f,0.24446790274782415064f, -0.96928123535654853171f,0.24595505033579459497f,0.96890280477642887202f, -0.24744161916777326904f,0.96852209427441737777f,0.24892760574572014853f, -0.96813910474636244441f,0.25041300657296522436f,0.96775383709347551076f, -0.25189781815421696809f,0.96736629222232850545f,0.25338203699557015902f, -0.96697647104485207059f,0.25486565960451457169f,0.96658437447833311928f, -0.25634868248994291395f,0.96619000344541250413f,0.25783110216215898713f, -0.96579335887408368500f,0.25931291513288623474f,0.96539444169768939830f, -0.26079411791527551401f,0.96499325285492032478f,0.26227470702391358914f, -0.96458979328981275803f,0.26375467897483134694f,0.96418406395174582890f, -0.26523403028551179039f,0.96377606579543984022f,0.26671275747489836538f, -0.96336579978095404631f,0.26819085706340317632f,0.96295326687368387741f, -0.26966832557291509076f,0.96253846804435916340f,0.27114515952680801059f, -0.96212140426904158019f,0.27262135544994897662f,0.96170207652912254037f, -0.27409690986870638429f,0.96128048581132063966f,0.27557181931095814376f, -0.96085663310767965850f,0.27704608030609989555f,0.96043051941556578655f, -0.27851968938505305973f,0.96000214573766595727f,0.27999264308027321801f, -0.95957151308198451733f,0.28146493792575794091f,0.95913862246184189431f, -0.28293657045705539188f,0.95870347489587159906f,0.28440753721127187692f, -0.95826607140801767226f,0.28587783472708061527f,0.95782641302753290802f, -0.28734745954472951102f,0.95738450078897585627f,0.28881640820604947972f, -0.95694033573220882438f,0.29028467725446233105f,0.95649391890239510161f, -0.29175226323498926195f,0.95604525134999640557f,0.29321916269425862822f, -0.95559433413077110586f,0.29468537218051432669f,0.95514116830577078243f, -0.29615088824362378883f,0.95468575494133833814f,0.29761570743508619641f, -0.95422809510910566733f,0.29907982630804047508f,0.95376818988599032512f, -0.30054324141727345454f,0.95330604035419386211f,0.30200594931922808417f, -0.95284164760119871573f,0.30346794657201131562f,0.95237501271976587880f, -0.30492922973540237397f,0.95190613680793234597f,0.30638979537086091787f, -0.95143502096900833820f,0.30784964004153486661f,0.95096166631157508231f, -0.30930876031226872680f,0.95048607394948170235f,0.31076715274961147495f, -0.95000824500184299914f,0.31222481392182488413f,0.94952818059303667475f, -0.31368174039889151761f,0.94904588185270055689f,0.31513792875252244485f, -0.94856134991573026749f,0.31659337555616584581f,0.94807458592227622507f, -0.31804807738501494896f,0.94758559101774109124f,0.31950203081601569188f, -0.94709436635277721717f,0.32095523242787521445f,0.94660091308328353499f, -0.32240767880106985244f,0.94610523237040344835f,0.32385936651785285356f, -0.94560732538052127971f,0.32531029216226292622f,0.94510719328526060501f, -0.32676045232013173347f,0.94460483726148025685f,0.32820984357909249729f, -0.94410025849127265918f,0.32965846252858749255f,0.94359345816196038559f, -0.33110630575987642921f,0.94308443746609349478f,0.33255336986604422389f, -0.94257319760144686605f,0.33399965144200938205f,0.94205973977101731265f, -0.33544514708453160301f,0.94154406518302080631f,0.33688985339222005111f, -0.94102617505088925753f,0.33833376696554112728f,0.94050607059326829518f, -0.33977688440682685123f,0.93998375303401404679f,0.34121920232028235542f, -0.93945922360218991898f,0.34266071731199437833f,0.93893248353206459900f, -0.34410142598993881391f,0.93840353406310805795f,0.34554132496398909380f, -0.93787237643998988545f,0.34698041084592368133f,0.93733901191257495977f, -0.34841868024943456472f,0.93680344173592156043f,0.34985612979013491763f, -0.93626566717027825959f,0.35129275608556709276f,0.93572568948108036935f, -0.35272855575521072646f,0.93518350993894761025f,0.35416352542049034380f, -0.93463912981968078064f,0.35559766170478385172f,0.93409255040425887007f, -0.35703096123342997759f,0.93354377297883617270f,0.35846342063373654030f, -0.93299279883473895669f,0.35989503653498811087f,0.93243962926846235550f, -0.36132580556845428355f,0.93188426558166814750f,0.36275572436739722537f, -0.93132670908118042608f,0.36418478956707989180f,0.93076696107898371224f, -0.36561299780477385379f,0.93020502289221906889f,0.36704034571976718038f, -0.92964089584318121418f,0.36846682995337232125f,0.92907458125931585702f, -0.36989244714893410038f,0.92850608047321558924f,0.37131719395183754306f, -0.92793539482261788720f,0.37274106700951575855f,0.92736252565040111495f, -0.37416406297145793358f,0.92678747430458174872f,0.37558617848921721505f, -0.92621024213831137928f,0.37700741021641825945f,0.92563083050987271516f, -0.37842775480876555960f,0.92504924078267758425f,0.37984720892405116066f, -0.92446547432526260391f,0.38126576922216237620f,0.92387953251128673848f, -0.38268343236508978178f,0.92329141671952763559f,0.38410019501693504207f, -0.92270112833387862850f,0.38551605384391884890f,0.92210866874334518339f, -0.38693100551438858181f,0.92151403934204190183f,0.38834504669882624617f, -0.92091724152918941204f,0.38975817406985641123f,0.92031827670911059425f, -0.39117038430225387069f,0.91971714629122736095f,0.39258167407295146978f, -0.91911385169005777040f,0.39399204006104809883f,0.91850839432521225181f, -0.39540147894781635385f,0.91790077562139049672f,0.39680998741671030805f, -0.91729099700837790632f,0.39821756215337356100f,0.91667905992104270485f, -0.39962419984564678810f,0.91606496579933172075f,0.40102989718357562321f, -0.91544871608826783316f,0.40243465085941843018f,0.91483031223794619713f, -0.40383845756765407442f,0.91420975570353069095f,0.40524131400498986100f, -0.91358704794525080750f,0.40664321687036902864f,0.91296219042839821256f, -0.40804416286497868782f,0.91233518462332274801f,0.40944414869225759235f, -0.91170603200542987832f,0.41084317105790391089f,0.91107473405517636067f, -0.41224122666988288755f,0.91044129225806724737f,0.41363831223843450235f, -0.90980570810465222209f,0.41503442447608163146f,0.90916798309052238025f, -0.41642956009763715253f,0.90852811871630612117f,0.41782371582021227141f, -0.90788611648766626150f,0.41921688836322390515f,0.90724197791529581636f, -0.42060907444840250902f,0.90659570451491533483f,0.42200027079979968159f, -0.90594729780726845902f,0.42339047414379604728f,0.90529675931811881551f, -0.42477968120910880589f,0.90464409057824624050f,0.42616788872679961520f, -0.90398929312344333820f,0.42755509343028208491f,0.90333236849451181705f, -0.42894129205532949278f,0.90267331823725882600f,0.43032648134008261165f, -0.90201214390249317976f,0.43171065802505725895f,0.90134884704602202810f, -0.43309381885315195726f,0.90068342922864685907f,0.43447596056965565037f, -0.90001589201616016833f,0.43585707992225547480f,0.89934623697934157338f, -0.43723717366104408732f,0.89867446569395381673f,0.43861623853852765853f, -0.89800057974073987932f,0.43999427130963325583f,0.89732458070541831763f, -0.44137126873171667052f,0.89664647017868015499f,0.44274722756457002282f, -0.89596624975618521791f,0.44412214457042920035f,0.89528392103855758410f, -0.44549601651398174074f,0.89459948563138269595f,0.44686884016237415906f, -0.89391294514520325265f,0.44824061228521988598f,0.89322430119551532446f, -0.44961132965460653965f,0.89253355540276457791f,0.45098098904510386387f, -0.89184070939234272313f,0.45234958723377088896f,0.89114576479458318392f, -0.45371712100016386993f,0.89044872324475787817f,0.45508358712634383592f, -0.88974958638307277692f,0.45644898239688391772f,0.88904835585466457371f, -0.45781330359887717485f,0.88834503330959635470f,0.45917654752194408951f, -0.88763962040285393496f,0.46053871095824000514f,0.88693211879434219469f, -0.46189979070246273141f,0.88622253014888063838f,0.46325978355186014923f, -0.88551085613619995307f,0.46461868630623781584f,0.88479709843093778954f, -0.46597649576796618121f,0.88408125871263498752f,0.46733320874198841510f, -0.88336333866573157891f,0.46868882203582790114f,0.88264333997956279099f, -0.47004333245959561971f,0.88192126434835504956f,0.47139673682599764204f, -0.88119711347122209322f,0.47274903195034279069f,0.88047088905216075450f, -0.47410021465054996703f,0.87974259280004740713f,0.47545028174715586733f, -0.87901222642863352519f,0.47679923006332208812f,0.87827979165654157523f, -0.47814705642484300885f,0.87754529020726135258f,0.47949375766015295275f, -0.87680872380914565145f,0.48083933060033395845f,0.87607009419540660122f, -0.48218377207912271887f,0.87532940310411089246f,0.48352707893291868579f, -0.87458665227817611321f,0.48486924800079106435f,0.87384184346536686316f, -0.48621027612448641797f,0.87309497841829009079f,0.48755016014843599592f, -0.87234605889439154058f,0.48888889691976317176f,0.87159508665595097909f, -0.49022648328829115938f,0.87084206347007897531f,0.49156291610654989643f, -0.87008699110871146054f,0.49289819222978403790f,0.86932987134860684186f, -0.49423230851595967295f,0.86857070597134089507f,0.49556526182577254058f, -0.86780949676330332299f,0.49689704902265446895f,0.86704624551569264845f, -0.49822766697278181303f,0.86628095402451299467f,0.49955711254508183838f, -0.86551362409056908920f,0.50088538261124071482f,0.86474425751946237817f, -0.50221247404571078832f,0.86397285612158669643f,0.50353838372571757542f, -0.86319942171212415971f,0.50486310853126759035f,0.86242395611104050168f, -0.50618664534515522835f,0.86164646114308129921f,0.50750899105297087033f, -0.86086693863776730939f,0.50883014254310698909f,0.86008539042939013974f, -0.51015009670676680908f,0.85930181835700847337f,0.51146885043797030157f, -0.85851622426444273994f,0.51278640063356295542f,0.85772861000027211809f, -0.51410274419322166128f,0.85693897741782876221f,0.51541787801946292724f, -0.85614732837519447184f,0.51673179901764987321f,0.85535366473519602870f, -0.51804450409599933636f,0.85455798836540053376f,0.51935599016558964269f, -0.85376030113811141042f,0.52066625414036715735f,0.85296060493036363059f, -0.52197529293715438925f,0.85215890162391982887f,0.52328310347565643035f, -0.85135519310526519554f,0.52458968267846894928f,0.85054948126560347976f, -0.52589502747108463065f,0.84974176800085254868f,0.52719913478190127964f, -0.84893205521163961347f,0.52850200154222848337f,0.84812034480329723252f, -0.52980362468629460526f,0.84730663868585831544f,0.53110400115125500076f, -0.84649093877405212627f,0.53240312787719790144f,0.84567324698729906540f, -0.53370100180715296379f,0.84485356524970711689f,0.53499761988709715332f, -0.84403189549006640835f,0.53629297906596318235f,0.84320823964184543620f, -0.53758707629564539410f,0.84238259964318584760f,0.53887990853100842248f, -0.84155497743689844370f,0.54017147272989285423f,0.84072537497045807253f, -0.54146176585312344454f,0.83989379419599952126f,0.54275078486451588944f, -0.83906023707031274217f,0.54403852673088382019f,0.83822470555483807875f, -0.54532498842204646383f,0.83738720161566193578f,0.54661016691083486041f, -0.83654772722351200542f,0.54789405917310018967f,0.83570628435375260423f, -0.54917666218771965525f,0.83486287498638001026f,0.55045797293660481131f, -0.83401750110601813315f,0.55173798840470733573f,0.83317016470191318511f, -0.55301670558002746780f,0.83232086776792968408f,0.55429412145362000341f, -0.83146961230254523567f,0.55557023301960217765f,0.83061640030884631436f, -0.55684503727516010407f,0.82976123379452304540f,0.55811853122055610221f, -0.82890411477186487499f,0.55939071185913613604f,0.82804504525775579626f, -0.56066157619733603124f,0.82718402727366913130f,0.56193112124468935775f, -0.82632106284566353427f,0.56319934401383409117f,0.82545615400437755138f, -0.56446624152051938506f,0.82458930278502529099f,0.56573181078361312046f, -0.82372051122739142759f,0.56699604882510867832f,0.82284978137582642788f, -0.56825895267013148970f,0.82197711527924155472f,0.56952051934694714053f, -0.82110251499110464835f,0.57078074588696725566f,0.82022598256943468620f, -0.57203962932475704850f,0.81934752007679700903f,0.57329716669804220430f, -0.81846712958029865792f,0.57455335504771576360f,0.81758481315158371139f, -0.57580819141784533866f,0.81670057286682784525f,0.57706167285567944170f, -0.81581441080673378075f,0.57831379641165558958f,0.81492632905652662156f, -0.57956455913940563285f,0.81403632970594841378f,0.58081395809576452649f, -0.81314441484925359394f,0.58206199034077543697f,0.81225058658520399302f, -0.58330865293769829094f,0.81135484701706372945f,0.58455394295301532637f, -0.81045719825259476821f,0.58579785745643886408f,0.80955764240405125864f, -0.58704039352091796911f,0.80865618158817498262f,0.58828154822264522306f, -0.80775281792619035848f,0.58952131864106394055f,0.80684755354379933401f, -0.59075970185887416442f,0.80594039057117627944f,0.59199669496204099239f, -0.80503133114296365758f,0.59323229503979979516f,0.80412037739826569549f, -0.59446649918466443197f,0.80320753148064494287f,0.59569930449243335691f, -0.80229279553811572168f,0.59693070806219639124f,0.80137617172314024039f, -0.59816070699634238395f,0.80045766219262282082f,0.59938929840056454079f, -0.79953726910790501314f,0.60061647938386897305f,0.79861499463476093297f, -0.60184224705858002658f,0.79769084094339115509f,0.60306659854034816437f, -0.79676481020841882774f,0.60428953094815596181f,0.79583690460888356633f, -0.60551104140432554512f,0.79490712632823701256f,0.60673112703452447558f, -0.79397547755433717231f,0.60794978496777363208f,0.79304196047944364167f, -0.60916701233645320634f,0.79210657730021238887f,0.61038280627630947528f, -0.79116933021769020318f,0.61159716392646190641f,0.79023022143731003197f, -0.61281008242940970820f,0.78928925316888565167f,0.61402155893103849138f, -0.78834642762660622761f,0.61523159058062681925f,0.78740174702903142911f, -0.61644017453085364622f,0.78645521359908576731f,0.61764730793780386886f, -0.78550682956405393220f,0.61885298796097631957f,0.78455659715557524159f, -0.62005721176328909561f,0.78360451860963820092f,0.62125997651108755271f, -0.78265059616657572938f,0.62246127937414996723f,0.78169483207105938671f, -0.62366111752569453053f,0.78073722857209448822f,0.62485948814238634341f, -0.77977778792301455368f,0.62605638840434352232f,0.77881651238147597827f, -0.62725181549514408275f,0.77785340420945314754f,0.62844576660183271155f, -0.77688846567323244230f,0.62963823891492698426f,0.77592169904340768660f, -0.63082922962842447046f,0.77495310659487393057f,0.63201873593980906207f, -0.77398269060682289844f,0.63320675505005719064f,0.77301045336273699338f, -0.63439328416364548779f,0.77203639715038452351f,0.63557832048855611440f, -0.77106052426181381776f,0.63676186123628419899f,0.77008283699334789674f, -0.63794390362184405507f,0.76910333764557969882f,0.63912444486377573138f, -0.76812202852336541881f,0.64030348218415167327f,0.76713891193582040007f, -0.64148101280858305095f,0.76615399019631291733f,0.64265703396622686494f, -0.76516726562245895860f,0.64383154288979138613f,0.76417874053611667406f, -0.64500453681554392737f,0.76318841726338138010f,0.64617601298331628357f, -0.76219629813457900891f,0.64734596863651205911f,0.76120238548426177871f, -0.64851440102211244110f,0.76020668165120242055f,0.64968130739068319368f, -0.75920918897838796102f,0.65084668499638087535f,0.75820990981301528144f, -0.65201053109695950027f,0.75720884650648456748f,0.65317284295377675551f, -0.75620600141439453523f,0.65433361783180044036f,0.75520137689653654700f, -0.65549285299961534967f,0.75419497531688917125f,0.65665054572942893607f, -0.75318679904361252042f,0.65780669329707863735f,0.75217685044904269986f, -0.65896129298203731661f,0.75116513190968636771f,0.66011434206742047870f, -0.75015164580621507273f,0.66126583783999226540f,0.74913639452345937020f, -0.66241577759017178373f,0.74811938045040360379f,0.66356415861203976725f, -0.74710060598018013245f,0.66471097820334479334f,0.74608007351006377927f, -0.66585623366550972246f,0.74505778544146594733f,0.66699992230363747137f, -0.74403374417992929057f,0.66814204142651845153f,0.74300795213512171866f, -0.66928258834663600929f,0.74198041172083106787f,0.67042156038017308717f, -0.74095112535495921691f,0.67155895484701833009f,0.73992009545951620275f, -0.67269476907077285777f,0.73888732446061511361f,0.67382900037875603783f, -0.73785281478846598269f,0.67496164610201192513f,0.73681656887736979300f, -0.67609270357531592310f,0.73577858916571359238f,0.67722217013718033485f, -0.73473887809596349907f,0.67835004312986146857f,0.73369743811466026084f, -0.67947631989936496666f,0.73265427167241281570f,0.68060099779545302212f, -0.73160938122389262972f,0.68172407417164970767f,0.73056276922782759087f, -0.68284554638524808112f,0.72951443814699701296f,0.68396541179731540350f, -0.72846439044822519637f,0.68508366777270035541f,0.72741262860237576593f, -0.68620031168003858824f,0.72635915508434600873f,0.68731534089175905233f, -0.72530397237306076796f,0.68842875278409043638f,0.72424708295146700276f, -0.68954054473706682948f,0.72318848930652745999f,0.69065071413453460458f, -0.72212819392921534511f,0.69175925836415774750f,0.72106619931450810501f, -0.69286617481742462932f,0.72000250796138165477f,0.69397146088965389055f, -0.71893712237280449351f,0.69507511398000088043f,0.71787004505573170920f, -0.69617713149146298601f,0.71680127852109953857f,0.69727751083088651551f, -0.71573082528381870571f,0.69837624940897280457f,0.71465868786276909308f, -0.69947334464028376733f,0.71358486878079352422f,0.70056879394324833576f, -0.71250937056469243469f,0.70166259474016845488f,0.71143219574521643356f, -0.70275474445722529993f,0.71035334685706241764f,0.70384524052448493858f, -0.70927282643886568891f,0.70493408037590488124f,0.70819063703319540259f, -0.70602126144933974317f,0.70710678118654757274f,0.70710678118654757274f, -0.70602126144933974317f,0.70819063703319540259f,0.70493408037590499227f, -0.70927282643886568891f,0.70384524052448493858f,0.71035334685706241764f, -0.70275474445722529993f,0.71143219574521643356f,0.70166259474016845488f, -0.71250937056469232367f,0.70056879394324844679f,0.71358486878079352422f, -0.69947334464028376733f,0.71465868786276909308f,0.69837624940897291559f, -0.71573082528381859468f,0.69727751083088662654f,0.71680127852109942754f, -0.69617713149146298601f,0.71787004505573170920f,0.69507511398000088043f, -0.71893712237280438249f,0.69397146088965400157f,0.72000250796138165477f, -0.69286617481742474034f,0.72106619931450810501f,0.69175925836415774750f, -0.72212819392921534511f,0.69065071413453460458f,0.72318848930652734897f, -0.68954054473706694051f,0.72424708295146689174f,0.68842875278409043638f, -0.72530397237306076796f,0.68731534089175905233f,0.72635915508434600873f, -0.68620031168003858824f,0.72741262860237576593f,0.68508366777270035541f, -0.72846439044822519637f,0.68396541179731551452f,0.72951443814699690193f, -0.68284554638524808112f,0.73056276922782759087f,0.68172407417164981869f, -0.73160938122389262972f,0.68060099779545302212f,0.73265427167241281570f, -0.67947631989936496666f,0.73369743811466026084f,0.67835004312986146857f, -0.73473887809596349907f,0.67722217013718044587f,0.73577858916571348136f, -0.67609270357531603413f,0.73681656887736979300f,0.67496164610201203615f, -0.73785281478846598269f,0.67382900037875614885f,0.73888732446061511361f, -0.67269476907077296879f,0.73992009545951609173f,0.67155895484701833009f, -0.74095112535495910588f,0.67042156038017308717f,0.74198041172083095685f, -0.66928258834663600929f,0.74300795213512171866f,0.66814204142651856255f, -0.74403374417992929057f,0.66699992230363747137f,0.74505778544146594733f, -0.66585623366550972246f,0.74608007351006366825f,0.66471097820334490436f, -0.74710060598018013245f,0.66356415861203987827f,0.74811938045040349277f, -0.66241577759017178373f,0.74913639452345925918f,0.66126583783999226540f, -0.75015164580621496171f,0.66011434206742047870f,0.75116513190968636771f, -0.65896129298203731661f,0.75217685044904269986f,0.65780669329707874837f, -0.75318679904361252042f,0.65665054572942904709f,0.75419497531688917125f, -0.65549285299961546070f,0.75520137689653654700f,0.65433361783180055138f, -0.75620600141439453523f,0.65317284295377686654f,0.75720884650648456748f, -0.65201053109695950027f,0.75820990981301528144f,0.65084668499638098638f, -0.75920918897838796102f,0.64968130739068319368f,0.76020668165120242055f, -0.64851440102211255212f,0.76120238548426177871f,0.64734596863651205911f, -0.76219629813457889789f,0.64617601298331639459f,0.76318841726338126907f, -0.64500453681554403840f,0.76417874053611667406f,0.64383154288979149715f, -0.76516726562245895860f,0.64265703396622686494f,0.76615399019631280630f, -0.64148101280858316198f,0.76713891193582040007f,0.64030348218415167327f, -0.76812202852336530778f,0.63912444486377573138f,0.76910333764557958780f, -0.63794390362184416610f,0.77008283699334789674f,0.63676186123628419899f, -0.77106052426181381776f,0.63557832048855622542f,0.77203639715038441249f, -0.63439328416364548779f,0.77301045336273688235f,0.63320675505005719064f, -0.77398269060682278742f,0.63201873593980906207f,0.77495310659487381955f, -0.63082922962842458148f,0.77592169904340757558f,0.62963823891492709528f, -0.77688846567323244230f,0.62844576660183271155f,0.77785340420945303652f, -0.62725181549514419377f,0.77881651238147586724f,0.62605638840434352232f, -0.77977778792301444266f,0.62485948814238645443f,0.78073722857209448822f, -0.62366111752569464155f,0.78169483207105938671f,0.62246127937415007825f, -0.78265059616657572938f,0.62125997651108766373f,0.78360451860963820092f, -0.62005721176328920663f,0.78455659715557524159f,0.61885298796097631957f, -0.78550682956405393220f,0.61764730793780397988f,0.78645521359908576731f, -0.61644017453085364622f,0.78740174702903131809f,0.61523159058062681925f, -0.78834642762660622761f,0.61402155893103849138f,0.78928925316888565167f, -0.61281008242940970820f,0.79023022143731003197f,0.61159716392646201744f, -0.79116933021769009216f,0.61038280627630947528f,0.79210657730021227785f, -0.60916701233645320634f,0.79304196047944364167f,0.60794978496777374311f, -0.79397547755433717231f,0.60673112703452447558f,0.79490712632823701256f, -0.60551104140432554512f,0.79583690460888345530f,0.60428953094815607283f, -0.79676481020841871672f,0.60306659854034827539f,0.79769084094339104407f, -0.60184224705858002658f,0.79861499463476082195f,0.60061647938386897305f, -0.79953726910790501314f,0.59938929840056454079f,0.80045766219262270980f, -0.59816070699634238395f,0.80137617172314012937f,0.59693070806219650226f, -0.80229279553811572168f,0.59569930449243346793f,0.80320753148064483184f, -0.59446649918466454299f,0.80412037739826569549f,0.59323229503979979516f, -0.80503133114296365758f,0.59199669496204099239f,0.80594039057117627944f, -0.59075970185887427544f,0.80684755354379922299f,0.58952131864106394055f, -0.80775281792619024746f,0.58828154822264533408f,0.80865618158817498262f, -0.58704039352091808013f,0.80955764240405125864f,0.58579785745643886408f, -0.81045719825259476821f,0.58455394295301532637f,0.81135484701706372945f, -0.58330865293769829094f,0.81225058658520388200f,0.58206199034077554799f, -0.81314441484925359394f,0.58081395809576452649f,0.81403632970594830276f, -0.57956455913940574387f,0.81492632905652662156f,0.57831379641165558958f, -0.81581441080673378075f,0.57706167285567955272f,0.81670057286682784525f, -0.57580819141784533866f,0.81758481315158371139f,0.57455335504771576360f, -0.81846712958029865792f,0.57329716669804231532f,0.81934752007679689800f, -0.57203962932475704850f,0.82022598256943468620f,0.57078074588696736669f, -0.82110251499110464835f,0.56952051934694725155f,0.82197711527924155472f, -0.56825895267013148970f,0.82284978137582631685f,0.56699604882510867832f, -0.82372051122739131657f,0.56573181078361323149f,0.82458930278502529099f, -0.56446624152051949608f,0.82545615400437744036f,0.56319934401383409117f, -0.82632106284566353427f,0.56193112124468946877f,0.82718402727366913130f, -0.56066157619733603124f,0.82804504525775579626f,0.55939071185913613604f, -0.82890411477186487499f,0.55811853122055610221f,0.82976123379452304540f, -0.55684503727516010407f,0.83061640030884620334f,0.55557023301960228867f, -0.83146961230254523567f,0.55429412145362011444f,0.83232086776792968408f, -0.55301670558002757883f,0.83317016470191318511f,0.55173798840470744675f, -0.83401750110601813315f,0.55045797293660481131f,0.83486287498638001026f, -0.54917666218771976627f,0.83570628435375260423f,0.54789405917310018967f, -0.83654772722351189440f,0.54661016691083486041f,0.83738720161566193578f, -0.54532498842204646383f,0.83822470555483796772f,0.54403852673088393122f, -0.83906023707031263115f,0.54275078486451600046f,0.83989379419599941023f, -0.54146176585312355556f,0.84072537497045796151f,0.54017147272989296525f, -0.84155497743689833268f,0.53887990853100842248f,0.84238259964318584760f, -0.53758707629564550512f,0.84320823964184543620f,0.53629297906596318235f, -0.84403189549006640835f,0.53499761988709726435f,0.84485356524970700587f, -0.53370100180715296379f,0.84567324698729906540f,0.53240312787719801246f, -0.84649093877405212627f,0.53110400115125500076f,0.84730663868585831544f, -0.52980362468629482731f,0.84812034480329712149f,0.52850200154222848337f, -0.84893205521163961347f,0.52719913478190139067f,0.84974176800085243766f, -0.52589502747108474168f,0.85054948126560336874f,0.52458968267846883826f, -0.85135519310526519554f,0.52328310347565643035f,0.85215890162391982887f, -0.52197529293715438925f,0.85296060493036363059f,0.52066625414036726838f, -0.85376030113811129940f,0.51935599016558953167f,0.85455798836540053376f, -0.51804450409599933636f,0.85535366473519602870f,0.51673179901764998423f, -0.85614732837519447184f,0.51541787801946314929f,0.85693897741782865118f, -0.51410274419322166128f,0.85772861000027211809f,0.51278640063356306644f, -0.85851622426444273994f,0.51146885043797052361f,0.85930181835700836235f, -0.51015009670676669806f,0.86008539042939025077f,0.50883014254310698909f, -0.86086693863776730939f,0.50750899105297087033f,0.86164646114308129921f, -0.50618664534515533937f,0.86242395611104050168f,0.50486310853126747933f, -0.86319942171212415971f,0.50353838372571757542f,0.86397285612158669643f, -0.50221247404571089934f,0.86474425751946237817f,0.50088538261124093687f, -0.86551362409056897818f,0.49955711254508183838f,0.86628095402451299467f, -0.49822766697278186854f,0.86704624551569264845f,0.49689704902265463549f, -0.86780949676330321196f,0.49556526182577248507f,0.86857070597134089507f, -0.49423230851595972846f,0.86932987134860673084f,0.49289819222978409341f, -0.87008699110871134952f,0.49156291610655006297f,0.87084206347007886428f, -0.49022648328829110387f,0.87159508665595109012f,0.48888889691976322727f, -0.87234605889439142956f,0.48755016014843605143f,0.87309497841829009079f, -0.48621027612448652899f,0.87384184346536675214f,0.48486924800079111986f, -0.87458665227817611321f,0.48352707893291874131f,0.87532940310411078144f, -0.48218377207912282989f,0.87607009419540660122f,0.48083933060033390294f, -0.87680872380914576247f,0.47949375766015300826f,0.87754529020726124156f, -0.47814705642484311987f,0.87827979165654146421f,0.47679923006332225466f, -0.87901222642863341417f,0.47545028174715586733f,0.87974259280004740713f, -0.47410021465055002254f,0.88047088905216075450f,0.47274903195034290171f, -0.88119711347122198219f,0.47139673682599780857f,0.88192126434835493853f, -0.47004333245959561971f,0.88264333997956279099f,0.46868882203582795665f, -0.88336333866573157891f,0.46733320874198852612f,0.88408125871263498752f, -0.46597649576796612569f,0.88479709843093778954f,0.46461868630623781584f, -0.88551085613619995307f,0.46325978355186026025f,0.88622253014888063838f, -0.46189979070246284243f,0.88693211879434208367f,0.46053871095824000514f, -0.88763962040285393496f,0.45917654752194414502f,0.88834503330959635470f, -0.45781330359887728587f,0.88904835585466457371f,0.45644898239688386221f, -0.88974958638307288794f,0.45508358712634383592f,0.89044872324475787817f, -0.45371712100016392544f,0.89114576479458318392f,0.45234958723377099998f, -0.89184070939234272313f,0.45098098904510380835f,0.89253355540276468894f, -0.44961132965460659516f,0.89322430119551532446f,0.44824061228521999700f, -0.89391294514520325265f,0.44686884016237432560f,0.89459948563138258493f, -0.44549601651398174074f,0.89528392103855758410f,0.44412214457042925586f, -0.89596624975618510689f,0.44274722756457013384f,0.89664647017868015499f, -0.44137126873171661501f,0.89732458070541831763f,0.43999427130963325583f, -0.89800057974073987932f,0.43861623853852771404f,0.89867446569395381673f, -0.43723717366104419835f,0.89934623697934146236f,0.43585707992225547480f, -0.90001589201616027935f,0.43447596056965570588f,0.90068342922864685907f, -0.43309381885315201277f,0.90134884704602202810f,0.43171065802505736997f, -0.90201214390249306874f,0.43032648134008261165f,0.90267331823725882600f, -0.42894129205532954829f,0.90333236849451181705f,0.42755509343028219593f, -0.90398929312344333820f,0.42616788872679961520f,0.90464409057824624050f, -0.42477968120910880589f,0.90529675931811881551f,0.42339047414379610279f, -0.90594729780726845902f,0.42200027079979979261f,0.90659570451491533483f, -0.42060907444840250902f,0.90724197791529592738f,0.41921688836322396066f, -0.90788611648766626150f,0.41782371582021238243f,0.90852811871630612117f, -0.41642956009763731906f,0.90916798309052226923f,0.41503442447608163146f, -0.90980570810465222209f,0.41363831223843455787f,0.91044129225806713634f, -0.41224122666988299857f,0.91107473405517624965f,0.41084317105790391089f, -0.91170603200542987832f,0.40944414869225764786f,0.91233518462332274801f, -0.40804416286497874333f,0.91296219042839810154f,0.40664321687036913966f, -0.91358704794525080750f,0.40524131400498986100f,0.91420975570353069095f, -0.40383845756765412993f,0.91483031223794608611f,0.40243465085941854120f, -0.91544871608826783316f,0.40102989718357578974f,0.91606496579933160973f, -0.39962419984564678810f,0.91667905992104270485f,0.39821756215337361651f, -0.91729099700837790632f,0.39680998741671041907f,0.91790077562139038569f, -0.39540147894781629834f,0.91850839432521225181f,0.39399204006104809883f, -0.91911385169005777040f,0.39258167407295152529f,0.91971714629122736095f, -0.39117038430225398171f,0.92031827670911048322f,0.38975817406985641123f, -0.92091724152918941204f,0.38834504669882630168f,0.92151403934204190183f, -0.38693100551438869283f,0.92210866874334507237f,0.38551605384391901543f, -0.92270112833387851747f,0.38410019501693504207f,0.92329141671952763559f, -0.38268343236508983729f,0.92387953251128673848f,0.38126576922216248722f, -0.92446547432526260391f,0.37984720892405110515f,0.92504924078267758425f, -0.37842775480876561511f,0.92563083050987271516f,0.37700741021641831496f, -0.92621024213831126826f,0.37558617848921732607f,0.92678747430458174872f, -0.37416406297145798909f,0.92736252565040111495f,0.37274106700951581406f, -0.92793539482261788720f,0.37131719395183759858f,0.92850608047321558924f, -0.36989244714893426691f,0.92907458125931574600f,0.36846682995337232125f, -0.92964089584318121418f,0.36704034571976723589f,0.93020502289221906889f, -0.36561299780477396482f,0.93076696107898371224f,0.36418478956707983629f, -0.93132670908118042608f,0.36275572436739722537f,0.93188426558166814750f, -0.36132580556845433906f,0.93243962926846235550f,0.35989503653498827740f, -0.93299279883473884567f,0.35846342063373654030f,0.93354377297883617270f, -0.35703096123343003310f,0.93409255040425887007f,0.35559766170478396274f, -0.93463912981968078064f,0.35416352542049051033f,0.93518350993894749923f, -0.35272855575521072646f,0.93572568948108036935f,0.35129275608556714827f, -0.93626566717027825959f,0.34985612979013502866f,0.93680344173592156043f, -0.34841868024943450921f,0.93733901191257495977f,0.34698041084592368133f, -0.93787237643998988545f,0.34554132496398914931f,0.93840353406310805795f, -0.34410142598993898044f,0.93893248353206448797f,0.34266071731199437833f, -0.93945922360218991898f,0.34121920232028241093f,0.93998375303401393577f, -0.33977688440682696225f,0.94050607059326829518f,0.33833376696554129381f, -0.94102617505088925753f,0.33688985339222005111f,0.94154406518302080631f, -0.33544514708453165852f,0.94205973977101731265f,0.33399965144200949307f, -0.94257319760144686605f,0.33255336986604422389f,0.94308443746609349478f, -0.33110630575987642921f,0.94359345816196038559f,0.32965846252858754806f, -0.94410025849127265918f,0.32820984357909266382f,0.94460483726148025685f, -0.32676045232013178898f,0.94510719328526060501f,0.32531029216226298173f, -0.94560732538052127971f,0.32385936651785296458f,0.94610523237040333733f, -0.32240767880107001897f,0.94660091308328353499f,0.32095523242787521445f, -0.94709436635277721717f,0.31950203081601574739f,0.94758559101774109124f, -0.31804807738501505998f,0.94807458592227622507f,0.31659337555616584581f, -0.94856134991573026749f,0.31513792875252244485f,0.94904588185270055689f, -0.31368174039889157312f,0.94952818059303667475f,0.31222481392182505067f, -0.95000824500184299914f,0.31076715274961147495f,0.95048607394948170235f, -0.30930876031226878231f,0.95096166631157508231f,0.30784964004153497763f, -0.95143502096900833820f,0.30638979537086108440f,0.95190613680793223494f, -0.30492922973540242948f,0.95237501271976587880f,0.30346794657201137113f, -0.95284164760119871573f,0.30200594931922819519f,0.95330604035419375109f, -0.30054324141727339903f,0.95376818988599032512f,0.29907982630804047508f, -0.95422809510910566733f,0.29761570743508630743f,0.95468575494133833814f, -0.29615088824362395536f,0.95514116830577067141f,0.29468537218051432669f, -0.95559433413077110586f,0.29321916269425868373f,0.95604525134999640557f, -0.29175226323498937298f,0.95649391890239499059f,0.29028467725446233105f, -0.95694033573220893540f,0.28881640820604947972f,0.95738450078897585627f, -0.28734745954472956653f,0.95782641302753290802f,0.28587783472708072630f, -0.95826607140801767226f,0.28440753721127182141f,0.95870347489587159906f, -0.28293657045705539188f,0.95913862246184189431f,0.28146493792575805193f, -0.95957151308198451733f,0.27999264308027338455f,0.96000214573766584625f, -0.27851968938505305973f,0.96043051941556578655f,0.27704608030609995106f, -0.96085663310767965850f,0.27557181931095825478f,0.96128048581132063966f, -0.27409690986870632878f,0.96170207652912254037f,0.27262135544994897662f, -0.96212140426904158019f,0.27114515952680806610f,0.96253846804435916340f, -0.26966832557291520178f,0.96295326687368387741f,0.26819085706340317632f, -0.96336579978095404631f,0.26671275747489842090f,0.96377606579543984022f, -0.26523403028551190141f,0.96418406395174571788f,0.26375467897483151347f, -0.96458979328981264700f,0.26227470702391358914f,0.96499325285492032478f, -0.26079411791527556952f,0.96539444169768939830f,0.25931291513288634576f, -0.96579335887408357397f,0.25783110216215893162f,0.96619000344541261516f, -0.25634868248994291395f,0.96658437447833311928f,0.25486565960451462720f, -0.96697647104485207059f,0.25338203699557027004f,0.96736629222232850545f, -0.25189781815421691258f,0.96775383709347551076f,0.25041300657296527987f, -0.96813910474636244441f,0.24892760574572025956f,0.96852209427441726675f, -0.24744161916777343557f,0.96890280477642887202f,0.24595505033579459497f, -0.96928123535654853171f,0.24446790274782420616f,0.96965738512429244800f, -0.24298017990326398197f,0.97003125319454397424f,0.24149188530286930243f, -0.97040283868755550234f,0.24000302244874149871f,0.97077214072895035013f, -0.23851359484431849944f,0.97113915844972509284f,0.23702360599436733679f, -0.97150389098625178352f,0.23553305940497545889f,0.97186633748027939639f, -0.23404195858354345794f,0.97222649707893626925f,0.23255030703877532794f, -0.97258436893473221296f,0.23105810828067127605f,0.97293995220556006576f, -0.22956536582051886852f,0.97329324605469824672f,0.22807208317088578653f, -0.97364424965081186603f,0.22657826384561011168f,0.97399296216795583359f, -0.22508391135979277653f,0.97433938278557585821f,0.22358902922979001504f, -0.97468351068851066810f,0.22209362097320359264f,0.97502534506699412020f, -0.22059769010887364526f,0.97536488511665686563f,0.21910124015686976984f, -0.97570213003852857003f,0.21760427463848366902f,0.97603707903903902388f, -0.21610679707621960333f,0.97636973133002114000f,0.21460881099378692483f, -0.97670008612871184184f,0.21311031991609136194f,0.97702814265775439484f, -0.21161132736922760866f,0.97735390014519996082f,0.21011183688046972118f, -0.97767735782450992943f,0.20861185197826345727f,0.97799851493455713936f, -0.20711137619221856032f,0.97831737071962765473f,0.20561041305309932237f, -0.97863392442942309657f,0.20410896609281700687f,0.97894817531906219710f, -0.20260703884442110567f,0.97926012264908202098f,0.20110463484209195606f, -0.97956976568544051887f,0.19960175762113105402f,0.97987710369951763756f, -0.19809841071795372680f,0.98018213596811731847f,0.19659459767008022335f, -0.98048486177346938497f,0.19509032201612833135f,0.98078528040323043058f, -0.19358558729580374602f,0.98108339115048659451f,0.19208039704989238183f, -0.98137919331375456089f,0.19057475482025279523f,0.98167268619698311305f, -0.18906866414980627589f,0.98196386910955524296f,0.18756212858252974129f, -0.98225274136628937249f,0.18605515166344663291f,0.98253930228744124076f, -0.18454773693861964423f,0.98282355119870523641f,0.18303988795514106180f, -0.98310548743121628501f,0.18153160826112513249f,0.98338511032155118130f, -0.18002290140569951471f,0.98366241921173025453f,0.17851377093899759019f, -0.98393741344921892278f,0.17700422041214886049f,0.98421009238692902521f, -0.17549425337727139751f,0.98448045538322093151f,0.17398387338746384989f, -0.98474850180190420801f,0.17247308399679603386f,0.98501423101223983814f, -0.17096188876030135595f,0.98527764238894122162f,0.16945029123396793125f, -0.98553873531217606185f,0.16793829497473122814f,0.98579750916756736512f, -0.16642590354046421508f,0.98605396334619543897f,0.16491312048997008866f, -0.98630809724459866938f,0.16339994938297322524f,0.98655991026477540817f, -0.16188639378011188130f,0.98680940181418541624f,0.16037245724292839566f, -0.98705657130575097380f,0.15885814333386139019f,0.98730141815785843473f, -0.15734345561623827581f,0.98754394179435922574f,0.15582839765426531597f, -0.98778414164457217783f,0.15431297301302024372f,0.98802201714328352633f, -0.15279718525844340760f,0.98825756773074946437f,0.15128103795733024994f, -0.98849079285269658701f,0.14976453467732162017f,0.98872169196032377858f, -0.14824767898689619749f,0.98895026451030298986f,0.14673047445536174793f, -0.98917650996478101444f,0.14521292465284751927f,0.98940042779138037687f, -0.14369503315029458212f,0.98962201746320077600f,0.14217680351944800288f, -0.98984127845882052821f,0.14065823933284923863f,0.99005821026229712256f, -0.13913934416382628401f,0.99027281236316910817f,0.13762012158648617710f, -0.99048508425645698239f,0.13610057517570620100f,0.99069502544266463406f, -0.13458070850712622324f,0.99090263542778000971f,0.13306052515713917561f, -0.99110791372327677884f,0.13154002870288328264f,0.99131085984611544415f, -0.13001922272223334631f,0.99151147331874389668f,0.12849811079379322432f, -0.99170975366909952520f,0.12697669649688597682f,0.99190570043060932726f, -0.12545498341154620592f,0.99209931314219179654f,0.12393297511851220083f, -0.99229059134825736699f,0.12241067519921627893f,0.99247953459870996706f, -0.12088808723577722237f,0.99266614244894801899f,0.11936521481099135467f, -0.99285041445986510489f,0.11784206150832501891f,0.99303235019785141002f, -0.11631863091190487725f,0.99321194923479450001f,0.11479492660651025027f, -0.99338921114808065305f,0.11327095217756436019f,0.99356413552059530403f, -0.11174671121112665639f,0.99373672194072459884f,0.11022220729388318428f, -0.99390697000235606051f,0.10869744401313867488f,0.99407487930487936634f, -0.10717242495680887049f,0.99424044945318790223f,0.10564715371341069916f, -0.99440368005767909576f,0.10412163387205472520f,0.99456457073425541537f, -0.10259586902243628126f,0.99472312110432570265f,0.10106986275482787718f, -0.99487933079480561638f,0.09954361866006944393f,0.99503319943811863180f, -0.09801714032956077016f,0.99518472667219681771f,0.09649043135525260662f, -0.99533391214048227980f,0.09496349532963906104f,0.99548075549192693856f, -0.09343633584574791151f,0.99562525638099430569f,0.09190895649713269611f, -0.99576741446765981713f,0.09038136087786501072f,0.99590722941741172125f, -0.08885355258252468358f,0.99604470090125196702f,0.08732553520619222576f, -0.99617982859569687015f,0.08579731234443987997f,0.99631261218277800129f, -0.08426888759332412659f,0.99644305135004263008f,0.08274026454937580266f, -0.99657114579055483539f,0.08121144680959238582f,0.99669689520289606044f, -0.07968243797143012563f,0.99682029929116566791f,0.07815324163279431524f, -0.99694135776498216117f,0.07662386139203161695f,0.99706007033948296225f, -0.07509430084792129145f,0.99717643673532618820f,0.07356456359966745406f, -0.99729045667869020697f,0.07203465324688941573f,0.99740212990127530279f, -0.07050457338961400866f,0.99751145614030345410f,0.06897432762826673225f, -0.99761843513851955478f,0.06744391956366410645f,0.99772306664419163624f, -0.06591335279700392957f,0.99782535041111164453f,0.06438263092985740954f, -0.99792528619859599548f,0.06285175756416142012f,0.99802287377148624081f, -0.06132073630220864768f,0.99811811290014917919f,0.05978957074664000698f, -0.99821100336047818846f,0.05825826450043573163f,0.99830154493389289261f, -0.05672682116690778292f,0.99838973740734016094f,0.05519524434969003135f, -0.99847558057329477421f,0.05366353765273067927f,0.99855907422975931365f, -0.05213170468028331672f,0.99864021818026527111f,0.05059974903689933717f, -0.99871901223387293811f,0.04906767432741812596f,0.99879545620517240501f, -0.04753548415695926094f,0.99886954991428356099f,0.04600318213091464381f, -0.99894129318685687124f,0.04447077185493874402f,0.99901068585407337697f, -0.04293825693494095902f,0.99907772775264536147f,0.04140564097707671171f, -0.99914241872481690532f,0.03987292758773984536f,0.99920475861836388631f, -0.03834012037355279123f,0.99926474728659442359f,0.03680722294135899131f, -0.99932238458834954375f,0.03527423889821394709f,0.99937767038800284780f, -0.03374117185137764235f,0.99943060455546173237f,0.03220802540830470378f, -0.99948118696616694567f,0.03067480317663658085f,0.99952941750109314256f, -0.02914150876419373953f,0.99957529604674921764f,0.02760814577896581953f, -0.99961882249517863830f,0.02607471782910403962f,0.99965999674395922270f, -0.02454122852291226384f,0.99969881869620424997f,0.02300768146883941032f, -0.99973528826056168306f,0.02147408027546960502f,0.99976940535121527898f, -0.01994042855151459750f,0.99980116988788425569f,0.01840672990580482019f, -0.99983058179582340319f,0.01687298794728177287f,0.99985764100582386060f, -0.01533920628498821985f,0.99988234745421256111f,0.01380538852806034895f, -0.99990470108285289808f,0.01227153828571994447f,0.99992470183914450299f, -0.01073765916726457208f,0.99994234967602391162f,0.00920375478205995995f, -0.99995764455196389786f,0.00766982873953107706f,0.99997058643097413988f, -0.00613588464915451517f,0.99998117528260110909f,0.00460192612044867198f, -0.99998941108192840321f,0.00306795676296613791f,0.99999529380957619118f, -0.00153398018628476615f,0.99999882345170187925f,1.00000000000000000000f, -0.00000000000000000000f,0.99998117528260110909f,0.00613588464915447527f, -0.99992470183914450299f,0.01227153828571992539f,0.99983058179582340319f, -0.01840672990580482019f,0.99969881869620424997f,0.02454122852291228812f, -0.99952941750109314256f,0.03067480317663662595f,0.99932238458834954375f, -0.03680722294135883171f,0.99907772775264536147f,0.04293825693494082024f, -0.99879545620517240501f,0.04906767432741801493f,0.99847558057329477421f, -0.05519524434968993420f,0.99811811290014917919f,0.06132073630220857829f, -0.99772306664419163624f,0.06744391956366405094f,0.99729045667869020697f, -0.07356456359966742631f,0.99682029929116566791f,0.07968243797143012563f, -0.99631261218277800129f,0.08579731234443989385f,0.99576741446765981713f, -0.09190895649713272386f,0.99518472667219692873f,0.09801714032956060363f, -0.99456457073425541537f,0.10412163387205458642f,0.99390697000235606051f, -0.11022220729388305938f,0.99321194923479450001f,0.11631863091190475235f, -0.99247953459870996706f,0.12241067519921619566f,0.99170975366909952520f, -0.12849811079379316880f,0.99090263542778000971f,0.13458070850712616773f, -0.99005821026229712256f,0.14065823933284921088f,0.98917650996478101444f, -0.14673047445536174793f,0.98825756773074946437f,0.15279718525844343535f, -0.98730141815785843473f,0.15885814333386144570f,0.98630809724459866938f, -0.16491312048996989437f,0.98527764238894122162f,0.17096188876030121717f, -0.98421009238692902521f,0.17700422041214874946f,0.98310548743121628501f, -0.18303988795514095078f,0.98196386910955524296f,0.18906866414980619262f, -0.98078528040323043058f,0.19509032201612824808f,0.97956976568544051887f, -0.20110463484209190055f,0.97831737071962765473f,0.20711137619221856032f, -0.97702814265775439484f,0.21311031991609136194f,0.97570213003852857003f, -0.21910124015686979759f,0.97433938278557585821f,0.22508391135979283204f, -0.97293995220556017678f,0.23105810828067110951f,0.97150389098625178352f, -0.23702360599436719801f,0.97003125319454397424f,0.24298017990326387094f, -0.96852209427441737777f,0.24892760574572014853f,0.96697647104485207059f, -0.25486565960451457169f,0.96539444169768939830f,0.26079411791527551401f, -0.96377606579543984022f,0.26671275747489836538f,0.96212140426904158019f, -0.27262135544994897662f,0.96043051941556578655f,0.27851968938505305973f, -0.95870347489587159906f,0.28440753721127187692f,0.95694033573220882438f, -0.29028467725446233105f,0.95514116830577078243f,0.29615088824362378883f, -0.95330604035419386211f,0.30200594931922808417f,0.95143502096900833820f, -0.30784964004153486661f,0.94952818059303667475f,0.31368174039889151761f, -0.94758559101774109124f,0.31950203081601569188f,0.94560732538052127971f, -0.32531029216226292622f,0.94359345816196038559f,0.33110630575987642921f, -0.94154406518302080631f,0.33688985339222005111f,0.93945922360218991898f, -0.34266071731199437833f,0.93733901191257495977f,0.34841868024943456472f, -0.93518350993894761025f,0.35416352542049034380f,0.93299279883473895669f, -0.35989503653498811087f,0.93076696107898371224f,0.36561299780477385379f, -0.92850608047321558924f,0.37131719395183754306f,0.92621024213831137928f, -0.37700741021641825945f,0.92387953251128673848f,0.38268343236508978178f, -0.92151403934204190183f,0.38834504669882624617f,0.91911385169005777040f, -0.39399204006104809883f,0.91667905992104270485f,0.39962419984564678810f, -0.91420975570353069095f,0.40524131400498986100f,0.91170603200542987832f, -0.41084317105790391089f,0.90916798309052238025f,0.41642956009763715253f, -0.90659570451491533483f,0.42200027079979968159f,0.90398929312344333820f, -0.42755509343028208491f,0.90134884704602202810f,0.43309381885315195726f, -0.89867446569395381673f,0.43861623853852765853f,0.89596624975618521791f, -0.44412214457042920035f,0.89322430119551532446f,0.44961132965460653965f, -0.89044872324475787817f,0.45508358712634383592f,0.88763962040285393496f, -0.46053871095824000514f,0.88479709843093778954f,0.46597649576796618121f, -0.88192126434835504956f,0.47139673682599764204f,0.87901222642863352519f, -0.47679923006332208812f,0.87607009419540660122f,0.48218377207912271887f, -0.87309497841829009079f,0.48755016014843599592f,0.87008699110871146054f, -0.49289819222978403790f,0.86704624551569264845f,0.49822766697278181303f, -0.86397285612158669643f,0.50353838372571757542f,0.86086693863776730939f, -0.50883014254310698909f,0.85772861000027211809f,0.51410274419322166128f, -0.85455798836540053376f,0.51935599016558964269f,0.85135519310526519554f, -0.52458968267846894928f,0.84812034480329723252f,0.52980362468629460526f, -0.84485356524970711689f,0.53499761988709715332f,0.84155497743689844370f, -0.54017147272989285423f,0.83822470555483807875f,0.54532498842204646383f, -0.83486287498638001026f,0.55045797293660481131f,0.83146961230254523567f, -0.55557023301960217765f,0.82804504525775579626f,0.56066157619733603124f, -0.82458930278502529099f,0.56573181078361312046f,0.82110251499110464835f, -0.57078074588696725566f,0.81758481315158371139f,0.57580819141784533866f, -0.81403632970594841378f,0.58081395809576452649f,0.81045719825259476821f, -0.58579785745643886408f,0.80684755354379933401f,0.59075970185887416442f, -0.80320753148064494287f,0.59569930449243335691f,0.79953726910790501314f, -0.60061647938386897305f,0.79583690460888356633f,0.60551104140432554512f, -0.79210657730021238887f,0.61038280627630947528f,0.78834642762660622761f, -0.61523159058062681925f,0.78455659715557524159f,0.62005721176328909561f, -0.78073722857209448822f,0.62485948814238634341f,0.77688846567323244230f, -0.62963823891492698426f,0.77301045336273699338f,0.63439328416364548779f, -0.76910333764557969882f,0.63912444486377573138f,0.76516726562245895860f, -0.64383154288979138613f,0.76120238548426177871f,0.64851440102211244110f, -0.75720884650648456748f,0.65317284295377675551f,0.75318679904361252042f, -0.65780669329707863735f,0.74913639452345937020f,0.66241577759017178373f, -0.74505778544146594733f,0.66699992230363747137f,0.74095112535495921691f, -0.67155895484701833009f,0.73681656887736979300f,0.67609270357531592310f, -0.73265427167241281570f,0.68060099779545302212f,0.72846439044822519637f, -0.68508366777270035541f,0.72424708295146700276f,0.68954054473706682948f, -0.72000250796138165477f,0.69397146088965389055f,0.71573082528381870571f, -0.69837624940897280457f,0.71143219574521643356f,0.70275474445722529993f, -0.70710678118654757274f,0.70710678118654757274f,0.70275474445722529993f, -0.71143219574521643356f,0.69837624940897291559f,0.71573082528381859468f, -0.69397146088965400157f,0.72000250796138165477f,0.68954054473706694051f, -0.72424708295146689174f,0.68508366777270035541f,0.72846439044822519637f, -0.68060099779545302212f,0.73265427167241281570f,0.67609270357531603413f, -0.73681656887736979300f,0.67155895484701833009f,0.74095112535495910588f, -0.66699992230363747137f,0.74505778544146594733f,0.66241577759017178373f, -0.74913639452345925918f,0.65780669329707874837f,0.75318679904361252042f, -0.65317284295377686654f,0.75720884650648456748f,0.64851440102211255212f, -0.76120238548426177871f,0.64383154288979149715f,0.76516726562245895860f, -0.63912444486377573138f,0.76910333764557958780f,0.63439328416364548779f, -0.77301045336273688235f,0.62963823891492709528f,0.77688846567323244230f, -0.62485948814238645443f,0.78073722857209448822f,0.62005721176328920663f, -0.78455659715557524159f,0.61523159058062681925f,0.78834642762660622761f, -0.61038280627630947528f,0.79210657730021227785f,0.60551104140432554512f, -0.79583690460888345530f,0.60061647938386897305f,0.79953726910790501314f, -0.59569930449243346793f,0.80320753148064483184f,0.59075970185887427544f, -0.80684755354379922299f,0.58579785745643886408f,0.81045719825259476821f, -0.58081395809576452649f,0.81403632970594830276f,0.57580819141784533866f, -0.81758481315158371139f,0.57078074588696736669f,0.82110251499110464835f, -0.56573181078361323149f,0.82458930278502529099f,0.56066157619733603124f, -0.82804504525775579626f,0.55557023301960228867f,0.83146961230254523567f, -0.55045797293660481131f,0.83486287498638001026f,0.54532498842204646383f, -0.83822470555483796772f,0.54017147272989296525f,0.84155497743689833268f, -0.53499761988709726435f,0.84485356524970700587f,0.52980362468629482731f, -0.84812034480329712149f,0.52458968267846883826f,0.85135519310526519554f, -0.51935599016558953167f,0.85455798836540053376f,0.51410274419322166128f, -0.85772861000027211809f,0.50883014254310698909f,0.86086693863776730939f, -0.50353838372571757542f,0.86397285612158669643f,0.49822766697278186854f, -0.86704624551569264845f,0.49289819222978409341f,0.87008699110871134952f, -0.48755016014843605143f,0.87309497841829009079f,0.48218377207912282989f, -0.87607009419540660122f,0.47679923006332225466f,0.87901222642863341417f, -0.47139673682599780857f,0.88192126434835493853f,0.46597649576796612569f, -0.88479709843093778954f,0.46053871095824000514f,0.88763962040285393496f, -0.45508358712634383592f,0.89044872324475787817f,0.44961132965460659516f, -0.89322430119551532446f,0.44412214457042925586f,0.89596624975618510689f, -0.43861623853852771404f,0.89867446569395381673f,0.43309381885315201277f, -0.90134884704602202810f,0.42755509343028219593f,0.90398929312344333820f, -0.42200027079979979261f,0.90659570451491533483f,0.41642956009763731906f, -0.90916798309052226923f,0.41084317105790391089f,0.91170603200542987832f, -0.40524131400498986100f,0.91420975570353069095f,0.39962419984564678810f, -0.91667905992104270485f,0.39399204006104809883f,0.91911385169005777040f, -0.38834504669882630168f,0.92151403934204190183f,0.38268343236508983729f, -0.92387953251128673848f,0.37700741021641831496f,0.92621024213831126826f, -0.37131719395183759858f,0.92850608047321558924f,0.36561299780477396482f, -0.93076696107898371224f,0.35989503653498827740f,0.93299279883473884567f, -0.35416352542049051033f,0.93518350993894749923f,0.34841868024943450921f, -0.93733901191257495977f,0.34266071731199437833f,0.93945922360218991898f, -0.33688985339222005111f,0.94154406518302080631f,0.33110630575987642921f, -0.94359345816196038559f,0.32531029216226298173f,0.94560732538052127971f, -0.31950203081601574739f,0.94758559101774109124f,0.31368174039889157312f, -0.94952818059303667475f,0.30784964004153497763f,0.95143502096900833820f, -0.30200594931922819519f,0.95330604035419375109f,0.29615088824362395536f, -0.95514116830577067141f,0.29028467725446233105f,0.95694033573220893540f, -0.28440753721127182141f,0.95870347489587159906f,0.27851968938505305973f, -0.96043051941556578655f,0.27262135544994897662f,0.96212140426904158019f, -0.26671275747489842090f,0.96377606579543984022f,0.26079411791527556952f, -0.96539444169768939830f,0.25486565960451462720f,0.96697647104485207059f, -0.24892760574572025956f,0.96852209427441726675f,0.24298017990326398197f, -0.97003125319454397424f,0.23702360599436733679f,0.97150389098625178352f, -0.23105810828067127605f,0.97293995220556006576f,0.22508391135979277653f, -0.97433938278557585821f,0.21910124015686976984f,0.97570213003852857003f, -0.21311031991609136194f,0.97702814265775439484f,0.20711137619221856032f, -0.97831737071962765473f,0.20110463484209195606f,0.97956976568544051887f, -0.19509032201612833135f,0.98078528040323043058f,0.18906866414980627589f, -0.98196386910955524296f,0.18303988795514106180f,0.98310548743121628501f, -0.17700422041214886049f,0.98421009238692902521f,0.17096188876030135595f, -0.98527764238894122162f,0.16491312048997008866f,0.98630809724459866938f, -0.15885814333386139019f,0.98730141815785843473f,0.15279718525844340760f, -0.98825756773074946437f,0.14673047445536174793f,0.98917650996478101444f, -0.14065823933284923863f,0.99005821026229712256f,0.13458070850712622324f, -0.99090263542778000971f,0.12849811079379322432f,0.99170975366909952520f, -0.12241067519921627893f,0.99247953459870996706f,0.11631863091190487725f, -0.99321194923479450001f,0.11022220729388318428f,0.99390697000235606051f, -0.10412163387205472520f,0.99456457073425541537f,0.09801714032956077016f, -0.99518472667219681771f,0.09190895649713269611f,0.99576741446765981713f, -0.08579731234443987997f,0.99631261218277800129f,0.07968243797143012563f, -0.99682029929116566791f,0.07356456359966745406f,0.99729045667869020697f, -0.06744391956366410645f,0.99772306664419163624f,0.06132073630220864768f, -0.99811811290014917919f,0.05519524434969003135f,0.99847558057329477421f, -0.04906767432741812596f,0.99879545620517240501f,0.04293825693494095902f, -0.99907772775264536147f,0.03680722294135899131f,0.99932238458834954375f, -0.03067480317663658085f,0.99952941750109314256f,0.02454122852291226384f, -0.99969881869620424997f,0.01840672990580482019f,0.99983058179582340319f, -0.01227153828571994447f,0.99992470183914450299f,0.00613588464915451517f, -0.99998117528260110909f,1.00000000000000000000f,0.00000000000000000000f, -0.99969881869620424997f,0.02454122852291228812f,0.99879545620517240501f, -0.04906767432741801493f,0.99729045667869020697f,0.07356456359966742631f, -0.99518472667219692873f,0.09801714032956060363f,0.99247953459870996706f, -0.12241067519921619566f,0.98917650996478101444f,0.14673047445536174793f, -0.98527764238894122162f,0.17096188876030121717f,0.98078528040323043058f, -0.19509032201612824808f,0.97570213003852857003f,0.21910124015686979759f, -0.97003125319454397424f,0.24298017990326387094f,0.96377606579543984022f, -0.26671275747489836538f,0.95694033573220882438f,0.29028467725446233105f, -0.94952818059303667475f,0.31368174039889151761f,0.94154406518302080631f, -0.33688985339222005111f,0.93299279883473895669f,0.35989503653498811087f, -0.92387953251128673848f,0.38268343236508978178f,0.91420975570353069095f, -0.40524131400498986100f,0.90398929312344333820f,0.42755509343028208491f, -0.89322430119551532446f,0.44961132965460653965f,0.88192126434835504956f, -0.47139673682599764204f,0.87008699110871146054f,0.49289819222978403790f, -0.85772861000027211809f,0.51410274419322166128f,0.84485356524970711689f, -0.53499761988709715332f,0.83146961230254523567f,0.55557023301960217765f, -0.81758481315158371139f,0.57580819141784533866f,0.80320753148064494287f, -0.59569930449243335691f,0.78834642762660622761f,0.61523159058062681925f, -0.77301045336273699338f,0.63439328416364548779f,0.75720884650648456748f, -0.65317284295377675551f,0.74095112535495921691f,0.67155895484701833009f, -0.72424708295146700276f,0.68954054473706682948f,0.70710678118654757274f, -0.70710678118654757274f,0.68954054473706694051f,0.72424708295146689174f, -0.67155895484701833009f,0.74095112535495910588f,0.65317284295377686654f, -0.75720884650648456748f,0.63439328416364548779f,0.77301045336273688235f, -0.61523159058062681925f,0.78834642762660622761f,0.59569930449243346793f, -0.80320753148064483184f,0.57580819141784533866f,0.81758481315158371139f, -0.55557023301960228867f,0.83146961230254523567f,0.53499761988709726435f, -0.84485356524970700587f,0.51410274419322166128f,0.85772861000027211809f, -0.49289819222978409341f,0.87008699110871134952f,0.47139673682599780857f, -0.88192126434835493853f,0.44961132965460659516f,0.89322430119551532446f, -0.42755509343028219593f,0.90398929312344333820f,0.40524131400498986100f, -0.91420975570353069095f,0.38268343236508983729f,0.92387953251128673848f, -0.35989503653498827740f,0.93299279883473884567f,0.33688985339222005111f, -0.94154406518302080631f,0.31368174039889157312f,0.94952818059303667475f, -0.29028467725446233105f,0.95694033573220893540f,0.26671275747489842090f, -0.96377606579543984022f,0.24298017990326398197f,0.97003125319454397424f, -0.21910124015686976984f,0.97570213003852857003f,0.19509032201612833135f, -0.98078528040323043058f,0.17096188876030135595f,0.98527764238894122162f, -0.14673047445536174793f,0.98917650996478101444f,0.12241067519921627893f, -0.99247953459870996706f,0.09801714032956077016f,0.99518472667219681771f, -0.07356456359966745406f,0.99729045667869020697f,0.04906767432741812596f, -0.99879545620517240501f,0.02454122852291226384f,0.99969881869620424997f, -1.00000000000000000000f,0.00000000000000000000f,0.99518472667219692873f, -0.09801714032956060363f,0.98078528040323043058f,0.19509032201612824808f, -0.95694033573220882438f,0.29028467725446233105f,0.92387953251128673848f, -0.38268343236508978178f,0.88192126434835504956f,0.47139673682599764204f, -0.83146961230254523567f,0.55557023301960217765f,0.77301045336273699338f, -0.63439328416364548779f,0.70710678118654757274f,0.70710678118654757274f, -0.63439328416364548779f,0.77301045336273688235f,0.55557023301960228867f, -0.83146961230254523567f,0.47139673682599780857f,0.88192126434835493853f, -0.38268343236508983729f,0.92387953251128673848f,0.29028467725446233105f, -0.95694033573220893540f,0.19509032201612833135f,0.98078528040323043058f, -0.09801714032956077016f,0.99518472667219681771f,1.00000000000000000000f, -0.00000000000000000000f,0.92387953251128673848f,0.38268343236508978178f, -0.70710678118654757274f,0.70710678118654757274f,0.38268343236508983729f, -0.92387953251128673848f,}; +1.00000000000000000000f,0.00000000000000000000f,0.99999880790710449219f, +0.00153398013208061457f,0.99999529123306274414f,0.00306795677170157433f, +0.99998939037322998047f,0.00460192607715725899f,0.99998116493225097656f, +0.00613588467240333557f,0.99997061491012573242f,0.00766982883214950562f, +0.99995762109756469727f,0.00920375436544418335f,0.99994236230850219727f, +0.01073765940964221954f,0.99992471933364868164f,0.01227153837680816650f, +0.99990469217300415039f,0.01380538847297430038f,0.99988234043121337891f, +0.01533920597285032272f,0.99985766410827636719f,0.01687298715114593506f, +0.99983060359954833984f,0.01840673014521598816f,0.99980115890502929688f, +0.01994042843580245972f,0.99976938962936401367f,0.02147408016026020050f, +0.99973529577255249023f,0.02300768159329891205f,0.99969881772994995117f, +0.02454122900962829590f,0.99966001510620117188f,0.02607471868395805359f, +0.99961882829666137695f,0.02760814502835273743f,0.99957531690597534180f, +0.02914150804281234741f,0.99952942132949829102f,0.03067480400204658508f, +0.99948120117187500000f,0.03220802545547485352f,0.99943059682846069336f, +0.03374117240309715271f,0.99937766790390014648f,0.03527423739433288574f, +0.99932235479354858398f,0.03680722415447235107f,0.99926477670669555664f, +0.03834012150764465332f,0.99920475482940673828f,0.03987292572855949402f, +0.99914240837097167969f,0.04140564054250717163f,0.99907773733139038086f, +0.04293825849890708923f,0.99901068210601806641f,0.04447077214717864990f, +0.99894130229949951172f,0.04600318148732185364f,0.99886953830718994141f, +0.04753548279404640198f,0.99879544973373413086f,0.04906767606735229492f, +0.99871903657913208008f,0.05059975013136863708f,0.99864023923873901367f, +0.05213170498609542847f,0.99855905771255493164f,0.05366353690624237061f, +0.99847555160522460938f,0.05519524589180946350f,0.99838972091674804688f, +0.05672682076692581177f,0.99830156564712524414f,0.05825826525688171387f, +0.99821102619171142578f,0.05978957191109657288f,0.99811810255050659180f, +0.06132073700428009033f,0.99802285432815551758f,0.06285175681114196777f, +0.99792528152465820312f,0.06438262760639190674f,0.99782532453536987305f, +0.06591334939002990723f,0.99772304296493530273f,0.06744392216205596924f, +0.99761843681335449219f,0.06897433102130889893f,0.99751144647598266602f, +0.07050457596778869629f,0.99740213155746459961f,0.07203464955091476440f, +0.99729043245315551758f,0.07356456667184829712f,0.99717640876770019531f, +0.07509429752826690674f,0.99706006050109863281f,0.07662386447191238403f, +0.99694132804870605469f,0.07815324515104293823f,0.99682027101516723633f, +0.07968243956565856934f,0.99669688940048217773f,0.08121144771575927734f, +0.99657112360000610352f,0.08274026215076446533f,0.99644303321838378906f, +0.08426889032125473022f,0.99631261825561523438f,0.08579730987548828125f, +0.99617981910705566406f,0.08732553571462631226f,0.99604469537734985352f, +0.08885355293750762939f,0.99590724706649780273f,0.09038136154413223267f, +0.99576741456985473633f,0.09190895408391952515f,0.99562525749206542969f, +0.09343633800745010376f,0.99548077583312988281f,0.09496349841356277466f, +0.99533390998840332031f,0.09649042785167694092f,0.99518471956253051758f, +0.09801714122295379639f,0.99503320455551147461f,0.09954361617565155029f, +0.99487930536270141602f,0.10106986016035079956f,0.99472314119338989258f, +0.10259586572647094727f,0.99456459283828735352f,0.10412163287401199341f, +0.99440366029739379883f,0.10564715415239334106f,0.99424046277999877930f, +0.10717242211103439331f,0.99407488107681274414f,0.10869744420051574707f, +0.99390697479248046875f,0.11022220551967620850f,0.99373674392700195312f, +0.11174671351909637451f,0.99356412887573242188f,0.11327095329761505127f, +0.99338918924331665039f,0.11479492485523223877f,0.99321192502975463867f, +0.11631862819194793701f,0.99303233623504638672f,0.11784206330776214600f, +0.99285042285919189453f,0.11936521530151367188f,0.99266612529754638672f, +0.12088808417320251465f,0.99247956275939941406f,0.12241067737340927124f, +0.99229061603546142578f,0.12393297255039215088f,0.99209928512573242188f, +0.12545497715473175049f,0.99190568923950195312f,0.12697669863700866699f, +0.99170976877212524414f,0.12849810719490051270f,0.99151146411895751953f, +0.13001921772956848145f,0.99131083488464355469f,0.13154003024101257324f, +0.99110794067382812500f,0.13306052982807159424f,0.99090266227722167969f, +0.13458070158958435059f,0.99069499969482421875f,0.13610057532787322998f, +0.99048507213592529297f,0.13762012124061584473f,0.99027281999588012695f, +0.13913933932781219482f,0.99005818367004394531f,0.14065824449062347412f, +0.98984128236770629883f,0.14217680692672729492f,0.98962199687957763672f, +0.14369502663612365723f,0.98940044641494750977f,0.14521291851997375488f, +0.98917651176452636719f,0.14673046767711639404f,0.98895025253295898438f, +0.14824767410755157471f,0.98872166872024536133f,0.14976453781127929688f, +0.98849081993103027344f,0.15128104388713836670f,0.98825758695602416992f, +0.15279719233512878418f,0.98802202939987182617f,0.15431296825408935547f, +0.98778414726257324219f,0.15582840144634246826f,0.98754394054412841797f, +0.15734346210956573486f,0.98730140924453735352f,0.15885815024375915527f, +0.98705655336380004883f,0.16037245094776153564f,0.98680937290191650391f, +0.16188639402389526367f,0.98655992746353149414f,0.16339994966983795166f, +0.98630809783935546875f,0.16491311788558959961f,0.98605394363403320312f, +0.16642589867115020752f,0.98579752445220947266f,0.16793829202651977539f, +0.98553872108459472656f,0.16945029795169830322f,0.98527765274047851562f, +0.17096188664436340332f,0.98501425981521606445f,0.17247308790683746338f, +0.98474848270416259766f,0.17398387193679809570f,0.98448044061660766602f, +0.17549425363540649414f,0.98421007394790649414f,0.17700421810150146484f, +0.98393744230270385742f,0.17851376533508300781f,0.98366242647171020508f, +0.18002289533615112305f,0.98338508605957031250f,0.18153160810470581055f, +0.98310548067092895508f,0.18303988873958587646f,0.98282355070114135742f, +0.18454773724079132080f,0.98253929615020751953f,0.18605515360832214355f, +0.98225271701812744141f,0.18756212294101715088f,0.98196387290954589844f, +0.18906866014003753662f,0.98167270421981811523f,0.19057475030422210693f, +0.98137921094894409180f,0.19208039343357086182f,0.98108339309692382812f, +0.19358558952808380127f,0.98078525066375732422f,0.19509032368659973145f, +0.98048484325408935547f,0.19659459590911865234f,0.98018211126327514648f, +0.19809840619564056396f,0.97987711429595947266f,0.19960175454616546631f, +0.97956979274749755859f,0.20110464096069335938f,0.97926014661788940430f, +0.20260703563690185547f,0.97894817590713500977f,0.20410896837711334229f, +0.97863394021987915039f,0.20561040937900543213f,0.97831737995147705078f, +0.20711137354373931885f,0.97799849510192871094f,0.20861184597015380859f, +0.97767734527587890625f,0.21011184155941009521f,0.97735387086868286133f, +0.21161133050918579102f,0.97702813148498535156f,0.21311031281948089600f, +0.97670006752014160156f,0.21460881829261779785f,0.97636973857879638672f, +0.21610680222511291504f,0.97603708505630493164f,0.21760427951812744141f, +0.97570210695266723633f,0.21910123527050018311f,0.97536486387252807617f, +0.22059768438339233398f,0.97502535581588745117f,0.22209362685680389404f, +0.97468352317810058594f,0.22358903288841247559f,0.97433936595916748047f, +0.22508391737937927246f,0.97399294376373291016f,0.22657826542854309082f, +0.97364425659179687500f,0.22807207703590393066f,0.97329324483871459961f, +0.22956536710262298584f,0.97293996810913085938f,0.23105810582637786865f, +0.97258436679840087891f,0.23255030810832977295f,0.97222650051116943359f, +0.23404195904731750488f,0.97186630964279174805f,0.23553305864334106445f, +0.97150391340255737305f,0.23702360689640045166f,0.97113913297653198242f, +0.23851358890533447266f,0.97077214717864990234f,0.24000301957130432129f, +0.97040283679962158203f,0.24149188399314880371f,0.97003126144409179688f, +0.24298018217086791992f,0.96965736150741577148f,0.24446789920330047607f, +0.96928125619888305664f,0.24595504999160766602f,0.96890282630920410156f, +0.24744161963462829590f,0.96852207183837890625f,0.24892760813236236572f, +0.96813911199569702148f,0.25041300058364868164f,0.96775382757186889648f, +0.25189781188964843750f,0.96736627817153930664f,0.25338202714920043945f, +0.96697646379470825195f,0.25486564636230468750f,0.96658438444137573242f, +0.25634866952896118164f,0.96618998050689697266f,0.25783109664916992188f, +0.96579337120056152344f,0.25931292772293090820f,0.96539443731307983398f, +0.26079410314559936523f,0.96499323844909667969f,0.26227471232414245605f, +0.96458977460861206055f,0.26375466585159301758f,0.96418404579162597656f, +0.26523402333259582520f,0.96377605199813842773f,0.26671275496482849121f, +0.96336579322814941406f,0.26819086074829101562f,0.96295326948165893555f, +0.26966831088066101074f,0.96253848075866699219f,0.27114516496658325195f, +0.96212142705917358398f,0.27262136340141296387f,0.96170204877853393555f, +0.27409690618515014648f,0.96128046512603759766f,0.27557182312011718750f, +0.96085661649703979492f,0.27704608440399169922f,0.96043050289154052734f, +0.27851969003677368164f,0.96000212430953979492f,0.27999264001846313477f, +0.95957154035568237305f,0.28146493434906005859f,0.95913863182067871094f, +0.28293657302856445312f,0.95870345830917358398f,0.28440752625465393066f, +0.95826607942581176758f,0.28587782382965087891f,0.95782643556594848633f, +0.28734746575355529785f,0.95738452672958374023f,0.28881642222404479980f, +0.95694035291671752930f,0.29028466343879699707f,0.95649391412734985352f, +0.29175224900245666504f,0.95604526996612548828f,0.29321914911270141602f, +0.95559436082839965820f,0.29468536376953125000f,0.95514118671417236328f, +0.29615089297294616699f,0.95468574762344360352f,0.29761570692062377930f, +0.95422810316085815430f,0.29907983541488647461f,0.95376819372177124023f, +0.30054324865341186523f,0.95330601930618286133f,0.30200594663619995117f, +0.95284163951873779297f,0.30346795916557312012f,0.95237499475479125977f, +0.30492922663688659668f,0.95190614461898803711f,0.30638980865478515625f, +0.95143502950668334961f,0.30784964561462402344f,0.95096164941787719727f, +0.30930876731872558594f,0.95048606395721435547f,0.31076714396476745605f, +0.95000827312469482422f,0.31222480535507202148f,0.94952815771102905273f, +0.31368175148963928223f,0.94904589653015136719f,0.31513792276382446289f, +0.94856137037277221680f,0.31659337878227233887f,0.94807457923889160156f, +0.31804808974266052246f,0.94758558273315429688f,0.31950202584266662598f, +0.94709438085556030273f,0.32095524668693542480f,0.94660091400146484375f, +0.32240769267082214355f,0.94610524177551269531f,0.32385936379432678223f, +0.94560730457305908203f,0.32531028985977172852f,0.94510722160339355469f, +0.32676044106483459473f,0.94460481405258178711f,0.32820984721183776855f, +0.94410026073455810547f,0.32965844869613647461f,0.94359344244003295898f, +0.33110630512237548828f,0.94308441877365112305f,0.33255335688591003418f, +0.94257318973541259766f,0.33399966359138488770f,0.94205975532531738281f, +0.33544513583183288574f,0.94154405593872070312f,0.33688986301422119141f, +0.94102615118026733398f,0.33833375573158264160f,0.94050604104995727539f, +0.33977687358856201172f,0.93998372554779052734f,0.34121921658515930176f, +0.93945920467376708984f,0.34266072511672973633f,0.93893247842788696289f, +0.34410142898559570312f,0.93840354681015014648f,0.34554132819175720215f, +0.93787235021591186523f,0.34698042273521423340f,0.93733900785446166992f, +0.34841868281364440918f,0.93680346012115478516f,0.34985613822937011719f, +0.93626564741134643555f,0.35129275918006896973f,0.93572568893432617188f, +0.35272854566574096680f,0.93518352508544921875f,0.35416352748870849609f, +0.93463915586471557617f,0.35559767484664916992f,0.93409252166748046875f, +0.35703095793724060059f,0.93354380130767822266f,0.35846340656280517578f, +0.93299281597137451172f,0.35989505052566528320f,0.93243962526321411133f, +0.36132580041885375977f,0.93188428878784179688f,0.36275571584701538086f, +0.93132668733596801758f,0.36418479681015014648f,0.93076694011688232422f, +0.36561298370361328125f,0.93020504713058471680f,0.36704033613204956055f, +0.92964088916778564453f,0.36846682429313659668f,0.92907458543777465820f, +0.36989244818687438965f,0.92850607633590698242f,0.37131720781326293945f, +0.92793542146682739258f,0.37274107336997985840f,0.92736250162124633789f, +0.37416407465934753418f,0.92678749561309814453f,0.37558618187904357910f, +0.92621022462844848633f,0.37700742483139038086f,0.92563080787658691406f, +0.37842774391174316406f,0.92504924535751342773f,0.37984719872474670410f, +0.92446547746658325195f,0.38126575946807861328f,0.92387950420379638672f, +0.38268342614173889160f,0.92329144477844238281f,0.38410019874572753906f, +0.92270112037658691406f,0.38551604747772216797f,0.92210865020751953125f, +0.38693100214004516602f,0.92151403427124023438f,0.38834503293037414551f, +0.92091721296310424805f,0.38975816965103149414f,0.92031830549240112305f, +0.39117038249969482422f,0.91971713304519653320f,0.39258167147636413574f, +0.91911387443542480469f,0.39399203658103942871f,0.91850841045379638672f, +0.39540147781372070312f,0.91790080070495605469f,0.39680999517440795898f, +0.91729098558425903320f,0.39821755886077880859f,0.91667908430099487305f, +0.39962419867515563965f,0.91606497764587402344f,0.40102988481521606445f, +0.91544872522354125977f,0.40243464708328247070f,0.91483032703399658203f, +0.40383845567703247070f,0.91420978307723999023f,0.40524131059646606445f, +0.91358703374862670898f,0.40664321184158325195f,0.91296219825744628906f, +0.40804415941238403320f,0.91233515739440917969f,0.40944415330886840820f, +0.91170603036880493164f,0.41084316372871398926f,0.91107475757598876953f, +0.41224122047424316406f,0.91044127941131591797f,0.41363832354545593262f, +0.90980571508407592773f,0.41503441333770751953f,0.90916800498962402344f, +0.41642954945564270020f,0.90852808952331542969f,0.41782370209693908691f, +0.90788608789443969727f,0.41921690106391906738f,0.90724200010299682617f, +0.42060908675193786621f,0.90659570693969726562f,0.42200025916099548340f, +0.90594726800918579102f,0.42339047789573669434f,0.90529674291610717773f, +0.42477968335151672363f,0.90464407205581665039f,0.42616787552833557129f, +0.90398931503295898438f,0.42755508422851562500f,0.90333235263824462891f, +0.42894127964973449707f,0.90267330408096313477f,0.43032649159431457520f, +0.90201216936111450195f,0.43171066045761108398f,0.90134882926940917969f, +0.43309381604194641113f,0.90068340301513671875f,0.43447595834732055664f, +0.90001589059829711914f,0.43585708737373352051f,0.89934623241424560547f, +0.43723717331886291504f,0.89867448806762695312f,0.43861624598503112793f, +0.89800059795379638672f,0.43999427556991577148f,0.89732456207275390625f, +0.44137126207351684570f,0.89664649963378906250f,0.44274723529815673828f, +0.89596623182296752930f,0.44412213563919067383f,0.89528393745422363281f, +0.44549602270126342773f,0.89459949731826782227f,0.44686883687973022461f, +0.89391297101974487305f,0.44824060797691345215f,0.89322429895401000977f, +0.44961133599281311035f,0.89253354072570800781f,0.45098099112510681152f, +0.89184069633483886719f,0.45234957337379455566f,0.89114576578140258789f, +0.45371711254119873047f,0.89044874906539916992f,0.45508357882499694824f, +0.88974958658218383789f,0.45644897222518920898f,0.88904833793640136719f, +0.45781329274177551270f,0.88834506273269653320f,0.45917654037475585938f, +0.88763964176177978516f,0.46053871512413024902f,0.88693213462829589844f, +0.46189978718757629395f,0.88622254133224487305f,0.46325978636741638184f, +0.88551086187362670898f,0.46461868286132812500f,0.88479709625244140625f, +0.46597650647163391113f,0.88408124446868896484f,0.46733319759368896484f, +0.88336336612701416016f,0.46868881583213806152f,0.88264334201812744141f, +0.47004333138465881348f,0.88192129135131835938f,0.47139674425125122070f, +0.88119709491729736328f,0.47274902462959289551f,0.88047087192535400391f, +0.47410020232200622559f,0.87974262237548828125f,0.47545027732849121094f, +0.87901222705841064453f,0.47679921984672546387f,0.87827980518341064453f, +0.47814705967903137207f,0.87754529714584350586f,0.47949376702308654785f, +0.87680870294570922852f,0.48083934187889099121f,0.87607008218765258789f, +0.48218378424644470215f,0.87532937526702880859f,0.48352706432342529297f, +0.87458664178848266602f,0.48486924171447753906f,0.87384182214736938477f, +0.48621028661727905273f,0.87309497594833374023f,0.48755016922950744629f, +0.87234604358673095703f,0.48888888955116271973f,0.87159508466720581055f, +0.49022647738456726074f,0.87084203958511352539f,0.49156290292739868164f, +0.87008696794509887695f,0.49289819598197937012f,0.86932986974716186523f, +0.49423229694366455078f,0.86857068538665771484f,0.49556526541709899902f, +0.86780947446823120117f,0.49689704179763793945f,0.86704623699188232422f, +0.49822765588760375977f,0.86628097295761108398f,0.49955710768699645996f, +0.86551362276077270508f,0.50088536739349365234f,0.86474424600601196289f, +0.50221246480941772461f,0.86397284269332885742f,0.50353837013244628906f, +0.86319941282272338867f,0.50486308336257934570f,0.86242395639419555664f, +0.50618666410446166992f,0.86164647340774536133f,0.50750899314880371094f, +0.86086696386337280273f,0.50883013010025024414f,0.86008536815643310547f, +0.51015007495880126953f,0.85930180549621582031f,0.51146882772445678711f, +0.85851621627807617188f,0.51278638839721679688f,0.85772860050201416016f, +0.51410275697708129883f,0.85693895816802978516f,0.51541787385940551758f, +0.85614734888076782227f,0.51673179864883422852f,0.85535365343093872070f, +0.51804453134536743164f,0.85455799102783203125f,0.51935601234436035156f, +0.85376030206680297852f,0.52066624164581298828f,0.85296058654785156250f, +0.52197527885437011719f,0.85215890407562255859f,0.52328312397003173828f, +0.85135519504547119141f,0.52458965778350830078f,0.85054945945739746094f, +0.52589499950408935547f,0.84974175691604614258f,0.52719914913177490234f, +0.84893202781677246094f,0.52850198745727539062f,0.84812033176422119141f, +0.52980363368988037109f,0.84730660915374755859f,0.53110402822494506836f, +0.84649091958999633789f,0.53240311145782470703f,0.84567326307296752930f, +0.53370100259780883789f,0.84485357999801635742f,0.53499764204025268555f, +0.84403187036514282227f,0.53629297018051147461f,0.84320825338363647461f, +0.53758704662322998047f,0.84238260984420776367f,0.53887993097305297852f, +0.84155499935150146484f,0.54017144441604614258f,0.84072536230087280273f, +0.54146176576614379883f,0.83989381790161132812f,0.54275077581405639648f, +0.83906024694442749023f,0.54403853416442871094f,0.83822470903396606445f, +0.54532498121261596680f,0.83738720417022705078f,0.54661017656326293945f, +0.83654773235321044922f,0.54789406061172485352f,0.83570629358291625977f, +0.54917663335800170898f,0.83486288785934448242f,0.55045795440673828125f, +0.83401751518249511719f,0.55173796415328979492f,0.83317017555236816406f, +0.55301672220230102539f,0.83232086896896362305f,0.55429410934448242188f, +0.83146959543228149414f,0.55557024478912353516f,0.83061641454696655273f, +0.55684500932693481445f,0.82976120710372924805f,0.55811852216720581055f, +0.82890409231185913086f,0.55939072370529174805f,0.82804507017135620117f, +0.56066155433654785156f,0.82718402147293090820f,0.56193113327026367188f, +0.82632106542587280273f,0.56319934129714965820f,0.82545614242553710938f, +0.56446623802185058594f,0.82458931207656860352f,0.56573182344436645508f, +0.82372051477432250977f,0.56699603796005249023f,0.82284981012344360352f, +0.56825894117355346680f,0.82197713851928710938f,0.56952053308486938477f, +0.82110249996185302734f,0.57078075408935546875f,0.82022595405578613281f, +0.57203960418701171875f,0.81934750080108642578f,0.57329714298248291016f, +0.81846714019775390625f,0.57455337047576904297f,0.81758481264114379883f, +0.57580816745758056641f,0.81670057773590087891f,0.57706165313720703125f, +0.81581443548202514648f,0.57831376791000366211f,0.81492632627487182617f, +0.57956457138061523438f,0.81403630971908569336f,0.58081394433975219727f, +0.81314438581466674805f,0.58206200599670410156f,0.81225061416625976562f, +0.58330863714218139648f,0.81135487556457519531f,0.58455395698547363281f, +0.81045717000961303711f,0.58579784631729125977f,0.80955761671066284180f, +0.58704036474227905273f,0.80865615606307983398f,0.58828157186508178711f, +0.80775284767150878906f,0.58952128887176513672f,0.80684757232666015625f, +0.59075969457626342773f,0.80594038963317871094f,0.59199666976928710938f, +0.80503135919570922852f,0.59323227405548095703f,0.80412036180496215820f, +0.59446650743484497070f,0.80320751667022705078f,0.59569931030273437500f, +0.80229282379150390625f,0.59693068265914916992f,0.80137616395950317383f, +0.59816068410873413086f,0.80045765638351440430f,0.59938931465148925781f, +0.79953724145889282227f,0.60061645507812500000f,0.79861497879028320312f, +0.60184222459793090820f,0.79769086837768554688f,0.60306662321090698242f, +0.79676479101181030273f,0.60428953170776367188f,0.79583692550659179688f, +0.60551106929779052734f,0.79490715265274047852f,0.60673111677169799805f, +0.79397547245025634766f,0.60794979333877563477f,0.79304194450378417969f, +0.60916703939437866211f,0.79210656881332397461f,0.61038279533386230469f, +0.79116934537887573242f,0.61159718036651611328f,0.79023021459579467773f, +0.61281007528305053711f,0.78928923606872558594f,0.61402153968811035156f, +0.78834640979766845703f,0.61523157358169555664f,0.78740173578262329102f, +0.61644017696380615234f,0.78645521402359008789f,0.61764729022979736328f, +0.78550684452056884766f,0.61885297298431396484f,0.78455656766891479492f, +0.62005722522735595703f,0.78360450267791748047f,0.62125998735427856445f, +0.78265058994293212891f,0.62246125936508178711f,0.78169482946395874023f, +0.62366110086441040039f,0.78073722124099731445f,0.62485951185226440430f, +0.77977776527404785156f,0.62605637311935424805f,0.77881652116775512695f, +0.62725180387496948242f,0.77785342931747436523f,0.62844574451446533203f, +0.77688848972320556641f,0.62963825464248657227f,0.77592170238494873047f, +0.63082921504974365234f,0.77495312690734863281f,0.63201874494552612305f, +0.77398270368576049805f,0.63320678472518920898f,0.77301043272018432617f, +0.63439327478408813477f,0.77203637361526489258f,0.63557833433151245117f, +0.77106052637100219727f,0.63676184415817260742f,0.77008283138275146484f, +0.63794392347335815430f,0.76910334825515747070f,0.63912445306777954102f, +0.76812201738357543945f,0.64030349254608154297f,0.76713889837265014648f, +0.64148104190826416016f,0.76615399122238159180f,0.64265704154968261719f, +0.76516723632812500000f,0.64383155107498168945f,0.76417875289916992188f, +0.64500451087951660156f,0.76318842172622680664f,0.64617604017257690430f, +0.76219630241394042969f,0.64734596014022827148f,0.76120239496231079102f, +0.64851438999176025391f,0.76020669937133789062f,0.64968132972717285156f, +0.75920921564102172852f,0.65084666013717651367f,0.75820988416671752930f, +0.65201056003570556641f,0.75720882415771484375f,0.65317285060882568359f, +0.75620597600936889648f,0.65433359146118164062f,0.75520139932632446289f, +0.65549284219741821289f,0.75419497489929199219f,0.65665054321289062500f, +0.75318682193756103516f,0.65780669450759887695f,0.75217682123184204102f, +0.65896129608154296875f,0.75116515159606933594f,0.66011434793472290039f, +0.75015163421630859375f,0.66126585006713867188f,0.74913638830184936523f, +0.66241580247879028320f,0.74811935424804687500f,0.66356414556503295898f, +0.74710059165954589844f,0.66471099853515625000f,0.74608010053634643555f, +0.66585624217987060547f,0.74505776166915893555f,0.66699993610382080078f, +0.74403375387191772461f,0.66814202070236206055f,0.74300795793533325195f, +0.66928261518478393555f,0.74198043346405029297f,0.67042154073715209961f, +0.74095112085342407227f,0.67155897617340087891f,0.73992007970809936523f, +0.67269474267959594727f,0.73888731002807617188f,0.67382901906967163086f, +0.73785281181335449219f,0.67496162652969360352f,0.73681658506393432617f, +0.67609268426895141602f,0.73577857017517089844f,0.67722219228744506836f, +0.73473888635635375977f,0.67835003137588500977f,0.73369741439819335938f, +0.67947632074356079102f,0.73265427350997924805f,0.68060100078582763672f, +0.73160940408706665039f,0.68172407150268554688f,0.73056274652481079102f, +0.68284553289413452148f,0.72951442003250122070f,0.68396538496017456055f, +0.72846436500549316406f,0.68508368730545043945f,0.72741264104843139648f, +0.68620032072067260742f,0.72635912895202636719f,0.68731534481048583984f, +0.72530394792556762695f,0.68842875957489013672f,0.72424709796905517578f, +0.68954056501388549805f,0.72318845987319946289f,0.69065070152282714844f, +0.72212821245193481445f,0.69175922870635986328f,0.72106617689132690430f, +0.69286614656448364258f,0.72000253200531005859f,0.69397145509719848633f, +0.71893709897994995117f,0.69507509469985961914f,0.71787005662918090820f, +0.69617712497711181641f,0.71680128574371337891f,0.69727748632431030273f, +0.71573084592819213867f,0.69837623834609985352f,0.71465867757797241211f, +0.69947332143783569336f,0.71358484029769897461f,0.70056879520416259766f, +0.71250939369201660156f,0.70166260004043579102f,0.71143221855163574219f, +0.70275473594665527344f,0.71035337448120117188f,0.70384526252746582031f, +0.70927280187606811523f,0.70493406057357788086f,0.70819061994552612305f, +0.70602124929428100586f,0.70710676908493041992f,0.70710676908493041992f, +0.70602124929428100586f,0.70819061994552612305f,0.70493406057357788086f, +0.70927280187606811523f,0.70384526252746582031f,0.71035337448120117188f, +0.70275473594665527344f,0.71143221855163574219f,0.70166260004043579102f, +0.71250939369201660156f,0.70056879520416259766f,0.71358484029769897461f, +0.69947332143783569336f,0.71465867757797241211f,0.69837623834609985352f, +0.71573084592819213867f,0.69727748632431030273f,0.71680128574371337891f, +0.69617712497711181641f,0.71787005662918090820f,0.69507509469985961914f, +0.71893709897994995117f,0.69397145509719848633f,0.72000253200531005859f, +0.69286614656448364258f,0.72106617689132690430f,0.69175922870635986328f, +0.72212821245193481445f,0.69065070152282714844f,0.72318845987319946289f, +0.68954056501388549805f,0.72424709796905517578f,0.68842875957489013672f, +0.72530394792556762695f,0.68731534481048583984f,0.72635912895202636719f, +0.68620032072067260742f,0.72741264104843139648f,0.68508368730545043945f, +0.72846436500549316406f,0.68396538496017456055f,0.72951442003250122070f, +0.68284553289413452148f,0.73056274652481079102f,0.68172407150268554688f, +0.73160940408706665039f,0.68060100078582763672f,0.73265427350997924805f, +0.67947632074356079102f,0.73369741439819335938f,0.67835003137588500977f, +0.73473888635635375977f,0.67722219228744506836f,0.73577857017517089844f, +0.67609268426895141602f,0.73681658506393432617f,0.67496162652969360352f, +0.73785281181335449219f,0.67382901906967163086f,0.73888731002807617188f, +0.67269474267959594727f,0.73992007970809936523f,0.67155897617340087891f, +0.74095112085342407227f,0.67042154073715209961f,0.74198043346405029297f, +0.66928261518478393555f,0.74300795793533325195f,0.66814202070236206055f, +0.74403375387191772461f,0.66699993610382080078f,0.74505776166915893555f, +0.66585624217987060547f,0.74608010053634643555f,0.66471099853515625000f, +0.74710059165954589844f,0.66356414556503295898f,0.74811935424804687500f, +0.66241580247879028320f,0.74913638830184936523f,0.66126585006713867188f, +0.75015163421630859375f,0.66011434793472290039f,0.75116515159606933594f, +0.65896129608154296875f,0.75217682123184204102f,0.65780669450759887695f, +0.75318682193756103516f,0.65665054321289062500f,0.75419497489929199219f, +0.65549284219741821289f,0.75520139932632446289f,0.65433359146118164062f, +0.75620597600936889648f,0.65317285060882568359f,0.75720882415771484375f, +0.65201056003570556641f,0.75820988416671752930f,0.65084666013717651367f, +0.75920921564102172852f,0.64968132972717285156f,0.76020669937133789062f, +0.64851438999176025391f,0.76120239496231079102f,0.64734596014022827148f, +0.76219630241394042969f,0.64617604017257690430f,0.76318842172622680664f, +0.64500451087951660156f,0.76417875289916992188f,0.64383155107498168945f, +0.76516723632812500000f,0.64265704154968261719f,0.76615399122238159180f, +0.64148104190826416016f,0.76713889837265014648f,0.64030349254608154297f, +0.76812201738357543945f,0.63912445306777954102f,0.76910334825515747070f, +0.63794392347335815430f,0.77008283138275146484f,0.63676184415817260742f, +0.77106052637100219727f,0.63557833433151245117f,0.77203637361526489258f, +0.63439327478408813477f,0.77301043272018432617f,0.63320678472518920898f, +0.77398270368576049805f,0.63201874494552612305f,0.77495312690734863281f, +0.63082921504974365234f,0.77592170238494873047f,0.62963825464248657227f, +0.77688848972320556641f,0.62844574451446533203f,0.77785342931747436523f, +0.62725180387496948242f,0.77881652116775512695f,0.62605637311935424805f, +0.77977776527404785156f,0.62485951185226440430f,0.78073722124099731445f, +0.62366110086441040039f,0.78169482946395874023f,0.62246125936508178711f, +0.78265058994293212891f,0.62125998735427856445f,0.78360450267791748047f, +0.62005722522735595703f,0.78455656766891479492f,0.61885297298431396484f, +0.78550684452056884766f,0.61764729022979736328f,0.78645521402359008789f, +0.61644017696380615234f,0.78740173578262329102f,0.61523157358169555664f, +0.78834640979766845703f,0.61402153968811035156f,0.78928923606872558594f, +0.61281007528305053711f,0.79023021459579467773f,0.61159718036651611328f, +0.79116934537887573242f,0.61038279533386230469f,0.79210656881332397461f, +0.60916703939437866211f,0.79304194450378417969f,0.60794979333877563477f, +0.79397547245025634766f,0.60673111677169799805f,0.79490715265274047852f, +0.60551106929779052734f,0.79583692550659179688f,0.60428953170776367188f, +0.79676479101181030273f,0.60306662321090698242f,0.79769086837768554688f, +0.60184222459793090820f,0.79861497879028320312f,0.60061645507812500000f, +0.79953724145889282227f,0.59938931465148925781f,0.80045765638351440430f, +0.59816068410873413086f,0.80137616395950317383f,0.59693068265914916992f, +0.80229282379150390625f,0.59569931030273437500f,0.80320751667022705078f, +0.59446650743484497070f,0.80412036180496215820f,0.59323227405548095703f, +0.80503135919570922852f,0.59199666976928710938f,0.80594038963317871094f, +0.59075969457626342773f,0.80684757232666015625f,0.58952128887176513672f, +0.80775284767150878906f,0.58828157186508178711f,0.80865615606307983398f, +0.58704036474227905273f,0.80955761671066284180f,0.58579784631729125977f, +0.81045717000961303711f,0.58455395698547363281f,0.81135487556457519531f, +0.58330863714218139648f,0.81225061416625976562f,0.58206200599670410156f, +0.81314438581466674805f,0.58081394433975219727f,0.81403630971908569336f, +0.57956457138061523438f,0.81492632627487182617f,0.57831376791000366211f, +0.81581443548202514648f,0.57706165313720703125f,0.81670057773590087891f, +0.57580816745758056641f,0.81758481264114379883f,0.57455337047576904297f, +0.81846714019775390625f,0.57329714298248291016f,0.81934750080108642578f, +0.57203960418701171875f,0.82022595405578613281f,0.57078075408935546875f, +0.82110249996185302734f,0.56952053308486938477f,0.82197713851928710938f, +0.56825894117355346680f,0.82284981012344360352f,0.56699603796005249023f, +0.82372051477432250977f,0.56573182344436645508f,0.82458931207656860352f, +0.56446623802185058594f,0.82545614242553710938f,0.56319934129714965820f, +0.82632106542587280273f,0.56193113327026367188f,0.82718402147293090820f, +0.56066155433654785156f,0.82804507017135620117f,0.55939072370529174805f, +0.82890409231185913086f,0.55811852216720581055f,0.82976120710372924805f, +0.55684500932693481445f,0.83061641454696655273f,0.55557024478912353516f, +0.83146959543228149414f,0.55429410934448242188f,0.83232086896896362305f, +0.55301672220230102539f,0.83317017555236816406f,0.55173796415328979492f, +0.83401751518249511719f,0.55045795440673828125f,0.83486288785934448242f, +0.54917663335800170898f,0.83570629358291625977f,0.54789406061172485352f, +0.83654773235321044922f,0.54661017656326293945f,0.83738720417022705078f, +0.54532498121261596680f,0.83822470903396606445f,0.54403853416442871094f, +0.83906024694442749023f,0.54275077581405639648f,0.83989381790161132812f, +0.54146176576614379883f,0.84072536230087280273f,0.54017144441604614258f, +0.84155499935150146484f,0.53887993097305297852f,0.84238260984420776367f, +0.53758704662322998047f,0.84320825338363647461f,0.53629297018051147461f, +0.84403187036514282227f,0.53499764204025268555f,0.84485357999801635742f, +0.53370100259780883789f,0.84567326307296752930f,0.53240311145782470703f, +0.84649091958999633789f,0.53110402822494506836f,0.84730660915374755859f, +0.52980363368988037109f,0.84812033176422119141f,0.52850198745727539062f, +0.84893202781677246094f,0.52719914913177490234f,0.84974175691604614258f, +0.52589499950408935547f,0.85054945945739746094f,0.52458965778350830078f, +0.85135519504547119141f,0.52328312397003173828f,0.85215890407562255859f, +0.52197527885437011719f,0.85296058654785156250f,0.52066624164581298828f, +0.85376030206680297852f,0.51935601234436035156f,0.85455799102783203125f, +0.51804453134536743164f,0.85535365343093872070f,0.51673179864883422852f, +0.85614734888076782227f,0.51541787385940551758f,0.85693895816802978516f, +0.51410275697708129883f,0.85772860050201416016f,0.51278638839721679688f, +0.85851621627807617188f,0.51146882772445678711f,0.85930180549621582031f, +0.51015007495880126953f,0.86008536815643310547f,0.50883013010025024414f, +0.86086696386337280273f,0.50750899314880371094f,0.86164647340774536133f, +0.50618666410446166992f,0.86242395639419555664f,0.50486308336257934570f, +0.86319941282272338867f,0.50353837013244628906f,0.86397284269332885742f, +0.50221246480941772461f,0.86474424600601196289f,0.50088536739349365234f, +0.86551362276077270508f,0.49955710768699645996f,0.86628097295761108398f, +0.49822765588760375977f,0.86704623699188232422f,0.49689704179763793945f, +0.86780947446823120117f,0.49556526541709899902f,0.86857068538665771484f, +0.49423229694366455078f,0.86932986974716186523f,0.49289819598197937012f, +0.87008696794509887695f,0.49156290292739868164f,0.87084203958511352539f, +0.49022647738456726074f,0.87159508466720581055f,0.48888888955116271973f, +0.87234604358673095703f,0.48755016922950744629f,0.87309497594833374023f, +0.48621028661727905273f,0.87384182214736938477f,0.48486924171447753906f, +0.87458664178848266602f,0.48352706432342529297f,0.87532937526702880859f, +0.48218378424644470215f,0.87607008218765258789f,0.48083934187889099121f, +0.87680870294570922852f,0.47949376702308654785f,0.87754529714584350586f, +0.47814705967903137207f,0.87827980518341064453f,0.47679921984672546387f, +0.87901222705841064453f,0.47545027732849121094f,0.87974262237548828125f, +0.47410020232200622559f,0.88047087192535400391f,0.47274902462959289551f, +0.88119709491729736328f,0.47139674425125122070f,0.88192129135131835938f, +0.47004333138465881348f,0.88264334201812744141f,0.46868881583213806152f, +0.88336336612701416016f,0.46733319759368896484f,0.88408124446868896484f, +0.46597650647163391113f,0.88479709625244140625f,0.46461868286132812500f, +0.88551086187362670898f,0.46325978636741638184f,0.88622254133224487305f, +0.46189978718757629395f,0.88693213462829589844f,0.46053871512413024902f, +0.88763964176177978516f,0.45917654037475585938f,0.88834506273269653320f, +0.45781329274177551270f,0.88904833793640136719f,0.45644897222518920898f, +0.88974958658218383789f,0.45508357882499694824f,0.89044874906539916992f, +0.45371711254119873047f,0.89114576578140258789f,0.45234957337379455566f, +0.89184069633483886719f,0.45098099112510681152f,0.89253354072570800781f, +0.44961133599281311035f,0.89322429895401000977f,0.44824060797691345215f, +0.89391297101974487305f,0.44686883687973022461f,0.89459949731826782227f, +0.44549602270126342773f,0.89528393745422363281f,0.44412213563919067383f, +0.89596623182296752930f,0.44274723529815673828f,0.89664649963378906250f, +0.44137126207351684570f,0.89732456207275390625f,0.43999427556991577148f, +0.89800059795379638672f,0.43861624598503112793f,0.89867448806762695312f, +0.43723717331886291504f,0.89934623241424560547f,0.43585708737373352051f, +0.90001589059829711914f,0.43447595834732055664f,0.90068340301513671875f, +0.43309381604194641113f,0.90134882926940917969f,0.43171066045761108398f, +0.90201216936111450195f,0.43032649159431457520f,0.90267330408096313477f, +0.42894127964973449707f,0.90333235263824462891f,0.42755508422851562500f, +0.90398931503295898438f,0.42616787552833557129f,0.90464407205581665039f, +0.42477968335151672363f,0.90529674291610717773f,0.42339047789573669434f, +0.90594726800918579102f,0.42200025916099548340f,0.90659570693969726562f, +0.42060908675193786621f,0.90724200010299682617f,0.41921690106391906738f, +0.90788608789443969727f,0.41782370209693908691f,0.90852808952331542969f, +0.41642954945564270020f,0.90916800498962402344f,0.41503441333770751953f, +0.90980571508407592773f,0.41363832354545593262f,0.91044127941131591797f, +0.41224122047424316406f,0.91107475757598876953f,0.41084316372871398926f, +0.91170603036880493164f,0.40944415330886840820f,0.91233515739440917969f, +0.40804415941238403320f,0.91296219825744628906f,0.40664321184158325195f, +0.91358703374862670898f,0.40524131059646606445f,0.91420978307723999023f, +0.40383845567703247070f,0.91483032703399658203f,0.40243464708328247070f, +0.91544872522354125977f,0.40102988481521606445f,0.91606497764587402344f, +0.39962419867515563965f,0.91667908430099487305f,0.39821755886077880859f, +0.91729098558425903320f,0.39680999517440795898f,0.91790080070495605469f, +0.39540147781372070312f,0.91850841045379638672f,0.39399203658103942871f, +0.91911387443542480469f,0.39258167147636413574f,0.91971713304519653320f, +0.39117038249969482422f,0.92031830549240112305f,0.38975816965103149414f, +0.92091721296310424805f,0.38834503293037414551f,0.92151403427124023438f, +0.38693100214004516602f,0.92210865020751953125f,0.38551604747772216797f, +0.92270112037658691406f,0.38410019874572753906f,0.92329144477844238281f, +0.38268342614173889160f,0.92387950420379638672f,0.38126575946807861328f, +0.92446547746658325195f,0.37984719872474670410f,0.92504924535751342773f, +0.37842774391174316406f,0.92563080787658691406f,0.37700742483139038086f, +0.92621022462844848633f,0.37558618187904357910f,0.92678749561309814453f, +0.37416407465934753418f,0.92736250162124633789f,0.37274107336997985840f, +0.92793542146682739258f,0.37131720781326293945f,0.92850607633590698242f, +0.36989244818687438965f,0.92907458543777465820f,0.36846682429313659668f, +0.92964088916778564453f,0.36704033613204956055f,0.93020504713058471680f, +0.36561298370361328125f,0.93076694011688232422f,0.36418479681015014648f, +0.93132668733596801758f,0.36275571584701538086f,0.93188428878784179688f, +0.36132580041885375977f,0.93243962526321411133f,0.35989505052566528320f, +0.93299281597137451172f,0.35846340656280517578f,0.93354380130767822266f, +0.35703095793724060059f,0.93409252166748046875f,0.35559767484664916992f, +0.93463915586471557617f,0.35416352748870849609f,0.93518352508544921875f, +0.35272854566574096680f,0.93572568893432617188f,0.35129275918006896973f, +0.93626564741134643555f,0.34985613822937011719f,0.93680346012115478516f, +0.34841868281364440918f,0.93733900785446166992f,0.34698042273521423340f, +0.93787235021591186523f,0.34554132819175720215f,0.93840354681015014648f, +0.34410142898559570312f,0.93893247842788696289f,0.34266072511672973633f, +0.93945920467376708984f,0.34121921658515930176f,0.93998372554779052734f, +0.33977687358856201172f,0.94050604104995727539f,0.33833375573158264160f, +0.94102615118026733398f,0.33688986301422119141f,0.94154405593872070312f, +0.33544513583183288574f,0.94205975532531738281f,0.33399966359138488770f, +0.94257318973541259766f,0.33255335688591003418f,0.94308441877365112305f, +0.33110630512237548828f,0.94359344244003295898f,0.32965844869613647461f, +0.94410026073455810547f,0.32820984721183776855f,0.94460481405258178711f, +0.32676044106483459473f,0.94510722160339355469f,0.32531028985977172852f, +0.94560730457305908203f,0.32385936379432678223f,0.94610524177551269531f, +0.32240769267082214355f,0.94660091400146484375f,0.32095524668693542480f, +0.94709438085556030273f,0.31950202584266662598f,0.94758558273315429688f, +0.31804808974266052246f,0.94807457923889160156f,0.31659337878227233887f, +0.94856137037277221680f,0.31513792276382446289f,0.94904589653015136719f, +0.31368175148963928223f,0.94952815771102905273f,0.31222480535507202148f, +0.95000827312469482422f,0.31076714396476745605f,0.95048606395721435547f, +0.30930876731872558594f,0.95096164941787719727f,0.30784964561462402344f, +0.95143502950668334961f,0.30638980865478515625f,0.95190614461898803711f, +0.30492922663688659668f,0.95237499475479125977f,0.30346795916557312012f, +0.95284163951873779297f,0.30200594663619995117f,0.95330601930618286133f, +0.30054324865341186523f,0.95376819372177124023f,0.29907983541488647461f, +0.95422810316085815430f,0.29761570692062377930f,0.95468574762344360352f, +0.29615089297294616699f,0.95514118671417236328f,0.29468536376953125000f, +0.95559436082839965820f,0.29321914911270141602f,0.95604526996612548828f, +0.29175224900245666504f,0.95649391412734985352f,0.29028466343879699707f, +0.95694035291671752930f,0.28881642222404479980f,0.95738452672958374023f, +0.28734746575355529785f,0.95782643556594848633f,0.28587782382965087891f, +0.95826607942581176758f,0.28440752625465393066f,0.95870345830917358398f, +0.28293657302856445312f,0.95913863182067871094f,0.28146493434906005859f, +0.95957154035568237305f,0.27999264001846313477f,0.96000212430953979492f, +0.27851969003677368164f,0.96043050289154052734f,0.27704608440399169922f, +0.96085661649703979492f,0.27557182312011718750f,0.96128046512603759766f, +0.27409690618515014648f,0.96170204877853393555f,0.27262136340141296387f, +0.96212142705917358398f,0.27114516496658325195f,0.96253848075866699219f, +0.26966831088066101074f,0.96295326948165893555f,0.26819086074829101562f, +0.96336579322814941406f,0.26671275496482849121f,0.96377605199813842773f, +0.26523402333259582520f,0.96418404579162597656f,0.26375466585159301758f, +0.96458977460861206055f,0.26227471232414245605f,0.96499323844909667969f, +0.26079410314559936523f,0.96539443731307983398f,0.25931292772293090820f, +0.96579337120056152344f,0.25783109664916992188f,0.96618998050689697266f, +0.25634866952896118164f,0.96658438444137573242f,0.25486564636230468750f, +0.96697646379470825195f,0.25338202714920043945f,0.96736627817153930664f, +0.25189781188964843750f,0.96775382757186889648f,0.25041300058364868164f, +0.96813911199569702148f,0.24892760813236236572f,0.96852207183837890625f, +0.24744161963462829590f,0.96890282630920410156f,0.24595504999160766602f, +0.96928125619888305664f,0.24446789920330047607f,0.96965736150741577148f, +0.24298018217086791992f,0.97003126144409179688f,0.24149188399314880371f, +0.97040283679962158203f,0.24000301957130432129f,0.97077214717864990234f, +0.23851358890533447266f,0.97113913297653198242f,0.23702360689640045166f, +0.97150391340255737305f,0.23553305864334106445f,0.97186630964279174805f, +0.23404195904731750488f,0.97222650051116943359f,0.23255030810832977295f, +0.97258436679840087891f,0.23105810582637786865f,0.97293996810913085938f, +0.22956536710262298584f,0.97329324483871459961f,0.22807207703590393066f, +0.97364425659179687500f,0.22657826542854309082f,0.97399294376373291016f, +0.22508391737937927246f,0.97433936595916748047f,0.22358903288841247559f, +0.97468352317810058594f,0.22209362685680389404f,0.97502535581588745117f, +0.22059768438339233398f,0.97536486387252807617f,0.21910123527050018311f, +0.97570210695266723633f,0.21760427951812744141f,0.97603708505630493164f, +0.21610680222511291504f,0.97636973857879638672f,0.21460881829261779785f, +0.97670006752014160156f,0.21311031281948089600f,0.97702813148498535156f, +0.21161133050918579102f,0.97735387086868286133f,0.21011184155941009521f, +0.97767734527587890625f,0.20861184597015380859f,0.97799849510192871094f, +0.20711137354373931885f,0.97831737995147705078f,0.20561040937900543213f, +0.97863394021987915039f,0.20410896837711334229f,0.97894817590713500977f, +0.20260703563690185547f,0.97926014661788940430f,0.20110464096069335938f, +0.97956979274749755859f,0.19960175454616546631f,0.97987711429595947266f, +0.19809840619564056396f,0.98018211126327514648f,0.19659459590911865234f, +0.98048484325408935547f,0.19509032368659973145f,0.98078525066375732422f, +0.19358558952808380127f,0.98108339309692382812f,0.19208039343357086182f, +0.98137921094894409180f,0.19057475030422210693f,0.98167270421981811523f, +0.18906866014003753662f,0.98196387290954589844f,0.18756212294101715088f, +0.98225271701812744141f,0.18605515360832214355f,0.98253929615020751953f, +0.18454773724079132080f,0.98282355070114135742f,0.18303988873958587646f, +0.98310548067092895508f,0.18153160810470581055f,0.98338508605957031250f, +0.18002289533615112305f,0.98366242647171020508f,0.17851376533508300781f, +0.98393744230270385742f,0.17700421810150146484f,0.98421007394790649414f, +0.17549425363540649414f,0.98448044061660766602f,0.17398387193679809570f, +0.98474848270416259766f,0.17247308790683746338f,0.98501425981521606445f, +0.17096188664436340332f,0.98527765274047851562f,0.16945029795169830322f, +0.98553872108459472656f,0.16793829202651977539f,0.98579752445220947266f, +0.16642589867115020752f,0.98605394363403320312f,0.16491311788558959961f, +0.98630809783935546875f,0.16339994966983795166f,0.98655992746353149414f, +0.16188639402389526367f,0.98680937290191650391f,0.16037245094776153564f, +0.98705655336380004883f,0.15885815024375915527f,0.98730140924453735352f, +0.15734346210956573486f,0.98754394054412841797f,0.15582840144634246826f, +0.98778414726257324219f,0.15431296825408935547f,0.98802202939987182617f, +0.15279719233512878418f,0.98825758695602416992f,0.15128104388713836670f, +0.98849081993103027344f,0.14976453781127929688f,0.98872166872024536133f, +0.14824767410755157471f,0.98895025253295898438f,0.14673046767711639404f, +0.98917651176452636719f,0.14521291851997375488f,0.98940044641494750977f, +0.14369502663612365723f,0.98962199687957763672f,0.14217680692672729492f, +0.98984128236770629883f,0.14065824449062347412f,0.99005818367004394531f, +0.13913933932781219482f,0.99027281999588012695f,0.13762012124061584473f, +0.99048507213592529297f,0.13610057532787322998f,0.99069499969482421875f, +0.13458070158958435059f,0.99090266227722167969f,0.13306052982807159424f, +0.99110794067382812500f,0.13154003024101257324f,0.99131083488464355469f, +0.13001921772956848145f,0.99151146411895751953f,0.12849810719490051270f, +0.99170976877212524414f,0.12697669863700866699f,0.99190568923950195312f, +0.12545497715473175049f,0.99209928512573242188f,0.12393297255039215088f, +0.99229061603546142578f,0.12241067737340927124f,0.99247956275939941406f, +0.12088808417320251465f,0.99266612529754638672f,0.11936521530151367188f, +0.99285042285919189453f,0.11784206330776214600f,0.99303233623504638672f, +0.11631862819194793701f,0.99321192502975463867f,0.11479492485523223877f, +0.99338918924331665039f,0.11327095329761505127f,0.99356412887573242188f, +0.11174671351909637451f,0.99373674392700195312f,0.11022220551967620850f, +0.99390697479248046875f,0.10869744420051574707f,0.99407488107681274414f, +0.10717242211103439331f,0.99424046277999877930f,0.10564715415239334106f, +0.99440366029739379883f,0.10412163287401199341f,0.99456459283828735352f, +0.10259586572647094727f,0.99472314119338989258f,0.10106986016035079956f, +0.99487930536270141602f,0.09954361617565155029f,0.99503320455551147461f, +0.09801714122295379639f,0.99518471956253051758f,0.09649042785167694092f, +0.99533390998840332031f,0.09496349841356277466f,0.99548077583312988281f, +0.09343633800745010376f,0.99562525749206542969f,0.09190895408391952515f, +0.99576741456985473633f,0.09038136154413223267f,0.99590724706649780273f, +0.08885355293750762939f,0.99604469537734985352f,0.08732553571462631226f, +0.99617981910705566406f,0.08579730987548828125f,0.99631261825561523438f, +0.08426889032125473022f,0.99644303321838378906f,0.08274026215076446533f, +0.99657112360000610352f,0.08121144771575927734f,0.99669688940048217773f, +0.07968243956565856934f,0.99682027101516723633f,0.07815324515104293823f, +0.99694132804870605469f,0.07662386447191238403f,0.99706006050109863281f, +0.07509429752826690674f,0.99717640876770019531f,0.07356456667184829712f, +0.99729043245315551758f,0.07203464955091476440f,0.99740213155746459961f, +0.07050457596778869629f,0.99751144647598266602f,0.06897433102130889893f, +0.99761843681335449219f,0.06744392216205596924f,0.99772304296493530273f, +0.06591334939002990723f,0.99782532453536987305f,0.06438262760639190674f, +0.99792528152465820312f,0.06285175681114196777f,0.99802285432815551758f, +0.06132073700428009033f,0.99811810255050659180f,0.05978957191109657288f, +0.99821102619171142578f,0.05825826525688171387f,0.99830156564712524414f, +0.05672682076692581177f,0.99838972091674804688f,0.05519524589180946350f, +0.99847555160522460938f,0.05366353690624237061f,0.99855905771255493164f, +0.05213170498609542847f,0.99864023923873901367f,0.05059975013136863708f, +0.99871903657913208008f,0.04906767606735229492f,0.99879544973373413086f, +0.04753548279404640198f,0.99886953830718994141f,0.04600318148732185364f, +0.99894130229949951172f,0.04447077214717864990f,0.99901068210601806641f, +0.04293825849890708923f,0.99907773733139038086f,0.04140564054250717163f, +0.99914240837097167969f,0.03987292572855949402f,0.99920475482940673828f, +0.03834012150764465332f,0.99926477670669555664f,0.03680722415447235107f, +0.99932235479354858398f,0.03527423739433288574f,0.99937766790390014648f, +0.03374117240309715271f,0.99943059682846069336f,0.03220802545547485352f, +0.99948120117187500000f,0.03067480400204658508f,0.99952942132949829102f, +0.02914150804281234741f,0.99957531690597534180f,0.02760814502835273743f, +0.99961882829666137695f,0.02607471868395805359f,0.99966001510620117188f, +0.02454122900962829590f,0.99969881772994995117f,0.02300768159329891205f, +0.99973529577255249023f,0.02147408016026020050f,0.99976938962936401367f, +0.01994042843580245972f,0.99980115890502929688f,0.01840673014521598816f, +0.99983060359954833984f,0.01687298715114593506f,0.99985766410827636719f, +0.01533920597285032272f,0.99988234043121337891f,0.01380538847297430038f, +0.99990469217300415039f,0.01227153837680816650f,0.99992471933364868164f, +0.01073765940964221954f,0.99994236230850219727f,0.00920375436544418335f, +0.99995762109756469727f,0.00766982883214950562f,0.99997061491012573242f, +0.00613588467240333557f,0.99998116493225097656f,0.00460192607715725899f, +0.99998939037322998047f,0.00306795677170157433f,0.99999529123306274414f, +0.00153398013208061457f,0.99999880790710449219f,1.00000000000000000000f, +0.00000000000000000000f,0.99998116493225097656f,0.00613588467240333557f, +0.99992471933364868164f,0.01227153837680816650f,0.99983060359954833984f, +0.01840673014521598816f,0.99969881772994995117f,0.02454122900962829590f, +0.99952942132949829102f,0.03067480400204658508f,0.99932235479354858398f, +0.03680722415447235107f,0.99907773733139038086f,0.04293825849890708923f, +0.99879544973373413086f,0.04906767606735229492f,0.99847555160522460938f, +0.05519524589180946350f,0.99811810255050659180f,0.06132073700428009033f, +0.99772304296493530273f,0.06744392216205596924f,0.99729043245315551758f, +0.07356456667184829712f,0.99682027101516723633f,0.07968243956565856934f, +0.99631261825561523438f,0.08579730987548828125f,0.99576741456985473633f, +0.09190895408391952515f,0.99518471956253051758f,0.09801714122295379639f, +0.99456459283828735352f,0.10412163287401199341f,0.99390697479248046875f, +0.11022220551967620850f,0.99321192502975463867f,0.11631862819194793701f, +0.99247956275939941406f,0.12241067737340927124f,0.99170976877212524414f, +0.12849810719490051270f,0.99090266227722167969f,0.13458070158958435059f, +0.99005818367004394531f,0.14065824449062347412f,0.98917651176452636719f, +0.14673046767711639404f,0.98825758695602416992f,0.15279719233512878418f, +0.98730140924453735352f,0.15885815024375915527f,0.98630809783935546875f, +0.16491311788558959961f,0.98527765274047851562f,0.17096188664436340332f, +0.98421007394790649414f,0.17700421810150146484f,0.98310548067092895508f, +0.18303988873958587646f,0.98196387290954589844f,0.18906866014003753662f, +0.98078525066375732422f,0.19509032368659973145f,0.97956979274749755859f, +0.20110464096069335938f,0.97831737995147705078f,0.20711137354373931885f, +0.97702813148498535156f,0.21311031281948089600f,0.97570210695266723633f, +0.21910123527050018311f,0.97433936595916748047f,0.22508391737937927246f, +0.97293996810913085938f,0.23105810582637786865f,0.97150391340255737305f, +0.23702360689640045166f,0.97003126144409179688f,0.24298018217086791992f, +0.96852207183837890625f,0.24892760813236236572f,0.96697646379470825195f, +0.25486564636230468750f,0.96539443731307983398f,0.26079410314559936523f, +0.96377605199813842773f,0.26671275496482849121f,0.96212142705917358398f, +0.27262136340141296387f,0.96043050289154052734f,0.27851969003677368164f, +0.95870345830917358398f,0.28440752625465393066f,0.95694035291671752930f, +0.29028466343879699707f,0.95514118671417236328f,0.29615089297294616699f, +0.95330601930618286133f,0.30200594663619995117f,0.95143502950668334961f, +0.30784964561462402344f,0.94952815771102905273f,0.31368175148963928223f, +0.94758558273315429688f,0.31950202584266662598f,0.94560730457305908203f, +0.32531028985977172852f,0.94359344244003295898f,0.33110630512237548828f, +0.94154405593872070312f,0.33688986301422119141f,0.93945920467376708984f, +0.34266072511672973633f,0.93733900785446166992f,0.34841868281364440918f, +0.93518352508544921875f,0.35416352748870849609f,0.93299281597137451172f, +0.35989505052566528320f,0.93076694011688232422f,0.36561298370361328125f, +0.92850607633590698242f,0.37131720781326293945f,0.92621022462844848633f, +0.37700742483139038086f,0.92387950420379638672f,0.38268342614173889160f, +0.92151403427124023438f,0.38834503293037414551f,0.91911387443542480469f, +0.39399203658103942871f,0.91667908430099487305f,0.39962419867515563965f, +0.91420978307723999023f,0.40524131059646606445f,0.91170603036880493164f, +0.41084316372871398926f,0.90916800498962402344f,0.41642954945564270020f, +0.90659570693969726562f,0.42200025916099548340f,0.90398931503295898438f, +0.42755508422851562500f,0.90134882926940917969f,0.43309381604194641113f, +0.89867448806762695312f,0.43861624598503112793f,0.89596623182296752930f, +0.44412213563919067383f,0.89322429895401000977f,0.44961133599281311035f, +0.89044874906539916992f,0.45508357882499694824f,0.88763964176177978516f, +0.46053871512413024902f,0.88479709625244140625f,0.46597650647163391113f, +0.88192129135131835938f,0.47139674425125122070f,0.87901222705841064453f, +0.47679921984672546387f,0.87607008218765258789f,0.48218378424644470215f, +0.87309497594833374023f,0.48755016922950744629f,0.87008696794509887695f, +0.49289819598197937012f,0.86704623699188232422f,0.49822765588760375977f, +0.86397284269332885742f,0.50353837013244628906f,0.86086696386337280273f, +0.50883013010025024414f,0.85772860050201416016f,0.51410275697708129883f, +0.85455799102783203125f,0.51935601234436035156f,0.85135519504547119141f, +0.52458965778350830078f,0.84812033176422119141f,0.52980363368988037109f, +0.84485357999801635742f,0.53499764204025268555f,0.84155499935150146484f, +0.54017144441604614258f,0.83822470903396606445f,0.54532498121261596680f, +0.83486288785934448242f,0.55045795440673828125f,0.83146959543228149414f, +0.55557024478912353516f,0.82804507017135620117f,0.56066155433654785156f, +0.82458931207656860352f,0.56573182344436645508f,0.82110249996185302734f, +0.57078075408935546875f,0.81758481264114379883f,0.57580816745758056641f, +0.81403630971908569336f,0.58081394433975219727f,0.81045717000961303711f, +0.58579784631729125977f,0.80684757232666015625f,0.59075969457626342773f, +0.80320751667022705078f,0.59569931030273437500f,0.79953724145889282227f, +0.60061645507812500000f,0.79583692550659179688f,0.60551106929779052734f, +0.79210656881332397461f,0.61038279533386230469f,0.78834640979766845703f, +0.61523157358169555664f,0.78455656766891479492f,0.62005722522735595703f, +0.78073722124099731445f,0.62485951185226440430f,0.77688848972320556641f, +0.62963825464248657227f,0.77301043272018432617f,0.63439327478408813477f, +0.76910334825515747070f,0.63912445306777954102f,0.76516723632812500000f, +0.64383155107498168945f,0.76120239496231079102f,0.64851438999176025391f, +0.75720882415771484375f,0.65317285060882568359f,0.75318682193756103516f, +0.65780669450759887695f,0.74913638830184936523f,0.66241580247879028320f, +0.74505776166915893555f,0.66699993610382080078f,0.74095112085342407227f, +0.67155897617340087891f,0.73681658506393432617f,0.67609268426895141602f, +0.73265427350997924805f,0.68060100078582763672f,0.72846436500549316406f, +0.68508368730545043945f,0.72424709796905517578f,0.68954056501388549805f, +0.72000253200531005859f,0.69397145509719848633f,0.71573084592819213867f, +0.69837623834609985352f,0.71143221855163574219f,0.70275473594665527344f, +0.70710676908493041992f,0.70710676908493041992f,0.70275473594665527344f, +0.71143221855163574219f,0.69837623834609985352f,0.71573084592819213867f, +0.69397145509719848633f,0.72000253200531005859f,0.68954056501388549805f, +0.72424709796905517578f,0.68508368730545043945f,0.72846436500549316406f, +0.68060100078582763672f,0.73265427350997924805f,0.67609268426895141602f, +0.73681658506393432617f,0.67155897617340087891f,0.74095112085342407227f, +0.66699993610382080078f,0.74505776166915893555f,0.66241580247879028320f, +0.74913638830184936523f,0.65780669450759887695f,0.75318682193756103516f, +0.65317285060882568359f,0.75720882415771484375f,0.64851438999176025391f, +0.76120239496231079102f,0.64383155107498168945f,0.76516723632812500000f, +0.63912445306777954102f,0.76910334825515747070f,0.63439327478408813477f, +0.77301043272018432617f,0.62963825464248657227f,0.77688848972320556641f, +0.62485951185226440430f,0.78073722124099731445f,0.62005722522735595703f, +0.78455656766891479492f,0.61523157358169555664f,0.78834640979766845703f, +0.61038279533386230469f,0.79210656881332397461f,0.60551106929779052734f, +0.79583692550659179688f,0.60061645507812500000f,0.79953724145889282227f, +0.59569931030273437500f,0.80320751667022705078f,0.59075969457626342773f, +0.80684757232666015625f,0.58579784631729125977f,0.81045717000961303711f, +0.58081394433975219727f,0.81403630971908569336f,0.57580816745758056641f, +0.81758481264114379883f,0.57078075408935546875f,0.82110249996185302734f, +0.56573182344436645508f,0.82458931207656860352f,0.56066155433654785156f, +0.82804507017135620117f,0.55557024478912353516f,0.83146959543228149414f, +0.55045795440673828125f,0.83486288785934448242f,0.54532498121261596680f, +0.83822470903396606445f,0.54017144441604614258f,0.84155499935150146484f, +0.53499764204025268555f,0.84485357999801635742f,0.52980363368988037109f, +0.84812033176422119141f,0.52458965778350830078f,0.85135519504547119141f, +0.51935601234436035156f,0.85455799102783203125f,0.51410275697708129883f, +0.85772860050201416016f,0.50883013010025024414f,0.86086696386337280273f, +0.50353837013244628906f,0.86397284269332885742f,0.49822765588760375977f, +0.86704623699188232422f,0.49289819598197937012f,0.87008696794509887695f, +0.48755016922950744629f,0.87309497594833374023f,0.48218378424644470215f, +0.87607008218765258789f,0.47679921984672546387f,0.87901222705841064453f, +0.47139674425125122070f,0.88192129135131835938f,0.46597650647163391113f, +0.88479709625244140625f,0.46053871512413024902f,0.88763964176177978516f, +0.45508357882499694824f,0.89044874906539916992f,0.44961133599281311035f, +0.89322429895401000977f,0.44412213563919067383f,0.89596623182296752930f, +0.43861624598503112793f,0.89867448806762695312f,0.43309381604194641113f, +0.90134882926940917969f,0.42755508422851562500f,0.90398931503295898438f, +0.42200025916099548340f,0.90659570693969726562f,0.41642954945564270020f, +0.90916800498962402344f,0.41084316372871398926f,0.91170603036880493164f, +0.40524131059646606445f,0.91420978307723999023f,0.39962419867515563965f, +0.91667908430099487305f,0.39399203658103942871f,0.91911387443542480469f, +0.38834503293037414551f,0.92151403427124023438f,0.38268342614173889160f, +0.92387950420379638672f,0.37700742483139038086f,0.92621022462844848633f, +0.37131720781326293945f,0.92850607633590698242f,0.36561298370361328125f, +0.93076694011688232422f,0.35989505052566528320f,0.93299281597137451172f, +0.35416352748870849609f,0.93518352508544921875f,0.34841868281364440918f, +0.93733900785446166992f,0.34266072511672973633f,0.93945920467376708984f, +0.33688986301422119141f,0.94154405593872070312f,0.33110630512237548828f, +0.94359344244003295898f,0.32531028985977172852f,0.94560730457305908203f, +0.31950202584266662598f,0.94758558273315429688f,0.31368175148963928223f, +0.94952815771102905273f,0.30784964561462402344f,0.95143502950668334961f, +0.30200594663619995117f,0.95330601930618286133f,0.29615089297294616699f, +0.95514118671417236328f,0.29028466343879699707f,0.95694035291671752930f, +0.28440752625465393066f,0.95870345830917358398f,0.27851969003677368164f, +0.96043050289154052734f,0.27262136340141296387f,0.96212142705917358398f, +0.26671275496482849121f,0.96377605199813842773f,0.26079410314559936523f, +0.96539443731307983398f,0.25486564636230468750f,0.96697646379470825195f, +0.24892760813236236572f,0.96852207183837890625f,0.24298018217086791992f, +0.97003126144409179688f,0.23702360689640045166f,0.97150391340255737305f, +0.23105810582637786865f,0.97293996810913085938f,0.22508391737937927246f, +0.97433936595916748047f,0.21910123527050018311f,0.97570210695266723633f, +0.21311031281948089600f,0.97702813148498535156f,0.20711137354373931885f, +0.97831737995147705078f,0.20110464096069335938f,0.97956979274749755859f, +0.19509032368659973145f,0.98078525066375732422f,0.18906866014003753662f, +0.98196387290954589844f,0.18303988873958587646f,0.98310548067092895508f, +0.17700421810150146484f,0.98421007394790649414f,0.17096188664436340332f, +0.98527765274047851562f,0.16491311788558959961f,0.98630809783935546875f, +0.15885815024375915527f,0.98730140924453735352f,0.15279719233512878418f, +0.98825758695602416992f,0.14673046767711639404f,0.98917651176452636719f, +0.14065824449062347412f,0.99005818367004394531f,0.13458070158958435059f, +0.99090266227722167969f,0.12849810719490051270f,0.99170976877212524414f, +0.12241067737340927124f,0.99247956275939941406f,0.11631862819194793701f, +0.99321192502975463867f,0.11022220551967620850f,0.99390697479248046875f, +0.10412163287401199341f,0.99456459283828735352f,0.09801714122295379639f, +0.99518471956253051758f,0.09190895408391952515f,0.99576741456985473633f, +0.08579730987548828125f,0.99631261825561523438f,0.07968243956565856934f, +0.99682027101516723633f,0.07356456667184829712f,0.99729043245315551758f, +0.06744392216205596924f,0.99772304296493530273f,0.06132073700428009033f, +0.99811810255050659180f,0.05519524589180946350f,0.99847555160522460938f, +0.04906767606735229492f,0.99879544973373413086f,0.04293825849890708923f, +0.99907773733139038086f,0.03680722415447235107f,0.99932235479354858398f, +0.03067480400204658508f,0.99952942132949829102f,0.02454122900962829590f, +0.99969881772994995117f,0.01840673014521598816f,0.99983060359954833984f, +0.01227153837680816650f,0.99992471933364868164f,0.00613588467240333557f, +0.99998116493225097656f,1.00000000000000000000f,0.00000000000000000000f, +0.99969881772994995117f,0.02454122900962829590f,0.99879544973373413086f, +0.04906767606735229492f,0.99729043245315551758f,0.07356456667184829712f, +0.99518471956253051758f,0.09801714122295379639f,0.99247956275939941406f, +0.12241067737340927124f,0.98917651176452636719f,0.14673046767711639404f, +0.98527765274047851562f,0.17096188664436340332f,0.98078525066375732422f, +0.19509032368659973145f,0.97570210695266723633f,0.21910123527050018311f, +0.97003126144409179688f,0.24298018217086791992f,0.96377605199813842773f, +0.26671275496482849121f,0.95694035291671752930f,0.29028466343879699707f, +0.94952815771102905273f,0.31368175148963928223f,0.94154405593872070312f, +0.33688986301422119141f,0.93299281597137451172f,0.35989505052566528320f, +0.92387950420379638672f,0.38268342614173889160f,0.91420978307723999023f, +0.40524131059646606445f,0.90398931503295898438f,0.42755508422851562500f, +0.89322429895401000977f,0.44961133599281311035f,0.88192129135131835938f, +0.47139674425125122070f,0.87008696794509887695f,0.49289819598197937012f, +0.85772860050201416016f,0.51410275697708129883f,0.84485357999801635742f, +0.53499764204025268555f,0.83146959543228149414f,0.55557024478912353516f, +0.81758481264114379883f,0.57580816745758056641f,0.80320751667022705078f, +0.59569931030273437500f,0.78834640979766845703f,0.61523157358169555664f, +0.77301043272018432617f,0.63439327478408813477f,0.75720882415771484375f, +0.65317285060882568359f,0.74095112085342407227f,0.67155897617340087891f, +0.72424709796905517578f,0.68954056501388549805f,0.70710676908493041992f, +0.70710676908493041992f,0.68954056501388549805f,0.72424709796905517578f, +0.67155897617340087891f,0.74095112085342407227f,0.65317285060882568359f, +0.75720882415771484375f,0.63439327478408813477f,0.77301043272018432617f, +0.61523157358169555664f,0.78834640979766845703f,0.59569931030273437500f, +0.80320751667022705078f,0.57580816745758056641f,0.81758481264114379883f, +0.55557024478912353516f,0.83146959543228149414f,0.53499764204025268555f, +0.84485357999801635742f,0.51410275697708129883f,0.85772860050201416016f, +0.49289819598197937012f,0.87008696794509887695f,0.47139674425125122070f, +0.88192129135131835938f,0.44961133599281311035f,0.89322429895401000977f, +0.42755508422851562500f,0.90398931503295898438f,0.40524131059646606445f, +0.91420978307723999023f,0.38268342614173889160f,0.92387950420379638672f, +0.35989505052566528320f,0.93299281597137451172f,0.33688986301422119141f, +0.94154405593872070312f,0.31368175148963928223f,0.94952815771102905273f, +0.29028466343879699707f,0.95694035291671752930f,0.26671275496482849121f, +0.96377605199813842773f,0.24298018217086791992f,0.97003126144409179688f, +0.21910123527050018311f,0.97570210695266723633f,0.19509032368659973145f, +0.98078525066375732422f,0.17096188664436340332f,0.98527765274047851562f, +0.14673046767711639404f,0.98917651176452636719f,0.12241067737340927124f, +0.99247956275939941406f,0.09801714122295379639f,0.99518471956253051758f, +0.07356456667184829712f,0.99729043245315551758f,0.04906767606735229492f, +0.99879544973373413086f,0.02454122900962829590f,0.99969881772994995117f, +1.00000000000000000000f,0.00000000000000000000f,0.99518471956253051758f, +0.09801714122295379639f,0.98078525066375732422f,0.19509032368659973145f, +0.95694035291671752930f,0.29028466343879699707f,0.92387950420379638672f, +0.38268342614173889160f,0.88192129135131835938f,0.47139674425125122070f, +0.83146959543228149414f,0.55557024478912353516f,0.77301043272018432617f, +0.63439327478408813477f,0.70710676908493041992f,0.70710676908493041992f, +0.63439327478408813477f,0.77301043272018432617f,0.55557024478912353516f, +0.83146959543228149414f,0.47139674425125122070f,0.88192129135131835938f, +0.38268342614173889160f,0.92387950420379638672f,0.29028466343879699707f, +0.95694035291671752930f,0.19509032368659973145f,0.98078525066375732422f, +0.09801714122295379639f,0.99518471956253051758f,1.00000000000000000000f, +0.00000000000000000000f,0.92387950420379638672f,0.38268342614173889160f, +0.70710676908493041992f,0.70710676908493041992f,0.38268342614173889160f, +0.92387950420379638672f,}; float32_t rearranged_twiddle_stride2_4096_f32[2728]={ -1.00000000000000000000f,0.00000000000000000000f,0.99999529380957619118f, -0.00306795676296597614f,0.99998117528260110909f,0.00613588464915447527f, -0.99995764455196389786f,0.00920375478205981944f,0.99992470183914450299f, -0.01227153828571992539f,0.99988234745421256111f,0.01533920628498810015f, -0.99983058179582340319f,0.01840672990580482019f,0.99976940535121527898f, -0.02147408027546950787f,0.99969881869620424997f,0.02454122852291228812f, -0.99961882249517863830f,0.02760814577896573974f,0.99952941750109314256f, -0.03067480317663662595f,0.99943060455546173237f,0.03374117185137757990f, -0.99932238458834954375f,0.03680722294135883171f,0.99920475861836388631f, -0.03987292758773981066f,0.99907772775264536147f,0.04293825693494082024f, -0.99894129318685687124f,0.04600318213091462299f,0.99879545620517240501f, -0.04906767432741801493f,0.99864021818026527111f,0.05213170468028332366f, -0.99847558057329477421f,0.05519524434968993420f,0.99830154493389289261f, -0.05825826450043575244f,0.99811811290014917919f,0.06132073630220857829f, -0.99792528619859599548f,0.06438263092985746505f,0.99772306664419163624f, -0.06744391956366405094f,0.99751145614030345410f,0.07050457338961385600f, -0.99729045667869020697f,0.07356456359966742631f,0.99706007033948296225f, -0.07662386139203149205f,0.99682029929116566791f,0.07968243797143012563f, -0.99657114579055483539f,0.08274026454937569164f,0.99631261218277800129f, -0.08579731234443989385f,0.99604470090125196702f,0.08885355258252460031f, -0.99576741446765981713f,0.09190895649713272386f,0.99548075549192693856f, -0.09496349532963899165f,0.99518472667219692873f,0.09801714032956060363f, -0.99487933079480561638f,0.10106986275482782167f,0.99456457073425541537f, -0.10412163387205458642f,0.99424044945318790223f,0.10717242495680884273f, -0.99390697000235606051f,0.11022220729388305938f,0.99356413552059530403f, -0.11327095217756434631f,0.99321194923479450001f,0.11631863091190475235f, -0.99285041445986510489f,0.11936521481099135467f,0.99247953459870996706f, -0.12241067519921619566f,0.99209931314219179654f,0.12545498341154623367f, -0.99170975366909952520f,0.12849811079379316880f,0.99131085984611544415f, -0.13154002870288311611f,0.99090263542778000971f,0.13458070850712616773f, -0.99048508425645709341f,0.13762012158648603832f,0.99005821026229712256f, -0.14065823933284921088f,0.98962201746320088702f,0.14369503315029447110f, -0.98917650996478101444f,0.14673047445536174793f,0.98872169196032377858f, -0.14976453467732150915f,0.98825756773074946437f,0.15279718525844343535f, -0.98778414164457217783f,0.15582839765426523271f,0.98730141815785843473f, -0.15885814333386144570f,0.98680940181418552726f,0.16188639378011182579f, -0.98630809724459866938f,0.16491312048996989437f,0.98579750916756747614f, -0.16793829497473117263f,0.98527764238894122162f,0.17096188876030121717f, -0.98474850180190420801f,0.17398387338746382214f,0.98421009238692902521f, -0.17700422041214874946f,0.98366241921173025453f,0.18002290140569951471f, -0.98310548743121628501f,0.18303988795514095078f,0.98253930228744124076f, -0.18605515166344663291f,0.98196386910955524296f,0.18906866414980619262f, -0.98137919331375456089f,0.19208039704989243734f,0.98078528040323043058f, -0.19509032201612824808f,0.98018213596811742949f,0.19809841071795356027f, -0.97956976568544051887f,0.20110463484209190055f,0.97894817531906219710f, -0.20410896609281686809f,0.97831737071962765473f,0.20711137619221856032f, -0.97767735782450992943f,0.21011183688046961016f,0.97702814265775439484f, -0.21311031991609136194f,0.97636973133002114000f,0.21610679707621952006f, -0.97570213003852857003f,0.21910124015686979759f,0.97502534506699412020f, -0.22209362097320350937f,0.97433938278557585821f,0.22508391135979283204f, -0.97364424965081197705f,0.22807208317088573102f,0.97293995220556017678f, -0.23105810828067110951f,0.97222649707893626925f,0.23404195858354343018f, -0.97150389098625178352f,0.23702360599436719801f,0.97077214072895035013f, -0.24000302244874149871f,0.97003125319454397424f,0.24298017990326387094f, -0.96928123535654853171f,0.24595505033579459497f,0.96852209427441737777f, -0.24892760574572014853f,0.96775383709347551076f,0.25189781815421696809f, -0.96697647104485207059f,0.25486565960451457169f,0.96619000344541250413f, -0.25783110216215898713f,0.96539444169768939830f,0.26079411791527551401f, -0.96458979328981275803f,0.26375467897483134694f,0.96377606579543984022f, -0.26671275747489836538f,0.96295326687368387741f,0.26966832557291509076f, -0.96212140426904158019f,0.27262135544994897662f,0.96128048581132063966f, -0.27557181931095814376f,0.96043051941556578655f,0.27851968938505305973f, -0.95957151308198451733f,0.28146493792575794091f,0.95870347489587159906f, -0.28440753721127187692f,0.95782641302753290802f,0.28734745954472951102f, -0.95694033573220882438f,0.29028467725446233105f,0.95604525134999640557f, -0.29321916269425862822f,0.95514116830577078243f,0.29615088824362378883f, -0.95422809510910566733f,0.29907982630804047508f,0.95330604035419386211f, -0.30200594931922808417f,0.95237501271976587880f,0.30492922973540237397f, -0.95143502096900833820f,0.30784964004153486661f,0.95048607394948170235f, -0.31076715274961147495f,0.94952818059303667475f,0.31368174039889151761f, -0.94856134991573026749f,0.31659337555616584581f,0.94758559101774109124f, -0.31950203081601569188f,0.94660091308328353499f,0.32240767880106985244f, -0.94560732538052127971f,0.32531029216226292622f,0.94460483726148025685f, -0.32820984357909249729f,0.94359345816196038559f,0.33110630575987642921f, -0.94257319760144686605f,0.33399965144200938205f,0.94154406518302080631f, -0.33688985339222005111f,0.94050607059326829518f,0.33977688440682685123f, -0.93945922360218991898f,0.34266071731199437833f,0.93840353406310805795f, -0.34554132496398909380f,0.93733901191257495977f,0.34841868024943456472f, -0.93626566717027825959f,0.35129275608556709276f,0.93518350993894761025f, -0.35416352542049034380f,0.93409255040425887007f,0.35703096123342997759f, -0.93299279883473895669f,0.35989503653498811087f,0.93188426558166814750f, -0.36275572436739722537f,0.93076696107898371224f,0.36561299780477385379f, -0.92964089584318121418f,0.36846682995337232125f,0.92850608047321558924f, -0.37131719395183754306f,0.92736252565040111495f,0.37416406297145793358f, -0.92621024213831137928f,0.37700741021641825945f,0.92504924078267758425f, -0.37984720892405116066f,0.92387953251128673848f,0.38268343236508978178f, -0.92270112833387862850f,0.38551605384391884890f,0.92151403934204190183f, -0.38834504669882624617f,0.92031827670911059425f,0.39117038430225387069f, -0.91911385169005777040f,0.39399204006104809883f,0.91790077562139049672f, -0.39680998741671030805f,0.91667905992104270485f,0.39962419984564678810f, -0.91544871608826783316f,0.40243465085941843018f,0.91420975570353069095f, -0.40524131400498986100f,0.91296219042839821256f,0.40804416286497868782f, -0.91170603200542987832f,0.41084317105790391089f,0.91044129225806724737f, -0.41363831223843450235f,0.90916798309052238025f,0.41642956009763715253f, -0.90788611648766626150f,0.41921688836322390515f,0.90659570451491533483f, -0.42200027079979968159f,0.90529675931811881551f,0.42477968120910880589f, -0.90398929312344333820f,0.42755509343028208491f,0.90267331823725882600f, -0.43032648134008261165f,0.90134884704602202810f,0.43309381885315195726f, -0.90001589201616016833f,0.43585707992225547480f,0.89867446569395381673f, -0.43861623853852765853f,0.89732458070541831763f,0.44137126873171667052f, -0.89596624975618521791f,0.44412214457042920035f,0.89459948563138269595f, -0.44686884016237415906f,0.89322430119551532446f,0.44961132965460653965f, -0.89184070939234272313f,0.45234958723377088896f,0.89044872324475787817f, -0.45508358712634383592f,0.88904835585466457371f,0.45781330359887717485f, -0.88763962040285393496f,0.46053871095824000514f,0.88622253014888063838f, -0.46325978355186014923f,0.88479709843093778954f,0.46597649576796618121f, -0.88336333866573157891f,0.46868882203582790114f,0.88192126434835504956f, -0.47139673682599764204f,0.88047088905216075450f,0.47410021465054996703f, -0.87901222642863352519f,0.47679923006332208812f,0.87754529020726135258f, -0.47949375766015295275f,0.87607009419540660122f,0.48218377207912271887f, -0.87458665227817611321f,0.48486924800079106435f,0.87309497841829009079f, -0.48755016014843599592f,0.87159508665595097909f,0.49022648328829115938f, -0.87008699110871146054f,0.49289819222978403790f,0.86857070597134089507f, -0.49556526182577254058f,0.86704624551569264845f,0.49822766697278181303f, -0.86551362409056908920f,0.50088538261124071482f,0.86397285612158669643f, -0.50353838372571757542f,0.86242395611104050168f,0.50618664534515522835f, -0.86086693863776730939f,0.50883014254310698909f,0.85930181835700847337f, -0.51146885043797030157f,0.85772861000027211809f,0.51410274419322166128f, -0.85614732837519447184f,0.51673179901764987321f,0.85455798836540053376f, -0.51935599016558964269f,0.85296060493036363059f,0.52197529293715438925f, -0.85135519310526519554f,0.52458968267846894928f,0.84974176800085254868f, -0.52719913478190127964f,0.84812034480329723252f,0.52980362468629460526f, -0.84649093877405212627f,0.53240312787719790144f,0.84485356524970711689f, -0.53499761988709715332f,0.84320823964184543620f,0.53758707629564539410f, -0.84155497743689844370f,0.54017147272989285423f,0.83989379419599952126f, -0.54275078486451588944f,0.83822470555483807875f,0.54532498842204646383f, -0.83654772722351200542f,0.54789405917310018967f,0.83486287498638001026f, -0.55045797293660481131f,0.83317016470191318511f,0.55301670558002746780f, -0.83146961230254523567f,0.55557023301960217765f,0.82976123379452304540f, -0.55811853122055610221f,0.82804504525775579626f,0.56066157619733603124f, -0.82632106284566353427f,0.56319934401383409117f,0.82458930278502529099f, -0.56573181078361312046f,0.82284978137582642788f,0.56825895267013148970f, -0.82110251499110464835f,0.57078074588696725566f,0.81934752007679700903f, -0.57329716669804220430f,0.81758481315158371139f,0.57580819141784533866f, -0.81581441080673378075f,0.57831379641165558958f,0.81403632970594841378f, -0.58081395809576452649f,0.81225058658520399302f,0.58330865293769829094f, -0.81045719825259476821f,0.58579785745643886408f,0.80865618158817498262f, -0.58828154822264522306f,0.80684755354379933401f,0.59075970185887416442f, -0.80503133114296365758f,0.59323229503979979516f,0.80320753148064494287f, -0.59569930449243335691f,0.80137617172314024039f,0.59816070699634238395f, -0.79953726910790501314f,0.60061647938386897305f,0.79769084094339115509f, -0.60306659854034816437f,0.79583690460888356633f,0.60551104140432554512f, -0.79397547755433717231f,0.60794978496777363208f,0.79210657730021238887f, -0.61038280627630947528f,0.79023022143731003197f,0.61281008242940970820f, -0.78834642762660622761f,0.61523159058062681925f,0.78645521359908576731f, -0.61764730793780386886f,0.78455659715557524159f,0.62005721176328909561f, -0.78265059616657572938f,0.62246127937414996723f,0.78073722857209448822f, -0.62485948814238634341f,0.77881651238147597827f,0.62725181549514408275f, -0.77688846567323244230f,0.62963823891492698426f,0.77495310659487393057f, -0.63201873593980906207f,0.77301045336273699338f,0.63439328416364548779f, -0.77106052426181381776f,0.63676186123628419899f,0.76910333764557969882f, -0.63912444486377573138f,0.76713891193582040007f,0.64148101280858305095f, -0.76516726562245895860f,0.64383154288979138613f,0.76318841726338138010f, -0.64617601298331628357f,0.76120238548426177871f,0.64851440102211244110f, -0.75920918897838796102f,0.65084668499638087535f,0.75720884650648456748f, -0.65317284295377675551f,0.75520137689653654700f,0.65549285299961534967f, -0.75318679904361252042f,0.65780669329707863735f,0.75116513190968636771f, -0.66011434206742047870f,0.74913639452345937020f,0.66241577759017178373f, -0.74710060598018013245f,0.66471097820334479334f,0.74505778544146594733f, -0.66699992230363747137f,0.74300795213512171866f,0.66928258834663600929f, -0.74095112535495921691f,0.67155895484701833009f,0.73888732446061511361f, -0.67382900037875603783f,0.73681656887736979300f,0.67609270357531592310f, -0.73473887809596349907f,0.67835004312986146857f,0.73265427167241281570f, -0.68060099779545302212f,0.73056276922782759087f,0.68284554638524808112f, -0.72846439044822519637f,0.68508366777270035541f,0.72635915508434600873f, -0.68731534089175905233f,0.72424708295146700276f,0.68954054473706682948f, -0.72212819392921534511f,0.69175925836415774750f,0.72000250796138165477f, -0.69397146088965389055f,0.71787004505573170920f,0.69617713149146298601f, -0.71573082528381870571f,0.69837624940897280457f,0.71358486878079352422f, -0.70056879394324833576f,0.71143219574521643356f,0.70275474445722529993f, -0.70927282643886568891f,0.70493408037590488124f,0.70710678118654757274f, -0.70710678118654757274f,0.70493408037590499227f,0.70927282643886568891f, -0.70275474445722529993f,0.71143219574521643356f,0.70056879394324844679f, -0.71358486878079352422f,0.69837624940897291559f,0.71573082528381859468f, -0.69617713149146298601f,0.71787004505573170920f,0.69397146088965400157f, -0.72000250796138165477f,0.69175925836415774750f,0.72212819392921534511f, -0.68954054473706694051f,0.72424708295146689174f,0.68731534089175905233f, -0.72635915508434600873f,0.68508366777270035541f,0.72846439044822519637f, -0.68284554638524808112f,0.73056276922782759087f,0.68060099779545302212f, -0.73265427167241281570f,0.67835004312986146857f,0.73473887809596349907f, -0.67609270357531603413f,0.73681656887736979300f,0.67382900037875614885f, -0.73888732446061511361f,0.67155895484701833009f,0.74095112535495910588f, -0.66928258834663600929f,0.74300795213512171866f,0.66699992230363747137f, -0.74505778544146594733f,0.66471097820334490436f,0.74710060598018013245f, -0.66241577759017178373f,0.74913639452345925918f,0.66011434206742047870f, -0.75116513190968636771f,0.65780669329707874837f,0.75318679904361252042f, -0.65549285299961546070f,0.75520137689653654700f,0.65317284295377686654f, -0.75720884650648456748f,0.65084668499638098638f,0.75920918897838796102f, -0.64851440102211255212f,0.76120238548426177871f,0.64617601298331639459f, -0.76318841726338126907f,0.64383154288979149715f,0.76516726562245895860f, -0.64148101280858316198f,0.76713891193582040007f,0.63912444486377573138f, -0.76910333764557958780f,0.63676186123628419899f,0.77106052426181381776f, -0.63439328416364548779f,0.77301045336273688235f,0.63201873593980906207f, -0.77495310659487381955f,0.62963823891492709528f,0.77688846567323244230f, -0.62725181549514419377f,0.77881651238147586724f,0.62485948814238645443f, -0.78073722857209448822f,0.62246127937415007825f,0.78265059616657572938f, -0.62005721176328920663f,0.78455659715557524159f,0.61764730793780397988f, -0.78645521359908576731f,0.61523159058062681925f,0.78834642762660622761f, -0.61281008242940970820f,0.79023022143731003197f,0.61038280627630947528f, -0.79210657730021227785f,0.60794978496777374311f,0.79397547755433717231f, -0.60551104140432554512f,0.79583690460888345530f,0.60306659854034827539f, -0.79769084094339104407f,0.60061647938386897305f,0.79953726910790501314f, -0.59816070699634238395f,0.80137617172314012937f,0.59569930449243346793f, -0.80320753148064483184f,0.59323229503979979516f,0.80503133114296365758f, -0.59075970185887427544f,0.80684755354379922299f,0.58828154822264533408f, -0.80865618158817498262f,0.58579785745643886408f,0.81045719825259476821f, -0.58330865293769829094f,0.81225058658520388200f,0.58081395809576452649f, -0.81403632970594830276f,0.57831379641165558958f,0.81581441080673378075f, -0.57580819141784533866f,0.81758481315158371139f,0.57329716669804231532f, -0.81934752007679689800f,0.57078074588696736669f,0.82110251499110464835f, -0.56825895267013148970f,0.82284978137582631685f,0.56573181078361323149f, -0.82458930278502529099f,0.56319934401383409117f,0.82632106284566353427f, -0.56066157619733603124f,0.82804504525775579626f,0.55811853122055610221f, -0.82976123379452304540f,0.55557023301960228867f,0.83146961230254523567f, -0.55301670558002757883f,0.83317016470191318511f,0.55045797293660481131f, -0.83486287498638001026f,0.54789405917310018967f,0.83654772722351189440f, -0.54532498842204646383f,0.83822470555483796772f,0.54275078486451600046f, -0.83989379419599941023f,0.54017147272989296525f,0.84155497743689833268f, -0.53758707629564550512f,0.84320823964184543620f,0.53499761988709726435f, -0.84485356524970700587f,0.53240312787719801246f,0.84649093877405212627f, -0.52980362468629482731f,0.84812034480329712149f,0.52719913478190139067f, -0.84974176800085243766f,0.52458968267846883826f,0.85135519310526519554f, -0.52197529293715438925f,0.85296060493036363059f,0.51935599016558953167f, -0.85455798836540053376f,0.51673179901764998423f,0.85614732837519447184f, -0.51410274419322166128f,0.85772861000027211809f,0.51146885043797052361f, -0.85930181835700836235f,0.50883014254310698909f,0.86086693863776730939f, -0.50618664534515533937f,0.86242395611104050168f,0.50353838372571757542f, -0.86397285612158669643f,0.50088538261124093687f,0.86551362409056897818f, -0.49822766697278186854f,0.86704624551569264845f,0.49556526182577248507f, -0.86857070597134089507f,0.49289819222978409341f,0.87008699110871134952f, -0.49022648328829110387f,0.87159508665595109012f,0.48755016014843605143f, -0.87309497841829009079f,0.48486924800079111986f,0.87458665227817611321f, -0.48218377207912282989f,0.87607009419540660122f,0.47949375766015300826f, -0.87754529020726124156f,0.47679923006332225466f,0.87901222642863341417f, -0.47410021465055002254f,0.88047088905216075450f,0.47139673682599780857f, -0.88192126434835493853f,0.46868882203582795665f,0.88336333866573157891f, -0.46597649576796612569f,0.88479709843093778954f,0.46325978355186026025f, -0.88622253014888063838f,0.46053871095824000514f,0.88763962040285393496f, -0.45781330359887728587f,0.88904835585466457371f,0.45508358712634383592f, -0.89044872324475787817f,0.45234958723377099998f,0.89184070939234272313f, -0.44961132965460659516f,0.89322430119551532446f,0.44686884016237432560f, -0.89459948563138258493f,0.44412214457042925586f,0.89596624975618510689f, -0.44137126873171661501f,0.89732458070541831763f,0.43861623853852771404f, -0.89867446569395381673f,0.43585707992225547480f,0.90001589201616027935f, -0.43309381885315201277f,0.90134884704602202810f,0.43032648134008261165f, -0.90267331823725882600f,0.42755509343028219593f,0.90398929312344333820f, -0.42477968120910880589f,0.90529675931811881551f,0.42200027079979979261f, -0.90659570451491533483f,0.41921688836322396066f,0.90788611648766626150f, -0.41642956009763731906f,0.90916798309052226923f,0.41363831223843455787f, -0.91044129225806713634f,0.41084317105790391089f,0.91170603200542987832f, -0.40804416286497874333f,0.91296219042839810154f,0.40524131400498986100f, -0.91420975570353069095f,0.40243465085941854120f,0.91544871608826783316f, -0.39962419984564678810f,0.91667905992104270485f,0.39680998741671041907f, -0.91790077562139038569f,0.39399204006104809883f,0.91911385169005777040f, -0.39117038430225398171f,0.92031827670911048322f,0.38834504669882630168f, -0.92151403934204190183f,0.38551605384391901543f,0.92270112833387851747f, -0.38268343236508983729f,0.92387953251128673848f,0.37984720892405110515f, -0.92504924078267758425f,0.37700741021641831496f,0.92621024213831126826f, -0.37416406297145798909f,0.92736252565040111495f,0.37131719395183759858f, -0.92850608047321558924f,0.36846682995337232125f,0.92964089584318121418f, -0.36561299780477396482f,0.93076696107898371224f,0.36275572436739722537f, -0.93188426558166814750f,0.35989503653498827740f,0.93299279883473884567f, -0.35703096123343003310f,0.93409255040425887007f,0.35416352542049051033f, -0.93518350993894749923f,0.35129275608556714827f,0.93626566717027825959f, -0.34841868024943450921f,0.93733901191257495977f,0.34554132496398914931f, -0.93840353406310805795f,0.34266071731199437833f,0.93945922360218991898f, -0.33977688440682696225f,0.94050607059326829518f,0.33688985339222005111f, -0.94154406518302080631f,0.33399965144200949307f,0.94257319760144686605f, -0.33110630575987642921f,0.94359345816196038559f,0.32820984357909266382f, -0.94460483726148025685f,0.32531029216226298173f,0.94560732538052127971f, -0.32240767880107001897f,0.94660091308328353499f,0.31950203081601574739f, -0.94758559101774109124f,0.31659337555616584581f,0.94856134991573026749f, -0.31368174039889157312f,0.94952818059303667475f,0.31076715274961147495f, -0.95048607394948170235f,0.30784964004153497763f,0.95143502096900833820f, -0.30492922973540242948f,0.95237501271976587880f,0.30200594931922819519f, -0.95330604035419375109f,0.29907982630804047508f,0.95422809510910566733f, -0.29615088824362395536f,0.95514116830577067141f,0.29321916269425868373f, -0.95604525134999640557f,0.29028467725446233105f,0.95694033573220893540f, -0.28734745954472956653f,0.95782641302753290802f,0.28440753721127182141f, -0.95870347489587159906f,0.28146493792575805193f,0.95957151308198451733f, -0.27851968938505305973f,0.96043051941556578655f,0.27557181931095825478f, -0.96128048581132063966f,0.27262135544994897662f,0.96212140426904158019f, -0.26966832557291520178f,0.96295326687368387741f,0.26671275747489842090f, -0.96377606579543984022f,0.26375467897483151347f,0.96458979328981264700f, -0.26079411791527556952f,0.96539444169768939830f,0.25783110216215893162f, -0.96619000344541261516f,0.25486565960451462720f,0.96697647104485207059f, -0.25189781815421691258f,0.96775383709347551076f,0.24892760574572025956f, -0.96852209427441726675f,0.24595505033579459497f,0.96928123535654853171f, -0.24298017990326398197f,0.97003125319454397424f,0.24000302244874149871f, -0.97077214072895035013f,0.23702360599436733679f,0.97150389098625178352f, -0.23404195858354345794f,0.97222649707893626925f,0.23105810828067127605f, -0.97293995220556006576f,0.22807208317088578653f,0.97364424965081186603f, -0.22508391135979277653f,0.97433938278557585821f,0.22209362097320359264f, -0.97502534506699412020f,0.21910124015686976984f,0.97570213003852857003f, -0.21610679707621960333f,0.97636973133002114000f,0.21311031991609136194f, -0.97702814265775439484f,0.21011183688046972118f,0.97767735782450992943f, -0.20711137619221856032f,0.97831737071962765473f,0.20410896609281700687f, -0.97894817531906219710f,0.20110463484209195606f,0.97956976568544051887f, -0.19809841071795372680f,0.98018213596811731847f,0.19509032201612833135f, -0.98078528040323043058f,0.19208039704989238183f,0.98137919331375456089f, -0.18906866414980627589f,0.98196386910955524296f,0.18605515166344663291f, -0.98253930228744124076f,0.18303988795514106180f,0.98310548743121628501f, -0.18002290140569951471f,0.98366241921173025453f,0.17700422041214886049f, -0.98421009238692902521f,0.17398387338746384989f,0.98474850180190420801f, -0.17096188876030135595f,0.98527764238894122162f,0.16793829497473122814f, -0.98579750916756736512f,0.16491312048997008866f,0.98630809724459866938f, -0.16188639378011188130f,0.98680940181418541624f,0.15885814333386139019f, -0.98730141815785843473f,0.15582839765426531597f,0.98778414164457217783f, -0.15279718525844340760f,0.98825756773074946437f,0.14976453467732162017f, -0.98872169196032377858f,0.14673047445536174793f,0.98917650996478101444f, -0.14369503315029458212f,0.98962201746320077600f,0.14065823933284923863f, -0.99005821026229712256f,0.13762012158648617710f,0.99048508425645698239f, -0.13458070850712622324f,0.99090263542778000971f,0.13154002870288328264f, -0.99131085984611544415f,0.12849811079379322432f,0.99170975366909952520f, -0.12545498341154620592f,0.99209931314219179654f,0.12241067519921627893f, -0.99247953459870996706f,0.11936521481099135467f,0.99285041445986510489f, -0.11631863091190487725f,0.99321194923479450001f,0.11327095217756436019f, -0.99356413552059530403f,0.11022220729388318428f,0.99390697000235606051f, -0.10717242495680887049f,0.99424044945318790223f,0.10412163387205472520f, -0.99456457073425541537f,0.10106986275482787718f,0.99487933079480561638f, -0.09801714032956077016f,0.99518472667219681771f,0.09496349532963906104f, -0.99548075549192693856f,0.09190895649713269611f,0.99576741446765981713f, -0.08885355258252468358f,0.99604470090125196702f,0.08579731234443987997f, -0.99631261218277800129f,0.08274026454937580266f,0.99657114579055483539f, -0.07968243797143012563f,0.99682029929116566791f,0.07662386139203161695f, -0.99706007033948296225f,0.07356456359966745406f,0.99729045667869020697f, -0.07050457338961400866f,0.99751145614030345410f,0.06744391956366410645f, -0.99772306664419163624f,0.06438263092985740954f,0.99792528619859599548f, -0.06132073630220864768f,0.99811811290014917919f,0.05825826450043573163f, -0.99830154493389289261f,0.05519524434969003135f,0.99847558057329477421f, -0.05213170468028331672f,0.99864021818026527111f,0.04906767432741812596f, -0.99879545620517240501f,0.04600318213091464381f,0.99894129318685687124f, -0.04293825693494095902f,0.99907772775264536147f,0.03987292758773984536f, -0.99920475861836388631f,0.03680722294135899131f,0.99932238458834954375f, -0.03374117185137764235f,0.99943060455546173237f,0.03067480317663658085f, -0.99952941750109314256f,0.02760814577896581953f,0.99961882249517863830f, -0.02454122852291226384f,0.99969881869620424997f,0.02147408027546960502f, -0.99976940535121527898f,0.01840672990580482019f,0.99983058179582340319f, -0.01533920628498821985f,0.99988234745421256111f,0.01227153828571994447f, -0.99992470183914450299f,0.00920375478205995995f,0.99995764455196389786f, -0.00613588464915451517f,0.99998117528260110909f,0.00306795676296613791f, -0.99999529380957619118f,0.00000000000000006123f,1.00000000000000000000f, --0.00306795676296601561f,0.99999529380957619118f,-0.00613588464915439287f, -0.99998117528260110909f,-0.00920375478205983678f,0.99995764455196389786f, --0.01227153828571982304f,0.99992470183914450299f,-0.01533920628498809842f, -0.99988234745421256111f,-0.01840672990580469529f,0.99983058179582340319f, --0.02147408027546948359f,0.99976940535121527898f,-0.02454122852291214241f, -0.99969881869620424997f,-0.02760814577896569810f,0.99961882249517863830f, --0.03067480317663645942f,0.99952941750109314256f,-0.03374117185137751745f, -0.99943060455546173237f,-0.03680722294135886641f,0.99932238458834954375f, --0.03987292758773972740f,0.99920475861836388631f,-0.04293825693494083412f, -0.99907772775264536147f,-0.04600318213091451891f,0.99894129318685687124f, --0.04906767432741800800f,0.99879545620517240501f,-0.05213170468028319182f, -0.99864021818026527111f,-0.05519524434968991339f,0.99847558057329477421f, --0.05825826450043560673f,0.99830154493389289261f,-0.06132073630220852972f, -0.99811811290014917919f,-0.06438263092985728464f,0.99792528619859599548f, --0.06744391956366398155f,0.99772306664419163624f,-0.07050457338961389764f, -0.99751145614030345410f,-0.07356456359966732916f,0.99729045667869020697f, --0.07662386139203150592f,0.99706007033948296225f,-0.07968243797143001461f, -0.99682029929116577893f,-0.08274026454937567776f,0.99657114579055483539f, --0.08579731234443975507f,0.99631261218277800129f,-0.08885355258252455868f, -0.99604470090125196702f,-0.09190895649713257121f,0.99576741446765981713f, --0.09496349532963895002f,0.99548075549192693856f,-0.09801714032956064526f, -0.99518472667219692873f,-0.10106986275482775228f,0.99487933079480561638f, --0.10412163387205460030f,0.99456457073425541537f,-0.10717242495680875947f, -0.99424044945318790223f,-0.11022220729388305938f,0.99390697000235606051f, --0.11327095217756423529f,0.99356413552059530403f,-0.11631863091190475235f, -0.99321194923479450001f,-0.11936521481099122977f,0.99285041445986510489f, --0.12241067519921615403f,0.99247953459870996706f,-0.12545498341154606714f, -0.99209931314219179654f,-0.12849811079379311329f,0.99170975366909952520f, --0.13154002870288314386f,0.99131085984611544415f,-0.13458070850712611222f, -0.99090263542778000971f,-0.13762012158648606608f,0.99048508425645698239f, --0.14065823933284912761f,0.99005821026229712256f,-0.14369503315029444335f, -0.98962201746320088702f,-0.14673047445536163691f,0.98917650996478101444f, --0.14976453467732150915f,0.98872169196032377858f,-0.15279718525844329657f, -0.98825756773074946437f,-0.15582839765426520495f,0.98778414164457217783f, --0.15885814333386127917f,0.98730141815785843473f,-0.16188639378011177028f, -0.98680940181418552726f,-0.16491312048996994988f,0.98630809724459866938f, --0.16793829497473108936f,0.98579750916756747614f,-0.17096188876030124493f, -0.98527764238894122162f,-0.17398387338746371111f,0.98474850180190420801f, --0.17700422041214874946f,0.98421009238692902521f,-0.18002290140569940369f, -0.98366241921173025453f,-0.18303988795514092303f,0.98310548743121628501f, --0.18605515166344649414f,0.98253930228744124076f,-0.18906866414980616486f, -0.98196386910955524296f,-0.19208039704989227081f,0.98137919331375456089f, --0.19509032201612819257f,0.98078528040323043058f,-0.19809841071795361578f, -0.98018213596811742949f,-0.20110463484209181728f,0.97956976568544051887f, --0.20410896609281689584f,0.97894817531906219710f,-0.20711137619221844930f, -0.97831737071962765473f,-0.21011183688046961016f,0.97767735782450992943f, --0.21311031991609125091f,0.97702814265775439484f,-0.21610679707621949230f, -0.97636973133002114000f,-0.21910124015686965881f,0.97570213003852857003f, --0.22209362097320348162f,0.97502534506699412020f,-0.22508391135979266551f, -0.97433938278557585821f,-0.22807208317088567551f,0.97364424965081197705f, --0.23105810828067113727f,0.97293995220556017678f,-0.23404195858354331916f, -0.97222649707893638027f,-0.23702360599436722577f,0.97150389098625178352f, --0.24000302244874138768f,0.97077214072895035013f,-0.24298017990326387094f, -0.97003125319454397424f,-0.24595505033579448395f,0.96928123535654853171f, --0.24892760574572012078f,0.96852209427441737777f,-0.25189781815421680156f, -0.96775383709347551076f,-0.25486565960451451618f,0.96697647104485207059f, --0.25783110216215882060f,0.96619000344541261516f,-0.26079411791527545850f, -0.96539444169768939830f,-0.26375467897483140245f,0.96458979328981275803f, --0.26671275747489830987f,0.96377606579543984022f,-0.26966832557291509076f, -0.96295326687368387741f,-0.27262135544994886560f,0.96212140426904158019f, --0.27557181931095814376f,0.96128048581132063966f,-0.27851968938505294870f, -0.96043051941556589757f,-0.28146493792575794091f,0.95957151308198451733f, --0.28440753721127171039f,0.95870347489587159906f,-0.28734745954472945551f, -0.95782641302753290802f,-0.29028467725446216452f,0.95694033573220893540f, --0.29321916269425857271f,0.95604525134999651659f,-0.29615088824362384434f, -0.95514116830577067141f,-0.29907982630804036406f,0.95422809510910566733f, --0.30200594931922808417f,0.95330604035419386211f,-0.30492922973540226295f, -0.95237501271976587880f,-0.30784964004153486661f,0.95143502096900833820f, --0.31076715274961136393f,0.95048607394948181337f,-0.31368174039889140658f, -0.94952818059303667475f,-0.31659337555616573479f,0.94856134991573037851f, --0.31950203081601563637f,0.94758559101774120226f,-0.32240767880106985244f, -0.94660091308328353499f,-0.32531029216226287071f,0.94560732538052139073f, --0.32820984357909255280f,0.94460483726148025685f,-0.33110630575987631818f, -0.94359345816196038559f,-0.33399965144200938205f,0.94257319760144686605f, --0.33688985339221994009f,0.94154406518302080631f,-0.33977688440682685123f, -0.94050607059326829518f,-0.34266071731199426731f,0.93945922360218991898f, --0.34554132496398903829f,0.93840353406310816897f,-0.34841868024943439819f, -0.93733901191257495977f,-0.35129275608556703725f,0.93626566717027825959f, --0.35416352542049039931f,0.93518350993894761025f,-0.35703096123342992207f, -0.93409255040425898109f,-0.35989503653498816638f,0.93299279883473884567f, --0.36275572436739711435f,0.93188426558166814750f,-0.36561299780477385379f, -0.93076696107898371224f,-0.36846682995337221023f,0.92964089584318132520f, --0.37131719395183748755f,0.92850608047321558924f,-0.37416406297145787807f, -0.92736252565040111495f,-0.37700741021641820394f,0.92621024213831137928f, --0.37984720892405099413f,0.92504924078267769527f,-0.38268343236508972627f, -0.92387953251128673848f,-0.38551605384391890441f,0.92270112833387851747f, --0.38834504669882619066f,0.92151403934204201285f,-0.39117038430225387069f, -0.92031827670911059425f,-0.39399204006104798781f,0.91911385169005777040f, --0.39680998741671030805f,0.91790077562139049672f,-0.39962419984564667708f, -0.91667905992104270485f,-0.40243465085941843018f,0.91544871608826783316f, --0.40524131400498974998f,0.91420975570353069095f,-0.40804416286497863231f, -0.91296219042839821256f,-0.41084317105790379987f,0.91170603200542987832f, --0.41363831223843450235f,0.91044129225806724737f,-0.41642956009763698599f, -0.90916798309052249127f,-0.41921688836322407168f,0.90788611648766615048f, --0.42200027079979968159f,0.90659570451491533483f,-0.42477968120910869487f, -0.90529675931811881551f,-0.42755509343028186287f,0.90398929312344344922f, --0.43032648134008272267f,0.90267331823725871498f,-0.43309381885315190175f, -0.90134884704602202810f,-0.43585707992225536378f,0.90001589201616027935f, --0.43861623853852738097f,0.89867446569395392775f,-0.44137126873171672603f, -0.89732458070541831763f,-0.44412214457042914484f,0.89596624975618521791f, --0.44686884016237399253f,0.89459948563138280697f,-0.44961132965460670619f, -0.89322430119551521344f,-0.45234958723377088896f,0.89184070939234272313f, --0.45508358712634372489f,0.89044872324475798919f,-0.45781330359887700832f, -0.88904835585466468473f,-0.46053871095824006066f,0.88763962040285393496f, --0.46325978355186014923f,0.88622253014888063838f,-0.46597649576796601467f, -0.88479709843093790056f,-0.46868882203582767909f,0.88336333866573168994f, --0.47139673682599769755f,0.88192126434835504956f,-0.47410021465054991152f, -0.88047088905216086552f,-0.47679923006332192159f,0.87901222642863352519f, --0.47949375766015311928f,0.87754529020726124156f,-0.48218377207912271887f, -0.87607009419540660122f,-0.48486924800079100883f,0.87458665227817622423f, --0.48755016014843571837f,0.87309497841829020182f,-0.49022648328829121489f, -0.87159508665595097909f,-0.49289819222978398239f,0.87008699110871146054f, --0.49556526182577237405f,0.86857070597134100609f,-0.49822766697278159098f, -0.86704624551569275948f,-0.50088538261124082585f,0.86551362409056908920f, --0.50353838372571746440f,0.86397285612158680745f,-0.50618664534515511733f, -0.86242395611104061270f,-0.50883014254310710012f,0.86086693863776719837f, --0.51146885043797041259f,0.85930181835700847337f,-0.51410274419322155026f, -0.85772861000027211809f,-0.51673179901764965116f,0.85614732837519458286f, --0.51935599016558964269f,0.85455798836540053376f,-0.52197529293715427823f, -0.85296060493036374162f,-0.52458968267846872724f,0.85135519310526519554f, --0.52719913478190105760f,0.84974176800085265970f,-0.52980362468629471628f, -0.84812034480329723252f,-0.53240312787719790144f,0.84649093877405212627f, --0.53499761988709704230f,0.84485356524970722791f,-0.53758707629564561614f, -0.84320823964184532517f,-0.54017147272989285423f,0.84155497743689844370f, --0.54275078486451577842f,0.83989379419599952126f,-0.54532498842204624179f, -0.83822470555483818977f,-0.54789405917310018967f,0.83654772722351200542f, --0.55045797293660470029f,0.83486287498638012128f,-0.55301670558002735678f, -0.83317016470191329613f,-0.55557023301960195560f,0.83146961230254534669f, --0.55811853122055610221f,0.82976123379452304540f,-0.56066157619733592021f, -0.82804504525775579626f,-0.56319934401383386913f,0.82632106284566364529f, --0.56573181078361323149f,0.82458930278502517996f,-0.56825895267013148970f, -0.82284978137582631685f,-0.57078074588696714464f,0.82110251499110475937f, --0.57329716669804198226f,0.81934752007679712005f,-0.57580819141784533866f, -0.81758481315158371139f,-0.57831379641165547856f,0.81581441080673378075f, --0.58081395809576441547f,0.81403632970594852480f,-0.58330865293769840196f, -0.81225058658520388200f,-0.58579785745643886408f,0.81045719825259476821f, --0.58828154822264522306f,0.80865618158817509364f,-0.59075970185887405339f, -0.80684755354379944503f,-0.59323229503979990618f,0.80503133114296354655f, --0.59569930449243335691f,0.80320753148064494287f,-0.59816070699634216190f, -0.80137617172314024039f,-0.60061647938386875101f,0.79953726910790523519f, --0.60306659854034827539f,0.79769084094339104407f,-0.60551104140432543410f, -0.79583690460888356633f,-0.60794978496777352106f,0.79397547755433728334f, --0.61038280627630958630f,0.79210657730021227785f,-0.61281008242940970820f, -0.79023022143731003197f,-0.61523159058062670823f,0.78834642762660633863f, --0.61764730793780375784f,0.78645521359908587833f,-0.62005721176328920663f, -0.78455659715557513056f,-0.62246127937414996723f,0.78265059616657572938f, --0.62485948814238623239f,0.78073722857209459924f,-0.62725181549514386070f, -0.77881651238147608929f,-0.62963823891492709528f,0.77688846567323244230f, --0.63201873593980895105f,0.77495310659487393057f,-0.63439328416364537677f, -0.77301045336273710440f,-0.63676186123628431002f,0.77106052426181370674f, --0.63912444486377573138f,0.76910333764557958780f,-0.64148101280858305095f, -0.76713891193582040007f,-0.64383154288979127511f,0.76516726562245906962f, --0.64617601298331639459f,0.76318841726338115805f,-0.64851440102211244110f, -0.76120238548426188974f,-0.65084668499638076433f,0.75920918897838807204f, --0.65317284295377653347f,0.75720884650648467851f,-0.65549285299961546070f, -0.75520137689653643598f,-0.65780669329707852633f,0.75318679904361252042f, --0.66011434206742036768f,0.75116513190968658975f,-0.66241577759017189475f, -0.74913639452345925918f,-0.66471097820334490436f,0.74710060598018013245f, --0.66699992230363736034f,0.74505778544146605835f,-0.66928258834663589827f, -0.74300795213512182968f,-0.67155895484701844111f,0.74095112535495899486f, --0.67382900037875603783f,0.73888732446061522463f,-0.67609270357531581208f, -0.73681656887737001504f,-0.67835004312986124653f,0.73473887809596372112f, --0.68060099779545302212f,0.73265427167241281570f,-0.68284554638524797010f, -0.73056276922782759087f,-0.68508366777270024439f,0.72846439044822530740f, --0.68731534089175916336f,0.72635915508434589771f,-0.68954054473706694051f, -0.72424708295146689174f,-0.69175925836415763648f,0.72212819392921545614f, --0.69397146088965377952f,0.72000250796138176579f,-0.69617713149146298601f, -0.71787004505573170920f,-0.69837624940897280457f,0.71573082528381870571f, --0.70056879394324822474f,0.71358486878079363525f,-0.70275474445722507788f, -0.71143219574521665560f,-0.70493408037590488124f,0.70927282643886557789f, --0.70710678118654746172f,0.70710678118654757274f,-0.70927282643886546687f, -0.70493408037590510329f,-0.71143219574521654458f,0.70275474445722518890f, --0.71358486878079352422f,0.70056879394324833576f,-0.71573082528381859468f, -0.69837624940897291559f,-0.71787004505573159818f,0.69617713149146309703f, --0.72000250796138165477f,0.69397146088965389055f,-0.72212819392921523409f, -0.69175925836415785852f,-0.72424708295146678072f,0.68954054473706705153f, --0.72635915508434578669f,0.68731534089175927438f,-0.72846439044822519637f, -0.68508366777270035541f,-0.73056276922782747985f,0.68284554638524808112f, --0.73265427167241270467f,0.68060099779545324417f,-0.73473887809596349907f, -0.67835004312986135755f,-0.73681656887736979300f,0.67609270357531592310f, --0.73888732446061511361f,0.67382900037875614885f,-0.74095112535495888384f, -0.67155895484701855214f,-0.74300795213512171866f,0.66928258834663600929f, --0.74505778544146594733f,0.66699992230363758239f,-0.74710060598018002143f, -0.66471097820334501538f,-0.74913639452345914815f,0.66241577759017200577f, --0.75116513190968636771f,0.66011434206742047870f,-0.75318679904361240940f, -0.65780669329707874837f,-0.75520137689653643598f,0.65549285299961557172f, --0.75720884650648467851f,0.65317284295377664449f,-0.75920918897838796102f, -0.65084668499638098638f,-0.76120238548426166769f,0.64851440102211255212f, --0.76318841726338115805f,0.64617601298331661663f,-0.76516726562245895860f, -0.64383154288979138613f,-0.76713891193582040007f,0.64148101280858316198f, --0.76910333764557947678f,0.63912444486377584241f,-0.77106052426181359571f, -0.63676186123628442104f,-0.77301045336273699338f,0.63439328416364548779f, --0.77495310659487381955f,0.63201873593980906207f,-0.77688846567323233128f, -0.62963823891492720630f,-0.77881651238147597827f,0.62725181549514408275f, --0.78073722857209448822f,0.62485948814238634341f,-0.78265059616657561836f, -0.62246127937415007825f,-0.78455659715557501954f,0.62005721176328942867f, --0.78645521359908576731f,0.61764730793780386886f,-0.78834642762660622761f, -0.61523159058062693028f,-0.79023022143730992095f,0.61281008242940981923f, --0.79210657730021216683f,0.61038280627630969732f,-0.79397547755433717231f, -0.60794978496777363208f,-0.79583690460888345530f,0.60551104140432565615f, --0.79769084094339093305f,0.60306659854034838641f,-0.79953726910790512417f, -0.60061647938386886203f,-0.80137617172314024039f,0.59816070699634238395f, --0.80320753148064483184f,0.59569930449243346793f,-0.80503133114296343553f, -0.59323229503980001720f,-0.80684755354379933401f,0.59075970185887416442f, --0.80865618158817498262f,0.58828154822264533408f,-0.81045719825259465718f, -0.58579785745643897510f,-0.81225058658520377097f,0.58330865293769851299f, --0.81403632970594841378f,0.58081395809576452649f,-0.81581441080673378075f, -0.57831379641165570060f,-0.81758481315158360037f,0.57580819141784544968f, --0.81934752007679700903f,0.57329716669804209328f,-0.82110251499110464835f, -0.57078074588696725566f,-0.82284978137582620583f,0.56825895267013171175f, --0.82458930278502506894f,0.56573181078361345353f,-0.82632106284566353427f, -0.56319934401383409117f,-0.82804504525775568524f,0.56066157619733614226f, --0.82976123379452293438f,0.55811853122055632426f,-0.83146961230254534669f, -0.55557023301960217765f,-0.83317016470191318511f,0.55301670558002746780f, --0.83486287498638001026f,0.55045797293660492233f,-0.83654772722351189440f, -0.54789405917310041172f,-0.83822470555483807875f,0.54532498842204635281f, --0.83989379419599952126f,0.54275078486451588944f,-0.84155497743689833268f, -0.54017147272989296525f,-0.84320823964184532517f,0.53758707629564572716f, --0.84485356524970711689f,0.53499761988709715332f,-0.84649093877405201525f, -0.53240312787719801246f,-0.84812034480329712149f,0.52980362468629482731f, --0.84974176800085254868f,0.52719913478190127964f,-0.85135519310526519554f, -0.52458968267846894928f,-0.85296060493036363059f,0.52197529293715438925f, --0.85455798836540042274f,0.51935599016558975372f,-0.85614732837519447184f, -0.51673179901764976218f,-0.85772861000027200706f,0.51410274419322177231f, --0.85930181835700836235f,0.51146885043797052361f,-0.86086693863776719837f, -0.50883014254310732216f,-0.86242395611104050168f,0.50618664534515522835f, --0.86397285612158669643f,0.50353838372571757542f,-0.86551362409056897818f, -0.50088538261124093687f,-0.86704624551569264845f,0.49822766697278175752f, --0.86857070597134089507f,0.49556526182577254058f,-0.87008699110871134952f, -0.49289819222978414892f,-0.87159508665595086807f,0.49022648328829138142f, --0.87309497841829009079f,0.48755016014843588490f,-0.87458665227817611321f, -0.48486924800079111986f,-0.87607009419540649020f,0.48218377207912288540f, --0.87754529020726113053f,0.47949375766015328582f,-0.87901222642863352519f, -0.47679923006332208812f,-0.88047088905216075450f,0.47410021465055007805f, --0.88192126434835493853f,0.47139673682599780857f,-0.88336333866573168994f, -0.46868882203582784562f,-0.88479709843093778954f,0.46597649576796618121f, --0.88622253014888052736f,0.46325978355186031576f,-0.88763962040285382393f, -0.46053871095824022719f,-0.88904835585466457371f,0.45781330359887717485f, --0.89044872324475787817f,0.45508358712634389143f,-0.89184070939234261211f, -0.45234958723377105549f,-0.89322430119551521344f,0.44961132965460687272f, --0.89459948563138269595f,0.44686884016237415906f,-0.89596624975618510689f, -0.44412214457042931137f,-0.89732458070541820661f,0.44137126873171689256f, --0.89867446569395392775f,0.43861623853852754751f,-0.90001589201616016833f, -0.43585707992225553031f,-0.90134884704602191707f,0.43309381885315206828f, --0.90267331823725871498f,0.43032648134008288920f,-0.90398929312344333820f, -0.42755509343028202940f,-0.90529675931811870448f,0.42477968120910886141f, --0.90659570451491533483f,0.42200027079979984812f,-0.90788611648766603945f, -0.41921688836322423821f,-0.90916798309052238025f,0.41642956009763715253f, --0.91044129225806713634f,0.41363831223843466889f,-0.91170603200542976730f, -0.41084317105790413294f,-0.91296219042839821256f,0.40804416286497857680f, --0.91420975570353069095f,0.40524131400498991651f,-0.91544871608826772214f, -0.40243465085941859671f,-0.91667905992104259383f,0.39962419984564706565f, --0.91790077562139049672f,0.39680998741671025254f,-0.91911385169005777040f, -0.39399204006104815434f,-0.92031827670911048322f,0.39117038430225403722f, --0.92151403934204179080f,0.38834504669882657923f,-0.92270112833387862850f, -0.38551605384391884890f,-0.92387953251128673848f,0.38268343236508989280f, --0.92504924078267747323f,0.37984720892405138271f,-0.92621024213831137928f, -0.37700741021641814843f,-0.92736252565040111495f,0.37416406297145804460f, --0.92850608047321547822f,0.37131719395183770960f,-0.92964089584318121418f, -0.36846682995337259880f,-0.93076696107898371224f,0.36561299780477379828f, --0.93188426558166803648f,0.36275572436739728088f,-0.93299279883473884567f, -0.35989503653498833291f,-0.93409255040425875904f,0.35703096123343031065f, --0.93518350993894761025f,0.35416352542049039931f,-0.93626566717027825959f, -0.35129275608556720378f,-0.93733901191257484875f,0.34841868024943478677f, --0.93840353406310816897f,0.34554132496398898278f,-0.93945922360218991898f, -0.34266071731199443384f,-0.94050607059326829518f,0.33977688440682701776f, --0.94154406518302069529f,0.33688985339222032867f,-0.94257319760144686605f, -0.33399965144200938205f,-0.94359345816196038559f,0.33110630575987648472f, --0.94460483726148014583f,0.32820984357909271933f,-0.94560732538052116869f, -0.32531029216226325929f,-0.94660091308328353499f,0.32240767880106985244f, --0.94758559101774109124f,0.31950203081601580291f,-0.94856134991573026749f, -0.31659337555616606785f,-0.94952818059303667475f,0.31368174039889140658f, --0.95048607394948170235f,0.31076715274961153046f,-0.95143502096900833820f, -0.30784964004153503314f,-0.95237501271976576778f,0.30492922973540265152f, --0.95330604035419386211f,0.30200594931922802866f,-0.95422809510910555630f, -0.29907982630804053059f,-0.95514116830577067141f,0.29615088824362401088f, --0.95604525134999629454f,0.29321916269425896129f,-0.95694033573220882438f, -0.29028467725446238656f,-0.95782641302753290802f,0.28734745954472962204f, --0.95870347489587148804f,0.28440753721127209896f,-0.95957151308198451733f, -0.28146493792575788540f,-0.96043051941556578655f,0.27851968938505317075f, --0.96128048581132063966f,0.27557181931095831029f,-0.96212140426904146917f, -0.27262135544994925418f,-0.96295326687368387741f,0.26966832557291509076f, --0.96377606579543984022f,0.26671275747489847641f,-0.96458979328981264700f, -0.26375467897483156898f,-0.96539444169768928727f,0.26079411791527584707f, --0.96619000344541250413f,0.25783110216215898713f,-0.96697647104485207059f, -0.25486565960451468271f,-0.96775383709347539973f,0.25189781815421719013f, --0.96852209427441737777f,0.24892760574572009302f,-0.96928123535654842069f, -0.24595505033579465048f,-0.97003125319454397424f,0.24298017990326406523f, --0.97077214072895023911f,0.24000302244874177626f,-0.97150389098625178352f, -0.23702360599436717026f,-0.97222649707893626925f,0.23404195858354351345f, --0.97293995220556006576f,0.23105810828067133156f,-0.97364424965081186603f, -0.22807208317088606409f,-0.97433938278557585821f,0.22508391135979283204f, --0.97502534506699412020f,0.22209362097320364815f,-0.97570213003852845901f, -0.21910124015687004739f,-0.97636973133002114000f,0.21610679707621943679f, --0.97702814265775439484f,0.21311031991609141745f,-0.97767735782450992943f, -0.21011183688046980444f,-0.97831737071962754371f,0.20711137619221883788f, --0.97894817531906219710f,0.20410896609281684033f,-0.97956976568544051887f, -0.20110463484209201157f,-0.98018213596811731847f,0.19809841071795381007f, --0.98078528040323043058f,0.19509032201612860891f,-0.98137919331375456089f, -0.19208039704989246510f,-0.98196386910955524296f,0.18906866414980635915f, --0.98253930228744124076f,0.18605515166344691047f,-0.98310548743121628501f, -0.18303988795514089527f,-0.98366241921173025453f,0.18002290140569957022f, --0.98421009238692902521f,0.17700422041214894375f,-0.98474850180190420801f, -0.17398387338746412745f,-0.98527764238894122162f,0.17096188876030121717f, --0.98579750916756736512f,0.16793829497473128365f,-0.98630809724459855836f, -0.16491312048997014417f,-0.98680940181418552726f,0.16188639378011174252f, --0.98730141815785843473f,0.15885814333386147346f,-0.98778414164457217783f, -0.15582839765426537149f,-0.98825756773074946437f,0.15279718525844368515f, --0.98872169196032377858f,0.14976453467732145364f,-0.98917650996478101444f, -0.14673047445536180344f,-0.98962201746320077600f,0.14369503315029463764f, --0.99005821026229701154f,0.14065823933284954395f,-0.99048508425645709341f, -0.13762012158648603832f,-0.99090263542778000971f,0.13458070850712627875f, --0.99131085984611544415f,0.13154002870288333815f,-0.99170975366909952520f, -0.12849811079379308554f,-0.99209931314219179654f,0.12545498341154626143f, --0.99247953459870996706f,0.12241067519921634832f,-0.99285041445986510489f, -0.11936521481099163222f,-0.99321194923479450001f,0.11631863091190471071f, --0.99356413552059530403f,0.11327095217756441570f,-0.99390697000235606051f, -0.11022220729388323979f,-0.99424044945318790223f,0.10717242495680916192f, --0.99456457073425541537f,0.10412163387205457254f,-0.99487933079480561638f, -0.10106986275482793269f,-0.99518472667219681771f,0.09801714032956082567f, --0.99548075549192693856f,0.09496349532963890838f,-0.99576741446765981713f, -0.09190895649713275162f,-0.99604470090125196702f,0.08885355258252475297f, --0.99631261218277800129f,0.08579731234444015753f,-0.99657114579055483539f, -0.08274026454937563613f,-0.99682029929116566791f,0.07968243797143019502f, --0.99706007033948296225f,0.07662386139203168633f,-0.99729045667869020697f, -0.07356456359966773162f,-0.99751145614030345410f,0.07050457338961385600f, --0.99772306664419163624f,0.06744391956366417584f,-0.99792528619859599548f, -0.06438263092985770097f,-0.99811811290014917919f,0.06132073630220848809f, --0.99830154493389289261f,0.05825826450043579408f,-0.99847558057329477421f, -0.05519524434969009380f,-0.99864021818026516009f,0.05213170468028359428f, --0.99879545620517240501f,0.04906767432741796636f,-0.99894129318685687124f, -0.04600318213091470626f,-0.99907772775264536147f,0.04293825693494102147f, --0.99920475861836388631f,0.03987292758774012985f,-0.99932238458834954375f, -0.03680722294135883171f,-0.99943060455546173237f,0.03374117185137770480f, --0.99952941750109314256f,0.03067480317663686534f,-0.99961882249517863830f, -0.02760814577896565994f,-0.99969881869620424997f,0.02454122852291232629f, --0.99976940535121527898f,0.02147408027546966747f,-0.99983058179582340319f, -0.01840672990580510121f,-0.99988234745421256111f,0.01533920628498806026f, --0.99992470183914450299f,0.01227153828572000692f,-0.99995764455196389786f, -0.00920375478206002066f,-0.99998117528260110909f,0.00613588464915479880f, --0.99999529380957619118f,0.00306795676296597701f,1.00000000000000000000f, -0.00000000000000000000f,0.99992470183914450299f,0.01227153828571992539f, -0.99969881869620424997f,0.02454122852291228812f,0.99932238458834954375f, -0.03680722294135883171f,0.99879545620517240501f,0.04906767432741801493f, -0.99811811290014917919f,0.06132073630220857829f,0.99729045667869020697f, -0.07356456359966742631f,0.99631261218277800129f,0.08579731234443989385f, -0.99518472667219692873f,0.09801714032956060363f,0.99390697000235606051f, -0.11022220729388305938f,0.99247953459870996706f,0.12241067519921619566f, -0.99090263542778000971f,0.13458070850712616773f,0.98917650996478101444f, -0.14673047445536174793f,0.98730141815785843473f,0.15885814333386144570f, -0.98527764238894122162f,0.17096188876030121717f,0.98310548743121628501f, -0.18303988795514095078f,0.98078528040323043058f,0.19509032201612824808f, -0.97831737071962765473f,0.20711137619221856032f,0.97570213003852857003f, -0.21910124015686979759f,0.97293995220556017678f,0.23105810828067110951f, -0.97003125319454397424f,0.24298017990326387094f,0.96697647104485207059f, -0.25486565960451457169f,0.96377606579543984022f,0.26671275747489836538f, -0.96043051941556578655f,0.27851968938505305973f,0.95694033573220882438f, -0.29028467725446233105f,0.95330604035419386211f,0.30200594931922808417f, -0.94952818059303667475f,0.31368174039889151761f,0.94560732538052127971f, -0.32531029216226292622f,0.94154406518302080631f,0.33688985339222005111f, -0.93733901191257495977f,0.34841868024943456472f,0.93299279883473895669f, -0.35989503653498811087f,0.92850608047321558924f,0.37131719395183754306f, -0.92387953251128673848f,0.38268343236508978178f,0.91911385169005777040f, -0.39399204006104809883f,0.91420975570353069095f,0.40524131400498986100f, -0.90916798309052238025f,0.41642956009763715253f,0.90398929312344333820f, -0.42755509343028208491f,0.89867446569395381673f,0.43861623853852765853f, -0.89322430119551532446f,0.44961132965460653965f,0.88763962040285393496f, -0.46053871095824000514f,0.88192126434835504956f,0.47139673682599764204f, -0.87607009419540660122f,0.48218377207912271887f,0.87008699110871146054f, -0.49289819222978403790f,0.86397285612158669643f,0.50353838372571757542f, -0.85772861000027211809f,0.51410274419322166128f,0.85135519310526519554f, -0.52458968267846894928f,0.84485356524970711689f,0.53499761988709715332f, -0.83822470555483807875f,0.54532498842204646383f,0.83146961230254523567f, -0.55557023301960217765f,0.82458930278502529099f,0.56573181078361312046f, -0.81758481315158371139f,0.57580819141784533866f,0.81045719825259476821f, -0.58579785745643886408f,0.80320753148064494287f,0.59569930449243335691f, -0.79583690460888356633f,0.60551104140432554512f,0.78834642762660622761f, -0.61523159058062681925f,0.78073722857209448822f,0.62485948814238634341f, -0.77301045336273699338f,0.63439328416364548779f,0.76516726562245895860f, -0.64383154288979138613f,0.75720884650648456748f,0.65317284295377675551f, -0.74913639452345937020f,0.66241577759017178373f,0.74095112535495921691f, -0.67155895484701833009f,0.73265427167241281570f,0.68060099779545302212f, -0.72424708295146700276f,0.68954054473706682948f,0.71573082528381870571f, -0.69837624940897280457f,0.70710678118654757274f,0.70710678118654757274f, -0.69837624940897291559f,0.71573082528381859468f,0.68954054473706694051f, -0.72424708295146689174f,0.68060099779545302212f,0.73265427167241281570f, -0.67155895484701833009f,0.74095112535495910588f,0.66241577759017178373f, -0.74913639452345925918f,0.65317284295377686654f,0.75720884650648456748f, -0.64383154288979149715f,0.76516726562245895860f,0.63439328416364548779f, -0.77301045336273688235f,0.62485948814238645443f,0.78073722857209448822f, -0.61523159058062681925f,0.78834642762660622761f,0.60551104140432554512f, -0.79583690460888345530f,0.59569930449243346793f,0.80320753148064483184f, -0.58579785745643886408f,0.81045719825259476821f,0.57580819141784533866f, -0.81758481315158371139f,0.56573181078361323149f,0.82458930278502529099f, -0.55557023301960228867f,0.83146961230254523567f,0.54532498842204646383f, -0.83822470555483796772f,0.53499761988709726435f,0.84485356524970700587f, -0.52458968267846883826f,0.85135519310526519554f,0.51410274419322166128f, -0.85772861000027211809f,0.50353838372571757542f,0.86397285612158669643f, -0.49289819222978409341f,0.87008699110871134952f,0.48218377207912282989f, -0.87607009419540660122f,0.47139673682599780857f,0.88192126434835493853f, -0.46053871095824000514f,0.88763962040285393496f,0.44961132965460659516f, -0.89322430119551532446f,0.43861623853852771404f,0.89867446569395381673f, -0.42755509343028219593f,0.90398929312344333820f,0.41642956009763731906f, -0.90916798309052226923f,0.40524131400498986100f,0.91420975570353069095f, -0.39399204006104809883f,0.91911385169005777040f,0.38268343236508983729f, -0.92387953251128673848f,0.37131719395183759858f,0.92850608047321558924f, -0.35989503653498827740f,0.93299279883473884567f,0.34841868024943450921f, -0.93733901191257495977f,0.33688985339222005111f,0.94154406518302080631f, -0.32531029216226298173f,0.94560732538052127971f,0.31368174039889157312f, -0.94952818059303667475f,0.30200594931922819519f,0.95330604035419375109f, -0.29028467725446233105f,0.95694033573220893540f,0.27851968938505305973f, -0.96043051941556578655f,0.26671275747489842090f,0.96377606579543984022f, -0.25486565960451462720f,0.96697647104485207059f,0.24298017990326398197f, -0.97003125319454397424f,0.23105810828067127605f,0.97293995220556006576f, -0.21910124015686976984f,0.97570213003852857003f,0.20711137619221856032f, -0.97831737071962765473f,0.19509032201612833135f,0.98078528040323043058f, -0.18303988795514106180f,0.98310548743121628501f,0.17096188876030135595f, -0.98527764238894122162f,0.15885814333386139019f,0.98730141815785843473f, -0.14673047445536174793f,0.98917650996478101444f,0.13458070850712622324f, -0.99090263542778000971f,0.12241067519921627893f,0.99247953459870996706f, -0.11022220729388318428f,0.99390697000235606051f,0.09801714032956077016f, -0.99518472667219681771f,0.08579731234443987997f,0.99631261218277800129f, -0.07356456359966745406f,0.99729045667869020697f,0.06132073630220864768f, -0.99811811290014917919f,0.04906767432741812596f,0.99879545620517240501f, -0.03680722294135899131f,0.99932238458834954375f,0.02454122852291226384f, -0.99969881869620424997f,0.01227153828571994447f,0.99992470183914450299f, -0.00000000000000006123f,1.00000000000000000000f,-0.01227153828571982304f, -0.99992470183914450299f,-0.02454122852291214241f,0.99969881869620424997f, --0.03680722294135886641f,0.99932238458834954375f,-0.04906767432741800800f, -0.99879545620517240501f,-0.06132073630220852972f,0.99811811290014917919f, --0.07356456359966732916f,0.99729045667869020697f,-0.08579731234443975507f, -0.99631261218277800129f,-0.09801714032956064526f,0.99518472667219692873f, --0.11022220729388305938f,0.99390697000235606051f,-0.12241067519921615403f, -0.99247953459870996706f,-0.13458070850712611222f,0.99090263542778000971f, --0.14673047445536163691f,0.98917650996478101444f,-0.15885814333386127917f, -0.98730141815785843473f,-0.17096188876030124493f,0.98527764238894122162f, --0.18303988795514092303f,0.98310548743121628501f,-0.19509032201612819257f, -0.98078528040323043058f,-0.20711137619221844930f,0.97831737071962765473f, --0.21910124015686965881f,0.97570213003852857003f,-0.23105810828067113727f, -0.97293995220556017678f,-0.24298017990326387094f,0.97003125319454397424f, --0.25486565960451451618f,0.96697647104485207059f,-0.26671275747489830987f, -0.96377606579543984022f,-0.27851968938505294870f,0.96043051941556589757f, --0.29028467725446216452f,0.95694033573220893540f,-0.30200594931922808417f, -0.95330604035419386211f,-0.31368174039889140658f,0.94952818059303667475f, --0.32531029216226287071f,0.94560732538052139073f,-0.33688985339221994009f, -0.94154406518302080631f,-0.34841868024943439819f,0.93733901191257495977f, --0.35989503653498816638f,0.93299279883473884567f,-0.37131719395183748755f, -0.92850608047321558924f,-0.38268343236508972627f,0.92387953251128673848f, --0.39399204006104798781f,0.91911385169005777040f,-0.40524131400498974998f, -0.91420975570353069095f,-0.41642956009763698599f,0.90916798309052249127f, --0.42755509343028186287f,0.90398929312344344922f,-0.43861623853852738097f, -0.89867446569395392775f,-0.44961132965460670619f,0.89322430119551521344f, --0.46053871095824006066f,0.88763962040285393496f,-0.47139673682599769755f, -0.88192126434835504956f,-0.48218377207912271887f,0.87607009419540660122f, --0.49289819222978398239f,0.87008699110871146054f,-0.50353838372571746440f, -0.86397285612158680745f,-0.51410274419322155026f,0.85772861000027211809f, --0.52458968267846872724f,0.85135519310526519554f,-0.53499761988709704230f, -0.84485356524970722791f,-0.54532498842204624179f,0.83822470555483818977f, --0.55557023301960195560f,0.83146961230254534669f,-0.56573181078361323149f, -0.82458930278502517996f,-0.57580819141784533866f,0.81758481315158371139f, --0.58579785745643886408f,0.81045719825259476821f,-0.59569930449243335691f, -0.80320753148064494287f,-0.60551104140432543410f,0.79583690460888356633f, --0.61523159058062670823f,0.78834642762660633863f,-0.62485948814238623239f, -0.78073722857209459924f,-0.63439328416364537677f,0.77301045336273710440f, --0.64383154288979127511f,0.76516726562245906962f,-0.65317284295377653347f, -0.75720884650648467851f,-0.66241577759017189475f,0.74913639452345925918f, --0.67155895484701844111f,0.74095112535495899486f,-0.68060099779545302212f, -0.73265427167241281570f,-0.68954054473706694051f,0.72424708295146689174f, --0.69837624940897280457f,0.71573082528381870571f,-0.70710678118654746172f, -0.70710678118654757274f,-0.71573082528381859468f,0.69837624940897291559f, --0.72424708295146678072f,0.68954054473706705153f,-0.73265427167241270467f, -0.68060099779545324417f,-0.74095112535495888384f,0.67155895484701855214f, --0.74913639452345914815f,0.66241577759017200577f,-0.75720884650648467851f, -0.65317284295377664449f,-0.76516726562245895860f,0.64383154288979138613f, --0.77301045336273699338f,0.63439328416364548779f,-0.78073722857209448822f, -0.62485948814238634341f,-0.78834642762660622761f,0.61523159058062693028f, --0.79583690460888345530f,0.60551104140432565615f,-0.80320753148064483184f, -0.59569930449243346793f,-0.81045719825259465718f,0.58579785745643897510f, --0.81758481315158360037f,0.57580819141784544968f,-0.82458930278502506894f, -0.56573181078361345353f,-0.83146961230254534669f,0.55557023301960217765f, --0.83822470555483807875f,0.54532498842204635281f,-0.84485356524970711689f, -0.53499761988709715332f,-0.85135519310526519554f,0.52458968267846894928f, --0.85772861000027200706f,0.51410274419322177231f,-0.86397285612158669643f, -0.50353838372571757542f,-0.87008699110871134952f,0.49289819222978414892f, --0.87607009419540649020f,0.48218377207912288540f,-0.88192126434835493853f, -0.47139673682599780857f,-0.88763962040285382393f,0.46053871095824022719f, --0.89322430119551521344f,0.44961132965460687272f,-0.89867446569395392775f, -0.43861623853852754751f,-0.90398929312344333820f,0.42755509343028202940f, --0.90916798309052238025f,0.41642956009763715253f,-0.91420975570353069095f, -0.40524131400498991651f,-0.91911385169005777040f,0.39399204006104815434f, --0.92387953251128673848f,0.38268343236508989280f,-0.92850608047321547822f, -0.37131719395183770960f,-0.93299279883473884567f,0.35989503653498833291f, --0.93733901191257484875f,0.34841868024943478677f,-0.94154406518302069529f, -0.33688985339222032867f,-0.94560732538052116869f,0.32531029216226325929f, --0.94952818059303667475f,0.31368174039889140658f,-0.95330604035419386211f, -0.30200594931922802866f,-0.95694033573220882438f,0.29028467725446238656f, --0.96043051941556578655f,0.27851968938505317075f,-0.96377606579543984022f, -0.26671275747489847641f,-0.96697647104485207059f,0.25486565960451468271f, --0.97003125319454397424f,0.24298017990326406523f,-0.97293995220556006576f, -0.23105810828067133156f,-0.97570213003852845901f,0.21910124015687004739f, --0.97831737071962754371f,0.20711137619221883788f,-0.98078528040323043058f, -0.19509032201612860891f,-0.98310548743121628501f,0.18303988795514089527f, --0.98527764238894122162f,0.17096188876030121717f,-0.98730141815785843473f, -0.15885814333386147346f,-0.98917650996478101444f,0.14673047445536180344f, --0.99090263542778000971f,0.13458070850712627875f,-0.99247953459870996706f, -0.12241067519921634832f,-0.99390697000235606051f,0.11022220729388323979f, --0.99518472667219681771f,0.09801714032956082567f,-0.99631261218277800129f, -0.08579731234444015753f,-0.99729045667869020697f,0.07356456359966773162f, --0.99811811290014917919f,0.06132073630220848809f,-0.99879545620517240501f, -0.04906767432741796636f,-0.99932238458834954375f,0.03680722294135883171f, --0.99969881869620424997f,0.02454122852291232629f,-0.99992470183914450299f, -0.01227153828572000692f,1.00000000000000000000f,0.00000000000000000000f, -0.99879545620517240501f,0.04906767432741801493f,0.99518472667219692873f, -0.09801714032956060363f,0.98917650996478101444f,0.14673047445536174793f, -0.98078528040323043058f,0.19509032201612824808f,0.97003125319454397424f, -0.24298017990326387094f,0.95694033573220882438f,0.29028467725446233105f, -0.94154406518302080631f,0.33688985339222005111f,0.92387953251128673848f, -0.38268343236508978178f,0.90398929312344333820f,0.42755509343028208491f, -0.88192126434835504956f,0.47139673682599764204f,0.85772861000027211809f, -0.51410274419322166128f,0.83146961230254523567f,0.55557023301960217765f, -0.80320753148064494287f,0.59569930449243335691f,0.77301045336273699338f, -0.63439328416364548779f,0.74095112535495921691f,0.67155895484701833009f, -0.70710678118654757274f,0.70710678118654757274f,0.67155895484701833009f, -0.74095112535495910588f,0.63439328416364548779f,0.77301045336273688235f, -0.59569930449243346793f,0.80320753148064483184f,0.55557023301960228867f, -0.83146961230254523567f,0.51410274419322166128f,0.85772861000027211809f, -0.47139673682599780857f,0.88192126434835493853f,0.42755509343028219593f, -0.90398929312344333820f,0.38268343236508983729f,0.92387953251128673848f, -0.33688985339222005111f,0.94154406518302080631f,0.29028467725446233105f, -0.95694033573220893540f,0.24298017990326398197f,0.97003125319454397424f, -0.19509032201612833135f,0.98078528040323043058f,0.14673047445536174793f, -0.98917650996478101444f,0.09801714032956077016f,0.99518472667219681771f, -0.04906767432741812596f,0.99879545620517240501f,0.00000000000000006123f, -1.00000000000000000000f,-0.04906767432741800800f,0.99879545620517240501f, --0.09801714032956064526f,0.99518472667219692873f,-0.14673047445536163691f, -0.98917650996478101444f,-0.19509032201612819257f,0.98078528040323043058f, --0.24298017990326387094f,0.97003125319454397424f,-0.29028467725446216452f, -0.95694033573220893540f,-0.33688985339221994009f,0.94154406518302080631f, --0.38268343236508972627f,0.92387953251128673848f,-0.42755509343028186287f, -0.90398929312344344922f,-0.47139673682599769755f,0.88192126434835504956f, --0.51410274419322155026f,0.85772861000027211809f,-0.55557023301960195560f, -0.83146961230254534669f,-0.59569930449243335691f,0.80320753148064494287f, --0.63439328416364537677f,0.77301045336273710440f,-0.67155895484701844111f, -0.74095112535495899486f,-0.70710678118654746172f,0.70710678118654757274f, --0.74095112535495888384f,0.67155895484701855214f,-0.77301045336273699338f, -0.63439328416364548779f,-0.80320753148064483184f,0.59569930449243346793f, --0.83146961230254534669f,0.55557023301960217765f,-0.85772861000027200706f, -0.51410274419322177231f,-0.88192126434835493853f,0.47139673682599780857f, --0.90398929312344333820f,0.42755509343028202940f,-0.92387953251128673848f, -0.38268343236508989280f,-0.94154406518302069529f,0.33688985339222032867f, --0.95694033573220882438f,0.29028467725446238656f,-0.97003125319454397424f, -0.24298017990326406523f,-0.98078528040323043058f,0.19509032201612860891f, --0.98917650996478101444f,0.14673047445536180344f,-0.99518472667219681771f, -0.09801714032956082567f,-0.99879545620517240501f,0.04906767432741796636f, -1.00000000000000000000f,0.00000000000000000000f,0.98078528040323043058f, -0.19509032201612824808f,0.92387953251128673848f,0.38268343236508978178f, -0.83146961230254523567f,0.55557023301960217765f,0.70710678118654757274f, -0.70710678118654757274f,0.55557023301960228867f,0.83146961230254523567f, -0.38268343236508983729f,0.92387953251128673848f,0.19509032201612833135f, -0.98078528040323043058f,0.00000000000000006123f,1.00000000000000000000f, --0.19509032201612819257f,0.98078528040323043058f,-0.38268343236508972627f, -0.92387953251128673848f,-0.55557023301960195560f,0.83146961230254534669f, --0.70710678118654746172f,0.70710678118654757274f,-0.83146961230254534669f, -0.55557023301960217765f,-0.92387953251128673848f,0.38268343236508989280f, --0.98078528040323043058f,0.19509032201612860891f,1.00000000000000000000f, -0.00000000000000000000f,0.70710678118654757274f,0.70710678118654757274f, -0.00000000000000006123f,1.00000000000000000000f,-0.70710678118654746172f, -0.70710678118654757274f,}; +1.00000000000000000000f,0.00000000000000000000f,0.99999529123306274414f, +0.00306795677170157433f,0.99998116493225097656f,0.00613588467240333557f, +0.99995762109756469727f,0.00920375436544418335f,0.99992471933364868164f, +0.01227153837680816650f,0.99988234043121337891f,0.01533920597285032272f, +0.99983060359954833984f,0.01840673014521598816f,0.99976938962936401367f, +0.02147408016026020050f,0.99969881772994995117f,0.02454122900962829590f, +0.99961882829666137695f,0.02760814502835273743f,0.99952942132949829102f, +0.03067480400204658508f,0.99943059682846069336f,0.03374117240309715271f, +0.99932235479354858398f,0.03680722415447235107f,0.99920475482940673828f, +0.03987292572855949402f,0.99907773733139038086f,0.04293825849890708923f, +0.99894130229949951172f,0.04600318148732185364f,0.99879544973373413086f, +0.04906767606735229492f,0.99864023923873901367f,0.05213170498609542847f, +0.99847555160522460938f,0.05519524589180946350f,0.99830156564712524414f, +0.05825826525688171387f,0.99811810255050659180f,0.06132073700428009033f, +0.99792528152465820312f,0.06438262760639190674f,0.99772304296493530273f, +0.06744392216205596924f,0.99751144647598266602f,0.07050457596778869629f, +0.99729043245315551758f,0.07356456667184829712f,0.99706006050109863281f, +0.07662386447191238403f,0.99682027101516723633f,0.07968243956565856934f, +0.99657112360000610352f,0.08274026215076446533f,0.99631261825561523438f, +0.08579730987548828125f,0.99604469537734985352f,0.08885355293750762939f, +0.99576741456985473633f,0.09190895408391952515f,0.99548077583312988281f, +0.09496349841356277466f,0.99518471956253051758f,0.09801714122295379639f, +0.99487930536270141602f,0.10106986016035079956f,0.99456459283828735352f, +0.10412163287401199341f,0.99424046277999877930f,0.10717242211103439331f, +0.99390697479248046875f,0.11022220551967620850f,0.99356412887573242188f, +0.11327095329761505127f,0.99321192502975463867f,0.11631862819194793701f, +0.99285042285919189453f,0.11936521530151367188f,0.99247956275939941406f, +0.12241067737340927124f,0.99209928512573242188f,0.12545497715473175049f, +0.99170976877212524414f,0.12849810719490051270f,0.99131083488464355469f, +0.13154003024101257324f,0.99090266227722167969f,0.13458070158958435059f, +0.99048507213592529297f,0.13762012124061584473f,0.99005818367004394531f, +0.14065824449062347412f,0.98962199687957763672f,0.14369502663612365723f, +0.98917651176452636719f,0.14673046767711639404f,0.98872166872024536133f, +0.14976453781127929688f,0.98825758695602416992f,0.15279719233512878418f, +0.98778414726257324219f,0.15582840144634246826f,0.98730140924453735352f, +0.15885815024375915527f,0.98680937290191650391f,0.16188639402389526367f, +0.98630809783935546875f,0.16491311788558959961f,0.98579752445220947266f, +0.16793829202651977539f,0.98527765274047851562f,0.17096188664436340332f, +0.98474848270416259766f,0.17398387193679809570f,0.98421007394790649414f, +0.17700421810150146484f,0.98366242647171020508f,0.18002289533615112305f, +0.98310548067092895508f,0.18303988873958587646f,0.98253929615020751953f, +0.18605515360832214355f,0.98196387290954589844f,0.18906866014003753662f, +0.98137921094894409180f,0.19208039343357086182f,0.98078525066375732422f, +0.19509032368659973145f,0.98018211126327514648f,0.19809840619564056396f, +0.97956979274749755859f,0.20110464096069335938f,0.97894817590713500977f, +0.20410896837711334229f,0.97831737995147705078f,0.20711137354373931885f, +0.97767734527587890625f,0.21011184155941009521f,0.97702813148498535156f, +0.21311031281948089600f,0.97636973857879638672f,0.21610680222511291504f, +0.97570210695266723633f,0.21910123527050018311f,0.97502535581588745117f, +0.22209362685680389404f,0.97433936595916748047f,0.22508391737937927246f, +0.97364425659179687500f,0.22807207703590393066f,0.97293996810913085938f, +0.23105810582637786865f,0.97222650051116943359f,0.23404195904731750488f, +0.97150391340255737305f,0.23702360689640045166f,0.97077214717864990234f, +0.24000301957130432129f,0.97003126144409179688f,0.24298018217086791992f, +0.96928125619888305664f,0.24595504999160766602f,0.96852207183837890625f, +0.24892760813236236572f,0.96775382757186889648f,0.25189781188964843750f, +0.96697646379470825195f,0.25486564636230468750f,0.96618998050689697266f, +0.25783109664916992188f,0.96539443731307983398f,0.26079410314559936523f, +0.96458977460861206055f,0.26375466585159301758f,0.96377605199813842773f, +0.26671275496482849121f,0.96295326948165893555f,0.26966831088066101074f, +0.96212142705917358398f,0.27262136340141296387f,0.96128046512603759766f, +0.27557182312011718750f,0.96043050289154052734f,0.27851969003677368164f, +0.95957154035568237305f,0.28146493434906005859f,0.95870345830917358398f, +0.28440752625465393066f,0.95782643556594848633f,0.28734746575355529785f, +0.95694035291671752930f,0.29028466343879699707f,0.95604526996612548828f, +0.29321914911270141602f,0.95514118671417236328f,0.29615089297294616699f, +0.95422810316085815430f,0.29907983541488647461f,0.95330601930618286133f, +0.30200594663619995117f,0.95237499475479125977f,0.30492922663688659668f, +0.95143502950668334961f,0.30784964561462402344f,0.95048606395721435547f, +0.31076714396476745605f,0.94952815771102905273f,0.31368175148963928223f, +0.94856137037277221680f,0.31659337878227233887f,0.94758558273315429688f, +0.31950202584266662598f,0.94660091400146484375f,0.32240769267082214355f, +0.94560730457305908203f,0.32531028985977172852f,0.94460481405258178711f, +0.32820984721183776855f,0.94359344244003295898f,0.33110630512237548828f, +0.94257318973541259766f,0.33399966359138488770f,0.94154405593872070312f, +0.33688986301422119141f,0.94050604104995727539f,0.33977687358856201172f, +0.93945920467376708984f,0.34266072511672973633f,0.93840354681015014648f, +0.34554132819175720215f,0.93733900785446166992f,0.34841868281364440918f, +0.93626564741134643555f,0.35129275918006896973f,0.93518352508544921875f, +0.35416352748870849609f,0.93409252166748046875f,0.35703095793724060059f, +0.93299281597137451172f,0.35989505052566528320f,0.93188428878784179688f, +0.36275571584701538086f,0.93076694011688232422f,0.36561298370361328125f, +0.92964088916778564453f,0.36846682429313659668f,0.92850607633590698242f, +0.37131720781326293945f,0.92736250162124633789f,0.37416407465934753418f, +0.92621022462844848633f,0.37700742483139038086f,0.92504924535751342773f, +0.37984719872474670410f,0.92387950420379638672f,0.38268342614173889160f, +0.92270112037658691406f,0.38551604747772216797f,0.92151403427124023438f, +0.38834503293037414551f,0.92031830549240112305f,0.39117038249969482422f, +0.91911387443542480469f,0.39399203658103942871f,0.91790080070495605469f, +0.39680999517440795898f,0.91667908430099487305f,0.39962419867515563965f, +0.91544872522354125977f,0.40243464708328247070f,0.91420978307723999023f, +0.40524131059646606445f,0.91296219825744628906f,0.40804415941238403320f, +0.91170603036880493164f,0.41084316372871398926f,0.91044127941131591797f, +0.41363832354545593262f,0.90916800498962402344f,0.41642954945564270020f, +0.90788608789443969727f,0.41921690106391906738f,0.90659570693969726562f, +0.42200025916099548340f,0.90529674291610717773f,0.42477968335151672363f, +0.90398931503295898438f,0.42755508422851562500f,0.90267330408096313477f, +0.43032649159431457520f,0.90134882926940917969f,0.43309381604194641113f, +0.90001589059829711914f,0.43585708737373352051f,0.89867448806762695312f, +0.43861624598503112793f,0.89732456207275390625f,0.44137126207351684570f, +0.89596623182296752930f,0.44412213563919067383f,0.89459949731826782227f, +0.44686883687973022461f,0.89322429895401000977f,0.44961133599281311035f, +0.89184069633483886719f,0.45234957337379455566f,0.89044874906539916992f, +0.45508357882499694824f,0.88904833793640136719f,0.45781329274177551270f, +0.88763964176177978516f,0.46053871512413024902f,0.88622254133224487305f, +0.46325978636741638184f,0.88479709625244140625f,0.46597650647163391113f, +0.88336336612701416016f,0.46868881583213806152f,0.88192129135131835938f, +0.47139674425125122070f,0.88047087192535400391f,0.47410020232200622559f, +0.87901222705841064453f,0.47679921984672546387f,0.87754529714584350586f, +0.47949376702308654785f,0.87607008218765258789f,0.48218378424644470215f, +0.87458664178848266602f,0.48486924171447753906f,0.87309497594833374023f, +0.48755016922950744629f,0.87159508466720581055f,0.49022647738456726074f, +0.87008696794509887695f,0.49289819598197937012f,0.86857068538665771484f, +0.49556526541709899902f,0.86704623699188232422f,0.49822765588760375977f, +0.86551362276077270508f,0.50088536739349365234f,0.86397284269332885742f, +0.50353837013244628906f,0.86242395639419555664f,0.50618666410446166992f, +0.86086696386337280273f,0.50883013010025024414f,0.85930180549621582031f, +0.51146882772445678711f,0.85772860050201416016f,0.51410275697708129883f, +0.85614734888076782227f,0.51673179864883422852f,0.85455799102783203125f, +0.51935601234436035156f,0.85296058654785156250f,0.52197527885437011719f, +0.85135519504547119141f,0.52458965778350830078f,0.84974175691604614258f, +0.52719914913177490234f,0.84812033176422119141f,0.52980363368988037109f, +0.84649091958999633789f,0.53240311145782470703f,0.84485357999801635742f, +0.53499764204025268555f,0.84320825338363647461f,0.53758704662322998047f, +0.84155499935150146484f,0.54017144441604614258f,0.83989381790161132812f, +0.54275077581405639648f,0.83822470903396606445f,0.54532498121261596680f, +0.83654773235321044922f,0.54789406061172485352f,0.83486288785934448242f, +0.55045795440673828125f,0.83317017555236816406f,0.55301672220230102539f, +0.83146959543228149414f,0.55557024478912353516f,0.82976120710372924805f, +0.55811852216720581055f,0.82804507017135620117f,0.56066155433654785156f, +0.82632106542587280273f,0.56319934129714965820f,0.82458931207656860352f, +0.56573182344436645508f,0.82284981012344360352f,0.56825894117355346680f, +0.82110249996185302734f,0.57078075408935546875f,0.81934750080108642578f, +0.57329714298248291016f,0.81758481264114379883f,0.57580816745758056641f, +0.81581443548202514648f,0.57831376791000366211f,0.81403630971908569336f, +0.58081394433975219727f,0.81225061416625976562f,0.58330863714218139648f, +0.81045717000961303711f,0.58579784631729125977f,0.80865615606307983398f, +0.58828157186508178711f,0.80684757232666015625f,0.59075969457626342773f, +0.80503135919570922852f,0.59323227405548095703f,0.80320751667022705078f, +0.59569931030273437500f,0.80137616395950317383f,0.59816068410873413086f, +0.79953724145889282227f,0.60061645507812500000f,0.79769086837768554688f, +0.60306662321090698242f,0.79583692550659179688f,0.60551106929779052734f, +0.79397547245025634766f,0.60794979333877563477f,0.79210656881332397461f, +0.61038279533386230469f,0.79023021459579467773f,0.61281007528305053711f, +0.78834640979766845703f,0.61523157358169555664f,0.78645521402359008789f, +0.61764729022979736328f,0.78455656766891479492f,0.62005722522735595703f, +0.78265058994293212891f,0.62246125936508178711f,0.78073722124099731445f, +0.62485951185226440430f,0.77881652116775512695f,0.62725180387496948242f, +0.77688848972320556641f,0.62963825464248657227f,0.77495312690734863281f, +0.63201874494552612305f,0.77301043272018432617f,0.63439327478408813477f, +0.77106052637100219727f,0.63676184415817260742f,0.76910334825515747070f, +0.63912445306777954102f,0.76713889837265014648f,0.64148104190826416016f, +0.76516723632812500000f,0.64383155107498168945f,0.76318842172622680664f, +0.64617604017257690430f,0.76120239496231079102f,0.64851438999176025391f, +0.75920921564102172852f,0.65084666013717651367f,0.75720882415771484375f, +0.65317285060882568359f,0.75520139932632446289f,0.65549284219741821289f, +0.75318682193756103516f,0.65780669450759887695f,0.75116515159606933594f, +0.66011434793472290039f,0.74913638830184936523f,0.66241580247879028320f, +0.74710059165954589844f,0.66471099853515625000f,0.74505776166915893555f, +0.66699993610382080078f,0.74300795793533325195f,0.66928261518478393555f, +0.74095112085342407227f,0.67155897617340087891f,0.73888731002807617188f, +0.67382901906967163086f,0.73681658506393432617f,0.67609268426895141602f, +0.73473888635635375977f,0.67835003137588500977f,0.73265427350997924805f, +0.68060100078582763672f,0.73056274652481079102f,0.68284553289413452148f, +0.72846436500549316406f,0.68508368730545043945f,0.72635912895202636719f, +0.68731534481048583984f,0.72424709796905517578f,0.68954056501388549805f, +0.72212821245193481445f,0.69175922870635986328f,0.72000253200531005859f, +0.69397145509719848633f,0.71787005662918090820f,0.69617712497711181641f, +0.71573084592819213867f,0.69837623834609985352f,0.71358484029769897461f, +0.70056879520416259766f,0.71143221855163574219f,0.70275473594665527344f, +0.70927280187606811523f,0.70493406057357788086f,0.70710676908493041992f, +0.70710676908493041992f,0.70493406057357788086f,0.70927280187606811523f, +0.70275473594665527344f,0.71143221855163574219f,0.70056879520416259766f, +0.71358484029769897461f,0.69837623834609985352f,0.71573084592819213867f, +0.69617712497711181641f,0.71787005662918090820f,0.69397145509719848633f, +0.72000253200531005859f,0.69175922870635986328f,0.72212821245193481445f, +0.68954056501388549805f,0.72424709796905517578f,0.68731534481048583984f, +0.72635912895202636719f,0.68508368730545043945f,0.72846436500549316406f, +0.68284553289413452148f,0.73056274652481079102f,0.68060100078582763672f, +0.73265427350997924805f,0.67835003137588500977f,0.73473888635635375977f, +0.67609268426895141602f,0.73681658506393432617f,0.67382901906967163086f, +0.73888731002807617188f,0.67155897617340087891f,0.74095112085342407227f, +0.66928261518478393555f,0.74300795793533325195f,0.66699993610382080078f, +0.74505776166915893555f,0.66471099853515625000f,0.74710059165954589844f, +0.66241580247879028320f,0.74913638830184936523f,0.66011434793472290039f, +0.75116515159606933594f,0.65780669450759887695f,0.75318682193756103516f, +0.65549284219741821289f,0.75520139932632446289f,0.65317285060882568359f, +0.75720882415771484375f,0.65084666013717651367f,0.75920921564102172852f, +0.64851438999176025391f,0.76120239496231079102f,0.64617604017257690430f, +0.76318842172622680664f,0.64383155107498168945f,0.76516723632812500000f, +0.64148104190826416016f,0.76713889837265014648f,0.63912445306777954102f, +0.76910334825515747070f,0.63676184415817260742f,0.77106052637100219727f, +0.63439327478408813477f,0.77301043272018432617f,0.63201874494552612305f, +0.77495312690734863281f,0.62963825464248657227f,0.77688848972320556641f, +0.62725180387496948242f,0.77881652116775512695f,0.62485951185226440430f, +0.78073722124099731445f,0.62246125936508178711f,0.78265058994293212891f, +0.62005722522735595703f,0.78455656766891479492f,0.61764729022979736328f, +0.78645521402359008789f,0.61523157358169555664f,0.78834640979766845703f, +0.61281007528305053711f,0.79023021459579467773f,0.61038279533386230469f, +0.79210656881332397461f,0.60794979333877563477f,0.79397547245025634766f, +0.60551106929779052734f,0.79583692550659179688f,0.60306662321090698242f, +0.79769086837768554688f,0.60061645507812500000f,0.79953724145889282227f, +0.59816068410873413086f,0.80137616395950317383f,0.59569931030273437500f, +0.80320751667022705078f,0.59323227405548095703f,0.80503135919570922852f, +0.59075969457626342773f,0.80684757232666015625f,0.58828157186508178711f, +0.80865615606307983398f,0.58579784631729125977f,0.81045717000961303711f, +0.58330863714218139648f,0.81225061416625976562f,0.58081394433975219727f, +0.81403630971908569336f,0.57831376791000366211f,0.81581443548202514648f, +0.57580816745758056641f,0.81758481264114379883f,0.57329714298248291016f, +0.81934750080108642578f,0.57078075408935546875f,0.82110249996185302734f, +0.56825894117355346680f,0.82284981012344360352f,0.56573182344436645508f, +0.82458931207656860352f,0.56319934129714965820f,0.82632106542587280273f, +0.56066155433654785156f,0.82804507017135620117f,0.55811852216720581055f, +0.82976120710372924805f,0.55557024478912353516f,0.83146959543228149414f, +0.55301672220230102539f,0.83317017555236816406f,0.55045795440673828125f, +0.83486288785934448242f,0.54789406061172485352f,0.83654773235321044922f, +0.54532498121261596680f,0.83822470903396606445f,0.54275077581405639648f, +0.83989381790161132812f,0.54017144441604614258f,0.84155499935150146484f, +0.53758704662322998047f,0.84320825338363647461f,0.53499764204025268555f, +0.84485357999801635742f,0.53240311145782470703f,0.84649091958999633789f, +0.52980363368988037109f,0.84812033176422119141f,0.52719914913177490234f, +0.84974175691604614258f,0.52458965778350830078f,0.85135519504547119141f, +0.52197527885437011719f,0.85296058654785156250f,0.51935601234436035156f, +0.85455799102783203125f,0.51673179864883422852f,0.85614734888076782227f, +0.51410275697708129883f,0.85772860050201416016f,0.51146882772445678711f, +0.85930180549621582031f,0.50883013010025024414f,0.86086696386337280273f, +0.50618666410446166992f,0.86242395639419555664f,0.50353837013244628906f, +0.86397284269332885742f,0.50088536739349365234f,0.86551362276077270508f, +0.49822765588760375977f,0.86704623699188232422f,0.49556526541709899902f, +0.86857068538665771484f,0.49289819598197937012f,0.87008696794509887695f, +0.49022647738456726074f,0.87159508466720581055f,0.48755016922950744629f, +0.87309497594833374023f,0.48486924171447753906f,0.87458664178848266602f, +0.48218378424644470215f,0.87607008218765258789f,0.47949376702308654785f, +0.87754529714584350586f,0.47679921984672546387f,0.87901222705841064453f, +0.47410020232200622559f,0.88047087192535400391f,0.47139674425125122070f, +0.88192129135131835938f,0.46868881583213806152f,0.88336336612701416016f, +0.46597650647163391113f,0.88479709625244140625f,0.46325978636741638184f, +0.88622254133224487305f,0.46053871512413024902f,0.88763964176177978516f, +0.45781329274177551270f,0.88904833793640136719f,0.45508357882499694824f, +0.89044874906539916992f,0.45234957337379455566f,0.89184069633483886719f, +0.44961133599281311035f,0.89322429895401000977f,0.44686883687973022461f, +0.89459949731826782227f,0.44412213563919067383f,0.89596623182296752930f, +0.44137126207351684570f,0.89732456207275390625f,0.43861624598503112793f, +0.89867448806762695312f,0.43585708737373352051f,0.90001589059829711914f, +0.43309381604194641113f,0.90134882926940917969f,0.43032649159431457520f, +0.90267330408096313477f,0.42755508422851562500f,0.90398931503295898438f, +0.42477968335151672363f,0.90529674291610717773f,0.42200025916099548340f, +0.90659570693969726562f,0.41921690106391906738f,0.90788608789443969727f, +0.41642954945564270020f,0.90916800498962402344f,0.41363832354545593262f, +0.91044127941131591797f,0.41084316372871398926f,0.91170603036880493164f, +0.40804415941238403320f,0.91296219825744628906f,0.40524131059646606445f, +0.91420978307723999023f,0.40243464708328247070f,0.91544872522354125977f, +0.39962419867515563965f,0.91667908430099487305f,0.39680999517440795898f, +0.91790080070495605469f,0.39399203658103942871f,0.91911387443542480469f, +0.39117038249969482422f,0.92031830549240112305f,0.38834503293037414551f, +0.92151403427124023438f,0.38551604747772216797f,0.92270112037658691406f, +0.38268342614173889160f,0.92387950420379638672f,0.37984719872474670410f, +0.92504924535751342773f,0.37700742483139038086f,0.92621022462844848633f, +0.37416407465934753418f,0.92736250162124633789f,0.37131720781326293945f, +0.92850607633590698242f,0.36846682429313659668f,0.92964088916778564453f, +0.36561298370361328125f,0.93076694011688232422f,0.36275571584701538086f, +0.93188428878784179688f,0.35989505052566528320f,0.93299281597137451172f, +0.35703095793724060059f,0.93409252166748046875f,0.35416352748870849609f, +0.93518352508544921875f,0.35129275918006896973f,0.93626564741134643555f, +0.34841868281364440918f,0.93733900785446166992f,0.34554132819175720215f, +0.93840354681015014648f,0.34266072511672973633f,0.93945920467376708984f, +0.33977687358856201172f,0.94050604104995727539f,0.33688986301422119141f, +0.94154405593872070312f,0.33399966359138488770f,0.94257318973541259766f, +0.33110630512237548828f,0.94359344244003295898f,0.32820984721183776855f, +0.94460481405258178711f,0.32531028985977172852f,0.94560730457305908203f, +0.32240769267082214355f,0.94660091400146484375f,0.31950202584266662598f, +0.94758558273315429688f,0.31659337878227233887f,0.94856137037277221680f, +0.31368175148963928223f,0.94952815771102905273f,0.31076714396476745605f, +0.95048606395721435547f,0.30784964561462402344f,0.95143502950668334961f, +0.30492922663688659668f,0.95237499475479125977f,0.30200594663619995117f, +0.95330601930618286133f,0.29907983541488647461f,0.95422810316085815430f, +0.29615089297294616699f,0.95514118671417236328f,0.29321914911270141602f, +0.95604526996612548828f,0.29028466343879699707f,0.95694035291671752930f, +0.28734746575355529785f,0.95782643556594848633f,0.28440752625465393066f, +0.95870345830917358398f,0.28146493434906005859f,0.95957154035568237305f, +0.27851969003677368164f,0.96043050289154052734f,0.27557182312011718750f, +0.96128046512603759766f,0.27262136340141296387f,0.96212142705917358398f, +0.26966831088066101074f,0.96295326948165893555f,0.26671275496482849121f, +0.96377605199813842773f,0.26375466585159301758f,0.96458977460861206055f, +0.26079410314559936523f,0.96539443731307983398f,0.25783109664916992188f, +0.96618998050689697266f,0.25486564636230468750f,0.96697646379470825195f, +0.25189781188964843750f,0.96775382757186889648f,0.24892760813236236572f, +0.96852207183837890625f,0.24595504999160766602f,0.96928125619888305664f, +0.24298018217086791992f,0.97003126144409179688f,0.24000301957130432129f, +0.97077214717864990234f,0.23702360689640045166f,0.97150391340255737305f, +0.23404195904731750488f,0.97222650051116943359f,0.23105810582637786865f, +0.97293996810913085938f,0.22807207703590393066f,0.97364425659179687500f, +0.22508391737937927246f,0.97433936595916748047f,0.22209362685680389404f, +0.97502535581588745117f,0.21910123527050018311f,0.97570210695266723633f, +0.21610680222511291504f,0.97636973857879638672f,0.21311031281948089600f, +0.97702813148498535156f,0.21011184155941009521f,0.97767734527587890625f, +0.20711137354373931885f,0.97831737995147705078f,0.20410896837711334229f, +0.97894817590713500977f,0.20110464096069335938f,0.97956979274749755859f, +0.19809840619564056396f,0.98018211126327514648f,0.19509032368659973145f, +0.98078525066375732422f,0.19208039343357086182f,0.98137921094894409180f, +0.18906866014003753662f,0.98196387290954589844f,0.18605515360832214355f, +0.98253929615020751953f,0.18303988873958587646f,0.98310548067092895508f, +0.18002289533615112305f,0.98366242647171020508f,0.17700421810150146484f, +0.98421007394790649414f,0.17398387193679809570f,0.98474848270416259766f, +0.17096188664436340332f,0.98527765274047851562f,0.16793829202651977539f, +0.98579752445220947266f,0.16491311788558959961f,0.98630809783935546875f, +0.16188639402389526367f,0.98680937290191650391f,0.15885815024375915527f, +0.98730140924453735352f,0.15582840144634246826f,0.98778414726257324219f, +0.15279719233512878418f,0.98825758695602416992f,0.14976453781127929688f, +0.98872166872024536133f,0.14673046767711639404f,0.98917651176452636719f, +0.14369502663612365723f,0.98962199687957763672f,0.14065824449062347412f, +0.99005818367004394531f,0.13762012124061584473f,0.99048507213592529297f, +0.13458070158958435059f,0.99090266227722167969f,0.13154003024101257324f, +0.99131083488464355469f,0.12849810719490051270f,0.99170976877212524414f, +0.12545497715473175049f,0.99209928512573242188f,0.12241067737340927124f, +0.99247956275939941406f,0.11936521530151367188f,0.99285042285919189453f, +0.11631862819194793701f,0.99321192502975463867f,0.11327095329761505127f, +0.99356412887573242188f,0.11022220551967620850f,0.99390697479248046875f, +0.10717242211103439331f,0.99424046277999877930f,0.10412163287401199341f, +0.99456459283828735352f,0.10106986016035079956f,0.99487930536270141602f, +0.09801714122295379639f,0.99518471956253051758f,0.09496349841356277466f, +0.99548077583312988281f,0.09190895408391952515f,0.99576741456985473633f, +0.08885355293750762939f,0.99604469537734985352f,0.08579730987548828125f, +0.99631261825561523438f,0.08274026215076446533f,0.99657112360000610352f, +0.07968243956565856934f,0.99682027101516723633f,0.07662386447191238403f, +0.99706006050109863281f,0.07356456667184829712f,0.99729043245315551758f, +0.07050457596778869629f,0.99751144647598266602f,0.06744392216205596924f, +0.99772304296493530273f,0.06438262760639190674f,0.99792528152465820312f, +0.06132073700428009033f,0.99811810255050659180f,0.05825826525688171387f, +0.99830156564712524414f,0.05519524589180946350f,0.99847555160522460938f, +0.05213170498609542847f,0.99864023923873901367f,0.04906767606735229492f, +0.99879544973373413086f,0.04600318148732185364f,0.99894130229949951172f, +0.04293825849890708923f,0.99907773733139038086f,0.03987292572855949402f, +0.99920475482940673828f,0.03680722415447235107f,0.99932235479354858398f, +0.03374117240309715271f,0.99943059682846069336f,0.03067480400204658508f, +0.99952942132949829102f,0.02760814502835273743f,0.99961882829666137695f, +0.02454122900962829590f,0.99969881772994995117f,0.02147408016026020050f, +0.99976938962936401367f,0.01840673014521598816f,0.99983060359954833984f, +0.01533920597285032272f,0.99988234043121337891f,0.01227153837680816650f, +0.99992471933364868164f,0.00920375436544418335f,0.99995762109756469727f, +0.00613588467240333557f,0.99998116493225097656f,0.00306795677170157433f, +0.99999529123306274414f,0.00000000000000006123f,1.00000000000000000000f, +-0.00306795677170157433f,0.99999529123306274414f,-0.00613588467240333557f, +0.99998116493225097656f,-0.00920375436544418335f,0.99995762109756469727f, +-0.01227153837680816650f,0.99992471933364868164f,-0.01533920597285032272f, +0.99988234043121337891f,-0.01840673014521598816f,0.99983060359954833984f, +-0.02147408016026020050f,0.99976938962936401367f,-0.02454122900962829590f, +0.99969881772994995117f,-0.02760814502835273743f,0.99961882829666137695f, +-0.03067480400204658508f,0.99952942132949829102f,-0.03374117240309715271f, +0.99943059682846069336f,-0.03680722415447235107f,0.99932235479354858398f, +-0.03987292572855949402f,0.99920475482940673828f,-0.04293825849890708923f, +0.99907773733139038086f,-0.04600318148732185364f,0.99894130229949951172f, +-0.04906767606735229492f,0.99879544973373413086f,-0.05213170498609542847f, +0.99864023923873901367f,-0.05519524589180946350f,0.99847555160522460938f, +-0.05825826525688171387f,0.99830156564712524414f,-0.06132073700428009033f, +0.99811810255050659180f,-0.06438262760639190674f,0.99792528152465820312f, +-0.06744392216205596924f,0.99772304296493530273f,-0.07050457596778869629f, +0.99751144647598266602f,-0.07356456667184829712f,0.99729043245315551758f, +-0.07662386447191238403f,0.99706006050109863281f,-0.07968243956565856934f, +0.99682027101516723633f,-0.08274026215076446533f,0.99657112360000610352f, +-0.08579730987548828125f,0.99631261825561523438f,-0.08885355293750762939f, +0.99604469537734985352f,-0.09190895408391952515f,0.99576741456985473633f, +-0.09496349841356277466f,0.99548077583312988281f,-0.09801714122295379639f, +0.99518471956253051758f,-0.10106986016035079956f,0.99487930536270141602f, +-0.10412163287401199341f,0.99456459283828735352f,-0.10717242211103439331f, +0.99424046277999877930f,-0.11022220551967620850f,0.99390697479248046875f, +-0.11327095329761505127f,0.99356412887573242188f,-0.11631862819194793701f, +0.99321192502975463867f,-0.11936521530151367188f,0.99285042285919189453f, +-0.12241067737340927124f,0.99247956275939941406f,-0.12545497715473175049f, +0.99209928512573242188f,-0.12849810719490051270f,0.99170976877212524414f, +-0.13154003024101257324f,0.99131083488464355469f,-0.13458070158958435059f, +0.99090266227722167969f,-0.13762012124061584473f,0.99048507213592529297f, +-0.14065824449062347412f,0.99005818367004394531f,-0.14369502663612365723f, +0.98962199687957763672f,-0.14673046767711639404f,0.98917651176452636719f, +-0.14976453781127929688f,0.98872166872024536133f,-0.15279719233512878418f, +0.98825758695602416992f,-0.15582840144634246826f,0.98778414726257324219f, +-0.15885815024375915527f,0.98730140924453735352f,-0.16188639402389526367f, +0.98680937290191650391f,-0.16491311788558959961f,0.98630809783935546875f, +-0.16793829202651977539f,0.98579752445220947266f,-0.17096188664436340332f, +0.98527765274047851562f,-0.17398387193679809570f,0.98474848270416259766f, +-0.17700421810150146484f,0.98421007394790649414f,-0.18002289533615112305f, +0.98366242647171020508f,-0.18303988873958587646f,0.98310548067092895508f, +-0.18605515360832214355f,0.98253929615020751953f,-0.18906866014003753662f, +0.98196387290954589844f,-0.19208039343357086182f,0.98137921094894409180f, +-0.19509032368659973145f,0.98078525066375732422f,-0.19809840619564056396f, +0.98018211126327514648f,-0.20110464096069335938f,0.97956979274749755859f, +-0.20410896837711334229f,0.97894817590713500977f,-0.20711137354373931885f, +0.97831737995147705078f,-0.21011184155941009521f,0.97767734527587890625f, +-0.21311031281948089600f,0.97702813148498535156f,-0.21610680222511291504f, +0.97636973857879638672f,-0.21910123527050018311f,0.97570210695266723633f, +-0.22209362685680389404f,0.97502535581588745117f,-0.22508391737937927246f, +0.97433936595916748047f,-0.22807207703590393066f,0.97364425659179687500f, +-0.23105810582637786865f,0.97293996810913085938f,-0.23404195904731750488f, +0.97222650051116943359f,-0.23702360689640045166f,0.97150391340255737305f, +-0.24000301957130432129f,0.97077214717864990234f,-0.24298018217086791992f, +0.97003126144409179688f,-0.24595504999160766602f,0.96928125619888305664f, +-0.24892760813236236572f,0.96852207183837890625f,-0.25189781188964843750f, +0.96775382757186889648f,-0.25486564636230468750f,0.96697646379470825195f, +-0.25783109664916992188f,0.96618998050689697266f,-0.26079410314559936523f, +0.96539443731307983398f,-0.26375466585159301758f,0.96458977460861206055f, +-0.26671275496482849121f,0.96377605199813842773f,-0.26966831088066101074f, +0.96295326948165893555f,-0.27262136340141296387f,0.96212142705917358398f, +-0.27557182312011718750f,0.96128046512603759766f,-0.27851969003677368164f, +0.96043050289154052734f,-0.28146493434906005859f,0.95957154035568237305f, +-0.28440752625465393066f,0.95870345830917358398f,-0.28734746575355529785f, +0.95782643556594848633f,-0.29028466343879699707f,0.95694035291671752930f, +-0.29321914911270141602f,0.95604526996612548828f,-0.29615089297294616699f, +0.95514118671417236328f,-0.29907983541488647461f,0.95422810316085815430f, +-0.30200594663619995117f,0.95330601930618286133f,-0.30492922663688659668f, +0.95237499475479125977f,-0.30784964561462402344f,0.95143502950668334961f, +-0.31076714396476745605f,0.95048606395721435547f,-0.31368175148963928223f, +0.94952815771102905273f,-0.31659337878227233887f,0.94856137037277221680f, +-0.31950202584266662598f,0.94758558273315429688f,-0.32240769267082214355f, +0.94660091400146484375f,-0.32531028985977172852f,0.94560730457305908203f, +-0.32820984721183776855f,0.94460481405258178711f,-0.33110630512237548828f, +0.94359344244003295898f,-0.33399966359138488770f,0.94257318973541259766f, +-0.33688986301422119141f,0.94154405593872070312f,-0.33977687358856201172f, +0.94050604104995727539f,-0.34266072511672973633f,0.93945920467376708984f, +-0.34554132819175720215f,0.93840354681015014648f,-0.34841868281364440918f, +0.93733900785446166992f,-0.35129275918006896973f,0.93626564741134643555f, +-0.35416352748870849609f,0.93518352508544921875f,-0.35703095793724060059f, +0.93409252166748046875f,-0.35989505052566528320f,0.93299281597137451172f, +-0.36275571584701538086f,0.93188428878784179688f,-0.36561298370361328125f, +0.93076694011688232422f,-0.36846682429313659668f,0.92964088916778564453f, +-0.37131720781326293945f,0.92850607633590698242f,-0.37416407465934753418f, +0.92736250162124633789f,-0.37700742483139038086f,0.92621022462844848633f, +-0.37984719872474670410f,0.92504924535751342773f,-0.38268342614173889160f, +0.92387950420379638672f,-0.38551604747772216797f,0.92270112037658691406f, +-0.38834503293037414551f,0.92151403427124023438f,-0.39117038249969482422f, +0.92031830549240112305f,-0.39399203658103942871f,0.91911387443542480469f, +-0.39680999517440795898f,0.91790080070495605469f,-0.39962419867515563965f, +0.91667908430099487305f,-0.40243464708328247070f,0.91544872522354125977f, +-0.40524131059646606445f,0.91420978307723999023f,-0.40804415941238403320f, +0.91296219825744628906f,-0.41084316372871398926f,0.91170603036880493164f, +-0.41363832354545593262f,0.91044127941131591797f,-0.41642954945564270020f, +0.90916800498962402344f,-0.41921690106391906738f,0.90788608789443969727f, +-0.42200025916099548340f,0.90659570693969726562f,-0.42477968335151672363f, +0.90529674291610717773f,-0.42755508422851562500f,0.90398931503295898438f, +-0.43032649159431457520f,0.90267330408096313477f,-0.43309381604194641113f, +0.90134882926940917969f,-0.43585708737373352051f,0.90001589059829711914f, +-0.43861624598503112793f,0.89867448806762695312f,-0.44137126207351684570f, +0.89732456207275390625f,-0.44412213563919067383f,0.89596623182296752930f, +-0.44686883687973022461f,0.89459949731826782227f,-0.44961133599281311035f, +0.89322429895401000977f,-0.45234957337379455566f,0.89184069633483886719f, +-0.45508357882499694824f,0.89044874906539916992f,-0.45781329274177551270f, +0.88904833793640136719f,-0.46053871512413024902f,0.88763964176177978516f, +-0.46325978636741638184f,0.88622254133224487305f,-0.46597650647163391113f, +0.88479709625244140625f,-0.46868881583213806152f,0.88336336612701416016f, +-0.47139674425125122070f,0.88192129135131835938f,-0.47410020232200622559f, +0.88047087192535400391f,-0.47679921984672546387f,0.87901222705841064453f, +-0.47949376702308654785f,0.87754529714584350586f,-0.48218378424644470215f, +0.87607008218765258789f,-0.48486924171447753906f,0.87458664178848266602f, +-0.48755016922950744629f,0.87309497594833374023f,-0.49022647738456726074f, +0.87159508466720581055f,-0.49289819598197937012f,0.87008696794509887695f, +-0.49556526541709899902f,0.86857068538665771484f,-0.49822765588760375977f, +0.86704623699188232422f,-0.50088536739349365234f,0.86551362276077270508f, +-0.50353837013244628906f,0.86397284269332885742f,-0.50618666410446166992f, +0.86242395639419555664f,-0.50883013010025024414f,0.86086696386337280273f, +-0.51146882772445678711f,0.85930180549621582031f,-0.51410275697708129883f, +0.85772860050201416016f,-0.51673179864883422852f,0.85614734888076782227f, +-0.51935601234436035156f,0.85455799102783203125f,-0.52197527885437011719f, +0.85296058654785156250f,-0.52458965778350830078f,0.85135519504547119141f, +-0.52719914913177490234f,0.84974175691604614258f,-0.52980363368988037109f, +0.84812033176422119141f,-0.53240311145782470703f,0.84649091958999633789f, +-0.53499764204025268555f,0.84485357999801635742f,-0.53758704662322998047f, +0.84320825338363647461f,-0.54017144441604614258f,0.84155499935150146484f, +-0.54275077581405639648f,0.83989381790161132812f,-0.54532498121261596680f, +0.83822470903396606445f,-0.54789406061172485352f,0.83654773235321044922f, +-0.55045795440673828125f,0.83486288785934448242f,-0.55301672220230102539f, +0.83317017555236816406f,-0.55557024478912353516f,0.83146959543228149414f, +-0.55811852216720581055f,0.82976120710372924805f,-0.56066155433654785156f, +0.82804507017135620117f,-0.56319934129714965820f,0.82632106542587280273f, +-0.56573182344436645508f,0.82458931207656860352f,-0.56825894117355346680f, +0.82284981012344360352f,-0.57078075408935546875f,0.82110249996185302734f, +-0.57329714298248291016f,0.81934750080108642578f,-0.57580816745758056641f, +0.81758481264114379883f,-0.57831376791000366211f,0.81581443548202514648f, +-0.58081394433975219727f,0.81403630971908569336f,-0.58330863714218139648f, +0.81225061416625976562f,-0.58579784631729125977f,0.81045717000961303711f, +-0.58828157186508178711f,0.80865615606307983398f,-0.59075969457626342773f, +0.80684757232666015625f,-0.59323227405548095703f,0.80503135919570922852f, +-0.59569931030273437500f,0.80320751667022705078f,-0.59816068410873413086f, +0.80137616395950317383f,-0.60061645507812500000f,0.79953724145889282227f, +-0.60306662321090698242f,0.79769086837768554688f,-0.60551106929779052734f, +0.79583692550659179688f,-0.60794979333877563477f,0.79397547245025634766f, +-0.61038279533386230469f,0.79210656881332397461f,-0.61281007528305053711f, +0.79023021459579467773f,-0.61523157358169555664f,0.78834640979766845703f, +-0.61764729022979736328f,0.78645521402359008789f,-0.62005722522735595703f, +0.78455656766891479492f,-0.62246125936508178711f,0.78265058994293212891f, +-0.62485951185226440430f,0.78073722124099731445f,-0.62725180387496948242f, +0.77881652116775512695f,-0.62963825464248657227f,0.77688848972320556641f, +-0.63201874494552612305f,0.77495312690734863281f,-0.63439327478408813477f, +0.77301043272018432617f,-0.63676184415817260742f,0.77106052637100219727f, +-0.63912445306777954102f,0.76910334825515747070f,-0.64148104190826416016f, +0.76713889837265014648f,-0.64383155107498168945f,0.76516723632812500000f, +-0.64617604017257690430f,0.76318842172622680664f,-0.64851438999176025391f, +0.76120239496231079102f,-0.65084666013717651367f,0.75920921564102172852f, +-0.65317285060882568359f,0.75720882415771484375f,-0.65549284219741821289f, +0.75520139932632446289f,-0.65780669450759887695f,0.75318682193756103516f, +-0.66011434793472290039f,0.75116515159606933594f,-0.66241580247879028320f, +0.74913638830184936523f,-0.66471099853515625000f,0.74710059165954589844f, +-0.66699993610382080078f,0.74505776166915893555f,-0.66928261518478393555f, +0.74300795793533325195f,-0.67155897617340087891f,0.74095112085342407227f, +-0.67382901906967163086f,0.73888731002807617188f,-0.67609268426895141602f, +0.73681658506393432617f,-0.67835003137588500977f,0.73473888635635375977f, +-0.68060100078582763672f,0.73265427350997924805f,-0.68284553289413452148f, +0.73056274652481079102f,-0.68508368730545043945f,0.72846436500549316406f, +-0.68731534481048583984f,0.72635912895202636719f,-0.68954056501388549805f, +0.72424709796905517578f,-0.69175922870635986328f,0.72212821245193481445f, +-0.69397145509719848633f,0.72000253200531005859f,-0.69617712497711181641f, +0.71787005662918090820f,-0.69837623834609985352f,0.71573084592819213867f, +-0.70056879520416259766f,0.71358484029769897461f,-0.70275473594665527344f, +0.71143221855163574219f,-0.70493406057357788086f,0.70927280187606811523f, +-0.70710676908493041992f,0.70710676908493041992f,-0.70927280187606811523f, +0.70493406057357788086f,-0.71143221855163574219f,0.70275473594665527344f, +-0.71358484029769897461f,0.70056879520416259766f,-0.71573084592819213867f, +0.69837623834609985352f,-0.71787005662918090820f,0.69617712497711181641f, +-0.72000253200531005859f,0.69397145509719848633f,-0.72212821245193481445f, +0.69175922870635986328f,-0.72424709796905517578f,0.68954056501388549805f, +-0.72635912895202636719f,0.68731534481048583984f,-0.72846436500549316406f, +0.68508368730545043945f,-0.73056274652481079102f,0.68284553289413452148f, +-0.73265427350997924805f,0.68060100078582763672f,-0.73473888635635375977f, +0.67835003137588500977f,-0.73681658506393432617f,0.67609268426895141602f, +-0.73888731002807617188f,0.67382901906967163086f,-0.74095112085342407227f, +0.67155897617340087891f,-0.74300795793533325195f,0.66928261518478393555f, +-0.74505776166915893555f,0.66699993610382080078f,-0.74710059165954589844f, +0.66471099853515625000f,-0.74913638830184936523f,0.66241580247879028320f, +-0.75116515159606933594f,0.66011434793472290039f,-0.75318682193756103516f, +0.65780669450759887695f,-0.75520139932632446289f,0.65549284219741821289f, +-0.75720882415771484375f,0.65317285060882568359f,-0.75920921564102172852f, +0.65084666013717651367f,-0.76120239496231079102f,0.64851438999176025391f, +-0.76318842172622680664f,0.64617604017257690430f,-0.76516723632812500000f, +0.64383155107498168945f,-0.76713889837265014648f,0.64148104190826416016f, +-0.76910334825515747070f,0.63912445306777954102f,-0.77106052637100219727f, +0.63676184415817260742f,-0.77301043272018432617f,0.63439327478408813477f, +-0.77495312690734863281f,0.63201874494552612305f,-0.77688848972320556641f, +0.62963825464248657227f,-0.77881652116775512695f,0.62725180387496948242f, +-0.78073722124099731445f,0.62485951185226440430f,-0.78265058994293212891f, +0.62246125936508178711f,-0.78455656766891479492f,0.62005722522735595703f, +-0.78645521402359008789f,0.61764729022979736328f,-0.78834640979766845703f, +0.61523157358169555664f,-0.79023021459579467773f,0.61281007528305053711f, +-0.79210656881332397461f,0.61038279533386230469f,-0.79397547245025634766f, +0.60794979333877563477f,-0.79583692550659179688f,0.60551106929779052734f, +-0.79769086837768554688f,0.60306662321090698242f,-0.79953724145889282227f, +0.60061645507812500000f,-0.80137616395950317383f,0.59816068410873413086f, +-0.80320751667022705078f,0.59569931030273437500f,-0.80503135919570922852f, +0.59323227405548095703f,-0.80684757232666015625f,0.59075969457626342773f, +-0.80865615606307983398f,0.58828157186508178711f,-0.81045717000961303711f, +0.58579784631729125977f,-0.81225061416625976562f,0.58330863714218139648f, +-0.81403630971908569336f,0.58081394433975219727f,-0.81581443548202514648f, +0.57831376791000366211f,-0.81758481264114379883f,0.57580816745758056641f, +-0.81934750080108642578f,0.57329714298248291016f,-0.82110249996185302734f, +0.57078075408935546875f,-0.82284981012344360352f,0.56825894117355346680f, +-0.82458931207656860352f,0.56573182344436645508f,-0.82632106542587280273f, +0.56319934129714965820f,-0.82804507017135620117f,0.56066155433654785156f, +-0.82976120710372924805f,0.55811852216720581055f,-0.83146959543228149414f, +0.55557024478912353516f,-0.83317017555236816406f,0.55301672220230102539f, +-0.83486288785934448242f,0.55045795440673828125f,-0.83654773235321044922f, +0.54789406061172485352f,-0.83822470903396606445f,0.54532498121261596680f, +-0.83989381790161132812f,0.54275077581405639648f,-0.84155499935150146484f, +0.54017144441604614258f,-0.84320825338363647461f,0.53758704662322998047f, +-0.84485357999801635742f,0.53499764204025268555f,-0.84649091958999633789f, +0.53240311145782470703f,-0.84812033176422119141f,0.52980363368988037109f, +-0.84974175691604614258f,0.52719914913177490234f,-0.85135519504547119141f, +0.52458965778350830078f,-0.85296058654785156250f,0.52197527885437011719f, +-0.85455799102783203125f,0.51935601234436035156f,-0.85614734888076782227f, +0.51673179864883422852f,-0.85772860050201416016f,0.51410275697708129883f, +-0.85930180549621582031f,0.51146882772445678711f,-0.86086696386337280273f, +0.50883013010025024414f,-0.86242395639419555664f,0.50618666410446166992f, +-0.86397284269332885742f,0.50353837013244628906f,-0.86551362276077270508f, +0.50088536739349365234f,-0.86704623699188232422f,0.49822765588760375977f, +-0.86857068538665771484f,0.49556526541709899902f,-0.87008696794509887695f, +0.49289819598197937012f,-0.87159508466720581055f,0.49022647738456726074f, +-0.87309497594833374023f,0.48755016922950744629f,-0.87458664178848266602f, +0.48486924171447753906f,-0.87607008218765258789f,0.48218378424644470215f, +-0.87754529714584350586f,0.47949376702308654785f,-0.87901222705841064453f, +0.47679921984672546387f,-0.88047087192535400391f,0.47410020232200622559f, +-0.88192129135131835938f,0.47139674425125122070f,-0.88336336612701416016f, +0.46868881583213806152f,-0.88479709625244140625f,0.46597650647163391113f, +-0.88622254133224487305f,0.46325978636741638184f,-0.88763964176177978516f, +0.46053871512413024902f,-0.88904833793640136719f,0.45781329274177551270f, +-0.89044874906539916992f,0.45508357882499694824f,-0.89184069633483886719f, +0.45234957337379455566f,-0.89322429895401000977f,0.44961133599281311035f, +-0.89459949731826782227f,0.44686883687973022461f,-0.89596623182296752930f, +0.44412213563919067383f,-0.89732456207275390625f,0.44137126207351684570f, +-0.89867448806762695312f,0.43861624598503112793f,-0.90001589059829711914f, +0.43585708737373352051f,-0.90134882926940917969f,0.43309381604194641113f, +-0.90267330408096313477f,0.43032649159431457520f,-0.90398931503295898438f, +0.42755508422851562500f,-0.90529674291610717773f,0.42477968335151672363f, +-0.90659570693969726562f,0.42200025916099548340f,-0.90788608789443969727f, +0.41921690106391906738f,-0.90916800498962402344f,0.41642954945564270020f, +-0.91044127941131591797f,0.41363832354545593262f,-0.91170603036880493164f, +0.41084316372871398926f,-0.91296219825744628906f,0.40804415941238403320f, +-0.91420978307723999023f,0.40524131059646606445f,-0.91544872522354125977f, +0.40243464708328247070f,-0.91667908430099487305f,0.39962419867515563965f, +-0.91790080070495605469f,0.39680999517440795898f,-0.91911387443542480469f, +0.39399203658103942871f,-0.92031830549240112305f,0.39117038249969482422f, +-0.92151403427124023438f,0.38834503293037414551f,-0.92270112037658691406f, +0.38551604747772216797f,-0.92387950420379638672f,0.38268342614173889160f, +-0.92504924535751342773f,0.37984719872474670410f,-0.92621022462844848633f, +0.37700742483139038086f,-0.92736250162124633789f,0.37416407465934753418f, +-0.92850607633590698242f,0.37131720781326293945f,-0.92964088916778564453f, +0.36846682429313659668f,-0.93076694011688232422f,0.36561298370361328125f, +-0.93188428878784179688f,0.36275571584701538086f,-0.93299281597137451172f, +0.35989505052566528320f,-0.93409252166748046875f,0.35703095793724060059f, +-0.93518352508544921875f,0.35416352748870849609f,-0.93626564741134643555f, +0.35129275918006896973f,-0.93733900785446166992f,0.34841868281364440918f, +-0.93840354681015014648f,0.34554132819175720215f,-0.93945920467376708984f, +0.34266072511672973633f,-0.94050604104995727539f,0.33977687358856201172f, +-0.94154405593872070312f,0.33688986301422119141f,-0.94257318973541259766f, +0.33399966359138488770f,-0.94359344244003295898f,0.33110630512237548828f, +-0.94460481405258178711f,0.32820984721183776855f,-0.94560730457305908203f, +0.32531028985977172852f,-0.94660091400146484375f,0.32240769267082214355f, +-0.94758558273315429688f,0.31950202584266662598f,-0.94856137037277221680f, +0.31659337878227233887f,-0.94952815771102905273f,0.31368175148963928223f, +-0.95048606395721435547f,0.31076714396476745605f,-0.95143502950668334961f, +0.30784964561462402344f,-0.95237499475479125977f,0.30492922663688659668f, +-0.95330601930618286133f,0.30200594663619995117f,-0.95422810316085815430f, +0.29907983541488647461f,-0.95514118671417236328f,0.29615089297294616699f, +-0.95604526996612548828f,0.29321914911270141602f,-0.95694035291671752930f, +0.29028466343879699707f,-0.95782643556594848633f,0.28734746575355529785f, +-0.95870345830917358398f,0.28440752625465393066f,-0.95957154035568237305f, +0.28146493434906005859f,-0.96043050289154052734f,0.27851969003677368164f, +-0.96128046512603759766f,0.27557182312011718750f,-0.96212142705917358398f, +0.27262136340141296387f,-0.96295326948165893555f,0.26966831088066101074f, +-0.96377605199813842773f,0.26671275496482849121f,-0.96458977460861206055f, +0.26375466585159301758f,-0.96539443731307983398f,0.26079410314559936523f, +-0.96618998050689697266f,0.25783109664916992188f,-0.96697646379470825195f, +0.25486564636230468750f,-0.96775382757186889648f,0.25189781188964843750f, +-0.96852207183837890625f,0.24892760813236236572f,-0.96928125619888305664f, +0.24595504999160766602f,-0.97003126144409179688f,0.24298018217086791992f, +-0.97077214717864990234f,0.24000301957130432129f,-0.97150391340255737305f, +0.23702360689640045166f,-0.97222650051116943359f,0.23404195904731750488f, +-0.97293996810913085938f,0.23105810582637786865f,-0.97364425659179687500f, +0.22807207703590393066f,-0.97433936595916748047f,0.22508391737937927246f, +-0.97502535581588745117f,0.22209362685680389404f,-0.97570210695266723633f, +0.21910123527050018311f,-0.97636973857879638672f,0.21610680222511291504f, +-0.97702813148498535156f,0.21311031281948089600f,-0.97767734527587890625f, +0.21011184155941009521f,-0.97831737995147705078f,0.20711137354373931885f, +-0.97894817590713500977f,0.20410896837711334229f,-0.97956979274749755859f, +0.20110464096069335938f,-0.98018211126327514648f,0.19809840619564056396f, +-0.98078525066375732422f,0.19509032368659973145f,-0.98137921094894409180f, +0.19208039343357086182f,-0.98196387290954589844f,0.18906866014003753662f, +-0.98253929615020751953f,0.18605515360832214355f,-0.98310548067092895508f, +0.18303988873958587646f,-0.98366242647171020508f,0.18002289533615112305f, +-0.98421007394790649414f,0.17700421810150146484f,-0.98474848270416259766f, +0.17398387193679809570f,-0.98527765274047851562f,0.17096188664436340332f, +-0.98579752445220947266f,0.16793829202651977539f,-0.98630809783935546875f, +0.16491311788558959961f,-0.98680937290191650391f,0.16188639402389526367f, +-0.98730140924453735352f,0.15885815024375915527f,-0.98778414726257324219f, +0.15582840144634246826f,-0.98825758695602416992f,0.15279719233512878418f, +-0.98872166872024536133f,0.14976453781127929688f,-0.98917651176452636719f, +0.14673046767711639404f,-0.98962199687957763672f,0.14369502663612365723f, +-0.99005818367004394531f,0.14065824449062347412f,-0.99048507213592529297f, +0.13762012124061584473f,-0.99090266227722167969f,0.13458070158958435059f, +-0.99131083488464355469f,0.13154003024101257324f,-0.99170976877212524414f, +0.12849810719490051270f,-0.99209928512573242188f,0.12545497715473175049f, +-0.99247956275939941406f,0.12241067737340927124f,-0.99285042285919189453f, +0.11936521530151367188f,-0.99321192502975463867f,0.11631862819194793701f, +-0.99356412887573242188f,0.11327095329761505127f,-0.99390697479248046875f, +0.11022220551967620850f,-0.99424046277999877930f,0.10717242211103439331f, +-0.99456459283828735352f,0.10412163287401199341f,-0.99487930536270141602f, +0.10106986016035079956f,-0.99518471956253051758f,0.09801714122295379639f, +-0.99548077583312988281f,0.09496349841356277466f,-0.99576741456985473633f, +0.09190895408391952515f,-0.99604469537734985352f,0.08885355293750762939f, +-0.99631261825561523438f,0.08579730987548828125f,-0.99657112360000610352f, +0.08274026215076446533f,-0.99682027101516723633f,0.07968243956565856934f, +-0.99706006050109863281f,0.07662386447191238403f,-0.99729043245315551758f, +0.07356456667184829712f,-0.99751144647598266602f,0.07050457596778869629f, +-0.99772304296493530273f,0.06744392216205596924f,-0.99792528152465820312f, +0.06438262760639190674f,-0.99811810255050659180f,0.06132073700428009033f, +-0.99830156564712524414f,0.05825826525688171387f,-0.99847555160522460938f, +0.05519524589180946350f,-0.99864023923873901367f,0.05213170498609542847f, +-0.99879544973373413086f,0.04906767606735229492f,-0.99894130229949951172f, +0.04600318148732185364f,-0.99907773733139038086f,0.04293825849890708923f, +-0.99920475482940673828f,0.03987292572855949402f,-0.99932235479354858398f, +0.03680722415447235107f,-0.99943059682846069336f,0.03374117240309715271f, +-0.99952942132949829102f,0.03067480400204658508f,-0.99961882829666137695f, +0.02760814502835273743f,-0.99969881772994995117f,0.02454122900962829590f, +-0.99976938962936401367f,0.02147408016026020050f,-0.99983060359954833984f, +0.01840673014521598816f,-0.99988234043121337891f,0.01533920597285032272f, +-0.99992471933364868164f,0.01227153837680816650f,-0.99995762109756469727f, +0.00920375436544418335f,-0.99998116493225097656f,0.00613588467240333557f, +-0.99999529123306274414f,0.00306795677170157433f,1.00000000000000000000f, +0.00000000000000000000f,0.99992471933364868164f,0.01227153837680816650f, +0.99969881772994995117f,0.02454122900962829590f,0.99932235479354858398f, +0.03680722415447235107f,0.99879544973373413086f,0.04906767606735229492f, +0.99811810255050659180f,0.06132073700428009033f,0.99729043245315551758f, +0.07356456667184829712f,0.99631261825561523438f,0.08579730987548828125f, +0.99518471956253051758f,0.09801714122295379639f,0.99390697479248046875f, +0.11022220551967620850f,0.99247956275939941406f,0.12241067737340927124f, +0.99090266227722167969f,0.13458070158958435059f,0.98917651176452636719f, +0.14673046767711639404f,0.98730140924453735352f,0.15885815024375915527f, +0.98527765274047851562f,0.17096188664436340332f,0.98310548067092895508f, +0.18303988873958587646f,0.98078525066375732422f,0.19509032368659973145f, +0.97831737995147705078f,0.20711137354373931885f,0.97570210695266723633f, +0.21910123527050018311f,0.97293996810913085938f,0.23105810582637786865f, +0.97003126144409179688f,0.24298018217086791992f,0.96697646379470825195f, +0.25486564636230468750f,0.96377605199813842773f,0.26671275496482849121f, +0.96043050289154052734f,0.27851969003677368164f,0.95694035291671752930f, +0.29028466343879699707f,0.95330601930618286133f,0.30200594663619995117f, +0.94952815771102905273f,0.31368175148963928223f,0.94560730457305908203f, +0.32531028985977172852f,0.94154405593872070312f,0.33688986301422119141f, +0.93733900785446166992f,0.34841868281364440918f,0.93299281597137451172f, +0.35989505052566528320f,0.92850607633590698242f,0.37131720781326293945f, +0.92387950420379638672f,0.38268342614173889160f,0.91911387443542480469f, +0.39399203658103942871f,0.91420978307723999023f,0.40524131059646606445f, +0.90916800498962402344f,0.41642954945564270020f,0.90398931503295898438f, +0.42755508422851562500f,0.89867448806762695312f,0.43861624598503112793f, +0.89322429895401000977f,0.44961133599281311035f,0.88763964176177978516f, +0.46053871512413024902f,0.88192129135131835938f,0.47139674425125122070f, +0.87607008218765258789f,0.48218378424644470215f,0.87008696794509887695f, +0.49289819598197937012f,0.86397284269332885742f,0.50353837013244628906f, +0.85772860050201416016f,0.51410275697708129883f,0.85135519504547119141f, +0.52458965778350830078f,0.84485357999801635742f,0.53499764204025268555f, +0.83822470903396606445f,0.54532498121261596680f,0.83146959543228149414f, +0.55557024478912353516f,0.82458931207656860352f,0.56573182344436645508f, +0.81758481264114379883f,0.57580816745758056641f,0.81045717000961303711f, +0.58579784631729125977f,0.80320751667022705078f,0.59569931030273437500f, +0.79583692550659179688f,0.60551106929779052734f,0.78834640979766845703f, +0.61523157358169555664f,0.78073722124099731445f,0.62485951185226440430f, +0.77301043272018432617f,0.63439327478408813477f,0.76516723632812500000f, +0.64383155107498168945f,0.75720882415771484375f,0.65317285060882568359f, +0.74913638830184936523f,0.66241580247879028320f,0.74095112085342407227f, +0.67155897617340087891f,0.73265427350997924805f,0.68060100078582763672f, +0.72424709796905517578f,0.68954056501388549805f,0.71573084592819213867f, +0.69837623834609985352f,0.70710676908493041992f,0.70710676908493041992f, +0.69837623834609985352f,0.71573084592819213867f,0.68954056501388549805f, +0.72424709796905517578f,0.68060100078582763672f,0.73265427350997924805f, +0.67155897617340087891f,0.74095112085342407227f,0.66241580247879028320f, +0.74913638830184936523f,0.65317285060882568359f,0.75720882415771484375f, +0.64383155107498168945f,0.76516723632812500000f,0.63439327478408813477f, +0.77301043272018432617f,0.62485951185226440430f,0.78073722124099731445f, +0.61523157358169555664f,0.78834640979766845703f,0.60551106929779052734f, +0.79583692550659179688f,0.59569931030273437500f,0.80320751667022705078f, +0.58579784631729125977f,0.81045717000961303711f,0.57580816745758056641f, +0.81758481264114379883f,0.56573182344436645508f,0.82458931207656860352f, +0.55557024478912353516f,0.83146959543228149414f,0.54532498121261596680f, +0.83822470903396606445f,0.53499764204025268555f,0.84485357999801635742f, +0.52458965778350830078f,0.85135519504547119141f,0.51410275697708129883f, +0.85772860050201416016f,0.50353837013244628906f,0.86397284269332885742f, +0.49289819598197937012f,0.87008696794509887695f,0.48218378424644470215f, +0.87607008218765258789f,0.47139674425125122070f,0.88192129135131835938f, +0.46053871512413024902f,0.88763964176177978516f,0.44961133599281311035f, +0.89322429895401000977f,0.43861624598503112793f,0.89867448806762695312f, +0.42755508422851562500f,0.90398931503295898438f,0.41642954945564270020f, +0.90916800498962402344f,0.40524131059646606445f,0.91420978307723999023f, +0.39399203658103942871f,0.91911387443542480469f,0.38268342614173889160f, +0.92387950420379638672f,0.37131720781326293945f,0.92850607633590698242f, +0.35989505052566528320f,0.93299281597137451172f,0.34841868281364440918f, +0.93733900785446166992f,0.33688986301422119141f,0.94154405593872070312f, +0.32531028985977172852f,0.94560730457305908203f,0.31368175148963928223f, +0.94952815771102905273f,0.30200594663619995117f,0.95330601930618286133f, +0.29028466343879699707f,0.95694035291671752930f,0.27851969003677368164f, +0.96043050289154052734f,0.26671275496482849121f,0.96377605199813842773f, +0.25486564636230468750f,0.96697646379470825195f,0.24298018217086791992f, +0.97003126144409179688f,0.23105810582637786865f,0.97293996810913085938f, +0.21910123527050018311f,0.97570210695266723633f,0.20711137354373931885f, +0.97831737995147705078f,0.19509032368659973145f,0.98078525066375732422f, +0.18303988873958587646f,0.98310548067092895508f,0.17096188664436340332f, +0.98527765274047851562f,0.15885815024375915527f,0.98730140924453735352f, +0.14673046767711639404f,0.98917651176452636719f,0.13458070158958435059f, +0.99090266227722167969f,0.12241067737340927124f,0.99247956275939941406f, +0.11022220551967620850f,0.99390697479248046875f,0.09801714122295379639f, +0.99518471956253051758f,0.08579730987548828125f,0.99631261825561523438f, +0.07356456667184829712f,0.99729043245315551758f,0.06132073700428009033f, +0.99811810255050659180f,0.04906767606735229492f,0.99879544973373413086f, +0.03680722415447235107f,0.99932235479354858398f,0.02454122900962829590f, +0.99969881772994995117f,0.01227153837680816650f,0.99992471933364868164f, +0.00000000000000006123f,1.00000000000000000000f,-0.01227153837680816650f, +0.99992471933364868164f,-0.02454122900962829590f,0.99969881772994995117f, +-0.03680722415447235107f,0.99932235479354858398f,-0.04906767606735229492f, +0.99879544973373413086f,-0.06132073700428009033f,0.99811810255050659180f, +-0.07356456667184829712f,0.99729043245315551758f,-0.08579730987548828125f, +0.99631261825561523438f,-0.09801714122295379639f,0.99518471956253051758f, +-0.11022220551967620850f,0.99390697479248046875f,-0.12241067737340927124f, +0.99247956275939941406f,-0.13458070158958435059f,0.99090266227722167969f, +-0.14673046767711639404f,0.98917651176452636719f,-0.15885815024375915527f, +0.98730140924453735352f,-0.17096188664436340332f,0.98527765274047851562f, +-0.18303988873958587646f,0.98310548067092895508f,-0.19509032368659973145f, +0.98078525066375732422f,-0.20711137354373931885f,0.97831737995147705078f, +-0.21910123527050018311f,0.97570210695266723633f,-0.23105810582637786865f, +0.97293996810913085938f,-0.24298018217086791992f,0.97003126144409179688f, +-0.25486564636230468750f,0.96697646379470825195f,-0.26671275496482849121f, +0.96377605199813842773f,-0.27851969003677368164f,0.96043050289154052734f, +-0.29028466343879699707f,0.95694035291671752930f,-0.30200594663619995117f, +0.95330601930618286133f,-0.31368175148963928223f,0.94952815771102905273f, +-0.32531028985977172852f,0.94560730457305908203f,-0.33688986301422119141f, +0.94154405593872070312f,-0.34841868281364440918f,0.93733900785446166992f, +-0.35989505052566528320f,0.93299281597137451172f,-0.37131720781326293945f, +0.92850607633590698242f,-0.38268342614173889160f,0.92387950420379638672f, +-0.39399203658103942871f,0.91911387443542480469f,-0.40524131059646606445f, +0.91420978307723999023f,-0.41642954945564270020f,0.90916800498962402344f, +-0.42755508422851562500f,0.90398931503295898438f,-0.43861624598503112793f, +0.89867448806762695312f,-0.44961133599281311035f,0.89322429895401000977f, +-0.46053871512413024902f,0.88763964176177978516f,-0.47139674425125122070f, +0.88192129135131835938f,-0.48218378424644470215f,0.87607008218765258789f, +-0.49289819598197937012f,0.87008696794509887695f,-0.50353837013244628906f, +0.86397284269332885742f,-0.51410275697708129883f,0.85772860050201416016f, +-0.52458965778350830078f,0.85135519504547119141f,-0.53499764204025268555f, +0.84485357999801635742f,-0.54532498121261596680f,0.83822470903396606445f, +-0.55557024478912353516f,0.83146959543228149414f,-0.56573182344436645508f, +0.82458931207656860352f,-0.57580816745758056641f,0.81758481264114379883f, +-0.58579784631729125977f,0.81045717000961303711f,-0.59569931030273437500f, +0.80320751667022705078f,-0.60551106929779052734f,0.79583692550659179688f, +-0.61523157358169555664f,0.78834640979766845703f,-0.62485951185226440430f, +0.78073722124099731445f,-0.63439327478408813477f,0.77301043272018432617f, +-0.64383155107498168945f,0.76516723632812500000f,-0.65317285060882568359f, +0.75720882415771484375f,-0.66241580247879028320f,0.74913638830184936523f, +-0.67155897617340087891f,0.74095112085342407227f,-0.68060100078582763672f, +0.73265427350997924805f,-0.68954056501388549805f,0.72424709796905517578f, +-0.69837623834609985352f,0.71573084592819213867f,-0.70710676908493041992f, +0.70710676908493041992f,-0.71573084592819213867f,0.69837623834609985352f, +-0.72424709796905517578f,0.68954056501388549805f,-0.73265427350997924805f, +0.68060100078582763672f,-0.74095112085342407227f,0.67155897617340087891f, +-0.74913638830184936523f,0.66241580247879028320f,-0.75720882415771484375f, +0.65317285060882568359f,-0.76516723632812500000f,0.64383155107498168945f, +-0.77301043272018432617f,0.63439327478408813477f,-0.78073722124099731445f, +0.62485951185226440430f,-0.78834640979766845703f,0.61523157358169555664f, +-0.79583692550659179688f,0.60551106929779052734f,-0.80320751667022705078f, +0.59569931030273437500f,-0.81045717000961303711f,0.58579784631729125977f, +-0.81758481264114379883f,0.57580816745758056641f,-0.82458931207656860352f, +0.56573182344436645508f,-0.83146959543228149414f,0.55557024478912353516f, +-0.83822470903396606445f,0.54532498121261596680f,-0.84485357999801635742f, +0.53499764204025268555f,-0.85135519504547119141f,0.52458965778350830078f, +-0.85772860050201416016f,0.51410275697708129883f,-0.86397284269332885742f, +0.50353837013244628906f,-0.87008696794509887695f,0.49289819598197937012f, +-0.87607008218765258789f,0.48218378424644470215f,-0.88192129135131835938f, +0.47139674425125122070f,-0.88763964176177978516f,0.46053871512413024902f, +-0.89322429895401000977f,0.44961133599281311035f,-0.89867448806762695312f, +0.43861624598503112793f,-0.90398931503295898438f,0.42755508422851562500f, +-0.90916800498962402344f,0.41642954945564270020f,-0.91420978307723999023f, +0.40524131059646606445f,-0.91911387443542480469f,0.39399203658103942871f, +-0.92387950420379638672f,0.38268342614173889160f,-0.92850607633590698242f, +0.37131720781326293945f,-0.93299281597137451172f,0.35989505052566528320f, +-0.93733900785446166992f,0.34841868281364440918f,-0.94154405593872070312f, +0.33688986301422119141f,-0.94560730457305908203f,0.32531028985977172852f, +-0.94952815771102905273f,0.31368175148963928223f,-0.95330601930618286133f, +0.30200594663619995117f,-0.95694035291671752930f,0.29028466343879699707f, +-0.96043050289154052734f,0.27851969003677368164f,-0.96377605199813842773f, +0.26671275496482849121f,-0.96697646379470825195f,0.25486564636230468750f, +-0.97003126144409179688f,0.24298018217086791992f,-0.97293996810913085938f, +0.23105810582637786865f,-0.97570210695266723633f,0.21910123527050018311f, +-0.97831737995147705078f,0.20711137354373931885f,-0.98078525066375732422f, +0.19509032368659973145f,-0.98310548067092895508f,0.18303988873958587646f, +-0.98527765274047851562f,0.17096188664436340332f,-0.98730140924453735352f, +0.15885815024375915527f,-0.98917651176452636719f,0.14673046767711639404f, +-0.99090266227722167969f,0.13458070158958435059f,-0.99247956275939941406f, +0.12241067737340927124f,-0.99390697479248046875f,0.11022220551967620850f, +-0.99518471956253051758f,0.09801714122295379639f,-0.99631261825561523438f, +0.08579730987548828125f,-0.99729043245315551758f,0.07356456667184829712f, +-0.99811810255050659180f,0.06132073700428009033f,-0.99879544973373413086f, +0.04906767606735229492f,-0.99932235479354858398f,0.03680722415447235107f, +-0.99969881772994995117f,0.02454122900962829590f,-0.99992471933364868164f, +0.01227153837680816650f,1.00000000000000000000f,0.00000000000000000000f, +0.99879544973373413086f,0.04906767606735229492f,0.99518471956253051758f, +0.09801714122295379639f,0.98917651176452636719f,0.14673046767711639404f, +0.98078525066375732422f,0.19509032368659973145f,0.97003126144409179688f, +0.24298018217086791992f,0.95694035291671752930f,0.29028466343879699707f, +0.94154405593872070312f,0.33688986301422119141f,0.92387950420379638672f, +0.38268342614173889160f,0.90398931503295898438f,0.42755508422851562500f, +0.88192129135131835938f,0.47139674425125122070f,0.85772860050201416016f, +0.51410275697708129883f,0.83146959543228149414f,0.55557024478912353516f, +0.80320751667022705078f,0.59569931030273437500f,0.77301043272018432617f, +0.63439327478408813477f,0.74095112085342407227f,0.67155897617340087891f, +0.70710676908493041992f,0.70710676908493041992f,0.67155897617340087891f, +0.74095112085342407227f,0.63439327478408813477f,0.77301043272018432617f, +0.59569931030273437500f,0.80320751667022705078f,0.55557024478912353516f, +0.83146959543228149414f,0.51410275697708129883f,0.85772860050201416016f, +0.47139674425125122070f,0.88192129135131835938f,0.42755508422851562500f, +0.90398931503295898438f,0.38268342614173889160f,0.92387950420379638672f, +0.33688986301422119141f,0.94154405593872070312f,0.29028466343879699707f, +0.95694035291671752930f,0.24298018217086791992f,0.97003126144409179688f, +0.19509032368659973145f,0.98078525066375732422f,0.14673046767711639404f, +0.98917651176452636719f,0.09801714122295379639f,0.99518471956253051758f, +0.04906767606735229492f,0.99879544973373413086f,0.00000000000000006123f, +1.00000000000000000000f,-0.04906767606735229492f,0.99879544973373413086f, +-0.09801714122295379639f,0.99518471956253051758f,-0.14673046767711639404f, +0.98917651176452636719f,-0.19509032368659973145f,0.98078525066375732422f, +-0.24298018217086791992f,0.97003126144409179688f,-0.29028466343879699707f, +0.95694035291671752930f,-0.33688986301422119141f,0.94154405593872070312f, +-0.38268342614173889160f,0.92387950420379638672f,-0.42755508422851562500f, +0.90398931503295898438f,-0.47139674425125122070f,0.88192129135131835938f, +-0.51410275697708129883f,0.85772860050201416016f,-0.55557024478912353516f, +0.83146959543228149414f,-0.59569931030273437500f,0.80320751667022705078f, +-0.63439327478408813477f,0.77301043272018432617f,-0.67155897617340087891f, +0.74095112085342407227f,-0.70710676908493041992f,0.70710676908493041992f, +-0.74095112085342407227f,0.67155897617340087891f,-0.77301043272018432617f, +0.63439327478408813477f,-0.80320751667022705078f,0.59569931030273437500f, +-0.83146959543228149414f,0.55557024478912353516f,-0.85772860050201416016f, +0.51410275697708129883f,-0.88192129135131835938f,0.47139674425125122070f, +-0.90398931503295898438f,0.42755508422851562500f,-0.92387950420379638672f, +0.38268342614173889160f,-0.94154405593872070312f,0.33688986301422119141f, +-0.95694035291671752930f,0.29028466343879699707f,-0.97003126144409179688f, +0.24298018217086791992f,-0.98078525066375732422f,0.19509032368659973145f, +-0.98917651176452636719f,0.14673046767711639404f,-0.99518471956253051758f, +0.09801714122295379639f,-0.99879544973373413086f,0.04906767606735229492f, +1.00000000000000000000f,0.00000000000000000000f,0.98078525066375732422f, +0.19509032368659973145f,0.92387950420379638672f,0.38268342614173889160f, +0.83146959543228149414f,0.55557024478912353516f,0.70710676908493041992f, +0.70710676908493041992f,0.55557024478912353516f,0.83146959543228149414f, +0.38268342614173889160f,0.92387950420379638672f,0.19509032368659973145f, +0.98078525066375732422f,0.00000000000000006123f,1.00000000000000000000f, +-0.19509032368659973145f,0.98078525066375732422f,-0.38268342614173889160f, +0.92387950420379638672f,-0.55557024478912353516f,0.83146959543228149414f, +-0.70710676908493041992f,0.70710676908493041992f,-0.83146959543228149414f, +0.55557024478912353516f,-0.92387950420379638672f,0.38268342614173889160f, +-0.98078525066375732422f,0.19509032368659973145f,1.00000000000000000000f, +0.00000000000000000000f,0.70710676908493041992f,0.70710676908493041992f, +0.00000000000000006123f,1.00000000000000000000f,-0.70710676908493041992f, +0.70710676908493041992f,}; float32_t rearranged_twiddle_stride3_4096_f32[2728]={ -1.00000000000000000000f,0.00000000000000000000f,0.99998941108192840321f, -0.00460192612044857050f,0.99995764455196389786f,0.00920375478205981944f, -0.99990470108285289808f,0.01380538852806039059f,0.99983058179582340319f, -0.01840672990580482019f,0.99973528826056168306f,0.02300768146883936868f, -0.99961882249517863830f,0.02760814577896573974f,0.99948118696616694567f, -0.03220802540830458582f,0.99932238458834954375f,0.03680722294135883171f, -0.99914241872481690532f,0.04140564097707673946f,0.99894129318685687124f, -0.04600318213091462299f,0.99871901223387293811f,0.05059974903689928166f, -0.99847558057329477421f,0.05519524434968993420f,0.99821100336047818846f, -0.05978957074663986820f,0.99792528619859599548f,0.06438263092985746505f, -0.99761843513851955478f,0.06897432762826674613f,0.99729045667869020697f, -0.07356456359966742631f,0.99694135776498216117f,0.07815324163279423197f, -0.99657114579055483539f,0.08274026454937569164f,0.99617982859569698117f, -0.08732553520619205922f,0.99576741446765981713f,0.09190895649713272386f, -0.99533391214048227980f,0.09649043135525259274f,0.99487933079480561638f, -0.10106986275482782167f,0.99440368005767909576f,0.10564715371341061589f, -0.99390697000235606051f,0.11022220729388305938f,0.99338921114808065305f, -0.11479492660651008373f,0.99285041445986510489f,0.11936521481099135467f, -0.99229059134825736699f,0.12393297511851215920f,0.99170975366909952520f, -0.12849811079379316880f,0.99110791372327688986f,0.13306052515713906459f, -0.99048508425645709341f,0.13762012158648603832f,0.98984127845882052821f, -0.14217680351944803063f,0.98917650996478101444f,0.14673047445536174793f, -0.98849079285269658701f,0.15128103795733022219f,0.98778414164457217783f, -0.15582839765426523271f,0.98705657130575097380f,0.16037245724292828464f, -0.98630809724459866938f,0.16491312048996989437f,0.98553873531217606185f, -0.16945029123396795900f,0.98474850180190420801f,0.17398387338746382214f, -0.98393741344921892278f,0.17851377093899750692f,0.98310548743121628501f, -0.18303988795514095078f,0.98225274136628937249f,0.18756212858252960252f, -0.98137919331375456089f,0.19208039704989243734f,0.98048486177346938497f, -0.19659459767008022335f,0.97956976568544051887f,0.20110463484209190055f, -0.97863392442942320759f,0.20561041305309923910f,0.97767735782450992943f, -0.21011183688046961016f,0.97670008612871184184f,0.21460881099378675829f, -0.97570213003852857003f,0.21910124015686979759f,0.97468351068851066810f, -0.22358902922978998729f,0.97364424965081197705f,0.22807208317088573102f, -0.97258436893473221296f,0.23255030703877524467f,0.97150389098625178352f, -0.23702360599436719801f,0.97040283868755550234f,0.24149188530286933019f, -0.96928123535654853171f,0.24595505033579459497f,0.96813910474636244441f, -0.25041300657296522436f,0.96697647104485207059f,0.25486565960451457169f, -0.96579335887408368500f,0.25931291513288623474f,0.96458979328981275803f, -0.26375467897483134694f,0.96336579978095404631f,0.26819085706340317632f, -0.96212140426904158019f,0.27262135544994897662f,0.96085663310767965850f, -0.27704608030609989555f,0.95957151308198451733f,0.28146493792575794091f, -0.95826607140801767226f,0.28587783472708061527f,0.95694033573220882438f, -0.29028467725446233105f,0.95559433413077110586f,0.29468537218051432669f, -0.95422809510910566733f,0.29907982630804047508f,0.95284164760119871573f, -0.30346794657201131562f,0.95143502096900833820f,0.30784964004153486661f, -0.95000824500184299914f,0.31222481392182488413f,0.94856134991573026749f, -0.31659337555616584581f,0.94709436635277721717f,0.32095523242787521445f, -0.94560732538052127971f,0.32531029216226292622f,0.94410025849127265918f, -0.32965846252858749255f,0.94257319760144686605f,0.33399965144200938205f, -0.94102617505088925753f,0.33833376696554112728f,0.93945922360218991898f, -0.34266071731199437833f,0.93787237643998988545f,0.34698041084592368133f, -0.93626566717027825959f,0.35129275608556709276f,0.93463912981968078064f, -0.35559766170478385172f,0.93299279883473895669f,0.35989503653498811087f, -0.93132670908118042608f,0.36418478956707989180f,0.92964089584318121418f, -0.36846682995337232125f,0.92793539482261788720f,0.37274106700951575855f, -0.92621024213831137928f,0.37700741021641825945f,0.92446547432526260391f, -0.38126576922216237620f,0.92270112833387862850f,0.38551605384391884890f, -0.92091724152918941204f,0.38975817406985641123f,0.91911385169005777040f, -0.39399204006104809883f,0.91729099700837790632f,0.39821756215337356100f, -0.91544871608826783316f,0.40243465085941843018f,0.91358704794525080750f, -0.40664321687036902864f,0.91170603200542987832f,0.41084317105790391089f, -0.90980570810465222209f,0.41503442447608163146f,0.90788611648766626150f, -0.41921688836322390515f,0.90594729780726845902f,0.42339047414379604728f, -0.90398929312344333820f,0.42755509343028208491f,0.90201214390249317976f, -0.43171065802505725895f,0.90001589201616016833f,0.43585707992225547480f, -0.89800057974073987932f,0.43999427130963325583f,0.89596624975618521791f, -0.44412214457042920035f,0.89391294514520325265f,0.44824061228521988598f, -0.89184070939234272313f,0.45234958723377088896f,0.88974958638307277692f, -0.45644898239688391772f,0.88763962040285393496f,0.46053871095824000514f, -0.88551085613619995307f,0.46461868630623781584f,0.88336333866573157891f, -0.46868882203582790114f,0.88119711347122209322f,0.47274903195034279069f, -0.87901222642863352519f,0.47679923006332208812f,0.87680872380914565145f, -0.48083933060033395845f,0.87458665227817611321f,0.48486924800079106435f, -0.87234605889439154058f,0.48888889691976317176f,0.87008699110871146054f, -0.49289819222978403790f,0.86780949676330332299f,0.49689704902265446895f, -0.86551362409056908920f,0.50088538261124071482f,0.86319942171212415971f, -0.50486310853126759035f,0.86086693863776730939f,0.50883014254310698909f, -0.85851622426444273994f,0.51278640063356295542f,0.85614732837519447184f, -0.51673179901764987321f,0.85376030113811141042f,0.52066625414036715735f, -0.85135519310526519554f,0.52458968267846894928f,0.84893205521163961347f, -0.52850200154222848337f,0.84649093877405212627f,0.53240312787719790144f, -0.84403189549006640835f,0.53629297906596318235f,0.84155497743689844370f, -0.54017147272989285423f,0.83906023707031274217f,0.54403852673088382019f, -0.83654772722351200542f,0.54789405917310018967f,0.83401750110601813315f, -0.55173798840470733573f,0.83146961230254523567f,0.55557023301960217765f, -0.82890411477186487499f,0.55939071185913613604f,0.82632106284566353427f, -0.56319934401383409117f,0.82372051122739142759f,0.56699604882510867832f, -0.82110251499110464835f,0.57078074588696725566f,0.81846712958029865792f, -0.57455335504771576360f,0.81581441080673378075f,0.57831379641165558958f, -0.81314441484925359394f,0.58206199034077543697f,0.81045719825259476821f, -0.58579785745643886408f,0.80775281792619035848f,0.58952131864106394055f, -0.80503133114296365758f,0.59323229503979979516f,0.80229279553811572168f, -0.59693070806219639124f,0.79953726910790501314f,0.60061647938386897305f, -0.79676481020841882774f,0.60428953094815596181f,0.79397547755433717231f, -0.60794978496777363208f,0.79116933021769020318f,0.61159716392646190641f, -0.78834642762660622761f,0.61523159058062681925f,0.78550682956405393220f, -0.61885298796097631957f,0.78265059616657572938f,0.62246127937414996723f, -0.77977778792301455368f,0.62605638840434352232f,0.77688846567323244230f, -0.62963823891492698426f,0.77398269060682289844f,0.63320675505005719064f, -0.77106052426181381776f,0.63676186123628419899f,0.76812202852336541881f, -0.64030348218415167327f,0.76516726562245895860f,0.64383154288979138613f, -0.76219629813457900891f,0.64734596863651205911f,0.75920918897838796102f, -0.65084668499638087535f,0.75620600141439453523f,0.65433361783180044036f, -0.75318679904361252042f,0.65780669329707863735f,0.75015164580621507273f, -0.66126583783999226540f,0.74710060598018013245f,0.66471097820334479334f, -0.74403374417992929057f,0.66814204142651845153f,0.74095112535495921691f, -0.67155895484701833009f,0.73785281478846598269f,0.67496164610201192513f, -0.73473887809596349907f,0.67835004312986146857f,0.73160938122389262972f, -0.68172407417164970767f,0.72846439044822519637f,0.68508366777270035541f, -0.72530397237306076796f,0.68842875278409043638f,0.72212819392921534511f, -0.69175925836415774750f,0.71893712237280449351f,0.69507511398000088043f, -0.71573082528381870571f,0.69837624940897280457f,0.71250937056469243469f, -0.70166259474016845488f,0.70927282643886568891f,0.70493408037590488124f, -0.70602126144933974317f,0.70819063703319540259f,0.70275474445722529993f, -0.71143219574521643356f,0.69947334464028376733f,0.71465868786276909308f, -0.69617713149146298601f,0.71787004505573170920f,0.69286617481742474034f, -0.72106619931450810501f,0.68954054473706694051f,0.72424708295146689174f, -0.68620031168003858824f,0.72741262860237576593f,0.68284554638524808112f, -0.73056276922782759087f,0.67947631989936496666f,0.73369743811466026084f, -0.67609270357531603413f,0.73681656887736979300f,0.67269476907077296879f, -0.73992009545951609173f,0.66928258834663600929f,0.74300795213512171866f, -0.66585623366550972246f,0.74608007351006366825f,0.66241577759017178373f, -0.74913639452345925918f,0.65896129298203731661f,0.75217685044904269986f, -0.65549285299961546070f,0.75520137689653654700f,0.65201053109695950027f, -0.75820990981301528144f,0.64851440102211255212f,0.76120238548426177871f, -0.64500453681554403840f,0.76417874053611667406f,0.64148101280858316198f, -0.76713891193582040007f,0.63794390362184416610f,0.77008283699334789674f, -0.63439328416364548779f,0.77301045336273688235f,0.63082922962842458148f, -0.77592169904340757558f,0.62725181549514419377f,0.77881651238147586724f, -0.62366111752569464155f,0.78169483207105938671f,0.62005721176328920663f, -0.78455659715557524159f,0.61644017453085364622f,0.78740174702903131809f, -0.61281008242940970820f,0.79023022143731003197f,0.60916701233645320634f, -0.79304196047944364167f,0.60551104140432554512f,0.79583690460888345530f, -0.60184224705858002658f,0.79861499463476082195f,0.59816070699634238395f, -0.80137617172314012937f,0.59446649918466454299f,0.80412037739826569549f, -0.59075970185887427544f,0.80684755354379922299f,0.58704039352091808013f, -0.80955764240405125864f,0.58330865293769829094f,0.81225058658520388200f, -0.57956455913940574387f,0.81492632905652662156f,0.57580819141784533866f, -0.81758481315158371139f,0.57203962932475704850f,0.82022598256943468620f, -0.56825895267013148970f,0.82284978137582631685f,0.56446624152051949608f, -0.82545615400437744036f,0.56066157619733603124f,0.82804504525775579626f, -0.55684503727516010407f,0.83061640030884620334f,0.55301670558002757883f, -0.83317016470191318511f,0.54917666218771976627f,0.83570628435375260423f, -0.54532498842204646383f,0.83822470555483796772f,0.54146176585312355556f, -0.84072537497045796151f,0.53758707629564550512f,0.84320823964184543620f, -0.53370100180715296379f,0.84567324698729906540f,0.52980362468629482731f, -0.84812034480329712149f,0.52589502747108474168f,0.85054948126560336874f, -0.52197529293715438925f,0.85296060493036363059f,0.51804450409599933636f, -0.85535366473519602870f,0.51410274419322166128f,0.85772861000027211809f, -0.51015009670676669806f,0.86008539042939025077f,0.50618664534515533937f, -0.86242395611104050168f,0.50221247404571089934f,0.86474425751946237817f, -0.49822766697278186854f,0.86704624551569264845f,0.49423230851595972846f, -0.86932987134860673084f,0.49022648328829110387f,0.87159508665595109012f, -0.48621027612448652899f,0.87384184346536675214f,0.48218377207912282989f, -0.87607009419540660122f,0.47814705642484311987f,0.87827979165654146421f, -0.47410021465055002254f,0.88047088905216075450f,0.47004333245959561971f, -0.88264333997956279099f,0.46597649576796612569f,0.88479709843093778954f, -0.46189979070246284243f,0.88693211879434208367f,0.45781330359887728587f, -0.88904835585466457371f,0.45371712100016392544f,0.89114576479458318392f, -0.44961132965460659516f,0.89322430119551532446f,0.44549601651398174074f, -0.89528392103855758410f,0.44137126873171661501f,0.89732458070541831763f, -0.43723717366104419835f,0.89934623697934146236f,0.43309381885315201277f, -0.90134884704602202810f,0.42894129205532954829f,0.90333236849451181705f, -0.42477968120910880589f,0.90529675931811881551f,0.42060907444840250902f, -0.90724197791529592738f,0.41642956009763731906f,0.90916798309052226923f, -0.41224122666988299857f,0.91107473405517624965f,0.40804416286497874333f, -0.91296219042839810154f,0.40383845756765412993f,0.91483031223794608611f, -0.39962419984564678810f,0.91667905992104270485f,0.39540147894781629834f, -0.91850839432521225181f,0.39117038430225398171f,0.92031827670911048322f, -0.38693100551438869283f,0.92210866874334507237f,0.38268343236508983729f, -0.92387953251128673848f,0.37842775480876561511f,0.92563083050987271516f, -0.37416406297145798909f,0.92736252565040111495f,0.36989244714893426691f, -0.92907458125931574600f,0.36561299780477396482f,0.93076696107898371224f, -0.36132580556845433906f,0.93243962926846235550f,0.35703096123343003310f, -0.93409255040425887007f,0.35272855575521072646f,0.93572568948108036935f, -0.34841868024943450921f,0.93733901191257495977f,0.34410142598993898044f, -0.93893248353206448797f,0.33977688440682696225f,0.94050607059326829518f, -0.33544514708453165852f,0.94205973977101731265f,0.33110630575987642921f, -0.94359345816196038559f,0.32676045232013178898f,0.94510719328526060501f, -0.32240767880107001897f,0.94660091308328353499f,0.31804807738501505998f, -0.94807458592227622507f,0.31368174039889157312f,0.94952818059303667475f, -0.30930876031226878231f,0.95096166631157508231f,0.30492922973540242948f, -0.95237501271976587880f,0.30054324141727339903f,0.95376818988599032512f, -0.29615088824362395536f,0.95514116830577067141f,0.29175226323498937298f, -0.95649391890239499059f,0.28734745954472956653f,0.95782641302753290802f, -0.28293657045705539188f,0.95913862246184189431f,0.27851968938505305973f, -0.96043051941556578655f,0.27409690986870632878f,0.96170207652912254037f, -0.26966832557291520178f,0.96295326687368387741f,0.26523403028551190141f, -0.96418406395174571788f,0.26079411791527556952f,0.96539444169768939830f, -0.25634868248994291395f,0.96658437447833311928f,0.25189781815421691258f, -0.96775383709347551076f,0.24744161916777343557f,0.96890280477642887202f, -0.24298017990326398197f,0.97003125319454397424f,0.23851359484431849944f, -0.97113915844972509284f,0.23404195858354345794f,0.97222649707893626925f, -0.22956536582051886852f,0.97329324605469824672f,0.22508391135979277653f, -0.97433938278557585821f,0.22059769010887364526f,0.97536488511665686563f, -0.21610679707621960333f,0.97636973133002114000f,0.21161132736922760866f, -0.97735390014519996082f,0.20711137619221856032f,0.97831737071962765473f, -0.20260703884442110567f,0.97926012264908202098f,0.19809841071795372680f, -0.98018213596811731847f,0.19358558729580374602f,0.98108339115048659451f, -0.18906866414980627589f,0.98196386910955524296f,0.18454773693861964423f, -0.98282355119870523641f,0.18002290140569951471f,0.98366241921173025453f, -0.17549425337727139751f,0.98448045538322093151f,0.17096188876030135595f, -0.98527764238894122162f,0.16642590354046421508f,0.98605396334619543897f, -0.16188639378011188130f,0.98680940181418541624f,0.15734345561623827581f, -0.98754394179435922574f,0.15279718525844340760f,0.98825756773074946437f, -0.14824767898689619749f,0.98895026451030298986f,0.14369503315029458212f, -0.98962201746320077600f,0.13913934416382628401f,0.99027281236316910817f, -0.13458070850712622324f,0.99090263542778000971f,0.13001922272223334631f, -0.99151147331874389668f,0.12545498341154620592f,0.99209931314219179654f, -0.12088808723577722237f,0.99266614244894801899f,0.11631863091190487725f, -0.99321194923479450001f,0.11174671121112665639f,0.99373672194072459884f, -0.10717242495680887049f,0.99424044945318790223f,0.10259586902243628126f, -0.99472312110432570265f,0.09801714032956077016f,0.99518472667219681771f, -0.09343633584574791151f,0.99562525638099430569f,0.08885355258252468358f, -0.99604470090125196702f,0.08426888759332412659f,0.99644305135004263008f, -0.07968243797143012563f,0.99682029929116566791f,0.07509430084792129145f, -0.99717643673532618820f,0.07050457338961400866f,0.99751145614030345410f, -0.06591335279700392957f,0.99782535041111164453f,0.06132073630220864768f, -0.99811811290014917919f,0.05672682116690778292f,0.99838973740734016094f, -0.05213170468028331672f,0.99864021818026527111f,0.04753548415695926094f, -0.99886954991428356099f,0.04293825693494095902f,0.99907772775264536147f, -0.03834012037355279123f,0.99926474728659442359f,0.03374117185137764235f, -0.99943060455546173237f,0.02914150876419373953f,0.99957529604674921764f, -0.02454122852291226384f,0.99969881869620424997f,0.01994042855151459750f, -0.99980116988788425569f,0.01533920628498821985f,0.99988234745421256111f, -0.01073765916726457208f,0.99994234967602391162f,0.00613588464915451517f, -0.99998117528260110909f,0.00153398018628476615f,0.99999882345170187925f, --0.00306795676296601561f,0.99999529380957619118f,-0.00766982873953095477f, -0.99997058643097413988f,-0.01227153828571982304f,0.99992470183914450299f, --0.01687298794728165144f,0.99985764100582386060f,-0.02147408027546948359f, -0.99976940535121527898f,-0.02607471782910391472f,0.99965999674395922270f, --0.03067480317663645942f,0.99952941750109314256f,-0.03527423889821382219f, -0.99937767038800284780f,-0.03987292758773972740f,0.99920475861836388631f, --0.04447077185493861912f,0.99901068585407337697f,-0.04906767432741800800f, -0.99879545620517240501f,-0.05366353765273055437f,0.99855907422975931365f, --0.05825826450043560673f,0.99830154493389289261f,-0.06285175756416130910f, -0.99802287377148624081f,-0.06744391956366398155f,0.99772306664419163624f, --0.07203465324688929083f,0.99740212990127530279f,-0.07662386139203150592f, -0.99706007033948296225f,-0.08121144680959226092f,0.99669689520289606044f, --0.08579731234443975507f,0.99631261218277800129f,-0.09038136087786488582f, -0.99590722941741172125f,-0.09496349532963895002f,0.99548075549192693856f, --0.09954361866006931903f,0.99503319943811863180f,-0.10412163387205460030f, -0.99456457073425541537f,-0.10869744401313856386f,0.99407487930487947736f, --0.11327095217756423529f,0.99356413552059530403f,-0.11784206150832489401f, -0.99303235019785141002f,-0.12241067519921615403f,0.99247953459870996706f, --0.12697669649688586579f,0.99190570043060932726f,-0.13154002870288314386f, -0.99131085984611544415f,-0.13610057517570606223f,0.99069502544266463406f, --0.14065823933284912761f,0.99005821026229712256f,-0.14521292465284740825f, -0.98940042779138037687f,-0.14976453467732150915f,0.98872169196032377858f, --0.15431297301302013270f,0.98802201714328352633f,-0.15885814333386127917f, -0.98730141815785843473f,-0.16339994938297311422f,0.98655991026477551920f, --0.16793829497473108936f,0.98579750916756747614f,-0.17247308399679592283f, -0.98501423101223983814f,-0.17700422041214874946f,0.98421009238692902521f, --0.18153160826112502146f,0.98338511032155118130f,-0.18605515166344649414f, -0.98253930228744124076f,-0.19057475482025265645f,0.98167268619698311305f, --0.19509032201612819257f,0.98078528040323043058f,-0.19960175762113094300f, -0.97987710369951763756f,-0.20410896609281689584f,0.97894817531906219710f, --0.20861185197826331850f,0.97799851493455713936f,-0.21311031991609125091f, -0.97702814265775439484f,-0.21760427463848355800f,0.97603707903903913490f, --0.22209362097320348162f,0.97502534506699412020f,-0.22657826384560997290f, -0.97399296216795583359f,-0.23105810828067113727f,0.97293995220556017678f, --0.23553305940497534787f,0.97186633748027939639f,-0.24000302244874138768f, -0.97077214072895035013f,-0.24446790274782409513f,0.96965738512429244800f, --0.24892760574572012078f,0.96852209427441737777f,-0.25338203699557015902f, -0.96736629222232850545f,-0.25783110216215882060f,0.96619000344541261516f, --0.26227470702391347812f,0.96499325285492043580f,-0.26671275747489830987f, -0.96377606579543984022f,-0.27114515952680795507f,0.96253846804435916340f, --0.27557181931095814376f,0.96128048581132063966f,-0.27999264308027327353f, -0.96000214573766584625f,-0.28440753721127171039f,0.95870347489587159906f, --0.28881640820604936870f,0.95738450078897596729f,-0.29321916269425857271f, -0.95604525134999651659f,-0.29761570743508619641f,0.95468575494133833814f, --0.30200594931922808417f,0.95330604035419386211f,-0.30638979537086097338f, -0.95190613680793234597f,-0.31076715274961136393f,0.95048607394948181337f, --0.31513792875252233383f,0.94904588185270055689f,-0.31950203081601563637f, -0.94758559101774120226f,-0.32385936651785285356f,0.94610523237040344835f, --0.32820984357909255280f,0.94460483726148025685f,-0.33255336986604405736f, -0.94308443746609349478f,-0.33688985339221994009f,0.94154406518302080631f, --0.34121920232028229991f,0.93998375303401404679f,-0.34554132496398903829f, -0.93840353406310816897f,-0.34985612979013491763f,0.93680344173592156043f, --0.35416352542049039931f,0.93518350993894761025f,-0.35846342063373642928f, -0.93354377297883628373f,-0.36275572436739711435f,0.93188426558166814750f, --0.36704034571976712487f,0.93020502289221906889f,-0.37131719395183748755f, -0.92850608047321558924f,-0.37558617848921721505f,0.92678747430458174872f, --0.37984720892405099413f,0.92504924078267769527f,-0.38410019501693493105f, -0.92329141671952774661f,-0.38834504669882619066f,0.92151403934204201285f, --0.39258167407295141427f,0.91971714629122736095f,-0.39680998741671030805f, -0.91790077562139049672f,-0.40102989718357567872f,0.91606496579933172075f, --0.40524131400498974998f,0.91420975570353069095f,-0.40944414869225753684f, -0.91233518462332285903f,-0.41363831223843450235f,0.91044129225806724737f, --0.41782371582021227141f,0.90852811871630612117f,-0.42200027079979968159f, -0.90659570451491533483f,-0.42616788872679967071f,0.90464409057824612947f, --0.43032648134008272267f,0.90267331823725871498f,-0.43447596056965581690f, -0.90068342922864685907f,-0.43861623853852738097f,0.89867446569395392775f, --0.44274722756456980077f,0.89664647017868026602f,-0.44686884016237399253f, -0.89459948563138280697f,-0.45098098904510369733f,0.89253355540276468894f, --0.45508358712634372489f,0.89044872324475798919f,-0.45917654752194403400f, -0.88834503330959635470f,-0.46325978355186014923f,0.88622253014888063838f, --0.46733320874198841510f,0.88408125871263498752f,-0.47139673682599769755f, -0.88192126434835504956f,-0.47545028174715592284f,0.87974259280004740713f, --0.47949375766015311928f,0.87754529020726124156f,-0.48352707893291846375f, -0.87532940310411100349f,-0.48755016014843571837f,0.87309497841829020182f, --0.49156291610654972990f,0.87084206347007897531f,-0.49556526182577237405f, -0.86857070597134100609f,-0.49955711254508178287f,0.86628095402451310569f, --0.50353838372571746440f,0.86397285612158680745f,-0.50750899105297075931f, -0.86164646114308141023f,-0.51146885043797041259f,0.85930181835700847337f, --0.51541787801946303826f,0.85693897741782865118f,-0.51935599016558964269f, -0.85455798836540053376f,-0.52328310347565654137f,0.85215890162391971785f, --0.52719913478190105760f,0.84974176800085265970f,-0.53110400115125477871f, -0.84730663868585853749f,-0.53499761988709704230f,0.84485356524970722791f, --0.53887990853100831146f,0.84238259964318595863f,-0.54275078486451577842f, -0.83989379419599952126f,-0.54661016691083474939f,0.83738720161566193578f, --0.55045797293660470029f,0.83486287498638012128f,-0.55429412145362011444f, -0.83232086776792968408f,-0.55811853122055610221f,0.82976123379452304540f, --0.56193112124468946877f,0.82718402727366902027f,-0.56573181078361323149f, -0.82458930278502517996f,-0.56952051934694725155f,0.82197711527924144370f, --0.57329716669804198226f,0.81934752007679712005f,-0.57706167285567933067f, -0.81670057286682795628f,-0.58081395809576441547f,0.81403632970594852480f, --0.58455394295301521534f,0.81135484701706384048f,-0.58828154822264522306f, -0.80865618158817509364f,-0.59199669496204088137f,0.80594039057117639047f, --0.59569930449243335691f,0.80320753148064494287f,-0.59938929840056454079f, -0.80045766219262282082f,-0.60306659854034827539f,0.79769084094339104407f, --0.60673112703452458661f,0.79490712632823690154f,-0.61038280627630958630f, -0.79210657730021227785f,-0.61402155893103815831f,0.78928925316888587371f, --0.61764730793780375784f,0.78645521359908587833f,-0.62125997651108744169f, -0.78360451860963831194f,-0.62485948814238623239f,0.78073722857209459924f, --0.62844576660183260053f,0.77785340420945314754f,-0.63201873593980895105f, -0.77495310659487393057f,-0.63557832048855611440f,0.77203639715038452351f, --0.63912444486377573138f,0.76910333764557958780f,-0.64265703396622686494f, -0.76615399019631280630f,-0.64617601298331639459f,0.76318841726338115805f, --0.64968130739068330470f,0.76020668165120230952f,-0.65317284295377653347f, -0.75720884650648467851f,-0.65665054572942882505f,0.75419497531688928227f, --0.66011434206742036768f,0.75116513190968658975f,-0.66356415861203965623f, -0.74811938045040371481f,-0.66699992230363736034f,0.74505778544146605835f, --0.67042156038017308717f,0.74198041172083106787f,-0.67382900037875603783f, -0.73888732446061522463f,-0.67722217013718044587f,0.73577858916571359238f, --0.68060099779545302212f,0.73265427167241281570f,-0.68396541179731551452f, -0.72951443814699701296f,-0.68731534089175916336f,0.72635915508434589771f, --0.69065071413453438254f,0.72318848930652757101f,-0.69397146088965377952f, -0.72000250796138176579f,-0.69727751083088640449f,0.71680127852109964959f, --0.70056879394324822474f,0.71358486878079363525f,-0.70384524052448482756f, -0.71035334685706241764f,-0.70710678118654746172f,0.70710678118654757274f, --0.71035334685706230662f,0.70384524052448504960f,-0.71358486878079352422f, -0.70056879394324833576f,-0.71680127852109953857f,0.69727751083088651551f, --0.72000250796138165477f,0.69397146088965389055f,-0.72318848930652745999f, -0.69065071413453460458f,-0.72635915508434578669f,0.68731534089175927438f, --0.72951443814699679091f,0.68396541179731562554f,-0.73265427167241270467f, -0.68060099779545324417f,-0.73577858916571337033f,0.67722217013718055689f, --0.73888732446061511361f,0.67382900037875614885f,-0.74198041172083095685f, -0.67042156038017319819f,-0.74505778544146594733f,0.66699992230363758239f, --0.74811938045040360379f,0.66356415861203976725f,-0.75116513190968636771f, -0.66011434206742047870f,-0.75419497531688917125f,0.65665054572942904709f, --0.75720884650648467851f,0.65317284295377664449f,-0.76020668165120219850f, -0.64968130739068341573f,-0.76318841726338115805f,0.64617601298331661663f, --0.76615399019631280630f,0.64265703396622708699f,-0.76910333764557947678f, -0.63912444486377584241f,-0.77203639715038441249f,0.63557832048855622542f, --0.77495310659487381955f,0.63201873593980906207f,-0.77785340420945303652f, -0.62844576660183271155f,-0.78073722857209448822f,0.62485948814238634341f, --0.78360451860963820092f,0.62125997651108755271f,-0.78645521359908576731f, -0.61764730793780386886f,-0.78928925316888576269f,0.61402155893103838036f, --0.79210657730021216683f,0.61038280627630969732f,-0.79490712632823679051f, -0.60673112703452469763f,-0.79769084094339093305f,0.60306659854034838641f, --0.80045766219262259877f,0.59938929840056465181f,-0.80320753148064483184f, -0.59569930449243346793f,-0.80594039057117627944f,0.59199669496204099239f, --0.80865618158817498262f,0.58828154822264533408f,-0.81135484701706372945f, -0.58455394295301532637f,-0.81403632970594841378f,0.58081395809576452649f, --0.81670057286682784525f,0.57706167285567944170f,-0.81934752007679700903f, -0.57329716669804209328f,-0.82197711527924133268f,0.56952051934694747359f, --0.82458930278502506894f,0.56573181078361345353f,-0.82718402727366902027f, -0.56193112124468957980f,-0.82976123379452293438f,0.55811853122055632426f, --0.83232086776792957306f,0.55429412145362022546f,-0.83486287498638001026f, -0.55045797293660492233f,-0.83738720161566182476f,0.54661016691083497143f, --0.83989379419599952126f,0.54275078486451588944f,-0.84238259964318584760f, -0.53887990853100842248f,-0.84485356524970711689f,0.53499761988709715332f, --0.84730663868585842646f,0.53110400115125488973f,-0.84974176800085254868f, -0.52719913478190127964f,-0.85215890162391960683f,0.52328310347565665239f, --0.85455798836540042274f,0.51935599016558975372f,-0.85693897741782865118f, -0.51541787801946314929f,-0.85930181835700836235f,0.51146885043797052361f, --0.86164646114308129921f,0.50750899105297098135f,-0.86397285612158669643f, -0.50353838372571757542f,-0.86628095402451299467f,0.49955711254508189390f, --0.86857070597134089507f,0.49556526182577254058f,-0.87084206347007886428f, -0.49156291610654989643f,-0.87309497841829009079f,0.48755016014843588490f, --0.87532940310411089246f,0.48352707893291863028f,-0.87754529020726113053f, -0.47949375766015328582f,-0.87974259280004729611f,0.47545028174715608937f, --0.88192126434835493853f,0.47139673682599780857f,-0.88408125871263487650f, -0.46733320874198858164f,-0.88622253014888052736f,0.46325978355186031576f, --0.88834503330959624368f,0.45917654752194420054f,-0.89044872324475787817f, -0.45508358712634389143f,-0.89253355540276457791f,0.45098098904510386387f, --0.89459948563138269595f,0.44686884016237415906f,-0.89664647017868026602f, -0.44274722756456996731f,-0.89867446569395392775f,0.43861623853852754751f, --0.90068342922864674804f,0.43447596056965598343f,-0.90267331823725871498f, -0.43032648134008288920f,-0.90464409057824612947f,0.42616788872679983724f, --0.90659570451491533483f,0.42200027079979984812f,-0.90852811871630612117f, -0.41782371582021243794f,-0.91044129225806713634f,0.41363831223843466889f, --0.91233518462332274801f,0.40944414869225770337f,-0.91420975570353069095f, -0.40524131400498991651f,-0.91606496579933172075f,0.40102989718357562321f, --0.91790077562139049672f,0.39680998741671025254f,-0.91971714629122736095f, -0.39258167407295141427f,-0.92151403934204179080f,0.38834504669882657923f, --0.92329141671952752457f,0.38410019501693531963f,-0.92504924078267747323f, -0.37984720892405138271f,-0.92678747430458174872f,0.37558617848921738158f, --0.92850608047321547822f,0.37131719395183770960f,-0.93020502289221906889f, -0.36704034571976729140f,-0.93188426558166803648f,0.36275572436739728088f, --0.93354377297883617270f,0.35846342063373659581f,-0.93518350993894761025f, -0.35416352542049039931f,-0.93680344173592167145f,0.34985612979013486212f, --0.93840353406310816897f,0.34554132496398898278f,-0.93998375303401382475f, -0.34121920232028268849f,-0.94154406518302069529f,0.33688985339222032867f, --0.94308443746609338376f,0.33255336986604444593f,-0.94460483726148014583f, -0.32820984357909271933f,-0.94610523237040333733f,0.32385936651785302010f, --0.94758559101774109124f,0.31950203081601580291f,-0.94904588185270055689f, -0.31513792875252250036f,-0.95048607394948170235f,0.31076715274961153046f, --0.95190613680793234597f,0.30638979537086091787f,-0.95330604035419386211f, -0.30200594931922802866f,-0.95468575494133833814f,0.29761570743508614090f, --0.95604525134999629454f,0.29321916269425896129f,-0.95738450078897585627f, -0.28881640820604975728f,-0.95870347489587148804f,0.28440753721127209896f, --0.96000214573766584625f,0.27999264308027344006f,-0.96128048581132063966f, -0.27557181931095831029f,-0.96253846804435916340f,0.27114515952680812161f, --0.96377606579543984022f,0.26671275747489847641f,-0.96499325285492032478f, -0.26227470702391370017f,-0.96619000344541250413f,0.25783110216215898713f, --0.96736629222232850545f,0.25338203699557010351f,-0.96852209427441737777f, -0.24892760574572009302f,-0.96965738512429233698f,0.24446790274782448371f, --0.97077214072895023911f,0.24000302244874177626f,-0.97186633748027928537f, -0.23553305940497573645f,-0.97293995220556006576f,0.23105810828067133156f, --0.97399296216795583359f,0.22657826384561016719f,-0.97502534506699412020f, -0.22209362097320364815f,-0.97603707903903902388f,0.21760427463848372454f, --0.97702814265775439484f,0.21311031991609141745f,-0.97799851493455713936f, -0.20861185197826351279f,-0.97894817531906219710f,0.20410896609281684033f, --0.97987710369951763756f,0.19960175762113091524f,-0.98078528040323043058f, -0.19509032201612860891f,-0.98167268619698311305f,0.19057475482025307278f, --0.98253930228744124076f,0.18605515166344691047f,-0.98338511032155118130f, -0.18153160826112521575f,-0.98421009238692902521f,0.17700422041214894375f, --0.98501423101223983814f,0.17247308399679611712f,-0.98579750916756736512f, -0.16793829497473128365f,-0.98655991026477540817f,0.16339994938297328075f, --0.98730141815785843473f,0.15885814333386147346f,-0.98802201714328352633f, -0.15431297301302007718f,-0.98872169196032377858f,0.14976453467732145364f, --0.98940042779138037687f,0.14521292465284735274f,-0.99005821026229701154f, -0.14065823933284954395f,-0.99069502544266463406f,0.13610057517570647856f, --0.99131085984611544415f,0.13154002870288333815f,-0.99190570043060932726f, -0.12697669649688606008f,-0.99247953459870996706f,0.12241067519921634832f, --0.99303235019785141002f,0.11784206150832508830f,-0.99356413552059530403f, -0.11327095217756441570f,-0.99407487930487936634f,0.10869744401313874427f, --0.99456457073425541537f,0.10412163387205457254f,-0.99503319943811863180f, -0.09954361866006927739f,-0.99548075549192693856f,0.09496349532963890838f, --0.99590722941741172125f,0.09038136087786528827f,-0.99631261218277800129f, -0.08579731234444015753f,-0.99669689520289606044f,0.08121144680959266338f, --0.99706007033948296225f,0.07662386139203168633f,-0.99740212990127530279f, -0.07203465324688947125f,-0.99772306664419163624f,0.06744391956366417584f, --0.99802287377148624081f,0.06285175756416148951f,-0.99830154493389289261f, -0.05825826450043579408f,-0.99855907422975931365f,0.05366353765273051968f, --0.99879545620517240501f,0.04906767432741796636f,-0.99901068585407337697f, -0.04447077185493858442f,-0.99920475861836388631f,0.03987292758774012985f, --0.99937767038800284780f,0.03527423889821423159f,-0.99952941750109314256f, -0.03067480317663686534f,-0.99965999674395922270f,0.02607471782910409860f, --0.99976940535121527898f,0.02147408027546966747f,-0.99985764100582386060f, -0.01687298794728183532f,-0.99992470183914450299f,0.01227153828572000692f, --0.99997058643097413988f,0.00766982873953113778f,-0.99999529380957619118f, -0.00306795676296597701f,-0.99999882345170187925f,-0.00153398018628480431f, --0.99998117528260110909f,-0.00613588464915455420f,-0.99994234967602391162f, --0.01073765916726416615f,-0.99988234745421256111f,-0.01533920628498781566f, --0.99980116988788425569f,-0.01994042855151419158f,-0.99969881869620424997f, --0.02454122852291207996f,-0.99957529604674921764f,-0.02914150876419355565f, --0.99943060455546173237f,-0.03374117185137745500f,-0.99926474728659442359f, --0.03834012037355261082f,-0.99907772775264536147f,-0.04293825693494077861f, --0.99886954991428356099f,-0.04753548415695929563f,-0.99864021818026527111f, --0.05213170468028335142f,-0.99838973740734016094f,-0.05672682116690781762f, --0.99811811290014917919f,-0.06132073630220824523f,-0.99782535041111164453f, --0.06591335279700352712f,-0.99751145614030345410f,-0.07050457338961360620f, --0.99717643673532618820f,-0.07509430084792109716f,-0.99682029929116577893f, --0.07968243797142994522f,-0.99644305135004263008f,-0.08426888759332393231f, --0.99604470090125196702f,-0.08885355258252450317f,-0.99562525638099430569f, --0.09343633584574773110f,-0.99518472667219692873f,-0.09801714032956058975f, --0.99472312110432570265f,-0.10259586902243630901f,-0.99424044945318790223f, --0.10717242495680891212f,-0.99373672194072470987f,-0.11174671121112625394f, --0.99321194923479461103f,-0.11631863091190447479f,-0.99266614244894801899f, --0.12088808723577681992f,-0.99209931314219179654f,-0.12545498341154601163f, --0.99151147331874400770f,-0.13001922272223317978f,-0.99090263542778000971f, --0.13458070850712605671f,-0.99027281236316910817f,-0.13913934416382611747f, --0.98962201746320088702f,-0.14369503315029438784f,-0.98895026451030298986f, --0.14824767898689603096f,-0.98825756773074946437f,-0.15279718525844343535f, --0.98754394179435922574f,-0.15734345561623830356f,-0.98680940181418552726f, --0.16188639378011149272f,-0.98605396334619543897f,-0.16642590354046382650f, --0.98527764238894133264f,-0.17096188876030096737f,-0.98448045538322093151f, --0.17549425337727120322f,-0.98366241921173025453f,-0.18002290140569934818f, --0.98282355119870534743f,-0.18454773693861947770f,-0.98196386910955524296f, --0.18906866414980610935f,-0.98108339115048670553f,-0.19358558729580355173f, --0.98018213596811742949f,-0.19809841071795356027f,-0.97926012264908202098f, --0.20260703884442113343f,-0.97831737071962765473f,-0.20711137619221858808f, --0.97735390014519996082f,-0.21161132736922766417f,-0.97636973133002125103f, --0.21610679707621921475f,-0.97536488511665697665f,-0.22059769010887325669f, --0.97433938278557585821f,-0.22508391135979261000f,-0.97329324605469824672f, --0.22956536582051870199f,-0.97222649707893638027f,-0.23404195858354326365f, --0.97113915844972520386f,-0.23851359484431830515f,-0.97003125319454397424f, --0.24298017990326381543f,-0.96890280477642887202f,-0.24744161916777326904f, --0.96775383709347551076f,-0.25189781815421696809f,-0.96658437447833311928f, --0.25634868248994291395f,-0.96539444169768939830f,-0.26079411791527562503f, --0.96418406395174582890f,-0.26523403028551151284f,-0.96295326687368398844f, --0.26966832557291481320f,-0.96170207652912265139f,-0.27409690986870616225f, --0.96043051941556589757f,-0.27851968938505289319f,-0.95913862246184200533f, --0.28293657045705516984f,-0.95782641302753290802f,-0.28734745954472939999f, --0.95649391890239510161f,-0.29175226323498920644f,-0.95514116830577078243f, --0.29615088824362378883f,-0.95376818988599032512f,-0.30054324141727345454f, --0.95237501271976587880f,-0.30492922973540242948f,-0.95096166631157508231f, --0.30930876031226878231f,-0.94952818059303678577f,-0.31368174039889118454f, --0.94807458592227633609f,-0.31804807738501467140f,-0.94660091308328364601f, --0.32240767880106963039f,-0.94510719328526060501f,-0.32676045232013156694f, --0.94359345816196038559f,-0.33110630575987626267f,-0.94205973977101742367f, --0.33544514708453149199f,-0.94050607059326840620f,-0.33977688440682679571f, --0.93893248353206459900f,-0.34410142598993881391f,-0.93733901191257495977f, --0.34841868024943456472f,-0.93572568948108036935f,-0.35272855575521072646f, --0.93409255040425887007f,-0.35703096123343008861f,-0.93243962926846246653f, --0.36132580556845395048f,-0.93076696107898382326f,-0.36561299780477357624f, --0.92907458125931585702f,-0.36989244714893387833f,-0.92736252565040111495f, --0.37416406297145782256f,-0.92563083050987282618f,-0.37842775480876539307f, --0.92387953251128684951f,-0.38268343236508967076f,-0.92210866874334518339f, --0.38693100551438852630f,-0.92031827670911059425f,-0.39117038430225381518f, --0.91850839432521225181f,-0.39540147894781629834f,-0.91667905992104270485f, --0.39962419984564684361f,-0.91483031223794608611f,-0.40383845756765418544f, --0.91296219042839832358f,-0.40804416286497835475f,-0.91107473405517647169f, --0.41224122666988260999f,-0.90916798309052249127f,-0.41642956009763693048f, --0.90724197791529592738f,-0.42060907444840234248f,-0.90529675931811881551f, --0.42477968120910863936f,-0.90333236849451192807f,-0.42894129205532938176f, --0.90134884704602202810f,-0.43309381885315184624f,-0.89934623697934157338f, --0.43723717366104403181f,-0.89732458070541831763f,-0.44137126873171667052f, --0.89528392103855747308f,-0.44549601651398174074f,-0.89322430119551532446f, --0.44961132965460665067f,-0.89114576479458340597f,-0.45371712100016353686f, --0.88904835585466468473f,-0.45781330359887695280f,-0.88693211879434230571f, --0.46189979070246250936f,-0.88479709843093790056f,-0.46597649576796595916f, --0.88264333997956290201f,-0.47004333245959545318f,-0.88047088905216086552f, --0.47410021465054985601f,-0.87827979165654157523f,-0.47814705642484295334f, --0.87607009419540660122f,-0.48218377207912266336f,-0.87384184346536686316f, --0.48621027612448636246f,-0.87159508665595109012f,-0.49022648328829115938f, --0.86932987134860673084f,-0.49423230851595978397f,-0.86704624551569287050f, --0.49822766697278153547f,-0.86474425751946248919f,-0.50221247404571056627f, --0.86242395611104072373f,-0.50618664534515500630f,-0.86008539042939025077f, --0.51015009670676658704f,-0.85772861000027211809f,-0.51410274419322155026f, --0.85535366473519613972f,-0.51804450409599922533f,-0.85296060493036374162f, --0.52197529293715427823f,-0.85054948126560347976f,-0.52589502747108463065f, --0.84812034480329723252f,-0.52980362468629460526f,-0.84567324698729906540f, --0.53370100180715296379f,-0.84320823964184543620f,-0.53758707629564550512f, --0.84072537497045818355f,-0.54146176585312322249f,-0.83822470555483818977f, --0.54532498842204613076f,-0.83570628435375271525f,-0.54917666218771943321f, --0.83317016470191329613f,-0.55301670558002735678f,-0.83061640030884642538f, --0.55684503727515988203f,-0.82804504525775590729f,-0.56066157619733592021f, --0.82545615400437755138f,-0.56446624152051938506f,-0.82284978137582642788f, --0.56825895267013148970f,-0.82022598256943468620f,-0.57203962932475704850f, --0.81758481315158371139f,-0.57580819141784533866f,-0.81492632905652662156f, --0.57956455913940574387f,-0.81225058658520388200f,-0.58330865293769829094f, --0.80955764240405148069f,-0.58704039352091774706f,-0.80684755354379944503f, --0.59075970185887394237f,-0.80412037739826591753f,-0.59446649918466420992f, --0.80137617172314035141f,-0.59816070699634216190f,-0.79861499463476093297f, --0.60184224705857991555f,-0.79583690460888356633f,-0.60551104140432543410f, --0.79304196047944375270f,-0.60916701233645309532f,-0.79023022143731003197f, --0.61281008242940970820f,-0.78740174702903142911f,-0.61644017453085364622f, --0.78455659715557524159f,-0.62005721176328920663f,-0.78169483207105938671f, --0.62366111752569464155f,-0.77881651238147620031f,-0.62725181549514386070f, --0.77592169904340779762f,-0.63082922962842424841f,-0.77301045336273710440f, --0.63439328416364526575f,-0.77008283699334811878f,-0.63794390362184394405f, --0.76713891193582051109f,-0.64148101280858305095f,-0.76417874053611678509f, --0.64500453681554381635f,-0.76120238548426188974f,-0.64851440102211233008f, --0.75820990981301539247f,-0.65201053109695950027f,-0.75520137689653654700f, --0.65549285299961534967f,-0.75217685044904269986f,-0.65896129298203731661f, --0.74913639452345925918f,-0.66241577759017178373f,-0.74608007351006400132f, --0.66585623366550938940f,-0.74300795213512194071f,-0.66928258834663578725f, --0.73992009545951631377f,-0.67269476907077274674f,-0.73681656887737001504f, --0.67609270357531581208f,-0.73369743811466037187f,-0.67947631989936485564f, --0.73056276922782770189f,-0.68284554638524797010f,-0.72741262860237587695f, --0.68620031168003847721f,-0.72424708295146700276f,-0.68954054473706682948f, --0.72106619931450810501f,-0.69286617481742462932f,-0.71787004505573170920f, --0.69617713149146298601f,-0.71465868786276898206f,-0.69947334464028387835f, --0.71143219574521665560f,-0.70275474445722507788f,-0.70819063703319551362f, --0.70602126144933952112f,-0.70493408037590510329f,-0.70927282643886546687f, --0.70166259474016867692f,-0.71250937056469221265f,-0.69837624940897302661f, --0.71573082528381848366f,-0.69507511398000099145f,-0.71893712237280438249f, --0.69175925836415785852f,-0.72212819392921523409f,-0.68842875278409054740f, --0.72530397237306065694f,-0.68508366777270035541f,-0.72846439044822519637f, --0.68172407417164981869f,-0.73160938122389251870f,-0.67835004312986146857f, --0.73473887809596349907f,-0.67496164610201225820f,-0.73785281478846576064f, --0.67155895484701866316f,-0.74095112535495888384f,-0.66814204142651867357f, --0.74403374417992906853f,-0.66471097820334501538f,-0.74710060598017991040f, --0.66126583783999237642f,-0.75015164580621496171f,-0.65780669329707874837f, --0.75318679904361240940f,-0.65433361783180066240f,-0.75620600141439442421f, --0.65084668499638098638f,-0.75920918897838796102f,-0.64734596863651250320f, --0.76219629813457856482f,-0.64383154288979149715f,-0.76516726562245895860f, --0.64030348218415200634f,-0.76812202852336519676f,-0.63676186123628419899f, --0.77106052426181381776f,-0.63320675505005752370f,-0.77398269060682256537f, --0.62963823891492687324f,-0.77688846567323255332f,-0.62605638840434374437f, --0.77977778792301433164f,-0.62246127937414974518f,-0.78265059616657584041f, --0.61885298796097643059f,-0.78550682956405382118f,-0.61523159058062726334f, --0.78834642762660589455f,-0.61159716392646201744f,-0.79116933021769009216f, --0.60794978496777407617f,-0.79397547755433683925f,-0.60428953094815607283f, --0.79676481020841871672f,-0.60061647938386930612f,-0.79953726910790479110f, --0.59693070806219639124f,-0.80229279553811572168f,-0.59323229503980012822f, --0.80503133114296343553f,-0.58952131864106382952f,-0.80775281792619046950f, --0.58579785745643908612f,-0.81045719825259465718f,-0.58206199034077532595f, --0.81314441484925370496f,-0.57831379641165570060f,-0.81581441080673366972f, --0.57455335504771631872f,-0.81846712958029832485f,-0.57078074588696736669f, --0.82110251499110464835f,-0.56699604882510901138f,-0.82372051122739109452f, --0.56319934401383409117f,-0.82632106284566342325f,-0.55939071185913646911f, --0.82890411477186465294f,-0.55557023301960217765f,-0.83146961230254523567f, --0.55173798840470766880f,-0.83401750110601791111f,-0.54789405917310007865f, --0.83654772722351211645f,-0.54403852673088415326f,-0.83906023707031252012f, --0.54017147272989274320f,-0.84155497743689855472f,-0.53629297906596329337f, --0.84403189549006629733f,-0.53240312787719845655f,-0.84649093877405179320f, --0.52850200154222859439f,-0.84893205521163961347f,-0.52458968267846928235f, --0.85135519310526486247f,-0.52066625414036715735f,-0.85376030113811141042f, --0.51673179901765020627f,-0.85614732837519424979f,-0.51278640063356295542f, --0.85851622426444285097f,-0.50883014254310732216f,-0.86086693863776708735f, --0.50486310853126736831f,-0.86319942171212427073f,-0.50088538261124104789f, --0.86551362409056897818f,-0.49689704902265435793f,-0.86780949676330332299f, --0.49289819222978420443f,-0.87008699110871134952f,-0.48888889691976367136f, --0.87234605889439120752f,-0.48486924800079117537f,-0.87458665227817611321f, --0.48083933060033440254f,-0.87680872380914542941f,-0.47679923006332214364f, --0.87901222642863341417f,-0.47274903195034317926f,-0.88119711347122187117f, --0.46868882203582790114f,-0.88336333866573157891f,-0.46461868630623814891f, --0.88551085613619973103f,-0.46053871095823989412f,-0.88763962040285404598f, --0.45644898239688419528f,-0.88974958638307266590f,-0.45234958723377066692f, --0.89184070939234283415f,-0.44824061228522010802f,-0.89391294514520314163f, --0.44412214457042975546f,-0.89596624975618488484f,-0.43999427130963336685f, --0.89800057974073976830f,-0.43585707992225597440f,-0.90001589201615994629f, --0.43171065802505731446f,-0.90201214390249317976f,-0.42755509343028247349f, --0.90398929312344311615f,-0.42339047414379599177f,-0.90594729780726845902f, --0.41921688836322429372f,-0.90788611648766603945f,-0.41503442447608152044f, --0.90980570810465233311f,-0.41084317105790418845f,-0.91170603200542976730f, --0.40664321687036886210f,-0.91358704794525091852f,-0.40243465085941865222f, --0.91544871608826772214f,-0.39821756215337417162f,-0.91729099700837768427f, --0.39399204006104820985f,-0.91911385169005765938f,-0.38975817406985696634f, --0.92091724152918930102f,-0.38551605384391890441f,-0.92270112833387851747f, --0.38126576922216276477f,-0.92446547432526249288f,-0.37700741021641820394f, --0.92621024213831137928f,-0.37274106700951614712f,-0.92793539482261766516f, --0.36846682995337221023f,-0.92964089584318132520f,-0.36418478956708016936f, --0.93132670908118031505f,-0.35989503653498794433f,-0.93299279883473895669f, --0.35559766170478407377f,-0.93463912981968066962f,-0.35129275608556687072f, --0.93626566717027837061f,-0.34698041084592379235f,-0.93787237643998977443f, --0.34266071731199487793f,-0.93945922360218969693f,-0.33833376696554123830f, --0.94102617505088925753f,-0.33399965144200982614f,-0.94257319760144675502f, --0.32965846252858749255f,-0.94410025849127265918f,-0.32531029216226331480f, --0.94560732538052116869f,-0.32095523242787515894f,-0.94709436635277721717f, --0.31659337555616617887f,-0.94856134991573015647f,-0.31222481392182477311f, --0.95000824500184311017f,-0.30784964004153508865f,-0.95143502096900833820f, --0.30346794657201103806f,-0.95284164760119871573f,-0.29907982630804058610f, --0.95422809510910555630f,-0.29468537218051488180f,-0.95559433413077088382f, --0.29028467725446244208f,-0.95694033573220882438f,-0.28587783472708105936f, --0.95826607140801756124f,-0.28146493792575794091f,-0.95957151308198451733f, --0.27704608030610028413f,-0.96085663310767954748f,-0.27262135544994886560f, --0.96212140426904158019f,-0.26819085706340350939f,-0.96336579978095393528f, --0.26375467897483123592f,-0.96458979328981275803f,-0.25931291513288645678f, --0.96579335887408357397f,-0.25486565960451434965f,-0.96697647104485218161f, --0.25041300657296539089f,-0.96813910474636233339f,-0.24595505033579515008f, --0.96928123535654830967f,-0.24149188530286941345f,-0.97040283868755550234f, --0.23702360599436766986f,-0.97150389098625167250f,-0.23255030703877521692f, --0.97258436893473221296f,-0.22807208317088611960f,-0.97364424965081186603f, --0.22358902922978990402f,-0.97468351068851066810f,-0.21910124015687010290f, --0.97570213003852845901f,-0.21460881099378659176f,-0.97670008612871184184f, --0.21011183688046985996f,-0.97767735782450992943f,-0.20561041305309901706f, --0.97863392442942320759f,-0.20110463484209206708f,-0.97956976568544051887f, --0.19659459767008077846f,-0.98048486177346927395f,-0.19208039704989252061f, --0.98137919331375456089f,-0.18756212858253007436f,-0.98225274136628937249f, --0.18303988795514095078f,-0.98310548743121628501f,-0.17851377093899792325f, --0.98393741344921881176f,-0.17398387338746373887f,-0.98474850180190420801f, --0.16945029123396829207f,-0.98553873531217606185f,-0.16491312048996975559f, --0.98630809724459866938f,-0.16037245724292850668f,-0.98705657130575097380f, --0.15582839765426498291f,-0.98778414164457217783f,-0.15128103795733036097f, --0.98849079285269658701f,-0.14673047445536230304f,-0.98917650996478090342f, --0.14217680351944814165f,-0.98984127845882052821f,-0.13762012158648653792f, --0.99048508425645698239f,-0.13306052515713906459f,-0.99110791372327688986f, --0.12849811079379358514f,-0.99170975366909952520f,-0.12393297511851208981f, --0.99229059134825736699f,-0.11936521481099168773f,-0.99285041445986510489f, --0.11479492660650993108f,-0.99338921114808065305f,-0.11022220729388330918f, --0.99390697000235606051f,-0.10564715371341037997f,-0.99440368005767909576f, --0.10106986275482798820f,-0.99487933079480561638f,-0.09649043135525316173f, --0.99533391214048216877f,-0.09190895649713282101f,-0.99576741446765981713f, --0.08732553520619255882f,-0.99617982859569687015f,-0.08274026454937570552f, --0.99657114579055483539f,-0.07815324163279464831f,-0.99694135776498205015f, --0.07356456359966735692f,-0.99729045667869020697f,-0.06897432762826707919f, --0.99761843513851955478f,-0.06438263092985731240f,-0.99792528619859599548f, --0.05978957074664013188f,-0.99821100336047818846f,-0.05519524434968971216f, --0.99847558057329477421f,-0.05059974903689945513f,-0.99871901223387293811f, --0.04600318213091520586f,-0.99894129318685687124f,-0.04140564097707683661f, --0.99914241872481690532f,-0.03680722294135933131f,-0.99932238458834943273f, --0.03220802540830459970f,-0.99948118696616694567f,-0.02760814577896616301f, --0.99961882249517863830f,-0.02300768146883930970f,-0.99973528826056168306f, --0.01840672990580516366f,-0.99983058179582340319f,-0.01380538852806025008f, --0.99990470108285289808f,-0.00920375478206008311f,-0.99995764455196389786f, --0.00460192612044835019f,-0.99998941108192840321f,1.00000000000000000000f, -0.00000000000000000000f,0.99983058179582340319f,0.01840672990580482019f, -0.99932238458834954375f,0.03680722294135883171f,0.99847558057329477421f, -0.05519524434968993420f,0.99729045667869020697f,0.07356456359966742631f, -0.99576741446765981713f,0.09190895649713272386f,0.99390697000235606051f, -0.11022220729388305938f,0.99170975366909952520f,0.12849811079379316880f, -0.98917650996478101444f,0.14673047445536174793f,0.98630809724459866938f, -0.16491312048996989437f,0.98310548743121628501f,0.18303988795514095078f, -0.97956976568544051887f,0.20110463484209190055f,0.97570213003852857003f, -0.21910124015686979759f,0.97150389098625178352f,0.23702360599436719801f, -0.96697647104485207059f,0.25486565960451457169f,0.96212140426904158019f, -0.27262135544994897662f,0.95694033573220882438f,0.29028467725446233105f, -0.95143502096900833820f,0.30784964004153486661f,0.94560732538052127971f, -0.32531029216226292622f,0.93945922360218991898f,0.34266071731199437833f, -0.93299279883473895669f,0.35989503653498811087f,0.92621024213831137928f, -0.37700741021641825945f,0.91911385169005777040f,0.39399204006104809883f, -0.91170603200542987832f,0.41084317105790391089f,0.90398929312344333820f, -0.42755509343028208491f,0.89596624975618521791f,0.44412214457042920035f, -0.88763962040285393496f,0.46053871095824000514f,0.87901222642863352519f, -0.47679923006332208812f,0.87008699110871146054f,0.49289819222978403790f, -0.86086693863776730939f,0.50883014254310698909f,0.85135519310526519554f, -0.52458968267846894928f,0.84155497743689844370f,0.54017147272989285423f, -0.83146961230254523567f,0.55557023301960217765f,0.82110251499110464835f, -0.57078074588696725566f,0.81045719825259476821f,0.58579785745643886408f, -0.79953726910790501314f,0.60061647938386897305f,0.78834642762660622761f, -0.61523159058062681925f,0.77688846567323244230f,0.62963823891492698426f, -0.76516726562245895860f,0.64383154288979138613f,0.75318679904361252042f, -0.65780669329707863735f,0.74095112535495921691f,0.67155895484701833009f, -0.72846439044822519637f,0.68508366777270035541f,0.71573082528381870571f, -0.69837624940897280457f,0.70275474445722529993f,0.71143219574521643356f, -0.68954054473706694051f,0.72424708295146689174f,0.67609270357531603413f, -0.73681656887736979300f,0.66241577759017178373f,0.74913639452345925918f, -0.64851440102211255212f,0.76120238548426177871f,0.63439328416364548779f, -0.77301045336273688235f,0.62005721176328920663f,0.78455659715557524159f, -0.60551104140432554512f,0.79583690460888345530f,0.59075970185887427544f, -0.80684755354379922299f,0.57580819141784533866f,0.81758481315158371139f, -0.56066157619733603124f,0.82804504525775579626f,0.54532498842204646383f, -0.83822470555483796772f,0.52980362468629482731f,0.84812034480329712149f, -0.51410274419322166128f,0.85772861000027211809f,0.49822766697278186854f, -0.86704624551569264845f,0.48218377207912282989f,0.87607009419540660122f, -0.46597649576796612569f,0.88479709843093778954f,0.44961132965460659516f, -0.89322430119551532446f,0.43309381885315201277f,0.90134884704602202810f, -0.41642956009763731906f,0.90916798309052226923f,0.39962419984564678810f, -0.91667905992104270485f,0.38268343236508983729f,0.92387953251128673848f, -0.36561299780477396482f,0.93076696107898371224f,0.34841868024943450921f, -0.93733901191257495977f,0.33110630575987642921f,0.94359345816196038559f, -0.31368174039889157312f,0.94952818059303667475f,0.29615088824362395536f, -0.95514116830577067141f,0.27851968938505305973f,0.96043051941556578655f, -0.26079411791527556952f,0.96539444169768939830f,0.24298017990326398197f, -0.97003125319454397424f,0.22508391135979277653f,0.97433938278557585821f, -0.20711137619221856032f,0.97831737071962765473f,0.18906866414980627589f, -0.98196386910955524296f,0.17096188876030135595f,0.98527764238894122162f, -0.15279718525844340760f,0.98825756773074946437f,0.13458070850712622324f, -0.99090263542778000971f,0.11631863091190487725f,0.99321194923479450001f, -0.09801714032956077016f,0.99518472667219681771f,0.07968243797143012563f, -0.99682029929116566791f,0.06132073630220864768f,0.99811811290014917919f, -0.04293825693494095902f,0.99907772775264536147f,0.02454122852291226384f, -0.99969881869620424997f,0.00613588464915451517f,0.99998117528260110909f, --0.01227153828571982304f,0.99992470183914450299f,-0.03067480317663645942f, -0.99952941750109314256f,-0.04906767432741800800f,0.99879545620517240501f, --0.06744391956366398155f,0.99772306664419163624f,-0.08579731234443975507f, -0.99631261218277800129f,-0.10412163387205460030f,0.99456457073425541537f, --0.12241067519921615403f,0.99247953459870996706f,-0.14065823933284912761f, -0.99005821026229712256f,-0.15885814333386127917f,0.98730141815785843473f, --0.17700422041214874946f,0.98421009238692902521f,-0.19509032201612819257f, -0.98078528040323043058f,-0.21311031991609125091f,0.97702814265775439484f, --0.23105810828067113727f,0.97293995220556017678f,-0.24892760574572012078f, -0.96852209427441737777f,-0.26671275747489830987f,0.96377606579543984022f, --0.28440753721127171039f,0.95870347489587159906f,-0.30200594931922808417f, -0.95330604035419386211f,-0.31950203081601563637f,0.94758559101774120226f, --0.33688985339221994009f,0.94154406518302080631f,-0.35416352542049039931f, -0.93518350993894761025f,-0.37131719395183748755f,0.92850608047321558924f, --0.38834504669882619066f,0.92151403934204201285f,-0.40524131400498974998f, -0.91420975570353069095f,-0.42200027079979968159f,0.90659570451491533483f, --0.43861623853852738097f,0.89867446569395392775f,-0.45508358712634372489f, -0.89044872324475798919f,-0.47139673682599769755f,0.88192126434835504956f, --0.48755016014843571837f,0.87309497841829020182f,-0.50353838372571746440f, -0.86397285612158680745f,-0.51935599016558964269f,0.85455798836540053376f, --0.53499761988709704230f,0.84485356524970722791f,-0.55045797293660470029f, -0.83486287498638012128f,-0.56573181078361323149f,0.82458930278502517996f, --0.58081395809576441547f,0.81403632970594852480f,-0.59569930449243335691f, -0.80320753148064494287f,-0.61038280627630958630f,0.79210657730021227785f, --0.62485948814238623239f,0.78073722857209459924f,-0.63912444486377573138f, -0.76910333764557958780f,-0.65317284295377653347f,0.75720884650648467851f, --0.66699992230363736034f,0.74505778544146605835f,-0.68060099779545302212f, -0.73265427167241281570f,-0.69397146088965377952f,0.72000250796138176579f, --0.70710678118654746172f,0.70710678118654757274f,-0.72000250796138165477f, -0.69397146088965389055f,-0.73265427167241270467f,0.68060099779545324417f, --0.74505778544146594733f,0.66699992230363758239f,-0.75720884650648467851f, -0.65317284295377664449f,-0.76910333764557947678f,0.63912444486377584241f, --0.78073722857209448822f,0.62485948814238634341f,-0.79210657730021216683f, -0.61038280627630969732f,-0.80320753148064483184f,0.59569930449243346793f, --0.81403632970594841378f,0.58081395809576452649f,-0.82458930278502506894f, -0.56573181078361345353f,-0.83486287498638001026f,0.55045797293660492233f, --0.84485356524970711689f,0.53499761988709715332f,-0.85455798836540042274f, -0.51935599016558975372f,-0.86397285612158669643f,0.50353838372571757542f, --0.87309497841829009079f,0.48755016014843588490f,-0.88192126434835493853f, -0.47139673682599780857f,-0.89044872324475787817f,0.45508358712634389143f, --0.89867446569395392775f,0.43861623853852754751f,-0.90659570451491533483f, -0.42200027079979984812f,-0.91420975570353069095f,0.40524131400498991651f, --0.92151403934204179080f,0.38834504669882657923f,-0.92850608047321547822f, -0.37131719395183770960f,-0.93518350993894761025f,0.35416352542049039931f, --0.94154406518302069529f,0.33688985339222032867f,-0.94758559101774109124f, -0.31950203081601580291f,-0.95330604035419386211f,0.30200594931922802866f, --0.95870347489587148804f,0.28440753721127209896f,-0.96377606579543984022f, -0.26671275747489847641f,-0.96852209427441737777f,0.24892760574572009302f, --0.97293995220556006576f,0.23105810828067133156f,-0.97702814265775439484f, -0.21311031991609141745f,-0.98078528040323043058f,0.19509032201612860891f, --0.98421009238692902521f,0.17700422041214894375f,-0.98730141815785843473f, -0.15885814333386147346f,-0.99005821026229701154f,0.14065823933284954395f, --0.99247953459870996706f,0.12241067519921634832f,-0.99456457073425541537f, -0.10412163387205457254f,-0.99631261218277800129f,0.08579731234444015753f, --0.99772306664419163624f,0.06744391956366417584f,-0.99879545620517240501f, -0.04906767432741796636f,-0.99952941750109314256f,0.03067480317663686534f, --0.99992470183914450299f,0.01227153828572000692f,-0.99998117528260110909f, --0.00613588464915455420f,-0.99969881869620424997f,-0.02454122852291207996f, --0.99907772775264536147f,-0.04293825693494077861f,-0.99811811290014917919f, --0.06132073630220824523f,-0.99682029929116577893f,-0.07968243797142994522f, --0.99518472667219692873f,-0.09801714032956058975f,-0.99321194923479461103f, --0.11631863091190447479f,-0.99090263542778000971f,-0.13458070850712605671f, --0.98825756773074946437f,-0.15279718525844343535f,-0.98527764238894133264f, --0.17096188876030096737f,-0.98196386910955524296f,-0.18906866414980610935f, --0.97831737071962765473f,-0.20711137619221858808f,-0.97433938278557585821f, --0.22508391135979261000f,-0.97003125319454397424f,-0.24298017990326381543f, --0.96539444169768939830f,-0.26079411791527562503f,-0.96043051941556589757f, --0.27851968938505289319f,-0.95514116830577078243f,-0.29615088824362378883f, --0.94952818059303678577f,-0.31368174039889118454f,-0.94359345816196038559f, --0.33110630575987626267f,-0.93733901191257495977f,-0.34841868024943456472f, --0.93076696107898382326f,-0.36561299780477357624f,-0.92387953251128684951f, --0.38268343236508967076f,-0.91667905992104270485f,-0.39962419984564684361f, --0.90916798309052249127f,-0.41642956009763693048f,-0.90134884704602202810f, --0.43309381885315184624f,-0.89322430119551532446f,-0.44961132965460665067f, --0.88479709843093790056f,-0.46597649576796595916f,-0.87607009419540660122f, --0.48218377207912266336f,-0.86704624551569287050f,-0.49822766697278153547f, --0.85772861000027211809f,-0.51410274419322155026f,-0.84812034480329723252f, --0.52980362468629460526f,-0.83822470555483818977f,-0.54532498842204613076f, --0.82804504525775590729f,-0.56066157619733592021f,-0.81758481315158371139f, --0.57580819141784533866f,-0.80684755354379944503f,-0.59075970185887394237f, --0.79583690460888356633f,-0.60551104140432543410f,-0.78455659715557524159f, --0.62005721176328920663f,-0.77301045336273710440f,-0.63439328416364526575f, --0.76120238548426188974f,-0.64851440102211233008f,-0.74913639452345925918f, --0.66241577759017178373f,-0.73681656887737001504f,-0.67609270357531581208f, --0.72424708295146700276f,-0.68954054473706682948f,-0.71143219574521665560f, --0.70275474445722507788f,-0.69837624940897302661f,-0.71573082528381848366f, --0.68508366777270035541f,-0.72846439044822519637f,-0.67155895484701866316f, --0.74095112535495888384f,-0.65780669329707874837f,-0.75318679904361240940f, --0.64383154288979149715f,-0.76516726562245895860f,-0.62963823891492687324f, --0.77688846567323255332f,-0.61523159058062726334f,-0.78834642762660589455f, --0.60061647938386930612f,-0.79953726910790479110f,-0.58579785745643908612f, --0.81045719825259465718f,-0.57078074588696736669f,-0.82110251499110464835f, --0.55557023301960217765f,-0.83146961230254523567f,-0.54017147272989274320f, --0.84155497743689855472f,-0.52458968267846928235f,-0.85135519310526486247f, --0.50883014254310732216f,-0.86086693863776708735f,-0.49289819222978420443f, --0.87008699110871134952f,-0.47679923006332214364f,-0.87901222642863341417f, --0.46053871095823989412f,-0.88763962040285404598f,-0.44412214457042975546f, --0.89596624975618488484f,-0.42755509343028247349f,-0.90398929312344311615f, --0.41084317105790418845f,-0.91170603200542976730f,-0.39399204006104820985f, --0.91911385169005765938f,-0.37700741021641820394f,-0.92621024213831137928f, --0.35989503653498794433f,-0.93299279883473895669f,-0.34266071731199487793f, --0.93945922360218969693f,-0.32531029216226331480f,-0.94560732538052116869f, --0.30784964004153508865f,-0.95143502096900833820f,-0.29028467725446244208f, --0.95694033573220882438f,-0.27262135544994886560f,-0.96212140426904158019f, --0.25486565960451434965f,-0.96697647104485218161f,-0.23702360599436766986f, --0.97150389098625167250f,-0.21910124015687010290f,-0.97570213003852845901f, --0.20110463484209206708f,-0.97956976568544051887f,-0.18303988795514095078f, --0.98310548743121628501f,-0.16491312048996975559f,-0.98630809724459866938f, --0.14673047445536230304f,-0.98917650996478090342f,-0.12849811079379358514f, --0.99170975366909952520f,-0.11022220729388330918f,-0.99390697000235606051f, --0.09190895649713282101f,-0.99576741446765981713f,-0.07356456359966735692f, --0.99729045667869020697f,-0.05519524434968971216f,-0.99847558057329477421f, --0.03680722294135933131f,-0.99932238458834943273f,-0.01840672990580516366f, --0.99983058179582340319f,1.00000000000000000000f,0.00000000000000000000f, -0.99729045667869020697f,0.07356456359966742631f,0.98917650996478101444f, -0.14673047445536174793f,0.97570213003852857003f,0.21910124015686979759f, -0.95694033573220882438f,0.29028467725446233105f,0.93299279883473895669f, -0.35989503653498811087f,0.90398929312344333820f,0.42755509343028208491f, -0.87008699110871146054f,0.49289819222978403790f,0.83146961230254523567f, -0.55557023301960217765f,0.78834642762660622761f,0.61523159058062681925f, -0.74095112535495921691f,0.67155895484701833009f,0.68954054473706694051f, -0.72424708295146689174f,0.63439328416364548779f,0.77301045336273688235f, -0.57580819141784533866f,0.81758481315158371139f,0.51410274419322166128f, -0.85772861000027211809f,0.44961132965460659516f,0.89322430119551532446f, -0.38268343236508983729f,0.92387953251128673848f,0.31368174039889157312f, -0.94952818059303667475f,0.24298017990326398197f,0.97003125319454397424f, -0.17096188876030135595f,0.98527764238894122162f,0.09801714032956077016f, -0.99518472667219681771f,0.02454122852291226384f,0.99969881869620424997f, --0.04906767432741800800f,0.99879545620517240501f,-0.12241067519921615403f, -0.99247953459870996706f,-0.19509032201612819257f,0.98078528040323043058f, --0.26671275747489830987f,0.96377606579543984022f,-0.33688985339221994009f, -0.94154406518302080631f,-0.40524131400498974998f,0.91420975570353069095f, --0.47139673682599769755f,0.88192126434835504956f,-0.53499761988709704230f, -0.84485356524970722791f,-0.59569930449243335691f,0.80320753148064494287f, --0.65317284295377653347f,0.75720884650648467851f,-0.70710678118654746172f, -0.70710678118654757274f,-0.75720884650648467851f,0.65317284295377664449f, --0.80320753148064483184f,0.59569930449243346793f,-0.84485356524970711689f, -0.53499761988709715332f,-0.88192126434835493853f,0.47139673682599780857f, --0.91420975570353069095f,0.40524131400498991651f,-0.94154406518302069529f, -0.33688985339222032867f,-0.96377606579543984022f,0.26671275747489847641f, --0.98078528040323043058f,0.19509032201612860891f,-0.99247953459870996706f, -0.12241067519921634832f,-0.99879545620517240501f,0.04906767432741796636f, --0.99969881869620424997f,-0.02454122852291207996f,-0.99518472667219692873f, --0.09801714032956058975f,-0.98527764238894133264f,-0.17096188876030096737f, --0.97003125319454397424f,-0.24298017990326381543f,-0.94952818059303678577f, --0.31368174039889118454f,-0.92387953251128684951f,-0.38268343236508967076f, --0.89322430119551532446f,-0.44961132965460665067f,-0.85772861000027211809f, --0.51410274419322155026f,-0.81758481315158371139f,-0.57580819141784533866f, --0.77301045336273710440f,-0.63439328416364526575f,-0.72424708295146700276f, --0.68954054473706682948f,-0.67155895484701866316f,-0.74095112535495888384f, --0.61523159058062726334f,-0.78834642762660589455f,-0.55557023301960217765f, --0.83146961230254523567f,-0.49289819222978420443f,-0.87008699110871134952f, --0.42755509343028247349f,-0.90398929312344311615f,-0.35989503653498794433f, --0.93299279883473895669f,-0.29028467725446244208f,-0.95694033573220882438f, --0.21910124015687010290f,-0.97570213003852845901f,-0.14673047445536230304f, --0.98917650996478090342f,-0.07356456359966735692f,-0.99729045667869020697f, -1.00000000000000000000f,0.00000000000000000000f,0.95694033573220882438f, -0.29028467725446233105f,0.83146961230254523567f,0.55557023301960217765f, -0.63439328416364548779f,0.77301045336273688235f,0.38268343236508983729f, -0.92387953251128673848f,0.09801714032956077016f,0.99518472667219681771f, --0.19509032201612819257f,0.98078528040323043058f,-0.47139673682599769755f, -0.88192126434835504956f,-0.70710678118654746172f,0.70710678118654757274f, --0.88192126434835493853f,0.47139673682599780857f,-0.98078528040323043058f, -0.19509032201612860891f,-0.99518472667219692873f,-0.09801714032956058975f, --0.92387953251128684951f,-0.38268343236508967076f,-0.77301045336273710440f, --0.63439328416364526575f,-0.55557023301960217765f,-0.83146961230254523567f, --0.29028467725446244208f,-0.95694033573220882438f,1.00000000000000000000f, -0.00000000000000000000f,0.38268343236508983729f,0.92387953251128673848f, --0.70710678118654746172f,0.70710678118654757274f,-0.92387953251128684951f, --0.38268343236508967076f,}; +1.00000000000000000000f,0.00000000000000000000f,0.99998939037322998047f, +0.00460192607715725899f,0.99995762109756469727f,0.00920375436544418335f, +0.99990469217300415039f,0.01380538847297430038f,0.99983060359954833984f, +0.01840673014521598816f,0.99973529577255249023f,0.02300768159329891205f, +0.99961882829666137695f,0.02760814502835273743f,0.99948120117187500000f, +0.03220802545547485352f,0.99932235479354858398f,0.03680722415447235107f, +0.99914240837097167969f,0.04140564054250717163f,0.99894130229949951172f, +0.04600318148732185364f,0.99871903657913208008f,0.05059975013136863708f, +0.99847555160522460938f,0.05519524589180946350f,0.99821102619171142578f, +0.05978957191109657288f,0.99792528152465820312f,0.06438262760639190674f, +0.99761843681335449219f,0.06897433102130889893f,0.99729043245315551758f, +0.07356456667184829712f,0.99694132804870605469f,0.07815324515104293823f, +0.99657112360000610352f,0.08274026215076446533f,0.99617981910705566406f, +0.08732553571462631226f,0.99576741456985473633f,0.09190895408391952515f, +0.99533390998840332031f,0.09649042785167694092f,0.99487930536270141602f, +0.10106986016035079956f,0.99440366029739379883f,0.10564715415239334106f, +0.99390697479248046875f,0.11022220551967620850f,0.99338918924331665039f, +0.11479492485523223877f,0.99285042285919189453f,0.11936521530151367188f, +0.99229061603546142578f,0.12393297255039215088f,0.99170976877212524414f, +0.12849810719490051270f,0.99110794067382812500f,0.13306052982807159424f, +0.99048507213592529297f,0.13762012124061584473f,0.98984128236770629883f, +0.14217680692672729492f,0.98917651176452636719f,0.14673046767711639404f, +0.98849081993103027344f,0.15128104388713836670f,0.98778414726257324219f, +0.15582840144634246826f,0.98705655336380004883f,0.16037245094776153564f, +0.98630809783935546875f,0.16491311788558959961f,0.98553872108459472656f, +0.16945029795169830322f,0.98474848270416259766f,0.17398387193679809570f, +0.98393744230270385742f,0.17851376533508300781f,0.98310548067092895508f, +0.18303988873958587646f,0.98225271701812744141f,0.18756212294101715088f, +0.98137921094894409180f,0.19208039343357086182f,0.98048484325408935547f, +0.19659459590911865234f,0.97956979274749755859f,0.20110464096069335938f, +0.97863394021987915039f,0.20561040937900543213f,0.97767734527587890625f, +0.21011184155941009521f,0.97670006752014160156f,0.21460881829261779785f, +0.97570210695266723633f,0.21910123527050018311f,0.97468352317810058594f, +0.22358903288841247559f,0.97364425659179687500f,0.22807207703590393066f, +0.97258436679840087891f,0.23255030810832977295f,0.97150391340255737305f, +0.23702360689640045166f,0.97040283679962158203f,0.24149188399314880371f, +0.96928125619888305664f,0.24595504999160766602f,0.96813911199569702148f, +0.25041300058364868164f,0.96697646379470825195f,0.25486564636230468750f, +0.96579337120056152344f,0.25931292772293090820f,0.96458977460861206055f, +0.26375466585159301758f,0.96336579322814941406f,0.26819086074829101562f, +0.96212142705917358398f,0.27262136340141296387f,0.96085661649703979492f, +0.27704608440399169922f,0.95957154035568237305f,0.28146493434906005859f, +0.95826607942581176758f,0.28587782382965087891f,0.95694035291671752930f, +0.29028466343879699707f,0.95559436082839965820f,0.29468536376953125000f, +0.95422810316085815430f,0.29907983541488647461f,0.95284163951873779297f, +0.30346795916557312012f,0.95143502950668334961f,0.30784964561462402344f, +0.95000827312469482422f,0.31222480535507202148f,0.94856137037277221680f, +0.31659337878227233887f,0.94709438085556030273f,0.32095524668693542480f, +0.94560730457305908203f,0.32531028985977172852f,0.94410026073455810547f, +0.32965844869613647461f,0.94257318973541259766f,0.33399966359138488770f, +0.94102615118026733398f,0.33833375573158264160f,0.93945920467376708984f, +0.34266072511672973633f,0.93787235021591186523f,0.34698042273521423340f, +0.93626564741134643555f,0.35129275918006896973f,0.93463915586471557617f, +0.35559767484664916992f,0.93299281597137451172f,0.35989505052566528320f, +0.93132668733596801758f,0.36418479681015014648f,0.92964088916778564453f, +0.36846682429313659668f,0.92793542146682739258f,0.37274107336997985840f, +0.92621022462844848633f,0.37700742483139038086f,0.92446547746658325195f, +0.38126575946807861328f,0.92270112037658691406f,0.38551604747772216797f, +0.92091721296310424805f,0.38975816965103149414f,0.91911387443542480469f, +0.39399203658103942871f,0.91729098558425903320f,0.39821755886077880859f, +0.91544872522354125977f,0.40243464708328247070f,0.91358703374862670898f, +0.40664321184158325195f,0.91170603036880493164f,0.41084316372871398926f, +0.90980571508407592773f,0.41503441333770751953f,0.90788608789443969727f, +0.41921690106391906738f,0.90594726800918579102f,0.42339047789573669434f, +0.90398931503295898438f,0.42755508422851562500f,0.90201216936111450195f, +0.43171066045761108398f,0.90001589059829711914f,0.43585708737373352051f, +0.89800059795379638672f,0.43999427556991577148f,0.89596623182296752930f, +0.44412213563919067383f,0.89391297101974487305f,0.44824060797691345215f, +0.89184069633483886719f,0.45234957337379455566f,0.88974958658218383789f, +0.45644897222518920898f,0.88763964176177978516f,0.46053871512413024902f, +0.88551086187362670898f,0.46461868286132812500f,0.88336336612701416016f, +0.46868881583213806152f,0.88119709491729736328f,0.47274902462959289551f, +0.87901222705841064453f,0.47679921984672546387f,0.87680870294570922852f, +0.48083934187889099121f,0.87458664178848266602f,0.48486924171447753906f, +0.87234604358673095703f,0.48888888955116271973f,0.87008696794509887695f, +0.49289819598197937012f,0.86780947446823120117f,0.49689704179763793945f, +0.86551362276077270508f,0.50088536739349365234f,0.86319941282272338867f, +0.50486308336257934570f,0.86086696386337280273f,0.50883013010025024414f, +0.85851621627807617188f,0.51278638839721679688f,0.85614734888076782227f, +0.51673179864883422852f,0.85376030206680297852f,0.52066624164581298828f, +0.85135519504547119141f,0.52458965778350830078f,0.84893202781677246094f, +0.52850198745727539062f,0.84649091958999633789f,0.53240311145782470703f, +0.84403187036514282227f,0.53629297018051147461f,0.84155499935150146484f, +0.54017144441604614258f,0.83906024694442749023f,0.54403853416442871094f, +0.83654773235321044922f,0.54789406061172485352f,0.83401751518249511719f, +0.55173796415328979492f,0.83146959543228149414f,0.55557024478912353516f, +0.82890409231185913086f,0.55939072370529174805f,0.82632106542587280273f, +0.56319934129714965820f,0.82372051477432250977f,0.56699603796005249023f, +0.82110249996185302734f,0.57078075408935546875f,0.81846714019775390625f, +0.57455337047576904297f,0.81581443548202514648f,0.57831376791000366211f, +0.81314438581466674805f,0.58206200599670410156f,0.81045717000961303711f, +0.58579784631729125977f,0.80775284767150878906f,0.58952128887176513672f, +0.80503135919570922852f,0.59323227405548095703f,0.80229282379150390625f, +0.59693068265914916992f,0.79953724145889282227f,0.60061645507812500000f, +0.79676479101181030273f,0.60428953170776367188f,0.79397547245025634766f, +0.60794979333877563477f,0.79116934537887573242f,0.61159718036651611328f, +0.78834640979766845703f,0.61523157358169555664f,0.78550684452056884766f, +0.61885297298431396484f,0.78265058994293212891f,0.62246125936508178711f, +0.77977776527404785156f,0.62605637311935424805f,0.77688848972320556641f, +0.62963825464248657227f,0.77398270368576049805f,0.63320678472518920898f, +0.77106052637100219727f,0.63676184415817260742f,0.76812201738357543945f, +0.64030349254608154297f,0.76516723632812500000f,0.64383155107498168945f, +0.76219630241394042969f,0.64734596014022827148f,0.75920921564102172852f, +0.65084666013717651367f,0.75620597600936889648f,0.65433359146118164062f, +0.75318682193756103516f,0.65780669450759887695f,0.75015163421630859375f, +0.66126585006713867188f,0.74710059165954589844f,0.66471099853515625000f, +0.74403375387191772461f,0.66814202070236206055f,0.74095112085342407227f, +0.67155897617340087891f,0.73785281181335449219f,0.67496162652969360352f, +0.73473888635635375977f,0.67835003137588500977f,0.73160940408706665039f, +0.68172407150268554688f,0.72846436500549316406f,0.68508368730545043945f, +0.72530394792556762695f,0.68842875957489013672f,0.72212821245193481445f, +0.69175922870635986328f,0.71893709897994995117f,0.69507509469985961914f, +0.71573084592819213867f,0.69837623834609985352f,0.71250939369201660156f, +0.70166260004043579102f,0.70927280187606811523f,0.70493406057357788086f, +0.70602124929428100586f,0.70819061994552612305f,0.70275473594665527344f, +0.71143221855163574219f,0.69947332143783569336f,0.71465867757797241211f, +0.69617712497711181641f,0.71787005662918090820f,0.69286614656448364258f, +0.72106617689132690430f,0.68954056501388549805f,0.72424709796905517578f, +0.68620032072067260742f,0.72741264104843139648f,0.68284553289413452148f, +0.73056274652481079102f,0.67947632074356079102f,0.73369741439819335938f, +0.67609268426895141602f,0.73681658506393432617f,0.67269474267959594727f, +0.73992007970809936523f,0.66928261518478393555f,0.74300795793533325195f, +0.66585624217987060547f,0.74608010053634643555f,0.66241580247879028320f, +0.74913638830184936523f,0.65896129608154296875f,0.75217682123184204102f, +0.65549284219741821289f,0.75520139932632446289f,0.65201056003570556641f, +0.75820988416671752930f,0.64851438999176025391f,0.76120239496231079102f, +0.64500451087951660156f,0.76417875289916992188f,0.64148104190826416016f, +0.76713889837265014648f,0.63794392347335815430f,0.77008283138275146484f, +0.63439327478408813477f,0.77301043272018432617f,0.63082921504974365234f, +0.77592170238494873047f,0.62725180387496948242f,0.77881652116775512695f, +0.62366110086441040039f,0.78169482946395874023f,0.62005722522735595703f, +0.78455656766891479492f,0.61644017696380615234f,0.78740173578262329102f, +0.61281007528305053711f,0.79023021459579467773f,0.60916703939437866211f, +0.79304194450378417969f,0.60551106929779052734f,0.79583692550659179688f, +0.60184222459793090820f,0.79861497879028320312f,0.59816068410873413086f, +0.80137616395950317383f,0.59446650743484497070f,0.80412036180496215820f, +0.59075969457626342773f,0.80684757232666015625f,0.58704036474227905273f, +0.80955761671066284180f,0.58330863714218139648f,0.81225061416625976562f, +0.57956457138061523438f,0.81492632627487182617f,0.57580816745758056641f, +0.81758481264114379883f,0.57203960418701171875f,0.82022595405578613281f, +0.56825894117355346680f,0.82284981012344360352f,0.56446623802185058594f, +0.82545614242553710938f,0.56066155433654785156f,0.82804507017135620117f, +0.55684500932693481445f,0.83061641454696655273f,0.55301672220230102539f, +0.83317017555236816406f,0.54917663335800170898f,0.83570629358291625977f, +0.54532498121261596680f,0.83822470903396606445f,0.54146176576614379883f, +0.84072536230087280273f,0.53758704662322998047f,0.84320825338363647461f, +0.53370100259780883789f,0.84567326307296752930f,0.52980363368988037109f, +0.84812033176422119141f,0.52589499950408935547f,0.85054945945739746094f, +0.52197527885437011719f,0.85296058654785156250f,0.51804453134536743164f, +0.85535365343093872070f,0.51410275697708129883f,0.85772860050201416016f, +0.51015007495880126953f,0.86008536815643310547f,0.50618666410446166992f, +0.86242395639419555664f,0.50221246480941772461f,0.86474424600601196289f, +0.49822765588760375977f,0.86704623699188232422f,0.49423229694366455078f, +0.86932986974716186523f,0.49022647738456726074f,0.87159508466720581055f, +0.48621028661727905273f,0.87384182214736938477f,0.48218378424644470215f, +0.87607008218765258789f,0.47814705967903137207f,0.87827980518341064453f, +0.47410020232200622559f,0.88047087192535400391f,0.47004333138465881348f, +0.88264334201812744141f,0.46597650647163391113f,0.88479709625244140625f, +0.46189978718757629395f,0.88693213462829589844f,0.45781329274177551270f, +0.88904833793640136719f,0.45371711254119873047f,0.89114576578140258789f, +0.44961133599281311035f,0.89322429895401000977f,0.44549602270126342773f, +0.89528393745422363281f,0.44137126207351684570f,0.89732456207275390625f, +0.43723717331886291504f,0.89934623241424560547f,0.43309381604194641113f, +0.90134882926940917969f,0.42894127964973449707f,0.90333235263824462891f, +0.42477968335151672363f,0.90529674291610717773f,0.42060908675193786621f, +0.90724200010299682617f,0.41642954945564270020f,0.90916800498962402344f, +0.41224122047424316406f,0.91107475757598876953f,0.40804415941238403320f, +0.91296219825744628906f,0.40383845567703247070f,0.91483032703399658203f, +0.39962419867515563965f,0.91667908430099487305f,0.39540147781372070312f, +0.91850841045379638672f,0.39117038249969482422f,0.92031830549240112305f, +0.38693100214004516602f,0.92210865020751953125f,0.38268342614173889160f, +0.92387950420379638672f,0.37842774391174316406f,0.92563080787658691406f, +0.37416407465934753418f,0.92736250162124633789f,0.36989244818687438965f, +0.92907458543777465820f,0.36561298370361328125f,0.93076694011688232422f, +0.36132580041885375977f,0.93243962526321411133f,0.35703095793724060059f, +0.93409252166748046875f,0.35272854566574096680f,0.93572568893432617188f, +0.34841868281364440918f,0.93733900785446166992f,0.34410142898559570312f, +0.93893247842788696289f,0.33977687358856201172f,0.94050604104995727539f, +0.33544513583183288574f,0.94205975532531738281f,0.33110630512237548828f, +0.94359344244003295898f,0.32676044106483459473f,0.94510722160339355469f, +0.32240769267082214355f,0.94660091400146484375f,0.31804808974266052246f, +0.94807457923889160156f,0.31368175148963928223f,0.94952815771102905273f, +0.30930876731872558594f,0.95096164941787719727f,0.30492922663688659668f, +0.95237499475479125977f,0.30054324865341186523f,0.95376819372177124023f, +0.29615089297294616699f,0.95514118671417236328f,0.29175224900245666504f, +0.95649391412734985352f,0.28734746575355529785f,0.95782643556594848633f, +0.28293657302856445312f,0.95913863182067871094f,0.27851969003677368164f, +0.96043050289154052734f,0.27409690618515014648f,0.96170204877853393555f, +0.26966831088066101074f,0.96295326948165893555f,0.26523402333259582520f, +0.96418404579162597656f,0.26079410314559936523f,0.96539443731307983398f, +0.25634866952896118164f,0.96658438444137573242f,0.25189781188964843750f, +0.96775382757186889648f,0.24744161963462829590f,0.96890282630920410156f, +0.24298018217086791992f,0.97003126144409179688f,0.23851358890533447266f, +0.97113913297653198242f,0.23404195904731750488f,0.97222650051116943359f, +0.22956536710262298584f,0.97329324483871459961f,0.22508391737937927246f, +0.97433936595916748047f,0.22059768438339233398f,0.97536486387252807617f, +0.21610680222511291504f,0.97636973857879638672f,0.21161133050918579102f, +0.97735387086868286133f,0.20711137354373931885f,0.97831737995147705078f, +0.20260703563690185547f,0.97926014661788940430f,0.19809840619564056396f, +0.98018211126327514648f,0.19358558952808380127f,0.98108339309692382812f, +0.18906866014003753662f,0.98196387290954589844f,0.18454773724079132080f, +0.98282355070114135742f,0.18002289533615112305f,0.98366242647171020508f, +0.17549425363540649414f,0.98448044061660766602f,0.17096188664436340332f, +0.98527765274047851562f,0.16642589867115020752f,0.98605394363403320312f, +0.16188639402389526367f,0.98680937290191650391f,0.15734346210956573486f, +0.98754394054412841797f,0.15279719233512878418f,0.98825758695602416992f, +0.14824767410755157471f,0.98895025253295898438f,0.14369502663612365723f, +0.98962199687957763672f,0.13913933932781219482f,0.99027281999588012695f, +0.13458070158958435059f,0.99090266227722167969f,0.13001921772956848145f, +0.99151146411895751953f,0.12545497715473175049f,0.99209928512573242188f, +0.12088808417320251465f,0.99266612529754638672f,0.11631862819194793701f, +0.99321192502975463867f,0.11174671351909637451f,0.99373674392700195312f, +0.10717242211103439331f,0.99424046277999877930f,0.10259586572647094727f, +0.99472314119338989258f,0.09801714122295379639f,0.99518471956253051758f, +0.09343633800745010376f,0.99562525749206542969f,0.08885355293750762939f, +0.99604469537734985352f,0.08426889032125473022f,0.99644303321838378906f, +0.07968243956565856934f,0.99682027101516723633f,0.07509429752826690674f, +0.99717640876770019531f,0.07050457596778869629f,0.99751144647598266602f, +0.06591334939002990723f,0.99782532453536987305f,0.06132073700428009033f, +0.99811810255050659180f,0.05672682076692581177f,0.99838972091674804688f, +0.05213170498609542847f,0.99864023923873901367f,0.04753548279404640198f, +0.99886953830718994141f,0.04293825849890708923f,0.99907773733139038086f, +0.03834012150764465332f,0.99926477670669555664f,0.03374117240309715271f, +0.99943059682846069336f,0.02914150804281234741f,0.99957531690597534180f, +0.02454122900962829590f,0.99969881772994995117f,0.01994042843580245972f, +0.99980115890502929688f,0.01533920597285032272f,0.99988234043121337891f, +0.01073765940964221954f,0.99994236230850219727f,0.00613588467240333557f, +0.99998116493225097656f,0.00153398013208061457f,0.99999880790710449219f, +-0.00306795677170157433f,0.99999529123306274414f,-0.00766982883214950562f, +0.99997061491012573242f,-0.01227153837680816650f,0.99992471933364868164f, +-0.01687298715114593506f,0.99985766410827636719f,-0.02147408016026020050f, +0.99976938962936401367f,-0.02607471868395805359f,0.99966001510620117188f, +-0.03067480400204658508f,0.99952942132949829102f,-0.03527423739433288574f, +0.99937766790390014648f,-0.03987292572855949402f,0.99920475482940673828f, +-0.04447077214717864990f,0.99901068210601806641f,-0.04906767606735229492f, +0.99879544973373413086f,-0.05366353690624237061f,0.99855905771255493164f, +-0.05825826525688171387f,0.99830156564712524414f,-0.06285175681114196777f, +0.99802285432815551758f,-0.06744392216205596924f,0.99772304296493530273f, +-0.07203464955091476440f,0.99740213155746459961f,-0.07662386447191238403f, +0.99706006050109863281f,-0.08121144771575927734f,0.99669688940048217773f, +-0.08579730987548828125f,0.99631261825561523438f,-0.09038136154413223267f, +0.99590724706649780273f,-0.09496349841356277466f,0.99548077583312988281f, +-0.09954361617565155029f,0.99503320455551147461f,-0.10412163287401199341f, +0.99456459283828735352f,-0.10869744420051574707f,0.99407488107681274414f, +-0.11327095329761505127f,0.99356412887573242188f,-0.11784206330776214600f, +0.99303233623504638672f,-0.12241067737340927124f,0.99247956275939941406f, +-0.12697669863700866699f,0.99190568923950195312f,-0.13154003024101257324f, +0.99131083488464355469f,-0.13610057532787322998f,0.99069499969482421875f, +-0.14065824449062347412f,0.99005818367004394531f,-0.14521291851997375488f, +0.98940044641494750977f,-0.14976453781127929688f,0.98872166872024536133f, +-0.15431296825408935547f,0.98802202939987182617f,-0.15885815024375915527f, +0.98730140924453735352f,-0.16339994966983795166f,0.98655992746353149414f, +-0.16793829202651977539f,0.98579752445220947266f,-0.17247308790683746338f, +0.98501425981521606445f,-0.17700421810150146484f,0.98421007394790649414f, +-0.18153160810470581055f,0.98338508605957031250f,-0.18605515360832214355f, +0.98253929615020751953f,-0.19057475030422210693f,0.98167270421981811523f, +-0.19509032368659973145f,0.98078525066375732422f,-0.19960175454616546631f, +0.97987711429595947266f,-0.20410896837711334229f,0.97894817590713500977f, +-0.20861184597015380859f,0.97799849510192871094f,-0.21311031281948089600f, +0.97702813148498535156f,-0.21760427951812744141f,0.97603708505630493164f, +-0.22209362685680389404f,0.97502535581588745117f,-0.22657826542854309082f, +0.97399294376373291016f,-0.23105810582637786865f,0.97293996810913085938f, +-0.23553305864334106445f,0.97186630964279174805f,-0.24000301957130432129f, +0.97077214717864990234f,-0.24446789920330047607f,0.96965736150741577148f, +-0.24892760813236236572f,0.96852207183837890625f,-0.25338202714920043945f, +0.96736627817153930664f,-0.25783109664916992188f,0.96618998050689697266f, +-0.26227471232414245605f,0.96499323844909667969f,-0.26671275496482849121f, +0.96377605199813842773f,-0.27114516496658325195f,0.96253848075866699219f, +-0.27557182312011718750f,0.96128046512603759766f,-0.27999264001846313477f, +0.96000212430953979492f,-0.28440752625465393066f,0.95870345830917358398f, +-0.28881642222404479980f,0.95738452672958374023f,-0.29321914911270141602f, +0.95604526996612548828f,-0.29761570692062377930f,0.95468574762344360352f, +-0.30200594663619995117f,0.95330601930618286133f,-0.30638980865478515625f, +0.95190614461898803711f,-0.31076714396476745605f,0.95048606395721435547f, +-0.31513792276382446289f,0.94904589653015136719f,-0.31950202584266662598f, +0.94758558273315429688f,-0.32385936379432678223f,0.94610524177551269531f, +-0.32820984721183776855f,0.94460481405258178711f,-0.33255335688591003418f, +0.94308441877365112305f,-0.33688986301422119141f,0.94154405593872070312f, +-0.34121921658515930176f,0.93998372554779052734f,-0.34554132819175720215f, +0.93840354681015014648f,-0.34985613822937011719f,0.93680346012115478516f, +-0.35416352748870849609f,0.93518352508544921875f,-0.35846340656280517578f, +0.93354380130767822266f,-0.36275571584701538086f,0.93188428878784179688f, +-0.36704033613204956055f,0.93020504713058471680f,-0.37131720781326293945f, +0.92850607633590698242f,-0.37558618187904357910f,0.92678749561309814453f, +-0.37984719872474670410f,0.92504924535751342773f,-0.38410019874572753906f, +0.92329144477844238281f,-0.38834503293037414551f,0.92151403427124023438f, +-0.39258167147636413574f,0.91971713304519653320f,-0.39680999517440795898f, +0.91790080070495605469f,-0.40102988481521606445f,0.91606497764587402344f, +-0.40524131059646606445f,0.91420978307723999023f,-0.40944415330886840820f, +0.91233515739440917969f,-0.41363832354545593262f,0.91044127941131591797f, +-0.41782370209693908691f,0.90852808952331542969f,-0.42200025916099548340f, +0.90659570693969726562f,-0.42616787552833557129f,0.90464407205581665039f, +-0.43032649159431457520f,0.90267330408096313477f,-0.43447595834732055664f, +0.90068340301513671875f,-0.43861624598503112793f,0.89867448806762695312f, +-0.44274723529815673828f,0.89664649963378906250f,-0.44686883687973022461f, +0.89459949731826782227f,-0.45098099112510681152f,0.89253354072570800781f, +-0.45508357882499694824f,0.89044874906539916992f,-0.45917654037475585938f, +0.88834506273269653320f,-0.46325978636741638184f,0.88622254133224487305f, +-0.46733319759368896484f,0.88408124446868896484f,-0.47139674425125122070f, +0.88192129135131835938f,-0.47545027732849121094f,0.87974262237548828125f, +-0.47949376702308654785f,0.87754529714584350586f,-0.48352706432342529297f, +0.87532937526702880859f,-0.48755016922950744629f,0.87309497594833374023f, +-0.49156290292739868164f,0.87084203958511352539f,-0.49556526541709899902f, +0.86857068538665771484f,-0.49955710768699645996f,0.86628097295761108398f, +-0.50353837013244628906f,0.86397284269332885742f,-0.50750899314880371094f, +0.86164647340774536133f,-0.51146882772445678711f,0.85930180549621582031f, +-0.51541787385940551758f,0.85693895816802978516f,-0.51935601234436035156f, +0.85455799102783203125f,-0.52328312397003173828f,0.85215890407562255859f, +-0.52719914913177490234f,0.84974175691604614258f,-0.53110402822494506836f, +0.84730660915374755859f,-0.53499764204025268555f,0.84485357999801635742f, +-0.53887993097305297852f,0.84238260984420776367f,-0.54275077581405639648f, +0.83989381790161132812f,-0.54661017656326293945f,0.83738720417022705078f, +-0.55045795440673828125f,0.83486288785934448242f,-0.55429410934448242188f, +0.83232086896896362305f,-0.55811852216720581055f,0.82976120710372924805f, +-0.56193113327026367188f,0.82718402147293090820f,-0.56573182344436645508f, +0.82458931207656860352f,-0.56952053308486938477f,0.82197713851928710938f, +-0.57329714298248291016f,0.81934750080108642578f,-0.57706165313720703125f, +0.81670057773590087891f,-0.58081394433975219727f,0.81403630971908569336f, +-0.58455395698547363281f,0.81135487556457519531f,-0.58828157186508178711f, +0.80865615606307983398f,-0.59199666976928710938f,0.80594038963317871094f, +-0.59569931030273437500f,0.80320751667022705078f,-0.59938931465148925781f, +0.80045765638351440430f,-0.60306662321090698242f,0.79769086837768554688f, +-0.60673111677169799805f,0.79490715265274047852f,-0.61038279533386230469f, +0.79210656881332397461f,-0.61402153968811035156f,0.78928923606872558594f, +-0.61764729022979736328f,0.78645521402359008789f,-0.62125998735427856445f, +0.78360450267791748047f,-0.62485951185226440430f,0.78073722124099731445f, +-0.62844574451446533203f,0.77785342931747436523f,-0.63201874494552612305f, +0.77495312690734863281f,-0.63557833433151245117f,0.77203637361526489258f, +-0.63912445306777954102f,0.76910334825515747070f,-0.64265704154968261719f, +0.76615399122238159180f,-0.64617604017257690430f,0.76318842172622680664f, +-0.64968132972717285156f,0.76020669937133789062f,-0.65317285060882568359f, +0.75720882415771484375f,-0.65665054321289062500f,0.75419497489929199219f, +-0.66011434793472290039f,0.75116515159606933594f,-0.66356414556503295898f, +0.74811935424804687500f,-0.66699993610382080078f,0.74505776166915893555f, +-0.67042154073715209961f,0.74198043346405029297f,-0.67382901906967163086f, +0.73888731002807617188f,-0.67722219228744506836f,0.73577857017517089844f, +-0.68060100078582763672f,0.73265427350997924805f,-0.68396538496017456055f, +0.72951442003250122070f,-0.68731534481048583984f,0.72635912895202636719f, +-0.69065070152282714844f,0.72318845987319946289f,-0.69397145509719848633f, +0.72000253200531005859f,-0.69727748632431030273f,0.71680128574371337891f, +-0.70056879520416259766f,0.71358484029769897461f,-0.70384526252746582031f, +0.71035337448120117188f,-0.70710676908493041992f,0.70710676908493041992f, +-0.71035337448120117188f,0.70384526252746582031f,-0.71358484029769897461f, +0.70056879520416259766f,-0.71680128574371337891f,0.69727748632431030273f, +-0.72000253200531005859f,0.69397145509719848633f,-0.72318845987319946289f, +0.69065070152282714844f,-0.72635912895202636719f,0.68731534481048583984f, +-0.72951442003250122070f,0.68396538496017456055f,-0.73265427350997924805f, +0.68060100078582763672f,-0.73577857017517089844f,0.67722219228744506836f, +-0.73888731002807617188f,0.67382901906967163086f,-0.74198043346405029297f, +0.67042154073715209961f,-0.74505776166915893555f,0.66699993610382080078f, +-0.74811935424804687500f,0.66356414556503295898f,-0.75116515159606933594f, +0.66011434793472290039f,-0.75419497489929199219f,0.65665054321289062500f, +-0.75720882415771484375f,0.65317285060882568359f,-0.76020669937133789062f, +0.64968132972717285156f,-0.76318842172622680664f,0.64617604017257690430f, +-0.76615399122238159180f,0.64265704154968261719f,-0.76910334825515747070f, +0.63912445306777954102f,-0.77203637361526489258f,0.63557833433151245117f, +-0.77495312690734863281f,0.63201874494552612305f,-0.77785342931747436523f, +0.62844574451446533203f,-0.78073722124099731445f,0.62485951185226440430f, +-0.78360450267791748047f,0.62125998735427856445f,-0.78645521402359008789f, +0.61764729022979736328f,-0.78928923606872558594f,0.61402153968811035156f, +-0.79210656881332397461f,0.61038279533386230469f,-0.79490715265274047852f, +0.60673111677169799805f,-0.79769086837768554688f,0.60306662321090698242f, +-0.80045765638351440430f,0.59938931465148925781f,-0.80320751667022705078f, +0.59569931030273437500f,-0.80594038963317871094f,0.59199666976928710938f, +-0.80865615606307983398f,0.58828157186508178711f,-0.81135487556457519531f, +0.58455395698547363281f,-0.81403630971908569336f,0.58081394433975219727f, +-0.81670057773590087891f,0.57706165313720703125f,-0.81934750080108642578f, +0.57329714298248291016f,-0.82197713851928710938f,0.56952053308486938477f, +-0.82458931207656860352f,0.56573182344436645508f,-0.82718402147293090820f, +0.56193113327026367188f,-0.82976120710372924805f,0.55811852216720581055f, +-0.83232086896896362305f,0.55429410934448242188f,-0.83486288785934448242f, +0.55045795440673828125f,-0.83738720417022705078f,0.54661017656326293945f, +-0.83989381790161132812f,0.54275077581405639648f,-0.84238260984420776367f, +0.53887993097305297852f,-0.84485357999801635742f,0.53499764204025268555f, +-0.84730660915374755859f,0.53110402822494506836f,-0.84974175691604614258f, +0.52719914913177490234f,-0.85215890407562255859f,0.52328312397003173828f, +-0.85455799102783203125f,0.51935601234436035156f,-0.85693895816802978516f, +0.51541787385940551758f,-0.85930180549621582031f,0.51146882772445678711f, +-0.86164647340774536133f,0.50750899314880371094f,-0.86397284269332885742f, +0.50353837013244628906f,-0.86628097295761108398f,0.49955710768699645996f, +-0.86857068538665771484f,0.49556526541709899902f,-0.87084203958511352539f, +0.49156290292739868164f,-0.87309497594833374023f,0.48755016922950744629f, +-0.87532937526702880859f,0.48352706432342529297f,-0.87754529714584350586f, +0.47949376702308654785f,-0.87974262237548828125f,0.47545027732849121094f, +-0.88192129135131835938f,0.47139674425125122070f,-0.88408124446868896484f, +0.46733319759368896484f,-0.88622254133224487305f,0.46325978636741638184f, +-0.88834506273269653320f,0.45917654037475585938f,-0.89044874906539916992f, +0.45508357882499694824f,-0.89253354072570800781f,0.45098099112510681152f, +-0.89459949731826782227f,0.44686883687973022461f,-0.89664649963378906250f, +0.44274723529815673828f,-0.89867448806762695312f,0.43861624598503112793f, +-0.90068340301513671875f,0.43447595834732055664f,-0.90267330408096313477f, +0.43032649159431457520f,-0.90464407205581665039f,0.42616787552833557129f, +-0.90659570693969726562f,0.42200025916099548340f,-0.90852808952331542969f, +0.41782370209693908691f,-0.91044127941131591797f,0.41363832354545593262f, +-0.91233515739440917969f,0.40944415330886840820f,-0.91420978307723999023f, +0.40524131059646606445f,-0.91606497764587402344f,0.40102988481521606445f, +-0.91790080070495605469f,0.39680999517440795898f,-0.91971713304519653320f, +0.39258167147636413574f,-0.92151403427124023438f,0.38834503293037414551f, +-0.92329144477844238281f,0.38410019874572753906f,-0.92504924535751342773f, +0.37984719872474670410f,-0.92678749561309814453f,0.37558618187904357910f, +-0.92850607633590698242f,0.37131720781326293945f,-0.93020504713058471680f, +0.36704033613204956055f,-0.93188428878784179688f,0.36275571584701538086f, +-0.93354380130767822266f,0.35846340656280517578f,-0.93518352508544921875f, +0.35416352748870849609f,-0.93680346012115478516f,0.34985613822937011719f, +-0.93840354681015014648f,0.34554132819175720215f,-0.93998372554779052734f, +0.34121921658515930176f,-0.94154405593872070312f,0.33688986301422119141f, +-0.94308441877365112305f,0.33255335688591003418f,-0.94460481405258178711f, +0.32820984721183776855f,-0.94610524177551269531f,0.32385936379432678223f, +-0.94758558273315429688f,0.31950202584266662598f,-0.94904589653015136719f, +0.31513792276382446289f,-0.95048606395721435547f,0.31076714396476745605f, +-0.95190614461898803711f,0.30638980865478515625f,-0.95330601930618286133f, +0.30200594663619995117f,-0.95468574762344360352f,0.29761570692062377930f, +-0.95604526996612548828f,0.29321914911270141602f,-0.95738452672958374023f, +0.28881642222404479980f,-0.95870345830917358398f,0.28440752625465393066f, +-0.96000212430953979492f,0.27999264001846313477f,-0.96128046512603759766f, +0.27557182312011718750f,-0.96253848075866699219f,0.27114516496658325195f, +-0.96377605199813842773f,0.26671275496482849121f,-0.96499323844909667969f, +0.26227471232414245605f,-0.96618998050689697266f,0.25783109664916992188f, +-0.96736627817153930664f,0.25338202714920043945f,-0.96852207183837890625f, +0.24892760813236236572f,-0.96965736150741577148f,0.24446789920330047607f, +-0.97077214717864990234f,0.24000301957130432129f,-0.97186630964279174805f, +0.23553305864334106445f,-0.97293996810913085938f,0.23105810582637786865f, +-0.97399294376373291016f,0.22657826542854309082f,-0.97502535581588745117f, +0.22209362685680389404f,-0.97603708505630493164f,0.21760427951812744141f, +-0.97702813148498535156f,0.21311031281948089600f,-0.97799849510192871094f, +0.20861184597015380859f,-0.97894817590713500977f,0.20410896837711334229f, +-0.97987711429595947266f,0.19960175454616546631f,-0.98078525066375732422f, +0.19509032368659973145f,-0.98167270421981811523f,0.19057475030422210693f, +-0.98253929615020751953f,0.18605515360832214355f,-0.98338508605957031250f, +0.18153160810470581055f,-0.98421007394790649414f,0.17700421810150146484f, +-0.98501425981521606445f,0.17247308790683746338f,-0.98579752445220947266f, +0.16793829202651977539f,-0.98655992746353149414f,0.16339994966983795166f, +-0.98730140924453735352f,0.15885815024375915527f,-0.98802202939987182617f, +0.15431296825408935547f,-0.98872166872024536133f,0.14976453781127929688f, +-0.98940044641494750977f,0.14521291851997375488f,-0.99005818367004394531f, +0.14065824449062347412f,-0.99069499969482421875f,0.13610057532787322998f, +-0.99131083488464355469f,0.13154003024101257324f,-0.99190568923950195312f, +0.12697669863700866699f,-0.99247956275939941406f,0.12241067737340927124f, +-0.99303233623504638672f,0.11784206330776214600f,-0.99356412887573242188f, +0.11327095329761505127f,-0.99407488107681274414f,0.10869744420051574707f, +-0.99456459283828735352f,0.10412163287401199341f,-0.99503320455551147461f, +0.09954361617565155029f,-0.99548077583312988281f,0.09496349841356277466f, +-0.99590724706649780273f,0.09038136154413223267f,-0.99631261825561523438f, +0.08579730987548828125f,-0.99669688940048217773f,0.08121144771575927734f, +-0.99706006050109863281f,0.07662386447191238403f,-0.99740213155746459961f, +0.07203464955091476440f,-0.99772304296493530273f,0.06744392216205596924f, +-0.99802285432815551758f,0.06285175681114196777f,-0.99830156564712524414f, +0.05825826525688171387f,-0.99855905771255493164f,0.05366353690624237061f, +-0.99879544973373413086f,0.04906767606735229492f,-0.99901068210601806641f, +0.04447077214717864990f,-0.99920475482940673828f,0.03987292572855949402f, +-0.99937766790390014648f,0.03527423739433288574f,-0.99952942132949829102f, +0.03067480400204658508f,-0.99966001510620117188f,0.02607471868395805359f, +-0.99976938962936401367f,0.02147408016026020050f,-0.99985766410827636719f, +0.01687298715114593506f,-0.99992471933364868164f,0.01227153837680816650f, +-0.99997061491012573242f,0.00766982883214950562f,-0.99999529123306274414f, +0.00306795677170157433f,-0.99999880790710449219f,-0.00153398013208061457f, +-0.99998116493225097656f,-0.00613588467240333557f,-0.99994236230850219727f, +-0.01073765940964221954f,-0.99988234043121337891f,-0.01533920597285032272f, +-0.99980115890502929688f,-0.01994042843580245972f,-0.99969881772994995117f, +-0.02454122900962829590f,-0.99957531690597534180f,-0.02914150804281234741f, +-0.99943059682846069336f,-0.03374117240309715271f,-0.99926477670669555664f, +-0.03834012150764465332f,-0.99907773733139038086f,-0.04293825849890708923f, +-0.99886953830718994141f,-0.04753548279404640198f,-0.99864023923873901367f, +-0.05213170498609542847f,-0.99838972091674804688f,-0.05672682076692581177f, +-0.99811810255050659180f,-0.06132073700428009033f,-0.99782532453536987305f, +-0.06591334939002990723f,-0.99751144647598266602f,-0.07050457596778869629f, +-0.99717640876770019531f,-0.07509429752826690674f,-0.99682027101516723633f, +-0.07968243956565856934f,-0.99644303321838378906f,-0.08426889032125473022f, +-0.99604469537734985352f,-0.08885355293750762939f,-0.99562525749206542969f, +-0.09343633800745010376f,-0.99518471956253051758f,-0.09801714122295379639f, +-0.99472314119338989258f,-0.10259586572647094727f,-0.99424046277999877930f, +-0.10717242211103439331f,-0.99373674392700195312f,-0.11174671351909637451f, +-0.99321192502975463867f,-0.11631862819194793701f,-0.99266612529754638672f, +-0.12088808417320251465f,-0.99209928512573242188f,-0.12545497715473175049f, +-0.99151146411895751953f,-0.13001921772956848145f,-0.99090266227722167969f, +-0.13458070158958435059f,-0.99027281999588012695f,-0.13913933932781219482f, +-0.98962199687957763672f,-0.14369502663612365723f,-0.98895025253295898438f, +-0.14824767410755157471f,-0.98825758695602416992f,-0.15279719233512878418f, +-0.98754394054412841797f,-0.15734346210956573486f,-0.98680937290191650391f, +-0.16188639402389526367f,-0.98605394363403320312f,-0.16642589867115020752f, +-0.98527765274047851562f,-0.17096188664436340332f,-0.98448044061660766602f, +-0.17549425363540649414f,-0.98366242647171020508f,-0.18002289533615112305f, +-0.98282355070114135742f,-0.18454773724079132080f,-0.98196387290954589844f, +-0.18906866014003753662f,-0.98108339309692382812f,-0.19358558952808380127f, +-0.98018211126327514648f,-0.19809840619564056396f,-0.97926014661788940430f, +-0.20260703563690185547f,-0.97831737995147705078f,-0.20711137354373931885f, +-0.97735387086868286133f,-0.21161133050918579102f,-0.97636973857879638672f, +-0.21610680222511291504f,-0.97536486387252807617f,-0.22059768438339233398f, +-0.97433936595916748047f,-0.22508391737937927246f,-0.97329324483871459961f, +-0.22956536710262298584f,-0.97222650051116943359f,-0.23404195904731750488f, +-0.97113913297653198242f,-0.23851358890533447266f,-0.97003126144409179688f, +-0.24298018217086791992f,-0.96890282630920410156f,-0.24744161963462829590f, +-0.96775382757186889648f,-0.25189781188964843750f,-0.96658438444137573242f, +-0.25634866952896118164f,-0.96539443731307983398f,-0.26079410314559936523f, +-0.96418404579162597656f,-0.26523402333259582520f,-0.96295326948165893555f, +-0.26966831088066101074f,-0.96170204877853393555f,-0.27409690618515014648f, +-0.96043050289154052734f,-0.27851969003677368164f,-0.95913863182067871094f, +-0.28293657302856445312f,-0.95782643556594848633f,-0.28734746575355529785f, +-0.95649391412734985352f,-0.29175224900245666504f,-0.95514118671417236328f, +-0.29615089297294616699f,-0.95376819372177124023f,-0.30054324865341186523f, +-0.95237499475479125977f,-0.30492922663688659668f,-0.95096164941787719727f, +-0.30930876731872558594f,-0.94952815771102905273f,-0.31368175148963928223f, +-0.94807457923889160156f,-0.31804808974266052246f,-0.94660091400146484375f, +-0.32240769267082214355f,-0.94510722160339355469f,-0.32676044106483459473f, +-0.94359344244003295898f,-0.33110630512237548828f,-0.94205975532531738281f, +-0.33544513583183288574f,-0.94050604104995727539f,-0.33977687358856201172f, +-0.93893247842788696289f,-0.34410142898559570312f,-0.93733900785446166992f, +-0.34841868281364440918f,-0.93572568893432617188f,-0.35272854566574096680f, +-0.93409252166748046875f,-0.35703095793724060059f,-0.93243962526321411133f, +-0.36132580041885375977f,-0.93076694011688232422f,-0.36561298370361328125f, +-0.92907458543777465820f,-0.36989244818687438965f,-0.92736250162124633789f, +-0.37416407465934753418f,-0.92563080787658691406f,-0.37842774391174316406f, +-0.92387950420379638672f,-0.38268342614173889160f,-0.92210865020751953125f, +-0.38693100214004516602f,-0.92031830549240112305f,-0.39117038249969482422f, +-0.91850841045379638672f,-0.39540147781372070312f,-0.91667908430099487305f, +-0.39962419867515563965f,-0.91483032703399658203f,-0.40383845567703247070f, +-0.91296219825744628906f,-0.40804415941238403320f,-0.91107475757598876953f, +-0.41224122047424316406f,-0.90916800498962402344f,-0.41642954945564270020f, +-0.90724200010299682617f,-0.42060908675193786621f,-0.90529674291610717773f, +-0.42477968335151672363f,-0.90333235263824462891f,-0.42894127964973449707f, +-0.90134882926940917969f,-0.43309381604194641113f,-0.89934623241424560547f, +-0.43723717331886291504f,-0.89732456207275390625f,-0.44137126207351684570f, +-0.89528393745422363281f,-0.44549602270126342773f,-0.89322429895401000977f, +-0.44961133599281311035f,-0.89114576578140258789f,-0.45371711254119873047f, +-0.88904833793640136719f,-0.45781329274177551270f,-0.88693213462829589844f, +-0.46189978718757629395f,-0.88479709625244140625f,-0.46597650647163391113f, +-0.88264334201812744141f,-0.47004333138465881348f,-0.88047087192535400391f, +-0.47410020232200622559f,-0.87827980518341064453f,-0.47814705967903137207f, +-0.87607008218765258789f,-0.48218378424644470215f,-0.87384182214736938477f, +-0.48621028661727905273f,-0.87159508466720581055f,-0.49022647738456726074f, +-0.86932986974716186523f,-0.49423229694366455078f,-0.86704623699188232422f, +-0.49822765588760375977f,-0.86474424600601196289f,-0.50221246480941772461f, +-0.86242395639419555664f,-0.50618666410446166992f,-0.86008536815643310547f, +-0.51015007495880126953f,-0.85772860050201416016f,-0.51410275697708129883f, +-0.85535365343093872070f,-0.51804453134536743164f,-0.85296058654785156250f, +-0.52197527885437011719f,-0.85054945945739746094f,-0.52589499950408935547f, +-0.84812033176422119141f,-0.52980363368988037109f,-0.84567326307296752930f, +-0.53370100259780883789f,-0.84320825338363647461f,-0.53758704662322998047f, +-0.84072536230087280273f,-0.54146176576614379883f,-0.83822470903396606445f, +-0.54532498121261596680f,-0.83570629358291625977f,-0.54917663335800170898f, +-0.83317017555236816406f,-0.55301672220230102539f,-0.83061641454696655273f, +-0.55684500932693481445f,-0.82804507017135620117f,-0.56066155433654785156f, +-0.82545614242553710938f,-0.56446623802185058594f,-0.82284981012344360352f, +-0.56825894117355346680f,-0.82022595405578613281f,-0.57203960418701171875f, +-0.81758481264114379883f,-0.57580816745758056641f,-0.81492632627487182617f, +-0.57956457138061523438f,-0.81225061416625976562f,-0.58330863714218139648f, +-0.80955761671066284180f,-0.58704036474227905273f,-0.80684757232666015625f, +-0.59075969457626342773f,-0.80412036180496215820f,-0.59446650743484497070f, +-0.80137616395950317383f,-0.59816068410873413086f,-0.79861497879028320312f, +-0.60184222459793090820f,-0.79583692550659179688f,-0.60551106929779052734f, +-0.79304194450378417969f,-0.60916703939437866211f,-0.79023021459579467773f, +-0.61281007528305053711f,-0.78740173578262329102f,-0.61644017696380615234f, +-0.78455656766891479492f,-0.62005722522735595703f,-0.78169482946395874023f, +-0.62366110086441040039f,-0.77881652116775512695f,-0.62725180387496948242f, +-0.77592170238494873047f,-0.63082921504974365234f,-0.77301043272018432617f, +-0.63439327478408813477f,-0.77008283138275146484f,-0.63794392347335815430f, +-0.76713889837265014648f,-0.64148104190826416016f,-0.76417875289916992188f, +-0.64500451087951660156f,-0.76120239496231079102f,-0.64851438999176025391f, +-0.75820988416671752930f,-0.65201056003570556641f,-0.75520139932632446289f, +-0.65549284219741821289f,-0.75217682123184204102f,-0.65896129608154296875f, +-0.74913638830184936523f,-0.66241580247879028320f,-0.74608010053634643555f, +-0.66585624217987060547f,-0.74300795793533325195f,-0.66928261518478393555f, +-0.73992007970809936523f,-0.67269474267959594727f,-0.73681658506393432617f, +-0.67609268426895141602f,-0.73369741439819335938f,-0.67947632074356079102f, +-0.73056274652481079102f,-0.68284553289413452148f,-0.72741264104843139648f, +-0.68620032072067260742f,-0.72424709796905517578f,-0.68954056501388549805f, +-0.72106617689132690430f,-0.69286614656448364258f,-0.71787005662918090820f, +-0.69617712497711181641f,-0.71465867757797241211f,-0.69947332143783569336f, +-0.71143221855163574219f,-0.70275473594665527344f,-0.70819061994552612305f, +-0.70602124929428100586f,-0.70493406057357788086f,-0.70927280187606811523f, +-0.70166260004043579102f,-0.71250939369201660156f,-0.69837623834609985352f, +-0.71573084592819213867f,-0.69507509469985961914f,-0.71893709897994995117f, +-0.69175922870635986328f,-0.72212821245193481445f,-0.68842875957489013672f, +-0.72530394792556762695f,-0.68508368730545043945f,-0.72846436500549316406f, +-0.68172407150268554688f,-0.73160940408706665039f,-0.67835003137588500977f, +-0.73473888635635375977f,-0.67496162652969360352f,-0.73785281181335449219f, +-0.67155897617340087891f,-0.74095112085342407227f,-0.66814202070236206055f, +-0.74403375387191772461f,-0.66471099853515625000f,-0.74710059165954589844f, +-0.66126585006713867188f,-0.75015163421630859375f,-0.65780669450759887695f, +-0.75318682193756103516f,-0.65433359146118164062f,-0.75620597600936889648f, +-0.65084666013717651367f,-0.75920921564102172852f,-0.64734596014022827148f, +-0.76219630241394042969f,-0.64383155107498168945f,-0.76516723632812500000f, +-0.64030349254608154297f,-0.76812201738357543945f,-0.63676184415817260742f, +-0.77106052637100219727f,-0.63320678472518920898f,-0.77398270368576049805f, +-0.62963825464248657227f,-0.77688848972320556641f,-0.62605637311935424805f, +-0.77977776527404785156f,-0.62246125936508178711f,-0.78265058994293212891f, +-0.61885297298431396484f,-0.78550684452056884766f,-0.61523157358169555664f, +-0.78834640979766845703f,-0.61159718036651611328f,-0.79116934537887573242f, +-0.60794979333877563477f,-0.79397547245025634766f,-0.60428953170776367188f, +-0.79676479101181030273f,-0.60061645507812500000f,-0.79953724145889282227f, +-0.59693068265914916992f,-0.80229282379150390625f,-0.59323227405548095703f, +-0.80503135919570922852f,-0.58952128887176513672f,-0.80775284767150878906f, +-0.58579784631729125977f,-0.81045717000961303711f,-0.58206200599670410156f, +-0.81314438581466674805f,-0.57831376791000366211f,-0.81581443548202514648f, +-0.57455337047576904297f,-0.81846714019775390625f,-0.57078075408935546875f, +-0.82110249996185302734f,-0.56699603796005249023f,-0.82372051477432250977f, +-0.56319934129714965820f,-0.82632106542587280273f,-0.55939072370529174805f, +-0.82890409231185913086f,-0.55557024478912353516f,-0.83146959543228149414f, +-0.55173796415328979492f,-0.83401751518249511719f,-0.54789406061172485352f, +-0.83654773235321044922f,-0.54403853416442871094f,-0.83906024694442749023f, +-0.54017144441604614258f,-0.84155499935150146484f,-0.53629297018051147461f, +-0.84403187036514282227f,-0.53240311145782470703f,-0.84649091958999633789f, +-0.52850198745727539062f,-0.84893202781677246094f,-0.52458965778350830078f, +-0.85135519504547119141f,-0.52066624164581298828f,-0.85376030206680297852f, +-0.51673179864883422852f,-0.85614734888076782227f,-0.51278638839721679688f, +-0.85851621627807617188f,-0.50883013010025024414f,-0.86086696386337280273f, +-0.50486308336257934570f,-0.86319941282272338867f,-0.50088536739349365234f, +-0.86551362276077270508f,-0.49689704179763793945f,-0.86780947446823120117f, +-0.49289819598197937012f,-0.87008696794509887695f,-0.48888888955116271973f, +-0.87234604358673095703f,-0.48486924171447753906f,-0.87458664178848266602f, +-0.48083934187889099121f,-0.87680870294570922852f,-0.47679921984672546387f, +-0.87901222705841064453f,-0.47274902462959289551f,-0.88119709491729736328f, +-0.46868881583213806152f,-0.88336336612701416016f,-0.46461868286132812500f, +-0.88551086187362670898f,-0.46053871512413024902f,-0.88763964176177978516f, +-0.45644897222518920898f,-0.88974958658218383789f,-0.45234957337379455566f, +-0.89184069633483886719f,-0.44824060797691345215f,-0.89391297101974487305f, +-0.44412213563919067383f,-0.89596623182296752930f,-0.43999427556991577148f, +-0.89800059795379638672f,-0.43585708737373352051f,-0.90001589059829711914f, +-0.43171066045761108398f,-0.90201216936111450195f,-0.42755508422851562500f, +-0.90398931503295898438f,-0.42339047789573669434f,-0.90594726800918579102f, +-0.41921690106391906738f,-0.90788608789443969727f,-0.41503441333770751953f, +-0.90980571508407592773f,-0.41084316372871398926f,-0.91170603036880493164f, +-0.40664321184158325195f,-0.91358703374862670898f,-0.40243464708328247070f, +-0.91544872522354125977f,-0.39821755886077880859f,-0.91729098558425903320f, +-0.39399203658103942871f,-0.91911387443542480469f,-0.38975816965103149414f, +-0.92091721296310424805f,-0.38551604747772216797f,-0.92270112037658691406f, +-0.38126575946807861328f,-0.92446547746658325195f,-0.37700742483139038086f, +-0.92621022462844848633f,-0.37274107336997985840f,-0.92793542146682739258f, +-0.36846682429313659668f,-0.92964088916778564453f,-0.36418479681015014648f, +-0.93132668733596801758f,-0.35989505052566528320f,-0.93299281597137451172f, +-0.35559767484664916992f,-0.93463915586471557617f,-0.35129275918006896973f, +-0.93626564741134643555f,-0.34698042273521423340f,-0.93787235021591186523f, +-0.34266072511672973633f,-0.93945920467376708984f,-0.33833375573158264160f, +-0.94102615118026733398f,-0.33399966359138488770f,-0.94257318973541259766f, +-0.32965844869613647461f,-0.94410026073455810547f,-0.32531028985977172852f, +-0.94560730457305908203f,-0.32095524668693542480f,-0.94709438085556030273f, +-0.31659337878227233887f,-0.94856137037277221680f,-0.31222480535507202148f, +-0.95000827312469482422f,-0.30784964561462402344f,-0.95143502950668334961f, +-0.30346795916557312012f,-0.95284163951873779297f,-0.29907983541488647461f, +-0.95422810316085815430f,-0.29468536376953125000f,-0.95559436082839965820f, +-0.29028466343879699707f,-0.95694035291671752930f,-0.28587782382965087891f, +-0.95826607942581176758f,-0.28146493434906005859f,-0.95957154035568237305f, +-0.27704608440399169922f,-0.96085661649703979492f,-0.27262136340141296387f, +-0.96212142705917358398f,-0.26819086074829101562f,-0.96336579322814941406f, +-0.26375466585159301758f,-0.96458977460861206055f,-0.25931292772293090820f, +-0.96579337120056152344f,-0.25486564636230468750f,-0.96697646379470825195f, +-0.25041300058364868164f,-0.96813911199569702148f,-0.24595504999160766602f, +-0.96928125619888305664f,-0.24149188399314880371f,-0.97040283679962158203f, +-0.23702360689640045166f,-0.97150391340255737305f,-0.23255030810832977295f, +-0.97258436679840087891f,-0.22807207703590393066f,-0.97364425659179687500f, +-0.22358903288841247559f,-0.97468352317810058594f,-0.21910123527050018311f, +-0.97570210695266723633f,-0.21460881829261779785f,-0.97670006752014160156f, +-0.21011184155941009521f,-0.97767734527587890625f,-0.20561040937900543213f, +-0.97863394021987915039f,-0.20110464096069335938f,-0.97956979274749755859f, +-0.19659459590911865234f,-0.98048484325408935547f,-0.19208039343357086182f, +-0.98137921094894409180f,-0.18756212294101715088f,-0.98225271701812744141f, +-0.18303988873958587646f,-0.98310548067092895508f,-0.17851376533508300781f, +-0.98393744230270385742f,-0.17398387193679809570f,-0.98474848270416259766f, +-0.16945029795169830322f,-0.98553872108459472656f,-0.16491311788558959961f, +-0.98630809783935546875f,-0.16037245094776153564f,-0.98705655336380004883f, +-0.15582840144634246826f,-0.98778414726257324219f,-0.15128104388713836670f, +-0.98849081993103027344f,-0.14673046767711639404f,-0.98917651176452636719f, +-0.14217680692672729492f,-0.98984128236770629883f,-0.13762012124061584473f, +-0.99048507213592529297f,-0.13306052982807159424f,-0.99110794067382812500f, +-0.12849810719490051270f,-0.99170976877212524414f,-0.12393297255039215088f, +-0.99229061603546142578f,-0.11936521530151367188f,-0.99285042285919189453f, +-0.11479492485523223877f,-0.99338918924331665039f,-0.11022220551967620850f, +-0.99390697479248046875f,-0.10564715415239334106f,-0.99440366029739379883f, +-0.10106986016035079956f,-0.99487930536270141602f,-0.09649042785167694092f, +-0.99533390998840332031f,-0.09190895408391952515f,-0.99576741456985473633f, +-0.08732553571462631226f,-0.99617981910705566406f,-0.08274026215076446533f, +-0.99657112360000610352f,-0.07815324515104293823f,-0.99694132804870605469f, +-0.07356456667184829712f,-0.99729043245315551758f,-0.06897433102130889893f, +-0.99761843681335449219f,-0.06438262760639190674f,-0.99792528152465820312f, +-0.05978957191109657288f,-0.99821102619171142578f,-0.05519524589180946350f, +-0.99847555160522460938f,-0.05059975013136863708f,-0.99871903657913208008f, +-0.04600318148732185364f,-0.99894130229949951172f,-0.04140564054250717163f, +-0.99914240837097167969f,-0.03680722415447235107f,-0.99932235479354858398f, +-0.03220802545547485352f,-0.99948120117187500000f,-0.02760814502835273743f, +-0.99961882829666137695f,-0.02300768159329891205f,-0.99973529577255249023f, +-0.01840673014521598816f,-0.99983060359954833984f,-0.01380538847297430038f, +-0.99990469217300415039f,-0.00920375436544418335f,-0.99995762109756469727f, +-0.00460192607715725899f,-0.99998939037322998047f,1.00000000000000000000f, +0.00000000000000000000f,0.99983060359954833984f,0.01840673014521598816f, +0.99932235479354858398f,0.03680722415447235107f,0.99847555160522460938f, +0.05519524589180946350f,0.99729043245315551758f,0.07356456667184829712f, +0.99576741456985473633f,0.09190895408391952515f,0.99390697479248046875f, +0.11022220551967620850f,0.99170976877212524414f,0.12849810719490051270f, +0.98917651176452636719f,0.14673046767711639404f,0.98630809783935546875f, +0.16491311788558959961f,0.98310548067092895508f,0.18303988873958587646f, +0.97956979274749755859f,0.20110464096069335938f,0.97570210695266723633f, +0.21910123527050018311f,0.97150391340255737305f,0.23702360689640045166f, +0.96697646379470825195f,0.25486564636230468750f,0.96212142705917358398f, +0.27262136340141296387f,0.95694035291671752930f,0.29028466343879699707f, +0.95143502950668334961f,0.30784964561462402344f,0.94560730457305908203f, +0.32531028985977172852f,0.93945920467376708984f,0.34266072511672973633f, +0.93299281597137451172f,0.35989505052566528320f,0.92621022462844848633f, +0.37700742483139038086f,0.91911387443542480469f,0.39399203658103942871f, +0.91170603036880493164f,0.41084316372871398926f,0.90398931503295898438f, +0.42755508422851562500f,0.89596623182296752930f,0.44412213563919067383f, +0.88763964176177978516f,0.46053871512413024902f,0.87901222705841064453f, +0.47679921984672546387f,0.87008696794509887695f,0.49289819598197937012f, +0.86086696386337280273f,0.50883013010025024414f,0.85135519504547119141f, +0.52458965778350830078f,0.84155499935150146484f,0.54017144441604614258f, +0.83146959543228149414f,0.55557024478912353516f,0.82110249996185302734f, +0.57078075408935546875f,0.81045717000961303711f,0.58579784631729125977f, +0.79953724145889282227f,0.60061645507812500000f,0.78834640979766845703f, +0.61523157358169555664f,0.77688848972320556641f,0.62963825464248657227f, +0.76516723632812500000f,0.64383155107498168945f,0.75318682193756103516f, +0.65780669450759887695f,0.74095112085342407227f,0.67155897617340087891f, +0.72846436500549316406f,0.68508368730545043945f,0.71573084592819213867f, +0.69837623834609985352f,0.70275473594665527344f,0.71143221855163574219f, +0.68954056501388549805f,0.72424709796905517578f,0.67609268426895141602f, +0.73681658506393432617f,0.66241580247879028320f,0.74913638830184936523f, +0.64851438999176025391f,0.76120239496231079102f,0.63439327478408813477f, +0.77301043272018432617f,0.62005722522735595703f,0.78455656766891479492f, +0.60551106929779052734f,0.79583692550659179688f,0.59075969457626342773f, +0.80684757232666015625f,0.57580816745758056641f,0.81758481264114379883f, +0.56066155433654785156f,0.82804507017135620117f,0.54532498121261596680f, +0.83822470903396606445f,0.52980363368988037109f,0.84812033176422119141f, +0.51410275697708129883f,0.85772860050201416016f,0.49822765588760375977f, +0.86704623699188232422f,0.48218378424644470215f,0.87607008218765258789f, +0.46597650647163391113f,0.88479709625244140625f,0.44961133599281311035f, +0.89322429895401000977f,0.43309381604194641113f,0.90134882926940917969f, +0.41642954945564270020f,0.90916800498962402344f,0.39962419867515563965f, +0.91667908430099487305f,0.38268342614173889160f,0.92387950420379638672f, +0.36561298370361328125f,0.93076694011688232422f,0.34841868281364440918f, +0.93733900785446166992f,0.33110630512237548828f,0.94359344244003295898f, +0.31368175148963928223f,0.94952815771102905273f,0.29615089297294616699f, +0.95514118671417236328f,0.27851969003677368164f,0.96043050289154052734f, +0.26079410314559936523f,0.96539443731307983398f,0.24298018217086791992f, +0.97003126144409179688f,0.22508391737937927246f,0.97433936595916748047f, +0.20711137354373931885f,0.97831737995147705078f,0.18906866014003753662f, +0.98196387290954589844f,0.17096188664436340332f,0.98527765274047851562f, +0.15279719233512878418f,0.98825758695602416992f,0.13458070158958435059f, +0.99090266227722167969f,0.11631862819194793701f,0.99321192502975463867f, +0.09801714122295379639f,0.99518471956253051758f,0.07968243956565856934f, +0.99682027101516723633f,0.06132073700428009033f,0.99811810255050659180f, +0.04293825849890708923f,0.99907773733139038086f,0.02454122900962829590f, +0.99969881772994995117f,0.00613588467240333557f,0.99998116493225097656f, +-0.01227153837680816650f,0.99992471933364868164f,-0.03067480400204658508f, +0.99952942132949829102f,-0.04906767606735229492f,0.99879544973373413086f, +-0.06744392216205596924f,0.99772304296493530273f,-0.08579730987548828125f, +0.99631261825561523438f,-0.10412163287401199341f,0.99456459283828735352f, +-0.12241067737340927124f,0.99247956275939941406f,-0.14065824449062347412f, +0.99005818367004394531f,-0.15885815024375915527f,0.98730140924453735352f, +-0.17700421810150146484f,0.98421007394790649414f,-0.19509032368659973145f, +0.98078525066375732422f,-0.21311031281948089600f,0.97702813148498535156f, +-0.23105810582637786865f,0.97293996810913085938f,-0.24892760813236236572f, +0.96852207183837890625f,-0.26671275496482849121f,0.96377605199813842773f, +-0.28440752625465393066f,0.95870345830917358398f,-0.30200594663619995117f, +0.95330601930618286133f,-0.31950202584266662598f,0.94758558273315429688f, +-0.33688986301422119141f,0.94154405593872070312f,-0.35416352748870849609f, +0.93518352508544921875f,-0.37131720781326293945f,0.92850607633590698242f, +-0.38834503293037414551f,0.92151403427124023438f,-0.40524131059646606445f, +0.91420978307723999023f,-0.42200025916099548340f,0.90659570693969726562f, +-0.43861624598503112793f,0.89867448806762695312f,-0.45508357882499694824f, +0.89044874906539916992f,-0.47139674425125122070f,0.88192129135131835938f, +-0.48755016922950744629f,0.87309497594833374023f,-0.50353837013244628906f, +0.86397284269332885742f,-0.51935601234436035156f,0.85455799102783203125f, +-0.53499764204025268555f,0.84485357999801635742f,-0.55045795440673828125f, +0.83486288785934448242f,-0.56573182344436645508f,0.82458931207656860352f, +-0.58081394433975219727f,0.81403630971908569336f,-0.59569931030273437500f, +0.80320751667022705078f,-0.61038279533386230469f,0.79210656881332397461f, +-0.62485951185226440430f,0.78073722124099731445f,-0.63912445306777954102f, +0.76910334825515747070f,-0.65317285060882568359f,0.75720882415771484375f, +-0.66699993610382080078f,0.74505776166915893555f,-0.68060100078582763672f, +0.73265427350997924805f,-0.69397145509719848633f,0.72000253200531005859f, +-0.70710676908493041992f,0.70710676908493041992f,-0.72000253200531005859f, +0.69397145509719848633f,-0.73265427350997924805f,0.68060100078582763672f, +-0.74505776166915893555f,0.66699993610382080078f,-0.75720882415771484375f, +0.65317285060882568359f,-0.76910334825515747070f,0.63912445306777954102f, +-0.78073722124099731445f,0.62485951185226440430f,-0.79210656881332397461f, +0.61038279533386230469f,-0.80320751667022705078f,0.59569931030273437500f, +-0.81403630971908569336f,0.58081394433975219727f,-0.82458931207656860352f, +0.56573182344436645508f,-0.83486288785934448242f,0.55045795440673828125f, +-0.84485357999801635742f,0.53499764204025268555f,-0.85455799102783203125f, +0.51935601234436035156f,-0.86397284269332885742f,0.50353837013244628906f, +-0.87309497594833374023f,0.48755016922950744629f,-0.88192129135131835938f, +0.47139674425125122070f,-0.89044874906539916992f,0.45508357882499694824f, +-0.89867448806762695312f,0.43861624598503112793f,-0.90659570693969726562f, +0.42200025916099548340f,-0.91420978307723999023f,0.40524131059646606445f, +-0.92151403427124023438f,0.38834503293037414551f,-0.92850607633590698242f, +0.37131720781326293945f,-0.93518352508544921875f,0.35416352748870849609f, +-0.94154405593872070312f,0.33688986301422119141f,-0.94758558273315429688f, +0.31950202584266662598f,-0.95330601930618286133f,0.30200594663619995117f, +-0.95870345830917358398f,0.28440752625465393066f,-0.96377605199813842773f, +0.26671275496482849121f,-0.96852207183837890625f,0.24892760813236236572f, +-0.97293996810913085938f,0.23105810582637786865f,-0.97702813148498535156f, +0.21311031281948089600f,-0.98078525066375732422f,0.19509032368659973145f, +-0.98421007394790649414f,0.17700421810150146484f,-0.98730140924453735352f, +0.15885815024375915527f,-0.99005818367004394531f,0.14065824449062347412f, +-0.99247956275939941406f,0.12241067737340927124f,-0.99456459283828735352f, +0.10412163287401199341f,-0.99631261825561523438f,0.08579730987548828125f, +-0.99772304296493530273f,0.06744392216205596924f,-0.99879544973373413086f, +0.04906767606735229492f,-0.99952942132949829102f,0.03067480400204658508f, +-0.99992471933364868164f,0.01227153837680816650f,-0.99998116493225097656f, +-0.00613588467240333557f,-0.99969881772994995117f,-0.02454122900962829590f, +-0.99907773733139038086f,-0.04293825849890708923f,-0.99811810255050659180f, +-0.06132073700428009033f,-0.99682027101516723633f,-0.07968243956565856934f, +-0.99518471956253051758f,-0.09801714122295379639f,-0.99321192502975463867f, +-0.11631862819194793701f,-0.99090266227722167969f,-0.13458070158958435059f, +-0.98825758695602416992f,-0.15279719233512878418f,-0.98527765274047851562f, +-0.17096188664436340332f,-0.98196387290954589844f,-0.18906866014003753662f, +-0.97831737995147705078f,-0.20711137354373931885f,-0.97433936595916748047f, +-0.22508391737937927246f,-0.97003126144409179688f,-0.24298018217086791992f, +-0.96539443731307983398f,-0.26079410314559936523f,-0.96043050289154052734f, +-0.27851969003677368164f,-0.95514118671417236328f,-0.29615089297294616699f, +-0.94952815771102905273f,-0.31368175148963928223f,-0.94359344244003295898f, +-0.33110630512237548828f,-0.93733900785446166992f,-0.34841868281364440918f, +-0.93076694011688232422f,-0.36561298370361328125f,-0.92387950420379638672f, +-0.38268342614173889160f,-0.91667908430099487305f,-0.39962419867515563965f, +-0.90916800498962402344f,-0.41642954945564270020f,-0.90134882926940917969f, +-0.43309381604194641113f,-0.89322429895401000977f,-0.44961133599281311035f, +-0.88479709625244140625f,-0.46597650647163391113f,-0.87607008218765258789f, +-0.48218378424644470215f,-0.86704623699188232422f,-0.49822765588760375977f, +-0.85772860050201416016f,-0.51410275697708129883f,-0.84812033176422119141f, +-0.52980363368988037109f,-0.83822470903396606445f,-0.54532498121261596680f, +-0.82804507017135620117f,-0.56066155433654785156f,-0.81758481264114379883f, +-0.57580816745758056641f,-0.80684757232666015625f,-0.59075969457626342773f, +-0.79583692550659179688f,-0.60551106929779052734f,-0.78455656766891479492f, +-0.62005722522735595703f,-0.77301043272018432617f,-0.63439327478408813477f, +-0.76120239496231079102f,-0.64851438999176025391f,-0.74913638830184936523f, +-0.66241580247879028320f,-0.73681658506393432617f,-0.67609268426895141602f, +-0.72424709796905517578f,-0.68954056501388549805f,-0.71143221855163574219f, +-0.70275473594665527344f,-0.69837623834609985352f,-0.71573084592819213867f, +-0.68508368730545043945f,-0.72846436500549316406f,-0.67155897617340087891f, +-0.74095112085342407227f,-0.65780669450759887695f,-0.75318682193756103516f, +-0.64383155107498168945f,-0.76516723632812500000f,-0.62963825464248657227f, +-0.77688848972320556641f,-0.61523157358169555664f,-0.78834640979766845703f, +-0.60061645507812500000f,-0.79953724145889282227f,-0.58579784631729125977f, +-0.81045717000961303711f,-0.57078075408935546875f,-0.82110249996185302734f, +-0.55557024478912353516f,-0.83146959543228149414f,-0.54017144441604614258f, +-0.84155499935150146484f,-0.52458965778350830078f,-0.85135519504547119141f, +-0.50883013010025024414f,-0.86086696386337280273f,-0.49289819598197937012f, +-0.87008696794509887695f,-0.47679921984672546387f,-0.87901222705841064453f, +-0.46053871512413024902f,-0.88763964176177978516f,-0.44412213563919067383f, +-0.89596623182296752930f,-0.42755508422851562500f,-0.90398931503295898438f, +-0.41084316372871398926f,-0.91170603036880493164f,-0.39399203658103942871f, +-0.91911387443542480469f,-0.37700742483139038086f,-0.92621022462844848633f, +-0.35989505052566528320f,-0.93299281597137451172f,-0.34266072511672973633f, +-0.93945920467376708984f,-0.32531028985977172852f,-0.94560730457305908203f, +-0.30784964561462402344f,-0.95143502950668334961f,-0.29028466343879699707f, +-0.95694035291671752930f,-0.27262136340141296387f,-0.96212142705917358398f, +-0.25486564636230468750f,-0.96697646379470825195f,-0.23702360689640045166f, +-0.97150391340255737305f,-0.21910123527050018311f,-0.97570210695266723633f, +-0.20110464096069335938f,-0.97956979274749755859f,-0.18303988873958587646f, +-0.98310548067092895508f,-0.16491311788558959961f,-0.98630809783935546875f, +-0.14673046767711639404f,-0.98917651176452636719f,-0.12849810719490051270f, +-0.99170976877212524414f,-0.11022220551967620850f,-0.99390697479248046875f, +-0.09190895408391952515f,-0.99576741456985473633f,-0.07356456667184829712f, +-0.99729043245315551758f,-0.05519524589180946350f,-0.99847555160522460938f, +-0.03680722415447235107f,-0.99932235479354858398f,-0.01840673014521598816f, +-0.99983060359954833984f,1.00000000000000000000f,0.00000000000000000000f, +0.99729043245315551758f,0.07356456667184829712f,0.98917651176452636719f, +0.14673046767711639404f,0.97570210695266723633f,0.21910123527050018311f, +0.95694035291671752930f,0.29028466343879699707f,0.93299281597137451172f, +0.35989505052566528320f,0.90398931503295898438f,0.42755508422851562500f, +0.87008696794509887695f,0.49289819598197937012f,0.83146959543228149414f, +0.55557024478912353516f,0.78834640979766845703f,0.61523157358169555664f, +0.74095112085342407227f,0.67155897617340087891f,0.68954056501388549805f, +0.72424709796905517578f,0.63439327478408813477f,0.77301043272018432617f, +0.57580816745758056641f,0.81758481264114379883f,0.51410275697708129883f, +0.85772860050201416016f,0.44961133599281311035f,0.89322429895401000977f, +0.38268342614173889160f,0.92387950420379638672f,0.31368175148963928223f, +0.94952815771102905273f,0.24298018217086791992f,0.97003126144409179688f, +0.17096188664436340332f,0.98527765274047851562f,0.09801714122295379639f, +0.99518471956253051758f,0.02454122900962829590f,0.99969881772994995117f, +-0.04906767606735229492f,0.99879544973373413086f,-0.12241067737340927124f, +0.99247956275939941406f,-0.19509032368659973145f,0.98078525066375732422f, +-0.26671275496482849121f,0.96377605199813842773f,-0.33688986301422119141f, +0.94154405593872070312f,-0.40524131059646606445f,0.91420978307723999023f, +-0.47139674425125122070f,0.88192129135131835938f,-0.53499764204025268555f, +0.84485357999801635742f,-0.59569931030273437500f,0.80320751667022705078f, +-0.65317285060882568359f,0.75720882415771484375f,-0.70710676908493041992f, +0.70710676908493041992f,-0.75720882415771484375f,0.65317285060882568359f, +-0.80320751667022705078f,0.59569931030273437500f,-0.84485357999801635742f, +0.53499764204025268555f,-0.88192129135131835938f,0.47139674425125122070f, +-0.91420978307723999023f,0.40524131059646606445f,-0.94154405593872070312f, +0.33688986301422119141f,-0.96377605199813842773f,0.26671275496482849121f, +-0.98078525066375732422f,0.19509032368659973145f,-0.99247956275939941406f, +0.12241067737340927124f,-0.99879544973373413086f,0.04906767606735229492f, +-0.99969881772994995117f,-0.02454122900962829590f,-0.99518471956253051758f, +-0.09801714122295379639f,-0.98527765274047851562f,-0.17096188664436340332f, +-0.97003126144409179688f,-0.24298018217086791992f,-0.94952815771102905273f, +-0.31368175148963928223f,-0.92387950420379638672f,-0.38268342614173889160f, +-0.89322429895401000977f,-0.44961133599281311035f,-0.85772860050201416016f, +-0.51410275697708129883f,-0.81758481264114379883f,-0.57580816745758056641f, +-0.77301043272018432617f,-0.63439327478408813477f,-0.72424709796905517578f, +-0.68954056501388549805f,-0.67155897617340087891f,-0.74095112085342407227f, +-0.61523157358169555664f,-0.78834640979766845703f,-0.55557024478912353516f, +-0.83146959543228149414f,-0.49289819598197937012f,-0.87008696794509887695f, +-0.42755508422851562500f,-0.90398931503295898438f,-0.35989505052566528320f, +-0.93299281597137451172f,-0.29028466343879699707f,-0.95694035291671752930f, +-0.21910123527050018311f,-0.97570210695266723633f,-0.14673046767711639404f, +-0.98917651176452636719f,-0.07356456667184829712f,-0.99729043245315551758f, +1.00000000000000000000f,0.00000000000000000000f,0.95694035291671752930f, +0.29028466343879699707f,0.83146959543228149414f,0.55557024478912353516f, +0.63439327478408813477f,0.77301043272018432617f,0.38268342614173889160f, +0.92387950420379638672f,0.09801714122295379639f,0.99518471956253051758f, +-0.19509032368659973145f,0.98078525066375732422f,-0.47139674425125122070f, +0.88192129135131835938f,-0.70710676908493041992f,0.70710676908493041992f, +-0.88192129135131835938f,0.47139674425125122070f,-0.98078525066375732422f, +0.19509032368659973145f,-0.99518471956253051758f,-0.09801714122295379639f, +-0.92387950420379638672f,-0.38268342614173889160f,-0.77301043272018432617f, +-0.63439327478408813477f,-0.55557024478912353516f,-0.83146959543228149414f, +-0.29028466343879699707f,-0.95694035291671752930f,1.00000000000000000000f, +0.00000000000000000000f,0.38268342614173889160f,0.92387950420379638672f, +-0.70710676908493041992f,0.70710676908493041992f,-0.92387950420379638672f, +-0.38268342614173889160f,}; #endif @@ -3766,7 +3769,8 @@ float32_t rearranged_twiddle_stride3_4096_f32[2728]={ #endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ -#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) @@ -5431,7 +5435,8 @@ q31_t rearranged_twiddle_stride3_4096_q31[2728]={ #endif /* defined(ARM_MATH_MVEI) */ -#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_mve_tables_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_mve_tables_f16.c index d3f2d34..56e3acd 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_mve_tables_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/CommonTables/arm_mve_tables_f16.c @@ -6,12 +6,13 @@ * Description: common tables like fft twiddle factors, Bitreverse, reciprocal etc * used for MVE implementation only * - * $Date: 14. April 2020 + * @version V1.10.0 + * @date 04 October 2021 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -28,10 +29,12 @@ * limitations under the License. */ -#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types_f16.h" + #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types_f16.h" + #if defined(ARM_FLOAT16_SUPPORTED) + #if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) @@ -48,22 +51,22 @@ uint32_t rearranged_twiddle_tab_stride3_arr_16_f16[2]={ 0,0,}; float16_t rearranged_twiddle_stride1_16_f16[8]={ -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f,}; +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f,}; float16_t rearranged_twiddle_stride2_16_f16[8]={ -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.00000000000000006123f,(float16_t)1.00000000000000000000f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f,}; +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.0000000000000f,(float16_t)1.0000000000000f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f,}; float16_t rearranged_twiddle_stride3_16_f16[8]={ -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.92387953251128684951f,(float16_t)-0.38268343236508967076f,}; +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.9238281250000f,(float16_t)-0.3825683593750f,}; #endif @@ -79,70 +82,70 @@ uint32_t rearranged_twiddle_tab_stride3_arr_64_f16[3]={ 0,32,0,}; float16_t rearranged_twiddle_stride1_64_f16[40]={ -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99518472667219692873f,(float16_t)0.09801714032956060363f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.88192126434835504956f,(float16_t)0.47139673682599764204f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.47139673682599780857f,(float16_t)0.88192126434835493853f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.29028467725446233105f,(float16_t)0.95694033573220893540f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f,}; +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f,}; float16_t rearranged_twiddle_stride2_64_f16[40]={ -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.00000000000000006123f,(float16_t)1.00000000000000000000f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.38268343236508972627f,(float16_t)0.92387953251128673848f, -(float16_t)-0.55557023301960195560f,(float16_t)0.83146961230254534669f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.83146961230254534669f,(float16_t)0.55557023301960217765f, -(float16_t)-0.92387953251128673848f,(float16_t)0.38268343236508989280f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.00000000000000006123f,(float16_t)1.00000000000000000000f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f,}; +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.0000000000000f,(float16_t)1.0000000000000f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)-0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)-0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.0000000000000f,(float16_t)1.0000000000000f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f,}; float16_t rearranged_twiddle_stride3_64_f16[40]={ -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.47139673682599769755f,(float16_t)0.88192126434835504956f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.88192126434835493853f,(float16_t)0.47139673682599780857f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)-0.99518472667219692873f,(float16_t)-0.09801714032956058975f, -(float16_t)-0.92387953251128684951f,(float16_t)-0.38268343236508967076f, -(float16_t)-0.77301045336273710440f,(float16_t)-0.63439328416364526575f, -(float16_t)-0.55557023301960217765f,(float16_t)-0.83146961230254523567f, -(float16_t)-0.29028467725446244208f,(float16_t)-0.95694033573220882438f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.92387953251128684951f,(float16_t)-0.38268343236508967076f,}; +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)-0.9951171875000f,(float16_t)-0.0980224609375f, +(float16_t)-0.9238281250000f,(float16_t)-0.3825683593750f, +(float16_t)-0.7729492187500f,(float16_t)-0.6342773437500f, +(float16_t)-0.5556640625000f,(float16_t)-0.8315429687500f, +(float16_t)-0.2902832031250f,(float16_t)-0.9570312500000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.9238281250000f,(float16_t)-0.3825683593750f,}; #endif @@ -158,262 +161,262 @@ uint32_t rearranged_twiddle_tab_stride3_arr_256_f16[4]={ 0,128,160,0,}; float16_t rearranged_twiddle_stride1_256_f16[168]={ -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99969881869620424997f,(float16_t)0.02454122852291228812f, -(float16_t)0.99879545620517240501f,(float16_t)0.04906767432741801493f, -(float16_t)0.99729045667869020697f,(float16_t)0.07356456359966742631f, -(float16_t)0.99518472667219692873f,(float16_t)0.09801714032956060363f, -(float16_t)0.99247953459870996706f,(float16_t)0.12241067519921619566f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.98527764238894122162f,(float16_t)0.17096188876030121717f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.97570213003852857003f,(float16_t)0.21910124015686979759f, -(float16_t)0.97003125319454397424f,(float16_t)0.24298017990326387094f, -(float16_t)0.96377606579543984022f,(float16_t)0.26671275747489836538f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.94952818059303667475f,(float16_t)0.31368174039889151761f, -(float16_t)0.94154406518302080631f,(float16_t)0.33688985339222005111f, -(float16_t)0.93299279883473895669f,(float16_t)0.35989503653498811087f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.91420975570353069095f,(float16_t)0.40524131400498986100f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.89322430119551532446f,(float16_t)0.44961132965460653965f, -(float16_t)0.88192126434835504956f,(float16_t)0.47139673682599764204f, -(float16_t)0.87008699110871146054f,(float16_t)0.49289819222978403790f, -(float16_t)0.85772861000027211809f,(float16_t)0.51410274419322166128f, -(float16_t)0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.81758481315158371139f,(float16_t)0.57580819141784533866f, -(float16_t)0.80320753148064494287f,(float16_t)0.59569930449243335691f, -(float16_t)0.78834642762660622761f,(float16_t)0.61523159058062681925f, -(float16_t)0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)0.75720884650648456748f,(float16_t)0.65317284295377675551f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.72424708295146700276f,(float16_t)0.68954054473706682948f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)0.67155895484701833009f,(float16_t)0.74095112535495910588f, -(float16_t)0.65317284295377686654f,(float16_t)0.75720884650648456748f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.61523159058062681925f,(float16_t)0.78834642762660622761f, -(float16_t)0.59569930449243346793f,(float16_t)0.80320753148064483184f, -(float16_t)0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.53499761988709726435f,(float16_t)0.84485356524970700587f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.49289819222978409341f,(float16_t)0.87008699110871134952f, -(float16_t)0.47139673682599780857f,(float16_t)0.88192126434835493853f, -(float16_t)0.44961132965460659516f,(float16_t)0.89322430119551532446f, -(float16_t)0.42755509343028219593f,(float16_t)0.90398929312344333820f, -(float16_t)0.40524131400498986100f,(float16_t)0.91420975570353069095f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.35989503653498827740f,(float16_t)0.93299279883473884567f, -(float16_t)0.33688985339222005111f,(float16_t)0.94154406518302080631f, -(float16_t)0.31368174039889157312f,(float16_t)0.94952818059303667475f, -(float16_t)0.29028467725446233105f,(float16_t)0.95694033573220893540f, -(float16_t)0.26671275747489842090f,(float16_t)0.96377606579543984022f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.21910124015686976984f,(float16_t)0.97570213003852857003f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.17096188876030135595f,(float16_t)0.98527764238894122162f, -(float16_t)0.14673047445536174793f,(float16_t)0.98917650996478101444f, -(float16_t)0.12241067519921627893f,(float16_t)0.99247953459870996706f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.07356456359966745406f,(float16_t)0.99729045667869020697f, -(float16_t)0.04906767432741812596f,(float16_t)0.99879545620517240501f, -(float16_t)0.02454122852291226384f,(float16_t)0.99969881869620424997f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99518472667219692873f,(float16_t)0.09801714032956060363f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.88192126434835504956f,(float16_t)0.47139673682599764204f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.47139673682599780857f,(float16_t)0.88192126434835493853f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.29028467725446233105f,(float16_t)0.95694033573220893540f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f,}; +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9995117187500f,(float16_t)0.0245361328125f, +(float16_t)0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9853515625000f,(float16_t)0.1710205078125f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9497070312500f,(float16_t)0.3137207031250f, +(float16_t)0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.8930664062500f,(float16_t)0.4497070312500f, +(float16_t)0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.8173828125000f,(float16_t)0.5756835937500f, +(float16_t)0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.7241210937500f,(float16_t)0.6894531250000f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.6152343750000f,(float16_t)0.7885742187500f, +(float16_t)0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.4929199218750f,(float16_t)0.8701171875000f, +(float16_t)0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3598632812500f,(float16_t)0.9331054687500f, +(float16_t)0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.2191162109375f,(float16_t)0.9755859375000f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0735473632812f,(float16_t)0.9970703125000f, +(float16_t)0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f,}; float16_t rearranged_twiddle_stride2_256_f16[168]={ -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99879545620517240501f,(float16_t)0.04906767432741801493f, -(float16_t)0.99518472667219692873f,(float16_t)0.09801714032956060363f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.97003125319454397424f,(float16_t)0.24298017990326387094f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.94154406518302080631f,(float16_t)0.33688985339222005111f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.88192126434835504956f,(float16_t)0.47139673682599764204f, -(float16_t)0.85772861000027211809f,(float16_t)0.51410274419322166128f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.80320753148064494287f,(float16_t)0.59569930449243335691f, -(float16_t)0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.67155895484701833009f,(float16_t)0.74095112535495910588f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.59569930449243346793f,(float16_t)0.80320753148064483184f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.47139673682599780857f,(float16_t)0.88192126434835493853f, -(float16_t)0.42755509343028219593f,(float16_t)0.90398929312344333820f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.33688985339222005111f,(float16_t)0.94154406518302080631f, -(float16_t)0.29028467725446233105f,(float16_t)0.95694033573220893540f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.14673047445536174793f,(float16_t)0.98917650996478101444f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.04906767432741812596f,(float16_t)0.99879545620517240501f, -(float16_t)0.00000000000000006123f,(float16_t)1.00000000000000000000f, -(float16_t)-0.04906767432741800800f,(float16_t)0.99879545620517240501f, -(float16_t)-0.09801714032956064526f,(float16_t)0.99518472667219692873f, -(float16_t)-0.14673047445536163691f,(float16_t)0.98917650996478101444f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.24298017990326387094f,(float16_t)0.97003125319454397424f, -(float16_t)-0.29028467725446216452f,(float16_t)0.95694033573220893540f, -(float16_t)-0.33688985339221994009f,(float16_t)0.94154406518302080631f, -(float16_t)-0.38268343236508972627f,(float16_t)0.92387953251128673848f, -(float16_t)-0.42755509343028186287f,(float16_t)0.90398929312344344922f, -(float16_t)-0.47139673682599769755f,(float16_t)0.88192126434835504956f, -(float16_t)-0.51410274419322155026f,(float16_t)0.85772861000027211809f, -(float16_t)-0.55557023301960195560f,(float16_t)0.83146961230254534669f, -(float16_t)-0.59569930449243335691f,(float16_t)0.80320753148064494287f, -(float16_t)-0.63439328416364537677f,(float16_t)0.77301045336273710440f, -(float16_t)-0.67155895484701844111f,(float16_t)0.74095112535495899486f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.74095112535495888384f,(float16_t)0.67155895484701855214f, -(float16_t)-0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)-0.80320753148064483184f,(float16_t)0.59569930449243346793f, -(float16_t)-0.83146961230254534669f,(float16_t)0.55557023301960217765f, -(float16_t)-0.85772861000027200706f,(float16_t)0.51410274419322177231f, -(float16_t)-0.88192126434835493853f,(float16_t)0.47139673682599780857f, -(float16_t)-0.90398929312344333820f,(float16_t)0.42755509343028202940f, -(float16_t)-0.92387953251128673848f,(float16_t)0.38268343236508989280f, -(float16_t)-0.94154406518302069529f,(float16_t)0.33688985339222032867f, -(float16_t)-0.95694033573220882438f,(float16_t)0.29028467725446238656f, -(float16_t)-0.97003125319454397424f,(float16_t)0.24298017990326406523f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)-0.98917650996478101444f,(float16_t)0.14673047445536180344f, -(float16_t)-0.99518472667219681771f,(float16_t)0.09801714032956082567f, -(float16_t)-0.99879545620517240501f,(float16_t)0.04906767432741796636f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.00000000000000006123f,(float16_t)1.00000000000000000000f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.38268343236508972627f,(float16_t)0.92387953251128673848f, -(float16_t)-0.55557023301960195560f,(float16_t)0.83146961230254534669f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.83146961230254534669f,(float16_t)0.55557023301960217765f, -(float16_t)-0.92387953251128673848f,(float16_t)0.38268343236508989280f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.00000000000000006123f,(float16_t)1.00000000000000000000f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f,}; +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)0.0000000000000f,(float16_t)1.0000000000000f, +(float16_t)-0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)-0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)-0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)-0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)-0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)-0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)-0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)-0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)-0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)-0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)-0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)-0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)-0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)-0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)-0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)-0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)-0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)-0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)-0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)-0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)-0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)-0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)-0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)-0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)-0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)-0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.0000000000000f,(float16_t)1.0000000000000f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)-0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)-0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.0000000000000f,(float16_t)1.0000000000000f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f,}; float16_t rearranged_twiddle_stride3_256_f16[168]={ -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99729045667869020697f,(float16_t)0.07356456359966742631f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.97570213003852857003f,(float16_t)0.21910124015686979759f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.93299279883473895669f,(float16_t)0.35989503653498811087f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.87008699110871146054f,(float16_t)0.49289819222978403790f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.78834642762660622761f,(float16_t)0.61523159058062681925f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.44961132965460659516f,(float16_t)0.89322430119551532446f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.31368174039889157312f,(float16_t)0.94952818059303667475f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.17096188876030135595f,(float16_t)0.98527764238894122162f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.02454122852291226384f,(float16_t)0.99969881869620424997f, -(float16_t)-0.04906767432741800800f,(float16_t)0.99879545620517240501f, -(float16_t)-0.12241067519921615403f,(float16_t)0.99247953459870996706f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.26671275747489830987f,(float16_t)0.96377606579543984022f, -(float16_t)-0.33688985339221994009f,(float16_t)0.94154406518302080631f, -(float16_t)-0.40524131400498974998f,(float16_t)0.91420975570353069095f, -(float16_t)-0.47139673682599769755f,(float16_t)0.88192126434835504956f, -(float16_t)-0.53499761988709704230f,(float16_t)0.84485356524970722791f, -(float16_t)-0.59569930449243335691f,(float16_t)0.80320753148064494287f, -(float16_t)-0.65317284295377653347f,(float16_t)0.75720884650648467851f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.75720884650648467851f,(float16_t)0.65317284295377664449f, -(float16_t)-0.80320753148064483184f,(float16_t)0.59569930449243346793f, -(float16_t)-0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)-0.88192126434835493853f,(float16_t)0.47139673682599780857f, -(float16_t)-0.91420975570353069095f,(float16_t)0.40524131400498991651f, -(float16_t)-0.94154406518302069529f,(float16_t)0.33688985339222032867f, -(float16_t)-0.96377606579543984022f,(float16_t)0.26671275747489847641f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)-0.99247953459870996706f,(float16_t)0.12241067519921634832f, -(float16_t)-0.99879545620517240501f,(float16_t)0.04906767432741796636f, -(float16_t)-0.99969881869620424997f,(float16_t)-0.02454122852291207996f, -(float16_t)-0.99518472667219692873f,(float16_t)-0.09801714032956058975f, -(float16_t)-0.98527764238894133264f,(float16_t)-0.17096188876030096737f, -(float16_t)-0.97003125319454397424f,(float16_t)-0.24298017990326381543f, -(float16_t)-0.94952818059303678577f,(float16_t)-0.31368174039889118454f, -(float16_t)-0.92387953251128684951f,(float16_t)-0.38268343236508967076f, -(float16_t)-0.89322430119551532446f,(float16_t)-0.44961132965460665067f, -(float16_t)-0.85772861000027211809f,(float16_t)-0.51410274419322155026f, -(float16_t)-0.81758481315158371139f,(float16_t)-0.57580819141784533866f, -(float16_t)-0.77301045336273710440f,(float16_t)-0.63439328416364526575f, -(float16_t)-0.72424708295146700276f,(float16_t)-0.68954054473706682948f, -(float16_t)-0.67155895484701866316f,(float16_t)-0.74095112535495888384f, -(float16_t)-0.61523159058062726334f,(float16_t)-0.78834642762660589455f, -(float16_t)-0.55557023301960217765f,(float16_t)-0.83146961230254523567f, -(float16_t)-0.49289819222978420443f,(float16_t)-0.87008699110871134952f, -(float16_t)-0.42755509343028247349f,(float16_t)-0.90398929312344311615f, -(float16_t)-0.35989503653498794433f,(float16_t)-0.93299279883473895669f, -(float16_t)-0.29028467725446244208f,(float16_t)-0.95694033573220882438f, -(float16_t)-0.21910124015687010290f,(float16_t)-0.97570213003852845901f, -(float16_t)-0.14673047445536230304f,(float16_t)-0.98917650996478090342f, -(float16_t)-0.07356456359966735692f,(float16_t)-0.99729045667869020697f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.47139673682599769755f,(float16_t)0.88192126434835504956f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.88192126434835493853f,(float16_t)0.47139673682599780857f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)-0.99518472667219692873f,(float16_t)-0.09801714032956058975f, -(float16_t)-0.92387953251128684951f,(float16_t)-0.38268343236508967076f, -(float16_t)-0.77301045336273710440f,(float16_t)-0.63439328416364526575f, -(float16_t)-0.55557023301960217765f,(float16_t)-0.83146961230254523567f, -(float16_t)-0.29028467725446244208f,(float16_t)-0.95694033573220882438f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.92387953251128684951f,(float16_t)-0.38268343236508967076f,}; +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)-0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)-0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)-0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)-0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)-0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)-0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)-0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)-0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)-0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)-0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)-0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)-0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)-0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)-0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)-0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)-0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)-0.9995117187500f,(float16_t)-0.0245361328125f, +(float16_t)-0.9951171875000f,(float16_t)-0.0980224609375f, +(float16_t)-0.9853515625000f,(float16_t)-0.1710205078125f, +(float16_t)-0.9702148437500f,(float16_t)-0.2429199218750f, +(float16_t)-0.9497070312500f,(float16_t)-0.3137207031250f, +(float16_t)-0.9238281250000f,(float16_t)-0.3825683593750f, +(float16_t)-0.8930664062500f,(float16_t)-0.4497070312500f, +(float16_t)-0.8579101562500f,(float16_t)-0.5141601562500f, +(float16_t)-0.8173828125000f,(float16_t)-0.5756835937500f, +(float16_t)-0.7729492187500f,(float16_t)-0.6342773437500f, +(float16_t)-0.7241210937500f,(float16_t)-0.6894531250000f, +(float16_t)-0.6713867187500f,(float16_t)-0.7407226562500f, +(float16_t)-0.6152343750000f,(float16_t)-0.7885742187500f, +(float16_t)-0.5556640625000f,(float16_t)-0.8315429687500f, +(float16_t)-0.4929199218750f,(float16_t)-0.8701171875000f, +(float16_t)-0.4274902343750f,(float16_t)-0.9038085937500f, +(float16_t)-0.3598632812500f,(float16_t)-0.9331054687500f, +(float16_t)-0.2902832031250f,(float16_t)-0.9570312500000f, +(float16_t)-0.2191162109375f,(float16_t)-0.9755859375000f, +(float16_t)-0.1467285156250f,(float16_t)-0.9892578125000f, +(float16_t)-0.0735473632812f,(float16_t)-0.9970703125000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)-0.9951171875000f,(float16_t)-0.0980224609375f, +(float16_t)-0.9238281250000f,(float16_t)-0.3825683593750f, +(float16_t)-0.7729492187500f,(float16_t)-0.6342773437500f, +(float16_t)-0.5556640625000f,(float16_t)-0.8315429687500f, +(float16_t)-0.2902832031250f,(float16_t)-0.9570312500000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.9238281250000f,(float16_t)-0.3825683593750f,}; #endif @@ -429,1030 +432,1030 @@ uint32_t rearranged_twiddle_tab_stride3_arr_1024_f16[5]={ 0,512,640,672,0,}; float16_t rearranged_twiddle_stride1_1024_f16[680]={ -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99998117528260110909f,(float16_t)0.00613588464915447527f, -(float16_t)0.99992470183914450299f,(float16_t)0.01227153828571992539f, -(float16_t)0.99983058179582340319f,(float16_t)0.01840672990580482019f, -(float16_t)0.99969881869620424997f,(float16_t)0.02454122852291228812f, -(float16_t)0.99952941750109314256f,(float16_t)0.03067480317663662595f, -(float16_t)0.99932238458834954375f,(float16_t)0.03680722294135883171f, -(float16_t)0.99907772775264536147f,(float16_t)0.04293825693494082024f, -(float16_t)0.99879545620517240501f,(float16_t)0.04906767432741801493f, -(float16_t)0.99847558057329477421f,(float16_t)0.05519524434968993420f, -(float16_t)0.99811811290014917919f,(float16_t)0.06132073630220857829f, -(float16_t)0.99772306664419163624f,(float16_t)0.06744391956366405094f, -(float16_t)0.99729045667869020697f,(float16_t)0.07356456359966742631f, -(float16_t)0.99682029929116566791f,(float16_t)0.07968243797143012563f, -(float16_t)0.99631261218277800129f,(float16_t)0.08579731234443989385f, -(float16_t)0.99576741446765981713f,(float16_t)0.09190895649713272386f, -(float16_t)0.99518472667219692873f,(float16_t)0.09801714032956060363f, -(float16_t)0.99456457073425541537f,(float16_t)0.10412163387205458642f, -(float16_t)0.99390697000235606051f,(float16_t)0.11022220729388305938f, -(float16_t)0.99321194923479450001f,(float16_t)0.11631863091190475235f, -(float16_t)0.99247953459870996706f,(float16_t)0.12241067519921619566f, -(float16_t)0.99170975366909952520f,(float16_t)0.12849811079379316880f, -(float16_t)0.99090263542778000971f,(float16_t)0.13458070850712616773f, -(float16_t)0.99005821026229712256f,(float16_t)0.14065823933284921088f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.98825756773074946437f,(float16_t)0.15279718525844343535f, -(float16_t)0.98730141815785843473f,(float16_t)0.15885814333386144570f, -(float16_t)0.98630809724459866938f,(float16_t)0.16491312048996989437f, -(float16_t)0.98527764238894122162f,(float16_t)0.17096188876030121717f, -(float16_t)0.98421009238692902521f,(float16_t)0.17700422041214874946f, -(float16_t)0.98310548743121628501f,(float16_t)0.18303988795514095078f, -(float16_t)0.98196386910955524296f,(float16_t)0.18906866414980619262f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.97956976568544051887f,(float16_t)0.20110463484209190055f, -(float16_t)0.97831737071962765473f,(float16_t)0.20711137619221856032f, -(float16_t)0.97702814265775439484f,(float16_t)0.21311031991609136194f, -(float16_t)0.97570213003852857003f,(float16_t)0.21910124015686979759f, -(float16_t)0.97433938278557585821f,(float16_t)0.22508391135979283204f, -(float16_t)0.97293995220556017678f,(float16_t)0.23105810828067110951f, -(float16_t)0.97150389098625178352f,(float16_t)0.23702360599436719801f, -(float16_t)0.97003125319454397424f,(float16_t)0.24298017990326387094f, -(float16_t)0.96852209427441737777f,(float16_t)0.24892760574572014853f, -(float16_t)0.96697647104485207059f,(float16_t)0.25486565960451457169f, -(float16_t)0.96539444169768939830f,(float16_t)0.26079411791527551401f, -(float16_t)0.96377606579543984022f,(float16_t)0.26671275747489836538f, -(float16_t)0.96212140426904158019f,(float16_t)0.27262135544994897662f, -(float16_t)0.96043051941556578655f,(float16_t)0.27851968938505305973f, -(float16_t)0.95870347489587159906f,(float16_t)0.28440753721127187692f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.95514116830577078243f,(float16_t)0.29615088824362378883f, -(float16_t)0.95330604035419386211f,(float16_t)0.30200594931922808417f, -(float16_t)0.95143502096900833820f,(float16_t)0.30784964004153486661f, -(float16_t)0.94952818059303667475f,(float16_t)0.31368174039889151761f, -(float16_t)0.94758559101774109124f,(float16_t)0.31950203081601569188f, -(float16_t)0.94560732538052127971f,(float16_t)0.32531029216226292622f, -(float16_t)0.94359345816196038559f,(float16_t)0.33110630575987642921f, -(float16_t)0.94154406518302080631f,(float16_t)0.33688985339222005111f, -(float16_t)0.93945922360218991898f,(float16_t)0.34266071731199437833f, -(float16_t)0.93733901191257495977f,(float16_t)0.34841868024943456472f, -(float16_t)0.93518350993894761025f,(float16_t)0.35416352542049034380f, -(float16_t)0.93299279883473895669f,(float16_t)0.35989503653498811087f, -(float16_t)0.93076696107898371224f,(float16_t)0.36561299780477385379f, -(float16_t)0.92850608047321558924f,(float16_t)0.37131719395183754306f, -(float16_t)0.92621024213831137928f,(float16_t)0.37700741021641825945f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.92151403934204190183f,(float16_t)0.38834504669882624617f, -(float16_t)0.91911385169005777040f,(float16_t)0.39399204006104809883f, -(float16_t)0.91667905992104270485f,(float16_t)0.39962419984564678810f, -(float16_t)0.91420975570353069095f,(float16_t)0.40524131400498986100f, -(float16_t)0.91170603200542987832f,(float16_t)0.41084317105790391089f, -(float16_t)0.90916798309052238025f,(float16_t)0.41642956009763715253f, -(float16_t)0.90659570451491533483f,(float16_t)0.42200027079979968159f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.90134884704602202810f,(float16_t)0.43309381885315195726f, -(float16_t)0.89867446569395381673f,(float16_t)0.43861623853852765853f, -(float16_t)0.89596624975618521791f,(float16_t)0.44412214457042920035f, -(float16_t)0.89322430119551532446f,(float16_t)0.44961132965460653965f, -(float16_t)0.89044872324475787817f,(float16_t)0.45508358712634383592f, -(float16_t)0.88763962040285393496f,(float16_t)0.46053871095824000514f, -(float16_t)0.88479709843093778954f,(float16_t)0.46597649576796618121f, -(float16_t)0.88192126434835504956f,(float16_t)0.47139673682599764204f, -(float16_t)0.87901222642863352519f,(float16_t)0.47679923006332208812f, -(float16_t)0.87607009419540660122f,(float16_t)0.48218377207912271887f, -(float16_t)0.87309497841829009079f,(float16_t)0.48755016014843599592f, -(float16_t)0.87008699110871146054f,(float16_t)0.49289819222978403790f, -(float16_t)0.86704624551569264845f,(float16_t)0.49822766697278181303f, -(float16_t)0.86397285612158669643f,(float16_t)0.50353838372571757542f, -(float16_t)0.86086693863776730939f,(float16_t)0.50883014254310698909f, -(float16_t)0.85772861000027211809f,(float16_t)0.51410274419322166128f, -(float16_t)0.85455798836540053376f,(float16_t)0.51935599016558964269f, -(float16_t)0.85135519310526519554f,(float16_t)0.52458968267846894928f, -(float16_t)0.84812034480329723252f,(float16_t)0.52980362468629460526f, -(float16_t)0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)0.84155497743689844370f,(float16_t)0.54017147272989285423f, -(float16_t)0.83822470555483807875f,(float16_t)0.54532498842204646383f, -(float16_t)0.83486287498638001026f,(float16_t)0.55045797293660481131f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.82804504525775579626f,(float16_t)0.56066157619733603124f, -(float16_t)0.82458930278502529099f,(float16_t)0.56573181078361312046f, -(float16_t)0.82110251499110464835f,(float16_t)0.57078074588696725566f, -(float16_t)0.81758481315158371139f,(float16_t)0.57580819141784533866f, -(float16_t)0.81403632970594841378f,(float16_t)0.58081395809576452649f, -(float16_t)0.81045719825259476821f,(float16_t)0.58579785745643886408f, -(float16_t)0.80684755354379933401f,(float16_t)0.59075970185887416442f, -(float16_t)0.80320753148064494287f,(float16_t)0.59569930449243335691f, -(float16_t)0.79953726910790501314f,(float16_t)0.60061647938386897305f, -(float16_t)0.79583690460888356633f,(float16_t)0.60551104140432554512f, -(float16_t)0.79210657730021238887f,(float16_t)0.61038280627630947528f, -(float16_t)0.78834642762660622761f,(float16_t)0.61523159058062681925f, -(float16_t)0.78455659715557524159f,(float16_t)0.62005721176328909561f, -(float16_t)0.78073722857209448822f,(float16_t)0.62485948814238634341f, -(float16_t)0.77688846567323244230f,(float16_t)0.62963823891492698426f, -(float16_t)0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)0.76910333764557969882f,(float16_t)0.63912444486377573138f, -(float16_t)0.76516726562245895860f,(float16_t)0.64383154288979138613f, -(float16_t)0.76120238548426177871f,(float16_t)0.64851440102211244110f, -(float16_t)0.75720884650648456748f,(float16_t)0.65317284295377675551f, -(float16_t)0.75318679904361252042f,(float16_t)0.65780669329707863735f, -(float16_t)0.74913639452345937020f,(float16_t)0.66241577759017178373f, -(float16_t)0.74505778544146594733f,(float16_t)0.66699992230363747137f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.73681656887736979300f,(float16_t)0.67609270357531592310f, -(float16_t)0.73265427167241281570f,(float16_t)0.68060099779545302212f, -(float16_t)0.72846439044822519637f,(float16_t)0.68508366777270035541f, -(float16_t)0.72424708295146700276f,(float16_t)0.68954054473706682948f, -(float16_t)0.72000250796138165477f,(float16_t)0.69397146088965389055f, -(float16_t)0.71573082528381870571f,(float16_t)0.69837624940897280457f, -(float16_t)0.71143219574521643356f,(float16_t)0.70275474445722529993f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.70275474445722529993f,(float16_t)0.71143219574521643356f, -(float16_t)0.69837624940897291559f,(float16_t)0.71573082528381859468f, -(float16_t)0.69397146088965400157f,(float16_t)0.72000250796138165477f, -(float16_t)0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)0.68508366777270035541f,(float16_t)0.72846439044822519637f, -(float16_t)0.68060099779545302212f,(float16_t)0.73265427167241281570f, -(float16_t)0.67609270357531603413f,(float16_t)0.73681656887736979300f, -(float16_t)0.67155895484701833009f,(float16_t)0.74095112535495910588f, -(float16_t)0.66699992230363747137f,(float16_t)0.74505778544146594733f, -(float16_t)0.66241577759017178373f,(float16_t)0.74913639452345925918f, -(float16_t)0.65780669329707874837f,(float16_t)0.75318679904361252042f, -(float16_t)0.65317284295377686654f,(float16_t)0.75720884650648456748f, -(float16_t)0.64851440102211255212f,(float16_t)0.76120238548426177871f, -(float16_t)0.64383154288979149715f,(float16_t)0.76516726562245895860f, -(float16_t)0.63912444486377573138f,(float16_t)0.76910333764557958780f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.62963823891492709528f,(float16_t)0.77688846567323244230f, -(float16_t)0.62485948814238645443f,(float16_t)0.78073722857209448822f, -(float16_t)0.62005721176328920663f,(float16_t)0.78455659715557524159f, -(float16_t)0.61523159058062681925f,(float16_t)0.78834642762660622761f, -(float16_t)0.61038280627630947528f,(float16_t)0.79210657730021227785f, -(float16_t)0.60551104140432554512f,(float16_t)0.79583690460888345530f, -(float16_t)0.60061647938386897305f,(float16_t)0.79953726910790501314f, -(float16_t)0.59569930449243346793f,(float16_t)0.80320753148064483184f, -(float16_t)0.59075970185887427544f,(float16_t)0.80684755354379922299f, -(float16_t)0.58579785745643886408f,(float16_t)0.81045719825259476821f, -(float16_t)0.58081395809576452649f,(float16_t)0.81403632970594830276f, -(float16_t)0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)0.57078074588696736669f,(float16_t)0.82110251499110464835f, -(float16_t)0.56573181078361323149f,(float16_t)0.82458930278502529099f, -(float16_t)0.56066157619733603124f,(float16_t)0.82804504525775579626f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.55045797293660481131f,(float16_t)0.83486287498638001026f, -(float16_t)0.54532498842204646383f,(float16_t)0.83822470555483796772f, -(float16_t)0.54017147272989296525f,(float16_t)0.84155497743689833268f, -(float16_t)0.53499761988709726435f,(float16_t)0.84485356524970700587f, -(float16_t)0.52980362468629482731f,(float16_t)0.84812034480329712149f, -(float16_t)0.52458968267846883826f,(float16_t)0.85135519310526519554f, -(float16_t)0.51935599016558953167f,(float16_t)0.85455798836540053376f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.50883014254310698909f,(float16_t)0.86086693863776730939f, -(float16_t)0.50353838372571757542f,(float16_t)0.86397285612158669643f, -(float16_t)0.49822766697278186854f,(float16_t)0.86704624551569264845f, -(float16_t)0.49289819222978409341f,(float16_t)0.87008699110871134952f, -(float16_t)0.48755016014843605143f,(float16_t)0.87309497841829009079f, -(float16_t)0.48218377207912282989f,(float16_t)0.87607009419540660122f, -(float16_t)0.47679923006332225466f,(float16_t)0.87901222642863341417f, -(float16_t)0.47139673682599780857f,(float16_t)0.88192126434835493853f, -(float16_t)0.46597649576796612569f,(float16_t)0.88479709843093778954f, -(float16_t)0.46053871095824000514f,(float16_t)0.88763962040285393496f, -(float16_t)0.45508358712634383592f,(float16_t)0.89044872324475787817f, -(float16_t)0.44961132965460659516f,(float16_t)0.89322430119551532446f, -(float16_t)0.44412214457042925586f,(float16_t)0.89596624975618510689f, -(float16_t)0.43861623853852771404f,(float16_t)0.89867446569395381673f, -(float16_t)0.43309381885315201277f,(float16_t)0.90134884704602202810f, -(float16_t)0.42755509343028219593f,(float16_t)0.90398929312344333820f, -(float16_t)0.42200027079979979261f,(float16_t)0.90659570451491533483f, -(float16_t)0.41642956009763731906f,(float16_t)0.90916798309052226923f, -(float16_t)0.41084317105790391089f,(float16_t)0.91170603200542987832f, -(float16_t)0.40524131400498986100f,(float16_t)0.91420975570353069095f, -(float16_t)0.39962419984564678810f,(float16_t)0.91667905992104270485f, -(float16_t)0.39399204006104809883f,(float16_t)0.91911385169005777040f, -(float16_t)0.38834504669882630168f,(float16_t)0.92151403934204190183f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.37700741021641831496f,(float16_t)0.92621024213831126826f, -(float16_t)0.37131719395183759858f,(float16_t)0.92850608047321558924f, -(float16_t)0.36561299780477396482f,(float16_t)0.93076696107898371224f, -(float16_t)0.35989503653498827740f,(float16_t)0.93299279883473884567f, -(float16_t)0.35416352542049051033f,(float16_t)0.93518350993894749923f, -(float16_t)0.34841868024943450921f,(float16_t)0.93733901191257495977f, -(float16_t)0.34266071731199437833f,(float16_t)0.93945922360218991898f, -(float16_t)0.33688985339222005111f,(float16_t)0.94154406518302080631f, -(float16_t)0.33110630575987642921f,(float16_t)0.94359345816196038559f, -(float16_t)0.32531029216226298173f,(float16_t)0.94560732538052127971f, -(float16_t)0.31950203081601574739f,(float16_t)0.94758559101774109124f, -(float16_t)0.31368174039889157312f,(float16_t)0.94952818059303667475f, -(float16_t)0.30784964004153497763f,(float16_t)0.95143502096900833820f, -(float16_t)0.30200594931922819519f,(float16_t)0.95330604035419375109f, -(float16_t)0.29615088824362395536f,(float16_t)0.95514116830577067141f, -(float16_t)0.29028467725446233105f,(float16_t)0.95694033573220893540f, -(float16_t)0.28440753721127182141f,(float16_t)0.95870347489587159906f, -(float16_t)0.27851968938505305973f,(float16_t)0.96043051941556578655f, -(float16_t)0.27262135544994897662f,(float16_t)0.96212140426904158019f, -(float16_t)0.26671275747489842090f,(float16_t)0.96377606579543984022f, -(float16_t)0.26079411791527556952f,(float16_t)0.96539444169768939830f, -(float16_t)0.25486565960451462720f,(float16_t)0.96697647104485207059f, -(float16_t)0.24892760574572025956f,(float16_t)0.96852209427441726675f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.23702360599436733679f,(float16_t)0.97150389098625178352f, -(float16_t)0.23105810828067127605f,(float16_t)0.97293995220556006576f, -(float16_t)0.22508391135979277653f,(float16_t)0.97433938278557585821f, -(float16_t)0.21910124015686976984f,(float16_t)0.97570213003852857003f, -(float16_t)0.21311031991609136194f,(float16_t)0.97702814265775439484f, -(float16_t)0.20711137619221856032f,(float16_t)0.97831737071962765473f, -(float16_t)0.20110463484209195606f,(float16_t)0.97956976568544051887f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.18906866414980627589f,(float16_t)0.98196386910955524296f, -(float16_t)0.18303988795514106180f,(float16_t)0.98310548743121628501f, -(float16_t)0.17700422041214886049f,(float16_t)0.98421009238692902521f, -(float16_t)0.17096188876030135595f,(float16_t)0.98527764238894122162f, -(float16_t)0.16491312048997008866f,(float16_t)0.98630809724459866938f, -(float16_t)0.15885814333386139019f,(float16_t)0.98730141815785843473f, -(float16_t)0.15279718525844340760f,(float16_t)0.98825756773074946437f, -(float16_t)0.14673047445536174793f,(float16_t)0.98917650996478101444f, -(float16_t)0.14065823933284923863f,(float16_t)0.99005821026229712256f, -(float16_t)0.13458070850712622324f,(float16_t)0.99090263542778000971f, -(float16_t)0.12849811079379322432f,(float16_t)0.99170975366909952520f, -(float16_t)0.12241067519921627893f,(float16_t)0.99247953459870996706f, -(float16_t)0.11631863091190487725f,(float16_t)0.99321194923479450001f, -(float16_t)0.11022220729388318428f,(float16_t)0.99390697000235606051f, -(float16_t)0.10412163387205472520f,(float16_t)0.99456457073425541537f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.09190895649713269611f,(float16_t)0.99576741446765981713f, -(float16_t)0.08579731234443987997f,(float16_t)0.99631261218277800129f, -(float16_t)0.07968243797143012563f,(float16_t)0.99682029929116566791f, -(float16_t)0.07356456359966745406f,(float16_t)0.99729045667869020697f, -(float16_t)0.06744391956366410645f,(float16_t)0.99772306664419163624f, -(float16_t)0.06132073630220864768f,(float16_t)0.99811811290014917919f, -(float16_t)0.05519524434969003135f,(float16_t)0.99847558057329477421f, -(float16_t)0.04906767432741812596f,(float16_t)0.99879545620517240501f, -(float16_t)0.04293825693494095902f,(float16_t)0.99907772775264536147f, -(float16_t)0.03680722294135899131f,(float16_t)0.99932238458834954375f, -(float16_t)0.03067480317663658085f,(float16_t)0.99952941750109314256f, -(float16_t)0.02454122852291226384f,(float16_t)0.99969881869620424997f, -(float16_t)0.01840672990580482019f,(float16_t)0.99983058179582340319f, -(float16_t)0.01227153828571994447f,(float16_t)0.99992470183914450299f, -(float16_t)0.00613588464915451517f,(float16_t)0.99998117528260110909f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99969881869620424997f,(float16_t)0.02454122852291228812f, -(float16_t)0.99879545620517240501f,(float16_t)0.04906767432741801493f, -(float16_t)0.99729045667869020697f,(float16_t)0.07356456359966742631f, -(float16_t)0.99518472667219692873f,(float16_t)0.09801714032956060363f, -(float16_t)0.99247953459870996706f,(float16_t)0.12241067519921619566f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.98527764238894122162f,(float16_t)0.17096188876030121717f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.97570213003852857003f,(float16_t)0.21910124015686979759f, -(float16_t)0.97003125319454397424f,(float16_t)0.24298017990326387094f, -(float16_t)0.96377606579543984022f,(float16_t)0.26671275747489836538f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.94952818059303667475f,(float16_t)0.31368174039889151761f, -(float16_t)0.94154406518302080631f,(float16_t)0.33688985339222005111f, -(float16_t)0.93299279883473895669f,(float16_t)0.35989503653498811087f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.91420975570353069095f,(float16_t)0.40524131400498986100f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.89322430119551532446f,(float16_t)0.44961132965460653965f, -(float16_t)0.88192126434835504956f,(float16_t)0.47139673682599764204f, -(float16_t)0.87008699110871146054f,(float16_t)0.49289819222978403790f, -(float16_t)0.85772861000027211809f,(float16_t)0.51410274419322166128f, -(float16_t)0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.81758481315158371139f,(float16_t)0.57580819141784533866f, -(float16_t)0.80320753148064494287f,(float16_t)0.59569930449243335691f, -(float16_t)0.78834642762660622761f,(float16_t)0.61523159058062681925f, -(float16_t)0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)0.75720884650648456748f,(float16_t)0.65317284295377675551f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.72424708295146700276f,(float16_t)0.68954054473706682948f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)0.67155895484701833009f,(float16_t)0.74095112535495910588f, -(float16_t)0.65317284295377686654f,(float16_t)0.75720884650648456748f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.61523159058062681925f,(float16_t)0.78834642762660622761f, -(float16_t)0.59569930449243346793f,(float16_t)0.80320753148064483184f, -(float16_t)0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.53499761988709726435f,(float16_t)0.84485356524970700587f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.49289819222978409341f,(float16_t)0.87008699110871134952f, -(float16_t)0.47139673682599780857f,(float16_t)0.88192126434835493853f, -(float16_t)0.44961132965460659516f,(float16_t)0.89322430119551532446f, -(float16_t)0.42755509343028219593f,(float16_t)0.90398929312344333820f, -(float16_t)0.40524131400498986100f,(float16_t)0.91420975570353069095f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.35989503653498827740f,(float16_t)0.93299279883473884567f, -(float16_t)0.33688985339222005111f,(float16_t)0.94154406518302080631f, -(float16_t)0.31368174039889157312f,(float16_t)0.94952818059303667475f, -(float16_t)0.29028467725446233105f,(float16_t)0.95694033573220893540f, -(float16_t)0.26671275747489842090f,(float16_t)0.96377606579543984022f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.21910124015686976984f,(float16_t)0.97570213003852857003f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.17096188876030135595f,(float16_t)0.98527764238894122162f, -(float16_t)0.14673047445536174793f,(float16_t)0.98917650996478101444f, -(float16_t)0.12241067519921627893f,(float16_t)0.99247953459870996706f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.07356456359966745406f,(float16_t)0.99729045667869020697f, -(float16_t)0.04906767432741812596f,(float16_t)0.99879545620517240501f, -(float16_t)0.02454122852291226384f,(float16_t)0.99969881869620424997f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99518472667219692873f,(float16_t)0.09801714032956060363f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.88192126434835504956f,(float16_t)0.47139673682599764204f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.47139673682599780857f,(float16_t)0.88192126434835493853f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.29028467725446233105f,(float16_t)0.95694033573220893540f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f,}; +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)1.0000000000000f,(float16_t)0.0061340332031f, +(float16_t)1.0000000000000f,(float16_t)0.0122680664062f, +(float16_t)1.0000000000000f,(float16_t)0.0184020996094f, +(float16_t)0.9995117187500f,(float16_t)0.0245361328125f, +(float16_t)0.9995117187500f,(float16_t)0.0306701660156f, +(float16_t)0.9995117187500f,(float16_t)0.0368041992188f, +(float16_t)0.9990234375000f,(float16_t)0.0429382324219f, +(float16_t)0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)0.9985351562500f,(float16_t)0.0552062988281f, +(float16_t)0.9980468750000f,(float16_t)0.0613098144531f, +(float16_t)0.9975585937500f,(float16_t)0.0674438476562f, +(float16_t)0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)0.9965820312500f,(float16_t)0.0797119140625f, +(float16_t)0.9960937500000f,(float16_t)0.0858154296875f, +(float16_t)0.9956054687500f,(float16_t)0.0919189453125f, +(float16_t)0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)0.9946289062500f,(float16_t)0.1041259765625f, +(float16_t)0.9941406250000f,(float16_t)0.1102294921875f, +(float16_t)0.9931640625000f,(float16_t)0.1163330078125f, +(float16_t)0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)0.9916992187500f,(float16_t)0.1285400390625f, +(float16_t)0.9907226562500f,(float16_t)0.1345214843750f, +(float16_t)0.9902343750000f,(float16_t)0.1406250000000f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9882812500000f,(float16_t)0.1528320312500f, +(float16_t)0.9873046875000f,(float16_t)0.1588134765625f, +(float16_t)0.9863281250000f,(float16_t)0.1649169921875f, +(float16_t)0.9853515625000f,(float16_t)0.1710205078125f, +(float16_t)0.9843750000000f,(float16_t)0.1770019531250f, +(float16_t)0.9829101562500f,(float16_t)0.1829833984375f, +(float16_t)0.9819335937500f,(float16_t)0.1890869140625f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9794921875000f,(float16_t)0.2010498046875f, +(float16_t)0.9785156250000f,(float16_t)0.2071533203125f, +(float16_t)0.9770507812500f,(float16_t)0.2131347656250f, +(float16_t)0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)0.9741210937500f,(float16_t)0.2250976562500f, +(float16_t)0.9731445312500f,(float16_t)0.2310791015625f, +(float16_t)0.9716796875000f,(float16_t)0.2370605468750f, +(float16_t)0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)0.9687500000000f,(float16_t)0.2489013671875f, +(float16_t)0.9667968750000f,(float16_t)0.2548828125000f, +(float16_t)0.9653320312500f,(float16_t)0.2607421875000f, +(float16_t)0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)0.9619140625000f,(float16_t)0.2727050781250f, +(float16_t)0.9604492187500f,(float16_t)0.2785644531250f, +(float16_t)0.9584960937500f,(float16_t)0.2844238281250f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9550781250000f,(float16_t)0.2961425781250f, +(float16_t)0.9531250000000f,(float16_t)0.3020019531250f, +(float16_t)0.9516601562500f,(float16_t)0.3078613281250f, +(float16_t)0.9497070312500f,(float16_t)0.3137207031250f, +(float16_t)0.9477539062500f,(float16_t)0.3195800781250f, +(float16_t)0.9458007812500f,(float16_t)0.3251953125000f, +(float16_t)0.9433593750000f,(float16_t)0.3310546875000f, +(float16_t)0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)0.9394531250000f,(float16_t)0.3427734375000f, +(float16_t)0.9375000000000f,(float16_t)0.3483886718750f, +(float16_t)0.9350585937500f,(float16_t)0.3542480468750f, +(float16_t)0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)0.9306640625000f,(float16_t)0.3657226562500f, +(float16_t)0.9287109375000f,(float16_t)0.3713378906250f, +(float16_t)0.9262695312500f,(float16_t)0.3769531250000f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.9213867187500f,(float16_t)0.3884277343750f, +(float16_t)0.9189453125000f,(float16_t)0.3940429687500f, +(float16_t)0.9165039062500f,(float16_t)0.3996582031250f, +(float16_t)0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)0.9116210937500f,(float16_t)0.4108886718750f, +(float16_t)0.9091796875000f,(float16_t)0.4165039062500f, +(float16_t)0.9067382812500f,(float16_t)0.4221191406250f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.9013671875000f,(float16_t)0.4331054687500f, +(float16_t)0.8984375000000f,(float16_t)0.4387207031250f, +(float16_t)0.8959960937500f,(float16_t)0.4440917968750f, +(float16_t)0.8930664062500f,(float16_t)0.4497070312500f, +(float16_t)0.8906250000000f,(float16_t)0.4550781250000f, +(float16_t)0.8876953125000f,(float16_t)0.4604492187500f, +(float16_t)0.8847656250000f,(float16_t)0.4660644531250f, +(float16_t)0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)0.8789062500000f,(float16_t)0.4768066406250f, +(float16_t)0.8759765625000f,(float16_t)0.4821777343750f, +(float16_t)0.8730468750000f,(float16_t)0.4875488281250f, +(float16_t)0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)0.8671875000000f,(float16_t)0.4982910156250f, +(float16_t)0.8637695312500f,(float16_t)0.5034179687500f, +(float16_t)0.8608398437500f,(float16_t)0.5087890625000f, +(float16_t)0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)0.8544921875000f,(float16_t)0.5195312500000f, +(float16_t)0.8515625000000f,(float16_t)0.5244140625000f, +(float16_t)0.8481445312500f,(float16_t)0.5297851562500f, +(float16_t)0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)0.8417968750000f,(float16_t)0.5400390625000f, +(float16_t)0.8383789062500f,(float16_t)0.5454101562500f, +(float16_t)0.8349609375000f,(float16_t)0.5502929687500f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.8281250000000f,(float16_t)0.5605468750000f, +(float16_t)0.8247070312500f,(float16_t)0.5659179687500f, +(float16_t)0.8212890625000f,(float16_t)0.5708007812500f, +(float16_t)0.8173828125000f,(float16_t)0.5756835937500f, +(float16_t)0.8139648437500f,(float16_t)0.5810546875000f, +(float16_t)0.8105468750000f,(float16_t)0.5859375000000f, +(float16_t)0.8066406250000f,(float16_t)0.5908203125000f, +(float16_t)0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)0.7993164062500f,(float16_t)0.6005859375000f, +(float16_t)0.7958984375000f,(float16_t)0.6054687500000f, +(float16_t)0.7919921875000f,(float16_t)0.6103515625000f, +(float16_t)0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)0.7846679687500f,(float16_t)0.6201171875000f, +(float16_t)0.7807617187500f,(float16_t)0.6250000000000f, +(float16_t)0.7768554687500f,(float16_t)0.6293945312500f, +(float16_t)0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)0.7690429687500f,(float16_t)0.6391601562500f, +(float16_t)0.7651367187500f,(float16_t)0.6440429687500f, +(float16_t)0.7612304687500f,(float16_t)0.6484375000000f, +(float16_t)0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)0.7534179687500f,(float16_t)0.6577148437500f, +(float16_t)0.7490234375000f,(float16_t)0.6625976562500f, +(float16_t)0.7451171875000f,(float16_t)0.6669921875000f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.7368164062500f,(float16_t)0.6762695312500f, +(float16_t)0.7324218750000f,(float16_t)0.6806640625000f, +(float16_t)0.7285156250000f,(float16_t)0.6850585937500f, +(float16_t)0.7241210937500f,(float16_t)0.6894531250000f, +(float16_t)0.7202148437500f,(float16_t)0.6938476562500f, +(float16_t)0.7158203125000f,(float16_t)0.6982421875000f, +(float16_t)0.7114257812500f,(float16_t)0.7026367187500f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.7026367187500f,(float16_t)0.7114257812500f, +(float16_t)0.6982421875000f,(float16_t)0.7158203125000f, +(float16_t)0.6938476562500f,(float16_t)0.7202148437500f, +(float16_t)0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)0.6850585937500f,(float16_t)0.7285156250000f, +(float16_t)0.6806640625000f,(float16_t)0.7324218750000f, +(float16_t)0.6762695312500f,(float16_t)0.7368164062500f, +(float16_t)0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)0.6669921875000f,(float16_t)0.7451171875000f, +(float16_t)0.6625976562500f,(float16_t)0.7490234375000f, +(float16_t)0.6577148437500f,(float16_t)0.7534179687500f, +(float16_t)0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)0.6484375000000f,(float16_t)0.7612304687500f, +(float16_t)0.6440429687500f,(float16_t)0.7651367187500f, +(float16_t)0.6391601562500f,(float16_t)0.7690429687500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.6293945312500f,(float16_t)0.7768554687500f, +(float16_t)0.6250000000000f,(float16_t)0.7807617187500f, +(float16_t)0.6201171875000f,(float16_t)0.7846679687500f, +(float16_t)0.6152343750000f,(float16_t)0.7885742187500f, +(float16_t)0.6103515625000f,(float16_t)0.7919921875000f, +(float16_t)0.6054687500000f,(float16_t)0.7958984375000f, +(float16_t)0.6005859375000f,(float16_t)0.7993164062500f, +(float16_t)0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)0.5908203125000f,(float16_t)0.8066406250000f, +(float16_t)0.5859375000000f,(float16_t)0.8105468750000f, +(float16_t)0.5810546875000f,(float16_t)0.8139648437500f, +(float16_t)0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)0.5708007812500f,(float16_t)0.8212890625000f, +(float16_t)0.5659179687500f,(float16_t)0.8247070312500f, +(float16_t)0.5605468750000f,(float16_t)0.8281250000000f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.5502929687500f,(float16_t)0.8349609375000f, +(float16_t)0.5454101562500f,(float16_t)0.8383789062500f, +(float16_t)0.5400390625000f,(float16_t)0.8417968750000f, +(float16_t)0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)0.5297851562500f,(float16_t)0.8481445312500f, +(float16_t)0.5244140625000f,(float16_t)0.8515625000000f, +(float16_t)0.5195312500000f,(float16_t)0.8544921875000f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.5087890625000f,(float16_t)0.8608398437500f, +(float16_t)0.5034179687500f,(float16_t)0.8637695312500f, +(float16_t)0.4982910156250f,(float16_t)0.8671875000000f, +(float16_t)0.4929199218750f,(float16_t)0.8701171875000f, +(float16_t)0.4875488281250f,(float16_t)0.8730468750000f, +(float16_t)0.4821777343750f,(float16_t)0.8759765625000f, +(float16_t)0.4768066406250f,(float16_t)0.8789062500000f, +(float16_t)0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)0.4660644531250f,(float16_t)0.8847656250000f, +(float16_t)0.4604492187500f,(float16_t)0.8876953125000f, +(float16_t)0.4550781250000f,(float16_t)0.8906250000000f, +(float16_t)0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)0.4440917968750f,(float16_t)0.8959960937500f, +(float16_t)0.4387207031250f,(float16_t)0.8984375000000f, +(float16_t)0.4331054687500f,(float16_t)0.9013671875000f, +(float16_t)0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)0.4221191406250f,(float16_t)0.9067382812500f, +(float16_t)0.4165039062500f,(float16_t)0.9091796875000f, +(float16_t)0.4108886718750f,(float16_t)0.9116210937500f, +(float16_t)0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)0.3996582031250f,(float16_t)0.9165039062500f, +(float16_t)0.3940429687500f,(float16_t)0.9189453125000f, +(float16_t)0.3884277343750f,(float16_t)0.9213867187500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3769531250000f,(float16_t)0.9262695312500f, +(float16_t)0.3713378906250f,(float16_t)0.9287109375000f, +(float16_t)0.3657226562500f,(float16_t)0.9306640625000f, +(float16_t)0.3598632812500f,(float16_t)0.9331054687500f, +(float16_t)0.3542480468750f,(float16_t)0.9350585937500f, +(float16_t)0.3483886718750f,(float16_t)0.9375000000000f, +(float16_t)0.3427734375000f,(float16_t)0.9394531250000f, +(float16_t)0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)0.3310546875000f,(float16_t)0.9433593750000f, +(float16_t)0.3251953125000f,(float16_t)0.9458007812500f, +(float16_t)0.3195800781250f,(float16_t)0.9477539062500f, +(float16_t)0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)0.3078613281250f,(float16_t)0.9516601562500f, +(float16_t)0.3020019531250f,(float16_t)0.9531250000000f, +(float16_t)0.2961425781250f,(float16_t)0.9550781250000f, +(float16_t)0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)0.2844238281250f,(float16_t)0.9584960937500f, +(float16_t)0.2785644531250f,(float16_t)0.9604492187500f, +(float16_t)0.2727050781250f,(float16_t)0.9619140625000f, +(float16_t)0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)0.2607421875000f,(float16_t)0.9653320312500f, +(float16_t)0.2548828125000f,(float16_t)0.9667968750000f, +(float16_t)0.2489013671875f,(float16_t)0.9687500000000f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.2370605468750f,(float16_t)0.9716796875000f, +(float16_t)0.2310791015625f,(float16_t)0.9731445312500f, +(float16_t)0.2250976562500f,(float16_t)0.9741210937500f, +(float16_t)0.2191162109375f,(float16_t)0.9755859375000f, +(float16_t)0.2131347656250f,(float16_t)0.9770507812500f, +(float16_t)0.2071533203125f,(float16_t)0.9785156250000f, +(float16_t)0.2010498046875f,(float16_t)0.9794921875000f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.1890869140625f,(float16_t)0.9819335937500f, +(float16_t)0.1829833984375f,(float16_t)0.9829101562500f, +(float16_t)0.1770019531250f,(float16_t)0.9843750000000f, +(float16_t)0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)0.1649169921875f,(float16_t)0.9863281250000f, +(float16_t)0.1588134765625f,(float16_t)0.9873046875000f, +(float16_t)0.1528320312500f,(float16_t)0.9882812500000f, +(float16_t)0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)0.1406250000000f,(float16_t)0.9902343750000f, +(float16_t)0.1345214843750f,(float16_t)0.9907226562500f, +(float16_t)0.1285400390625f,(float16_t)0.9916992187500f, +(float16_t)0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)0.1163330078125f,(float16_t)0.9931640625000f, +(float16_t)0.1102294921875f,(float16_t)0.9941406250000f, +(float16_t)0.1041259765625f,(float16_t)0.9946289062500f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0919189453125f,(float16_t)0.9956054687500f, +(float16_t)0.0858154296875f,(float16_t)0.9960937500000f, +(float16_t)0.0797119140625f,(float16_t)0.9965820312500f, +(float16_t)0.0735473632812f,(float16_t)0.9970703125000f, +(float16_t)0.0674438476562f,(float16_t)0.9975585937500f, +(float16_t)0.0613098144531f,(float16_t)0.9980468750000f, +(float16_t)0.0552062988281f,(float16_t)0.9985351562500f, +(float16_t)0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)0.0429382324219f,(float16_t)0.9990234375000f, +(float16_t)0.0368041992188f,(float16_t)0.9995117187500f, +(float16_t)0.0306701660156f,(float16_t)0.9995117187500f, +(float16_t)0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)0.0184020996094f,(float16_t)1.0000000000000f, +(float16_t)0.0122680664062f,(float16_t)1.0000000000000f, +(float16_t)0.0061340332031f,(float16_t)1.0000000000000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9995117187500f,(float16_t)0.0245361328125f, +(float16_t)0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9853515625000f,(float16_t)0.1710205078125f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9497070312500f,(float16_t)0.3137207031250f, +(float16_t)0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.8930664062500f,(float16_t)0.4497070312500f, +(float16_t)0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.8173828125000f,(float16_t)0.5756835937500f, +(float16_t)0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.7241210937500f,(float16_t)0.6894531250000f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.6152343750000f,(float16_t)0.7885742187500f, +(float16_t)0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.4929199218750f,(float16_t)0.8701171875000f, +(float16_t)0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3598632812500f,(float16_t)0.9331054687500f, +(float16_t)0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.2191162109375f,(float16_t)0.9755859375000f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0735473632812f,(float16_t)0.9970703125000f, +(float16_t)0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f,}; float16_t rearranged_twiddle_stride2_1024_f16[680]={ -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99992470183914450299f,(float16_t)0.01227153828571992539f, -(float16_t)0.99969881869620424997f,(float16_t)0.02454122852291228812f, -(float16_t)0.99932238458834954375f,(float16_t)0.03680722294135883171f, -(float16_t)0.99879545620517240501f,(float16_t)0.04906767432741801493f, -(float16_t)0.99811811290014917919f,(float16_t)0.06132073630220857829f, -(float16_t)0.99729045667869020697f,(float16_t)0.07356456359966742631f, -(float16_t)0.99631261218277800129f,(float16_t)0.08579731234443989385f, -(float16_t)0.99518472667219692873f,(float16_t)0.09801714032956060363f, -(float16_t)0.99390697000235606051f,(float16_t)0.11022220729388305938f, -(float16_t)0.99247953459870996706f,(float16_t)0.12241067519921619566f, -(float16_t)0.99090263542778000971f,(float16_t)0.13458070850712616773f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.98730141815785843473f,(float16_t)0.15885814333386144570f, -(float16_t)0.98527764238894122162f,(float16_t)0.17096188876030121717f, -(float16_t)0.98310548743121628501f,(float16_t)0.18303988795514095078f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.97831737071962765473f,(float16_t)0.20711137619221856032f, -(float16_t)0.97570213003852857003f,(float16_t)0.21910124015686979759f, -(float16_t)0.97293995220556017678f,(float16_t)0.23105810828067110951f, -(float16_t)0.97003125319454397424f,(float16_t)0.24298017990326387094f, -(float16_t)0.96697647104485207059f,(float16_t)0.25486565960451457169f, -(float16_t)0.96377606579543984022f,(float16_t)0.26671275747489836538f, -(float16_t)0.96043051941556578655f,(float16_t)0.27851968938505305973f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.95330604035419386211f,(float16_t)0.30200594931922808417f, -(float16_t)0.94952818059303667475f,(float16_t)0.31368174039889151761f, -(float16_t)0.94560732538052127971f,(float16_t)0.32531029216226292622f, -(float16_t)0.94154406518302080631f,(float16_t)0.33688985339222005111f, -(float16_t)0.93733901191257495977f,(float16_t)0.34841868024943456472f, -(float16_t)0.93299279883473895669f,(float16_t)0.35989503653498811087f, -(float16_t)0.92850608047321558924f,(float16_t)0.37131719395183754306f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.91911385169005777040f,(float16_t)0.39399204006104809883f, -(float16_t)0.91420975570353069095f,(float16_t)0.40524131400498986100f, -(float16_t)0.90916798309052238025f,(float16_t)0.41642956009763715253f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.89867446569395381673f,(float16_t)0.43861623853852765853f, -(float16_t)0.89322430119551532446f,(float16_t)0.44961132965460653965f, -(float16_t)0.88763962040285393496f,(float16_t)0.46053871095824000514f, -(float16_t)0.88192126434835504956f,(float16_t)0.47139673682599764204f, -(float16_t)0.87607009419540660122f,(float16_t)0.48218377207912271887f, -(float16_t)0.87008699110871146054f,(float16_t)0.49289819222978403790f, -(float16_t)0.86397285612158669643f,(float16_t)0.50353838372571757542f, -(float16_t)0.85772861000027211809f,(float16_t)0.51410274419322166128f, -(float16_t)0.85135519310526519554f,(float16_t)0.52458968267846894928f, -(float16_t)0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)0.83822470555483807875f,(float16_t)0.54532498842204646383f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.82458930278502529099f,(float16_t)0.56573181078361312046f, -(float16_t)0.81758481315158371139f,(float16_t)0.57580819141784533866f, -(float16_t)0.81045719825259476821f,(float16_t)0.58579785745643886408f, -(float16_t)0.80320753148064494287f,(float16_t)0.59569930449243335691f, -(float16_t)0.79583690460888356633f,(float16_t)0.60551104140432554512f, -(float16_t)0.78834642762660622761f,(float16_t)0.61523159058062681925f, -(float16_t)0.78073722857209448822f,(float16_t)0.62485948814238634341f, -(float16_t)0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)0.76516726562245895860f,(float16_t)0.64383154288979138613f, -(float16_t)0.75720884650648456748f,(float16_t)0.65317284295377675551f, -(float16_t)0.74913639452345937020f,(float16_t)0.66241577759017178373f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.73265427167241281570f,(float16_t)0.68060099779545302212f, -(float16_t)0.72424708295146700276f,(float16_t)0.68954054473706682948f, -(float16_t)0.71573082528381870571f,(float16_t)0.69837624940897280457f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.69837624940897291559f,(float16_t)0.71573082528381859468f, -(float16_t)0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)0.68060099779545302212f,(float16_t)0.73265427167241281570f, -(float16_t)0.67155895484701833009f,(float16_t)0.74095112535495910588f, -(float16_t)0.66241577759017178373f,(float16_t)0.74913639452345925918f, -(float16_t)0.65317284295377686654f,(float16_t)0.75720884650648456748f, -(float16_t)0.64383154288979149715f,(float16_t)0.76516726562245895860f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.62485948814238645443f,(float16_t)0.78073722857209448822f, -(float16_t)0.61523159058062681925f,(float16_t)0.78834642762660622761f, -(float16_t)0.60551104140432554512f,(float16_t)0.79583690460888345530f, -(float16_t)0.59569930449243346793f,(float16_t)0.80320753148064483184f, -(float16_t)0.58579785745643886408f,(float16_t)0.81045719825259476821f, -(float16_t)0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)0.56573181078361323149f,(float16_t)0.82458930278502529099f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.54532498842204646383f,(float16_t)0.83822470555483796772f, -(float16_t)0.53499761988709726435f,(float16_t)0.84485356524970700587f, -(float16_t)0.52458968267846883826f,(float16_t)0.85135519310526519554f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.50353838372571757542f,(float16_t)0.86397285612158669643f, -(float16_t)0.49289819222978409341f,(float16_t)0.87008699110871134952f, -(float16_t)0.48218377207912282989f,(float16_t)0.87607009419540660122f, -(float16_t)0.47139673682599780857f,(float16_t)0.88192126434835493853f, -(float16_t)0.46053871095824000514f,(float16_t)0.88763962040285393496f, -(float16_t)0.44961132965460659516f,(float16_t)0.89322430119551532446f, -(float16_t)0.43861623853852771404f,(float16_t)0.89867446569395381673f, -(float16_t)0.42755509343028219593f,(float16_t)0.90398929312344333820f, -(float16_t)0.41642956009763731906f,(float16_t)0.90916798309052226923f, -(float16_t)0.40524131400498986100f,(float16_t)0.91420975570353069095f, -(float16_t)0.39399204006104809883f,(float16_t)0.91911385169005777040f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.37131719395183759858f,(float16_t)0.92850608047321558924f, -(float16_t)0.35989503653498827740f,(float16_t)0.93299279883473884567f, -(float16_t)0.34841868024943450921f,(float16_t)0.93733901191257495977f, -(float16_t)0.33688985339222005111f,(float16_t)0.94154406518302080631f, -(float16_t)0.32531029216226298173f,(float16_t)0.94560732538052127971f, -(float16_t)0.31368174039889157312f,(float16_t)0.94952818059303667475f, -(float16_t)0.30200594931922819519f,(float16_t)0.95330604035419375109f, -(float16_t)0.29028467725446233105f,(float16_t)0.95694033573220893540f, -(float16_t)0.27851968938505305973f,(float16_t)0.96043051941556578655f, -(float16_t)0.26671275747489842090f,(float16_t)0.96377606579543984022f, -(float16_t)0.25486565960451462720f,(float16_t)0.96697647104485207059f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.23105810828067127605f,(float16_t)0.97293995220556006576f, -(float16_t)0.21910124015686976984f,(float16_t)0.97570213003852857003f, -(float16_t)0.20711137619221856032f,(float16_t)0.97831737071962765473f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.18303988795514106180f,(float16_t)0.98310548743121628501f, -(float16_t)0.17096188876030135595f,(float16_t)0.98527764238894122162f, -(float16_t)0.15885814333386139019f,(float16_t)0.98730141815785843473f, -(float16_t)0.14673047445536174793f,(float16_t)0.98917650996478101444f, -(float16_t)0.13458070850712622324f,(float16_t)0.99090263542778000971f, -(float16_t)0.12241067519921627893f,(float16_t)0.99247953459870996706f, -(float16_t)0.11022220729388318428f,(float16_t)0.99390697000235606051f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.08579731234443987997f,(float16_t)0.99631261218277800129f, -(float16_t)0.07356456359966745406f,(float16_t)0.99729045667869020697f, -(float16_t)0.06132073630220864768f,(float16_t)0.99811811290014917919f, -(float16_t)0.04906767432741812596f,(float16_t)0.99879545620517240501f, -(float16_t)0.03680722294135899131f,(float16_t)0.99932238458834954375f, -(float16_t)0.02454122852291226384f,(float16_t)0.99969881869620424997f, -(float16_t)0.01227153828571994447f,(float16_t)0.99992470183914450299f, -(float16_t)0.00000000000000006123f,(float16_t)1.00000000000000000000f, -(float16_t)-0.01227153828571982304f,(float16_t)0.99992470183914450299f, -(float16_t)-0.02454122852291214241f,(float16_t)0.99969881869620424997f, -(float16_t)-0.03680722294135886641f,(float16_t)0.99932238458834954375f, -(float16_t)-0.04906767432741800800f,(float16_t)0.99879545620517240501f, -(float16_t)-0.06132073630220852972f,(float16_t)0.99811811290014917919f, -(float16_t)-0.07356456359966732916f,(float16_t)0.99729045667869020697f, -(float16_t)-0.08579731234443975507f,(float16_t)0.99631261218277800129f, -(float16_t)-0.09801714032956064526f,(float16_t)0.99518472667219692873f, -(float16_t)-0.11022220729388305938f,(float16_t)0.99390697000235606051f, -(float16_t)-0.12241067519921615403f,(float16_t)0.99247953459870996706f, -(float16_t)-0.13458070850712611222f,(float16_t)0.99090263542778000971f, -(float16_t)-0.14673047445536163691f,(float16_t)0.98917650996478101444f, -(float16_t)-0.15885814333386127917f,(float16_t)0.98730141815785843473f, -(float16_t)-0.17096188876030124493f,(float16_t)0.98527764238894122162f, -(float16_t)-0.18303988795514092303f,(float16_t)0.98310548743121628501f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.20711137619221844930f,(float16_t)0.97831737071962765473f, -(float16_t)-0.21910124015686965881f,(float16_t)0.97570213003852857003f, -(float16_t)-0.23105810828067113727f,(float16_t)0.97293995220556017678f, -(float16_t)-0.24298017990326387094f,(float16_t)0.97003125319454397424f, -(float16_t)-0.25486565960451451618f,(float16_t)0.96697647104485207059f, -(float16_t)-0.26671275747489830987f,(float16_t)0.96377606579543984022f, -(float16_t)-0.27851968938505294870f,(float16_t)0.96043051941556589757f, -(float16_t)-0.29028467725446216452f,(float16_t)0.95694033573220893540f, -(float16_t)-0.30200594931922808417f,(float16_t)0.95330604035419386211f, -(float16_t)-0.31368174039889140658f,(float16_t)0.94952818059303667475f, -(float16_t)-0.32531029216226287071f,(float16_t)0.94560732538052139073f, -(float16_t)-0.33688985339221994009f,(float16_t)0.94154406518302080631f, -(float16_t)-0.34841868024943439819f,(float16_t)0.93733901191257495977f, -(float16_t)-0.35989503653498816638f,(float16_t)0.93299279883473884567f, -(float16_t)-0.37131719395183748755f,(float16_t)0.92850608047321558924f, -(float16_t)-0.38268343236508972627f,(float16_t)0.92387953251128673848f, -(float16_t)-0.39399204006104798781f,(float16_t)0.91911385169005777040f, -(float16_t)-0.40524131400498974998f,(float16_t)0.91420975570353069095f, -(float16_t)-0.41642956009763698599f,(float16_t)0.90916798309052249127f, -(float16_t)-0.42755509343028186287f,(float16_t)0.90398929312344344922f, -(float16_t)-0.43861623853852738097f,(float16_t)0.89867446569395392775f, -(float16_t)-0.44961132965460670619f,(float16_t)0.89322430119551521344f, -(float16_t)-0.46053871095824006066f,(float16_t)0.88763962040285393496f, -(float16_t)-0.47139673682599769755f,(float16_t)0.88192126434835504956f, -(float16_t)-0.48218377207912271887f,(float16_t)0.87607009419540660122f, -(float16_t)-0.49289819222978398239f,(float16_t)0.87008699110871146054f, -(float16_t)-0.50353838372571746440f,(float16_t)0.86397285612158680745f, -(float16_t)-0.51410274419322155026f,(float16_t)0.85772861000027211809f, -(float16_t)-0.52458968267846872724f,(float16_t)0.85135519310526519554f, -(float16_t)-0.53499761988709704230f,(float16_t)0.84485356524970722791f, -(float16_t)-0.54532498842204624179f,(float16_t)0.83822470555483818977f, -(float16_t)-0.55557023301960195560f,(float16_t)0.83146961230254534669f, -(float16_t)-0.56573181078361323149f,(float16_t)0.82458930278502517996f, -(float16_t)-0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)-0.58579785745643886408f,(float16_t)0.81045719825259476821f, -(float16_t)-0.59569930449243335691f,(float16_t)0.80320753148064494287f, -(float16_t)-0.60551104140432543410f,(float16_t)0.79583690460888356633f, -(float16_t)-0.61523159058062670823f,(float16_t)0.78834642762660633863f, -(float16_t)-0.62485948814238623239f,(float16_t)0.78073722857209459924f, -(float16_t)-0.63439328416364537677f,(float16_t)0.77301045336273710440f, -(float16_t)-0.64383154288979127511f,(float16_t)0.76516726562245906962f, -(float16_t)-0.65317284295377653347f,(float16_t)0.75720884650648467851f, -(float16_t)-0.66241577759017189475f,(float16_t)0.74913639452345925918f, -(float16_t)-0.67155895484701844111f,(float16_t)0.74095112535495899486f, -(float16_t)-0.68060099779545302212f,(float16_t)0.73265427167241281570f, -(float16_t)-0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)-0.69837624940897280457f,(float16_t)0.71573082528381870571f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.71573082528381859468f,(float16_t)0.69837624940897291559f, -(float16_t)-0.72424708295146678072f,(float16_t)0.68954054473706705153f, -(float16_t)-0.73265427167241270467f,(float16_t)0.68060099779545324417f, -(float16_t)-0.74095112535495888384f,(float16_t)0.67155895484701855214f, -(float16_t)-0.74913639452345914815f,(float16_t)0.66241577759017200577f, -(float16_t)-0.75720884650648467851f,(float16_t)0.65317284295377664449f, -(float16_t)-0.76516726562245895860f,(float16_t)0.64383154288979138613f, -(float16_t)-0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)-0.78073722857209448822f,(float16_t)0.62485948814238634341f, -(float16_t)-0.78834642762660622761f,(float16_t)0.61523159058062693028f, -(float16_t)-0.79583690460888345530f,(float16_t)0.60551104140432565615f, -(float16_t)-0.80320753148064483184f,(float16_t)0.59569930449243346793f, -(float16_t)-0.81045719825259465718f,(float16_t)0.58579785745643897510f, -(float16_t)-0.81758481315158360037f,(float16_t)0.57580819141784544968f, -(float16_t)-0.82458930278502506894f,(float16_t)0.56573181078361345353f, -(float16_t)-0.83146961230254534669f,(float16_t)0.55557023301960217765f, -(float16_t)-0.83822470555483807875f,(float16_t)0.54532498842204635281f, -(float16_t)-0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)-0.85135519310526519554f,(float16_t)0.52458968267846894928f, -(float16_t)-0.85772861000027200706f,(float16_t)0.51410274419322177231f, -(float16_t)-0.86397285612158669643f,(float16_t)0.50353838372571757542f, -(float16_t)-0.87008699110871134952f,(float16_t)0.49289819222978414892f, -(float16_t)-0.87607009419540649020f,(float16_t)0.48218377207912288540f, -(float16_t)-0.88192126434835493853f,(float16_t)0.47139673682599780857f, -(float16_t)-0.88763962040285382393f,(float16_t)0.46053871095824022719f, -(float16_t)-0.89322430119551521344f,(float16_t)0.44961132965460687272f, -(float16_t)-0.89867446569395392775f,(float16_t)0.43861623853852754751f, -(float16_t)-0.90398929312344333820f,(float16_t)0.42755509343028202940f, -(float16_t)-0.90916798309052238025f,(float16_t)0.41642956009763715253f, -(float16_t)-0.91420975570353069095f,(float16_t)0.40524131400498991651f, -(float16_t)-0.91911385169005777040f,(float16_t)0.39399204006104815434f, -(float16_t)-0.92387953251128673848f,(float16_t)0.38268343236508989280f, -(float16_t)-0.92850608047321547822f,(float16_t)0.37131719395183770960f, -(float16_t)-0.93299279883473884567f,(float16_t)0.35989503653498833291f, -(float16_t)-0.93733901191257484875f,(float16_t)0.34841868024943478677f, -(float16_t)-0.94154406518302069529f,(float16_t)0.33688985339222032867f, -(float16_t)-0.94560732538052116869f,(float16_t)0.32531029216226325929f, -(float16_t)-0.94952818059303667475f,(float16_t)0.31368174039889140658f, -(float16_t)-0.95330604035419386211f,(float16_t)0.30200594931922802866f, -(float16_t)-0.95694033573220882438f,(float16_t)0.29028467725446238656f, -(float16_t)-0.96043051941556578655f,(float16_t)0.27851968938505317075f, -(float16_t)-0.96377606579543984022f,(float16_t)0.26671275747489847641f, -(float16_t)-0.96697647104485207059f,(float16_t)0.25486565960451468271f, -(float16_t)-0.97003125319454397424f,(float16_t)0.24298017990326406523f, -(float16_t)-0.97293995220556006576f,(float16_t)0.23105810828067133156f, -(float16_t)-0.97570213003852845901f,(float16_t)0.21910124015687004739f, -(float16_t)-0.97831737071962754371f,(float16_t)0.20711137619221883788f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)-0.98310548743121628501f,(float16_t)0.18303988795514089527f, -(float16_t)-0.98527764238894122162f,(float16_t)0.17096188876030121717f, -(float16_t)-0.98730141815785843473f,(float16_t)0.15885814333386147346f, -(float16_t)-0.98917650996478101444f,(float16_t)0.14673047445536180344f, -(float16_t)-0.99090263542778000971f,(float16_t)0.13458070850712627875f, -(float16_t)-0.99247953459870996706f,(float16_t)0.12241067519921634832f, -(float16_t)-0.99390697000235606051f,(float16_t)0.11022220729388323979f, -(float16_t)-0.99518472667219681771f,(float16_t)0.09801714032956082567f, -(float16_t)-0.99631261218277800129f,(float16_t)0.08579731234444015753f, -(float16_t)-0.99729045667869020697f,(float16_t)0.07356456359966773162f, -(float16_t)-0.99811811290014917919f,(float16_t)0.06132073630220848809f, -(float16_t)-0.99879545620517240501f,(float16_t)0.04906767432741796636f, -(float16_t)-0.99932238458834954375f,(float16_t)0.03680722294135883171f, -(float16_t)-0.99969881869620424997f,(float16_t)0.02454122852291232629f, -(float16_t)-0.99992470183914450299f,(float16_t)0.01227153828572000692f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99879545620517240501f,(float16_t)0.04906767432741801493f, -(float16_t)0.99518472667219692873f,(float16_t)0.09801714032956060363f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.97003125319454397424f,(float16_t)0.24298017990326387094f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.94154406518302080631f,(float16_t)0.33688985339222005111f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.88192126434835504956f,(float16_t)0.47139673682599764204f, -(float16_t)0.85772861000027211809f,(float16_t)0.51410274419322166128f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.80320753148064494287f,(float16_t)0.59569930449243335691f, -(float16_t)0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.67155895484701833009f,(float16_t)0.74095112535495910588f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.59569930449243346793f,(float16_t)0.80320753148064483184f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.47139673682599780857f,(float16_t)0.88192126434835493853f, -(float16_t)0.42755509343028219593f,(float16_t)0.90398929312344333820f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.33688985339222005111f,(float16_t)0.94154406518302080631f, -(float16_t)0.29028467725446233105f,(float16_t)0.95694033573220893540f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.14673047445536174793f,(float16_t)0.98917650996478101444f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.04906767432741812596f,(float16_t)0.99879545620517240501f, -(float16_t)0.00000000000000006123f,(float16_t)1.00000000000000000000f, -(float16_t)-0.04906767432741800800f,(float16_t)0.99879545620517240501f, -(float16_t)-0.09801714032956064526f,(float16_t)0.99518472667219692873f, -(float16_t)-0.14673047445536163691f,(float16_t)0.98917650996478101444f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.24298017990326387094f,(float16_t)0.97003125319454397424f, -(float16_t)-0.29028467725446216452f,(float16_t)0.95694033573220893540f, -(float16_t)-0.33688985339221994009f,(float16_t)0.94154406518302080631f, -(float16_t)-0.38268343236508972627f,(float16_t)0.92387953251128673848f, -(float16_t)-0.42755509343028186287f,(float16_t)0.90398929312344344922f, -(float16_t)-0.47139673682599769755f,(float16_t)0.88192126434835504956f, -(float16_t)-0.51410274419322155026f,(float16_t)0.85772861000027211809f, -(float16_t)-0.55557023301960195560f,(float16_t)0.83146961230254534669f, -(float16_t)-0.59569930449243335691f,(float16_t)0.80320753148064494287f, -(float16_t)-0.63439328416364537677f,(float16_t)0.77301045336273710440f, -(float16_t)-0.67155895484701844111f,(float16_t)0.74095112535495899486f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.74095112535495888384f,(float16_t)0.67155895484701855214f, -(float16_t)-0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)-0.80320753148064483184f,(float16_t)0.59569930449243346793f, -(float16_t)-0.83146961230254534669f,(float16_t)0.55557023301960217765f, -(float16_t)-0.85772861000027200706f,(float16_t)0.51410274419322177231f, -(float16_t)-0.88192126434835493853f,(float16_t)0.47139673682599780857f, -(float16_t)-0.90398929312344333820f,(float16_t)0.42755509343028202940f, -(float16_t)-0.92387953251128673848f,(float16_t)0.38268343236508989280f, -(float16_t)-0.94154406518302069529f,(float16_t)0.33688985339222032867f, -(float16_t)-0.95694033573220882438f,(float16_t)0.29028467725446238656f, -(float16_t)-0.97003125319454397424f,(float16_t)0.24298017990326406523f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)-0.98917650996478101444f,(float16_t)0.14673047445536180344f, -(float16_t)-0.99518472667219681771f,(float16_t)0.09801714032956082567f, -(float16_t)-0.99879545620517240501f,(float16_t)0.04906767432741796636f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.00000000000000006123f,(float16_t)1.00000000000000000000f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.38268343236508972627f,(float16_t)0.92387953251128673848f, -(float16_t)-0.55557023301960195560f,(float16_t)0.83146961230254534669f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.83146961230254534669f,(float16_t)0.55557023301960217765f, -(float16_t)-0.92387953251128673848f,(float16_t)0.38268343236508989280f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.00000000000000006123f,(float16_t)1.00000000000000000000f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f,}; +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)1.0000000000000f,(float16_t)0.0122680664062f, +(float16_t)0.9995117187500f,(float16_t)0.0245361328125f, +(float16_t)0.9995117187500f,(float16_t)0.0368041992188f, +(float16_t)0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)0.9980468750000f,(float16_t)0.0613098144531f, +(float16_t)0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)0.9960937500000f,(float16_t)0.0858154296875f, +(float16_t)0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)0.9941406250000f,(float16_t)0.1102294921875f, +(float16_t)0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)0.9907226562500f,(float16_t)0.1345214843750f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9873046875000f,(float16_t)0.1588134765625f, +(float16_t)0.9853515625000f,(float16_t)0.1710205078125f, +(float16_t)0.9829101562500f,(float16_t)0.1829833984375f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9785156250000f,(float16_t)0.2071533203125f, +(float16_t)0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)0.9731445312500f,(float16_t)0.2310791015625f, +(float16_t)0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)0.9667968750000f,(float16_t)0.2548828125000f, +(float16_t)0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)0.9604492187500f,(float16_t)0.2785644531250f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9531250000000f,(float16_t)0.3020019531250f, +(float16_t)0.9497070312500f,(float16_t)0.3137207031250f, +(float16_t)0.9458007812500f,(float16_t)0.3251953125000f, +(float16_t)0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)0.9375000000000f,(float16_t)0.3483886718750f, +(float16_t)0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)0.9287109375000f,(float16_t)0.3713378906250f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.9189453125000f,(float16_t)0.3940429687500f, +(float16_t)0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)0.9091796875000f,(float16_t)0.4165039062500f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.8984375000000f,(float16_t)0.4387207031250f, +(float16_t)0.8930664062500f,(float16_t)0.4497070312500f, +(float16_t)0.8876953125000f,(float16_t)0.4604492187500f, +(float16_t)0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)0.8759765625000f,(float16_t)0.4821777343750f, +(float16_t)0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)0.8637695312500f,(float16_t)0.5034179687500f, +(float16_t)0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)0.8515625000000f,(float16_t)0.5244140625000f, +(float16_t)0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)0.8383789062500f,(float16_t)0.5454101562500f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.8247070312500f,(float16_t)0.5659179687500f, +(float16_t)0.8173828125000f,(float16_t)0.5756835937500f, +(float16_t)0.8105468750000f,(float16_t)0.5859375000000f, +(float16_t)0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)0.7958984375000f,(float16_t)0.6054687500000f, +(float16_t)0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)0.7807617187500f,(float16_t)0.6250000000000f, +(float16_t)0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)0.7651367187500f,(float16_t)0.6440429687500f, +(float16_t)0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)0.7490234375000f,(float16_t)0.6625976562500f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.7324218750000f,(float16_t)0.6806640625000f, +(float16_t)0.7241210937500f,(float16_t)0.6894531250000f, +(float16_t)0.7158203125000f,(float16_t)0.6982421875000f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.6982421875000f,(float16_t)0.7158203125000f, +(float16_t)0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)0.6806640625000f,(float16_t)0.7324218750000f, +(float16_t)0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)0.6625976562500f,(float16_t)0.7490234375000f, +(float16_t)0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)0.6440429687500f,(float16_t)0.7651367187500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.6250000000000f,(float16_t)0.7807617187500f, +(float16_t)0.6152343750000f,(float16_t)0.7885742187500f, +(float16_t)0.6054687500000f,(float16_t)0.7958984375000f, +(float16_t)0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)0.5859375000000f,(float16_t)0.8105468750000f, +(float16_t)0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)0.5659179687500f,(float16_t)0.8247070312500f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.5454101562500f,(float16_t)0.8383789062500f, +(float16_t)0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)0.5244140625000f,(float16_t)0.8515625000000f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.5034179687500f,(float16_t)0.8637695312500f, +(float16_t)0.4929199218750f,(float16_t)0.8701171875000f, +(float16_t)0.4821777343750f,(float16_t)0.8759765625000f, +(float16_t)0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)0.4604492187500f,(float16_t)0.8876953125000f, +(float16_t)0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)0.4387207031250f,(float16_t)0.8984375000000f, +(float16_t)0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)0.4165039062500f,(float16_t)0.9091796875000f, +(float16_t)0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)0.3940429687500f,(float16_t)0.9189453125000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3713378906250f,(float16_t)0.9287109375000f, +(float16_t)0.3598632812500f,(float16_t)0.9331054687500f, +(float16_t)0.3483886718750f,(float16_t)0.9375000000000f, +(float16_t)0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)0.3251953125000f,(float16_t)0.9458007812500f, +(float16_t)0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)0.3020019531250f,(float16_t)0.9531250000000f, +(float16_t)0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)0.2785644531250f,(float16_t)0.9604492187500f, +(float16_t)0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)0.2548828125000f,(float16_t)0.9667968750000f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.2310791015625f,(float16_t)0.9731445312500f, +(float16_t)0.2191162109375f,(float16_t)0.9755859375000f, +(float16_t)0.2071533203125f,(float16_t)0.9785156250000f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.1829833984375f,(float16_t)0.9829101562500f, +(float16_t)0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)0.1588134765625f,(float16_t)0.9873046875000f, +(float16_t)0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)0.1345214843750f,(float16_t)0.9907226562500f, +(float16_t)0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)0.1102294921875f,(float16_t)0.9941406250000f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0858154296875f,(float16_t)0.9960937500000f, +(float16_t)0.0735473632812f,(float16_t)0.9970703125000f, +(float16_t)0.0613098144531f,(float16_t)0.9980468750000f, +(float16_t)0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)0.0368041992188f,(float16_t)0.9995117187500f, +(float16_t)0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)0.0122680664062f,(float16_t)1.0000000000000f, +(float16_t)0.0000000000000f,(float16_t)1.0000000000000f, +(float16_t)-0.0122680664062f,(float16_t)1.0000000000000f, +(float16_t)-0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)-0.0368041992188f,(float16_t)0.9995117187500f, +(float16_t)-0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)-0.0613098144531f,(float16_t)0.9980468750000f, +(float16_t)-0.0735473632812f,(float16_t)0.9970703125000f, +(float16_t)-0.0858154296875f,(float16_t)0.9960937500000f, +(float16_t)-0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)-0.1102294921875f,(float16_t)0.9941406250000f, +(float16_t)-0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)-0.1345214843750f,(float16_t)0.9907226562500f, +(float16_t)-0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)-0.1588134765625f,(float16_t)0.9873046875000f, +(float16_t)-0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)-0.1829833984375f,(float16_t)0.9829101562500f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.2071533203125f,(float16_t)0.9785156250000f, +(float16_t)-0.2191162109375f,(float16_t)0.9755859375000f, +(float16_t)-0.2310791015625f,(float16_t)0.9731445312500f, +(float16_t)-0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)-0.2548828125000f,(float16_t)0.9667968750000f, +(float16_t)-0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)-0.2785644531250f,(float16_t)0.9604492187500f, +(float16_t)-0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)-0.3020019531250f,(float16_t)0.9531250000000f, +(float16_t)-0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)-0.3251953125000f,(float16_t)0.9458007812500f, +(float16_t)-0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)-0.3483886718750f,(float16_t)0.9375000000000f, +(float16_t)-0.3598632812500f,(float16_t)0.9331054687500f, +(float16_t)-0.3713378906250f,(float16_t)0.9287109375000f, +(float16_t)-0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)-0.3940429687500f,(float16_t)0.9189453125000f, +(float16_t)-0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)-0.4165039062500f,(float16_t)0.9091796875000f, +(float16_t)-0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)-0.4387207031250f,(float16_t)0.8984375000000f, +(float16_t)-0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)-0.4604492187500f,(float16_t)0.8876953125000f, +(float16_t)-0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)-0.4821777343750f,(float16_t)0.8759765625000f, +(float16_t)-0.4929199218750f,(float16_t)0.8701171875000f, +(float16_t)-0.5034179687500f,(float16_t)0.8637695312500f, +(float16_t)-0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)-0.5244140625000f,(float16_t)0.8515625000000f, +(float16_t)-0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)-0.5454101562500f,(float16_t)0.8383789062500f, +(float16_t)-0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)-0.5659179687500f,(float16_t)0.8247070312500f, +(float16_t)-0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)-0.5859375000000f,(float16_t)0.8105468750000f, +(float16_t)-0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)-0.6054687500000f,(float16_t)0.7958984375000f, +(float16_t)-0.6152343750000f,(float16_t)0.7885742187500f, +(float16_t)-0.6250000000000f,(float16_t)0.7807617187500f, +(float16_t)-0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)-0.6440429687500f,(float16_t)0.7651367187500f, +(float16_t)-0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)-0.6625976562500f,(float16_t)0.7490234375000f, +(float16_t)-0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)-0.6806640625000f,(float16_t)0.7324218750000f, +(float16_t)-0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)-0.6982421875000f,(float16_t)0.7158203125000f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.7158203125000f,(float16_t)0.6982421875000f, +(float16_t)-0.7241210937500f,(float16_t)0.6894531250000f, +(float16_t)-0.7324218750000f,(float16_t)0.6806640625000f, +(float16_t)-0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)-0.7490234375000f,(float16_t)0.6625976562500f, +(float16_t)-0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)-0.7651367187500f,(float16_t)0.6440429687500f, +(float16_t)-0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)-0.7807617187500f,(float16_t)0.6250000000000f, +(float16_t)-0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)-0.7958984375000f,(float16_t)0.6054687500000f, +(float16_t)-0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)-0.8105468750000f,(float16_t)0.5859375000000f, +(float16_t)-0.8173828125000f,(float16_t)0.5756835937500f, +(float16_t)-0.8247070312500f,(float16_t)0.5659179687500f, +(float16_t)-0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)-0.8383789062500f,(float16_t)0.5454101562500f, +(float16_t)-0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)-0.8515625000000f,(float16_t)0.5244140625000f, +(float16_t)-0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)-0.8637695312500f,(float16_t)0.5034179687500f, +(float16_t)-0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)-0.8759765625000f,(float16_t)0.4821777343750f, +(float16_t)-0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)-0.8876953125000f,(float16_t)0.4604492187500f, +(float16_t)-0.8930664062500f,(float16_t)0.4497070312500f, +(float16_t)-0.8984375000000f,(float16_t)0.4387207031250f, +(float16_t)-0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)-0.9091796875000f,(float16_t)0.4165039062500f, +(float16_t)-0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)-0.9189453125000f,(float16_t)0.3940429687500f, +(float16_t)-0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)-0.9287109375000f,(float16_t)0.3713378906250f, +(float16_t)-0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)-0.9375000000000f,(float16_t)0.3483886718750f, +(float16_t)-0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)-0.9458007812500f,(float16_t)0.3251953125000f, +(float16_t)-0.9497070312500f,(float16_t)0.3137207031250f, +(float16_t)-0.9531250000000f,(float16_t)0.3020019531250f, +(float16_t)-0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)-0.9604492187500f,(float16_t)0.2785644531250f, +(float16_t)-0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)-0.9667968750000f,(float16_t)0.2548828125000f, +(float16_t)-0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)-0.9731445312500f,(float16_t)0.2310791015625f, +(float16_t)-0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)-0.9785156250000f,(float16_t)0.2071533203125f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)-0.9829101562500f,(float16_t)0.1829833984375f, +(float16_t)-0.9853515625000f,(float16_t)0.1710205078125f, +(float16_t)-0.9873046875000f,(float16_t)0.1588134765625f, +(float16_t)-0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)-0.9907226562500f,(float16_t)0.1345214843750f, +(float16_t)-0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)-0.9941406250000f,(float16_t)0.1102294921875f, +(float16_t)-0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)-0.9960937500000f,(float16_t)0.0858154296875f, +(float16_t)-0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)-0.9980468750000f,(float16_t)0.0613098144531f, +(float16_t)-0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)-0.9995117187500f,(float16_t)0.0368041992188f, +(float16_t)-0.9995117187500f,(float16_t)0.0245361328125f, +(float16_t)-1.0000000000000f,(float16_t)0.0122680664062f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)0.0000000000000f,(float16_t)1.0000000000000f, +(float16_t)-0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)-0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)-0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)-0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)-0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)-0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)-0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)-0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)-0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)-0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)-0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)-0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)-0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)-0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)-0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)-0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)-0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)-0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)-0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)-0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)-0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)-0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)-0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)-0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)-0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)-0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.0000000000000f,(float16_t)1.0000000000000f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)-0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)-0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.0000000000000f,(float16_t)1.0000000000000f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f,}; float16_t rearranged_twiddle_stride3_1024_f16[680]={ -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99983058179582340319f,(float16_t)0.01840672990580482019f, -(float16_t)0.99932238458834954375f,(float16_t)0.03680722294135883171f, -(float16_t)0.99847558057329477421f,(float16_t)0.05519524434968993420f, -(float16_t)0.99729045667869020697f,(float16_t)0.07356456359966742631f, -(float16_t)0.99576741446765981713f,(float16_t)0.09190895649713272386f, -(float16_t)0.99390697000235606051f,(float16_t)0.11022220729388305938f, -(float16_t)0.99170975366909952520f,(float16_t)0.12849811079379316880f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.98630809724459866938f,(float16_t)0.16491312048996989437f, -(float16_t)0.98310548743121628501f,(float16_t)0.18303988795514095078f, -(float16_t)0.97956976568544051887f,(float16_t)0.20110463484209190055f, -(float16_t)0.97570213003852857003f,(float16_t)0.21910124015686979759f, -(float16_t)0.97150389098625178352f,(float16_t)0.23702360599436719801f, -(float16_t)0.96697647104485207059f,(float16_t)0.25486565960451457169f, -(float16_t)0.96212140426904158019f,(float16_t)0.27262135544994897662f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.95143502096900833820f,(float16_t)0.30784964004153486661f, -(float16_t)0.94560732538052127971f,(float16_t)0.32531029216226292622f, -(float16_t)0.93945922360218991898f,(float16_t)0.34266071731199437833f, -(float16_t)0.93299279883473895669f,(float16_t)0.35989503653498811087f, -(float16_t)0.92621024213831137928f,(float16_t)0.37700741021641825945f, -(float16_t)0.91911385169005777040f,(float16_t)0.39399204006104809883f, -(float16_t)0.91170603200542987832f,(float16_t)0.41084317105790391089f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.89596624975618521791f,(float16_t)0.44412214457042920035f, -(float16_t)0.88763962040285393496f,(float16_t)0.46053871095824000514f, -(float16_t)0.87901222642863352519f,(float16_t)0.47679923006332208812f, -(float16_t)0.87008699110871146054f,(float16_t)0.49289819222978403790f, -(float16_t)0.86086693863776730939f,(float16_t)0.50883014254310698909f, -(float16_t)0.85135519310526519554f,(float16_t)0.52458968267846894928f, -(float16_t)0.84155497743689844370f,(float16_t)0.54017147272989285423f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.82110251499110464835f,(float16_t)0.57078074588696725566f, -(float16_t)0.81045719825259476821f,(float16_t)0.58579785745643886408f, -(float16_t)0.79953726910790501314f,(float16_t)0.60061647938386897305f, -(float16_t)0.78834642762660622761f,(float16_t)0.61523159058062681925f, -(float16_t)0.77688846567323244230f,(float16_t)0.62963823891492698426f, -(float16_t)0.76516726562245895860f,(float16_t)0.64383154288979138613f, -(float16_t)0.75318679904361252042f,(float16_t)0.65780669329707863735f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.72846439044822519637f,(float16_t)0.68508366777270035541f, -(float16_t)0.71573082528381870571f,(float16_t)0.69837624940897280457f, -(float16_t)0.70275474445722529993f,(float16_t)0.71143219574521643356f, -(float16_t)0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)0.67609270357531603413f,(float16_t)0.73681656887736979300f, -(float16_t)0.66241577759017178373f,(float16_t)0.74913639452345925918f, -(float16_t)0.64851440102211255212f,(float16_t)0.76120238548426177871f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.62005721176328920663f,(float16_t)0.78455659715557524159f, -(float16_t)0.60551104140432554512f,(float16_t)0.79583690460888345530f, -(float16_t)0.59075970185887427544f,(float16_t)0.80684755354379922299f, -(float16_t)0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)0.56066157619733603124f,(float16_t)0.82804504525775579626f, -(float16_t)0.54532498842204646383f,(float16_t)0.83822470555483796772f, -(float16_t)0.52980362468629482731f,(float16_t)0.84812034480329712149f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.49822766697278186854f,(float16_t)0.86704624551569264845f, -(float16_t)0.48218377207912282989f,(float16_t)0.87607009419540660122f, -(float16_t)0.46597649576796612569f,(float16_t)0.88479709843093778954f, -(float16_t)0.44961132965460659516f,(float16_t)0.89322430119551532446f, -(float16_t)0.43309381885315201277f,(float16_t)0.90134884704602202810f, -(float16_t)0.41642956009763731906f,(float16_t)0.90916798309052226923f, -(float16_t)0.39962419984564678810f,(float16_t)0.91667905992104270485f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.36561299780477396482f,(float16_t)0.93076696107898371224f, -(float16_t)0.34841868024943450921f,(float16_t)0.93733901191257495977f, -(float16_t)0.33110630575987642921f,(float16_t)0.94359345816196038559f, -(float16_t)0.31368174039889157312f,(float16_t)0.94952818059303667475f, -(float16_t)0.29615088824362395536f,(float16_t)0.95514116830577067141f, -(float16_t)0.27851968938505305973f,(float16_t)0.96043051941556578655f, -(float16_t)0.26079411791527556952f,(float16_t)0.96539444169768939830f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.22508391135979277653f,(float16_t)0.97433938278557585821f, -(float16_t)0.20711137619221856032f,(float16_t)0.97831737071962765473f, -(float16_t)0.18906866414980627589f,(float16_t)0.98196386910955524296f, -(float16_t)0.17096188876030135595f,(float16_t)0.98527764238894122162f, -(float16_t)0.15279718525844340760f,(float16_t)0.98825756773074946437f, -(float16_t)0.13458070850712622324f,(float16_t)0.99090263542778000971f, -(float16_t)0.11631863091190487725f,(float16_t)0.99321194923479450001f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.07968243797143012563f,(float16_t)0.99682029929116566791f, -(float16_t)0.06132073630220864768f,(float16_t)0.99811811290014917919f, -(float16_t)0.04293825693494095902f,(float16_t)0.99907772775264536147f, -(float16_t)0.02454122852291226384f,(float16_t)0.99969881869620424997f, -(float16_t)0.00613588464915451517f,(float16_t)0.99998117528260110909f, -(float16_t)-0.01227153828571982304f,(float16_t)0.99992470183914450299f, -(float16_t)-0.03067480317663645942f,(float16_t)0.99952941750109314256f, -(float16_t)-0.04906767432741800800f,(float16_t)0.99879545620517240501f, -(float16_t)-0.06744391956366398155f,(float16_t)0.99772306664419163624f, -(float16_t)-0.08579731234443975507f,(float16_t)0.99631261218277800129f, -(float16_t)-0.10412163387205460030f,(float16_t)0.99456457073425541537f, -(float16_t)-0.12241067519921615403f,(float16_t)0.99247953459870996706f, -(float16_t)-0.14065823933284912761f,(float16_t)0.99005821026229712256f, -(float16_t)-0.15885814333386127917f,(float16_t)0.98730141815785843473f, -(float16_t)-0.17700422041214874946f,(float16_t)0.98421009238692902521f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.21311031991609125091f,(float16_t)0.97702814265775439484f, -(float16_t)-0.23105810828067113727f,(float16_t)0.97293995220556017678f, -(float16_t)-0.24892760574572012078f,(float16_t)0.96852209427441737777f, -(float16_t)-0.26671275747489830987f,(float16_t)0.96377606579543984022f, -(float16_t)-0.28440753721127171039f,(float16_t)0.95870347489587159906f, -(float16_t)-0.30200594931922808417f,(float16_t)0.95330604035419386211f, -(float16_t)-0.31950203081601563637f,(float16_t)0.94758559101774120226f, -(float16_t)-0.33688985339221994009f,(float16_t)0.94154406518302080631f, -(float16_t)-0.35416352542049039931f,(float16_t)0.93518350993894761025f, -(float16_t)-0.37131719395183748755f,(float16_t)0.92850608047321558924f, -(float16_t)-0.38834504669882619066f,(float16_t)0.92151403934204201285f, -(float16_t)-0.40524131400498974998f,(float16_t)0.91420975570353069095f, -(float16_t)-0.42200027079979968159f,(float16_t)0.90659570451491533483f, -(float16_t)-0.43861623853852738097f,(float16_t)0.89867446569395392775f, -(float16_t)-0.45508358712634372489f,(float16_t)0.89044872324475798919f, -(float16_t)-0.47139673682599769755f,(float16_t)0.88192126434835504956f, -(float16_t)-0.48755016014843571837f,(float16_t)0.87309497841829020182f, -(float16_t)-0.50353838372571746440f,(float16_t)0.86397285612158680745f, -(float16_t)-0.51935599016558964269f,(float16_t)0.85455798836540053376f, -(float16_t)-0.53499761988709704230f,(float16_t)0.84485356524970722791f, -(float16_t)-0.55045797293660470029f,(float16_t)0.83486287498638012128f, -(float16_t)-0.56573181078361323149f,(float16_t)0.82458930278502517996f, -(float16_t)-0.58081395809576441547f,(float16_t)0.81403632970594852480f, -(float16_t)-0.59569930449243335691f,(float16_t)0.80320753148064494287f, -(float16_t)-0.61038280627630958630f,(float16_t)0.79210657730021227785f, -(float16_t)-0.62485948814238623239f,(float16_t)0.78073722857209459924f, -(float16_t)-0.63912444486377573138f,(float16_t)0.76910333764557958780f, -(float16_t)-0.65317284295377653347f,(float16_t)0.75720884650648467851f, -(float16_t)-0.66699992230363736034f,(float16_t)0.74505778544146605835f, -(float16_t)-0.68060099779545302212f,(float16_t)0.73265427167241281570f, -(float16_t)-0.69397146088965377952f,(float16_t)0.72000250796138176579f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.72000250796138165477f,(float16_t)0.69397146088965389055f, -(float16_t)-0.73265427167241270467f,(float16_t)0.68060099779545324417f, -(float16_t)-0.74505778544146594733f,(float16_t)0.66699992230363758239f, -(float16_t)-0.75720884650648467851f,(float16_t)0.65317284295377664449f, -(float16_t)-0.76910333764557947678f,(float16_t)0.63912444486377584241f, -(float16_t)-0.78073722857209448822f,(float16_t)0.62485948814238634341f, -(float16_t)-0.79210657730021216683f,(float16_t)0.61038280627630969732f, -(float16_t)-0.80320753148064483184f,(float16_t)0.59569930449243346793f, -(float16_t)-0.81403632970594841378f,(float16_t)0.58081395809576452649f, -(float16_t)-0.82458930278502506894f,(float16_t)0.56573181078361345353f, -(float16_t)-0.83486287498638001026f,(float16_t)0.55045797293660492233f, -(float16_t)-0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)-0.85455798836540042274f,(float16_t)0.51935599016558975372f, -(float16_t)-0.86397285612158669643f,(float16_t)0.50353838372571757542f, -(float16_t)-0.87309497841829009079f,(float16_t)0.48755016014843588490f, -(float16_t)-0.88192126434835493853f,(float16_t)0.47139673682599780857f, -(float16_t)-0.89044872324475787817f,(float16_t)0.45508358712634389143f, -(float16_t)-0.89867446569395392775f,(float16_t)0.43861623853852754751f, -(float16_t)-0.90659570451491533483f,(float16_t)0.42200027079979984812f, -(float16_t)-0.91420975570353069095f,(float16_t)0.40524131400498991651f, -(float16_t)-0.92151403934204179080f,(float16_t)0.38834504669882657923f, -(float16_t)-0.92850608047321547822f,(float16_t)0.37131719395183770960f, -(float16_t)-0.93518350993894761025f,(float16_t)0.35416352542049039931f, -(float16_t)-0.94154406518302069529f,(float16_t)0.33688985339222032867f, -(float16_t)-0.94758559101774109124f,(float16_t)0.31950203081601580291f, -(float16_t)-0.95330604035419386211f,(float16_t)0.30200594931922802866f, -(float16_t)-0.95870347489587148804f,(float16_t)0.28440753721127209896f, -(float16_t)-0.96377606579543984022f,(float16_t)0.26671275747489847641f, -(float16_t)-0.96852209427441737777f,(float16_t)0.24892760574572009302f, -(float16_t)-0.97293995220556006576f,(float16_t)0.23105810828067133156f, -(float16_t)-0.97702814265775439484f,(float16_t)0.21311031991609141745f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)-0.98421009238692902521f,(float16_t)0.17700422041214894375f, -(float16_t)-0.98730141815785843473f,(float16_t)0.15885814333386147346f, -(float16_t)-0.99005821026229701154f,(float16_t)0.14065823933284954395f, -(float16_t)-0.99247953459870996706f,(float16_t)0.12241067519921634832f, -(float16_t)-0.99456457073425541537f,(float16_t)0.10412163387205457254f, -(float16_t)-0.99631261218277800129f,(float16_t)0.08579731234444015753f, -(float16_t)-0.99772306664419163624f,(float16_t)0.06744391956366417584f, -(float16_t)-0.99879545620517240501f,(float16_t)0.04906767432741796636f, -(float16_t)-0.99952941750109314256f,(float16_t)0.03067480317663686534f, -(float16_t)-0.99992470183914450299f,(float16_t)0.01227153828572000692f, -(float16_t)-0.99998117528260110909f,(float16_t)-0.00613588464915455420f, -(float16_t)-0.99969881869620424997f,(float16_t)-0.02454122852291207996f, -(float16_t)-0.99907772775264536147f,(float16_t)-0.04293825693494077861f, -(float16_t)-0.99811811290014917919f,(float16_t)-0.06132073630220824523f, -(float16_t)-0.99682029929116577893f,(float16_t)-0.07968243797142994522f, -(float16_t)-0.99518472667219692873f,(float16_t)-0.09801714032956058975f, -(float16_t)-0.99321194923479461103f,(float16_t)-0.11631863091190447479f, -(float16_t)-0.99090263542778000971f,(float16_t)-0.13458070850712605671f, -(float16_t)-0.98825756773074946437f,(float16_t)-0.15279718525844343535f, -(float16_t)-0.98527764238894133264f,(float16_t)-0.17096188876030096737f, -(float16_t)-0.98196386910955524296f,(float16_t)-0.18906866414980610935f, -(float16_t)-0.97831737071962765473f,(float16_t)-0.20711137619221858808f, -(float16_t)-0.97433938278557585821f,(float16_t)-0.22508391135979261000f, -(float16_t)-0.97003125319454397424f,(float16_t)-0.24298017990326381543f, -(float16_t)-0.96539444169768939830f,(float16_t)-0.26079411791527562503f, -(float16_t)-0.96043051941556589757f,(float16_t)-0.27851968938505289319f, -(float16_t)-0.95514116830577078243f,(float16_t)-0.29615088824362378883f, -(float16_t)-0.94952818059303678577f,(float16_t)-0.31368174039889118454f, -(float16_t)-0.94359345816196038559f,(float16_t)-0.33110630575987626267f, -(float16_t)-0.93733901191257495977f,(float16_t)-0.34841868024943456472f, -(float16_t)-0.93076696107898382326f,(float16_t)-0.36561299780477357624f, -(float16_t)-0.92387953251128684951f,(float16_t)-0.38268343236508967076f, -(float16_t)-0.91667905992104270485f,(float16_t)-0.39962419984564684361f, -(float16_t)-0.90916798309052249127f,(float16_t)-0.41642956009763693048f, -(float16_t)-0.90134884704602202810f,(float16_t)-0.43309381885315184624f, -(float16_t)-0.89322430119551532446f,(float16_t)-0.44961132965460665067f, -(float16_t)-0.88479709843093790056f,(float16_t)-0.46597649576796595916f, -(float16_t)-0.87607009419540660122f,(float16_t)-0.48218377207912266336f, -(float16_t)-0.86704624551569287050f,(float16_t)-0.49822766697278153547f, -(float16_t)-0.85772861000027211809f,(float16_t)-0.51410274419322155026f, -(float16_t)-0.84812034480329723252f,(float16_t)-0.52980362468629460526f, -(float16_t)-0.83822470555483818977f,(float16_t)-0.54532498842204613076f, -(float16_t)-0.82804504525775590729f,(float16_t)-0.56066157619733592021f, -(float16_t)-0.81758481315158371139f,(float16_t)-0.57580819141784533866f, -(float16_t)-0.80684755354379944503f,(float16_t)-0.59075970185887394237f, -(float16_t)-0.79583690460888356633f,(float16_t)-0.60551104140432543410f, -(float16_t)-0.78455659715557524159f,(float16_t)-0.62005721176328920663f, -(float16_t)-0.77301045336273710440f,(float16_t)-0.63439328416364526575f, -(float16_t)-0.76120238548426188974f,(float16_t)-0.64851440102211233008f, -(float16_t)-0.74913639452345925918f,(float16_t)-0.66241577759017178373f, -(float16_t)-0.73681656887737001504f,(float16_t)-0.67609270357531581208f, -(float16_t)-0.72424708295146700276f,(float16_t)-0.68954054473706682948f, -(float16_t)-0.71143219574521665560f,(float16_t)-0.70275474445722507788f, -(float16_t)-0.69837624940897302661f,(float16_t)-0.71573082528381848366f, -(float16_t)-0.68508366777270035541f,(float16_t)-0.72846439044822519637f, -(float16_t)-0.67155895484701866316f,(float16_t)-0.74095112535495888384f, -(float16_t)-0.65780669329707874837f,(float16_t)-0.75318679904361240940f, -(float16_t)-0.64383154288979149715f,(float16_t)-0.76516726562245895860f, -(float16_t)-0.62963823891492687324f,(float16_t)-0.77688846567323255332f, -(float16_t)-0.61523159058062726334f,(float16_t)-0.78834642762660589455f, -(float16_t)-0.60061647938386930612f,(float16_t)-0.79953726910790479110f, -(float16_t)-0.58579785745643908612f,(float16_t)-0.81045719825259465718f, -(float16_t)-0.57078074588696736669f,(float16_t)-0.82110251499110464835f, -(float16_t)-0.55557023301960217765f,(float16_t)-0.83146961230254523567f, -(float16_t)-0.54017147272989274320f,(float16_t)-0.84155497743689855472f, -(float16_t)-0.52458968267846928235f,(float16_t)-0.85135519310526486247f, -(float16_t)-0.50883014254310732216f,(float16_t)-0.86086693863776708735f, -(float16_t)-0.49289819222978420443f,(float16_t)-0.87008699110871134952f, -(float16_t)-0.47679923006332214364f,(float16_t)-0.87901222642863341417f, -(float16_t)-0.46053871095823989412f,(float16_t)-0.88763962040285404598f, -(float16_t)-0.44412214457042975546f,(float16_t)-0.89596624975618488484f, -(float16_t)-0.42755509343028247349f,(float16_t)-0.90398929312344311615f, -(float16_t)-0.41084317105790418845f,(float16_t)-0.91170603200542976730f, -(float16_t)-0.39399204006104820985f,(float16_t)-0.91911385169005765938f, -(float16_t)-0.37700741021641820394f,(float16_t)-0.92621024213831137928f, -(float16_t)-0.35989503653498794433f,(float16_t)-0.93299279883473895669f, -(float16_t)-0.34266071731199487793f,(float16_t)-0.93945922360218969693f, -(float16_t)-0.32531029216226331480f,(float16_t)-0.94560732538052116869f, -(float16_t)-0.30784964004153508865f,(float16_t)-0.95143502096900833820f, -(float16_t)-0.29028467725446244208f,(float16_t)-0.95694033573220882438f, -(float16_t)-0.27262135544994886560f,(float16_t)-0.96212140426904158019f, -(float16_t)-0.25486565960451434965f,(float16_t)-0.96697647104485218161f, -(float16_t)-0.23702360599436766986f,(float16_t)-0.97150389098625167250f, -(float16_t)-0.21910124015687010290f,(float16_t)-0.97570213003852845901f, -(float16_t)-0.20110463484209206708f,(float16_t)-0.97956976568544051887f, -(float16_t)-0.18303988795514095078f,(float16_t)-0.98310548743121628501f, -(float16_t)-0.16491312048996975559f,(float16_t)-0.98630809724459866938f, -(float16_t)-0.14673047445536230304f,(float16_t)-0.98917650996478090342f, -(float16_t)-0.12849811079379358514f,(float16_t)-0.99170975366909952520f, -(float16_t)-0.11022220729388330918f,(float16_t)-0.99390697000235606051f, -(float16_t)-0.09190895649713282101f,(float16_t)-0.99576741446765981713f, -(float16_t)-0.07356456359966735692f,(float16_t)-0.99729045667869020697f, -(float16_t)-0.05519524434968971216f,(float16_t)-0.99847558057329477421f, -(float16_t)-0.03680722294135933131f,(float16_t)-0.99932238458834943273f, -(float16_t)-0.01840672990580516366f,(float16_t)-0.99983058179582340319f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99729045667869020697f,(float16_t)0.07356456359966742631f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.97570213003852857003f,(float16_t)0.21910124015686979759f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.93299279883473895669f,(float16_t)0.35989503653498811087f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.87008699110871146054f,(float16_t)0.49289819222978403790f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.78834642762660622761f,(float16_t)0.61523159058062681925f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.44961132965460659516f,(float16_t)0.89322430119551532446f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.31368174039889157312f,(float16_t)0.94952818059303667475f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.17096188876030135595f,(float16_t)0.98527764238894122162f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.02454122852291226384f,(float16_t)0.99969881869620424997f, -(float16_t)-0.04906767432741800800f,(float16_t)0.99879545620517240501f, -(float16_t)-0.12241067519921615403f,(float16_t)0.99247953459870996706f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.26671275747489830987f,(float16_t)0.96377606579543984022f, -(float16_t)-0.33688985339221994009f,(float16_t)0.94154406518302080631f, -(float16_t)-0.40524131400498974998f,(float16_t)0.91420975570353069095f, -(float16_t)-0.47139673682599769755f,(float16_t)0.88192126434835504956f, -(float16_t)-0.53499761988709704230f,(float16_t)0.84485356524970722791f, -(float16_t)-0.59569930449243335691f,(float16_t)0.80320753148064494287f, -(float16_t)-0.65317284295377653347f,(float16_t)0.75720884650648467851f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.75720884650648467851f,(float16_t)0.65317284295377664449f, -(float16_t)-0.80320753148064483184f,(float16_t)0.59569930449243346793f, -(float16_t)-0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)-0.88192126434835493853f,(float16_t)0.47139673682599780857f, -(float16_t)-0.91420975570353069095f,(float16_t)0.40524131400498991651f, -(float16_t)-0.94154406518302069529f,(float16_t)0.33688985339222032867f, -(float16_t)-0.96377606579543984022f,(float16_t)0.26671275747489847641f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)-0.99247953459870996706f,(float16_t)0.12241067519921634832f, -(float16_t)-0.99879545620517240501f,(float16_t)0.04906767432741796636f, -(float16_t)-0.99969881869620424997f,(float16_t)-0.02454122852291207996f, -(float16_t)-0.99518472667219692873f,(float16_t)-0.09801714032956058975f, -(float16_t)-0.98527764238894133264f,(float16_t)-0.17096188876030096737f, -(float16_t)-0.97003125319454397424f,(float16_t)-0.24298017990326381543f, -(float16_t)-0.94952818059303678577f,(float16_t)-0.31368174039889118454f, -(float16_t)-0.92387953251128684951f,(float16_t)-0.38268343236508967076f, -(float16_t)-0.89322430119551532446f,(float16_t)-0.44961132965460665067f, -(float16_t)-0.85772861000027211809f,(float16_t)-0.51410274419322155026f, -(float16_t)-0.81758481315158371139f,(float16_t)-0.57580819141784533866f, -(float16_t)-0.77301045336273710440f,(float16_t)-0.63439328416364526575f, -(float16_t)-0.72424708295146700276f,(float16_t)-0.68954054473706682948f, -(float16_t)-0.67155895484701866316f,(float16_t)-0.74095112535495888384f, -(float16_t)-0.61523159058062726334f,(float16_t)-0.78834642762660589455f, -(float16_t)-0.55557023301960217765f,(float16_t)-0.83146961230254523567f, -(float16_t)-0.49289819222978420443f,(float16_t)-0.87008699110871134952f, -(float16_t)-0.42755509343028247349f,(float16_t)-0.90398929312344311615f, -(float16_t)-0.35989503653498794433f,(float16_t)-0.93299279883473895669f, -(float16_t)-0.29028467725446244208f,(float16_t)-0.95694033573220882438f, -(float16_t)-0.21910124015687010290f,(float16_t)-0.97570213003852845901f, -(float16_t)-0.14673047445536230304f,(float16_t)-0.98917650996478090342f, -(float16_t)-0.07356456359966735692f,(float16_t)-0.99729045667869020697f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.47139673682599769755f,(float16_t)0.88192126434835504956f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.88192126434835493853f,(float16_t)0.47139673682599780857f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)-0.99518472667219692873f,(float16_t)-0.09801714032956058975f, -(float16_t)-0.92387953251128684951f,(float16_t)-0.38268343236508967076f, -(float16_t)-0.77301045336273710440f,(float16_t)-0.63439328416364526575f, -(float16_t)-0.55557023301960217765f,(float16_t)-0.83146961230254523567f, -(float16_t)-0.29028467725446244208f,(float16_t)-0.95694033573220882438f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.92387953251128684951f,(float16_t)-0.38268343236508967076f,}; +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)1.0000000000000f,(float16_t)0.0184020996094f, +(float16_t)0.9995117187500f,(float16_t)0.0368041992188f, +(float16_t)0.9985351562500f,(float16_t)0.0552062988281f, +(float16_t)0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)0.9956054687500f,(float16_t)0.0919189453125f, +(float16_t)0.9941406250000f,(float16_t)0.1102294921875f, +(float16_t)0.9916992187500f,(float16_t)0.1285400390625f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9863281250000f,(float16_t)0.1649169921875f, +(float16_t)0.9829101562500f,(float16_t)0.1829833984375f, +(float16_t)0.9794921875000f,(float16_t)0.2010498046875f, +(float16_t)0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)0.9716796875000f,(float16_t)0.2370605468750f, +(float16_t)0.9667968750000f,(float16_t)0.2548828125000f, +(float16_t)0.9619140625000f,(float16_t)0.2727050781250f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9516601562500f,(float16_t)0.3078613281250f, +(float16_t)0.9458007812500f,(float16_t)0.3251953125000f, +(float16_t)0.9394531250000f,(float16_t)0.3427734375000f, +(float16_t)0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)0.9262695312500f,(float16_t)0.3769531250000f, +(float16_t)0.9189453125000f,(float16_t)0.3940429687500f, +(float16_t)0.9116210937500f,(float16_t)0.4108886718750f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.8959960937500f,(float16_t)0.4440917968750f, +(float16_t)0.8876953125000f,(float16_t)0.4604492187500f, +(float16_t)0.8789062500000f,(float16_t)0.4768066406250f, +(float16_t)0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)0.8608398437500f,(float16_t)0.5087890625000f, +(float16_t)0.8515625000000f,(float16_t)0.5244140625000f, +(float16_t)0.8417968750000f,(float16_t)0.5400390625000f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.8212890625000f,(float16_t)0.5708007812500f, +(float16_t)0.8105468750000f,(float16_t)0.5859375000000f, +(float16_t)0.7993164062500f,(float16_t)0.6005859375000f, +(float16_t)0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)0.7768554687500f,(float16_t)0.6293945312500f, +(float16_t)0.7651367187500f,(float16_t)0.6440429687500f, +(float16_t)0.7534179687500f,(float16_t)0.6577148437500f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.7285156250000f,(float16_t)0.6850585937500f, +(float16_t)0.7158203125000f,(float16_t)0.6982421875000f, +(float16_t)0.7026367187500f,(float16_t)0.7114257812500f, +(float16_t)0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)0.6762695312500f,(float16_t)0.7368164062500f, +(float16_t)0.6625976562500f,(float16_t)0.7490234375000f, +(float16_t)0.6484375000000f,(float16_t)0.7612304687500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.6201171875000f,(float16_t)0.7846679687500f, +(float16_t)0.6054687500000f,(float16_t)0.7958984375000f, +(float16_t)0.5908203125000f,(float16_t)0.8066406250000f, +(float16_t)0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)0.5605468750000f,(float16_t)0.8281250000000f, +(float16_t)0.5454101562500f,(float16_t)0.8383789062500f, +(float16_t)0.5297851562500f,(float16_t)0.8481445312500f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.4982910156250f,(float16_t)0.8671875000000f, +(float16_t)0.4821777343750f,(float16_t)0.8759765625000f, +(float16_t)0.4660644531250f,(float16_t)0.8847656250000f, +(float16_t)0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)0.4331054687500f,(float16_t)0.9013671875000f, +(float16_t)0.4165039062500f,(float16_t)0.9091796875000f, +(float16_t)0.3996582031250f,(float16_t)0.9165039062500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3657226562500f,(float16_t)0.9306640625000f, +(float16_t)0.3483886718750f,(float16_t)0.9375000000000f, +(float16_t)0.3310546875000f,(float16_t)0.9433593750000f, +(float16_t)0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)0.2961425781250f,(float16_t)0.9550781250000f, +(float16_t)0.2785644531250f,(float16_t)0.9604492187500f, +(float16_t)0.2607421875000f,(float16_t)0.9653320312500f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.2250976562500f,(float16_t)0.9741210937500f, +(float16_t)0.2071533203125f,(float16_t)0.9785156250000f, +(float16_t)0.1890869140625f,(float16_t)0.9819335937500f, +(float16_t)0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)0.1528320312500f,(float16_t)0.9882812500000f, +(float16_t)0.1345214843750f,(float16_t)0.9907226562500f, +(float16_t)0.1163330078125f,(float16_t)0.9931640625000f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0797119140625f,(float16_t)0.9965820312500f, +(float16_t)0.0613098144531f,(float16_t)0.9980468750000f, +(float16_t)0.0429382324219f,(float16_t)0.9990234375000f, +(float16_t)0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)0.0061340332031f,(float16_t)1.0000000000000f, +(float16_t)-0.0122680664062f,(float16_t)1.0000000000000f, +(float16_t)-0.0306701660156f,(float16_t)0.9995117187500f, +(float16_t)-0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)-0.0674438476562f,(float16_t)0.9975585937500f, +(float16_t)-0.0858154296875f,(float16_t)0.9960937500000f, +(float16_t)-0.1041259765625f,(float16_t)0.9946289062500f, +(float16_t)-0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)-0.1406250000000f,(float16_t)0.9902343750000f, +(float16_t)-0.1588134765625f,(float16_t)0.9873046875000f, +(float16_t)-0.1770019531250f,(float16_t)0.9843750000000f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.2131347656250f,(float16_t)0.9770507812500f, +(float16_t)-0.2310791015625f,(float16_t)0.9731445312500f, +(float16_t)-0.2489013671875f,(float16_t)0.9687500000000f, +(float16_t)-0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)-0.2844238281250f,(float16_t)0.9584960937500f, +(float16_t)-0.3020019531250f,(float16_t)0.9531250000000f, +(float16_t)-0.3195800781250f,(float16_t)0.9477539062500f, +(float16_t)-0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)-0.3542480468750f,(float16_t)0.9350585937500f, +(float16_t)-0.3713378906250f,(float16_t)0.9287109375000f, +(float16_t)-0.3884277343750f,(float16_t)0.9213867187500f, +(float16_t)-0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)-0.4221191406250f,(float16_t)0.9067382812500f, +(float16_t)-0.4387207031250f,(float16_t)0.8984375000000f, +(float16_t)-0.4550781250000f,(float16_t)0.8906250000000f, +(float16_t)-0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)-0.4875488281250f,(float16_t)0.8730468750000f, +(float16_t)-0.5034179687500f,(float16_t)0.8637695312500f, +(float16_t)-0.5195312500000f,(float16_t)0.8544921875000f, +(float16_t)-0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)-0.5502929687500f,(float16_t)0.8349609375000f, +(float16_t)-0.5659179687500f,(float16_t)0.8247070312500f, +(float16_t)-0.5810546875000f,(float16_t)0.8139648437500f, +(float16_t)-0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)-0.6103515625000f,(float16_t)0.7919921875000f, +(float16_t)-0.6250000000000f,(float16_t)0.7807617187500f, +(float16_t)-0.6391601562500f,(float16_t)0.7690429687500f, +(float16_t)-0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)-0.6669921875000f,(float16_t)0.7451171875000f, +(float16_t)-0.6806640625000f,(float16_t)0.7324218750000f, +(float16_t)-0.6938476562500f,(float16_t)0.7202148437500f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.7202148437500f,(float16_t)0.6938476562500f, +(float16_t)-0.7324218750000f,(float16_t)0.6806640625000f, +(float16_t)-0.7451171875000f,(float16_t)0.6669921875000f, +(float16_t)-0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)-0.7690429687500f,(float16_t)0.6391601562500f, +(float16_t)-0.7807617187500f,(float16_t)0.6250000000000f, +(float16_t)-0.7919921875000f,(float16_t)0.6103515625000f, +(float16_t)-0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)-0.8139648437500f,(float16_t)0.5810546875000f, +(float16_t)-0.8247070312500f,(float16_t)0.5659179687500f, +(float16_t)-0.8349609375000f,(float16_t)0.5502929687500f, +(float16_t)-0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)-0.8544921875000f,(float16_t)0.5195312500000f, +(float16_t)-0.8637695312500f,(float16_t)0.5034179687500f, +(float16_t)-0.8730468750000f,(float16_t)0.4875488281250f, +(float16_t)-0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)-0.8906250000000f,(float16_t)0.4550781250000f, +(float16_t)-0.8984375000000f,(float16_t)0.4387207031250f, +(float16_t)-0.9067382812500f,(float16_t)0.4221191406250f, +(float16_t)-0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)-0.9213867187500f,(float16_t)0.3884277343750f, +(float16_t)-0.9287109375000f,(float16_t)0.3713378906250f, +(float16_t)-0.9350585937500f,(float16_t)0.3542480468750f, +(float16_t)-0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)-0.9477539062500f,(float16_t)0.3195800781250f, +(float16_t)-0.9531250000000f,(float16_t)0.3020019531250f, +(float16_t)-0.9584960937500f,(float16_t)0.2844238281250f, +(float16_t)-0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)-0.9687500000000f,(float16_t)0.2489013671875f, +(float16_t)-0.9731445312500f,(float16_t)0.2310791015625f, +(float16_t)-0.9770507812500f,(float16_t)0.2131347656250f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)-0.9843750000000f,(float16_t)0.1770019531250f, +(float16_t)-0.9873046875000f,(float16_t)0.1588134765625f, +(float16_t)-0.9902343750000f,(float16_t)0.1406250000000f, +(float16_t)-0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)-0.9946289062500f,(float16_t)0.1041259765625f, +(float16_t)-0.9960937500000f,(float16_t)0.0858154296875f, +(float16_t)-0.9975585937500f,(float16_t)0.0674438476562f, +(float16_t)-0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)-0.9995117187500f,(float16_t)0.0306701660156f, +(float16_t)-1.0000000000000f,(float16_t)0.0122680664062f, +(float16_t)-1.0000000000000f,(float16_t)-0.0061340332031f, +(float16_t)-0.9995117187500f,(float16_t)-0.0245361328125f, +(float16_t)-0.9990234375000f,(float16_t)-0.0429382324219f, +(float16_t)-0.9980468750000f,(float16_t)-0.0613098144531f, +(float16_t)-0.9965820312500f,(float16_t)-0.0797119140625f, +(float16_t)-0.9951171875000f,(float16_t)-0.0980224609375f, +(float16_t)-0.9931640625000f,(float16_t)-0.1163330078125f, +(float16_t)-0.9907226562500f,(float16_t)-0.1345214843750f, +(float16_t)-0.9882812500000f,(float16_t)-0.1528320312500f, +(float16_t)-0.9853515625000f,(float16_t)-0.1710205078125f, +(float16_t)-0.9819335937500f,(float16_t)-0.1890869140625f, +(float16_t)-0.9785156250000f,(float16_t)-0.2071533203125f, +(float16_t)-0.9741210937500f,(float16_t)-0.2250976562500f, +(float16_t)-0.9702148437500f,(float16_t)-0.2429199218750f, +(float16_t)-0.9653320312500f,(float16_t)-0.2607421875000f, +(float16_t)-0.9604492187500f,(float16_t)-0.2785644531250f, +(float16_t)-0.9550781250000f,(float16_t)-0.2961425781250f, +(float16_t)-0.9497070312500f,(float16_t)-0.3137207031250f, +(float16_t)-0.9433593750000f,(float16_t)-0.3310546875000f, +(float16_t)-0.9375000000000f,(float16_t)-0.3483886718750f, +(float16_t)-0.9306640625000f,(float16_t)-0.3657226562500f, +(float16_t)-0.9238281250000f,(float16_t)-0.3825683593750f, +(float16_t)-0.9165039062500f,(float16_t)-0.3996582031250f, +(float16_t)-0.9091796875000f,(float16_t)-0.4165039062500f, +(float16_t)-0.9013671875000f,(float16_t)-0.4331054687500f, +(float16_t)-0.8930664062500f,(float16_t)-0.4497070312500f, +(float16_t)-0.8847656250000f,(float16_t)-0.4660644531250f, +(float16_t)-0.8759765625000f,(float16_t)-0.4821777343750f, +(float16_t)-0.8671875000000f,(float16_t)-0.4982910156250f, +(float16_t)-0.8579101562500f,(float16_t)-0.5141601562500f, +(float16_t)-0.8481445312500f,(float16_t)-0.5297851562500f, +(float16_t)-0.8383789062500f,(float16_t)-0.5454101562500f, +(float16_t)-0.8281250000000f,(float16_t)-0.5605468750000f, +(float16_t)-0.8173828125000f,(float16_t)-0.5756835937500f, +(float16_t)-0.8066406250000f,(float16_t)-0.5908203125000f, +(float16_t)-0.7958984375000f,(float16_t)-0.6054687500000f, +(float16_t)-0.7846679687500f,(float16_t)-0.6201171875000f, +(float16_t)-0.7729492187500f,(float16_t)-0.6342773437500f, +(float16_t)-0.7612304687500f,(float16_t)-0.6484375000000f, +(float16_t)-0.7490234375000f,(float16_t)-0.6625976562500f, +(float16_t)-0.7368164062500f,(float16_t)-0.6762695312500f, +(float16_t)-0.7241210937500f,(float16_t)-0.6894531250000f, +(float16_t)-0.7114257812500f,(float16_t)-0.7026367187500f, +(float16_t)-0.6982421875000f,(float16_t)-0.7158203125000f, +(float16_t)-0.6850585937500f,(float16_t)-0.7285156250000f, +(float16_t)-0.6713867187500f,(float16_t)-0.7407226562500f, +(float16_t)-0.6577148437500f,(float16_t)-0.7534179687500f, +(float16_t)-0.6440429687500f,(float16_t)-0.7651367187500f, +(float16_t)-0.6293945312500f,(float16_t)-0.7768554687500f, +(float16_t)-0.6152343750000f,(float16_t)-0.7885742187500f, +(float16_t)-0.6005859375000f,(float16_t)-0.7993164062500f, +(float16_t)-0.5859375000000f,(float16_t)-0.8105468750000f, +(float16_t)-0.5708007812500f,(float16_t)-0.8212890625000f, +(float16_t)-0.5556640625000f,(float16_t)-0.8315429687500f, +(float16_t)-0.5400390625000f,(float16_t)-0.8417968750000f, +(float16_t)-0.5244140625000f,(float16_t)-0.8515625000000f, +(float16_t)-0.5087890625000f,(float16_t)-0.8608398437500f, +(float16_t)-0.4929199218750f,(float16_t)-0.8701171875000f, +(float16_t)-0.4768066406250f,(float16_t)-0.8789062500000f, +(float16_t)-0.4604492187500f,(float16_t)-0.8876953125000f, +(float16_t)-0.4440917968750f,(float16_t)-0.8959960937500f, +(float16_t)-0.4274902343750f,(float16_t)-0.9038085937500f, +(float16_t)-0.4108886718750f,(float16_t)-0.9116210937500f, +(float16_t)-0.3940429687500f,(float16_t)-0.9189453125000f, +(float16_t)-0.3769531250000f,(float16_t)-0.9262695312500f, +(float16_t)-0.3598632812500f,(float16_t)-0.9331054687500f, +(float16_t)-0.3427734375000f,(float16_t)-0.9394531250000f, +(float16_t)-0.3251953125000f,(float16_t)-0.9458007812500f, +(float16_t)-0.3078613281250f,(float16_t)-0.9516601562500f, +(float16_t)-0.2902832031250f,(float16_t)-0.9570312500000f, +(float16_t)-0.2727050781250f,(float16_t)-0.9619140625000f, +(float16_t)-0.2548828125000f,(float16_t)-0.9667968750000f, +(float16_t)-0.2370605468750f,(float16_t)-0.9716796875000f, +(float16_t)-0.2191162109375f,(float16_t)-0.9755859375000f, +(float16_t)-0.2010498046875f,(float16_t)-0.9794921875000f, +(float16_t)-0.1829833984375f,(float16_t)-0.9829101562500f, +(float16_t)-0.1649169921875f,(float16_t)-0.9863281250000f, +(float16_t)-0.1467285156250f,(float16_t)-0.9892578125000f, +(float16_t)-0.1285400390625f,(float16_t)-0.9916992187500f, +(float16_t)-0.1102294921875f,(float16_t)-0.9941406250000f, +(float16_t)-0.0919189453125f,(float16_t)-0.9956054687500f, +(float16_t)-0.0735473632812f,(float16_t)-0.9970703125000f, +(float16_t)-0.0552062988281f,(float16_t)-0.9985351562500f, +(float16_t)-0.0368041992188f,(float16_t)-0.9995117187500f, +(float16_t)-0.0184020996094f,(float16_t)-1.0000000000000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)-0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)-0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)-0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)-0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)-0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)-0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)-0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)-0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)-0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)-0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)-0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)-0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)-0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)-0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)-0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)-0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)-0.9995117187500f,(float16_t)-0.0245361328125f, +(float16_t)-0.9951171875000f,(float16_t)-0.0980224609375f, +(float16_t)-0.9853515625000f,(float16_t)-0.1710205078125f, +(float16_t)-0.9702148437500f,(float16_t)-0.2429199218750f, +(float16_t)-0.9497070312500f,(float16_t)-0.3137207031250f, +(float16_t)-0.9238281250000f,(float16_t)-0.3825683593750f, +(float16_t)-0.8930664062500f,(float16_t)-0.4497070312500f, +(float16_t)-0.8579101562500f,(float16_t)-0.5141601562500f, +(float16_t)-0.8173828125000f,(float16_t)-0.5756835937500f, +(float16_t)-0.7729492187500f,(float16_t)-0.6342773437500f, +(float16_t)-0.7241210937500f,(float16_t)-0.6894531250000f, +(float16_t)-0.6713867187500f,(float16_t)-0.7407226562500f, +(float16_t)-0.6152343750000f,(float16_t)-0.7885742187500f, +(float16_t)-0.5556640625000f,(float16_t)-0.8315429687500f, +(float16_t)-0.4929199218750f,(float16_t)-0.8701171875000f, +(float16_t)-0.4274902343750f,(float16_t)-0.9038085937500f, +(float16_t)-0.3598632812500f,(float16_t)-0.9331054687500f, +(float16_t)-0.2902832031250f,(float16_t)-0.9570312500000f, +(float16_t)-0.2191162109375f,(float16_t)-0.9755859375000f, +(float16_t)-0.1467285156250f,(float16_t)-0.9892578125000f, +(float16_t)-0.0735473632812f,(float16_t)-0.9970703125000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)-0.9951171875000f,(float16_t)-0.0980224609375f, +(float16_t)-0.9238281250000f,(float16_t)-0.3825683593750f, +(float16_t)-0.7729492187500f,(float16_t)-0.6342773437500f, +(float16_t)-0.5556640625000f,(float16_t)-0.8315429687500f, +(float16_t)-0.2902832031250f,(float16_t)-0.9570312500000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.9238281250000f,(float16_t)-0.3825683593750f,}; #endif @@ -1468,4102 +1471,4102 @@ uint32_t rearranged_twiddle_tab_stride3_arr_4096_f16[6]={ 0,2048,2560,2688,2720,0,}; float16_t rearranged_twiddle_stride1_4096_f16[2728]={ -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99999882345170187925f,(float16_t)0.00153398018628476550f, -(float16_t)0.99999529380957619118f,(float16_t)0.00306795676296597614f, -(float16_t)0.99998941108192840321f,(float16_t)0.00460192612044857050f, -(float16_t)0.99998117528260110909f,(float16_t)0.00613588464915447527f, -(float16_t)0.99997058643097413988f,(float16_t)0.00766982873953109701f, -(float16_t)0.99995764455196389786f,(float16_t)0.00920375478205981944f, -(float16_t)0.99994234967602391162f,(float16_t)0.01073765916726449055f, -(float16_t)0.99992470183914450299f,(float16_t)0.01227153828571992539f, -(float16_t)0.99990470108285289808f,(float16_t)0.01380538852806039059f, -(float16_t)0.99988234745421256111f,(float16_t)0.01533920628498810015f, -(float16_t)0.99985764100582386060f,(float16_t)0.01687298794728171042f, -(float16_t)0.99983058179582340319f,(float16_t)0.01840672990580482019f, -(float16_t)0.99980116988788425569f,(float16_t)0.01994042855151444138f, -(float16_t)0.99976940535121527898f,(float16_t)0.02147408027546950787f, -(float16_t)0.99973528826056168306f,(float16_t)0.02300768146883936868f, -(float16_t)0.99969881869620424997f,(float16_t)0.02454122852291228812f, -(float16_t)0.99965999674395922270f,(float16_t)0.02607471782910390085f, -(float16_t)0.99961882249517863830f,(float16_t)0.02760814577896573974f, -(float16_t)0.99957529604674921764f,(float16_t)0.02914150876419372219f, -(float16_t)0.99952941750109314256f,(float16_t)0.03067480317663662595f, -(float16_t)0.99948118696616694567f,(float16_t)0.03220802540830458582f, -(float16_t)0.99943060455546173237f,(float16_t)0.03374117185137757990f, -(float16_t)0.99937767038800284780f,(float16_t)0.03527423889821394709f, -(float16_t)0.99932238458834954375f,(float16_t)0.03680722294135883171f, -(float16_t)0.99926474728659442359f,(float16_t)0.03834012037355269409f, -(float16_t)0.99920475861836388631f,(float16_t)0.03987292758773981066f, -(float16_t)0.99914241872481690532f,(float16_t)0.04140564097707673946f, -(float16_t)0.99907772775264536147f,(float16_t)0.04293825693494082024f, -(float16_t)0.99901068585407337697f,(float16_t)0.04447077185493866769f, -(float16_t)0.99894129318685687124f,(float16_t)0.04600318213091462299f, -(float16_t)0.99886954991428356099f,(float16_t)0.04753548415695930257f, -(float16_t)0.99879545620517240501f,(float16_t)0.04906767432741801493f, -(float16_t)0.99871901223387293811f,(float16_t)0.05059974903689928166f, -(float16_t)0.99864021818026527111f,(float16_t)0.05213170468028332366f, -(float16_t)0.99855907422975931365f,(float16_t)0.05366353765273051968f, -(float16_t)0.99847558057329477421f,(float16_t)0.05519524434968993420f, -(float16_t)0.99838973740734016094f,(float16_t)0.05672682116690774823f, -(float16_t)0.99830154493389289261f,(float16_t)0.05825826450043575244f, -(float16_t)0.99821100336047818846f,(float16_t)0.05978957074663986820f, -(float16_t)0.99811811290014917919f,(float16_t)0.06132073630220857829f, -(float16_t)0.99802287377148624081f,(float16_t)0.06285175756416140624f, -(float16_t)0.99792528619859599548f,(float16_t)0.06438263092985746505f, -(float16_t)0.99782535041111164453f,(float16_t)0.06591335279700380467f, -(float16_t)0.99772306664419163624f,(float16_t)0.06744391956366405094f, -(float16_t)0.99761843513851955478f,(float16_t)0.06897432762826674613f, -(float16_t)0.99751145614030345410f,(float16_t)0.07050457338961385600f, -(float16_t)0.99740212990127530279f,(float16_t)0.07203465324688933247f, -(float16_t)0.99729045667869020697f,(float16_t)0.07356456359966742631f, -(float16_t)0.99717643673532618820f,(float16_t)0.07509430084792130533f, -(float16_t)0.99706007033948296225f,(float16_t)0.07662386139203149205f, -(float16_t)0.99694135776498216117f,(float16_t)0.07815324163279423197f, -(float16_t)0.99682029929116566791f,(float16_t)0.07968243797143012563f, -(float16_t)0.99669689520289606044f,(float16_t)0.08121144680959244133f, -(float16_t)0.99657114579055483539f,(float16_t)0.08274026454937569164f, -(float16_t)0.99644305135004263008f,(float16_t)0.08426888759332407108f, -(float16_t)0.99631261218277800129f,(float16_t)0.08579731234443989385f, -(float16_t)0.99617982859569698117f,(float16_t)0.08732553520619205922f, -(float16_t)0.99604470090125196702f,(float16_t)0.08885355258252460031f, -(float16_t)0.99590722941741172125f,(float16_t)0.09038136087786498296f, -(float16_t)0.99576741446765981713f,(float16_t)0.09190895649713272386f, -(float16_t)0.99562525638099430569f,(float16_t)0.09343633584574778661f, -(float16_t)0.99548075549192693856f,(float16_t)0.09496349532963899165f, -(float16_t)0.99533391214048227980f,(float16_t)0.09649043135525259274f, -(float16_t)0.99518472667219692873f,(float16_t)0.09801714032956060363f, -(float16_t)0.99503319943811863180f,(float16_t)0.09954361866006931903f, -(float16_t)0.99487933079480561638f,(float16_t)0.10106986275482782167f, -(float16_t)0.99472312110432570265f,(float16_t)0.10259586902243628126f, -(float16_t)0.99456457073425541537f,(float16_t)0.10412163387205458642f, -(float16_t)0.99440368005767909576f,(float16_t)0.10564715371341061589f, -(float16_t)0.99424044945318790223f,(float16_t)0.10717242495680884273f, -(float16_t)0.99407487930487936634f,(float16_t)0.10869744401313871651f, -(float16_t)0.99390697000235606051f,(float16_t)0.11022220729388305938f, -(float16_t)0.99373672194072459884f,(float16_t)0.11174671121112658700f, -(float16_t)0.99356413552059530403f,(float16_t)0.11327095217756434631f, -(float16_t)0.99338921114808065305f,(float16_t)0.11479492660651008373f, -(float16_t)0.99321194923479450001f,(float16_t)0.11631863091190475235f, -(float16_t)0.99303235019785141002f,(float16_t)0.11784206150832497728f, -(float16_t)0.99285041445986510489f,(float16_t)0.11936521481099135467f, -(float16_t)0.99266614244894801899f,(float16_t)0.12088808723577708359f, -(float16_t)0.99247953459870996706f,(float16_t)0.12241067519921619566f, -(float16_t)0.99229059134825736699f,(float16_t)0.12393297511851215920f, -(float16_t)0.99209931314219179654f,(float16_t)0.12545498341154623367f, -(float16_t)0.99190570043060932726f,(float16_t)0.12697669649688586579f, -(float16_t)0.99170975366909952520f,(float16_t)0.12849811079379316880f, -(float16_t)0.99151147331874389668f,(float16_t)0.13001922272223334631f, -(float16_t)0.99131085984611544415f,(float16_t)0.13154002870288311611f, -(float16_t)0.99110791372327688986f,(float16_t)0.13306052515713906459f, -(float16_t)0.99090263542778000971f,(float16_t)0.13458070850712616773f, -(float16_t)0.99069502544266463406f,(float16_t)0.13610057517570620100f, -(float16_t)0.99048508425645709341f,(float16_t)0.13762012158648603832f, -(float16_t)0.99027281236316910817f,(float16_t)0.13913934416382620074f, -(float16_t)0.99005821026229712256f,(float16_t)0.14065823933284921088f, -(float16_t)0.98984127845882052821f,(float16_t)0.14217680351944803063f, -(float16_t)0.98962201746320088702f,(float16_t)0.14369503315029447110f, -(float16_t)0.98940042779138037687f,(float16_t)0.14521292465284746376f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.98895026451030298986f,(float16_t)0.14824767898689603096f, -(float16_t)0.98872169196032377858f,(float16_t)0.14976453467732150915f, -(float16_t)0.98849079285269658701f,(float16_t)0.15128103795733022219f, -(float16_t)0.98825756773074946437f,(float16_t)0.15279718525844343535f, -(float16_t)0.98802201714328352633f,(float16_t)0.15431297301302010494f, -(float16_t)0.98778414164457217783f,(float16_t)0.15582839765426523271f, -(float16_t)0.98754394179435922574f,(float16_t)0.15734345561623824805f, -(float16_t)0.98730141815785843473f,(float16_t)0.15885814333386144570f, -(float16_t)0.98705657130575097380f,(float16_t)0.16037245724292828464f, -(float16_t)0.98680940181418552726f,(float16_t)0.16188639378011182579f, -(float16_t)0.98655991026477540817f,(float16_t)0.16339994938297322524f, -(float16_t)0.98630809724459866938f,(float16_t)0.16491312048996989437f, -(float16_t)0.98605396334619543897f,(float16_t)0.16642590354046410406f, -(float16_t)0.98579750916756747614f,(float16_t)0.16793829497473117263f, -(float16_t)0.98553873531217606185f,(float16_t)0.16945029123396795900f, -(float16_t)0.98527764238894122162f,(float16_t)0.17096188876030121717f, -(float16_t)0.98501423101223983814f,(float16_t)0.17247308399679595059f, -(float16_t)0.98474850180190420801f,(float16_t)0.17398387338746382214f, -(float16_t)0.98448045538322093151f,(float16_t)0.17549425337727142526f, -(float16_t)0.98421009238692902521f,(float16_t)0.17700422041214874946f, -(float16_t)0.98393741344921892278f,(float16_t)0.17851377093899750692f, -(float16_t)0.98366241921173025453f,(float16_t)0.18002290140569951471f, -(float16_t)0.98338511032155118130f,(float16_t)0.18153160826112496595f, -(float16_t)0.98310548743121628501f,(float16_t)0.18303988795514095078f, -(float16_t)0.98282355119870523641f,(float16_t)0.18454773693861961648f, -(float16_t)0.98253930228744124076f,(float16_t)0.18605515166344663291f, -(float16_t)0.98225274136628937249f,(float16_t)0.18756212858252960252f, -(float16_t)0.98196386910955524296f,(float16_t)0.18906866414980619262f, -(float16_t)0.98167268619698311305f,(float16_t)0.19057475482025273972f, -(float16_t)0.98137919331375456089f,(float16_t)0.19208039704989243734f, -(float16_t)0.98108339115048670553f,(float16_t)0.19358558729580360724f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.98048486177346938497f,(float16_t)0.19659459767008022335f, -(float16_t)0.98018213596811742949f,(float16_t)0.19809841071795356027f, -(float16_t)0.97987710369951763756f,(float16_t)0.19960175762113097075f, -(float16_t)0.97956976568544051887f,(float16_t)0.20110463484209190055f, -(float16_t)0.97926012264908202098f,(float16_t)0.20260703884442113343f, -(float16_t)0.97894817531906219710f,(float16_t)0.20410896609281686809f, -(float16_t)0.97863392442942320759f,(float16_t)0.20561041305309923910f, -(float16_t)0.97831737071962765473f,(float16_t)0.20711137619221856032f, -(float16_t)0.97799851493455713936f,(float16_t)0.20861185197826348503f, -(float16_t)0.97767735782450992943f,(float16_t)0.21011183688046961016f, -(float16_t)0.97735390014519996082f,(float16_t)0.21161132736922755315f, -(float16_t)0.97702814265775439484f,(float16_t)0.21311031991609136194f, -(float16_t)0.97670008612871184184f,(float16_t)0.21460881099378675829f, -(float16_t)0.97636973133002114000f,(float16_t)0.21610679707621952006f, -(float16_t)0.97603707903903902388f,(float16_t)0.21760427463848364127f, -(float16_t)0.97570213003852857003f,(float16_t)0.21910124015686979759f, -(float16_t)0.97536488511665697665f,(float16_t)0.22059769010887350649f, -(float16_t)0.97502534506699412020f,(float16_t)0.22209362097320350937f, -(float16_t)0.97468351068851066810f,(float16_t)0.22358902922978998729f, -(float16_t)0.97433938278557585821f,(float16_t)0.22508391135979283204f, -(float16_t)0.97399296216795583359f,(float16_t)0.22657826384561000066f, -(float16_t)0.97364424965081197705f,(float16_t)0.22807208317088573102f, -(float16_t)0.97329324605469824672f,(float16_t)0.22956536582051886852f, -(float16_t)0.97293995220556017678f,(float16_t)0.23105810828067110951f, -(float16_t)0.97258436893473221296f,(float16_t)0.23255030703877524467f, -(float16_t)0.97222649707893626925f,(float16_t)0.23404195858354343018f, -(float16_t)0.97186633748027939639f,(float16_t)0.23553305940497548665f, -(float16_t)0.97150389098625178352f,(float16_t)0.23702360599436719801f, -(float16_t)0.97113915844972509284f,(float16_t)0.23851359484431841618f, -(float16_t)0.97077214072895035013f,(float16_t)0.24000302244874149871f, -(float16_t)0.97040283868755550234f,(float16_t)0.24149188530286933019f, -(float16_t)0.97003125319454397424f,(float16_t)0.24298017990326387094f, -(float16_t)0.96965738512429244800f,(float16_t)0.24446790274782415064f, -(float16_t)0.96928123535654853171f,(float16_t)0.24595505033579459497f, -(float16_t)0.96890280477642887202f,(float16_t)0.24744161916777326904f, -(float16_t)0.96852209427441737777f,(float16_t)0.24892760574572014853f, -(float16_t)0.96813910474636244441f,(float16_t)0.25041300657296522436f, -(float16_t)0.96775383709347551076f,(float16_t)0.25189781815421696809f, -(float16_t)0.96736629222232850545f,(float16_t)0.25338203699557015902f, -(float16_t)0.96697647104485207059f,(float16_t)0.25486565960451457169f, -(float16_t)0.96658437447833311928f,(float16_t)0.25634868248994291395f, -(float16_t)0.96619000344541250413f,(float16_t)0.25783110216215898713f, -(float16_t)0.96579335887408368500f,(float16_t)0.25931291513288623474f, -(float16_t)0.96539444169768939830f,(float16_t)0.26079411791527551401f, -(float16_t)0.96499325285492032478f,(float16_t)0.26227470702391358914f, -(float16_t)0.96458979328981275803f,(float16_t)0.26375467897483134694f, -(float16_t)0.96418406395174582890f,(float16_t)0.26523403028551179039f, -(float16_t)0.96377606579543984022f,(float16_t)0.26671275747489836538f, -(float16_t)0.96336579978095404631f,(float16_t)0.26819085706340317632f, -(float16_t)0.96295326687368387741f,(float16_t)0.26966832557291509076f, -(float16_t)0.96253846804435916340f,(float16_t)0.27114515952680801059f, -(float16_t)0.96212140426904158019f,(float16_t)0.27262135544994897662f, -(float16_t)0.96170207652912254037f,(float16_t)0.27409690986870638429f, -(float16_t)0.96128048581132063966f,(float16_t)0.27557181931095814376f, -(float16_t)0.96085663310767965850f,(float16_t)0.27704608030609989555f, -(float16_t)0.96043051941556578655f,(float16_t)0.27851968938505305973f, -(float16_t)0.96000214573766595727f,(float16_t)0.27999264308027321801f, -(float16_t)0.95957151308198451733f,(float16_t)0.28146493792575794091f, -(float16_t)0.95913862246184189431f,(float16_t)0.28293657045705539188f, -(float16_t)0.95870347489587159906f,(float16_t)0.28440753721127187692f, -(float16_t)0.95826607140801767226f,(float16_t)0.28587783472708061527f, -(float16_t)0.95782641302753290802f,(float16_t)0.28734745954472951102f, -(float16_t)0.95738450078897585627f,(float16_t)0.28881640820604947972f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.95649391890239510161f,(float16_t)0.29175226323498926195f, -(float16_t)0.95604525134999640557f,(float16_t)0.29321916269425862822f, -(float16_t)0.95559433413077110586f,(float16_t)0.29468537218051432669f, -(float16_t)0.95514116830577078243f,(float16_t)0.29615088824362378883f, -(float16_t)0.95468575494133833814f,(float16_t)0.29761570743508619641f, -(float16_t)0.95422809510910566733f,(float16_t)0.29907982630804047508f, -(float16_t)0.95376818988599032512f,(float16_t)0.30054324141727345454f, -(float16_t)0.95330604035419386211f,(float16_t)0.30200594931922808417f, -(float16_t)0.95284164760119871573f,(float16_t)0.30346794657201131562f, -(float16_t)0.95237501271976587880f,(float16_t)0.30492922973540237397f, -(float16_t)0.95190613680793234597f,(float16_t)0.30638979537086091787f, -(float16_t)0.95143502096900833820f,(float16_t)0.30784964004153486661f, -(float16_t)0.95096166631157508231f,(float16_t)0.30930876031226872680f, -(float16_t)0.95048607394948170235f,(float16_t)0.31076715274961147495f, -(float16_t)0.95000824500184299914f,(float16_t)0.31222481392182488413f, -(float16_t)0.94952818059303667475f,(float16_t)0.31368174039889151761f, -(float16_t)0.94904588185270055689f,(float16_t)0.31513792875252244485f, -(float16_t)0.94856134991573026749f,(float16_t)0.31659337555616584581f, -(float16_t)0.94807458592227622507f,(float16_t)0.31804807738501494896f, -(float16_t)0.94758559101774109124f,(float16_t)0.31950203081601569188f, -(float16_t)0.94709436635277721717f,(float16_t)0.32095523242787521445f, -(float16_t)0.94660091308328353499f,(float16_t)0.32240767880106985244f, -(float16_t)0.94610523237040344835f,(float16_t)0.32385936651785285356f, -(float16_t)0.94560732538052127971f,(float16_t)0.32531029216226292622f, -(float16_t)0.94510719328526060501f,(float16_t)0.32676045232013173347f, -(float16_t)0.94460483726148025685f,(float16_t)0.32820984357909249729f, -(float16_t)0.94410025849127265918f,(float16_t)0.32965846252858749255f, -(float16_t)0.94359345816196038559f,(float16_t)0.33110630575987642921f, -(float16_t)0.94308443746609349478f,(float16_t)0.33255336986604422389f, -(float16_t)0.94257319760144686605f,(float16_t)0.33399965144200938205f, -(float16_t)0.94205973977101731265f,(float16_t)0.33544514708453160301f, -(float16_t)0.94154406518302080631f,(float16_t)0.33688985339222005111f, -(float16_t)0.94102617505088925753f,(float16_t)0.33833376696554112728f, -(float16_t)0.94050607059326829518f,(float16_t)0.33977688440682685123f, -(float16_t)0.93998375303401404679f,(float16_t)0.34121920232028235542f, -(float16_t)0.93945922360218991898f,(float16_t)0.34266071731199437833f, -(float16_t)0.93893248353206459900f,(float16_t)0.34410142598993881391f, -(float16_t)0.93840353406310805795f,(float16_t)0.34554132496398909380f, -(float16_t)0.93787237643998988545f,(float16_t)0.34698041084592368133f, -(float16_t)0.93733901191257495977f,(float16_t)0.34841868024943456472f, -(float16_t)0.93680344173592156043f,(float16_t)0.34985612979013491763f, -(float16_t)0.93626566717027825959f,(float16_t)0.35129275608556709276f, -(float16_t)0.93572568948108036935f,(float16_t)0.35272855575521072646f, -(float16_t)0.93518350993894761025f,(float16_t)0.35416352542049034380f, -(float16_t)0.93463912981968078064f,(float16_t)0.35559766170478385172f, -(float16_t)0.93409255040425887007f,(float16_t)0.35703096123342997759f, -(float16_t)0.93354377297883617270f,(float16_t)0.35846342063373654030f, -(float16_t)0.93299279883473895669f,(float16_t)0.35989503653498811087f, -(float16_t)0.93243962926846235550f,(float16_t)0.36132580556845428355f, -(float16_t)0.93188426558166814750f,(float16_t)0.36275572436739722537f, -(float16_t)0.93132670908118042608f,(float16_t)0.36418478956707989180f, -(float16_t)0.93076696107898371224f,(float16_t)0.36561299780477385379f, -(float16_t)0.93020502289221906889f,(float16_t)0.36704034571976718038f, -(float16_t)0.92964089584318121418f,(float16_t)0.36846682995337232125f, -(float16_t)0.92907458125931585702f,(float16_t)0.36989244714893410038f, -(float16_t)0.92850608047321558924f,(float16_t)0.37131719395183754306f, -(float16_t)0.92793539482261788720f,(float16_t)0.37274106700951575855f, -(float16_t)0.92736252565040111495f,(float16_t)0.37416406297145793358f, -(float16_t)0.92678747430458174872f,(float16_t)0.37558617848921721505f, -(float16_t)0.92621024213831137928f,(float16_t)0.37700741021641825945f, -(float16_t)0.92563083050987271516f,(float16_t)0.37842775480876555960f, -(float16_t)0.92504924078267758425f,(float16_t)0.37984720892405116066f, -(float16_t)0.92446547432526260391f,(float16_t)0.38126576922216237620f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.92329141671952763559f,(float16_t)0.38410019501693504207f, -(float16_t)0.92270112833387862850f,(float16_t)0.38551605384391884890f, -(float16_t)0.92210866874334518339f,(float16_t)0.38693100551438858181f, -(float16_t)0.92151403934204190183f,(float16_t)0.38834504669882624617f, -(float16_t)0.92091724152918941204f,(float16_t)0.38975817406985641123f, -(float16_t)0.92031827670911059425f,(float16_t)0.39117038430225387069f, -(float16_t)0.91971714629122736095f,(float16_t)0.39258167407295146978f, -(float16_t)0.91911385169005777040f,(float16_t)0.39399204006104809883f, -(float16_t)0.91850839432521225181f,(float16_t)0.39540147894781635385f, -(float16_t)0.91790077562139049672f,(float16_t)0.39680998741671030805f, -(float16_t)0.91729099700837790632f,(float16_t)0.39821756215337356100f, -(float16_t)0.91667905992104270485f,(float16_t)0.39962419984564678810f, -(float16_t)0.91606496579933172075f,(float16_t)0.40102989718357562321f, -(float16_t)0.91544871608826783316f,(float16_t)0.40243465085941843018f, -(float16_t)0.91483031223794619713f,(float16_t)0.40383845756765407442f, -(float16_t)0.91420975570353069095f,(float16_t)0.40524131400498986100f, -(float16_t)0.91358704794525080750f,(float16_t)0.40664321687036902864f, -(float16_t)0.91296219042839821256f,(float16_t)0.40804416286497868782f, -(float16_t)0.91233518462332274801f,(float16_t)0.40944414869225759235f, -(float16_t)0.91170603200542987832f,(float16_t)0.41084317105790391089f, -(float16_t)0.91107473405517636067f,(float16_t)0.41224122666988288755f, -(float16_t)0.91044129225806724737f,(float16_t)0.41363831223843450235f, -(float16_t)0.90980570810465222209f,(float16_t)0.41503442447608163146f, -(float16_t)0.90916798309052238025f,(float16_t)0.41642956009763715253f, -(float16_t)0.90852811871630612117f,(float16_t)0.41782371582021227141f, -(float16_t)0.90788611648766626150f,(float16_t)0.41921688836322390515f, -(float16_t)0.90724197791529581636f,(float16_t)0.42060907444840250902f, -(float16_t)0.90659570451491533483f,(float16_t)0.42200027079979968159f, -(float16_t)0.90594729780726845902f,(float16_t)0.42339047414379604728f, -(float16_t)0.90529675931811881551f,(float16_t)0.42477968120910880589f, -(float16_t)0.90464409057824624050f,(float16_t)0.42616788872679961520f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.90333236849451181705f,(float16_t)0.42894129205532949278f, -(float16_t)0.90267331823725882600f,(float16_t)0.43032648134008261165f, -(float16_t)0.90201214390249317976f,(float16_t)0.43171065802505725895f, -(float16_t)0.90134884704602202810f,(float16_t)0.43309381885315195726f, -(float16_t)0.90068342922864685907f,(float16_t)0.43447596056965565037f, -(float16_t)0.90001589201616016833f,(float16_t)0.43585707992225547480f, -(float16_t)0.89934623697934157338f,(float16_t)0.43723717366104408732f, -(float16_t)0.89867446569395381673f,(float16_t)0.43861623853852765853f, -(float16_t)0.89800057974073987932f,(float16_t)0.43999427130963325583f, -(float16_t)0.89732458070541831763f,(float16_t)0.44137126873171667052f, -(float16_t)0.89664647017868015499f,(float16_t)0.44274722756457002282f, -(float16_t)0.89596624975618521791f,(float16_t)0.44412214457042920035f, -(float16_t)0.89528392103855758410f,(float16_t)0.44549601651398174074f, -(float16_t)0.89459948563138269595f,(float16_t)0.44686884016237415906f, -(float16_t)0.89391294514520325265f,(float16_t)0.44824061228521988598f, -(float16_t)0.89322430119551532446f,(float16_t)0.44961132965460653965f, -(float16_t)0.89253355540276457791f,(float16_t)0.45098098904510386387f, -(float16_t)0.89184070939234272313f,(float16_t)0.45234958723377088896f, -(float16_t)0.89114576479458318392f,(float16_t)0.45371712100016386993f, -(float16_t)0.89044872324475787817f,(float16_t)0.45508358712634383592f, -(float16_t)0.88974958638307277692f,(float16_t)0.45644898239688391772f, -(float16_t)0.88904835585466457371f,(float16_t)0.45781330359887717485f, -(float16_t)0.88834503330959635470f,(float16_t)0.45917654752194408951f, -(float16_t)0.88763962040285393496f,(float16_t)0.46053871095824000514f, -(float16_t)0.88693211879434219469f,(float16_t)0.46189979070246273141f, -(float16_t)0.88622253014888063838f,(float16_t)0.46325978355186014923f, -(float16_t)0.88551085613619995307f,(float16_t)0.46461868630623781584f, -(float16_t)0.88479709843093778954f,(float16_t)0.46597649576796618121f, -(float16_t)0.88408125871263498752f,(float16_t)0.46733320874198841510f, -(float16_t)0.88336333866573157891f,(float16_t)0.46868882203582790114f, -(float16_t)0.88264333997956279099f,(float16_t)0.47004333245959561971f, -(float16_t)0.88192126434835504956f,(float16_t)0.47139673682599764204f, -(float16_t)0.88119711347122209322f,(float16_t)0.47274903195034279069f, -(float16_t)0.88047088905216075450f,(float16_t)0.47410021465054996703f, -(float16_t)0.87974259280004740713f,(float16_t)0.47545028174715586733f, -(float16_t)0.87901222642863352519f,(float16_t)0.47679923006332208812f, -(float16_t)0.87827979165654157523f,(float16_t)0.47814705642484300885f, -(float16_t)0.87754529020726135258f,(float16_t)0.47949375766015295275f, -(float16_t)0.87680872380914565145f,(float16_t)0.48083933060033395845f, -(float16_t)0.87607009419540660122f,(float16_t)0.48218377207912271887f, -(float16_t)0.87532940310411089246f,(float16_t)0.48352707893291868579f, -(float16_t)0.87458665227817611321f,(float16_t)0.48486924800079106435f, -(float16_t)0.87384184346536686316f,(float16_t)0.48621027612448641797f, -(float16_t)0.87309497841829009079f,(float16_t)0.48755016014843599592f, -(float16_t)0.87234605889439154058f,(float16_t)0.48888889691976317176f, -(float16_t)0.87159508665595097909f,(float16_t)0.49022648328829115938f, -(float16_t)0.87084206347007897531f,(float16_t)0.49156291610654989643f, -(float16_t)0.87008699110871146054f,(float16_t)0.49289819222978403790f, -(float16_t)0.86932987134860684186f,(float16_t)0.49423230851595967295f, -(float16_t)0.86857070597134089507f,(float16_t)0.49556526182577254058f, -(float16_t)0.86780949676330332299f,(float16_t)0.49689704902265446895f, -(float16_t)0.86704624551569264845f,(float16_t)0.49822766697278181303f, -(float16_t)0.86628095402451299467f,(float16_t)0.49955711254508183838f, -(float16_t)0.86551362409056908920f,(float16_t)0.50088538261124071482f, -(float16_t)0.86474425751946237817f,(float16_t)0.50221247404571078832f, -(float16_t)0.86397285612158669643f,(float16_t)0.50353838372571757542f, -(float16_t)0.86319942171212415971f,(float16_t)0.50486310853126759035f, -(float16_t)0.86242395611104050168f,(float16_t)0.50618664534515522835f, -(float16_t)0.86164646114308129921f,(float16_t)0.50750899105297087033f, -(float16_t)0.86086693863776730939f,(float16_t)0.50883014254310698909f, -(float16_t)0.86008539042939013974f,(float16_t)0.51015009670676680908f, -(float16_t)0.85930181835700847337f,(float16_t)0.51146885043797030157f, -(float16_t)0.85851622426444273994f,(float16_t)0.51278640063356295542f, -(float16_t)0.85772861000027211809f,(float16_t)0.51410274419322166128f, -(float16_t)0.85693897741782876221f,(float16_t)0.51541787801946292724f, -(float16_t)0.85614732837519447184f,(float16_t)0.51673179901764987321f, -(float16_t)0.85535366473519602870f,(float16_t)0.51804450409599933636f, -(float16_t)0.85455798836540053376f,(float16_t)0.51935599016558964269f, -(float16_t)0.85376030113811141042f,(float16_t)0.52066625414036715735f, -(float16_t)0.85296060493036363059f,(float16_t)0.52197529293715438925f, -(float16_t)0.85215890162391982887f,(float16_t)0.52328310347565643035f, -(float16_t)0.85135519310526519554f,(float16_t)0.52458968267846894928f, -(float16_t)0.85054948126560347976f,(float16_t)0.52589502747108463065f, -(float16_t)0.84974176800085254868f,(float16_t)0.52719913478190127964f, -(float16_t)0.84893205521163961347f,(float16_t)0.52850200154222848337f, -(float16_t)0.84812034480329723252f,(float16_t)0.52980362468629460526f, -(float16_t)0.84730663868585831544f,(float16_t)0.53110400115125500076f, -(float16_t)0.84649093877405212627f,(float16_t)0.53240312787719790144f, -(float16_t)0.84567324698729906540f,(float16_t)0.53370100180715296379f, -(float16_t)0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)0.84403189549006640835f,(float16_t)0.53629297906596318235f, -(float16_t)0.84320823964184543620f,(float16_t)0.53758707629564539410f, -(float16_t)0.84238259964318584760f,(float16_t)0.53887990853100842248f, -(float16_t)0.84155497743689844370f,(float16_t)0.54017147272989285423f, -(float16_t)0.84072537497045807253f,(float16_t)0.54146176585312344454f, -(float16_t)0.83989379419599952126f,(float16_t)0.54275078486451588944f, -(float16_t)0.83906023707031274217f,(float16_t)0.54403852673088382019f, -(float16_t)0.83822470555483807875f,(float16_t)0.54532498842204646383f, -(float16_t)0.83738720161566193578f,(float16_t)0.54661016691083486041f, -(float16_t)0.83654772722351200542f,(float16_t)0.54789405917310018967f, -(float16_t)0.83570628435375260423f,(float16_t)0.54917666218771965525f, -(float16_t)0.83486287498638001026f,(float16_t)0.55045797293660481131f, -(float16_t)0.83401750110601813315f,(float16_t)0.55173798840470733573f, -(float16_t)0.83317016470191318511f,(float16_t)0.55301670558002746780f, -(float16_t)0.83232086776792968408f,(float16_t)0.55429412145362000341f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.83061640030884631436f,(float16_t)0.55684503727516010407f, -(float16_t)0.82976123379452304540f,(float16_t)0.55811853122055610221f, -(float16_t)0.82890411477186487499f,(float16_t)0.55939071185913613604f, -(float16_t)0.82804504525775579626f,(float16_t)0.56066157619733603124f, -(float16_t)0.82718402727366913130f,(float16_t)0.56193112124468935775f, -(float16_t)0.82632106284566353427f,(float16_t)0.56319934401383409117f, -(float16_t)0.82545615400437755138f,(float16_t)0.56446624152051938506f, -(float16_t)0.82458930278502529099f,(float16_t)0.56573181078361312046f, -(float16_t)0.82372051122739142759f,(float16_t)0.56699604882510867832f, -(float16_t)0.82284978137582642788f,(float16_t)0.56825895267013148970f, -(float16_t)0.82197711527924155472f,(float16_t)0.56952051934694714053f, -(float16_t)0.82110251499110464835f,(float16_t)0.57078074588696725566f, -(float16_t)0.82022598256943468620f,(float16_t)0.57203962932475704850f, -(float16_t)0.81934752007679700903f,(float16_t)0.57329716669804220430f, -(float16_t)0.81846712958029865792f,(float16_t)0.57455335504771576360f, -(float16_t)0.81758481315158371139f,(float16_t)0.57580819141784533866f, -(float16_t)0.81670057286682784525f,(float16_t)0.57706167285567944170f, -(float16_t)0.81581441080673378075f,(float16_t)0.57831379641165558958f, -(float16_t)0.81492632905652662156f,(float16_t)0.57956455913940563285f, -(float16_t)0.81403632970594841378f,(float16_t)0.58081395809576452649f, -(float16_t)0.81314441484925359394f,(float16_t)0.58206199034077543697f, -(float16_t)0.81225058658520399302f,(float16_t)0.58330865293769829094f, -(float16_t)0.81135484701706372945f,(float16_t)0.58455394295301532637f, -(float16_t)0.81045719825259476821f,(float16_t)0.58579785745643886408f, -(float16_t)0.80955764240405125864f,(float16_t)0.58704039352091796911f, -(float16_t)0.80865618158817498262f,(float16_t)0.58828154822264522306f, -(float16_t)0.80775281792619035848f,(float16_t)0.58952131864106394055f, -(float16_t)0.80684755354379933401f,(float16_t)0.59075970185887416442f, -(float16_t)0.80594039057117627944f,(float16_t)0.59199669496204099239f, -(float16_t)0.80503133114296365758f,(float16_t)0.59323229503979979516f, -(float16_t)0.80412037739826569549f,(float16_t)0.59446649918466443197f, -(float16_t)0.80320753148064494287f,(float16_t)0.59569930449243335691f, -(float16_t)0.80229279553811572168f,(float16_t)0.59693070806219639124f, -(float16_t)0.80137617172314024039f,(float16_t)0.59816070699634238395f, -(float16_t)0.80045766219262282082f,(float16_t)0.59938929840056454079f, -(float16_t)0.79953726910790501314f,(float16_t)0.60061647938386897305f, -(float16_t)0.79861499463476093297f,(float16_t)0.60184224705858002658f, -(float16_t)0.79769084094339115509f,(float16_t)0.60306659854034816437f, -(float16_t)0.79676481020841882774f,(float16_t)0.60428953094815596181f, -(float16_t)0.79583690460888356633f,(float16_t)0.60551104140432554512f, -(float16_t)0.79490712632823701256f,(float16_t)0.60673112703452447558f, -(float16_t)0.79397547755433717231f,(float16_t)0.60794978496777363208f, -(float16_t)0.79304196047944364167f,(float16_t)0.60916701233645320634f, -(float16_t)0.79210657730021238887f,(float16_t)0.61038280627630947528f, -(float16_t)0.79116933021769020318f,(float16_t)0.61159716392646190641f, -(float16_t)0.79023022143731003197f,(float16_t)0.61281008242940970820f, -(float16_t)0.78928925316888565167f,(float16_t)0.61402155893103849138f, -(float16_t)0.78834642762660622761f,(float16_t)0.61523159058062681925f, -(float16_t)0.78740174702903142911f,(float16_t)0.61644017453085364622f, -(float16_t)0.78645521359908576731f,(float16_t)0.61764730793780386886f, -(float16_t)0.78550682956405393220f,(float16_t)0.61885298796097631957f, -(float16_t)0.78455659715557524159f,(float16_t)0.62005721176328909561f, -(float16_t)0.78360451860963820092f,(float16_t)0.62125997651108755271f, -(float16_t)0.78265059616657572938f,(float16_t)0.62246127937414996723f, -(float16_t)0.78169483207105938671f,(float16_t)0.62366111752569453053f, -(float16_t)0.78073722857209448822f,(float16_t)0.62485948814238634341f, -(float16_t)0.77977778792301455368f,(float16_t)0.62605638840434352232f, -(float16_t)0.77881651238147597827f,(float16_t)0.62725181549514408275f, -(float16_t)0.77785340420945314754f,(float16_t)0.62844576660183271155f, -(float16_t)0.77688846567323244230f,(float16_t)0.62963823891492698426f, -(float16_t)0.77592169904340768660f,(float16_t)0.63082922962842447046f, -(float16_t)0.77495310659487393057f,(float16_t)0.63201873593980906207f, -(float16_t)0.77398269060682289844f,(float16_t)0.63320675505005719064f, -(float16_t)0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)0.77203639715038452351f,(float16_t)0.63557832048855611440f, -(float16_t)0.77106052426181381776f,(float16_t)0.63676186123628419899f, -(float16_t)0.77008283699334789674f,(float16_t)0.63794390362184405507f, -(float16_t)0.76910333764557969882f,(float16_t)0.63912444486377573138f, -(float16_t)0.76812202852336541881f,(float16_t)0.64030348218415167327f, -(float16_t)0.76713891193582040007f,(float16_t)0.64148101280858305095f, -(float16_t)0.76615399019631291733f,(float16_t)0.64265703396622686494f, -(float16_t)0.76516726562245895860f,(float16_t)0.64383154288979138613f, -(float16_t)0.76417874053611667406f,(float16_t)0.64500453681554392737f, -(float16_t)0.76318841726338138010f,(float16_t)0.64617601298331628357f, -(float16_t)0.76219629813457900891f,(float16_t)0.64734596863651205911f, -(float16_t)0.76120238548426177871f,(float16_t)0.64851440102211244110f, -(float16_t)0.76020668165120242055f,(float16_t)0.64968130739068319368f, -(float16_t)0.75920918897838796102f,(float16_t)0.65084668499638087535f, -(float16_t)0.75820990981301528144f,(float16_t)0.65201053109695950027f, -(float16_t)0.75720884650648456748f,(float16_t)0.65317284295377675551f, -(float16_t)0.75620600141439453523f,(float16_t)0.65433361783180044036f, -(float16_t)0.75520137689653654700f,(float16_t)0.65549285299961534967f, -(float16_t)0.75419497531688917125f,(float16_t)0.65665054572942893607f, -(float16_t)0.75318679904361252042f,(float16_t)0.65780669329707863735f, -(float16_t)0.75217685044904269986f,(float16_t)0.65896129298203731661f, -(float16_t)0.75116513190968636771f,(float16_t)0.66011434206742047870f, -(float16_t)0.75015164580621507273f,(float16_t)0.66126583783999226540f, -(float16_t)0.74913639452345937020f,(float16_t)0.66241577759017178373f, -(float16_t)0.74811938045040360379f,(float16_t)0.66356415861203976725f, -(float16_t)0.74710060598018013245f,(float16_t)0.66471097820334479334f, -(float16_t)0.74608007351006377927f,(float16_t)0.66585623366550972246f, -(float16_t)0.74505778544146594733f,(float16_t)0.66699992230363747137f, -(float16_t)0.74403374417992929057f,(float16_t)0.66814204142651845153f, -(float16_t)0.74300795213512171866f,(float16_t)0.66928258834663600929f, -(float16_t)0.74198041172083106787f,(float16_t)0.67042156038017308717f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.73992009545951620275f,(float16_t)0.67269476907077285777f, -(float16_t)0.73888732446061511361f,(float16_t)0.67382900037875603783f, -(float16_t)0.73785281478846598269f,(float16_t)0.67496164610201192513f, -(float16_t)0.73681656887736979300f,(float16_t)0.67609270357531592310f, -(float16_t)0.73577858916571359238f,(float16_t)0.67722217013718033485f, -(float16_t)0.73473887809596349907f,(float16_t)0.67835004312986146857f, -(float16_t)0.73369743811466026084f,(float16_t)0.67947631989936496666f, -(float16_t)0.73265427167241281570f,(float16_t)0.68060099779545302212f, -(float16_t)0.73160938122389262972f,(float16_t)0.68172407417164970767f, -(float16_t)0.73056276922782759087f,(float16_t)0.68284554638524808112f, -(float16_t)0.72951443814699701296f,(float16_t)0.68396541179731540350f, -(float16_t)0.72846439044822519637f,(float16_t)0.68508366777270035541f, -(float16_t)0.72741262860237576593f,(float16_t)0.68620031168003858824f, -(float16_t)0.72635915508434600873f,(float16_t)0.68731534089175905233f, -(float16_t)0.72530397237306076796f,(float16_t)0.68842875278409043638f, -(float16_t)0.72424708295146700276f,(float16_t)0.68954054473706682948f, -(float16_t)0.72318848930652745999f,(float16_t)0.69065071413453460458f, -(float16_t)0.72212819392921534511f,(float16_t)0.69175925836415774750f, -(float16_t)0.72106619931450810501f,(float16_t)0.69286617481742462932f, -(float16_t)0.72000250796138165477f,(float16_t)0.69397146088965389055f, -(float16_t)0.71893712237280449351f,(float16_t)0.69507511398000088043f, -(float16_t)0.71787004505573170920f,(float16_t)0.69617713149146298601f, -(float16_t)0.71680127852109953857f,(float16_t)0.69727751083088651551f, -(float16_t)0.71573082528381870571f,(float16_t)0.69837624940897280457f, -(float16_t)0.71465868786276909308f,(float16_t)0.69947334464028376733f, -(float16_t)0.71358486878079352422f,(float16_t)0.70056879394324833576f, -(float16_t)0.71250937056469243469f,(float16_t)0.70166259474016845488f, -(float16_t)0.71143219574521643356f,(float16_t)0.70275474445722529993f, -(float16_t)0.71035334685706241764f,(float16_t)0.70384524052448493858f, -(float16_t)0.70927282643886568891f,(float16_t)0.70493408037590488124f, -(float16_t)0.70819063703319540259f,(float16_t)0.70602126144933974317f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.70602126144933974317f,(float16_t)0.70819063703319540259f, -(float16_t)0.70493408037590499227f,(float16_t)0.70927282643886568891f, -(float16_t)0.70384524052448493858f,(float16_t)0.71035334685706241764f, -(float16_t)0.70275474445722529993f,(float16_t)0.71143219574521643356f, -(float16_t)0.70166259474016845488f,(float16_t)0.71250937056469232367f, -(float16_t)0.70056879394324844679f,(float16_t)0.71358486878079352422f, -(float16_t)0.69947334464028376733f,(float16_t)0.71465868786276909308f, -(float16_t)0.69837624940897291559f,(float16_t)0.71573082528381859468f, -(float16_t)0.69727751083088662654f,(float16_t)0.71680127852109942754f, -(float16_t)0.69617713149146298601f,(float16_t)0.71787004505573170920f, -(float16_t)0.69507511398000088043f,(float16_t)0.71893712237280438249f, -(float16_t)0.69397146088965400157f,(float16_t)0.72000250796138165477f, -(float16_t)0.69286617481742474034f,(float16_t)0.72106619931450810501f, -(float16_t)0.69175925836415774750f,(float16_t)0.72212819392921534511f, -(float16_t)0.69065071413453460458f,(float16_t)0.72318848930652734897f, -(float16_t)0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)0.68842875278409043638f,(float16_t)0.72530397237306076796f, -(float16_t)0.68731534089175905233f,(float16_t)0.72635915508434600873f, -(float16_t)0.68620031168003858824f,(float16_t)0.72741262860237576593f, -(float16_t)0.68508366777270035541f,(float16_t)0.72846439044822519637f, -(float16_t)0.68396541179731551452f,(float16_t)0.72951443814699690193f, -(float16_t)0.68284554638524808112f,(float16_t)0.73056276922782759087f, -(float16_t)0.68172407417164981869f,(float16_t)0.73160938122389262972f, -(float16_t)0.68060099779545302212f,(float16_t)0.73265427167241281570f, -(float16_t)0.67947631989936496666f,(float16_t)0.73369743811466026084f, -(float16_t)0.67835004312986146857f,(float16_t)0.73473887809596349907f, -(float16_t)0.67722217013718044587f,(float16_t)0.73577858916571348136f, -(float16_t)0.67609270357531603413f,(float16_t)0.73681656887736979300f, -(float16_t)0.67496164610201203615f,(float16_t)0.73785281478846598269f, -(float16_t)0.67382900037875614885f,(float16_t)0.73888732446061511361f, -(float16_t)0.67269476907077296879f,(float16_t)0.73992009545951609173f, -(float16_t)0.67155895484701833009f,(float16_t)0.74095112535495910588f, -(float16_t)0.67042156038017308717f,(float16_t)0.74198041172083095685f, -(float16_t)0.66928258834663600929f,(float16_t)0.74300795213512171866f, -(float16_t)0.66814204142651856255f,(float16_t)0.74403374417992929057f, -(float16_t)0.66699992230363747137f,(float16_t)0.74505778544146594733f, -(float16_t)0.66585623366550972246f,(float16_t)0.74608007351006366825f, -(float16_t)0.66471097820334490436f,(float16_t)0.74710060598018013245f, -(float16_t)0.66356415861203987827f,(float16_t)0.74811938045040349277f, -(float16_t)0.66241577759017178373f,(float16_t)0.74913639452345925918f, -(float16_t)0.66126583783999226540f,(float16_t)0.75015164580621496171f, -(float16_t)0.66011434206742047870f,(float16_t)0.75116513190968636771f, -(float16_t)0.65896129298203731661f,(float16_t)0.75217685044904269986f, -(float16_t)0.65780669329707874837f,(float16_t)0.75318679904361252042f, -(float16_t)0.65665054572942904709f,(float16_t)0.75419497531688917125f, -(float16_t)0.65549285299961546070f,(float16_t)0.75520137689653654700f, -(float16_t)0.65433361783180055138f,(float16_t)0.75620600141439453523f, -(float16_t)0.65317284295377686654f,(float16_t)0.75720884650648456748f, -(float16_t)0.65201053109695950027f,(float16_t)0.75820990981301528144f, -(float16_t)0.65084668499638098638f,(float16_t)0.75920918897838796102f, -(float16_t)0.64968130739068319368f,(float16_t)0.76020668165120242055f, -(float16_t)0.64851440102211255212f,(float16_t)0.76120238548426177871f, -(float16_t)0.64734596863651205911f,(float16_t)0.76219629813457889789f, -(float16_t)0.64617601298331639459f,(float16_t)0.76318841726338126907f, -(float16_t)0.64500453681554403840f,(float16_t)0.76417874053611667406f, -(float16_t)0.64383154288979149715f,(float16_t)0.76516726562245895860f, -(float16_t)0.64265703396622686494f,(float16_t)0.76615399019631280630f, -(float16_t)0.64148101280858316198f,(float16_t)0.76713891193582040007f, -(float16_t)0.64030348218415167327f,(float16_t)0.76812202852336530778f, -(float16_t)0.63912444486377573138f,(float16_t)0.76910333764557958780f, -(float16_t)0.63794390362184416610f,(float16_t)0.77008283699334789674f, -(float16_t)0.63676186123628419899f,(float16_t)0.77106052426181381776f, -(float16_t)0.63557832048855622542f,(float16_t)0.77203639715038441249f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.63320675505005719064f,(float16_t)0.77398269060682278742f, -(float16_t)0.63201873593980906207f,(float16_t)0.77495310659487381955f, -(float16_t)0.63082922962842458148f,(float16_t)0.77592169904340757558f, -(float16_t)0.62963823891492709528f,(float16_t)0.77688846567323244230f, -(float16_t)0.62844576660183271155f,(float16_t)0.77785340420945303652f, -(float16_t)0.62725181549514419377f,(float16_t)0.77881651238147586724f, -(float16_t)0.62605638840434352232f,(float16_t)0.77977778792301444266f, -(float16_t)0.62485948814238645443f,(float16_t)0.78073722857209448822f, -(float16_t)0.62366111752569464155f,(float16_t)0.78169483207105938671f, -(float16_t)0.62246127937415007825f,(float16_t)0.78265059616657572938f, -(float16_t)0.62125997651108766373f,(float16_t)0.78360451860963820092f, -(float16_t)0.62005721176328920663f,(float16_t)0.78455659715557524159f, -(float16_t)0.61885298796097631957f,(float16_t)0.78550682956405393220f, -(float16_t)0.61764730793780397988f,(float16_t)0.78645521359908576731f, -(float16_t)0.61644017453085364622f,(float16_t)0.78740174702903131809f, -(float16_t)0.61523159058062681925f,(float16_t)0.78834642762660622761f, -(float16_t)0.61402155893103849138f,(float16_t)0.78928925316888565167f, -(float16_t)0.61281008242940970820f,(float16_t)0.79023022143731003197f, -(float16_t)0.61159716392646201744f,(float16_t)0.79116933021769009216f, -(float16_t)0.61038280627630947528f,(float16_t)0.79210657730021227785f, -(float16_t)0.60916701233645320634f,(float16_t)0.79304196047944364167f, -(float16_t)0.60794978496777374311f,(float16_t)0.79397547755433717231f, -(float16_t)0.60673112703452447558f,(float16_t)0.79490712632823701256f, -(float16_t)0.60551104140432554512f,(float16_t)0.79583690460888345530f, -(float16_t)0.60428953094815607283f,(float16_t)0.79676481020841871672f, -(float16_t)0.60306659854034827539f,(float16_t)0.79769084094339104407f, -(float16_t)0.60184224705858002658f,(float16_t)0.79861499463476082195f, -(float16_t)0.60061647938386897305f,(float16_t)0.79953726910790501314f, -(float16_t)0.59938929840056454079f,(float16_t)0.80045766219262270980f, -(float16_t)0.59816070699634238395f,(float16_t)0.80137617172314012937f, -(float16_t)0.59693070806219650226f,(float16_t)0.80229279553811572168f, -(float16_t)0.59569930449243346793f,(float16_t)0.80320753148064483184f, -(float16_t)0.59446649918466454299f,(float16_t)0.80412037739826569549f, -(float16_t)0.59323229503979979516f,(float16_t)0.80503133114296365758f, -(float16_t)0.59199669496204099239f,(float16_t)0.80594039057117627944f, -(float16_t)0.59075970185887427544f,(float16_t)0.80684755354379922299f, -(float16_t)0.58952131864106394055f,(float16_t)0.80775281792619024746f, -(float16_t)0.58828154822264533408f,(float16_t)0.80865618158817498262f, -(float16_t)0.58704039352091808013f,(float16_t)0.80955764240405125864f, -(float16_t)0.58579785745643886408f,(float16_t)0.81045719825259476821f, -(float16_t)0.58455394295301532637f,(float16_t)0.81135484701706372945f, -(float16_t)0.58330865293769829094f,(float16_t)0.81225058658520388200f, -(float16_t)0.58206199034077554799f,(float16_t)0.81314441484925359394f, -(float16_t)0.58081395809576452649f,(float16_t)0.81403632970594830276f, -(float16_t)0.57956455913940574387f,(float16_t)0.81492632905652662156f, -(float16_t)0.57831379641165558958f,(float16_t)0.81581441080673378075f, -(float16_t)0.57706167285567955272f,(float16_t)0.81670057286682784525f, -(float16_t)0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)0.57455335504771576360f,(float16_t)0.81846712958029865792f, -(float16_t)0.57329716669804231532f,(float16_t)0.81934752007679689800f, -(float16_t)0.57203962932475704850f,(float16_t)0.82022598256943468620f, -(float16_t)0.57078074588696736669f,(float16_t)0.82110251499110464835f, -(float16_t)0.56952051934694725155f,(float16_t)0.82197711527924155472f, -(float16_t)0.56825895267013148970f,(float16_t)0.82284978137582631685f, -(float16_t)0.56699604882510867832f,(float16_t)0.82372051122739131657f, -(float16_t)0.56573181078361323149f,(float16_t)0.82458930278502529099f, -(float16_t)0.56446624152051949608f,(float16_t)0.82545615400437744036f, -(float16_t)0.56319934401383409117f,(float16_t)0.82632106284566353427f, -(float16_t)0.56193112124468946877f,(float16_t)0.82718402727366913130f, -(float16_t)0.56066157619733603124f,(float16_t)0.82804504525775579626f, -(float16_t)0.55939071185913613604f,(float16_t)0.82890411477186487499f, -(float16_t)0.55811853122055610221f,(float16_t)0.82976123379452304540f, -(float16_t)0.55684503727516010407f,(float16_t)0.83061640030884620334f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.55429412145362011444f,(float16_t)0.83232086776792968408f, -(float16_t)0.55301670558002757883f,(float16_t)0.83317016470191318511f, -(float16_t)0.55173798840470744675f,(float16_t)0.83401750110601813315f, -(float16_t)0.55045797293660481131f,(float16_t)0.83486287498638001026f, -(float16_t)0.54917666218771976627f,(float16_t)0.83570628435375260423f, -(float16_t)0.54789405917310018967f,(float16_t)0.83654772722351189440f, -(float16_t)0.54661016691083486041f,(float16_t)0.83738720161566193578f, -(float16_t)0.54532498842204646383f,(float16_t)0.83822470555483796772f, -(float16_t)0.54403852673088393122f,(float16_t)0.83906023707031263115f, -(float16_t)0.54275078486451600046f,(float16_t)0.83989379419599941023f, -(float16_t)0.54146176585312355556f,(float16_t)0.84072537497045796151f, -(float16_t)0.54017147272989296525f,(float16_t)0.84155497743689833268f, -(float16_t)0.53887990853100842248f,(float16_t)0.84238259964318584760f, -(float16_t)0.53758707629564550512f,(float16_t)0.84320823964184543620f, -(float16_t)0.53629297906596318235f,(float16_t)0.84403189549006640835f, -(float16_t)0.53499761988709726435f,(float16_t)0.84485356524970700587f, -(float16_t)0.53370100180715296379f,(float16_t)0.84567324698729906540f, -(float16_t)0.53240312787719801246f,(float16_t)0.84649093877405212627f, -(float16_t)0.53110400115125500076f,(float16_t)0.84730663868585831544f, -(float16_t)0.52980362468629482731f,(float16_t)0.84812034480329712149f, -(float16_t)0.52850200154222848337f,(float16_t)0.84893205521163961347f, -(float16_t)0.52719913478190139067f,(float16_t)0.84974176800085243766f, -(float16_t)0.52589502747108474168f,(float16_t)0.85054948126560336874f, -(float16_t)0.52458968267846883826f,(float16_t)0.85135519310526519554f, -(float16_t)0.52328310347565643035f,(float16_t)0.85215890162391982887f, -(float16_t)0.52197529293715438925f,(float16_t)0.85296060493036363059f, -(float16_t)0.52066625414036726838f,(float16_t)0.85376030113811129940f, -(float16_t)0.51935599016558953167f,(float16_t)0.85455798836540053376f, -(float16_t)0.51804450409599933636f,(float16_t)0.85535366473519602870f, -(float16_t)0.51673179901764998423f,(float16_t)0.85614732837519447184f, -(float16_t)0.51541787801946314929f,(float16_t)0.85693897741782865118f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.51278640063356306644f,(float16_t)0.85851622426444273994f, -(float16_t)0.51146885043797052361f,(float16_t)0.85930181835700836235f, -(float16_t)0.51015009670676669806f,(float16_t)0.86008539042939025077f, -(float16_t)0.50883014254310698909f,(float16_t)0.86086693863776730939f, -(float16_t)0.50750899105297087033f,(float16_t)0.86164646114308129921f, -(float16_t)0.50618664534515533937f,(float16_t)0.86242395611104050168f, -(float16_t)0.50486310853126747933f,(float16_t)0.86319942171212415971f, -(float16_t)0.50353838372571757542f,(float16_t)0.86397285612158669643f, -(float16_t)0.50221247404571089934f,(float16_t)0.86474425751946237817f, -(float16_t)0.50088538261124093687f,(float16_t)0.86551362409056897818f, -(float16_t)0.49955711254508183838f,(float16_t)0.86628095402451299467f, -(float16_t)0.49822766697278186854f,(float16_t)0.86704624551569264845f, -(float16_t)0.49689704902265463549f,(float16_t)0.86780949676330321196f, -(float16_t)0.49556526182577248507f,(float16_t)0.86857070597134089507f, -(float16_t)0.49423230851595972846f,(float16_t)0.86932987134860673084f, -(float16_t)0.49289819222978409341f,(float16_t)0.87008699110871134952f, -(float16_t)0.49156291610655006297f,(float16_t)0.87084206347007886428f, -(float16_t)0.49022648328829110387f,(float16_t)0.87159508665595109012f, -(float16_t)0.48888889691976322727f,(float16_t)0.87234605889439142956f, -(float16_t)0.48755016014843605143f,(float16_t)0.87309497841829009079f, -(float16_t)0.48621027612448652899f,(float16_t)0.87384184346536675214f, -(float16_t)0.48486924800079111986f,(float16_t)0.87458665227817611321f, -(float16_t)0.48352707893291874131f,(float16_t)0.87532940310411078144f, -(float16_t)0.48218377207912282989f,(float16_t)0.87607009419540660122f, -(float16_t)0.48083933060033390294f,(float16_t)0.87680872380914576247f, -(float16_t)0.47949375766015300826f,(float16_t)0.87754529020726124156f, -(float16_t)0.47814705642484311987f,(float16_t)0.87827979165654146421f, -(float16_t)0.47679923006332225466f,(float16_t)0.87901222642863341417f, -(float16_t)0.47545028174715586733f,(float16_t)0.87974259280004740713f, -(float16_t)0.47410021465055002254f,(float16_t)0.88047088905216075450f, -(float16_t)0.47274903195034290171f,(float16_t)0.88119711347122198219f, -(float16_t)0.47139673682599780857f,(float16_t)0.88192126434835493853f, -(float16_t)0.47004333245959561971f,(float16_t)0.88264333997956279099f, -(float16_t)0.46868882203582795665f,(float16_t)0.88336333866573157891f, -(float16_t)0.46733320874198852612f,(float16_t)0.88408125871263498752f, -(float16_t)0.46597649576796612569f,(float16_t)0.88479709843093778954f, -(float16_t)0.46461868630623781584f,(float16_t)0.88551085613619995307f, -(float16_t)0.46325978355186026025f,(float16_t)0.88622253014888063838f, -(float16_t)0.46189979070246284243f,(float16_t)0.88693211879434208367f, -(float16_t)0.46053871095824000514f,(float16_t)0.88763962040285393496f, -(float16_t)0.45917654752194414502f,(float16_t)0.88834503330959635470f, -(float16_t)0.45781330359887728587f,(float16_t)0.88904835585466457371f, -(float16_t)0.45644898239688386221f,(float16_t)0.88974958638307288794f, -(float16_t)0.45508358712634383592f,(float16_t)0.89044872324475787817f, -(float16_t)0.45371712100016392544f,(float16_t)0.89114576479458318392f, -(float16_t)0.45234958723377099998f,(float16_t)0.89184070939234272313f, -(float16_t)0.45098098904510380835f,(float16_t)0.89253355540276468894f, -(float16_t)0.44961132965460659516f,(float16_t)0.89322430119551532446f, -(float16_t)0.44824061228521999700f,(float16_t)0.89391294514520325265f, -(float16_t)0.44686884016237432560f,(float16_t)0.89459948563138258493f, -(float16_t)0.44549601651398174074f,(float16_t)0.89528392103855758410f, -(float16_t)0.44412214457042925586f,(float16_t)0.89596624975618510689f, -(float16_t)0.44274722756457013384f,(float16_t)0.89664647017868015499f, -(float16_t)0.44137126873171661501f,(float16_t)0.89732458070541831763f, -(float16_t)0.43999427130963325583f,(float16_t)0.89800057974073987932f, -(float16_t)0.43861623853852771404f,(float16_t)0.89867446569395381673f, -(float16_t)0.43723717366104419835f,(float16_t)0.89934623697934146236f, -(float16_t)0.43585707992225547480f,(float16_t)0.90001589201616027935f, -(float16_t)0.43447596056965570588f,(float16_t)0.90068342922864685907f, -(float16_t)0.43309381885315201277f,(float16_t)0.90134884704602202810f, -(float16_t)0.43171065802505736997f,(float16_t)0.90201214390249306874f, -(float16_t)0.43032648134008261165f,(float16_t)0.90267331823725882600f, -(float16_t)0.42894129205532954829f,(float16_t)0.90333236849451181705f, -(float16_t)0.42755509343028219593f,(float16_t)0.90398929312344333820f, -(float16_t)0.42616788872679961520f,(float16_t)0.90464409057824624050f, -(float16_t)0.42477968120910880589f,(float16_t)0.90529675931811881551f, -(float16_t)0.42339047414379610279f,(float16_t)0.90594729780726845902f, -(float16_t)0.42200027079979979261f,(float16_t)0.90659570451491533483f, -(float16_t)0.42060907444840250902f,(float16_t)0.90724197791529592738f, -(float16_t)0.41921688836322396066f,(float16_t)0.90788611648766626150f, -(float16_t)0.41782371582021238243f,(float16_t)0.90852811871630612117f, -(float16_t)0.41642956009763731906f,(float16_t)0.90916798309052226923f, -(float16_t)0.41503442447608163146f,(float16_t)0.90980570810465222209f, -(float16_t)0.41363831223843455787f,(float16_t)0.91044129225806713634f, -(float16_t)0.41224122666988299857f,(float16_t)0.91107473405517624965f, -(float16_t)0.41084317105790391089f,(float16_t)0.91170603200542987832f, -(float16_t)0.40944414869225764786f,(float16_t)0.91233518462332274801f, -(float16_t)0.40804416286497874333f,(float16_t)0.91296219042839810154f, -(float16_t)0.40664321687036913966f,(float16_t)0.91358704794525080750f, -(float16_t)0.40524131400498986100f,(float16_t)0.91420975570353069095f, -(float16_t)0.40383845756765412993f,(float16_t)0.91483031223794608611f, -(float16_t)0.40243465085941854120f,(float16_t)0.91544871608826783316f, -(float16_t)0.40102989718357578974f,(float16_t)0.91606496579933160973f, -(float16_t)0.39962419984564678810f,(float16_t)0.91667905992104270485f, -(float16_t)0.39821756215337361651f,(float16_t)0.91729099700837790632f, -(float16_t)0.39680998741671041907f,(float16_t)0.91790077562139038569f, -(float16_t)0.39540147894781629834f,(float16_t)0.91850839432521225181f, -(float16_t)0.39399204006104809883f,(float16_t)0.91911385169005777040f, -(float16_t)0.39258167407295152529f,(float16_t)0.91971714629122736095f, -(float16_t)0.39117038430225398171f,(float16_t)0.92031827670911048322f, -(float16_t)0.38975817406985641123f,(float16_t)0.92091724152918941204f, -(float16_t)0.38834504669882630168f,(float16_t)0.92151403934204190183f, -(float16_t)0.38693100551438869283f,(float16_t)0.92210866874334507237f, -(float16_t)0.38551605384391901543f,(float16_t)0.92270112833387851747f, -(float16_t)0.38410019501693504207f,(float16_t)0.92329141671952763559f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.38126576922216248722f,(float16_t)0.92446547432526260391f, -(float16_t)0.37984720892405110515f,(float16_t)0.92504924078267758425f, -(float16_t)0.37842775480876561511f,(float16_t)0.92563083050987271516f, -(float16_t)0.37700741021641831496f,(float16_t)0.92621024213831126826f, -(float16_t)0.37558617848921732607f,(float16_t)0.92678747430458174872f, -(float16_t)0.37416406297145798909f,(float16_t)0.92736252565040111495f, -(float16_t)0.37274106700951581406f,(float16_t)0.92793539482261788720f, -(float16_t)0.37131719395183759858f,(float16_t)0.92850608047321558924f, -(float16_t)0.36989244714893426691f,(float16_t)0.92907458125931574600f, -(float16_t)0.36846682995337232125f,(float16_t)0.92964089584318121418f, -(float16_t)0.36704034571976723589f,(float16_t)0.93020502289221906889f, -(float16_t)0.36561299780477396482f,(float16_t)0.93076696107898371224f, -(float16_t)0.36418478956707983629f,(float16_t)0.93132670908118042608f, -(float16_t)0.36275572436739722537f,(float16_t)0.93188426558166814750f, -(float16_t)0.36132580556845433906f,(float16_t)0.93243962926846235550f, -(float16_t)0.35989503653498827740f,(float16_t)0.93299279883473884567f, -(float16_t)0.35846342063373654030f,(float16_t)0.93354377297883617270f, -(float16_t)0.35703096123343003310f,(float16_t)0.93409255040425887007f, -(float16_t)0.35559766170478396274f,(float16_t)0.93463912981968078064f, -(float16_t)0.35416352542049051033f,(float16_t)0.93518350993894749923f, -(float16_t)0.35272855575521072646f,(float16_t)0.93572568948108036935f, -(float16_t)0.35129275608556714827f,(float16_t)0.93626566717027825959f, -(float16_t)0.34985612979013502866f,(float16_t)0.93680344173592156043f, -(float16_t)0.34841868024943450921f,(float16_t)0.93733901191257495977f, -(float16_t)0.34698041084592368133f,(float16_t)0.93787237643998988545f, -(float16_t)0.34554132496398914931f,(float16_t)0.93840353406310805795f, -(float16_t)0.34410142598993898044f,(float16_t)0.93893248353206448797f, -(float16_t)0.34266071731199437833f,(float16_t)0.93945922360218991898f, -(float16_t)0.34121920232028241093f,(float16_t)0.93998375303401393577f, -(float16_t)0.33977688440682696225f,(float16_t)0.94050607059326829518f, -(float16_t)0.33833376696554129381f,(float16_t)0.94102617505088925753f, -(float16_t)0.33688985339222005111f,(float16_t)0.94154406518302080631f, -(float16_t)0.33544514708453165852f,(float16_t)0.94205973977101731265f, -(float16_t)0.33399965144200949307f,(float16_t)0.94257319760144686605f, -(float16_t)0.33255336986604422389f,(float16_t)0.94308443746609349478f, -(float16_t)0.33110630575987642921f,(float16_t)0.94359345816196038559f, -(float16_t)0.32965846252858754806f,(float16_t)0.94410025849127265918f, -(float16_t)0.32820984357909266382f,(float16_t)0.94460483726148025685f, -(float16_t)0.32676045232013178898f,(float16_t)0.94510719328526060501f, -(float16_t)0.32531029216226298173f,(float16_t)0.94560732538052127971f, -(float16_t)0.32385936651785296458f,(float16_t)0.94610523237040333733f, -(float16_t)0.32240767880107001897f,(float16_t)0.94660091308328353499f, -(float16_t)0.32095523242787521445f,(float16_t)0.94709436635277721717f, -(float16_t)0.31950203081601574739f,(float16_t)0.94758559101774109124f, -(float16_t)0.31804807738501505998f,(float16_t)0.94807458592227622507f, -(float16_t)0.31659337555616584581f,(float16_t)0.94856134991573026749f, -(float16_t)0.31513792875252244485f,(float16_t)0.94904588185270055689f, -(float16_t)0.31368174039889157312f,(float16_t)0.94952818059303667475f, -(float16_t)0.31222481392182505067f,(float16_t)0.95000824500184299914f, -(float16_t)0.31076715274961147495f,(float16_t)0.95048607394948170235f, -(float16_t)0.30930876031226878231f,(float16_t)0.95096166631157508231f, -(float16_t)0.30784964004153497763f,(float16_t)0.95143502096900833820f, -(float16_t)0.30638979537086108440f,(float16_t)0.95190613680793223494f, -(float16_t)0.30492922973540242948f,(float16_t)0.95237501271976587880f, -(float16_t)0.30346794657201137113f,(float16_t)0.95284164760119871573f, -(float16_t)0.30200594931922819519f,(float16_t)0.95330604035419375109f, -(float16_t)0.30054324141727339903f,(float16_t)0.95376818988599032512f, -(float16_t)0.29907982630804047508f,(float16_t)0.95422809510910566733f, -(float16_t)0.29761570743508630743f,(float16_t)0.95468575494133833814f, -(float16_t)0.29615088824362395536f,(float16_t)0.95514116830577067141f, -(float16_t)0.29468537218051432669f,(float16_t)0.95559433413077110586f, -(float16_t)0.29321916269425868373f,(float16_t)0.95604525134999640557f, -(float16_t)0.29175226323498937298f,(float16_t)0.95649391890239499059f, -(float16_t)0.29028467725446233105f,(float16_t)0.95694033573220893540f, -(float16_t)0.28881640820604947972f,(float16_t)0.95738450078897585627f, -(float16_t)0.28734745954472956653f,(float16_t)0.95782641302753290802f, -(float16_t)0.28587783472708072630f,(float16_t)0.95826607140801767226f, -(float16_t)0.28440753721127182141f,(float16_t)0.95870347489587159906f, -(float16_t)0.28293657045705539188f,(float16_t)0.95913862246184189431f, -(float16_t)0.28146493792575805193f,(float16_t)0.95957151308198451733f, -(float16_t)0.27999264308027338455f,(float16_t)0.96000214573766584625f, -(float16_t)0.27851968938505305973f,(float16_t)0.96043051941556578655f, -(float16_t)0.27704608030609995106f,(float16_t)0.96085663310767965850f, -(float16_t)0.27557181931095825478f,(float16_t)0.96128048581132063966f, -(float16_t)0.27409690986870632878f,(float16_t)0.96170207652912254037f, -(float16_t)0.27262135544994897662f,(float16_t)0.96212140426904158019f, -(float16_t)0.27114515952680806610f,(float16_t)0.96253846804435916340f, -(float16_t)0.26966832557291520178f,(float16_t)0.96295326687368387741f, -(float16_t)0.26819085706340317632f,(float16_t)0.96336579978095404631f, -(float16_t)0.26671275747489842090f,(float16_t)0.96377606579543984022f, -(float16_t)0.26523403028551190141f,(float16_t)0.96418406395174571788f, -(float16_t)0.26375467897483151347f,(float16_t)0.96458979328981264700f, -(float16_t)0.26227470702391358914f,(float16_t)0.96499325285492032478f, -(float16_t)0.26079411791527556952f,(float16_t)0.96539444169768939830f, -(float16_t)0.25931291513288634576f,(float16_t)0.96579335887408357397f, -(float16_t)0.25783110216215893162f,(float16_t)0.96619000344541261516f, -(float16_t)0.25634868248994291395f,(float16_t)0.96658437447833311928f, -(float16_t)0.25486565960451462720f,(float16_t)0.96697647104485207059f, -(float16_t)0.25338203699557027004f,(float16_t)0.96736629222232850545f, -(float16_t)0.25189781815421691258f,(float16_t)0.96775383709347551076f, -(float16_t)0.25041300657296527987f,(float16_t)0.96813910474636244441f, -(float16_t)0.24892760574572025956f,(float16_t)0.96852209427441726675f, -(float16_t)0.24744161916777343557f,(float16_t)0.96890280477642887202f, -(float16_t)0.24595505033579459497f,(float16_t)0.96928123535654853171f, -(float16_t)0.24446790274782420616f,(float16_t)0.96965738512429244800f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.24149188530286930243f,(float16_t)0.97040283868755550234f, -(float16_t)0.24000302244874149871f,(float16_t)0.97077214072895035013f, -(float16_t)0.23851359484431849944f,(float16_t)0.97113915844972509284f, -(float16_t)0.23702360599436733679f,(float16_t)0.97150389098625178352f, -(float16_t)0.23553305940497545889f,(float16_t)0.97186633748027939639f, -(float16_t)0.23404195858354345794f,(float16_t)0.97222649707893626925f, -(float16_t)0.23255030703877532794f,(float16_t)0.97258436893473221296f, -(float16_t)0.23105810828067127605f,(float16_t)0.97293995220556006576f, -(float16_t)0.22956536582051886852f,(float16_t)0.97329324605469824672f, -(float16_t)0.22807208317088578653f,(float16_t)0.97364424965081186603f, -(float16_t)0.22657826384561011168f,(float16_t)0.97399296216795583359f, -(float16_t)0.22508391135979277653f,(float16_t)0.97433938278557585821f, -(float16_t)0.22358902922979001504f,(float16_t)0.97468351068851066810f, -(float16_t)0.22209362097320359264f,(float16_t)0.97502534506699412020f, -(float16_t)0.22059769010887364526f,(float16_t)0.97536488511665686563f, -(float16_t)0.21910124015686976984f,(float16_t)0.97570213003852857003f, -(float16_t)0.21760427463848366902f,(float16_t)0.97603707903903902388f, -(float16_t)0.21610679707621960333f,(float16_t)0.97636973133002114000f, -(float16_t)0.21460881099378692483f,(float16_t)0.97670008612871184184f, -(float16_t)0.21311031991609136194f,(float16_t)0.97702814265775439484f, -(float16_t)0.21161132736922760866f,(float16_t)0.97735390014519996082f, -(float16_t)0.21011183688046972118f,(float16_t)0.97767735782450992943f, -(float16_t)0.20861185197826345727f,(float16_t)0.97799851493455713936f, -(float16_t)0.20711137619221856032f,(float16_t)0.97831737071962765473f, -(float16_t)0.20561041305309932237f,(float16_t)0.97863392442942309657f, -(float16_t)0.20410896609281700687f,(float16_t)0.97894817531906219710f, -(float16_t)0.20260703884442110567f,(float16_t)0.97926012264908202098f, -(float16_t)0.20110463484209195606f,(float16_t)0.97956976568544051887f, -(float16_t)0.19960175762113105402f,(float16_t)0.97987710369951763756f, -(float16_t)0.19809841071795372680f,(float16_t)0.98018213596811731847f, -(float16_t)0.19659459767008022335f,(float16_t)0.98048486177346938497f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.19358558729580374602f,(float16_t)0.98108339115048659451f, -(float16_t)0.19208039704989238183f,(float16_t)0.98137919331375456089f, -(float16_t)0.19057475482025279523f,(float16_t)0.98167268619698311305f, -(float16_t)0.18906866414980627589f,(float16_t)0.98196386910955524296f, -(float16_t)0.18756212858252974129f,(float16_t)0.98225274136628937249f, -(float16_t)0.18605515166344663291f,(float16_t)0.98253930228744124076f, -(float16_t)0.18454773693861964423f,(float16_t)0.98282355119870523641f, -(float16_t)0.18303988795514106180f,(float16_t)0.98310548743121628501f, -(float16_t)0.18153160826112513249f,(float16_t)0.98338511032155118130f, -(float16_t)0.18002290140569951471f,(float16_t)0.98366241921173025453f, -(float16_t)0.17851377093899759019f,(float16_t)0.98393741344921892278f, -(float16_t)0.17700422041214886049f,(float16_t)0.98421009238692902521f, -(float16_t)0.17549425337727139751f,(float16_t)0.98448045538322093151f, -(float16_t)0.17398387338746384989f,(float16_t)0.98474850180190420801f, -(float16_t)0.17247308399679603386f,(float16_t)0.98501423101223983814f, -(float16_t)0.17096188876030135595f,(float16_t)0.98527764238894122162f, -(float16_t)0.16945029123396793125f,(float16_t)0.98553873531217606185f, -(float16_t)0.16793829497473122814f,(float16_t)0.98579750916756736512f, -(float16_t)0.16642590354046421508f,(float16_t)0.98605396334619543897f, -(float16_t)0.16491312048997008866f,(float16_t)0.98630809724459866938f, -(float16_t)0.16339994938297322524f,(float16_t)0.98655991026477540817f, -(float16_t)0.16188639378011188130f,(float16_t)0.98680940181418541624f, -(float16_t)0.16037245724292839566f,(float16_t)0.98705657130575097380f, -(float16_t)0.15885814333386139019f,(float16_t)0.98730141815785843473f, -(float16_t)0.15734345561623827581f,(float16_t)0.98754394179435922574f, -(float16_t)0.15582839765426531597f,(float16_t)0.98778414164457217783f, -(float16_t)0.15431297301302024372f,(float16_t)0.98802201714328352633f, -(float16_t)0.15279718525844340760f,(float16_t)0.98825756773074946437f, -(float16_t)0.15128103795733024994f,(float16_t)0.98849079285269658701f, -(float16_t)0.14976453467732162017f,(float16_t)0.98872169196032377858f, -(float16_t)0.14824767898689619749f,(float16_t)0.98895026451030298986f, -(float16_t)0.14673047445536174793f,(float16_t)0.98917650996478101444f, -(float16_t)0.14521292465284751927f,(float16_t)0.98940042779138037687f, -(float16_t)0.14369503315029458212f,(float16_t)0.98962201746320077600f, -(float16_t)0.14217680351944800288f,(float16_t)0.98984127845882052821f, -(float16_t)0.14065823933284923863f,(float16_t)0.99005821026229712256f, -(float16_t)0.13913934416382628401f,(float16_t)0.99027281236316910817f, -(float16_t)0.13762012158648617710f,(float16_t)0.99048508425645698239f, -(float16_t)0.13610057517570620100f,(float16_t)0.99069502544266463406f, -(float16_t)0.13458070850712622324f,(float16_t)0.99090263542778000971f, -(float16_t)0.13306052515713917561f,(float16_t)0.99110791372327677884f, -(float16_t)0.13154002870288328264f,(float16_t)0.99131085984611544415f, -(float16_t)0.13001922272223334631f,(float16_t)0.99151147331874389668f, -(float16_t)0.12849811079379322432f,(float16_t)0.99170975366909952520f, -(float16_t)0.12697669649688597682f,(float16_t)0.99190570043060932726f, -(float16_t)0.12545498341154620592f,(float16_t)0.99209931314219179654f, -(float16_t)0.12393297511851220083f,(float16_t)0.99229059134825736699f, -(float16_t)0.12241067519921627893f,(float16_t)0.99247953459870996706f, -(float16_t)0.12088808723577722237f,(float16_t)0.99266614244894801899f, -(float16_t)0.11936521481099135467f,(float16_t)0.99285041445986510489f, -(float16_t)0.11784206150832501891f,(float16_t)0.99303235019785141002f, -(float16_t)0.11631863091190487725f,(float16_t)0.99321194923479450001f, -(float16_t)0.11479492660651025027f,(float16_t)0.99338921114808065305f, -(float16_t)0.11327095217756436019f,(float16_t)0.99356413552059530403f, -(float16_t)0.11174671121112665639f,(float16_t)0.99373672194072459884f, -(float16_t)0.11022220729388318428f,(float16_t)0.99390697000235606051f, -(float16_t)0.10869744401313867488f,(float16_t)0.99407487930487936634f, -(float16_t)0.10717242495680887049f,(float16_t)0.99424044945318790223f, -(float16_t)0.10564715371341069916f,(float16_t)0.99440368005767909576f, -(float16_t)0.10412163387205472520f,(float16_t)0.99456457073425541537f, -(float16_t)0.10259586902243628126f,(float16_t)0.99472312110432570265f, -(float16_t)0.10106986275482787718f,(float16_t)0.99487933079480561638f, -(float16_t)0.09954361866006944393f,(float16_t)0.99503319943811863180f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.09649043135525260662f,(float16_t)0.99533391214048227980f, -(float16_t)0.09496349532963906104f,(float16_t)0.99548075549192693856f, -(float16_t)0.09343633584574791151f,(float16_t)0.99562525638099430569f, -(float16_t)0.09190895649713269611f,(float16_t)0.99576741446765981713f, -(float16_t)0.09038136087786501072f,(float16_t)0.99590722941741172125f, -(float16_t)0.08885355258252468358f,(float16_t)0.99604470090125196702f, -(float16_t)0.08732553520619222576f,(float16_t)0.99617982859569687015f, -(float16_t)0.08579731234443987997f,(float16_t)0.99631261218277800129f, -(float16_t)0.08426888759332412659f,(float16_t)0.99644305135004263008f, -(float16_t)0.08274026454937580266f,(float16_t)0.99657114579055483539f, -(float16_t)0.08121144680959238582f,(float16_t)0.99669689520289606044f, -(float16_t)0.07968243797143012563f,(float16_t)0.99682029929116566791f, -(float16_t)0.07815324163279431524f,(float16_t)0.99694135776498216117f, -(float16_t)0.07662386139203161695f,(float16_t)0.99706007033948296225f, -(float16_t)0.07509430084792129145f,(float16_t)0.99717643673532618820f, -(float16_t)0.07356456359966745406f,(float16_t)0.99729045667869020697f, -(float16_t)0.07203465324688941573f,(float16_t)0.99740212990127530279f, -(float16_t)0.07050457338961400866f,(float16_t)0.99751145614030345410f, -(float16_t)0.06897432762826673225f,(float16_t)0.99761843513851955478f, -(float16_t)0.06744391956366410645f,(float16_t)0.99772306664419163624f, -(float16_t)0.06591335279700392957f,(float16_t)0.99782535041111164453f, -(float16_t)0.06438263092985740954f,(float16_t)0.99792528619859599548f, -(float16_t)0.06285175756416142012f,(float16_t)0.99802287377148624081f, -(float16_t)0.06132073630220864768f,(float16_t)0.99811811290014917919f, -(float16_t)0.05978957074664000698f,(float16_t)0.99821100336047818846f, -(float16_t)0.05825826450043573163f,(float16_t)0.99830154493389289261f, -(float16_t)0.05672682116690778292f,(float16_t)0.99838973740734016094f, -(float16_t)0.05519524434969003135f,(float16_t)0.99847558057329477421f, -(float16_t)0.05366353765273067927f,(float16_t)0.99855907422975931365f, -(float16_t)0.05213170468028331672f,(float16_t)0.99864021818026527111f, -(float16_t)0.05059974903689933717f,(float16_t)0.99871901223387293811f, -(float16_t)0.04906767432741812596f,(float16_t)0.99879545620517240501f, -(float16_t)0.04753548415695926094f,(float16_t)0.99886954991428356099f, -(float16_t)0.04600318213091464381f,(float16_t)0.99894129318685687124f, -(float16_t)0.04447077185493874402f,(float16_t)0.99901068585407337697f, -(float16_t)0.04293825693494095902f,(float16_t)0.99907772775264536147f, -(float16_t)0.04140564097707671171f,(float16_t)0.99914241872481690532f, -(float16_t)0.03987292758773984536f,(float16_t)0.99920475861836388631f, -(float16_t)0.03834012037355279123f,(float16_t)0.99926474728659442359f, -(float16_t)0.03680722294135899131f,(float16_t)0.99932238458834954375f, -(float16_t)0.03527423889821394709f,(float16_t)0.99937767038800284780f, -(float16_t)0.03374117185137764235f,(float16_t)0.99943060455546173237f, -(float16_t)0.03220802540830470378f,(float16_t)0.99948118696616694567f, -(float16_t)0.03067480317663658085f,(float16_t)0.99952941750109314256f, -(float16_t)0.02914150876419373953f,(float16_t)0.99957529604674921764f, -(float16_t)0.02760814577896581953f,(float16_t)0.99961882249517863830f, -(float16_t)0.02607471782910403962f,(float16_t)0.99965999674395922270f, -(float16_t)0.02454122852291226384f,(float16_t)0.99969881869620424997f, -(float16_t)0.02300768146883941032f,(float16_t)0.99973528826056168306f, -(float16_t)0.02147408027546960502f,(float16_t)0.99976940535121527898f, -(float16_t)0.01994042855151459750f,(float16_t)0.99980116988788425569f, -(float16_t)0.01840672990580482019f,(float16_t)0.99983058179582340319f, -(float16_t)0.01687298794728177287f,(float16_t)0.99985764100582386060f, -(float16_t)0.01533920628498821985f,(float16_t)0.99988234745421256111f, -(float16_t)0.01380538852806034895f,(float16_t)0.99990470108285289808f, -(float16_t)0.01227153828571994447f,(float16_t)0.99992470183914450299f, -(float16_t)0.01073765916726457208f,(float16_t)0.99994234967602391162f, -(float16_t)0.00920375478205995995f,(float16_t)0.99995764455196389786f, -(float16_t)0.00766982873953107706f,(float16_t)0.99997058643097413988f, -(float16_t)0.00613588464915451517f,(float16_t)0.99998117528260110909f, -(float16_t)0.00460192612044867198f,(float16_t)0.99998941108192840321f, -(float16_t)0.00306795676296613791f,(float16_t)0.99999529380957619118f, -(float16_t)0.00153398018628476615f,(float16_t)0.99999882345170187925f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99998117528260110909f,(float16_t)0.00613588464915447527f, -(float16_t)0.99992470183914450299f,(float16_t)0.01227153828571992539f, -(float16_t)0.99983058179582340319f,(float16_t)0.01840672990580482019f, -(float16_t)0.99969881869620424997f,(float16_t)0.02454122852291228812f, -(float16_t)0.99952941750109314256f,(float16_t)0.03067480317663662595f, -(float16_t)0.99932238458834954375f,(float16_t)0.03680722294135883171f, -(float16_t)0.99907772775264536147f,(float16_t)0.04293825693494082024f, -(float16_t)0.99879545620517240501f,(float16_t)0.04906767432741801493f, -(float16_t)0.99847558057329477421f,(float16_t)0.05519524434968993420f, -(float16_t)0.99811811290014917919f,(float16_t)0.06132073630220857829f, -(float16_t)0.99772306664419163624f,(float16_t)0.06744391956366405094f, -(float16_t)0.99729045667869020697f,(float16_t)0.07356456359966742631f, -(float16_t)0.99682029929116566791f,(float16_t)0.07968243797143012563f, -(float16_t)0.99631261218277800129f,(float16_t)0.08579731234443989385f, -(float16_t)0.99576741446765981713f,(float16_t)0.09190895649713272386f, -(float16_t)0.99518472667219692873f,(float16_t)0.09801714032956060363f, -(float16_t)0.99456457073425541537f,(float16_t)0.10412163387205458642f, -(float16_t)0.99390697000235606051f,(float16_t)0.11022220729388305938f, -(float16_t)0.99321194923479450001f,(float16_t)0.11631863091190475235f, -(float16_t)0.99247953459870996706f,(float16_t)0.12241067519921619566f, -(float16_t)0.99170975366909952520f,(float16_t)0.12849811079379316880f, -(float16_t)0.99090263542778000971f,(float16_t)0.13458070850712616773f, -(float16_t)0.99005821026229712256f,(float16_t)0.14065823933284921088f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.98825756773074946437f,(float16_t)0.15279718525844343535f, -(float16_t)0.98730141815785843473f,(float16_t)0.15885814333386144570f, -(float16_t)0.98630809724459866938f,(float16_t)0.16491312048996989437f, -(float16_t)0.98527764238894122162f,(float16_t)0.17096188876030121717f, -(float16_t)0.98421009238692902521f,(float16_t)0.17700422041214874946f, -(float16_t)0.98310548743121628501f,(float16_t)0.18303988795514095078f, -(float16_t)0.98196386910955524296f,(float16_t)0.18906866414980619262f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.97956976568544051887f,(float16_t)0.20110463484209190055f, -(float16_t)0.97831737071962765473f,(float16_t)0.20711137619221856032f, -(float16_t)0.97702814265775439484f,(float16_t)0.21311031991609136194f, -(float16_t)0.97570213003852857003f,(float16_t)0.21910124015686979759f, -(float16_t)0.97433938278557585821f,(float16_t)0.22508391135979283204f, -(float16_t)0.97293995220556017678f,(float16_t)0.23105810828067110951f, -(float16_t)0.97150389098625178352f,(float16_t)0.23702360599436719801f, -(float16_t)0.97003125319454397424f,(float16_t)0.24298017990326387094f, -(float16_t)0.96852209427441737777f,(float16_t)0.24892760574572014853f, -(float16_t)0.96697647104485207059f,(float16_t)0.25486565960451457169f, -(float16_t)0.96539444169768939830f,(float16_t)0.26079411791527551401f, -(float16_t)0.96377606579543984022f,(float16_t)0.26671275747489836538f, -(float16_t)0.96212140426904158019f,(float16_t)0.27262135544994897662f, -(float16_t)0.96043051941556578655f,(float16_t)0.27851968938505305973f, -(float16_t)0.95870347489587159906f,(float16_t)0.28440753721127187692f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.95514116830577078243f,(float16_t)0.29615088824362378883f, -(float16_t)0.95330604035419386211f,(float16_t)0.30200594931922808417f, -(float16_t)0.95143502096900833820f,(float16_t)0.30784964004153486661f, -(float16_t)0.94952818059303667475f,(float16_t)0.31368174039889151761f, -(float16_t)0.94758559101774109124f,(float16_t)0.31950203081601569188f, -(float16_t)0.94560732538052127971f,(float16_t)0.32531029216226292622f, -(float16_t)0.94359345816196038559f,(float16_t)0.33110630575987642921f, -(float16_t)0.94154406518302080631f,(float16_t)0.33688985339222005111f, -(float16_t)0.93945922360218991898f,(float16_t)0.34266071731199437833f, -(float16_t)0.93733901191257495977f,(float16_t)0.34841868024943456472f, -(float16_t)0.93518350993894761025f,(float16_t)0.35416352542049034380f, -(float16_t)0.93299279883473895669f,(float16_t)0.35989503653498811087f, -(float16_t)0.93076696107898371224f,(float16_t)0.36561299780477385379f, -(float16_t)0.92850608047321558924f,(float16_t)0.37131719395183754306f, -(float16_t)0.92621024213831137928f,(float16_t)0.37700741021641825945f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.92151403934204190183f,(float16_t)0.38834504669882624617f, -(float16_t)0.91911385169005777040f,(float16_t)0.39399204006104809883f, -(float16_t)0.91667905992104270485f,(float16_t)0.39962419984564678810f, -(float16_t)0.91420975570353069095f,(float16_t)0.40524131400498986100f, -(float16_t)0.91170603200542987832f,(float16_t)0.41084317105790391089f, -(float16_t)0.90916798309052238025f,(float16_t)0.41642956009763715253f, -(float16_t)0.90659570451491533483f,(float16_t)0.42200027079979968159f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.90134884704602202810f,(float16_t)0.43309381885315195726f, -(float16_t)0.89867446569395381673f,(float16_t)0.43861623853852765853f, -(float16_t)0.89596624975618521791f,(float16_t)0.44412214457042920035f, -(float16_t)0.89322430119551532446f,(float16_t)0.44961132965460653965f, -(float16_t)0.89044872324475787817f,(float16_t)0.45508358712634383592f, -(float16_t)0.88763962040285393496f,(float16_t)0.46053871095824000514f, -(float16_t)0.88479709843093778954f,(float16_t)0.46597649576796618121f, -(float16_t)0.88192126434835504956f,(float16_t)0.47139673682599764204f, -(float16_t)0.87901222642863352519f,(float16_t)0.47679923006332208812f, -(float16_t)0.87607009419540660122f,(float16_t)0.48218377207912271887f, -(float16_t)0.87309497841829009079f,(float16_t)0.48755016014843599592f, -(float16_t)0.87008699110871146054f,(float16_t)0.49289819222978403790f, -(float16_t)0.86704624551569264845f,(float16_t)0.49822766697278181303f, -(float16_t)0.86397285612158669643f,(float16_t)0.50353838372571757542f, -(float16_t)0.86086693863776730939f,(float16_t)0.50883014254310698909f, -(float16_t)0.85772861000027211809f,(float16_t)0.51410274419322166128f, -(float16_t)0.85455798836540053376f,(float16_t)0.51935599016558964269f, -(float16_t)0.85135519310526519554f,(float16_t)0.52458968267846894928f, -(float16_t)0.84812034480329723252f,(float16_t)0.52980362468629460526f, -(float16_t)0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)0.84155497743689844370f,(float16_t)0.54017147272989285423f, -(float16_t)0.83822470555483807875f,(float16_t)0.54532498842204646383f, -(float16_t)0.83486287498638001026f,(float16_t)0.55045797293660481131f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.82804504525775579626f,(float16_t)0.56066157619733603124f, -(float16_t)0.82458930278502529099f,(float16_t)0.56573181078361312046f, -(float16_t)0.82110251499110464835f,(float16_t)0.57078074588696725566f, -(float16_t)0.81758481315158371139f,(float16_t)0.57580819141784533866f, -(float16_t)0.81403632970594841378f,(float16_t)0.58081395809576452649f, -(float16_t)0.81045719825259476821f,(float16_t)0.58579785745643886408f, -(float16_t)0.80684755354379933401f,(float16_t)0.59075970185887416442f, -(float16_t)0.80320753148064494287f,(float16_t)0.59569930449243335691f, -(float16_t)0.79953726910790501314f,(float16_t)0.60061647938386897305f, -(float16_t)0.79583690460888356633f,(float16_t)0.60551104140432554512f, -(float16_t)0.79210657730021238887f,(float16_t)0.61038280627630947528f, -(float16_t)0.78834642762660622761f,(float16_t)0.61523159058062681925f, -(float16_t)0.78455659715557524159f,(float16_t)0.62005721176328909561f, -(float16_t)0.78073722857209448822f,(float16_t)0.62485948814238634341f, -(float16_t)0.77688846567323244230f,(float16_t)0.62963823891492698426f, -(float16_t)0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)0.76910333764557969882f,(float16_t)0.63912444486377573138f, -(float16_t)0.76516726562245895860f,(float16_t)0.64383154288979138613f, -(float16_t)0.76120238548426177871f,(float16_t)0.64851440102211244110f, -(float16_t)0.75720884650648456748f,(float16_t)0.65317284295377675551f, -(float16_t)0.75318679904361252042f,(float16_t)0.65780669329707863735f, -(float16_t)0.74913639452345937020f,(float16_t)0.66241577759017178373f, -(float16_t)0.74505778544146594733f,(float16_t)0.66699992230363747137f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.73681656887736979300f,(float16_t)0.67609270357531592310f, -(float16_t)0.73265427167241281570f,(float16_t)0.68060099779545302212f, -(float16_t)0.72846439044822519637f,(float16_t)0.68508366777270035541f, -(float16_t)0.72424708295146700276f,(float16_t)0.68954054473706682948f, -(float16_t)0.72000250796138165477f,(float16_t)0.69397146088965389055f, -(float16_t)0.71573082528381870571f,(float16_t)0.69837624940897280457f, -(float16_t)0.71143219574521643356f,(float16_t)0.70275474445722529993f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.70275474445722529993f,(float16_t)0.71143219574521643356f, -(float16_t)0.69837624940897291559f,(float16_t)0.71573082528381859468f, -(float16_t)0.69397146088965400157f,(float16_t)0.72000250796138165477f, -(float16_t)0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)0.68508366777270035541f,(float16_t)0.72846439044822519637f, -(float16_t)0.68060099779545302212f,(float16_t)0.73265427167241281570f, -(float16_t)0.67609270357531603413f,(float16_t)0.73681656887736979300f, -(float16_t)0.67155895484701833009f,(float16_t)0.74095112535495910588f, -(float16_t)0.66699992230363747137f,(float16_t)0.74505778544146594733f, -(float16_t)0.66241577759017178373f,(float16_t)0.74913639452345925918f, -(float16_t)0.65780669329707874837f,(float16_t)0.75318679904361252042f, -(float16_t)0.65317284295377686654f,(float16_t)0.75720884650648456748f, -(float16_t)0.64851440102211255212f,(float16_t)0.76120238548426177871f, -(float16_t)0.64383154288979149715f,(float16_t)0.76516726562245895860f, -(float16_t)0.63912444486377573138f,(float16_t)0.76910333764557958780f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.62963823891492709528f,(float16_t)0.77688846567323244230f, -(float16_t)0.62485948814238645443f,(float16_t)0.78073722857209448822f, -(float16_t)0.62005721176328920663f,(float16_t)0.78455659715557524159f, -(float16_t)0.61523159058062681925f,(float16_t)0.78834642762660622761f, -(float16_t)0.61038280627630947528f,(float16_t)0.79210657730021227785f, -(float16_t)0.60551104140432554512f,(float16_t)0.79583690460888345530f, -(float16_t)0.60061647938386897305f,(float16_t)0.79953726910790501314f, -(float16_t)0.59569930449243346793f,(float16_t)0.80320753148064483184f, -(float16_t)0.59075970185887427544f,(float16_t)0.80684755354379922299f, -(float16_t)0.58579785745643886408f,(float16_t)0.81045719825259476821f, -(float16_t)0.58081395809576452649f,(float16_t)0.81403632970594830276f, -(float16_t)0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)0.57078074588696736669f,(float16_t)0.82110251499110464835f, -(float16_t)0.56573181078361323149f,(float16_t)0.82458930278502529099f, -(float16_t)0.56066157619733603124f,(float16_t)0.82804504525775579626f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.55045797293660481131f,(float16_t)0.83486287498638001026f, -(float16_t)0.54532498842204646383f,(float16_t)0.83822470555483796772f, -(float16_t)0.54017147272989296525f,(float16_t)0.84155497743689833268f, -(float16_t)0.53499761988709726435f,(float16_t)0.84485356524970700587f, -(float16_t)0.52980362468629482731f,(float16_t)0.84812034480329712149f, -(float16_t)0.52458968267846883826f,(float16_t)0.85135519310526519554f, -(float16_t)0.51935599016558953167f,(float16_t)0.85455798836540053376f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.50883014254310698909f,(float16_t)0.86086693863776730939f, -(float16_t)0.50353838372571757542f,(float16_t)0.86397285612158669643f, -(float16_t)0.49822766697278186854f,(float16_t)0.86704624551569264845f, -(float16_t)0.49289819222978409341f,(float16_t)0.87008699110871134952f, -(float16_t)0.48755016014843605143f,(float16_t)0.87309497841829009079f, -(float16_t)0.48218377207912282989f,(float16_t)0.87607009419540660122f, -(float16_t)0.47679923006332225466f,(float16_t)0.87901222642863341417f, -(float16_t)0.47139673682599780857f,(float16_t)0.88192126434835493853f, -(float16_t)0.46597649576796612569f,(float16_t)0.88479709843093778954f, -(float16_t)0.46053871095824000514f,(float16_t)0.88763962040285393496f, -(float16_t)0.45508358712634383592f,(float16_t)0.89044872324475787817f, -(float16_t)0.44961132965460659516f,(float16_t)0.89322430119551532446f, -(float16_t)0.44412214457042925586f,(float16_t)0.89596624975618510689f, -(float16_t)0.43861623853852771404f,(float16_t)0.89867446569395381673f, -(float16_t)0.43309381885315201277f,(float16_t)0.90134884704602202810f, -(float16_t)0.42755509343028219593f,(float16_t)0.90398929312344333820f, -(float16_t)0.42200027079979979261f,(float16_t)0.90659570451491533483f, -(float16_t)0.41642956009763731906f,(float16_t)0.90916798309052226923f, -(float16_t)0.41084317105790391089f,(float16_t)0.91170603200542987832f, -(float16_t)0.40524131400498986100f,(float16_t)0.91420975570353069095f, -(float16_t)0.39962419984564678810f,(float16_t)0.91667905992104270485f, -(float16_t)0.39399204006104809883f,(float16_t)0.91911385169005777040f, -(float16_t)0.38834504669882630168f,(float16_t)0.92151403934204190183f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.37700741021641831496f,(float16_t)0.92621024213831126826f, -(float16_t)0.37131719395183759858f,(float16_t)0.92850608047321558924f, -(float16_t)0.36561299780477396482f,(float16_t)0.93076696107898371224f, -(float16_t)0.35989503653498827740f,(float16_t)0.93299279883473884567f, -(float16_t)0.35416352542049051033f,(float16_t)0.93518350993894749923f, -(float16_t)0.34841868024943450921f,(float16_t)0.93733901191257495977f, -(float16_t)0.34266071731199437833f,(float16_t)0.93945922360218991898f, -(float16_t)0.33688985339222005111f,(float16_t)0.94154406518302080631f, -(float16_t)0.33110630575987642921f,(float16_t)0.94359345816196038559f, -(float16_t)0.32531029216226298173f,(float16_t)0.94560732538052127971f, -(float16_t)0.31950203081601574739f,(float16_t)0.94758559101774109124f, -(float16_t)0.31368174039889157312f,(float16_t)0.94952818059303667475f, -(float16_t)0.30784964004153497763f,(float16_t)0.95143502096900833820f, -(float16_t)0.30200594931922819519f,(float16_t)0.95330604035419375109f, -(float16_t)0.29615088824362395536f,(float16_t)0.95514116830577067141f, -(float16_t)0.29028467725446233105f,(float16_t)0.95694033573220893540f, -(float16_t)0.28440753721127182141f,(float16_t)0.95870347489587159906f, -(float16_t)0.27851968938505305973f,(float16_t)0.96043051941556578655f, -(float16_t)0.27262135544994897662f,(float16_t)0.96212140426904158019f, -(float16_t)0.26671275747489842090f,(float16_t)0.96377606579543984022f, -(float16_t)0.26079411791527556952f,(float16_t)0.96539444169768939830f, -(float16_t)0.25486565960451462720f,(float16_t)0.96697647104485207059f, -(float16_t)0.24892760574572025956f,(float16_t)0.96852209427441726675f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.23702360599436733679f,(float16_t)0.97150389098625178352f, -(float16_t)0.23105810828067127605f,(float16_t)0.97293995220556006576f, -(float16_t)0.22508391135979277653f,(float16_t)0.97433938278557585821f, -(float16_t)0.21910124015686976984f,(float16_t)0.97570213003852857003f, -(float16_t)0.21311031991609136194f,(float16_t)0.97702814265775439484f, -(float16_t)0.20711137619221856032f,(float16_t)0.97831737071962765473f, -(float16_t)0.20110463484209195606f,(float16_t)0.97956976568544051887f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.18906866414980627589f,(float16_t)0.98196386910955524296f, -(float16_t)0.18303988795514106180f,(float16_t)0.98310548743121628501f, -(float16_t)0.17700422041214886049f,(float16_t)0.98421009238692902521f, -(float16_t)0.17096188876030135595f,(float16_t)0.98527764238894122162f, -(float16_t)0.16491312048997008866f,(float16_t)0.98630809724459866938f, -(float16_t)0.15885814333386139019f,(float16_t)0.98730141815785843473f, -(float16_t)0.15279718525844340760f,(float16_t)0.98825756773074946437f, -(float16_t)0.14673047445536174793f,(float16_t)0.98917650996478101444f, -(float16_t)0.14065823933284923863f,(float16_t)0.99005821026229712256f, -(float16_t)0.13458070850712622324f,(float16_t)0.99090263542778000971f, -(float16_t)0.12849811079379322432f,(float16_t)0.99170975366909952520f, -(float16_t)0.12241067519921627893f,(float16_t)0.99247953459870996706f, -(float16_t)0.11631863091190487725f,(float16_t)0.99321194923479450001f, -(float16_t)0.11022220729388318428f,(float16_t)0.99390697000235606051f, -(float16_t)0.10412163387205472520f,(float16_t)0.99456457073425541537f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.09190895649713269611f,(float16_t)0.99576741446765981713f, -(float16_t)0.08579731234443987997f,(float16_t)0.99631261218277800129f, -(float16_t)0.07968243797143012563f,(float16_t)0.99682029929116566791f, -(float16_t)0.07356456359966745406f,(float16_t)0.99729045667869020697f, -(float16_t)0.06744391956366410645f,(float16_t)0.99772306664419163624f, -(float16_t)0.06132073630220864768f,(float16_t)0.99811811290014917919f, -(float16_t)0.05519524434969003135f,(float16_t)0.99847558057329477421f, -(float16_t)0.04906767432741812596f,(float16_t)0.99879545620517240501f, -(float16_t)0.04293825693494095902f,(float16_t)0.99907772775264536147f, -(float16_t)0.03680722294135899131f,(float16_t)0.99932238458834954375f, -(float16_t)0.03067480317663658085f,(float16_t)0.99952941750109314256f, -(float16_t)0.02454122852291226384f,(float16_t)0.99969881869620424997f, -(float16_t)0.01840672990580482019f,(float16_t)0.99983058179582340319f, -(float16_t)0.01227153828571994447f,(float16_t)0.99992470183914450299f, -(float16_t)0.00613588464915451517f,(float16_t)0.99998117528260110909f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99969881869620424997f,(float16_t)0.02454122852291228812f, -(float16_t)0.99879545620517240501f,(float16_t)0.04906767432741801493f, -(float16_t)0.99729045667869020697f,(float16_t)0.07356456359966742631f, -(float16_t)0.99518472667219692873f,(float16_t)0.09801714032956060363f, -(float16_t)0.99247953459870996706f,(float16_t)0.12241067519921619566f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.98527764238894122162f,(float16_t)0.17096188876030121717f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.97570213003852857003f,(float16_t)0.21910124015686979759f, -(float16_t)0.97003125319454397424f,(float16_t)0.24298017990326387094f, -(float16_t)0.96377606579543984022f,(float16_t)0.26671275747489836538f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.94952818059303667475f,(float16_t)0.31368174039889151761f, -(float16_t)0.94154406518302080631f,(float16_t)0.33688985339222005111f, -(float16_t)0.93299279883473895669f,(float16_t)0.35989503653498811087f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.91420975570353069095f,(float16_t)0.40524131400498986100f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.89322430119551532446f,(float16_t)0.44961132965460653965f, -(float16_t)0.88192126434835504956f,(float16_t)0.47139673682599764204f, -(float16_t)0.87008699110871146054f,(float16_t)0.49289819222978403790f, -(float16_t)0.85772861000027211809f,(float16_t)0.51410274419322166128f, -(float16_t)0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.81758481315158371139f,(float16_t)0.57580819141784533866f, -(float16_t)0.80320753148064494287f,(float16_t)0.59569930449243335691f, -(float16_t)0.78834642762660622761f,(float16_t)0.61523159058062681925f, -(float16_t)0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)0.75720884650648456748f,(float16_t)0.65317284295377675551f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.72424708295146700276f,(float16_t)0.68954054473706682948f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)0.67155895484701833009f,(float16_t)0.74095112535495910588f, -(float16_t)0.65317284295377686654f,(float16_t)0.75720884650648456748f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.61523159058062681925f,(float16_t)0.78834642762660622761f, -(float16_t)0.59569930449243346793f,(float16_t)0.80320753148064483184f, -(float16_t)0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.53499761988709726435f,(float16_t)0.84485356524970700587f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.49289819222978409341f,(float16_t)0.87008699110871134952f, -(float16_t)0.47139673682599780857f,(float16_t)0.88192126434835493853f, -(float16_t)0.44961132965460659516f,(float16_t)0.89322430119551532446f, -(float16_t)0.42755509343028219593f,(float16_t)0.90398929312344333820f, -(float16_t)0.40524131400498986100f,(float16_t)0.91420975570353069095f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.35989503653498827740f,(float16_t)0.93299279883473884567f, -(float16_t)0.33688985339222005111f,(float16_t)0.94154406518302080631f, -(float16_t)0.31368174039889157312f,(float16_t)0.94952818059303667475f, -(float16_t)0.29028467725446233105f,(float16_t)0.95694033573220893540f, -(float16_t)0.26671275747489842090f,(float16_t)0.96377606579543984022f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.21910124015686976984f,(float16_t)0.97570213003852857003f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.17096188876030135595f,(float16_t)0.98527764238894122162f, -(float16_t)0.14673047445536174793f,(float16_t)0.98917650996478101444f, -(float16_t)0.12241067519921627893f,(float16_t)0.99247953459870996706f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.07356456359966745406f,(float16_t)0.99729045667869020697f, -(float16_t)0.04906767432741812596f,(float16_t)0.99879545620517240501f, -(float16_t)0.02454122852291226384f,(float16_t)0.99969881869620424997f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99518472667219692873f,(float16_t)0.09801714032956060363f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.88192126434835504956f,(float16_t)0.47139673682599764204f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.47139673682599780857f,(float16_t)0.88192126434835493853f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.29028467725446233105f,(float16_t)0.95694033573220893540f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f,}; +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)1.0000000000000f,(float16_t)0.0015335083008f, +(float16_t)1.0000000000000f,(float16_t)0.0030670166016f, +(float16_t)1.0000000000000f,(float16_t)0.0046005249023f, +(float16_t)1.0000000000000f,(float16_t)0.0061340332031f, +(float16_t)1.0000000000000f,(float16_t)0.0076713562012f, +(float16_t)1.0000000000000f,(float16_t)0.0092010498047f, +(float16_t)1.0000000000000f,(float16_t)0.0107345581055f, +(float16_t)1.0000000000000f,(float16_t)0.0122680664062f, +(float16_t)1.0000000000000f,(float16_t)0.0138015747070f, +(float16_t)1.0000000000000f,(float16_t)0.0153427124023f, +(float16_t)1.0000000000000f,(float16_t)0.0168762207031f, +(float16_t)1.0000000000000f,(float16_t)0.0184020996094f, +(float16_t)1.0000000000000f,(float16_t)0.0199432373047f, +(float16_t)1.0000000000000f,(float16_t)0.0214691162109f, +(float16_t)0.9995117187500f,(float16_t)0.0230102539062f, +(float16_t)0.9995117187500f,(float16_t)0.0245361328125f, +(float16_t)0.9995117187500f,(float16_t)0.0260772705078f, +(float16_t)0.9995117187500f,(float16_t)0.0276031494141f, +(float16_t)0.9995117187500f,(float16_t)0.0291442871094f, +(float16_t)0.9995117187500f,(float16_t)0.0306701660156f, +(float16_t)0.9995117187500f,(float16_t)0.0321960449219f, +(float16_t)0.9995117187500f,(float16_t)0.0337524414062f, +(float16_t)0.9995117187500f,(float16_t)0.0352783203125f, +(float16_t)0.9995117187500f,(float16_t)0.0368041992188f, +(float16_t)0.9990234375000f,(float16_t)0.0383300781250f, +(float16_t)0.9990234375000f,(float16_t)0.0398864746094f, +(float16_t)0.9990234375000f,(float16_t)0.0414123535156f, +(float16_t)0.9990234375000f,(float16_t)0.0429382324219f, +(float16_t)0.9990234375000f,(float16_t)0.0444641113281f, +(float16_t)0.9990234375000f,(float16_t)0.0459899902344f, +(float16_t)0.9990234375000f,(float16_t)0.0475463867188f, +(float16_t)0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)0.9985351562500f,(float16_t)0.0505981445312f, +(float16_t)0.9985351562500f,(float16_t)0.0521240234375f, +(float16_t)0.9985351562500f,(float16_t)0.0536499023438f, +(float16_t)0.9985351562500f,(float16_t)0.0552062988281f, +(float16_t)0.9985351562500f,(float16_t)0.0567321777344f, +(float16_t)0.9985351562500f,(float16_t)0.0582580566406f, +(float16_t)0.9980468750000f,(float16_t)0.0597839355469f, +(float16_t)0.9980468750000f,(float16_t)0.0613098144531f, +(float16_t)0.9980468750000f,(float16_t)0.0628662109375f, +(float16_t)0.9980468750000f,(float16_t)0.0643920898438f, +(float16_t)0.9980468750000f,(float16_t)0.0659179687500f, +(float16_t)0.9975585937500f,(float16_t)0.0674438476562f, +(float16_t)0.9975585937500f,(float16_t)0.0689697265625f, +(float16_t)0.9975585937500f,(float16_t)0.0704956054688f, +(float16_t)0.9975585937500f,(float16_t)0.0720214843750f, +(float16_t)0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)0.9970703125000f,(float16_t)0.0750732421875f, +(float16_t)0.9970703125000f,(float16_t)0.0765991210938f, +(float16_t)0.9970703125000f,(float16_t)0.0781250000000f, +(float16_t)0.9965820312500f,(float16_t)0.0797119140625f, +(float16_t)0.9965820312500f,(float16_t)0.0812377929688f, +(float16_t)0.9965820312500f,(float16_t)0.0827636718750f, +(float16_t)0.9965820312500f,(float16_t)0.0842895507812f, +(float16_t)0.9960937500000f,(float16_t)0.0858154296875f, +(float16_t)0.9960937500000f,(float16_t)0.0873413085938f, +(float16_t)0.9960937500000f,(float16_t)0.0888671875000f, +(float16_t)0.9960937500000f,(float16_t)0.0903930664062f, +(float16_t)0.9956054687500f,(float16_t)0.0919189453125f, +(float16_t)0.9956054687500f,(float16_t)0.0934448242188f, +(float16_t)0.9956054687500f,(float16_t)0.0949707031250f, +(float16_t)0.9951171875000f,(float16_t)0.0964965820312f, +(float16_t)0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)0.9951171875000f,(float16_t)0.0995483398438f, +(float16_t)0.9951171875000f,(float16_t)0.1010742187500f, +(float16_t)0.9946289062500f,(float16_t)0.1026000976562f, +(float16_t)0.9946289062500f,(float16_t)0.1041259765625f, +(float16_t)0.9946289062500f,(float16_t)0.1056518554688f, +(float16_t)0.9941406250000f,(float16_t)0.1071777343750f, +(float16_t)0.9941406250000f,(float16_t)0.1087036132812f, +(float16_t)0.9941406250000f,(float16_t)0.1102294921875f, +(float16_t)0.9936523437500f,(float16_t)0.1117553710938f, +(float16_t)0.9936523437500f,(float16_t)0.1132812500000f, +(float16_t)0.9931640625000f,(float16_t)0.1148071289062f, +(float16_t)0.9931640625000f,(float16_t)0.1163330078125f, +(float16_t)0.9931640625000f,(float16_t)0.1178588867188f, +(float16_t)0.9926757812500f,(float16_t)0.1193847656250f, +(float16_t)0.9926757812500f,(float16_t)0.1209106445312f, +(float16_t)0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)0.9921875000000f,(float16_t)0.1239624023438f, +(float16_t)0.9921875000000f,(float16_t)0.1254882812500f, +(float16_t)0.9916992187500f,(float16_t)0.1269531250000f, +(float16_t)0.9916992187500f,(float16_t)0.1285400390625f, +(float16_t)0.9916992187500f,(float16_t)0.1300048828125f, +(float16_t)0.9912109375000f,(float16_t)0.1315917968750f, +(float16_t)0.9912109375000f,(float16_t)0.1330566406250f, +(float16_t)0.9907226562500f,(float16_t)0.1345214843750f, +(float16_t)0.9907226562500f,(float16_t)0.1361083984375f, +(float16_t)0.9907226562500f,(float16_t)0.1375732421875f, +(float16_t)0.9902343750000f,(float16_t)0.1391601562500f, +(float16_t)0.9902343750000f,(float16_t)0.1406250000000f, +(float16_t)0.9897460937500f,(float16_t)0.1422119140625f, +(float16_t)0.9897460937500f,(float16_t)0.1436767578125f, +(float16_t)0.9892578125000f,(float16_t)0.1452636718750f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9887695312500f,(float16_t)0.1481933593750f, +(float16_t)0.9887695312500f,(float16_t)0.1497802734375f, +(float16_t)0.9882812500000f,(float16_t)0.1512451171875f, +(float16_t)0.9882812500000f,(float16_t)0.1528320312500f, +(float16_t)0.9877929687500f,(float16_t)0.1542968750000f, +(float16_t)0.9877929687500f,(float16_t)0.1558837890625f, +(float16_t)0.9873046875000f,(float16_t)0.1573486328125f, +(float16_t)0.9873046875000f,(float16_t)0.1588134765625f, +(float16_t)0.9868164062500f,(float16_t)0.1604003906250f, +(float16_t)0.9868164062500f,(float16_t)0.1618652343750f, +(float16_t)0.9863281250000f,(float16_t)0.1634521484375f, +(float16_t)0.9863281250000f,(float16_t)0.1649169921875f, +(float16_t)0.9858398437500f,(float16_t)0.1663818359375f, +(float16_t)0.9858398437500f,(float16_t)0.1679687500000f, +(float16_t)0.9853515625000f,(float16_t)0.1694335937500f, +(float16_t)0.9853515625000f,(float16_t)0.1710205078125f, +(float16_t)0.9848632812500f,(float16_t)0.1724853515625f, +(float16_t)0.9848632812500f,(float16_t)0.1739501953125f, +(float16_t)0.9843750000000f,(float16_t)0.1755371093750f, +(float16_t)0.9843750000000f,(float16_t)0.1770019531250f, +(float16_t)0.9838867187500f,(float16_t)0.1784667968750f, +(float16_t)0.9838867187500f,(float16_t)0.1800537109375f, +(float16_t)0.9833984375000f,(float16_t)0.1815185546875f, +(float16_t)0.9829101562500f,(float16_t)0.1829833984375f, +(float16_t)0.9829101562500f,(float16_t)0.1845703125000f, +(float16_t)0.9824218750000f,(float16_t)0.1860351562500f, +(float16_t)0.9824218750000f,(float16_t)0.1876220703125f, +(float16_t)0.9819335937500f,(float16_t)0.1890869140625f, +(float16_t)0.9814453125000f,(float16_t)0.1905517578125f, +(float16_t)0.9814453125000f,(float16_t)0.1921386718750f, +(float16_t)0.9809570312500f,(float16_t)0.1936035156250f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9804687500000f,(float16_t)0.1966552734375f, +(float16_t)0.9799804687500f,(float16_t)0.1981201171875f, +(float16_t)0.9799804687500f,(float16_t)0.1995849609375f, +(float16_t)0.9794921875000f,(float16_t)0.2010498046875f, +(float16_t)0.9794921875000f,(float16_t)0.2026367187500f, +(float16_t)0.9790039062500f,(float16_t)0.2041015625000f, +(float16_t)0.9785156250000f,(float16_t)0.2055664062500f, +(float16_t)0.9785156250000f,(float16_t)0.2071533203125f, +(float16_t)0.9780273437500f,(float16_t)0.2086181640625f, +(float16_t)0.9775390625000f,(float16_t)0.2100830078125f, +(float16_t)0.9775390625000f,(float16_t)0.2116699218750f, +(float16_t)0.9770507812500f,(float16_t)0.2131347656250f, +(float16_t)0.9765625000000f,(float16_t)0.2145996093750f, +(float16_t)0.9765625000000f,(float16_t)0.2160644531250f, +(float16_t)0.9760742187500f,(float16_t)0.2176513671875f, +(float16_t)0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)0.9755859375000f,(float16_t)0.2205810546875f, +(float16_t)0.9750976562500f,(float16_t)0.2220458984375f, +(float16_t)0.9746093750000f,(float16_t)0.2236328125000f, +(float16_t)0.9741210937500f,(float16_t)0.2250976562500f, +(float16_t)0.9741210937500f,(float16_t)0.2265625000000f, +(float16_t)0.9736328125000f,(float16_t)0.2280273437500f, +(float16_t)0.9731445312500f,(float16_t)0.2296142578125f, +(float16_t)0.9731445312500f,(float16_t)0.2310791015625f, +(float16_t)0.9726562500000f,(float16_t)0.2325439453125f, +(float16_t)0.9721679687500f,(float16_t)0.2340087890625f, +(float16_t)0.9716796875000f,(float16_t)0.2354736328125f, +(float16_t)0.9716796875000f,(float16_t)0.2370605468750f, +(float16_t)0.9711914062500f,(float16_t)0.2385253906250f, +(float16_t)0.9707031250000f,(float16_t)0.2399902343750f, +(float16_t)0.9702148437500f,(float16_t)0.2414550781250f, +(float16_t)0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)0.9697265625000f,(float16_t)0.2445068359375f, +(float16_t)0.9692382812500f,(float16_t)0.2459716796875f, +(float16_t)0.9687500000000f,(float16_t)0.2474365234375f, +(float16_t)0.9687500000000f,(float16_t)0.2489013671875f, +(float16_t)0.9682617187500f,(float16_t)0.2504882812500f, +(float16_t)0.9677734375000f,(float16_t)0.2519531250000f, +(float16_t)0.9672851562500f,(float16_t)0.2534179687500f, +(float16_t)0.9667968750000f,(float16_t)0.2548828125000f, +(float16_t)0.9667968750000f,(float16_t)0.2563476562500f, +(float16_t)0.9663085937500f,(float16_t)0.2578125000000f, +(float16_t)0.9658203125000f,(float16_t)0.2592773437500f, +(float16_t)0.9653320312500f,(float16_t)0.2607421875000f, +(float16_t)0.9648437500000f,(float16_t)0.2622070312500f, +(float16_t)0.9643554687500f,(float16_t)0.2636718750000f, +(float16_t)0.9643554687500f,(float16_t)0.2651367187500f, +(float16_t)0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)0.9633789062500f,(float16_t)0.2683105468750f, +(float16_t)0.9628906250000f,(float16_t)0.2697753906250f, +(float16_t)0.9624023437500f,(float16_t)0.2712402343750f, +(float16_t)0.9619140625000f,(float16_t)0.2727050781250f, +(float16_t)0.9619140625000f,(float16_t)0.2741699218750f, +(float16_t)0.9614257812500f,(float16_t)0.2756347656250f, +(float16_t)0.9609375000000f,(float16_t)0.2770996093750f, +(float16_t)0.9604492187500f,(float16_t)0.2785644531250f, +(float16_t)0.9599609375000f,(float16_t)0.2800292968750f, +(float16_t)0.9594726562500f,(float16_t)0.2814941406250f, +(float16_t)0.9589843750000f,(float16_t)0.2829589843750f, +(float16_t)0.9584960937500f,(float16_t)0.2844238281250f, +(float16_t)0.9584960937500f,(float16_t)0.2858886718750f, +(float16_t)0.9580078125000f,(float16_t)0.2873535156250f, +(float16_t)0.9575195312500f,(float16_t)0.2888183593750f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9565429687500f,(float16_t)0.2917480468750f, +(float16_t)0.9560546875000f,(float16_t)0.2932128906250f, +(float16_t)0.9555664062500f,(float16_t)0.2946777343750f, +(float16_t)0.9550781250000f,(float16_t)0.2961425781250f, +(float16_t)0.9545898437500f,(float16_t)0.2976074218750f, +(float16_t)0.9541015625000f,(float16_t)0.2990722656250f, +(float16_t)0.9536132812500f,(float16_t)0.3005371093750f, +(float16_t)0.9531250000000f,(float16_t)0.3020019531250f, +(float16_t)0.9526367187500f,(float16_t)0.3034667968750f, +(float16_t)0.9521484375000f,(float16_t)0.3049316406250f, +(float16_t)0.9521484375000f,(float16_t)0.3063964843750f, +(float16_t)0.9516601562500f,(float16_t)0.3078613281250f, +(float16_t)0.9511718750000f,(float16_t)0.3093261718750f, +(float16_t)0.9506835937500f,(float16_t)0.3107910156250f, +(float16_t)0.9501953125000f,(float16_t)0.3122558593750f, +(float16_t)0.9497070312500f,(float16_t)0.3137207031250f, +(float16_t)0.9492187500000f,(float16_t)0.3151855468750f, +(float16_t)0.9487304687500f,(float16_t)0.3166503906250f, +(float16_t)0.9482421875000f,(float16_t)0.3181152343750f, +(float16_t)0.9477539062500f,(float16_t)0.3195800781250f, +(float16_t)0.9472656250000f,(float16_t)0.3210449218750f, +(float16_t)0.9467773437500f,(float16_t)0.3225097656250f, +(float16_t)0.9462890625000f,(float16_t)0.3239746093750f, +(float16_t)0.9458007812500f,(float16_t)0.3251953125000f, +(float16_t)0.9453125000000f,(float16_t)0.3266601562500f, +(float16_t)0.9448242187500f,(float16_t)0.3281250000000f, +(float16_t)0.9443359375000f,(float16_t)0.3295898437500f, +(float16_t)0.9433593750000f,(float16_t)0.3310546875000f, +(float16_t)0.9428710937500f,(float16_t)0.3325195312500f, +(float16_t)0.9423828125000f,(float16_t)0.3339843750000f, +(float16_t)0.9418945312500f,(float16_t)0.3354492187500f, +(float16_t)0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)0.9409179687500f,(float16_t)0.3383789062500f, +(float16_t)0.9404296875000f,(float16_t)0.3398437500000f, +(float16_t)0.9399414062500f,(float16_t)0.3413085937500f, +(float16_t)0.9394531250000f,(float16_t)0.3427734375000f, +(float16_t)0.9389648437500f,(float16_t)0.3439941406250f, +(float16_t)0.9384765625000f,(float16_t)0.3454589843750f, +(float16_t)0.9379882812500f,(float16_t)0.3469238281250f, +(float16_t)0.9375000000000f,(float16_t)0.3483886718750f, +(float16_t)0.9370117187500f,(float16_t)0.3498535156250f, +(float16_t)0.9360351562500f,(float16_t)0.3513183593750f, +(float16_t)0.9355468750000f,(float16_t)0.3527832031250f, +(float16_t)0.9350585937500f,(float16_t)0.3542480468750f, +(float16_t)0.9345703125000f,(float16_t)0.3557128906250f, +(float16_t)0.9340820312500f,(float16_t)0.3569335937500f, +(float16_t)0.9335937500000f,(float16_t)0.3583984375000f, +(float16_t)0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)0.9326171875000f,(float16_t)0.3613281250000f, +(float16_t)0.9316406250000f,(float16_t)0.3627929687500f, +(float16_t)0.9311523437500f,(float16_t)0.3642578125000f, +(float16_t)0.9306640625000f,(float16_t)0.3657226562500f, +(float16_t)0.9301757812500f,(float16_t)0.3669433593750f, +(float16_t)0.9296875000000f,(float16_t)0.3684082031250f, +(float16_t)0.9291992187500f,(float16_t)0.3698730468750f, +(float16_t)0.9287109375000f,(float16_t)0.3713378906250f, +(float16_t)0.9277343750000f,(float16_t)0.3728027343750f, +(float16_t)0.9272460937500f,(float16_t)0.3742675781250f, +(float16_t)0.9267578125000f,(float16_t)0.3754882812500f, +(float16_t)0.9262695312500f,(float16_t)0.3769531250000f, +(float16_t)0.9257812500000f,(float16_t)0.3784179687500f, +(float16_t)0.9252929687500f,(float16_t)0.3798828125000f, +(float16_t)0.9243164062500f,(float16_t)0.3813476562500f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.9233398437500f,(float16_t)0.3840332031250f, +(float16_t)0.9228515625000f,(float16_t)0.3854980468750f, +(float16_t)0.9218750000000f,(float16_t)0.3869628906250f, +(float16_t)0.9213867187500f,(float16_t)0.3884277343750f, +(float16_t)0.9208984375000f,(float16_t)0.3896484375000f, +(float16_t)0.9204101562500f,(float16_t)0.3911132812500f, +(float16_t)0.9199218750000f,(float16_t)0.3925781250000f, +(float16_t)0.9189453125000f,(float16_t)0.3940429687500f, +(float16_t)0.9184570312500f,(float16_t)0.3955078125000f, +(float16_t)0.9179687500000f,(float16_t)0.3967285156250f, +(float16_t)0.9174804687500f,(float16_t)0.3981933593750f, +(float16_t)0.9165039062500f,(float16_t)0.3996582031250f, +(float16_t)0.9160156250000f,(float16_t)0.4011230468750f, +(float16_t)0.9155273437500f,(float16_t)0.4023437500000f, +(float16_t)0.9150390625000f,(float16_t)0.4038085937500f, +(float16_t)0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)0.9135742187500f,(float16_t)0.4067382812500f, +(float16_t)0.9130859375000f,(float16_t)0.4079589843750f, +(float16_t)0.9121093750000f,(float16_t)0.4094238281250f, +(float16_t)0.9116210937500f,(float16_t)0.4108886718750f, +(float16_t)0.9111328125000f,(float16_t)0.4123535156250f, +(float16_t)0.9106445312500f,(float16_t)0.4135742187500f, +(float16_t)0.9096679687500f,(float16_t)0.4150390625000f, +(float16_t)0.9091796875000f,(float16_t)0.4165039062500f, +(float16_t)0.9086914062500f,(float16_t)0.4177246093750f, +(float16_t)0.9077148437500f,(float16_t)0.4191894531250f, +(float16_t)0.9072265625000f,(float16_t)0.4206542968750f, +(float16_t)0.9067382812500f,(float16_t)0.4221191406250f, +(float16_t)0.9057617187500f,(float16_t)0.4233398437500f, +(float16_t)0.9052734375000f,(float16_t)0.4248046875000f, +(float16_t)0.9047851562500f,(float16_t)0.4262695312500f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.9033203125000f,(float16_t)0.4289550781250f, +(float16_t)0.9028320312500f,(float16_t)0.4304199218750f, +(float16_t)0.9018554687500f,(float16_t)0.4316406250000f, +(float16_t)0.9013671875000f,(float16_t)0.4331054687500f, +(float16_t)0.9008789062500f,(float16_t)0.4345703125000f, +(float16_t)0.8999023437500f,(float16_t)0.4357910156250f, +(float16_t)0.8994140625000f,(float16_t)0.4372558593750f, +(float16_t)0.8984375000000f,(float16_t)0.4387207031250f, +(float16_t)0.8979492187500f,(float16_t)0.4399414062500f, +(float16_t)0.8974609375000f,(float16_t)0.4414062500000f, +(float16_t)0.8964843750000f,(float16_t)0.4426269531250f, +(float16_t)0.8959960937500f,(float16_t)0.4440917968750f, +(float16_t)0.8955078125000f,(float16_t)0.4455566406250f, +(float16_t)0.8945312500000f,(float16_t)0.4467773437500f, +(float16_t)0.8940429687500f,(float16_t)0.4482421875000f, +(float16_t)0.8930664062500f,(float16_t)0.4497070312500f, +(float16_t)0.8925781250000f,(float16_t)0.4509277343750f, +(float16_t)0.8916015625000f,(float16_t)0.4523925781250f, +(float16_t)0.8911132812500f,(float16_t)0.4536132812500f, +(float16_t)0.8906250000000f,(float16_t)0.4550781250000f, +(float16_t)0.8896484375000f,(float16_t)0.4565429687500f, +(float16_t)0.8891601562500f,(float16_t)0.4577636718750f, +(float16_t)0.8881835937500f,(float16_t)0.4592285156250f, +(float16_t)0.8876953125000f,(float16_t)0.4604492187500f, +(float16_t)0.8867187500000f,(float16_t)0.4619140625000f, +(float16_t)0.8862304687500f,(float16_t)0.4633789062500f, +(float16_t)0.8857421875000f,(float16_t)0.4645996093750f, +(float16_t)0.8847656250000f,(float16_t)0.4660644531250f, +(float16_t)0.8842773437500f,(float16_t)0.4672851562500f, +(float16_t)0.8833007812500f,(float16_t)0.4687500000000f, +(float16_t)0.8828125000000f,(float16_t)0.4699707031250f, +(float16_t)0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)0.8813476562500f,(float16_t)0.4726562500000f, +(float16_t)0.8803710937500f,(float16_t)0.4741210937500f, +(float16_t)0.8798828125000f,(float16_t)0.4753417968750f, +(float16_t)0.8789062500000f,(float16_t)0.4768066406250f, +(float16_t)0.8784179687500f,(float16_t)0.4780273437500f, +(float16_t)0.8774414062500f,(float16_t)0.4794921875000f, +(float16_t)0.8769531250000f,(float16_t)0.4809570312500f, +(float16_t)0.8759765625000f,(float16_t)0.4821777343750f, +(float16_t)0.8754882812500f,(float16_t)0.4836425781250f, +(float16_t)0.8745117187500f,(float16_t)0.4848632812500f, +(float16_t)0.8740234375000f,(float16_t)0.4863281250000f, +(float16_t)0.8730468750000f,(float16_t)0.4875488281250f, +(float16_t)0.8725585937500f,(float16_t)0.4887695312500f, +(float16_t)0.8715820312500f,(float16_t)0.4902343750000f, +(float16_t)0.8706054687500f,(float16_t)0.4914550781250f, +(float16_t)0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)0.8691406250000f,(float16_t)0.4941406250000f, +(float16_t)0.8686523437500f,(float16_t)0.4956054687500f, +(float16_t)0.8676757812500f,(float16_t)0.4968261718750f, +(float16_t)0.8671875000000f,(float16_t)0.4982910156250f, +(float16_t)0.8662109375000f,(float16_t)0.4995117187500f, +(float16_t)0.8657226562500f,(float16_t)0.5009765625000f, +(float16_t)0.8647460937500f,(float16_t)0.5024414062500f, +(float16_t)0.8637695312500f,(float16_t)0.5034179687500f, +(float16_t)0.8632812500000f,(float16_t)0.5048828125000f, +(float16_t)0.8623046875000f,(float16_t)0.5063476562500f, +(float16_t)0.8618164062500f,(float16_t)0.5073242187500f, +(float16_t)0.8608398437500f,(float16_t)0.5087890625000f, +(float16_t)0.8598632812500f,(float16_t)0.5102539062500f, +(float16_t)0.8593750000000f,(float16_t)0.5112304687500f, +(float16_t)0.8583984375000f,(float16_t)0.5126953125000f, +(float16_t)0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)0.8569335937500f,(float16_t)0.5156250000000f, +(float16_t)0.8559570312500f,(float16_t)0.5166015625000f, +(float16_t)0.8554687500000f,(float16_t)0.5180664062500f, +(float16_t)0.8544921875000f,(float16_t)0.5195312500000f, +(float16_t)0.8540039062500f,(float16_t)0.5205078125000f, +(float16_t)0.8530273437500f,(float16_t)0.5219726562500f, +(float16_t)0.8520507812500f,(float16_t)0.5234375000000f, +(float16_t)0.8515625000000f,(float16_t)0.5244140625000f, +(float16_t)0.8505859375000f,(float16_t)0.5258789062500f, +(float16_t)0.8496093750000f,(float16_t)0.5273437500000f, +(float16_t)0.8491210937500f,(float16_t)0.5283203125000f, +(float16_t)0.8481445312500f,(float16_t)0.5297851562500f, +(float16_t)0.8471679687500f,(float16_t)0.5312500000000f, +(float16_t)0.8466796875000f,(float16_t)0.5322265625000f, +(float16_t)0.8457031250000f,(float16_t)0.5336914062500f, +(float16_t)0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)0.8442382812500f,(float16_t)0.5361328125000f, +(float16_t)0.8432617187500f,(float16_t)0.5375976562500f, +(float16_t)0.8422851562500f,(float16_t)0.5390625000000f, +(float16_t)0.8417968750000f,(float16_t)0.5400390625000f, +(float16_t)0.8408203125000f,(float16_t)0.5415039062500f, +(float16_t)0.8398437500000f,(float16_t)0.5429687500000f, +(float16_t)0.8388671875000f,(float16_t)0.5439453125000f, +(float16_t)0.8383789062500f,(float16_t)0.5454101562500f, +(float16_t)0.8374023437500f,(float16_t)0.5463867187500f, +(float16_t)0.8364257812500f,(float16_t)0.5478515625000f, +(float16_t)0.8359375000000f,(float16_t)0.5493164062500f, +(float16_t)0.8349609375000f,(float16_t)0.5502929687500f, +(float16_t)0.8339843750000f,(float16_t)0.5517578125000f, +(float16_t)0.8330078125000f,(float16_t)0.5532226562500f, +(float16_t)0.8325195312500f,(float16_t)0.5541992187500f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.8305664062500f,(float16_t)0.5566406250000f, +(float16_t)0.8295898437500f,(float16_t)0.5581054687500f, +(float16_t)0.8291015625000f,(float16_t)0.5595703125000f, +(float16_t)0.8281250000000f,(float16_t)0.5605468750000f, +(float16_t)0.8271484375000f,(float16_t)0.5620117187500f, +(float16_t)0.8261718750000f,(float16_t)0.5629882812500f, +(float16_t)0.8256835937500f,(float16_t)0.5644531250000f, +(float16_t)0.8247070312500f,(float16_t)0.5659179687500f, +(float16_t)0.8237304687500f,(float16_t)0.5668945312500f, +(float16_t)0.8227539062500f,(float16_t)0.5683593750000f, +(float16_t)0.8217773437500f,(float16_t)0.5693359375000f, +(float16_t)0.8212890625000f,(float16_t)0.5708007812500f, +(float16_t)0.8203125000000f,(float16_t)0.5722656250000f, +(float16_t)0.8193359375000f,(float16_t)0.5732421875000f, +(float16_t)0.8183593750000f,(float16_t)0.5747070312500f, +(float16_t)0.8173828125000f,(float16_t)0.5756835937500f, +(float16_t)0.8168945312500f,(float16_t)0.5771484375000f, +(float16_t)0.8159179687500f,(float16_t)0.5781250000000f, +(float16_t)0.8149414062500f,(float16_t)0.5795898437500f, +(float16_t)0.8139648437500f,(float16_t)0.5810546875000f, +(float16_t)0.8129882812500f,(float16_t)0.5820312500000f, +(float16_t)0.8120117187500f,(float16_t)0.5834960937500f, +(float16_t)0.8115234375000f,(float16_t)0.5844726562500f, +(float16_t)0.8105468750000f,(float16_t)0.5859375000000f, +(float16_t)0.8095703125000f,(float16_t)0.5869140625000f, +(float16_t)0.8085937500000f,(float16_t)0.5883789062500f, +(float16_t)0.8076171875000f,(float16_t)0.5893554687500f, +(float16_t)0.8066406250000f,(float16_t)0.5908203125000f, +(float16_t)0.8061523437500f,(float16_t)0.5917968750000f, +(float16_t)0.8051757812500f,(float16_t)0.5932617187500f, +(float16_t)0.8041992187500f,(float16_t)0.5942382812500f, +(float16_t)0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)0.8022460937500f,(float16_t)0.5971679687500f, +(float16_t)0.8012695312500f,(float16_t)0.5981445312500f, +(float16_t)0.8002929687500f,(float16_t)0.5996093750000f, +(float16_t)0.7993164062500f,(float16_t)0.6005859375000f, +(float16_t)0.7988281250000f,(float16_t)0.6020507812500f, +(float16_t)0.7978515625000f,(float16_t)0.6030273437500f, +(float16_t)0.7968750000000f,(float16_t)0.6044921875000f, +(float16_t)0.7958984375000f,(float16_t)0.6054687500000f, +(float16_t)0.7949218750000f,(float16_t)0.6069335937500f, +(float16_t)0.7939453125000f,(float16_t)0.6079101562500f, +(float16_t)0.7929687500000f,(float16_t)0.6093750000000f, +(float16_t)0.7919921875000f,(float16_t)0.6103515625000f, +(float16_t)0.7910156250000f,(float16_t)0.6118164062500f, +(float16_t)0.7900390625000f,(float16_t)0.6127929687500f, +(float16_t)0.7890625000000f,(float16_t)0.6142578125000f, +(float16_t)0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)0.7875976562500f,(float16_t)0.6162109375000f, +(float16_t)0.7866210937500f,(float16_t)0.6176757812500f, +(float16_t)0.7856445312500f,(float16_t)0.6186523437500f, +(float16_t)0.7846679687500f,(float16_t)0.6201171875000f, +(float16_t)0.7836914062500f,(float16_t)0.6210937500000f, +(float16_t)0.7827148437500f,(float16_t)0.6225585937500f, +(float16_t)0.7817382812500f,(float16_t)0.6235351562500f, +(float16_t)0.7807617187500f,(float16_t)0.6250000000000f, +(float16_t)0.7797851562500f,(float16_t)0.6259765625000f, +(float16_t)0.7788085937500f,(float16_t)0.6274414062500f, +(float16_t)0.7778320312500f,(float16_t)0.6284179687500f, +(float16_t)0.7768554687500f,(float16_t)0.6293945312500f, +(float16_t)0.7758789062500f,(float16_t)0.6308593750000f, +(float16_t)0.7749023437500f,(float16_t)0.6318359375000f, +(float16_t)0.7739257812500f,(float16_t)0.6333007812500f, +(float16_t)0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)0.7719726562500f,(float16_t)0.6357421875000f, +(float16_t)0.7709960937500f,(float16_t)0.6367187500000f, +(float16_t)0.7700195312500f,(float16_t)0.6381835937500f, +(float16_t)0.7690429687500f,(float16_t)0.6391601562500f, +(float16_t)0.7680664062500f,(float16_t)0.6401367187500f, +(float16_t)0.7670898437500f,(float16_t)0.6416015625000f, +(float16_t)0.7661132812500f,(float16_t)0.6425781250000f, +(float16_t)0.7651367187500f,(float16_t)0.6440429687500f, +(float16_t)0.7641601562500f,(float16_t)0.6450195312500f, +(float16_t)0.7631835937500f,(float16_t)0.6459960937500f, +(float16_t)0.7622070312500f,(float16_t)0.6474609375000f, +(float16_t)0.7612304687500f,(float16_t)0.6484375000000f, +(float16_t)0.7602539062500f,(float16_t)0.6499023437500f, +(float16_t)0.7592773437500f,(float16_t)0.6508789062500f, +(float16_t)0.7583007812500f,(float16_t)0.6518554687500f, +(float16_t)0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)0.7563476562500f,(float16_t)0.6542968750000f, +(float16_t)0.7553710937500f,(float16_t)0.6552734375000f, +(float16_t)0.7543945312500f,(float16_t)0.6567382812500f, +(float16_t)0.7534179687500f,(float16_t)0.6577148437500f, +(float16_t)0.7519531250000f,(float16_t)0.6591796875000f, +(float16_t)0.7509765625000f,(float16_t)0.6601562500000f, +(float16_t)0.7500000000000f,(float16_t)0.6611328125000f, +(float16_t)0.7490234375000f,(float16_t)0.6625976562500f, +(float16_t)0.7480468750000f,(float16_t)0.6635742187500f, +(float16_t)0.7470703125000f,(float16_t)0.6645507812500f, +(float16_t)0.7460937500000f,(float16_t)0.6660156250000f, +(float16_t)0.7451171875000f,(float16_t)0.6669921875000f, +(float16_t)0.7441406250000f,(float16_t)0.6679687500000f, +(float16_t)0.7431640625000f,(float16_t)0.6694335937500f, +(float16_t)0.7421875000000f,(float16_t)0.6704101562500f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.7397460937500f,(float16_t)0.6728515625000f, +(float16_t)0.7387695312500f,(float16_t)0.6738281250000f, +(float16_t)0.7377929687500f,(float16_t)0.6748046875000f, +(float16_t)0.7368164062500f,(float16_t)0.6762695312500f, +(float16_t)0.7358398437500f,(float16_t)0.6772460937500f, +(float16_t)0.7348632812500f,(float16_t)0.6782226562500f, +(float16_t)0.7338867187500f,(float16_t)0.6796875000000f, +(float16_t)0.7324218750000f,(float16_t)0.6806640625000f, +(float16_t)0.7314453125000f,(float16_t)0.6816406250000f, +(float16_t)0.7304687500000f,(float16_t)0.6826171875000f, +(float16_t)0.7294921875000f,(float16_t)0.6840820312500f, +(float16_t)0.7285156250000f,(float16_t)0.6850585937500f, +(float16_t)0.7275390625000f,(float16_t)0.6860351562500f, +(float16_t)0.7265625000000f,(float16_t)0.6875000000000f, +(float16_t)0.7250976562500f,(float16_t)0.6884765625000f, +(float16_t)0.7241210937500f,(float16_t)0.6894531250000f, +(float16_t)0.7231445312500f,(float16_t)0.6904296875000f, +(float16_t)0.7221679687500f,(float16_t)0.6918945312500f, +(float16_t)0.7211914062500f,(float16_t)0.6928710937500f, +(float16_t)0.7202148437500f,(float16_t)0.6938476562500f, +(float16_t)0.7187500000000f,(float16_t)0.6953125000000f, +(float16_t)0.7177734375000f,(float16_t)0.6962890625000f, +(float16_t)0.7167968750000f,(float16_t)0.6972656250000f, +(float16_t)0.7158203125000f,(float16_t)0.6982421875000f, +(float16_t)0.7148437500000f,(float16_t)0.6997070312500f, +(float16_t)0.7133789062500f,(float16_t)0.7006835937500f, +(float16_t)0.7124023437500f,(float16_t)0.7016601562500f, +(float16_t)0.7114257812500f,(float16_t)0.7026367187500f, +(float16_t)0.7104492187500f,(float16_t)0.7036132812500f, +(float16_t)0.7094726562500f,(float16_t)0.7050781250000f, +(float16_t)0.7080078125000f,(float16_t)0.7060546875000f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.7060546875000f,(float16_t)0.7080078125000f, +(float16_t)0.7050781250000f,(float16_t)0.7094726562500f, +(float16_t)0.7036132812500f,(float16_t)0.7104492187500f, +(float16_t)0.7026367187500f,(float16_t)0.7114257812500f, +(float16_t)0.7016601562500f,(float16_t)0.7124023437500f, +(float16_t)0.7006835937500f,(float16_t)0.7133789062500f, +(float16_t)0.6997070312500f,(float16_t)0.7148437500000f, +(float16_t)0.6982421875000f,(float16_t)0.7158203125000f, +(float16_t)0.6972656250000f,(float16_t)0.7167968750000f, +(float16_t)0.6962890625000f,(float16_t)0.7177734375000f, +(float16_t)0.6953125000000f,(float16_t)0.7187500000000f, +(float16_t)0.6938476562500f,(float16_t)0.7202148437500f, +(float16_t)0.6928710937500f,(float16_t)0.7211914062500f, +(float16_t)0.6918945312500f,(float16_t)0.7221679687500f, +(float16_t)0.6904296875000f,(float16_t)0.7231445312500f, +(float16_t)0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)0.6884765625000f,(float16_t)0.7250976562500f, +(float16_t)0.6875000000000f,(float16_t)0.7265625000000f, +(float16_t)0.6860351562500f,(float16_t)0.7275390625000f, +(float16_t)0.6850585937500f,(float16_t)0.7285156250000f, +(float16_t)0.6840820312500f,(float16_t)0.7294921875000f, +(float16_t)0.6826171875000f,(float16_t)0.7304687500000f, +(float16_t)0.6816406250000f,(float16_t)0.7314453125000f, +(float16_t)0.6806640625000f,(float16_t)0.7324218750000f, +(float16_t)0.6796875000000f,(float16_t)0.7338867187500f, +(float16_t)0.6782226562500f,(float16_t)0.7348632812500f, +(float16_t)0.6772460937500f,(float16_t)0.7358398437500f, +(float16_t)0.6762695312500f,(float16_t)0.7368164062500f, +(float16_t)0.6748046875000f,(float16_t)0.7377929687500f, +(float16_t)0.6738281250000f,(float16_t)0.7387695312500f, +(float16_t)0.6728515625000f,(float16_t)0.7397460937500f, +(float16_t)0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)0.6704101562500f,(float16_t)0.7421875000000f, +(float16_t)0.6694335937500f,(float16_t)0.7431640625000f, +(float16_t)0.6679687500000f,(float16_t)0.7441406250000f, +(float16_t)0.6669921875000f,(float16_t)0.7451171875000f, +(float16_t)0.6660156250000f,(float16_t)0.7460937500000f, +(float16_t)0.6645507812500f,(float16_t)0.7470703125000f, +(float16_t)0.6635742187500f,(float16_t)0.7480468750000f, +(float16_t)0.6625976562500f,(float16_t)0.7490234375000f, +(float16_t)0.6611328125000f,(float16_t)0.7500000000000f, +(float16_t)0.6601562500000f,(float16_t)0.7509765625000f, +(float16_t)0.6591796875000f,(float16_t)0.7519531250000f, +(float16_t)0.6577148437500f,(float16_t)0.7534179687500f, +(float16_t)0.6567382812500f,(float16_t)0.7543945312500f, +(float16_t)0.6552734375000f,(float16_t)0.7553710937500f, +(float16_t)0.6542968750000f,(float16_t)0.7563476562500f, +(float16_t)0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)0.6518554687500f,(float16_t)0.7583007812500f, +(float16_t)0.6508789062500f,(float16_t)0.7592773437500f, +(float16_t)0.6499023437500f,(float16_t)0.7602539062500f, +(float16_t)0.6484375000000f,(float16_t)0.7612304687500f, +(float16_t)0.6474609375000f,(float16_t)0.7622070312500f, +(float16_t)0.6459960937500f,(float16_t)0.7631835937500f, +(float16_t)0.6450195312500f,(float16_t)0.7641601562500f, +(float16_t)0.6440429687500f,(float16_t)0.7651367187500f, +(float16_t)0.6425781250000f,(float16_t)0.7661132812500f, +(float16_t)0.6416015625000f,(float16_t)0.7670898437500f, +(float16_t)0.6401367187500f,(float16_t)0.7680664062500f, +(float16_t)0.6391601562500f,(float16_t)0.7690429687500f, +(float16_t)0.6381835937500f,(float16_t)0.7700195312500f, +(float16_t)0.6367187500000f,(float16_t)0.7709960937500f, +(float16_t)0.6357421875000f,(float16_t)0.7719726562500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.6333007812500f,(float16_t)0.7739257812500f, +(float16_t)0.6318359375000f,(float16_t)0.7749023437500f, +(float16_t)0.6308593750000f,(float16_t)0.7758789062500f, +(float16_t)0.6293945312500f,(float16_t)0.7768554687500f, +(float16_t)0.6284179687500f,(float16_t)0.7778320312500f, +(float16_t)0.6274414062500f,(float16_t)0.7788085937500f, +(float16_t)0.6259765625000f,(float16_t)0.7797851562500f, +(float16_t)0.6250000000000f,(float16_t)0.7807617187500f, +(float16_t)0.6235351562500f,(float16_t)0.7817382812500f, +(float16_t)0.6225585937500f,(float16_t)0.7827148437500f, +(float16_t)0.6210937500000f,(float16_t)0.7836914062500f, +(float16_t)0.6201171875000f,(float16_t)0.7846679687500f, +(float16_t)0.6186523437500f,(float16_t)0.7856445312500f, +(float16_t)0.6176757812500f,(float16_t)0.7866210937500f, +(float16_t)0.6162109375000f,(float16_t)0.7875976562500f, +(float16_t)0.6152343750000f,(float16_t)0.7885742187500f, +(float16_t)0.6142578125000f,(float16_t)0.7890625000000f, +(float16_t)0.6127929687500f,(float16_t)0.7900390625000f, +(float16_t)0.6118164062500f,(float16_t)0.7910156250000f, +(float16_t)0.6103515625000f,(float16_t)0.7919921875000f, +(float16_t)0.6093750000000f,(float16_t)0.7929687500000f, +(float16_t)0.6079101562500f,(float16_t)0.7939453125000f, +(float16_t)0.6069335937500f,(float16_t)0.7949218750000f, +(float16_t)0.6054687500000f,(float16_t)0.7958984375000f, +(float16_t)0.6044921875000f,(float16_t)0.7968750000000f, +(float16_t)0.6030273437500f,(float16_t)0.7978515625000f, +(float16_t)0.6020507812500f,(float16_t)0.7988281250000f, +(float16_t)0.6005859375000f,(float16_t)0.7993164062500f, +(float16_t)0.5996093750000f,(float16_t)0.8002929687500f, +(float16_t)0.5981445312500f,(float16_t)0.8012695312500f, +(float16_t)0.5971679687500f,(float16_t)0.8022460937500f, +(float16_t)0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)0.5942382812500f,(float16_t)0.8041992187500f, +(float16_t)0.5932617187500f,(float16_t)0.8051757812500f, +(float16_t)0.5917968750000f,(float16_t)0.8061523437500f, +(float16_t)0.5908203125000f,(float16_t)0.8066406250000f, +(float16_t)0.5893554687500f,(float16_t)0.8076171875000f, +(float16_t)0.5883789062500f,(float16_t)0.8085937500000f, +(float16_t)0.5869140625000f,(float16_t)0.8095703125000f, +(float16_t)0.5859375000000f,(float16_t)0.8105468750000f, +(float16_t)0.5844726562500f,(float16_t)0.8115234375000f, +(float16_t)0.5834960937500f,(float16_t)0.8120117187500f, +(float16_t)0.5820312500000f,(float16_t)0.8129882812500f, +(float16_t)0.5810546875000f,(float16_t)0.8139648437500f, +(float16_t)0.5795898437500f,(float16_t)0.8149414062500f, +(float16_t)0.5781250000000f,(float16_t)0.8159179687500f, +(float16_t)0.5771484375000f,(float16_t)0.8168945312500f, +(float16_t)0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)0.5747070312500f,(float16_t)0.8183593750000f, +(float16_t)0.5732421875000f,(float16_t)0.8193359375000f, +(float16_t)0.5722656250000f,(float16_t)0.8203125000000f, +(float16_t)0.5708007812500f,(float16_t)0.8212890625000f, +(float16_t)0.5693359375000f,(float16_t)0.8217773437500f, +(float16_t)0.5683593750000f,(float16_t)0.8227539062500f, +(float16_t)0.5668945312500f,(float16_t)0.8237304687500f, +(float16_t)0.5659179687500f,(float16_t)0.8247070312500f, +(float16_t)0.5644531250000f,(float16_t)0.8256835937500f, +(float16_t)0.5629882812500f,(float16_t)0.8261718750000f, +(float16_t)0.5620117187500f,(float16_t)0.8271484375000f, +(float16_t)0.5605468750000f,(float16_t)0.8281250000000f, +(float16_t)0.5595703125000f,(float16_t)0.8291015625000f, +(float16_t)0.5581054687500f,(float16_t)0.8295898437500f, +(float16_t)0.5566406250000f,(float16_t)0.8305664062500f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.5541992187500f,(float16_t)0.8325195312500f, +(float16_t)0.5532226562500f,(float16_t)0.8330078125000f, +(float16_t)0.5517578125000f,(float16_t)0.8339843750000f, +(float16_t)0.5502929687500f,(float16_t)0.8349609375000f, +(float16_t)0.5493164062500f,(float16_t)0.8359375000000f, +(float16_t)0.5478515625000f,(float16_t)0.8364257812500f, +(float16_t)0.5463867187500f,(float16_t)0.8374023437500f, +(float16_t)0.5454101562500f,(float16_t)0.8383789062500f, +(float16_t)0.5439453125000f,(float16_t)0.8388671875000f, +(float16_t)0.5429687500000f,(float16_t)0.8398437500000f, +(float16_t)0.5415039062500f,(float16_t)0.8408203125000f, +(float16_t)0.5400390625000f,(float16_t)0.8417968750000f, +(float16_t)0.5390625000000f,(float16_t)0.8422851562500f, +(float16_t)0.5375976562500f,(float16_t)0.8432617187500f, +(float16_t)0.5361328125000f,(float16_t)0.8442382812500f, +(float16_t)0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)0.5336914062500f,(float16_t)0.8457031250000f, +(float16_t)0.5322265625000f,(float16_t)0.8466796875000f, +(float16_t)0.5312500000000f,(float16_t)0.8471679687500f, +(float16_t)0.5297851562500f,(float16_t)0.8481445312500f, +(float16_t)0.5283203125000f,(float16_t)0.8491210937500f, +(float16_t)0.5273437500000f,(float16_t)0.8496093750000f, +(float16_t)0.5258789062500f,(float16_t)0.8505859375000f, +(float16_t)0.5244140625000f,(float16_t)0.8515625000000f, +(float16_t)0.5234375000000f,(float16_t)0.8520507812500f, +(float16_t)0.5219726562500f,(float16_t)0.8530273437500f, +(float16_t)0.5205078125000f,(float16_t)0.8540039062500f, +(float16_t)0.5195312500000f,(float16_t)0.8544921875000f, +(float16_t)0.5180664062500f,(float16_t)0.8554687500000f, +(float16_t)0.5166015625000f,(float16_t)0.8559570312500f, +(float16_t)0.5156250000000f,(float16_t)0.8569335937500f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.5126953125000f,(float16_t)0.8583984375000f, +(float16_t)0.5112304687500f,(float16_t)0.8593750000000f, +(float16_t)0.5102539062500f,(float16_t)0.8598632812500f, +(float16_t)0.5087890625000f,(float16_t)0.8608398437500f, +(float16_t)0.5073242187500f,(float16_t)0.8618164062500f, +(float16_t)0.5063476562500f,(float16_t)0.8623046875000f, +(float16_t)0.5048828125000f,(float16_t)0.8632812500000f, +(float16_t)0.5034179687500f,(float16_t)0.8637695312500f, +(float16_t)0.5024414062500f,(float16_t)0.8647460937500f, +(float16_t)0.5009765625000f,(float16_t)0.8657226562500f, +(float16_t)0.4995117187500f,(float16_t)0.8662109375000f, +(float16_t)0.4982910156250f,(float16_t)0.8671875000000f, +(float16_t)0.4968261718750f,(float16_t)0.8676757812500f, +(float16_t)0.4956054687500f,(float16_t)0.8686523437500f, +(float16_t)0.4941406250000f,(float16_t)0.8691406250000f, +(float16_t)0.4929199218750f,(float16_t)0.8701171875000f, +(float16_t)0.4914550781250f,(float16_t)0.8706054687500f, +(float16_t)0.4902343750000f,(float16_t)0.8715820312500f, +(float16_t)0.4887695312500f,(float16_t)0.8725585937500f, +(float16_t)0.4875488281250f,(float16_t)0.8730468750000f, +(float16_t)0.4863281250000f,(float16_t)0.8740234375000f, +(float16_t)0.4848632812500f,(float16_t)0.8745117187500f, +(float16_t)0.4836425781250f,(float16_t)0.8754882812500f, +(float16_t)0.4821777343750f,(float16_t)0.8759765625000f, +(float16_t)0.4809570312500f,(float16_t)0.8769531250000f, +(float16_t)0.4794921875000f,(float16_t)0.8774414062500f, +(float16_t)0.4780273437500f,(float16_t)0.8784179687500f, +(float16_t)0.4768066406250f,(float16_t)0.8789062500000f, +(float16_t)0.4753417968750f,(float16_t)0.8798828125000f, +(float16_t)0.4741210937500f,(float16_t)0.8803710937500f, +(float16_t)0.4726562500000f,(float16_t)0.8813476562500f, +(float16_t)0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)0.4699707031250f,(float16_t)0.8828125000000f, +(float16_t)0.4687500000000f,(float16_t)0.8833007812500f, +(float16_t)0.4672851562500f,(float16_t)0.8842773437500f, +(float16_t)0.4660644531250f,(float16_t)0.8847656250000f, +(float16_t)0.4645996093750f,(float16_t)0.8857421875000f, +(float16_t)0.4633789062500f,(float16_t)0.8862304687500f, +(float16_t)0.4619140625000f,(float16_t)0.8867187500000f, +(float16_t)0.4604492187500f,(float16_t)0.8876953125000f, +(float16_t)0.4592285156250f,(float16_t)0.8881835937500f, +(float16_t)0.4577636718750f,(float16_t)0.8891601562500f, +(float16_t)0.4565429687500f,(float16_t)0.8896484375000f, +(float16_t)0.4550781250000f,(float16_t)0.8906250000000f, +(float16_t)0.4536132812500f,(float16_t)0.8911132812500f, +(float16_t)0.4523925781250f,(float16_t)0.8916015625000f, +(float16_t)0.4509277343750f,(float16_t)0.8925781250000f, +(float16_t)0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)0.4482421875000f,(float16_t)0.8940429687500f, +(float16_t)0.4467773437500f,(float16_t)0.8945312500000f, +(float16_t)0.4455566406250f,(float16_t)0.8955078125000f, +(float16_t)0.4440917968750f,(float16_t)0.8959960937500f, +(float16_t)0.4426269531250f,(float16_t)0.8964843750000f, +(float16_t)0.4414062500000f,(float16_t)0.8974609375000f, +(float16_t)0.4399414062500f,(float16_t)0.8979492187500f, +(float16_t)0.4387207031250f,(float16_t)0.8984375000000f, +(float16_t)0.4372558593750f,(float16_t)0.8994140625000f, +(float16_t)0.4357910156250f,(float16_t)0.8999023437500f, +(float16_t)0.4345703125000f,(float16_t)0.9008789062500f, +(float16_t)0.4331054687500f,(float16_t)0.9013671875000f, +(float16_t)0.4316406250000f,(float16_t)0.9018554687500f, +(float16_t)0.4304199218750f,(float16_t)0.9028320312500f, +(float16_t)0.4289550781250f,(float16_t)0.9033203125000f, +(float16_t)0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)0.4262695312500f,(float16_t)0.9047851562500f, +(float16_t)0.4248046875000f,(float16_t)0.9052734375000f, +(float16_t)0.4233398437500f,(float16_t)0.9057617187500f, +(float16_t)0.4221191406250f,(float16_t)0.9067382812500f, +(float16_t)0.4206542968750f,(float16_t)0.9072265625000f, +(float16_t)0.4191894531250f,(float16_t)0.9077148437500f, +(float16_t)0.4177246093750f,(float16_t)0.9086914062500f, +(float16_t)0.4165039062500f,(float16_t)0.9091796875000f, +(float16_t)0.4150390625000f,(float16_t)0.9096679687500f, +(float16_t)0.4135742187500f,(float16_t)0.9106445312500f, +(float16_t)0.4123535156250f,(float16_t)0.9111328125000f, +(float16_t)0.4108886718750f,(float16_t)0.9116210937500f, +(float16_t)0.4094238281250f,(float16_t)0.9121093750000f, +(float16_t)0.4079589843750f,(float16_t)0.9130859375000f, +(float16_t)0.4067382812500f,(float16_t)0.9135742187500f, +(float16_t)0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)0.4038085937500f,(float16_t)0.9150390625000f, +(float16_t)0.4023437500000f,(float16_t)0.9155273437500f, +(float16_t)0.4011230468750f,(float16_t)0.9160156250000f, +(float16_t)0.3996582031250f,(float16_t)0.9165039062500f, +(float16_t)0.3981933593750f,(float16_t)0.9174804687500f, +(float16_t)0.3967285156250f,(float16_t)0.9179687500000f, +(float16_t)0.3955078125000f,(float16_t)0.9184570312500f, +(float16_t)0.3940429687500f,(float16_t)0.9189453125000f, +(float16_t)0.3925781250000f,(float16_t)0.9199218750000f, +(float16_t)0.3911132812500f,(float16_t)0.9204101562500f, +(float16_t)0.3896484375000f,(float16_t)0.9208984375000f, +(float16_t)0.3884277343750f,(float16_t)0.9213867187500f, +(float16_t)0.3869628906250f,(float16_t)0.9218750000000f, +(float16_t)0.3854980468750f,(float16_t)0.9228515625000f, +(float16_t)0.3840332031250f,(float16_t)0.9233398437500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3813476562500f,(float16_t)0.9243164062500f, +(float16_t)0.3798828125000f,(float16_t)0.9252929687500f, +(float16_t)0.3784179687500f,(float16_t)0.9257812500000f, +(float16_t)0.3769531250000f,(float16_t)0.9262695312500f, +(float16_t)0.3754882812500f,(float16_t)0.9267578125000f, +(float16_t)0.3742675781250f,(float16_t)0.9272460937500f, +(float16_t)0.3728027343750f,(float16_t)0.9277343750000f, +(float16_t)0.3713378906250f,(float16_t)0.9287109375000f, +(float16_t)0.3698730468750f,(float16_t)0.9291992187500f, +(float16_t)0.3684082031250f,(float16_t)0.9296875000000f, +(float16_t)0.3669433593750f,(float16_t)0.9301757812500f, +(float16_t)0.3657226562500f,(float16_t)0.9306640625000f, +(float16_t)0.3642578125000f,(float16_t)0.9311523437500f, +(float16_t)0.3627929687500f,(float16_t)0.9316406250000f, +(float16_t)0.3613281250000f,(float16_t)0.9326171875000f, +(float16_t)0.3598632812500f,(float16_t)0.9331054687500f, +(float16_t)0.3583984375000f,(float16_t)0.9335937500000f, +(float16_t)0.3569335937500f,(float16_t)0.9340820312500f, +(float16_t)0.3557128906250f,(float16_t)0.9345703125000f, +(float16_t)0.3542480468750f,(float16_t)0.9350585937500f, +(float16_t)0.3527832031250f,(float16_t)0.9355468750000f, +(float16_t)0.3513183593750f,(float16_t)0.9360351562500f, +(float16_t)0.3498535156250f,(float16_t)0.9370117187500f, +(float16_t)0.3483886718750f,(float16_t)0.9375000000000f, +(float16_t)0.3469238281250f,(float16_t)0.9379882812500f, +(float16_t)0.3454589843750f,(float16_t)0.9384765625000f, +(float16_t)0.3439941406250f,(float16_t)0.9389648437500f, +(float16_t)0.3427734375000f,(float16_t)0.9394531250000f, +(float16_t)0.3413085937500f,(float16_t)0.9399414062500f, +(float16_t)0.3398437500000f,(float16_t)0.9404296875000f, +(float16_t)0.3383789062500f,(float16_t)0.9409179687500f, +(float16_t)0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)0.3354492187500f,(float16_t)0.9418945312500f, +(float16_t)0.3339843750000f,(float16_t)0.9423828125000f, +(float16_t)0.3325195312500f,(float16_t)0.9428710937500f, +(float16_t)0.3310546875000f,(float16_t)0.9433593750000f, +(float16_t)0.3295898437500f,(float16_t)0.9443359375000f, +(float16_t)0.3281250000000f,(float16_t)0.9448242187500f, +(float16_t)0.3266601562500f,(float16_t)0.9453125000000f, +(float16_t)0.3251953125000f,(float16_t)0.9458007812500f, +(float16_t)0.3239746093750f,(float16_t)0.9462890625000f, +(float16_t)0.3225097656250f,(float16_t)0.9467773437500f, +(float16_t)0.3210449218750f,(float16_t)0.9472656250000f, +(float16_t)0.3195800781250f,(float16_t)0.9477539062500f, +(float16_t)0.3181152343750f,(float16_t)0.9482421875000f, +(float16_t)0.3166503906250f,(float16_t)0.9487304687500f, +(float16_t)0.3151855468750f,(float16_t)0.9492187500000f, +(float16_t)0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)0.3122558593750f,(float16_t)0.9501953125000f, +(float16_t)0.3107910156250f,(float16_t)0.9506835937500f, +(float16_t)0.3093261718750f,(float16_t)0.9511718750000f, +(float16_t)0.3078613281250f,(float16_t)0.9516601562500f, +(float16_t)0.3063964843750f,(float16_t)0.9521484375000f, +(float16_t)0.3049316406250f,(float16_t)0.9521484375000f, +(float16_t)0.3034667968750f,(float16_t)0.9526367187500f, +(float16_t)0.3020019531250f,(float16_t)0.9531250000000f, +(float16_t)0.3005371093750f,(float16_t)0.9536132812500f, +(float16_t)0.2990722656250f,(float16_t)0.9541015625000f, +(float16_t)0.2976074218750f,(float16_t)0.9545898437500f, +(float16_t)0.2961425781250f,(float16_t)0.9550781250000f, +(float16_t)0.2946777343750f,(float16_t)0.9555664062500f, +(float16_t)0.2932128906250f,(float16_t)0.9560546875000f, +(float16_t)0.2917480468750f,(float16_t)0.9565429687500f, +(float16_t)0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)0.2888183593750f,(float16_t)0.9575195312500f, +(float16_t)0.2873535156250f,(float16_t)0.9580078125000f, +(float16_t)0.2858886718750f,(float16_t)0.9584960937500f, +(float16_t)0.2844238281250f,(float16_t)0.9584960937500f, +(float16_t)0.2829589843750f,(float16_t)0.9589843750000f, +(float16_t)0.2814941406250f,(float16_t)0.9594726562500f, +(float16_t)0.2800292968750f,(float16_t)0.9599609375000f, +(float16_t)0.2785644531250f,(float16_t)0.9604492187500f, +(float16_t)0.2770996093750f,(float16_t)0.9609375000000f, +(float16_t)0.2756347656250f,(float16_t)0.9614257812500f, +(float16_t)0.2741699218750f,(float16_t)0.9619140625000f, +(float16_t)0.2727050781250f,(float16_t)0.9619140625000f, +(float16_t)0.2712402343750f,(float16_t)0.9624023437500f, +(float16_t)0.2697753906250f,(float16_t)0.9628906250000f, +(float16_t)0.2683105468750f,(float16_t)0.9633789062500f, +(float16_t)0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)0.2651367187500f,(float16_t)0.9643554687500f, +(float16_t)0.2636718750000f,(float16_t)0.9643554687500f, +(float16_t)0.2622070312500f,(float16_t)0.9648437500000f, +(float16_t)0.2607421875000f,(float16_t)0.9653320312500f, +(float16_t)0.2592773437500f,(float16_t)0.9658203125000f, +(float16_t)0.2578125000000f,(float16_t)0.9663085937500f, +(float16_t)0.2563476562500f,(float16_t)0.9667968750000f, +(float16_t)0.2548828125000f,(float16_t)0.9667968750000f, +(float16_t)0.2534179687500f,(float16_t)0.9672851562500f, +(float16_t)0.2519531250000f,(float16_t)0.9677734375000f, +(float16_t)0.2504882812500f,(float16_t)0.9682617187500f, +(float16_t)0.2489013671875f,(float16_t)0.9687500000000f, +(float16_t)0.2474365234375f,(float16_t)0.9687500000000f, +(float16_t)0.2459716796875f,(float16_t)0.9692382812500f, +(float16_t)0.2445068359375f,(float16_t)0.9697265625000f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.2414550781250f,(float16_t)0.9702148437500f, +(float16_t)0.2399902343750f,(float16_t)0.9707031250000f, +(float16_t)0.2385253906250f,(float16_t)0.9711914062500f, +(float16_t)0.2370605468750f,(float16_t)0.9716796875000f, +(float16_t)0.2354736328125f,(float16_t)0.9716796875000f, +(float16_t)0.2340087890625f,(float16_t)0.9721679687500f, +(float16_t)0.2325439453125f,(float16_t)0.9726562500000f, +(float16_t)0.2310791015625f,(float16_t)0.9731445312500f, +(float16_t)0.2296142578125f,(float16_t)0.9731445312500f, +(float16_t)0.2280273437500f,(float16_t)0.9736328125000f, +(float16_t)0.2265625000000f,(float16_t)0.9741210937500f, +(float16_t)0.2250976562500f,(float16_t)0.9741210937500f, +(float16_t)0.2236328125000f,(float16_t)0.9746093750000f, +(float16_t)0.2220458984375f,(float16_t)0.9750976562500f, +(float16_t)0.2205810546875f,(float16_t)0.9755859375000f, +(float16_t)0.2191162109375f,(float16_t)0.9755859375000f, +(float16_t)0.2176513671875f,(float16_t)0.9760742187500f, +(float16_t)0.2160644531250f,(float16_t)0.9765625000000f, +(float16_t)0.2145996093750f,(float16_t)0.9765625000000f, +(float16_t)0.2131347656250f,(float16_t)0.9770507812500f, +(float16_t)0.2116699218750f,(float16_t)0.9775390625000f, +(float16_t)0.2100830078125f,(float16_t)0.9775390625000f, +(float16_t)0.2086181640625f,(float16_t)0.9780273437500f, +(float16_t)0.2071533203125f,(float16_t)0.9785156250000f, +(float16_t)0.2055664062500f,(float16_t)0.9785156250000f, +(float16_t)0.2041015625000f,(float16_t)0.9790039062500f, +(float16_t)0.2026367187500f,(float16_t)0.9794921875000f, +(float16_t)0.2010498046875f,(float16_t)0.9794921875000f, +(float16_t)0.1995849609375f,(float16_t)0.9799804687500f, +(float16_t)0.1981201171875f,(float16_t)0.9799804687500f, +(float16_t)0.1966552734375f,(float16_t)0.9804687500000f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.1936035156250f,(float16_t)0.9809570312500f, +(float16_t)0.1921386718750f,(float16_t)0.9814453125000f, +(float16_t)0.1905517578125f,(float16_t)0.9814453125000f, +(float16_t)0.1890869140625f,(float16_t)0.9819335937500f, +(float16_t)0.1876220703125f,(float16_t)0.9824218750000f, +(float16_t)0.1860351562500f,(float16_t)0.9824218750000f, +(float16_t)0.1845703125000f,(float16_t)0.9829101562500f, +(float16_t)0.1829833984375f,(float16_t)0.9829101562500f, +(float16_t)0.1815185546875f,(float16_t)0.9833984375000f, +(float16_t)0.1800537109375f,(float16_t)0.9838867187500f, +(float16_t)0.1784667968750f,(float16_t)0.9838867187500f, +(float16_t)0.1770019531250f,(float16_t)0.9843750000000f, +(float16_t)0.1755371093750f,(float16_t)0.9843750000000f, +(float16_t)0.1739501953125f,(float16_t)0.9848632812500f, +(float16_t)0.1724853515625f,(float16_t)0.9848632812500f, +(float16_t)0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)0.1694335937500f,(float16_t)0.9853515625000f, +(float16_t)0.1679687500000f,(float16_t)0.9858398437500f, +(float16_t)0.1663818359375f,(float16_t)0.9858398437500f, +(float16_t)0.1649169921875f,(float16_t)0.9863281250000f, +(float16_t)0.1634521484375f,(float16_t)0.9863281250000f, +(float16_t)0.1618652343750f,(float16_t)0.9868164062500f, +(float16_t)0.1604003906250f,(float16_t)0.9868164062500f, +(float16_t)0.1588134765625f,(float16_t)0.9873046875000f, +(float16_t)0.1573486328125f,(float16_t)0.9873046875000f, +(float16_t)0.1558837890625f,(float16_t)0.9877929687500f, +(float16_t)0.1542968750000f,(float16_t)0.9877929687500f, +(float16_t)0.1528320312500f,(float16_t)0.9882812500000f, +(float16_t)0.1512451171875f,(float16_t)0.9882812500000f, +(float16_t)0.1497802734375f,(float16_t)0.9887695312500f, +(float16_t)0.1481933593750f,(float16_t)0.9887695312500f, +(float16_t)0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)0.1452636718750f,(float16_t)0.9892578125000f, +(float16_t)0.1436767578125f,(float16_t)0.9897460937500f, +(float16_t)0.1422119140625f,(float16_t)0.9897460937500f, +(float16_t)0.1406250000000f,(float16_t)0.9902343750000f, +(float16_t)0.1391601562500f,(float16_t)0.9902343750000f, +(float16_t)0.1375732421875f,(float16_t)0.9907226562500f, +(float16_t)0.1361083984375f,(float16_t)0.9907226562500f, +(float16_t)0.1345214843750f,(float16_t)0.9907226562500f, +(float16_t)0.1330566406250f,(float16_t)0.9912109375000f, +(float16_t)0.1315917968750f,(float16_t)0.9912109375000f, +(float16_t)0.1300048828125f,(float16_t)0.9916992187500f, +(float16_t)0.1285400390625f,(float16_t)0.9916992187500f, +(float16_t)0.1269531250000f,(float16_t)0.9916992187500f, +(float16_t)0.1254882812500f,(float16_t)0.9921875000000f, +(float16_t)0.1239624023438f,(float16_t)0.9921875000000f, +(float16_t)0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)0.1209106445312f,(float16_t)0.9926757812500f, +(float16_t)0.1193847656250f,(float16_t)0.9926757812500f, +(float16_t)0.1178588867188f,(float16_t)0.9931640625000f, +(float16_t)0.1163330078125f,(float16_t)0.9931640625000f, +(float16_t)0.1148071289062f,(float16_t)0.9931640625000f, +(float16_t)0.1132812500000f,(float16_t)0.9936523437500f, +(float16_t)0.1117553710938f,(float16_t)0.9936523437500f, +(float16_t)0.1102294921875f,(float16_t)0.9941406250000f, +(float16_t)0.1087036132812f,(float16_t)0.9941406250000f, +(float16_t)0.1071777343750f,(float16_t)0.9941406250000f, +(float16_t)0.1056518554688f,(float16_t)0.9946289062500f, +(float16_t)0.1041259765625f,(float16_t)0.9946289062500f, +(float16_t)0.1026000976562f,(float16_t)0.9946289062500f, +(float16_t)0.1010742187500f,(float16_t)0.9951171875000f, +(float16_t)0.0995483398438f,(float16_t)0.9951171875000f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0964965820312f,(float16_t)0.9951171875000f, +(float16_t)0.0949707031250f,(float16_t)0.9956054687500f, +(float16_t)0.0934448242188f,(float16_t)0.9956054687500f, +(float16_t)0.0919189453125f,(float16_t)0.9956054687500f, +(float16_t)0.0903930664062f,(float16_t)0.9960937500000f, +(float16_t)0.0888671875000f,(float16_t)0.9960937500000f, +(float16_t)0.0873413085938f,(float16_t)0.9960937500000f, +(float16_t)0.0858154296875f,(float16_t)0.9960937500000f, +(float16_t)0.0842895507812f,(float16_t)0.9965820312500f, +(float16_t)0.0827636718750f,(float16_t)0.9965820312500f, +(float16_t)0.0812377929688f,(float16_t)0.9965820312500f, +(float16_t)0.0797119140625f,(float16_t)0.9965820312500f, +(float16_t)0.0781250000000f,(float16_t)0.9970703125000f, +(float16_t)0.0765991210938f,(float16_t)0.9970703125000f, +(float16_t)0.0750732421875f,(float16_t)0.9970703125000f, +(float16_t)0.0735473632812f,(float16_t)0.9970703125000f, +(float16_t)0.0720214843750f,(float16_t)0.9975585937500f, +(float16_t)0.0704956054688f,(float16_t)0.9975585937500f, +(float16_t)0.0689697265625f,(float16_t)0.9975585937500f, +(float16_t)0.0674438476562f,(float16_t)0.9975585937500f, +(float16_t)0.0659179687500f,(float16_t)0.9980468750000f, +(float16_t)0.0643920898438f,(float16_t)0.9980468750000f, +(float16_t)0.0628662109375f,(float16_t)0.9980468750000f, +(float16_t)0.0613098144531f,(float16_t)0.9980468750000f, +(float16_t)0.0597839355469f,(float16_t)0.9980468750000f, +(float16_t)0.0582580566406f,(float16_t)0.9985351562500f, +(float16_t)0.0567321777344f,(float16_t)0.9985351562500f, +(float16_t)0.0552062988281f,(float16_t)0.9985351562500f, +(float16_t)0.0536499023438f,(float16_t)0.9985351562500f, +(float16_t)0.0521240234375f,(float16_t)0.9985351562500f, +(float16_t)0.0505981445312f,(float16_t)0.9985351562500f, +(float16_t)0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)0.0475463867188f,(float16_t)0.9990234375000f, +(float16_t)0.0459899902344f,(float16_t)0.9990234375000f, +(float16_t)0.0444641113281f,(float16_t)0.9990234375000f, +(float16_t)0.0429382324219f,(float16_t)0.9990234375000f, +(float16_t)0.0414123535156f,(float16_t)0.9990234375000f, +(float16_t)0.0398864746094f,(float16_t)0.9990234375000f, +(float16_t)0.0383300781250f,(float16_t)0.9990234375000f, +(float16_t)0.0368041992188f,(float16_t)0.9995117187500f, +(float16_t)0.0352783203125f,(float16_t)0.9995117187500f, +(float16_t)0.0337524414062f,(float16_t)0.9995117187500f, +(float16_t)0.0321960449219f,(float16_t)0.9995117187500f, +(float16_t)0.0306701660156f,(float16_t)0.9995117187500f, +(float16_t)0.0291442871094f,(float16_t)0.9995117187500f, +(float16_t)0.0276031494141f,(float16_t)0.9995117187500f, +(float16_t)0.0260772705078f,(float16_t)0.9995117187500f, +(float16_t)0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)0.0230102539062f,(float16_t)0.9995117187500f, +(float16_t)0.0214691162109f,(float16_t)1.0000000000000f, +(float16_t)0.0199432373047f,(float16_t)1.0000000000000f, +(float16_t)0.0184020996094f,(float16_t)1.0000000000000f, +(float16_t)0.0168762207031f,(float16_t)1.0000000000000f, +(float16_t)0.0153427124023f,(float16_t)1.0000000000000f, +(float16_t)0.0138015747070f,(float16_t)1.0000000000000f, +(float16_t)0.0122680664062f,(float16_t)1.0000000000000f, +(float16_t)0.0107345581055f,(float16_t)1.0000000000000f, +(float16_t)0.0092010498047f,(float16_t)1.0000000000000f, +(float16_t)0.0076713562012f,(float16_t)1.0000000000000f, +(float16_t)0.0061340332031f,(float16_t)1.0000000000000f, +(float16_t)0.0046005249023f,(float16_t)1.0000000000000f, +(float16_t)0.0030670166016f,(float16_t)1.0000000000000f, +(float16_t)0.0015335083008f,(float16_t)1.0000000000000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)1.0000000000000f,(float16_t)0.0061340332031f, +(float16_t)1.0000000000000f,(float16_t)0.0122680664062f, +(float16_t)1.0000000000000f,(float16_t)0.0184020996094f, +(float16_t)0.9995117187500f,(float16_t)0.0245361328125f, +(float16_t)0.9995117187500f,(float16_t)0.0306701660156f, +(float16_t)0.9995117187500f,(float16_t)0.0368041992188f, +(float16_t)0.9990234375000f,(float16_t)0.0429382324219f, +(float16_t)0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)0.9985351562500f,(float16_t)0.0552062988281f, +(float16_t)0.9980468750000f,(float16_t)0.0613098144531f, +(float16_t)0.9975585937500f,(float16_t)0.0674438476562f, +(float16_t)0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)0.9965820312500f,(float16_t)0.0797119140625f, +(float16_t)0.9960937500000f,(float16_t)0.0858154296875f, +(float16_t)0.9956054687500f,(float16_t)0.0919189453125f, +(float16_t)0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)0.9946289062500f,(float16_t)0.1041259765625f, +(float16_t)0.9941406250000f,(float16_t)0.1102294921875f, +(float16_t)0.9931640625000f,(float16_t)0.1163330078125f, +(float16_t)0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)0.9916992187500f,(float16_t)0.1285400390625f, +(float16_t)0.9907226562500f,(float16_t)0.1345214843750f, +(float16_t)0.9902343750000f,(float16_t)0.1406250000000f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9882812500000f,(float16_t)0.1528320312500f, +(float16_t)0.9873046875000f,(float16_t)0.1588134765625f, +(float16_t)0.9863281250000f,(float16_t)0.1649169921875f, +(float16_t)0.9853515625000f,(float16_t)0.1710205078125f, +(float16_t)0.9843750000000f,(float16_t)0.1770019531250f, +(float16_t)0.9829101562500f,(float16_t)0.1829833984375f, +(float16_t)0.9819335937500f,(float16_t)0.1890869140625f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9794921875000f,(float16_t)0.2010498046875f, +(float16_t)0.9785156250000f,(float16_t)0.2071533203125f, +(float16_t)0.9770507812500f,(float16_t)0.2131347656250f, +(float16_t)0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)0.9741210937500f,(float16_t)0.2250976562500f, +(float16_t)0.9731445312500f,(float16_t)0.2310791015625f, +(float16_t)0.9716796875000f,(float16_t)0.2370605468750f, +(float16_t)0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)0.9687500000000f,(float16_t)0.2489013671875f, +(float16_t)0.9667968750000f,(float16_t)0.2548828125000f, +(float16_t)0.9653320312500f,(float16_t)0.2607421875000f, +(float16_t)0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)0.9619140625000f,(float16_t)0.2727050781250f, +(float16_t)0.9604492187500f,(float16_t)0.2785644531250f, +(float16_t)0.9584960937500f,(float16_t)0.2844238281250f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9550781250000f,(float16_t)0.2961425781250f, +(float16_t)0.9531250000000f,(float16_t)0.3020019531250f, +(float16_t)0.9516601562500f,(float16_t)0.3078613281250f, +(float16_t)0.9497070312500f,(float16_t)0.3137207031250f, +(float16_t)0.9477539062500f,(float16_t)0.3195800781250f, +(float16_t)0.9458007812500f,(float16_t)0.3251953125000f, +(float16_t)0.9433593750000f,(float16_t)0.3310546875000f, +(float16_t)0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)0.9394531250000f,(float16_t)0.3427734375000f, +(float16_t)0.9375000000000f,(float16_t)0.3483886718750f, +(float16_t)0.9350585937500f,(float16_t)0.3542480468750f, +(float16_t)0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)0.9306640625000f,(float16_t)0.3657226562500f, +(float16_t)0.9287109375000f,(float16_t)0.3713378906250f, +(float16_t)0.9262695312500f,(float16_t)0.3769531250000f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.9213867187500f,(float16_t)0.3884277343750f, +(float16_t)0.9189453125000f,(float16_t)0.3940429687500f, +(float16_t)0.9165039062500f,(float16_t)0.3996582031250f, +(float16_t)0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)0.9116210937500f,(float16_t)0.4108886718750f, +(float16_t)0.9091796875000f,(float16_t)0.4165039062500f, +(float16_t)0.9067382812500f,(float16_t)0.4221191406250f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.9013671875000f,(float16_t)0.4331054687500f, +(float16_t)0.8984375000000f,(float16_t)0.4387207031250f, +(float16_t)0.8959960937500f,(float16_t)0.4440917968750f, +(float16_t)0.8930664062500f,(float16_t)0.4497070312500f, +(float16_t)0.8906250000000f,(float16_t)0.4550781250000f, +(float16_t)0.8876953125000f,(float16_t)0.4604492187500f, +(float16_t)0.8847656250000f,(float16_t)0.4660644531250f, +(float16_t)0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)0.8789062500000f,(float16_t)0.4768066406250f, +(float16_t)0.8759765625000f,(float16_t)0.4821777343750f, +(float16_t)0.8730468750000f,(float16_t)0.4875488281250f, +(float16_t)0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)0.8671875000000f,(float16_t)0.4982910156250f, +(float16_t)0.8637695312500f,(float16_t)0.5034179687500f, +(float16_t)0.8608398437500f,(float16_t)0.5087890625000f, +(float16_t)0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)0.8544921875000f,(float16_t)0.5195312500000f, +(float16_t)0.8515625000000f,(float16_t)0.5244140625000f, +(float16_t)0.8481445312500f,(float16_t)0.5297851562500f, +(float16_t)0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)0.8417968750000f,(float16_t)0.5400390625000f, +(float16_t)0.8383789062500f,(float16_t)0.5454101562500f, +(float16_t)0.8349609375000f,(float16_t)0.5502929687500f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.8281250000000f,(float16_t)0.5605468750000f, +(float16_t)0.8247070312500f,(float16_t)0.5659179687500f, +(float16_t)0.8212890625000f,(float16_t)0.5708007812500f, +(float16_t)0.8173828125000f,(float16_t)0.5756835937500f, +(float16_t)0.8139648437500f,(float16_t)0.5810546875000f, +(float16_t)0.8105468750000f,(float16_t)0.5859375000000f, +(float16_t)0.8066406250000f,(float16_t)0.5908203125000f, +(float16_t)0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)0.7993164062500f,(float16_t)0.6005859375000f, +(float16_t)0.7958984375000f,(float16_t)0.6054687500000f, +(float16_t)0.7919921875000f,(float16_t)0.6103515625000f, +(float16_t)0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)0.7846679687500f,(float16_t)0.6201171875000f, +(float16_t)0.7807617187500f,(float16_t)0.6250000000000f, +(float16_t)0.7768554687500f,(float16_t)0.6293945312500f, +(float16_t)0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)0.7690429687500f,(float16_t)0.6391601562500f, +(float16_t)0.7651367187500f,(float16_t)0.6440429687500f, +(float16_t)0.7612304687500f,(float16_t)0.6484375000000f, +(float16_t)0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)0.7534179687500f,(float16_t)0.6577148437500f, +(float16_t)0.7490234375000f,(float16_t)0.6625976562500f, +(float16_t)0.7451171875000f,(float16_t)0.6669921875000f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.7368164062500f,(float16_t)0.6762695312500f, +(float16_t)0.7324218750000f,(float16_t)0.6806640625000f, +(float16_t)0.7285156250000f,(float16_t)0.6850585937500f, +(float16_t)0.7241210937500f,(float16_t)0.6894531250000f, +(float16_t)0.7202148437500f,(float16_t)0.6938476562500f, +(float16_t)0.7158203125000f,(float16_t)0.6982421875000f, +(float16_t)0.7114257812500f,(float16_t)0.7026367187500f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.7026367187500f,(float16_t)0.7114257812500f, +(float16_t)0.6982421875000f,(float16_t)0.7158203125000f, +(float16_t)0.6938476562500f,(float16_t)0.7202148437500f, +(float16_t)0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)0.6850585937500f,(float16_t)0.7285156250000f, +(float16_t)0.6806640625000f,(float16_t)0.7324218750000f, +(float16_t)0.6762695312500f,(float16_t)0.7368164062500f, +(float16_t)0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)0.6669921875000f,(float16_t)0.7451171875000f, +(float16_t)0.6625976562500f,(float16_t)0.7490234375000f, +(float16_t)0.6577148437500f,(float16_t)0.7534179687500f, +(float16_t)0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)0.6484375000000f,(float16_t)0.7612304687500f, +(float16_t)0.6440429687500f,(float16_t)0.7651367187500f, +(float16_t)0.6391601562500f,(float16_t)0.7690429687500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.6293945312500f,(float16_t)0.7768554687500f, +(float16_t)0.6250000000000f,(float16_t)0.7807617187500f, +(float16_t)0.6201171875000f,(float16_t)0.7846679687500f, +(float16_t)0.6152343750000f,(float16_t)0.7885742187500f, +(float16_t)0.6103515625000f,(float16_t)0.7919921875000f, +(float16_t)0.6054687500000f,(float16_t)0.7958984375000f, +(float16_t)0.6005859375000f,(float16_t)0.7993164062500f, +(float16_t)0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)0.5908203125000f,(float16_t)0.8066406250000f, +(float16_t)0.5859375000000f,(float16_t)0.8105468750000f, +(float16_t)0.5810546875000f,(float16_t)0.8139648437500f, +(float16_t)0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)0.5708007812500f,(float16_t)0.8212890625000f, +(float16_t)0.5659179687500f,(float16_t)0.8247070312500f, +(float16_t)0.5605468750000f,(float16_t)0.8281250000000f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.5502929687500f,(float16_t)0.8349609375000f, +(float16_t)0.5454101562500f,(float16_t)0.8383789062500f, +(float16_t)0.5400390625000f,(float16_t)0.8417968750000f, +(float16_t)0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)0.5297851562500f,(float16_t)0.8481445312500f, +(float16_t)0.5244140625000f,(float16_t)0.8515625000000f, +(float16_t)0.5195312500000f,(float16_t)0.8544921875000f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.5087890625000f,(float16_t)0.8608398437500f, +(float16_t)0.5034179687500f,(float16_t)0.8637695312500f, +(float16_t)0.4982910156250f,(float16_t)0.8671875000000f, +(float16_t)0.4929199218750f,(float16_t)0.8701171875000f, +(float16_t)0.4875488281250f,(float16_t)0.8730468750000f, +(float16_t)0.4821777343750f,(float16_t)0.8759765625000f, +(float16_t)0.4768066406250f,(float16_t)0.8789062500000f, +(float16_t)0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)0.4660644531250f,(float16_t)0.8847656250000f, +(float16_t)0.4604492187500f,(float16_t)0.8876953125000f, +(float16_t)0.4550781250000f,(float16_t)0.8906250000000f, +(float16_t)0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)0.4440917968750f,(float16_t)0.8959960937500f, +(float16_t)0.4387207031250f,(float16_t)0.8984375000000f, +(float16_t)0.4331054687500f,(float16_t)0.9013671875000f, +(float16_t)0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)0.4221191406250f,(float16_t)0.9067382812500f, +(float16_t)0.4165039062500f,(float16_t)0.9091796875000f, +(float16_t)0.4108886718750f,(float16_t)0.9116210937500f, +(float16_t)0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)0.3996582031250f,(float16_t)0.9165039062500f, +(float16_t)0.3940429687500f,(float16_t)0.9189453125000f, +(float16_t)0.3884277343750f,(float16_t)0.9213867187500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3769531250000f,(float16_t)0.9262695312500f, +(float16_t)0.3713378906250f,(float16_t)0.9287109375000f, +(float16_t)0.3657226562500f,(float16_t)0.9306640625000f, +(float16_t)0.3598632812500f,(float16_t)0.9331054687500f, +(float16_t)0.3542480468750f,(float16_t)0.9350585937500f, +(float16_t)0.3483886718750f,(float16_t)0.9375000000000f, +(float16_t)0.3427734375000f,(float16_t)0.9394531250000f, +(float16_t)0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)0.3310546875000f,(float16_t)0.9433593750000f, +(float16_t)0.3251953125000f,(float16_t)0.9458007812500f, +(float16_t)0.3195800781250f,(float16_t)0.9477539062500f, +(float16_t)0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)0.3078613281250f,(float16_t)0.9516601562500f, +(float16_t)0.3020019531250f,(float16_t)0.9531250000000f, +(float16_t)0.2961425781250f,(float16_t)0.9550781250000f, +(float16_t)0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)0.2844238281250f,(float16_t)0.9584960937500f, +(float16_t)0.2785644531250f,(float16_t)0.9604492187500f, +(float16_t)0.2727050781250f,(float16_t)0.9619140625000f, +(float16_t)0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)0.2607421875000f,(float16_t)0.9653320312500f, +(float16_t)0.2548828125000f,(float16_t)0.9667968750000f, +(float16_t)0.2489013671875f,(float16_t)0.9687500000000f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.2370605468750f,(float16_t)0.9716796875000f, +(float16_t)0.2310791015625f,(float16_t)0.9731445312500f, +(float16_t)0.2250976562500f,(float16_t)0.9741210937500f, +(float16_t)0.2191162109375f,(float16_t)0.9755859375000f, +(float16_t)0.2131347656250f,(float16_t)0.9770507812500f, +(float16_t)0.2071533203125f,(float16_t)0.9785156250000f, +(float16_t)0.2010498046875f,(float16_t)0.9794921875000f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.1890869140625f,(float16_t)0.9819335937500f, +(float16_t)0.1829833984375f,(float16_t)0.9829101562500f, +(float16_t)0.1770019531250f,(float16_t)0.9843750000000f, +(float16_t)0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)0.1649169921875f,(float16_t)0.9863281250000f, +(float16_t)0.1588134765625f,(float16_t)0.9873046875000f, +(float16_t)0.1528320312500f,(float16_t)0.9882812500000f, +(float16_t)0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)0.1406250000000f,(float16_t)0.9902343750000f, +(float16_t)0.1345214843750f,(float16_t)0.9907226562500f, +(float16_t)0.1285400390625f,(float16_t)0.9916992187500f, +(float16_t)0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)0.1163330078125f,(float16_t)0.9931640625000f, +(float16_t)0.1102294921875f,(float16_t)0.9941406250000f, +(float16_t)0.1041259765625f,(float16_t)0.9946289062500f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0919189453125f,(float16_t)0.9956054687500f, +(float16_t)0.0858154296875f,(float16_t)0.9960937500000f, +(float16_t)0.0797119140625f,(float16_t)0.9965820312500f, +(float16_t)0.0735473632812f,(float16_t)0.9970703125000f, +(float16_t)0.0674438476562f,(float16_t)0.9975585937500f, +(float16_t)0.0613098144531f,(float16_t)0.9980468750000f, +(float16_t)0.0552062988281f,(float16_t)0.9985351562500f, +(float16_t)0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)0.0429382324219f,(float16_t)0.9990234375000f, +(float16_t)0.0368041992188f,(float16_t)0.9995117187500f, +(float16_t)0.0306701660156f,(float16_t)0.9995117187500f, +(float16_t)0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)0.0184020996094f,(float16_t)1.0000000000000f, +(float16_t)0.0122680664062f,(float16_t)1.0000000000000f, +(float16_t)0.0061340332031f,(float16_t)1.0000000000000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9995117187500f,(float16_t)0.0245361328125f, +(float16_t)0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9853515625000f,(float16_t)0.1710205078125f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9497070312500f,(float16_t)0.3137207031250f, +(float16_t)0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.8930664062500f,(float16_t)0.4497070312500f, +(float16_t)0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.8173828125000f,(float16_t)0.5756835937500f, +(float16_t)0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.7241210937500f,(float16_t)0.6894531250000f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.6152343750000f,(float16_t)0.7885742187500f, +(float16_t)0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.4929199218750f,(float16_t)0.8701171875000f, +(float16_t)0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3598632812500f,(float16_t)0.9331054687500f, +(float16_t)0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.2191162109375f,(float16_t)0.9755859375000f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0735473632812f,(float16_t)0.9970703125000f, +(float16_t)0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f,}; float16_t rearranged_twiddle_stride2_4096_f16[2728]={ -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99999529380957619118f,(float16_t)0.00306795676296597614f, -(float16_t)0.99998117528260110909f,(float16_t)0.00613588464915447527f, -(float16_t)0.99995764455196389786f,(float16_t)0.00920375478205981944f, -(float16_t)0.99992470183914450299f,(float16_t)0.01227153828571992539f, -(float16_t)0.99988234745421256111f,(float16_t)0.01533920628498810015f, -(float16_t)0.99983058179582340319f,(float16_t)0.01840672990580482019f, -(float16_t)0.99976940535121527898f,(float16_t)0.02147408027546950787f, -(float16_t)0.99969881869620424997f,(float16_t)0.02454122852291228812f, -(float16_t)0.99961882249517863830f,(float16_t)0.02760814577896573974f, -(float16_t)0.99952941750109314256f,(float16_t)0.03067480317663662595f, -(float16_t)0.99943060455546173237f,(float16_t)0.03374117185137757990f, -(float16_t)0.99932238458834954375f,(float16_t)0.03680722294135883171f, -(float16_t)0.99920475861836388631f,(float16_t)0.03987292758773981066f, -(float16_t)0.99907772775264536147f,(float16_t)0.04293825693494082024f, -(float16_t)0.99894129318685687124f,(float16_t)0.04600318213091462299f, -(float16_t)0.99879545620517240501f,(float16_t)0.04906767432741801493f, -(float16_t)0.99864021818026527111f,(float16_t)0.05213170468028332366f, -(float16_t)0.99847558057329477421f,(float16_t)0.05519524434968993420f, -(float16_t)0.99830154493389289261f,(float16_t)0.05825826450043575244f, -(float16_t)0.99811811290014917919f,(float16_t)0.06132073630220857829f, -(float16_t)0.99792528619859599548f,(float16_t)0.06438263092985746505f, -(float16_t)0.99772306664419163624f,(float16_t)0.06744391956366405094f, -(float16_t)0.99751145614030345410f,(float16_t)0.07050457338961385600f, -(float16_t)0.99729045667869020697f,(float16_t)0.07356456359966742631f, -(float16_t)0.99706007033948296225f,(float16_t)0.07662386139203149205f, -(float16_t)0.99682029929116566791f,(float16_t)0.07968243797143012563f, -(float16_t)0.99657114579055483539f,(float16_t)0.08274026454937569164f, -(float16_t)0.99631261218277800129f,(float16_t)0.08579731234443989385f, -(float16_t)0.99604470090125196702f,(float16_t)0.08885355258252460031f, -(float16_t)0.99576741446765981713f,(float16_t)0.09190895649713272386f, -(float16_t)0.99548075549192693856f,(float16_t)0.09496349532963899165f, -(float16_t)0.99518472667219692873f,(float16_t)0.09801714032956060363f, -(float16_t)0.99487933079480561638f,(float16_t)0.10106986275482782167f, -(float16_t)0.99456457073425541537f,(float16_t)0.10412163387205458642f, -(float16_t)0.99424044945318790223f,(float16_t)0.10717242495680884273f, -(float16_t)0.99390697000235606051f,(float16_t)0.11022220729388305938f, -(float16_t)0.99356413552059530403f,(float16_t)0.11327095217756434631f, -(float16_t)0.99321194923479450001f,(float16_t)0.11631863091190475235f, -(float16_t)0.99285041445986510489f,(float16_t)0.11936521481099135467f, -(float16_t)0.99247953459870996706f,(float16_t)0.12241067519921619566f, -(float16_t)0.99209931314219179654f,(float16_t)0.12545498341154623367f, -(float16_t)0.99170975366909952520f,(float16_t)0.12849811079379316880f, -(float16_t)0.99131085984611544415f,(float16_t)0.13154002870288311611f, -(float16_t)0.99090263542778000971f,(float16_t)0.13458070850712616773f, -(float16_t)0.99048508425645709341f,(float16_t)0.13762012158648603832f, -(float16_t)0.99005821026229712256f,(float16_t)0.14065823933284921088f, -(float16_t)0.98962201746320088702f,(float16_t)0.14369503315029447110f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.98872169196032377858f,(float16_t)0.14976453467732150915f, -(float16_t)0.98825756773074946437f,(float16_t)0.15279718525844343535f, -(float16_t)0.98778414164457217783f,(float16_t)0.15582839765426523271f, -(float16_t)0.98730141815785843473f,(float16_t)0.15885814333386144570f, -(float16_t)0.98680940181418552726f,(float16_t)0.16188639378011182579f, -(float16_t)0.98630809724459866938f,(float16_t)0.16491312048996989437f, -(float16_t)0.98579750916756747614f,(float16_t)0.16793829497473117263f, -(float16_t)0.98527764238894122162f,(float16_t)0.17096188876030121717f, -(float16_t)0.98474850180190420801f,(float16_t)0.17398387338746382214f, -(float16_t)0.98421009238692902521f,(float16_t)0.17700422041214874946f, -(float16_t)0.98366241921173025453f,(float16_t)0.18002290140569951471f, -(float16_t)0.98310548743121628501f,(float16_t)0.18303988795514095078f, -(float16_t)0.98253930228744124076f,(float16_t)0.18605515166344663291f, -(float16_t)0.98196386910955524296f,(float16_t)0.18906866414980619262f, -(float16_t)0.98137919331375456089f,(float16_t)0.19208039704989243734f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.98018213596811742949f,(float16_t)0.19809841071795356027f, -(float16_t)0.97956976568544051887f,(float16_t)0.20110463484209190055f, -(float16_t)0.97894817531906219710f,(float16_t)0.20410896609281686809f, -(float16_t)0.97831737071962765473f,(float16_t)0.20711137619221856032f, -(float16_t)0.97767735782450992943f,(float16_t)0.21011183688046961016f, -(float16_t)0.97702814265775439484f,(float16_t)0.21311031991609136194f, -(float16_t)0.97636973133002114000f,(float16_t)0.21610679707621952006f, -(float16_t)0.97570213003852857003f,(float16_t)0.21910124015686979759f, -(float16_t)0.97502534506699412020f,(float16_t)0.22209362097320350937f, -(float16_t)0.97433938278557585821f,(float16_t)0.22508391135979283204f, -(float16_t)0.97364424965081197705f,(float16_t)0.22807208317088573102f, -(float16_t)0.97293995220556017678f,(float16_t)0.23105810828067110951f, -(float16_t)0.97222649707893626925f,(float16_t)0.23404195858354343018f, -(float16_t)0.97150389098625178352f,(float16_t)0.23702360599436719801f, -(float16_t)0.97077214072895035013f,(float16_t)0.24000302244874149871f, -(float16_t)0.97003125319454397424f,(float16_t)0.24298017990326387094f, -(float16_t)0.96928123535654853171f,(float16_t)0.24595505033579459497f, -(float16_t)0.96852209427441737777f,(float16_t)0.24892760574572014853f, -(float16_t)0.96775383709347551076f,(float16_t)0.25189781815421696809f, -(float16_t)0.96697647104485207059f,(float16_t)0.25486565960451457169f, -(float16_t)0.96619000344541250413f,(float16_t)0.25783110216215898713f, -(float16_t)0.96539444169768939830f,(float16_t)0.26079411791527551401f, -(float16_t)0.96458979328981275803f,(float16_t)0.26375467897483134694f, -(float16_t)0.96377606579543984022f,(float16_t)0.26671275747489836538f, -(float16_t)0.96295326687368387741f,(float16_t)0.26966832557291509076f, -(float16_t)0.96212140426904158019f,(float16_t)0.27262135544994897662f, -(float16_t)0.96128048581132063966f,(float16_t)0.27557181931095814376f, -(float16_t)0.96043051941556578655f,(float16_t)0.27851968938505305973f, -(float16_t)0.95957151308198451733f,(float16_t)0.28146493792575794091f, -(float16_t)0.95870347489587159906f,(float16_t)0.28440753721127187692f, -(float16_t)0.95782641302753290802f,(float16_t)0.28734745954472951102f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.95604525134999640557f,(float16_t)0.29321916269425862822f, -(float16_t)0.95514116830577078243f,(float16_t)0.29615088824362378883f, -(float16_t)0.95422809510910566733f,(float16_t)0.29907982630804047508f, -(float16_t)0.95330604035419386211f,(float16_t)0.30200594931922808417f, -(float16_t)0.95237501271976587880f,(float16_t)0.30492922973540237397f, -(float16_t)0.95143502096900833820f,(float16_t)0.30784964004153486661f, -(float16_t)0.95048607394948170235f,(float16_t)0.31076715274961147495f, -(float16_t)0.94952818059303667475f,(float16_t)0.31368174039889151761f, -(float16_t)0.94856134991573026749f,(float16_t)0.31659337555616584581f, -(float16_t)0.94758559101774109124f,(float16_t)0.31950203081601569188f, -(float16_t)0.94660091308328353499f,(float16_t)0.32240767880106985244f, -(float16_t)0.94560732538052127971f,(float16_t)0.32531029216226292622f, -(float16_t)0.94460483726148025685f,(float16_t)0.32820984357909249729f, -(float16_t)0.94359345816196038559f,(float16_t)0.33110630575987642921f, -(float16_t)0.94257319760144686605f,(float16_t)0.33399965144200938205f, -(float16_t)0.94154406518302080631f,(float16_t)0.33688985339222005111f, -(float16_t)0.94050607059326829518f,(float16_t)0.33977688440682685123f, -(float16_t)0.93945922360218991898f,(float16_t)0.34266071731199437833f, -(float16_t)0.93840353406310805795f,(float16_t)0.34554132496398909380f, -(float16_t)0.93733901191257495977f,(float16_t)0.34841868024943456472f, -(float16_t)0.93626566717027825959f,(float16_t)0.35129275608556709276f, -(float16_t)0.93518350993894761025f,(float16_t)0.35416352542049034380f, -(float16_t)0.93409255040425887007f,(float16_t)0.35703096123342997759f, -(float16_t)0.93299279883473895669f,(float16_t)0.35989503653498811087f, -(float16_t)0.93188426558166814750f,(float16_t)0.36275572436739722537f, -(float16_t)0.93076696107898371224f,(float16_t)0.36561299780477385379f, -(float16_t)0.92964089584318121418f,(float16_t)0.36846682995337232125f, -(float16_t)0.92850608047321558924f,(float16_t)0.37131719395183754306f, -(float16_t)0.92736252565040111495f,(float16_t)0.37416406297145793358f, -(float16_t)0.92621024213831137928f,(float16_t)0.37700741021641825945f, -(float16_t)0.92504924078267758425f,(float16_t)0.37984720892405116066f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.92270112833387862850f,(float16_t)0.38551605384391884890f, -(float16_t)0.92151403934204190183f,(float16_t)0.38834504669882624617f, -(float16_t)0.92031827670911059425f,(float16_t)0.39117038430225387069f, -(float16_t)0.91911385169005777040f,(float16_t)0.39399204006104809883f, -(float16_t)0.91790077562139049672f,(float16_t)0.39680998741671030805f, -(float16_t)0.91667905992104270485f,(float16_t)0.39962419984564678810f, -(float16_t)0.91544871608826783316f,(float16_t)0.40243465085941843018f, -(float16_t)0.91420975570353069095f,(float16_t)0.40524131400498986100f, -(float16_t)0.91296219042839821256f,(float16_t)0.40804416286497868782f, -(float16_t)0.91170603200542987832f,(float16_t)0.41084317105790391089f, -(float16_t)0.91044129225806724737f,(float16_t)0.41363831223843450235f, -(float16_t)0.90916798309052238025f,(float16_t)0.41642956009763715253f, -(float16_t)0.90788611648766626150f,(float16_t)0.41921688836322390515f, -(float16_t)0.90659570451491533483f,(float16_t)0.42200027079979968159f, -(float16_t)0.90529675931811881551f,(float16_t)0.42477968120910880589f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.90267331823725882600f,(float16_t)0.43032648134008261165f, -(float16_t)0.90134884704602202810f,(float16_t)0.43309381885315195726f, -(float16_t)0.90001589201616016833f,(float16_t)0.43585707992225547480f, -(float16_t)0.89867446569395381673f,(float16_t)0.43861623853852765853f, -(float16_t)0.89732458070541831763f,(float16_t)0.44137126873171667052f, -(float16_t)0.89596624975618521791f,(float16_t)0.44412214457042920035f, -(float16_t)0.89459948563138269595f,(float16_t)0.44686884016237415906f, -(float16_t)0.89322430119551532446f,(float16_t)0.44961132965460653965f, -(float16_t)0.89184070939234272313f,(float16_t)0.45234958723377088896f, -(float16_t)0.89044872324475787817f,(float16_t)0.45508358712634383592f, -(float16_t)0.88904835585466457371f,(float16_t)0.45781330359887717485f, -(float16_t)0.88763962040285393496f,(float16_t)0.46053871095824000514f, -(float16_t)0.88622253014888063838f,(float16_t)0.46325978355186014923f, -(float16_t)0.88479709843093778954f,(float16_t)0.46597649576796618121f, -(float16_t)0.88336333866573157891f,(float16_t)0.46868882203582790114f, -(float16_t)0.88192126434835504956f,(float16_t)0.47139673682599764204f, -(float16_t)0.88047088905216075450f,(float16_t)0.47410021465054996703f, -(float16_t)0.87901222642863352519f,(float16_t)0.47679923006332208812f, -(float16_t)0.87754529020726135258f,(float16_t)0.47949375766015295275f, -(float16_t)0.87607009419540660122f,(float16_t)0.48218377207912271887f, -(float16_t)0.87458665227817611321f,(float16_t)0.48486924800079106435f, -(float16_t)0.87309497841829009079f,(float16_t)0.48755016014843599592f, -(float16_t)0.87159508665595097909f,(float16_t)0.49022648328829115938f, -(float16_t)0.87008699110871146054f,(float16_t)0.49289819222978403790f, -(float16_t)0.86857070597134089507f,(float16_t)0.49556526182577254058f, -(float16_t)0.86704624551569264845f,(float16_t)0.49822766697278181303f, -(float16_t)0.86551362409056908920f,(float16_t)0.50088538261124071482f, -(float16_t)0.86397285612158669643f,(float16_t)0.50353838372571757542f, -(float16_t)0.86242395611104050168f,(float16_t)0.50618664534515522835f, -(float16_t)0.86086693863776730939f,(float16_t)0.50883014254310698909f, -(float16_t)0.85930181835700847337f,(float16_t)0.51146885043797030157f, -(float16_t)0.85772861000027211809f,(float16_t)0.51410274419322166128f, -(float16_t)0.85614732837519447184f,(float16_t)0.51673179901764987321f, -(float16_t)0.85455798836540053376f,(float16_t)0.51935599016558964269f, -(float16_t)0.85296060493036363059f,(float16_t)0.52197529293715438925f, -(float16_t)0.85135519310526519554f,(float16_t)0.52458968267846894928f, -(float16_t)0.84974176800085254868f,(float16_t)0.52719913478190127964f, -(float16_t)0.84812034480329723252f,(float16_t)0.52980362468629460526f, -(float16_t)0.84649093877405212627f,(float16_t)0.53240312787719790144f, -(float16_t)0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)0.84320823964184543620f,(float16_t)0.53758707629564539410f, -(float16_t)0.84155497743689844370f,(float16_t)0.54017147272989285423f, -(float16_t)0.83989379419599952126f,(float16_t)0.54275078486451588944f, -(float16_t)0.83822470555483807875f,(float16_t)0.54532498842204646383f, -(float16_t)0.83654772722351200542f,(float16_t)0.54789405917310018967f, -(float16_t)0.83486287498638001026f,(float16_t)0.55045797293660481131f, -(float16_t)0.83317016470191318511f,(float16_t)0.55301670558002746780f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.82976123379452304540f,(float16_t)0.55811853122055610221f, -(float16_t)0.82804504525775579626f,(float16_t)0.56066157619733603124f, -(float16_t)0.82632106284566353427f,(float16_t)0.56319934401383409117f, -(float16_t)0.82458930278502529099f,(float16_t)0.56573181078361312046f, -(float16_t)0.82284978137582642788f,(float16_t)0.56825895267013148970f, -(float16_t)0.82110251499110464835f,(float16_t)0.57078074588696725566f, -(float16_t)0.81934752007679700903f,(float16_t)0.57329716669804220430f, -(float16_t)0.81758481315158371139f,(float16_t)0.57580819141784533866f, -(float16_t)0.81581441080673378075f,(float16_t)0.57831379641165558958f, -(float16_t)0.81403632970594841378f,(float16_t)0.58081395809576452649f, -(float16_t)0.81225058658520399302f,(float16_t)0.58330865293769829094f, -(float16_t)0.81045719825259476821f,(float16_t)0.58579785745643886408f, -(float16_t)0.80865618158817498262f,(float16_t)0.58828154822264522306f, -(float16_t)0.80684755354379933401f,(float16_t)0.59075970185887416442f, -(float16_t)0.80503133114296365758f,(float16_t)0.59323229503979979516f, -(float16_t)0.80320753148064494287f,(float16_t)0.59569930449243335691f, -(float16_t)0.80137617172314024039f,(float16_t)0.59816070699634238395f, -(float16_t)0.79953726910790501314f,(float16_t)0.60061647938386897305f, -(float16_t)0.79769084094339115509f,(float16_t)0.60306659854034816437f, -(float16_t)0.79583690460888356633f,(float16_t)0.60551104140432554512f, -(float16_t)0.79397547755433717231f,(float16_t)0.60794978496777363208f, -(float16_t)0.79210657730021238887f,(float16_t)0.61038280627630947528f, -(float16_t)0.79023022143731003197f,(float16_t)0.61281008242940970820f, -(float16_t)0.78834642762660622761f,(float16_t)0.61523159058062681925f, -(float16_t)0.78645521359908576731f,(float16_t)0.61764730793780386886f, -(float16_t)0.78455659715557524159f,(float16_t)0.62005721176328909561f, -(float16_t)0.78265059616657572938f,(float16_t)0.62246127937414996723f, -(float16_t)0.78073722857209448822f,(float16_t)0.62485948814238634341f, -(float16_t)0.77881651238147597827f,(float16_t)0.62725181549514408275f, -(float16_t)0.77688846567323244230f,(float16_t)0.62963823891492698426f, -(float16_t)0.77495310659487393057f,(float16_t)0.63201873593980906207f, -(float16_t)0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)0.77106052426181381776f,(float16_t)0.63676186123628419899f, -(float16_t)0.76910333764557969882f,(float16_t)0.63912444486377573138f, -(float16_t)0.76713891193582040007f,(float16_t)0.64148101280858305095f, -(float16_t)0.76516726562245895860f,(float16_t)0.64383154288979138613f, -(float16_t)0.76318841726338138010f,(float16_t)0.64617601298331628357f, -(float16_t)0.76120238548426177871f,(float16_t)0.64851440102211244110f, -(float16_t)0.75920918897838796102f,(float16_t)0.65084668499638087535f, -(float16_t)0.75720884650648456748f,(float16_t)0.65317284295377675551f, -(float16_t)0.75520137689653654700f,(float16_t)0.65549285299961534967f, -(float16_t)0.75318679904361252042f,(float16_t)0.65780669329707863735f, -(float16_t)0.75116513190968636771f,(float16_t)0.66011434206742047870f, -(float16_t)0.74913639452345937020f,(float16_t)0.66241577759017178373f, -(float16_t)0.74710060598018013245f,(float16_t)0.66471097820334479334f, -(float16_t)0.74505778544146594733f,(float16_t)0.66699992230363747137f, -(float16_t)0.74300795213512171866f,(float16_t)0.66928258834663600929f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.73888732446061511361f,(float16_t)0.67382900037875603783f, -(float16_t)0.73681656887736979300f,(float16_t)0.67609270357531592310f, -(float16_t)0.73473887809596349907f,(float16_t)0.67835004312986146857f, -(float16_t)0.73265427167241281570f,(float16_t)0.68060099779545302212f, -(float16_t)0.73056276922782759087f,(float16_t)0.68284554638524808112f, -(float16_t)0.72846439044822519637f,(float16_t)0.68508366777270035541f, -(float16_t)0.72635915508434600873f,(float16_t)0.68731534089175905233f, -(float16_t)0.72424708295146700276f,(float16_t)0.68954054473706682948f, -(float16_t)0.72212819392921534511f,(float16_t)0.69175925836415774750f, -(float16_t)0.72000250796138165477f,(float16_t)0.69397146088965389055f, -(float16_t)0.71787004505573170920f,(float16_t)0.69617713149146298601f, -(float16_t)0.71573082528381870571f,(float16_t)0.69837624940897280457f, -(float16_t)0.71358486878079352422f,(float16_t)0.70056879394324833576f, -(float16_t)0.71143219574521643356f,(float16_t)0.70275474445722529993f, -(float16_t)0.70927282643886568891f,(float16_t)0.70493408037590488124f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.70493408037590499227f,(float16_t)0.70927282643886568891f, -(float16_t)0.70275474445722529993f,(float16_t)0.71143219574521643356f, -(float16_t)0.70056879394324844679f,(float16_t)0.71358486878079352422f, -(float16_t)0.69837624940897291559f,(float16_t)0.71573082528381859468f, -(float16_t)0.69617713149146298601f,(float16_t)0.71787004505573170920f, -(float16_t)0.69397146088965400157f,(float16_t)0.72000250796138165477f, -(float16_t)0.69175925836415774750f,(float16_t)0.72212819392921534511f, -(float16_t)0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)0.68731534089175905233f,(float16_t)0.72635915508434600873f, -(float16_t)0.68508366777270035541f,(float16_t)0.72846439044822519637f, -(float16_t)0.68284554638524808112f,(float16_t)0.73056276922782759087f, -(float16_t)0.68060099779545302212f,(float16_t)0.73265427167241281570f, -(float16_t)0.67835004312986146857f,(float16_t)0.73473887809596349907f, -(float16_t)0.67609270357531603413f,(float16_t)0.73681656887736979300f, -(float16_t)0.67382900037875614885f,(float16_t)0.73888732446061511361f, -(float16_t)0.67155895484701833009f,(float16_t)0.74095112535495910588f, -(float16_t)0.66928258834663600929f,(float16_t)0.74300795213512171866f, -(float16_t)0.66699992230363747137f,(float16_t)0.74505778544146594733f, -(float16_t)0.66471097820334490436f,(float16_t)0.74710060598018013245f, -(float16_t)0.66241577759017178373f,(float16_t)0.74913639452345925918f, -(float16_t)0.66011434206742047870f,(float16_t)0.75116513190968636771f, -(float16_t)0.65780669329707874837f,(float16_t)0.75318679904361252042f, -(float16_t)0.65549285299961546070f,(float16_t)0.75520137689653654700f, -(float16_t)0.65317284295377686654f,(float16_t)0.75720884650648456748f, -(float16_t)0.65084668499638098638f,(float16_t)0.75920918897838796102f, -(float16_t)0.64851440102211255212f,(float16_t)0.76120238548426177871f, -(float16_t)0.64617601298331639459f,(float16_t)0.76318841726338126907f, -(float16_t)0.64383154288979149715f,(float16_t)0.76516726562245895860f, -(float16_t)0.64148101280858316198f,(float16_t)0.76713891193582040007f, -(float16_t)0.63912444486377573138f,(float16_t)0.76910333764557958780f, -(float16_t)0.63676186123628419899f,(float16_t)0.77106052426181381776f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.63201873593980906207f,(float16_t)0.77495310659487381955f, -(float16_t)0.62963823891492709528f,(float16_t)0.77688846567323244230f, -(float16_t)0.62725181549514419377f,(float16_t)0.77881651238147586724f, -(float16_t)0.62485948814238645443f,(float16_t)0.78073722857209448822f, -(float16_t)0.62246127937415007825f,(float16_t)0.78265059616657572938f, -(float16_t)0.62005721176328920663f,(float16_t)0.78455659715557524159f, -(float16_t)0.61764730793780397988f,(float16_t)0.78645521359908576731f, -(float16_t)0.61523159058062681925f,(float16_t)0.78834642762660622761f, -(float16_t)0.61281008242940970820f,(float16_t)0.79023022143731003197f, -(float16_t)0.61038280627630947528f,(float16_t)0.79210657730021227785f, -(float16_t)0.60794978496777374311f,(float16_t)0.79397547755433717231f, -(float16_t)0.60551104140432554512f,(float16_t)0.79583690460888345530f, -(float16_t)0.60306659854034827539f,(float16_t)0.79769084094339104407f, -(float16_t)0.60061647938386897305f,(float16_t)0.79953726910790501314f, -(float16_t)0.59816070699634238395f,(float16_t)0.80137617172314012937f, -(float16_t)0.59569930449243346793f,(float16_t)0.80320753148064483184f, -(float16_t)0.59323229503979979516f,(float16_t)0.80503133114296365758f, -(float16_t)0.59075970185887427544f,(float16_t)0.80684755354379922299f, -(float16_t)0.58828154822264533408f,(float16_t)0.80865618158817498262f, -(float16_t)0.58579785745643886408f,(float16_t)0.81045719825259476821f, -(float16_t)0.58330865293769829094f,(float16_t)0.81225058658520388200f, -(float16_t)0.58081395809576452649f,(float16_t)0.81403632970594830276f, -(float16_t)0.57831379641165558958f,(float16_t)0.81581441080673378075f, -(float16_t)0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)0.57329716669804231532f,(float16_t)0.81934752007679689800f, -(float16_t)0.57078074588696736669f,(float16_t)0.82110251499110464835f, -(float16_t)0.56825895267013148970f,(float16_t)0.82284978137582631685f, -(float16_t)0.56573181078361323149f,(float16_t)0.82458930278502529099f, -(float16_t)0.56319934401383409117f,(float16_t)0.82632106284566353427f, -(float16_t)0.56066157619733603124f,(float16_t)0.82804504525775579626f, -(float16_t)0.55811853122055610221f,(float16_t)0.82976123379452304540f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.55301670558002757883f,(float16_t)0.83317016470191318511f, -(float16_t)0.55045797293660481131f,(float16_t)0.83486287498638001026f, -(float16_t)0.54789405917310018967f,(float16_t)0.83654772722351189440f, -(float16_t)0.54532498842204646383f,(float16_t)0.83822470555483796772f, -(float16_t)0.54275078486451600046f,(float16_t)0.83989379419599941023f, -(float16_t)0.54017147272989296525f,(float16_t)0.84155497743689833268f, -(float16_t)0.53758707629564550512f,(float16_t)0.84320823964184543620f, -(float16_t)0.53499761988709726435f,(float16_t)0.84485356524970700587f, -(float16_t)0.53240312787719801246f,(float16_t)0.84649093877405212627f, -(float16_t)0.52980362468629482731f,(float16_t)0.84812034480329712149f, -(float16_t)0.52719913478190139067f,(float16_t)0.84974176800085243766f, -(float16_t)0.52458968267846883826f,(float16_t)0.85135519310526519554f, -(float16_t)0.52197529293715438925f,(float16_t)0.85296060493036363059f, -(float16_t)0.51935599016558953167f,(float16_t)0.85455798836540053376f, -(float16_t)0.51673179901764998423f,(float16_t)0.85614732837519447184f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.51146885043797052361f,(float16_t)0.85930181835700836235f, -(float16_t)0.50883014254310698909f,(float16_t)0.86086693863776730939f, -(float16_t)0.50618664534515533937f,(float16_t)0.86242395611104050168f, -(float16_t)0.50353838372571757542f,(float16_t)0.86397285612158669643f, -(float16_t)0.50088538261124093687f,(float16_t)0.86551362409056897818f, -(float16_t)0.49822766697278186854f,(float16_t)0.86704624551569264845f, -(float16_t)0.49556526182577248507f,(float16_t)0.86857070597134089507f, -(float16_t)0.49289819222978409341f,(float16_t)0.87008699110871134952f, -(float16_t)0.49022648328829110387f,(float16_t)0.87159508665595109012f, -(float16_t)0.48755016014843605143f,(float16_t)0.87309497841829009079f, -(float16_t)0.48486924800079111986f,(float16_t)0.87458665227817611321f, -(float16_t)0.48218377207912282989f,(float16_t)0.87607009419540660122f, -(float16_t)0.47949375766015300826f,(float16_t)0.87754529020726124156f, -(float16_t)0.47679923006332225466f,(float16_t)0.87901222642863341417f, -(float16_t)0.47410021465055002254f,(float16_t)0.88047088905216075450f, -(float16_t)0.47139673682599780857f,(float16_t)0.88192126434835493853f, -(float16_t)0.46868882203582795665f,(float16_t)0.88336333866573157891f, -(float16_t)0.46597649576796612569f,(float16_t)0.88479709843093778954f, -(float16_t)0.46325978355186026025f,(float16_t)0.88622253014888063838f, -(float16_t)0.46053871095824000514f,(float16_t)0.88763962040285393496f, -(float16_t)0.45781330359887728587f,(float16_t)0.88904835585466457371f, -(float16_t)0.45508358712634383592f,(float16_t)0.89044872324475787817f, -(float16_t)0.45234958723377099998f,(float16_t)0.89184070939234272313f, -(float16_t)0.44961132965460659516f,(float16_t)0.89322430119551532446f, -(float16_t)0.44686884016237432560f,(float16_t)0.89459948563138258493f, -(float16_t)0.44412214457042925586f,(float16_t)0.89596624975618510689f, -(float16_t)0.44137126873171661501f,(float16_t)0.89732458070541831763f, -(float16_t)0.43861623853852771404f,(float16_t)0.89867446569395381673f, -(float16_t)0.43585707992225547480f,(float16_t)0.90001589201616027935f, -(float16_t)0.43309381885315201277f,(float16_t)0.90134884704602202810f, -(float16_t)0.43032648134008261165f,(float16_t)0.90267331823725882600f, -(float16_t)0.42755509343028219593f,(float16_t)0.90398929312344333820f, -(float16_t)0.42477968120910880589f,(float16_t)0.90529675931811881551f, -(float16_t)0.42200027079979979261f,(float16_t)0.90659570451491533483f, -(float16_t)0.41921688836322396066f,(float16_t)0.90788611648766626150f, -(float16_t)0.41642956009763731906f,(float16_t)0.90916798309052226923f, -(float16_t)0.41363831223843455787f,(float16_t)0.91044129225806713634f, -(float16_t)0.41084317105790391089f,(float16_t)0.91170603200542987832f, -(float16_t)0.40804416286497874333f,(float16_t)0.91296219042839810154f, -(float16_t)0.40524131400498986100f,(float16_t)0.91420975570353069095f, -(float16_t)0.40243465085941854120f,(float16_t)0.91544871608826783316f, -(float16_t)0.39962419984564678810f,(float16_t)0.91667905992104270485f, -(float16_t)0.39680998741671041907f,(float16_t)0.91790077562139038569f, -(float16_t)0.39399204006104809883f,(float16_t)0.91911385169005777040f, -(float16_t)0.39117038430225398171f,(float16_t)0.92031827670911048322f, -(float16_t)0.38834504669882630168f,(float16_t)0.92151403934204190183f, -(float16_t)0.38551605384391901543f,(float16_t)0.92270112833387851747f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.37984720892405110515f,(float16_t)0.92504924078267758425f, -(float16_t)0.37700741021641831496f,(float16_t)0.92621024213831126826f, -(float16_t)0.37416406297145798909f,(float16_t)0.92736252565040111495f, -(float16_t)0.37131719395183759858f,(float16_t)0.92850608047321558924f, -(float16_t)0.36846682995337232125f,(float16_t)0.92964089584318121418f, -(float16_t)0.36561299780477396482f,(float16_t)0.93076696107898371224f, -(float16_t)0.36275572436739722537f,(float16_t)0.93188426558166814750f, -(float16_t)0.35989503653498827740f,(float16_t)0.93299279883473884567f, -(float16_t)0.35703096123343003310f,(float16_t)0.93409255040425887007f, -(float16_t)0.35416352542049051033f,(float16_t)0.93518350993894749923f, -(float16_t)0.35129275608556714827f,(float16_t)0.93626566717027825959f, -(float16_t)0.34841868024943450921f,(float16_t)0.93733901191257495977f, -(float16_t)0.34554132496398914931f,(float16_t)0.93840353406310805795f, -(float16_t)0.34266071731199437833f,(float16_t)0.93945922360218991898f, -(float16_t)0.33977688440682696225f,(float16_t)0.94050607059326829518f, -(float16_t)0.33688985339222005111f,(float16_t)0.94154406518302080631f, -(float16_t)0.33399965144200949307f,(float16_t)0.94257319760144686605f, -(float16_t)0.33110630575987642921f,(float16_t)0.94359345816196038559f, -(float16_t)0.32820984357909266382f,(float16_t)0.94460483726148025685f, -(float16_t)0.32531029216226298173f,(float16_t)0.94560732538052127971f, -(float16_t)0.32240767880107001897f,(float16_t)0.94660091308328353499f, -(float16_t)0.31950203081601574739f,(float16_t)0.94758559101774109124f, -(float16_t)0.31659337555616584581f,(float16_t)0.94856134991573026749f, -(float16_t)0.31368174039889157312f,(float16_t)0.94952818059303667475f, -(float16_t)0.31076715274961147495f,(float16_t)0.95048607394948170235f, -(float16_t)0.30784964004153497763f,(float16_t)0.95143502096900833820f, -(float16_t)0.30492922973540242948f,(float16_t)0.95237501271976587880f, -(float16_t)0.30200594931922819519f,(float16_t)0.95330604035419375109f, -(float16_t)0.29907982630804047508f,(float16_t)0.95422809510910566733f, -(float16_t)0.29615088824362395536f,(float16_t)0.95514116830577067141f, -(float16_t)0.29321916269425868373f,(float16_t)0.95604525134999640557f, -(float16_t)0.29028467725446233105f,(float16_t)0.95694033573220893540f, -(float16_t)0.28734745954472956653f,(float16_t)0.95782641302753290802f, -(float16_t)0.28440753721127182141f,(float16_t)0.95870347489587159906f, -(float16_t)0.28146493792575805193f,(float16_t)0.95957151308198451733f, -(float16_t)0.27851968938505305973f,(float16_t)0.96043051941556578655f, -(float16_t)0.27557181931095825478f,(float16_t)0.96128048581132063966f, -(float16_t)0.27262135544994897662f,(float16_t)0.96212140426904158019f, -(float16_t)0.26966832557291520178f,(float16_t)0.96295326687368387741f, -(float16_t)0.26671275747489842090f,(float16_t)0.96377606579543984022f, -(float16_t)0.26375467897483151347f,(float16_t)0.96458979328981264700f, -(float16_t)0.26079411791527556952f,(float16_t)0.96539444169768939830f, -(float16_t)0.25783110216215893162f,(float16_t)0.96619000344541261516f, -(float16_t)0.25486565960451462720f,(float16_t)0.96697647104485207059f, -(float16_t)0.25189781815421691258f,(float16_t)0.96775383709347551076f, -(float16_t)0.24892760574572025956f,(float16_t)0.96852209427441726675f, -(float16_t)0.24595505033579459497f,(float16_t)0.96928123535654853171f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.24000302244874149871f,(float16_t)0.97077214072895035013f, -(float16_t)0.23702360599436733679f,(float16_t)0.97150389098625178352f, -(float16_t)0.23404195858354345794f,(float16_t)0.97222649707893626925f, -(float16_t)0.23105810828067127605f,(float16_t)0.97293995220556006576f, -(float16_t)0.22807208317088578653f,(float16_t)0.97364424965081186603f, -(float16_t)0.22508391135979277653f,(float16_t)0.97433938278557585821f, -(float16_t)0.22209362097320359264f,(float16_t)0.97502534506699412020f, -(float16_t)0.21910124015686976984f,(float16_t)0.97570213003852857003f, -(float16_t)0.21610679707621960333f,(float16_t)0.97636973133002114000f, -(float16_t)0.21311031991609136194f,(float16_t)0.97702814265775439484f, -(float16_t)0.21011183688046972118f,(float16_t)0.97767735782450992943f, -(float16_t)0.20711137619221856032f,(float16_t)0.97831737071962765473f, -(float16_t)0.20410896609281700687f,(float16_t)0.97894817531906219710f, -(float16_t)0.20110463484209195606f,(float16_t)0.97956976568544051887f, -(float16_t)0.19809841071795372680f,(float16_t)0.98018213596811731847f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.19208039704989238183f,(float16_t)0.98137919331375456089f, -(float16_t)0.18906866414980627589f,(float16_t)0.98196386910955524296f, -(float16_t)0.18605515166344663291f,(float16_t)0.98253930228744124076f, -(float16_t)0.18303988795514106180f,(float16_t)0.98310548743121628501f, -(float16_t)0.18002290140569951471f,(float16_t)0.98366241921173025453f, -(float16_t)0.17700422041214886049f,(float16_t)0.98421009238692902521f, -(float16_t)0.17398387338746384989f,(float16_t)0.98474850180190420801f, -(float16_t)0.17096188876030135595f,(float16_t)0.98527764238894122162f, -(float16_t)0.16793829497473122814f,(float16_t)0.98579750916756736512f, -(float16_t)0.16491312048997008866f,(float16_t)0.98630809724459866938f, -(float16_t)0.16188639378011188130f,(float16_t)0.98680940181418541624f, -(float16_t)0.15885814333386139019f,(float16_t)0.98730141815785843473f, -(float16_t)0.15582839765426531597f,(float16_t)0.98778414164457217783f, -(float16_t)0.15279718525844340760f,(float16_t)0.98825756773074946437f, -(float16_t)0.14976453467732162017f,(float16_t)0.98872169196032377858f, -(float16_t)0.14673047445536174793f,(float16_t)0.98917650996478101444f, -(float16_t)0.14369503315029458212f,(float16_t)0.98962201746320077600f, -(float16_t)0.14065823933284923863f,(float16_t)0.99005821026229712256f, -(float16_t)0.13762012158648617710f,(float16_t)0.99048508425645698239f, -(float16_t)0.13458070850712622324f,(float16_t)0.99090263542778000971f, -(float16_t)0.13154002870288328264f,(float16_t)0.99131085984611544415f, -(float16_t)0.12849811079379322432f,(float16_t)0.99170975366909952520f, -(float16_t)0.12545498341154620592f,(float16_t)0.99209931314219179654f, -(float16_t)0.12241067519921627893f,(float16_t)0.99247953459870996706f, -(float16_t)0.11936521481099135467f,(float16_t)0.99285041445986510489f, -(float16_t)0.11631863091190487725f,(float16_t)0.99321194923479450001f, -(float16_t)0.11327095217756436019f,(float16_t)0.99356413552059530403f, -(float16_t)0.11022220729388318428f,(float16_t)0.99390697000235606051f, -(float16_t)0.10717242495680887049f,(float16_t)0.99424044945318790223f, -(float16_t)0.10412163387205472520f,(float16_t)0.99456457073425541537f, -(float16_t)0.10106986275482787718f,(float16_t)0.99487933079480561638f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.09496349532963906104f,(float16_t)0.99548075549192693856f, -(float16_t)0.09190895649713269611f,(float16_t)0.99576741446765981713f, -(float16_t)0.08885355258252468358f,(float16_t)0.99604470090125196702f, -(float16_t)0.08579731234443987997f,(float16_t)0.99631261218277800129f, -(float16_t)0.08274026454937580266f,(float16_t)0.99657114579055483539f, -(float16_t)0.07968243797143012563f,(float16_t)0.99682029929116566791f, -(float16_t)0.07662386139203161695f,(float16_t)0.99706007033948296225f, -(float16_t)0.07356456359966745406f,(float16_t)0.99729045667869020697f, -(float16_t)0.07050457338961400866f,(float16_t)0.99751145614030345410f, -(float16_t)0.06744391956366410645f,(float16_t)0.99772306664419163624f, -(float16_t)0.06438263092985740954f,(float16_t)0.99792528619859599548f, -(float16_t)0.06132073630220864768f,(float16_t)0.99811811290014917919f, -(float16_t)0.05825826450043573163f,(float16_t)0.99830154493389289261f, -(float16_t)0.05519524434969003135f,(float16_t)0.99847558057329477421f, -(float16_t)0.05213170468028331672f,(float16_t)0.99864021818026527111f, -(float16_t)0.04906767432741812596f,(float16_t)0.99879545620517240501f, -(float16_t)0.04600318213091464381f,(float16_t)0.99894129318685687124f, -(float16_t)0.04293825693494095902f,(float16_t)0.99907772775264536147f, -(float16_t)0.03987292758773984536f,(float16_t)0.99920475861836388631f, -(float16_t)0.03680722294135899131f,(float16_t)0.99932238458834954375f, -(float16_t)0.03374117185137764235f,(float16_t)0.99943060455546173237f, -(float16_t)0.03067480317663658085f,(float16_t)0.99952941750109314256f, -(float16_t)0.02760814577896581953f,(float16_t)0.99961882249517863830f, -(float16_t)0.02454122852291226384f,(float16_t)0.99969881869620424997f, -(float16_t)0.02147408027546960502f,(float16_t)0.99976940535121527898f, -(float16_t)0.01840672990580482019f,(float16_t)0.99983058179582340319f, -(float16_t)0.01533920628498821985f,(float16_t)0.99988234745421256111f, -(float16_t)0.01227153828571994447f,(float16_t)0.99992470183914450299f, -(float16_t)0.00920375478205995995f,(float16_t)0.99995764455196389786f, -(float16_t)0.00613588464915451517f,(float16_t)0.99998117528260110909f, -(float16_t)0.00306795676296613791f,(float16_t)0.99999529380957619118f, -(float16_t)0.00000000000000006123f,(float16_t)1.00000000000000000000f, -(float16_t)-0.00306795676296601561f,(float16_t)0.99999529380957619118f, -(float16_t)-0.00613588464915439287f,(float16_t)0.99998117528260110909f, -(float16_t)-0.00920375478205983678f,(float16_t)0.99995764455196389786f, -(float16_t)-0.01227153828571982304f,(float16_t)0.99992470183914450299f, -(float16_t)-0.01533920628498809842f,(float16_t)0.99988234745421256111f, -(float16_t)-0.01840672990580469529f,(float16_t)0.99983058179582340319f, -(float16_t)-0.02147408027546948359f,(float16_t)0.99976940535121527898f, -(float16_t)-0.02454122852291214241f,(float16_t)0.99969881869620424997f, -(float16_t)-0.02760814577896569810f,(float16_t)0.99961882249517863830f, -(float16_t)-0.03067480317663645942f,(float16_t)0.99952941750109314256f, -(float16_t)-0.03374117185137751745f,(float16_t)0.99943060455546173237f, -(float16_t)-0.03680722294135886641f,(float16_t)0.99932238458834954375f, -(float16_t)-0.03987292758773972740f,(float16_t)0.99920475861836388631f, -(float16_t)-0.04293825693494083412f,(float16_t)0.99907772775264536147f, -(float16_t)-0.04600318213091451891f,(float16_t)0.99894129318685687124f, -(float16_t)-0.04906767432741800800f,(float16_t)0.99879545620517240501f, -(float16_t)-0.05213170468028319182f,(float16_t)0.99864021818026527111f, -(float16_t)-0.05519524434968991339f,(float16_t)0.99847558057329477421f, -(float16_t)-0.05825826450043560673f,(float16_t)0.99830154493389289261f, -(float16_t)-0.06132073630220852972f,(float16_t)0.99811811290014917919f, -(float16_t)-0.06438263092985728464f,(float16_t)0.99792528619859599548f, -(float16_t)-0.06744391956366398155f,(float16_t)0.99772306664419163624f, -(float16_t)-0.07050457338961389764f,(float16_t)0.99751145614030345410f, -(float16_t)-0.07356456359966732916f,(float16_t)0.99729045667869020697f, -(float16_t)-0.07662386139203150592f,(float16_t)0.99706007033948296225f, -(float16_t)-0.07968243797143001461f,(float16_t)0.99682029929116577893f, -(float16_t)-0.08274026454937567776f,(float16_t)0.99657114579055483539f, -(float16_t)-0.08579731234443975507f,(float16_t)0.99631261218277800129f, -(float16_t)-0.08885355258252455868f,(float16_t)0.99604470090125196702f, -(float16_t)-0.09190895649713257121f,(float16_t)0.99576741446765981713f, -(float16_t)-0.09496349532963895002f,(float16_t)0.99548075549192693856f, -(float16_t)-0.09801714032956064526f,(float16_t)0.99518472667219692873f, -(float16_t)-0.10106986275482775228f,(float16_t)0.99487933079480561638f, -(float16_t)-0.10412163387205460030f,(float16_t)0.99456457073425541537f, -(float16_t)-0.10717242495680875947f,(float16_t)0.99424044945318790223f, -(float16_t)-0.11022220729388305938f,(float16_t)0.99390697000235606051f, -(float16_t)-0.11327095217756423529f,(float16_t)0.99356413552059530403f, -(float16_t)-0.11631863091190475235f,(float16_t)0.99321194923479450001f, -(float16_t)-0.11936521481099122977f,(float16_t)0.99285041445986510489f, -(float16_t)-0.12241067519921615403f,(float16_t)0.99247953459870996706f, -(float16_t)-0.12545498341154606714f,(float16_t)0.99209931314219179654f, -(float16_t)-0.12849811079379311329f,(float16_t)0.99170975366909952520f, -(float16_t)-0.13154002870288314386f,(float16_t)0.99131085984611544415f, -(float16_t)-0.13458070850712611222f,(float16_t)0.99090263542778000971f, -(float16_t)-0.13762012158648606608f,(float16_t)0.99048508425645698239f, -(float16_t)-0.14065823933284912761f,(float16_t)0.99005821026229712256f, -(float16_t)-0.14369503315029444335f,(float16_t)0.98962201746320088702f, -(float16_t)-0.14673047445536163691f,(float16_t)0.98917650996478101444f, -(float16_t)-0.14976453467732150915f,(float16_t)0.98872169196032377858f, -(float16_t)-0.15279718525844329657f,(float16_t)0.98825756773074946437f, -(float16_t)-0.15582839765426520495f,(float16_t)0.98778414164457217783f, -(float16_t)-0.15885814333386127917f,(float16_t)0.98730141815785843473f, -(float16_t)-0.16188639378011177028f,(float16_t)0.98680940181418552726f, -(float16_t)-0.16491312048996994988f,(float16_t)0.98630809724459866938f, -(float16_t)-0.16793829497473108936f,(float16_t)0.98579750916756747614f, -(float16_t)-0.17096188876030124493f,(float16_t)0.98527764238894122162f, -(float16_t)-0.17398387338746371111f,(float16_t)0.98474850180190420801f, -(float16_t)-0.17700422041214874946f,(float16_t)0.98421009238692902521f, -(float16_t)-0.18002290140569940369f,(float16_t)0.98366241921173025453f, -(float16_t)-0.18303988795514092303f,(float16_t)0.98310548743121628501f, -(float16_t)-0.18605515166344649414f,(float16_t)0.98253930228744124076f, -(float16_t)-0.18906866414980616486f,(float16_t)0.98196386910955524296f, -(float16_t)-0.19208039704989227081f,(float16_t)0.98137919331375456089f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.19809841071795361578f,(float16_t)0.98018213596811742949f, -(float16_t)-0.20110463484209181728f,(float16_t)0.97956976568544051887f, -(float16_t)-0.20410896609281689584f,(float16_t)0.97894817531906219710f, -(float16_t)-0.20711137619221844930f,(float16_t)0.97831737071962765473f, -(float16_t)-0.21011183688046961016f,(float16_t)0.97767735782450992943f, -(float16_t)-0.21311031991609125091f,(float16_t)0.97702814265775439484f, -(float16_t)-0.21610679707621949230f,(float16_t)0.97636973133002114000f, -(float16_t)-0.21910124015686965881f,(float16_t)0.97570213003852857003f, -(float16_t)-0.22209362097320348162f,(float16_t)0.97502534506699412020f, -(float16_t)-0.22508391135979266551f,(float16_t)0.97433938278557585821f, -(float16_t)-0.22807208317088567551f,(float16_t)0.97364424965081197705f, -(float16_t)-0.23105810828067113727f,(float16_t)0.97293995220556017678f, -(float16_t)-0.23404195858354331916f,(float16_t)0.97222649707893638027f, -(float16_t)-0.23702360599436722577f,(float16_t)0.97150389098625178352f, -(float16_t)-0.24000302244874138768f,(float16_t)0.97077214072895035013f, -(float16_t)-0.24298017990326387094f,(float16_t)0.97003125319454397424f, -(float16_t)-0.24595505033579448395f,(float16_t)0.96928123535654853171f, -(float16_t)-0.24892760574572012078f,(float16_t)0.96852209427441737777f, -(float16_t)-0.25189781815421680156f,(float16_t)0.96775383709347551076f, -(float16_t)-0.25486565960451451618f,(float16_t)0.96697647104485207059f, -(float16_t)-0.25783110216215882060f,(float16_t)0.96619000344541261516f, -(float16_t)-0.26079411791527545850f,(float16_t)0.96539444169768939830f, -(float16_t)-0.26375467897483140245f,(float16_t)0.96458979328981275803f, -(float16_t)-0.26671275747489830987f,(float16_t)0.96377606579543984022f, -(float16_t)-0.26966832557291509076f,(float16_t)0.96295326687368387741f, -(float16_t)-0.27262135544994886560f,(float16_t)0.96212140426904158019f, -(float16_t)-0.27557181931095814376f,(float16_t)0.96128048581132063966f, -(float16_t)-0.27851968938505294870f,(float16_t)0.96043051941556589757f, -(float16_t)-0.28146493792575794091f,(float16_t)0.95957151308198451733f, -(float16_t)-0.28440753721127171039f,(float16_t)0.95870347489587159906f, -(float16_t)-0.28734745954472945551f,(float16_t)0.95782641302753290802f, -(float16_t)-0.29028467725446216452f,(float16_t)0.95694033573220893540f, -(float16_t)-0.29321916269425857271f,(float16_t)0.95604525134999651659f, -(float16_t)-0.29615088824362384434f,(float16_t)0.95514116830577067141f, -(float16_t)-0.29907982630804036406f,(float16_t)0.95422809510910566733f, -(float16_t)-0.30200594931922808417f,(float16_t)0.95330604035419386211f, -(float16_t)-0.30492922973540226295f,(float16_t)0.95237501271976587880f, -(float16_t)-0.30784964004153486661f,(float16_t)0.95143502096900833820f, -(float16_t)-0.31076715274961136393f,(float16_t)0.95048607394948181337f, -(float16_t)-0.31368174039889140658f,(float16_t)0.94952818059303667475f, -(float16_t)-0.31659337555616573479f,(float16_t)0.94856134991573037851f, -(float16_t)-0.31950203081601563637f,(float16_t)0.94758559101774120226f, -(float16_t)-0.32240767880106985244f,(float16_t)0.94660091308328353499f, -(float16_t)-0.32531029216226287071f,(float16_t)0.94560732538052139073f, -(float16_t)-0.32820984357909255280f,(float16_t)0.94460483726148025685f, -(float16_t)-0.33110630575987631818f,(float16_t)0.94359345816196038559f, -(float16_t)-0.33399965144200938205f,(float16_t)0.94257319760144686605f, -(float16_t)-0.33688985339221994009f,(float16_t)0.94154406518302080631f, -(float16_t)-0.33977688440682685123f,(float16_t)0.94050607059326829518f, -(float16_t)-0.34266071731199426731f,(float16_t)0.93945922360218991898f, -(float16_t)-0.34554132496398903829f,(float16_t)0.93840353406310816897f, -(float16_t)-0.34841868024943439819f,(float16_t)0.93733901191257495977f, -(float16_t)-0.35129275608556703725f,(float16_t)0.93626566717027825959f, -(float16_t)-0.35416352542049039931f,(float16_t)0.93518350993894761025f, -(float16_t)-0.35703096123342992207f,(float16_t)0.93409255040425898109f, -(float16_t)-0.35989503653498816638f,(float16_t)0.93299279883473884567f, -(float16_t)-0.36275572436739711435f,(float16_t)0.93188426558166814750f, -(float16_t)-0.36561299780477385379f,(float16_t)0.93076696107898371224f, -(float16_t)-0.36846682995337221023f,(float16_t)0.92964089584318132520f, -(float16_t)-0.37131719395183748755f,(float16_t)0.92850608047321558924f, -(float16_t)-0.37416406297145787807f,(float16_t)0.92736252565040111495f, -(float16_t)-0.37700741021641820394f,(float16_t)0.92621024213831137928f, -(float16_t)-0.37984720892405099413f,(float16_t)0.92504924078267769527f, -(float16_t)-0.38268343236508972627f,(float16_t)0.92387953251128673848f, -(float16_t)-0.38551605384391890441f,(float16_t)0.92270112833387851747f, -(float16_t)-0.38834504669882619066f,(float16_t)0.92151403934204201285f, -(float16_t)-0.39117038430225387069f,(float16_t)0.92031827670911059425f, -(float16_t)-0.39399204006104798781f,(float16_t)0.91911385169005777040f, -(float16_t)-0.39680998741671030805f,(float16_t)0.91790077562139049672f, -(float16_t)-0.39962419984564667708f,(float16_t)0.91667905992104270485f, -(float16_t)-0.40243465085941843018f,(float16_t)0.91544871608826783316f, -(float16_t)-0.40524131400498974998f,(float16_t)0.91420975570353069095f, -(float16_t)-0.40804416286497863231f,(float16_t)0.91296219042839821256f, -(float16_t)-0.41084317105790379987f,(float16_t)0.91170603200542987832f, -(float16_t)-0.41363831223843450235f,(float16_t)0.91044129225806724737f, -(float16_t)-0.41642956009763698599f,(float16_t)0.90916798309052249127f, -(float16_t)-0.41921688836322407168f,(float16_t)0.90788611648766615048f, -(float16_t)-0.42200027079979968159f,(float16_t)0.90659570451491533483f, -(float16_t)-0.42477968120910869487f,(float16_t)0.90529675931811881551f, -(float16_t)-0.42755509343028186287f,(float16_t)0.90398929312344344922f, -(float16_t)-0.43032648134008272267f,(float16_t)0.90267331823725871498f, -(float16_t)-0.43309381885315190175f,(float16_t)0.90134884704602202810f, -(float16_t)-0.43585707992225536378f,(float16_t)0.90001589201616027935f, -(float16_t)-0.43861623853852738097f,(float16_t)0.89867446569395392775f, -(float16_t)-0.44137126873171672603f,(float16_t)0.89732458070541831763f, -(float16_t)-0.44412214457042914484f,(float16_t)0.89596624975618521791f, -(float16_t)-0.44686884016237399253f,(float16_t)0.89459948563138280697f, -(float16_t)-0.44961132965460670619f,(float16_t)0.89322430119551521344f, -(float16_t)-0.45234958723377088896f,(float16_t)0.89184070939234272313f, -(float16_t)-0.45508358712634372489f,(float16_t)0.89044872324475798919f, -(float16_t)-0.45781330359887700832f,(float16_t)0.88904835585466468473f, -(float16_t)-0.46053871095824006066f,(float16_t)0.88763962040285393496f, -(float16_t)-0.46325978355186014923f,(float16_t)0.88622253014888063838f, -(float16_t)-0.46597649576796601467f,(float16_t)0.88479709843093790056f, -(float16_t)-0.46868882203582767909f,(float16_t)0.88336333866573168994f, -(float16_t)-0.47139673682599769755f,(float16_t)0.88192126434835504956f, -(float16_t)-0.47410021465054991152f,(float16_t)0.88047088905216086552f, -(float16_t)-0.47679923006332192159f,(float16_t)0.87901222642863352519f, -(float16_t)-0.47949375766015311928f,(float16_t)0.87754529020726124156f, -(float16_t)-0.48218377207912271887f,(float16_t)0.87607009419540660122f, -(float16_t)-0.48486924800079100883f,(float16_t)0.87458665227817622423f, -(float16_t)-0.48755016014843571837f,(float16_t)0.87309497841829020182f, -(float16_t)-0.49022648328829121489f,(float16_t)0.87159508665595097909f, -(float16_t)-0.49289819222978398239f,(float16_t)0.87008699110871146054f, -(float16_t)-0.49556526182577237405f,(float16_t)0.86857070597134100609f, -(float16_t)-0.49822766697278159098f,(float16_t)0.86704624551569275948f, -(float16_t)-0.50088538261124082585f,(float16_t)0.86551362409056908920f, -(float16_t)-0.50353838372571746440f,(float16_t)0.86397285612158680745f, -(float16_t)-0.50618664534515511733f,(float16_t)0.86242395611104061270f, -(float16_t)-0.50883014254310710012f,(float16_t)0.86086693863776719837f, -(float16_t)-0.51146885043797041259f,(float16_t)0.85930181835700847337f, -(float16_t)-0.51410274419322155026f,(float16_t)0.85772861000027211809f, -(float16_t)-0.51673179901764965116f,(float16_t)0.85614732837519458286f, -(float16_t)-0.51935599016558964269f,(float16_t)0.85455798836540053376f, -(float16_t)-0.52197529293715427823f,(float16_t)0.85296060493036374162f, -(float16_t)-0.52458968267846872724f,(float16_t)0.85135519310526519554f, -(float16_t)-0.52719913478190105760f,(float16_t)0.84974176800085265970f, -(float16_t)-0.52980362468629471628f,(float16_t)0.84812034480329723252f, -(float16_t)-0.53240312787719790144f,(float16_t)0.84649093877405212627f, -(float16_t)-0.53499761988709704230f,(float16_t)0.84485356524970722791f, -(float16_t)-0.53758707629564561614f,(float16_t)0.84320823964184532517f, -(float16_t)-0.54017147272989285423f,(float16_t)0.84155497743689844370f, -(float16_t)-0.54275078486451577842f,(float16_t)0.83989379419599952126f, -(float16_t)-0.54532498842204624179f,(float16_t)0.83822470555483818977f, -(float16_t)-0.54789405917310018967f,(float16_t)0.83654772722351200542f, -(float16_t)-0.55045797293660470029f,(float16_t)0.83486287498638012128f, -(float16_t)-0.55301670558002735678f,(float16_t)0.83317016470191329613f, -(float16_t)-0.55557023301960195560f,(float16_t)0.83146961230254534669f, -(float16_t)-0.55811853122055610221f,(float16_t)0.82976123379452304540f, -(float16_t)-0.56066157619733592021f,(float16_t)0.82804504525775579626f, -(float16_t)-0.56319934401383386913f,(float16_t)0.82632106284566364529f, -(float16_t)-0.56573181078361323149f,(float16_t)0.82458930278502517996f, -(float16_t)-0.56825895267013148970f,(float16_t)0.82284978137582631685f, -(float16_t)-0.57078074588696714464f,(float16_t)0.82110251499110475937f, -(float16_t)-0.57329716669804198226f,(float16_t)0.81934752007679712005f, -(float16_t)-0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)-0.57831379641165547856f,(float16_t)0.81581441080673378075f, -(float16_t)-0.58081395809576441547f,(float16_t)0.81403632970594852480f, -(float16_t)-0.58330865293769840196f,(float16_t)0.81225058658520388200f, -(float16_t)-0.58579785745643886408f,(float16_t)0.81045719825259476821f, -(float16_t)-0.58828154822264522306f,(float16_t)0.80865618158817509364f, -(float16_t)-0.59075970185887405339f,(float16_t)0.80684755354379944503f, -(float16_t)-0.59323229503979990618f,(float16_t)0.80503133114296354655f, -(float16_t)-0.59569930449243335691f,(float16_t)0.80320753148064494287f, -(float16_t)-0.59816070699634216190f,(float16_t)0.80137617172314024039f, -(float16_t)-0.60061647938386875101f,(float16_t)0.79953726910790523519f, -(float16_t)-0.60306659854034827539f,(float16_t)0.79769084094339104407f, -(float16_t)-0.60551104140432543410f,(float16_t)0.79583690460888356633f, -(float16_t)-0.60794978496777352106f,(float16_t)0.79397547755433728334f, -(float16_t)-0.61038280627630958630f,(float16_t)0.79210657730021227785f, -(float16_t)-0.61281008242940970820f,(float16_t)0.79023022143731003197f, -(float16_t)-0.61523159058062670823f,(float16_t)0.78834642762660633863f, -(float16_t)-0.61764730793780375784f,(float16_t)0.78645521359908587833f, -(float16_t)-0.62005721176328920663f,(float16_t)0.78455659715557513056f, -(float16_t)-0.62246127937414996723f,(float16_t)0.78265059616657572938f, -(float16_t)-0.62485948814238623239f,(float16_t)0.78073722857209459924f, -(float16_t)-0.62725181549514386070f,(float16_t)0.77881651238147608929f, -(float16_t)-0.62963823891492709528f,(float16_t)0.77688846567323244230f, -(float16_t)-0.63201873593980895105f,(float16_t)0.77495310659487393057f, -(float16_t)-0.63439328416364537677f,(float16_t)0.77301045336273710440f, -(float16_t)-0.63676186123628431002f,(float16_t)0.77106052426181370674f, -(float16_t)-0.63912444486377573138f,(float16_t)0.76910333764557958780f, -(float16_t)-0.64148101280858305095f,(float16_t)0.76713891193582040007f, -(float16_t)-0.64383154288979127511f,(float16_t)0.76516726562245906962f, -(float16_t)-0.64617601298331639459f,(float16_t)0.76318841726338115805f, -(float16_t)-0.64851440102211244110f,(float16_t)0.76120238548426188974f, -(float16_t)-0.65084668499638076433f,(float16_t)0.75920918897838807204f, -(float16_t)-0.65317284295377653347f,(float16_t)0.75720884650648467851f, -(float16_t)-0.65549285299961546070f,(float16_t)0.75520137689653643598f, -(float16_t)-0.65780669329707852633f,(float16_t)0.75318679904361252042f, -(float16_t)-0.66011434206742036768f,(float16_t)0.75116513190968658975f, -(float16_t)-0.66241577759017189475f,(float16_t)0.74913639452345925918f, -(float16_t)-0.66471097820334490436f,(float16_t)0.74710060598018013245f, -(float16_t)-0.66699992230363736034f,(float16_t)0.74505778544146605835f, -(float16_t)-0.66928258834663589827f,(float16_t)0.74300795213512182968f, -(float16_t)-0.67155895484701844111f,(float16_t)0.74095112535495899486f, -(float16_t)-0.67382900037875603783f,(float16_t)0.73888732446061522463f, -(float16_t)-0.67609270357531581208f,(float16_t)0.73681656887737001504f, -(float16_t)-0.67835004312986124653f,(float16_t)0.73473887809596372112f, -(float16_t)-0.68060099779545302212f,(float16_t)0.73265427167241281570f, -(float16_t)-0.68284554638524797010f,(float16_t)0.73056276922782759087f, -(float16_t)-0.68508366777270024439f,(float16_t)0.72846439044822530740f, -(float16_t)-0.68731534089175916336f,(float16_t)0.72635915508434589771f, -(float16_t)-0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)-0.69175925836415763648f,(float16_t)0.72212819392921545614f, -(float16_t)-0.69397146088965377952f,(float16_t)0.72000250796138176579f, -(float16_t)-0.69617713149146298601f,(float16_t)0.71787004505573170920f, -(float16_t)-0.69837624940897280457f,(float16_t)0.71573082528381870571f, -(float16_t)-0.70056879394324822474f,(float16_t)0.71358486878079363525f, -(float16_t)-0.70275474445722507788f,(float16_t)0.71143219574521665560f, -(float16_t)-0.70493408037590488124f,(float16_t)0.70927282643886557789f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.70927282643886546687f,(float16_t)0.70493408037590510329f, -(float16_t)-0.71143219574521654458f,(float16_t)0.70275474445722518890f, -(float16_t)-0.71358486878079352422f,(float16_t)0.70056879394324833576f, -(float16_t)-0.71573082528381859468f,(float16_t)0.69837624940897291559f, -(float16_t)-0.71787004505573159818f,(float16_t)0.69617713149146309703f, -(float16_t)-0.72000250796138165477f,(float16_t)0.69397146088965389055f, -(float16_t)-0.72212819392921523409f,(float16_t)0.69175925836415785852f, -(float16_t)-0.72424708295146678072f,(float16_t)0.68954054473706705153f, -(float16_t)-0.72635915508434578669f,(float16_t)0.68731534089175927438f, -(float16_t)-0.72846439044822519637f,(float16_t)0.68508366777270035541f, -(float16_t)-0.73056276922782747985f,(float16_t)0.68284554638524808112f, -(float16_t)-0.73265427167241270467f,(float16_t)0.68060099779545324417f, -(float16_t)-0.73473887809596349907f,(float16_t)0.67835004312986135755f, -(float16_t)-0.73681656887736979300f,(float16_t)0.67609270357531592310f, -(float16_t)-0.73888732446061511361f,(float16_t)0.67382900037875614885f, -(float16_t)-0.74095112535495888384f,(float16_t)0.67155895484701855214f, -(float16_t)-0.74300795213512171866f,(float16_t)0.66928258834663600929f, -(float16_t)-0.74505778544146594733f,(float16_t)0.66699992230363758239f, -(float16_t)-0.74710060598018002143f,(float16_t)0.66471097820334501538f, -(float16_t)-0.74913639452345914815f,(float16_t)0.66241577759017200577f, -(float16_t)-0.75116513190968636771f,(float16_t)0.66011434206742047870f, -(float16_t)-0.75318679904361240940f,(float16_t)0.65780669329707874837f, -(float16_t)-0.75520137689653643598f,(float16_t)0.65549285299961557172f, -(float16_t)-0.75720884650648467851f,(float16_t)0.65317284295377664449f, -(float16_t)-0.75920918897838796102f,(float16_t)0.65084668499638098638f, -(float16_t)-0.76120238548426166769f,(float16_t)0.64851440102211255212f, -(float16_t)-0.76318841726338115805f,(float16_t)0.64617601298331661663f, -(float16_t)-0.76516726562245895860f,(float16_t)0.64383154288979138613f, -(float16_t)-0.76713891193582040007f,(float16_t)0.64148101280858316198f, -(float16_t)-0.76910333764557947678f,(float16_t)0.63912444486377584241f, -(float16_t)-0.77106052426181359571f,(float16_t)0.63676186123628442104f, -(float16_t)-0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)-0.77495310659487381955f,(float16_t)0.63201873593980906207f, -(float16_t)-0.77688846567323233128f,(float16_t)0.62963823891492720630f, -(float16_t)-0.77881651238147597827f,(float16_t)0.62725181549514408275f, -(float16_t)-0.78073722857209448822f,(float16_t)0.62485948814238634341f, -(float16_t)-0.78265059616657561836f,(float16_t)0.62246127937415007825f, -(float16_t)-0.78455659715557501954f,(float16_t)0.62005721176328942867f, -(float16_t)-0.78645521359908576731f,(float16_t)0.61764730793780386886f, -(float16_t)-0.78834642762660622761f,(float16_t)0.61523159058062693028f, -(float16_t)-0.79023022143730992095f,(float16_t)0.61281008242940981923f, -(float16_t)-0.79210657730021216683f,(float16_t)0.61038280627630969732f, -(float16_t)-0.79397547755433717231f,(float16_t)0.60794978496777363208f, -(float16_t)-0.79583690460888345530f,(float16_t)0.60551104140432565615f, -(float16_t)-0.79769084094339093305f,(float16_t)0.60306659854034838641f, -(float16_t)-0.79953726910790512417f,(float16_t)0.60061647938386886203f, -(float16_t)-0.80137617172314024039f,(float16_t)0.59816070699634238395f, -(float16_t)-0.80320753148064483184f,(float16_t)0.59569930449243346793f, -(float16_t)-0.80503133114296343553f,(float16_t)0.59323229503980001720f, -(float16_t)-0.80684755354379933401f,(float16_t)0.59075970185887416442f, -(float16_t)-0.80865618158817498262f,(float16_t)0.58828154822264533408f, -(float16_t)-0.81045719825259465718f,(float16_t)0.58579785745643897510f, -(float16_t)-0.81225058658520377097f,(float16_t)0.58330865293769851299f, -(float16_t)-0.81403632970594841378f,(float16_t)0.58081395809576452649f, -(float16_t)-0.81581441080673378075f,(float16_t)0.57831379641165570060f, -(float16_t)-0.81758481315158360037f,(float16_t)0.57580819141784544968f, -(float16_t)-0.81934752007679700903f,(float16_t)0.57329716669804209328f, -(float16_t)-0.82110251499110464835f,(float16_t)0.57078074588696725566f, -(float16_t)-0.82284978137582620583f,(float16_t)0.56825895267013171175f, -(float16_t)-0.82458930278502506894f,(float16_t)0.56573181078361345353f, -(float16_t)-0.82632106284566353427f,(float16_t)0.56319934401383409117f, -(float16_t)-0.82804504525775568524f,(float16_t)0.56066157619733614226f, -(float16_t)-0.82976123379452293438f,(float16_t)0.55811853122055632426f, -(float16_t)-0.83146961230254534669f,(float16_t)0.55557023301960217765f, -(float16_t)-0.83317016470191318511f,(float16_t)0.55301670558002746780f, -(float16_t)-0.83486287498638001026f,(float16_t)0.55045797293660492233f, -(float16_t)-0.83654772722351189440f,(float16_t)0.54789405917310041172f, -(float16_t)-0.83822470555483807875f,(float16_t)0.54532498842204635281f, -(float16_t)-0.83989379419599952126f,(float16_t)0.54275078486451588944f, -(float16_t)-0.84155497743689833268f,(float16_t)0.54017147272989296525f, -(float16_t)-0.84320823964184532517f,(float16_t)0.53758707629564572716f, -(float16_t)-0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)-0.84649093877405201525f,(float16_t)0.53240312787719801246f, -(float16_t)-0.84812034480329712149f,(float16_t)0.52980362468629482731f, -(float16_t)-0.84974176800085254868f,(float16_t)0.52719913478190127964f, -(float16_t)-0.85135519310526519554f,(float16_t)0.52458968267846894928f, -(float16_t)-0.85296060493036363059f,(float16_t)0.52197529293715438925f, -(float16_t)-0.85455798836540042274f,(float16_t)0.51935599016558975372f, -(float16_t)-0.85614732837519447184f,(float16_t)0.51673179901764976218f, -(float16_t)-0.85772861000027200706f,(float16_t)0.51410274419322177231f, -(float16_t)-0.85930181835700836235f,(float16_t)0.51146885043797052361f, -(float16_t)-0.86086693863776719837f,(float16_t)0.50883014254310732216f, -(float16_t)-0.86242395611104050168f,(float16_t)0.50618664534515522835f, -(float16_t)-0.86397285612158669643f,(float16_t)0.50353838372571757542f, -(float16_t)-0.86551362409056897818f,(float16_t)0.50088538261124093687f, -(float16_t)-0.86704624551569264845f,(float16_t)0.49822766697278175752f, -(float16_t)-0.86857070597134089507f,(float16_t)0.49556526182577254058f, -(float16_t)-0.87008699110871134952f,(float16_t)0.49289819222978414892f, -(float16_t)-0.87159508665595086807f,(float16_t)0.49022648328829138142f, -(float16_t)-0.87309497841829009079f,(float16_t)0.48755016014843588490f, -(float16_t)-0.87458665227817611321f,(float16_t)0.48486924800079111986f, -(float16_t)-0.87607009419540649020f,(float16_t)0.48218377207912288540f, -(float16_t)-0.87754529020726113053f,(float16_t)0.47949375766015328582f, -(float16_t)-0.87901222642863352519f,(float16_t)0.47679923006332208812f, -(float16_t)-0.88047088905216075450f,(float16_t)0.47410021465055007805f, -(float16_t)-0.88192126434835493853f,(float16_t)0.47139673682599780857f, -(float16_t)-0.88336333866573168994f,(float16_t)0.46868882203582784562f, -(float16_t)-0.88479709843093778954f,(float16_t)0.46597649576796618121f, -(float16_t)-0.88622253014888052736f,(float16_t)0.46325978355186031576f, -(float16_t)-0.88763962040285382393f,(float16_t)0.46053871095824022719f, -(float16_t)-0.88904835585466457371f,(float16_t)0.45781330359887717485f, -(float16_t)-0.89044872324475787817f,(float16_t)0.45508358712634389143f, -(float16_t)-0.89184070939234261211f,(float16_t)0.45234958723377105549f, -(float16_t)-0.89322430119551521344f,(float16_t)0.44961132965460687272f, -(float16_t)-0.89459948563138269595f,(float16_t)0.44686884016237415906f, -(float16_t)-0.89596624975618510689f,(float16_t)0.44412214457042931137f, -(float16_t)-0.89732458070541820661f,(float16_t)0.44137126873171689256f, -(float16_t)-0.89867446569395392775f,(float16_t)0.43861623853852754751f, -(float16_t)-0.90001589201616016833f,(float16_t)0.43585707992225553031f, -(float16_t)-0.90134884704602191707f,(float16_t)0.43309381885315206828f, -(float16_t)-0.90267331823725871498f,(float16_t)0.43032648134008288920f, -(float16_t)-0.90398929312344333820f,(float16_t)0.42755509343028202940f, -(float16_t)-0.90529675931811870448f,(float16_t)0.42477968120910886141f, -(float16_t)-0.90659570451491533483f,(float16_t)0.42200027079979984812f, -(float16_t)-0.90788611648766603945f,(float16_t)0.41921688836322423821f, -(float16_t)-0.90916798309052238025f,(float16_t)0.41642956009763715253f, -(float16_t)-0.91044129225806713634f,(float16_t)0.41363831223843466889f, -(float16_t)-0.91170603200542976730f,(float16_t)0.41084317105790413294f, -(float16_t)-0.91296219042839821256f,(float16_t)0.40804416286497857680f, -(float16_t)-0.91420975570353069095f,(float16_t)0.40524131400498991651f, -(float16_t)-0.91544871608826772214f,(float16_t)0.40243465085941859671f, -(float16_t)-0.91667905992104259383f,(float16_t)0.39962419984564706565f, -(float16_t)-0.91790077562139049672f,(float16_t)0.39680998741671025254f, -(float16_t)-0.91911385169005777040f,(float16_t)0.39399204006104815434f, -(float16_t)-0.92031827670911048322f,(float16_t)0.39117038430225403722f, -(float16_t)-0.92151403934204179080f,(float16_t)0.38834504669882657923f, -(float16_t)-0.92270112833387862850f,(float16_t)0.38551605384391884890f, -(float16_t)-0.92387953251128673848f,(float16_t)0.38268343236508989280f, -(float16_t)-0.92504924078267747323f,(float16_t)0.37984720892405138271f, -(float16_t)-0.92621024213831137928f,(float16_t)0.37700741021641814843f, -(float16_t)-0.92736252565040111495f,(float16_t)0.37416406297145804460f, -(float16_t)-0.92850608047321547822f,(float16_t)0.37131719395183770960f, -(float16_t)-0.92964089584318121418f,(float16_t)0.36846682995337259880f, -(float16_t)-0.93076696107898371224f,(float16_t)0.36561299780477379828f, -(float16_t)-0.93188426558166803648f,(float16_t)0.36275572436739728088f, -(float16_t)-0.93299279883473884567f,(float16_t)0.35989503653498833291f, -(float16_t)-0.93409255040425875904f,(float16_t)0.35703096123343031065f, -(float16_t)-0.93518350993894761025f,(float16_t)0.35416352542049039931f, -(float16_t)-0.93626566717027825959f,(float16_t)0.35129275608556720378f, -(float16_t)-0.93733901191257484875f,(float16_t)0.34841868024943478677f, -(float16_t)-0.93840353406310816897f,(float16_t)0.34554132496398898278f, -(float16_t)-0.93945922360218991898f,(float16_t)0.34266071731199443384f, -(float16_t)-0.94050607059326829518f,(float16_t)0.33977688440682701776f, -(float16_t)-0.94154406518302069529f,(float16_t)0.33688985339222032867f, -(float16_t)-0.94257319760144686605f,(float16_t)0.33399965144200938205f, -(float16_t)-0.94359345816196038559f,(float16_t)0.33110630575987648472f, -(float16_t)-0.94460483726148014583f,(float16_t)0.32820984357909271933f, -(float16_t)-0.94560732538052116869f,(float16_t)0.32531029216226325929f, -(float16_t)-0.94660091308328353499f,(float16_t)0.32240767880106985244f, -(float16_t)-0.94758559101774109124f,(float16_t)0.31950203081601580291f, -(float16_t)-0.94856134991573026749f,(float16_t)0.31659337555616606785f, -(float16_t)-0.94952818059303667475f,(float16_t)0.31368174039889140658f, -(float16_t)-0.95048607394948170235f,(float16_t)0.31076715274961153046f, -(float16_t)-0.95143502096900833820f,(float16_t)0.30784964004153503314f, -(float16_t)-0.95237501271976576778f,(float16_t)0.30492922973540265152f, -(float16_t)-0.95330604035419386211f,(float16_t)0.30200594931922802866f, -(float16_t)-0.95422809510910555630f,(float16_t)0.29907982630804053059f, -(float16_t)-0.95514116830577067141f,(float16_t)0.29615088824362401088f, -(float16_t)-0.95604525134999629454f,(float16_t)0.29321916269425896129f, -(float16_t)-0.95694033573220882438f,(float16_t)0.29028467725446238656f, -(float16_t)-0.95782641302753290802f,(float16_t)0.28734745954472962204f, -(float16_t)-0.95870347489587148804f,(float16_t)0.28440753721127209896f, -(float16_t)-0.95957151308198451733f,(float16_t)0.28146493792575788540f, -(float16_t)-0.96043051941556578655f,(float16_t)0.27851968938505317075f, -(float16_t)-0.96128048581132063966f,(float16_t)0.27557181931095831029f, -(float16_t)-0.96212140426904146917f,(float16_t)0.27262135544994925418f, -(float16_t)-0.96295326687368387741f,(float16_t)0.26966832557291509076f, -(float16_t)-0.96377606579543984022f,(float16_t)0.26671275747489847641f, -(float16_t)-0.96458979328981264700f,(float16_t)0.26375467897483156898f, -(float16_t)-0.96539444169768928727f,(float16_t)0.26079411791527584707f, -(float16_t)-0.96619000344541250413f,(float16_t)0.25783110216215898713f, -(float16_t)-0.96697647104485207059f,(float16_t)0.25486565960451468271f, -(float16_t)-0.96775383709347539973f,(float16_t)0.25189781815421719013f, -(float16_t)-0.96852209427441737777f,(float16_t)0.24892760574572009302f, -(float16_t)-0.96928123535654842069f,(float16_t)0.24595505033579465048f, -(float16_t)-0.97003125319454397424f,(float16_t)0.24298017990326406523f, -(float16_t)-0.97077214072895023911f,(float16_t)0.24000302244874177626f, -(float16_t)-0.97150389098625178352f,(float16_t)0.23702360599436717026f, -(float16_t)-0.97222649707893626925f,(float16_t)0.23404195858354351345f, -(float16_t)-0.97293995220556006576f,(float16_t)0.23105810828067133156f, -(float16_t)-0.97364424965081186603f,(float16_t)0.22807208317088606409f, -(float16_t)-0.97433938278557585821f,(float16_t)0.22508391135979283204f, -(float16_t)-0.97502534506699412020f,(float16_t)0.22209362097320364815f, -(float16_t)-0.97570213003852845901f,(float16_t)0.21910124015687004739f, -(float16_t)-0.97636973133002114000f,(float16_t)0.21610679707621943679f, -(float16_t)-0.97702814265775439484f,(float16_t)0.21311031991609141745f, -(float16_t)-0.97767735782450992943f,(float16_t)0.21011183688046980444f, -(float16_t)-0.97831737071962754371f,(float16_t)0.20711137619221883788f, -(float16_t)-0.97894817531906219710f,(float16_t)0.20410896609281684033f, -(float16_t)-0.97956976568544051887f,(float16_t)0.20110463484209201157f, -(float16_t)-0.98018213596811731847f,(float16_t)0.19809841071795381007f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)-0.98137919331375456089f,(float16_t)0.19208039704989246510f, -(float16_t)-0.98196386910955524296f,(float16_t)0.18906866414980635915f, -(float16_t)-0.98253930228744124076f,(float16_t)0.18605515166344691047f, -(float16_t)-0.98310548743121628501f,(float16_t)0.18303988795514089527f, -(float16_t)-0.98366241921173025453f,(float16_t)0.18002290140569957022f, -(float16_t)-0.98421009238692902521f,(float16_t)0.17700422041214894375f, -(float16_t)-0.98474850180190420801f,(float16_t)0.17398387338746412745f, -(float16_t)-0.98527764238894122162f,(float16_t)0.17096188876030121717f, -(float16_t)-0.98579750916756736512f,(float16_t)0.16793829497473128365f, -(float16_t)-0.98630809724459855836f,(float16_t)0.16491312048997014417f, -(float16_t)-0.98680940181418552726f,(float16_t)0.16188639378011174252f, -(float16_t)-0.98730141815785843473f,(float16_t)0.15885814333386147346f, -(float16_t)-0.98778414164457217783f,(float16_t)0.15582839765426537149f, -(float16_t)-0.98825756773074946437f,(float16_t)0.15279718525844368515f, -(float16_t)-0.98872169196032377858f,(float16_t)0.14976453467732145364f, -(float16_t)-0.98917650996478101444f,(float16_t)0.14673047445536180344f, -(float16_t)-0.98962201746320077600f,(float16_t)0.14369503315029463764f, -(float16_t)-0.99005821026229701154f,(float16_t)0.14065823933284954395f, -(float16_t)-0.99048508425645709341f,(float16_t)0.13762012158648603832f, -(float16_t)-0.99090263542778000971f,(float16_t)0.13458070850712627875f, -(float16_t)-0.99131085984611544415f,(float16_t)0.13154002870288333815f, -(float16_t)-0.99170975366909952520f,(float16_t)0.12849811079379308554f, -(float16_t)-0.99209931314219179654f,(float16_t)0.12545498341154626143f, -(float16_t)-0.99247953459870996706f,(float16_t)0.12241067519921634832f, -(float16_t)-0.99285041445986510489f,(float16_t)0.11936521481099163222f, -(float16_t)-0.99321194923479450001f,(float16_t)0.11631863091190471071f, -(float16_t)-0.99356413552059530403f,(float16_t)0.11327095217756441570f, -(float16_t)-0.99390697000235606051f,(float16_t)0.11022220729388323979f, -(float16_t)-0.99424044945318790223f,(float16_t)0.10717242495680916192f, -(float16_t)-0.99456457073425541537f,(float16_t)0.10412163387205457254f, -(float16_t)-0.99487933079480561638f,(float16_t)0.10106986275482793269f, -(float16_t)-0.99518472667219681771f,(float16_t)0.09801714032956082567f, -(float16_t)-0.99548075549192693856f,(float16_t)0.09496349532963890838f, -(float16_t)-0.99576741446765981713f,(float16_t)0.09190895649713275162f, -(float16_t)-0.99604470090125196702f,(float16_t)0.08885355258252475297f, -(float16_t)-0.99631261218277800129f,(float16_t)0.08579731234444015753f, -(float16_t)-0.99657114579055483539f,(float16_t)0.08274026454937563613f, -(float16_t)-0.99682029929116566791f,(float16_t)0.07968243797143019502f, -(float16_t)-0.99706007033948296225f,(float16_t)0.07662386139203168633f, -(float16_t)-0.99729045667869020697f,(float16_t)0.07356456359966773162f, -(float16_t)-0.99751145614030345410f,(float16_t)0.07050457338961385600f, -(float16_t)-0.99772306664419163624f,(float16_t)0.06744391956366417584f, -(float16_t)-0.99792528619859599548f,(float16_t)0.06438263092985770097f, -(float16_t)-0.99811811290014917919f,(float16_t)0.06132073630220848809f, -(float16_t)-0.99830154493389289261f,(float16_t)0.05825826450043579408f, -(float16_t)-0.99847558057329477421f,(float16_t)0.05519524434969009380f, -(float16_t)-0.99864021818026516009f,(float16_t)0.05213170468028359428f, -(float16_t)-0.99879545620517240501f,(float16_t)0.04906767432741796636f, -(float16_t)-0.99894129318685687124f,(float16_t)0.04600318213091470626f, -(float16_t)-0.99907772775264536147f,(float16_t)0.04293825693494102147f, -(float16_t)-0.99920475861836388631f,(float16_t)0.03987292758774012985f, -(float16_t)-0.99932238458834954375f,(float16_t)0.03680722294135883171f, -(float16_t)-0.99943060455546173237f,(float16_t)0.03374117185137770480f, -(float16_t)-0.99952941750109314256f,(float16_t)0.03067480317663686534f, -(float16_t)-0.99961882249517863830f,(float16_t)0.02760814577896565994f, -(float16_t)-0.99969881869620424997f,(float16_t)0.02454122852291232629f, -(float16_t)-0.99976940535121527898f,(float16_t)0.02147408027546966747f, -(float16_t)-0.99983058179582340319f,(float16_t)0.01840672990580510121f, -(float16_t)-0.99988234745421256111f,(float16_t)0.01533920628498806026f, -(float16_t)-0.99992470183914450299f,(float16_t)0.01227153828572000692f, -(float16_t)-0.99995764455196389786f,(float16_t)0.00920375478206002066f, -(float16_t)-0.99998117528260110909f,(float16_t)0.00613588464915479880f, -(float16_t)-0.99999529380957619118f,(float16_t)0.00306795676296597701f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99992470183914450299f,(float16_t)0.01227153828571992539f, -(float16_t)0.99969881869620424997f,(float16_t)0.02454122852291228812f, -(float16_t)0.99932238458834954375f,(float16_t)0.03680722294135883171f, -(float16_t)0.99879545620517240501f,(float16_t)0.04906767432741801493f, -(float16_t)0.99811811290014917919f,(float16_t)0.06132073630220857829f, -(float16_t)0.99729045667869020697f,(float16_t)0.07356456359966742631f, -(float16_t)0.99631261218277800129f,(float16_t)0.08579731234443989385f, -(float16_t)0.99518472667219692873f,(float16_t)0.09801714032956060363f, -(float16_t)0.99390697000235606051f,(float16_t)0.11022220729388305938f, -(float16_t)0.99247953459870996706f,(float16_t)0.12241067519921619566f, -(float16_t)0.99090263542778000971f,(float16_t)0.13458070850712616773f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.98730141815785843473f,(float16_t)0.15885814333386144570f, -(float16_t)0.98527764238894122162f,(float16_t)0.17096188876030121717f, -(float16_t)0.98310548743121628501f,(float16_t)0.18303988795514095078f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.97831737071962765473f,(float16_t)0.20711137619221856032f, -(float16_t)0.97570213003852857003f,(float16_t)0.21910124015686979759f, -(float16_t)0.97293995220556017678f,(float16_t)0.23105810828067110951f, -(float16_t)0.97003125319454397424f,(float16_t)0.24298017990326387094f, -(float16_t)0.96697647104485207059f,(float16_t)0.25486565960451457169f, -(float16_t)0.96377606579543984022f,(float16_t)0.26671275747489836538f, -(float16_t)0.96043051941556578655f,(float16_t)0.27851968938505305973f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.95330604035419386211f,(float16_t)0.30200594931922808417f, -(float16_t)0.94952818059303667475f,(float16_t)0.31368174039889151761f, -(float16_t)0.94560732538052127971f,(float16_t)0.32531029216226292622f, -(float16_t)0.94154406518302080631f,(float16_t)0.33688985339222005111f, -(float16_t)0.93733901191257495977f,(float16_t)0.34841868024943456472f, -(float16_t)0.93299279883473895669f,(float16_t)0.35989503653498811087f, -(float16_t)0.92850608047321558924f,(float16_t)0.37131719395183754306f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.91911385169005777040f,(float16_t)0.39399204006104809883f, -(float16_t)0.91420975570353069095f,(float16_t)0.40524131400498986100f, -(float16_t)0.90916798309052238025f,(float16_t)0.41642956009763715253f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.89867446569395381673f,(float16_t)0.43861623853852765853f, -(float16_t)0.89322430119551532446f,(float16_t)0.44961132965460653965f, -(float16_t)0.88763962040285393496f,(float16_t)0.46053871095824000514f, -(float16_t)0.88192126434835504956f,(float16_t)0.47139673682599764204f, -(float16_t)0.87607009419540660122f,(float16_t)0.48218377207912271887f, -(float16_t)0.87008699110871146054f,(float16_t)0.49289819222978403790f, -(float16_t)0.86397285612158669643f,(float16_t)0.50353838372571757542f, -(float16_t)0.85772861000027211809f,(float16_t)0.51410274419322166128f, -(float16_t)0.85135519310526519554f,(float16_t)0.52458968267846894928f, -(float16_t)0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)0.83822470555483807875f,(float16_t)0.54532498842204646383f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.82458930278502529099f,(float16_t)0.56573181078361312046f, -(float16_t)0.81758481315158371139f,(float16_t)0.57580819141784533866f, -(float16_t)0.81045719825259476821f,(float16_t)0.58579785745643886408f, -(float16_t)0.80320753148064494287f,(float16_t)0.59569930449243335691f, -(float16_t)0.79583690460888356633f,(float16_t)0.60551104140432554512f, -(float16_t)0.78834642762660622761f,(float16_t)0.61523159058062681925f, -(float16_t)0.78073722857209448822f,(float16_t)0.62485948814238634341f, -(float16_t)0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)0.76516726562245895860f,(float16_t)0.64383154288979138613f, -(float16_t)0.75720884650648456748f,(float16_t)0.65317284295377675551f, -(float16_t)0.74913639452345937020f,(float16_t)0.66241577759017178373f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.73265427167241281570f,(float16_t)0.68060099779545302212f, -(float16_t)0.72424708295146700276f,(float16_t)0.68954054473706682948f, -(float16_t)0.71573082528381870571f,(float16_t)0.69837624940897280457f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.69837624940897291559f,(float16_t)0.71573082528381859468f, -(float16_t)0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)0.68060099779545302212f,(float16_t)0.73265427167241281570f, -(float16_t)0.67155895484701833009f,(float16_t)0.74095112535495910588f, -(float16_t)0.66241577759017178373f,(float16_t)0.74913639452345925918f, -(float16_t)0.65317284295377686654f,(float16_t)0.75720884650648456748f, -(float16_t)0.64383154288979149715f,(float16_t)0.76516726562245895860f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.62485948814238645443f,(float16_t)0.78073722857209448822f, -(float16_t)0.61523159058062681925f,(float16_t)0.78834642762660622761f, -(float16_t)0.60551104140432554512f,(float16_t)0.79583690460888345530f, -(float16_t)0.59569930449243346793f,(float16_t)0.80320753148064483184f, -(float16_t)0.58579785745643886408f,(float16_t)0.81045719825259476821f, -(float16_t)0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)0.56573181078361323149f,(float16_t)0.82458930278502529099f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.54532498842204646383f,(float16_t)0.83822470555483796772f, -(float16_t)0.53499761988709726435f,(float16_t)0.84485356524970700587f, -(float16_t)0.52458968267846883826f,(float16_t)0.85135519310526519554f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.50353838372571757542f,(float16_t)0.86397285612158669643f, -(float16_t)0.49289819222978409341f,(float16_t)0.87008699110871134952f, -(float16_t)0.48218377207912282989f,(float16_t)0.87607009419540660122f, -(float16_t)0.47139673682599780857f,(float16_t)0.88192126434835493853f, -(float16_t)0.46053871095824000514f,(float16_t)0.88763962040285393496f, -(float16_t)0.44961132965460659516f,(float16_t)0.89322430119551532446f, -(float16_t)0.43861623853852771404f,(float16_t)0.89867446569395381673f, -(float16_t)0.42755509343028219593f,(float16_t)0.90398929312344333820f, -(float16_t)0.41642956009763731906f,(float16_t)0.90916798309052226923f, -(float16_t)0.40524131400498986100f,(float16_t)0.91420975570353069095f, -(float16_t)0.39399204006104809883f,(float16_t)0.91911385169005777040f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.37131719395183759858f,(float16_t)0.92850608047321558924f, -(float16_t)0.35989503653498827740f,(float16_t)0.93299279883473884567f, -(float16_t)0.34841868024943450921f,(float16_t)0.93733901191257495977f, -(float16_t)0.33688985339222005111f,(float16_t)0.94154406518302080631f, -(float16_t)0.32531029216226298173f,(float16_t)0.94560732538052127971f, -(float16_t)0.31368174039889157312f,(float16_t)0.94952818059303667475f, -(float16_t)0.30200594931922819519f,(float16_t)0.95330604035419375109f, -(float16_t)0.29028467725446233105f,(float16_t)0.95694033573220893540f, -(float16_t)0.27851968938505305973f,(float16_t)0.96043051941556578655f, -(float16_t)0.26671275747489842090f,(float16_t)0.96377606579543984022f, -(float16_t)0.25486565960451462720f,(float16_t)0.96697647104485207059f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.23105810828067127605f,(float16_t)0.97293995220556006576f, -(float16_t)0.21910124015686976984f,(float16_t)0.97570213003852857003f, -(float16_t)0.20711137619221856032f,(float16_t)0.97831737071962765473f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.18303988795514106180f,(float16_t)0.98310548743121628501f, -(float16_t)0.17096188876030135595f,(float16_t)0.98527764238894122162f, -(float16_t)0.15885814333386139019f,(float16_t)0.98730141815785843473f, -(float16_t)0.14673047445536174793f,(float16_t)0.98917650996478101444f, -(float16_t)0.13458070850712622324f,(float16_t)0.99090263542778000971f, -(float16_t)0.12241067519921627893f,(float16_t)0.99247953459870996706f, -(float16_t)0.11022220729388318428f,(float16_t)0.99390697000235606051f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.08579731234443987997f,(float16_t)0.99631261218277800129f, -(float16_t)0.07356456359966745406f,(float16_t)0.99729045667869020697f, -(float16_t)0.06132073630220864768f,(float16_t)0.99811811290014917919f, -(float16_t)0.04906767432741812596f,(float16_t)0.99879545620517240501f, -(float16_t)0.03680722294135899131f,(float16_t)0.99932238458834954375f, -(float16_t)0.02454122852291226384f,(float16_t)0.99969881869620424997f, -(float16_t)0.01227153828571994447f,(float16_t)0.99992470183914450299f, -(float16_t)0.00000000000000006123f,(float16_t)1.00000000000000000000f, -(float16_t)-0.01227153828571982304f,(float16_t)0.99992470183914450299f, -(float16_t)-0.02454122852291214241f,(float16_t)0.99969881869620424997f, -(float16_t)-0.03680722294135886641f,(float16_t)0.99932238458834954375f, -(float16_t)-0.04906767432741800800f,(float16_t)0.99879545620517240501f, -(float16_t)-0.06132073630220852972f,(float16_t)0.99811811290014917919f, -(float16_t)-0.07356456359966732916f,(float16_t)0.99729045667869020697f, -(float16_t)-0.08579731234443975507f,(float16_t)0.99631261218277800129f, -(float16_t)-0.09801714032956064526f,(float16_t)0.99518472667219692873f, -(float16_t)-0.11022220729388305938f,(float16_t)0.99390697000235606051f, -(float16_t)-0.12241067519921615403f,(float16_t)0.99247953459870996706f, -(float16_t)-0.13458070850712611222f,(float16_t)0.99090263542778000971f, -(float16_t)-0.14673047445536163691f,(float16_t)0.98917650996478101444f, -(float16_t)-0.15885814333386127917f,(float16_t)0.98730141815785843473f, -(float16_t)-0.17096188876030124493f,(float16_t)0.98527764238894122162f, -(float16_t)-0.18303988795514092303f,(float16_t)0.98310548743121628501f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.20711137619221844930f,(float16_t)0.97831737071962765473f, -(float16_t)-0.21910124015686965881f,(float16_t)0.97570213003852857003f, -(float16_t)-0.23105810828067113727f,(float16_t)0.97293995220556017678f, -(float16_t)-0.24298017990326387094f,(float16_t)0.97003125319454397424f, -(float16_t)-0.25486565960451451618f,(float16_t)0.96697647104485207059f, -(float16_t)-0.26671275747489830987f,(float16_t)0.96377606579543984022f, -(float16_t)-0.27851968938505294870f,(float16_t)0.96043051941556589757f, -(float16_t)-0.29028467725446216452f,(float16_t)0.95694033573220893540f, -(float16_t)-0.30200594931922808417f,(float16_t)0.95330604035419386211f, -(float16_t)-0.31368174039889140658f,(float16_t)0.94952818059303667475f, -(float16_t)-0.32531029216226287071f,(float16_t)0.94560732538052139073f, -(float16_t)-0.33688985339221994009f,(float16_t)0.94154406518302080631f, -(float16_t)-0.34841868024943439819f,(float16_t)0.93733901191257495977f, -(float16_t)-0.35989503653498816638f,(float16_t)0.93299279883473884567f, -(float16_t)-0.37131719395183748755f,(float16_t)0.92850608047321558924f, -(float16_t)-0.38268343236508972627f,(float16_t)0.92387953251128673848f, -(float16_t)-0.39399204006104798781f,(float16_t)0.91911385169005777040f, -(float16_t)-0.40524131400498974998f,(float16_t)0.91420975570353069095f, -(float16_t)-0.41642956009763698599f,(float16_t)0.90916798309052249127f, -(float16_t)-0.42755509343028186287f,(float16_t)0.90398929312344344922f, -(float16_t)-0.43861623853852738097f,(float16_t)0.89867446569395392775f, -(float16_t)-0.44961132965460670619f,(float16_t)0.89322430119551521344f, -(float16_t)-0.46053871095824006066f,(float16_t)0.88763962040285393496f, -(float16_t)-0.47139673682599769755f,(float16_t)0.88192126434835504956f, -(float16_t)-0.48218377207912271887f,(float16_t)0.87607009419540660122f, -(float16_t)-0.49289819222978398239f,(float16_t)0.87008699110871146054f, -(float16_t)-0.50353838372571746440f,(float16_t)0.86397285612158680745f, -(float16_t)-0.51410274419322155026f,(float16_t)0.85772861000027211809f, -(float16_t)-0.52458968267846872724f,(float16_t)0.85135519310526519554f, -(float16_t)-0.53499761988709704230f,(float16_t)0.84485356524970722791f, -(float16_t)-0.54532498842204624179f,(float16_t)0.83822470555483818977f, -(float16_t)-0.55557023301960195560f,(float16_t)0.83146961230254534669f, -(float16_t)-0.56573181078361323149f,(float16_t)0.82458930278502517996f, -(float16_t)-0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)-0.58579785745643886408f,(float16_t)0.81045719825259476821f, -(float16_t)-0.59569930449243335691f,(float16_t)0.80320753148064494287f, -(float16_t)-0.60551104140432543410f,(float16_t)0.79583690460888356633f, -(float16_t)-0.61523159058062670823f,(float16_t)0.78834642762660633863f, -(float16_t)-0.62485948814238623239f,(float16_t)0.78073722857209459924f, -(float16_t)-0.63439328416364537677f,(float16_t)0.77301045336273710440f, -(float16_t)-0.64383154288979127511f,(float16_t)0.76516726562245906962f, -(float16_t)-0.65317284295377653347f,(float16_t)0.75720884650648467851f, -(float16_t)-0.66241577759017189475f,(float16_t)0.74913639452345925918f, -(float16_t)-0.67155895484701844111f,(float16_t)0.74095112535495899486f, -(float16_t)-0.68060099779545302212f,(float16_t)0.73265427167241281570f, -(float16_t)-0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)-0.69837624940897280457f,(float16_t)0.71573082528381870571f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.71573082528381859468f,(float16_t)0.69837624940897291559f, -(float16_t)-0.72424708295146678072f,(float16_t)0.68954054473706705153f, -(float16_t)-0.73265427167241270467f,(float16_t)0.68060099779545324417f, -(float16_t)-0.74095112535495888384f,(float16_t)0.67155895484701855214f, -(float16_t)-0.74913639452345914815f,(float16_t)0.66241577759017200577f, -(float16_t)-0.75720884650648467851f,(float16_t)0.65317284295377664449f, -(float16_t)-0.76516726562245895860f,(float16_t)0.64383154288979138613f, -(float16_t)-0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)-0.78073722857209448822f,(float16_t)0.62485948814238634341f, -(float16_t)-0.78834642762660622761f,(float16_t)0.61523159058062693028f, -(float16_t)-0.79583690460888345530f,(float16_t)0.60551104140432565615f, -(float16_t)-0.80320753148064483184f,(float16_t)0.59569930449243346793f, -(float16_t)-0.81045719825259465718f,(float16_t)0.58579785745643897510f, -(float16_t)-0.81758481315158360037f,(float16_t)0.57580819141784544968f, -(float16_t)-0.82458930278502506894f,(float16_t)0.56573181078361345353f, -(float16_t)-0.83146961230254534669f,(float16_t)0.55557023301960217765f, -(float16_t)-0.83822470555483807875f,(float16_t)0.54532498842204635281f, -(float16_t)-0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)-0.85135519310526519554f,(float16_t)0.52458968267846894928f, -(float16_t)-0.85772861000027200706f,(float16_t)0.51410274419322177231f, -(float16_t)-0.86397285612158669643f,(float16_t)0.50353838372571757542f, -(float16_t)-0.87008699110871134952f,(float16_t)0.49289819222978414892f, -(float16_t)-0.87607009419540649020f,(float16_t)0.48218377207912288540f, -(float16_t)-0.88192126434835493853f,(float16_t)0.47139673682599780857f, -(float16_t)-0.88763962040285382393f,(float16_t)0.46053871095824022719f, -(float16_t)-0.89322430119551521344f,(float16_t)0.44961132965460687272f, -(float16_t)-0.89867446569395392775f,(float16_t)0.43861623853852754751f, -(float16_t)-0.90398929312344333820f,(float16_t)0.42755509343028202940f, -(float16_t)-0.90916798309052238025f,(float16_t)0.41642956009763715253f, -(float16_t)-0.91420975570353069095f,(float16_t)0.40524131400498991651f, -(float16_t)-0.91911385169005777040f,(float16_t)0.39399204006104815434f, -(float16_t)-0.92387953251128673848f,(float16_t)0.38268343236508989280f, -(float16_t)-0.92850608047321547822f,(float16_t)0.37131719395183770960f, -(float16_t)-0.93299279883473884567f,(float16_t)0.35989503653498833291f, -(float16_t)-0.93733901191257484875f,(float16_t)0.34841868024943478677f, -(float16_t)-0.94154406518302069529f,(float16_t)0.33688985339222032867f, -(float16_t)-0.94560732538052116869f,(float16_t)0.32531029216226325929f, -(float16_t)-0.94952818059303667475f,(float16_t)0.31368174039889140658f, -(float16_t)-0.95330604035419386211f,(float16_t)0.30200594931922802866f, -(float16_t)-0.95694033573220882438f,(float16_t)0.29028467725446238656f, -(float16_t)-0.96043051941556578655f,(float16_t)0.27851968938505317075f, -(float16_t)-0.96377606579543984022f,(float16_t)0.26671275747489847641f, -(float16_t)-0.96697647104485207059f,(float16_t)0.25486565960451468271f, -(float16_t)-0.97003125319454397424f,(float16_t)0.24298017990326406523f, -(float16_t)-0.97293995220556006576f,(float16_t)0.23105810828067133156f, -(float16_t)-0.97570213003852845901f,(float16_t)0.21910124015687004739f, -(float16_t)-0.97831737071962754371f,(float16_t)0.20711137619221883788f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)-0.98310548743121628501f,(float16_t)0.18303988795514089527f, -(float16_t)-0.98527764238894122162f,(float16_t)0.17096188876030121717f, -(float16_t)-0.98730141815785843473f,(float16_t)0.15885814333386147346f, -(float16_t)-0.98917650996478101444f,(float16_t)0.14673047445536180344f, -(float16_t)-0.99090263542778000971f,(float16_t)0.13458070850712627875f, -(float16_t)-0.99247953459870996706f,(float16_t)0.12241067519921634832f, -(float16_t)-0.99390697000235606051f,(float16_t)0.11022220729388323979f, -(float16_t)-0.99518472667219681771f,(float16_t)0.09801714032956082567f, -(float16_t)-0.99631261218277800129f,(float16_t)0.08579731234444015753f, -(float16_t)-0.99729045667869020697f,(float16_t)0.07356456359966773162f, -(float16_t)-0.99811811290014917919f,(float16_t)0.06132073630220848809f, -(float16_t)-0.99879545620517240501f,(float16_t)0.04906767432741796636f, -(float16_t)-0.99932238458834954375f,(float16_t)0.03680722294135883171f, -(float16_t)-0.99969881869620424997f,(float16_t)0.02454122852291232629f, -(float16_t)-0.99992470183914450299f,(float16_t)0.01227153828572000692f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99879545620517240501f,(float16_t)0.04906767432741801493f, -(float16_t)0.99518472667219692873f,(float16_t)0.09801714032956060363f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.97003125319454397424f,(float16_t)0.24298017990326387094f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.94154406518302080631f,(float16_t)0.33688985339222005111f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.88192126434835504956f,(float16_t)0.47139673682599764204f, -(float16_t)0.85772861000027211809f,(float16_t)0.51410274419322166128f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.80320753148064494287f,(float16_t)0.59569930449243335691f, -(float16_t)0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.67155895484701833009f,(float16_t)0.74095112535495910588f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.59569930449243346793f,(float16_t)0.80320753148064483184f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.47139673682599780857f,(float16_t)0.88192126434835493853f, -(float16_t)0.42755509343028219593f,(float16_t)0.90398929312344333820f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.33688985339222005111f,(float16_t)0.94154406518302080631f, -(float16_t)0.29028467725446233105f,(float16_t)0.95694033573220893540f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.14673047445536174793f,(float16_t)0.98917650996478101444f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.04906767432741812596f,(float16_t)0.99879545620517240501f, -(float16_t)0.00000000000000006123f,(float16_t)1.00000000000000000000f, -(float16_t)-0.04906767432741800800f,(float16_t)0.99879545620517240501f, -(float16_t)-0.09801714032956064526f,(float16_t)0.99518472667219692873f, -(float16_t)-0.14673047445536163691f,(float16_t)0.98917650996478101444f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.24298017990326387094f,(float16_t)0.97003125319454397424f, -(float16_t)-0.29028467725446216452f,(float16_t)0.95694033573220893540f, -(float16_t)-0.33688985339221994009f,(float16_t)0.94154406518302080631f, -(float16_t)-0.38268343236508972627f,(float16_t)0.92387953251128673848f, -(float16_t)-0.42755509343028186287f,(float16_t)0.90398929312344344922f, -(float16_t)-0.47139673682599769755f,(float16_t)0.88192126434835504956f, -(float16_t)-0.51410274419322155026f,(float16_t)0.85772861000027211809f, -(float16_t)-0.55557023301960195560f,(float16_t)0.83146961230254534669f, -(float16_t)-0.59569930449243335691f,(float16_t)0.80320753148064494287f, -(float16_t)-0.63439328416364537677f,(float16_t)0.77301045336273710440f, -(float16_t)-0.67155895484701844111f,(float16_t)0.74095112535495899486f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.74095112535495888384f,(float16_t)0.67155895484701855214f, -(float16_t)-0.77301045336273699338f,(float16_t)0.63439328416364548779f, -(float16_t)-0.80320753148064483184f,(float16_t)0.59569930449243346793f, -(float16_t)-0.83146961230254534669f,(float16_t)0.55557023301960217765f, -(float16_t)-0.85772861000027200706f,(float16_t)0.51410274419322177231f, -(float16_t)-0.88192126434835493853f,(float16_t)0.47139673682599780857f, -(float16_t)-0.90398929312344333820f,(float16_t)0.42755509343028202940f, -(float16_t)-0.92387953251128673848f,(float16_t)0.38268343236508989280f, -(float16_t)-0.94154406518302069529f,(float16_t)0.33688985339222032867f, -(float16_t)-0.95694033573220882438f,(float16_t)0.29028467725446238656f, -(float16_t)-0.97003125319454397424f,(float16_t)0.24298017990326406523f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)-0.98917650996478101444f,(float16_t)0.14673047445536180344f, -(float16_t)-0.99518472667219681771f,(float16_t)0.09801714032956082567f, -(float16_t)-0.99879545620517240501f,(float16_t)0.04906767432741796636f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.98078528040323043058f,(float16_t)0.19509032201612824808f, -(float16_t)0.92387953251128673848f,(float16_t)0.38268343236508978178f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.55557023301960228867f,(float16_t)0.83146961230254523567f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.19509032201612833135f,(float16_t)0.98078528040323043058f, -(float16_t)0.00000000000000006123f,(float16_t)1.00000000000000000000f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.38268343236508972627f,(float16_t)0.92387953251128673848f, -(float16_t)-0.55557023301960195560f,(float16_t)0.83146961230254534669f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.83146961230254534669f,(float16_t)0.55557023301960217765f, -(float16_t)-0.92387953251128673848f,(float16_t)0.38268343236508989280f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.70710678118654757274f,(float16_t)0.70710678118654757274f, -(float16_t)0.00000000000000006123f,(float16_t)1.00000000000000000000f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f,}; +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)1.0000000000000f,(float16_t)0.0030670166016f, +(float16_t)1.0000000000000f,(float16_t)0.0061340332031f, +(float16_t)1.0000000000000f,(float16_t)0.0092010498047f, +(float16_t)1.0000000000000f,(float16_t)0.0122680664062f, +(float16_t)1.0000000000000f,(float16_t)0.0153427124023f, +(float16_t)1.0000000000000f,(float16_t)0.0184020996094f, +(float16_t)1.0000000000000f,(float16_t)0.0214691162109f, +(float16_t)0.9995117187500f,(float16_t)0.0245361328125f, +(float16_t)0.9995117187500f,(float16_t)0.0276031494141f, +(float16_t)0.9995117187500f,(float16_t)0.0306701660156f, +(float16_t)0.9995117187500f,(float16_t)0.0337524414062f, +(float16_t)0.9995117187500f,(float16_t)0.0368041992188f, +(float16_t)0.9990234375000f,(float16_t)0.0398864746094f, +(float16_t)0.9990234375000f,(float16_t)0.0429382324219f, +(float16_t)0.9990234375000f,(float16_t)0.0459899902344f, +(float16_t)0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)0.9985351562500f,(float16_t)0.0521240234375f, +(float16_t)0.9985351562500f,(float16_t)0.0552062988281f, +(float16_t)0.9985351562500f,(float16_t)0.0582580566406f, +(float16_t)0.9980468750000f,(float16_t)0.0613098144531f, +(float16_t)0.9980468750000f,(float16_t)0.0643920898438f, +(float16_t)0.9975585937500f,(float16_t)0.0674438476562f, +(float16_t)0.9975585937500f,(float16_t)0.0704956054688f, +(float16_t)0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)0.9970703125000f,(float16_t)0.0765991210938f, +(float16_t)0.9965820312500f,(float16_t)0.0797119140625f, +(float16_t)0.9965820312500f,(float16_t)0.0827636718750f, +(float16_t)0.9960937500000f,(float16_t)0.0858154296875f, +(float16_t)0.9960937500000f,(float16_t)0.0888671875000f, +(float16_t)0.9956054687500f,(float16_t)0.0919189453125f, +(float16_t)0.9956054687500f,(float16_t)0.0949707031250f, +(float16_t)0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)0.9951171875000f,(float16_t)0.1010742187500f, +(float16_t)0.9946289062500f,(float16_t)0.1041259765625f, +(float16_t)0.9941406250000f,(float16_t)0.1071777343750f, +(float16_t)0.9941406250000f,(float16_t)0.1102294921875f, +(float16_t)0.9936523437500f,(float16_t)0.1132812500000f, +(float16_t)0.9931640625000f,(float16_t)0.1163330078125f, +(float16_t)0.9926757812500f,(float16_t)0.1193847656250f, +(float16_t)0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)0.9921875000000f,(float16_t)0.1254882812500f, +(float16_t)0.9916992187500f,(float16_t)0.1285400390625f, +(float16_t)0.9912109375000f,(float16_t)0.1315917968750f, +(float16_t)0.9907226562500f,(float16_t)0.1345214843750f, +(float16_t)0.9907226562500f,(float16_t)0.1375732421875f, +(float16_t)0.9902343750000f,(float16_t)0.1406250000000f, +(float16_t)0.9897460937500f,(float16_t)0.1436767578125f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9887695312500f,(float16_t)0.1497802734375f, +(float16_t)0.9882812500000f,(float16_t)0.1528320312500f, +(float16_t)0.9877929687500f,(float16_t)0.1558837890625f, +(float16_t)0.9873046875000f,(float16_t)0.1588134765625f, +(float16_t)0.9868164062500f,(float16_t)0.1618652343750f, +(float16_t)0.9863281250000f,(float16_t)0.1649169921875f, +(float16_t)0.9858398437500f,(float16_t)0.1679687500000f, +(float16_t)0.9853515625000f,(float16_t)0.1710205078125f, +(float16_t)0.9848632812500f,(float16_t)0.1739501953125f, +(float16_t)0.9843750000000f,(float16_t)0.1770019531250f, +(float16_t)0.9838867187500f,(float16_t)0.1800537109375f, +(float16_t)0.9829101562500f,(float16_t)0.1829833984375f, +(float16_t)0.9824218750000f,(float16_t)0.1860351562500f, +(float16_t)0.9819335937500f,(float16_t)0.1890869140625f, +(float16_t)0.9814453125000f,(float16_t)0.1921386718750f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9799804687500f,(float16_t)0.1981201171875f, +(float16_t)0.9794921875000f,(float16_t)0.2010498046875f, +(float16_t)0.9790039062500f,(float16_t)0.2041015625000f, +(float16_t)0.9785156250000f,(float16_t)0.2071533203125f, +(float16_t)0.9775390625000f,(float16_t)0.2100830078125f, +(float16_t)0.9770507812500f,(float16_t)0.2131347656250f, +(float16_t)0.9765625000000f,(float16_t)0.2160644531250f, +(float16_t)0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)0.9750976562500f,(float16_t)0.2220458984375f, +(float16_t)0.9741210937500f,(float16_t)0.2250976562500f, +(float16_t)0.9736328125000f,(float16_t)0.2280273437500f, +(float16_t)0.9731445312500f,(float16_t)0.2310791015625f, +(float16_t)0.9721679687500f,(float16_t)0.2340087890625f, +(float16_t)0.9716796875000f,(float16_t)0.2370605468750f, +(float16_t)0.9707031250000f,(float16_t)0.2399902343750f, +(float16_t)0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)0.9692382812500f,(float16_t)0.2459716796875f, +(float16_t)0.9687500000000f,(float16_t)0.2489013671875f, +(float16_t)0.9677734375000f,(float16_t)0.2519531250000f, +(float16_t)0.9667968750000f,(float16_t)0.2548828125000f, +(float16_t)0.9663085937500f,(float16_t)0.2578125000000f, +(float16_t)0.9653320312500f,(float16_t)0.2607421875000f, +(float16_t)0.9643554687500f,(float16_t)0.2636718750000f, +(float16_t)0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)0.9628906250000f,(float16_t)0.2697753906250f, +(float16_t)0.9619140625000f,(float16_t)0.2727050781250f, +(float16_t)0.9614257812500f,(float16_t)0.2756347656250f, +(float16_t)0.9604492187500f,(float16_t)0.2785644531250f, +(float16_t)0.9594726562500f,(float16_t)0.2814941406250f, +(float16_t)0.9584960937500f,(float16_t)0.2844238281250f, +(float16_t)0.9580078125000f,(float16_t)0.2873535156250f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9560546875000f,(float16_t)0.2932128906250f, +(float16_t)0.9550781250000f,(float16_t)0.2961425781250f, +(float16_t)0.9541015625000f,(float16_t)0.2990722656250f, +(float16_t)0.9531250000000f,(float16_t)0.3020019531250f, +(float16_t)0.9521484375000f,(float16_t)0.3049316406250f, +(float16_t)0.9516601562500f,(float16_t)0.3078613281250f, +(float16_t)0.9506835937500f,(float16_t)0.3107910156250f, +(float16_t)0.9497070312500f,(float16_t)0.3137207031250f, +(float16_t)0.9487304687500f,(float16_t)0.3166503906250f, +(float16_t)0.9477539062500f,(float16_t)0.3195800781250f, +(float16_t)0.9467773437500f,(float16_t)0.3225097656250f, +(float16_t)0.9458007812500f,(float16_t)0.3251953125000f, +(float16_t)0.9448242187500f,(float16_t)0.3281250000000f, +(float16_t)0.9433593750000f,(float16_t)0.3310546875000f, +(float16_t)0.9423828125000f,(float16_t)0.3339843750000f, +(float16_t)0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)0.9404296875000f,(float16_t)0.3398437500000f, +(float16_t)0.9394531250000f,(float16_t)0.3427734375000f, +(float16_t)0.9384765625000f,(float16_t)0.3454589843750f, +(float16_t)0.9375000000000f,(float16_t)0.3483886718750f, +(float16_t)0.9360351562500f,(float16_t)0.3513183593750f, +(float16_t)0.9350585937500f,(float16_t)0.3542480468750f, +(float16_t)0.9340820312500f,(float16_t)0.3569335937500f, +(float16_t)0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)0.9316406250000f,(float16_t)0.3627929687500f, +(float16_t)0.9306640625000f,(float16_t)0.3657226562500f, +(float16_t)0.9296875000000f,(float16_t)0.3684082031250f, +(float16_t)0.9287109375000f,(float16_t)0.3713378906250f, +(float16_t)0.9272460937500f,(float16_t)0.3742675781250f, +(float16_t)0.9262695312500f,(float16_t)0.3769531250000f, +(float16_t)0.9252929687500f,(float16_t)0.3798828125000f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.9228515625000f,(float16_t)0.3854980468750f, +(float16_t)0.9213867187500f,(float16_t)0.3884277343750f, +(float16_t)0.9204101562500f,(float16_t)0.3911132812500f, +(float16_t)0.9189453125000f,(float16_t)0.3940429687500f, +(float16_t)0.9179687500000f,(float16_t)0.3967285156250f, +(float16_t)0.9165039062500f,(float16_t)0.3996582031250f, +(float16_t)0.9155273437500f,(float16_t)0.4023437500000f, +(float16_t)0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)0.9130859375000f,(float16_t)0.4079589843750f, +(float16_t)0.9116210937500f,(float16_t)0.4108886718750f, +(float16_t)0.9106445312500f,(float16_t)0.4135742187500f, +(float16_t)0.9091796875000f,(float16_t)0.4165039062500f, +(float16_t)0.9077148437500f,(float16_t)0.4191894531250f, +(float16_t)0.9067382812500f,(float16_t)0.4221191406250f, +(float16_t)0.9052734375000f,(float16_t)0.4248046875000f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.9028320312500f,(float16_t)0.4304199218750f, +(float16_t)0.9013671875000f,(float16_t)0.4331054687500f, +(float16_t)0.8999023437500f,(float16_t)0.4357910156250f, +(float16_t)0.8984375000000f,(float16_t)0.4387207031250f, +(float16_t)0.8974609375000f,(float16_t)0.4414062500000f, +(float16_t)0.8959960937500f,(float16_t)0.4440917968750f, +(float16_t)0.8945312500000f,(float16_t)0.4467773437500f, +(float16_t)0.8930664062500f,(float16_t)0.4497070312500f, +(float16_t)0.8916015625000f,(float16_t)0.4523925781250f, +(float16_t)0.8906250000000f,(float16_t)0.4550781250000f, +(float16_t)0.8891601562500f,(float16_t)0.4577636718750f, +(float16_t)0.8876953125000f,(float16_t)0.4604492187500f, +(float16_t)0.8862304687500f,(float16_t)0.4633789062500f, +(float16_t)0.8847656250000f,(float16_t)0.4660644531250f, +(float16_t)0.8833007812500f,(float16_t)0.4687500000000f, +(float16_t)0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)0.8803710937500f,(float16_t)0.4741210937500f, +(float16_t)0.8789062500000f,(float16_t)0.4768066406250f, +(float16_t)0.8774414062500f,(float16_t)0.4794921875000f, +(float16_t)0.8759765625000f,(float16_t)0.4821777343750f, +(float16_t)0.8745117187500f,(float16_t)0.4848632812500f, +(float16_t)0.8730468750000f,(float16_t)0.4875488281250f, +(float16_t)0.8715820312500f,(float16_t)0.4902343750000f, +(float16_t)0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)0.8686523437500f,(float16_t)0.4956054687500f, +(float16_t)0.8671875000000f,(float16_t)0.4982910156250f, +(float16_t)0.8657226562500f,(float16_t)0.5009765625000f, +(float16_t)0.8637695312500f,(float16_t)0.5034179687500f, +(float16_t)0.8623046875000f,(float16_t)0.5063476562500f, +(float16_t)0.8608398437500f,(float16_t)0.5087890625000f, +(float16_t)0.8593750000000f,(float16_t)0.5112304687500f, +(float16_t)0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)0.8559570312500f,(float16_t)0.5166015625000f, +(float16_t)0.8544921875000f,(float16_t)0.5195312500000f, +(float16_t)0.8530273437500f,(float16_t)0.5219726562500f, +(float16_t)0.8515625000000f,(float16_t)0.5244140625000f, +(float16_t)0.8496093750000f,(float16_t)0.5273437500000f, +(float16_t)0.8481445312500f,(float16_t)0.5297851562500f, +(float16_t)0.8466796875000f,(float16_t)0.5322265625000f, +(float16_t)0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)0.8432617187500f,(float16_t)0.5375976562500f, +(float16_t)0.8417968750000f,(float16_t)0.5400390625000f, +(float16_t)0.8398437500000f,(float16_t)0.5429687500000f, +(float16_t)0.8383789062500f,(float16_t)0.5454101562500f, +(float16_t)0.8364257812500f,(float16_t)0.5478515625000f, +(float16_t)0.8349609375000f,(float16_t)0.5502929687500f, +(float16_t)0.8330078125000f,(float16_t)0.5532226562500f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.8295898437500f,(float16_t)0.5581054687500f, +(float16_t)0.8281250000000f,(float16_t)0.5605468750000f, +(float16_t)0.8261718750000f,(float16_t)0.5629882812500f, +(float16_t)0.8247070312500f,(float16_t)0.5659179687500f, +(float16_t)0.8227539062500f,(float16_t)0.5683593750000f, +(float16_t)0.8212890625000f,(float16_t)0.5708007812500f, +(float16_t)0.8193359375000f,(float16_t)0.5732421875000f, +(float16_t)0.8173828125000f,(float16_t)0.5756835937500f, +(float16_t)0.8159179687500f,(float16_t)0.5781250000000f, +(float16_t)0.8139648437500f,(float16_t)0.5810546875000f, +(float16_t)0.8120117187500f,(float16_t)0.5834960937500f, +(float16_t)0.8105468750000f,(float16_t)0.5859375000000f, +(float16_t)0.8085937500000f,(float16_t)0.5883789062500f, +(float16_t)0.8066406250000f,(float16_t)0.5908203125000f, +(float16_t)0.8051757812500f,(float16_t)0.5932617187500f, +(float16_t)0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)0.8012695312500f,(float16_t)0.5981445312500f, +(float16_t)0.7993164062500f,(float16_t)0.6005859375000f, +(float16_t)0.7978515625000f,(float16_t)0.6030273437500f, +(float16_t)0.7958984375000f,(float16_t)0.6054687500000f, +(float16_t)0.7939453125000f,(float16_t)0.6079101562500f, +(float16_t)0.7919921875000f,(float16_t)0.6103515625000f, +(float16_t)0.7900390625000f,(float16_t)0.6127929687500f, +(float16_t)0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)0.7866210937500f,(float16_t)0.6176757812500f, +(float16_t)0.7846679687500f,(float16_t)0.6201171875000f, +(float16_t)0.7827148437500f,(float16_t)0.6225585937500f, +(float16_t)0.7807617187500f,(float16_t)0.6250000000000f, +(float16_t)0.7788085937500f,(float16_t)0.6274414062500f, +(float16_t)0.7768554687500f,(float16_t)0.6293945312500f, +(float16_t)0.7749023437500f,(float16_t)0.6318359375000f, +(float16_t)0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)0.7709960937500f,(float16_t)0.6367187500000f, +(float16_t)0.7690429687500f,(float16_t)0.6391601562500f, +(float16_t)0.7670898437500f,(float16_t)0.6416015625000f, +(float16_t)0.7651367187500f,(float16_t)0.6440429687500f, +(float16_t)0.7631835937500f,(float16_t)0.6459960937500f, +(float16_t)0.7612304687500f,(float16_t)0.6484375000000f, +(float16_t)0.7592773437500f,(float16_t)0.6508789062500f, +(float16_t)0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)0.7553710937500f,(float16_t)0.6552734375000f, +(float16_t)0.7534179687500f,(float16_t)0.6577148437500f, +(float16_t)0.7509765625000f,(float16_t)0.6601562500000f, +(float16_t)0.7490234375000f,(float16_t)0.6625976562500f, +(float16_t)0.7470703125000f,(float16_t)0.6645507812500f, +(float16_t)0.7451171875000f,(float16_t)0.6669921875000f, +(float16_t)0.7431640625000f,(float16_t)0.6694335937500f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.7387695312500f,(float16_t)0.6738281250000f, +(float16_t)0.7368164062500f,(float16_t)0.6762695312500f, +(float16_t)0.7348632812500f,(float16_t)0.6782226562500f, +(float16_t)0.7324218750000f,(float16_t)0.6806640625000f, +(float16_t)0.7304687500000f,(float16_t)0.6826171875000f, +(float16_t)0.7285156250000f,(float16_t)0.6850585937500f, +(float16_t)0.7265625000000f,(float16_t)0.6875000000000f, +(float16_t)0.7241210937500f,(float16_t)0.6894531250000f, +(float16_t)0.7221679687500f,(float16_t)0.6918945312500f, +(float16_t)0.7202148437500f,(float16_t)0.6938476562500f, +(float16_t)0.7177734375000f,(float16_t)0.6962890625000f, +(float16_t)0.7158203125000f,(float16_t)0.6982421875000f, +(float16_t)0.7133789062500f,(float16_t)0.7006835937500f, +(float16_t)0.7114257812500f,(float16_t)0.7026367187500f, +(float16_t)0.7094726562500f,(float16_t)0.7050781250000f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.7050781250000f,(float16_t)0.7094726562500f, +(float16_t)0.7026367187500f,(float16_t)0.7114257812500f, +(float16_t)0.7006835937500f,(float16_t)0.7133789062500f, +(float16_t)0.6982421875000f,(float16_t)0.7158203125000f, +(float16_t)0.6962890625000f,(float16_t)0.7177734375000f, +(float16_t)0.6938476562500f,(float16_t)0.7202148437500f, +(float16_t)0.6918945312500f,(float16_t)0.7221679687500f, +(float16_t)0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)0.6875000000000f,(float16_t)0.7265625000000f, +(float16_t)0.6850585937500f,(float16_t)0.7285156250000f, +(float16_t)0.6826171875000f,(float16_t)0.7304687500000f, +(float16_t)0.6806640625000f,(float16_t)0.7324218750000f, +(float16_t)0.6782226562500f,(float16_t)0.7348632812500f, +(float16_t)0.6762695312500f,(float16_t)0.7368164062500f, +(float16_t)0.6738281250000f,(float16_t)0.7387695312500f, +(float16_t)0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)0.6694335937500f,(float16_t)0.7431640625000f, +(float16_t)0.6669921875000f,(float16_t)0.7451171875000f, +(float16_t)0.6645507812500f,(float16_t)0.7470703125000f, +(float16_t)0.6625976562500f,(float16_t)0.7490234375000f, +(float16_t)0.6601562500000f,(float16_t)0.7509765625000f, +(float16_t)0.6577148437500f,(float16_t)0.7534179687500f, +(float16_t)0.6552734375000f,(float16_t)0.7553710937500f, +(float16_t)0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)0.6508789062500f,(float16_t)0.7592773437500f, +(float16_t)0.6484375000000f,(float16_t)0.7612304687500f, +(float16_t)0.6459960937500f,(float16_t)0.7631835937500f, +(float16_t)0.6440429687500f,(float16_t)0.7651367187500f, +(float16_t)0.6416015625000f,(float16_t)0.7670898437500f, +(float16_t)0.6391601562500f,(float16_t)0.7690429687500f, +(float16_t)0.6367187500000f,(float16_t)0.7709960937500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.6318359375000f,(float16_t)0.7749023437500f, +(float16_t)0.6293945312500f,(float16_t)0.7768554687500f, +(float16_t)0.6274414062500f,(float16_t)0.7788085937500f, +(float16_t)0.6250000000000f,(float16_t)0.7807617187500f, +(float16_t)0.6225585937500f,(float16_t)0.7827148437500f, +(float16_t)0.6201171875000f,(float16_t)0.7846679687500f, +(float16_t)0.6176757812500f,(float16_t)0.7866210937500f, +(float16_t)0.6152343750000f,(float16_t)0.7885742187500f, +(float16_t)0.6127929687500f,(float16_t)0.7900390625000f, +(float16_t)0.6103515625000f,(float16_t)0.7919921875000f, +(float16_t)0.6079101562500f,(float16_t)0.7939453125000f, +(float16_t)0.6054687500000f,(float16_t)0.7958984375000f, +(float16_t)0.6030273437500f,(float16_t)0.7978515625000f, +(float16_t)0.6005859375000f,(float16_t)0.7993164062500f, +(float16_t)0.5981445312500f,(float16_t)0.8012695312500f, +(float16_t)0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)0.5932617187500f,(float16_t)0.8051757812500f, +(float16_t)0.5908203125000f,(float16_t)0.8066406250000f, +(float16_t)0.5883789062500f,(float16_t)0.8085937500000f, +(float16_t)0.5859375000000f,(float16_t)0.8105468750000f, +(float16_t)0.5834960937500f,(float16_t)0.8120117187500f, +(float16_t)0.5810546875000f,(float16_t)0.8139648437500f, +(float16_t)0.5781250000000f,(float16_t)0.8159179687500f, +(float16_t)0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)0.5732421875000f,(float16_t)0.8193359375000f, +(float16_t)0.5708007812500f,(float16_t)0.8212890625000f, +(float16_t)0.5683593750000f,(float16_t)0.8227539062500f, +(float16_t)0.5659179687500f,(float16_t)0.8247070312500f, +(float16_t)0.5629882812500f,(float16_t)0.8261718750000f, +(float16_t)0.5605468750000f,(float16_t)0.8281250000000f, +(float16_t)0.5581054687500f,(float16_t)0.8295898437500f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.5532226562500f,(float16_t)0.8330078125000f, +(float16_t)0.5502929687500f,(float16_t)0.8349609375000f, +(float16_t)0.5478515625000f,(float16_t)0.8364257812500f, +(float16_t)0.5454101562500f,(float16_t)0.8383789062500f, +(float16_t)0.5429687500000f,(float16_t)0.8398437500000f, +(float16_t)0.5400390625000f,(float16_t)0.8417968750000f, +(float16_t)0.5375976562500f,(float16_t)0.8432617187500f, +(float16_t)0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)0.5322265625000f,(float16_t)0.8466796875000f, +(float16_t)0.5297851562500f,(float16_t)0.8481445312500f, +(float16_t)0.5273437500000f,(float16_t)0.8496093750000f, +(float16_t)0.5244140625000f,(float16_t)0.8515625000000f, +(float16_t)0.5219726562500f,(float16_t)0.8530273437500f, +(float16_t)0.5195312500000f,(float16_t)0.8544921875000f, +(float16_t)0.5166015625000f,(float16_t)0.8559570312500f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.5112304687500f,(float16_t)0.8593750000000f, +(float16_t)0.5087890625000f,(float16_t)0.8608398437500f, +(float16_t)0.5063476562500f,(float16_t)0.8623046875000f, +(float16_t)0.5034179687500f,(float16_t)0.8637695312500f, +(float16_t)0.5009765625000f,(float16_t)0.8657226562500f, +(float16_t)0.4982910156250f,(float16_t)0.8671875000000f, +(float16_t)0.4956054687500f,(float16_t)0.8686523437500f, +(float16_t)0.4929199218750f,(float16_t)0.8701171875000f, +(float16_t)0.4902343750000f,(float16_t)0.8715820312500f, +(float16_t)0.4875488281250f,(float16_t)0.8730468750000f, +(float16_t)0.4848632812500f,(float16_t)0.8745117187500f, +(float16_t)0.4821777343750f,(float16_t)0.8759765625000f, +(float16_t)0.4794921875000f,(float16_t)0.8774414062500f, +(float16_t)0.4768066406250f,(float16_t)0.8789062500000f, +(float16_t)0.4741210937500f,(float16_t)0.8803710937500f, +(float16_t)0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)0.4687500000000f,(float16_t)0.8833007812500f, +(float16_t)0.4660644531250f,(float16_t)0.8847656250000f, +(float16_t)0.4633789062500f,(float16_t)0.8862304687500f, +(float16_t)0.4604492187500f,(float16_t)0.8876953125000f, +(float16_t)0.4577636718750f,(float16_t)0.8891601562500f, +(float16_t)0.4550781250000f,(float16_t)0.8906250000000f, +(float16_t)0.4523925781250f,(float16_t)0.8916015625000f, +(float16_t)0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)0.4467773437500f,(float16_t)0.8945312500000f, +(float16_t)0.4440917968750f,(float16_t)0.8959960937500f, +(float16_t)0.4414062500000f,(float16_t)0.8974609375000f, +(float16_t)0.4387207031250f,(float16_t)0.8984375000000f, +(float16_t)0.4357910156250f,(float16_t)0.8999023437500f, +(float16_t)0.4331054687500f,(float16_t)0.9013671875000f, +(float16_t)0.4304199218750f,(float16_t)0.9028320312500f, +(float16_t)0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)0.4248046875000f,(float16_t)0.9052734375000f, +(float16_t)0.4221191406250f,(float16_t)0.9067382812500f, +(float16_t)0.4191894531250f,(float16_t)0.9077148437500f, +(float16_t)0.4165039062500f,(float16_t)0.9091796875000f, +(float16_t)0.4135742187500f,(float16_t)0.9106445312500f, +(float16_t)0.4108886718750f,(float16_t)0.9116210937500f, +(float16_t)0.4079589843750f,(float16_t)0.9130859375000f, +(float16_t)0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)0.4023437500000f,(float16_t)0.9155273437500f, +(float16_t)0.3996582031250f,(float16_t)0.9165039062500f, +(float16_t)0.3967285156250f,(float16_t)0.9179687500000f, +(float16_t)0.3940429687500f,(float16_t)0.9189453125000f, +(float16_t)0.3911132812500f,(float16_t)0.9204101562500f, +(float16_t)0.3884277343750f,(float16_t)0.9213867187500f, +(float16_t)0.3854980468750f,(float16_t)0.9228515625000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3798828125000f,(float16_t)0.9252929687500f, +(float16_t)0.3769531250000f,(float16_t)0.9262695312500f, +(float16_t)0.3742675781250f,(float16_t)0.9272460937500f, +(float16_t)0.3713378906250f,(float16_t)0.9287109375000f, +(float16_t)0.3684082031250f,(float16_t)0.9296875000000f, +(float16_t)0.3657226562500f,(float16_t)0.9306640625000f, +(float16_t)0.3627929687500f,(float16_t)0.9316406250000f, +(float16_t)0.3598632812500f,(float16_t)0.9331054687500f, +(float16_t)0.3569335937500f,(float16_t)0.9340820312500f, +(float16_t)0.3542480468750f,(float16_t)0.9350585937500f, +(float16_t)0.3513183593750f,(float16_t)0.9360351562500f, +(float16_t)0.3483886718750f,(float16_t)0.9375000000000f, +(float16_t)0.3454589843750f,(float16_t)0.9384765625000f, +(float16_t)0.3427734375000f,(float16_t)0.9394531250000f, +(float16_t)0.3398437500000f,(float16_t)0.9404296875000f, +(float16_t)0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)0.3339843750000f,(float16_t)0.9423828125000f, +(float16_t)0.3310546875000f,(float16_t)0.9433593750000f, +(float16_t)0.3281250000000f,(float16_t)0.9448242187500f, +(float16_t)0.3251953125000f,(float16_t)0.9458007812500f, +(float16_t)0.3225097656250f,(float16_t)0.9467773437500f, +(float16_t)0.3195800781250f,(float16_t)0.9477539062500f, +(float16_t)0.3166503906250f,(float16_t)0.9487304687500f, +(float16_t)0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)0.3107910156250f,(float16_t)0.9506835937500f, +(float16_t)0.3078613281250f,(float16_t)0.9516601562500f, +(float16_t)0.3049316406250f,(float16_t)0.9521484375000f, +(float16_t)0.3020019531250f,(float16_t)0.9531250000000f, +(float16_t)0.2990722656250f,(float16_t)0.9541015625000f, +(float16_t)0.2961425781250f,(float16_t)0.9550781250000f, +(float16_t)0.2932128906250f,(float16_t)0.9560546875000f, +(float16_t)0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)0.2873535156250f,(float16_t)0.9580078125000f, +(float16_t)0.2844238281250f,(float16_t)0.9584960937500f, +(float16_t)0.2814941406250f,(float16_t)0.9594726562500f, +(float16_t)0.2785644531250f,(float16_t)0.9604492187500f, +(float16_t)0.2756347656250f,(float16_t)0.9614257812500f, +(float16_t)0.2727050781250f,(float16_t)0.9619140625000f, +(float16_t)0.2697753906250f,(float16_t)0.9628906250000f, +(float16_t)0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)0.2636718750000f,(float16_t)0.9643554687500f, +(float16_t)0.2607421875000f,(float16_t)0.9653320312500f, +(float16_t)0.2578125000000f,(float16_t)0.9663085937500f, +(float16_t)0.2548828125000f,(float16_t)0.9667968750000f, +(float16_t)0.2519531250000f,(float16_t)0.9677734375000f, +(float16_t)0.2489013671875f,(float16_t)0.9687500000000f, +(float16_t)0.2459716796875f,(float16_t)0.9692382812500f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.2399902343750f,(float16_t)0.9707031250000f, +(float16_t)0.2370605468750f,(float16_t)0.9716796875000f, +(float16_t)0.2340087890625f,(float16_t)0.9721679687500f, +(float16_t)0.2310791015625f,(float16_t)0.9731445312500f, +(float16_t)0.2280273437500f,(float16_t)0.9736328125000f, +(float16_t)0.2250976562500f,(float16_t)0.9741210937500f, +(float16_t)0.2220458984375f,(float16_t)0.9750976562500f, +(float16_t)0.2191162109375f,(float16_t)0.9755859375000f, +(float16_t)0.2160644531250f,(float16_t)0.9765625000000f, +(float16_t)0.2131347656250f,(float16_t)0.9770507812500f, +(float16_t)0.2100830078125f,(float16_t)0.9775390625000f, +(float16_t)0.2071533203125f,(float16_t)0.9785156250000f, +(float16_t)0.2041015625000f,(float16_t)0.9790039062500f, +(float16_t)0.2010498046875f,(float16_t)0.9794921875000f, +(float16_t)0.1981201171875f,(float16_t)0.9799804687500f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.1921386718750f,(float16_t)0.9814453125000f, +(float16_t)0.1890869140625f,(float16_t)0.9819335937500f, +(float16_t)0.1860351562500f,(float16_t)0.9824218750000f, +(float16_t)0.1829833984375f,(float16_t)0.9829101562500f, +(float16_t)0.1800537109375f,(float16_t)0.9838867187500f, +(float16_t)0.1770019531250f,(float16_t)0.9843750000000f, +(float16_t)0.1739501953125f,(float16_t)0.9848632812500f, +(float16_t)0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)0.1679687500000f,(float16_t)0.9858398437500f, +(float16_t)0.1649169921875f,(float16_t)0.9863281250000f, +(float16_t)0.1618652343750f,(float16_t)0.9868164062500f, +(float16_t)0.1588134765625f,(float16_t)0.9873046875000f, +(float16_t)0.1558837890625f,(float16_t)0.9877929687500f, +(float16_t)0.1528320312500f,(float16_t)0.9882812500000f, +(float16_t)0.1497802734375f,(float16_t)0.9887695312500f, +(float16_t)0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)0.1436767578125f,(float16_t)0.9897460937500f, +(float16_t)0.1406250000000f,(float16_t)0.9902343750000f, +(float16_t)0.1375732421875f,(float16_t)0.9907226562500f, +(float16_t)0.1345214843750f,(float16_t)0.9907226562500f, +(float16_t)0.1315917968750f,(float16_t)0.9912109375000f, +(float16_t)0.1285400390625f,(float16_t)0.9916992187500f, +(float16_t)0.1254882812500f,(float16_t)0.9921875000000f, +(float16_t)0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)0.1193847656250f,(float16_t)0.9926757812500f, +(float16_t)0.1163330078125f,(float16_t)0.9931640625000f, +(float16_t)0.1132812500000f,(float16_t)0.9936523437500f, +(float16_t)0.1102294921875f,(float16_t)0.9941406250000f, +(float16_t)0.1071777343750f,(float16_t)0.9941406250000f, +(float16_t)0.1041259765625f,(float16_t)0.9946289062500f, +(float16_t)0.1010742187500f,(float16_t)0.9951171875000f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0949707031250f,(float16_t)0.9956054687500f, +(float16_t)0.0919189453125f,(float16_t)0.9956054687500f, +(float16_t)0.0888671875000f,(float16_t)0.9960937500000f, +(float16_t)0.0858154296875f,(float16_t)0.9960937500000f, +(float16_t)0.0827636718750f,(float16_t)0.9965820312500f, +(float16_t)0.0797119140625f,(float16_t)0.9965820312500f, +(float16_t)0.0765991210938f,(float16_t)0.9970703125000f, +(float16_t)0.0735473632812f,(float16_t)0.9970703125000f, +(float16_t)0.0704956054688f,(float16_t)0.9975585937500f, +(float16_t)0.0674438476562f,(float16_t)0.9975585937500f, +(float16_t)0.0643920898438f,(float16_t)0.9980468750000f, +(float16_t)0.0613098144531f,(float16_t)0.9980468750000f, +(float16_t)0.0582580566406f,(float16_t)0.9985351562500f, +(float16_t)0.0552062988281f,(float16_t)0.9985351562500f, +(float16_t)0.0521240234375f,(float16_t)0.9985351562500f, +(float16_t)0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)0.0459899902344f,(float16_t)0.9990234375000f, +(float16_t)0.0429382324219f,(float16_t)0.9990234375000f, +(float16_t)0.0398864746094f,(float16_t)0.9990234375000f, +(float16_t)0.0368041992188f,(float16_t)0.9995117187500f, +(float16_t)0.0337524414062f,(float16_t)0.9995117187500f, +(float16_t)0.0306701660156f,(float16_t)0.9995117187500f, +(float16_t)0.0276031494141f,(float16_t)0.9995117187500f, +(float16_t)0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)0.0214691162109f,(float16_t)1.0000000000000f, +(float16_t)0.0184020996094f,(float16_t)1.0000000000000f, +(float16_t)0.0153427124023f,(float16_t)1.0000000000000f, +(float16_t)0.0122680664062f,(float16_t)1.0000000000000f, +(float16_t)0.0092010498047f,(float16_t)1.0000000000000f, +(float16_t)0.0061340332031f,(float16_t)1.0000000000000f, +(float16_t)0.0030670166016f,(float16_t)1.0000000000000f, +(float16_t)0.0000000000000f,(float16_t)1.0000000000000f, +(float16_t)-0.0030670166016f,(float16_t)1.0000000000000f, +(float16_t)-0.0061340332031f,(float16_t)1.0000000000000f, +(float16_t)-0.0092010498047f,(float16_t)1.0000000000000f, +(float16_t)-0.0122680664062f,(float16_t)1.0000000000000f, +(float16_t)-0.0153427124023f,(float16_t)1.0000000000000f, +(float16_t)-0.0184020996094f,(float16_t)1.0000000000000f, +(float16_t)-0.0214691162109f,(float16_t)1.0000000000000f, +(float16_t)-0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)-0.0276031494141f,(float16_t)0.9995117187500f, +(float16_t)-0.0306701660156f,(float16_t)0.9995117187500f, +(float16_t)-0.0337524414062f,(float16_t)0.9995117187500f, +(float16_t)-0.0368041992188f,(float16_t)0.9995117187500f, +(float16_t)-0.0398864746094f,(float16_t)0.9990234375000f, +(float16_t)-0.0429382324219f,(float16_t)0.9990234375000f, +(float16_t)-0.0459899902344f,(float16_t)0.9990234375000f, +(float16_t)-0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)-0.0521240234375f,(float16_t)0.9985351562500f, +(float16_t)-0.0552062988281f,(float16_t)0.9985351562500f, +(float16_t)-0.0582580566406f,(float16_t)0.9985351562500f, +(float16_t)-0.0613098144531f,(float16_t)0.9980468750000f, +(float16_t)-0.0643920898438f,(float16_t)0.9980468750000f, +(float16_t)-0.0674438476562f,(float16_t)0.9975585937500f, +(float16_t)-0.0704956054688f,(float16_t)0.9975585937500f, +(float16_t)-0.0735473632812f,(float16_t)0.9970703125000f, +(float16_t)-0.0765991210938f,(float16_t)0.9970703125000f, +(float16_t)-0.0797119140625f,(float16_t)0.9965820312500f, +(float16_t)-0.0827636718750f,(float16_t)0.9965820312500f, +(float16_t)-0.0858154296875f,(float16_t)0.9960937500000f, +(float16_t)-0.0888671875000f,(float16_t)0.9960937500000f, +(float16_t)-0.0919189453125f,(float16_t)0.9956054687500f, +(float16_t)-0.0949707031250f,(float16_t)0.9956054687500f, +(float16_t)-0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)-0.1010742187500f,(float16_t)0.9951171875000f, +(float16_t)-0.1041259765625f,(float16_t)0.9946289062500f, +(float16_t)-0.1071777343750f,(float16_t)0.9941406250000f, +(float16_t)-0.1102294921875f,(float16_t)0.9941406250000f, +(float16_t)-0.1132812500000f,(float16_t)0.9936523437500f, +(float16_t)-0.1163330078125f,(float16_t)0.9931640625000f, +(float16_t)-0.1193847656250f,(float16_t)0.9926757812500f, +(float16_t)-0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)-0.1254882812500f,(float16_t)0.9921875000000f, +(float16_t)-0.1285400390625f,(float16_t)0.9916992187500f, +(float16_t)-0.1315917968750f,(float16_t)0.9912109375000f, +(float16_t)-0.1345214843750f,(float16_t)0.9907226562500f, +(float16_t)-0.1375732421875f,(float16_t)0.9907226562500f, +(float16_t)-0.1406250000000f,(float16_t)0.9902343750000f, +(float16_t)-0.1436767578125f,(float16_t)0.9897460937500f, +(float16_t)-0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)-0.1497802734375f,(float16_t)0.9887695312500f, +(float16_t)-0.1528320312500f,(float16_t)0.9882812500000f, +(float16_t)-0.1558837890625f,(float16_t)0.9877929687500f, +(float16_t)-0.1588134765625f,(float16_t)0.9873046875000f, +(float16_t)-0.1618652343750f,(float16_t)0.9868164062500f, +(float16_t)-0.1649169921875f,(float16_t)0.9863281250000f, +(float16_t)-0.1679687500000f,(float16_t)0.9858398437500f, +(float16_t)-0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)-0.1739501953125f,(float16_t)0.9848632812500f, +(float16_t)-0.1770019531250f,(float16_t)0.9843750000000f, +(float16_t)-0.1800537109375f,(float16_t)0.9838867187500f, +(float16_t)-0.1829833984375f,(float16_t)0.9829101562500f, +(float16_t)-0.1860351562500f,(float16_t)0.9824218750000f, +(float16_t)-0.1890869140625f,(float16_t)0.9819335937500f, +(float16_t)-0.1921386718750f,(float16_t)0.9814453125000f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.1981201171875f,(float16_t)0.9799804687500f, +(float16_t)-0.2010498046875f,(float16_t)0.9794921875000f, +(float16_t)-0.2041015625000f,(float16_t)0.9790039062500f, +(float16_t)-0.2071533203125f,(float16_t)0.9785156250000f, +(float16_t)-0.2100830078125f,(float16_t)0.9775390625000f, +(float16_t)-0.2131347656250f,(float16_t)0.9770507812500f, +(float16_t)-0.2160644531250f,(float16_t)0.9765625000000f, +(float16_t)-0.2191162109375f,(float16_t)0.9755859375000f, +(float16_t)-0.2220458984375f,(float16_t)0.9750976562500f, +(float16_t)-0.2250976562500f,(float16_t)0.9741210937500f, +(float16_t)-0.2280273437500f,(float16_t)0.9736328125000f, +(float16_t)-0.2310791015625f,(float16_t)0.9731445312500f, +(float16_t)-0.2340087890625f,(float16_t)0.9721679687500f, +(float16_t)-0.2370605468750f,(float16_t)0.9716796875000f, +(float16_t)-0.2399902343750f,(float16_t)0.9707031250000f, +(float16_t)-0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)-0.2459716796875f,(float16_t)0.9692382812500f, +(float16_t)-0.2489013671875f,(float16_t)0.9687500000000f, +(float16_t)-0.2519531250000f,(float16_t)0.9677734375000f, +(float16_t)-0.2548828125000f,(float16_t)0.9667968750000f, +(float16_t)-0.2578125000000f,(float16_t)0.9663085937500f, +(float16_t)-0.2607421875000f,(float16_t)0.9653320312500f, +(float16_t)-0.2636718750000f,(float16_t)0.9643554687500f, +(float16_t)-0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)-0.2697753906250f,(float16_t)0.9628906250000f, +(float16_t)-0.2727050781250f,(float16_t)0.9619140625000f, +(float16_t)-0.2756347656250f,(float16_t)0.9614257812500f, +(float16_t)-0.2785644531250f,(float16_t)0.9604492187500f, +(float16_t)-0.2814941406250f,(float16_t)0.9594726562500f, +(float16_t)-0.2844238281250f,(float16_t)0.9584960937500f, +(float16_t)-0.2873535156250f,(float16_t)0.9580078125000f, +(float16_t)-0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)-0.2932128906250f,(float16_t)0.9560546875000f, +(float16_t)-0.2961425781250f,(float16_t)0.9550781250000f, +(float16_t)-0.2990722656250f,(float16_t)0.9541015625000f, +(float16_t)-0.3020019531250f,(float16_t)0.9531250000000f, +(float16_t)-0.3049316406250f,(float16_t)0.9521484375000f, +(float16_t)-0.3078613281250f,(float16_t)0.9516601562500f, +(float16_t)-0.3107910156250f,(float16_t)0.9506835937500f, +(float16_t)-0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)-0.3166503906250f,(float16_t)0.9487304687500f, +(float16_t)-0.3195800781250f,(float16_t)0.9477539062500f, +(float16_t)-0.3225097656250f,(float16_t)0.9467773437500f, +(float16_t)-0.3251953125000f,(float16_t)0.9458007812500f, +(float16_t)-0.3281250000000f,(float16_t)0.9448242187500f, +(float16_t)-0.3310546875000f,(float16_t)0.9433593750000f, +(float16_t)-0.3339843750000f,(float16_t)0.9423828125000f, +(float16_t)-0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)-0.3398437500000f,(float16_t)0.9404296875000f, +(float16_t)-0.3427734375000f,(float16_t)0.9394531250000f, +(float16_t)-0.3454589843750f,(float16_t)0.9384765625000f, +(float16_t)-0.3483886718750f,(float16_t)0.9375000000000f, +(float16_t)-0.3513183593750f,(float16_t)0.9360351562500f, +(float16_t)-0.3542480468750f,(float16_t)0.9350585937500f, +(float16_t)-0.3569335937500f,(float16_t)0.9340820312500f, +(float16_t)-0.3598632812500f,(float16_t)0.9331054687500f, +(float16_t)-0.3627929687500f,(float16_t)0.9316406250000f, +(float16_t)-0.3657226562500f,(float16_t)0.9306640625000f, +(float16_t)-0.3684082031250f,(float16_t)0.9296875000000f, +(float16_t)-0.3713378906250f,(float16_t)0.9287109375000f, +(float16_t)-0.3742675781250f,(float16_t)0.9272460937500f, +(float16_t)-0.3769531250000f,(float16_t)0.9262695312500f, +(float16_t)-0.3798828125000f,(float16_t)0.9252929687500f, +(float16_t)-0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)-0.3854980468750f,(float16_t)0.9228515625000f, +(float16_t)-0.3884277343750f,(float16_t)0.9213867187500f, +(float16_t)-0.3911132812500f,(float16_t)0.9204101562500f, +(float16_t)-0.3940429687500f,(float16_t)0.9189453125000f, +(float16_t)-0.3967285156250f,(float16_t)0.9179687500000f, +(float16_t)-0.3996582031250f,(float16_t)0.9165039062500f, +(float16_t)-0.4023437500000f,(float16_t)0.9155273437500f, +(float16_t)-0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)-0.4079589843750f,(float16_t)0.9130859375000f, +(float16_t)-0.4108886718750f,(float16_t)0.9116210937500f, +(float16_t)-0.4135742187500f,(float16_t)0.9106445312500f, +(float16_t)-0.4165039062500f,(float16_t)0.9091796875000f, +(float16_t)-0.4191894531250f,(float16_t)0.9077148437500f, +(float16_t)-0.4221191406250f,(float16_t)0.9067382812500f, +(float16_t)-0.4248046875000f,(float16_t)0.9052734375000f, +(float16_t)-0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)-0.4304199218750f,(float16_t)0.9028320312500f, +(float16_t)-0.4331054687500f,(float16_t)0.9013671875000f, +(float16_t)-0.4357910156250f,(float16_t)0.8999023437500f, +(float16_t)-0.4387207031250f,(float16_t)0.8984375000000f, +(float16_t)-0.4414062500000f,(float16_t)0.8974609375000f, +(float16_t)-0.4440917968750f,(float16_t)0.8959960937500f, +(float16_t)-0.4467773437500f,(float16_t)0.8945312500000f, +(float16_t)-0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)-0.4523925781250f,(float16_t)0.8916015625000f, +(float16_t)-0.4550781250000f,(float16_t)0.8906250000000f, +(float16_t)-0.4577636718750f,(float16_t)0.8891601562500f, +(float16_t)-0.4604492187500f,(float16_t)0.8876953125000f, +(float16_t)-0.4633789062500f,(float16_t)0.8862304687500f, +(float16_t)-0.4660644531250f,(float16_t)0.8847656250000f, +(float16_t)-0.4687500000000f,(float16_t)0.8833007812500f, +(float16_t)-0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)-0.4741210937500f,(float16_t)0.8803710937500f, +(float16_t)-0.4768066406250f,(float16_t)0.8789062500000f, +(float16_t)-0.4794921875000f,(float16_t)0.8774414062500f, +(float16_t)-0.4821777343750f,(float16_t)0.8759765625000f, +(float16_t)-0.4848632812500f,(float16_t)0.8745117187500f, +(float16_t)-0.4875488281250f,(float16_t)0.8730468750000f, +(float16_t)-0.4902343750000f,(float16_t)0.8715820312500f, +(float16_t)-0.4929199218750f,(float16_t)0.8701171875000f, +(float16_t)-0.4956054687500f,(float16_t)0.8686523437500f, +(float16_t)-0.4982910156250f,(float16_t)0.8671875000000f, +(float16_t)-0.5009765625000f,(float16_t)0.8657226562500f, +(float16_t)-0.5034179687500f,(float16_t)0.8637695312500f, +(float16_t)-0.5063476562500f,(float16_t)0.8623046875000f, +(float16_t)-0.5087890625000f,(float16_t)0.8608398437500f, +(float16_t)-0.5112304687500f,(float16_t)0.8593750000000f, +(float16_t)-0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)-0.5166015625000f,(float16_t)0.8559570312500f, +(float16_t)-0.5195312500000f,(float16_t)0.8544921875000f, +(float16_t)-0.5219726562500f,(float16_t)0.8530273437500f, +(float16_t)-0.5244140625000f,(float16_t)0.8515625000000f, +(float16_t)-0.5273437500000f,(float16_t)0.8496093750000f, +(float16_t)-0.5297851562500f,(float16_t)0.8481445312500f, +(float16_t)-0.5322265625000f,(float16_t)0.8466796875000f, +(float16_t)-0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)-0.5375976562500f,(float16_t)0.8432617187500f, +(float16_t)-0.5400390625000f,(float16_t)0.8417968750000f, +(float16_t)-0.5429687500000f,(float16_t)0.8398437500000f, +(float16_t)-0.5454101562500f,(float16_t)0.8383789062500f, +(float16_t)-0.5478515625000f,(float16_t)0.8364257812500f, +(float16_t)-0.5502929687500f,(float16_t)0.8349609375000f, +(float16_t)-0.5532226562500f,(float16_t)0.8330078125000f, +(float16_t)-0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)-0.5581054687500f,(float16_t)0.8295898437500f, +(float16_t)-0.5605468750000f,(float16_t)0.8281250000000f, +(float16_t)-0.5629882812500f,(float16_t)0.8261718750000f, +(float16_t)-0.5659179687500f,(float16_t)0.8247070312500f, +(float16_t)-0.5683593750000f,(float16_t)0.8227539062500f, +(float16_t)-0.5708007812500f,(float16_t)0.8212890625000f, +(float16_t)-0.5732421875000f,(float16_t)0.8193359375000f, +(float16_t)-0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)-0.5781250000000f,(float16_t)0.8159179687500f, +(float16_t)-0.5810546875000f,(float16_t)0.8139648437500f, +(float16_t)-0.5834960937500f,(float16_t)0.8120117187500f, +(float16_t)-0.5859375000000f,(float16_t)0.8105468750000f, +(float16_t)-0.5883789062500f,(float16_t)0.8085937500000f, +(float16_t)-0.5908203125000f,(float16_t)0.8066406250000f, +(float16_t)-0.5932617187500f,(float16_t)0.8051757812500f, +(float16_t)-0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)-0.5981445312500f,(float16_t)0.8012695312500f, +(float16_t)-0.6005859375000f,(float16_t)0.7993164062500f, +(float16_t)-0.6030273437500f,(float16_t)0.7978515625000f, +(float16_t)-0.6054687500000f,(float16_t)0.7958984375000f, +(float16_t)-0.6079101562500f,(float16_t)0.7939453125000f, +(float16_t)-0.6103515625000f,(float16_t)0.7919921875000f, +(float16_t)-0.6127929687500f,(float16_t)0.7900390625000f, +(float16_t)-0.6152343750000f,(float16_t)0.7885742187500f, +(float16_t)-0.6176757812500f,(float16_t)0.7866210937500f, +(float16_t)-0.6201171875000f,(float16_t)0.7846679687500f, +(float16_t)-0.6225585937500f,(float16_t)0.7827148437500f, +(float16_t)-0.6250000000000f,(float16_t)0.7807617187500f, +(float16_t)-0.6274414062500f,(float16_t)0.7788085937500f, +(float16_t)-0.6293945312500f,(float16_t)0.7768554687500f, +(float16_t)-0.6318359375000f,(float16_t)0.7749023437500f, +(float16_t)-0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)-0.6367187500000f,(float16_t)0.7709960937500f, +(float16_t)-0.6391601562500f,(float16_t)0.7690429687500f, +(float16_t)-0.6416015625000f,(float16_t)0.7670898437500f, +(float16_t)-0.6440429687500f,(float16_t)0.7651367187500f, +(float16_t)-0.6459960937500f,(float16_t)0.7631835937500f, +(float16_t)-0.6484375000000f,(float16_t)0.7612304687500f, +(float16_t)-0.6508789062500f,(float16_t)0.7592773437500f, +(float16_t)-0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)-0.6552734375000f,(float16_t)0.7553710937500f, +(float16_t)-0.6577148437500f,(float16_t)0.7534179687500f, +(float16_t)-0.6601562500000f,(float16_t)0.7509765625000f, +(float16_t)-0.6625976562500f,(float16_t)0.7490234375000f, +(float16_t)-0.6645507812500f,(float16_t)0.7470703125000f, +(float16_t)-0.6669921875000f,(float16_t)0.7451171875000f, +(float16_t)-0.6694335937500f,(float16_t)0.7431640625000f, +(float16_t)-0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)-0.6738281250000f,(float16_t)0.7387695312500f, +(float16_t)-0.6762695312500f,(float16_t)0.7368164062500f, +(float16_t)-0.6782226562500f,(float16_t)0.7348632812500f, +(float16_t)-0.6806640625000f,(float16_t)0.7324218750000f, +(float16_t)-0.6826171875000f,(float16_t)0.7304687500000f, +(float16_t)-0.6850585937500f,(float16_t)0.7285156250000f, +(float16_t)-0.6875000000000f,(float16_t)0.7265625000000f, +(float16_t)-0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)-0.6918945312500f,(float16_t)0.7221679687500f, +(float16_t)-0.6938476562500f,(float16_t)0.7202148437500f, +(float16_t)-0.6962890625000f,(float16_t)0.7177734375000f, +(float16_t)-0.6982421875000f,(float16_t)0.7158203125000f, +(float16_t)-0.7006835937500f,(float16_t)0.7133789062500f, +(float16_t)-0.7026367187500f,(float16_t)0.7114257812500f, +(float16_t)-0.7050781250000f,(float16_t)0.7094726562500f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.7094726562500f,(float16_t)0.7050781250000f, +(float16_t)-0.7114257812500f,(float16_t)0.7026367187500f, +(float16_t)-0.7133789062500f,(float16_t)0.7006835937500f, +(float16_t)-0.7158203125000f,(float16_t)0.6982421875000f, +(float16_t)-0.7177734375000f,(float16_t)0.6962890625000f, +(float16_t)-0.7202148437500f,(float16_t)0.6938476562500f, +(float16_t)-0.7221679687500f,(float16_t)0.6918945312500f, +(float16_t)-0.7241210937500f,(float16_t)0.6894531250000f, +(float16_t)-0.7265625000000f,(float16_t)0.6875000000000f, +(float16_t)-0.7285156250000f,(float16_t)0.6850585937500f, +(float16_t)-0.7304687500000f,(float16_t)0.6826171875000f, +(float16_t)-0.7324218750000f,(float16_t)0.6806640625000f, +(float16_t)-0.7348632812500f,(float16_t)0.6782226562500f, +(float16_t)-0.7368164062500f,(float16_t)0.6762695312500f, +(float16_t)-0.7387695312500f,(float16_t)0.6738281250000f, +(float16_t)-0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)-0.7431640625000f,(float16_t)0.6694335937500f, +(float16_t)-0.7451171875000f,(float16_t)0.6669921875000f, +(float16_t)-0.7470703125000f,(float16_t)0.6645507812500f, +(float16_t)-0.7490234375000f,(float16_t)0.6625976562500f, +(float16_t)-0.7509765625000f,(float16_t)0.6601562500000f, +(float16_t)-0.7534179687500f,(float16_t)0.6577148437500f, +(float16_t)-0.7553710937500f,(float16_t)0.6552734375000f, +(float16_t)-0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)-0.7592773437500f,(float16_t)0.6508789062500f, +(float16_t)-0.7612304687500f,(float16_t)0.6484375000000f, +(float16_t)-0.7631835937500f,(float16_t)0.6459960937500f, +(float16_t)-0.7651367187500f,(float16_t)0.6440429687500f, +(float16_t)-0.7670898437500f,(float16_t)0.6416015625000f, +(float16_t)-0.7690429687500f,(float16_t)0.6391601562500f, +(float16_t)-0.7709960937500f,(float16_t)0.6367187500000f, +(float16_t)-0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)-0.7749023437500f,(float16_t)0.6318359375000f, +(float16_t)-0.7768554687500f,(float16_t)0.6293945312500f, +(float16_t)-0.7788085937500f,(float16_t)0.6274414062500f, +(float16_t)-0.7807617187500f,(float16_t)0.6250000000000f, +(float16_t)-0.7827148437500f,(float16_t)0.6225585937500f, +(float16_t)-0.7846679687500f,(float16_t)0.6201171875000f, +(float16_t)-0.7866210937500f,(float16_t)0.6176757812500f, +(float16_t)-0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)-0.7900390625000f,(float16_t)0.6127929687500f, +(float16_t)-0.7919921875000f,(float16_t)0.6103515625000f, +(float16_t)-0.7939453125000f,(float16_t)0.6079101562500f, +(float16_t)-0.7958984375000f,(float16_t)0.6054687500000f, +(float16_t)-0.7978515625000f,(float16_t)0.6030273437500f, +(float16_t)-0.7993164062500f,(float16_t)0.6005859375000f, +(float16_t)-0.8012695312500f,(float16_t)0.5981445312500f, +(float16_t)-0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)-0.8051757812500f,(float16_t)0.5932617187500f, +(float16_t)-0.8066406250000f,(float16_t)0.5908203125000f, +(float16_t)-0.8085937500000f,(float16_t)0.5883789062500f, +(float16_t)-0.8105468750000f,(float16_t)0.5859375000000f, +(float16_t)-0.8120117187500f,(float16_t)0.5834960937500f, +(float16_t)-0.8139648437500f,(float16_t)0.5810546875000f, +(float16_t)-0.8159179687500f,(float16_t)0.5781250000000f, +(float16_t)-0.8173828125000f,(float16_t)0.5756835937500f, +(float16_t)-0.8193359375000f,(float16_t)0.5732421875000f, +(float16_t)-0.8212890625000f,(float16_t)0.5708007812500f, +(float16_t)-0.8227539062500f,(float16_t)0.5683593750000f, +(float16_t)-0.8247070312500f,(float16_t)0.5659179687500f, +(float16_t)-0.8261718750000f,(float16_t)0.5629882812500f, +(float16_t)-0.8281250000000f,(float16_t)0.5605468750000f, +(float16_t)-0.8295898437500f,(float16_t)0.5581054687500f, +(float16_t)-0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)-0.8330078125000f,(float16_t)0.5532226562500f, +(float16_t)-0.8349609375000f,(float16_t)0.5502929687500f, +(float16_t)-0.8364257812500f,(float16_t)0.5478515625000f, +(float16_t)-0.8383789062500f,(float16_t)0.5454101562500f, +(float16_t)-0.8398437500000f,(float16_t)0.5429687500000f, +(float16_t)-0.8417968750000f,(float16_t)0.5400390625000f, +(float16_t)-0.8432617187500f,(float16_t)0.5375976562500f, +(float16_t)-0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)-0.8466796875000f,(float16_t)0.5322265625000f, +(float16_t)-0.8481445312500f,(float16_t)0.5297851562500f, +(float16_t)-0.8496093750000f,(float16_t)0.5273437500000f, +(float16_t)-0.8515625000000f,(float16_t)0.5244140625000f, +(float16_t)-0.8530273437500f,(float16_t)0.5219726562500f, +(float16_t)-0.8544921875000f,(float16_t)0.5195312500000f, +(float16_t)-0.8559570312500f,(float16_t)0.5166015625000f, +(float16_t)-0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)-0.8593750000000f,(float16_t)0.5112304687500f, +(float16_t)-0.8608398437500f,(float16_t)0.5087890625000f, +(float16_t)-0.8623046875000f,(float16_t)0.5063476562500f, +(float16_t)-0.8637695312500f,(float16_t)0.5034179687500f, +(float16_t)-0.8657226562500f,(float16_t)0.5009765625000f, +(float16_t)-0.8671875000000f,(float16_t)0.4982910156250f, +(float16_t)-0.8686523437500f,(float16_t)0.4956054687500f, +(float16_t)-0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)-0.8715820312500f,(float16_t)0.4902343750000f, +(float16_t)-0.8730468750000f,(float16_t)0.4875488281250f, +(float16_t)-0.8745117187500f,(float16_t)0.4848632812500f, +(float16_t)-0.8759765625000f,(float16_t)0.4821777343750f, +(float16_t)-0.8774414062500f,(float16_t)0.4794921875000f, +(float16_t)-0.8789062500000f,(float16_t)0.4768066406250f, +(float16_t)-0.8803710937500f,(float16_t)0.4741210937500f, +(float16_t)-0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)-0.8833007812500f,(float16_t)0.4687500000000f, +(float16_t)-0.8847656250000f,(float16_t)0.4660644531250f, +(float16_t)-0.8862304687500f,(float16_t)0.4633789062500f, +(float16_t)-0.8876953125000f,(float16_t)0.4604492187500f, +(float16_t)-0.8891601562500f,(float16_t)0.4577636718750f, +(float16_t)-0.8906250000000f,(float16_t)0.4550781250000f, +(float16_t)-0.8916015625000f,(float16_t)0.4523925781250f, +(float16_t)-0.8930664062500f,(float16_t)0.4497070312500f, +(float16_t)-0.8945312500000f,(float16_t)0.4467773437500f, +(float16_t)-0.8959960937500f,(float16_t)0.4440917968750f, +(float16_t)-0.8974609375000f,(float16_t)0.4414062500000f, +(float16_t)-0.8984375000000f,(float16_t)0.4387207031250f, +(float16_t)-0.8999023437500f,(float16_t)0.4357910156250f, +(float16_t)-0.9013671875000f,(float16_t)0.4331054687500f, +(float16_t)-0.9028320312500f,(float16_t)0.4304199218750f, +(float16_t)-0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)-0.9052734375000f,(float16_t)0.4248046875000f, +(float16_t)-0.9067382812500f,(float16_t)0.4221191406250f, +(float16_t)-0.9077148437500f,(float16_t)0.4191894531250f, +(float16_t)-0.9091796875000f,(float16_t)0.4165039062500f, +(float16_t)-0.9106445312500f,(float16_t)0.4135742187500f, +(float16_t)-0.9116210937500f,(float16_t)0.4108886718750f, +(float16_t)-0.9130859375000f,(float16_t)0.4079589843750f, +(float16_t)-0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)-0.9155273437500f,(float16_t)0.4023437500000f, +(float16_t)-0.9165039062500f,(float16_t)0.3996582031250f, +(float16_t)-0.9179687500000f,(float16_t)0.3967285156250f, +(float16_t)-0.9189453125000f,(float16_t)0.3940429687500f, +(float16_t)-0.9204101562500f,(float16_t)0.3911132812500f, +(float16_t)-0.9213867187500f,(float16_t)0.3884277343750f, +(float16_t)-0.9228515625000f,(float16_t)0.3854980468750f, +(float16_t)-0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)-0.9252929687500f,(float16_t)0.3798828125000f, +(float16_t)-0.9262695312500f,(float16_t)0.3769531250000f, +(float16_t)-0.9272460937500f,(float16_t)0.3742675781250f, +(float16_t)-0.9287109375000f,(float16_t)0.3713378906250f, +(float16_t)-0.9296875000000f,(float16_t)0.3684082031250f, +(float16_t)-0.9306640625000f,(float16_t)0.3657226562500f, +(float16_t)-0.9316406250000f,(float16_t)0.3627929687500f, +(float16_t)-0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)-0.9340820312500f,(float16_t)0.3569335937500f, +(float16_t)-0.9350585937500f,(float16_t)0.3542480468750f, +(float16_t)-0.9360351562500f,(float16_t)0.3513183593750f, +(float16_t)-0.9375000000000f,(float16_t)0.3483886718750f, +(float16_t)-0.9384765625000f,(float16_t)0.3454589843750f, +(float16_t)-0.9394531250000f,(float16_t)0.3427734375000f, +(float16_t)-0.9404296875000f,(float16_t)0.3398437500000f, +(float16_t)-0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)-0.9423828125000f,(float16_t)0.3339843750000f, +(float16_t)-0.9433593750000f,(float16_t)0.3310546875000f, +(float16_t)-0.9448242187500f,(float16_t)0.3281250000000f, +(float16_t)-0.9458007812500f,(float16_t)0.3251953125000f, +(float16_t)-0.9467773437500f,(float16_t)0.3225097656250f, +(float16_t)-0.9477539062500f,(float16_t)0.3195800781250f, +(float16_t)-0.9487304687500f,(float16_t)0.3166503906250f, +(float16_t)-0.9497070312500f,(float16_t)0.3137207031250f, +(float16_t)-0.9506835937500f,(float16_t)0.3107910156250f, +(float16_t)-0.9516601562500f,(float16_t)0.3078613281250f, +(float16_t)-0.9521484375000f,(float16_t)0.3049316406250f, +(float16_t)-0.9531250000000f,(float16_t)0.3020019531250f, +(float16_t)-0.9541015625000f,(float16_t)0.2990722656250f, +(float16_t)-0.9550781250000f,(float16_t)0.2961425781250f, +(float16_t)-0.9560546875000f,(float16_t)0.2932128906250f, +(float16_t)-0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)-0.9580078125000f,(float16_t)0.2873535156250f, +(float16_t)-0.9584960937500f,(float16_t)0.2844238281250f, +(float16_t)-0.9594726562500f,(float16_t)0.2814941406250f, +(float16_t)-0.9604492187500f,(float16_t)0.2785644531250f, +(float16_t)-0.9614257812500f,(float16_t)0.2756347656250f, +(float16_t)-0.9619140625000f,(float16_t)0.2727050781250f, +(float16_t)-0.9628906250000f,(float16_t)0.2697753906250f, +(float16_t)-0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)-0.9643554687500f,(float16_t)0.2636718750000f, +(float16_t)-0.9653320312500f,(float16_t)0.2607421875000f, +(float16_t)-0.9663085937500f,(float16_t)0.2578125000000f, +(float16_t)-0.9667968750000f,(float16_t)0.2548828125000f, +(float16_t)-0.9677734375000f,(float16_t)0.2519531250000f, +(float16_t)-0.9687500000000f,(float16_t)0.2489013671875f, +(float16_t)-0.9692382812500f,(float16_t)0.2459716796875f, +(float16_t)-0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)-0.9707031250000f,(float16_t)0.2399902343750f, +(float16_t)-0.9716796875000f,(float16_t)0.2370605468750f, +(float16_t)-0.9721679687500f,(float16_t)0.2340087890625f, +(float16_t)-0.9731445312500f,(float16_t)0.2310791015625f, +(float16_t)-0.9736328125000f,(float16_t)0.2280273437500f, +(float16_t)-0.9741210937500f,(float16_t)0.2250976562500f, +(float16_t)-0.9750976562500f,(float16_t)0.2220458984375f, +(float16_t)-0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)-0.9765625000000f,(float16_t)0.2160644531250f, +(float16_t)-0.9770507812500f,(float16_t)0.2131347656250f, +(float16_t)-0.9775390625000f,(float16_t)0.2100830078125f, +(float16_t)-0.9785156250000f,(float16_t)0.2071533203125f, +(float16_t)-0.9790039062500f,(float16_t)0.2041015625000f, +(float16_t)-0.9794921875000f,(float16_t)0.2010498046875f, +(float16_t)-0.9799804687500f,(float16_t)0.1981201171875f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)-0.9814453125000f,(float16_t)0.1921386718750f, +(float16_t)-0.9819335937500f,(float16_t)0.1890869140625f, +(float16_t)-0.9824218750000f,(float16_t)0.1860351562500f, +(float16_t)-0.9829101562500f,(float16_t)0.1829833984375f, +(float16_t)-0.9838867187500f,(float16_t)0.1800537109375f, +(float16_t)-0.9843750000000f,(float16_t)0.1770019531250f, +(float16_t)-0.9848632812500f,(float16_t)0.1739501953125f, +(float16_t)-0.9853515625000f,(float16_t)0.1710205078125f, +(float16_t)-0.9858398437500f,(float16_t)0.1679687500000f, +(float16_t)-0.9863281250000f,(float16_t)0.1649169921875f, +(float16_t)-0.9868164062500f,(float16_t)0.1618652343750f, +(float16_t)-0.9873046875000f,(float16_t)0.1588134765625f, +(float16_t)-0.9877929687500f,(float16_t)0.1558837890625f, +(float16_t)-0.9882812500000f,(float16_t)0.1528320312500f, +(float16_t)-0.9887695312500f,(float16_t)0.1497802734375f, +(float16_t)-0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)-0.9897460937500f,(float16_t)0.1436767578125f, +(float16_t)-0.9902343750000f,(float16_t)0.1406250000000f, +(float16_t)-0.9907226562500f,(float16_t)0.1375732421875f, +(float16_t)-0.9907226562500f,(float16_t)0.1345214843750f, +(float16_t)-0.9912109375000f,(float16_t)0.1315917968750f, +(float16_t)-0.9916992187500f,(float16_t)0.1285400390625f, +(float16_t)-0.9921875000000f,(float16_t)0.1254882812500f, +(float16_t)-0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)-0.9926757812500f,(float16_t)0.1193847656250f, +(float16_t)-0.9931640625000f,(float16_t)0.1163330078125f, +(float16_t)-0.9936523437500f,(float16_t)0.1132812500000f, +(float16_t)-0.9941406250000f,(float16_t)0.1102294921875f, +(float16_t)-0.9941406250000f,(float16_t)0.1071777343750f, +(float16_t)-0.9946289062500f,(float16_t)0.1041259765625f, +(float16_t)-0.9951171875000f,(float16_t)0.1010742187500f, +(float16_t)-0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)-0.9956054687500f,(float16_t)0.0949707031250f, +(float16_t)-0.9956054687500f,(float16_t)0.0919189453125f, +(float16_t)-0.9960937500000f,(float16_t)0.0888671875000f, +(float16_t)-0.9960937500000f,(float16_t)0.0858154296875f, +(float16_t)-0.9965820312500f,(float16_t)0.0827636718750f, +(float16_t)-0.9965820312500f,(float16_t)0.0797119140625f, +(float16_t)-0.9970703125000f,(float16_t)0.0765991210938f, +(float16_t)-0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)-0.9975585937500f,(float16_t)0.0704956054688f, +(float16_t)-0.9975585937500f,(float16_t)0.0674438476562f, +(float16_t)-0.9980468750000f,(float16_t)0.0643920898438f, +(float16_t)-0.9980468750000f,(float16_t)0.0613098144531f, +(float16_t)-0.9985351562500f,(float16_t)0.0582580566406f, +(float16_t)-0.9985351562500f,(float16_t)0.0552062988281f, +(float16_t)-0.9985351562500f,(float16_t)0.0521240234375f, +(float16_t)-0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)-0.9990234375000f,(float16_t)0.0459899902344f, +(float16_t)-0.9990234375000f,(float16_t)0.0429382324219f, +(float16_t)-0.9990234375000f,(float16_t)0.0398864746094f, +(float16_t)-0.9995117187500f,(float16_t)0.0368041992188f, +(float16_t)-0.9995117187500f,(float16_t)0.0337524414062f, +(float16_t)-0.9995117187500f,(float16_t)0.0306701660156f, +(float16_t)-0.9995117187500f,(float16_t)0.0276031494141f, +(float16_t)-0.9995117187500f,(float16_t)0.0245361328125f, +(float16_t)-1.0000000000000f,(float16_t)0.0214691162109f, +(float16_t)-1.0000000000000f,(float16_t)0.0184020996094f, +(float16_t)-1.0000000000000f,(float16_t)0.0153427124023f, +(float16_t)-1.0000000000000f,(float16_t)0.0122680664062f, +(float16_t)-1.0000000000000f,(float16_t)0.0092010498047f, +(float16_t)-1.0000000000000f,(float16_t)0.0061340332031f, +(float16_t)-1.0000000000000f,(float16_t)0.0030670166016f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)1.0000000000000f,(float16_t)0.0122680664062f, +(float16_t)0.9995117187500f,(float16_t)0.0245361328125f, +(float16_t)0.9995117187500f,(float16_t)0.0368041992188f, +(float16_t)0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)0.9980468750000f,(float16_t)0.0613098144531f, +(float16_t)0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)0.9960937500000f,(float16_t)0.0858154296875f, +(float16_t)0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)0.9941406250000f,(float16_t)0.1102294921875f, +(float16_t)0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)0.9907226562500f,(float16_t)0.1345214843750f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9873046875000f,(float16_t)0.1588134765625f, +(float16_t)0.9853515625000f,(float16_t)0.1710205078125f, +(float16_t)0.9829101562500f,(float16_t)0.1829833984375f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9785156250000f,(float16_t)0.2071533203125f, +(float16_t)0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)0.9731445312500f,(float16_t)0.2310791015625f, +(float16_t)0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)0.9667968750000f,(float16_t)0.2548828125000f, +(float16_t)0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)0.9604492187500f,(float16_t)0.2785644531250f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9531250000000f,(float16_t)0.3020019531250f, +(float16_t)0.9497070312500f,(float16_t)0.3137207031250f, +(float16_t)0.9458007812500f,(float16_t)0.3251953125000f, +(float16_t)0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)0.9375000000000f,(float16_t)0.3483886718750f, +(float16_t)0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)0.9287109375000f,(float16_t)0.3713378906250f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.9189453125000f,(float16_t)0.3940429687500f, +(float16_t)0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)0.9091796875000f,(float16_t)0.4165039062500f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.8984375000000f,(float16_t)0.4387207031250f, +(float16_t)0.8930664062500f,(float16_t)0.4497070312500f, +(float16_t)0.8876953125000f,(float16_t)0.4604492187500f, +(float16_t)0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)0.8759765625000f,(float16_t)0.4821777343750f, +(float16_t)0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)0.8637695312500f,(float16_t)0.5034179687500f, +(float16_t)0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)0.8515625000000f,(float16_t)0.5244140625000f, +(float16_t)0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)0.8383789062500f,(float16_t)0.5454101562500f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.8247070312500f,(float16_t)0.5659179687500f, +(float16_t)0.8173828125000f,(float16_t)0.5756835937500f, +(float16_t)0.8105468750000f,(float16_t)0.5859375000000f, +(float16_t)0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)0.7958984375000f,(float16_t)0.6054687500000f, +(float16_t)0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)0.7807617187500f,(float16_t)0.6250000000000f, +(float16_t)0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)0.7651367187500f,(float16_t)0.6440429687500f, +(float16_t)0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)0.7490234375000f,(float16_t)0.6625976562500f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.7324218750000f,(float16_t)0.6806640625000f, +(float16_t)0.7241210937500f,(float16_t)0.6894531250000f, +(float16_t)0.7158203125000f,(float16_t)0.6982421875000f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.6982421875000f,(float16_t)0.7158203125000f, +(float16_t)0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)0.6806640625000f,(float16_t)0.7324218750000f, +(float16_t)0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)0.6625976562500f,(float16_t)0.7490234375000f, +(float16_t)0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)0.6440429687500f,(float16_t)0.7651367187500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.6250000000000f,(float16_t)0.7807617187500f, +(float16_t)0.6152343750000f,(float16_t)0.7885742187500f, +(float16_t)0.6054687500000f,(float16_t)0.7958984375000f, +(float16_t)0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)0.5859375000000f,(float16_t)0.8105468750000f, +(float16_t)0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)0.5659179687500f,(float16_t)0.8247070312500f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.5454101562500f,(float16_t)0.8383789062500f, +(float16_t)0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)0.5244140625000f,(float16_t)0.8515625000000f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.5034179687500f,(float16_t)0.8637695312500f, +(float16_t)0.4929199218750f,(float16_t)0.8701171875000f, +(float16_t)0.4821777343750f,(float16_t)0.8759765625000f, +(float16_t)0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)0.4604492187500f,(float16_t)0.8876953125000f, +(float16_t)0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)0.4387207031250f,(float16_t)0.8984375000000f, +(float16_t)0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)0.4165039062500f,(float16_t)0.9091796875000f, +(float16_t)0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)0.3940429687500f,(float16_t)0.9189453125000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3713378906250f,(float16_t)0.9287109375000f, +(float16_t)0.3598632812500f,(float16_t)0.9331054687500f, +(float16_t)0.3483886718750f,(float16_t)0.9375000000000f, +(float16_t)0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)0.3251953125000f,(float16_t)0.9458007812500f, +(float16_t)0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)0.3020019531250f,(float16_t)0.9531250000000f, +(float16_t)0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)0.2785644531250f,(float16_t)0.9604492187500f, +(float16_t)0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)0.2548828125000f,(float16_t)0.9667968750000f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.2310791015625f,(float16_t)0.9731445312500f, +(float16_t)0.2191162109375f,(float16_t)0.9755859375000f, +(float16_t)0.2071533203125f,(float16_t)0.9785156250000f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.1829833984375f,(float16_t)0.9829101562500f, +(float16_t)0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)0.1588134765625f,(float16_t)0.9873046875000f, +(float16_t)0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)0.1345214843750f,(float16_t)0.9907226562500f, +(float16_t)0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)0.1102294921875f,(float16_t)0.9941406250000f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0858154296875f,(float16_t)0.9960937500000f, +(float16_t)0.0735473632812f,(float16_t)0.9970703125000f, +(float16_t)0.0613098144531f,(float16_t)0.9980468750000f, +(float16_t)0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)0.0368041992188f,(float16_t)0.9995117187500f, +(float16_t)0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)0.0122680664062f,(float16_t)1.0000000000000f, +(float16_t)0.0000000000000f,(float16_t)1.0000000000000f, +(float16_t)-0.0122680664062f,(float16_t)1.0000000000000f, +(float16_t)-0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)-0.0368041992188f,(float16_t)0.9995117187500f, +(float16_t)-0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)-0.0613098144531f,(float16_t)0.9980468750000f, +(float16_t)-0.0735473632812f,(float16_t)0.9970703125000f, +(float16_t)-0.0858154296875f,(float16_t)0.9960937500000f, +(float16_t)-0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)-0.1102294921875f,(float16_t)0.9941406250000f, +(float16_t)-0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)-0.1345214843750f,(float16_t)0.9907226562500f, +(float16_t)-0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)-0.1588134765625f,(float16_t)0.9873046875000f, +(float16_t)-0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)-0.1829833984375f,(float16_t)0.9829101562500f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.2071533203125f,(float16_t)0.9785156250000f, +(float16_t)-0.2191162109375f,(float16_t)0.9755859375000f, +(float16_t)-0.2310791015625f,(float16_t)0.9731445312500f, +(float16_t)-0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)-0.2548828125000f,(float16_t)0.9667968750000f, +(float16_t)-0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)-0.2785644531250f,(float16_t)0.9604492187500f, +(float16_t)-0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)-0.3020019531250f,(float16_t)0.9531250000000f, +(float16_t)-0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)-0.3251953125000f,(float16_t)0.9458007812500f, +(float16_t)-0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)-0.3483886718750f,(float16_t)0.9375000000000f, +(float16_t)-0.3598632812500f,(float16_t)0.9331054687500f, +(float16_t)-0.3713378906250f,(float16_t)0.9287109375000f, +(float16_t)-0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)-0.3940429687500f,(float16_t)0.9189453125000f, +(float16_t)-0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)-0.4165039062500f,(float16_t)0.9091796875000f, +(float16_t)-0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)-0.4387207031250f,(float16_t)0.8984375000000f, +(float16_t)-0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)-0.4604492187500f,(float16_t)0.8876953125000f, +(float16_t)-0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)-0.4821777343750f,(float16_t)0.8759765625000f, +(float16_t)-0.4929199218750f,(float16_t)0.8701171875000f, +(float16_t)-0.5034179687500f,(float16_t)0.8637695312500f, +(float16_t)-0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)-0.5244140625000f,(float16_t)0.8515625000000f, +(float16_t)-0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)-0.5454101562500f,(float16_t)0.8383789062500f, +(float16_t)-0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)-0.5659179687500f,(float16_t)0.8247070312500f, +(float16_t)-0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)-0.5859375000000f,(float16_t)0.8105468750000f, +(float16_t)-0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)-0.6054687500000f,(float16_t)0.7958984375000f, +(float16_t)-0.6152343750000f,(float16_t)0.7885742187500f, +(float16_t)-0.6250000000000f,(float16_t)0.7807617187500f, +(float16_t)-0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)-0.6440429687500f,(float16_t)0.7651367187500f, +(float16_t)-0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)-0.6625976562500f,(float16_t)0.7490234375000f, +(float16_t)-0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)-0.6806640625000f,(float16_t)0.7324218750000f, +(float16_t)-0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)-0.6982421875000f,(float16_t)0.7158203125000f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.7158203125000f,(float16_t)0.6982421875000f, +(float16_t)-0.7241210937500f,(float16_t)0.6894531250000f, +(float16_t)-0.7324218750000f,(float16_t)0.6806640625000f, +(float16_t)-0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)-0.7490234375000f,(float16_t)0.6625976562500f, +(float16_t)-0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)-0.7651367187500f,(float16_t)0.6440429687500f, +(float16_t)-0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)-0.7807617187500f,(float16_t)0.6250000000000f, +(float16_t)-0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)-0.7958984375000f,(float16_t)0.6054687500000f, +(float16_t)-0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)-0.8105468750000f,(float16_t)0.5859375000000f, +(float16_t)-0.8173828125000f,(float16_t)0.5756835937500f, +(float16_t)-0.8247070312500f,(float16_t)0.5659179687500f, +(float16_t)-0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)-0.8383789062500f,(float16_t)0.5454101562500f, +(float16_t)-0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)-0.8515625000000f,(float16_t)0.5244140625000f, +(float16_t)-0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)-0.8637695312500f,(float16_t)0.5034179687500f, +(float16_t)-0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)-0.8759765625000f,(float16_t)0.4821777343750f, +(float16_t)-0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)-0.8876953125000f,(float16_t)0.4604492187500f, +(float16_t)-0.8930664062500f,(float16_t)0.4497070312500f, +(float16_t)-0.8984375000000f,(float16_t)0.4387207031250f, +(float16_t)-0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)-0.9091796875000f,(float16_t)0.4165039062500f, +(float16_t)-0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)-0.9189453125000f,(float16_t)0.3940429687500f, +(float16_t)-0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)-0.9287109375000f,(float16_t)0.3713378906250f, +(float16_t)-0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)-0.9375000000000f,(float16_t)0.3483886718750f, +(float16_t)-0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)-0.9458007812500f,(float16_t)0.3251953125000f, +(float16_t)-0.9497070312500f,(float16_t)0.3137207031250f, +(float16_t)-0.9531250000000f,(float16_t)0.3020019531250f, +(float16_t)-0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)-0.9604492187500f,(float16_t)0.2785644531250f, +(float16_t)-0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)-0.9667968750000f,(float16_t)0.2548828125000f, +(float16_t)-0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)-0.9731445312500f,(float16_t)0.2310791015625f, +(float16_t)-0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)-0.9785156250000f,(float16_t)0.2071533203125f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)-0.9829101562500f,(float16_t)0.1829833984375f, +(float16_t)-0.9853515625000f,(float16_t)0.1710205078125f, +(float16_t)-0.9873046875000f,(float16_t)0.1588134765625f, +(float16_t)-0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)-0.9907226562500f,(float16_t)0.1345214843750f, +(float16_t)-0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)-0.9941406250000f,(float16_t)0.1102294921875f, +(float16_t)-0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)-0.9960937500000f,(float16_t)0.0858154296875f, +(float16_t)-0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)-0.9980468750000f,(float16_t)0.0613098144531f, +(float16_t)-0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)-0.9995117187500f,(float16_t)0.0368041992188f, +(float16_t)-0.9995117187500f,(float16_t)0.0245361328125f, +(float16_t)-1.0000000000000f,(float16_t)0.0122680664062f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)0.0000000000000f,(float16_t)1.0000000000000f, +(float16_t)-0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)-0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)-0.1467285156250f,(float16_t)0.9892578125000f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)-0.2902832031250f,(float16_t)0.9570312500000f, +(float16_t)-0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)-0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)-0.4274902343750f,(float16_t)0.9038085937500f, +(float16_t)-0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)-0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)-0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)-0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)-0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)-0.6713867187500f,(float16_t)0.7407226562500f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)-0.7729492187500f,(float16_t)0.6342773437500f, +(float16_t)-0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)-0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)-0.8579101562500f,(float16_t)0.5141601562500f, +(float16_t)-0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)-0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)-0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)-0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)-0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)-0.9702148437500f,(float16_t)0.2429199218750f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)-0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)-0.9951171875000f,(float16_t)0.0980224609375f, +(float16_t)-0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)0.0000000000000f,(float16_t)1.0000000000000f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)-0.5556640625000f,(float16_t)0.8315429687500f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)-0.9238281250000f,(float16_t)0.3825683593750f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)0.0000000000000f,(float16_t)1.0000000000000f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f,}; float16_t rearranged_twiddle_stride3_4096_f16[2728]={ -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99998941108192840321f,(float16_t)0.00460192612044857050f, -(float16_t)0.99995764455196389786f,(float16_t)0.00920375478205981944f, -(float16_t)0.99990470108285289808f,(float16_t)0.01380538852806039059f, -(float16_t)0.99983058179582340319f,(float16_t)0.01840672990580482019f, -(float16_t)0.99973528826056168306f,(float16_t)0.02300768146883936868f, -(float16_t)0.99961882249517863830f,(float16_t)0.02760814577896573974f, -(float16_t)0.99948118696616694567f,(float16_t)0.03220802540830458582f, -(float16_t)0.99932238458834954375f,(float16_t)0.03680722294135883171f, -(float16_t)0.99914241872481690532f,(float16_t)0.04140564097707673946f, -(float16_t)0.99894129318685687124f,(float16_t)0.04600318213091462299f, -(float16_t)0.99871901223387293811f,(float16_t)0.05059974903689928166f, -(float16_t)0.99847558057329477421f,(float16_t)0.05519524434968993420f, -(float16_t)0.99821100336047818846f,(float16_t)0.05978957074663986820f, -(float16_t)0.99792528619859599548f,(float16_t)0.06438263092985746505f, -(float16_t)0.99761843513851955478f,(float16_t)0.06897432762826674613f, -(float16_t)0.99729045667869020697f,(float16_t)0.07356456359966742631f, -(float16_t)0.99694135776498216117f,(float16_t)0.07815324163279423197f, -(float16_t)0.99657114579055483539f,(float16_t)0.08274026454937569164f, -(float16_t)0.99617982859569698117f,(float16_t)0.08732553520619205922f, -(float16_t)0.99576741446765981713f,(float16_t)0.09190895649713272386f, -(float16_t)0.99533391214048227980f,(float16_t)0.09649043135525259274f, -(float16_t)0.99487933079480561638f,(float16_t)0.10106986275482782167f, -(float16_t)0.99440368005767909576f,(float16_t)0.10564715371341061589f, -(float16_t)0.99390697000235606051f,(float16_t)0.11022220729388305938f, -(float16_t)0.99338921114808065305f,(float16_t)0.11479492660651008373f, -(float16_t)0.99285041445986510489f,(float16_t)0.11936521481099135467f, -(float16_t)0.99229059134825736699f,(float16_t)0.12393297511851215920f, -(float16_t)0.99170975366909952520f,(float16_t)0.12849811079379316880f, -(float16_t)0.99110791372327688986f,(float16_t)0.13306052515713906459f, -(float16_t)0.99048508425645709341f,(float16_t)0.13762012158648603832f, -(float16_t)0.98984127845882052821f,(float16_t)0.14217680351944803063f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.98849079285269658701f,(float16_t)0.15128103795733022219f, -(float16_t)0.98778414164457217783f,(float16_t)0.15582839765426523271f, -(float16_t)0.98705657130575097380f,(float16_t)0.16037245724292828464f, -(float16_t)0.98630809724459866938f,(float16_t)0.16491312048996989437f, -(float16_t)0.98553873531217606185f,(float16_t)0.16945029123396795900f, -(float16_t)0.98474850180190420801f,(float16_t)0.17398387338746382214f, -(float16_t)0.98393741344921892278f,(float16_t)0.17851377093899750692f, -(float16_t)0.98310548743121628501f,(float16_t)0.18303988795514095078f, -(float16_t)0.98225274136628937249f,(float16_t)0.18756212858252960252f, -(float16_t)0.98137919331375456089f,(float16_t)0.19208039704989243734f, -(float16_t)0.98048486177346938497f,(float16_t)0.19659459767008022335f, -(float16_t)0.97956976568544051887f,(float16_t)0.20110463484209190055f, -(float16_t)0.97863392442942320759f,(float16_t)0.20561041305309923910f, -(float16_t)0.97767735782450992943f,(float16_t)0.21011183688046961016f, -(float16_t)0.97670008612871184184f,(float16_t)0.21460881099378675829f, -(float16_t)0.97570213003852857003f,(float16_t)0.21910124015686979759f, -(float16_t)0.97468351068851066810f,(float16_t)0.22358902922978998729f, -(float16_t)0.97364424965081197705f,(float16_t)0.22807208317088573102f, -(float16_t)0.97258436893473221296f,(float16_t)0.23255030703877524467f, -(float16_t)0.97150389098625178352f,(float16_t)0.23702360599436719801f, -(float16_t)0.97040283868755550234f,(float16_t)0.24149188530286933019f, -(float16_t)0.96928123535654853171f,(float16_t)0.24595505033579459497f, -(float16_t)0.96813910474636244441f,(float16_t)0.25041300657296522436f, -(float16_t)0.96697647104485207059f,(float16_t)0.25486565960451457169f, -(float16_t)0.96579335887408368500f,(float16_t)0.25931291513288623474f, -(float16_t)0.96458979328981275803f,(float16_t)0.26375467897483134694f, -(float16_t)0.96336579978095404631f,(float16_t)0.26819085706340317632f, -(float16_t)0.96212140426904158019f,(float16_t)0.27262135544994897662f, -(float16_t)0.96085663310767965850f,(float16_t)0.27704608030609989555f, -(float16_t)0.95957151308198451733f,(float16_t)0.28146493792575794091f, -(float16_t)0.95826607140801767226f,(float16_t)0.28587783472708061527f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.95559433413077110586f,(float16_t)0.29468537218051432669f, -(float16_t)0.95422809510910566733f,(float16_t)0.29907982630804047508f, -(float16_t)0.95284164760119871573f,(float16_t)0.30346794657201131562f, -(float16_t)0.95143502096900833820f,(float16_t)0.30784964004153486661f, -(float16_t)0.95000824500184299914f,(float16_t)0.31222481392182488413f, -(float16_t)0.94856134991573026749f,(float16_t)0.31659337555616584581f, -(float16_t)0.94709436635277721717f,(float16_t)0.32095523242787521445f, -(float16_t)0.94560732538052127971f,(float16_t)0.32531029216226292622f, -(float16_t)0.94410025849127265918f,(float16_t)0.32965846252858749255f, -(float16_t)0.94257319760144686605f,(float16_t)0.33399965144200938205f, -(float16_t)0.94102617505088925753f,(float16_t)0.33833376696554112728f, -(float16_t)0.93945922360218991898f,(float16_t)0.34266071731199437833f, -(float16_t)0.93787237643998988545f,(float16_t)0.34698041084592368133f, -(float16_t)0.93626566717027825959f,(float16_t)0.35129275608556709276f, -(float16_t)0.93463912981968078064f,(float16_t)0.35559766170478385172f, -(float16_t)0.93299279883473895669f,(float16_t)0.35989503653498811087f, -(float16_t)0.93132670908118042608f,(float16_t)0.36418478956707989180f, -(float16_t)0.92964089584318121418f,(float16_t)0.36846682995337232125f, -(float16_t)0.92793539482261788720f,(float16_t)0.37274106700951575855f, -(float16_t)0.92621024213831137928f,(float16_t)0.37700741021641825945f, -(float16_t)0.92446547432526260391f,(float16_t)0.38126576922216237620f, -(float16_t)0.92270112833387862850f,(float16_t)0.38551605384391884890f, -(float16_t)0.92091724152918941204f,(float16_t)0.38975817406985641123f, -(float16_t)0.91911385169005777040f,(float16_t)0.39399204006104809883f, -(float16_t)0.91729099700837790632f,(float16_t)0.39821756215337356100f, -(float16_t)0.91544871608826783316f,(float16_t)0.40243465085941843018f, -(float16_t)0.91358704794525080750f,(float16_t)0.40664321687036902864f, -(float16_t)0.91170603200542987832f,(float16_t)0.41084317105790391089f, -(float16_t)0.90980570810465222209f,(float16_t)0.41503442447608163146f, -(float16_t)0.90788611648766626150f,(float16_t)0.41921688836322390515f, -(float16_t)0.90594729780726845902f,(float16_t)0.42339047414379604728f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.90201214390249317976f,(float16_t)0.43171065802505725895f, -(float16_t)0.90001589201616016833f,(float16_t)0.43585707992225547480f, -(float16_t)0.89800057974073987932f,(float16_t)0.43999427130963325583f, -(float16_t)0.89596624975618521791f,(float16_t)0.44412214457042920035f, -(float16_t)0.89391294514520325265f,(float16_t)0.44824061228521988598f, -(float16_t)0.89184070939234272313f,(float16_t)0.45234958723377088896f, -(float16_t)0.88974958638307277692f,(float16_t)0.45644898239688391772f, -(float16_t)0.88763962040285393496f,(float16_t)0.46053871095824000514f, -(float16_t)0.88551085613619995307f,(float16_t)0.46461868630623781584f, -(float16_t)0.88336333866573157891f,(float16_t)0.46868882203582790114f, -(float16_t)0.88119711347122209322f,(float16_t)0.47274903195034279069f, -(float16_t)0.87901222642863352519f,(float16_t)0.47679923006332208812f, -(float16_t)0.87680872380914565145f,(float16_t)0.48083933060033395845f, -(float16_t)0.87458665227817611321f,(float16_t)0.48486924800079106435f, -(float16_t)0.87234605889439154058f,(float16_t)0.48888889691976317176f, -(float16_t)0.87008699110871146054f,(float16_t)0.49289819222978403790f, -(float16_t)0.86780949676330332299f,(float16_t)0.49689704902265446895f, -(float16_t)0.86551362409056908920f,(float16_t)0.50088538261124071482f, -(float16_t)0.86319942171212415971f,(float16_t)0.50486310853126759035f, -(float16_t)0.86086693863776730939f,(float16_t)0.50883014254310698909f, -(float16_t)0.85851622426444273994f,(float16_t)0.51278640063356295542f, -(float16_t)0.85614732837519447184f,(float16_t)0.51673179901764987321f, -(float16_t)0.85376030113811141042f,(float16_t)0.52066625414036715735f, -(float16_t)0.85135519310526519554f,(float16_t)0.52458968267846894928f, -(float16_t)0.84893205521163961347f,(float16_t)0.52850200154222848337f, -(float16_t)0.84649093877405212627f,(float16_t)0.53240312787719790144f, -(float16_t)0.84403189549006640835f,(float16_t)0.53629297906596318235f, -(float16_t)0.84155497743689844370f,(float16_t)0.54017147272989285423f, -(float16_t)0.83906023707031274217f,(float16_t)0.54403852673088382019f, -(float16_t)0.83654772722351200542f,(float16_t)0.54789405917310018967f, -(float16_t)0.83401750110601813315f,(float16_t)0.55173798840470733573f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.82890411477186487499f,(float16_t)0.55939071185913613604f, -(float16_t)0.82632106284566353427f,(float16_t)0.56319934401383409117f, -(float16_t)0.82372051122739142759f,(float16_t)0.56699604882510867832f, -(float16_t)0.82110251499110464835f,(float16_t)0.57078074588696725566f, -(float16_t)0.81846712958029865792f,(float16_t)0.57455335504771576360f, -(float16_t)0.81581441080673378075f,(float16_t)0.57831379641165558958f, -(float16_t)0.81314441484925359394f,(float16_t)0.58206199034077543697f, -(float16_t)0.81045719825259476821f,(float16_t)0.58579785745643886408f, -(float16_t)0.80775281792619035848f,(float16_t)0.58952131864106394055f, -(float16_t)0.80503133114296365758f,(float16_t)0.59323229503979979516f, -(float16_t)0.80229279553811572168f,(float16_t)0.59693070806219639124f, -(float16_t)0.79953726910790501314f,(float16_t)0.60061647938386897305f, -(float16_t)0.79676481020841882774f,(float16_t)0.60428953094815596181f, -(float16_t)0.79397547755433717231f,(float16_t)0.60794978496777363208f, -(float16_t)0.79116933021769020318f,(float16_t)0.61159716392646190641f, -(float16_t)0.78834642762660622761f,(float16_t)0.61523159058062681925f, -(float16_t)0.78550682956405393220f,(float16_t)0.61885298796097631957f, -(float16_t)0.78265059616657572938f,(float16_t)0.62246127937414996723f, -(float16_t)0.77977778792301455368f,(float16_t)0.62605638840434352232f, -(float16_t)0.77688846567323244230f,(float16_t)0.62963823891492698426f, -(float16_t)0.77398269060682289844f,(float16_t)0.63320675505005719064f, -(float16_t)0.77106052426181381776f,(float16_t)0.63676186123628419899f, -(float16_t)0.76812202852336541881f,(float16_t)0.64030348218415167327f, -(float16_t)0.76516726562245895860f,(float16_t)0.64383154288979138613f, -(float16_t)0.76219629813457900891f,(float16_t)0.64734596863651205911f, -(float16_t)0.75920918897838796102f,(float16_t)0.65084668499638087535f, -(float16_t)0.75620600141439453523f,(float16_t)0.65433361783180044036f, -(float16_t)0.75318679904361252042f,(float16_t)0.65780669329707863735f, -(float16_t)0.75015164580621507273f,(float16_t)0.66126583783999226540f, -(float16_t)0.74710060598018013245f,(float16_t)0.66471097820334479334f, -(float16_t)0.74403374417992929057f,(float16_t)0.66814204142651845153f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.73785281478846598269f,(float16_t)0.67496164610201192513f, -(float16_t)0.73473887809596349907f,(float16_t)0.67835004312986146857f, -(float16_t)0.73160938122389262972f,(float16_t)0.68172407417164970767f, -(float16_t)0.72846439044822519637f,(float16_t)0.68508366777270035541f, -(float16_t)0.72530397237306076796f,(float16_t)0.68842875278409043638f, -(float16_t)0.72212819392921534511f,(float16_t)0.69175925836415774750f, -(float16_t)0.71893712237280449351f,(float16_t)0.69507511398000088043f, -(float16_t)0.71573082528381870571f,(float16_t)0.69837624940897280457f, -(float16_t)0.71250937056469243469f,(float16_t)0.70166259474016845488f, -(float16_t)0.70927282643886568891f,(float16_t)0.70493408037590488124f, -(float16_t)0.70602126144933974317f,(float16_t)0.70819063703319540259f, -(float16_t)0.70275474445722529993f,(float16_t)0.71143219574521643356f, -(float16_t)0.69947334464028376733f,(float16_t)0.71465868786276909308f, -(float16_t)0.69617713149146298601f,(float16_t)0.71787004505573170920f, -(float16_t)0.69286617481742474034f,(float16_t)0.72106619931450810501f, -(float16_t)0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)0.68620031168003858824f,(float16_t)0.72741262860237576593f, -(float16_t)0.68284554638524808112f,(float16_t)0.73056276922782759087f, -(float16_t)0.67947631989936496666f,(float16_t)0.73369743811466026084f, -(float16_t)0.67609270357531603413f,(float16_t)0.73681656887736979300f, -(float16_t)0.67269476907077296879f,(float16_t)0.73992009545951609173f, -(float16_t)0.66928258834663600929f,(float16_t)0.74300795213512171866f, -(float16_t)0.66585623366550972246f,(float16_t)0.74608007351006366825f, -(float16_t)0.66241577759017178373f,(float16_t)0.74913639452345925918f, -(float16_t)0.65896129298203731661f,(float16_t)0.75217685044904269986f, -(float16_t)0.65549285299961546070f,(float16_t)0.75520137689653654700f, -(float16_t)0.65201053109695950027f,(float16_t)0.75820990981301528144f, -(float16_t)0.64851440102211255212f,(float16_t)0.76120238548426177871f, -(float16_t)0.64500453681554403840f,(float16_t)0.76417874053611667406f, -(float16_t)0.64148101280858316198f,(float16_t)0.76713891193582040007f, -(float16_t)0.63794390362184416610f,(float16_t)0.77008283699334789674f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.63082922962842458148f,(float16_t)0.77592169904340757558f, -(float16_t)0.62725181549514419377f,(float16_t)0.77881651238147586724f, -(float16_t)0.62366111752569464155f,(float16_t)0.78169483207105938671f, -(float16_t)0.62005721176328920663f,(float16_t)0.78455659715557524159f, -(float16_t)0.61644017453085364622f,(float16_t)0.78740174702903131809f, -(float16_t)0.61281008242940970820f,(float16_t)0.79023022143731003197f, -(float16_t)0.60916701233645320634f,(float16_t)0.79304196047944364167f, -(float16_t)0.60551104140432554512f,(float16_t)0.79583690460888345530f, -(float16_t)0.60184224705858002658f,(float16_t)0.79861499463476082195f, -(float16_t)0.59816070699634238395f,(float16_t)0.80137617172314012937f, -(float16_t)0.59446649918466454299f,(float16_t)0.80412037739826569549f, -(float16_t)0.59075970185887427544f,(float16_t)0.80684755354379922299f, -(float16_t)0.58704039352091808013f,(float16_t)0.80955764240405125864f, -(float16_t)0.58330865293769829094f,(float16_t)0.81225058658520388200f, -(float16_t)0.57956455913940574387f,(float16_t)0.81492632905652662156f, -(float16_t)0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)0.57203962932475704850f,(float16_t)0.82022598256943468620f, -(float16_t)0.56825895267013148970f,(float16_t)0.82284978137582631685f, -(float16_t)0.56446624152051949608f,(float16_t)0.82545615400437744036f, -(float16_t)0.56066157619733603124f,(float16_t)0.82804504525775579626f, -(float16_t)0.55684503727516010407f,(float16_t)0.83061640030884620334f, -(float16_t)0.55301670558002757883f,(float16_t)0.83317016470191318511f, -(float16_t)0.54917666218771976627f,(float16_t)0.83570628435375260423f, -(float16_t)0.54532498842204646383f,(float16_t)0.83822470555483796772f, -(float16_t)0.54146176585312355556f,(float16_t)0.84072537497045796151f, -(float16_t)0.53758707629564550512f,(float16_t)0.84320823964184543620f, -(float16_t)0.53370100180715296379f,(float16_t)0.84567324698729906540f, -(float16_t)0.52980362468629482731f,(float16_t)0.84812034480329712149f, -(float16_t)0.52589502747108474168f,(float16_t)0.85054948126560336874f, -(float16_t)0.52197529293715438925f,(float16_t)0.85296060493036363059f, -(float16_t)0.51804450409599933636f,(float16_t)0.85535366473519602870f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.51015009670676669806f,(float16_t)0.86008539042939025077f, -(float16_t)0.50618664534515533937f,(float16_t)0.86242395611104050168f, -(float16_t)0.50221247404571089934f,(float16_t)0.86474425751946237817f, -(float16_t)0.49822766697278186854f,(float16_t)0.86704624551569264845f, -(float16_t)0.49423230851595972846f,(float16_t)0.86932987134860673084f, -(float16_t)0.49022648328829110387f,(float16_t)0.87159508665595109012f, -(float16_t)0.48621027612448652899f,(float16_t)0.87384184346536675214f, -(float16_t)0.48218377207912282989f,(float16_t)0.87607009419540660122f, -(float16_t)0.47814705642484311987f,(float16_t)0.87827979165654146421f, -(float16_t)0.47410021465055002254f,(float16_t)0.88047088905216075450f, -(float16_t)0.47004333245959561971f,(float16_t)0.88264333997956279099f, -(float16_t)0.46597649576796612569f,(float16_t)0.88479709843093778954f, -(float16_t)0.46189979070246284243f,(float16_t)0.88693211879434208367f, -(float16_t)0.45781330359887728587f,(float16_t)0.88904835585466457371f, -(float16_t)0.45371712100016392544f,(float16_t)0.89114576479458318392f, -(float16_t)0.44961132965460659516f,(float16_t)0.89322430119551532446f, -(float16_t)0.44549601651398174074f,(float16_t)0.89528392103855758410f, -(float16_t)0.44137126873171661501f,(float16_t)0.89732458070541831763f, -(float16_t)0.43723717366104419835f,(float16_t)0.89934623697934146236f, -(float16_t)0.43309381885315201277f,(float16_t)0.90134884704602202810f, -(float16_t)0.42894129205532954829f,(float16_t)0.90333236849451181705f, -(float16_t)0.42477968120910880589f,(float16_t)0.90529675931811881551f, -(float16_t)0.42060907444840250902f,(float16_t)0.90724197791529592738f, -(float16_t)0.41642956009763731906f,(float16_t)0.90916798309052226923f, -(float16_t)0.41224122666988299857f,(float16_t)0.91107473405517624965f, -(float16_t)0.40804416286497874333f,(float16_t)0.91296219042839810154f, -(float16_t)0.40383845756765412993f,(float16_t)0.91483031223794608611f, -(float16_t)0.39962419984564678810f,(float16_t)0.91667905992104270485f, -(float16_t)0.39540147894781629834f,(float16_t)0.91850839432521225181f, -(float16_t)0.39117038430225398171f,(float16_t)0.92031827670911048322f, -(float16_t)0.38693100551438869283f,(float16_t)0.92210866874334507237f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.37842775480876561511f,(float16_t)0.92563083050987271516f, -(float16_t)0.37416406297145798909f,(float16_t)0.92736252565040111495f, -(float16_t)0.36989244714893426691f,(float16_t)0.92907458125931574600f, -(float16_t)0.36561299780477396482f,(float16_t)0.93076696107898371224f, -(float16_t)0.36132580556845433906f,(float16_t)0.93243962926846235550f, -(float16_t)0.35703096123343003310f,(float16_t)0.93409255040425887007f, -(float16_t)0.35272855575521072646f,(float16_t)0.93572568948108036935f, -(float16_t)0.34841868024943450921f,(float16_t)0.93733901191257495977f, -(float16_t)0.34410142598993898044f,(float16_t)0.93893248353206448797f, -(float16_t)0.33977688440682696225f,(float16_t)0.94050607059326829518f, -(float16_t)0.33544514708453165852f,(float16_t)0.94205973977101731265f, -(float16_t)0.33110630575987642921f,(float16_t)0.94359345816196038559f, -(float16_t)0.32676045232013178898f,(float16_t)0.94510719328526060501f, -(float16_t)0.32240767880107001897f,(float16_t)0.94660091308328353499f, -(float16_t)0.31804807738501505998f,(float16_t)0.94807458592227622507f, -(float16_t)0.31368174039889157312f,(float16_t)0.94952818059303667475f, -(float16_t)0.30930876031226878231f,(float16_t)0.95096166631157508231f, -(float16_t)0.30492922973540242948f,(float16_t)0.95237501271976587880f, -(float16_t)0.30054324141727339903f,(float16_t)0.95376818988599032512f, -(float16_t)0.29615088824362395536f,(float16_t)0.95514116830577067141f, -(float16_t)0.29175226323498937298f,(float16_t)0.95649391890239499059f, -(float16_t)0.28734745954472956653f,(float16_t)0.95782641302753290802f, -(float16_t)0.28293657045705539188f,(float16_t)0.95913862246184189431f, -(float16_t)0.27851968938505305973f,(float16_t)0.96043051941556578655f, -(float16_t)0.27409690986870632878f,(float16_t)0.96170207652912254037f, -(float16_t)0.26966832557291520178f,(float16_t)0.96295326687368387741f, -(float16_t)0.26523403028551190141f,(float16_t)0.96418406395174571788f, -(float16_t)0.26079411791527556952f,(float16_t)0.96539444169768939830f, -(float16_t)0.25634868248994291395f,(float16_t)0.96658437447833311928f, -(float16_t)0.25189781815421691258f,(float16_t)0.96775383709347551076f, -(float16_t)0.24744161916777343557f,(float16_t)0.96890280477642887202f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.23851359484431849944f,(float16_t)0.97113915844972509284f, -(float16_t)0.23404195858354345794f,(float16_t)0.97222649707893626925f, -(float16_t)0.22956536582051886852f,(float16_t)0.97329324605469824672f, -(float16_t)0.22508391135979277653f,(float16_t)0.97433938278557585821f, -(float16_t)0.22059769010887364526f,(float16_t)0.97536488511665686563f, -(float16_t)0.21610679707621960333f,(float16_t)0.97636973133002114000f, -(float16_t)0.21161132736922760866f,(float16_t)0.97735390014519996082f, -(float16_t)0.20711137619221856032f,(float16_t)0.97831737071962765473f, -(float16_t)0.20260703884442110567f,(float16_t)0.97926012264908202098f, -(float16_t)0.19809841071795372680f,(float16_t)0.98018213596811731847f, -(float16_t)0.19358558729580374602f,(float16_t)0.98108339115048659451f, -(float16_t)0.18906866414980627589f,(float16_t)0.98196386910955524296f, -(float16_t)0.18454773693861964423f,(float16_t)0.98282355119870523641f, -(float16_t)0.18002290140569951471f,(float16_t)0.98366241921173025453f, -(float16_t)0.17549425337727139751f,(float16_t)0.98448045538322093151f, -(float16_t)0.17096188876030135595f,(float16_t)0.98527764238894122162f, -(float16_t)0.16642590354046421508f,(float16_t)0.98605396334619543897f, -(float16_t)0.16188639378011188130f,(float16_t)0.98680940181418541624f, -(float16_t)0.15734345561623827581f,(float16_t)0.98754394179435922574f, -(float16_t)0.15279718525844340760f,(float16_t)0.98825756773074946437f, -(float16_t)0.14824767898689619749f,(float16_t)0.98895026451030298986f, -(float16_t)0.14369503315029458212f,(float16_t)0.98962201746320077600f, -(float16_t)0.13913934416382628401f,(float16_t)0.99027281236316910817f, -(float16_t)0.13458070850712622324f,(float16_t)0.99090263542778000971f, -(float16_t)0.13001922272223334631f,(float16_t)0.99151147331874389668f, -(float16_t)0.12545498341154620592f,(float16_t)0.99209931314219179654f, -(float16_t)0.12088808723577722237f,(float16_t)0.99266614244894801899f, -(float16_t)0.11631863091190487725f,(float16_t)0.99321194923479450001f, -(float16_t)0.11174671121112665639f,(float16_t)0.99373672194072459884f, -(float16_t)0.10717242495680887049f,(float16_t)0.99424044945318790223f, -(float16_t)0.10259586902243628126f,(float16_t)0.99472312110432570265f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.09343633584574791151f,(float16_t)0.99562525638099430569f, -(float16_t)0.08885355258252468358f,(float16_t)0.99604470090125196702f, -(float16_t)0.08426888759332412659f,(float16_t)0.99644305135004263008f, -(float16_t)0.07968243797143012563f,(float16_t)0.99682029929116566791f, -(float16_t)0.07509430084792129145f,(float16_t)0.99717643673532618820f, -(float16_t)0.07050457338961400866f,(float16_t)0.99751145614030345410f, -(float16_t)0.06591335279700392957f,(float16_t)0.99782535041111164453f, -(float16_t)0.06132073630220864768f,(float16_t)0.99811811290014917919f, -(float16_t)0.05672682116690778292f,(float16_t)0.99838973740734016094f, -(float16_t)0.05213170468028331672f,(float16_t)0.99864021818026527111f, -(float16_t)0.04753548415695926094f,(float16_t)0.99886954991428356099f, -(float16_t)0.04293825693494095902f,(float16_t)0.99907772775264536147f, -(float16_t)0.03834012037355279123f,(float16_t)0.99926474728659442359f, -(float16_t)0.03374117185137764235f,(float16_t)0.99943060455546173237f, -(float16_t)0.02914150876419373953f,(float16_t)0.99957529604674921764f, -(float16_t)0.02454122852291226384f,(float16_t)0.99969881869620424997f, -(float16_t)0.01994042855151459750f,(float16_t)0.99980116988788425569f, -(float16_t)0.01533920628498821985f,(float16_t)0.99988234745421256111f, -(float16_t)0.01073765916726457208f,(float16_t)0.99994234967602391162f, -(float16_t)0.00613588464915451517f,(float16_t)0.99998117528260110909f, -(float16_t)0.00153398018628476615f,(float16_t)0.99999882345170187925f, -(float16_t)-0.00306795676296601561f,(float16_t)0.99999529380957619118f, -(float16_t)-0.00766982873953095477f,(float16_t)0.99997058643097413988f, -(float16_t)-0.01227153828571982304f,(float16_t)0.99992470183914450299f, -(float16_t)-0.01687298794728165144f,(float16_t)0.99985764100582386060f, -(float16_t)-0.02147408027546948359f,(float16_t)0.99976940535121527898f, -(float16_t)-0.02607471782910391472f,(float16_t)0.99965999674395922270f, -(float16_t)-0.03067480317663645942f,(float16_t)0.99952941750109314256f, -(float16_t)-0.03527423889821382219f,(float16_t)0.99937767038800284780f, -(float16_t)-0.03987292758773972740f,(float16_t)0.99920475861836388631f, -(float16_t)-0.04447077185493861912f,(float16_t)0.99901068585407337697f, -(float16_t)-0.04906767432741800800f,(float16_t)0.99879545620517240501f, -(float16_t)-0.05366353765273055437f,(float16_t)0.99855907422975931365f, -(float16_t)-0.05825826450043560673f,(float16_t)0.99830154493389289261f, -(float16_t)-0.06285175756416130910f,(float16_t)0.99802287377148624081f, -(float16_t)-0.06744391956366398155f,(float16_t)0.99772306664419163624f, -(float16_t)-0.07203465324688929083f,(float16_t)0.99740212990127530279f, -(float16_t)-0.07662386139203150592f,(float16_t)0.99706007033948296225f, -(float16_t)-0.08121144680959226092f,(float16_t)0.99669689520289606044f, -(float16_t)-0.08579731234443975507f,(float16_t)0.99631261218277800129f, -(float16_t)-0.09038136087786488582f,(float16_t)0.99590722941741172125f, -(float16_t)-0.09496349532963895002f,(float16_t)0.99548075549192693856f, -(float16_t)-0.09954361866006931903f,(float16_t)0.99503319943811863180f, -(float16_t)-0.10412163387205460030f,(float16_t)0.99456457073425541537f, -(float16_t)-0.10869744401313856386f,(float16_t)0.99407487930487947736f, -(float16_t)-0.11327095217756423529f,(float16_t)0.99356413552059530403f, -(float16_t)-0.11784206150832489401f,(float16_t)0.99303235019785141002f, -(float16_t)-0.12241067519921615403f,(float16_t)0.99247953459870996706f, -(float16_t)-0.12697669649688586579f,(float16_t)0.99190570043060932726f, -(float16_t)-0.13154002870288314386f,(float16_t)0.99131085984611544415f, -(float16_t)-0.13610057517570606223f,(float16_t)0.99069502544266463406f, -(float16_t)-0.14065823933284912761f,(float16_t)0.99005821026229712256f, -(float16_t)-0.14521292465284740825f,(float16_t)0.98940042779138037687f, -(float16_t)-0.14976453467732150915f,(float16_t)0.98872169196032377858f, -(float16_t)-0.15431297301302013270f,(float16_t)0.98802201714328352633f, -(float16_t)-0.15885814333386127917f,(float16_t)0.98730141815785843473f, -(float16_t)-0.16339994938297311422f,(float16_t)0.98655991026477551920f, -(float16_t)-0.16793829497473108936f,(float16_t)0.98579750916756747614f, -(float16_t)-0.17247308399679592283f,(float16_t)0.98501423101223983814f, -(float16_t)-0.17700422041214874946f,(float16_t)0.98421009238692902521f, -(float16_t)-0.18153160826112502146f,(float16_t)0.98338511032155118130f, -(float16_t)-0.18605515166344649414f,(float16_t)0.98253930228744124076f, -(float16_t)-0.19057475482025265645f,(float16_t)0.98167268619698311305f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.19960175762113094300f,(float16_t)0.97987710369951763756f, -(float16_t)-0.20410896609281689584f,(float16_t)0.97894817531906219710f, -(float16_t)-0.20861185197826331850f,(float16_t)0.97799851493455713936f, -(float16_t)-0.21311031991609125091f,(float16_t)0.97702814265775439484f, -(float16_t)-0.21760427463848355800f,(float16_t)0.97603707903903913490f, -(float16_t)-0.22209362097320348162f,(float16_t)0.97502534506699412020f, -(float16_t)-0.22657826384560997290f,(float16_t)0.97399296216795583359f, -(float16_t)-0.23105810828067113727f,(float16_t)0.97293995220556017678f, -(float16_t)-0.23553305940497534787f,(float16_t)0.97186633748027939639f, -(float16_t)-0.24000302244874138768f,(float16_t)0.97077214072895035013f, -(float16_t)-0.24446790274782409513f,(float16_t)0.96965738512429244800f, -(float16_t)-0.24892760574572012078f,(float16_t)0.96852209427441737777f, -(float16_t)-0.25338203699557015902f,(float16_t)0.96736629222232850545f, -(float16_t)-0.25783110216215882060f,(float16_t)0.96619000344541261516f, -(float16_t)-0.26227470702391347812f,(float16_t)0.96499325285492043580f, -(float16_t)-0.26671275747489830987f,(float16_t)0.96377606579543984022f, -(float16_t)-0.27114515952680795507f,(float16_t)0.96253846804435916340f, -(float16_t)-0.27557181931095814376f,(float16_t)0.96128048581132063966f, -(float16_t)-0.27999264308027327353f,(float16_t)0.96000214573766584625f, -(float16_t)-0.28440753721127171039f,(float16_t)0.95870347489587159906f, -(float16_t)-0.28881640820604936870f,(float16_t)0.95738450078897596729f, -(float16_t)-0.29321916269425857271f,(float16_t)0.95604525134999651659f, -(float16_t)-0.29761570743508619641f,(float16_t)0.95468575494133833814f, -(float16_t)-0.30200594931922808417f,(float16_t)0.95330604035419386211f, -(float16_t)-0.30638979537086097338f,(float16_t)0.95190613680793234597f, -(float16_t)-0.31076715274961136393f,(float16_t)0.95048607394948181337f, -(float16_t)-0.31513792875252233383f,(float16_t)0.94904588185270055689f, -(float16_t)-0.31950203081601563637f,(float16_t)0.94758559101774120226f, -(float16_t)-0.32385936651785285356f,(float16_t)0.94610523237040344835f, -(float16_t)-0.32820984357909255280f,(float16_t)0.94460483726148025685f, -(float16_t)-0.33255336986604405736f,(float16_t)0.94308443746609349478f, -(float16_t)-0.33688985339221994009f,(float16_t)0.94154406518302080631f, -(float16_t)-0.34121920232028229991f,(float16_t)0.93998375303401404679f, -(float16_t)-0.34554132496398903829f,(float16_t)0.93840353406310816897f, -(float16_t)-0.34985612979013491763f,(float16_t)0.93680344173592156043f, -(float16_t)-0.35416352542049039931f,(float16_t)0.93518350993894761025f, -(float16_t)-0.35846342063373642928f,(float16_t)0.93354377297883628373f, -(float16_t)-0.36275572436739711435f,(float16_t)0.93188426558166814750f, -(float16_t)-0.36704034571976712487f,(float16_t)0.93020502289221906889f, -(float16_t)-0.37131719395183748755f,(float16_t)0.92850608047321558924f, -(float16_t)-0.37558617848921721505f,(float16_t)0.92678747430458174872f, -(float16_t)-0.37984720892405099413f,(float16_t)0.92504924078267769527f, -(float16_t)-0.38410019501693493105f,(float16_t)0.92329141671952774661f, -(float16_t)-0.38834504669882619066f,(float16_t)0.92151403934204201285f, -(float16_t)-0.39258167407295141427f,(float16_t)0.91971714629122736095f, -(float16_t)-0.39680998741671030805f,(float16_t)0.91790077562139049672f, -(float16_t)-0.40102989718357567872f,(float16_t)0.91606496579933172075f, -(float16_t)-0.40524131400498974998f,(float16_t)0.91420975570353069095f, -(float16_t)-0.40944414869225753684f,(float16_t)0.91233518462332285903f, -(float16_t)-0.41363831223843450235f,(float16_t)0.91044129225806724737f, -(float16_t)-0.41782371582021227141f,(float16_t)0.90852811871630612117f, -(float16_t)-0.42200027079979968159f,(float16_t)0.90659570451491533483f, -(float16_t)-0.42616788872679967071f,(float16_t)0.90464409057824612947f, -(float16_t)-0.43032648134008272267f,(float16_t)0.90267331823725871498f, -(float16_t)-0.43447596056965581690f,(float16_t)0.90068342922864685907f, -(float16_t)-0.43861623853852738097f,(float16_t)0.89867446569395392775f, -(float16_t)-0.44274722756456980077f,(float16_t)0.89664647017868026602f, -(float16_t)-0.44686884016237399253f,(float16_t)0.89459948563138280697f, -(float16_t)-0.45098098904510369733f,(float16_t)0.89253355540276468894f, -(float16_t)-0.45508358712634372489f,(float16_t)0.89044872324475798919f, -(float16_t)-0.45917654752194403400f,(float16_t)0.88834503330959635470f, -(float16_t)-0.46325978355186014923f,(float16_t)0.88622253014888063838f, -(float16_t)-0.46733320874198841510f,(float16_t)0.88408125871263498752f, -(float16_t)-0.47139673682599769755f,(float16_t)0.88192126434835504956f, -(float16_t)-0.47545028174715592284f,(float16_t)0.87974259280004740713f, -(float16_t)-0.47949375766015311928f,(float16_t)0.87754529020726124156f, -(float16_t)-0.48352707893291846375f,(float16_t)0.87532940310411100349f, -(float16_t)-0.48755016014843571837f,(float16_t)0.87309497841829020182f, -(float16_t)-0.49156291610654972990f,(float16_t)0.87084206347007897531f, -(float16_t)-0.49556526182577237405f,(float16_t)0.86857070597134100609f, -(float16_t)-0.49955711254508178287f,(float16_t)0.86628095402451310569f, -(float16_t)-0.50353838372571746440f,(float16_t)0.86397285612158680745f, -(float16_t)-0.50750899105297075931f,(float16_t)0.86164646114308141023f, -(float16_t)-0.51146885043797041259f,(float16_t)0.85930181835700847337f, -(float16_t)-0.51541787801946303826f,(float16_t)0.85693897741782865118f, -(float16_t)-0.51935599016558964269f,(float16_t)0.85455798836540053376f, -(float16_t)-0.52328310347565654137f,(float16_t)0.85215890162391971785f, -(float16_t)-0.52719913478190105760f,(float16_t)0.84974176800085265970f, -(float16_t)-0.53110400115125477871f,(float16_t)0.84730663868585853749f, -(float16_t)-0.53499761988709704230f,(float16_t)0.84485356524970722791f, -(float16_t)-0.53887990853100831146f,(float16_t)0.84238259964318595863f, -(float16_t)-0.54275078486451577842f,(float16_t)0.83989379419599952126f, -(float16_t)-0.54661016691083474939f,(float16_t)0.83738720161566193578f, -(float16_t)-0.55045797293660470029f,(float16_t)0.83486287498638012128f, -(float16_t)-0.55429412145362011444f,(float16_t)0.83232086776792968408f, -(float16_t)-0.55811853122055610221f,(float16_t)0.82976123379452304540f, -(float16_t)-0.56193112124468946877f,(float16_t)0.82718402727366902027f, -(float16_t)-0.56573181078361323149f,(float16_t)0.82458930278502517996f, -(float16_t)-0.56952051934694725155f,(float16_t)0.82197711527924144370f, -(float16_t)-0.57329716669804198226f,(float16_t)0.81934752007679712005f, -(float16_t)-0.57706167285567933067f,(float16_t)0.81670057286682795628f, -(float16_t)-0.58081395809576441547f,(float16_t)0.81403632970594852480f, -(float16_t)-0.58455394295301521534f,(float16_t)0.81135484701706384048f, -(float16_t)-0.58828154822264522306f,(float16_t)0.80865618158817509364f, -(float16_t)-0.59199669496204088137f,(float16_t)0.80594039057117639047f, -(float16_t)-0.59569930449243335691f,(float16_t)0.80320753148064494287f, -(float16_t)-0.59938929840056454079f,(float16_t)0.80045766219262282082f, -(float16_t)-0.60306659854034827539f,(float16_t)0.79769084094339104407f, -(float16_t)-0.60673112703452458661f,(float16_t)0.79490712632823690154f, -(float16_t)-0.61038280627630958630f,(float16_t)0.79210657730021227785f, -(float16_t)-0.61402155893103815831f,(float16_t)0.78928925316888587371f, -(float16_t)-0.61764730793780375784f,(float16_t)0.78645521359908587833f, -(float16_t)-0.62125997651108744169f,(float16_t)0.78360451860963831194f, -(float16_t)-0.62485948814238623239f,(float16_t)0.78073722857209459924f, -(float16_t)-0.62844576660183260053f,(float16_t)0.77785340420945314754f, -(float16_t)-0.63201873593980895105f,(float16_t)0.77495310659487393057f, -(float16_t)-0.63557832048855611440f,(float16_t)0.77203639715038452351f, -(float16_t)-0.63912444486377573138f,(float16_t)0.76910333764557958780f, -(float16_t)-0.64265703396622686494f,(float16_t)0.76615399019631280630f, -(float16_t)-0.64617601298331639459f,(float16_t)0.76318841726338115805f, -(float16_t)-0.64968130739068330470f,(float16_t)0.76020668165120230952f, -(float16_t)-0.65317284295377653347f,(float16_t)0.75720884650648467851f, -(float16_t)-0.65665054572942882505f,(float16_t)0.75419497531688928227f, -(float16_t)-0.66011434206742036768f,(float16_t)0.75116513190968658975f, -(float16_t)-0.66356415861203965623f,(float16_t)0.74811938045040371481f, -(float16_t)-0.66699992230363736034f,(float16_t)0.74505778544146605835f, -(float16_t)-0.67042156038017308717f,(float16_t)0.74198041172083106787f, -(float16_t)-0.67382900037875603783f,(float16_t)0.73888732446061522463f, -(float16_t)-0.67722217013718044587f,(float16_t)0.73577858916571359238f, -(float16_t)-0.68060099779545302212f,(float16_t)0.73265427167241281570f, -(float16_t)-0.68396541179731551452f,(float16_t)0.72951443814699701296f, -(float16_t)-0.68731534089175916336f,(float16_t)0.72635915508434589771f, -(float16_t)-0.69065071413453438254f,(float16_t)0.72318848930652757101f, -(float16_t)-0.69397146088965377952f,(float16_t)0.72000250796138176579f, -(float16_t)-0.69727751083088640449f,(float16_t)0.71680127852109964959f, -(float16_t)-0.70056879394324822474f,(float16_t)0.71358486878079363525f, -(float16_t)-0.70384524052448482756f,(float16_t)0.71035334685706241764f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.71035334685706230662f,(float16_t)0.70384524052448504960f, -(float16_t)-0.71358486878079352422f,(float16_t)0.70056879394324833576f, -(float16_t)-0.71680127852109953857f,(float16_t)0.69727751083088651551f, -(float16_t)-0.72000250796138165477f,(float16_t)0.69397146088965389055f, -(float16_t)-0.72318848930652745999f,(float16_t)0.69065071413453460458f, -(float16_t)-0.72635915508434578669f,(float16_t)0.68731534089175927438f, -(float16_t)-0.72951443814699679091f,(float16_t)0.68396541179731562554f, -(float16_t)-0.73265427167241270467f,(float16_t)0.68060099779545324417f, -(float16_t)-0.73577858916571337033f,(float16_t)0.67722217013718055689f, -(float16_t)-0.73888732446061511361f,(float16_t)0.67382900037875614885f, -(float16_t)-0.74198041172083095685f,(float16_t)0.67042156038017319819f, -(float16_t)-0.74505778544146594733f,(float16_t)0.66699992230363758239f, -(float16_t)-0.74811938045040360379f,(float16_t)0.66356415861203976725f, -(float16_t)-0.75116513190968636771f,(float16_t)0.66011434206742047870f, -(float16_t)-0.75419497531688917125f,(float16_t)0.65665054572942904709f, -(float16_t)-0.75720884650648467851f,(float16_t)0.65317284295377664449f, -(float16_t)-0.76020668165120219850f,(float16_t)0.64968130739068341573f, -(float16_t)-0.76318841726338115805f,(float16_t)0.64617601298331661663f, -(float16_t)-0.76615399019631280630f,(float16_t)0.64265703396622708699f, -(float16_t)-0.76910333764557947678f,(float16_t)0.63912444486377584241f, -(float16_t)-0.77203639715038441249f,(float16_t)0.63557832048855622542f, -(float16_t)-0.77495310659487381955f,(float16_t)0.63201873593980906207f, -(float16_t)-0.77785340420945303652f,(float16_t)0.62844576660183271155f, -(float16_t)-0.78073722857209448822f,(float16_t)0.62485948814238634341f, -(float16_t)-0.78360451860963820092f,(float16_t)0.62125997651108755271f, -(float16_t)-0.78645521359908576731f,(float16_t)0.61764730793780386886f, -(float16_t)-0.78928925316888576269f,(float16_t)0.61402155893103838036f, -(float16_t)-0.79210657730021216683f,(float16_t)0.61038280627630969732f, -(float16_t)-0.79490712632823679051f,(float16_t)0.60673112703452469763f, -(float16_t)-0.79769084094339093305f,(float16_t)0.60306659854034838641f, -(float16_t)-0.80045766219262259877f,(float16_t)0.59938929840056465181f, -(float16_t)-0.80320753148064483184f,(float16_t)0.59569930449243346793f, -(float16_t)-0.80594039057117627944f,(float16_t)0.59199669496204099239f, -(float16_t)-0.80865618158817498262f,(float16_t)0.58828154822264533408f, -(float16_t)-0.81135484701706372945f,(float16_t)0.58455394295301532637f, -(float16_t)-0.81403632970594841378f,(float16_t)0.58081395809576452649f, -(float16_t)-0.81670057286682784525f,(float16_t)0.57706167285567944170f, -(float16_t)-0.81934752007679700903f,(float16_t)0.57329716669804209328f, -(float16_t)-0.82197711527924133268f,(float16_t)0.56952051934694747359f, -(float16_t)-0.82458930278502506894f,(float16_t)0.56573181078361345353f, -(float16_t)-0.82718402727366902027f,(float16_t)0.56193112124468957980f, -(float16_t)-0.82976123379452293438f,(float16_t)0.55811853122055632426f, -(float16_t)-0.83232086776792957306f,(float16_t)0.55429412145362022546f, -(float16_t)-0.83486287498638001026f,(float16_t)0.55045797293660492233f, -(float16_t)-0.83738720161566182476f,(float16_t)0.54661016691083497143f, -(float16_t)-0.83989379419599952126f,(float16_t)0.54275078486451588944f, -(float16_t)-0.84238259964318584760f,(float16_t)0.53887990853100842248f, -(float16_t)-0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)-0.84730663868585842646f,(float16_t)0.53110400115125488973f, -(float16_t)-0.84974176800085254868f,(float16_t)0.52719913478190127964f, -(float16_t)-0.85215890162391960683f,(float16_t)0.52328310347565665239f, -(float16_t)-0.85455798836540042274f,(float16_t)0.51935599016558975372f, -(float16_t)-0.85693897741782865118f,(float16_t)0.51541787801946314929f, -(float16_t)-0.85930181835700836235f,(float16_t)0.51146885043797052361f, -(float16_t)-0.86164646114308129921f,(float16_t)0.50750899105297098135f, -(float16_t)-0.86397285612158669643f,(float16_t)0.50353838372571757542f, -(float16_t)-0.86628095402451299467f,(float16_t)0.49955711254508189390f, -(float16_t)-0.86857070597134089507f,(float16_t)0.49556526182577254058f, -(float16_t)-0.87084206347007886428f,(float16_t)0.49156291610654989643f, -(float16_t)-0.87309497841829009079f,(float16_t)0.48755016014843588490f, -(float16_t)-0.87532940310411089246f,(float16_t)0.48352707893291863028f, -(float16_t)-0.87754529020726113053f,(float16_t)0.47949375766015328582f, -(float16_t)-0.87974259280004729611f,(float16_t)0.47545028174715608937f, -(float16_t)-0.88192126434835493853f,(float16_t)0.47139673682599780857f, -(float16_t)-0.88408125871263487650f,(float16_t)0.46733320874198858164f, -(float16_t)-0.88622253014888052736f,(float16_t)0.46325978355186031576f, -(float16_t)-0.88834503330959624368f,(float16_t)0.45917654752194420054f, -(float16_t)-0.89044872324475787817f,(float16_t)0.45508358712634389143f, -(float16_t)-0.89253355540276457791f,(float16_t)0.45098098904510386387f, -(float16_t)-0.89459948563138269595f,(float16_t)0.44686884016237415906f, -(float16_t)-0.89664647017868026602f,(float16_t)0.44274722756456996731f, -(float16_t)-0.89867446569395392775f,(float16_t)0.43861623853852754751f, -(float16_t)-0.90068342922864674804f,(float16_t)0.43447596056965598343f, -(float16_t)-0.90267331823725871498f,(float16_t)0.43032648134008288920f, -(float16_t)-0.90464409057824612947f,(float16_t)0.42616788872679983724f, -(float16_t)-0.90659570451491533483f,(float16_t)0.42200027079979984812f, -(float16_t)-0.90852811871630612117f,(float16_t)0.41782371582021243794f, -(float16_t)-0.91044129225806713634f,(float16_t)0.41363831223843466889f, -(float16_t)-0.91233518462332274801f,(float16_t)0.40944414869225770337f, -(float16_t)-0.91420975570353069095f,(float16_t)0.40524131400498991651f, -(float16_t)-0.91606496579933172075f,(float16_t)0.40102989718357562321f, -(float16_t)-0.91790077562139049672f,(float16_t)0.39680998741671025254f, -(float16_t)-0.91971714629122736095f,(float16_t)0.39258167407295141427f, -(float16_t)-0.92151403934204179080f,(float16_t)0.38834504669882657923f, -(float16_t)-0.92329141671952752457f,(float16_t)0.38410019501693531963f, -(float16_t)-0.92504924078267747323f,(float16_t)0.37984720892405138271f, -(float16_t)-0.92678747430458174872f,(float16_t)0.37558617848921738158f, -(float16_t)-0.92850608047321547822f,(float16_t)0.37131719395183770960f, -(float16_t)-0.93020502289221906889f,(float16_t)0.36704034571976729140f, -(float16_t)-0.93188426558166803648f,(float16_t)0.36275572436739728088f, -(float16_t)-0.93354377297883617270f,(float16_t)0.35846342063373659581f, -(float16_t)-0.93518350993894761025f,(float16_t)0.35416352542049039931f, -(float16_t)-0.93680344173592167145f,(float16_t)0.34985612979013486212f, -(float16_t)-0.93840353406310816897f,(float16_t)0.34554132496398898278f, -(float16_t)-0.93998375303401382475f,(float16_t)0.34121920232028268849f, -(float16_t)-0.94154406518302069529f,(float16_t)0.33688985339222032867f, -(float16_t)-0.94308443746609338376f,(float16_t)0.33255336986604444593f, -(float16_t)-0.94460483726148014583f,(float16_t)0.32820984357909271933f, -(float16_t)-0.94610523237040333733f,(float16_t)0.32385936651785302010f, -(float16_t)-0.94758559101774109124f,(float16_t)0.31950203081601580291f, -(float16_t)-0.94904588185270055689f,(float16_t)0.31513792875252250036f, -(float16_t)-0.95048607394948170235f,(float16_t)0.31076715274961153046f, -(float16_t)-0.95190613680793234597f,(float16_t)0.30638979537086091787f, -(float16_t)-0.95330604035419386211f,(float16_t)0.30200594931922802866f, -(float16_t)-0.95468575494133833814f,(float16_t)0.29761570743508614090f, -(float16_t)-0.95604525134999629454f,(float16_t)0.29321916269425896129f, -(float16_t)-0.95738450078897585627f,(float16_t)0.28881640820604975728f, -(float16_t)-0.95870347489587148804f,(float16_t)0.28440753721127209896f, -(float16_t)-0.96000214573766584625f,(float16_t)0.27999264308027344006f, -(float16_t)-0.96128048581132063966f,(float16_t)0.27557181931095831029f, -(float16_t)-0.96253846804435916340f,(float16_t)0.27114515952680812161f, -(float16_t)-0.96377606579543984022f,(float16_t)0.26671275747489847641f, -(float16_t)-0.96499325285492032478f,(float16_t)0.26227470702391370017f, -(float16_t)-0.96619000344541250413f,(float16_t)0.25783110216215898713f, -(float16_t)-0.96736629222232850545f,(float16_t)0.25338203699557010351f, -(float16_t)-0.96852209427441737777f,(float16_t)0.24892760574572009302f, -(float16_t)-0.96965738512429233698f,(float16_t)0.24446790274782448371f, -(float16_t)-0.97077214072895023911f,(float16_t)0.24000302244874177626f, -(float16_t)-0.97186633748027928537f,(float16_t)0.23553305940497573645f, -(float16_t)-0.97293995220556006576f,(float16_t)0.23105810828067133156f, -(float16_t)-0.97399296216795583359f,(float16_t)0.22657826384561016719f, -(float16_t)-0.97502534506699412020f,(float16_t)0.22209362097320364815f, -(float16_t)-0.97603707903903902388f,(float16_t)0.21760427463848372454f, -(float16_t)-0.97702814265775439484f,(float16_t)0.21311031991609141745f, -(float16_t)-0.97799851493455713936f,(float16_t)0.20861185197826351279f, -(float16_t)-0.97894817531906219710f,(float16_t)0.20410896609281684033f, -(float16_t)-0.97987710369951763756f,(float16_t)0.19960175762113091524f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)-0.98167268619698311305f,(float16_t)0.19057475482025307278f, -(float16_t)-0.98253930228744124076f,(float16_t)0.18605515166344691047f, -(float16_t)-0.98338511032155118130f,(float16_t)0.18153160826112521575f, -(float16_t)-0.98421009238692902521f,(float16_t)0.17700422041214894375f, -(float16_t)-0.98501423101223983814f,(float16_t)0.17247308399679611712f, -(float16_t)-0.98579750916756736512f,(float16_t)0.16793829497473128365f, -(float16_t)-0.98655991026477540817f,(float16_t)0.16339994938297328075f, -(float16_t)-0.98730141815785843473f,(float16_t)0.15885814333386147346f, -(float16_t)-0.98802201714328352633f,(float16_t)0.15431297301302007718f, -(float16_t)-0.98872169196032377858f,(float16_t)0.14976453467732145364f, -(float16_t)-0.98940042779138037687f,(float16_t)0.14521292465284735274f, -(float16_t)-0.99005821026229701154f,(float16_t)0.14065823933284954395f, -(float16_t)-0.99069502544266463406f,(float16_t)0.13610057517570647856f, -(float16_t)-0.99131085984611544415f,(float16_t)0.13154002870288333815f, -(float16_t)-0.99190570043060932726f,(float16_t)0.12697669649688606008f, -(float16_t)-0.99247953459870996706f,(float16_t)0.12241067519921634832f, -(float16_t)-0.99303235019785141002f,(float16_t)0.11784206150832508830f, -(float16_t)-0.99356413552059530403f,(float16_t)0.11327095217756441570f, -(float16_t)-0.99407487930487936634f,(float16_t)0.10869744401313874427f, -(float16_t)-0.99456457073425541537f,(float16_t)0.10412163387205457254f, -(float16_t)-0.99503319943811863180f,(float16_t)0.09954361866006927739f, -(float16_t)-0.99548075549192693856f,(float16_t)0.09496349532963890838f, -(float16_t)-0.99590722941741172125f,(float16_t)0.09038136087786528827f, -(float16_t)-0.99631261218277800129f,(float16_t)0.08579731234444015753f, -(float16_t)-0.99669689520289606044f,(float16_t)0.08121144680959266338f, -(float16_t)-0.99706007033948296225f,(float16_t)0.07662386139203168633f, -(float16_t)-0.99740212990127530279f,(float16_t)0.07203465324688947125f, -(float16_t)-0.99772306664419163624f,(float16_t)0.06744391956366417584f, -(float16_t)-0.99802287377148624081f,(float16_t)0.06285175756416148951f, -(float16_t)-0.99830154493389289261f,(float16_t)0.05825826450043579408f, -(float16_t)-0.99855907422975931365f,(float16_t)0.05366353765273051968f, -(float16_t)-0.99879545620517240501f,(float16_t)0.04906767432741796636f, -(float16_t)-0.99901068585407337697f,(float16_t)0.04447077185493858442f, -(float16_t)-0.99920475861836388631f,(float16_t)0.03987292758774012985f, -(float16_t)-0.99937767038800284780f,(float16_t)0.03527423889821423159f, -(float16_t)-0.99952941750109314256f,(float16_t)0.03067480317663686534f, -(float16_t)-0.99965999674395922270f,(float16_t)0.02607471782910409860f, -(float16_t)-0.99976940535121527898f,(float16_t)0.02147408027546966747f, -(float16_t)-0.99985764100582386060f,(float16_t)0.01687298794728183532f, -(float16_t)-0.99992470183914450299f,(float16_t)0.01227153828572000692f, -(float16_t)-0.99997058643097413988f,(float16_t)0.00766982873953113778f, -(float16_t)-0.99999529380957619118f,(float16_t)0.00306795676296597701f, -(float16_t)-0.99999882345170187925f,(float16_t)-0.00153398018628480431f, -(float16_t)-0.99998117528260110909f,(float16_t)-0.00613588464915455420f, -(float16_t)-0.99994234967602391162f,(float16_t)-0.01073765916726416615f, -(float16_t)-0.99988234745421256111f,(float16_t)-0.01533920628498781566f, -(float16_t)-0.99980116988788425569f,(float16_t)-0.01994042855151419158f, -(float16_t)-0.99969881869620424997f,(float16_t)-0.02454122852291207996f, -(float16_t)-0.99957529604674921764f,(float16_t)-0.02914150876419355565f, -(float16_t)-0.99943060455546173237f,(float16_t)-0.03374117185137745500f, -(float16_t)-0.99926474728659442359f,(float16_t)-0.03834012037355261082f, -(float16_t)-0.99907772775264536147f,(float16_t)-0.04293825693494077861f, -(float16_t)-0.99886954991428356099f,(float16_t)-0.04753548415695929563f, -(float16_t)-0.99864021818026527111f,(float16_t)-0.05213170468028335142f, -(float16_t)-0.99838973740734016094f,(float16_t)-0.05672682116690781762f, -(float16_t)-0.99811811290014917919f,(float16_t)-0.06132073630220824523f, -(float16_t)-0.99782535041111164453f,(float16_t)-0.06591335279700352712f, -(float16_t)-0.99751145614030345410f,(float16_t)-0.07050457338961360620f, -(float16_t)-0.99717643673532618820f,(float16_t)-0.07509430084792109716f, -(float16_t)-0.99682029929116577893f,(float16_t)-0.07968243797142994522f, -(float16_t)-0.99644305135004263008f,(float16_t)-0.08426888759332393231f, -(float16_t)-0.99604470090125196702f,(float16_t)-0.08885355258252450317f, -(float16_t)-0.99562525638099430569f,(float16_t)-0.09343633584574773110f, -(float16_t)-0.99518472667219692873f,(float16_t)-0.09801714032956058975f, -(float16_t)-0.99472312110432570265f,(float16_t)-0.10259586902243630901f, -(float16_t)-0.99424044945318790223f,(float16_t)-0.10717242495680891212f, -(float16_t)-0.99373672194072470987f,(float16_t)-0.11174671121112625394f, -(float16_t)-0.99321194923479461103f,(float16_t)-0.11631863091190447479f, -(float16_t)-0.99266614244894801899f,(float16_t)-0.12088808723577681992f, -(float16_t)-0.99209931314219179654f,(float16_t)-0.12545498341154601163f, -(float16_t)-0.99151147331874400770f,(float16_t)-0.13001922272223317978f, -(float16_t)-0.99090263542778000971f,(float16_t)-0.13458070850712605671f, -(float16_t)-0.99027281236316910817f,(float16_t)-0.13913934416382611747f, -(float16_t)-0.98962201746320088702f,(float16_t)-0.14369503315029438784f, -(float16_t)-0.98895026451030298986f,(float16_t)-0.14824767898689603096f, -(float16_t)-0.98825756773074946437f,(float16_t)-0.15279718525844343535f, -(float16_t)-0.98754394179435922574f,(float16_t)-0.15734345561623830356f, -(float16_t)-0.98680940181418552726f,(float16_t)-0.16188639378011149272f, -(float16_t)-0.98605396334619543897f,(float16_t)-0.16642590354046382650f, -(float16_t)-0.98527764238894133264f,(float16_t)-0.17096188876030096737f, -(float16_t)-0.98448045538322093151f,(float16_t)-0.17549425337727120322f, -(float16_t)-0.98366241921173025453f,(float16_t)-0.18002290140569934818f, -(float16_t)-0.98282355119870534743f,(float16_t)-0.18454773693861947770f, -(float16_t)-0.98196386910955524296f,(float16_t)-0.18906866414980610935f, -(float16_t)-0.98108339115048670553f,(float16_t)-0.19358558729580355173f, -(float16_t)-0.98018213596811742949f,(float16_t)-0.19809841071795356027f, -(float16_t)-0.97926012264908202098f,(float16_t)-0.20260703884442113343f, -(float16_t)-0.97831737071962765473f,(float16_t)-0.20711137619221858808f, -(float16_t)-0.97735390014519996082f,(float16_t)-0.21161132736922766417f, -(float16_t)-0.97636973133002125103f,(float16_t)-0.21610679707621921475f, -(float16_t)-0.97536488511665697665f,(float16_t)-0.22059769010887325669f, -(float16_t)-0.97433938278557585821f,(float16_t)-0.22508391135979261000f, -(float16_t)-0.97329324605469824672f,(float16_t)-0.22956536582051870199f, -(float16_t)-0.97222649707893638027f,(float16_t)-0.23404195858354326365f, -(float16_t)-0.97113915844972520386f,(float16_t)-0.23851359484431830515f, -(float16_t)-0.97003125319454397424f,(float16_t)-0.24298017990326381543f, -(float16_t)-0.96890280477642887202f,(float16_t)-0.24744161916777326904f, -(float16_t)-0.96775383709347551076f,(float16_t)-0.25189781815421696809f, -(float16_t)-0.96658437447833311928f,(float16_t)-0.25634868248994291395f, -(float16_t)-0.96539444169768939830f,(float16_t)-0.26079411791527562503f, -(float16_t)-0.96418406395174582890f,(float16_t)-0.26523403028551151284f, -(float16_t)-0.96295326687368398844f,(float16_t)-0.26966832557291481320f, -(float16_t)-0.96170207652912265139f,(float16_t)-0.27409690986870616225f, -(float16_t)-0.96043051941556589757f,(float16_t)-0.27851968938505289319f, -(float16_t)-0.95913862246184200533f,(float16_t)-0.28293657045705516984f, -(float16_t)-0.95782641302753290802f,(float16_t)-0.28734745954472939999f, -(float16_t)-0.95649391890239510161f,(float16_t)-0.29175226323498920644f, -(float16_t)-0.95514116830577078243f,(float16_t)-0.29615088824362378883f, -(float16_t)-0.95376818988599032512f,(float16_t)-0.30054324141727345454f, -(float16_t)-0.95237501271976587880f,(float16_t)-0.30492922973540242948f, -(float16_t)-0.95096166631157508231f,(float16_t)-0.30930876031226878231f, -(float16_t)-0.94952818059303678577f,(float16_t)-0.31368174039889118454f, -(float16_t)-0.94807458592227633609f,(float16_t)-0.31804807738501467140f, -(float16_t)-0.94660091308328364601f,(float16_t)-0.32240767880106963039f, -(float16_t)-0.94510719328526060501f,(float16_t)-0.32676045232013156694f, -(float16_t)-0.94359345816196038559f,(float16_t)-0.33110630575987626267f, -(float16_t)-0.94205973977101742367f,(float16_t)-0.33544514708453149199f, -(float16_t)-0.94050607059326840620f,(float16_t)-0.33977688440682679571f, -(float16_t)-0.93893248353206459900f,(float16_t)-0.34410142598993881391f, -(float16_t)-0.93733901191257495977f,(float16_t)-0.34841868024943456472f, -(float16_t)-0.93572568948108036935f,(float16_t)-0.35272855575521072646f, -(float16_t)-0.93409255040425887007f,(float16_t)-0.35703096123343008861f, -(float16_t)-0.93243962926846246653f,(float16_t)-0.36132580556845395048f, -(float16_t)-0.93076696107898382326f,(float16_t)-0.36561299780477357624f, -(float16_t)-0.92907458125931585702f,(float16_t)-0.36989244714893387833f, -(float16_t)-0.92736252565040111495f,(float16_t)-0.37416406297145782256f, -(float16_t)-0.92563083050987282618f,(float16_t)-0.37842775480876539307f, -(float16_t)-0.92387953251128684951f,(float16_t)-0.38268343236508967076f, -(float16_t)-0.92210866874334518339f,(float16_t)-0.38693100551438852630f, -(float16_t)-0.92031827670911059425f,(float16_t)-0.39117038430225381518f, -(float16_t)-0.91850839432521225181f,(float16_t)-0.39540147894781629834f, -(float16_t)-0.91667905992104270485f,(float16_t)-0.39962419984564684361f, -(float16_t)-0.91483031223794608611f,(float16_t)-0.40383845756765418544f, -(float16_t)-0.91296219042839832358f,(float16_t)-0.40804416286497835475f, -(float16_t)-0.91107473405517647169f,(float16_t)-0.41224122666988260999f, -(float16_t)-0.90916798309052249127f,(float16_t)-0.41642956009763693048f, -(float16_t)-0.90724197791529592738f,(float16_t)-0.42060907444840234248f, -(float16_t)-0.90529675931811881551f,(float16_t)-0.42477968120910863936f, -(float16_t)-0.90333236849451192807f,(float16_t)-0.42894129205532938176f, -(float16_t)-0.90134884704602202810f,(float16_t)-0.43309381885315184624f, -(float16_t)-0.89934623697934157338f,(float16_t)-0.43723717366104403181f, -(float16_t)-0.89732458070541831763f,(float16_t)-0.44137126873171667052f, -(float16_t)-0.89528392103855747308f,(float16_t)-0.44549601651398174074f, -(float16_t)-0.89322430119551532446f,(float16_t)-0.44961132965460665067f, -(float16_t)-0.89114576479458340597f,(float16_t)-0.45371712100016353686f, -(float16_t)-0.88904835585466468473f,(float16_t)-0.45781330359887695280f, -(float16_t)-0.88693211879434230571f,(float16_t)-0.46189979070246250936f, -(float16_t)-0.88479709843093790056f,(float16_t)-0.46597649576796595916f, -(float16_t)-0.88264333997956290201f,(float16_t)-0.47004333245959545318f, -(float16_t)-0.88047088905216086552f,(float16_t)-0.47410021465054985601f, -(float16_t)-0.87827979165654157523f,(float16_t)-0.47814705642484295334f, -(float16_t)-0.87607009419540660122f,(float16_t)-0.48218377207912266336f, -(float16_t)-0.87384184346536686316f,(float16_t)-0.48621027612448636246f, -(float16_t)-0.87159508665595109012f,(float16_t)-0.49022648328829115938f, -(float16_t)-0.86932987134860673084f,(float16_t)-0.49423230851595978397f, -(float16_t)-0.86704624551569287050f,(float16_t)-0.49822766697278153547f, -(float16_t)-0.86474425751946248919f,(float16_t)-0.50221247404571056627f, -(float16_t)-0.86242395611104072373f,(float16_t)-0.50618664534515500630f, -(float16_t)-0.86008539042939025077f,(float16_t)-0.51015009670676658704f, -(float16_t)-0.85772861000027211809f,(float16_t)-0.51410274419322155026f, -(float16_t)-0.85535366473519613972f,(float16_t)-0.51804450409599922533f, -(float16_t)-0.85296060493036374162f,(float16_t)-0.52197529293715427823f, -(float16_t)-0.85054948126560347976f,(float16_t)-0.52589502747108463065f, -(float16_t)-0.84812034480329723252f,(float16_t)-0.52980362468629460526f, -(float16_t)-0.84567324698729906540f,(float16_t)-0.53370100180715296379f, -(float16_t)-0.84320823964184543620f,(float16_t)-0.53758707629564550512f, -(float16_t)-0.84072537497045818355f,(float16_t)-0.54146176585312322249f, -(float16_t)-0.83822470555483818977f,(float16_t)-0.54532498842204613076f, -(float16_t)-0.83570628435375271525f,(float16_t)-0.54917666218771943321f, -(float16_t)-0.83317016470191329613f,(float16_t)-0.55301670558002735678f, -(float16_t)-0.83061640030884642538f,(float16_t)-0.55684503727515988203f, -(float16_t)-0.82804504525775590729f,(float16_t)-0.56066157619733592021f, -(float16_t)-0.82545615400437755138f,(float16_t)-0.56446624152051938506f, -(float16_t)-0.82284978137582642788f,(float16_t)-0.56825895267013148970f, -(float16_t)-0.82022598256943468620f,(float16_t)-0.57203962932475704850f, -(float16_t)-0.81758481315158371139f,(float16_t)-0.57580819141784533866f, -(float16_t)-0.81492632905652662156f,(float16_t)-0.57956455913940574387f, -(float16_t)-0.81225058658520388200f,(float16_t)-0.58330865293769829094f, -(float16_t)-0.80955764240405148069f,(float16_t)-0.58704039352091774706f, -(float16_t)-0.80684755354379944503f,(float16_t)-0.59075970185887394237f, -(float16_t)-0.80412037739826591753f,(float16_t)-0.59446649918466420992f, -(float16_t)-0.80137617172314035141f,(float16_t)-0.59816070699634216190f, -(float16_t)-0.79861499463476093297f,(float16_t)-0.60184224705857991555f, -(float16_t)-0.79583690460888356633f,(float16_t)-0.60551104140432543410f, -(float16_t)-0.79304196047944375270f,(float16_t)-0.60916701233645309532f, -(float16_t)-0.79023022143731003197f,(float16_t)-0.61281008242940970820f, -(float16_t)-0.78740174702903142911f,(float16_t)-0.61644017453085364622f, -(float16_t)-0.78455659715557524159f,(float16_t)-0.62005721176328920663f, -(float16_t)-0.78169483207105938671f,(float16_t)-0.62366111752569464155f, -(float16_t)-0.77881651238147620031f,(float16_t)-0.62725181549514386070f, -(float16_t)-0.77592169904340779762f,(float16_t)-0.63082922962842424841f, -(float16_t)-0.77301045336273710440f,(float16_t)-0.63439328416364526575f, -(float16_t)-0.77008283699334811878f,(float16_t)-0.63794390362184394405f, -(float16_t)-0.76713891193582051109f,(float16_t)-0.64148101280858305095f, -(float16_t)-0.76417874053611678509f,(float16_t)-0.64500453681554381635f, -(float16_t)-0.76120238548426188974f,(float16_t)-0.64851440102211233008f, -(float16_t)-0.75820990981301539247f,(float16_t)-0.65201053109695950027f, -(float16_t)-0.75520137689653654700f,(float16_t)-0.65549285299961534967f, -(float16_t)-0.75217685044904269986f,(float16_t)-0.65896129298203731661f, -(float16_t)-0.74913639452345925918f,(float16_t)-0.66241577759017178373f, -(float16_t)-0.74608007351006400132f,(float16_t)-0.66585623366550938940f, -(float16_t)-0.74300795213512194071f,(float16_t)-0.66928258834663578725f, -(float16_t)-0.73992009545951631377f,(float16_t)-0.67269476907077274674f, -(float16_t)-0.73681656887737001504f,(float16_t)-0.67609270357531581208f, -(float16_t)-0.73369743811466037187f,(float16_t)-0.67947631989936485564f, -(float16_t)-0.73056276922782770189f,(float16_t)-0.68284554638524797010f, -(float16_t)-0.72741262860237587695f,(float16_t)-0.68620031168003847721f, -(float16_t)-0.72424708295146700276f,(float16_t)-0.68954054473706682948f, -(float16_t)-0.72106619931450810501f,(float16_t)-0.69286617481742462932f, -(float16_t)-0.71787004505573170920f,(float16_t)-0.69617713149146298601f, -(float16_t)-0.71465868786276898206f,(float16_t)-0.69947334464028387835f, -(float16_t)-0.71143219574521665560f,(float16_t)-0.70275474445722507788f, -(float16_t)-0.70819063703319551362f,(float16_t)-0.70602126144933952112f, -(float16_t)-0.70493408037590510329f,(float16_t)-0.70927282643886546687f, -(float16_t)-0.70166259474016867692f,(float16_t)-0.71250937056469221265f, -(float16_t)-0.69837624940897302661f,(float16_t)-0.71573082528381848366f, -(float16_t)-0.69507511398000099145f,(float16_t)-0.71893712237280438249f, -(float16_t)-0.69175925836415785852f,(float16_t)-0.72212819392921523409f, -(float16_t)-0.68842875278409054740f,(float16_t)-0.72530397237306065694f, -(float16_t)-0.68508366777270035541f,(float16_t)-0.72846439044822519637f, -(float16_t)-0.68172407417164981869f,(float16_t)-0.73160938122389251870f, -(float16_t)-0.67835004312986146857f,(float16_t)-0.73473887809596349907f, -(float16_t)-0.67496164610201225820f,(float16_t)-0.73785281478846576064f, -(float16_t)-0.67155895484701866316f,(float16_t)-0.74095112535495888384f, -(float16_t)-0.66814204142651867357f,(float16_t)-0.74403374417992906853f, -(float16_t)-0.66471097820334501538f,(float16_t)-0.74710060598017991040f, -(float16_t)-0.66126583783999237642f,(float16_t)-0.75015164580621496171f, -(float16_t)-0.65780669329707874837f,(float16_t)-0.75318679904361240940f, -(float16_t)-0.65433361783180066240f,(float16_t)-0.75620600141439442421f, -(float16_t)-0.65084668499638098638f,(float16_t)-0.75920918897838796102f, -(float16_t)-0.64734596863651250320f,(float16_t)-0.76219629813457856482f, -(float16_t)-0.64383154288979149715f,(float16_t)-0.76516726562245895860f, -(float16_t)-0.64030348218415200634f,(float16_t)-0.76812202852336519676f, -(float16_t)-0.63676186123628419899f,(float16_t)-0.77106052426181381776f, -(float16_t)-0.63320675505005752370f,(float16_t)-0.77398269060682256537f, -(float16_t)-0.62963823891492687324f,(float16_t)-0.77688846567323255332f, -(float16_t)-0.62605638840434374437f,(float16_t)-0.77977778792301433164f, -(float16_t)-0.62246127937414974518f,(float16_t)-0.78265059616657584041f, -(float16_t)-0.61885298796097643059f,(float16_t)-0.78550682956405382118f, -(float16_t)-0.61523159058062726334f,(float16_t)-0.78834642762660589455f, -(float16_t)-0.61159716392646201744f,(float16_t)-0.79116933021769009216f, -(float16_t)-0.60794978496777407617f,(float16_t)-0.79397547755433683925f, -(float16_t)-0.60428953094815607283f,(float16_t)-0.79676481020841871672f, -(float16_t)-0.60061647938386930612f,(float16_t)-0.79953726910790479110f, -(float16_t)-0.59693070806219639124f,(float16_t)-0.80229279553811572168f, -(float16_t)-0.59323229503980012822f,(float16_t)-0.80503133114296343553f, -(float16_t)-0.58952131864106382952f,(float16_t)-0.80775281792619046950f, -(float16_t)-0.58579785745643908612f,(float16_t)-0.81045719825259465718f, -(float16_t)-0.58206199034077532595f,(float16_t)-0.81314441484925370496f, -(float16_t)-0.57831379641165570060f,(float16_t)-0.81581441080673366972f, -(float16_t)-0.57455335504771631872f,(float16_t)-0.81846712958029832485f, -(float16_t)-0.57078074588696736669f,(float16_t)-0.82110251499110464835f, -(float16_t)-0.56699604882510901138f,(float16_t)-0.82372051122739109452f, -(float16_t)-0.56319934401383409117f,(float16_t)-0.82632106284566342325f, -(float16_t)-0.55939071185913646911f,(float16_t)-0.82890411477186465294f, -(float16_t)-0.55557023301960217765f,(float16_t)-0.83146961230254523567f, -(float16_t)-0.55173798840470766880f,(float16_t)-0.83401750110601791111f, -(float16_t)-0.54789405917310007865f,(float16_t)-0.83654772722351211645f, -(float16_t)-0.54403852673088415326f,(float16_t)-0.83906023707031252012f, -(float16_t)-0.54017147272989274320f,(float16_t)-0.84155497743689855472f, -(float16_t)-0.53629297906596329337f,(float16_t)-0.84403189549006629733f, -(float16_t)-0.53240312787719845655f,(float16_t)-0.84649093877405179320f, -(float16_t)-0.52850200154222859439f,(float16_t)-0.84893205521163961347f, -(float16_t)-0.52458968267846928235f,(float16_t)-0.85135519310526486247f, -(float16_t)-0.52066625414036715735f,(float16_t)-0.85376030113811141042f, -(float16_t)-0.51673179901765020627f,(float16_t)-0.85614732837519424979f, -(float16_t)-0.51278640063356295542f,(float16_t)-0.85851622426444285097f, -(float16_t)-0.50883014254310732216f,(float16_t)-0.86086693863776708735f, -(float16_t)-0.50486310853126736831f,(float16_t)-0.86319942171212427073f, -(float16_t)-0.50088538261124104789f,(float16_t)-0.86551362409056897818f, -(float16_t)-0.49689704902265435793f,(float16_t)-0.86780949676330332299f, -(float16_t)-0.49289819222978420443f,(float16_t)-0.87008699110871134952f, -(float16_t)-0.48888889691976367136f,(float16_t)-0.87234605889439120752f, -(float16_t)-0.48486924800079117537f,(float16_t)-0.87458665227817611321f, -(float16_t)-0.48083933060033440254f,(float16_t)-0.87680872380914542941f, -(float16_t)-0.47679923006332214364f,(float16_t)-0.87901222642863341417f, -(float16_t)-0.47274903195034317926f,(float16_t)-0.88119711347122187117f, -(float16_t)-0.46868882203582790114f,(float16_t)-0.88336333866573157891f, -(float16_t)-0.46461868630623814891f,(float16_t)-0.88551085613619973103f, -(float16_t)-0.46053871095823989412f,(float16_t)-0.88763962040285404598f, -(float16_t)-0.45644898239688419528f,(float16_t)-0.88974958638307266590f, -(float16_t)-0.45234958723377066692f,(float16_t)-0.89184070939234283415f, -(float16_t)-0.44824061228522010802f,(float16_t)-0.89391294514520314163f, -(float16_t)-0.44412214457042975546f,(float16_t)-0.89596624975618488484f, -(float16_t)-0.43999427130963336685f,(float16_t)-0.89800057974073976830f, -(float16_t)-0.43585707992225597440f,(float16_t)-0.90001589201615994629f, -(float16_t)-0.43171065802505731446f,(float16_t)-0.90201214390249317976f, -(float16_t)-0.42755509343028247349f,(float16_t)-0.90398929312344311615f, -(float16_t)-0.42339047414379599177f,(float16_t)-0.90594729780726845902f, -(float16_t)-0.41921688836322429372f,(float16_t)-0.90788611648766603945f, -(float16_t)-0.41503442447608152044f,(float16_t)-0.90980570810465233311f, -(float16_t)-0.41084317105790418845f,(float16_t)-0.91170603200542976730f, -(float16_t)-0.40664321687036886210f,(float16_t)-0.91358704794525091852f, -(float16_t)-0.40243465085941865222f,(float16_t)-0.91544871608826772214f, -(float16_t)-0.39821756215337417162f,(float16_t)-0.91729099700837768427f, -(float16_t)-0.39399204006104820985f,(float16_t)-0.91911385169005765938f, -(float16_t)-0.38975817406985696634f,(float16_t)-0.92091724152918930102f, -(float16_t)-0.38551605384391890441f,(float16_t)-0.92270112833387851747f, -(float16_t)-0.38126576922216276477f,(float16_t)-0.92446547432526249288f, -(float16_t)-0.37700741021641820394f,(float16_t)-0.92621024213831137928f, -(float16_t)-0.37274106700951614712f,(float16_t)-0.92793539482261766516f, -(float16_t)-0.36846682995337221023f,(float16_t)-0.92964089584318132520f, -(float16_t)-0.36418478956708016936f,(float16_t)-0.93132670908118031505f, -(float16_t)-0.35989503653498794433f,(float16_t)-0.93299279883473895669f, -(float16_t)-0.35559766170478407377f,(float16_t)-0.93463912981968066962f, -(float16_t)-0.35129275608556687072f,(float16_t)-0.93626566717027837061f, -(float16_t)-0.34698041084592379235f,(float16_t)-0.93787237643998977443f, -(float16_t)-0.34266071731199487793f,(float16_t)-0.93945922360218969693f, -(float16_t)-0.33833376696554123830f,(float16_t)-0.94102617505088925753f, -(float16_t)-0.33399965144200982614f,(float16_t)-0.94257319760144675502f, -(float16_t)-0.32965846252858749255f,(float16_t)-0.94410025849127265918f, -(float16_t)-0.32531029216226331480f,(float16_t)-0.94560732538052116869f, -(float16_t)-0.32095523242787515894f,(float16_t)-0.94709436635277721717f, -(float16_t)-0.31659337555616617887f,(float16_t)-0.94856134991573015647f, -(float16_t)-0.31222481392182477311f,(float16_t)-0.95000824500184311017f, -(float16_t)-0.30784964004153508865f,(float16_t)-0.95143502096900833820f, -(float16_t)-0.30346794657201103806f,(float16_t)-0.95284164760119871573f, -(float16_t)-0.29907982630804058610f,(float16_t)-0.95422809510910555630f, -(float16_t)-0.29468537218051488180f,(float16_t)-0.95559433413077088382f, -(float16_t)-0.29028467725446244208f,(float16_t)-0.95694033573220882438f, -(float16_t)-0.28587783472708105936f,(float16_t)-0.95826607140801756124f, -(float16_t)-0.28146493792575794091f,(float16_t)-0.95957151308198451733f, -(float16_t)-0.27704608030610028413f,(float16_t)-0.96085663310767954748f, -(float16_t)-0.27262135544994886560f,(float16_t)-0.96212140426904158019f, -(float16_t)-0.26819085706340350939f,(float16_t)-0.96336579978095393528f, -(float16_t)-0.26375467897483123592f,(float16_t)-0.96458979328981275803f, -(float16_t)-0.25931291513288645678f,(float16_t)-0.96579335887408357397f, -(float16_t)-0.25486565960451434965f,(float16_t)-0.96697647104485218161f, -(float16_t)-0.25041300657296539089f,(float16_t)-0.96813910474636233339f, -(float16_t)-0.24595505033579515008f,(float16_t)-0.96928123535654830967f, -(float16_t)-0.24149188530286941345f,(float16_t)-0.97040283868755550234f, -(float16_t)-0.23702360599436766986f,(float16_t)-0.97150389098625167250f, -(float16_t)-0.23255030703877521692f,(float16_t)-0.97258436893473221296f, -(float16_t)-0.22807208317088611960f,(float16_t)-0.97364424965081186603f, -(float16_t)-0.22358902922978990402f,(float16_t)-0.97468351068851066810f, -(float16_t)-0.21910124015687010290f,(float16_t)-0.97570213003852845901f, -(float16_t)-0.21460881099378659176f,(float16_t)-0.97670008612871184184f, -(float16_t)-0.21011183688046985996f,(float16_t)-0.97767735782450992943f, -(float16_t)-0.20561041305309901706f,(float16_t)-0.97863392442942320759f, -(float16_t)-0.20110463484209206708f,(float16_t)-0.97956976568544051887f, -(float16_t)-0.19659459767008077846f,(float16_t)-0.98048486177346927395f, -(float16_t)-0.19208039704989252061f,(float16_t)-0.98137919331375456089f, -(float16_t)-0.18756212858253007436f,(float16_t)-0.98225274136628937249f, -(float16_t)-0.18303988795514095078f,(float16_t)-0.98310548743121628501f, -(float16_t)-0.17851377093899792325f,(float16_t)-0.98393741344921881176f, -(float16_t)-0.17398387338746373887f,(float16_t)-0.98474850180190420801f, -(float16_t)-0.16945029123396829207f,(float16_t)-0.98553873531217606185f, -(float16_t)-0.16491312048996975559f,(float16_t)-0.98630809724459866938f, -(float16_t)-0.16037245724292850668f,(float16_t)-0.98705657130575097380f, -(float16_t)-0.15582839765426498291f,(float16_t)-0.98778414164457217783f, -(float16_t)-0.15128103795733036097f,(float16_t)-0.98849079285269658701f, -(float16_t)-0.14673047445536230304f,(float16_t)-0.98917650996478090342f, -(float16_t)-0.14217680351944814165f,(float16_t)-0.98984127845882052821f, -(float16_t)-0.13762012158648653792f,(float16_t)-0.99048508425645698239f, -(float16_t)-0.13306052515713906459f,(float16_t)-0.99110791372327688986f, -(float16_t)-0.12849811079379358514f,(float16_t)-0.99170975366909952520f, -(float16_t)-0.12393297511851208981f,(float16_t)-0.99229059134825736699f, -(float16_t)-0.11936521481099168773f,(float16_t)-0.99285041445986510489f, -(float16_t)-0.11479492660650993108f,(float16_t)-0.99338921114808065305f, -(float16_t)-0.11022220729388330918f,(float16_t)-0.99390697000235606051f, -(float16_t)-0.10564715371341037997f,(float16_t)-0.99440368005767909576f, -(float16_t)-0.10106986275482798820f,(float16_t)-0.99487933079480561638f, -(float16_t)-0.09649043135525316173f,(float16_t)-0.99533391214048216877f, -(float16_t)-0.09190895649713282101f,(float16_t)-0.99576741446765981713f, -(float16_t)-0.08732553520619255882f,(float16_t)-0.99617982859569687015f, -(float16_t)-0.08274026454937570552f,(float16_t)-0.99657114579055483539f, -(float16_t)-0.07815324163279464831f,(float16_t)-0.99694135776498205015f, -(float16_t)-0.07356456359966735692f,(float16_t)-0.99729045667869020697f, -(float16_t)-0.06897432762826707919f,(float16_t)-0.99761843513851955478f, -(float16_t)-0.06438263092985731240f,(float16_t)-0.99792528619859599548f, -(float16_t)-0.05978957074664013188f,(float16_t)-0.99821100336047818846f, -(float16_t)-0.05519524434968971216f,(float16_t)-0.99847558057329477421f, -(float16_t)-0.05059974903689945513f,(float16_t)-0.99871901223387293811f, -(float16_t)-0.04600318213091520586f,(float16_t)-0.99894129318685687124f, -(float16_t)-0.04140564097707683661f,(float16_t)-0.99914241872481690532f, -(float16_t)-0.03680722294135933131f,(float16_t)-0.99932238458834943273f, -(float16_t)-0.03220802540830459970f,(float16_t)-0.99948118696616694567f, -(float16_t)-0.02760814577896616301f,(float16_t)-0.99961882249517863830f, -(float16_t)-0.02300768146883930970f,(float16_t)-0.99973528826056168306f, -(float16_t)-0.01840672990580516366f,(float16_t)-0.99983058179582340319f, -(float16_t)-0.01380538852806025008f,(float16_t)-0.99990470108285289808f, -(float16_t)-0.00920375478206008311f,(float16_t)-0.99995764455196389786f, -(float16_t)-0.00460192612044835019f,(float16_t)-0.99998941108192840321f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99983058179582340319f,(float16_t)0.01840672990580482019f, -(float16_t)0.99932238458834954375f,(float16_t)0.03680722294135883171f, -(float16_t)0.99847558057329477421f,(float16_t)0.05519524434968993420f, -(float16_t)0.99729045667869020697f,(float16_t)0.07356456359966742631f, -(float16_t)0.99576741446765981713f,(float16_t)0.09190895649713272386f, -(float16_t)0.99390697000235606051f,(float16_t)0.11022220729388305938f, -(float16_t)0.99170975366909952520f,(float16_t)0.12849811079379316880f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.98630809724459866938f,(float16_t)0.16491312048996989437f, -(float16_t)0.98310548743121628501f,(float16_t)0.18303988795514095078f, -(float16_t)0.97956976568544051887f,(float16_t)0.20110463484209190055f, -(float16_t)0.97570213003852857003f,(float16_t)0.21910124015686979759f, -(float16_t)0.97150389098625178352f,(float16_t)0.23702360599436719801f, -(float16_t)0.96697647104485207059f,(float16_t)0.25486565960451457169f, -(float16_t)0.96212140426904158019f,(float16_t)0.27262135544994897662f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.95143502096900833820f,(float16_t)0.30784964004153486661f, -(float16_t)0.94560732538052127971f,(float16_t)0.32531029216226292622f, -(float16_t)0.93945922360218991898f,(float16_t)0.34266071731199437833f, -(float16_t)0.93299279883473895669f,(float16_t)0.35989503653498811087f, -(float16_t)0.92621024213831137928f,(float16_t)0.37700741021641825945f, -(float16_t)0.91911385169005777040f,(float16_t)0.39399204006104809883f, -(float16_t)0.91170603200542987832f,(float16_t)0.41084317105790391089f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.89596624975618521791f,(float16_t)0.44412214457042920035f, -(float16_t)0.88763962040285393496f,(float16_t)0.46053871095824000514f, -(float16_t)0.87901222642863352519f,(float16_t)0.47679923006332208812f, -(float16_t)0.87008699110871146054f,(float16_t)0.49289819222978403790f, -(float16_t)0.86086693863776730939f,(float16_t)0.50883014254310698909f, -(float16_t)0.85135519310526519554f,(float16_t)0.52458968267846894928f, -(float16_t)0.84155497743689844370f,(float16_t)0.54017147272989285423f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.82110251499110464835f,(float16_t)0.57078074588696725566f, -(float16_t)0.81045719825259476821f,(float16_t)0.58579785745643886408f, -(float16_t)0.79953726910790501314f,(float16_t)0.60061647938386897305f, -(float16_t)0.78834642762660622761f,(float16_t)0.61523159058062681925f, -(float16_t)0.77688846567323244230f,(float16_t)0.62963823891492698426f, -(float16_t)0.76516726562245895860f,(float16_t)0.64383154288979138613f, -(float16_t)0.75318679904361252042f,(float16_t)0.65780669329707863735f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.72846439044822519637f,(float16_t)0.68508366777270035541f, -(float16_t)0.71573082528381870571f,(float16_t)0.69837624940897280457f, -(float16_t)0.70275474445722529993f,(float16_t)0.71143219574521643356f, -(float16_t)0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)0.67609270357531603413f,(float16_t)0.73681656887736979300f, -(float16_t)0.66241577759017178373f,(float16_t)0.74913639452345925918f, -(float16_t)0.64851440102211255212f,(float16_t)0.76120238548426177871f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.62005721176328920663f,(float16_t)0.78455659715557524159f, -(float16_t)0.60551104140432554512f,(float16_t)0.79583690460888345530f, -(float16_t)0.59075970185887427544f,(float16_t)0.80684755354379922299f, -(float16_t)0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)0.56066157619733603124f,(float16_t)0.82804504525775579626f, -(float16_t)0.54532498842204646383f,(float16_t)0.83822470555483796772f, -(float16_t)0.52980362468629482731f,(float16_t)0.84812034480329712149f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.49822766697278186854f,(float16_t)0.86704624551569264845f, -(float16_t)0.48218377207912282989f,(float16_t)0.87607009419540660122f, -(float16_t)0.46597649576796612569f,(float16_t)0.88479709843093778954f, -(float16_t)0.44961132965460659516f,(float16_t)0.89322430119551532446f, -(float16_t)0.43309381885315201277f,(float16_t)0.90134884704602202810f, -(float16_t)0.41642956009763731906f,(float16_t)0.90916798309052226923f, -(float16_t)0.39962419984564678810f,(float16_t)0.91667905992104270485f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.36561299780477396482f,(float16_t)0.93076696107898371224f, -(float16_t)0.34841868024943450921f,(float16_t)0.93733901191257495977f, -(float16_t)0.33110630575987642921f,(float16_t)0.94359345816196038559f, -(float16_t)0.31368174039889157312f,(float16_t)0.94952818059303667475f, -(float16_t)0.29615088824362395536f,(float16_t)0.95514116830577067141f, -(float16_t)0.27851968938505305973f,(float16_t)0.96043051941556578655f, -(float16_t)0.26079411791527556952f,(float16_t)0.96539444169768939830f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.22508391135979277653f,(float16_t)0.97433938278557585821f, -(float16_t)0.20711137619221856032f,(float16_t)0.97831737071962765473f, -(float16_t)0.18906866414980627589f,(float16_t)0.98196386910955524296f, -(float16_t)0.17096188876030135595f,(float16_t)0.98527764238894122162f, -(float16_t)0.15279718525844340760f,(float16_t)0.98825756773074946437f, -(float16_t)0.13458070850712622324f,(float16_t)0.99090263542778000971f, -(float16_t)0.11631863091190487725f,(float16_t)0.99321194923479450001f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.07968243797143012563f,(float16_t)0.99682029929116566791f, -(float16_t)0.06132073630220864768f,(float16_t)0.99811811290014917919f, -(float16_t)0.04293825693494095902f,(float16_t)0.99907772775264536147f, -(float16_t)0.02454122852291226384f,(float16_t)0.99969881869620424997f, -(float16_t)0.00613588464915451517f,(float16_t)0.99998117528260110909f, -(float16_t)-0.01227153828571982304f,(float16_t)0.99992470183914450299f, -(float16_t)-0.03067480317663645942f,(float16_t)0.99952941750109314256f, -(float16_t)-0.04906767432741800800f,(float16_t)0.99879545620517240501f, -(float16_t)-0.06744391956366398155f,(float16_t)0.99772306664419163624f, -(float16_t)-0.08579731234443975507f,(float16_t)0.99631261218277800129f, -(float16_t)-0.10412163387205460030f,(float16_t)0.99456457073425541537f, -(float16_t)-0.12241067519921615403f,(float16_t)0.99247953459870996706f, -(float16_t)-0.14065823933284912761f,(float16_t)0.99005821026229712256f, -(float16_t)-0.15885814333386127917f,(float16_t)0.98730141815785843473f, -(float16_t)-0.17700422041214874946f,(float16_t)0.98421009238692902521f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.21311031991609125091f,(float16_t)0.97702814265775439484f, -(float16_t)-0.23105810828067113727f,(float16_t)0.97293995220556017678f, -(float16_t)-0.24892760574572012078f,(float16_t)0.96852209427441737777f, -(float16_t)-0.26671275747489830987f,(float16_t)0.96377606579543984022f, -(float16_t)-0.28440753721127171039f,(float16_t)0.95870347489587159906f, -(float16_t)-0.30200594931922808417f,(float16_t)0.95330604035419386211f, -(float16_t)-0.31950203081601563637f,(float16_t)0.94758559101774120226f, -(float16_t)-0.33688985339221994009f,(float16_t)0.94154406518302080631f, -(float16_t)-0.35416352542049039931f,(float16_t)0.93518350993894761025f, -(float16_t)-0.37131719395183748755f,(float16_t)0.92850608047321558924f, -(float16_t)-0.38834504669882619066f,(float16_t)0.92151403934204201285f, -(float16_t)-0.40524131400498974998f,(float16_t)0.91420975570353069095f, -(float16_t)-0.42200027079979968159f,(float16_t)0.90659570451491533483f, -(float16_t)-0.43861623853852738097f,(float16_t)0.89867446569395392775f, -(float16_t)-0.45508358712634372489f,(float16_t)0.89044872324475798919f, -(float16_t)-0.47139673682599769755f,(float16_t)0.88192126434835504956f, -(float16_t)-0.48755016014843571837f,(float16_t)0.87309497841829020182f, -(float16_t)-0.50353838372571746440f,(float16_t)0.86397285612158680745f, -(float16_t)-0.51935599016558964269f,(float16_t)0.85455798836540053376f, -(float16_t)-0.53499761988709704230f,(float16_t)0.84485356524970722791f, -(float16_t)-0.55045797293660470029f,(float16_t)0.83486287498638012128f, -(float16_t)-0.56573181078361323149f,(float16_t)0.82458930278502517996f, -(float16_t)-0.58081395809576441547f,(float16_t)0.81403632970594852480f, -(float16_t)-0.59569930449243335691f,(float16_t)0.80320753148064494287f, -(float16_t)-0.61038280627630958630f,(float16_t)0.79210657730021227785f, -(float16_t)-0.62485948814238623239f,(float16_t)0.78073722857209459924f, -(float16_t)-0.63912444486377573138f,(float16_t)0.76910333764557958780f, -(float16_t)-0.65317284295377653347f,(float16_t)0.75720884650648467851f, -(float16_t)-0.66699992230363736034f,(float16_t)0.74505778544146605835f, -(float16_t)-0.68060099779545302212f,(float16_t)0.73265427167241281570f, -(float16_t)-0.69397146088965377952f,(float16_t)0.72000250796138176579f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.72000250796138165477f,(float16_t)0.69397146088965389055f, -(float16_t)-0.73265427167241270467f,(float16_t)0.68060099779545324417f, -(float16_t)-0.74505778544146594733f,(float16_t)0.66699992230363758239f, -(float16_t)-0.75720884650648467851f,(float16_t)0.65317284295377664449f, -(float16_t)-0.76910333764557947678f,(float16_t)0.63912444486377584241f, -(float16_t)-0.78073722857209448822f,(float16_t)0.62485948814238634341f, -(float16_t)-0.79210657730021216683f,(float16_t)0.61038280627630969732f, -(float16_t)-0.80320753148064483184f,(float16_t)0.59569930449243346793f, -(float16_t)-0.81403632970594841378f,(float16_t)0.58081395809576452649f, -(float16_t)-0.82458930278502506894f,(float16_t)0.56573181078361345353f, -(float16_t)-0.83486287498638001026f,(float16_t)0.55045797293660492233f, -(float16_t)-0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)-0.85455798836540042274f,(float16_t)0.51935599016558975372f, -(float16_t)-0.86397285612158669643f,(float16_t)0.50353838372571757542f, -(float16_t)-0.87309497841829009079f,(float16_t)0.48755016014843588490f, -(float16_t)-0.88192126434835493853f,(float16_t)0.47139673682599780857f, -(float16_t)-0.89044872324475787817f,(float16_t)0.45508358712634389143f, -(float16_t)-0.89867446569395392775f,(float16_t)0.43861623853852754751f, -(float16_t)-0.90659570451491533483f,(float16_t)0.42200027079979984812f, -(float16_t)-0.91420975570353069095f,(float16_t)0.40524131400498991651f, -(float16_t)-0.92151403934204179080f,(float16_t)0.38834504669882657923f, -(float16_t)-0.92850608047321547822f,(float16_t)0.37131719395183770960f, -(float16_t)-0.93518350993894761025f,(float16_t)0.35416352542049039931f, -(float16_t)-0.94154406518302069529f,(float16_t)0.33688985339222032867f, -(float16_t)-0.94758559101774109124f,(float16_t)0.31950203081601580291f, -(float16_t)-0.95330604035419386211f,(float16_t)0.30200594931922802866f, -(float16_t)-0.95870347489587148804f,(float16_t)0.28440753721127209896f, -(float16_t)-0.96377606579543984022f,(float16_t)0.26671275747489847641f, -(float16_t)-0.96852209427441737777f,(float16_t)0.24892760574572009302f, -(float16_t)-0.97293995220556006576f,(float16_t)0.23105810828067133156f, -(float16_t)-0.97702814265775439484f,(float16_t)0.21311031991609141745f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)-0.98421009238692902521f,(float16_t)0.17700422041214894375f, -(float16_t)-0.98730141815785843473f,(float16_t)0.15885814333386147346f, -(float16_t)-0.99005821026229701154f,(float16_t)0.14065823933284954395f, -(float16_t)-0.99247953459870996706f,(float16_t)0.12241067519921634832f, -(float16_t)-0.99456457073425541537f,(float16_t)0.10412163387205457254f, -(float16_t)-0.99631261218277800129f,(float16_t)0.08579731234444015753f, -(float16_t)-0.99772306664419163624f,(float16_t)0.06744391956366417584f, -(float16_t)-0.99879545620517240501f,(float16_t)0.04906767432741796636f, -(float16_t)-0.99952941750109314256f,(float16_t)0.03067480317663686534f, -(float16_t)-0.99992470183914450299f,(float16_t)0.01227153828572000692f, -(float16_t)-0.99998117528260110909f,(float16_t)-0.00613588464915455420f, -(float16_t)-0.99969881869620424997f,(float16_t)-0.02454122852291207996f, -(float16_t)-0.99907772775264536147f,(float16_t)-0.04293825693494077861f, -(float16_t)-0.99811811290014917919f,(float16_t)-0.06132073630220824523f, -(float16_t)-0.99682029929116577893f,(float16_t)-0.07968243797142994522f, -(float16_t)-0.99518472667219692873f,(float16_t)-0.09801714032956058975f, -(float16_t)-0.99321194923479461103f,(float16_t)-0.11631863091190447479f, -(float16_t)-0.99090263542778000971f,(float16_t)-0.13458070850712605671f, -(float16_t)-0.98825756773074946437f,(float16_t)-0.15279718525844343535f, -(float16_t)-0.98527764238894133264f,(float16_t)-0.17096188876030096737f, -(float16_t)-0.98196386910955524296f,(float16_t)-0.18906866414980610935f, -(float16_t)-0.97831737071962765473f,(float16_t)-0.20711137619221858808f, -(float16_t)-0.97433938278557585821f,(float16_t)-0.22508391135979261000f, -(float16_t)-0.97003125319454397424f,(float16_t)-0.24298017990326381543f, -(float16_t)-0.96539444169768939830f,(float16_t)-0.26079411791527562503f, -(float16_t)-0.96043051941556589757f,(float16_t)-0.27851968938505289319f, -(float16_t)-0.95514116830577078243f,(float16_t)-0.29615088824362378883f, -(float16_t)-0.94952818059303678577f,(float16_t)-0.31368174039889118454f, -(float16_t)-0.94359345816196038559f,(float16_t)-0.33110630575987626267f, -(float16_t)-0.93733901191257495977f,(float16_t)-0.34841868024943456472f, -(float16_t)-0.93076696107898382326f,(float16_t)-0.36561299780477357624f, -(float16_t)-0.92387953251128684951f,(float16_t)-0.38268343236508967076f, -(float16_t)-0.91667905992104270485f,(float16_t)-0.39962419984564684361f, -(float16_t)-0.90916798309052249127f,(float16_t)-0.41642956009763693048f, -(float16_t)-0.90134884704602202810f,(float16_t)-0.43309381885315184624f, -(float16_t)-0.89322430119551532446f,(float16_t)-0.44961132965460665067f, -(float16_t)-0.88479709843093790056f,(float16_t)-0.46597649576796595916f, -(float16_t)-0.87607009419540660122f,(float16_t)-0.48218377207912266336f, -(float16_t)-0.86704624551569287050f,(float16_t)-0.49822766697278153547f, -(float16_t)-0.85772861000027211809f,(float16_t)-0.51410274419322155026f, -(float16_t)-0.84812034480329723252f,(float16_t)-0.52980362468629460526f, -(float16_t)-0.83822470555483818977f,(float16_t)-0.54532498842204613076f, -(float16_t)-0.82804504525775590729f,(float16_t)-0.56066157619733592021f, -(float16_t)-0.81758481315158371139f,(float16_t)-0.57580819141784533866f, -(float16_t)-0.80684755354379944503f,(float16_t)-0.59075970185887394237f, -(float16_t)-0.79583690460888356633f,(float16_t)-0.60551104140432543410f, -(float16_t)-0.78455659715557524159f,(float16_t)-0.62005721176328920663f, -(float16_t)-0.77301045336273710440f,(float16_t)-0.63439328416364526575f, -(float16_t)-0.76120238548426188974f,(float16_t)-0.64851440102211233008f, -(float16_t)-0.74913639452345925918f,(float16_t)-0.66241577759017178373f, -(float16_t)-0.73681656887737001504f,(float16_t)-0.67609270357531581208f, -(float16_t)-0.72424708295146700276f,(float16_t)-0.68954054473706682948f, -(float16_t)-0.71143219574521665560f,(float16_t)-0.70275474445722507788f, -(float16_t)-0.69837624940897302661f,(float16_t)-0.71573082528381848366f, -(float16_t)-0.68508366777270035541f,(float16_t)-0.72846439044822519637f, -(float16_t)-0.67155895484701866316f,(float16_t)-0.74095112535495888384f, -(float16_t)-0.65780669329707874837f,(float16_t)-0.75318679904361240940f, -(float16_t)-0.64383154288979149715f,(float16_t)-0.76516726562245895860f, -(float16_t)-0.62963823891492687324f,(float16_t)-0.77688846567323255332f, -(float16_t)-0.61523159058062726334f,(float16_t)-0.78834642762660589455f, -(float16_t)-0.60061647938386930612f,(float16_t)-0.79953726910790479110f, -(float16_t)-0.58579785745643908612f,(float16_t)-0.81045719825259465718f, -(float16_t)-0.57078074588696736669f,(float16_t)-0.82110251499110464835f, -(float16_t)-0.55557023301960217765f,(float16_t)-0.83146961230254523567f, -(float16_t)-0.54017147272989274320f,(float16_t)-0.84155497743689855472f, -(float16_t)-0.52458968267846928235f,(float16_t)-0.85135519310526486247f, -(float16_t)-0.50883014254310732216f,(float16_t)-0.86086693863776708735f, -(float16_t)-0.49289819222978420443f,(float16_t)-0.87008699110871134952f, -(float16_t)-0.47679923006332214364f,(float16_t)-0.87901222642863341417f, -(float16_t)-0.46053871095823989412f,(float16_t)-0.88763962040285404598f, -(float16_t)-0.44412214457042975546f,(float16_t)-0.89596624975618488484f, -(float16_t)-0.42755509343028247349f,(float16_t)-0.90398929312344311615f, -(float16_t)-0.41084317105790418845f,(float16_t)-0.91170603200542976730f, -(float16_t)-0.39399204006104820985f,(float16_t)-0.91911385169005765938f, -(float16_t)-0.37700741021641820394f,(float16_t)-0.92621024213831137928f, -(float16_t)-0.35989503653498794433f,(float16_t)-0.93299279883473895669f, -(float16_t)-0.34266071731199487793f,(float16_t)-0.93945922360218969693f, -(float16_t)-0.32531029216226331480f,(float16_t)-0.94560732538052116869f, -(float16_t)-0.30784964004153508865f,(float16_t)-0.95143502096900833820f, -(float16_t)-0.29028467725446244208f,(float16_t)-0.95694033573220882438f, -(float16_t)-0.27262135544994886560f,(float16_t)-0.96212140426904158019f, -(float16_t)-0.25486565960451434965f,(float16_t)-0.96697647104485218161f, -(float16_t)-0.23702360599436766986f,(float16_t)-0.97150389098625167250f, -(float16_t)-0.21910124015687010290f,(float16_t)-0.97570213003852845901f, -(float16_t)-0.20110463484209206708f,(float16_t)-0.97956976568544051887f, -(float16_t)-0.18303988795514095078f,(float16_t)-0.98310548743121628501f, -(float16_t)-0.16491312048996975559f,(float16_t)-0.98630809724459866938f, -(float16_t)-0.14673047445536230304f,(float16_t)-0.98917650996478090342f, -(float16_t)-0.12849811079379358514f,(float16_t)-0.99170975366909952520f, -(float16_t)-0.11022220729388330918f,(float16_t)-0.99390697000235606051f, -(float16_t)-0.09190895649713282101f,(float16_t)-0.99576741446765981713f, -(float16_t)-0.07356456359966735692f,(float16_t)-0.99729045667869020697f, -(float16_t)-0.05519524434968971216f,(float16_t)-0.99847558057329477421f, -(float16_t)-0.03680722294135933131f,(float16_t)-0.99932238458834943273f, -(float16_t)-0.01840672990580516366f,(float16_t)-0.99983058179582340319f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.99729045667869020697f,(float16_t)0.07356456359966742631f, -(float16_t)0.98917650996478101444f,(float16_t)0.14673047445536174793f, -(float16_t)0.97570213003852857003f,(float16_t)0.21910124015686979759f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.93299279883473895669f,(float16_t)0.35989503653498811087f, -(float16_t)0.90398929312344333820f,(float16_t)0.42755509343028208491f, -(float16_t)0.87008699110871146054f,(float16_t)0.49289819222978403790f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.78834642762660622761f,(float16_t)0.61523159058062681925f, -(float16_t)0.74095112535495921691f,(float16_t)0.67155895484701833009f, -(float16_t)0.68954054473706694051f,(float16_t)0.72424708295146689174f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.57580819141784533866f,(float16_t)0.81758481315158371139f, -(float16_t)0.51410274419322166128f,(float16_t)0.85772861000027211809f, -(float16_t)0.44961132965460659516f,(float16_t)0.89322430119551532446f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.31368174039889157312f,(float16_t)0.94952818059303667475f, -(float16_t)0.24298017990326398197f,(float16_t)0.97003125319454397424f, -(float16_t)0.17096188876030135595f,(float16_t)0.98527764238894122162f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)0.02454122852291226384f,(float16_t)0.99969881869620424997f, -(float16_t)-0.04906767432741800800f,(float16_t)0.99879545620517240501f, -(float16_t)-0.12241067519921615403f,(float16_t)0.99247953459870996706f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.26671275747489830987f,(float16_t)0.96377606579543984022f, -(float16_t)-0.33688985339221994009f,(float16_t)0.94154406518302080631f, -(float16_t)-0.40524131400498974998f,(float16_t)0.91420975570353069095f, -(float16_t)-0.47139673682599769755f,(float16_t)0.88192126434835504956f, -(float16_t)-0.53499761988709704230f,(float16_t)0.84485356524970722791f, -(float16_t)-0.59569930449243335691f,(float16_t)0.80320753148064494287f, -(float16_t)-0.65317284295377653347f,(float16_t)0.75720884650648467851f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.75720884650648467851f,(float16_t)0.65317284295377664449f, -(float16_t)-0.80320753148064483184f,(float16_t)0.59569930449243346793f, -(float16_t)-0.84485356524970711689f,(float16_t)0.53499761988709715332f, -(float16_t)-0.88192126434835493853f,(float16_t)0.47139673682599780857f, -(float16_t)-0.91420975570353069095f,(float16_t)0.40524131400498991651f, -(float16_t)-0.94154406518302069529f,(float16_t)0.33688985339222032867f, -(float16_t)-0.96377606579543984022f,(float16_t)0.26671275747489847641f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)-0.99247953459870996706f,(float16_t)0.12241067519921634832f, -(float16_t)-0.99879545620517240501f,(float16_t)0.04906767432741796636f, -(float16_t)-0.99969881869620424997f,(float16_t)-0.02454122852291207996f, -(float16_t)-0.99518472667219692873f,(float16_t)-0.09801714032956058975f, -(float16_t)-0.98527764238894133264f,(float16_t)-0.17096188876030096737f, -(float16_t)-0.97003125319454397424f,(float16_t)-0.24298017990326381543f, -(float16_t)-0.94952818059303678577f,(float16_t)-0.31368174039889118454f, -(float16_t)-0.92387953251128684951f,(float16_t)-0.38268343236508967076f, -(float16_t)-0.89322430119551532446f,(float16_t)-0.44961132965460665067f, -(float16_t)-0.85772861000027211809f,(float16_t)-0.51410274419322155026f, -(float16_t)-0.81758481315158371139f,(float16_t)-0.57580819141784533866f, -(float16_t)-0.77301045336273710440f,(float16_t)-0.63439328416364526575f, -(float16_t)-0.72424708295146700276f,(float16_t)-0.68954054473706682948f, -(float16_t)-0.67155895484701866316f,(float16_t)-0.74095112535495888384f, -(float16_t)-0.61523159058062726334f,(float16_t)-0.78834642762660589455f, -(float16_t)-0.55557023301960217765f,(float16_t)-0.83146961230254523567f, -(float16_t)-0.49289819222978420443f,(float16_t)-0.87008699110871134952f, -(float16_t)-0.42755509343028247349f,(float16_t)-0.90398929312344311615f, -(float16_t)-0.35989503653498794433f,(float16_t)-0.93299279883473895669f, -(float16_t)-0.29028467725446244208f,(float16_t)-0.95694033573220882438f, -(float16_t)-0.21910124015687010290f,(float16_t)-0.97570213003852845901f, -(float16_t)-0.14673047445536230304f,(float16_t)-0.98917650996478090342f, -(float16_t)-0.07356456359966735692f,(float16_t)-0.99729045667869020697f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.95694033573220882438f,(float16_t)0.29028467725446233105f, -(float16_t)0.83146961230254523567f,(float16_t)0.55557023301960217765f, -(float16_t)0.63439328416364548779f,(float16_t)0.77301045336273688235f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)0.09801714032956077016f,(float16_t)0.99518472667219681771f, -(float16_t)-0.19509032201612819257f,(float16_t)0.98078528040323043058f, -(float16_t)-0.47139673682599769755f,(float16_t)0.88192126434835504956f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.88192126434835493853f,(float16_t)0.47139673682599780857f, -(float16_t)-0.98078528040323043058f,(float16_t)0.19509032201612860891f, -(float16_t)-0.99518472667219692873f,(float16_t)-0.09801714032956058975f, -(float16_t)-0.92387953251128684951f,(float16_t)-0.38268343236508967076f, -(float16_t)-0.77301045336273710440f,(float16_t)-0.63439328416364526575f, -(float16_t)-0.55557023301960217765f,(float16_t)-0.83146961230254523567f, -(float16_t)-0.29028467725446244208f,(float16_t)-0.95694033573220882438f, -(float16_t)1.00000000000000000000f,(float16_t)0.00000000000000000000f, -(float16_t)0.38268343236508983729f,(float16_t)0.92387953251128673848f, -(float16_t)-0.70710678118654746172f,(float16_t)0.70710678118654757274f, -(float16_t)-0.92387953251128684951f,(float16_t)-0.38268343236508967076f,}; +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)1.0000000000000f,(float16_t)0.0046005249023f, +(float16_t)1.0000000000000f,(float16_t)0.0092010498047f, +(float16_t)1.0000000000000f,(float16_t)0.0138015747070f, +(float16_t)1.0000000000000f,(float16_t)0.0184020996094f, +(float16_t)0.9995117187500f,(float16_t)0.0230102539062f, +(float16_t)0.9995117187500f,(float16_t)0.0276031494141f, +(float16_t)0.9995117187500f,(float16_t)0.0321960449219f, +(float16_t)0.9995117187500f,(float16_t)0.0368041992188f, +(float16_t)0.9990234375000f,(float16_t)0.0414123535156f, +(float16_t)0.9990234375000f,(float16_t)0.0459899902344f, +(float16_t)0.9985351562500f,(float16_t)0.0505981445312f, +(float16_t)0.9985351562500f,(float16_t)0.0552062988281f, +(float16_t)0.9980468750000f,(float16_t)0.0597839355469f, +(float16_t)0.9980468750000f,(float16_t)0.0643920898438f, +(float16_t)0.9975585937500f,(float16_t)0.0689697265625f, +(float16_t)0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)0.9970703125000f,(float16_t)0.0781250000000f, +(float16_t)0.9965820312500f,(float16_t)0.0827636718750f, +(float16_t)0.9960937500000f,(float16_t)0.0873413085938f, +(float16_t)0.9956054687500f,(float16_t)0.0919189453125f, +(float16_t)0.9951171875000f,(float16_t)0.0964965820312f, +(float16_t)0.9951171875000f,(float16_t)0.1010742187500f, +(float16_t)0.9946289062500f,(float16_t)0.1056518554688f, +(float16_t)0.9941406250000f,(float16_t)0.1102294921875f, +(float16_t)0.9931640625000f,(float16_t)0.1148071289062f, +(float16_t)0.9926757812500f,(float16_t)0.1193847656250f, +(float16_t)0.9921875000000f,(float16_t)0.1239624023438f, +(float16_t)0.9916992187500f,(float16_t)0.1285400390625f, +(float16_t)0.9912109375000f,(float16_t)0.1330566406250f, +(float16_t)0.9907226562500f,(float16_t)0.1375732421875f, +(float16_t)0.9897460937500f,(float16_t)0.1422119140625f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9882812500000f,(float16_t)0.1512451171875f, +(float16_t)0.9877929687500f,(float16_t)0.1558837890625f, +(float16_t)0.9868164062500f,(float16_t)0.1604003906250f, +(float16_t)0.9863281250000f,(float16_t)0.1649169921875f, +(float16_t)0.9853515625000f,(float16_t)0.1694335937500f, +(float16_t)0.9848632812500f,(float16_t)0.1739501953125f, +(float16_t)0.9838867187500f,(float16_t)0.1784667968750f, +(float16_t)0.9829101562500f,(float16_t)0.1829833984375f, +(float16_t)0.9824218750000f,(float16_t)0.1876220703125f, +(float16_t)0.9814453125000f,(float16_t)0.1921386718750f, +(float16_t)0.9804687500000f,(float16_t)0.1966552734375f, +(float16_t)0.9794921875000f,(float16_t)0.2010498046875f, +(float16_t)0.9785156250000f,(float16_t)0.2055664062500f, +(float16_t)0.9775390625000f,(float16_t)0.2100830078125f, +(float16_t)0.9765625000000f,(float16_t)0.2145996093750f, +(float16_t)0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)0.9746093750000f,(float16_t)0.2236328125000f, +(float16_t)0.9736328125000f,(float16_t)0.2280273437500f, +(float16_t)0.9726562500000f,(float16_t)0.2325439453125f, +(float16_t)0.9716796875000f,(float16_t)0.2370605468750f, +(float16_t)0.9702148437500f,(float16_t)0.2414550781250f, +(float16_t)0.9692382812500f,(float16_t)0.2459716796875f, +(float16_t)0.9682617187500f,(float16_t)0.2504882812500f, +(float16_t)0.9667968750000f,(float16_t)0.2548828125000f, +(float16_t)0.9658203125000f,(float16_t)0.2592773437500f, +(float16_t)0.9643554687500f,(float16_t)0.2636718750000f, +(float16_t)0.9633789062500f,(float16_t)0.2683105468750f, +(float16_t)0.9619140625000f,(float16_t)0.2727050781250f, +(float16_t)0.9609375000000f,(float16_t)0.2770996093750f, +(float16_t)0.9594726562500f,(float16_t)0.2814941406250f, +(float16_t)0.9584960937500f,(float16_t)0.2858886718750f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9555664062500f,(float16_t)0.2946777343750f, +(float16_t)0.9541015625000f,(float16_t)0.2990722656250f, +(float16_t)0.9526367187500f,(float16_t)0.3034667968750f, +(float16_t)0.9516601562500f,(float16_t)0.3078613281250f, +(float16_t)0.9501953125000f,(float16_t)0.3122558593750f, +(float16_t)0.9487304687500f,(float16_t)0.3166503906250f, +(float16_t)0.9472656250000f,(float16_t)0.3210449218750f, +(float16_t)0.9458007812500f,(float16_t)0.3251953125000f, +(float16_t)0.9443359375000f,(float16_t)0.3295898437500f, +(float16_t)0.9423828125000f,(float16_t)0.3339843750000f, +(float16_t)0.9409179687500f,(float16_t)0.3383789062500f, +(float16_t)0.9394531250000f,(float16_t)0.3427734375000f, +(float16_t)0.9379882812500f,(float16_t)0.3469238281250f, +(float16_t)0.9360351562500f,(float16_t)0.3513183593750f, +(float16_t)0.9345703125000f,(float16_t)0.3557128906250f, +(float16_t)0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)0.9311523437500f,(float16_t)0.3642578125000f, +(float16_t)0.9296875000000f,(float16_t)0.3684082031250f, +(float16_t)0.9277343750000f,(float16_t)0.3728027343750f, +(float16_t)0.9262695312500f,(float16_t)0.3769531250000f, +(float16_t)0.9243164062500f,(float16_t)0.3813476562500f, +(float16_t)0.9228515625000f,(float16_t)0.3854980468750f, +(float16_t)0.9208984375000f,(float16_t)0.3896484375000f, +(float16_t)0.9189453125000f,(float16_t)0.3940429687500f, +(float16_t)0.9174804687500f,(float16_t)0.3981933593750f, +(float16_t)0.9155273437500f,(float16_t)0.4023437500000f, +(float16_t)0.9135742187500f,(float16_t)0.4067382812500f, +(float16_t)0.9116210937500f,(float16_t)0.4108886718750f, +(float16_t)0.9096679687500f,(float16_t)0.4150390625000f, +(float16_t)0.9077148437500f,(float16_t)0.4191894531250f, +(float16_t)0.9057617187500f,(float16_t)0.4233398437500f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.9018554687500f,(float16_t)0.4316406250000f, +(float16_t)0.8999023437500f,(float16_t)0.4357910156250f, +(float16_t)0.8979492187500f,(float16_t)0.4399414062500f, +(float16_t)0.8959960937500f,(float16_t)0.4440917968750f, +(float16_t)0.8940429687500f,(float16_t)0.4482421875000f, +(float16_t)0.8916015625000f,(float16_t)0.4523925781250f, +(float16_t)0.8896484375000f,(float16_t)0.4565429687500f, +(float16_t)0.8876953125000f,(float16_t)0.4604492187500f, +(float16_t)0.8857421875000f,(float16_t)0.4645996093750f, +(float16_t)0.8833007812500f,(float16_t)0.4687500000000f, +(float16_t)0.8813476562500f,(float16_t)0.4726562500000f, +(float16_t)0.8789062500000f,(float16_t)0.4768066406250f, +(float16_t)0.8769531250000f,(float16_t)0.4809570312500f, +(float16_t)0.8745117187500f,(float16_t)0.4848632812500f, +(float16_t)0.8725585937500f,(float16_t)0.4887695312500f, +(float16_t)0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)0.8676757812500f,(float16_t)0.4968261718750f, +(float16_t)0.8657226562500f,(float16_t)0.5009765625000f, +(float16_t)0.8632812500000f,(float16_t)0.5048828125000f, +(float16_t)0.8608398437500f,(float16_t)0.5087890625000f, +(float16_t)0.8583984375000f,(float16_t)0.5126953125000f, +(float16_t)0.8559570312500f,(float16_t)0.5166015625000f, +(float16_t)0.8540039062500f,(float16_t)0.5205078125000f, +(float16_t)0.8515625000000f,(float16_t)0.5244140625000f, +(float16_t)0.8491210937500f,(float16_t)0.5283203125000f, +(float16_t)0.8466796875000f,(float16_t)0.5322265625000f, +(float16_t)0.8442382812500f,(float16_t)0.5361328125000f, +(float16_t)0.8417968750000f,(float16_t)0.5400390625000f, +(float16_t)0.8388671875000f,(float16_t)0.5439453125000f, +(float16_t)0.8364257812500f,(float16_t)0.5478515625000f, +(float16_t)0.8339843750000f,(float16_t)0.5517578125000f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.8291015625000f,(float16_t)0.5595703125000f, +(float16_t)0.8261718750000f,(float16_t)0.5629882812500f, +(float16_t)0.8237304687500f,(float16_t)0.5668945312500f, +(float16_t)0.8212890625000f,(float16_t)0.5708007812500f, +(float16_t)0.8183593750000f,(float16_t)0.5747070312500f, +(float16_t)0.8159179687500f,(float16_t)0.5781250000000f, +(float16_t)0.8129882812500f,(float16_t)0.5820312500000f, +(float16_t)0.8105468750000f,(float16_t)0.5859375000000f, +(float16_t)0.8076171875000f,(float16_t)0.5893554687500f, +(float16_t)0.8051757812500f,(float16_t)0.5932617187500f, +(float16_t)0.8022460937500f,(float16_t)0.5971679687500f, +(float16_t)0.7993164062500f,(float16_t)0.6005859375000f, +(float16_t)0.7968750000000f,(float16_t)0.6044921875000f, +(float16_t)0.7939453125000f,(float16_t)0.6079101562500f, +(float16_t)0.7910156250000f,(float16_t)0.6118164062500f, +(float16_t)0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)0.7856445312500f,(float16_t)0.6186523437500f, +(float16_t)0.7827148437500f,(float16_t)0.6225585937500f, +(float16_t)0.7797851562500f,(float16_t)0.6259765625000f, +(float16_t)0.7768554687500f,(float16_t)0.6293945312500f, +(float16_t)0.7739257812500f,(float16_t)0.6333007812500f, +(float16_t)0.7709960937500f,(float16_t)0.6367187500000f, +(float16_t)0.7680664062500f,(float16_t)0.6401367187500f, +(float16_t)0.7651367187500f,(float16_t)0.6440429687500f, +(float16_t)0.7622070312500f,(float16_t)0.6474609375000f, +(float16_t)0.7592773437500f,(float16_t)0.6508789062500f, +(float16_t)0.7563476562500f,(float16_t)0.6542968750000f, +(float16_t)0.7534179687500f,(float16_t)0.6577148437500f, +(float16_t)0.7500000000000f,(float16_t)0.6611328125000f, +(float16_t)0.7470703125000f,(float16_t)0.6645507812500f, +(float16_t)0.7441406250000f,(float16_t)0.6679687500000f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.7377929687500f,(float16_t)0.6748046875000f, +(float16_t)0.7348632812500f,(float16_t)0.6782226562500f, +(float16_t)0.7314453125000f,(float16_t)0.6816406250000f, +(float16_t)0.7285156250000f,(float16_t)0.6850585937500f, +(float16_t)0.7250976562500f,(float16_t)0.6884765625000f, +(float16_t)0.7221679687500f,(float16_t)0.6918945312500f, +(float16_t)0.7187500000000f,(float16_t)0.6953125000000f, +(float16_t)0.7158203125000f,(float16_t)0.6982421875000f, +(float16_t)0.7124023437500f,(float16_t)0.7016601562500f, +(float16_t)0.7094726562500f,(float16_t)0.7050781250000f, +(float16_t)0.7060546875000f,(float16_t)0.7080078125000f, +(float16_t)0.7026367187500f,(float16_t)0.7114257812500f, +(float16_t)0.6997070312500f,(float16_t)0.7148437500000f, +(float16_t)0.6962890625000f,(float16_t)0.7177734375000f, +(float16_t)0.6928710937500f,(float16_t)0.7211914062500f, +(float16_t)0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)0.6860351562500f,(float16_t)0.7275390625000f, +(float16_t)0.6826171875000f,(float16_t)0.7304687500000f, +(float16_t)0.6796875000000f,(float16_t)0.7338867187500f, +(float16_t)0.6762695312500f,(float16_t)0.7368164062500f, +(float16_t)0.6728515625000f,(float16_t)0.7397460937500f, +(float16_t)0.6694335937500f,(float16_t)0.7431640625000f, +(float16_t)0.6660156250000f,(float16_t)0.7460937500000f, +(float16_t)0.6625976562500f,(float16_t)0.7490234375000f, +(float16_t)0.6591796875000f,(float16_t)0.7519531250000f, +(float16_t)0.6552734375000f,(float16_t)0.7553710937500f, +(float16_t)0.6518554687500f,(float16_t)0.7583007812500f, +(float16_t)0.6484375000000f,(float16_t)0.7612304687500f, +(float16_t)0.6450195312500f,(float16_t)0.7641601562500f, +(float16_t)0.6416015625000f,(float16_t)0.7670898437500f, +(float16_t)0.6381835937500f,(float16_t)0.7700195312500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.6308593750000f,(float16_t)0.7758789062500f, +(float16_t)0.6274414062500f,(float16_t)0.7788085937500f, +(float16_t)0.6235351562500f,(float16_t)0.7817382812500f, +(float16_t)0.6201171875000f,(float16_t)0.7846679687500f, +(float16_t)0.6162109375000f,(float16_t)0.7875976562500f, +(float16_t)0.6127929687500f,(float16_t)0.7900390625000f, +(float16_t)0.6093750000000f,(float16_t)0.7929687500000f, +(float16_t)0.6054687500000f,(float16_t)0.7958984375000f, +(float16_t)0.6020507812500f,(float16_t)0.7988281250000f, +(float16_t)0.5981445312500f,(float16_t)0.8012695312500f, +(float16_t)0.5942382812500f,(float16_t)0.8041992187500f, +(float16_t)0.5908203125000f,(float16_t)0.8066406250000f, +(float16_t)0.5869140625000f,(float16_t)0.8095703125000f, +(float16_t)0.5834960937500f,(float16_t)0.8120117187500f, +(float16_t)0.5795898437500f,(float16_t)0.8149414062500f, +(float16_t)0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)0.5722656250000f,(float16_t)0.8203125000000f, +(float16_t)0.5683593750000f,(float16_t)0.8227539062500f, +(float16_t)0.5644531250000f,(float16_t)0.8256835937500f, +(float16_t)0.5605468750000f,(float16_t)0.8281250000000f, +(float16_t)0.5566406250000f,(float16_t)0.8305664062500f, +(float16_t)0.5532226562500f,(float16_t)0.8330078125000f, +(float16_t)0.5493164062500f,(float16_t)0.8359375000000f, +(float16_t)0.5454101562500f,(float16_t)0.8383789062500f, +(float16_t)0.5415039062500f,(float16_t)0.8408203125000f, +(float16_t)0.5375976562500f,(float16_t)0.8432617187500f, +(float16_t)0.5336914062500f,(float16_t)0.8457031250000f, +(float16_t)0.5297851562500f,(float16_t)0.8481445312500f, +(float16_t)0.5258789062500f,(float16_t)0.8505859375000f, +(float16_t)0.5219726562500f,(float16_t)0.8530273437500f, +(float16_t)0.5180664062500f,(float16_t)0.8554687500000f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.5102539062500f,(float16_t)0.8598632812500f, +(float16_t)0.5063476562500f,(float16_t)0.8623046875000f, +(float16_t)0.5024414062500f,(float16_t)0.8647460937500f, +(float16_t)0.4982910156250f,(float16_t)0.8671875000000f, +(float16_t)0.4941406250000f,(float16_t)0.8691406250000f, +(float16_t)0.4902343750000f,(float16_t)0.8715820312500f, +(float16_t)0.4863281250000f,(float16_t)0.8740234375000f, +(float16_t)0.4821777343750f,(float16_t)0.8759765625000f, +(float16_t)0.4780273437500f,(float16_t)0.8784179687500f, +(float16_t)0.4741210937500f,(float16_t)0.8803710937500f, +(float16_t)0.4699707031250f,(float16_t)0.8828125000000f, +(float16_t)0.4660644531250f,(float16_t)0.8847656250000f, +(float16_t)0.4619140625000f,(float16_t)0.8867187500000f, +(float16_t)0.4577636718750f,(float16_t)0.8891601562500f, +(float16_t)0.4536132812500f,(float16_t)0.8911132812500f, +(float16_t)0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)0.4455566406250f,(float16_t)0.8955078125000f, +(float16_t)0.4414062500000f,(float16_t)0.8974609375000f, +(float16_t)0.4372558593750f,(float16_t)0.8994140625000f, +(float16_t)0.4331054687500f,(float16_t)0.9013671875000f, +(float16_t)0.4289550781250f,(float16_t)0.9033203125000f, +(float16_t)0.4248046875000f,(float16_t)0.9052734375000f, +(float16_t)0.4206542968750f,(float16_t)0.9072265625000f, +(float16_t)0.4165039062500f,(float16_t)0.9091796875000f, +(float16_t)0.4123535156250f,(float16_t)0.9111328125000f, +(float16_t)0.4079589843750f,(float16_t)0.9130859375000f, +(float16_t)0.4038085937500f,(float16_t)0.9150390625000f, +(float16_t)0.3996582031250f,(float16_t)0.9165039062500f, +(float16_t)0.3955078125000f,(float16_t)0.9184570312500f, +(float16_t)0.3911132812500f,(float16_t)0.9204101562500f, +(float16_t)0.3869628906250f,(float16_t)0.9218750000000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3784179687500f,(float16_t)0.9257812500000f, +(float16_t)0.3742675781250f,(float16_t)0.9272460937500f, +(float16_t)0.3698730468750f,(float16_t)0.9291992187500f, +(float16_t)0.3657226562500f,(float16_t)0.9306640625000f, +(float16_t)0.3613281250000f,(float16_t)0.9326171875000f, +(float16_t)0.3569335937500f,(float16_t)0.9340820312500f, +(float16_t)0.3527832031250f,(float16_t)0.9355468750000f, +(float16_t)0.3483886718750f,(float16_t)0.9375000000000f, +(float16_t)0.3439941406250f,(float16_t)0.9389648437500f, +(float16_t)0.3398437500000f,(float16_t)0.9404296875000f, +(float16_t)0.3354492187500f,(float16_t)0.9418945312500f, +(float16_t)0.3310546875000f,(float16_t)0.9433593750000f, +(float16_t)0.3266601562500f,(float16_t)0.9453125000000f, +(float16_t)0.3225097656250f,(float16_t)0.9467773437500f, +(float16_t)0.3181152343750f,(float16_t)0.9482421875000f, +(float16_t)0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)0.3093261718750f,(float16_t)0.9511718750000f, +(float16_t)0.3049316406250f,(float16_t)0.9521484375000f, +(float16_t)0.3005371093750f,(float16_t)0.9536132812500f, +(float16_t)0.2961425781250f,(float16_t)0.9550781250000f, +(float16_t)0.2917480468750f,(float16_t)0.9565429687500f, +(float16_t)0.2873535156250f,(float16_t)0.9580078125000f, +(float16_t)0.2829589843750f,(float16_t)0.9589843750000f, +(float16_t)0.2785644531250f,(float16_t)0.9604492187500f, +(float16_t)0.2741699218750f,(float16_t)0.9619140625000f, +(float16_t)0.2697753906250f,(float16_t)0.9628906250000f, +(float16_t)0.2651367187500f,(float16_t)0.9643554687500f, +(float16_t)0.2607421875000f,(float16_t)0.9653320312500f, +(float16_t)0.2563476562500f,(float16_t)0.9667968750000f, +(float16_t)0.2519531250000f,(float16_t)0.9677734375000f, +(float16_t)0.2474365234375f,(float16_t)0.9687500000000f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.2385253906250f,(float16_t)0.9711914062500f, +(float16_t)0.2340087890625f,(float16_t)0.9721679687500f, +(float16_t)0.2296142578125f,(float16_t)0.9731445312500f, +(float16_t)0.2250976562500f,(float16_t)0.9741210937500f, +(float16_t)0.2205810546875f,(float16_t)0.9755859375000f, +(float16_t)0.2160644531250f,(float16_t)0.9765625000000f, +(float16_t)0.2116699218750f,(float16_t)0.9775390625000f, +(float16_t)0.2071533203125f,(float16_t)0.9785156250000f, +(float16_t)0.2026367187500f,(float16_t)0.9794921875000f, +(float16_t)0.1981201171875f,(float16_t)0.9799804687500f, +(float16_t)0.1936035156250f,(float16_t)0.9809570312500f, +(float16_t)0.1890869140625f,(float16_t)0.9819335937500f, +(float16_t)0.1845703125000f,(float16_t)0.9829101562500f, +(float16_t)0.1800537109375f,(float16_t)0.9838867187500f, +(float16_t)0.1755371093750f,(float16_t)0.9843750000000f, +(float16_t)0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)0.1663818359375f,(float16_t)0.9858398437500f, +(float16_t)0.1618652343750f,(float16_t)0.9868164062500f, +(float16_t)0.1573486328125f,(float16_t)0.9873046875000f, +(float16_t)0.1528320312500f,(float16_t)0.9882812500000f, +(float16_t)0.1481933593750f,(float16_t)0.9887695312500f, +(float16_t)0.1436767578125f,(float16_t)0.9897460937500f, +(float16_t)0.1391601562500f,(float16_t)0.9902343750000f, +(float16_t)0.1345214843750f,(float16_t)0.9907226562500f, +(float16_t)0.1300048828125f,(float16_t)0.9916992187500f, +(float16_t)0.1254882812500f,(float16_t)0.9921875000000f, +(float16_t)0.1209106445312f,(float16_t)0.9926757812500f, +(float16_t)0.1163330078125f,(float16_t)0.9931640625000f, +(float16_t)0.1117553710938f,(float16_t)0.9936523437500f, +(float16_t)0.1071777343750f,(float16_t)0.9941406250000f, +(float16_t)0.1026000976562f,(float16_t)0.9946289062500f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0934448242188f,(float16_t)0.9956054687500f, +(float16_t)0.0888671875000f,(float16_t)0.9960937500000f, +(float16_t)0.0842895507812f,(float16_t)0.9965820312500f, +(float16_t)0.0797119140625f,(float16_t)0.9965820312500f, +(float16_t)0.0750732421875f,(float16_t)0.9970703125000f, +(float16_t)0.0704956054688f,(float16_t)0.9975585937500f, +(float16_t)0.0659179687500f,(float16_t)0.9980468750000f, +(float16_t)0.0613098144531f,(float16_t)0.9980468750000f, +(float16_t)0.0567321777344f,(float16_t)0.9985351562500f, +(float16_t)0.0521240234375f,(float16_t)0.9985351562500f, +(float16_t)0.0475463867188f,(float16_t)0.9990234375000f, +(float16_t)0.0429382324219f,(float16_t)0.9990234375000f, +(float16_t)0.0383300781250f,(float16_t)0.9990234375000f, +(float16_t)0.0337524414062f,(float16_t)0.9995117187500f, +(float16_t)0.0291442871094f,(float16_t)0.9995117187500f, +(float16_t)0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)0.0199432373047f,(float16_t)1.0000000000000f, +(float16_t)0.0153427124023f,(float16_t)1.0000000000000f, +(float16_t)0.0107345581055f,(float16_t)1.0000000000000f, +(float16_t)0.0061340332031f,(float16_t)1.0000000000000f, +(float16_t)0.0015335083008f,(float16_t)1.0000000000000f, +(float16_t)-0.0030670166016f,(float16_t)1.0000000000000f, +(float16_t)-0.0076713562012f,(float16_t)1.0000000000000f, +(float16_t)-0.0122680664062f,(float16_t)1.0000000000000f, +(float16_t)-0.0168762207031f,(float16_t)1.0000000000000f, +(float16_t)-0.0214691162109f,(float16_t)1.0000000000000f, +(float16_t)-0.0260772705078f,(float16_t)0.9995117187500f, +(float16_t)-0.0306701660156f,(float16_t)0.9995117187500f, +(float16_t)-0.0352783203125f,(float16_t)0.9995117187500f, +(float16_t)-0.0398864746094f,(float16_t)0.9990234375000f, +(float16_t)-0.0444641113281f,(float16_t)0.9990234375000f, +(float16_t)-0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)-0.0536499023438f,(float16_t)0.9985351562500f, +(float16_t)-0.0582580566406f,(float16_t)0.9985351562500f, +(float16_t)-0.0628662109375f,(float16_t)0.9980468750000f, +(float16_t)-0.0674438476562f,(float16_t)0.9975585937500f, +(float16_t)-0.0720214843750f,(float16_t)0.9975585937500f, +(float16_t)-0.0765991210938f,(float16_t)0.9970703125000f, +(float16_t)-0.0812377929688f,(float16_t)0.9965820312500f, +(float16_t)-0.0858154296875f,(float16_t)0.9960937500000f, +(float16_t)-0.0903930664062f,(float16_t)0.9960937500000f, +(float16_t)-0.0949707031250f,(float16_t)0.9956054687500f, +(float16_t)-0.0995483398438f,(float16_t)0.9951171875000f, +(float16_t)-0.1041259765625f,(float16_t)0.9946289062500f, +(float16_t)-0.1087036132812f,(float16_t)0.9941406250000f, +(float16_t)-0.1132812500000f,(float16_t)0.9936523437500f, +(float16_t)-0.1178588867188f,(float16_t)0.9931640625000f, +(float16_t)-0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)-0.1269531250000f,(float16_t)0.9916992187500f, +(float16_t)-0.1315917968750f,(float16_t)0.9912109375000f, +(float16_t)-0.1361083984375f,(float16_t)0.9907226562500f, +(float16_t)-0.1406250000000f,(float16_t)0.9902343750000f, +(float16_t)-0.1452636718750f,(float16_t)0.9892578125000f, +(float16_t)-0.1497802734375f,(float16_t)0.9887695312500f, +(float16_t)-0.1542968750000f,(float16_t)0.9877929687500f, +(float16_t)-0.1588134765625f,(float16_t)0.9873046875000f, +(float16_t)-0.1634521484375f,(float16_t)0.9863281250000f, +(float16_t)-0.1679687500000f,(float16_t)0.9858398437500f, +(float16_t)-0.1724853515625f,(float16_t)0.9848632812500f, +(float16_t)-0.1770019531250f,(float16_t)0.9843750000000f, +(float16_t)-0.1815185546875f,(float16_t)0.9833984375000f, +(float16_t)-0.1860351562500f,(float16_t)0.9824218750000f, +(float16_t)-0.1905517578125f,(float16_t)0.9814453125000f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.1995849609375f,(float16_t)0.9799804687500f, +(float16_t)-0.2041015625000f,(float16_t)0.9790039062500f, +(float16_t)-0.2086181640625f,(float16_t)0.9780273437500f, +(float16_t)-0.2131347656250f,(float16_t)0.9770507812500f, +(float16_t)-0.2176513671875f,(float16_t)0.9760742187500f, +(float16_t)-0.2220458984375f,(float16_t)0.9750976562500f, +(float16_t)-0.2265625000000f,(float16_t)0.9741210937500f, +(float16_t)-0.2310791015625f,(float16_t)0.9731445312500f, +(float16_t)-0.2354736328125f,(float16_t)0.9716796875000f, +(float16_t)-0.2399902343750f,(float16_t)0.9707031250000f, +(float16_t)-0.2445068359375f,(float16_t)0.9697265625000f, +(float16_t)-0.2489013671875f,(float16_t)0.9687500000000f, +(float16_t)-0.2534179687500f,(float16_t)0.9672851562500f, +(float16_t)-0.2578125000000f,(float16_t)0.9663085937500f, +(float16_t)-0.2622070312500f,(float16_t)0.9648437500000f, +(float16_t)-0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)-0.2712402343750f,(float16_t)0.9624023437500f, +(float16_t)-0.2756347656250f,(float16_t)0.9614257812500f, +(float16_t)-0.2800292968750f,(float16_t)0.9599609375000f, +(float16_t)-0.2844238281250f,(float16_t)0.9584960937500f, +(float16_t)-0.2888183593750f,(float16_t)0.9575195312500f, +(float16_t)-0.2932128906250f,(float16_t)0.9560546875000f, +(float16_t)-0.2976074218750f,(float16_t)0.9545898437500f, +(float16_t)-0.3020019531250f,(float16_t)0.9531250000000f, +(float16_t)-0.3063964843750f,(float16_t)0.9521484375000f, +(float16_t)-0.3107910156250f,(float16_t)0.9506835937500f, +(float16_t)-0.3151855468750f,(float16_t)0.9492187500000f, +(float16_t)-0.3195800781250f,(float16_t)0.9477539062500f, +(float16_t)-0.3239746093750f,(float16_t)0.9462890625000f, +(float16_t)-0.3281250000000f,(float16_t)0.9448242187500f, +(float16_t)-0.3325195312500f,(float16_t)0.9428710937500f, +(float16_t)-0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)-0.3413085937500f,(float16_t)0.9399414062500f, +(float16_t)-0.3454589843750f,(float16_t)0.9384765625000f, +(float16_t)-0.3498535156250f,(float16_t)0.9370117187500f, +(float16_t)-0.3542480468750f,(float16_t)0.9350585937500f, +(float16_t)-0.3583984375000f,(float16_t)0.9335937500000f, +(float16_t)-0.3627929687500f,(float16_t)0.9316406250000f, +(float16_t)-0.3669433593750f,(float16_t)0.9301757812500f, +(float16_t)-0.3713378906250f,(float16_t)0.9287109375000f, +(float16_t)-0.3754882812500f,(float16_t)0.9267578125000f, +(float16_t)-0.3798828125000f,(float16_t)0.9252929687500f, +(float16_t)-0.3840332031250f,(float16_t)0.9233398437500f, +(float16_t)-0.3884277343750f,(float16_t)0.9213867187500f, +(float16_t)-0.3925781250000f,(float16_t)0.9199218750000f, +(float16_t)-0.3967285156250f,(float16_t)0.9179687500000f, +(float16_t)-0.4011230468750f,(float16_t)0.9160156250000f, +(float16_t)-0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)-0.4094238281250f,(float16_t)0.9121093750000f, +(float16_t)-0.4135742187500f,(float16_t)0.9106445312500f, +(float16_t)-0.4177246093750f,(float16_t)0.9086914062500f, +(float16_t)-0.4221191406250f,(float16_t)0.9067382812500f, +(float16_t)-0.4262695312500f,(float16_t)0.9047851562500f, +(float16_t)-0.4304199218750f,(float16_t)0.9028320312500f, +(float16_t)-0.4345703125000f,(float16_t)0.9008789062500f, +(float16_t)-0.4387207031250f,(float16_t)0.8984375000000f, +(float16_t)-0.4426269531250f,(float16_t)0.8964843750000f, +(float16_t)-0.4467773437500f,(float16_t)0.8945312500000f, +(float16_t)-0.4509277343750f,(float16_t)0.8925781250000f, +(float16_t)-0.4550781250000f,(float16_t)0.8906250000000f, +(float16_t)-0.4592285156250f,(float16_t)0.8881835937500f, +(float16_t)-0.4633789062500f,(float16_t)0.8862304687500f, +(float16_t)-0.4672851562500f,(float16_t)0.8842773437500f, +(float16_t)-0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)-0.4753417968750f,(float16_t)0.8798828125000f, +(float16_t)-0.4794921875000f,(float16_t)0.8774414062500f, +(float16_t)-0.4836425781250f,(float16_t)0.8754882812500f, +(float16_t)-0.4875488281250f,(float16_t)0.8730468750000f, +(float16_t)-0.4914550781250f,(float16_t)0.8706054687500f, +(float16_t)-0.4956054687500f,(float16_t)0.8686523437500f, +(float16_t)-0.4995117187500f,(float16_t)0.8662109375000f, +(float16_t)-0.5034179687500f,(float16_t)0.8637695312500f, +(float16_t)-0.5073242187500f,(float16_t)0.8618164062500f, +(float16_t)-0.5112304687500f,(float16_t)0.8593750000000f, +(float16_t)-0.5156250000000f,(float16_t)0.8569335937500f, +(float16_t)-0.5195312500000f,(float16_t)0.8544921875000f, +(float16_t)-0.5234375000000f,(float16_t)0.8520507812500f, +(float16_t)-0.5273437500000f,(float16_t)0.8496093750000f, +(float16_t)-0.5312500000000f,(float16_t)0.8471679687500f, +(float16_t)-0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)-0.5390625000000f,(float16_t)0.8422851562500f, +(float16_t)-0.5429687500000f,(float16_t)0.8398437500000f, +(float16_t)-0.5463867187500f,(float16_t)0.8374023437500f, +(float16_t)-0.5502929687500f,(float16_t)0.8349609375000f, +(float16_t)-0.5541992187500f,(float16_t)0.8325195312500f, +(float16_t)-0.5581054687500f,(float16_t)0.8295898437500f, +(float16_t)-0.5620117187500f,(float16_t)0.8271484375000f, +(float16_t)-0.5659179687500f,(float16_t)0.8247070312500f, +(float16_t)-0.5693359375000f,(float16_t)0.8217773437500f, +(float16_t)-0.5732421875000f,(float16_t)0.8193359375000f, +(float16_t)-0.5771484375000f,(float16_t)0.8168945312500f, +(float16_t)-0.5810546875000f,(float16_t)0.8139648437500f, +(float16_t)-0.5844726562500f,(float16_t)0.8115234375000f, +(float16_t)-0.5883789062500f,(float16_t)0.8085937500000f, +(float16_t)-0.5917968750000f,(float16_t)0.8061523437500f, +(float16_t)-0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)-0.5996093750000f,(float16_t)0.8002929687500f, +(float16_t)-0.6030273437500f,(float16_t)0.7978515625000f, +(float16_t)-0.6069335937500f,(float16_t)0.7949218750000f, +(float16_t)-0.6103515625000f,(float16_t)0.7919921875000f, +(float16_t)-0.6142578125000f,(float16_t)0.7890625000000f, +(float16_t)-0.6176757812500f,(float16_t)0.7866210937500f, +(float16_t)-0.6210937500000f,(float16_t)0.7836914062500f, +(float16_t)-0.6250000000000f,(float16_t)0.7807617187500f, +(float16_t)-0.6284179687500f,(float16_t)0.7778320312500f, +(float16_t)-0.6318359375000f,(float16_t)0.7749023437500f, +(float16_t)-0.6357421875000f,(float16_t)0.7719726562500f, +(float16_t)-0.6391601562500f,(float16_t)0.7690429687500f, +(float16_t)-0.6425781250000f,(float16_t)0.7661132812500f, +(float16_t)-0.6459960937500f,(float16_t)0.7631835937500f, +(float16_t)-0.6499023437500f,(float16_t)0.7602539062500f, +(float16_t)-0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)-0.6567382812500f,(float16_t)0.7543945312500f, +(float16_t)-0.6601562500000f,(float16_t)0.7509765625000f, +(float16_t)-0.6635742187500f,(float16_t)0.7480468750000f, +(float16_t)-0.6669921875000f,(float16_t)0.7451171875000f, +(float16_t)-0.6704101562500f,(float16_t)0.7421875000000f, +(float16_t)-0.6738281250000f,(float16_t)0.7387695312500f, +(float16_t)-0.6772460937500f,(float16_t)0.7358398437500f, +(float16_t)-0.6806640625000f,(float16_t)0.7324218750000f, +(float16_t)-0.6840820312500f,(float16_t)0.7294921875000f, +(float16_t)-0.6875000000000f,(float16_t)0.7265625000000f, +(float16_t)-0.6904296875000f,(float16_t)0.7231445312500f, +(float16_t)-0.6938476562500f,(float16_t)0.7202148437500f, +(float16_t)-0.6972656250000f,(float16_t)0.7167968750000f, +(float16_t)-0.7006835937500f,(float16_t)0.7133789062500f, +(float16_t)-0.7036132812500f,(float16_t)0.7104492187500f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.7104492187500f,(float16_t)0.7036132812500f, +(float16_t)-0.7133789062500f,(float16_t)0.7006835937500f, +(float16_t)-0.7167968750000f,(float16_t)0.6972656250000f, +(float16_t)-0.7202148437500f,(float16_t)0.6938476562500f, +(float16_t)-0.7231445312500f,(float16_t)0.6904296875000f, +(float16_t)-0.7265625000000f,(float16_t)0.6875000000000f, +(float16_t)-0.7294921875000f,(float16_t)0.6840820312500f, +(float16_t)-0.7324218750000f,(float16_t)0.6806640625000f, +(float16_t)-0.7358398437500f,(float16_t)0.6772460937500f, +(float16_t)-0.7387695312500f,(float16_t)0.6738281250000f, +(float16_t)-0.7421875000000f,(float16_t)0.6704101562500f, +(float16_t)-0.7451171875000f,(float16_t)0.6669921875000f, +(float16_t)-0.7480468750000f,(float16_t)0.6635742187500f, +(float16_t)-0.7509765625000f,(float16_t)0.6601562500000f, +(float16_t)-0.7543945312500f,(float16_t)0.6567382812500f, +(float16_t)-0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)-0.7602539062500f,(float16_t)0.6499023437500f, +(float16_t)-0.7631835937500f,(float16_t)0.6459960937500f, +(float16_t)-0.7661132812500f,(float16_t)0.6425781250000f, +(float16_t)-0.7690429687500f,(float16_t)0.6391601562500f, +(float16_t)-0.7719726562500f,(float16_t)0.6357421875000f, +(float16_t)-0.7749023437500f,(float16_t)0.6318359375000f, +(float16_t)-0.7778320312500f,(float16_t)0.6284179687500f, +(float16_t)-0.7807617187500f,(float16_t)0.6250000000000f, +(float16_t)-0.7836914062500f,(float16_t)0.6210937500000f, +(float16_t)-0.7866210937500f,(float16_t)0.6176757812500f, +(float16_t)-0.7890625000000f,(float16_t)0.6142578125000f, +(float16_t)-0.7919921875000f,(float16_t)0.6103515625000f, +(float16_t)-0.7949218750000f,(float16_t)0.6069335937500f, +(float16_t)-0.7978515625000f,(float16_t)0.6030273437500f, +(float16_t)-0.8002929687500f,(float16_t)0.5996093750000f, +(float16_t)-0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)-0.8061523437500f,(float16_t)0.5917968750000f, +(float16_t)-0.8085937500000f,(float16_t)0.5883789062500f, +(float16_t)-0.8115234375000f,(float16_t)0.5844726562500f, +(float16_t)-0.8139648437500f,(float16_t)0.5810546875000f, +(float16_t)-0.8168945312500f,(float16_t)0.5771484375000f, +(float16_t)-0.8193359375000f,(float16_t)0.5732421875000f, +(float16_t)-0.8217773437500f,(float16_t)0.5693359375000f, +(float16_t)-0.8247070312500f,(float16_t)0.5659179687500f, +(float16_t)-0.8271484375000f,(float16_t)0.5620117187500f, +(float16_t)-0.8295898437500f,(float16_t)0.5581054687500f, +(float16_t)-0.8325195312500f,(float16_t)0.5541992187500f, +(float16_t)-0.8349609375000f,(float16_t)0.5502929687500f, +(float16_t)-0.8374023437500f,(float16_t)0.5463867187500f, +(float16_t)-0.8398437500000f,(float16_t)0.5429687500000f, +(float16_t)-0.8422851562500f,(float16_t)0.5390625000000f, +(float16_t)-0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)-0.8471679687500f,(float16_t)0.5312500000000f, +(float16_t)-0.8496093750000f,(float16_t)0.5273437500000f, +(float16_t)-0.8520507812500f,(float16_t)0.5234375000000f, +(float16_t)-0.8544921875000f,(float16_t)0.5195312500000f, +(float16_t)-0.8569335937500f,(float16_t)0.5156250000000f, +(float16_t)-0.8593750000000f,(float16_t)0.5112304687500f, +(float16_t)-0.8618164062500f,(float16_t)0.5073242187500f, +(float16_t)-0.8637695312500f,(float16_t)0.5034179687500f, +(float16_t)-0.8662109375000f,(float16_t)0.4995117187500f, +(float16_t)-0.8686523437500f,(float16_t)0.4956054687500f, +(float16_t)-0.8706054687500f,(float16_t)0.4914550781250f, +(float16_t)-0.8730468750000f,(float16_t)0.4875488281250f, +(float16_t)-0.8754882812500f,(float16_t)0.4836425781250f, +(float16_t)-0.8774414062500f,(float16_t)0.4794921875000f, +(float16_t)-0.8798828125000f,(float16_t)0.4753417968750f, +(float16_t)-0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)-0.8842773437500f,(float16_t)0.4672851562500f, +(float16_t)-0.8862304687500f,(float16_t)0.4633789062500f, +(float16_t)-0.8881835937500f,(float16_t)0.4592285156250f, +(float16_t)-0.8906250000000f,(float16_t)0.4550781250000f, +(float16_t)-0.8925781250000f,(float16_t)0.4509277343750f, +(float16_t)-0.8945312500000f,(float16_t)0.4467773437500f, +(float16_t)-0.8964843750000f,(float16_t)0.4426269531250f, +(float16_t)-0.8984375000000f,(float16_t)0.4387207031250f, +(float16_t)-0.9008789062500f,(float16_t)0.4345703125000f, +(float16_t)-0.9028320312500f,(float16_t)0.4304199218750f, +(float16_t)-0.9047851562500f,(float16_t)0.4262695312500f, +(float16_t)-0.9067382812500f,(float16_t)0.4221191406250f, +(float16_t)-0.9086914062500f,(float16_t)0.4177246093750f, +(float16_t)-0.9106445312500f,(float16_t)0.4135742187500f, +(float16_t)-0.9121093750000f,(float16_t)0.4094238281250f, +(float16_t)-0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)-0.9160156250000f,(float16_t)0.4011230468750f, +(float16_t)-0.9179687500000f,(float16_t)0.3967285156250f, +(float16_t)-0.9199218750000f,(float16_t)0.3925781250000f, +(float16_t)-0.9213867187500f,(float16_t)0.3884277343750f, +(float16_t)-0.9233398437500f,(float16_t)0.3840332031250f, +(float16_t)-0.9252929687500f,(float16_t)0.3798828125000f, +(float16_t)-0.9267578125000f,(float16_t)0.3754882812500f, +(float16_t)-0.9287109375000f,(float16_t)0.3713378906250f, +(float16_t)-0.9301757812500f,(float16_t)0.3669433593750f, +(float16_t)-0.9316406250000f,(float16_t)0.3627929687500f, +(float16_t)-0.9335937500000f,(float16_t)0.3583984375000f, +(float16_t)-0.9350585937500f,(float16_t)0.3542480468750f, +(float16_t)-0.9370117187500f,(float16_t)0.3498535156250f, +(float16_t)-0.9384765625000f,(float16_t)0.3454589843750f, +(float16_t)-0.9399414062500f,(float16_t)0.3413085937500f, +(float16_t)-0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)-0.9428710937500f,(float16_t)0.3325195312500f, +(float16_t)-0.9448242187500f,(float16_t)0.3281250000000f, +(float16_t)-0.9462890625000f,(float16_t)0.3239746093750f, +(float16_t)-0.9477539062500f,(float16_t)0.3195800781250f, +(float16_t)-0.9492187500000f,(float16_t)0.3151855468750f, +(float16_t)-0.9506835937500f,(float16_t)0.3107910156250f, +(float16_t)-0.9521484375000f,(float16_t)0.3063964843750f, +(float16_t)-0.9531250000000f,(float16_t)0.3020019531250f, +(float16_t)-0.9545898437500f,(float16_t)0.2976074218750f, +(float16_t)-0.9560546875000f,(float16_t)0.2932128906250f, +(float16_t)-0.9575195312500f,(float16_t)0.2888183593750f, +(float16_t)-0.9584960937500f,(float16_t)0.2844238281250f, +(float16_t)-0.9599609375000f,(float16_t)0.2800292968750f, +(float16_t)-0.9614257812500f,(float16_t)0.2756347656250f, +(float16_t)-0.9624023437500f,(float16_t)0.2712402343750f, +(float16_t)-0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)-0.9648437500000f,(float16_t)0.2622070312500f, +(float16_t)-0.9663085937500f,(float16_t)0.2578125000000f, +(float16_t)-0.9672851562500f,(float16_t)0.2534179687500f, +(float16_t)-0.9687500000000f,(float16_t)0.2489013671875f, +(float16_t)-0.9697265625000f,(float16_t)0.2445068359375f, +(float16_t)-0.9707031250000f,(float16_t)0.2399902343750f, +(float16_t)-0.9716796875000f,(float16_t)0.2354736328125f, +(float16_t)-0.9731445312500f,(float16_t)0.2310791015625f, +(float16_t)-0.9741210937500f,(float16_t)0.2265625000000f, +(float16_t)-0.9750976562500f,(float16_t)0.2220458984375f, +(float16_t)-0.9760742187500f,(float16_t)0.2176513671875f, +(float16_t)-0.9770507812500f,(float16_t)0.2131347656250f, +(float16_t)-0.9780273437500f,(float16_t)0.2086181640625f, +(float16_t)-0.9790039062500f,(float16_t)0.2041015625000f, +(float16_t)-0.9799804687500f,(float16_t)0.1995849609375f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)-0.9814453125000f,(float16_t)0.1905517578125f, +(float16_t)-0.9824218750000f,(float16_t)0.1860351562500f, +(float16_t)-0.9833984375000f,(float16_t)0.1815185546875f, +(float16_t)-0.9843750000000f,(float16_t)0.1770019531250f, +(float16_t)-0.9848632812500f,(float16_t)0.1724853515625f, +(float16_t)-0.9858398437500f,(float16_t)0.1679687500000f, +(float16_t)-0.9863281250000f,(float16_t)0.1634521484375f, +(float16_t)-0.9873046875000f,(float16_t)0.1588134765625f, +(float16_t)-0.9877929687500f,(float16_t)0.1542968750000f, +(float16_t)-0.9887695312500f,(float16_t)0.1497802734375f, +(float16_t)-0.9892578125000f,(float16_t)0.1452636718750f, +(float16_t)-0.9902343750000f,(float16_t)0.1406250000000f, +(float16_t)-0.9907226562500f,(float16_t)0.1361083984375f, +(float16_t)-0.9912109375000f,(float16_t)0.1315917968750f, +(float16_t)-0.9916992187500f,(float16_t)0.1269531250000f, +(float16_t)-0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)-0.9931640625000f,(float16_t)0.1178588867188f, +(float16_t)-0.9936523437500f,(float16_t)0.1132812500000f, +(float16_t)-0.9941406250000f,(float16_t)0.1087036132812f, +(float16_t)-0.9946289062500f,(float16_t)0.1041259765625f, +(float16_t)-0.9951171875000f,(float16_t)0.0995483398438f, +(float16_t)-0.9956054687500f,(float16_t)0.0949707031250f, +(float16_t)-0.9960937500000f,(float16_t)0.0903930664062f, +(float16_t)-0.9960937500000f,(float16_t)0.0858154296875f, +(float16_t)-0.9965820312500f,(float16_t)0.0812377929688f, +(float16_t)-0.9970703125000f,(float16_t)0.0765991210938f, +(float16_t)-0.9975585937500f,(float16_t)0.0720214843750f, +(float16_t)-0.9975585937500f,(float16_t)0.0674438476562f, +(float16_t)-0.9980468750000f,(float16_t)0.0628662109375f, +(float16_t)-0.9985351562500f,(float16_t)0.0582580566406f, +(float16_t)-0.9985351562500f,(float16_t)0.0536499023438f, +(float16_t)-0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)-0.9990234375000f,(float16_t)0.0444641113281f, +(float16_t)-0.9990234375000f,(float16_t)0.0398864746094f, +(float16_t)-0.9995117187500f,(float16_t)0.0352783203125f, +(float16_t)-0.9995117187500f,(float16_t)0.0306701660156f, +(float16_t)-0.9995117187500f,(float16_t)0.0260772705078f, +(float16_t)-1.0000000000000f,(float16_t)0.0214691162109f, +(float16_t)-1.0000000000000f,(float16_t)0.0168762207031f, +(float16_t)-1.0000000000000f,(float16_t)0.0122680664062f, +(float16_t)-1.0000000000000f,(float16_t)0.0076713562012f, +(float16_t)-1.0000000000000f,(float16_t)0.0030670166016f, +(float16_t)-1.0000000000000f,(float16_t)-0.0015335083008f, +(float16_t)-1.0000000000000f,(float16_t)-0.0061340332031f, +(float16_t)-1.0000000000000f,(float16_t)-0.0107345581055f, +(float16_t)-1.0000000000000f,(float16_t)-0.0153427124023f, +(float16_t)-1.0000000000000f,(float16_t)-0.0199432373047f, +(float16_t)-0.9995117187500f,(float16_t)-0.0245361328125f, +(float16_t)-0.9995117187500f,(float16_t)-0.0291442871094f, +(float16_t)-0.9995117187500f,(float16_t)-0.0337524414062f, +(float16_t)-0.9990234375000f,(float16_t)-0.0383300781250f, +(float16_t)-0.9990234375000f,(float16_t)-0.0429382324219f, +(float16_t)-0.9990234375000f,(float16_t)-0.0475463867188f, +(float16_t)-0.9985351562500f,(float16_t)-0.0521240234375f, +(float16_t)-0.9985351562500f,(float16_t)-0.0567321777344f, +(float16_t)-0.9980468750000f,(float16_t)-0.0613098144531f, +(float16_t)-0.9980468750000f,(float16_t)-0.0659179687500f, +(float16_t)-0.9975585937500f,(float16_t)-0.0704956054688f, +(float16_t)-0.9970703125000f,(float16_t)-0.0750732421875f, +(float16_t)-0.9965820312500f,(float16_t)-0.0797119140625f, +(float16_t)-0.9965820312500f,(float16_t)-0.0842895507812f, +(float16_t)-0.9960937500000f,(float16_t)-0.0888671875000f, +(float16_t)-0.9956054687500f,(float16_t)-0.0934448242188f, +(float16_t)-0.9951171875000f,(float16_t)-0.0980224609375f, +(float16_t)-0.9946289062500f,(float16_t)-0.1026000976562f, +(float16_t)-0.9941406250000f,(float16_t)-0.1071777343750f, +(float16_t)-0.9936523437500f,(float16_t)-0.1117553710938f, +(float16_t)-0.9931640625000f,(float16_t)-0.1163330078125f, +(float16_t)-0.9926757812500f,(float16_t)-0.1209106445312f, +(float16_t)-0.9921875000000f,(float16_t)-0.1254882812500f, +(float16_t)-0.9916992187500f,(float16_t)-0.1300048828125f, +(float16_t)-0.9907226562500f,(float16_t)-0.1345214843750f, +(float16_t)-0.9902343750000f,(float16_t)-0.1391601562500f, +(float16_t)-0.9897460937500f,(float16_t)-0.1436767578125f, +(float16_t)-0.9887695312500f,(float16_t)-0.1481933593750f, +(float16_t)-0.9882812500000f,(float16_t)-0.1528320312500f, +(float16_t)-0.9873046875000f,(float16_t)-0.1573486328125f, +(float16_t)-0.9868164062500f,(float16_t)-0.1618652343750f, +(float16_t)-0.9858398437500f,(float16_t)-0.1663818359375f, +(float16_t)-0.9853515625000f,(float16_t)-0.1710205078125f, +(float16_t)-0.9843750000000f,(float16_t)-0.1755371093750f, +(float16_t)-0.9838867187500f,(float16_t)-0.1800537109375f, +(float16_t)-0.9829101562500f,(float16_t)-0.1845703125000f, +(float16_t)-0.9819335937500f,(float16_t)-0.1890869140625f, +(float16_t)-0.9809570312500f,(float16_t)-0.1936035156250f, +(float16_t)-0.9799804687500f,(float16_t)-0.1981201171875f, +(float16_t)-0.9794921875000f,(float16_t)-0.2026367187500f, +(float16_t)-0.9785156250000f,(float16_t)-0.2071533203125f, +(float16_t)-0.9775390625000f,(float16_t)-0.2116699218750f, +(float16_t)-0.9765625000000f,(float16_t)-0.2160644531250f, +(float16_t)-0.9755859375000f,(float16_t)-0.2205810546875f, +(float16_t)-0.9741210937500f,(float16_t)-0.2250976562500f, +(float16_t)-0.9731445312500f,(float16_t)-0.2296142578125f, +(float16_t)-0.9721679687500f,(float16_t)-0.2340087890625f, +(float16_t)-0.9711914062500f,(float16_t)-0.2385253906250f, +(float16_t)-0.9702148437500f,(float16_t)-0.2429199218750f, +(float16_t)-0.9687500000000f,(float16_t)-0.2474365234375f, +(float16_t)-0.9677734375000f,(float16_t)-0.2519531250000f, +(float16_t)-0.9667968750000f,(float16_t)-0.2563476562500f, +(float16_t)-0.9653320312500f,(float16_t)-0.2607421875000f, +(float16_t)-0.9643554687500f,(float16_t)-0.2651367187500f, +(float16_t)-0.9628906250000f,(float16_t)-0.2697753906250f, +(float16_t)-0.9619140625000f,(float16_t)-0.2741699218750f, +(float16_t)-0.9604492187500f,(float16_t)-0.2785644531250f, +(float16_t)-0.9589843750000f,(float16_t)-0.2829589843750f, +(float16_t)-0.9580078125000f,(float16_t)-0.2873535156250f, +(float16_t)-0.9565429687500f,(float16_t)-0.2917480468750f, +(float16_t)-0.9550781250000f,(float16_t)-0.2961425781250f, +(float16_t)-0.9536132812500f,(float16_t)-0.3005371093750f, +(float16_t)-0.9521484375000f,(float16_t)-0.3049316406250f, +(float16_t)-0.9511718750000f,(float16_t)-0.3093261718750f, +(float16_t)-0.9497070312500f,(float16_t)-0.3137207031250f, +(float16_t)-0.9482421875000f,(float16_t)-0.3181152343750f, +(float16_t)-0.9467773437500f,(float16_t)-0.3225097656250f, +(float16_t)-0.9453125000000f,(float16_t)-0.3266601562500f, +(float16_t)-0.9433593750000f,(float16_t)-0.3310546875000f, +(float16_t)-0.9418945312500f,(float16_t)-0.3354492187500f, +(float16_t)-0.9404296875000f,(float16_t)-0.3398437500000f, +(float16_t)-0.9389648437500f,(float16_t)-0.3439941406250f, +(float16_t)-0.9375000000000f,(float16_t)-0.3483886718750f, +(float16_t)-0.9355468750000f,(float16_t)-0.3527832031250f, +(float16_t)-0.9340820312500f,(float16_t)-0.3569335937500f, +(float16_t)-0.9326171875000f,(float16_t)-0.3613281250000f, +(float16_t)-0.9306640625000f,(float16_t)-0.3657226562500f, +(float16_t)-0.9291992187500f,(float16_t)-0.3698730468750f, +(float16_t)-0.9272460937500f,(float16_t)-0.3742675781250f, +(float16_t)-0.9257812500000f,(float16_t)-0.3784179687500f, +(float16_t)-0.9238281250000f,(float16_t)-0.3825683593750f, +(float16_t)-0.9218750000000f,(float16_t)-0.3869628906250f, +(float16_t)-0.9204101562500f,(float16_t)-0.3911132812500f, +(float16_t)-0.9184570312500f,(float16_t)-0.3955078125000f, +(float16_t)-0.9165039062500f,(float16_t)-0.3996582031250f, +(float16_t)-0.9150390625000f,(float16_t)-0.4038085937500f, +(float16_t)-0.9130859375000f,(float16_t)-0.4079589843750f, +(float16_t)-0.9111328125000f,(float16_t)-0.4123535156250f, +(float16_t)-0.9091796875000f,(float16_t)-0.4165039062500f, +(float16_t)-0.9072265625000f,(float16_t)-0.4206542968750f, +(float16_t)-0.9052734375000f,(float16_t)-0.4248046875000f, +(float16_t)-0.9033203125000f,(float16_t)-0.4289550781250f, +(float16_t)-0.9013671875000f,(float16_t)-0.4331054687500f, +(float16_t)-0.8994140625000f,(float16_t)-0.4372558593750f, +(float16_t)-0.8974609375000f,(float16_t)-0.4414062500000f, +(float16_t)-0.8955078125000f,(float16_t)-0.4455566406250f, +(float16_t)-0.8930664062500f,(float16_t)-0.4497070312500f, +(float16_t)-0.8911132812500f,(float16_t)-0.4536132812500f, +(float16_t)-0.8891601562500f,(float16_t)-0.4577636718750f, +(float16_t)-0.8867187500000f,(float16_t)-0.4619140625000f, +(float16_t)-0.8847656250000f,(float16_t)-0.4660644531250f, +(float16_t)-0.8828125000000f,(float16_t)-0.4699707031250f, +(float16_t)-0.8803710937500f,(float16_t)-0.4741210937500f, +(float16_t)-0.8784179687500f,(float16_t)-0.4780273437500f, +(float16_t)-0.8759765625000f,(float16_t)-0.4821777343750f, +(float16_t)-0.8740234375000f,(float16_t)-0.4863281250000f, +(float16_t)-0.8715820312500f,(float16_t)-0.4902343750000f, +(float16_t)-0.8691406250000f,(float16_t)-0.4941406250000f, +(float16_t)-0.8671875000000f,(float16_t)-0.4982910156250f, +(float16_t)-0.8647460937500f,(float16_t)-0.5024414062500f, +(float16_t)-0.8623046875000f,(float16_t)-0.5063476562500f, +(float16_t)-0.8598632812500f,(float16_t)-0.5102539062500f, +(float16_t)-0.8579101562500f,(float16_t)-0.5141601562500f, +(float16_t)-0.8554687500000f,(float16_t)-0.5180664062500f, +(float16_t)-0.8530273437500f,(float16_t)-0.5219726562500f, +(float16_t)-0.8505859375000f,(float16_t)-0.5258789062500f, +(float16_t)-0.8481445312500f,(float16_t)-0.5297851562500f, +(float16_t)-0.8457031250000f,(float16_t)-0.5336914062500f, +(float16_t)-0.8432617187500f,(float16_t)-0.5375976562500f, +(float16_t)-0.8408203125000f,(float16_t)-0.5415039062500f, +(float16_t)-0.8383789062500f,(float16_t)-0.5454101562500f, +(float16_t)-0.8359375000000f,(float16_t)-0.5493164062500f, +(float16_t)-0.8330078125000f,(float16_t)-0.5532226562500f, +(float16_t)-0.8305664062500f,(float16_t)-0.5566406250000f, +(float16_t)-0.8281250000000f,(float16_t)-0.5605468750000f, +(float16_t)-0.8256835937500f,(float16_t)-0.5644531250000f, +(float16_t)-0.8227539062500f,(float16_t)-0.5683593750000f, +(float16_t)-0.8203125000000f,(float16_t)-0.5722656250000f, +(float16_t)-0.8173828125000f,(float16_t)-0.5756835937500f, +(float16_t)-0.8149414062500f,(float16_t)-0.5795898437500f, +(float16_t)-0.8120117187500f,(float16_t)-0.5834960937500f, +(float16_t)-0.8095703125000f,(float16_t)-0.5869140625000f, +(float16_t)-0.8066406250000f,(float16_t)-0.5908203125000f, +(float16_t)-0.8041992187500f,(float16_t)-0.5942382812500f, +(float16_t)-0.8012695312500f,(float16_t)-0.5981445312500f, +(float16_t)-0.7988281250000f,(float16_t)-0.6020507812500f, +(float16_t)-0.7958984375000f,(float16_t)-0.6054687500000f, +(float16_t)-0.7929687500000f,(float16_t)-0.6093750000000f, +(float16_t)-0.7900390625000f,(float16_t)-0.6127929687500f, +(float16_t)-0.7875976562500f,(float16_t)-0.6162109375000f, +(float16_t)-0.7846679687500f,(float16_t)-0.6201171875000f, +(float16_t)-0.7817382812500f,(float16_t)-0.6235351562500f, +(float16_t)-0.7788085937500f,(float16_t)-0.6274414062500f, +(float16_t)-0.7758789062500f,(float16_t)-0.6308593750000f, +(float16_t)-0.7729492187500f,(float16_t)-0.6342773437500f, +(float16_t)-0.7700195312500f,(float16_t)-0.6381835937500f, +(float16_t)-0.7670898437500f,(float16_t)-0.6416015625000f, +(float16_t)-0.7641601562500f,(float16_t)-0.6450195312500f, +(float16_t)-0.7612304687500f,(float16_t)-0.6484375000000f, +(float16_t)-0.7583007812500f,(float16_t)-0.6518554687500f, +(float16_t)-0.7553710937500f,(float16_t)-0.6552734375000f, +(float16_t)-0.7519531250000f,(float16_t)-0.6591796875000f, +(float16_t)-0.7490234375000f,(float16_t)-0.6625976562500f, +(float16_t)-0.7460937500000f,(float16_t)-0.6660156250000f, +(float16_t)-0.7431640625000f,(float16_t)-0.6694335937500f, +(float16_t)-0.7397460937500f,(float16_t)-0.6728515625000f, +(float16_t)-0.7368164062500f,(float16_t)-0.6762695312500f, +(float16_t)-0.7338867187500f,(float16_t)-0.6796875000000f, +(float16_t)-0.7304687500000f,(float16_t)-0.6826171875000f, +(float16_t)-0.7275390625000f,(float16_t)-0.6860351562500f, +(float16_t)-0.7241210937500f,(float16_t)-0.6894531250000f, +(float16_t)-0.7211914062500f,(float16_t)-0.6928710937500f, +(float16_t)-0.7177734375000f,(float16_t)-0.6962890625000f, +(float16_t)-0.7148437500000f,(float16_t)-0.6997070312500f, +(float16_t)-0.7114257812500f,(float16_t)-0.7026367187500f, +(float16_t)-0.7080078125000f,(float16_t)-0.7060546875000f, +(float16_t)-0.7050781250000f,(float16_t)-0.7094726562500f, +(float16_t)-0.7016601562500f,(float16_t)-0.7124023437500f, +(float16_t)-0.6982421875000f,(float16_t)-0.7158203125000f, +(float16_t)-0.6953125000000f,(float16_t)-0.7187500000000f, +(float16_t)-0.6918945312500f,(float16_t)-0.7221679687500f, +(float16_t)-0.6884765625000f,(float16_t)-0.7250976562500f, +(float16_t)-0.6850585937500f,(float16_t)-0.7285156250000f, +(float16_t)-0.6816406250000f,(float16_t)-0.7314453125000f, +(float16_t)-0.6782226562500f,(float16_t)-0.7348632812500f, +(float16_t)-0.6748046875000f,(float16_t)-0.7377929687500f, +(float16_t)-0.6713867187500f,(float16_t)-0.7407226562500f, +(float16_t)-0.6679687500000f,(float16_t)-0.7441406250000f, +(float16_t)-0.6645507812500f,(float16_t)-0.7470703125000f, +(float16_t)-0.6611328125000f,(float16_t)-0.7500000000000f, +(float16_t)-0.6577148437500f,(float16_t)-0.7534179687500f, +(float16_t)-0.6542968750000f,(float16_t)-0.7563476562500f, +(float16_t)-0.6508789062500f,(float16_t)-0.7592773437500f, +(float16_t)-0.6474609375000f,(float16_t)-0.7622070312500f, +(float16_t)-0.6440429687500f,(float16_t)-0.7651367187500f, +(float16_t)-0.6401367187500f,(float16_t)-0.7680664062500f, +(float16_t)-0.6367187500000f,(float16_t)-0.7709960937500f, +(float16_t)-0.6333007812500f,(float16_t)-0.7739257812500f, +(float16_t)-0.6293945312500f,(float16_t)-0.7768554687500f, +(float16_t)-0.6259765625000f,(float16_t)-0.7797851562500f, +(float16_t)-0.6225585937500f,(float16_t)-0.7827148437500f, +(float16_t)-0.6186523437500f,(float16_t)-0.7856445312500f, +(float16_t)-0.6152343750000f,(float16_t)-0.7885742187500f, +(float16_t)-0.6118164062500f,(float16_t)-0.7910156250000f, +(float16_t)-0.6079101562500f,(float16_t)-0.7939453125000f, +(float16_t)-0.6044921875000f,(float16_t)-0.7968750000000f, +(float16_t)-0.6005859375000f,(float16_t)-0.7993164062500f, +(float16_t)-0.5971679687500f,(float16_t)-0.8022460937500f, +(float16_t)-0.5932617187500f,(float16_t)-0.8051757812500f, +(float16_t)-0.5893554687500f,(float16_t)-0.8076171875000f, +(float16_t)-0.5859375000000f,(float16_t)-0.8105468750000f, +(float16_t)-0.5820312500000f,(float16_t)-0.8129882812500f, +(float16_t)-0.5781250000000f,(float16_t)-0.8159179687500f, +(float16_t)-0.5747070312500f,(float16_t)-0.8183593750000f, +(float16_t)-0.5708007812500f,(float16_t)-0.8212890625000f, +(float16_t)-0.5668945312500f,(float16_t)-0.8237304687500f, +(float16_t)-0.5629882812500f,(float16_t)-0.8261718750000f, +(float16_t)-0.5595703125000f,(float16_t)-0.8291015625000f, +(float16_t)-0.5556640625000f,(float16_t)-0.8315429687500f, +(float16_t)-0.5517578125000f,(float16_t)-0.8339843750000f, +(float16_t)-0.5478515625000f,(float16_t)-0.8364257812500f, +(float16_t)-0.5439453125000f,(float16_t)-0.8388671875000f, +(float16_t)-0.5400390625000f,(float16_t)-0.8417968750000f, +(float16_t)-0.5361328125000f,(float16_t)-0.8442382812500f, +(float16_t)-0.5322265625000f,(float16_t)-0.8466796875000f, +(float16_t)-0.5283203125000f,(float16_t)-0.8491210937500f, +(float16_t)-0.5244140625000f,(float16_t)-0.8515625000000f, +(float16_t)-0.5205078125000f,(float16_t)-0.8540039062500f, +(float16_t)-0.5166015625000f,(float16_t)-0.8559570312500f, +(float16_t)-0.5126953125000f,(float16_t)-0.8583984375000f, +(float16_t)-0.5087890625000f,(float16_t)-0.8608398437500f, +(float16_t)-0.5048828125000f,(float16_t)-0.8632812500000f, +(float16_t)-0.5009765625000f,(float16_t)-0.8657226562500f, +(float16_t)-0.4968261718750f,(float16_t)-0.8676757812500f, +(float16_t)-0.4929199218750f,(float16_t)-0.8701171875000f, +(float16_t)-0.4887695312500f,(float16_t)-0.8725585937500f, +(float16_t)-0.4848632812500f,(float16_t)-0.8745117187500f, +(float16_t)-0.4809570312500f,(float16_t)-0.8769531250000f, +(float16_t)-0.4768066406250f,(float16_t)-0.8789062500000f, +(float16_t)-0.4726562500000f,(float16_t)-0.8813476562500f, +(float16_t)-0.4687500000000f,(float16_t)-0.8833007812500f, +(float16_t)-0.4645996093750f,(float16_t)-0.8857421875000f, +(float16_t)-0.4604492187500f,(float16_t)-0.8876953125000f, +(float16_t)-0.4565429687500f,(float16_t)-0.8896484375000f, +(float16_t)-0.4523925781250f,(float16_t)-0.8916015625000f, +(float16_t)-0.4482421875000f,(float16_t)-0.8940429687500f, +(float16_t)-0.4440917968750f,(float16_t)-0.8959960937500f, +(float16_t)-0.4399414062500f,(float16_t)-0.8979492187500f, +(float16_t)-0.4357910156250f,(float16_t)-0.8999023437500f, +(float16_t)-0.4316406250000f,(float16_t)-0.9018554687500f, +(float16_t)-0.4274902343750f,(float16_t)-0.9038085937500f, +(float16_t)-0.4233398437500f,(float16_t)-0.9057617187500f, +(float16_t)-0.4191894531250f,(float16_t)-0.9077148437500f, +(float16_t)-0.4150390625000f,(float16_t)-0.9096679687500f, +(float16_t)-0.4108886718750f,(float16_t)-0.9116210937500f, +(float16_t)-0.4067382812500f,(float16_t)-0.9135742187500f, +(float16_t)-0.4023437500000f,(float16_t)-0.9155273437500f, +(float16_t)-0.3981933593750f,(float16_t)-0.9174804687500f, +(float16_t)-0.3940429687500f,(float16_t)-0.9189453125000f, +(float16_t)-0.3896484375000f,(float16_t)-0.9208984375000f, +(float16_t)-0.3854980468750f,(float16_t)-0.9228515625000f, +(float16_t)-0.3813476562500f,(float16_t)-0.9243164062500f, +(float16_t)-0.3769531250000f,(float16_t)-0.9262695312500f, +(float16_t)-0.3728027343750f,(float16_t)-0.9277343750000f, +(float16_t)-0.3684082031250f,(float16_t)-0.9296875000000f, +(float16_t)-0.3642578125000f,(float16_t)-0.9311523437500f, +(float16_t)-0.3598632812500f,(float16_t)-0.9331054687500f, +(float16_t)-0.3557128906250f,(float16_t)-0.9345703125000f, +(float16_t)-0.3513183593750f,(float16_t)-0.9360351562500f, +(float16_t)-0.3469238281250f,(float16_t)-0.9379882812500f, +(float16_t)-0.3427734375000f,(float16_t)-0.9394531250000f, +(float16_t)-0.3383789062500f,(float16_t)-0.9409179687500f, +(float16_t)-0.3339843750000f,(float16_t)-0.9423828125000f, +(float16_t)-0.3295898437500f,(float16_t)-0.9443359375000f, +(float16_t)-0.3251953125000f,(float16_t)-0.9458007812500f, +(float16_t)-0.3210449218750f,(float16_t)-0.9472656250000f, +(float16_t)-0.3166503906250f,(float16_t)-0.9487304687500f, +(float16_t)-0.3122558593750f,(float16_t)-0.9501953125000f, +(float16_t)-0.3078613281250f,(float16_t)-0.9516601562500f, +(float16_t)-0.3034667968750f,(float16_t)-0.9526367187500f, +(float16_t)-0.2990722656250f,(float16_t)-0.9541015625000f, +(float16_t)-0.2946777343750f,(float16_t)-0.9555664062500f, +(float16_t)-0.2902832031250f,(float16_t)-0.9570312500000f, +(float16_t)-0.2858886718750f,(float16_t)-0.9584960937500f, +(float16_t)-0.2814941406250f,(float16_t)-0.9594726562500f, +(float16_t)-0.2770996093750f,(float16_t)-0.9609375000000f, +(float16_t)-0.2727050781250f,(float16_t)-0.9619140625000f, +(float16_t)-0.2683105468750f,(float16_t)-0.9633789062500f, +(float16_t)-0.2636718750000f,(float16_t)-0.9643554687500f, +(float16_t)-0.2592773437500f,(float16_t)-0.9658203125000f, +(float16_t)-0.2548828125000f,(float16_t)-0.9667968750000f, +(float16_t)-0.2504882812500f,(float16_t)-0.9682617187500f, +(float16_t)-0.2459716796875f,(float16_t)-0.9692382812500f, +(float16_t)-0.2414550781250f,(float16_t)-0.9702148437500f, +(float16_t)-0.2370605468750f,(float16_t)-0.9716796875000f, +(float16_t)-0.2325439453125f,(float16_t)-0.9726562500000f, +(float16_t)-0.2280273437500f,(float16_t)-0.9736328125000f, +(float16_t)-0.2236328125000f,(float16_t)-0.9746093750000f, +(float16_t)-0.2191162109375f,(float16_t)-0.9755859375000f, +(float16_t)-0.2145996093750f,(float16_t)-0.9765625000000f, +(float16_t)-0.2100830078125f,(float16_t)-0.9775390625000f, +(float16_t)-0.2055664062500f,(float16_t)-0.9785156250000f, +(float16_t)-0.2010498046875f,(float16_t)-0.9794921875000f, +(float16_t)-0.1966552734375f,(float16_t)-0.9804687500000f, +(float16_t)-0.1921386718750f,(float16_t)-0.9814453125000f, +(float16_t)-0.1876220703125f,(float16_t)-0.9824218750000f, +(float16_t)-0.1829833984375f,(float16_t)-0.9829101562500f, +(float16_t)-0.1784667968750f,(float16_t)-0.9838867187500f, +(float16_t)-0.1739501953125f,(float16_t)-0.9848632812500f, +(float16_t)-0.1694335937500f,(float16_t)-0.9853515625000f, +(float16_t)-0.1649169921875f,(float16_t)-0.9863281250000f, +(float16_t)-0.1604003906250f,(float16_t)-0.9868164062500f, +(float16_t)-0.1558837890625f,(float16_t)-0.9877929687500f, +(float16_t)-0.1512451171875f,(float16_t)-0.9882812500000f, +(float16_t)-0.1467285156250f,(float16_t)-0.9892578125000f, +(float16_t)-0.1422119140625f,(float16_t)-0.9897460937500f, +(float16_t)-0.1375732421875f,(float16_t)-0.9907226562500f, +(float16_t)-0.1330566406250f,(float16_t)-0.9912109375000f, +(float16_t)-0.1285400390625f,(float16_t)-0.9916992187500f, +(float16_t)-0.1239624023438f,(float16_t)-0.9921875000000f, +(float16_t)-0.1193847656250f,(float16_t)-0.9926757812500f, +(float16_t)-0.1148071289062f,(float16_t)-0.9931640625000f, +(float16_t)-0.1102294921875f,(float16_t)-0.9941406250000f, +(float16_t)-0.1056518554688f,(float16_t)-0.9946289062500f, +(float16_t)-0.1010742187500f,(float16_t)-0.9951171875000f, +(float16_t)-0.0964965820312f,(float16_t)-0.9951171875000f, +(float16_t)-0.0919189453125f,(float16_t)-0.9956054687500f, +(float16_t)-0.0873413085938f,(float16_t)-0.9960937500000f, +(float16_t)-0.0827636718750f,(float16_t)-0.9965820312500f, +(float16_t)-0.0781250000000f,(float16_t)-0.9970703125000f, +(float16_t)-0.0735473632812f,(float16_t)-0.9970703125000f, +(float16_t)-0.0689697265625f,(float16_t)-0.9975585937500f, +(float16_t)-0.0643920898438f,(float16_t)-0.9980468750000f, +(float16_t)-0.0597839355469f,(float16_t)-0.9980468750000f, +(float16_t)-0.0552062988281f,(float16_t)-0.9985351562500f, +(float16_t)-0.0505981445312f,(float16_t)-0.9985351562500f, +(float16_t)-0.0459899902344f,(float16_t)-0.9990234375000f, +(float16_t)-0.0414123535156f,(float16_t)-0.9990234375000f, +(float16_t)-0.0368041992188f,(float16_t)-0.9995117187500f, +(float16_t)-0.0321960449219f,(float16_t)-0.9995117187500f, +(float16_t)-0.0276031494141f,(float16_t)-0.9995117187500f, +(float16_t)-0.0230102539062f,(float16_t)-0.9995117187500f, +(float16_t)-0.0184020996094f,(float16_t)-1.0000000000000f, +(float16_t)-0.0138015747070f,(float16_t)-1.0000000000000f, +(float16_t)-0.0092010498047f,(float16_t)-1.0000000000000f, +(float16_t)-0.0046005249023f,(float16_t)-1.0000000000000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)1.0000000000000f,(float16_t)0.0184020996094f, +(float16_t)0.9995117187500f,(float16_t)0.0368041992188f, +(float16_t)0.9985351562500f,(float16_t)0.0552062988281f, +(float16_t)0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)0.9956054687500f,(float16_t)0.0919189453125f, +(float16_t)0.9941406250000f,(float16_t)0.1102294921875f, +(float16_t)0.9916992187500f,(float16_t)0.1285400390625f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9863281250000f,(float16_t)0.1649169921875f, +(float16_t)0.9829101562500f,(float16_t)0.1829833984375f, +(float16_t)0.9794921875000f,(float16_t)0.2010498046875f, +(float16_t)0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)0.9716796875000f,(float16_t)0.2370605468750f, +(float16_t)0.9667968750000f,(float16_t)0.2548828125000f, +(float16_t)0.9619140625000f,(float16_t)0.2727050781250f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9516601562500f,(float16_t)0.3078613281250f, +(float16_t)0.9458007812500f,(float16_t)0.3251953125000f, +(float16_t)0.9394531250000f,(float16_t)0.3427734375000f, +(float16_t)0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)0.9262695312500f,(float16_t)0.3769531250000f, +(float16_t)0.9189453125000f,(float16_t)0.3940429687500f, +(float16_t)0.9116210937500f,(float16_t)0.4108886718750f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.8959960937500f,(float16_t)0.4440917968750f, +(float16_t)0.8876953125000f,(float16_t)0.4604492187500f, +(float16_t)0.8789062500000f,(float16_t)0.4768066406250f, +(float16_t)0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)0.8608398437500f,(float16_t)0.5087890625000f, +(float16_t)0.8515625000000f,(float16_t)0.5244140625000f, +(float16_t)0.8417968750000f,(float16_t)0.5400390625000f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.8212890625000f,(float16_t)0.5708007812500f, +(float16_t)0.8105468750000f,(float16_t)0.5859375000000f, +(float16_t)0.7993164062500f,(float16_t)0.6005859375000f, +(float16_t)0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)0.7768554687500f,(float16_t)0.6293945312500f, +(float16_t)0.7651367187500f,(float16_t)0.6440429687500f, +(float16_t)0.7534179687500f,(float16_t)0.6577148437500f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.7285156250000f,(float16_t)0.6850585937500f, +(float16_t)0.7158203125000f,(float16_t)0.6982421875000f, +(float16_t)0.7026367187500f,(float16_t)0.7114257812500f, +(float16_t)0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)0.6762695312500f,(float16_t)0.7368164062500f, +(float16_t)0.6625976562500f,(float16_t)0.7490234375000f, +(float16_t)0.6484375000000f,(float16_t)0.7612304687500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.6201171875000f,(float16_t)0.7846679687500f, +(float16_t)0.6054687500000f,(float16_t)0.7958984375000f, +(float16_t)0.5908203125000f,(float16_t)0.8066406250000f, +(float16_t)0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)0.5605468750000f,(float16_t)0.8281250000000f, +(float16_t)0.5454101562500f,(float16_t)0.8383789062500f, +(float16_t)0.5297851562500f,(float16_t)0.8481445312500f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.4982910156250f,(float16_t)0.8671875000000f, +(float16_t)0.4821777343750f,(float16_t)0.8759765625000f, +(float16_t)0.4660644531250f,(float16_t)0.8847656250000f, +(float16_t)0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)0.4331054687500f,(float16_t)0.9013671875000f, +(float16_t)0.4165039062500f,(float16_t)0.9091796875000f, +(float16_t)0.3996582031250f,(float16_t)0.9165039062500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3657226562500f,(float16_t)0.9306640625000f, +(float16_t)0.3483886718750f,(float16_t)0.9375000000000f, +(float16_t)0.3310546875000f,(float16_t)0.9433593750000f, +(float16_t)0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)0.2961425781250f,(float16_t)0.9550781250000f, +(float16_t)0.2785644531250f,(float16_t)0.9604492187500f, +(float16_t)0.2607421875000f,(float16_t)0.9653320312500f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.2250976562500f,(float16_t)0.9741210937500f, +(float16_t)0.2071533203125f,(float16_t)0.9785156250000f, +(float16_t)0.1890869140625f,(float16_t)0.9819335937500f, +(float16_t)0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)0.1528320312500f,(float16_t)0.9882812500000f, +(float16_t)0.1345214843750f,(float16_t)0.9907226562500f, +(float16_t)0.1163330078125f,(float16_t)0.9931640625000f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0797119140625f,(float16_t)0.9965820312500f, +(float16_t)0.0613098144531f,(float16_t)0.9980468750000f, +(float16_t)0.0429382324219f,(float16_t)0.9990234375000f, +(float16_t)0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)0.0061340332031f,(float16_t)1.0000000000000f, +(float16_t)-0.0122680664062f,(float16_t)1.0000000000000f, +(float16_t)-0.0306701660156f,(float16_t)0.9995117187500f, +(float16_t)-0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)-0.0674438476562f,(float16_t)0.9975585937500f, +(float16_t)-0.0858154296875f,(float16_t)0.9960937500000f, +(float16_t)-0.1041259765625f,(float16_t)0.9946289062500f, +(float16_t)-0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)-0.1406250000000f,(float16_t)0.9902343750000f, +(float16_t)-0.1588134765625f,(float16_t)0.9873046875000f, +(float16_t)-0.1770019531250f,(float16_t)0.9843750000000f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.2131347656250f,(float16_t)0.9770507812500f, +(float16_t)-0.2310791015625f,(float16_t)0.9731445312500f, +(float16_t)-0.2489013671875f,(float16_t)0.9687500000000f, +(float16_t)-0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)-0.2844238281250f,(float16_t)0.9584960937500f, +(float16_t)-0.3020019531250f,(float16_t)0.9531250000000f, +(float16_t)-0.3195800781250f,(float16_t)0.9477539062500f, +(float16_t)-0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)-0.3542480468750f,(float16_t)0.9350585937500f, +(float16_t)-0.3713378906250f,(float16_t)0.9287109375000f, +(float16_t)-0.3884277343750f,(float16_t)0.9213867187500f, +(float16_t)-0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)-0.4221191406250f,(float16_t)0.9067382812500f, +(float16_t)-0.4387207031250f,(float16_t)0.8984375000000f, +(float16_t)-0.4550781250000f,(float16_t)0.8906250000000f, +(float16_t)-0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)-0.4875488281250f,(float16_t)0.8730468750000f, +(float16_t)-0.5034179687500f,(float16_t)0.8637695312500f, +(float16_t)-0.5195312500000f,(float16_t)0.8544921875000f, +(float16_t)-0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)-0.5502929687500f,(float16_t)0.8349609375000f, +(float16_t)-0.5659179687500f,(float16_t)0.8247070312500f, +(float16_t)-0.5810546875000f,(float16_t)0.8139648437500f, +(float16_t)-0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)-0.6103515625000f,(float16_t)0.7919921875000f, +(float16_t)-0.6250000000000f,(float16_t)0.7807617187500f, +(float16_t)-0.6391601562500f,(float16_t)0.7690429687500f, +(float16_t)-0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)-0.6669921875000f,(float16_t)0.7451171875000f, +(float16_t)-0.6806640625000f,(float16_t)0.7324218750000f, +(float16_t)-0.6938476562500f,(float16_t)0.7202148437500f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.7202148437500f,(float16_t)0.6938476562500f, +(float16_t)-0.7324218750000f,(float16_t)0.6806640625000f, +(float16_t)-0.7451171875000f,(float16_t)0.6669921875000f, +(float16_t)-0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)-0.7690429687500f,(float16_t)0.6391601562500f, +(float16_t)-0.7807617187500f,(float16_t)0.6250000000000f, +(float16_t)-0.7919921875000f,(float16_t)0.6103515625000f, +(float16_t)-0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)-0.8139648437500f,(float16_t)0.5810546875000f, +(float16_t)-0.8247070312500f,(float16_t)0.5659179687500f, +(float16_t)-0.8349609375000f,(float16_t)0.5502929687500f, +(float16_t)-0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)-0.8544921875000f,(float16_t)0.5195312500000f, +(float16_t)-0.8637695312500f,(float16_t)0.5034179687500f, +(float16_t)-0.8730468750000f,(float16_t)0.4875488281250f, +(float16_t)-0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)-0.8906250000000f,(float16_t)0.4550781250000f, +(float16_t)-0.8984375000000f,(float16_t)0.4387207031250f, +(float16_t)-0.9067382812500f,(float16_t)0.4221191406250f, +(float16_t)-0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)-0.9213867187500f,(float16_t)0.3884277343750f, +(float16_t)-0.9287109375000f,(float16_t)0.3713378906250f, +(float16_t)-0.9350585937500f,(float16_t)0.3542480468750f, +(float16_t)-0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)-0.9477539062500f,(float16_t)0.3195800781250f, +(float16_t)-0.9531250000000f,(float16_t)0.3020019531250f, +(float16_t)-0.9584960937500f,(float16_t)0.2844238281250f, +(float16_t)-0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)-0.9687500000000f,(float16_t)0.2489013671875f, +(float16_t)-0.9731445312500f,(float16_t)0.2310791015625f, +(float16_t)-0.9770507812500f,(float16_t)0.2131347656250f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)-0.9843750000000f,(float16_t)0.1770019531250f, +(float16_t)-0.9873046875000f,(float16_t)0.1588134765625f, +(float16_t)-0.9902343750000f,(float16_t)0.1406250000000f, +(float16_t)-0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)-0.9946289062500f,(float16_t)0.1041259765625f, +(float16_t)-0.9960937500000f,(float16_t)0.0858154296875f, +(float16_t)-0.9975585937500f,(float16_t)0.0674438476562f, +(float16_t)-0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)-0.9995117187500f,(float16_t)0.0306701660156f, +(float16_t)-1.0000000000000f,(float16_t)0.0122680664062f, +(float16_t)-1.0000000000000f,(float16_t)-0.0061340332031f, +(float16_t)-0.9995117187500f,(float16_t)-0.0245361328125f, +(float16_t)-0.9990234375000f,(float16_t)-0.0429382324219f, +(float16_t)-0.9980468750000f,(float16_t)-0.0613098144531f, +(float16_t)-0.9965820312500f,(float16_t)-0.0797119140625f, +(float16_t)-0.9951171875000f,(float16_t)-0.0980224609375f, +(float16_t)-0.9931640625000f,(float16_t)-0.1163330078125f, +(float16_t)-0.9907226562500f,(float16_t)-0.1345214843750f, +(float16_t)-0.9882812500000f,(float16_t)-0.1528320312500f, +(float16_t)-0.9853515625000f,(float16_t)-0.1710205078125f, +(float16_t)-0.9819335937500f,(float16_t)-0.1890869140625f, +(float16_t)-0.9785156250000f,(float16_t)-0.2071533203125f, +(float16_t)-0.9741210937500f,(float16_t)-0.2250976562500f, +(float16_t)-0.9702148437500f,(float16_t)-0.2429199218750f, +(float16_t)-0.9653320312500f,(float16_t)-0.2607421875000f, +(float16_t)-0.9604492187500f,(float16_t)-0.2785644531250f, +(float16_t)-0.9550781250000f,(float16_t)-0.2961425781250f, +(float16_t)-0.9497070312500f,(float16_t)-0.3137207031250f, +(float16_t)-0.9433593750000f,(float16_t)-0.3310546875000f, +(float16_t)-0.9375000000000f,(float16_t)-0.3483886718750f, +(float16_t)-0.9306640625000f,(float16_t)-0.3657226562500f, +(float16_t)-0.9238281250000f,(float16_t)-0.3825683593750f, +(float16_t)-0.9165039062500f,(float16_t)-0.3996582031250f, +(float16_t)-0.9091796875000f,(float16_t)-0.4165039062500f, +(float16_t)-0.9013671875000f,(float16_t)-0.4331054687500f, +(float16_t)-0.8930664062500f,(float16_t)-0.4497070312500f, +(float16_t)-0.8847656250000f,(float16_t)-0.4660644531250f, +(float16_t)-0.8759765625000f,(float16_t)-0.4821777343750f, +(float16_t)-0.8671875000000f,(float16_t)-0.4982910156250f, +(float16_t)-0.8579101562500f,(float16_t)-0.5141601562500f, +(float16_t)-0.8481445312500f,(float16_t)-0.5297851562500f, +(float16_t)-0.8383789062500f,(float16_t)-0.5454101562500f, +(float16_t)-0.8281250000000f,(float16_t)-0.5605468750000f, +(float16_t)-0.8173828125000f,(float16_t)-0.5756835937500f, +(float16_t)-0.8066406250000f,(float16_t)-0.5908203125000f, +(float16_t)-0.7958984375000f,(float16_t)-0.6054687500000f, +(float16_t)-0.7846679687500f,(float16_t)-0.6201171875000f, +(float16_t)-0.7729492187500f,(float16_t)-0.6342773437500f, +(float16_t)-0.7612304687500f,(float16_t)-0.6484375000000f, +(float16_t)-0.7490234375000f,(float16_t)-0.6625976562500f, +(float16_t)-0.7368164062500f,(float16_t)-0.6762695312500f, +(float16_t)-0.7241210937500f,(float16_t)-0.6894531250000f, +(float16_t)-0.7114257812500f,(float16_t)-0.7026367187500f, +(float16_t)-0.6982421875000f,(float16_t)-0.7158203125000f, +(float16_t)-0.6850585937500f,(float16_t)-0.7285156250000f, +(float16_t)-0.6713867187500f,(float16_t)-0.7407226562500f, +(float16_t)-0.6577148437500f,(float16_t)-0.7534179687500f, +(float16_t)-0.6440429687500f,(float16_t)-0.7651367187500f, +(float16_t)-0.6293945312500f,(float16_t)-0.7768554687500f, +(float16_t)-0.6152343750000f,(float16_t)-0.7885742187500f, +(float16_t)-0.6005859375000f,(float16_t)-0.7993164062500f, +(float16_t)-0.5859375000000f,(float16_t)-0.8105468750000f, +(float16_t)-0.5708007812500f,(float16_t)-0.8212890625000f, +(float16_t)-0.5556640625000f,(float16_t)-0.8315429687500f, +(float16_t)-0.5400390625000f,(float16_t)-0.8417968750000f, +(float16_t)-0.5244140625000f,(float16_t)-0.8515625000000f, +(float16_t)-0.5087890625000f,(float16_t)-0.8608398437500f, +(float16_t)-0.4929199218750f,(float16_t)-0.8701171875000f, +(float16_t)-0.4768066406250f,(float16_t)-0.8789062500000f, +(float16_t)-0.4604492187500f,(float16_t)-0.8876953125000f, +(float16_t)-0.4440917968750f,(float16_t)-0.8959960937500f, +(float16_t)-0.4274902343750f,(float16_t)-0.9038085937500f, +(float16_t)-0.4108886718750f,(float16_t)-0.9116210937500f, +(float16_t)-0.3940429687500f,(float16_t)-0.9189453125000f, +(float16_t)-0.3769531250000f,(float16_t)-0.9262695312500f, +(float16_t)-0.3598632812500f,(float16_t)-0.9331054687500f, +(float16_t)-0.3427734375000f,(float16_t)-0.9394531250000f, +(float16_t)-0.3251953125000f,(float16_t)-0.9458007812500f, +(float16_t)-0.3078613281250f,(float16_t)-0.9516601562500f, +(float16_t)-0.2902832031250f,(float16_t)-0.9570312500000f, +(float16_t)-0.2727050781250f,(float16_t)-0.9619140625000f, +(float16_t)-0.2548828125000f,(float16_t)-0.9667968750000f, +(float16_t)-0.2370605468750f,(float16_t)-0.9716796875000f, +(float16_t)-0.2191162109375f,(float16_t)-0.9755859375000f, +(float16_t)-0.2010498046875f,(float16_t)-0.9794921875000f, +(float16_t)-0.1829833984375f,(float16_t)-0.9829101562500f, +(float16_t)-0.1649169921875f,(float16_t)-0.9863281250000f, +(float16_t)-0.1467285156250f,(float16_t)-0.9892578125000f, +(float16_t)-0.1285400390625f,(float16_t)-0.9916992187500f, +(float16_t)-0.1102294921875f,(float16_t)-0.9941406250000f, +(float16_t)-0.0919189453125f,(float16_t)-0.9956054687500f, +(float16_t)-0.0735473632812f,(float16_t)-0.9970703125000f, +(float16_t)-0.0552062988281f,(float16_t)-0.9985351562500f, +(float16_t)-0.0368041992188f,(float16_t)-0.9995117187500f, +(float16_t)-0.0184020996094f,(float16_t)-1.0000000000000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9970703125000f,(float16_t)0.0735473632812f, +(float16_t)0.9892578125000f,(float16_t)0.1467285156250f, +(float16_t)0.9755859375000f,(float16_t)0.2191162109375f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.9331054687500f,(float16_t)0.3598632812500f, +(float16_t)0.9038085937500f,(float16_t)0.4274902343750f, +(float16_t)0.8701171875000f,(float16_t)0.4929199218750f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.7885742187500f,(float16_t)0.6152343750000f, +(float16_t)0.7407226562500f,(float16_t)0.6713867187500f, +(float16_t)0.6894531250000f,(float16_t)0.7241210937500f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.5756835937500f,(float16_t)0.8173828125000f, +(float16_t)0.5141601562500f,(float16_t)0.8579101562500f, +(float16_t)0.4497070312500f,(float16_t)0.8930664062500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.3137207031250f,(float16_t)0.9497070312500f, +(float16_t)0.2429199218750f,(float16_t)0.9702148437500f, +(float16_t)0.1710205078125f,(float16_t)0.9853515625000f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)0.0245361328125f,(float16_t)0.9995117187500f, +(float16_t)-0.0490722656250f,(float16_t)0.9990234375000f, +(float16_t)-0.1224365234375f,(float16_t)0.9926757812500f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.2666015625000f,(float16_t)0.9638671875000f, +(float16_t)-0.3369140625000f,(float16_t)0.9414062500000f, +(float16_t)-0.4052734375000f,(float16_t)0.9140625000000f, +(float16_t)-0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)-0.5351562500000f,(float16_t)0.8447265625000f, +(float16_t)-0.5957031250000f,(float16_t)0.8032226562500f, +(float16_t)-0.6533203125000f,(float16_t)0.7573242187500f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.7573242187500f,(float16_t)0.6533203125000f, +(float16_t)-0.8032226562500f,(float16_t)0.5957031250000f, +(float16_t)-0.8447265625000f,(float16_t)0.5351562500000f, +(float16_t)-0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)-0.9140625000000f,(float16_t)0.4052734375000f, +(float16_t)-0.9414062500000f,(float16_t)0.3369140625000f, +(float16_t)-0.9638671875000f,(float16_t)0.2666015625000f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)-0.9926757812500f,(float16_t)0.1224365234375f, +(float16_t)-0.9990234375000f,(float16_t)0.0490722656250f, +(float16_t)-0.9995117187500f,(float16_t)-0.0245361328125f, +(float16_t)-0.9951171875000f,(float16_t)-0.0980224609375f, +(float16_t)-0.9853515625000f,(float16_t)-0.1710205078125f, +(float16_t)-0.9702148437500f,(float16_t)-0.2429199218750f, +(float16_t)-0.9497070312500f,(float16_t)-0.3137207031250f, +(float16_t)-0.9238281250000f,(float16_t)-0.3825683593750f, +(float16_t)-0.8930664062500f,(float16_t)-0.4497070312500f, +(float16_t)-0.8579101562500f,(float16_t)-0.5141601562500f, +(float16_t)-0.8173828125000f,(float16_t)-0.5756835937500f, +(float16_t)-0.7729492187500f,(float16_t)-0.6342773437500f, +(float16_t)-0.7241210937500f,(float16_t)-0.6894531250000f, +(float16_t)-0.6713867187500f,(float16_t)-0.7407226562500f, +(float16_t)-0.6152343750000f,(float16_t)-0.7885742187500f, +(float16_t)-0.5556640625000f,(float16_t)-0.8315429687500f, +(float16_t)-0.4929199218750f,(float16_t)-0.8701171875000f, +(float16_t)-0.4274902343750f,(float16_t)-0.9038085937500f, +(float16_t)-0.3598632812500f,(float16_t)-0.9331054687500f, +(float16_t)-0.2902832031250f,(float16_t)-0.9570312500000f, +(float16_t)-0.2191162109375f,(float16_t)-0.9755859375000f, +(float16_t)-0.1467285156250f,(float16_t)-0.9892578125000f, +(float16_t)-0.0735473632812f,(float16_t)-0.9970703125000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.9570312500000f,(float16_t)0.2902832031250f, +(float16_t)0.8315429687500f,(float16_t)0.5556640625000f, +(float16_t)0.6342773437500f,(float16_t)0.7729492187500f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)0.0980224609375f,(float16_t)0.9951171875000f, +(float16_t)-0.1950683593750f,(float16_t)0.9809570312500f, +(float16_t)-0.4714355468750f,(float16_t)0.8818359375000f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.8818359375000f,(float16_t)0.4714355468750f, +(float16_t)-0.9809570312500f,(float16_t)0.1950683593750f, +(float16_t)-0.9951171875000f,(float16_t)-0.0980224609375f, +(float16_t)-0.9238281250000f,(float16_t)-0.3825683593750f, +(float16_t)-0.7729492187500f,(float16_t)-0.6342773437500f, +(float16_t)-0.5556640625000f,(float16_t)-0.8315429687500f, +(float16_t)-0.2902832031250f,(float16_t)-0.9570312500000f, +(float16_t)1.0000000000000f,(float16_t)0.0000000000000f, +(float16_t)0.3825683593750f,(float16_t)0.9238281250000f, +(float16_t)-0.7070312500000f,(float16_t)0.7070312500000f, +(float16_t)-0.9238281250000f,(float16_t)-0.3825683593750f,}; #endif diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_conj_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_conj_f16.c index 3fefe25..9b10a4a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_conj_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_conj_f16.c @@ -5,11 +5,13 @@ * Title: arm_cmplx_conj_f16.c * Description: Floating-point complex conjugate * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -33,28 +35,6 @@ @ingroup groupCmplxMath */ -/** - @defgroup cmplx_conj Complex Conjugate - - Conjugates the elements of a complex data vector. - - The pSrc points to the source data and - pDst points to the destination data where the result should be written. - numSamples specifies the number of complex samples - and the data in each array is stored in an interleaved fashion - (real, imag, real, imag, ...). - Each array has a total of 2*numSamples values. - - The underlying algorithm is used: -
-  for (n = 0; n < numSamples; n++) {
-      pDst[(2*n)  ] =  pSrc[(2*n)  ];    // real part
-      pDst[(2*n)+1] = -pSrc[(2*n)+1];    // imag part
-  }
-  
- - There are separate functions for floating-point, Q15, and Q31 data types. - */ /** @addtogroup cmplx_conj @@ -112,7 +92,7 @@ void arm_cmplx_conj_f16( /* Calculate Complex Conjugate and store result in destination buffer. */ *pDst++ = *pSrc++; - *pDst++ = -*pSrc++; + *pDst++ = -(_Float16)*pSrc++; /* Decrement loop counter */ blkCnt--; @@ -139,16 +119,16 @@ void arm_cmplx_conj_f16( /* Calculate Complex Conjugate and store result in destination buffer. */ *pDst++ = *pSrc++; - *pDst++ = -*pSrc++; + *pDst++ = -(_Float16)*pSrc++; *pDst++ = *pSrc++; - *pDst++ = -*pSrc++; + *pDst++ = -(_Float16)*pSrc++; *pDst++ = *pSrc++; - *pDst++ = -*pSrc++; + *pDst++ = -(_Float16)*pSrc++; *pDst++ = *pSrc++; - *pDst++ = -*pSrc++; + *pDst++ = -(_Float16)*pSrc++; /* Decrement loop counter */ blkCnt--; @@ -170,7 +150,7 @@ void arm_cmplx_conj_f16( /* Calculate Complex Conjugate and store result in destination buffer. */ *pDst++ = *pSrc++; - *pDst++ = -*pSrc++; + *pDst++ = -(_Float16)*pSrc++; /* Decrement loop counter */ blkCnt--; @@ -183,4 +163,5 @@ void arm_cmplx_conj_f16( @} end of cmplx_conj group */ #endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_conj_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_conj_f32.c index dcb276d..89cbe5b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_conj_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_conj_f32.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_conj_f32.c * Description: Floating-point complex conjugate * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_conj_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_conj_q15.c index 3764614..b13e16d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_conj_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_conj_q15.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_conj_q15.c * Description: Q15 complex conjugate * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -124,11 +124,11 @@ void arm_cmplx_conj_q15( /* Calculate Complex Conjugate and store result in destination buffer. */ - #if defined (ARM_MATH_DSP) - in1 = read_q15x2_ia ((q15_t **) &pSrc); - in2 = read_q15x2_ia ((q15_t **) &pSrc); - in3 = read_q15x2_ia ((q15_t **) &pSrc); - in4 = read_q15x2_ia ((q15_t **) &pSrc); +#if defined (ARM_MATH_DSP) + in1 = read_q15x2_ia (&pSrc); + in2 = read_q15x2_ia (&pSrc); + in3 = read_q15x2_ia (&pSrc); + in4 = read_q15x2_ia (&pSrc); #ifndef ARM_MATH_BIG_ENDIAN in1 = __QASX(0, in1); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_conj_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_conj_q31.c index aaf8707..879d679 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_conj_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_conj_q31.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_conj_q31.c * Description: Q31 complex conjugate * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_dot_prod_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_dot_prod_f16.c index 44ea9aa..6066f61 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_dot_prod_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_dot_prod_f16.c @@ -5,11 +5,13 @@ * Title: arm_cmplx_dot_prod_f16.c * Description: Floating-point complex dot product * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -35,32 +37,6 @@ @ingroup groupCmplxMath */ -/** - @defgroup cmplx_dot_prod Complex Dot Product - - Computes the dot product of two complex vectors. - The vectors are multiplied element-by-element and then summed. - - The pSrcA points to the first complex input vector and - pSrcB points to the second complex input vector. - numSamples specifies the number of complex samples - and the data in each array is stored in an interleaved fashion - (real, imag, real, imag, ...). - Each array has a total of 2*numSamples values. - - The underlying algorithm is used: - -
-  realResult = 0;
-  imagResult = 0;
-  for (n = 0; n < numSamples; n++) {
-      realResult += pSrcA[(2*n)+0] * pSrcB[(2*n)+0] - pSrcA[(2*n)+1] * pSrcB[(2*n)+1];
-      imagResult += pSrcA[(2*n)+0] * pSrcB[(2*n)+1] + pSrcA[(2*n)+1] * pSrcB[(2*n)+0];
-  }
-  
- - There are separate functions for floating-point, Q15, and Q31 data types. - */ /** @addtogroup cmplx_dot_prod @@ -286,4 +262,5 @@ void arm_cmplx_dot_prod_f16( */ #endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_dot_prod_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_dot_prod_f32.c index ddc0f6e..8282d6f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_dot_prod_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_dot_prod_f32.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_dot_prod_f32.c * Description: Floating-point complex dot product * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_dot_prod_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_dot_prod_q15.c index 4ae4d05..2c93864 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_dot_prod_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_dot_prod_q15.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_dot_prod_q15.c * Description: Processing function for the Q15 Complex Dot product * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_dot_prod_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_dot_prod_q31.c index 3e1ec7a..bd5e894 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_dot_prod_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_dot_prod_q31.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_dot_prod_q31.c * Description: Q31 complex dot product * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_f16.c index 8cad742..a4c859d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_f16.c @@ -5,11 +5,13 @@ * Title: arm_cmplx_mag_f16.c * Description: Floating-point complex magnitude * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -33,29 +35,7 @@ @ingroup groupCmplxMath */ -/** - @defgroup cmplx_mag Complex Magnitude - - Computes the magnitude of the elements of a complex data vector. - - The pSrc points to the source data and - pDst points to the where the result should be written. - numSamples specifies the number of complex samples - in the input array and the data is stored in an interleaved fashion - (real, imag, real, imag, ...). - The input array has a total of 2*numSamples values; - the output array has a total of numSamples values. - - The underlying algorithm is used: -
-  for (n = 0; n < numSamples; n++) {
-      pDst[n] = sqrt(pSrc[(2*n)+0]^2 + pSrc[(2*n)+1]^2);
-  }
-  
- - There are separate functions for floating-point, Q15, and Q31 data types. - */ /** @addtogroup cmplx_mag @@ -239,4 +219,5 @@ void arm_cmplx_mag_f16( */ #endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_f32.c index 8209fce..b2c9230 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_f32.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_mag_f32.c * Description: Floating-point complex magnitude * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_f64.c new file mode 100644 index 0000000..2d651ac --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_f64.c @@ -0,0 +1,82 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_cmplx_mag_f64.c + * Description: Floating-point complex magnitude + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/complex_math_functions.h" + +/** + @ingroup groupCmplxMath + */ + + + +/** + @addtogroup cmplx_mag + @{ + */ + +/** + @brief Floating-point complex magnitude. + @param[in] pSrc points to input vector + @param[out] pDst points to output vector + @param[in] numSamples number of samples in each vector + @return none + */ +void arm_cmplx_mag_f64( + const float64_t * pSrc, + float64_t * pDst, + uint32_t numSamples) +{ + uint32_t blkCnt; /* loop counter */ + float64_t real, imag; /* Temporary variables to hold input values */ + + /* Initialize blkCnt with number of samples */ + blkCnt = numSamples; + + while (blkCnt > 0U) + { + /* C[0] = sqrt(A[0] * A[0] + A[1] * A[1]) */ + + real = *pSrc++; + imag = *pSrc++; + + /* store result in destination buffer. */ + *pDst++ = sqrt((real * real) + (imag * imag)); + + /* Decrement loop counter */ + blkCnt--; + } + +} + +/** + @} end of cmplx_mag group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_fast_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_fast_q15.c new file mode 100644 index 0000000..6a78a7e --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_fast_q15.c @@ -0,0 +1,227 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_cmplx_mag_fast_q15.c + * Description: Q15 complex magnitude + * + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/complex_math_functions.h" + +/** + @ingroup groupCmplxMath + */ + +/** + @addtogroup cmplx_mag + @{ + */ + +/** + @brief Q15 complex magnitude. + @param[in] pSrc points to input vector + @param[out] pDst points to output vector + @param[in] numSamples number of samples in each vector + @return none + + @par Scaling and Overflow Behavior + The function implements 1.15 by 1.15 multiplications and finally output is converted into 2.14 format. + Fast functions are less accurate. This function will tend to clamp to 0 + the too small values. So sqrt(x*x) = x will not always be true. + */ +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_cmplx_mag_fast_q15( + const q15_t * pSrc, + q15_t * pDst, + uint32_t numSamples) +{ + + int32_t blockSize = numSamples; /* loop counters */ + uint32_t blkCnt; /* loop counters */ + q15x8x2_t vecSrc; + q15x8_t sum; + q31_t in; + q31_t acc0; + + blkCnt = blockSize >> 3; + while (blkCnt > 0U) + { + vecSrc = vld2q(pSrc); + pSrc += 16; + sum = vqaddq(vmulhq(vecSrc.val[0], vecSrc.val[0]), + vmulhq(vecSrc.val[1], vecSrc.val[1])); + + sum = vshrq(sum, 1); + + sum = FAST_VSQRT_Q15(sum); + + vst1q(pDst, sum); + pDst += 8; + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + + /* + * tail + */ + blkCnt = blockSize & 7; + + while (blkCnt > 0U) + { + /* C[0] = sqrt(A[0] * A[0] + A[1] * A[1]) */ + + in = read_q15x2_ia ((q15_t **) &pSrc); + acc0 = __SMUAD(in, in); + + /* store result in 2.14 format in destination buffer. */ + arm_sqrt_q15((q15_t) (acc0 >> 17), pDst++); + + + /* Decrement loop counter */ + blkCnt--; + } +} + +#else +void arm_cmplx_mag_fast_q15( + const q15_t * pSrc, + q15_t * pDst, + uint32_t numSamples) +{ + uint32_t blkCnt; /* Loop counter */ + +#if defined (ARM_MATH_DSP) + q31_t in; + q31_t acc0; /* Accumulators */ +#else + q15_t real, imag; /* Temporary input variables */ + q31_t acc0, acc1; /* Accumulators */ +#endif + +#if defined (ARM_MATH_LOOPUNROLL) + + /* Loop unrolling: Compute 4 outputs at a time */ + blkCnt = numSamples >> 2U; + + while (blkCnt > 0U) + { + /* C[0] = sqrt(A[0] * A[0] + A[1] * A[1]) */ + +#if defined (ARM_MATH_DSP) + in = read_q15x2_ia (&pSrc); + acc0 = __SMUAD(in, in); + /* store result in 2.14 format in destination buffer. */ + arm_sqrt_q15((q15_t) (acc0 >> 17), pDst++); + + in = read_q15x2_ia (&pSrc); + acc0 = __SMUAD(in, in); + arm_sqrt_q15((q15_t) (acc0 >> 17), pDst++); + + in = read_q15x2_ia (&pSrc); + acc0 = __SMUAD(in, in); + arm_sqrt_q15((q15_t) (acc0 >> 17), pDst++); + + in = read_q15x2_ia (&pSrc); + acc0 = __SMUAD(in, in); + arm_sqrt_q15((q15_t) (acc0 >> 17), pDst++); +#else + real = *pSrc++; + imag = *pSrc++; + acc0 = ((q31_t) real * real); + acc1 = ((q31_t) imag * imag); + + /* store result in 2.14 format in destination buffer. */ + arm_sqrt_q15((q15_t) (((q63_t) acc0 + acc1) >> 17), pDst++); + + real = *pSrc++; + imag = *pSrc++; + acc0 = ((q31_t) real * real); + acc1 = ((q31_t) imag * imag); + arm_sqrt_q15((q15_t) (((q63_t) acc0 + acc1) >> 17), pDst++); + + real = *pSrc++; + imag = *pSrc++; + acc0 = ((q31_t) real * real); + acc1 = ((q31_t) imag * imag); + arm_sqrt_q15((q15_t) (((q63_t) acc0 + acc1) >> 17), pDst++); + + real = *pSrc++; + imag = *pSrc++; + acc0 = ((q31_t) real * real); + acc1 = ((q31_t) imag * imag); + arm_sqrt_q15((q15_t) (((q63_t) acc0 + acc1) >> 17), pDst++); +#endif /* #if defined (ARM_MATH_DSP) */ + + /* Decrement loop counter */ + blkCnt--; + } + + /* Loop unrolling: Compute remaining outputs */ + blkCnt = numSamples % 0x4U; + +#else + + /* Initialize blkCnt with number of samples */ + blkCnt = numSamples; + +#endif /* #if defined (ARM_MATH_LOOPUNROLL) */ + + while (blkCnt > 0U) + { + /* C[0] = sqrt(A[0] * A[0] + A[1] * A[1]) */ + +#if defined (ARM_MATH_DSP) + in = read_q15x2_ia (&pSrc); + acc0 = __SMUAD(in, in); + + /* store result in 2.14 format in destination buffer. */ + arm_sqrt_q15((q15_t) (acc0 >> 17), pDst++); +#else + real = *pSrc++; + imag = *pSrc++; + acc0 = ((q31_t) real * real); + acc1 = ((q31_t) imag * imag); + + /* store result in 2.14 format in destination buffer. */ + arm_sqrt_q15((q15_t) (((q63_t) acc0 + acc1) >> 17), pDst++); +#endif + + /* Decrement loop counter */ + blkCnt--; + } + +} +#endif /* defined(ARM_MATH_MVEI) */ + +/** + @} end of cmplx_mag group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_q15.c index 473ef07..9c06477 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_q15.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_mag_q15.c * Description: Q15 complex magnitude * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -49,6 +49,11 @@ @par Scaling and Overflow Behavior The function implements 1.15 by 1.15 multiplications and finally output is converted into 2.14 format. */ + +/* Sqrt q31 is used otherwise accuracy is not good enough + for small values and for some applications it is + an issue. + */ #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" @@ -62,23 +67,52 @@ void arm_cmplx_mag_q15( int32_t blockSize = numSamples; /* loop counters */ uint32_t blkCnt; /* loop counters */ q15x8x2_t vecSrc; - q15x8_t sum; + q31x4_t prod0; + q31x4_t prod1; + q31_t in; q31_t acc0; + q31x4_t acc0V; + q31x4_t acc1V; + + q31_t res; + q15x8_t resV; blkCnt = blockSize >> 3; while (blkCnt > 0U) { vecSrc = vld2q(pSrc); pSrc += 16; - sum = vqaddq(vmulhq(vecSrc.val[0], vecSrc.val[0]), - vmulhq(vecSrc.val[1], vecSrc.val[1])); - sum = vshrq(sum, 1); + acc0V = vdupq_n_s32(0); + acc1V = vdupq_n_s32(0); + + prod0 = vmullbq_int_s16(vecSrc.val[0], vecSrc.val[0]); + acc0V = vqaddq_s32(acc0V,prod0); + + prod0 = vmullbq_int_s16(vecSrc.val[1], vecSrc.val[1]); + acc0V = vqaddq_s32(acc0V,prod0); + + + prod1 = vmulltq_int_s16(vecSrc.val[0], vecSrc.val[0]); + acc1V = vqaddq_s32(acc1V,prod1); + + prod1 = vmulltq_int_s16(vecSrc.val[1], vecSrc.val[1]); + acc1V = vqaddq_s32(acc1V,prod1); + + + + acc0V = vshrq(acc0V, 1); + acc1V = vshrq(acc1V, 1); + + acc0V = FAST_VSQRT_Q31(acc0V); + acc1V = FAST_VSQRT_Q31(acc1V); - sum = FAST_VSQRT_Q15(sum); + resV = vdupq_n_s16(0); + resV = vqshrnbq_n_s32(resV,acc0V,16); + resV = vqshrntq_n_s32(resV,acc1V,16); - vst1q(pDst, sum); + vst1q(pDst, resV); pDst += 8; /* * Decrement the blockSize loop counter @@ -99,7 +133,8 @@ void arm_cmplx_mag_q15( acc0 = __SMUAD(in, in); /* store result in 2.14 format in destination buffer. */ - arm_sqrt_q15((q15_t) (acc0 >> 17), pDst++); + arm_sqrt_q31(acc0 >> 1 , &res); + *pDst++ = res >> 16; /* Decrement loop counter */ @@ -113,6 +148,7 @@ void arm_cmplx_mag_q15( q15_t * pDst, uint32_t numSamples) { + q31_t res; /* temporary result */ uint32_t blkCnt; /* Loop counter */ #if defined (ARM_MATH_DSP) @@ -133,22 +169,26 @@ void arm_cmplx_mag_q15( /* C[0] = sqrt(A[0] * A[0] + A[1] * A[1]) */ #if defined (ARM_MATH_DSP) - in = read_q15x2_ia ((q15_t **) &pSrc); + in = read_q15x2_ia (&pSrc); acc0 = __SMUAD(in, in); /* store result in 2.14 format in destination buffer. */ - arm_sqrt_q15((q15_t) (acc0 >> 17), pDst++); + arm_sqrt_q31(acc0 >> 1 , &res); + *pDst++ = res >> 16; - in = read_q15x2_ia ((q15_t **) &pSrc); + in = read_q15x2_ia (&pSrc); acc0 = __SMUAD(in, in); - arm_sqrt_q15((q15_t) (acc0 >> 17), pDst++); + arm_sqrt_q31(acc0 >> 1 , &res); + *pDst++ = res >> 16; - in = read_q15x2_ia ((q15_t **) &pSrc); + in = read_q15x2_ia (&pSrc); acc0 = __SMUAD(in, in); - arm_sqrt_q15((q15_t) (acc0 >> 17), pDst++); + arm_sqrt_q31(acc0 >> 1 , &res); + *pDst++ = res >> 16; - in = read_q15x2_ia ((q15_t **) &pSrc); + in = read_q15x2_ia (&pSrc); acc0 = __SMUAD(in, in); - arm_sqrt_q15((q15_t) (acc0 >> 17), pDst++); + arm_sqrt_q31(acc0 >> 1 , &res); + *pDst++ = res >> 16; #else real = *pSrc++; imag = *pSrc++; @@ -156,25 +196,29 @@ void arm_cmplx_mag_q15( acc1 = ((q31_t) imag * imag); /* store result in 2.14 format in destination buffer. */ - arm_sqrt_q15((q15_t) (((q63_t) acc0 + acc1) >> 17), pDst++); + arm_sqrt_q31((acc0 + acc1) >> 1 , &res); + *pDst++ = res >> 16; real = *pSrc++; imag = *pSrc++; acc0 = ((q31_t) real * real); acc1 = ((q31_t) imag * imag); - arm_sqrt_q15((q15_t) (((q63_t) acc0 + acc1) >> 17), pDst++); + arm_sqrt_q31((acc0 + acc1) >> 1 , &res); + *pDst++ = res >> 16; real = *pSrc++; imag = *pSrc++; acc0 = ((q31_t) real * real); acc1 = ((q31_t) imag * imag); - arm_sqrt_q15((q15_t) (((q63_t) acc0 + acc1) >> 17), pDst++); + arm_sqrt_q31((acc0 + acc1) >> 1 , &res); + *pDst++ = res >> 16; real = *pSrc++; imag = *pSrc++; acc0 = ((q31_t) real * real); acc1 = ((q31_t) imag * imag); - arm_sqrt_q15((q15_t) (((q63_t) acc0 + acc1) >> 17), pDst++); + arm_sqrt_q31((acc0 + acc1) >> 1 , &res); + *pDst++ = res >> 16; #endif /* #if defined (ARM_MATH_DSP) */ /* Decrement loop counter */ @@ -196,11 +240,12 @@ void arm_cmplx_mag_q15( /* C[0] = sqrt(A[0] * A[0] + A[1] * A[1]) */ #if defined (ARM_MATH_DSP) - in = read_q15x2_ia ((q15_t **) &pSrc); + in = read_q15x2_ia (&pSrc); acc0 = __SMUAD(in, in); /* store result in 2.14 format in destination buffer. */ - arm_sqrt_q15((q15_t) (acc0 >> 17), pDst++); + arm_sqrt_q31(acc0 >> 1 , &res); + *pDst++ = res >> 16; #else real = *pSrc++; imag = *pSrc++; @@ -208,7 +253,9 @@ void arm_cmplx_mag_q15( acc1 = ((q31_t) imag * imag); /* store result in 2.14 format in destination buffer. */ - arm_sqrt_q15((q15_t) (((q63_t) acc0 + acc1) >> 17), pDst++); + arm_sqrt_q31((acc0 + acc1) >> 1 , &res); + *pDst++ = res >> 16; + #endif /* Decrement loop counter */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_q31.c index fa5a4e4..0041620 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_q31.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_mag_q31.c * Description: Q31 complex magnitude * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_f16.c index 1449000..5fd3af1 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_f16.c @@ -5,11 +5,13 @@ * Title: arm_cmplx_mag_squared_f16.c * Description: Floating-point complex magnitude squared * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -34,29 +36,6 @@ @ingroup groupCmplxMath */ -/** - @defgroup cmplx_mag_squared Complex Magnitude Squared - - Computes the magnitude squared of the elements of a complex data vector. - - The pSrc points to the source data and - pDst points to the where the result should be written. - numSamples specifies the number of complex samples - in the input array and the data is stored in an interleaved fashion - (real, imag, real, imag, ...). - The input array has a total of 2*numSamples values; - the output array has a total of numSamples values. - - The underlying algorithm is used: - -
-  for (n = 0; n < numSamples; n++) {
-      pDst[n] = pSrc[(2*n)+0]^2 + pSrc[(2*n)+1]^2;
-  }
-  
- - There are separate functions for floating-point, Q15, and Q31 data types. - */ /** @addtogroup cmplx_mag_squared @@ -172,4 +151,5 @@ void arm_cmplx_mag_squared_f16( */ #endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_f32.c index e611194..eaadf1c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_f32.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_mag_squared_f32.c * Description: Floating-point complex magnitude squared * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_f64.c new file mode 100644 index 0000000..d2a2b36 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_f64.c @@ -0,0 +1,80 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_cmplx_mag_squared_f64.c + * Description: Floating-point complex magnitude squared + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/complex_math_functions.h" + +/** + @ingroup groupCmplxMath + */ + +/** + @addtogroup cmplx_mag_squared + @{ + */ + +/** + @brief Floating-point complex magnitude squared. + @param[in] pSrc points to input vector + @param[out] pDst points to output vector + @param[in] numSamples number of samples in each vector + @return none + */ +void arm_cmplx_mag_squared_f64( + const float64_t * pSrc, + float64_t * pDst, + uint32_t numSamples) +{ + uint32_t blkCnt; /* Loop counter */ + float64_t real, imag; /* Temporary input variables */ + + /* Initialize blkCnt with number of samples */ + blkCnt = numSamples; + + while (blkCnt > 0U) + { + /* C[0] = (A[0] * A[0] + A[1] * A[1]) */ + + real = *pSrc++; + imag = *pSrc++; + + /* store result in destination buffer. */ + *pDst++ = (real * real) + (imag * imag); + + /* Decrement loop counter */ + blkCnt--; + } + +} + +/** + @} end of cmplx_mag_squared group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_q15.c index 5163b22..0e2b2ec 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_q15.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_mag_squared_q15.c * Description: Q15 complex magnitude squared * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -133,20 +133,20 @@ void arm_cmplx_mag_squared_q15( /* C[0] = (A[0] * A[0] + A[1] * A[1]) */ #if defined (ARM_MATH_DSP) - in = read_q15x2_ia ((q15_t **) &pSrc); + in = read_q15x2_ia (&pSrc); acc0 = __SMUAD(in, in); /* store result in 3.13 format in destination buffer. */ *pDst++ = (q15_t) (acc0 >> 17); - in = read_q15x2_ia ((q15_t **) &pSrc); + in = read_q15x2_ia (&pSrc); acc0 = __SMUAD(in, in); *pDst++ = (q15_t) (acc0 >> 17); - in = read_q15x2_ia ((q15_t **) &pSrc); + in = read_q15x2_ia (&pSrc); acc0 = __SMUAD(in, in); *pDst++ = (q15_t) (acc0 >> 17); - in = read_q15x2_ia ((q15_t **) &pSrc); + in = read_q15x2_ia (&pSrc); acc0 = __SMUAD(in, in); *pDst++ = (q15_t) (acc0 >> 17); #else @@ -195,7 +195,7 @@ void arm_cmplx_mag_squared_q15( /* C[0] = (A[0] * A[0] + A[1] * A[1]) */ #if defined (ARM_MATH_DSP) - in = read_q15x2_ia ((q15_t **) &pSrc); + in = read_q15x2_ia (&pSrc); acc0 = __SMUAD(in, in); /* store result in 3.13 format in destination buffer. */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_q31.c index e9a7649..b533a60 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mag_squared_q31.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_mag_squared_q31.c * Description: Q31 complex magnitude squared * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_f16.c index 79f48e9..75fefa3 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_f16.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_mult_cmplx_f16.c * Description: Floating-point complex-by-complex multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -36,27 +36,7 @@ @ingroup groupCmplxMath */ -/** - @defgroup CmplxByCmplxMult Complex-by-Complex Multiplication - - Multiplies a complex vector by another complex vector and generates a complex result. - The data in the complex arrays is stored in an interleaved fashion - (real, imag, real, imag, ...). - The parameter numSamples represents the number of complex - samples processed. The complex arrays have a total of 2*numSamples - real values. - The underlying algorithm is used: - -
-  for (n = 0; n < numSamples; n++) {
-      pDst[(2*n)+0] = pSrcA[(2*n)+0] * pSrcB[(2*n)+0] - pSrcA[(2*n)+1] * pSrcB[(2*n)+1];
-      pDst[(2*n)+1] = pSrcA[(2*n)+0] * pSrcB[(2*n)+1] + pSrcA[(2*n)+1] * pSrcB[(2*n)+0];
-  }
-  
- - There are separate functions for floating-point, Q15, and Q31 data types. - */ /** @addtogroup CmplxByCmplxMult @@ -271,4 +251,5 @@ void arm_cmplx_mult_cmplx_f16( */ #endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_f32.c index 672ed89..d6ec828 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_f32.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_mult_cmplx_f32.c * Description: Floating-point complex-by-complex multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_f64.c new file mode 100644 index 0000000..603de64 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_f64.c @@ -0,0 +1,87 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_cmplx_mult_cmplx_f64.c + * Description: Floating-point complex-by-complex multiplication + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/complex_math_functions.h" + +/** + @ingroup groupCmplxMath + */ + +/** + @addtogroup CmplxByCmplxMult + @{ + */ + +/** + @brief Floating-point complex-by-complex multiplication. + @param[in] pSrcA points to first input vector + @param[in] pSrcB points to second input vector + @param[out] pDst points to output vector + @param[in] numSamples number of samples in each vector + @return none + */ + +void arm_cmplx_mult_cmplx_f64( + const float64_t * pSrcA, + const float64_t * pSrcB, + float64_t * pDst, + uint32_t numSamples) +{ + uint32_t blkCnt; /* Loop counter */ + float64_t a, b, c, d; /* Temporary variables to store real and imaginary values */ + + /* Initialize blkCnt with number of samples */ + blkCnt = numSamples; + + while (blkCnt > 0U) + { + /* C[2 * i ] = A[2 * i] * B[2 * i ] - A[2 * i + 1] * B[2 * i + 1]. */ + /* C[2 * i + 1] = A[2 * i] * B[2 * i + 1] + A[2 * i + 1] * B[2 * i ]. */ + + a = *pSrcA++; + b = *pSrcA++; + c = *pSrcB++; + d = *pSrcB++; + + /* store result in destination buffer. */ + *pDst++ = (a * c) - (b * d); + *pDst++ = (a * d) + (b * c); + + /* Decrement loop counter */ + blkCnt--; + } + +} + +/** + @} end of CmplxByCmplxMult group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_q15.c index 759b917..0790341 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_q15.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_mult_cmplx_q15.c * Description: Q15 complex-by-complex multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_q31.c index 6280603..cbfc505 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_cmplx_q31.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_mult_cmplx_q31.c * Description: Q31 complex-by-complex multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_f16.c index 1bc40d2..740639e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_f16.c @@ -5,11 +5,13 @@ * Title: arm_cmplx_mult_real_f16.c * Description: Floating-point complex by real multiplication * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -34,28 +36,6 @@ @ingroup groupCmplxMath */ -/** - @defgroup CmplxByRealMult Complex-by-Real Multiplication - - Multiplies a complex vector by a real vector and generates a complex result. - The data in the complex arrays is stored in an interleaved fashion - (real, imag, real, imag, ...). - The parameter numSamples represents the number of complex - samples processed. The complex arrays have a total of 2*numSamples - real values while the real array has a total of numSamples - real values. - - The underlying algorithm is used: - -
-  for (n = 0; n < numSamples; n++) {
-      pCmplxDst[(2*n)+0] = pSrcCmplx[(2*n)+0] * pSrcReal[n];
-      pCmplxDst[(2*n)+1] = pSrcCmplx[(2*n)+1] * pSrcReal[n];
-  }
-  
- - There are separate functions for floating-point, Q15, and Q31 data types. - */ /** @addtogroup CmplxByRealMult @@ -79,7 +59,7 @@ void arm_cmplx_mult_real_f16( float16_t * pCmplxDst, uint32_t numSamples) { - const static uint16_t stride_cmplx_x_real_16[8] = { + static const uint16_t stride_cmplx_x_real_16[8] = { 0, 0, 1, 1, 2, 2, 3, 3 }; uint32_t blockSizeC = numSamples * CMPLX_DIM; /* loop counters */ @@ -141,20 +121,20 @@ void arm_cmplx_mult_real_f16( in = *pSrcReal++; /* store result in destination buffer. */ - *pCmplxDst++ = *pSrcCmplx++ * in; - *pCmplxDst++ = *pSrcCmplx++ * in; + *pCmplxDst++ = (_Float16)*pSrcCmplx++ * (_Float16)in; + *pCmplxDst++ = (_Float16)*pSrcCmplx++ * (_Float16)in; in = *pSrcReal++; - *pCmplxDst++ = *pSrcCmplx++ * in; - *pCmplxDst++ = *pSrcCmplx++ * in; + *pCmplxDst++ = (_Float16)*pSrcCmplx++ * (_Float16)in; + *pCmplxDst++ = (_Float16)*pSrcCmplx++ * (_Float16)in; in = *pSrcReal++; - *pCmplxDst++ = *pSrcCmplx++ * in; - *pCmplxDst++ = *pSrcCmplx++ * in; + *pCmplxDst++ = (_Float16)*pSrcCmplx++ * (_Float16)in; + *pCmplxDst++ = (_Float16)*pSrcCmplx++ * (_Float16)in; in = *pSrcReal++; - *pCmplxDst++ = *pSrcCmplx++* in; - *pCmplxDst++ = *pSrcCmplx++ * in; + *pCmplxDst++ = (_Float16)*pSrcCmplx++ * (_Float16)in; + *pCmplxDst++ = (_Float16)*pSrcCmplx++ * (_Float16)in; /* Decrement loop counter */ blkCnt--; @@ -177,8 +157,8 @@ void arm_cmplx_mult_real_f16( in = *pSrcReal++; /* store result in destination buffer. */ - *pCmplxDst++ = *pSrcCmplx++ * in; - *pCmplxDst++ = *pSrcCmplx++ * in; + *pCmplxDst++ = (_Float16)*pSrcCmplx++ * (_Float16)in; + *pCmplxDst++ = (_Float16)*pSrcCmplx++ * (_Float16)in; /* Decrement loop counter */ blkCnt--; @@ -192,4 +172,5 @@ void arm_cmplx_mult_real_f16( */ #endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_f32.c index c946dfa..af346be 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_f32.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_mult_real_f32.c * Description: Floating-point complex by real multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -79,7 +79,7 @@ void arm_cmplx_mult_real_f32( float32_t * pCmplxDst, uint32_t numSamples) { - const static uint32_t stride_cmplx_x_real_32[4] = { 0, 0, 1, 1 }; + static const uint32_t stride_cmplx_x_real_32[4] = { 0, 0, 1, 1 }; uint32_t blockSizeC = numSamples * CMPLX_DIM; /* loop counters */ uint32_t blkCnt; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_q15.c index 9495dcb..c2aab63 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_q15.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_mult_real_q15.c * Description: Q15 complex by real multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -59,7 +59,7 @@ void arm_cmplx_mult_real_q15( q15_t * pCmplxDst, uint32_t numSamples) { - const static uint16_t stride_cmplx_x_real_16[8] = { + static const uint16_t stride_cmplx_x_real_16[8] = { 0, 0, 1, 1, 2, 2, 3, 3 }; q15x8_t rVec; @@ -135,10 +135,10 @@ void arm_cmplx_mult_real_q15( #if defined (ARM_MATH_DSP) /* read 2 complex numbers both real and imaginary from complex input buffer */ - inA1 = read_q15x2_ia ((q15_t **) &pSrcCmplx); - inA2 = read_q15x2_ia ((q15_t **) &pSrcCmplx); + inA1 = read_q15x2_ia (&pSrcCmplx); + inA2 = read_q15x2_ia (&pSrcCmplx); /* read 2 real values at a time from real input buffer */ - inB1 = read_q15x2_ia ((q15_t **) &pSrcReal); + inB1 = read_q15x2_ia (&pSrcReal); /* multiply complex number with real numbers */ #ifndef ARM_MATH_BIG_ENDIAN @@ -163,9 +163,9 @@ void arm_cmplx_mult_real_q15( write_q15x2_ia (&pCmplxDst, __PKHBT(out1, out2, 16)); write_q15x2_ia (&pCmplxDst, __PKHBT(out3, out4, 16)); - inA1 = read_q15x2_ia ((q15_t **) &pSrcCmplx); - inA2 = read_q15x2_ia ((q15_t **) &pSrcCmplx); - inB1 = read_q15x2_ia ((q15_t **) &pSrcReal); + inA1 = read_q15x2_ia (&pSrcCmplx); + inA2 = read_q15x2_ia (&pSrcCmplx); + inB1 = read_q15x2_ia (&pSrcReal); #ifndef ARM_MATH_BIG_ENDIAN mul1 = (q31_t) ((q15_t) (inA1) * (q15_t) (inB1)); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_q31.c index 8303420..700468d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ComplexMathFunctions/arm_cmplx_mult_real_q31.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_mult_real_q31.c * Description: Q31 complex by real multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -60,7 +60,7 @@ void arm_cmplx_mult_real_q31( uint32_t numSamples) { - const static uint32_t stride_cmplx_x_real_32[4] = { + static const uint32_t stride_cmplx_x_real_32[4] = { 0, 0, 1, 1 }; q31x4_t rVec; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_init_f32.c index 40892c1..976e91f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_pid_init_f32.c * Description: Floating-point PID Control initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_init_q15.c index 1c8e160..79f5f0d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_init_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_init_q15.c @@ -5,13 +5,13 @@ * Title: arm_pid_init_q15.c * Description: Q15 PID Control initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_init_q31.c index d38c740..df5415c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_pid_init_q31.c * Description: Q31 PID Control initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_reset_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_reset_f32.c index fa29131..b0e6abb 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_reset_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_reset_f32.c @@ -5,13 +5,13 @@ * Title: arm_pid_reset_f32.c * Description: Floating-point PID Control reset function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_reset_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_reset_q15.c index bcd451a..c42f45a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_reset_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_reset_q15.c @@ -5,13 +5,13 @@ * Title: arm_pid_reset_q15.c * Description: Q15 PID Control reset function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_reset_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_reset_q31.c index c13df84..472a2c1 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_reset_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_pid_reset_q31.c @@ -5,13 +5,13 @@ * Title: arm_pid_reset_q31.c * Description: Q31 PID Control reset function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_sin_cos_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_sin_cos_f32.c index 97a3e39..4c85db6 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_sin_cos_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_sin_cos_f32.c @@ -5,13 +5,13 @@ * Title: arm_sin_cos_f32.c * Description: Sine and Cosine calculation for floating-point values * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -31,35 +31,6 @@ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h" #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables.h" -/** - @ingroup groupController - */ - -/** - @defgroup SinCos Sine Cosine - - Computes the trigonometric sine and cosine values using a combination of table lookup - and linear interpolation. - There are separate functions for Q31 and floating-point data types. - The input to the floating-point version is in degrees while the - fixed-point Q31 have a scaled input with the range - [-1 0.9999] mapping to [-180 +180] degrees. - - The floating point function also allows values that are out of the usual range. When this happens, the function will - take extra time to adjust the input value to the range of [-180 180]. - - The result is accurate to 5 digits after the decimal point. - - The implementation is based on table lookup using 360 values together with linear interpolation. - The steps used are: - -# Calculation of the nearest integer table index. - -# Compute the fractional portion (fract) of the input. - -# Fetch the value corresponding to \c index from sine table to \c y0 and also value from \c index+1 to \c y1. - -# Sine value is computed as *psinVal = y0 + (fract * (y1 - y0)). - -# Fetch the value corresponding to \c index from cosine table to \c y0 and also value from \c index+1 to \c y1. - -# Cosine value is computed as *pcosVal = y0 + (fract * (y1 - y0)). - */ - /** @addtogroup SinCos @{ @@ -109,8 +80,6 @@ void arm_sin_cos_f32( d1 = -sinTable_f32[indexS ]; d2 = -sinTable_f32[indexS+1]; - temp = (1.0f - fract) * f1 + fract * f2; - Dn = 0.0122718463030f; /* delta between the two points (fixed), in this case 2*pi/FAST_MATH_TABLE_SIZE */ Df = f2 - f1; /* delta between the values of the functions */ @@ -127,7 +96,6 @@ void arm_sin_cos_f32( d1 = sinTable_f32[indexC ]; d2 = sinTable_f32[indexC+1]; - temp = (1.0f - fract) * f1 + fract * f2; Df = f2 - f1; // delta between the values of the functions temp = Dn * (d1 + d2) - 2 * Df; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_sin_cos_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_sin_cos_q31.c index 7e7c881..4198307 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_sin_cos_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/ControllerFunctions/arm_sin_cos_q31.c @@ -5,13 +5,13 @@ * Title: arm_sin_cos_q31.c * Description: Cosine & Sine calculation for Q31 values * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_boolean_distance.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_boolean_distance.c index df49f29..921d039 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_boolean_distance.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_boolean_distance.c @@ -6,11 +6,13 @@ * Title: arm_svm_linear_init_f32.c * Description: SVM Linear Instance Initialization * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_boolean_distance_template.h b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_boolean_distance_template.h index 70a96cd..b50c739 100755 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_boolean_distance_template.h +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_boolean_distance_template.h @@ -4,11 +4,13 @@ * Title: arm_boolean_distance.c * Description: Templates for boolean distances * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_braycurtis_distance_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_braycurtis_distance_f16.c index bc899da..1c056f2 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_braycurtis_distance_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_braycurtis_distance_f16.c @@ -6,11 +6,13 @@ * Title: arm_braycurtis_distance_f16.c * Description: Bray-Curtis distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -133,8 +135,8 @@ float16_t arm_braycurtis_distance_f16(const float16_t *pA,const float16_t *pB, u { tmpA = *pA++; tmpB = *pB++; - accumDiff += (_Float16)fabsf(tmpA - tmpB); - accumSum += (_Float16)fabsf(tmpA + tmpB); + accumDiff += (_Float16)fabsf((float32_t)((_Float16)tmpA - (_Float16)tmpB)); + accumSum += (_Float16)fabsf((float32_t)((_Float16)tmpA + (_Float16)tmpB)); blockSize --; } /* diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_braycurtis_distance_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_braycurtis_distance_f32.c index b616cd1..4a8fd6b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_braycurtis_distance_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_braycurtis_distance_f32.c @@ -6,11 +6,13 @@ * Title: arm_braycurtis_distance_f32.c * Description: Bray-Curtis distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_canberra_distance_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_canberra_distance_f16.c index ef0f411..7cfffc1 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_canberra_distance_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_canberra_distance_f16.c @@ -6,11 +6,13 @@ * Title: arm_canberra_distance_f16.c * Description: Canberra distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -150,11 +152,11 @@ float16_t arm_canberra_distance_f16(const float16_t *pA,const float16_t *pB, uin tmpA = *pA++; tmpB = *pB++; - diff = fabsf(tmpA - tmpB); - sum = fabsf(tmpA) + fabsf(tmpB); - if ((tmpA != 0.0f16) || (tmpB != 0.0f16)) + diff = fabsf((float32_t)((_Float16)tmpA - (_Float16)tmpB)); + sum = (_Float16)fabsf((float32_t)tmpA) + (_Float16)fabsf((float32_t)tmpB); + if (((_Float16)tmpA != 0.0f16) || ((_Float16)tmpB != 0.0f16)) { - accum += (diff / sum); + accum += ((_Float16)diff / (_Float16)sum); } blockSize --; } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_canberra_distance_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_canberra_distance_f32.c index 153124c..78d1353 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_canberra_distance_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_canberra_distance_f32.c @@ -6,11 +6,13 @@ * Title: arm_canberra_distance_f32.c * Description: Canberra distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_chebyshev_distance_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_chebyshev_distance_f16.c index f825ac2..bbf41dc 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_chebyshev_distance_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_chebyshev_distance_f16.c @@ -6,11 +6,13 @@ * Title: arm_chebyshev_distance_f16.c * Description: Chebyshev distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -117,7 +119,7 @@ float16_t arm_chebyshev_distance_f16(const float16_t *pA,const float16_t *pB, ui tmpA = *pA++; tmpB = *pB++; - diff = fabsf(tmpA - tmpB); + diff = (_Float16)fabsf((float32_t)((_Float16)tmpA - (_Float16)tmpB)); maxVal = diff; blockSize--; @@ -125,8 +127,8 @@ float16_t arm_chebyshev_distance_f16(const float16_t *pA,const float16_t *pB, ui { tmpA = *pA++; tmpB = *pB++; - diff = fabsf(tmpA - tmpB); - if (diff > maxVal) + diff = (_Float16)fabsf((float32_t)((_Float16)tmpA - (_Float16)tmpB)); + if ((_Float16)diff > (_Float16)maxVal) { maxVal = diff; } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_chebyshev_distance_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_chebyshev_distance_f32.c index e306011..ee45e3d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_chebyshev_distance_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_chebyshev_distance_f32.c @@ -6,11 +6,13 @@ * Title: arm_chebyshev_distance_f32.c * Description: Chebyshev distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_chebyshev_distance_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_chebyshev_distance_f64.c new file mode 100644 index 0000000..0b64f72 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_chebyshev_distance_f64.c @@ -0,0 +1,80 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES + +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_chebyshev_distance_f64.c + * Description: Chebyshev distance between two vectors + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/distance_functions.h" +#include +#include + + +/** + @addtogroup Chebyshev + @{ + */ + + +/** + * @brief Chebyshev distance between two vectors + * @param[in] pA First vector + * @param[in] pB Second vector + * @param[in] blockSize vector length + * @return distance + * + */ +float64_t arm_chebyshev_distance_f64(const float64_t *pA,const float64_t *pB, uint32_t blockSize) +{ + float64_t diff=0., maxVal,tmpA, tmpB; + + tmpA = *pA++; + tmpB = *pB++; + diff = fabs(tmpA - tmpB); + maxVal = diff; + blockSize--; + + while(blockSize > 0) + { + tmpA = *pA++; + tmpB = *pB++; + diff = fabs(tmpA - tmpB); + if (diff > maxVal) + { + maxVal = diff; + } + blockSize --; + } + + return(maxVal); +} + +/** + * @} end of Chebyshev group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cityblock_distance_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cityblock_distance_f16.c index 876da7d..0c9cc2f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cityblock_distance_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cityblock_distance_f16.c @@ -6,11 +6,13 @@ * Title: arm_cityblock_distance_f16.c * Description: Cityblock (Manhattan) distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -111,7 +113,7 @@ float16_t arm_cityblock_distance_f16(const float16_t *pA,const float16_t *pB, ui { tmpA = *pA++; tmpB = *pB++; - accum += (_Float16)fabsf(tmpA - tmpB); + accum += (_Float16)fabsf((float32_t)((_Float16)tmpA - (_Float16)tmpB)); blockSize --; } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cityblock_distance_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cityblock_distance_f32.c index d35239b..a749055 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cityblock_distance_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cityblock_distance_f32.c @@ -6,11 +6,13 @@ * Title: arm_cityblock_distance_f32.c * Description: Cityblock (Manhattan) distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cityblock_distance_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cityblock_distance_f64.c new file mode 100644 index 0000000..e07e7a7 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cityblock_distance_f64.c @@ -0,0 +1,71 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES + +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_cityblock_distance_f64.c + * Description: Cityblock (Manhattan) distance between two vectors + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/distance_functions.h" +#include +#include + +/** + @addtogroup Manhattan + @{ + */ + + +/** + * @brief Cityblock (Manhattan) distance between two vectors + * @param[in] pA First vector + * @param[in] pB Second vector + * @param[in] blockSize vector length + * @return distance + * + */ +float64_t arm_cityblock_distance_f64(const float64_t *pA,const float64_t *pB, uint32_t blockSize) +{ + float64_t accum,tmpA, tmpB; + + accum = 0.; + while(blockSize > 0) + { + tmpA = *pA++; + tmpB = *pB++; + accum += fabs(tmpA - tmpB); + + blockSize --; + } + + return(accum); +} + +/** + * @} end of Manhattan group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_correlation_distance_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_correlation_distance_f16.c index e7d3638..715484b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_correlation_distance_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_correlation_distance_f16.c @@ -6,11 +6,13 @@ * Title: arm_correlation_distance_f16.c * Description: Correlation distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -70,21 +72,21 @@ float16_t arm_correlation_distance_f16(float16_t *pA,float16_t *pB, uint32_t blo arm_mean_f16(pA, blockSize, &ma); arm_mean_f16(pB, blockSize, &mb); - arm_offset_f16(pA, -ma, pA, blockSize); - arm_offset_f16(pB, -mb, pB, blockSize); + arm_offset_f16(pA, -(_Float16)ma, pA, blockSize); + arm_offset_f16(pB, -(_Float16)mb, pB, blockSize); arm_power_f16(pA, blockSize, &pwra); arm_power_f16(pB, blockSize, &pwrb); arm_dot_prod_f16(pA,pB,blockSize,&dot); - dot = dot / blockSize; - pwra = pwra / blockSize; - pwrb = pwrb / blockSize; + dot = (_Float16)dot / (_Float16)blockSize; + pwra = (_Float16)pwra / (_Float16)blockSize; + pwrb = (_Float16)pwrb / (_Float16)blockSize; - arm_sqrt_f16(pwra * pwrb,&tmp); + arm_sqrt_f16((_Float16)pwra * (_Float16)pwrb,&tmp); - return(1.0f - dot / tmp); + return(1.0f16 - (_Float16)dot / (_Float16)tmp); } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_correlation_distance_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_correlation_distance_f32.c index e71fd7f..79d26a9 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_correlation_distance_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_correlation_distance_f32.c @@ -6,11 +6,13 @@ * Title: arm_correlation_distance_f32.c * Description: Correlation distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cosine_distance_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cosine_distance_f16.c index 0046263..453aebf 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cosine_distance_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cosine_distance_f16.c @@ -6,11 +6,13 @@ * Title: arm_cosine_distance_f16.c * Description: Cosine distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -60,6 +62,8 @@ * @param[in] blockSize vector length * @return distance * + * @par Description + * cosine_distance(u,v) is 1 - u . v / (Norm(u) Norm(v)) */ float16_t arm_cosine_distance_f16(const float16_t *pA,const float16_t *pB, uint32_t blockSize) @@ -71,8 +75,8 @@ float16_t arm_cosine_distance_f16(const float16_t *pA,const float16_t *pB, uint3 arm_dot_prod_f16(pA,pB,blockSize,&dot); - arm_sqrt_f16(pwra * pwrb, &tmp); - return(1.0f - dot / tmp); + arm_sqrt_f16((_Float16)pwra * (_Float16)pwrb, &tmp); + return(1.0f16 - (_Float16)dot / (_Float16)tmp); } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cosine_distance_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cosine_distance_f32.c index 1ad6cc7..871c7af 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cosine_distance_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cosine_distance_f32.c @@ -6,11 +6,13 @@ * Title: arm_cosine_distance_f32.c * Description: Cosine distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -47,6 +49,8 @@ * @param[in] blockSize vector length * @return distance * + * @par Description + * cosine_distance(u,v) is 1 - u . v / (Norm(u) Norm(v)) */ float32_t arm_cosine_distance_f32(const float32_t *pA,const float32_t *pB, uint32_t blockSize) diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cosine_distance_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cosine_distance_f64.c new file mode 100644 index 0000000..ea5e654 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_cosine_distance_f64.c @@ -0,0 +1,74 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES + +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_cosine_distance_f64.c + * Description: Cosine distance between two vectors + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/distance_functions.h" +#include +#include + + +/** + @addtogroup CosineDist + @{ + */ + + + +/** + * @brief Cosine distance between two vectors + * + * @param[in] pA First vector + * @param[in] pB Second vector + * @param[in] blockSize vector length + * @return distance + * + */ + +float64_t arm_cosine_distance_f64(const float64_t *pA,const float64_t *pB, uint32_t blockSize) +{ + float64_t pwra,pwrb,dot,tmp; + + arm_power_f64(pA, blockSize, &pwra); + arm_power_f64(pB, blockSize, &pwrb); + + arm_dot_prod_f64(pA,pB,blockSize,&dot); + + tmp = sqrt(pwra * pwrb); + return(1. - dot / tmp); + +} + + + +/** + * @} end of CosineDist group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_dice_distance.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_dice_distance.c index 4fd2963..d27dfc9 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_dice_distance.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_dice_distance.c @@ -6,11 +6,13 @@ * Title: arm_dice_distance.c * Description: Dice distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_euclidean_distance_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_euclidean_distance_f16.c index 67a703e..dd1d9ca 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_euclidean_distance_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_euclidean_distance_f16.c @@ -6,11 +6,13 @@ * Title: arm_euclidean_distance_f16.c * Description: Euclidean distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_euclidean_distance_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_euclidean_distance_f32.c index 101151e..ccbdc77 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_euclidean_distance_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_euclidean_distance_f32.c @@ -6,11 +6,13 @@ * Title: arm_euclidean_distance_f32.c * Description: Euclidean distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_euclidean_distance_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_euclidean_distance_f64.c new file mode 100644 index 0000000..04c42f7 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_euclidean_distance_f64.c @@ -0,0 +1,70 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES + +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_euclidean_distance_f64.c + * Description: Euclidean distance between two vectors + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/distance_functions.h" +#include +#include + + + +/** + @addtogroup Euclidean + @{ + */ + + +/** + * @brief Euclidean distance between two vectors + * @param[in] pA First vector + * @param[in] pB Second vector + * @param[in] blockSize vector length + * @return distance + * + */ +float64_t arm_euclidean_distance_f64(const float64_t *pA,const float64_t *pB, uint32_t blockSize) +{ + float64_t accum=0.,tmp; + + while(blockSize > 0) + { + tmp = *pA++ - *pB++; + accum += SQ(tmp); + blockSize --; + } + tmp = sqrt(accum); + return(tmp); +} + +/** + * @} end of Euclidean group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_hamming_distance.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_hamming_distance.c index 8a6e4f7..28f2733 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_hamming_distance.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_hamming_distance.c @@ -6,11 +6,13 @@ * Title: arm_hamming_distance.c * Description: Hamming distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_jaccard_distance.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_jaccard_distance.c index d3dc3bb..30d061b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_jaccard_distance.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_jaccard_distance.c @@ -6,11 +6,13 @@ * Title: arm_jaccard_distance.c * Description: Jaccard distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_jensenshannon_distance_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_jensenshannon_distance_f16.c index 87a14d8..14bd4b0 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_jensenshannon_distance_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_jensenshannon_distance_f16.c @@ -6,11 +6,13 @@ * Title: arm_jensenshannon_distance_f16.c * Description: Jensen-Shannon distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -54,7 +56,7 @@ /// @private __STATIC_INLINE float16_t rel_entr(float16_t x, float16_t y) { - return (x * logf(x / y)); + return ((_Float16)x * (_Float16)logf((float32_t)((_Float16)x / (_Float16)y))); } #endif @@ -117,7 +119,7 @@ float16_t arm_jensenshannon_distance_f16(const float16_t *pA,const float16_t *pB } - arm_sqrt_f16(vecAddAcrossF16Mve(accumV) / 2.0f, &tmp); + arm_sqrt_f16((_Float16)vecAddAcrossF16Mve(accumV) / 2.0f16, &tmp); return (tmp); } @@ -162,7 +164,7 @@ float16_t arm_jensenshannon_distance_f16(const float16_t *pA,const float16_t *pB sum = left + right; - arm_sqrt_f16(sum/2.0f, &result); + arm_sqrt_f16((_Float16)sum/2.0f16, &result); return(result); } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_jensenshannon_distance_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_jensenshannon_distance_f32.c index 56af92e..6aeb797 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_jensenshannon_distance_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_jensenshannon_distance_f32.c @@ -6,11 +6,13 @@ * Title: arm_jensenshannon_distance_f32.c * Description: Jensen-Shannon distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_kulsinski_distance.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_kulsinski_distance.c index 2941de9..1bcb2ef 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_kulsinski_distance.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_kulsinski_distance.c @@ -6,11 +6,13 @@ * Title: arm_kulsinski_distance.c * Description: Kulsinski distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_minkowski_distance_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_minkowski_distance_f16.c index 79d1b8a..ae9c3cb 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_minkowski_distance_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_minkowski_distance_f16.c @@ -6,11 +6,13 @@ * Title: arm_minkowski_distance_f16.c * Description: Minkowski distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -69,10 +71,9 @@ float16_t arm_minkowski_distance_f16(const float16_t *pA,const float16_t *pB, int32_t order, uint32_t blockSize) { uint32_t blkCnt; - f16x8_t a, b, tmpV, accumV, sumV; + f16x8_t a, b, tmpV, sumV; sumV = vdupq_n_f16(0.0f); - accumV = vdupq_n_f16(0.0f); blkCnt = blockSize >> 3; while (blkCnt > 0U) { @@ -104,7 +105,7 @@ float16_t arm_minkowski_distance_f16(const float16_t *pA,const float16_t *pB, in sumV = vaddq_m(sumV, sumV, tmpV, p0); } - return (powf(vecAddAcrossF16Mve(sumV), (1.0f / (float16_t) order))); + return (powf((float32_t)vecAddAcrossF16Mve(sumV), (1.0f / (float32_t) order))); } @@ -116,14 +117,14 @@ float16_t arm_minkowski_distance_f16(const float16_t *pA,const float16_t *pB, in _Float16 sum; uint32_t i; - sum = 0.0f; + sum = 0.0f16; for(i=0; i < blockSize; i++) { - sum += (_Float16)powf(fabsf(pA[i] - pB[i]),order); + sum += (_Float16)powf(fabsf((float32_t)((_Float16)pA[i] - (_Float16)pB[i])),order); } - return(powf(sum,(1.0f/order))); + return(_Float16)(powf((float32_t)sum,(1.0f/(float32_t)order))); } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_minkowski_distance_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_minkowski_distance_f32.c index 51a904a..e29d8e1 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_minkowski_distance_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_minkowski_distance_f32.c @@ -6,11 +6,13 @@ * Title: arm_minkowski_distance_f32.c * Description: Minkowski distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -76,10 +78,9 @@ __attribute__((weak)) float __powisf2(float a, int b) float32_t arm_minkowski_distance_f32(const float32_t *pA,const float32_t *pB, int32_t order, uint32_t blockSize) { uint32_t blkCnt; - f32x4_t a, b, tmpV, accumV, sumV; + f32x4_t a, b, tmpV, sumV; sumV = vdupq_n_f32(0.0f); - accumV = vdupq_n_f32(0.0f); blkCnt = blockSize >> 2; while (blkCnt > 0U) { diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_rogerstanimoto_distance.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_rogerstanimoto_distance.c index 2f923dd..eb7820d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_rogerstanimoto_distance.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_rogerstanimoto_distance.c @@ -6,11 +6,13 @@ * Title: arm_rogerstanimoto_distance.c * Description: Roger Stanimoto distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_russellrao_distance.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_russellrao_distance.c index d924ea2..0be143e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_russellrao_distance.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_russellrao_distance.c @@ -6,11 +6,13 @@ * Title: arm_russellrao_distance.c * Description: Russell-Rao distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -63,7 +65,7 @@ float32_t arm_russellrao_distance(const uint32_t *pA, const uint32_t *pB, uint32 arm_boolean_distance_TT(pA, pB, numberOfBools, &ctt); - return(1.0*(numberOfBools - ctt) / ((float32_t)numberOfBools)); + return(1.0f*(numberOfBools - ctt) / ((float32_t)numberOfBools)); } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_sokalmichener_distance.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_sokalmichener_distance.c index d18904e..3b7fd14 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_sokalmichener_distance.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_sokalmichener_distance.c @@ -6,11 +6,13 @@ * Title: arm_sokalmichener_distance.c * Description: Sokal-Michener distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_sokalsneath_distance.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_sokalsneath_distance.c index 48b24fc..707466e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_sokalsneath_distance.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_sokalsneath_distance.c @@ -6,11 +6,13 @@ * Title: arm_sokalsneath_distance.c * Description: Sokal-Sneath distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_yule_distance.c b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_yule_distance.c index 0535e5b..cf52c90 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_yule_distance.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/DistanceFunctions/arm_yule_distance.c @@ -6,11 +6,13 @@ * Title: arm_yule_distance.c * Description: Yule distance between two vectors * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_atan2_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_atan2_f16.c new file mode 100644 index 0000000..93c898c --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_atan2_f16.c @@ -0,0 +1,175 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_atan2_f16.c + * Description: float16 Arc tangent of y/x + * + * $Date: 22 April 2022 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions_f16.h" + +#if defined(ARM_FLOAT16_SUPPORTED) + +/* + +atan for argument between in [0, 1.0] + + +*/ + +#define PIF16 3.14f16 +#define PI16HALF 1.571f16 + +#define ATANHALFF16 0.463648f16 + +#define ATAN2_NB_COEFS_F16 5 + +static const float16_t atan2_coefs_f16[ATAN2_NB_COEFS_F16]={0.f16 +,1.f16 +,0.f16 +,-0.367f16 +,0.152f16 +}; + +__STATIC_FORCEINLINE float16_t arm_atan_limited_f16(float16_t x) +{ + float16_t res=atan2_coefs_f16[ATAN2_NB_COEFS_F16-1]; + int i=1; + for(i=1;i 1.0f16) + { + x = 1.0f16 / (_Float16)x; + res = (_Float16)PI16HALF - (_Float16)arm_atan_limited_f16(x); + } + else + { + res += (_Float16)arm_atan_limited_f16(x); + } + + + if (sign) + { + res = -(_Float16)res; + } + + return(res); +} + +/** + @ingroup groupFastMath + */ + + +/** + @addtogroup atan2 + @{ + */ + +/** + @brief Arc Tangent of y/x using sign of y and x to get right quadrant + @param[in] y y coordinate + @param[in] x x coordinate + @param[out] result Result + @return error status. + + @par Compute the Arc tangent of y/x: + The sign of y and x are used to determine the right quadrant + and compute the right angle. + +*/ +arm_status arm_atan2_f16(float16_t y,float16_t x,float16_t *result) +{ + if ((_Float16)x > 0.0f16) + { + *result=arm_atan_f16((_Float16)y/(_Float16)x); + return(ARM_MATH_SUCCESS); + } + if ((_Float16)x < 0.0f16) + { + if ((_Float16)y > 0.0f16) + { + *result=(_Float16)arm_atan_f16((_Float16)y/(_Float16)x) + (_Float16)PIF16; + } + else if ((_Float16)y < 0.0f16) + { + *result=(_Float16)arm_atan_f16((_Float16)y/(_Float16)x) - (_Float16)PIF16; + } + else + { + if (signbit((float)y)) + { + *result= -(_Float16)PIF16; + } + else + { + *result= PIF16; + } + } + return(ARM_MATH_SUCCESS); + } + if ((_Float16)x == 0.0f16) + { + if ((_Float16)y > 0.0f16) + { + *result=PI16HALF; + return(ARM_MATH_SUCCESS); + } + if ((_Float16)y < 0.0f16) + { + *result=-(_Float16)PI16HALF; + return(ARM_MATH_SUCCESS); + } + } + + + return(ARM_MATH_NANINF); + +} + +#endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ +/** + @} end of atan2 group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_atan2_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_atan2_f32.c new file mode 100644 index 0000000..51f6812 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_atan2_f32.c @@ -0,0 +1,187 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_atan2_f32.c + * Description: float32 Arc tangent of y/x + * + * $Date: 22 April 2022 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" + +/* + +atan for argument between in [0, 1.0] + + +*/ + +#define ATANHALFF32 0.463648f +#define PIHALFF32 1.5707963267948966192313f + +#define ATAN2_NB_COEFS_F32 10 + +static const float32_t atan2_coefs_f32[ATAN2_NB_COEFS_F32]={0.0f +,1.0000001638308195518f +,-0.0000228941363602264f +,-0.3328086544578890873f +,-0.004404814619311061f +,0.2162217461808173258f +,-0.0207504842057097504f +,-0.1745263362250363339f +,0.1340557235283553386f +,-0.0323664125927477625f +}; + +__STATIC_FORCEINLINE float32_t arm_atan_limited_f32(float32_t x) +{ + float32_t res=atan2_coefs_f32[ATAN2_NB_COEFS_F32-1]; + int i=1; + for(i=1;i 1.0f) + { + x = 1.0f / x; + res = PIHALFF32 - arm_atan_limited_f32(x); + } + else + { + res += arm_atan_limited_f32(x); + } + + + if (sign) + { + res = -res; + } + + return(res); +} + + +/** + @ingroup groupFastMath + */ + +/** + @defgroup atan2 ArcTan2 + + Computing Arc tangent only using the ratio y/x is not enough to determine the angle + since there is an indeterminacy. Opposite quadrants are giving the same ratio. + + ArcTan2 is not using y/x to compute the angle but y and x and use the sign of y and x + to determine the quadrant. + + */ + +/** + @addtogroup atan2 + @{ + */ + +/** + @brief Arc Tangent of y/x using sign of y and x to get right quadrant + @param[in] y y coordinate + @param[in] x x coordinate + @param[out] result Result + @return error status. + + @par Compute the Arc tangent of y/x: + The sign of y and x are used to determine the right quadrant + and compute the right angle. +*/ + + +arm_status arm_atan2_f32(float32_t y,float32_t x,float32_t *result) +{ + if (x > 0.0f) + { + *result=arm_atan_f32(y/x); + return(ARM_MATH_SUCCESS); + } + if (x < 0.0f) + { + if (y > 0.0f) + { + *result=arm_atan_f32(y/x) + PI; + } + else if (y < 0.0f) + { + *result=arm_atan_f32(y/x) - PI; + } + else + { + if (signbit(y)) + { + *result= -PI; + } + else + { + *result= PI; + } + } + return(ARM_MATH_SUCCESS); + } + if (x == 0.0f) + { + if (y > 0.0f) + { + *result=PIHALFF32; + return(ARM_MATH_SUCCESS); + } + if (y < 0.0f) + { + *result=-PIHALFF32; + return(ARM_MATH_SUCCESS); + } + } + + + return(ARM_MATH_NANINF); + +} + +/** + @} end of atan2 group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_atan2_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_atan2_q15.c new file mode 100644 index 0000000..c334bee --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_atan2_q15.c @@ -0,0 +1,239 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_atan2_q15.c + * Description: float32 Arc tangent of y/x + * + * $Date: 22 April 2022 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/utils.h" + +/* + +atan for argument between in [0, 1.0] + +*/ + + +/* Q2.13 */ +#define ATANHALFQ13 0xed6 +#define PIHALFQ13 0x3244 +#define PIQ13 0x6488 + +#define ATAN2_NB_COEFS_Q15 10 + +static const q15_t atan2_coefs_q15[ATAN2_NB_COEFS_Q15]={0x0000 +,0x7fff +,0xffff +,0xd567 +,0xff70 +,0x1bad +,0xfd58 +,0xe9a9 +,0x1129 +,0xfbdb +}; + +__STATIC_FORCEINLINE q15_t arm_atan_limited_q15(q15_t x) +{ + q31_t res=(q31_t)atan2_coefs_q15[ATAN2_NB_COEFS_Q15-1]; + int i=1; + for(i=1;i> 15U; + res = res + ((q31_t) atan2_coefs_q15[ATAN2_NB_COEFS_Q15-1-i]) ; + } + + res = __SSAT(res>>2,16); + + + return(res); +} + + +__STATIC_FORCEINLINE q15_t arm_atan_q15(q15_t y,q15_t x) +{ + int sign=0; + q15_t res=0; + + if (y<0) + { + /* Negate y */ +#if defined (ARM_MATH_DSP) + y = __QSUB16(0, y); +#else + y = (y == (q15_t) 0x8000) ? (q15_t) 0x7fff : -y; +#endif + + sign=1-sign; + } + + if (x < 0) + { + sign=1 - sign; + + /* Negate x */ +#if defined (ARM_MATH_DSP) + x = __QSUB16(0, x); +#else + x = (x == (q15_t) 0x8000) ? (q15_t) 0x7fff : -x; +#endif + } + + if (y > x) + { + q15_t ratio; + int16_t shift; + + arm_divide_q15(x,y,&ratio,&shift); + + /* Shift ratio by shift */ + if (shift >=0) + { + ratio = __SSAT(((q31_t) ratio << shift), 16); + } + else + { + ratio = (ratio >> -shift); + } + + res = PIHALFQ13 - arm_atan_limited_q15(ratio); + + } + else + { + q15_t ratio; + int16_t shift; + + arm_divide_q15(y,x,&ratio,&shift); + + /* Shift ratio by shift */ + if (shift >=0) + { + ratio = __SSAT(((q31_t) ratio << shift), 16); + } + else + { + ratio = (ratio >> -shift); + } + + + res = arm_atan_limited_q15(ratio); + + } + + + if (sign) + { + /* Negate res */ +#if defined (ARM_MATH_DSP) + res = __QSUB16(0, res); +#else + res = (res == (q15_t) 0x8000) ? (q15_t) 0x7fff : -res; +#endif + } + + return(res); +} + + +/** + @ingroup groupFastMath + */ + + +/** + @addtogroup atan2 + @{ + */ + +/** + @brief Arc Tangent of y/x using sign of y and x to get right quadrant + @param[in] y y coordinate + @param[in] x x coordinate + @param[out] result Result in Q2.13 + @return error status. + + @par Compute the Arc tangent of y/x: + The sign of y and x are used to determine the right quadrant + and compute the right angle. +*/ + + +arm_status arm_atan2_q15(q15_t y,q15_t x,q15_t *result) +{ + if (x > 0) + { + *result=arm_atan_q15(y,x); + return(ARM_MATH_SUCCESS); + } + if (x < 0) + { + if (y > 0) + { + *result=arm_atan_q15(y,x) + PIQ13; + } + else if (y < 0) + { + *result=arm_atan_q15(y,x) - PIQ13; + } + else + { + if (y<0) + { + *result= -PIQ13; + } + else + { + *result= PIQ13; + } + } + return(ARM_MATH_SUCCESS); + } + if (x == 0) + { + if (y > 0) + { + *result=PIHALFQ13; + return(ARM_MATH_SUCCESS); + } + if (y < 0) + { + *result=-PIHALFQ13; + return(ARM_MATH_SUCCESS); + } + } + + + return(ARM_MATH_NANINF); + +} + +/** + @} end of atan2 group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_atan2_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_atan2_q31.c new file mode 100644 index 0000000..6eba0ce --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_atan2_q31.c @@ -0,0 +1,240 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_atan2_q31.c + * Description: float32 Arc tangent of y/x + * + * $Date: 22 April 2022 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/utils.h" + +/* + +atan for argument between in [0, 1.0] + +*/ + + +/* Q2.29 */ +#define ATANHALF_Q29 0xed63383 +#define PIHALF_Q29 0x3243f6a9 +#define PIQ29 0x6487ed51 + +#define ATAN2_NB_COEFS_Q31 13 + +static const q31_t atan2_coefs_q31[ATAN2_NB_COEFS_Q31]={0x00000000 +,0x7ffffffe +,0x000001b6 +,0xd555158e +,0x00036463 +,0x1985f617 +,0x001992ae +,0xeed53a7f +,0xf8f15245 +,0x2215a3a4 +,0xe0fab004 +,0x0cdd4825 +,0xfddbc054 +}; + + +__STATIC_FORCEINLINE q31_t arm_atan_limited_q31(q31_t x) +{ + q63_t res=(q63_t)atan2_coefs_q31[ATAN2_NB_COEFS_Q31-1]; + int i=1; + for(i=1;i> 31U; + res = res + ((q63_t) atan2_coefs_q31[ATAN2_NB_COEFS_Q31-1-i]) ; + } + + return(clip_q63_to_q31(res>>2)); +} + + +__STATIC_FORCEINLINE q31_t arm_atan_q31(q31_t y,q31_t x) +{ + int sign=0; + q31_t res=0; + + if (y<0) + { + /* Negate y */ +#if defined (ARM_MATH_DSP) + y = __QSUB(0, y); +#else + y = (y == INT32_MIN) ? INT32_MAX : -y; +#endif + + sign=1-sign; + } + + if (x < 0) + { + sign=1 - sign; + + /* Negate x */ +#if defined (ARM_MATH_DSP) + x = __QSUB(0, x); +#else + x = (x == INT32_MIN) ? INT32_MAX : -x; +#endif + } + + if (y > x) + { + q31_t ratio; + int16_t shift; + + arm_divide_q31(x,y,&ratio,&shift); + + /* Shift ratio by shift */ + if (shift >= 0) + { + ratio = clip_q63_to_q31((q63_t) ratio << shift); + } + else + { + ratio = (ratio >> -shift); + } + + res = PIHALF_Q29 - arm_atan_limited_q31(ratio); + + } + else + { + q31_t ratio; + int16_t shift; + + arm_divide_q31(y,x,&ratio,&shift); + + /* Shift ratio by shift */ + if (shift >= 0) + { + ratio = clip_q63_to_q31((q63_t) ratio << shift); + } + else + { + ratio = (ratio >> -shift); + } + + + res = arm_atan_limited_q31(ratio); + + } + + + if (sign) + { + /* Negate res */ +#if defined (ARM_MATH_DSP) + res = __QSUB(0, res); +#else + res = (res == INT32_MIN) ? INT32_MAX : -res; +#endif + } + + return(res); +} + + +/** + @ingroup groupFastMath + */ + + +/** + @addtogroup atan2 + @{ + */ + +/** + @brief Arc Tangent of y/x using sign of y and x to get right quadrant + @param[in] y y coordinate + @param[in] x x coordinate + @param[out] result Result in Q2.29 + @return error status. + + @par Compute the Arc tangent of y/x: + The sign of y and x are used to determine the right quadrant + and compute the right angle. +*/ + + +arm_status arm_atan2_q31(q31_t y,q31_t x,q31_t *result) +{ + if (x > 0) + { + *result=arm_atan_q31(y,x); + return(ARM_MATH_SUCCESS); + } + if (x < 0) + { + if (y > 0) + { + *result=arm_atan_q31(y,x) + PIQ29; + } + else if (y < 0) + { + *result=arm_atan_q31(y,x) - PIQ29; + } + else + { + if (y<0) + { + *result= -PIQ29; + } + else + { + *result= PIQ29; + } + } + return(ARM_MATH_SUCCESS); + } + if (x == 0) + { + if (y > 0) + { + *result=PIHALF_Q29; + return(ARM_MATH_SUCCESS); + } + if (y < 0) + { + *result=-PIHALF_Q29; + return(ARM_MATH_SUCCESS); + } + } + + + return(ARM_MATH_NANINF); + +} + +/** + @} end of atan2 group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_cos_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_cos_f32.c index ff7f0a2..ac428dc 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_cos_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_cos_f32.c @@ -5,13 +5,13 @@ * Title: arm_cos_f32.c * Description: Fast cosine calculation for floating-point values * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_cos_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_cos_q15.c index ea995fd..c423b06 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_cos_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_cos_q15.c @@ -5,13 +5,13 @@ * Title: arm_cos_q15.c * Description: Fast cosine calculation for Q15 values * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_cos_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_cos_q31.c index ab02d2b..749dd0e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_cos_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_cos_q31.c @@ -5,13 +5,13 @@ * Title: arm_cos_q31.c * Description: Fast cosine calculation for Q31 values * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_divide_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_divide_q15.c new file mode 100644 index 0000000..c53a379 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_divide_q15.c @@ -0,0 +1,114 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_cos_q15.c + * Description: Fast cosine calculation for Q15 values + * + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables.h" + +#include + +/** + @ingroup groupFastMath + */ + +/** + @defgroup divide Fixed point division + + */ + +/** + @addtogroup divide + @{ + */ + +/** + @brief Fixed point division + @param[in] numerator Numerator + @param[in] denominator Denominator + @param[out] quotient Quotient value normalized between -1.0 and 1.0 + @param[out] shift Shift left value to get the unnormalized quotient + @return error status + + When dividing by 0, an error ARM_MATH_NANINF is returned. And the quotient is forced + to the saturated negative or positive value. + */ + +arm_status arm_divide_q15(q15_t numerator, + q15_t denominator, + q15_t *quotient, + int16_t *shift) +{ + int16_t sign=0; + q31_t temp; + int16_t shiftForNormalizing; + + *shift = 0; + + sign = (numerator>>15) ^ (denominator>>15); + + if (denominator == 0) + { + if (sign) + { + *quotient = 0x8000; + } + else + { + *quotient = 0x7FFF; + } + return(ARM_MATH_NANINF); + } + + arm_abs_q15(&numerator,&numerator,1); + arm_abs_q15(&denominator,&denominator,1); + + temp = ((q31_t)numerator << 15) / ((q31_t)denominator); + + shiftForNormalizing= 17 - __CLZ(temp); + if (shiftForNormalizing > 0) + { + *shift = shiftForNormalizing; + temp = temp >> shiftForNormalizing; + } + + if (sign) + { + temp = -temp; + } + + *quotient=temp; + + return(ARM_MATH_SUCCESS); +} + +/** + @} end of divide group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_divide_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_divide_q31.c new file mode 100644 index 0000000..b1ae866 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_divide_q31.c @@ -0,0 +1,109 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_cos_q31.c + * Description: Fast cosine calculation for Q31 values + * + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables.h" + +#include + +/** + @ingroup groupFastMath + */ + +/** + @addtogroup divide + @{ + */ + +/** + @brief Fixed point division + @param[in] numerator Numerator + @param[in] denominator Denominator + @param[out] quotient Quotient value normalized between -1.0 and 1.0 + @param[out] shift Shift left value to get the unnormalized quotient + @return error status + + When dividing by 0, an error ARM_MATH_NANINF is returned. And the quotient is forced + to the saturated negative or positive value. + */ + +arm_status arm_divide_q31(q31_t numerator, + q31_t denominator, + q31_t *quotient, + int16_t *shift) +{ + int16_t sign=0; + q63_t temp; + int16_t shiftForNormalizing; + + *shift = 0; + + sign = (numerator>>31) ^ (denominator>>31); + + if (denominator == 0) + { + if (sign) + { + *quotient = 0x80000000; + } + else + { + *quotient = 0x7FFFFFFF; + } + return(ARM_MATH_NANINF); + } + + arm_abs_q31(&numerator,&numerator,1); + arm_abs_q31(&denominator,&denominator,1); + + temp = ((q63_t)numerator << 31) / ((q63_t)denominator); + + shiftForNormalizing= 32 - __CLZ(temp >> 31); + if (shiftForNormalizing > 0) + { + *shift = shiftForNormalizing; + temp = temp >> shiftForNormalizing; + } + + if (sign) + { + temp = -temp; + } + + *quotient=(q31_t)temp; + + return(ARM_MATH_SUCCESS); +} + +/** + @} end of divide group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sin_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sin_f32.c index 08d326d..89cc8b1 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sin_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sin_f32.c @@ -5,13 +5,13 @@ * Title: arm_sin_f32.c * Description: Fast sine calculation for floating-point values * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sin_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sin_q15.c index 439b33a..7d99d9f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sin_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sin_q15.c @@ -5,13 +5,13 @@ * Title: arm_sin_q15.c * Description: Fast sine calculation for Q15 values * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sin_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sin_q31.c index 01d9c6c..92f2ba6 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sin_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sin_q31.c @@ -5,13 +5,13 @@ * Title: arm_sin_q31.c * Description: Fast sine calculation for Q31 values * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sqrt_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sqrt_q15.c index e499f2b..bfcb9b2 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sqrt_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sqrt_q15.c @@ -5,13 +5,13 @@ * Title: arm_sqrt_q15.c * Description: Q15 square root function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -31,6 +31,8 @@ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables.h" +#define Q12QUARTER 0x2000 + /** @ingroup groupFastMath */ @@ -53,14 +55,7 @@ arm_status arm_sqrt_q15( q15_t in, q15_t * pOut) { - q31_t bits_val1; - q15_t number, temp1, var1, signBits1, half; - float32_t temp_float1; - union - { - q31_t fracval; - float32_t floatval; - } tempconv; + q15_t number, var1, signBits1,temp; number = in; @@ -78,46 +73,30 @@ arm_status arm_sqrt_q15( { number = number << (signBits1 - 1); } + /* Start value for 1/sqrt(x) for the Newton iteration */ + var1 = sqrt_initial_lut_q15[(number>> 11) - (Q12QUARTER >> 11)]; - /* Calculate half value of the number */ - half = number >> 1; - /* Store the number for later use */ - temp1 = number; - - /* Convert to float */ - temp_float1 = number * 3.051757812500000e-005f; - /* Store as integer */ - tempconv.floatval = temp_float1; - bits_val1 = tempconv.fracval; - /* Subtract the shifted value from the magic number to give intial guess */ - bits_val1 = 0x5f3759df - (bits_val1 >> 1); /* gives initial guess */ - /* Store as float */ - tempconv.fracval = bits_val1; - temp_float1 = tempconv.floatval; - /* Convert to integer format */ - var1 = (q31_t) (temp_float1 * 16384); - + /* 0.5 var1 * (3 - number * var1 * var1) */ /* 1st iteration */ - var1 = ((q15_t) ((q31_t) var1 * (0x3000 - - ((q15_t) - ((((q15_t) - (((q31_t) var1 * var1) >> 15)) * - (q31_t) half) >> 15))) >> 15)) << 2; - /* 2nd iteration */ - var1 = ((q15_t) ((q31_t) var1 * (0x3000 - - ((q15_t) - ((((q15_t) - (((q31_t) var1 * var1) >> 15)) * - (q31_t) half) >> 15))) >> 15)) << 2; - /* 3rd iteration */ - var1 = ((q15_t) ((q31_t) var1 * (0x3000 - - ((q15_t) - ((((q15_t) - (((q31_t) var1 * var1) >> 15)) * - (q31_t) half) >> 15))) >> 15)) << 2; + + temp = ((q31_t) var1 * var1) >> 12; + temp = ((q31_t) number * temp) >> 15; + temp = 0x3000 - temp; + var1 = ((q31_t) var1 * temp) >> 13; + + temp = ((q31_t) var1 * var1) >> 12; + temp = ((q31_t) number * temp) >> 15; + temp = 0x3000 - temp; + var1 = ((q31_t) var1 * temp) >> 13; + + temp = ((q31_t) var1 * var1) >> 12; + temp = ((q31_t) number * temp) >> 15; + temp = 0x3000 - temp; + var1 = ((q31_t) var1 * temp) >> 13; /* Multiply the inverse square root with the original value */ - var1 = ((q15_t) (((q31_t) temp1 * var1) >> 15)) << 1; + + var1 = ((q15_t) (((q31_t) number * var1) >> 12)); /* Shift the output down accordingly */ if ((signBits1 % 2) == 0) @@ -130,6 +109,7 @@ arm_status arm_sqrt_q15( } *pOut = var1; + return (ARM_MATH_SUCCESS); } /* If the number is a negative number then store zero as its square root value */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sqrt_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sqrt_q31.c index 0dbb6af..0b8954a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sqrt_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_sqrt_q31.c @@ -5,13 +5,13 @@ * Title: arm_sqrt_q31.c * Description: Q31 square root function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -31,6 +31,8 @@ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables.h" +#define Q28QUARTER 0x20000000 + /** @ingroup groupFastMath */ @@ -53,15 +55,8 @@ arm_status arm_sqrt_q31( q31_t in, q31_t * pOut) { - q31_t bits_val1; - q31_t number, temp1, var1, signBits1, half; - float32_t temp_float1; - union - { - q31_t fracval; - float32_t floatval; - } tempconv; - + q31_t number, var1, signBits1 ,temp; + number = in; /* If the input is a positive number then compute the signBits. */ @@ -79,45 +74,33 @@ arm_status arm_sqrt_q31( number = number << (signBits1 - 1); } - /* Calculate half value of the number */ - half = number >> 1; - /* Store the number for later use */ - temp1 = number; - - /* Convert to float */ - temp_float1 = number * 4.6566128731e-010f; - /* Store as integer */ - tempconv.floatval = temp_float1; - bits_val1 = tempconv.fracval; - /* Subtract the shifted value from the magic number to give intial guess */ - bits_val1 = 0x5f3759df - (bits_val1 >> 1); /* gives initial guess */ - /* Store as float */ - tempconv.fracval = bits_val1; - temp_float1 = tempconv.floatval; - /* Convert to integer format */ - var1 = (q31_t) (temp_float1 * 1073741824); + /* Start value for 1/sqrt(x) for the Newton iteration */ + var1 = sqrt_initial_lut_q31[(number>> 26) - (Q28QUARTER >> 26)]; + + /* 0.5 var1 * (3 - number * var1 * var1) */ /* 1st iteration */ - var1 = ((q31_t) ((q63_t) var1 * (0x30000000 - - ((q31_t) - ((((q31_t) - (((q63_t) var1 * var1) >> 31)) * - (q63_t) half) >> 31))) >> 31)) << 2; + + temp = ((q63_t) var1 * var1) >> 28; + temp = ((q63_t) number * temp) >> 31; + temp = 0x30000000 - temp; + var1 = ((q63_t) var1 * temp) >> 29; + + /* 2nd iteration */ - var1 = ((q31_t) ((q63_t) var1 * (0x30000000 - - ((q31_t) - ((((q31_t) - (((q63_t) var1 * var1) >> 31)) * - (q63_t) half) >> 31))) >> 31)) << 2; - /* 3rd iteration */ - var1 = ((q31_t) ((q63_t) var1 * (0x30000000 - - ((q31_t) - ((((q31_t) - (((q63_t) var1 * var1) >> 31)) * - (q63_t) half) >> 31))) >> 31)) << 2; + temp = ((q63_t) var1 * var1) >> 28; + temp = ((q63_t) number * temp) >> 31; + temp = 0x30000000 - temp; + var1 = ((q63_t) var1 * temp) >> 29; + + /* 3nd iteration */ + temp = ((q63_t) var1 * var1) >> 28; + temp = ((q63_t) number * temp) >> 31; + temp = 0x30000000 - temp; + var1 = ((q63_t) var1 * temp) >> 29; /* Multiply the inverse square root with the original value */ - var1 = ((q31_t) (((q63_t) temp1 * var1) >> 31)) << 1; + var1 = ((q31_t) (((q63_t) number * var1) >> 28)); /* Shift the output down accordingly */ if ((signBits1 % 2) == 0) diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vexp_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vexp_f16.c index 02864e5..dffb4de 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vexp_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vexp_f16.c @@ -5,13 +5,13 @@ * Title: arm_vlog_f16.c * Description: Fast vectorized log * - * $Date: 15. Octoboer 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -36,7 +36,18 @@ #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_math_f16.h" +/** + @addtogroup vexp + @{ + */ +/** + @brief Floating-point vector of exp values. + @param[in] pSrc points to the input vector + @param[out] pDst points to the output vector + @param[in] blockSize number of samples in each vector + @return none + */ void arm_vexp_f16( const float16_t * pSrc, float16_t * pDst, @@ -73,7 +84,7 @@ void arm_vexp_f16( /* C = log(A) */ /* Calculate log and store result in destination buffer. */ - *pDst++ = expf(*pSrc++); + *pDst++ = (_Float16)expf((float32_t)*pSrc++); /* Decrement loop counter */ blkCnt--; @@ -82,5 +93,7 @@ void arm_vexp_f16( #endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ - +/** + @} end of vexp group + */ #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vexp_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vexp_f32.c index cde8efe..3f23825 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vexp_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vexp_f32.c @@ -5,13 +5,13 @@ * Title: arm_vlog_f32.c * Description: Fast vectorized log * - * $Date: 15. Octoboer 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -35,6 +35,28 @@ #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_math.h" #endif +/** + @ingroup groupFastMath + */ + +/** + @defgroup vexp Vector Exponential + + Compute the exp values of a vector of samples. +*/ + +/** + @addtogroup vexp + @{ + */ + +/** + @brief Floating-point vector of exp values. + @param[in] pSrc points to the input vector + @param[out] pDst points to the output vector + @param[in] blockSize number of samples in each vector + @return none + */ void arm_vexp_f32( const float32_t * pSrc, float32_t * pDst, @@ -98,4 +120,7 @@ void arm_vexp_f32( } } +/** + @} end of vexp group + */ #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vexp_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vexp_f64.c new file mode 100644 index 0000000..950c0a5 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vexp_f64.c @@ -0,0 +1,70 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_vlog_f64.c + * Description: Fast vectorized log + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables.h" + +/** + @addtogroup vexp + @{ + */ + +/** + @brief Floating-point vector of exp values. + @param[in] pSrc points to the input vector + @param[out] pDst points to the output vector + @param[in] blockSize number of samples in each vector + @return none + */ +void arm_vexp_f64( + const float64_t * pSrc, + float64_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; + + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = log(A) */ + + /* Calculate log and store result in destination buffer. */ + *pDst++ = exp(*pSrc++); + + /* Decrement loop counter */ + blkCnt--; + } +} + +/** + @} end of vexp group + */ +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vinverse_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vinverse_f16.c index 11f0e8d..ec9e842 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vinverse_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vinverse_f16.c @@ -5,13 +5,13 @@ * Title: arm_vinverse_f16.c * Description: Fast vectorized inverse * - * $Date: 15. Octoboer 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -70,7 +70,7 @@ void arm_vinverse_f16( while (blkCnt > 0U) { - *pDst++ = 1.0 / *pSrc++; + *pDst++ = 1.0f16 / (_Float16)*pSrc++; /* Decrement loop counter */ blkCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_f16.c index b05f8e6..60b4af3 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_f16.c @@ -5,13 +5,13 @@ * Title: arm_vlog_f16.c * Description: Fast vectorized log * - * $Date: 15. Octoboer 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -29,21 +29,157 @@ */ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions_f16.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/support_functions_f16.h" #if defined(ARM_FLOAT16_SUPPORTED) +/* Degree of the polynomial approximation */ +#define NB_DEG_LOGF16 3 + +/* +Related to the Log2 of the number of approximations. +For instance, with 3 there are 1 + 2^3 polynomials +*/ +#define NB_DIV_LOGF16 3 + +/* Length of the LUT table */ +#define NB_LUT_LOGF16 (NB_DEG_LOGF16+1)*(1 + (1< 1000][[2, 1]], {i, 1, 2, (1.0/2^nb)}]; +coefs = Chop@Flatten[CoefficientList[lut, x]]; + +*/ +static float16_t lut_logf16[NB_LUT_LOGF16]={ + 0,0.125,-0.00781197,0.00063974,0.117783, + 0.111111,-0.00617212,0.000447935,0.223144, + 0.1,-0.00499952,0.000327193,0.318454,0.0909091, + -0.00413191,0.000246234,0.405465,0.0833333, + -0.00347199,0.000189928,0.485508,0.0769231, + -0.00295841,0.00014956,0.559616,0.0714286, + -0.0025509,0.000119868,0.628609,0.0666667, + -0.00222213,0.0000975436,0.693147, + 0.0625,-0.00195305,0.0000804357}; + + +float16_t logf16_scalar(float16_t x) +{ + int16_t i = arm_typecast_s16_f16(x); + + int32_t vecExpUnBiased = (i >> 10) - 15; + i = i - (vecExpUnBiased << 10); + float16_t vecTmpFlt1 = arm_typecast_f16_s16(i); + + float16_t *lut; + int n; + float16_t tmp,v; + + tmp = ((_Float16)vecTmpFlt1 - 1.0f16) * (1 << NB_DIV_LOGF16); + n = (int)floor((double)tmp); + v = (_Float16)tmp - (_Float16)n; + + lut = lut_logf16 + n * (1+NB_DEG_LOGF16); + + float16_t res = lut[NB_DEG_LOGF16-1]; + for(int j=NB_DEG_LOGF16-2; j >=0 ; j--) + { + res = (_Float16)lut[j] + (_Float16)v * (_Float16)res; + } + + res = (_Float16)res + 0.693147f16 * (_Float16)vecExpUnBiased; + + + return(res); +} + +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) + #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables.h" #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_math_f16.h" + +float16x8_t vlogq_lut_f16(float16x8_t vecIn) +{ + int16x8_t i = vreinterpretq_s16_f16(vecIn); + + int16x8_t vecExpUnBiased = vsubq_n_s16(vshrq_n_s16(i,10), 15); + i = vsubq_s16(i,vshlq_n_s16(vecExpUnBiased,10)); + float16x8_t vecTmpFlt1 = vreinterpretq_f16_s16(i); + + + float16x8_t lutV; + int16x8_t n; + int16x8_t offset; + + float16x8_t tmp,v,res; + + tmp = vmulq_n_f16(vsubq_n_f16(vecTmpFlt1,1.0f16),(_Float16)(1 << NB_DIV_LOGF16)); + + n = vcvtq_s16_f16(tmp); + v = vsubq_f16(tmp,vcvtq_f16_s16(n)); + + + offset = vmulq_n_s16(n,(1+NB_DEG_LOGF16)); + offset = vaddq_n_s16(offset,NB_DEG_LOGF16-1); + + res = vldrhq_gather_shifted_offset_f16(lut_logf16,(uint16x8_t)offset); + offset = vsubq_n_s16(offset,1); + + for(int j=NB_DEG_LOGF16-2; j >=0 ; j--) + { + lutV = vldrhq_gather_shifted_offset_f16(lut_logf16,(uint16x8_t)offset); + res = vfmaq_f16(lutV,v,res); + offset = vsubq_n_s16(offset,1); + + } + + res = vfmaq_n_f16(res,vcvtq_f16_s16(vecExpUnBiased),0.693147f16); + + + return(res); + +} + +#endif + +/** + @ingroup groupFastMath + */ + +/** + @addtogroup vlog + @{ + */ + +/** + @brief Floating-point vector of log values. + @param[in] pSrc points to the input vector + @param[out] pDst points to the output vector + @param[in] blockSize number of samples in each vector + @return none + */ + + void arm_vlog_f16( const float16_t * pSrc, float16_t * pDst, uint32_t blockSize) { - uint32_t blkCnt; + uint32_t blkCnt; #if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) - f16x8_t src; f16x8_t dst; @@ -52,7 +188,7 @@ void arm_vlog_f16( while (blkCnt > 0U) { src = vld1q(pSrc); - dst = vlogq_f16(src); + dst = vlogq_lut_f16(src); vst1q(pDst, dst); pSrc += 8; @@ -69,16 +205,22 @@ void arm_vlog_f16( while (blkCnt > 0U) { /* C = log(A) */ - + /* Calculate log and store result in destination buffer. */ - *pDst++ = logf(*pSrc++); - + *pDst++ = logf16_scalar(*pSrc++); + /* Decrement loop counter */ blkCnt--; } } -#endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ +/** + @} end of vlog group + */ + + +#endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_f32.c index 5e92635..7c59553 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_f32.c @@ -5,13 +5,13 @@ * Title: arm_vlog_f32.c * Description: Fast vectorized log * - * $Date: 15. Octoboer 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -31,6 +31,24 @@ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables.h" + +/** + @ingroup groupFastMath + */ + + +/** + @defgroup vlog Vector Log + + Compute the log values of a vector of samples. + + */ + +/** + @addtogroup vlog + @{ + */ + #if (defined(ARM_MATH_MVEF) || defined(ARM_MATH_HELIUM) || defined(ARM_MATH_NEON) || defined(ARM_MATH_NEON_EXPERIMENTAL)) && !defined(ARM_MATH_AUTOVECTORIZE) #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_math.h" #endif @@ -98,4 +116,8 @@ void arm_vlog_f32( } } +/** + @} end of vlog group + */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_f64.c new file mode 100644 index 0000000..fae58bb --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_f64.c @@ -0,0 +1,55 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_vlog_f64.c + * Description: Fast vectorized log + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables.h" + +void arm_vlog_f64( + const float64_t * pSrc, + float64_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; + + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = log(A) */ + + /* Calculate log and store result in destination buffer. */ + *pDst++ = log(*pSrc++); + + /* Decrement loop counter */ + blkCnt--; + } +} + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_q15.c new file mode 100644 index 0000000..15d332e --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_q15.c @@ -0,0 +1,268 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_vlog_q15 + * Description: Q15 vector log + * + * $Date: 19 July 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" + + +#define LOG_Q15_ACCURACY 15 + +/* Bit to represent the normalization factor + It is Ceiling[Log2[LOG_Q15_ACCURACY]] of the previous value. + The Log2 algorithm is assuming that the value x is + 1 <= x < 2. + + But input value could be as small a 2^-LOG_Q15_ACCURACY + which would give an integer part of -15. +*/ +#define LOG_Q15_INTEGER_PART 4 + +/* 2.0 in q14 */ +#define LOQ_Q15_THRESHOLD (1u << LOG_Q15_ACCURACY) + +/* HALF */ +#define LOQ_Q15_Q16_HALF LOQ_Q15_THRESHOLD +#define LOQ_Q15_Q14_HALF (LOQ_Q15_Q16_HALF >> 2) + + +/* 1.0 / Log2[Exp[1]] in q15 */ +#define LOG_Q15_INVLOG2EXP 0x58b9u + + +/* Clay Turner algorithm */ +static uint16_t arm_scalar_log_q15(uint16_t src) +{ + int i; + + int16_t c = __CLZ(src)-16; + int16_t normalization=0; + + /* 0.5 in q11 */ + uint16_t inc = LOQ_Q15_Q16_HALF >> (LOG_Q15_INTEGER_PART + 1); + + /* Will compute y = log2(x) for 1 <= x < 2.0 */ + uint16_t x; + + /* q11 */ + uint16_t y=0; + + /* q11 */ + int16_t tmp; + + + /* Normalize and convert to q14 format */ + x = src; + if ((c-1) < 0) + { + x = x >> (1-c); + } + else + { + x = x << (c-1); + } + normalization = c; + + + + /* Compute the Log2. Result is in q11 instead of q16 + because we know 0 <= y < 1.0 but + we want a result allowing to do a + product on int16 rather than having to go + through int32 + */ + for(i = 0; i < LOG_Q15_ACCURACY ; i++) + { + x = (((int32_t)x*x)) >> (LOG_Q15_ACCURACY - 1); + + if (x >= LOQ_Q15_THRESHOLD) + { + y += inc ; + x = x >> 1; + } + inc = inc >> 1; + } + + + /* + Convert the Log2 to Log and apply normalization. + We compute (y - normalisation) * (1 / Log2[e]). + + */ + + /* q11 */ + //tmp = y - ((int32_t)normalization << (LOG_Q15_ACCURACY + 1)); + tmp = (int16_t)y - (normalization << (LOG_Q15_ACCURACY - LOG_Q15_INTEGER_PART)); + + /* q4.11 */ + y = ((int32_t)tmp * LOG_Q15_INVLOG2EXP) >> 15; + + return(y); + +} + +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + + +q15x8_t vlogq_q15(q15x8_t src) +{ + + int i; + + int16x8_t c = vclzq_s16(src); + int16x8_t normalization = c; + + + /* 0.5 in q11 */ + uint16_t inc = LOQ_Q15_Q16_HALF >> (LOG_Q15_INTEGER_PART + 1); + + /* Will compute y = log2(x) for 1 <= x < 2.0 */ + uint16x8_t x; + + + /* q11 */ + uint16x8_t y = vdupq_n_u16(0); + + + /* q11 */ + int16x8_t vtmp; + + + mve_pred16_t p; + + /* Normalize and convert to q14 format */ + + + vtmp = vsubq_n_s16(c,1); + x = vshlq_u16((uint16x8_t)src,vtmp); + + + /* Compute the Log2. Result is in q11 instead of q16 + because we know 0 <= y < 1.0 but + we want a result allowing to do a + product on int16 rather than having to go + through int32 + */ + for(i = 0; i < LOG_Q15_ACCURACY ; i++) + { + x = vmulhq_u16(x,x); + x = vshlq_n_u16(x,2); + + + p = vcmphiq_u16(x,vdupq_n_u16(LOQ_Q15_THRESHOLD)); + y = vaddq_m_n_u16(y, y,inc,p); + x = vshrq_m_n_u16(x,x,1,p); + + inc = inc >> 1; + } + + + /* + Convert the Log2 to Log and apply normalization. + We compute (y - normalisation) * (1 / Log2[e]). + + */ + + /* q11 */ + // tmp = (int16_t)y - (normalization << (LOG_Q15_ACCURACY - LOG_Q15_INTEGER_PART)); + vtmp = vshlq_n_s16(normalization,LOG_Q15_ACCURACY - LOG_Q15_INTEGER_PART); + vtmp = vsubq_s16((int16x8_t)y,vtmp); + + + + /* q4.11 */ + // y = ((int32_t)tmp * LOG_Q15_INVLOG2EXP) >> 15; + vtmp = vqdmulhq_n_s16(vtmp,LOG_Q15_INVLOG2EXP); + + return(vtmp); +} +#endif + +/** + @ingroup groupFastMath + */ + +/** + @addtogroup vlog + @{ + */ + +/** + @brief q15 vector of log values. + @param[in] pSrc points to the input vector in q15 + @param[out] pDst points to the output vector in q4.11 + @param[in] blockSize number of samples in each vector + @return none + + */ + +void arm_vlog_q15( + const q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; /* loop counters */ + + #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + q15x8_t src; + q15x8_t dst; + + blkCnt = blockSize >> 3; + + while (blkCnt > 0U) + { + src = vld1q(pSrc); + dst = vlogq_q15(src); + vst1q(pDst, dst); + + pSrc += 8; + pDst += 8; + /* Decrement loop counter */ + blkCnt--; + } + + blkCnt = blockSize & 7; + #else + blkCnt = blockSize; + #endif + + while (blkCnt > 0U) + { + *pDst++ = arm_scalar_log_q15(*pSrc++); + + /* Decrement loop counter */ + blkCnt--; + } +} + +/** + @} end of vlog group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_q31.c new file mode 100644 index 0000000..5be5b72 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FastMathFunctions/arm_vlog_q31.c @@ -0,0 +1,262 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_vlog_q31 + * Description: Q31 vector log + * + * $Date: 19 July 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" + +#define LOG_Q31_ACCURACY 31 + +/* Bit to represent the normalization factor + It is Ceiling[Log2[LOG_Q31_ACCURACY]] of the previous value. + The Log2 algorithm is assuming that the value x is + 1 <= x < 2. + + But input value could be as small a 2^-LOG_Q31_ACCURACY + which would give an integer part of -31. +*/ +#define LOG_Q31_INTEGER_PART 5 + +/* 2.0 in Q30 */ +#define LOQ_Q31_THRESHOLD (1u << LOG_Q31_ACCURACY) + +/* HALF */ +#define LOQ_Q31_Q32_HALF LOQ_Q31_THRESHOLD +#define LOQ_Q31_Q30_HALF (LOQ_Q31_Q32_HALF >> 2) + + +/* 1.0 / Log2[Exp[1]] in Q31 */ +#define LOG_Q31_INVLOG2EXP 0x58b90bfbuL + +/* Clay Turner algorithm */ +static uint32_t arm_scalar_log_q31(uint32_t src) +{ + int32_t i; + + int32_t c = __CLZ(src); + int32_t normalization=0; + + /* 0.5 in q26 */ + uint32_t inc = LOQ_Q31_Q32_HALF >> (LOG_Q31_INTEGER_PART + 1); + + /* Will compute y = log2(x) for 1 <= x < 2.0 */ + uint32_t x; + + /* q26 */ + uint32_t y=0; + + /* q26 */ + int32_t tmp; + + + /* Normalize and convert to q30 format */ + x = src; + if ((c-1) < 0) + { + x = x >> (1-c); + } + else + { + x = x << (c-1); + } + normalization = c; + + /* Compute the Log2. Result is in q26 + because we know 0 <= y < 1.0 but + do not want to use q32 to allow + following computation with less instructions. + */ + for(i = 0; i < LOG_Q31_ACCURACY ; i++) + { + x = ((int64_t)x*x) >> (LOG_Q31_ACCURACY - 1); + + if (x >= LOQ_Q31_THRESHOLD) + { + y += inc ; + x = x >> 1; + } + inc = inc >> 1; + } + + /* + Convert the Log2 to Log and apply normalization. + We compute (y - normalisation) * (1 / Log2[e]). + + */ + + /* q26 */ + tmp = (int32_t)y - (normalization << (LOG_Q31_ACCURACY - LOG_Q31_INTEGER_PART)); + + + /* q5.26 */ + y = ((int64_t)tmp * LOG_Q31_INVLOG2EXP) >> 31; + + + + return(y); + +} + +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + + +q31x4_t vlogq_q31(q31x4_t src) +{ + + int32_t i; + + int32x4_t c = vclzq_s32(src); + int32x4_t normalization = c; + + + /* 0.5 in q11 */ + uint32_t inc = LOQ_Q31_Q32_HALF >> (LOG_Q31_INTEGER_PART + 1); + + /* Will compute y = log2(x) for 1 <= x < 2.0 */ + uint32x4_t x; + + + /* q11 */ + uint32x4_t y = vdupq_n_u32(0); + + + /* q11 */ + int32x4_t vtmp; + + + mve_pred16_t p; + + /* Normalize and convert to q14 format */ + + + vtmp = vsubq_n_s32(c,1); + x = vshlq_u32((uint32x4_t)src,vtmp); + + + /* Compute the Log2. Result is in Q26 + because we know 0 <= y < 1.0 but + do not want to use Q32 to allow + following computation with less instructions. + */ + for(i = 0; i < LOG_Q31_ACCURACY ; i++) + { + x = vmulhq_u32(x,x); + x = vshlq_n_u32(x,2); + + + p = vcmphiq_u32(x,vdupq_n_u32(LOQ_Q31_THRESHOLD)); + y = vaddq_m_n_u32(y, y,inc,p); + x = vshrq_m_n_u32(x,x,1,p); + + inc = inc >> 1; + } + + + /* + Convert the Log2 to Log and apply normalization. + We compute (y - normalisation) * (1 / Log2[e]). + + */ + + /* q11 */ + // tmp = (int16_t)y - (normalization << (LOG_Q15_ACCURACY - LOG_Q15_INTEGER_PART)); + vtmp = vshlq_n_s32(normalization,LOG_Q31_ACCURACY - LOG_Q31_INTEGER_PART); + vtmp = vsubq_s32((int32x4_t)y,vtmp); + + + + /* q4.11 */ + // y = ((int32_t)tmp * LOG_Q15_INVLOG2EXP) >> 15; + vtmp = vqdmulhq_n_s32(vtmp,LOG_Q31_INVLOG2EXP); + + return(vtmp); +} +#endif + +/** + @ingroup groupFastMath + */ + +/** + @addtogroup vlog + @{ + */ + +/** + @brief q31 vector of log values. + @param[in] pSrc points to the input vector in q31 + @param[out] pDst points to the output vector q5.26 + @param[in] blockSize number of samples in each vector + @return none + + */ +void arm_vlog_q31( + const q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; /* loop counters */ + + #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + + q31x4_t src; + q31x4_t dst; + + blkCnt = blockSize >> 2; + + while (blkCnt > 0U) + { + src = vld1q(pSrc); + dst = vlogq_q31(src); + vst1q(pDst, dst); + + pSrc += 4; + pDst += 4; + /* Decrement loop counter */ + blkCnt--; + } + + blkCnt = blockSize & 3; + #else + blkCnt = blockSize; + #endif + + while (blkCnt > 0U) + { + *pDst++=arm_scalar_log_q31(*pSrc++); + + blkCnt--; + } + +} + +/** + @} end of vlog group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_32x64_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_32x64_init_q31.c index 4c1d91a..64d61f1 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_32x64_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_32x64_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df1_32x64_init_q31.c * Description: High precision Q31 Biquad cascade filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_32x64_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_32x64_q31.c index 2c01a9c..1111311 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_32x64_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_32x64_q31.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df1_32x64_q31.c * Description: High precision Q31 Biquad cascade filter processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -298,7 +298,7 @@ void arm_biquad_cas_df1_32x64_q31( q31_t b0, b1, b2, a1, a2; /* Filter coefficients */ int32_t shift = (int32_t) S->postShift + 1; /* Shift to be applied to the output */ uint32_t sample, stage = S->numStages; /* loop counters */ - q31x4_t vecCoef, vecIn; + q31x4_t vecCoef = { 0 }, vecIn; q63_t acc; if (blockSize <= 3) diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_f16.c index 4986e95..c38e37b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_f16.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df1_f16.c * Description: Processing function for the floating-point Biquad cascade DirectFormI(DF1) filter * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -65,7 +65,7 @@ void arm_biquad_cascade_df1_f16( const float16_t *pCoeffs = S->pCoeffs; /* coefficient pointer */ float16_t Xn1, Xn2, Yn1, Yn2; /* Filter pState variables */ float16_t X0, X1, X2, X3; /* temporary input */ - float16_t X4, X5, X6, X7; /* temporary input */ + float16_t X4, X5, X6, X7 = 0; /* temporary input */ _Float16 lastX, lastY; /* X,Y history for tail handling */ f16x8_t coeffs; f16x8_t accVec; /* accumultor vector */ @@ -491,4 +491,5 @@ void arm_biquad_cascade_df1_f16( #endif /* #if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) */ #endif /*#if defined(ARM_FLOAT16_SUPPORTED)*/ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_f32.c index ae17c46..931a6f0 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_f32.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df1_f32.c * Description: Processing function for the floating-point Biquad cascade DirectFormI(DF1) filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -178,7 +178,7 @@ void arm_biquad_cascade_df1_f32( const float32_t *pCoeffs = S->pCoeffs; /* coefficient pointer */ float32_t Xn1, Xn2, Yn1, Yn2; /* Filter pState variables */ float32_t lastX, lastY; /* X,Y history for tail handling */ - float32_t X0, X1, X2, X3; /* temporary input */ + float32_t X0, X1, X2, X3 = 0; /* temporary input */ f32x4_t coeffs; f32x4_t accVec; /* accumultor vector */ uint32_t sample, stage = S->numStages; /* loop counters */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_fast_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_fast_q15.c index e42af39..f6d7243 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_fast_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_fast_q15.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df1_fast_q15.c * Description: Fast processing function for the Q15 Biquad cascade filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -81,13 +81,13 @@ void arm_biquad_cascade_df1_fast_q15( do { /* Read the b0 and 0 coefficients using SIMD */ - b0 = read_q15x2_ia ((q15_t **) &pCoeffs); + b0 = read_q15x2_ia (&pCoeffs); /* Read the b1 and b2 coefficients using SIMD */ - b1 = read_q15x2_ia ((q15_t **) &pCoeffs); + b1 = read_q15x2_ia (&pCoeffs); /* Read the a1 and a2 coefficients using SIMD */ - a1 = read_q15x2_ia ((q15_t **) &pCoeffs); + a1 = read_q15x2_ia (&pCoeffs); /* Read the input state values from the state buffer: x[n-1], x[n-2] */ state_in = read_q15x2_ia (&pState); @@ -111,7 +111,7 @@ void arm_biquad_cascade_df1_fast_q15( { /* Read the input */ - in = read_q15x2_ia ((q15_t **) &pIn); + in = read_q15x2_ia (&pIn); /* out = b0 * x[n] + 0 * 0 */ out = __SMUAD(b0, in); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_fast_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_fast_q31.c index dbf2d01..1ddff4d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_fast_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_fast_q31.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df1_fast_q31.c * Description: Processing function for the Q31 Fast Biquad cascade DirectFormI(DF1) filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_init_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_init_f16.c index 4f291fe..0cbe6f6 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_init_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_init_f16.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df1_init_f16.c * Description: Floating-point Biquad cascade DirectFormI(DF1) filter initialization function * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -98,29 +98,35 @@ void arm_biquad_cascade_df1_init_f16( #if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) +/* + +The computation of the coefficients is done in float32 otherwise the +resulting filter is too different from the expected one. + +*/ static void generateCoefsFastBiquadF16(float16_t b0, float16_t b1, float16_t b2, float16_t a1, float16_t a2, arm_biquad_mod_coef_f16 * newCoef) { float32_t coeffs[8][12] = { - {0, 0, 0, 0, 0, 0, 0, b0, b1, b2, a1, a2}, - {0, 0, 0, 0, 0, 0, b0, b1, b2, 0, a2, 0}, - {0, 0, 0, 0, 0, b0, b1, b2, 0, 0, 0, 0}, - {0, 0, 0, 0, b0, b1, b2, 0, 0, 0, 0, 0}, - {0, 0, 0, b0, b1, b2, 0, 0, 0, 0, 0, 0}, - {0, 0, b0, b1, b2, 0, 0, 0, 0, 0, 0, 0}, - {0, b0, b1, b2, 0, 0, 0, 0, 0, 0, 0, 0}, - {b0, b1, b2, 0, 0, 0, 0, 0, 0, 0, 0, 0} + {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, (float32_t)b0, (float32_t)b1, (float32_t)b2, (float32_t)a1, (float32_t)a2}, + {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, (float32_t)b0, (float32_t)b1, (float32_t)b2, 0.0f, (float32_t)a2, 0.0f}, + {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, (float32_t)b0, (float32_t)b1, (float32_t)b2, 0.0f, 0.0f, 0.0f, 0.0f}, + {0.0f, 0.0f, 0.0f, 0.0f, (float32_t)b0, (float32_t)b1, (float32_t)b2, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, + {0.0f, 0.0f, 0.0f, (float32_t)b0, (float32_t)b1, (float32_t)b2, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, + {0.0f, 0.0f, (float32_t)b0, (float32_t)b1, (float32_t)b2, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, + {0.0f, (float32_t)b0, (float32_t)b1, (float32_t)b2, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, + {(float32_t)b0, (float32_t)b1, (float32_t)b2, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f} }; for (int i = 0; i < 12; i++) { - coeffs[1][i] += (a1 * coeffs[0][i]); - coeffs[2][i] += (a1 * coeffs[1][i]) + (a2 * coeffs[0][i]); - coeffs[3][i] += (a1 * coeffs[2][i]) + (a2 * coeffs[1][i]); - coeffs[4][i] += (a1 * coeffs[3][i]) + (a2 * coeffs[2][i]); - coeffs[5][i] += (a1 * coeffs[4][i]) + (a2 * coeffs[3][i]); - coeffs[6][i] += (a1 * coeffs[5][i]) + (a2 * coeffs[4][i]); - coeffs[7][i] += (a1 * coeffs[6][i]) + (a2 * coeffs[5][i]); + coeffs[1][i] += ((float32_t)a1 * coeffs[0][i]); + coeffs[2][i] += ((float32_t)a1 * coeffs[1][i]) + ((float32_t)a2 * coeffs[0][i]); + coeffs[3][i] += ((float32_t)a1 * coeffs[2][i]) + ((float32_t)a2 * coeffs[1][i]); + coeffs[4][i] += ((float32_t)a1 * coeffs[3][i]) + ((float32_t)a2 * coeffs[2][i]); + coeffs[5][i] += ((float32_t)a1 * coeffs[4][i]) + ((float32_t)a2 * coeffs[3][i]); + coeffs[6][i] += ((float32_t)a1 * coeffs[5][i]) + ((float32_t)a2 * coeffs[4][i]); + coeffs[7][i] += ((float32_t)a1 * coeffs[6][i]) + ((float32_t)a2 * coeffs[5][i]); /* * transpose @@ -159,5 +165,6 @@ void arm_biquad_cascade_df1_mve_init_f16(arm_biquad_casd_df1_inst_f16 * S, /** @} end of BiquadCascadeDF1 group */ -#endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ +#endif /* #if defined(ARMfloat16_t_SUPPORTED) */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_init_f32.c index e904fd9..91b079b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df1_init_f32.c * Description: Floating-point Biquad cascade DirectFormI(DF1) filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_init_q15.c index 54aa5b0..8f3020e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_init_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_init_q15.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df1_init_q15.c * Description: Q15 Biquad cascade DirectFormI(DF1) filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_init_q31.c index ee65719..0cc7acc 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df1_init_q31.c * Description: Q31 Biquad cascade DirectFormI(DF1) filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_q15.c index 0791bbc..df7d114 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_q15.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df1_q15.c * Description: Processing function for the Q15 Biquad cascade DirectFormI(DF1) filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_q31.c index 5dbf177..ca2fce9 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df1_q31.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df1_q31.c * Description: Processing function for the Q31 Biquad cascade filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -71,7 +71,7 @@ void arm_biquad_cascade_df1_q31( uint32_t stages = S->numStages; /* loop counters */ int postShift = S->postShift; q31x4_t b0Coeffs, b1Coeffs, a0Coeffs, a1Coeffs; /* Coefficients vector */ - q31x4_t stateVec; + q31x4_t stateVec = { 0 }; q31_t *pState = S->pState; /* pState pointer initialization */ q31x4_t inVec0; int64_t acc; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_f16.c index ea24338..a9ef2e7 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_f16.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df2T_f16.c * Description: Processing function for floating-point transposed direct form II Biquad cascade filter * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -49,7 +49,7 @@ @return none */ -#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) +#if (defined(ARM_MATH_MVE_FLOAT16) && defined(ARM_MATH_HELIUM_EXPERIMENTAL)) && !defined(ARM_MATH_AUTOVECTORIZE) void arm_biquad_cascade_df2T_f16( const arm_biquad_cascade_df2T_instance_f16 * S, const float16_t * pSrc, @@ -188,7 +188,7 @@ void arm_biquad_cascade_df2T_f16( while (stage > 0U); } #else -LOW_OPTIMIZATION_ENTER + void arm_biquad_cascade_df2T_f16( const arm_biquad_cascade_df2T_instance_f16 * S, const float16_t * pSrc, @@ -488,7 +488,6 @@ void arm_biquad_cascade_df2T_f16( } while (stage > 0U); } -LOW_OPTIMIZATION_EXIT #endif /* #if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ /** @} end of BiquadCascadeDF2T group diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_f32.c index 1398842..f75a614 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_f32.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df2T_f32.c * Description: Processing function for floating-point transposed direct form II Biquad cascade filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -47,7 +47,7 @@ @param[in] blockSize number of samples to process @return none */ -#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) +#if (defined(ARM_MATH_MVEF) && defined(ARM_MATH_HELIUM_EXPERIMENTAL)) && !defined(ARM_MATH_AUTOVECTORIZE) #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" void arm_biquad_cascade_df2T_f32( @@ -345,7 +345,7 @@ void arm_biquad_cascade_df2T_f32( } } #else -LOW_OPTIMIZATION_ENTER + void arm_biquad_cascade_df2T_f32( const arm_biquad_cascade_df2T_instance_f32 * S, const float32_t * pSrc, @@ -645,7 +645,7 @@ void arm_biquad_cascade_df2T_f32( } while (stage > 0U); } -LOW_OPTIMIZATION_EXIT + #endif /* #if defined(ARM_MATH_NEON) */ #endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_f64.c index f935a1b..6d72a5a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_f64.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_f64.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df2T_f64.c * Description: Processing function for floating-point transposed direct form II Biquad cascade filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -107,7 +107,7 @@ To do this manually without calling the init function, assign the follow subfields of the instance structure: numStages, pCoeffs, pState. Also set all of the values in pState to zero. @par - Use of the initialization function is optional. + Use of the initialization function is optional except for the vectorized versions (Helium and Neon). However, if the initialization function is used, then the instance structure cannot be placed into a const data section. To place an instance structure into a const data section, the instance structure must be manually initialized. Set the values in the state buffer to zeros before static initialization. @@ -119,6 +119,12 @@ where numStages is the number of Biquad stages in the filter; pState is the address of the state buffer. pCoeffs is the address of the coefficient buffer; + @par Neon version + For Neon version, the function arm_biquad_cascade_df2T_compute_coefs_x must be + used in addition to arm_biquad_cascade_df2T_init_x. + + See the documentation of arm_biquad_cascade_df2T_init_x for more details. + */ /** @@ -135,7 +141,7 @@ @return none */ -LOW_OPTIMIZATION_ENTER + void arm_biquad_cascade_df2T_f64( const arm_biquad_cascade_df2T_instance_f64 * S, const float64_t * pSrc, @@ -438,7 +444,7 @@ void arm_biquad_cascade_df2T_f64( } while (stage > 0U); } -LOW_OPTIMIZATION_EXIT + /** @} end of BiquadCascadeDF2T group diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_init_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_init_f16.c index ebd0fc4..fa07f91 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_init_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_init_f16.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df2T_init_f16.c * Description: Initialization function for floating-point transposed direct form II Biquad cascade filter * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -114,4 +114,5 @@ void arm_biquad_cascade_df2T_init_f16( */ #endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_init_f32.c index 00375d8..988d6ca 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df2T_init_f32.c * Description: Initialization function for floating-point transposed direct form II Biquad cascade filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -39,78 +39,32 @@ @{ */ -/** - @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - @param[in,out] S points to an instance of the filter data structure. - @param[in] numStages number of 2nd order stages in the filter. - @param[in] pCoeffs points to the filter coefficients. - @param[in] pState points to the state buffer. - @return none - @par Coefficient and State Ordering - The coefficients are stored in the array pCoeffs in the following order - in the not Neon version. -
-      {b10, b11, b12, a11, a12, b20, b21, b22, a21, a22, ...}
-  
- - @par - where b1x and a1x are the coefficients for the first stage, - b2x and a2x are the coefficients for the second stage, - and so on. The pCoeffs array contains a total of 5*numStages values. - - For Neon version, this array is bigger. If numstages = 4x + y, then the array has size: - 32*x + 5*y - and it must be initialized using the function - arm_biquad_cascade_df2T_compute_coefs_f32 which is taking the - standard array coefficient as parameters. - - But, an array of 8*numstages is a good approximation. - - Then, the initialization can be done with: -
-                   arm_biquad_cascade_df2T_init_f32(&SNeon, nbCascade, neonCoefs, stateNeon);
-                   arm_biquad_cascade_df2T_compute_coefs_f32(&SNeon,nbCascade,coefs);
-  
- - @par In this example, neonCoefs is a bigger array of size 8 * numStages. - coefs is the standard array: - -
-      {b10, b11, b12, a11, a12, b20, b21, b22, a21, a22, ...}
-  
- - - @par - The pState is a pointer to state array. - Each Biquad stage has 2 state variables d1, and d2. - The 2 state variables for stage 1 are first, then the 2 state variables for stage 2, and so on. - The state array has a total length of 2*numStages values. - The state variables are updated after each block of data is processed; the coefficients are untouched. - */ #if defined(ARM_MATH_NEON) -/* +/** + @brief Compute new coefficient arrays for use in vectorized filter (Neon only). + @param[in] numStages number of 2nd order stages in the filter. + @param[in] pCoeffs points to the original filter coefficients. + @param[in] pComputedCoeffs points to the new computed coefficients for the vectorized Neon version. + @return none + + @par Size of coefficient arrays: + pCoeffs has size 5 * numStages -Must be called after initializing the biquad instance. -pCoeffs has size 5 * nbCascade -Whereas the pCoeffs for the init has size (4*4 + 4*4)* nbCascade + pComputedCoeffs has size 8 * numStages -So this pCoeffs is the one which would be used for the not Neon version. -The pCoeffs passed in init is bigger than the one for the not Neon version. + pComputedCoeffs is the array to be used in arm_biquad_cascade_df2T_init_f32. */ void arm_biquad_cascade_df2T_compute_coefs_f32( - arm_biquad_cascade_df2T_instance_f32 * S, uint8_t numStages, - float32_t * pCoeffs) + const float32_t * pCoeffs, + float32_t * pComputedCoeffs) { uint8_t cnt; - float32_t *pDstCoeffs; float32_t b0[4],b1[4],b2[4],a1[4],a2[4]; - pDstCoeffs = (float32_t*)S->pCoeffs; - cnt = numStages >> 2; while(cnt > 0) { @@ -125,52 +79,52 @@ void arm_biquad_cascade_df2T_compute_coefs_f32( } /* Vec 1 */ - *pDstCoeffs++ = 0; - *pDstCoeffs++ = b0[1]; - *pDstCoeffs++ = b0[2]; - *pDstCoeffs++ = b0[3]; + *pComputedCoeffs++ = 0; + *pComputedCoeffs++ = b0[1]; + *pComputedCoeffs++ = b0[2]; + *pComputedCoeffs++ = b0[3]; /* Vec 2 */ - *pDstCoeffs++ = 0; - *pDstCoeffs++ = 0; - *pDstCoeffs++ = b0[1] * b0[2]; - *pDstCoeffs++ = b0[2] * b0[3]; + *pComputedCoeffs++ = 0; + *pComputedCoeffs++ = 0; + *pComputedCoeffs++ = b0[1] * b0[2]; + *pComputedCoeffs++ = b0[2] * b0[3]; /* Vec 3 */ - *pDstCoeffs++ = 0; - *pDstCoeffs++ = 0; - *pDstCoeffs++ = 0; - *pDstCoeffs++ = b0[1] * b0[2] * b0[3]; + *pComputedCoeffs++ = 0; + *pComputedCoeffs++ = 0; + *pComputedCoeffs++ = 0; + *pComputedCoeffs++ = b0[1] * b0[2] * b0[3]; /* Vec 4 */ - *pDstCoeffs++ = b0[0]; - *pDstCoeffs++ = b0[0] * b0[1]; - *pDstCoeffs++ = b0[0] * b0[1] * b0[2]; - *pDstCoeffs++ = b0[0] * b0[1] * b0[2] * b0[3]; + *pComputedCoeffs++ = b0[0]; + *pComputedCoeffs++ = b0[0] * b0[1]; + *pComputedCoeffs++ = b0[0] * b0[1] * b0[2]; + *pComputedCoeffs++ = b0[0] * b0[1] * b0[2] * b0[3]; /* Vec 5 */ - *pDstCoeffs++ = b1[0]; - *pDstCoeffs++ = b1[1]; - *pDstCoeffs++ = b1[2]; - *pDstCoeffs++ = b1[3]; + *pComputedCoeffs++ = b1[0]; + *pComputedCoeffs++ = b1[1]; + *pComputedCoeffs++ = b1[2]; + *pComputedCoeffs++ = b1[3]; /* Vec 6 */ - *pDstCoeffs++ = b2[0]; - *pDstCoeffs++ = b2[1]; - *pDstCoeffs++ = b2[2]; - *pDstCoeffs++ = b2[3]; + *pComputedCoeffs++ = b2[0]; + *pComputedCoeffs++ = b2[1]; + *pComputedCoeffs++ = b2[2]; + *pComputedCoeffs++ = b2[3]; /* Vec 7 */ - *pDstCoeffs++ = a1[0]; - *pDstCoeffs++ = a1[1]; - *pDstCoeffs++ = a1[2]; - *pDstCoeffs++ = a1[3]; + *pComputedCoeffs++ = a1[0]; + *pComputedCoeffs++ = a1[1]; + *pComputedCoeffs++ = a1[2]; + *pComputedCoeffs++ = a1[3]; /* Vec 8 */ - *pDstCoeffs++ = a2[0]; - *pDstCoeffs++ = a2[1]; - *pDstCoeffs++ = a2[2]; - *pDstCoeffs++ = a2[3]; + *pComputedCoeffs++ = a2[0]; + *pComputedCoeffs++ = a2[1]; + *pComputedCoeffs++ = a2[2]; + *pComputedCoeffs++ = a2[3]; cnt--; } @@ -178,17 +132,66 @@ void arm_biquad_cascade_df2T_compute_coefs_f32( cnt = numStages & 0x3; while(cnt > 0) { - *pDstCoeffs++ = *pCoeffs++; - *pDstCoeffs++ = *pCoeffs++; - *pDstCoeffs++ = *pCoeffs++; - *pDstCoeffs++ = *pCoeffs++; - *pDstCoeffs++ = *pCoeffs++; + *pComputedCoeffs++ = *pCoeffs++; + *pComputedCoeffs++ = *pCoeffs++; + *pComputedCoeffs++ = *pCoeffs++; + *pComputedCoeffs++ = *pCoeffs++; + *pComputedCoeffs++ = *pCoeffs++; cnt--; } } #endif +/** + @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. + @param[in,out] S points to an instance of the filter data structure. + @param[in] numStages number of 2nd order stages in the filter. + @param[in] pCoeffs points to the filter coefficients. + @param[in] pState points to the state buffer. + @return none + + @par Coefficient and State Ordering + The coefficients are stored in the array pCoeffs in the following order + in the not Neon version. +
+      {b10, b11, b12, a11, a12, b20, b21, b22, a21, a22, ...}
+  
+ + @par + where b1x and a1x are the coefficients for the first stage, + b2x and a2x are the coefficients for the second stage, + and so on. The pCoeffs array contains a total of 5*numStages values. + + For Neon version, this array is bigger. If numstages = 4x + y, then the array has size: + 32*x + 5*y + and it must be initialized using the function + arm_biquad_cascade_df2T_compute_coefs_f32 which is taking the + standard array coefficient as parameters. + + But, an array of 8*numstages is a good approximation. + + Then, the initialization can be done with: +
+                   arm_biquad_cascade_df2T_compute_coefs_f32(nbCascade,coefs,computedCoefs);
+                   arm_biquad_cascade_df2T_init_f32(&SNeon, nbCascade, computedCoefs, stateNeon);
+  
+ + @par In this example, computedCoefs is a bigger array of size 8 * numStages. + coefs is the standard array: + +
+      {b10, b11, b12, a11, a12, b20, b21, b22, a21, a22, ...}
+  
+ + + @par + The pState is a pointer to state array. + Each Biquad stage has 2 state variables d1, and d2. + The 2 state variables for stage 1 are first, then the 2 state variables for stage 2, and so on. + The state array has a total length of 2*numStages values. + The state variables are updated after each block of data is processed; the coefficients are untouched. + */ void arm_biquad_cascade_df2T_init_f32( arm_biquad_cascade_df2T_instance_f32 * S, uint8_t numStages, diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_init_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_init_f64.c index c33c915..e06f35e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_init_f64.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_df2T_init_f64.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_df2T_init_f64.c * Description: Initialization function for floating-point transposed direct form II Biquad cascade filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_stereo_df2T_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_stereo_df2T_f16.c index 2767bc1..ef6b4cb 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_stereo_df2T_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_stereo_df2T_f16.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_stereo_df2T_f16.c * Description: Processing function for floating-point transposed direct form II Biquad cascade filter. 2 channels * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -53,7 +53,7 @@ #pragma GCC warning "Scalar version of arm_biquad_cascade_stereo_df2T_f16 built. Helium version has build issues with gcc." #endif -#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) && !defined(__CMSIS_GCC_H) +#if (defined(ARM_MATH_MVE_FLOAT16) && defined(ARM_MATH_HELIUM_EXPERIMENTAL)) && !defined(ARM_MATH_AUTOVECTORIZE) && !defined(__CMSIS_GCC_H) void arm_biquad_cascade_stereo_df2T_f16( const arm_biquad_cascade_stereo_df2T_instance_f16 * S, const float16_t * pSrc, @@ -194,7 +194,7 @@ void arm_biquad_cascade_stereo_df2T_f16( while (stage > 0U); } #else -LOW_OPTIMIZATION_ENTER + void arm_biquad_cascade_stereo_df2T_f16( const arm_biquad_cascade_stereo_df2T_instance_f16 * S, const float16_t * pSrc, @@ -427,11 +427,12 @@ void arm_biquad_cascade_stereo_df2T_f16( } while (stage > 0U); } -LOW_OPTIMIZATION_EXIT + #endif /* #if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) */ /** @} end of BiquadCascadeDF2T group */ #endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_stereo_df2T_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_stereo_df2T_f32.c index 5851c91..e0a5d03 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_stereo_df2T_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_stereo_df2T_f32.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_stereo_df2T_f32.c * Description: Processing function for floating-point transposed direct form II Biquad cascade filter. 2 channels * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -47,7 +47,7 @@ @param[in] blockSize number of samples to process @return none */ -#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) +#if (defined(ARM_MATH_MVEF) && defined(ARM_MATH_HELIUM_EXPERIMENTAL)) && !defined(ARM_MATH_AUTOVECTORIZE) #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" void arm_biquad_cascade_stereo_df2T_f32( @@ -181,7 +181,7 @@ void arm_biquad_cascade_stereo_df2T_f32( } #else -LOW_OPTIMIZATION_ENTER + void arm_biquad_cascade_stereo_df2T_f32( const arm_biquad_cascade_stereo_df2T_instance_f32 * S, const float32_t * pSrc, @@ -414,7 +414,7 @@ void arm_biquad_cascade_stereo_df2T_f32( } while (stage > 0U); } -LOW_OPTIMIZATION_EXIT + #endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ /** diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_stereo_df2T_init_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_stereo_df2T_init_f16.c index 83f63ed..3277519 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_stereo_df2T_init_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_stereo_df2T_init_f16.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_stereo_df2T_init_f16.c * Description: Initialization function for floating-point transposed direct form II Biquad cascade filter * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_stereo_df2T_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_stereo_df2T_init_f32.c index aa4ce89..f7dd819 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_stereo_df2T_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_biquad_cascade_stereo_df2T_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_biquad_cascade_stereo_df2T_init_f32.c * Description: Initialization function for floating-point transposed direct form II Biquad cascade filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_f32.c index 9080c75..5e123e4 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_f32.c @@ -5,13 +5,13 @@ * Title: arm_conv_f32.c * Description: Convolution of floating-point sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -45,12 +45,14 @@ @par Algorithm Let a[n] and b[n] be sequences of length srcALen and srcBLen samples respectively. Then the convolution -
-     c[n] = a[n] * b[n]
-  
+ \f[ + c[n] = a[n] * b[n] + \f] @par is defined as - \image html ConvolutionEquation.gif + \f[ + c[n] = \sum_{k=0}^{srcALen} a[k] b[n-k] + \f] @par Note that c[n] is of length srcALen + srcBLen - 1 and is defined over the interval n=0, 1, 2, ..., srcALen + srcBLen - 2. pSrcA points to the first input vector of length srcALen and @@ -62,9 +64,9 @@ For each offset \c n, the overlapping portions of a[n] and b[n] are multiplied and summed together. @par Note that convolution is a commutative operation: -
-     a[n] * b[n] = b[n] * a[n].
-  
+ \f[ + a[n] * b[n] = b[n] * a[n]. + \f] @par This means that switching the A and B arguments to the convolution functions has no effect. @@ -80,6 +82,12 @@ @par Opt Versions Opt versions are supported for Q15 and Q7. Design uses internal scratch buffer for getting good optimisation. These versions are optimised in cycles and consumes more memory (Scratch memory) compared to Q15 and Q7 versions + + @par Long versions: + For convolution of long vectors, those functions are + no more adapted and will be very slow. + An implementation based upon FFTs should be used. + */ /** diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_fast_opt_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_fast_opt_q15.c index dda46cf..62b1c95 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_fast_opt_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_fast_opt_q15.c @@ -5,13 +5,13 @@ * Title: arm_conv_fast_opt_q15.c * Description: Fast Q15 Convolution * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_fast_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_fast_q15.c index a0f4860..d00ad65 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_fast_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_fast_q15.c @@ -5,13 +5,13 @@ * Title: arm_conv_fast_q15.c * Description: Fast Q15 Convolution * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_fast_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_fast_q31.c index 70949a0..569e484 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_fast_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_fast_q31.c @@ -5,13 +5,13 @@ * Title: arm_conv_fast_q31.c * Description: Fast Q31 Convolution * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_opt_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_opt_q15.c index ad7bf76..6230627 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_opt_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_opt_q15.c @@ -5,13 +5,13 @@ * Title: arm_conv_opt_q15.c * Description: Convolution of Q15 sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_opt_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_opt_q7.c index a4b251d..1afdb5d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_opt_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_opt_q7.c @@ -5,13 +5,13 @@ * Title: arm_conv_opt_q7.c * Description: Convolution of Q7 sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_f32.c index 73c732e..1ce871c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_f32.c @@ -5,13 +5,13 @@ * Title: arm_conv_partial_f32.c * Description: Partial convolution of floating-point sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -58,6 +58,12 @@ @par Opt Versions Opt versions are supported for Q15 and Q7. Design uses internal scratch buffer for getting good optimisation. These versions are optimised in cycles and consumes more memory (Scratch memory) compared to Q15 and Q7 versions of partial convolution + + @par Long versions: + For convolution of long vectors, those functions are + no more adapted and will be very slow. + An implementation based upon FFTs should be used. + */ /** @@ -97,7 +103,7 @@ arm_status arm_conv_partial_f32( const float32_t *pSrc1, *pSrc2; /* Intermediate pointers */ float32_t sum; /* Accumulator */ uint32_t j, k, count, blkCnt, check; - uint32_t blockSize1, blockSize2, blockSize3; /* Loop counters */ + int32_t blockSize1, blockSize2, blockSize3; /* Loop counters */ arm_status status; /* Status of Partial convolution */ #if defined (ARM_MATH_LOOPUNROLL) @@ -144,7 +150,7 @@ arm_status arm_conv_partial_f32( blockSize3 = ((int32_t)check > (int32_t)srcALen) ? (int32_t)check - (int32_t)srcALen : 0; blockSize3 = ((int32_t)firstIndex > (int32_t)srcALen - 1) ? blockSize3 - (int32_t)firstIndex + (int32_t)srcALen : blockSize3; blockSize1 = ((int32_t) srcBLen - 1) - (int32_t) firstIndex; - blockSize1 = (blockSize1 > 0) ? ((check > (srcBLen - 1U)) ? blockSize1 : numPoints) : 0; + blockSize1 = (blockSize1 > 0) ? ((check > (srcBLen - 1U)) ? blockSize1 : (int32_t)numPoints) : 0; blockSize2 = ((int32_t) check - blockSize3) - (blockSize1 + (int32_t) firstIndex); blockSize2 = (blockSize2 > 0) ? blockSize2 : 0; @@ -189,7 +195,7 @@ arm_status arm_conv_partial_f32( * ----------------------*/ /* The first stage starts here */ - while (blockSize1 > 0U) + while (blockSize1 > 0) { /* Accumulator is made zero for every iteration */ sum = 0.0f; @@ -541,7 +547,14 @@ arm_status arm_conv_partial_f32( count = srcBLen - 1U; /* Working pointer of inputA */ - pSrc1 = (pIn1 + srcALen) - (srcBLen - 1U); + if (firstIndex > srcALen) + { + pSrc1 = (pIn1 + firstIndex) - (srcBLen - 1U); + } + else + { + pSrc1 = (pIn1 + srcALen) - (srcBLen - 1U); + } px = pSrc1; /* Working pointer of inputB */ @@ -552,7 +565,7 @@ arm_status arm_conv_partial_f32( * Stage3 process * ------------------*/ - while (blockSize3 > 0U) + while (blockSize3 > 0) { /* Accumulator is made zero for every iteration */ sum = 0.0f; @@ -629,7 +642,6 @@ arm_status arm_conv_partial_f32( float32_t sum; /* Accumulator */ uint32_t i, j; /* Loop counters */ arm_status status; /* Status of Partial convolution */ - /* Check for range of output samples to be calculated */ if ((firstIndex + numPoints) > ((srcALen + (srcBLen - 1U)))) { diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_fast_opt_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_fast_opt_q15.c index 310d0a7..d181f6e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_fast_opt_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_fast_opt_q15.c @@ -5,13 +5,13 @@ * Title: arm_conv_partial_fast_opt_q15.c * Description: Fast Q15 Partial convolution * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_fast_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_fast_q15.c index 700e553..96cfe1c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_fast_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_fast_q15.c @@ -5,13 +5,13 @@ * Title: arm_conv_partial_fast_q15.c * Description: Fast Q15 Partial convolution * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -576,7 +576,14 @@ arm_status arm_conv_partial_fast_q15( count = srcBLen - 1U; /* Working pointer of inputA */ - pSrc1 = (pIn1 + srcALen) - (srcBLen - 1U); + if (firstIndex > srcALen) + { + pSrc1 = (pIn1 + firstIndex) - (srcBLen - 1U); + } + else + { + pSrc1 = (pIn1 + srcALen) - (srcBLen - 1U); + } px = pSrc1; /* Working pointer of inputB */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_fast_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_fast_q31.c index 2fb96f3..4f7a01a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_fast_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_fast_q31.c @@ -5,13 +5,13 @@ * Title: arm_conv_partial_fast_q31.c * Description: Fast Q31 Partial convolution * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -73,7 +73,7 @@ arm_status arm_conv_partial_fast_q31( const q31_t *pSrc1, *pSrc2; /* Intermediate pointers */ q31_t sum; /* Accumulators */ uint32_t j, k, count, check, blkCnt; - uint32_t blockSize1, blockSize2, blockSize3; /* Loop counters */ + int32_t blockSize1, blockSize2, blockSize3; /* Loop counters */ arm_status status; /* Status of Partial convolution */ #if defined (ARM_MATH_LOOPUNROLL) @@ -120,7 +120,7 @@ arm_status arm_conv_partial_fast_q31( blockSize3 = ((int32_t)check > (int32_t)srcALen) ? (int32_t)check - (int32_t)srcALen : 0; blockSize3 = ((int32_t)firstIndex > (int32_t)srcALen - 1) ? blockSize3 - (int32_t)firstIndex + (int32_t)srcALen : blockSize3; blockSize1 = ((int32_t) srcBLen - 1) - (int32_t) firstIndex; - blockSize1 = (blockSize1 > 0) ? ((check > (srcBLen - 1U)) ? blockSize1 : numPoints) : 0; + blockSize1 = (blockSize1 > 0) ? ((check > (srcBLen - 1U)) ? blockSize1 : (int32_t)numPoints) : 0; blockSize2 = (int32_t) check - ((blockSize3 + blockSize1) + (int32_t) firstIndex); blockSize2 = (blockSize2 > 0) ? blockSize2 : 0; @@ -165,7 +165,7 @@ arm_status arm_conv_partial_fast_q31( * ----------------------*/ /* The first stage starts here */ - while (blockSize1 > 0U) + while (blockSize1 > 0) { /* Accumulator is made zero for every iteration */ sum = 0; @@ -528,7 +528,14 @@ arm_status arm_conv_partial_fast_q31( count = srcBLen - 1U; /* Working pointer of inputA */ - pSrc1 = (pIn1 + srcALen) - (srcBLen - 1U); + if (firstIndex > srcALen) + { + pSrc1 = (pIn1 + firstIndex) - (srcBLen - 1U); + } + else + { + pSrc1 = (pIn1 + srcALen) - (srcBLen - 1U); + } px = pSrc1; /* Working pointer of inputB */ @@ -539,7 +546,7 @@ arm_status arm_conv_partial_fast_q31( * Stage3 process * ------------------*/ - while (blockSize3 > 0U) + while (blockSize3 > 0) { /* Accumulator is made zero for every iteration */ sum = 0; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_opt_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_opt_q15.c index a2cc22c..1296674 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_opt_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_opt_q15.c @@ -5,13 +5,13 @@ * Title: arm_conv_partial_opt_q15.c * Description: Partial convolution of Q15 sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_opt_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_opt_q7.c index 2befd5d..1b0527d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_opt_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_opt_q7.c @@ -5,13 +5,13 @@ * Title: arm_conv_partial_opt_q7.c * Description: Partial convolution of Q7 sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_q15.c index 52f253c..41cd5c9 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_q15.c @@ -5,13 +5,13 @@ * Title: arm_conv_partial_q15.c * Description: Partial convolution of Q15 sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -78,7 +78,7 @@ arm_status arm_conv_partial_q15( const q15_t *py; /* Intermediate inputB pointer */ const q15_t *pSrc1, *pSrc2; /* Intermediate pointers */ q31_t x0, x1, x2, x3, c0; /* Temporary input variables to hold state and coefficient values */ - uint32_t blockSize1, blockSize2, blockSize3; /* Loop counters */ + int32_t blockSize1, blockSize2, blockSize3; /* Loop counters */ uint32_t j, k, count, blkCnt, check; arm_status status; /* Status of Partial convolution */ @@ -121,7 +121,7 @@ arm_status arm_conv_partial_q15( blockSize3 = ((int32_t)check > (int32_t)srcALen) ? (int32_t)check - (int32_t)srcALen : 0; blockSize3 = ((int32_t)firstIndex > (int32_t)srcALen - 1) ? blockSize3 - (int32_t)firstIndex + (int32_t)srcALen : blockSize3; blockSize1 = ((int32_t) srcBLen - 1) - (int32_t) firstIndex; - blockSize1 = (blockSize1 > 0) ? ((check > (srcBLen - 1U)) ? blockSize1 : numPoints) : 0; + blockSize1 = (blockSize1 > 0) ? ((check > (srcBLen - 1U)) ? blockSize1 : (int32_t)numPoints) : 0; blockSize2 = (int32_t) check - ((blockSize3 + blockSize1) + (int32_t) firstIndex); blockSize2 = (blockSize2 > 0) ? blockSize2 : 0; @@ -170,7 +170,7 @@ arm_status arm_conv_partial_q15( /* Second part of this stage computes the MAC operations greater than or equal to 4 */ /* The first part of the stage starts here */ - while ((count < 4U) && (blockSize1 > 0U)) + while ((count < 4U) && (blockSize1 > 0)) { /* Accumulator is made zero for every iteration */ sum = 0; @@ -208,7 +208,7 @@ arm_status arm_conv_partial_q15( * y[srcBLen] and y[srcBLen-1] coefficients, py is decremented by 1 */ py = py - 1; - while (blockSize1 > 0U) + while (blockSize1 > 0) { /* Accumulator is made zero for every iteration */ sum = 0; @@ -582,7 +582,14 @@ arm_status arm_conv_partial_q15( count = srcBLen - 1U; /* Working pointer of inputA */ - pSrc1 = (pIn1 + srcALen) - (srcBLen - 1U); + if (firstIndex > srcALen) + { + pSrc1 = (pIn1 + firstIndex) - (srcBLen - 1U); + } + else + { + pSrc1 = (pIn1 + srcALen) - (srcBLen - 1U); + } px = pSrc1; /* Working pointer of inputB */ @@ -601,7 +608,7 @@ arm_status arm_conv_partial_q15( /* The first part of the stage starts here */ j = count >> 2U; - while ((j > 0U) && (blockSize3 > 0U)) + while ((j > 0U) && (blockSize3 > 0)) { /* Accumulator is made zero for every iteration */ sum = 0; @@ -662,7 +669,7 @@ arm_status arm_conv_partial_q15( * so pointer py is updated to read only one sample at a time */ py = py + 1U; - while (blockSize3 > 0U) + while (blockSize3 > 0) { /* Accumulator is made zero for every iteration */ sum = 0; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_q31.c index eb360b6..887aa71 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_q31.c @@ -5,13 +5,13 @@ * Title: arm_conv_partial_q31.c * Description: Partial convolution of Q31 sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -76,7 +76,7 @@ arm_status arm_conv_partial_q31( const q31_t *pSrc1, *pSrc2; /* Intermediate pointers */ q63_t sum; /* Accumulator */ uint32_t j, k, count, blkCnt, check; - uint32_t blockSize1, blockSize2, blockSize3; /* Loop counters */ + int32_t blockSize1, blockSize2, blockSize3; /* Loop counters */ arm_status status; /* Status of Partial convolution */ #if defined (ARM_MATH_LOOPUNROLL) @@ -123,7 +123,7 @@ arm_status arm_conv_partial_q31( blockSize3 = ((int32_t)check > (int32_t)srcALen) ? (int32_t)check - (int32_t)srcALen : 0; blockSize3 = ((int32_t)firstIndex > (int32_t)srcALen - 1) ? blockSize3 - (int32_t)firstIndex + (int32_t)srcALen : blockSize3; blockSize1 = ((int32_t) srcBLen - 1) - (int32_t) firstIndex; - blockSize1 = (blockSize1 > 0) ? ((check > (srcBLen - 1U)) ? blockSize1 : numPoints) : 0; + blockSize1 = (blockSize1 > 0) ? ((check > (srcBLen - 1U)) ? blockSize1 : (int32_t)numPoints) : 0; blockSize2 = (int32_t) check - ((blockSize3 + blockSize1) + (int32_t) firstIndex); blockSize2 = (blockSize2 > 0) ? blockSize2 : 0; @@ -168,7 +168,7 @@ arm_status arm_conv_partial_q31( * ----------------------*/ /* The first stage starts here */ - while (blockSize1 > 0U) + while (blockSize1 > 0) { /* Accumulator is made zero for every iteration */ sum = 0; @@ -501,7 +501,14 @@ arm_status arm_conv_partial_q31( count = srcBLen - 1U; /* Working pointer of inputA */ - pSrc1 = (pIn1 + srcALen) - (srcBLen - 1U); + if (firstIndex > srcALen) + { + pSrc1 = (pIn1 + firstIndex) - (srcBLen - 1U); + } + else + { + pSrc1 = (pIn1 + srcALen) - (srcBLen - 1U); + } px = pSrc1; /* Working pointer of inputB */ @@ -512,7 +519,7 @@ arm_status arm_conv_partial_q31( * Stage3 process * ------------------*/ - while (blockSize3 > 0U) + while (blockSize3 > 0) { /* Accumulator is made zero for every iteration */ sum = 0; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_q7.c index a4f03af..3589f63 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_partial_q7.c @@ -5,13 +5,13 @@ * Title: arm_conv_partial_q7.c * Description: Partial convolution of Q7 sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -66,7 +66,7 @@ arm_status arm_conv_partial_q7( uint32_t numPoints) { -#if ARM_MATH_DSP +#if defined(ARM_MATH_DSP) const q7_t *pIn1; /* InputA pointer */ const q7_t *pIn2; /* InputB pointer */ @@ -76,7 +76,7 @@ arm_status arm_conv_partial_q7( const q7_t *pSrc1, *pSrc2; /* Intermediate pointers */ q31_t sum; /* Accumulator */ uint32_t j, k, count, blkCnt, check; /* Loop counters */ - uint32_t blockSize1, blockSize2, blockSize3; /* Loop counters */ + int32_t blockSize1, blockSize2, blockSize3; /* Loop counters */ arm_status status; /* Status of Partial convolution */ #if defined (ARM_MATH_LOOPUNROLL) @@ -125,7 +125,7 @@ arm_status arm_conv_partial_q7( blockSize3 = ((int32_t)check > (int32_t)srcALen) ? (int32_t)check - (int32_t)srcALen : 0; blockSize3 = ((int32_t)firstIndex > (int32_t)srcALen - 1) ? blockSize3 - (int32_t)firstIndex + (int32_t)srcALen : blockSize3; blockSize1 = ((int32_t) srcBLen - 1) - (int32_t) firstIndex; - blockSize1 = (blockSize1 > 0) ? ((check > (srcBLen - 1U)) ? blockSize1 : numPoints) : 0; + blockSize1 = (blockSize1 > 0) ? ((check > (srcBLen - 1U)) ? blockSize1 : (int32_t)numPoints) : 0; blockSize2 = (int32_t) check - ((blockSize3 + blockSize1) + (int32_t) firstIndex); blockSize2 = (blockSize2 > 0) ? blockSize2 : 0; @@ -170,7 +170,7 @@ arm_status arm_conv_partial_q7( * ----------------------*/ /* The first stage starts here */ - while (blockSize1 > 0U) + while (blockSize1 > 0) { /* Accumulator is made zero for every iteration */ sum = 0; @@ -604,7 +604,14 @@ arm_status arm_conv_partial_q7( count = srcBLen - 1U; /* Working pointer of inputA */ - pSrc1 = (pIn1 + srcALen) - (srcBLen - 1U); + if (firstIndex > srcALen) + { + pSrc1 = (pIn1 + firstIndex) - (srcBLen - 1U); + } + else + { + pSrc1 = (pIn1 + srcALen) - (srcBLen - 1U); + } px = pSrc1; /* Working pointer of inputB */ @@ -615,7 +622,7 @@ arm_status arm_conv_partial_q7( * Stage3 process * ------------------*/ - while (blockSize3 > 0U) + while (blockSize3 > 0) { /* Accumulator is made zero for every iteration */ sum = 0; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_q15.c index aae3708..38e652c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_q15.c @@ -5,13 +5,13 @@ * Title: arm_conv_q15.c * Description: Convolution of Q15 sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_q31.c index 1e133f0..9d2dd29 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_q31.c @@ -5,13 +5,13 @@ * Title: arm_conv_q31.c * Description: Convolution of Q31 sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_q7.c index 0c521c3..a0f96dd 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_conv_q7.c @@ -5,13 +5,13 @@ * Title: arm_conv_q7.c * Description: Convolution of Q7 sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_f16.c index d35d92c..d584c25 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_f16.c @@ -5,13 +5,13 @@ * Title: arm_correlate_f16.c * Description: Correlation of floating-point sequences * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -35,51 +35,7 @@ @ingroup groupFilters */ -/** - @defgroup Corr Correlation - - Correlation is a mathematical operation that is similar to convolution. - As with convolution, correlation uses two signals to produce a third signal. - The underlying algorithms in correlation and convolution are identical except that one of the inputs is flipped in convolution. - Correlation is commonly used to measure the similarity between two signals. - It has applications in pattern recognition, cryptanalysis, and searching. - The CMSIS library provides correlation functions for Q7, Q15, Q31 and floating-point data types. - Fast versions of the Q15 and Q31 functions are also provided. - - @par Algorithm - Let a[n] and b[n] be sequences of length srcALen and srcBLen samples respectively. - The convolution of the two signals is denoted by -
-      c[n] = a[n] * b[n]
-  
- In correlation, one of the signals is flipped in time -
-       c[n] = a[n] * b[-n]
-  
- @par - and this is mathematically defined as - \image html CorrelateEquation.gif - @par - The pSrcA points to the first input vector of length srcALen and pSrcB points to the second input vector of length srcBLen. - The result c[n] is of length 2 * max(srcALen, srcBLen) - 1 and is defined over the interval n=0, 1, 2, ..., (2 * max(srcALen, srcBLen) - 2). - The output result is written to pDst and the calling function must allocate 2 * max(srcALen, srcBLen) - 1 words for the result. - - @note - The pDst should be initialized to all zeros before being used. - - @par Fixed-Point Behavior - Correlation requires summing up a large number of intermediate products. - As such, the Q7, Q15, and Q31 functions run a risk of overflow and saturation. - Refer to the function specific documentation below for further details of the particular algorithm used. - - @par Fast Versions - Fast versions are supported for Q31 and Q15. Cycles for Fast versions are less compared to Q31 and Q15 of correlate and the design requires - the input signals should be scaled down to avoid intermediate overflows. - - @par Opt Versions - Opt versions are supported for Q15 and Q7. Design uses internal scratch buffer for getting good optimisation. - These versions are optimised in cycles and consumes more memory (Scratch memory) compared to Q15 and Q7 versions of correlate - */ + /** @addtogroup Corr @@ -640,16 +596,16 @@ void arm_correlate_f16( while (k > 0U) { /* x[0] * y[srcBLen - 4] */ - sum += *px++ * *py++; + sum += (_Float16)*px++ * (_Float16)*py++; /* x[1] * y[srcBLen - 3] */ - sum += *px++ * *py++; + sum += (_Float16)*px++ * (_Float16)*py++; /* x[2] * y[srcBLen - 2] */ - sum += *px++ * *py++; + sum += (_Float16)*px++ * (_Float16)*py++; /* x[3] * y[srcBLen - 1] */ - sum += *px++ * *py++; + sum += (_Float16)*px++ * (_Float16)*py++; /* Decrement loop counter */ k--; @@ -669,7 +625,7 @@ void arm_correlate_f16( { /* Perform the multiply-accumulate */ /* x[0] * y[srcBLen - 1] */ - sum += *px++ * *py++; + sum += (_Float16)*px++ * (_Float16)*py++; /* Decrement loop counter */ k--; @@ -752,13 +708,13 @@ void arm_correlate_f16( /* Perform the multiply-accumulate */ /* acc0 += x[0] * y[0] */ - acc0 += x0 * c0; + acc0 += (_Float16)x0 * (_Float16)c0; /* acc1 += x[1] * y[0] */ - acc1 += x1 * c0; + acc1 += (_Float16)x1 * (_Float16)c0; /* acc2 += x[2] * y[0] */ - acc2 += x2 * c0; + acc2 += (_Float16)x2 * (_Float16)c0; /* acc3 += x[3] * y[0] */ - acc3 += x3 * c0; + acc3 += (_Float16)x3 * (_Float16)c0; /* Read y[1] sample */ c0 = *(py++); @@ -767,13 +723,13 @@ void arm_correlate_f16( /* Perform the multiply-accumulate */ /* acc0 += x[1] * y[1] */ - acc0 += x1 * c0; + acc0 += (_Float16)x1 * (_Float16)c0; /* acc1 += x[2] * y[1] */ - acc1 += x2 * c0; + acc1 += (_Float16)x2 * (_Float16)c0; /* acc2 += x[3] * y[1] */ - acc2 += x3 * c0; + acc2 += (_Float16)x3 * (_Float16)c0; /* acc3 += x[4] * y[1] */ - acc3 += x0 * c0; + acc3 += (_Float16)x0 * (_Float16)c0; /* Read y[2] sample */ c0 = *(py++); @@ -782,13 +738,13 @@ void arm_correlate_f16( /* Perform the multiply-accumulate */ /* acc0 += x[2] * y[2] */ - acc0 += x2 * c0; + acc0 += (_Float16)x2 * (_Float16)c0; /* acc1 += x[3] * y[2] */ - acc1 += x3 * c0; + acc1 += (_Float16)x3 * (_Float16)c0; /* acc2 += x[4] * y[2] */ - acc2 += x0 * c0; + acc2 += (_Float16)x0 * (_Float16)c0; /* acc3 += x[5] * y[2] */ - acc3 += x1 * c0; + acc3 += (_Float16)x1 * (_Float16)c0; /* Read y[3] sample */ c0 = *(py++); @@ -797,13 +753,13 @@ void arm_correlate_f16( /* Perform the multiply-accumulate */ /* acc0 += x[3] * y[3] */ - acc0 += x3 * c0; + acc0 += (_Float16)x3 * (_Float16)c0; /* acc1 += x[4] * y[3] */ - acc1 += x0 * c0; + acc1 += (_Float16)x0 * (_Float16)c0; /* acc2 += x[5] * y[3] */ - acc2 += x1 * c0; + acc2 += (_Float16)x1 * (_Float16)c0; /* acc3 += x[6] * y[3] */ - acc3 += x2 * c0; + acc3 += (_Float16)x2 * (_Float16)c0; } while (--k); @@ -820,13 +776,13 @@ void arm_correlate_f16( /* Perform the multiply-accumulate */ /* acc0 += x[4] * y[4] */ - acc0 += x0 * c0; + acc0 += (_Float16)x0 * (_Float16)c0; /* acc1 += x[5] * y[4] */ - acc1 += x1 * c0; + acc1 += (_Float16)x1 * (_Float16)c0; /* acc2 += x[6] * y[4] */ - acc2 += x2 * c0; + acc2 += (_Float16)x2 * (_Float16)c0; /* acc3 += x[7] * y[4] */ - acc3 += x3 * c0; + acc3 += (_Float16)x3 * (_Float16)c0; /* Reuse the present samples for the next MAC */ x0 = x1; @@ -888,10 +844,10 @@ void arm_correlate_f16( while (k > 0U) { /* Perform the multiply-accumulate */ - sum += *px++ * *py++; - sum += *px++ * *py++; - sum += *px++ * *py++; - sum += *px++ * *py++; + sum += (_Float16)*px++ * (_Float16)*py++; + sum += (_Float16)*px++ * (_Float16)*py++; + sum += (_Float16)*px++ * (_Float16)*py++; + sum += (_Float16)*px++ * (_Float16)*py++; /* Decrement loop counter */ k--; @@ -909,7 +865,7 @@ void arm_correlate_f16( while (k > 0U) { /* Perform the multiply-accumulate */ - sum += *px++ * *py++; + sum += (_Float16)*px++ * (_Float16)*py++; /* Decrement the loop counter */ k--; @@ -949,7 +905,7 @@ void arm_correlate_f16( while (k > 0U) { /* Perform the multiply-accumulate */ - sum += *px++ * *py++; + sum += (_Float16)*px++ * (_Float16)*py++; /* Decrement the loop counter */ k--; @@ -1016,16 +972,16 @@ void arm_correlate_f16( { /* Perform the multiply-accumulate */ /* sum += x[srcALen - srcBLen + 4] * y[3] */ - sum += *px++ * *py++; + sum += (_Float16)*px++ * (_Float16)*py++; /* sum += x[srcALen - srcBLen + 3] * y[2] */ - sum += *px++ * *py++; + sum += (_Float16)*px++ * (_Float16)*py++; /* sum += x[srcALen - srcBLen + 2] * y[1] */ - sum += *px++ * *py++; + sum += (_Float16)*px++ * (_Float16)*py++; /* sum += x[srcALen - srcBLen + 1] * y[0] */ - sum += *px++ * *py++; + sum += (_Float16)*px++ * (_Float16)*py++; /* Decrement loop counter */ k--; @@ -1044,7 +1000,7 @@ void arm_correlate_f16( while (k > 0U) { /* Perform the multiply-accumulate */ - sum += *px++ * *py++; + sum += (_Float16)*px++ * (_Float16)*py++; /* Decrement loop counter */ k--; @@ -1138,7 +1094,7 @@ void arm_correlate_f16( if ((((i - j) < srcBLen) && (j < srcALen))) { /* z[i] += x[i-j] * y[j] */ - sum += pIn1[j] * pIn2[-((int32_t) i - j)]; + sum += (_Float16)pIn1[j] * (_Float16)pIn2[-((int32_t) i - (int32_t) j)]; } } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_f32.c index bf1eaf5..7d4880e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_f32.c @@ -5,13 +5,13 @@ * Title: arm_correlate_f32.c * Description: Correlation of floating-point sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -48,16 +48,20 @@ @par Algorithm Let a[n] and b[n] be sequences of length srcALen and srcBLen samples respectively. The convolution of the two signals is denoted by -
-      c[n] = a[n] * b[n]
-  
+ \f[ + c[n] = a[n] * b[n] + \f] + In correlation, one of the signals is flipped in time -
-       c[n] = a[n] * b[-n]
-  
+ + \f[ + c[n] = a[n] * b[-n] + \f] @par and this is mathematically defined as - \image html CorrelateEquation.gif + \f[ + c[n] = \sum_{k=0}^{srcALen} a[k] b[k-n] + \f] @par The pSrcA points to the first input vector of length srcALen and pSrcB points to the second input vector of length srcBLen. The result c[n] is of length 2 * max(srcALen, srcBLen) - 1 and is defined over the interval n=0, 1, 2, ..., (2 * max(srcALen, srcBLen) - 2). @@ -78,6 +82,11 @@ @par Opt Versions Opt versions are supported for Q15 and Q7. Design uses internal scratch buffer for getting good optimisation. These versions are optimised in cycles and consumes more memory (Scratch memory) compared to Q15 and Q7 versions of correlate + + @par Long versions: + For convolution of long vectors, those functions are + no more adapted and will be very slow. + An implementation based upon FFTs should be used. */ /** @@ -1076,7 +1085,7 @@ void arm_correlate_f32( if ((((i - j) < srcBLen) && (j < srcALen))) { /* z[i] += x[i-j] * y[j] */ - sum += pIn1[j] * pIn2[-((int32_t) i - j)]; + sum += pIn1[j] * pIn2[-((int32_t) i - (int32_t) j)]; } } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_f64.c new file mode 100644 index 0000000..e0e9ba6 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_f64.c @@ -0,0 +1,369 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_correlate_f64.c + * Description: Correlation of floating-point sequences + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/filtering_functions.h" + +/** + @ingroup groupFilters + */ + +/** + @addtogroup Corr + @{ + */ + +/** + @brief Correlation of floating-point sequences. + @param[in] pSrcA points to the first input sequence + @param[in] srcALen length of the first input sequence + @param[in] pSrcB points to the second input sequence + @param[in] srcBLen length of the second input sequence + @param[out] pDst points to the location where the output result is written. Length 2 * max(srcALen, srcBLen) - 1. + @return none + */ + +void arm_correlate_f64( + const float64_t * pSrcA, + uint32_t srcALen, + const float64_t * pSrcB, + uint32_t srcBLen, + float64_t * pDst) +{ + const float64_t *pIn1; /* InputA pointer */ + const float64_t *pIn2; /* InputB pointer */ + float64_t *pOut = pDst; /* Output pointer */ + const float64_t *px; /* Intermediate inputA pointer */ + const float64_t *py; /* Intermediate inputB pointer */ + const float64_t *pSrc1; + float64_t sum; + uint32_t blockSize1, blockSize2, blockSize3; /* Loop counters */ + uint32_t j, k, count, blkCnt; /* Loop counters */ + uint32_t outBlockSize; /* Loop counter */ + int32_t inc = 1; /* Destination address modifier */ + + /* The algorithm implementation is based on the lengths of the inputs. */ + /* srcB is always made to slide across srcA. */ + /* So srcBLen is always considered as shorter or equal to srcALen */ + /* But CORR(x, y) is reverse of CORR(y, x) */ + /* So, when srcBLen > srcALen, output pointer is made to point to the end of the output buffer */ + /* and the destination pointer modifier, inc is set to -1 */ + /* If srcALen > srcBLen, zero pad has to be done to srcB to make the two inputs of same length */ + /* But to improve the performance, + * we assume zeroes in the output instead of zero padding either of the the inputs*/ + /* If srcALen > srcBLen, + * (srcALen - srcBLen) zeroes has to included in the starting of the output buffer */ + /* If srcALen < srcBLen, + * (srcALen - srcBLen) zeroes has to included in the ending of the output buffer */ + if (srcALen >= srcBLen) + { + /* Initialization of inputA pointer */ + pIn1 = pSrcA; + + /* Initialization of inputB pointer */ + pIn2 = pSrcB; + + /* Number of output samples is calculated */ + outBlockSize = (2U * srcALen) - 1U; + + /* When srcALen > srcBLen, zero padding has to be done to srcB + * to make their lengths equal. + * Instead, (outBlockSize - (srcALen + srcBLen - 1)) + * number of output samples are made zero */ + j = outBlockSize - (srcALen + (srcBLen - 1U)); + + /* Updating the pointer position to non zero value */ + pOut += j; + } + else + { + /* Initialization of inputA pointer */ + pIn1 = pSrcB; + + /* Initialization of inputB pointer */ + pIn2 = pSrcA; + + /* srcBLen is always considered as shorter or equal to srcALen */ + j = srcBLen; + srcBLen = srcALen; + srcALen = j; + + /* CORR(x, y) = Reverse order(CORR(y, x)) */ + /* Hence set the destination pointer to point to the last output sample */ + pOut = pDst + ((srcALen + srcBLen) - 2U); + + /* Destination address modifier is set to -1 */ + inc = -1; + } + + /* The function is internally + * divided into three stages according to the number of multiplications that has to be + * taken place between inputA samples and inputB samples. In the first stage of the + * algorithm, the multiplications increase by one for every iteration. + * In the second stage of the algorithm, srcBLen number of multiplications are done. + * In the third stage of the algorithm, the multiplications decrease by one + * for every iteration. */ + + /* The algorithm is implemented in three stages. + The loop counters of each stage is initiated here. */ + blockSize1 = srcBLen - 1U; + blockSize2 = srcALen - (srcBLen - 1U); + blockSize3 = blockSize1; + + /* -------------------------- + * Initializations of stage1 + * -------------------------*/ + + /* sum = x[0] * y[srcBlen - 1] + * sum = x[0] * y[srcBlen-2] + x[1] * y[srcBlen - 1] + * .... + * sum = x[0] * y[0] + x[1] * y[1] +...+ x[srcBLen - 1] * y[srcBLen - 1] + */ + + /* In this stage the MAC operations are increased by 1 for every iteration. + The count variable holds the number of MAC operations performed */ + count = 1U; + + /* Working pointer of inputA */ + px = pIn1; + + /* Working pointer of inputB */ + pSrc1 = pIn2 + (srcBLen - 1U); + py = pSrc1; + + /* ------------------------ + * Stage1 process + * ----------------------*/ + + /* The first stage starts here */ + while (blockSize1 > 0U) + { + /* Accumulator is made zero for every iteration */ + sum = 0.; + + /* Initialize k with number of samples */ + k = count; + + while (k > 0U) + { + /* Perform the multiply-accumulate */ + /* x[0] * y[srcBLen - 1] */ + sum += *px++ * *py++; + + /* Decrement loop counter */ + k--; + } + + /* Store the result in the accumulator in the destination buffer. */ + *pOut = sum; + /* Destination pointer is updated according to the address modifier, inc */ + pOut += inc; + + /* Update the inputA and inputB pointers for next MAC calculation */ + py = pSrc1 - count; + px = pIn1; + + /* Increment MAC count */ + count++; + + /* Decrement loop counter */ + blockSize1--; + } + + /* -------------------------- + * Initializations of stage2 + * ------------------------*/ + + /* sum = x[0] * y[0] + x[1] * y[1] +...+ x[srcBLen-1] * y[srcBLen-1] + * sum = x[1] * y[0] + x[2] * y[1] +...+ x[srcBLen] * y[srcBLen-1] + * .... + * sum = x[srcALen-srcBLen-2] * y[0] + x[srcALen-srcBLen-1] * y[1] +...+ x[srcALen-1] * y[srcBLen-1] + */ + + /* Working pointer of inputA */ + px = pIn1; + + /* Working pointer of inputB */ + py = pIn2; + + /* count is index by which the pointer pIn1 to be incremented */ + count = 0U; + + /* ------------------- + * Stage2 process + * ------------------*/ + + /* Stage2 depends on srcBLen as in this stage srcBLen number of MACS are performed. + * So, to loop unroll over blockSize2, + * srcBLen should be greater than or equal to 4 */ + if (srcBLen >= 4U) + { + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize2; + + while (blkCnt > 0U) + { + /* Accumulator is made zero for every iteration */ + sum = 0.; + + /* Initialize blkCnt with number of samples */ + k = srcBLen; + + while (k > 0U) + { + /* Perform the multiply-accumulate */ + sum += *px++ * *py++; + + /* Decrement the loop counter */ + k--; + } + + /* Store the result in the accumulator in the destination buffer. */ + *pOut = sum; + + /* Destination pointer is updated according to the address modifier, inc */ + pOut += inc; + + /* Increment the pointer pIn1 index, count by 1 */ + count++; + + /* Update the inputA and inputB pointers for next MAC calculation */ + px = pIn1 + count; + py = pIn2; + + /* Decrement the loop counter */ + blkCnt--; + } + } + else + { + /* If the srcBLen is not a multiple of 4, + * the blockSize2 loop cannot be unrolled by 4 */ + blkCnt = blockSize2; + + while (blkCnt > 0U) + { + /* Accumulator is made zero for every iteration */ + sum = 0.; + + /* Loop over srcBLen */ + k = srcBLen; + + while (k > 0U) + { + /* Perform the multiply-accumulate */ + sum += *px++ * *py++; + + /* Decrement the loop counter */ + k--; + } + + /* Store the result in the accumulator in the destination buffer. */ + *pOut = sum; + /* Destination pointer is updated according to the address modifier, inc */ + pOut += inc; + + /* Increment the pointer pIn1 index, count by 1 */ + count++; + + /* Update the inputA and inputB pointers for next MAC calculation */ + px = pIn1 + count; + py = pIn2; + + /* Decrement the loop counter */ + blkCnt--; + } + } + + + /* -------------------------- + * Initializations of stage3 + * -------------------------*/ + + /* sum += x[srcALen-srcBLen+1] * y[0] + x[srcALen-srcBLen+2] * y[1] +...+ x[srcALen-1] * y[srcBLen-1] + * sum += x[srcALen-srcBLen+2] * y[0] + x[srcALen-srcBLen+3] * y[1] +...+ x[srcALen-1] * y[srcBLen-1] + * .... + * sum += x[srcALen-2] * y[0] + x[srcALen-1] * y[1] + * sum += x[srcALen-1] * y[0] + */ + + /* In this stage the MAC operations are decreased by 1 for every iteration. + The count variable holds the number of MAC operations performed */ + count = srcBLen - 1U; + + /* Working pointer of inputA */ + pSrc1 = pIn1 + (srcALen - (srcBLen - 1U)); + px = pSrc1; + + /* Working pointer of inputB */ + py = pIn2; + + /* ------------------- + * Stage3 process + * ------------------*/ + + while (blockSize3 > 0U) + { + /* Accumulator is made zero for every iteration */ + sum = 0.; + + /* Initialize blkCnt with number of samples */ + k = count; + + while (k > 0U) + { + /* Perform the multiply-accumulate */ + sum += *px++ * *py++; + + /* Decrement loop counter */ + k--; + } + + /* Store the result in the accumulator in the destination buffer. */ + *pOut = sum; + /* Destination pointer is updated according to the address modifier, inc */ + pOut += inc; + + /* Update the inputA and inputB pointers for next MAC calculation */ + px = ++pSrc1; + py = pIn2; + + /* Decrement MAC count */ + count--; + + /* Decrement the loop counter */ + blockSize3--; + } +} + +/** + @} end of Corr group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_fast_opt_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_fast_opt_q15.c index 71f01a9..2f655d7 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_fast_opt_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_fast_opt_q15.c @@ -5,13 +5,13 @@ * Title: arm_correlate_fast_opt_q15.c * Description: Fast Q15 Correlation * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_fast_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_fast_q15.c index 970c7aa..ecb26da 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_fast_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_fast_q15.c @@ -5,13 +5,13 @@ * Title: arm_correlate_fast_q15.c * Description: Fast Q15 Correlation * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_fast_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_fast_q31.c index a2967d9..5747e13 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_fast_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_fast_q31.c @@ -5,13 +5,13 @@ * Title: arm_correlate_fast_q31.c * Description: Fast Q31 Correlation * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_opt_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_opt_q15.c index c7d0dd1..5283f24 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_opt_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_opt_q15.c @@ -5,13 +5,13 @@ * Title: arm_correlate_opt_q15.c * Description: Correlation of Q15 sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_opt_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_opt_q7.c index db70a77..0cab9f2 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_opt_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_opt_q7.c @@ -5,13 +5,13 @@ * Title: arm_correlate_opt_q7.c * Description: Correlation of Q7 sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_q15.c index b7882cc..aa8bc35 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_q15.c @@ -5,13 +5,13 @@ * Title: arm_correlate_q15.c * Description: Correlation of Q15 sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -884,7 +884,7 @@ void arm_correlate_q15( if (((i - j) < srcBLen) && (j < srcALen)) { /* z[i] += x[i-j] * y[j] */ - sum += ((q31_t) pIn1[j] * pIn2[-((int32_t) i - j)]); + sum += ((q31_t) pIn1[j] * pIn2[-((int32_t) i - (int32_t) j)]); } } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_q31.c index 44d2f27..4aa50da 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_q31.c @@ -5,13 +5,13 @@ * Title: arm_correlate_q31.c * Description: Correlation of Q31 sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -860,7 +860,7 @@ void arm_correlate_q31( if (((i - j) < srcBLen) && (j < srcALen)) { /* z[i] += x[i-j] * y[j] */ - sum += ((q63_t) pIn1[j] * pIn2[-((int32_t) i - j)]); + sum += ((q63_t) pIn1[j] * pIn2[-((int32_t) i - (int32_t) j)]); } } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_q7.c index 4ff13c4..095ec99 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_correlate_q7.c @@ -5,13 +5,13 @@ * Title: arm_correlate_q7.c * Description: Correlation of Q7 sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -983,7 +983,7 @@ void arm_correlate_q7( if (((i - j) < srcBLen) && (j < srcALen)) { /* z[i] += x[i-j] * y[j] */ - sum += ((q15_t) pIn1[j] * pIn2[-((int32_t) i - j)]); + sum += ((q15_t) pIn1[j] * pIn2[-((int32_t) i - (int32_t) j)]); } } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_f32.c index 6bcf66f..cf641ec 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_f32.c @@ -5,13 +5,13 @@ * Title: arm_fir_decimate_f32.c * Description: FIR decimation for floating-point sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -144,7 +144,7 @@ void arm_fir_decimate_f32( uint32_t i, tapCnt, blkCnt, outBlockSize = blockSize / S->M; /* Loop counters */ uint32_t blkCntN4; const float32_t *px0, *px1, *px2, *px3; - f32x4_t accv, acc0v, acc1v, acc2v, acc3v; + f32x4_t accv = { 0 }, acc0v, acc1v, acc2v, acc3v; f32x4_t x0v, x1v, x2v, x3v; f32x4_t c0v; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_fast_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_fast_q15.c index 42fdade..66f0e90 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_fast_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_fast_q15.c @@ -5,13 +5,13 @@ * Title: arm_fir_decimate_fast_q15.c * Description: Fast Q15 FIR Decimator * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_fast_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_fast_q31.c index 61c7c27..6aa1a23 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_fast_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_fast_q31.c @@ -5,13 +5,13 @@ * Title: arm_fir_decimate_fast_q31.c * Description: Fast Q31 FIR Decimator * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_init_f32.c index 8e08403..c67b49c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_fir_decimate_init_f32.c * Description: Floating-point FIR Decimator initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_init_q15.c index 61562f9..9c4913f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_init_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_init_q15.c @@ -5,13 +5,13 @@ * Title: arm_fir_decimate_init_q15.c * Description: Initialization function for the Q15 FIR Decimator * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_init_q31.c index 04248e7..a4bb036 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_fir_decimate_init_q31.c * Description: Initialization function for Q31 FIR Decimation filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_q15.c index 419c544..cd03e0c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_q15.c @@ -5,13 +5,13 @@ * Title: arm_fir_decimate_q15.c * Description: Q15 FIR Decimator * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_q31.c index 0eb7123..d104b35 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_decimate_q31.c @@ -5,13 +5,13 @@ * Title: arm_fir_decimate_q31.c * Description: Q31 FIR Decimator * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_f16.c index ff74a44..28a974e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_f16.c @@ -5,10 +5,13 @@ * Title: arm_fir_f16.c * Description: Floating-point FIR filter processing function * - * Target Processor: Cortex-M cores + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -58,6 +61,7 @@ vecAcc0 = vfmaq(vecAcc0, vecIn0, c[i]); \ } +#define NB_TAPS 4 __STATIC_INLINE void arm_fir_f16_1_4_mve(const arm_fir_instance_f16 * S, const float16_t * __restrict pSrc, float16_t * __restrict pDst, uint32_t blockSize) @@ -73,7 +77,6 @@ __STATIC_INLINE void arm_fir_f16_1_4_mve(const arm_fir_instance_f16 * S, int32_t blkCnt; float16x8_t vecIn0; float16x8_t vecAcc0; - const int NB_TAPS=4; float16_t c[NB_TAPS]; @@ -146,8 +149,9 @@ __STATIC_INLINE void arm_fir_f16_1_4_mve(const arm_fir_instance_f16 * S, } } +#undef NB_TAPS - +#define NB_TAPS 8 __STATIC_INLINE void arm_fir_f16_5_8_mve(const arm_fir_instance_f16 * S, const float16_t * __restrict pSrc, float16_t * __restrict pDst, uint32_t blockSize) @@ -163,7 +167,6 @@ __STATIC_INLINE void arm_fir_f16_5_8_mve(const arm_fir_instance_f16 * S, int32_t blkCnt; float16x8_t vecIn0; float16x8_t vecAcc0; - const int NB_TAPS=8; float16_t c[NB_TAPS]; @@ -236,7 +239,7 @@ __STATIC_INLINE void arm_fir_f16_5_8_mve(const arm_fir_instance_f16 * S, } } - +#undef NB_TAPS void arm_fir_f16(const arm_fir_instance_f16 * S, const float16_t * pSrc, @@ -871,7 +874,7 @@ void arm_fir_f16( while (i > 0U) { /* acc = b[numTaps-1] * x[n-numTaps-1] + b[numTaps-2] * x[n-numTaps-2] + b[numTaps-3] * x[n-numTaps-3] +...+ b[0] * x[0] */ - acc0 += *px++ * *pb++; + acc0 += (_Float16)*px++ * (_Float16)*pb++; i--; } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_f32.c index d213bc4..8fcc5ae 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_f32.c @@ -5,13 +5,13 @@ * Title: arm_fir_f32.c * Description: Floating-point FIR filter processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -99,13 +99,23 @@ where numTaps is the number of filter coefficients in the filter; pState is the address of the state buffer; pCoeffs is the address of the coefficient buffer. @par Initialization of Helium version - For Helium version the array of coefficients must be a multiple of 16 even if less - then 16 coefficients are used. The additional coefficients must be set to 0. - It does not mean that all the coefficients will be used in the filter (numTaps - is still set to its right value in the init function.) It just means that + For Helium version the array of coefficients must be padded with zero to contain + a full number of lanes. + + The array length L must be a multiple of x. L = x * a : + - x is 4 for f32 + - x is 4 for q31 + - x is 4 for f16 (so managed like the f32 version and not like the q15 one) + - x is 8 for q15 + - x is 16 for q7 + + The additional coefficients + (x * a - numTaps) must be set to 0. + numTaps is still set to its right value in the init function. It means that the implementation may require to read more coefficients due to the vectorization and to avoid having to manage too many different cases in the code. + @par Helium state buffer The state buffer must contain some additional temporary data used during the computation but which is not the state of the FIR. @@ -152,6 +162,7 @@ } +#define NB_TAPS 4 __STATIC_INLINE void arm_fir_f32_1_4_mve(const arm_fir_instance_f32 * S, const float32_t * __restrict pSrc, float32_t * __restrict pDst, uint32_t blockSize) @@ -168,7 +179,6 @@ __STATIC_INLINE void arm_fir_f32_1_4_mve(const arm_fir_instance_f32 * S, int32_t blkCnt; float32x4_t vecIn0; float32x4_t vecAcc0; - const int NB_TAPS=4; float32_t c[NB_TAPS]; const float32_t *pCoeffsCur = pCoeffs; @@ -235,8 +245,7 @@ __STATIC_INLINE void arm_fir_f32_1_4_mve(const arm_fir_instance_f32 * S, } while (blkCnt > 0); } - - +#undef NB_TAPS __STATIC_INLINE void arm_fir_f32_5_8_mve(const arm_fir_instance_f32 * S, const float32_t * __restrict pSrc, diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_f64.c new file mode 100644 index 0000000..2aaa4fb --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_f64.c @@ -0,0 +1,133 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_fir_f64.c + * Description: Floating-point FIR filter processing function + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/filtering_functions.h" + +/** + @ingroup groupFilters + */ + +/** + @addtogroup FIR + @{ + */ + +/** + @brief Processing function for floating-point FIR filter. + @param[in] S points to an instance of the floating-point FIR filter structure + @param[in] pSrc points to the block of input data + @param[out] pDst points to the block of output data + @param[in] blockSize number of samples to process + @return none + */ + +void arm_fir_f64( + const arm_fir_instance_f64 * S, + const float64_t * pSrc, + float64_t * pDst, + uint32_t blockSize) +{ + float64_t *pState = S->pState; /* State pointer */ + const float64_t *pCoeffs = S->pCoeffs; /* Coefficient pointer */ + float64_t *pStateCurnt; /* Points to the current sample of the state */ + float64_t *px; /* Temporary pointer for state buffer */ + const float64_t *pb; /* Temporary pointer for coefficient buffer */ + float64_t acc0; /* Accumulator */ + uint32_t numTaps = S->numTaps; /* Number of filter coefficients in the filter */ + uint32_t i, tapCnt, blkCnt; /* Loop counters */ + + /* S->pState points to state array which contains previous frame (numTaps - 1) samples */ + /* pStateCurnt points to the location where the new input data should be written */ + pStateCurnt = &(S->pState[(numTaps - 1U)]); + + /* Initialize blkCnt with number of taps */ + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* Copy one sample at a time into state buffer */ + *pStateCurnt++ = *pSrc++; + + /* Set the accumulator to zero */ + acc0 = 0.; + + /* Initialize state pointer */ + px = pState; + + /* Initialize Coefficient pointer */ + pb = pCoeffs; + + i = numTaps; + + /* Perform the multiply-accumulates */ + while (i > 0U) + { + /* acc = b[numTaps-1] * x[n-numTaps-1] + b[numTaps-2] * x[n-numTaps-2] + b[numTaps-3] * x[n-numTaps-3] +...+ b[0] * x[0] */ + acc0 += *px++ * *pb++; + + i--; + } + + /* Store result in destination buffer. */ + *pDst++ = acc0; + + /* Advance state pointer by 1 for the next sample */ + pState = pState + 1U; + + /* Decrement loop counter */ + blkCnt--; + } + + /* Processing is complete. + Now copy the last numTaps - 1 samples to the start of the state buffer. + This prepares the state buffer for the next function call. */ + + /* Points to the start of the state buffer */ + pStateCurnt = S->pState; + + /* Initialize tapCnt with number of taps */ + tapCnt = (numTaps - 1U); + + /* Copy remaining data */ + while (tapCnt > 0U) + { + *pStateCurnt++ = *pState++; + + /* Decrement loop counter */ + tapCnt--; + } + +} + +/** +* @} end of FIR group +*/ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_fast_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_fast_q15.c index 0603ce3..d33fb86 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_fast_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_fast_q15.c @@ -5,13 +5,13 @@ * Title: arm_fir_fast_q15.c * Description: Q15 Fast FIR filter processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_fast_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_fast_q31.c index 991af2f..d50f463 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_fast_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_fast_q31.c @@ -5,13 +5,13 @@ * Title: arm_fir_fast_q31.c * Description: Processing function for the Q31 Fast FIR filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -60,7 +60,6 @@ Use function \ref arm_fir_init_q31() to initialize the filter structure. */ -IAR_ONLY_LOW_OPTIMIZATION_ENTER void arm_fir_fast_q31( const arm_fir_instance_q31 * S, const q31_t * pSrc, @@ -320,7 +319,6 @@ void arm_fir_fast_q31( } } -IAR_ONLY_LOW_OPTIMIZATION_EXIT /** @} end of FIR group */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_f16.c index 9e52dc3..2bc43b5 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_f16.c @@ -5,10 +5,13 @@ * Title: arm_fir_init_f16.c * Description: Floating-point FIR filter initialization function * - * Target Processor: Cortex-M cores + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -56,13 +59,14 @@ pState points to the array of state variables. pState is of length numTaps+blockSize-1 samples (except for Helium - see below), where blockSize is the number of input samples processed by each call to arm_fir_f16(). @par Initialization of Helium version - For Helium version the array of coefficients must be a multiple of 16 even if less - then 16 coefficients are used. The additional coefficients must be set to 0. - It does not mean that all the coefficients will be used in the filter (numTaps - is still set to its right value in the init function.) It just means that + For Helium version the array of coefficients must be a multiple of 4 (4a) even if less + then 4a coefficients are defined in the FIR. The additional coefficients + (4a - numTaps) must be set to 0. + numTaps is still set to its right value in the init function. It means that the implementation may require to read more coefficients due to the vectorization and to avoid having to manage too many different cases in the code. + @par Helium state buffer The state buffer must contain some additional temporary data used during the computation but which is not the state of the FIR. diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_f32.c index 4dd4333..cbc3989 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_fir_init_f32.c * Description: Floating-point FIR filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -57,10 +57,10 @@ pState points to the array of state variables and some working memory for the Helium version. pState is of length numTaps+blockSize-1 samples (except for Helium - see below), where blockSize is the number of input samples processed by each call to arm_fir_f32(). @par Initialization of Helium version - For Helium version the array of coefficients must be a multiple of 16 even if less - then 16 coefficients are used. The additional coefficients must be set to 0. - It does not mean that all the coefficients will be used in the filter (numTaps - is still set to its right value in the init function.) It just means that + For Helium version the array of coefficients must be a multiple of 4 (4a) even if less + then 4a coefficients are defined in the FIR. The additional coefficients + (4a - numTaps) must be set to 0. + numTaps is still set to its right value in the init function. It means that the implementation may require to read more coefficients due to the vectorization and to avoid having to manage too many different cases in the code. diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_f64.c new file mode 100644 index 0000000..16ca036 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_f64.c @@ -0,0 +1,88 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_fir_init_f64.c + * Description: Floating-point FIR filter initialization function + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/filtering_functions.h" + +/** + @ingroup groupFilters + */ + +/** + @addtogroup FIR + @{ + */ + +/** + @brief Initialization function for the floating-point FIR filter. + @param[in,out] S points to an instance of the floating-point FIR filter structure + @param[in] numTaps number of filter coefficients in the filter + @param[in] pCoeffs points to the filter coefficients buffer + @param[in] pState points to the state buffer + @param[in] blockSize number of samples processed per call + @return none + + @par Details + pCoeffs points to the array of filter coefficients stored in time reversed order: +
+      {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]}
+  
+ @par + pState points to the array of state variables. + pState is of length numTaps+blockSize-1 samples, where blockSize is the number of input samples processed by each call to arm_fir_f64(). + + @par + There is no Helium version of the fir F64. + + */ + +void arm_fir_init_f64( + arm_fir_instance_f64 * S, + uint16_t numTaps, + const float64_t * pCoeffs, + float64_t * pState, + uint32_t blockSize) +{ + /* Assign filter taps */ + S->numTaps = numTaps; + + /* Assign coefficient pointer */ + S->pCoeffs = pCoeffs; + + /* Clear state buffer. The size is always (blockSize + numTaps - 1) */ + memset(pState, 0, (numTaps + (blockSize - 1U)) * sizeof(float64_t)); + /* Assign state pointer */ + S->pState = pState; +} + +/** + @} end of FIR group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_q15.c index 605aff1..6853f1f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_q15.c @@ -5,13 +5,13 @@ * Title: arm_fir_init_q15.c * Description: Q15 FIR filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -75,6 +75,14 @@ pState points to the array of state variables. pState is of length numTaps+blockSize, when running on Cortex-M4 and Cortex-M3 and is of length numTaps+blockSize-1, when running on Cortex-M0 where blockSize is the number of input samples processed by each call to arm_fir_q15(). + + @par Initialization of Helium version + For Helium version the array of coefficients must be a multiple of 8 (8a) even if less + then 8a coefficients are defined in the FIR. The additional coefficients + (8a - numTaps) must be set to 0. + numTaps is still set to its right value in the init function. It means that + the implementation may require to read more coefficients due to the vectorization and + to avoid having to manage too many different cases in the code. */ arm_status arm_fir_init_q15( diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_q31.c index df552ae..de44f74 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_fir_init_q31.c * Description: Q31 FIR filter initialization function. * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -57,10 +57,10 @@ pState is of length numTaps+blockSize-1 samples (except for Helium - see below), where blockSize is the number of input samples processed by each call to arm_fir_q31(). @par Initialization of Helium version - For Helium version the array of coefficients must be a multiple of 16 even if less - then 16 coefficients are used. The additional coefficients must be set to 0. - It does not mean that all the coefficients will be used in the filter (numTaps - is still set to its right value in the init function.) It just means that + For Helium version the array of coefficients must be a multiple of 4 (4a) even if less + then 4a coefficients are defined in the FIR. The additional coefficients + (4a - numTaps) must be set to 0. + numTaps is still set to its right value in the init function. It means that the implementation may require to read more coefficients due to the vectorization and to avoid having to manage too many different cases in the code. diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_q7.c index 5101d72..db14670 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_init_q7.c @@ -5,13 +5,13 @@ * Title: arm_fir_init_q7.c * Description: Q7 FIR filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -56,6 +56,15 @@ @par pState points to the array of state variables. pState is of length numTaps+blockSize-1 samples, where blockSize is the number of input samples processed by each call to arm_fir_q7(). + + @par Initialization of Helium version + For Helium version the array of coefficients must be a multiple of 16 (16a) even if less + then 16a coefficients are defined in the FIR. The additional coefficients + (16a - numTaps) must be set to 0. + numTaps is still set to its right value in the init function. It means that + the implementation may require to read more coefficients due to the vectorization and + to avoid having to manage too many different cases in the code. + */ void arm_fir_init_q7( diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_f32.c index c5a349b..ddff5c2 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_f32.c @@ -5,13 +5,13 @@ * Title: arm_fir_interpolate_f32.c * Description: Floating-point FIR interpolation sequences * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -149,7 +149,7 @@ static void arm_fir_interpolate2_f32_mve( uint32_t blkCnt; /* Loop counters */ uint16_t phaseLen = S->phaseLength; /* Length of each polyphase filter component */ uint32_t strides[4] = { 0, 1 * 2, 2 * 2, 3 * 2 }; - uint32x4_t vec_strides0 = *(uint32x4_t *) strides; + uint32x4_t vec_strides0 = vld1q_u32(strides); uint32x4_t vec_strides1 = vec_strides0 + 1; f32x4_t acc0, acc1; @@ -273,8 +273,8 @@ void arm_fir_interpolate_f32( uint16_t phaseLen = S->phaseLength; /* Length of each polyphase filter component */ uint32_t strides[4] = { 0, 1 * S->L, 2 * S->L, 3 * S->L }; uint32_t stridesM[4] = { 4, 3, 2, 1 }; - uint32x4_t vec_stridesM = *(uint32x4_t *) stridesM; - uint32x4_t vec_strides = *(uint32x4_t *) strides; + uint32x4_t vec_stridesM = vld1q_u32(stridesM); + uint32x4_t vec_strides = vld1q_u32(strides); f32x4_t acc; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_init_f32.c index b135fa9..cfbf102 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_fir_interpolate_init_f32.c * Description: Floating-point FIR interpolator initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_init_q15.c index 4cd35cb..f016592 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_init_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_init_q15.c @@ -5,13 +5,13 @@ * Title: arm_fir_interpolate_init_q15.c * Description: Q15 FIR interpolator initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_init_q31.c index 682ba10..cd40905 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_fir_interpolate_init_q31.c * Description: Q31 FIR interpolator initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_q15.c index de3d48e..21691ee 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_q15.c @@ -5,13 +5,13 @@ * Title: arm_fir_interpolate_q15.c * Description: Q15 FIR interpolation * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_q31.c index 4e737da..edd0c70 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_interpolate_q31.c @@ -5,13 +5,13 @@ * Title: arm_fir_interpolate_q31.c * Description: Q31 FIR interpolation * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -73,7 +73,7 @@ void arm_fir_interpolate_q31( uint32_t i, blkCnt; /* Loop counters */ uint16_t phaseLen = S->phaseLength; /* Length of each polyphase filter component */ uint32_t strides[4] = { 0, 1 * S->L, 2 * S->L, 3 * S->L }; - uint32x4_t vec_strides0 = *(uint32x4_t *) strides; + uint32x4_t vec_strides0 = vld1q_u32(strides); uint32x4_t vec_strides1 = vec_strides0 + 1; uint32x4_t vec_strides2 = vec_strides0 + 2; uint32x4_t vec_strides3 = vec_strides0 + 3; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_f32.c index 0f28abe..9655bb0 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_f32.c @@ -5,13 +5,13 @@ * Title: arm_fir_lattice_f32.c * Description: Processing function for floating-point FIR Lattice filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -37,6 +37,9 @@ /** @defgroup FIR_Lattice Finite Impulse Response (FIR) Lattice Filters + @deprecated Those functions are no more tested nor maintained and will be removed in + a future version. + This set of functions implements Finite Impulse Response (FIR) lattice filters for Q15, Q31 and floating-point data types. Lattice filters are used in a variety of adaptive filter applications. The filter structure is feedforward and diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_init_f32.c index 720dd17..2e7b6a4 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_fir_lattice_init_f32.c * Description: Floating-point FIR Lattice filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_init_q15.c index 7743ebd..27fe5ca 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_init_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_init_q15.c @@ -5,13 +5,13 @@ * Title: arm_fir_lattice_init_q15.c * Description: Q15 FIR Lattice filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_init_q31.c index e85c34a..c2f29d2 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_fir_lattice_init_q31.c * Description: Q31 FIR lattice filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_q15.c index ec87561..dbb91c2 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_q15.c @@ -5,13 +5,13 @@ * Title: arm_fir_lattice_q15.c * Description: Q15 FIR lattice filter processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_q31.c index ecf5880..e5de1f7 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_lattice_q31.c @@ -5,13 +5,13 @@ * Title: arm_fir_lattice_q31.c * Description: Q31 FIR lattice filter processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_q15.c index e1531b6..f197d15 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_q15.c @@ -5,13 +5,13 @@ * Title: arm_fir_q15.c * Description: Q15 FIR filter processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -88,14 +88,13 @@ uint32_t numTaps = S->numTaps; /* Number of filter coefficients in the filter */\ int32_t blkCnt; \ q15x8_t vecIn0; \ - const int32_t nbVecTaps = (NBTAPS / 8); \ \ /* \ * load coefs \ */ \ - q15x8_t vecCoeffs[nbVecTaps]; \ + q15x8_t vecCoeffs[NBVECTAPS]; \ \ - for (int i = 0; i < nbVecTaps; i++) \ + for (int i = 0; i < NBVECTAPS; i++) \ vecCoeffs[i] = vldrhq_s16(pCoeffs + 8 * i); \ \ /* \ @@ -116,7 +115,7 @@ pStateCur += 4; \ pTempSrc += 4; \ \ - FIR_Q15_CORE(pOutput, 4, nbVecTaps, pSamples, vecCoeffs); \ + FIR_Q15_CORE(pOutput, 4, NBVECTAPS, pSamples, vecCoeffs); \ pSamples += 4; \ \ blkCnt--; \ @@ -128,7 +127,7 @@ for (int i = 0; i < residual; i++) \ *pStateCur++ = *pTempSrc++; \ \ - FIR_Q15_CORE(pOutput, residual, nbVecTaps, pSamples, vecCoeffs); \ + FIR_Q15_CORE(pOutput, residual, NBVECTAPS, pSamples, vecCoeffs); \ \ /* \ * Copy the samples back into the history buffer start \ @@ -158,7 +157,9 @@ static void arm_fir_q15_25_32_mve(const arm_fir_instance_q15 * S, q15_t * __restrict pDst, uint32_t blockSize) { #define NBTAPS 32 + #define NBVECTAPS (NBTAPS / 8) FIR_Q15_MAIN_CORE(); + #undef NBVECTAPS #undef NBTAPS } @@ -167,7 +168,9 @@ static void arm_fir_q15_17_24_mve(const arm_fir_instance_q15 * S, q15_t * __restrict pDst, uint32_t blockSize) { #define NBTAPS 24 + #define NBVECTAPS (NBTAPS / 8) FIR_Q15_MAIN_CORE(); + #undef NBVECTAPS #undef NBTAPS } @@ -177,7 +180,9 @@ static void arm_fir_q15_9_16_mve(const arm_fir_instance_q15 * S, q15_t * __restrict pDst, uint32_t blockSize) { #define NBTAPS 16 + #define NBVECTAPS (NBTAPS / 8) FIR_Q15_MAIN_CORE(); + #undef NBVECTAPS #undef NBTAPS } @@ -186,7 +191,9 @@ static void arm_fir_q15_1_8_mve(const arm_fir_instance_q15 * S, q15_t * __restrict pDst, uint32_t blockSize) { #define NBTAPS 8 + #define NBVECTAPS (NBTAPS / 8) FIR_Q15_MAIN_CORE(); + #undef NBVECTAPS #undef NBTAPS } @@ -520,7 +527,7 @@ void arm_fir_q15( while (tapCnt > 0U) { /* Read the first two coefficients using SIMD: b[N] and b[N-1] coefficients */ - c0 = read_q15x2_ia ((q15_t **) &pb); + c0 = read_q15x2_ia (&pb); /* acc0 += b[N] * x[n-N] + b[N-1] * x[n-N-1] */ acc0 = __SMLALD(x0, c0, acc0); @@ -552,7 +559,7 @@ void arm_fir_q15( acc3 = __SMLALDX(x1, c0, acc3); /* Read coefficients b[N-2], b[N-3] */ - c0 = read_q15x2_ia ((q15_t **) &pb); + c0 = read_q15x2_ia (&pb); /* acc0 += b[N-2] * x[n-N-2] + b[N-3] * x[n-N-3] */ acc0 = __SMLALD(x2, c0, acc0); @@ -585,7 +592,7 @@ void arm_fir_q15( if ((numTaps & 0x3U) != 0U) { /* Read last two coefficients */ - c0 = read_q15x2_ia ((q15_t **) &pb); + c0 = read_q15x2_ia (&pb); /* Perform the multiply-accumulates */ acc0 = __SMLALD(x0, c0, acc0); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_q31.c index 0b02824..16bd7e9 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_q31.c @@ -5,13 +5,13 @@ * Title: arm_fir_q31.c * Description: Q31 FIR filter processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -119,14 +119,13 @@ q31_t *pTempDest; /* Temporary pointer to the destination buffer */\ uint32_t numTaps = S->numTaps; /* Number of filter coefficients in the filter */\ int32_t blkCnt; \ - const int32_t nbVecTaps = (NBTAPS / 4); \ \ /* \ * load coefs \ */ \ - q31x4_t vecCoeffs[nbVecTaps]; \ + q31x4_t vecCoeffs[NBVECTAPS]; \ \ - for (int i = 0; i < nbVecTaps; i++) \ + for (int i = 0; i < NBVECTAPS; i++) \ vecCoeffs[i] = vld1q(pCoeffs + 4 * i); \ \ /* \ @@ -147,7 +146,7 @@ pStateCur += 4; \ pTempSrc += 4; \ \ - FIR_Q31_CORE(4, nbVecTaps, pSamples, vecCoeffs); \ + FIR_Q31_CORE(4, NBVECTAPS, pSamples, vecCoeffs); \ \ pSamples += 4; \ /* \ @@ -164,7 +163,7 @@ for (int i = 0; i < residual; i++) \ *pStateCur++ = *pTempSrc++; \ \ - FIR_Q31_CORE(3, nbVecTaps, pSamples, vecCoeffs); \ + FIR_Q31_CORE(3, NBVECTAPS, pSamples, vecCoeffs); \ } \ break; \ \ @@ -173,7 +172,7 @@ for (int i = 0; i < residual; i++) \ *pStateCur++ = *pTempSrc++; \ \ - FIR_Q31_CORE(2, nbVecTaps, pSamples, vecCoeffs); \ + FIR_Q31_CORE(2, NBVECTAPS, pSamples, vecCoeffs); \ } \ break; \ \ @@ -182,7 +181,7 @@ for (int i = 0; i < residual; i++) \ *pStateCur++ = *pTempSrc++; \ \ - FIR_Q31_CORE(1, nbVecTaps, pSamples, vecCoeffs); \ + FIR_Q31_CORE(1, NBVECTAPS, pSamples, vecCoeffs); \ } \ break; \ } \ @@ -384,7 +383,9 @@ static void arm_fir_q31_5_8_mve(const arm_fir_instance_q31 * S, q31_t * __restrict pDst, uint32_t blockSize) { #define NBTAPS 8 + #define NBVECTAPS (NBTAPS / 4) FIR_Q31_MAIN_CORE(); + #undef NBVECTAPS #undef NBTAPS } @@ -394,7 +395,9 @@ static void arm_fir_q31_9_12_mve(const arm_fir_instance_q31 * S, q31_t * __restrict pDst, uint32_t blockSize) { #define NBTAPS 12 + #define NBVECTAPS (NBTAPS / 4) FIR_Q31_MAIN_CORE(); + #undef NBVECTAPS #undef NBTAPS } @@ -404,7 +407,9 @@ static void arm_fir_q31_13_16_mve(const arm_fir_instance_q31 * S, q31_t * __restrict pDst, uint32_t blockSize) { #define NBTAPS 16 + #define NBVECTAPS (NBTAPS / 4) FIR_Q31_MAIN_CORE(); + #undef NBVECTAPS #undef NBTAPS } @@ -414,7 +419,9 @@ static void arm_fir_q31_17_20_mve(const arm_fir_instance_q31 * S, q31_t * __restrict pDst, uint32_t blockSize) { #define NBTAPS 20 + #define NBVECTAPS (NBTAPS / 4) FIR_Q31_MAIN_CORE(); + #undef NBVECTAPS #undef NBTAPS } @@ -424,7 +431,9 @@ static void arm_fir_q31_21_24_mve(const arm_fir_instance_q31 * S, q31_t * __restrict pDst, uint32_t blockSize) { #define NBTAPS 24 + #define NBVECTAPS (NBTAPS / 4) FIR_Q31_MAIN_CORE(); + #undef NBVECTAPS #undef NBTAPS } @@ -434,7 +443,9 @@ static void arm_fir_q31_25_28_mve(const arm_fir_instance_q31 * S, q31_t * __restrict pDst, uint32_t blockSize) { #define NBTAPS 28 + #define NBVECTAPS (NBTAPS / 4) FIR_Q31_MAIN_CORE(); + #undef NBVECTAPS #undef NBTAPS } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_q7.c index 241f896..5966646 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_q7.c @@ -5,13 +5,13 @@ * Title: arm_fir_q7.c * Description: Q7 FIR filter processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -83,14 +83,13 @@ uint32_t numTaps = S->numTaps; /* Number of filter coefficients in the filter */\ int32_t blkCnt; \ q7x16_t vecIn0; \ - const int32_t nbVecTaps = (NBTAPS / 16); \ \ /* \ * load coefs \ */ \ - q7x16_t vecCoeffs[nbVecTaps]; \ + q7x16_t vecCoeffs[NBVECTAPS]; \ \ - for (int i = 0; i < nbVecTaps; i++) \ + for (int i = 0; i < NBVECTAPS; i++) \ vecCoeffs[i] = vldrbq_s8(pCoeffs + 16 * i); \ \ /* \ @@ -111,7 +110,7 @@ pStateCur += 4; \ pTempSrc += 4; \ \ - FIR_Q7_CORE(pOutput, 4, nbVecTaps, pSamples, vecCoeffs); \ + FIR_Q7_CORE(pOutput, 4, NBVECTAPS, pSamples, vecCoeffs); \ pSamples += 4; \ \ blkCnt--; \ @@ -123,7 +122,7 @@ for (int i = 0; i < residual; i++) \ *pStateCur++ = *pTempSrc++; \ \ - FIR_Q7_CORE(pOutput, residual, nbVecTaps, pSamples, vecCoeffs); \ + FIR_Q7_CORE(pOutput, residual, NBVECTAPS, pSamples, vecCoeffs); \ \ \ /* \ @@ -143,22 +142,50 @@ while (blkCnt > 0); \ } -static void arm_fir_q7_17_32_mve(const arm_fir_instance_q7 * S, + +static void arm_fir_q7_49_64_mve(const arm_fir_instance_q7 * S, + const q7_t * __restrict pSrc, + q7_t * __restrict pDst, uint32_t blockSize) +{ + #define NBTAPS 64 + #define NBVECTAPS (NBTAPS / 16) + FIR_Q7_MAIN_CORE(); + #undef NBVECTAPS + #undef NBTAPS +} + + +void arm_fir_q7_33_48_mve(const arm_fir_instance_q7 * S, + const q7_t * __restrict pSrc, + q7_t * __restrict pDst, uint32_t blockSize) +{ + #define NBTAPS 48 + #define NBVECTAPS (NBTAPS / 16) + FIR_Q7_MAIN_CORE(); + #undef NBVECTAPS + #undef NBTAPS +} + +static void arm_fir_q7_17_32_mve(const arm_fir_instance_q7 * S, const q7_t * __restrict pSrc, q7_t * __restrict pDst, uint32_t blockSize) { #define NBTAPS 32 + #define NBVECTAPS (NBTAPS / 16) FIR_Q7_MAIN_CORE(); + #undef NBVECTAPS #undef NBTAPS } -void arm_fir_q7_1_16_mve(const arm_fir_instance_q7 * S, - const q7_t * __restrict pSrc, +void arm_fir_q7_1_16_mve(const arm_fir_instance_q7 * S, + const q7_t * __restrict pSrc, q7_t * __restrict pDst, uint32_t blockSize) { #define NBTAPS 16 + #define NBVECTAPS (NBTAPS / 16) FIR_Q7_MAIN_CORE(); + #undef NBVECTAPS #undef NBTAPS } @@ -198,6 +225,22 @@ void arm_fir_q7( arm_fir_q7_17_32_mve(S, pSrc, pDst, blockSize); return; } + else if (numTaps <= 48) + { + /* + * [33 to 48 taps] specialized routine + */ + arm_fir_q7_33_48_mve(S, pSrc, pDst, blockSize); + return; + } + else if (numTaps <= 64) + { + /* + * [49 to 64 taps] specialized routine + */ + arm_fir_q7_49_64_mve(S, pSrc, pDst, blockSize); + return; + } /* * pState points to state array which contains previous frame (numTaps - 1) samples @@ -609,7 +652,7 @@ void arm_fir_q7( { acc0 += (q15_t) * (px++) * (*(pb++)); i--; - } + } /* The result is in 2.14 format. Convert to 1.7 Then store the output in the destination buffer. */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_f32.c index ca71b9a..b95ec65 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_f32.c @@ -5,13 +5,13 @@ * Title: arm_fir_sparse_f32.c * Description: Floating-point sparse FIR filter processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -37,6 +37,9 @@ /** @defgroup FIR_Sparse Finite Impulse Response (FIR) Sparse Filters + @deprecated Those functions are no more tested nor maintained and will be removed in + a future version. + This group of functions implements sparse FIR filters. Sparse FIR filters are equivalent to standard FIR filters except that most of the coefficients are equal to zero. Sparse filters are used for simulating reflections in communications and audio applications. diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_init_f32.c index c3e134b..963c050 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_fir_sparse_init_f32.c * Description: Floating-point sparse FIR filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_init_q15.c index 688bb0b..72ec65a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_init_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_init_q15.c @@ -5,13 +5,13 @@ * Title: arm_fir_sparse_init_q15.c * Description: Q15 sparse FIR filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_init_q31.c index fcb0153..509c85e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_fir_sparse_init_q31.c * Description: Q31 sparse FIR filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_init_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_init_q7.c index e2a437c..4f0f793 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_init_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_init_q7.c @@ -5,13 +5,13 @@ * Title: arm_fir_sparse_init_q7.c * Description: Q7 sparse FIR filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_q15.c index 5b19f77..8784737 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_q15.c @@ -5,13 +5,13 @@ * Title: arm_fir_sparse_q15.c * Description: Q15 sparse FIR filter processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_q31.c index 04cc5ea..6524e26 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_q31.c @@ -5,13 +5,13 @@ * Title: arm_fir_sparse_q31.c * Description: Q31 sparse FIR filter processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_q7.c index 193bc2b..85ec295 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_fir_sparse_q7.c @@ -5,13 +5,13 @@ * Title: arm_fir_sparse_q7.c * Description: Q7 sparse FIR filter processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_f32.c index 5cf0548..4c48c85 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_f32.c @@ -5,13 +5,13 @@ * Title: arm_iir_lattice_f32.c * Description: Floating-point IIR Lattice filter processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_init_f32.c index 94ebb5d..d9922ec 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_iir_lattice_init_f32.c * Description: Floating-point IIR lattice filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_init_q15.c index 5f2b5e6..1dae546 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_init_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_init_q15.c @@ -5,13 +5,13 @@ * Title: arm_iir_lattice_init_q15.c * Description: Q15 IIR lattice filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_init_q31.c index a14b217..779d09e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_iir_lattice_init_q31.c * Description: Initialization function for the Q31 IIR lattice filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_q15.c index 25ed237..2768ffa 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_q15.c @@ -5,13 +5,13 @@ * Title: arm_iir_lattice_q15.c * Description: Q15 IIR Lattice filter processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_q31.c index e5e6ee0..430c090 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_iir_lattice_q31.c @@ -5,13 +5,13 @@ * Title: arm_iir_lattice_q31.c * Description: Q31 IIR Lattice filter processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_levinson_durbin_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_levinson_durbin_f16.c new file mode 100644 index 0000000..5129666 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_levinson_durbin_f16.c @@ -0,0 +1,277 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_levinson_durbin_f16.c + * Description: f16 version of Levinson Durbin algorithm + * + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/filtering_functions_f16.h" + +/** + @ingroup groupFilters + */ + + + +/** + @addtogroup LD + @{ + */ + +/** + @brief Levinson Durbin + @param[in] phi autocovariance vector starting with lag 0 (length is nbCoefs + 1) + @param[out] a autoregressive coefficients + @param[out] err prediction error (variance) + @param[in] nbCoefs number of autoregressive coefficients + @return none + */ + +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) && defined(__CMSIS_GCC_H) +#pragma GCC warning "Scalar version of arm_levinson_durbin_f16 built. Helium version has build issues with gcc." +#endif + +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) && !defined(__CMSIS_GCC_H) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +#define LANE4567_MASK 0xFF00 + +void arm_levinson_durbin_f16(const float16_t *phi, + float16_t *a, + float16_t *err, + int nbCoefs) +{ + _Float16 e; + static const uint16_t revOffsetArray[8] = {7,6,5,4,3,2,1,0}; + + a[0] = (_Float16)phi[1] / (_Float16)phi[0]; + + e = (_Float16)phi[0] - (_Float16)phi[1] * (_Float16)a[0]; + for(int p=1; p < nbCoefs; p++) + { + _Float16 suma = 0.0f16; + _Float16 sumb = 0.0f16; + f16x8_t vecA,vecRevPhi,vecPhi,vecSumA, vecSumB; + _Float16 k; + uint32_t blkCnt; + const float16_t *pPhi,*pRevPhi,*pA; + uint16x8_t revOffset; + + int nb,j,i; + + revOffset = vld1q(revOffsetArray); + vecSumA = vdupq_n_f16(0.0f16); + vecSumB = vdupq_n_f16(0.0f16); + + pRevPhi = &phi[p-7]; + pPhi = &phi[1]; + pA = a; + + i = 0; + blkCnt = p >> 3; + while(blkCnt > 0) + { + vecA = vld1q(pA); + pA += 8; + + vecPhi = vld1q(pPhi); + pPhi += 8; + + vecRevPhi = vldrhq_gather_shifted_offset_f16(pRevPhi,revOffset); + pRevPhi -= 8; + + vecSumA = vfmaq(vecSumA,vecA,vecRevPhi); + vecSumB = vfmaq(vecSumB,vecA,vecPhi); + + i += 8; + blkCnt--; + + } + + suma = vecAddAcrossF16Mve(vecSumA); + sumb = vecAddAcrossF16Mve(vecSumB); + + blkCnt = p & 7; + while(blkCnt > 0) + { + suma += (_Float16)a[i] * (_Float16)phi[p - i]; + sumb += (_Float16)a[i] * (_Float16)phi[i + 1]; + + i++; + blkCnt--; + } + + k = ((_Float16)phi[p+1] - suma)/((_Float16)phi[0] - sumb); + + f16x8_t vecRevA,tmp; + static int16_t orgOffsetArray[8]={0,1,2,3,-1,-2,-3,-4}; + static const int16_t offsetIncArray[8]={4,4,4,4,-4,-4,-4,-4}; + + uint16x8_t offset,offsetInc,vecTmp; + + + offset = vld1q_u16((uint16_t*)orgOffsetArray); + vecTmp = vdupq_n_u16(p); + + offset = vaddq_m_u16(offset,offset,vecTmp,LANE4567_MASK); + offsetInc = vld1q_u16((uint16_t*)offsetIncArray); + + nb = p >> 3; + j=0; + for(int i = 0; i < nb ; i++) + { + + /* + x0=a[j] - k * a[p-1-j]; + x1=a[j+1] - k * a[p-2-j]; + x3=a[p-1-j] - k * a[j]; + x4=a[p-2-j] - k * a[j+1]; + + a[j] = x0; + a[j+1] = x1; + a[p-1-j] = x2; + a[p-2-j] = x3; + */ + + uint64_t tmpa,tmpb; + vecA = vldrhq_gather_shifted_offset_f16(a,offset); + + + tmpa = vgetq_lane_u64((uint64x2_t)vecA,0); + tmpb = vgetq_lane_u64((uint64x2_t)vecA,1); + vecRevA = (f16x8_t) vsetq_lane_u64(tmpb,(uint64x2_t)vecRevA,0); + vecRevA = (f16x8_t) vsetq_lane_u64(tmpa,(uint64x2_t)vecRevA,1); + + + tmp = vsubq(vecA,vmulq_n_f16(vecRevA,k)); + vstrhq_scatter_shifted_offset_f16(a, offset, tmp); + + offset = vaddq(offset,offsetInc); + + j+=4; + + } + + blkCnt = p & 7; + + if (blkCnt) + { + nb = blkCnt >> 1; + for(int i =0;i < nb ; i++) + { + _Float16 x,y; + + x=(_Float16)a[j] - (_Float16)k * (_Float16)a[p-1-j]; + y=(_Float16)a[p-1-j] - (_Float16)k * (_Float16)a[j]; + + a[j] = x; + a[p-1-j] = y; + + j++; + } + + nb = blkCnt & 1; + if (nb) + { + a[j]=(_Float16)a[j]- (_Float16)k * (_Float16)a[p-1-j]; + } + } + + + a[p] = k; + e = e * (1.0f16 - k*k); + + + } + *err = e; +} + +#else + +#if defined(ARM_FLOAT16_SUPPORTED) + +void arm_levinson_durbin_f16(const float16_t *phi, + float16_t *a, + float16_t *err, + int nbCoefs) +{ + _Float16 e; + + a[0] = (_Float16)phi[1] / (_Float16)phi[0]; + + e = (_Float16)phi[0] - (_Float16)phi[1] * (_Float16)a[0]; + for(int p=1; p < nbCoefs; p++) + { + _Float16 suma=0.0f16; + _Float16 sumb=0.0f16; + _Float16 k; + int nb,j; + + for(int i=0; i < p; i++) + { + suma += (_Float16)a[i] * (_Float16)phi[p - i]; + sumb += (_Float16)a[i] * (_Float16)phi[i + 1]; + } + + k = ((_Float16)phi[p+1]-suma)/((_Float16)phi[0] - sumb); + + + nb = p >> 1; + j=0; + for(int i =0;i < nb ; i++) + { + _Float16 x,y; + + x=(_Float16)a[j] - (_Float16)k * (_Float16)a[p-1-j]; + y=(_Float16)a[p-1-j] - (_Float16)k * (_Float16)a[j]; + + a[j] = x; + a[p-1-j] = y; + + j++; + } + + nb = p & 1; + if (nb) + { + a[j]=(_Float16)a[j]- (_Float16)k * (_Float16)a[p-1-j]; + } + + a[p] = k; + e = e * (1.0f16 - k*k); + + + } + *err = e; +} +#endif /* defined(ARM_FLOAT16_SUPPORTED */ +#endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of LD group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_levinson_durbin_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_levinson_durbin_f32.c new file mode 100644 index 0000000..0c4e650 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_levinson_durbin_f32.c @@ -0,0 +1,283 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_levinson_durbin_f32.c + * Description: f32 version of Levinson Durbin algorithm + * + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/filtering_functions.h" + +/** + @ingroup groupFilters + */ + +/** + @defgroup LD Levinson Durbin Algorithm + + */ + +/** + @addtogroup LD + @{ + */ + +/** + @brief Levinson Durbin + @param[in] phi autocovariance vector starting with lag 0 (length is nbCoefs + 1) + @param[out] a autoregressive coefficients + @param[out] err prediction error (variance) + @param[in] nbCoefs number of autoregressive coefficients + @return none + */ + +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) && defined(__CMSIS_GCC_H) +#pragma GCC warning "Scalar version of arm_levinson_durbin_f32 built. Helium version has build issues with gcc." +#endif + +#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) && !defined(__CMSIS_GCC_H) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +#define LANE23_MASK 0xFF00 + +void arm_levinson_durbin_f32(const float32_t *phi, + float32_t *a, + float32_t *err, + int nbCoefs) +{ + float32_t e; + static const uint32_t revOffsetArray[4] = {3,2,1,0}; + + a[0] = phi[1] / phi[0]; + + e = phi[0] - phi[1] * a[0]; + for(int p=1; p < nbCoefs; p++) + { + float32_t suma = 0.0f; + float32_t sumb = 0.0f; + f32x4_t vecA,vecRevPhi,vecPhi,vecSumA, vecSumB; + float32_t k; + uint32_t blkCnt; + const float32_t *pPhi,*pRevPhi,*pA; + uint32x4_t revOffset; + + int nb,j,i; + + revOffset = vld1q(revOffsetArray); + vecSumA = vdupq_n_f32(0.0f); + vecSumB = vdupq_n_f32(0.0f); + + pRevPhi = &phi[p-3]; + pPhi = &phi[1]; + pA = a; + + i = 0; + blkCnt = p >> 2; + while(blkCnt > 0) + { + vecA = vld1q(pA); + pA += 4; + + vecPhi = vld1q(pPhi); + pPhi += 4; + + vecRevPhi = vldrwq_gather_shifted_offset_f32(pRevPhi,revOffset); + pRevPhi -= 4; + + vecSumA = vfmaq(vecSumA,vecA,vecRevPhi); + vecSumB = vfmaq(vecSumB,vecA,vecPhi); + + i += 4; + blkCnt--; + + } + + suma = vecAddAcrossF32Mve(vecSumA); + sumb = vecAddAcrossF32Mve(vecSumB); + + blkCnt = p & 3; + while(blkCnt > 0) + { + suma += a[i] * phi[p - i]; + sumb += a[i] * phi[i + 1]; + + i++; + blkCnt--; + } + + k = (phi[p+1] - suma)/(phi[0] - sumb); + + f32x4_t vecRevA,tmp; + static int32_t orgOffsetArray[4]={0,1,-1,-2}; + static const int32_t offsetIncArray[4]={2,2,-2,-2}; + + uint32x4_t offset,offsetInc,vecTmp; + + + offset = vld1q_u32((uint32_t*)orgOffsetArray); + vecTmp = vdupq_n_u32(p); + + offset = vaddq_m_u32(offset,offset,vecTmp,LANE23_MASK); + offsetInc = vld1q_u32((uint32_t*)offsetIncArray); + + nb = p >> 2; + j=0; + for(int i = 0; i < nb ; i++) + { + + /* + x0=a[j] - k * a[p-1-j]; + x1=a[j+1] - k * a[p-2-j]; + x3=a[p-1-j] - k * a[j]; + x4=a[p-2-j] - k * a[j+1]; + + a[j] = x0; + a[j+1] = x1; + a[p-1-j] = x2; + a[p-2-j] = x3; + */ + + uint64_t tmpa,tmpb; + vecA = vldrwq_gather_shifted_offset_f32(a,offset); + + + tmpa = vgetq_lane_u64((uint64x2_t)vecA,0); + tmpb = vgetq_lane_u64((uint64x2_t)vecA,1); + vecRevA = (f32x4_t) vsetq_lane_u64(tmpb,(uint64x2_t)vecRevA,0); + vecRevA = (f32x4_t) vsetq_lane_u64(tmpa,(uint64x2_t)vecRevA,1); + + + tmp = vsubq(vecA,vmulq_n_f32(vecRevA,k)); + vstrwq_scatter_shifted_offset_f32(a, offset, tmp); + + offset = vaddq(offset,offsetInc); + + j+=2; + + } + + switch(p & 3) + { + case 3: + { + float32_t x,y; + x = a[j] - k * a[p-1-j]; + y = a[p-1-j] - k * a[j]; + + a[j] = x; + a[p-1-j] = y; + + a[j+1] = a[j+1] - k * a[p-1-(j+1)]; + } + break; + + case 2: + { + float32_t x,y; + x = a[j] - k * a[p-1-j]; + y = a[p-1-j] - k * a[j]; + + a[j] = x; + a[p-1-j] = y; + } + break; + + case 1: + a[j] = a[j]- k * a[p-1-j]; + break; + } + + a[p] = k; + e = e * (1.0f - k*k); + + + } + *err = e; +} + +#else +void arm_levinson_durbin_f32(const float32_t *phi, + float32_t *a, + float32_t *err, + int nbCoefs) +{ + float32_t e; + int p; + + a[0] = phi[1] / phi[0]; + + e = phi[0] - phi[1] * a[0]; + for(p=1; p < nbCoefs; p++) + { + float32_t suma=0.0f; + float32_t sumb=0.0f; + float32_t k; + int nb,j,i; + + for(i=0; i < p; i++) + { + suma += a[i] * phi[p - i]; + sumb += a[i] * phi[i + 1]; + } + + k = (phi[p+1]-suma)/(phi[0] - sumb); + + + nb = p >> 1; + j=0; + for(i =0; i < nb ; i++) + { + float32_t x,y; + + x=a[j] - k * a[p-1-j]; + y=a[p-1-j] - k * a[j]; + + a[j] = x; + a[p-1-j] = y; + + j++; + } + + nb = p & 1; + if (nb) + { + a[j]=a[j]- k * a[p-1-j]; + } + + a[p] = k; + e = e * (1.0f - k*k); + + + } + *err = e; +} +#endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ + +/** + @} end of LD group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_levinson_durbin_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_levinson_durbin_q31.c new file mode 100644 index 0000000..b38b792 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_levinson_durbin_q31.c @@ -0,0 +1,380 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_levinson_durbin_q31.c + * Description: q31 version of Levinson Durbin algorithm + * + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/filtering_functions.h" + +#define ONE_Q31 0x7FFFFFFFL +#define TWO_Q30 0x7FFFFFFFL + +#define HALF_Q31 0x00008000L +#define ONE_Q15 0x7FFF +#define HALF_Q15 0x3FFF +#define LOWPART_MASK 0x07FFF + +__STATIC_FORCEINLINE q31_t mul32x16(q31_t a, q15_t b) +{ + q31_t r = ((q63_t)a * (q63_t)b) >> 15; + + return(r); + +} + +__STATIC_FORCEINLINE q31_t mul32x32(q31_t a, q31_t b) +{ + //q31_t r = __SSAT(((q63_t)a * b) >> 31,31); + q31_t r = ((q63_t)a * b) >> 31; + + return(r); + +} + +__STATIC_FORCEINLINE q31_t divide(q31_t n, q31_t d) +{ + arm_status status; + int16_t shift; + q15_t inverse; + q31_t r; + // We are computing: + // n / d = n / (h + l) where h and l are the high end and low end part. + // 1 / (h + l) = 1 / h (1 - l / h) + // Our division algorithm has a shift. So it is returning a scaled value sh. + // So we need a << shift to convert 1/ sh to 1/h. + // In below code, we are organizing the computation differently. Instead of computing: + // 1 / h (1 - l / h) + // we are computing + // 1 / h (2 - (l + h) / h) + // 1 / h (2 - d / h) + // Also, we are not computing 1/h in Q15 but in Q14. + // 2 is expressed in Q30. + // So at the end of all computation we need a << 2 + + // Result is in Q14 because of use of HALF_Q15 instead of ONE_Q15. + status=arm_divide_q15(HALF_Q15,d>>16,&inverse,&shift); + (void)status; + + // d is used instead of l + // So we will need to substract to 2 instead of 1. + r = mul32x16(d,inverse); + r = TWO_Q30 - (r << shift); + r = mul32x16(r, inverse); + r = mul32x32(r,n) ; + r = r << (shift + 2); + + return(r); + +} + +/** + @ingroup groupFilters + */ + + + +/** + @addtogroup LD + @{ + */ + +/** + @brief Levinson Durbin + @param[in] phi autocovariance vector starting with lag 0 (length is nbCoefs + 1) + @param[out] a autoregressive coefficients + @param[out] err prediction error (variance) + @param[in] nbCoefs number of autoregressive coefficients + @return none + */ + +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) && defined(__CMSIS_GCC_H) +#pragma GCC warning "Scalar version of arm_levinson_durbin_q31 built. Helium version has build issues with gcc." +#endif + +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) && !defined(__CMSIS_GCC_H) + +#define LANE23_MASK 0xFF00 + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" +void arm_levinson_durbin_q31(const q31_t *phi, + q31_t *a, + q31_t *err, + int nbCoefs) +{ + q31_t e; + + static const uint32_t revOffsetArray[4] = {3,2,1,0}; + + //a[0] = phi[1] / phi[0]; + a[0] = divide(phi[1], phi[0]); + + + //e = phi[0] - phi[1] * a[0]; + e = phi[0] - mul32x32(phi[1],a[0]); + + for(int p=1; p < nbCoefs; p++) + { + q63_t suma=0; + q63_t sumb=0; + q31x4_t vecA,vecRevPhi,vecPhi; + q31_t k; + uint32_t blkCnt; + const q31_t *pPhi,*pRevPhi,*pA; + uint32x4_t revOffset; + + + int nb,j,i; + + revOffset = vld1q(revOffsetArray); + + pRevPhi = &phi[p-3]; + pPhi = &phi[1]; + pA = a; + + i = 0; + blkCnt = p >> 2; + while(blkCnt > 0) + { + vecA = vld1q(pA); + pA += 4; + + vecPhi = vld1q(pPhi); + pPhi += 4; + + vecRevPhi = vldrwq_gather_shifted_offset_s32(pRevPhi,revOffset); + pRevPhi -= 4; + + suma = vmlaldavaq(suma,vecA,vecRevPhi); + sumb = vmlaldavaq(sumb,vecA,vecPhi); + + i += 4; + blkCnt--; + } + + + blkCnt = p & 3; + while(blkCnt > 0) + { + suma += ((q63_t)a[i] * phi[p - i]); + sumb += ((q63_t)a[i] * phi[i + 1]); + + i++; + blkCnt--; + } + + suma = asrl(suma, 31); + sumb = asrl(sumb, 31); + + + + //k = (phi[p+1]-suma)/(phi[0] - sumb); + k = divide(phi[p+1]-(q31_t)suma,phi[0] - (q31_t)sumb); + + q31x4_t vecRevA,tmp; + static int32_t orgOffsetArray[4]={0,1,-1,-2}; + static const int32_t offsetIncArray[4]={2,2,-2,-2}; + + uint32x4_t offset,offsetInc,vecTmp; + + + offset = vld1q_u32((uint32_t*)orgOffsetArray); + vecTmp = vdupq_n_u32(p); + + offset = vaddq_m_u32(offset,offset,vecTmp,LANE23_MASK); + offsetInc = vld1q_u32((uint32_t*)offsetIncArray); + + + nb = p >> 2; + j=0; + for(int i =0;i < nb ; i++) + { + /* + q31_t x0,x1,x2,x3; + + //x = a[j] - k * a[p-1-j]; + x0 = a[j] - mul32x32(k,a[p-1-j]); + x1 = a[j+1] - mul32x32(k,a[p-2-j]); + + //y = a[p-1-j] - k * a[j]; + x2 = a[p-1-j] - mul32x32(k , a[j]); + x3 = a[p-2-j] - mul32x32(k , a[j+1]); + + a[j] = x0; + a[j+1] = x1; + a[p-1-j] = x2; + a[p-2-j] = x3; + */ + + uint64_t tmpa,tmpb; + vecA = vldrwq_gather_shifted_offset_s32(a,offset); + + + tmpa = vgetq_lane_u64((uint64x2_t)vecA,0); + tmpb = vgetq_lane_u64((uint64x2_t)vecA,1); + vecRevA = (q31x4_t) vsetq_lane_u64(tmpb,(uint64x2_t)vecRevA,0); + vecRevA = (q31x4_t) vsetq_lane_u64(tmpa,(uint64x2_t)vecRevA,1); + + + tmp = vsubq(vecA,vqdmulhq_n_s32(vecRevA,k)); + vstrwq_scatter_shifted_offset_s32(a, offset, tmp); + + offset = vaddq(offset,offsetInc); + + j+=2; + } + + switch(p & 3) + { + case 3: + { + q31_t x,y; + + //x = a[j] - k * a[p-1-j]; + x = a[j] - mul32x32(k,a[p-1-j]); + + //y = a[p-1-j] - k * a[j]; + y = a[p-1-j] - mul32x32(k , a[j]); + + a[j] = x; + a[p-1-j] = y; + + //a[j] = a[j]- k * a[p-1-j]; + a[j+1] = a[j+1] - mul32x32(k,a[p-2-j]); + } + break; + + case 2: + { + q31_t x,y; + + //x = a[j] - k * a[p-1-j]; + x = a[j] - mul32x32(k,a[p-1-j]); + + //y = a[p-1-j] - k * a[j]; + y = a[p-1-j] - mul32x32(k , a[j]); + + a[j] = x; + a[p-1-j] = y; + } + break; + + case 1: + //a[j] = a[j]- k * a[p-1-j]; + a[j] = a[j] - mul32x32(k,a[p-1-j]); + break; + } + + a[p] = k; + + // e = e * (1 - k*k); + e = mul32x32(e,ONE_Q31 - mul32x32(k,k)); + + + } + *err = e; +} + +#else + +void arm_levinson_durbin_q31(const q31_t *phi, + q31_t *a, + q31_t *err, + int nbCoefs) +{ + q31_t e; + int p; + + //a[0] = phi[1] / phi[0]; + a[0] = divide(phi[1], phi[0]); + + + //e = phi[0] - phi[1] * a[0]; + e = phi[0] - mul32x32(phi[1],a[0]); + + for(p=1; p < nbCoefs; p++) + { + q63_t suma=0; + q63_t sumb=0; + q31_t k; + int nb,j,i; + + for(i=0; i < p; i++) + { + suma += ((q63_t)a[i] * phi[p - i]); + sumb += ((q63_t)a[i] * phi[i + 1]); + } + + suma = suma >> 31; + sumb = sumb >> 31; + + + + //k = (phi[p+1]-suma)/(phi[0] - sumb); + k = divide(phi[p+1]-(q31_t)suma,phi[0] - (q31_t)sumb); + + + nb = p >> 1; + j=0; + for(i =0;i < nb ; i++) + { + q31_t x,y; + + //x = a[j] - k * a[p-1-j]; + x = a[j] - mul32x32(k,a[p-1-j]); + + //y = a[p-1-j] - k * a[j]; + y = a[p-1-j] - mul32x32(k , a[j]); + + a[j] = x; + a[p-1-j] = y; + + j++; + } + + nb = p & 1; + if (nb) + { + //a[j] = a[j]- k * a[p-1-j]; + a[j] = a[j] - mul32x32(k,a[p-1-j]); + } + + a[p] = k; + + // e = e * (1 - k*k); + e = mul32x32(e,ONE_Q31 - mul32x32(k,k)); + + + } + *err = e; +} +#endif /* defined(ARM_MATH_MVEI) */ + +/** + @} end of LD group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_f32.c index ef2e832..865999f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_f32.c @@ -5,13 +5,13 @@ * Title: arm_lms_f32.c * Description: Processing function for the floating-point LMS filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_init_f32.c index e4e53a0..8d8e144 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_lms_init_f32.c * Description: Floating-point LMS filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_init_q15.c index 4918436..871caa0 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_init_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_init_q15.c @@ -5,13 +5,13 @@ * Title: arm_lms_init_q15.c * Description: Q15 LMS filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_init_q31.c index 42d76f5..f4482d3 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_lms_init_q31.c * Description: Q31 LMS filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_f32.c index e269d7d..0e99319 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_f32.c @@ -5,13 +5,13 @@ * Title: arm_lms_norm_f32.c * Description: Processing function for the floating-point NLMS filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_init_f32.c index 8fc9597..949f6c3 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_lms_norm_init_f32.c * Description: Floating-point NLMS filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_init_q15.c index 0c41794..aa05875 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_init_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_init_q15.c @@ -5,13 +5,13 @@ * Title: arm_lms_norm_init_q15.c * Description: Q15 NLMS filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_init_q31.c index a261a30..28e3c5b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_lms_norm_init_q31.c * Description: Q31 NLMS filter initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_q15.c index 9785a78..2e4befd 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_q15.c @@ -5,13 +5,13 @@ * Title: arm_lms_norm_q15.c * Description: Processing function for Q15 normalized LMS filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_q31.c index 37cce57..322219d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_norm_q31.c @@ -5,13 +5,13 @@ * Title: arm_lms_norm_q31.c * Description: Processing function for the Q31 NLMS filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_q15.c index 536409b..b165d7f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_q15.c @@ -5,13 +5,13 @@ * Title: arm_lms_q15.c * Description: Processing function for Q15 LMS filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_q31.c index cc63338..fedf570 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/FilteringFunctions/arm_lms_q31.c @@ -5,13 +5,13 @@ * Title: arm_lms_q31.c * Description: Processing function for the Q31 LMS filter * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_f16.c index 1e974b6..d9a7d7c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_f16.c @@ -5,13 +5,13 @@ * Title: arm_bilinear_interp_f16.c * Description: Floating-point bilinear interpolation * - * $Date: 22 July 2020 + * $Date: 23 April 2021 * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -37,57 +37,6 @@ @ingroup groupInterpolation */ -/** - * @defgroup BilinearInterpolate Bilinear Interpolation - * - * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid. - * The underlying function f(x, y) is sampled on a regular grid and the interpolation process - * determines values between the grid points. - * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension. - * Bilinear interpolation is often used in image processing to rescale images. - * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types. - * - * Algorithm - * \par - * The instance structure used by the bilinear interpolation functions describes a two dimensional data table. - * For floating-point, the instance structure is defined as: - *
-   *   typedef struct
-   *   {
-   *     uint16_t numRows;
-   *     uint16_t numCols;
-   *     float16_t *pData;
-   * } arm_bilinear_interp_instance_f16;
-   * 
- * - * \par - * where numRows specifies the number of rows in the table; - * numCols specifies the number of columns in the table; - * and pData points to an array of size numRows*numCols values. - * The data table pTable is organized in row order and the supplied data values fall on integer indexes. - * That is, table element (x,y) is located at pTable[x + y*numCols] where x and y are integers. - * - * \par - * Let (x, y) specify the desired interpolation point. Then define: - *
-   *     XF = floor(x)
-   *     YF = floor(y)
-   * 
- * \par - * The interpolated output point is computed as: - *
-   *  f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
-   *           + f(XF+1, YF) * (x-XF)*(1-(y-YF))
-   *           + f(XF, YF+1) * (1-(x-XF))*(y-YF)
-   *           + f(XF+1, YF+1) * (x-XF)*(y-YF)
-   * 
- * Note that the coordinates (x, y) contain integer and fractional components. - * The integer components specify which portion of the table to use while the - * fractional components control the interpolation processor. - * - * \par - * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output. - */ /** @@ -143,18 +92,19 @@ /* Calculation of intermediate values */ b1 = f00; - b2 = f01 - f00; - b3 = f10 - f00; - b4 = f00 - f01 - f10 + f11; + b2 = (_Float16)f01 - (_Float16)f00; + b3 = (_Float16)f10 - (_Float16)f00; + b4 = (_Float16)f00 - (_Float16)f01 - (_Float16)f10 + (_Float16)f11; /* Calculation of fractional part in X */ - xdiff = X - xIndex; + xdiff = (_Float16)X - (_Float16)xIndex; /* Calculation of fractional part in Y */ - ydiff = Y - yIndex; + ydiff = (_Float16)Y - (_Float16)yIndex; /* Calculation of bi-linear interpolated output */ - out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff; + out = (_Float16)b1 + (_Float16)b2 * (_Float16)xdiff + + (_Float16)b3 * (_Float16)ydiff + (_Float16)b4 * (_Float16)xdiff * (_Float16)ydiff; /* return to application */ return (out); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_f32.c index 41e99a4..3008a7a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_f32.c @@ -5,13 +5,13 @@ * Title: arm_bilinear_interp_f32.c * Description: Floating-point bilinear interpolation * - * $Date: 22 July 2020 + * $Date: 23 April 2021 * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_q15.c index 484b404..bc92417 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_q15.c @@ -5,13 +5,13 @@ * Title: arm_linear_interp_q15.c * Description: Q15 linear interpolation * - * $Date: 22 July 2020 + * $Date: 23 April 2021 * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_q31.c index 4a5f654..2375763 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_q31.c @@ -5,13 +5,13 @@ * Title: arm_linear_interp_q31.c * Description: Q31 linear interpolation * - * $Date: 22 July 2020 + * $Date: 23 April 2021 * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_q7.c index 31b3a68..0a78876 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_bilinear_interp_q7.c @@ -5,13 +5,13 @@ * Title: arm_linear_interp_q7.c * Description: Q7 linear interpolation * - * $Date: 22 July 2020 + * $Date: 23 April 2021 * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_f16.c index f2b0b36..c25a217 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_f16.c @@ -5,13 +5,13 @@ * Title: arm_linear_interp_f16.c * Description: Floating-point linear interpolation * - * $Date: 22 July 2020 + * $Date: 23 April 2021 * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -37,37 +37,6 @@ @ingroup groupInterpolation */ -/** - * @defgroup LinearInterpolate Linear Interpolation - * - * Linear interpolation is a method of curve fitting using linear polynomials. - * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line - * - * \par - * \image html LinearInterp.gif "Linear interpolation" - * - * \par - * A Linear Interpolate function calculates an output value(y), for the input(x) - * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values) - * - * \par Algorithm: - *
-   *       y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
-   *       where x0, x1 are nearest values of input x
-   *             y0, y1 are nearest values to output y
-   * 
- * - * \par - * This set of functions implements Linear interpolation process - * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single - * sample of data and each call to the function returns a single processed value. - * S points to an instance of the Linear Interpolate function data structure. - * x is the input sample value. The functions returns the output value. - * - * \par - * if x is outside of the table boundary, Linear interpolation returns first value of the table - * if x is below input range and returns last value of table if x is above range. - */ /** * @addtogroup LinearInterpolate @@ -93,7 +62,7 @@ float16_t *pYData = S->pYData; /* pointer to output table */ /* Calculation of index */ - i = (int32_t) ((x - S->x1) / xSpacing); + i = (int32_t) (((_Float16)x - (_Float16)S->x1) / (_Float16)xSpacing); if (i < 0) { @@ -108,15 +77,16 @@ else { /* Calculation of nearest input values */ - x0 = S->x1 + i * xSpacing; - x1 = S->x1 + (i + 1) * xSpacing; + x0 = (_Float16)S->x1 + (_Float16)i * (_Float16)xSpacing; + x1 = (_Float16)S->x1 + (_Float16)(i + 1) * (_Float16)xSpacing; /* Read of nearest output values */ y0 = pYData[i]; y1 = pYData[i + 1]; /* Calculation of output */ - y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0)); + y = (_Float16)y0 + ((_Float16)x - (_Float16)x0) * + (((_Float16)y1 - (_Float16)y0) / ((_Float16)x1 - (_Float16)x0)); } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_f32.c index f8caa74..834d54e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_f32.c @@ -5,13 +5,13 @@ * Title: arm_linear_interp_f32.c * Description: Floating-point linear interpolation * - * $Date: 22 July 2020 + * $Date: 23 April 2021 * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_q15.c index 690c44a..f2cfc80 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_q15.c @@ -5,13 +5,13 @@ * Title: arm_linear_interp_q15.c * Description: Q15 linear interpolation * - * $Date: 22 July 2020 + * $Date: 23 April 2021 * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -53,7 +53,7 @@ * */ q15_t arm_linear_interp_q15( - q15_t * pYData, + const q15_t * pYData, q31_t x, uint32_t nValues) { diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_q31.c index 783e125..bdeefb8 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_q31.c @@ -5,13 +5,13 @@ * Title: arm_linear_interp_q31.c * Description: Q31 linear interpolation * - * $Date: 22 July 2020 + * $Date: 23 April 2021 * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -54,7 +54,7 @@ * */ q31_t arm_linear_interp_q31( - q31_t * pYData, + const q31_t * pYData, q31_t x, uint32_t nValues) { diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_q7.c index 0f32e3d..bde5678 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_linear_interp_q7.c @@ -5,13 +5,13 @@ * Title: arm_linear_interp_q7.c * Description: Q7 linear interpolation * - * $Date: 22 July 2020 + * $Date: 23 April 2021 * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -53,7 +53,7 @@ * This function can support maximum of table size 2^12. */ q7_t arm_linear_interp_q7( - q7_t * pYData, + const q7_t * pYData, q31_t x, uint32_t nValues) { diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_spline_interp_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_spline_interp_f32.c index 822986c..21a5edb 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_spline_interp_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_spline_interp_f32.c @@ -5,13 +5,13 @@ * Title: arm_spline_interp_f32.c * Description: Floating-point cubic spline interpolation * - * $Date: 13 November 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -140,7 +140,7 @@ /** * @brief Processing function for the floating-point cubic spline interpolation. * @param[in] S points to an instance of the floating-point spline structure. - * @param[in] xq points to the x values ot the interpolated data points. + * @param[in] xq points to the x values of the interpolated data points. * @param[out] pDst points to the block of output data. * @param[in] blockSize number of samples of output data. */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_spline_interp_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_spline_interp_init_f32.c index 5e5c442..80e4d76 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_spline_interp_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/InterpolationFunctions/arm_spline_interp_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_spline_interp_init_f32.c * Description: Floating-point cubic spline initialization function * - * $Date: 13 November 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_householder_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_householder_f16.c new file mode 100644 index 0000000..e9f15bc --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_householder_f16.c @@ -0,0 +1,125 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_householder_f16.c + * Description: Half floating-point Householder transform + * + * $Date: 15 June 2022 + * $Revision: V1.11.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions_f16.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions_f16.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions_f16.h" + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h" + + +#include + + + +/** + @ingroup groupMatrix + */ + + +/** + @addtogroup MatrixHouseholder + @{ + */ + +/** + @brief Householder transform of a half floating point vector. + @param[in] pSrc points to the input vector. + @param[in] threshold norm2 threshold. + @param[in] blockSize dimension of the vector space. + @param[out] pOut points to the output vector. + @return beta return the scaling factor beta + */ + + +#if defined(ARM_FLOAT16_SUPPORTED) + + + +float16_t arm_householder_f16( + const float16_t * pSrc, + const float16_t threshold, + uint32_t blockSize, + float16_t * pOut + ) + +{ + uint32_t i; + float16_t epsilon; + float16_t x1norm2,alpha; + float16_t beta,tau,r; + + epsilon = threshold; + + alpha = pSrc[0]; + + for(i=1; i < blockSize; i++) + { + pOut[i] = pSrc[i]; + } + pOut[0] = 1.0f16; + + arm_dot_prod_f16(pSrc+1,pSrc+1,blockSize-1,&x1norm2); + + if ((_Float16)x1norm2<=(_Float16)epsilon) + { + tau = 0.0f16; + memset(pOut,0,blockSize * sizeof(float16_t)); + } + else + { + beta = (_Float16)alpha * (_Float16)alpha + (_Float16)x1norm2; + (void)arm_sqrt_f16(beta,&beta); + + if ((_Float16)alpha > 0.0f16) + { + beta = -(_Float16)beta; + } + + r = 1.0f16 / ((_Float16)alpha -(_Float16)beta); + arm_scale_f16(pOut,r,pOut,blockSize); + pOut[0] = 1.0f16; + + + tau = ((_Float16)beta - (_Float16)alpha) / (_Float16)beta; + + } + + return(tau); + +} + + +#endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ +/** + @} end of MatrixHouseholder group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_householder_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_householder_f32.c new file mode 100644 index 0000000..c1510bc --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_householder_f32.c @@ -0,0 +1,196 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_householder_f32.c + * Description: Floating-point Householder transform + * + * $Date: 15 June 2022 + * $Revision: V1.11.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h" + +#include + + + +/** + @ingroup groupMatrix + */ + +/** + @defgroup MatrixHouseholder Householder transform of a vector + + Computes the Householder transform of a vector x. + + The Householder transform of x is a vector v with + + \f[ + v_0 = 1 + \f] + + and a scalar \f$\beta\f$ such that: + + \f[ + P = I - \beta v v^T + \f] + + is an orthogonal matrix and + + \f[ + P x = ||x||_2 e_1 + \f] + + So P is an hyperplane reflection such that the image of x + is proportional to \f$e_1\f$. + + \f$e_1\f$ is the vector of coordinates: + + \f[ + \begin{pmatrix} + 1 \\ + 0 \\ + \vdots \\ + \end{pmatrix} + \f] + + If x is already proportional to \f$e_1\f$ then + the matrix P should be the identity. + + Thus, \f$\beta\f$ should be 0 and in this case the vector v + can also be null. + + But how do we detect that x is already proportional to + \f$e_1\f$. + + If x + \f[ + x = + \begin{pmatrix} + x_0 \\ + xr \\ + \end{pmatrix} + \f] + + where \f$xr\f$ is a vector. + + The algorithm is computing the norm squared of this vector: + + \f[ + ||xr||^2 + \f] + + and this value is compared to a `threshold`. If the value + is smaller than the `threshold`, the algorithm is + returning 0 for \f$\beta\f$ and the householder vector. + + This `threshold` is an argument of the function. + + Default values are provided in the header + `dsp/matrix_functions.h` like for instance + `DEFAULT_HOUSEHOLDER_THRESHOLD_F32` + + + + */ + +/** + @addtogroup MatrixHouseholder + @{ + */ + +/** + @brief Householder transform of a floating point vector. + @param[in] pSrc points to the input vector. + @param[in] threshold norm2 threshold. + @param[in] blockSize dimension of the vector space. + @param[out] pOut points to the output vector. + @return beta return the scaling factor beta + */ + + + + +float32_t arm_householder_f32( + const float32_t * pSrc, + const float32_t threshold, + uint32_t blockSize, + float32_t * pOut + ) + +{ + uint32_t i; + float32_t epsilon; + float32_t x1norm2,alpha; + float32_t beta,tau,r; + + epsilon = threshold; + + alpha = pSrc[0]; + + for(i=1; i < blockSize; i++) + { + pOut[i] = pSrc[i]; + } + pOut[0] = 1.0f; + + arm_dot_prod_f32(pSrc+1,pSrc+1,blockSize-1,&x1norm2); + + if (x1norm2<=epsilon) + { + tau = 0.0f; + memset(pOut,0,blockSize * sizeof(float32_t)); + } + else + { + beta = alpha * alpha + x1norm2; + (void)arm_sqrt_f32(beta,&beta); + + if (alpha > 0.0f) + { + beta = -beta; + } + + r = 1.0f / (alpha -beta); + arm_scale_f32(pOut,r,pOut,blockSize); + pOut[0] = 1.0f; + + + tau = (beta - alpha) / beta; + + } + + return(tau); + +} + + +/** + @} end of MatrixHouseholder group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_householder_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_householder_f64.c new file mode 100644 index 0000000..3f41011 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_householder_f64.c @@ -0,0 +1,121 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_householder_f64.c + * Description: Double floating-point Householder transform + * + * $Date: 15 June 2022 + * $Revision: V1.11.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h" + +#include + + + +/** + @ingroup groupMatrix + */ + + +/** + @addtogroup MatrixHouseholder + @{ + */ + +/** + @brief Householder transform of a double floating point vector. + @param[in] pSrc points to the input vector. + @param[in] threshold norm2 threshold. + @param[in] blockSize dimension of the vector space. + @param[out] pOut points to the output vector. + @return beta return the scaling factor beta + */ + + + + +float64_t arm_householder_f64( + const float64_t * pSrc, + const float64_t threshold, + uint32_t blockSize, + float64_t * pOut + ) + +{ + uint32_t i; + float64_t epsilon; + float64_t x1norm2,alpha; + float64_t beta,tau,r; + + epsilon = threshold; + + alpha = pSrc[0]; + + for(i=1; i < blockSize; i++) + { + pOut[i] = pSrc[i]; + } + pOut[0] = 1.0; + + arm_dot_prod_f64(pSrc+1,pSrc+1,blockSize-1,&x1norm2); + + if (x1norm2<=epsilon) + { + tau = 0.0; + memset(pOut,0,blockSize * sizeof(float64_t)); + } + else + { + beta = alpha * alpha + x1norm2; + beta=sqrt(beta); + + if (alpha > 0.0) + { + beta = -beta; + } + + r = 1.0 / (alpha -beta); + arm_scale_f64(pOut,r,pOut,blockSize); + pOut[0] = 1.0; + + + tau = (beta - alpha) / beta; + + } + + return(tau); + +} + + +/** + @} end of MatrixHouseholder group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_add_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_add_f16.c index b598b4a..77b4fab 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_add_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_add_f16.c @@ -5,13 +5,13 @@ * Title: arm_mat_add_f16.c * Description: Floating-point matrix addition * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -64,7 +64,7 @@ arm_status arm_mat_add_f16( arm_status status; uint32_t numSamples; /* total number of elements in the matrix */ float16_t *pDataA, *pDataB, *pDataDst; - f16x8_t vecA, vecB, vecDst; + f16x8_t vecA, vecB, vecDst = { 0 }; float16_t const *pSrcAVec; float16_t const *pSrcBVec; uint32_t blkCnt; /* loop counters */ @@ -169,13 +169,13 @@ arm_status arm_mat_add_f16( /* C(m,n) = A(m,n) + B(m,n) */ /* Add and store result in destination buffer. */ - *pOut++ = *pInA++ + *pInB++; + *pOut++ = (_Float16)*pInA++ + (_Float16)*pInB++; - *pOut++ = *pInA++ + *pInB++; + *pOut++ = (_Float16)*pInA++ + (_Float16)*pInB++; - *pOut++ = *pInA++ + *pInB++; + *pOut++ = (_Float16)*pInA++ + (_Float16)*pInB++; - *pOut++ = *pInA++ + *pInB++; + *pOut++ = (_Float16)*pInA++ + (_Float16)*pInB++; /* Decrement loop counter */ blkCnt--; @@ -196,7 +196,7 @@ arm_status arm_mat_add_f16( /* C(m,n) = A(m,n) + B(m,n) */ /* Add and store result in destination buffer. */ - *pOut++ = *pInA++ + *pInB++; + *pOut++ = (_Float16)*pInA++ + (_Float16)*pInB++; /* Decrement loop counter */ blkCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_add_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_add_f32.c index 705d680..b777249 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_add_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_add_f32.c @@ -5,13 +5,13 @@ * Title: arm_mat_add_f32.c * Description: Floating-point matrix addition * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -38,7 +38,27 @@ @defgroup MatrixAdd Matrix Addition Adds two matrices. - \image html MatrixAddition.gif "Addition of two 3 x 3 matrices" + @par Addition of two 3 x 3 matrices + + \f[ + \begin{pmatrix} + a_{1,1} & a_{1,2} & a_{1,3} \\ + a_{2,1} & a_{2,2} & a_{2,3} \\ + a_{3,1} & a_{3,2} & a_{3,3} \\ + \end{pmatrix} + + + \begin{pmatrix} + b_{1,1} & b_{1,2} & b_{1,3} \\ + b_{2,1} & b_{2,2} & b_{2,3} \\ + b_{3,1} & b_{3,2} & b_{3,3} \\ + \end{pmatrix} + = + \begin{pmatrix} + a_{1,1}+b_{1,1} & a_{1,2}+b_{1,2} & a_{1,3}+b_{1,3} \\ + a_{2,1}+b_{2,1} & a_{2,2}+b_{2,2} & a_{2,3}+b_{2,3} \\ + a_{3,1}+b_{3,1} & a_{3,2}+b_{3,2} & a_{3,3}+b_{3,3} \\ + \end{pmatrix} + \f] The functions check to make sure that pSrcA, pSrcB, and pDst have the same @@ -70,7 +90,7 @@ arm_status arm_mat_add_f32( arm_status status; uint32_t numSamples; /* total number of elements in the matrix */ float32_t *pDataA, *pDataB, *pDataDst; - f32x4_t vecA, vecB, vecDst; + f32x4_t vecA, vecB, vecDst = { 0 }; float32_t const *pSrcAVec; float32_t const *pSrcBVec; uint32_t blkCnt; /* loop counters */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_add_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_add_q15.c index 0e7d5fa..9a1dfa0 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_add_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_add_q15.c @@ -5,13 +5,13 @@ * Title: arm_mat_add_q15.c * Description: Q15 matrix addition * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -61,7 +61,7 @@ arm_status arm_mat_add_q15( { uint32_t numSamples; /* total number of elements in the matrix */ q15_t *pDataA, *pDataB, *pDataDst; - q15x8_t vecA, vecB, vecDst; + q15x8_t vecA, vecB, vecDst = { 0 }; q15_t const *pSrcAVec; q15_t const *pSrcBVec; uint32_t blkCnt; /* loop counters */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_add_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_add_q31.c index b5c98e4..7b08dbf 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_add_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_add_q31.c @@ -5,13 +5,13 @@ * Title: arm_mat_add_q31.c * Description: Q31 matrix addition * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -61,7 +61,7 @@ arm_status arm_mat_add_q31( arm_status status; /* status of matrix addition */ uint32_t numSamples; /* total number of elements in the matrix */ q31_t *pDataA, *pDataB, *pDataDst; - q31x4_t vecA, vecB, vecDst; + q31x4_t vecA, vecB, vecDst = { 0 }; q31_t const *pSrcAVec; q31_t const *pSrcBVec; uint32_t blkCnt; /* loop counters */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cholesky_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cholesky_f16.c index f6429f6..31b245e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cholesky_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cholesky_f16.c @@ -5,11 +5,13 @@ * Title: arm_mat_cholesky_f16.c * Description: Floating-point Cholesky decomposition * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -27,6 +29,7 @@ */ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions_f16.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h" #if defined(ARM_FLOAT16_SUPPORTED) @@ -50,7 +53,7 @@ - \ref ARM_MATH_DECOMPOSITION_FAILURE : Input matrix cannot be decomposed * @par * If the matrix is ill conditioned or only semi-definite, then it is better using the LDL^t decomposition. - * The decomposition of A is returning a lower triangular matrix U such that A = U U^t + * The decomposition of A is returning a lower triangular matrix U such that A = L L^t */ #if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) @@ -158,16 +161,13 @@ arm_status arm_mat_cholesky_f16( pG[j * n + i] = vecAddAcrossF16Mve(acc); } - if (pG[i * n + i] <= 0.0f16) + if ((_Float16)pG[i * n + i] <= 0.0f16) { return(ARM_MATH_DECOMPOSITION_FAILURE); } - invSqrtVj = (_Float16)1.0f/sqrtf(pG[i * n + i]); - for(j=i; j < n ; j++) - { - pG[j * n + i] = (_Float16)pG[j * n + i] * invSqrtVj ; - } + invSqrtVj = 1.0f16/(_Float16)sqrtf((float32_t)pG[i * n + i]); + SCALE_COL_F16(pDst,i,invSqrtVj,i); } status = ARM_MATH_SUCCESS; @@ -220,20 +220,21 @@ arm_status arm_mat_cholesky_f16( for(k=0; k < i ; k++) { - pG[j * n + i] = pG[j * n + i] - pG[i * n + k] * pG[j * n + k]; + pG[j * n + i] = (_Float16)pG[j * n + i] - (_Float16)pG[i * n + k] * (_Float16)pG[j * n + k]; } } - if (pG[i * n + i] <= 0.0f) + if ((_Float16)pG[i * n + i] <= 0.0f16) { return(ARM_MATH_DECOMPOSITION_FAILURE); } - invSqrtVj = 1.0f/sqrtf(pG[i * n + i]); - for(j=i ; j < n ; j++) - { - pG[j * n + i] = pG[j * n + i] * invSqrtVj ; - } + /* The division is done in float32 for accuracy reason and + because doing it in f16 would not have any impact on the performances. + */ + invSqrtVj = 1.0f/sqrtf((float32_t)pG[i * n + i]); + SCALE_COL_F16(pDst,i,invSqrtVj,i); + } status = ARM_MATH_SUCCESS; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cholesky_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cholesky_f32.c index 89f5ae9..77890a4 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cholesky_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cholesky_f32.c @@ -5,11 +5,13 @@ * Title: arm_mat_cholesky_f32.c * Description: Floating-point Cholesky decomposition * + * $Date: 05 October 2021 + * $Revision: V1.9.1 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -27,6 +29,7 @@ */ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h" /** @ingroup groupMatrix @@ -35,7 +38,7 @@ /** @defgroup MatrixChol Cholesky and LDLT decompositions - Computes the Cholesky or LDL^t decomposition of a matrix. + Computes the Cholesky or LL^t decomposition of a matrix. If the input matrix does not have a decomposition, then the @@ -58,7 +61,7 @@ - \ref ARM_MATH_DECOMPOSITION_FAILURE : Input matrix cannot be decomposed * @par * If the matrix is ill conditioned or only semi-definite, then it is better using the LDL^t decomposition. - * The decomposition of A is returning a lower triangular matrix U such that A = U U^t + * The decomposition of A is returning a lower triangular matrix L such that A = L L^t */ #if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) @@ -170,10 +173,7 @@ arm_status arm_mat_cholesky_f32( } invSqrtVj = 1.0f/sqrtf(pG[i * n + i]); - for(j=i; j < n ; j++) - { - pG[j * n + i] = pG[j * n + i] * invSqrtVj ; - } + SCALE_COL_F32(pDst,i,invSqrtVj,i); } status = ARM_MATH_SUCCESS; @@ -221,7 +221,9 @@ arm_status arm_mat_cholesky_f32( f32x4_t acc, acc0, acc1, acc2, acc3; f32x4_t vecGi; f32x4_t vecGj,vecGj0,vecGj1,vecGj2,vecGj3; - f32x2_t tmp = vdup_n_f32(0); +#if !defined(__aarch64__) + f32x2_t tmp = vdup_n_f32(0); +#endif float32_t sum=0.0f; float32_t sum0=0.0f,sum1=0.0f,sum2=0.0f,sum3=0.0f; @@ -264,7 +266,7 @@ arm_status arm_mat_cholesky_f32( k+=4; } -#if __aarch64__ +#if defined(__aarch64__) sum0 = vpadds_f32(vpadd_f32(vget_low_f32(acc0), vget_high_f32(acc0))); sum1 = vpadds_f32(vpadd_f32(vget_low_f32(acc1), vget_high_f32(acc1))); sum2 = vpadds_f32(vpadd_f32(vget_low_f32(acc2), vget_high_f32(acc2))); @@ -322,7 +324,7 @@ arm_status arm_mat_cholesky_f32( k+=4; } -#if __aarch64__ +#if defined(__aarch64__) sum = vpadds_f32(vpadd_f32(vget_low_f32(acc), vget_high_f32(acc))); #else tmp = vpadd_f32(vget_low_f32(acc), vget_high_f32(acc)); @@ -348,10 +350,7 @@ arm_status arm_mat_cholesky_f32( } invSqrtVj = 1.0f/sqrtf(pG[i * n + i]); - for(j=i; j < n ; j++) - { - pG[j * n + i] = pG[j * n + i] * invSqrtVj ; - } + SCALE_COL_F32(pDst,i,invSqrtVj,i); } status = ARM_MATH_SUCCESS; @@ -414,10 +413,8 @@ arm_status arm_mat_cholesky_f32( } invSqrtVj = 1.0f/sqrtf(pG[i * n + i]); - for(j=i ; j < n ; j++) - { - pG[j * n + i] = pG[j * n + i] * invSqrtVj ; - } + SCALE_COL_F32(pDst,i,invSqrtVj,i); + } status = ARM_MATH_SUCCESS; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cholesky_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cholesky_f64.c index d73edfe..b42f296 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cholesky_f64.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cholesky_f64.c @@ -5,11 +5,13 @@ * Title: arm_mat_cholesky_f64.c * Description: Floating-point Cholesky decomposition * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -27,6 +29,7 @@ */ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h" /** @ingroup groupMatrix @@ -48,7 +51,7 @@ - \ref ARM_MATH_DECOMPOSITION_FAILURE : Input matrix cannot be decomposed * @par * If the matrix is ill conditioned or only semi-definite, then it is better using the LDL^t decomposition. - * The decomposition of A is returning a lower triangular matrix U such that A = U U^t + * The decomposition of A is returning a lower triangular matrix L such that A = L L^t */ @@ -96,16 +99,14 @@ arm_status arm_mat_cholesky_f64( } } - if (pG[i * n + i] <= 0.0f) + if (pG[i * n + i] <= 0.0) { return(ARM_MATH_DECOMPOSITION_FAILURE); } invSqrtVj = 1.0/sqrt(pG[i * n + i]); - for(j=i ; j < n ; j++) - { - pG[j * n + i] = pG[j * n + i] * invSqrtVj ; - } + SCALE_COL_F64(pDst,i,invSqrtVj,i); + } status = ARM_MATH_SUCCESS; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_mult_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_mult_f16.c index 398e5eb..3822659 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_mult_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_mult_f16.c @@ -5,13 +5,13 @@ * Title: arm_mat_cmplx_mult_f16.c * Description: Floating-point matrix multiplication * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -69,7 +69,7 @@ __STATIC_FORCEINLINE arm_status arm_mat_cmplx_mult_f16_2x2_mve( const arm_matrix_instance_f16 * pSrcB, arm_matrix_instance_f16 * pDst) { - const uint16_t MATRIX_DIM = 2; +#define MATRIX_DIM 2 float16_t const *pInB = pSrcB->pData; /* input data matrix pointer B */ float16_t *pInA = pSrcA->pData; /* input data matrix pointer A */ float16_t *pOut = pDst->pData; /* output data matrix pointer */ @@ -133,6 +133,7 @@ __STATIC_FORCEINLINE arm_status arm_mat_cmplx_mult_f16_2x2_mve( * Return to application */ return (ARM_MATH_SUCCESS); +#undef MATRIX_DIM } @@ -142,7 +143,7 @@ __STATIC_FORCEINLINE arm_status arm_mat_cmplx_mult_f16_3x3_mve( const arm_matrix_instance_f16 * pSrcB, arm_matrix_instance_f16 * pDst) { - const uint16_t MATRIX_DIM = 3; +#define MATRIX_DIM 3 float16_t const *pInB = pSrcB->pData; /* input data matrix pointer B */ float16_t *pInA = pSrcA->pData; /* input data matrix pointer A */ float16_t *pOut = pDst->pData; /* output data matrix pointer */ @@ -228,6 +229,7 @@ __STATIC_FORCEINLINE arm_status arm_mat_cmplx_mult_f16_3x3_mve( * Return to application */ return (ARM_MATH_SUCCESS); +#undef MATRIX_DIM } @@ -238,7 +240,7 @@ __STATIC_FORCEINLINE arm_status arm_mat_cmplx_mult_f16_4x4_mve( const arm_matrix_instance_f16 * pSrcB, arm_matrix_instance_f16 * pDst) { - const uint16_t MATRIX_DIM = 4; +#define MATRIX_DIM 4 float16_t const *pInB = pSrcB->pData; /* input data matrix pointer B */ float16_t *pInA = pSrcA->pData; /* input data matrix pointer A */ float16_t *pOut = pDst->pData; /* output data matrix pointer */ @@ -373,6 +375,7 @@ __STATIC_FORCEINLINE arm_status arm_mat_cmplx_mult_f16_4x4_mve( * Return to application */ return (ARM_MATH_SUCCESS); +#undef MATRIX_DIM } @@ -417,8 +420,8 @@ if ((pSrcA->numCols != pSrcB->numRows) || { if (numRowsA == 1) { - pOut[0] = pInA[0] * pInB[0] - pInA[1] * pInB[1]; - pOut[1] = pInA[0] * pInB[1] + pInA[1] * pInB[0]; + pOut[0] = (_Float16)pInA[0] * (_Float16)pInB[0] - (_Float16)pInA[1] * (_Float16)pInB[1]; + pOut[1] = (_Float16)pInA[0] * (_Float16)pInB[1] + (_Float16)pInA[1] * (_Float16)pInB[0]; return (ARM_MATH_SUCCESS); } else if (numRowsA == 2) diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_mult_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_mult_f32.c index 1619ccd..941849d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_mult_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_mult_f32.c @@ -5,13 +5,13 @@ * Title: arm_mat_cmplx_mult_f32.c * Description: Floating-point matrix multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -534,7 +534,7 @@ arm_status arm_mat_cmplx_mult_f32( uint16_t numRowsA = pSrcA->numRows; /* number of rows of input matrix A */ uint16_t numColsB = pSrcB->numCols; /* number of columns of input matrix B */ uint16_t numColsA = pSrcA->numCols; /* number of columns of input matrix A */ - uint16_t col, i = 0U, row = numRowsA, colCnt; /* loop counters */ + uint16_t col, i = 0U, row = numRowsA; /* loop counters */ arm_status status; /* status of matrix multiplication */ uint32x4_t vecOffs, vecColBOffs; uint32_t blkCnt, rowCnt; /* loop counters */ @@ -613,7 +613,6 @@ arm_status arm_mat_cmplx_mult_f32( /* * Matrix A columns number of MAC operations are to be performed */ - colCnt = numColsA; float32_t const *pSrcA0Vec, *pSrcA1Vec, *pSrcA2Vec, *pSrcA3Vec; float32_t const *pInA0 = pInA; @@ -754,7 +753,6 @@ arm_status arm_mat_cmplx_mult_f32( /* * Matrix A columns number of MAC operations are to be performed */ - colCnt = numColsA; float32_t const *pSrcA0Vec; float32_t const *pInA0 = pInA; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_mult_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_mult_q15.c index 120c925..09f457f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_mult_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_mult_q15.c @@ -5,13 +5,13 @@ * Title: arm_cmplx_mat_mult_q15.c * Description: Q15 complex matrix multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -463,8 +463,8 @@ arm_status arm_mat_cmplx_mult_q15( #if defined (ARM_MATH_DSP) /* read real and imag values from pSrcA and pSrcB buffer */ - pSourceA = read_q15x2_ia ((q15_t **) &pInA); - pSourceB = read_q15x2_ia ((q15_t **) &pInB); + pSourceA = read_q15x2_ia (&pInA); + pSourceB = read_q15x2_ia (&pInB); /* Multiply and Accumlates */ #ifdef ARM_MATH_BIG_ENDIAN @@ -477,8 +477,8 @@ arm_status arm_mat_cmplx_mult_q15( sumImag += (q63_t) prod2; /* read real and imag values from pSrcA and pSrcB buffer */ - pSourceA = read_q15x2_ia ((q15_t **) &pInA); - pSourceB = read_q15x2_ia ((q15_t **) &pInB); + pSourceA = read_q15x2_ia (&pInA); + pSourceB = read_q15x2_ia (&pInB); /* Multiply and Accumlates */ #ifdef ARM_MATH_BIG_ENDIAN @@ -536,8 +536,8 @@ arm_status arm_mat_cmplx_mult_q15( #if defined (ARM_MATH_DSP) /* read real and imag values from pSrcA and pSrcB buffer */ - pSourceA = read_q15x2_ia ((q15_t **) &pInA); - pSourceB = read_q15x2_ia ((q15_t **) &pInB); + pSourceA = read_q15x2_ia (&pInA); + pSourceB = read_q15x2_ia (&pInB); /* Multiply and Accumlates */ #ifdef ARM_MATH_BIG_ENDIAN diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_mult_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_mult_q31.c index 960f4a6..9933865 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_mult_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_mult_q31.c @@ -5,13 +5,13 @@ * Title: arm_mat_cmplx_mult_q31.c * Description: Floating-point matrix multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -528,7 +528,7 @@ arm_status arm_mat_cmplx_mult_q31( uint16_t numRowsA = pSrcA->numRows; /* number of rows of input matrix A */ uint16_t numColsB = pSrcB->numCols; /* number of columns of input matrix B */ uint16_t numColsA = pSrcA->numCols; /* number of columns of input matrix A */ - uint16_t col, i = 0U, row = numRowsA, colCnt; /* loop counters */ + uint16_t col, i = 0U, row = numRowsA; /* loop counters */ arm_status status; /* status of matrix multiplication */ uint32x4_t vecOffs, vecColBOffs; uint32_t blkCnt, rowCnt; /* loop counters */ @@ -613,7 +613,6 @@ arm_status arm_mat_cmplx_mult_q31( /* * Matrix A columns number of MAC operations are to be performed */ - colCnt = numColsA; q31_t const *pSrcA0Vec, *pSrcA1Vec; q31_t const *pInA0 = pInA; @@ -744,7 +743,6 @@ arm_status arm_mat_cmplx_mult_q31( /* * Matrix A columns number of MAC operations are to be performed */ - colCnt = numColsA; q31_t const *pSrcA0Vec; q31_t const *pInA0 = pInA; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_trans_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_trans_f16.c index bbcbe04..3e96414 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_trans_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_trans_f16.c @@ -5,13 +5,13 @@ * Title: arm_mat_cmplx_trans_f16.c * Description: Floating-point complex matrix transpose * - * $Date: 08. July 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_trans_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_trans_f32.c index 38e77c3..e551d07 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_trans_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_trans_f32.c @@ -5,13 +5,13 @@ * Title: arm_mat_cmplx_trans_f32.c * Description: Floating-point complex matrix transpose * - * $Date: 08. July 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -40,7 +40,23 @@ Tranposes a complex matrix. Transposing an M x N matrix flips it around the center diagonal and results in an N x M matrix. - \image html MatrixTranspose.gif "Transpose of a 3 x 3 matrix" + + @par Transpose of a 3 x 3 matrix + + \f[ + \begin{pmatrix} + a_{1,1} & a_{1,2} & a_{1,3} \\ + a_{2,1} & a_{2,2} & a_{2,3} \\ + a_{3,1} & a_{3,2} & a_{3,3} \\ + \end{pmatrix}^T + = + \begin{pmatrix} + a_{1,1} & a_{2,1} & a_{3,1} \\ + a_{1,2} & a_{2,2} & a_{3,2} \\ + a_{1,3} & a_{2,3} & a_{3,3} \\ + \end{pmatrix} + \f] + */ /** diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_trans_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_trans_q15.c index 37d1724..1f80f12 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_trans_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_trans_q15.c @@ -5,13 +5,13 @@ * Title: arm_mat_cmplx_trans_q31.c * Description: Q15 complex matrix transpose * - * $Date: 08. July 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_trans_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_trans_q31.c index 1ad551a..ba38341 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_trans_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_cmplx_trans_q31.c @@ -5,13 +5,13 @@ * Title: arm_mat_cmplx_trans_q31.c * Description: Q31 complex matrix transpose * - * $Date: 08. July 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_init_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_init_f16.c index ddf9390..e5a7aa2 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_init_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_init_f16.c @@ -5,13 +5,13 @@ * Title: arm_mat_init_f16.c * Description: Floating-point matrix initialization * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_init_f32.c index 0122f3d..c9348fd 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_mat_init_f32.c * Description: Floating-point matrix initialization * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_init_q15.c index 281b165..bd2a7c2 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_init_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_init_q15.c @@ -5,13 +5,13 @@ * Title: arm_mat_init_q15.c * Description: Q15 matrix initialization * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_init_q31.c index 64f2e7e..a9bcb52 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_mat_init_q31.c * Description: Q31 matrix initialization * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -34,10 +34,7 @@ @ingroup groupMatrix */ -/** - @defgroup MatrixInit Matrix Initialization - - */ + /** @addtogroup MatrixInit diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_inverse_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_inverse_f16.c index 4565796..27ad218 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_inverse_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_inverse_f16.c @@ -5,13 +5,13 @@ * Title: arm_mat_inverse_f16.c * Description: Floating-point matrix inverse * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -29,6 +29,7 @@ */ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions_f16.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h" #if defined(ARM_FLOAT16_SUPPORTED) @@ -52,526 +53,20 @@ - \ref ARM_MATH_SIZE_MISMATCH : Matrix size check failed - \ref ARM_MATH_SINGULAR : Input matrix is found to be singular (non-invertible) */ -#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) - -arm_status arm_mat_inverse_f16( - const arm_matrix_instance_f16 * pSrc, - arm_matrix_instance_f16 * pDst) -{ - float16_t *pIn = pSrc->pData; /* input data matrix pointer */ - float16_t *pOut = pDst->pData; /* output data matrix pointer */ - float16_t *pInT1, *pInT2; /* Temporary input data matrix pointer */ - float16_t *pOutT1, *pOutT2; /* Temporary output data matrix pointer */ - float16_t *pPivotRowIn, *pPRT_in, *pPivotRowDst, *pPRT_pDst; /* Temporary input and output data matrix pointer */ - - uint32_t numRows = pSrc->numRows; /* Number of rows in the matrix */ - uint32_t numCols = pSrc->numCols; /* Number of Cols in the matrix */ - float16_t *pTmpA, *pTmpB; - - _Float16 in = 0.0f16; /* Temporary input values */ - uint32_t i, rowCnt, flag = 0U, j, loopCnt, k, l; /* loop counters */ - arm_status status; /* status of matrix inverse */ - uint32_t blkCnt; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrc->numRows != pSrc->numCols) || (pDst->numRows != pDst->numCols) - || (pSrc->numRows != pDst->numRows)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif /* #ifdef ARM_MATH_MATRIX_CHECK */ - { - - /*-------------------------------------------------------------------------------------------------------------- - * Matrix Inverse can be solved using elementary row operations. - * - * Gauss-Jordan Method: - * - * 1. First combine the identity matrix and the input matrix separated by a bar to form an - * augmented matrix as follows: - * _ _ _ _ _ _ _ _ - * | | a11 a12 | | | 1 0 | | | X11 X12 | - * | | | | | | | = | | - * |_ |_ a21 a22 _| | |_0 1 _| _| |_ X21 X21 _| - * - * 2. In our implementation, pDst Matrix is used as identity matrix. - * - * 3. Begin with the first row. Let i = 1. - * - * 4. Check to see if the pivot for row i is zero. - * The pivot is the element of the main diagonal that is on the current row. - * For instance, if working with row i, then the pivot element is aii. - * If the pivot is zero, exchange that row with a row below it that does not - * contain a zero in column i. If this is not possible, then an inverse - * to that matrix does not exist. - * - * 5. Divide every element of row i by the pivot. - * - * 6. For every row below and row i, replace that row with the sum of that row and - * a multiple of row i so that each new element in column i below row i is zero. - * - * 7. Move to the next row and column and repeat steps 2 through 5 until you have zeros - * for every element below and above the main diagonal. - * - * 8. Now an identical matrix is formed to the left of the bar(input matrix, src). - * Therefore, the matrix to the right of the bar is our solution(dst matrix, dst). - *----------------------------------------------------------------------------------------------------------------*/ - - /* - * Working pointer for destination matrix - */ - pOutT1 = pOut; - /* - * Loop over the number of rows - */ - rowCnt = numRows; - /* - * Making the destination matrix as identity matrix - */ - while (rowCnt > 0U) - { - /* - * Writing all zeroes in lower triangle of the destination matrix - */ - j = numRows - rowCnt; - while (j > 0U) - { - *pOutT1++ = 0.0f16; - j--; - } - /* - * Writing all ones in the diagonal of the destination matrix - */ - *pOutT1++ = 1.0f16; - /* - * Writing all zeroes in upper triangle of the destination matrix - */ - j = rowCnt - 1U; - while (j > 0U) - { - *pOutT1++ = 0.0f16; - j--; - } - /* - * Decrement the loop counter - */ - rowCnt--; - } - - /* - * Loop over the number of columns of the input matrix. - * All the elements in each column are processed by the row operations - */ - loopCnt = numCols; - /* - * Index modifier to navigate through the columns - */ - l = 0U; - while (loopCnt > 0U) - { - /* - * Check if the pivot element is zero.. - * If it is zero then interchange the row with non zero row below. - * If there is no non zero element to replace in the rows below, - * then the matrix is Singular. - */ - - /* - * Working pointer for the input matrix that points - * * to the pivot element of the particular row - */ - pInT1 = pIn + (l * numCols); - /* - * Working pointer for the destination matrix that points - * * to the pivot element of the particular row - */ - pOutT1 = pOut + (l * numCols); - /* - * Temporary variable to hold the pivot value - */ - in = *pInT1; - /* - * Destination pointer modifier - */ - k = 1U; - - /* - * Check if the pivot element is zero - */ - if (*pInT1 == 0.0f16) - { - /* - * Loop over the number rows present below - */ - for (i = (l + 1U); i < numRows; i++) - { - /* - * Update the input and destination pointers - */ - pInT2 = pInT1 + (numCols * i); - pOutT2 = pOutT1 + (numCols * k); - /* - * Check if there is a non zero pivot element to - * * replace in the rows below - */ - if (*pInT2 != 0.0f16) - { - f16x8_t vecA, vecB; - /* - * Loop over number of columns - * * to the right of the pilot element - */ - pTmpA = pInT1; - pTmpB = pInT2; - blkCnt = (numCols - l) >> 3; - while (blkCnt > 0U) - { - - vecA = vldrhq_f16(pTmpA); - vecB = vldrhq_f16(pTmpB); - vstrhq_f16(pTmpB, vecA); - vstrhq_f16(pTmpA, vecB); - - pTmpA += 8; - pTmpB += 8; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - /* - * tail - * (will be merged thru tail predication) - */ - blkCnt = (numCols - l) & 7; - if (blkCnt > 0U) - { - mve_pred16_t p0 = vctp16q(blkCnt); - - vecA = vldrhq_f16(pTmpA); - vecB = vldrhq_f16(pTmpB); - vstrhq_p_f16(pTmpB, vecA, p0); - vstrhq_p_f16(pTmpA, vecB, p0); - } - - pInT1 += numCols - l; - pInT2 += numCols - l; - pTmpA = pOutT1; - pTmpB = pOutT2; - blkCnt = numCols >> 3; - while (blkCnt > 0U) - { - - vecA = vldrhq_f16(pTmpA); - vecB = vldrhq_f16(pTmpB); - vstrhq_f16(pTmpB, vecA); - vstrhq_f16(pTmpA, vecB); - pTmpA += 8; - pTmpB += 8; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - /* - * tail - */ - blkCnt = numCols & 7; - if (blkCnt > 0U) - { - mve_pred16_t p0 = vctp16q(blkCnt); - - vecA = vldrhq_f16(pTmpA); - vecB = vldrhq_f16(pTmpB); - vstrhq_p_f16(pTmpB, vecA, p0); - vstrhq_p_f16(pTmpA, vecB, p0); - } - - pOutT1 += numCols; - pOutT2 += numCols; - /* - * Flag to indicate whether exchange is done or not - */ - flag = 1U; - - /* - * Break after exchange is done - */ - break; - } - /* - * Update the destination pointer modifier - */ - k++; - } - } - - /* - * Update the status if the matrix is singular - */ - if ((flag != 1U) && (in == 0.0f16)) - { - return ARM_MATH_SINGULAR; - } - - /* - * Points to the pivot row of input and destination matrices - */ - pPivotRowIn = pIn + (l * numCols); - pPivotRowDst = pOut + (l * numCols); - - /* - * Temporary pointers to the pivot row pointers - */ - pInT1 = pPivotRowIn; - pOutT1 = pPivotRowDst; - - /* - * Pivot element of the row - */ - in = *(pIn + (l * numCols)); - - pTmpA = pInT1; - - f16x8_t invIn = vdupq_n_f16(1.0f16 / in); - - blkCnt = (numCols - l) >> 3; - f16x8_t vecA; - while (blkCnt > 0U) - { - *(f16x8_t *) pTmpA = *(f16x8_t *) pTmpA * invIn; - pTmpA += 8; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - /* - * tail - */ - blkCnt = (numCols - l) & 7; - if (blkCnt > 0U) - { - mve_pred16_t p0 = vctp16q(blkCnt); - - - vecA = vldrhq_f16(pTmpA); - vecA = vecA * invIn; - vstrhq_p_f16(pTmpA, vecA, p0); - } - - pInT1 += numCols - l; - /* - * Loop over number of columns - * * to the right of the pilot element - */ - - pTmpA = pOutT1; - blkCnt = numCols >> 3; - while (blkCnt > 0U) - { - *(f16x8_t *) pTmpA = *(f16x8_t *) pTmpA *invIn; - pTmpA += 8; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - /* - * tail - * (will be merged thru tail predication) - */ - blkCnt = numCols & 7; - if (blkCnt > 0U) - { - mve_pred16_t p0 = vctp16q(blkCnt); - - vecA = vldrhq_f16(pTmpA); - vecA = vecA * invIn; - vstrhq_p_f16(pTmpA, vecA, p0); - } - - pOutT1 += numCols; - - /* - * Replace the rows with the sum of that row and a multiple of row i - * * so that each new element in column i above row i is zero. - */ - - /* - * Temporary pointers for input and destination matrices - */ - pInT1 = pIn; - pOutT1 = pOut; - - for (i = 0U; i < numRows; i++) - { - /* - * Check for the pivot element - */ - if (i == l) - { - /* - * If the processing element is the pivot element, - * only the columns to the right are to be processed - */ - pInT1 += numCols - l; - pOutT1 += numCols; - } - else - { - /* - * Element of the reference row - */ - - /* - * Working pointers for input and destination pivot rows - */ - pPRT_in = pPivotRowIn; - pPRT_pDst = pPivotRowDst; - /* - * Loop over the number of columns to the right of the pivot element, - * to replace the elements in the input matrix - */ - - in = *pInT1; - f16x8_t tmpV = vdupq_n_f16(in); - - blkCnt = (numCols - l) >> 3; - while (blkCnt > 0U) - { - f16x8_t vec1, vec2; - /* - * Replace the element by the sum of that row - * and a multiple of the reference row - */ - vec1 = vldrhq_f16(pInT1); - vec2 = vldrhq_f16(pPRT_in); - vec1 = vfmsq_f16(vec1, tmpV, vec2); - vstrhq_f16(pInT1, vec1); - pPRT_in += 8; - pInT1 += 8; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - /* - * tail - * (will be merged thru tail predication) - */ - blkCnt = (numCols - l) & 7; - if (blkCnt > 0U) - { - f16x8_t vec1, vec2; - mve_pred16_t p0 = vctp16q(blkCnt); - - vec1 = vldrhq_f16(pInT1); - vec2 = vldrhq_f16(pPRT_in); - vec1 = vfmsq_f16(vec1, tmpV, vec2); - vstrhq_p_f16(pInT1, vec1, p0); - pInT1 += blkCnt; - } - - blkCnt = numCols >> 3; - while (blkCnt > 0U) - { - f16x8_t vec1, vec2; - - /* - * Replace the element by the sum of that row - * and a multiple of the reference row - */ - vec1 = vldrhq_f16(pOutT1); - vec2 = vldrhq_f16(pPRT_pDst); - vec1 = vfmsq_f16(vec1, tmpV, vec2); - vstrhq_f16(pOutT1, vec1); - pPRT_pDst += 8; - pOutT1 += 8; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - /* - * tail - * (will be merged thru tail predication) - */ - blkCnt = numCols & 7; - if (blkCnt > 0U) - { - f16x8_t vec1, vec2; - mve_pred16_t p0 = vctp16q(blkCnt); - - vec1 = vldrhq_f16(pOutT1); - vec2 = vldrhq_f16(pPRT_pDst); - vec1 = vfmsq_f16(vec1, tmpV, vec2); - vstrhq_p_f16(pOutT1, vec1, p0); - - pInT2 += blkCnt; - pOutT1 += blkCnt; - } - } - /* - * Increment the temporary input pointer - */ - pInT1 = pInT1 + l; - } - /* - * Increment the input pointer - */ - pIn++; - /* - * Decrement the loop counter - */ - loopCnt--; - /* - * Increment the index modifier - */ - l++; - } - - /* - * Set status as ARM_MATH_SUCCESS - */ - status = ARM_MATH_SUCCESS; - - if ((flag != 1U) && (in == 0.0f16)) - { - pIn = pSrc->pData; - for (i = 0; i < numRows * numCols; i++) - { - if (pIn[i] != 0.0f16) - break; - } - - if (i == numRows * numCols) - status = ARM_MATH_SINGULAR; - } - } - /* Return to application */ - return (status); -} - -#else - arm_status arm_mat_inverse_f16( const arm_matrix_instance_f16 * pSrc, arm_matrix_instance_f16 * pDst) { float16_t *pIn = pSrc->pData; /* input data matrix pointer */ float16_t *pOut = pDst->pData; /* output data matrix pointer */ - float16_t *pInT1, *pInT2; /* Temporary input data matrix pointer */ - float16_t *pOutT1, *pOutT2; /* Temporary output data matrix pointer */ - float16_t *pPivotRowIn, *pPRT_in, *pPivotRowDst, *pPRT_pDst; /* Temporary input and output data matrix pointer */ + + float16_t *pTmp; uint32_t numRows = pSrc->numRows; /* Number of rows in the matrix */ uint32_t numCols = pSrc->numCols; /* Number of Cols in the matrix */ - _Float16 Xchg, in = 0.0f16, in1; /* Temporary input values */ - uint32_t i, rowCnt, flag = 0U, j, loopCnt, k, l; /* loop counters */ + + float16_t pivot = 0.0f16, newPivot=0.0f16; /* Temporary input values */ + uint32_t selectedRow,pivotRow,i, rowNb, rowCnt, flag = 0U, j,column; /* loop counters */ arm_status status; /* status of matrix inverse */ #ifdef ARM_MATH_MATRIX_CHECK @@ -589,7 +84,6 @@ arm_status arm_mat_inverse_f16( #endif /* #ifdef ARM_MATH_MATRIX_CHECK */ { - /*-------------------------------------------------------------------------------------------------------------- * Matrix Inverse can be solved using elementary row operations. * @@ -626,7 +120,7 @@ arm_status arm_mat_inverse_f16( *----------------------------------------------------------------------------------------------------------------*/ /* Working pointer for destination matrix */ - pOutT1 = pOut; + pTmp = pOut; /* Loop over the number of rows */ rowCnt = numRows; @@ -638,18 +132,18 @@ arm_status arm_mat_inverse_f16( j = numRows - rowCnt; while (j > 0U) { - *pOutT1++ = 0.0f16; + *pTmp++ = 0.0f16; j--; } /* Writing all ones in the diagonal of the destination matrix */ - *pOutT1++ = 1.0f16; + *pTmp++ = 1.0f16; /* Writing all zeroes in upper triangle of the destination matrix */ j = rowCnt - 1U; while (j > 0U) { - *pOutT1++ = 0.0f16; + *pTmp++ = 0.0f16; j--; } @@ -659,232 +153,105 @@ arm_status arm_mat_inverse_f16( /* Loop over the number of columns of the input matrix. All the elements in each column are processed by the row operations */ - loopCnt = numCols; /* Index modifier to navigate through the columns */ - l = 0U; - - while (loopCnt > 0U) + for(column = 0U; column < numCols; column++) { /* Check if the pivot element is zero.. * If it is zero then interchange the row with non zero row below. * If there is no non zero element to replace in the rows below, * then the matrix is Singular. */ - /* Working pointer for the input matrix that points - * to the pivot element of the particular row */ - pInT1 = pIn + (l * numCols); - - /* Working pointer for the destination matrix that points - * to the pivot element of the particular row */ - pOutT1 = pOut + (l * numCols); + pivotRow = column; /* Temporary variable to hold the pivot value */ - in = *pInT1; - - - /* Destination pointer modifier */ - k = 1U; + pTmp = ELEM(pSrc,column,column) ; + pivot = *pTmp; + selectedRow = column; - /* Check if the pivot element is zero */ - if (*pInT1 == 0.0f16) - { + /* Loop over the number rows present below */ - for (i = (l + 1U); i < numRows; i++) - { + for (rowNb = column+1; rowNb < numRows; rowNb++) + { /* Update the input and destination pointers */ - pInT2 = pInT1 + (numCols * i); - pOutT2 = pOutT1 + (numCols * k); + pTmp = ELEM(pSrc,rowNb,column); + newPivot = *pTmp; + if (fabsf((float32_t)newPivot) > fabsf((float32_t)pivot)) + { + selectedRow = rowNb; + pivot = newPivot; + } + + } /* Check if there is a non zero pivot element to * replace in the rows below */ - if (*pInT2 != 0.0f16) - { + if (((_Float16)pivot != 0.0f16) && (selectedRow != column)) + { /* Loop over number of columns * to the right of the pilot element */ - j = numCols - l; - - while (j > 0U) - { - /* Exchange the row elements of the input matrix */ - Xchg = *pInT2; - *pInT2++ = *pInT1; - *pInT1++ = Xchg; - /* Decrement the loop counter */ - j--; - } - - /* Loop over number of columns of the destination matrix */ - j = numCols; - - while (j > 0U) - { - /* Exchange the row elements of the destination matrix */ - Xchg = *pOutT2; - *pOutT2++ = *pOutT1; - *pOutT1++ = Xchg; - - /* Decrement loop counter */ - j--; - } + SWAP_ROWS_F16(pSrc,column, pivotRow,selectedRow); + SWAP_ROWS_F16(pDst,0, pivotRow,selectedRow); + /* Flag to indicate whether exchange is done or not */ flag = 1U; - /* Break after exchange is done */ - break; - } - - /* Update the destination pointer modifier */ - k++; - - /* Decrement loop counter */ - } } + /* Update the status if the matrix is singular */ - if ((flag != 1U) && (in == 0.0f16)) + if ((flag != 1U) && ((_Float16)pivot == 0.0f16)) { return ARM_MATH_SINGULAR; } - /* Points to the pivot row of input and destination matrices */ - pPivotRowIn = pIn + (l * numCols); - pPivotRowDst = pOut + (l * numCols); - - /* Temporary pointers to the pivot row pointers */ - pInT1 = pPivotRowIn; - pInT2 = pPivotRowDst; - + /* Pivot element of the row */ - in = *pPivotRowIn; + pivot = 1.0f16 / (_Float16)pivot; - /* Loop over number of columns - * to the right of the pilot element */ - j = (numCols - l); - - while (j > 0U) - { - /* Divide each element of the row of the input matrix - * by the pivot element */ - in1 = *pInT1; - *pInT1++ = in1 / in; - - /* Decrement the loop counter */ - j--; - } - - /* Loop over number of columns of the destination matrix */ - j = numCols; - - while (j > 0U) - { - /* Divide each element of the row of the destination matrix - * by the pivot element */ - in1 = *pInT2; - *pInT2++ = in1 / in; - - /* Decrement the loop counter */ - j--; - } + SCALE_ROW_F16(pSrc,column,pivot,pivotRow); + SCALE_ROW_F16(pDst,0,pivot,pivotRow); + /* Replace the rows with the sum of that row and a multiple of row i * so that each new element in column i above row i is zero.*/ - /* Temporary pointers for input and destination matrices */ - pInT1 = pIn; - pInT2 = pOut; - - /* index used to check for pivot element */ - i = 0U; - - /* Loop over number of rows */ - /* to be replaced by the sum of that row and a multiple of row i */ - k = numRows; - - while (k > 0U) + rowNb = 0; + for (;rowNb < pivotRow; rowNb++) { - /* Check for the pivot element */ - if (i == l) - { - /* If the processing element is the pivot element, - only the columns to the right are to be processed */ - pInT1 += numCols - l; - - pInT2 += numCols; - } - else - { - /* Element of the reference row */ - in = *pInT1; - - /* Working pointers for input and destination pivot rows */ - pPRT_in = pPivotRowIn; - pPRT_pDst = pPivotRowDst; - - /* Loop over the number of columns to the right of the pivot element, - to replace the elements in the input matrix */ - j = (numCols - l); - - while (j > 0U) - { - /* Replace the element by the sum of that row - and a multiple of the reference row */ - in1 = *pInT1; - *pInT1++ = in1 - (in * *pPRT_in++); - - /* Decrement the loop counter */ - j--; - } - - /* Loop over the number of columns to - replace the elements in the destination matrix */ - j = numCols; + pTmp = ELEM(pSrc,rowNb,column) ; + pivot = *pTmp; - while (j > 0U) - { - /* Replace the element by the sum of that row - and a multiple of the reference row */ - in1 = *pInT2; - *pInT2++ = in1 - (in * *pPRT_pDst++); + MAS_ROW_F16(column,pSrc,rowNb,pivot,pSrc,pivotRow); + MAS_ROW_F16(0 ,pDst,rowNb,pivot,pDst,pivotRow); - /* Decrement loop counter */ - j--; - } - } + } - /* Increment temporary input pointer */ - pInT1 = pInT1 + l; + for (rowNb = pivotRow + 1; rowNb < numRows; rowNb++) + { + pTmp = ELEM(pSrc,rowNb,column) ; + pivot = *pTmp; - /* Decrement loop counter */ - k--; + MAS_ROW_F16(column,pSrc,rowNb,pivot,pSrc,pivotRow); + MAS_ROW_F16(0 ,pDst,rowNb,pivot,pDst,pivotRow); - /* Increment pivot index */ - i++; } - /* Increment the input pointer */ - pIn++; - - /* Decrement the loop counter */ - loopCnt--; - - /* Increment the index modifier */ - l++; } /* Set status as ARM_MATH_SUCCESS */ status = ARM_MATH_SUCCESS; - if ((flag != 1U) && (in == 0.0f16)) + if ((flag != 1U) && ((_Float16)pivot == 0.0f16)) { pIn = pSrc->pData; for (i = 0; i < numRows * numCols; i++) { - if (pIn[i] != 0.0f16) + if ((_Float16)pIn[i] != 0.0f16) break; } @@ -896,8 +263,6 @@ arm_status arm_mat_inverse_f16( /* Return to application */ return (status); } -#endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ - /** @} end of MatrixInv group */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_inverse_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_inverse_f32.c index f4c753b..83e8577 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_inverse_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_inverse_f32.c @@ -5,13 +5,13 @@ * Title: arm_mat_inverse_f32.c * Description: Floating-point matrix inverse * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -29,6 +29,8 @@ */ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h" + /** @ingroup groupMatrix @@ -52,7 +54,22 @@ of elementary row-operations to an identity matrix yields the inverse matrix. If the input matrix is singular, then the algorithm terminates and returns error status ARM_MATH_SINGULAR. - \image html MatrixInverse.gif "Matrix Inverse of a 3 x 3 matrix using Gauss-Jordan Method" + + @par Matrix Inverse of a 3 x 3 matrix using Gauss-Jordan Method + + \f[ + \begin{pmatrix} + a_{1,1} & a_{1,2} & a_{1,3} & | & 1 & 0 & 0\\ + a_{2,1} & a_{2,2} & a_{2,3} & | & 0 & 1 & 0\\ + a_{3,1} & a_{3,2} & a_{3,3} & | & 0 & 0 & 1\\ + \end{pmatrix} + \rightarrow + \begin{pmatrix} + 1 & 0 & 0 & | & x_{1,1} & x_{2,1} & x_{3,1} \\ + 0 & 1 & 0 & | & x_{1,2} & x_{2,2} & x_{3,2} \\ + 0 & 0 & 1 & | & x_{1,3} & x_{2,3} & x_{3,3} \\ + \end{pmatrix} + \f] */ /** @@ -69,937 +86,20 @@ - \ref ARM_MATH_SIZE_MISMATCH : Matrix size check failed - \ref ARM_MATH_SINGULAR : Input matrix is found to be singular (non-invertible) */ -#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) - -arm_status arm_mat_inverse_f32( - const arm_matrix_instance_f32 * pSrc, - arm_matrix_instance_f32 * pDst) -{ - float32_t *pIn = pSrc->pData; /* input data matrix pointer */ - float32_t *pOut = pDst->pData; /* output data matrix pointer */ - float32_t *pInT1, *pInT2; /* Temporary input data matrix pointer */ - float32_t *pOutT1, *pOutT2; /* Temporary output data matrix pointer */ - float32_t *pPivotRowIn, *pPRT_in, *pPivotRowDst, *pPRT_pDst; /* Temporary input and output data matrix pointer */ - - uint32_t numRows = pSrc->numRows; /* Number of rows in the matrix */ - uint32_t numCols = pSrc->numCols; /* Number of Cols in the matrix */ - float32_t *pTmpA, *pTmpB; - - float32_t in = 0.0f; /* Temporary input values */ - uint32_t i, rowCnt, flag = 0U, j, loopCnt, k, l; /* loop counters */ - arm_status status; /* status of matrix inverse */ - uint32_t blkCnt; - -#ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrc->numRows != pSrc->numCols) || (pDst->numRows != pDst->numCols) - || (pSrc->numRows != pDst->numRows)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif /* #ifdef ARM_MATH_MATRIX_CHECK */ - { - - /*-------------------------------------------------------------------------------------------------------------- - * Matrix Inverse can be solved using elementary row operations. - * - * Gauss-Jordan Method: - * - * 1. First combine the identity matrix and the input matrix separated by a bar to form an - * augmented matrix as follows: - * _ _ _ _ _ _ _ _ - * | | a11 a12 | | | 1 0 | | | X11 X12 | - * | | | | | | | = | | - * |_ |_ a21 a22 _| | |_0 1 _| _| |_ X21 X21 _| - * - * 2. In our implementation, pDst Matrix is used as identity matrix. - * - * 3. Begin with the first row. Let i = 1. - * - * 4. Check to see if the pivot for row i is zero. - * The pivot is the element of the main diagonal that is on the current row. - * For instance, if working with row i, then the pivot element is aii. - * If the pivot is zero, exchange that row with a row below it that does not - * contain a zero in column i. If this is not possible, then an inverse - * to that matrix does not exist. - * - * 5. Divide every element of row i by the pivot. - * - * 6. For every row below and row i, replace that row with the sum of that row and - * a multiple of row i so that each new element in column i below row i is zero. - * - * 7. Move to the next row and column and repeat steps 2 through 5 until you have zeros - * for every element below and above the main diagonal. - * - * 8. Now an identical matrix is formed to the left of the bar(input matrix, src). - * Therefore, the matrix to the right of the bar is our solution(dst matrix, dst). - *----------------------------------------------------------------------------------------------------------------*/ - - /* - * Working pointer for destination matrix - */ - pOutT1 = pOut; - /* - * Loop over the number of rows - */ - rowCnt = numRows; - /* - * Making the destination matrix as identity matrix - */ - while (rowCnt > 0U) - { - /* - * Writing all zeroes in lower triangle of the destination matrix - */ - j = numRows - rowCnt; - while (j > 0U) - { - *pOutT1++ = 0.0f; - j--; - } - /* - * Writing all ones in the diagonal of the destination matrix - */ - *pOutT1++ = 1.0f; - /* - * Writing all zeroes in upper triangle of the destination matrix - */ - j = rowCnt - 1U; - while (j > 0U) - { - *pOutT1++ = 0.0f; - j--; - } - /* - * Decrement the loop counter - */ - rowCnt--; - } - - /* - * Loop over the number of columns of the input matrix. - * All the elements in each column are processed by the row operations - */ - loopCnt = numCols; - /* - * Index modifier to navigate through the columns - */ - l = 0U; - while (loopCnt > 0U) - { - /* - * Check if the pivot element is zero.. - * If it is zero then interchange the row with non zero row below. - * If there is no non zero element to replace in the rows below, - * then the matrix is Singular. - */ - - /* - * Working pointer for the input matrix that points - * * to the pivot element of the particular row - */ - pInT1 = pIn + (l * numCols); - /* - * Working pointer for the destination matrix that points - * * to the pivot element of the particular row - */ - pOutT1 = pOut + (l * numCols); - /* - * Temporary variable to hold the pivot value - */ - in = *pInT1; - /* - * Destination pointer modifier - */ - k = 1U; - - /* - * Check if the pivot element is zero - */ - if (*pInT1 == 0.0f) - { - /* - * Loop over the number rows present below - */ - for (i = (l + 1U); i < numRows; i++) - { - /* - * Update the input and destination pointers - */ - pInT2 = pInT1 + (numCols * i); - pOutT2 = pOutT1 + (numCols * k); - /* - * Check if there is a non zero pivot element to - * * replace in the rows below - */ - if (*pInT2 != 0.0f) - { - f32x4_t vecA, vecB; - /* - * Loop over number of columns - * * to the right of the pilot element - */ - pTmpA = pInT1; - pTmpB = pInT2; - blkCnt = (numCols - l) >> 2; - while (blkCnt > 0U) - { - - vecA = vldrwq_f32(pTmpA); - vecB = vldrwq_f32(pTmpB); - vstrwq_f32(pTmpB, vecA); - vstrwq_f32(pTmpA, vecB); - - pTmpA += 4; - pTmpB += 4; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - /* - * tail - * (will be merged thru tail predication) - */ - blkCnt = (numCols - l) & 3; - if (blkCnt > 0U) - { - mve_pred16_t p0 = vctp32q(blkCnt); - - vecA = vldrwq_f32(pTmpA); - vecB = vldrwq_f32(pTmpB); - vstrwq_p_f32(pTmpB, vecA, p0); - vstrwq_p_f32(pTmpA, vecB, p0); - } - - pInT1 += numCols - l; - pInT2 += numCols - l; - pTmpA = pOutT1; - pTmpB = pOutT2; - blkCnt = numCols >> 2; - while (blkCnt > 0U) - { - - vecA = vldrwq_f32(pTmpA); - vecB = vldrwq_f32(pTmpB); - vstrwq_f32(pTmpB, vecA); - vstrwq_f32(pTmpA, vecB); - pTmpA += 4; - pTmpB += 4; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - /* - * tail - */ - blkCnt = numCols & 3; - if (blkCnt > 0U) - { - mve_pred16_t p0 = vctp32q(blkCnt); - - vecA = vldrwq_f32(pTmpA); - vecB = vldrwq_f32(pTmpB); - vstrwq_p_f32(pTmpB, vecA, p0); - vstrwq_p_f32(pTmpA, vecB, p0); - } - - pOutT1 += numCols; - pOutT2 += numCols; - /* - * Flag to indicate whether exchange is done or not - */ - flag = 1U; - - /* - * Break after exchange is done - */ - break; - } - /* - * Update the destination pointer modifier - */ - k++; - } - } - - /* - * Update the status if the matrix is singular - */ - if ((flag != 1U) && (in == 0.0f)) - { - return ARM_MATH_SINGULAR; - } - - /* - * Points to the pivot row of input and destination matrices - */ - pPivotRowIn = pIn + (l * numCols); - pPivotRowDst = pOut + (l * numCols); - - /* - * Temporary pointers to the pivot row pointers - */ - pInT1 = pPivotRowIn; - pOutT1 = pPivotRowDst; - - /* - * Pivot element of the row - */ - in = *(pIn + (l * numCols)); - - pTmpA = pInT1; - - f32x4_t invIn = vdupq_n_f32(1.0f / in); - - blkCnt = (numCols - l) >> 2; - f32x4_t vecA; - while (blkCnt > 0U) - { - *(f32x4_t *) pTmpA = *(f32x4_t *) pTmpA * invIn; - pTmpA += 4; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - /* - * tail - */ - blkCnt = (numCols - l) & 3; - if (blkCnt > 0U) - { - mve_pred16_t p0 = vctp32q(blkCnt); - - - vecA = vldrwq_f32(pTmpA); - vecA = vecA * invIn; - vstrwq_p_f32(pTmpA, vecA, p0); - } - - pInT1 += numCols - l; - /* - * Loop over number of columns - * * to the right of the pilot element - */ - - pTmpA = pOutT1; - blkCnt = numCols >> 2; - while (blkCnt > 0U) - { - *(f32x4_t *) pTmpA = *(f32x4_t *) pTmpA *invIn; - pTmpA += 4; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - /* - * tail - * (will be merged thru tail predication) - */ - blkCnt = numCols & 3; - if (blkCnt > 0U) - { - mve_pred16_t p0 = vctp32q(blkCnt); - - vecA = vldrwq_f32(pTmpA); - vecA = vecA * invIn; - vstrwq_p_f32(pTmpA, vecA, p0); - } - - pOutT1 += numCols; - - /* - * Replace the rows with the sum of that row and a multiple of row i - * * so that each new element in column i above row i is zero. - */ - - /* - * Temporary pointers for input and destination matrices - */ - pInT1 = pIn; - pOutT1 = pOut; - - for (i = 0U; i < numRows; i++) - { - /* - * Check for the pivot element - */ - if (i == l) - { - /* - * If the processing element is the pivot element, - * only the columns to the right are to be processed - */ - pInT1 += numCols - l; - pOutT1 += numCols; - } - else - { - /* - * Element of the reference row - */ - - /* - * Working pointers for input and destination pivot rows - */ - pPRT_in = pPivotRowIn; - pPRT_pDst = pPivotRowDst; - /* - * Loop over the number of columns to the right of the pivot element, - * to replace the elements in the input matrix - */ - - in = *pInT1; - f32x4_t tmpV = vdupq_n_f32(in); - - blkCnt = (numCols - l) >> 2; - while (blkCnt > 0U) - { - f32x4_t vec1, vec2; - /* - * Replace the element by the sum of that row - * and a multiple of the reference row - */ - vec1 = vldrwq_f32(pInT1); - vec2 = vldrwq_f32(pPRT_in); - vec1 = vfmsq_f32(vec1, tmpV, vec2); - vstrwq_f32(pInT1, vec1); - pPRT_in += 4; - pInT1 += 4; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - /* - * tail - * (will be merged thru tail predication) - */ - blkCnt = (numCols - l) & 3; - if (blkCnt > 0U) - { - f32x4_t vec1, vec2; - mve_pred16_t p0 = vctp32q(blkCnt); - - vec1 = vldrwq_f32(pInT1); - vec2 = vldrwq_f32(pPRT_in); - vec1 = vfmsq_f32(vec1, tmpV, vec2); - vstrwq_p_f32(pInT1, vec1, p0); - pInT1 += blkCnt; - } - - blkCnt = numCols >> 2; - while (blkCnt > 0U) - { - f32x4_t vec1, vec2; - - /* - * Replace the element by the sum of that row - * and a multiple of the reference row - */ - vec1 = vldrwq_f32(pOutT1); - vec2 = vldrwq_f32(pPRT_pDst); - vec1 = vfmsq_f32(vec1, tmpV, vec2); - vstrwq_f32(pOutT1, vec1); - pPRT_pDst += 4; - pOutT1 += 4; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - /* - * tail - * (will be merged thru tail predication) - */ - blkCnt = numCols & 3; - if (blkCnt > 0U) - { - f32x4_t vec1, vec2; - mve_pred16_t p0 = vctp32q(blkCnt); - - vec1 = vldrwq_f32(pOutT1); - vec2 = vldrwq_f32(pPRT_pDst); - vec1 = vfmsq_f32(vec1, tmpV, vec2); - vstrwq_p_f32(pOutT1, vec1, p0); - - pInT2 += blkCnt; - pOutT1 += blkCnt; - } - } - /* - * Increment the temporary input pointer - */ - pInT1 = pInT1 + l; - } - /* - * Increment the input pointer - */ - pIn++; - /* - * Decrement the loop counter - */ - loopCnt--; - /* - * Increment the index modifier - */ - l++; - } - - /* - * Set status as ARM_MATH_SUCCESS - */ - status = ARM_MATH_SUCCESS; - - if ((flag != 1U) && (in == 0.0f)) - { - pIn = pSrc->pData; - for (i = 0; i < numRows * numCols; i++) - { - if (pIn[i] != 0.0f) - break; - } - - if (i == numRows * numCols) - status = ARM_MATH_SINGULAR; - } - } - /* Return to application */ - return (status); -} - -#else -#if defined(ARM_MATH_NEON) -arm_status arm_mat_inverse_f32( - const arm_matrix_instance_f32 * pSrc, - arm_matrix_instance_f32 * pDst) -{ - float32_t *pIn = pSrc->pData; /* input data matrix pointer */ - float32_t *pOut = pDst->pData; /* output data matrix pointer */ - float32_t *pInT1, *pInT2; /* Temporary input data matrix pointer */ - float32_t *pOutT1, *pOutT2; /* Temporary output data matrix pointer */ - float32_t *pPivotRowIn, *pPRT_in, *pPivotRowDst, *pPRT_pDst; /* Temporary input and output data matrix pointer */ - uint32_t numRows = pSrc->numRows; /* Number of rows in the matrix */ - uint32_t numCols = pSrc->numCols; /* Number of Cols in the matrix */ - - - float32_t Xchg, in = 0.0f, in1; /* Temporary input values */ - uint32_t i, rowCnt, flag = 0U, j, loopCnt, k, l; /* loop counters */ - arm_status status; /* status of matrix inverse */ - float32x4_t vec1; - float32x4_t vec2; - float32x4_t tmpV; - -#ifdef ARM_MATH_MATRIX_CHECK - - /* Check for matrix mismatch condition */ - if ((pSrc->numRows != pSrc->numCols) || (pDst->numRows != pDst->numCols) - || (pSrc->numRows != pDst->numRows)) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif /* #ifdef ARM_MATH_MATRIX_CHECK */ - - { - /*-------------------------------------------------------------------------------------------------------------- - * Matrix Inverse can be solved using elementary row operations. - * - * Gauss-Jordan Method: - * - * 1. First combine the identity matrix and the input matrix separated by a bar to form an - * augmented matrix as follows: - * _ _ _ _ - * | a11 a12 | 1 0 | | X11 X12 | - * | | | = | | - * |_ a21 a22 | 0 1 _| |_ X21 X21 _| - * - * 2. In our implementation, pDst Matrix is used as identity matrix. - * - * 3. Begin with the first row. Let i = 1. - * - * 4. Check to see if the pivot for row i is zero. - * The pivot is the element of the main diagonal that is on the current row. - * For instance, if working with row i, then the pivot element is aii. - * If the pivot is zero, exchange that row with a row below it that does not - * contain a zero in column i. If this is not possible, then an inverse - * to that matrix does not exist. - * - * 5. Divide every element of row i by the pivot. - * - * 6. For every row below and row i, replace that row with the sum of that row and - * a multiple of row i so that each new element in column i below row i is zero. - * - * 7. Move to the next row and column and repeat steps 2 through 5 until you have zeros - * for every element below and above the main diagonal. - * - * 8. Now an identical matrix is formed to the left of the bar(input matrix, pSrc). - * Therefore, the matrix to the right of the bar is our solution(pDst matrix, pDst). - *----------------------------------------------------------------------------------------------------------------*/ - - /* Working pointer for destination matrix */ - pOutT1 = pOut; - - /* Loop over the number of rows */ - rowCnt = numRows; - - /* Making the destination matrix as identity matrix */ - while (rowCnt > 0U) - { - /* Writing all zeroes in lower triangle of the destination matrix */ - j = numRows - rowCnt; - while (j > 0U) - { - *pOutT1++ = 0.0f; - j--; - } - - /* Writing all ones in the diagonal of the destination matrix */ - *pOutT1++ = 1.0f; - - /* Writing all zeroes in upper triangle of the destination matrix */ - j = rowCnt - 1U; - - while (j > 0U) - { - *pOutT1++ = 0.0f; - j--; - } - - /* Decrement the loop counter */ - rowCnt--; - } - - /* Loop over the number of columns of the input matrix. - All the elements in each column are processed by the row operations */ - loopCnt = numCols; - - /* Index modifier to navigate through the columns */ - l = 0U; - - while (loopCnt > 0U) - { - /* Check if the pivot element is zero.. - * If it is zero then interchange the row with non zero row below. - * If there is no non zero element to replace in the rows below, - * then the matrix is Singular. */ - - /* Working pointer for the input matrix that points - * to the pivot element of the particular row */ - pInT1 = pIn + (l * numCols); - - /* Working pointer for the destination matrix that points - * to the pivot element of the particular row */ - pOutT1 = pOut + (l * numCols); - - /* Temporary variable to hold the pivot value */ - in = *pInT1; - - - /* Destination pointer modifier */ - k = 1U; - - /* Check if the pivot element is zero */ - if (*pInT1 == 0.0f) - { - /* Loop over the number rows present below */ - for (i = (l + 1U); i < numRows; i++) - { - /* Update the input and destination pointers */ - pInT2 = pInT1 + (numCols * i); - pOutT2 = pOutT1 + (numCols * k); - - /* Check if there is a non zero pivot element to - * replace in the rows below */ - if (*pInT2 != 0.0f) - { - /* Loop over number of columns - * to the right of the pilot element */ - j = numCols - l; - - while (j > 0U) - { - /* Exchange the row elements of the input matrix */ - Xchg = *pInT2; - *pInT2++ = *pInT1; - *pInT1++ = Xchg; - - /* Decrement the loop counter */ - j--; - } - - /* Loop over number of columns of the destination matrix */ - j = numCols; - - while (j > 0U) - { - /* Exchange the row elements of the destination matrix */ - Xchg = *pOutT2; - *pOutT2++ = *pOutT1; - *pOutT1++ = Xchg; - - /* Decrement the loop counter */ - j--; - } - - /* Flag to indicate whether exchange is done or not */ - flag = 1U; - - /* Break after exchange is done */ - break; - } - - /* Update the destination pointer modifier */ - k++; - } - } - - /* Update the status if the matrix is singular */ - if ((flag != 1U) && (in == 0.0f)) - { - return ARM_MATH_SINGULAR; - } - - /* Points to the pivot row of input and destination matrices */ - pPivotRowIn = pIn + (l * numCols); - pPivotRowDst = pOut + (l * numCols); - - /* Temporary pointers to the pivot row pointers */ - pInT1 = pPivotRowIn; - pInT2 = pPivotRowDst; - - /* Pivot element of the row */ - in = *pPivotRowIn; - tmpV = vdupq_n_f32(1.0f/in); - - /* Loop over number of columns - * to the right of the pilot element */ - j = (numCols - l) >> 2; - - while (j > 0U) - { - /* Divide each element of the row of the input matrix - * by the pivot element */ - vec1 = vld1q_f32(pInT1); - - vec1 = vmulq_f32(vec1, tmpV); - vst1q_f32(pInT1, vec1); - pInT1 += 4; - - /* Decrement the loop counter */ - j--; - } - - /* Tail */ - j = (numCols - l) & 3; - - while (j > 0U) - { - /* Divide each element of the row of the input matrix - * by the pivot element */ - in1 = *pInT1; - *pInT1++ = in1 / in; - - /* Decrement the loop counter */ - j--; - } - - /* Loop over number of columns of the destination matrix */ - j = numCols >> 2; - - while (j > 0U) - { - /* Divide each element of the row of the destination matrix - * by the pivot element */ - vec1 = vld1q_f32(pInT2); - - vec1 = vmulq_f32(vec1, tmpV); - vst1q_f32(pInT2, vec1); - pInT2 += 4; - - /* Decrement the loop counter */ - j--; - } - - /* Tail */ - j = numCols & 3; - - while (j > 0U) - { - /* Divide each element of the row of the destination matrix - * by the pivot element */ - in1 = *pInT2; - *pInT2++ = in1 / in; - - /* Decrement the loop counter */ - j--; - } - - /* Replace the rows with the sum of that row and a multiple of row i - * so that each new element in column i above row i is zero.*/ - - /* Temporary pointers for input and destination matrices */ - pInT1 = pIn; - pInT2 = pOut; - - /* index used to check for pivot element */ - i = 0U; - - /* Loop over number of rows */ - /* to be replaced by the sum of that row and a multiple of row i */ - k = numRows; - - while (k > 0U) - { - /* Check for the pivot element */ - if (i == l) - { - /* If the processing element is the pivot element, - only the columns to the right are to be processed */ - pInT1 += numCols - l; - - pInT2 += numCols; - } - else - { - /* Element of the reference row */ - in = *pInT1; - tmpV = vdupq_n_f32(in); - - /* Working pointers for input and destination pivot rows */ - pPRT_in = pPivotRowIn; - pPRT_pDst = pPivotRowDst; - - /* Loop over the number of columns to the right of the pivot element, - to replace the elements in the input matrix */ - j = (numCols - l) >> 2; - - while (j > 0U) - { - /* Replace the element by the sum of that row - and a multiple of the reference row */ - vec1 = vld1q_f32(pInT1); - vec2 = vld1q_f32(pPRT_in); - vec1 = vmlsq_f32(vec1, tmpV, vec2); - vst1q_f32(pInT1, vec1); - pPRT_in += 4; - pInT1 += 4; - - /* Decrement the loop counter */ - j--; - } - - /* Tail */ - j = (numCols - l) & 3; - - while (j > 0U) - { - /* Replace the element by the sum of that row - and a multiple of the reference row */ - in1 = *pInT1; - *pInT1++ = in1 - (in * *pPRT_in++); - - /* Decrement the loop counter */ - j--; - } - - /* Loop over the number of columns to - replace the elements in the destination matrix */ - j = numCols >> 2; - - while (j > 0U) - { - /* Replace the element by the sum of that row - and a multiple of the reference row */ - vec1 = vld1q_f32(pInT2); - vec2 = vld1q_f32(pPRT_pDst); - vec1 = vmlsq_f32(vec1, tmpV, vec2); - vst1q_f32(pInT2, vec1); - pPRT_pDst += 4; - pInT2 += 4; - - /* Decrement the loop counter */ - j--; - } - - /* Tail */ - j = numCols & 3; - - while (j > 0U) - { - /* Replace the element by the sum of that row - and a multiple of the reference row */ - in1 = *pInT2; - *pInT2++ = in1 - (in * *pPRT_pDst++); - - /* Decrement the loop counter */ - j--; - } - - } - - /* Increment the temporary input pointer */ - pInT1 = pInT1 + l; - - /* Decrement the loop counter */ - k--; - - /* Increment the pivot index */ - i++; - } - - /* Increment the input pointer */ - pIn++; - - /* Decrement the loop counter */ - loopCnt--; - - /* Increment the index modifier */ - l++; - } - - /* Set status as ARM_MATH_SUCCESS */ - status = ARM_MATH_SUCCESS; - - if ((flag != 1U) && (in == 0.0f)) - { - pIn = pSrc->pData; - for (i = 0; i < numRows * numCols; i++) - { - if (pIn[i] != 0.0f) - break; - } - - if (i == numRows * numCols) - status = ARM_MATH_SINGULAR; - } - } - /* Return to application */ - return (status); -} -#else arm_status arm_mat_inverse_f32( const arm_matrix_instance_f32 * pSrc, arm_matrix_instance_f32 * pDst) { float32_t *pIn = pSrc->pData; /* input data matrix pointer */ float32_t *pOut = pDst->pData; /* output data matrix pointer */ - float32_t *pInT1, *pInT2; /* Temporary input data matrix pointer */ - float32_t *pOutT1, *pOutT2; /* Temporary output data matrix pointer */ - float32_t *pPivotRowIn, *pPRT_in, *pPivotRowDst, *pPRT_pDst; /* Temporary input and output data matrix pointer */ + + float32_t *pTmp; uint32_t numRows = pSrc->numRows; /* Number of rows in the matrix */ uint32_t numCols = pSrc->numCols; /* Number of Cols in the matrix */ -#if defined (ARM_MATH_DSP) - float32_t Xchg, in = 0.0f, in1; /* Temporary input values */ - uint32_t i, rowCnt, flag = 0U, j, loopCnt, k, l; /* loop counters */ + float32_t pivot = 0.0f, newPivot=0.0f; /* Temporary input values */ + uint32_t selectedRow,pivotRow,i, rowNb, rowCnt, flag = 0U, j,column; /* loop counters */ arm_status status; /* status of matrix inverse */ #ifdef ARM_MATH_MATRIX_CHECK @@ -1017,7 +117,6 @@ arm_status arm_mat_inverse_f32( #endif /* #ifdef ARM_MATH_MATRIX_CHECK */ { - /*-------------------------------------------------------------------------------------------------------------- * Matrix Inverse can be solved using elementary row operations. * @@ -1054,7 +153,7 @@ arm_status arm_mat_inverse_f32( *----------------------------------------------------------------------------------------------------------------*/ /* Working pointer for destination matrix */ - pOutT1 = pOut; + pTmp = pOut; /* Loop over the number of rows */ rowCnt = numRows; @@ -1066,18 +165,18 @@ arm_status arm_mat_inverse_f32( j = numRows - rowCnt; while (j > 0U) { - *pOutT1++ = 0.0f; + *pTmp++ = 0.0f; j--; } /* Writing all ones in the diagonal of the destination matrix */ - *pOutT1++ = 1.0f; + *pTmp++ = 1.0f; /* Writing all zeroes in upper triangle of the destination matrix */ j = rowCnt - 1U; while (j > 0U) { - *pOutT1++ = 0.0f; + *pTmp++ = 0.0f; j--; } @@ -1087,486 +186,100 @@ arm_status arm_mat_inverse_f32( /* Loop over the number of columns of the input matrix. All the elements in each column are processed by the row operations */ - loopCnt = numCols; /* Index modifier to navigate through the columns */ - l = 0U; - - while (loopCnt > 0U) + for(column = 0U; column < numCols; column++) { /* Check if the pivot element is zero.. * If it is zero then interchange the row with non zero row below. * If there is no non zero element to replace in the rows below, * then the matrix is Singular. */ - /* Working pointer for the input matrix that points - * to the pivot element of the particular row */ - pInT1 = pIn + (l * numCols); - - /* Working pointer for the destination matrix that points - * to the pivot element of the particular row */ - pOutT1 = pOut + (l * numCols); + pivotRow = column; /* Temporary variable to hold the pivot value */ - in = *pInT1; + pTmp = ELEM(pSrc,column,column) ; + pivot = *pTmp; + selectedRow = column; + /* Find maximum pivot in column */ - /* Destination pointer modifier */ - k = 1U; - - /* Check if the pivot element is zero */ - if (*pInT1 == 0.0f) - { /* Loop over the number rows present below */ - for (i = (l + 1U); i < numRows; i++) - { - /* Update the input and destination pointers */ - pInT2 = pInT1 + (numCols * i); - pOutT2 = pOutT1 + (numCols * k); - - /* Check if there is a non zero pivot element to - * replace in the rows below */ - if (*pInT2 != 0.0f) - { - /* Loop over number of columns - * to the right of the pilot element */ - j = numCols - l; - - while (j > 0U) - { - /* Exchange the row elements of the input matrix */ - Xchg = *pInT2; - *pInT2++ = *pInT1; - *pInT1++ = Xchg; - - /* Decrement the loop counter */ - j--; - } - - /* Loop over number of columns of the destination matrix */ - j = numCols; - - while (j > 0U) - { - /* Exchange the row elements of the destination matrix */ - Xchg = *pOutT2; - *pOutT2++ = *pOutT1; - *pOutT1++ = Xchg; - - /* Decrement loop counter */ - j--; - } - - /* Flag to indicate whether exchange is done or not */ - flag = 1U; - - /* Break after exchange is done */ - break; - } - - /* Update the destination pointer modifier */ - k++; - - /* Decrement loop counter */ - } - } - - /* Update the status if the matrix is singular */ - if ((flag != 1U) && (in == 0.0f)) - { - return ARM_MATH_SINGULAR; - } - - /* Points to the pivot row of input and destination matrices */ - pPivotRowIn = pIn + (l * numCols); - pPivotRowDst = pOut + (l * numCols); - - /* Temporary pointers to the pivot row pointers */ - pInT1 = pPivotRowIn; - pInT2 = pPivotRowDst; - - /* Pivot element of the row */ - in = *pPivotRowIn; - - /* Loop over number of columns - * to the right of the pilot element */ - j = (numCols - l); - - while (j > 0U) - { - /* Divide each element of the row of the input matrix - * by the pivot element */ - in1 = *pInT1; - *pInT1++ = in1 / in; - - /* Decrement the loop counter */ - j--; - } - - /* Loop over number of columns of the destination matrix */ - j = numCols; - - while (j > 0U) - { - /* Divide each element of the row of the destination matrix - * by the pivot element */ - in1 = *pInT2; - *pInT2++ = in1 / in; - - /* Decrement the loop counter */ - j--; - } - - /* Replace the rows with the sum of that row and a multiple of row i - * so that each new element in column i above row i is zero.*/ - - /* Temporary pointers for input and destination matrices */ - pInT1 = pIn; - pInT2 = pOut; - - /* index used to check for pivot element */ - i = 0U; - - /* Loop over number of rows */ - /* to be replaced by the sum of that row and a multiple of row i */ - k = numRows; - - while (k > 0U) + for (rowNb = column+1; rowNb < numRows; rowNb++) { - /* Check for the pivot element */ - if (i == l) - { - /* If the processing element is the pivot element, - only the columns to the right are to be processed */ - pInT1 += numCols - l; - - pInT2 += numCols; - } - else - { - /* Element of the reference row */ - in = *pInT1; - - /* Working pointers for input and destination pivot rows */ - pPRT_in = pPivotRowIn; - pPRT_pDst = pPivotRowDst; - - /* Loop over the number of columns to the right of the pivot element, - to replace the elements in the input matrix */ - j = (numCols - l); - - while (j > 0U) - { - /* Replace the element by the sum of that row - and a multiple of the reference row */ - in1 = *pInT1; - *pInT1++ = in1 - (in * *pPRT_in++); - - /* Decrement the loop counter */ - j--; - } - - /* Loop over the number of columns to - replace the elements in the destination matrix */ - j = numCols; - - while (j > 0U) + /* Update the input and destination pointers */ + pTmp = ELEM(pSrc,rowNb,column); + newPivot = *pTmp; + if (fabsf(newPivot) > fabsf(pivot)) { - /* Replace the element by the sum of that row - and a multiple of the reference row */ - in1 = *pInT2; - *pInT2++ = in1 - (in * *pPRT_pDst++); - - /* Decrement loop counter */ - j--; + selectedRow = rowNb; + pivot = newPivot; } - - } - - /* Increment temporary input pointer */ - pInT1 = pInT1 + l; - - /* Decrement loop counter */ - k--; - - /* Increment pivot index */ - i++; - } - - /* Increment the input pointer */ - pIn++; - - /* Decrement the loop counter */ - loopCnt--; - - /* Increment the index modifier */ - l++; - } - - -#else - - float32_t Xchg, in = 0.0f; /* Temporary input values */ - uint32_t i, rowCnt, flag = 0U, j, loopCnt, k, l; /* loop counters */ - arm_status status; /* status of matrix inverse */ - -#ifdef ARM_MATH_MATRIX_CHECK - - /* Check for matrix mismatch condition */ - if ((pSrc->numRows != pSrc->numCols) || - (pDst->numRows != pDst->numCols) || - (pSrc->numRows != pDst->numRows) ) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else - -#endif /* #ifdef ARM_MATH_MATRIX_CHECK */ - - { - - /*-------------------------------------------------------------------------------------------------------------- - * Matrix Inverse can be solved using elementary row operations. - * - * Gauss-Jordan Method: - * - * 1. First combine the identity matrix and the input matrix separated by a bar to form an - * augmented matrix as follows: - * _ _ _ _ _ _ _ _ - * | | a11 a12 | | | 1 0 | | | X11 X12 | - * | | | | | | | = | | - * |_ |_ a21 a22 _| | |_0 1 _| _| |_ X21 X21 _| - * - * 2. In our implementation, pDst Matrix is used as identity matrix. - * - * 3. Begin with the first row. Let i = 1. - * - * 4. Check to see if the pivot for row i is zero. - * The pivot is the element of the main diagonal that is on the current row. - * For instance, if working with row i, then the pivot element is aii. - * If the pivot is zero, exchange that row with a row below it that does not - * contain a zero in column i. If this is not possible, then an inverse - * to that matrix does not exist. - * - * 5. Divide every element of row i by the pivot. - * - * 6. For every row below and row i, replace that row with the sum of that row and - * a multiple of row i so that each new element in column i below row i is zero. - * - * 7. Move to the next row and column and repeat steps 2 through 5 until you have zeros - * for every element below and above the main diagonal. - * - * 8. Now an identical matrix is formed to the left of the bar(input matrix, src). - * Therefore, the matrix to the right of the bar is our solution(dst matrix, dst). - *----------------------------------------------------------------------------------------------------------------*/ - - /* Working pointer for destination matrix */ - pOutT1 = pOut; - - /* Loop over the number of rows */ - rowCnt = numRows; - - /* Making the destination matrix as identity matrix */ - while (rowCnt > 0U) - { - /* Writing all zeroes in lower triangle of the destination matrix */ - j = numRows - rowCnt; - while (j > 0U) - { - *pOutT1++ = 0.0f; - j--; } - - /* Writing all ones in the diagonal of the destination matrix */ - *pOutT1++ = 1.0f; - - /* Writing all zeroes in upper triangle of the destination matrix */ - j = rowCnt - 1U; - while (j > 0U) + + /* Check if there is a non zero pivot element to + * replace in the rows below */ + if ((pivot != 0.0f) && (selectedRow != column)) { - *pOutT1++ = 0.0f; - j--; - } - - /* Decrement loop counter */ - rowCnt--; - } - - /* Loop over the number of columns of the input matrix. - All the elements in each column are processed by the row operations */ - loopCnt = numCols; - - /* Index modifier to navigate through the columns */ - l = 0U; - - while (loopCnt > 0U) - { - /* Check if the pivot element is zero.. - * If it is zero then interchange the row with non zero row below. - * If there is no non zero element to replace in the rows below, - * then the matrix is Singular. */ - - /* Working pointer for the input matrix that points - * to the pivot element of the particular row */ - pInT1 = pIn + (l * numCols); - - /* Working pointer for the destination matrix that points - * to the pivot element of the particular row */ - pOutT1 = pOut + (l * numCols); - - /* Temporary variable to hold the pivot value */ - in = *pInT1; - - /* Destination pointer modifier */ - k = 1U; - - /* Check if the pivot element is zero */ - if (*pInT1 == 0.0f) - { - /* Loop over the number rows present below */ - for (i = (l + 1U); i < numRows; i++) - { - /* Update the input and destination pointers */ - pInT2 = pInT1 + (numCols * i); - pOutT2 = pOutT1 + (numCols * k); - - /* Check if there is a non zero pivot element to - * replace in the rows below */ - if (*pInT2 != 0.0f) - { - /* Loop over number of columns - * to the right of the pilot element */ - for (j = 0U; j < (numCols - l); j++) - { - /* Exchange the row elements of the input matrix */ - Xchg = *pInT2; - *pInT2++ = *pInT1; - *pInT1++ = Xchg; - } - - for (j = 0U; j < numCols; j++) - { - Xchg = *pOutT2; - *pOutT2++ = *pOutT1; - *pOutT1++ = Xchg; - } + + SWAP_ROWS_F32(pSrc,column, pivotRow,selectedRow); + SWAP_ROWS_F32(pDst,0, pivotRow,selectedRow); + /* Flag to indicate whether exchange is done or not */ flag = 1U; + } - /* Break after exchange is done */ - break; - } - /* Update the destination pointer modifier */ - k++; - } - } + + /* Update the status if the matrix is singular */ - if ((flag != 1U) && (in == 0.0f)) + if ((flag != 1U) && (pivot == 0.0f)) { return ARM_MATH_SINGULAR; } - /* Points to the pivot row of input and destination matrices */ - pPivotRowIn = pIn + (l * numCols); - pPivotRowDst = pOut + (l * numCols); - - /* Temporary pointers to the pivot row pointers */ - pInT1 = pPivotRowIn; - pOutT1 = pPivotRowDst; - + /* Pivot element of the row */ - in = *(pIn + (l * numCols)); + pivot = 1.0f / pivot; - /* Loop over number of columns - * to the right of the pilot element */ - for (j = 0U; j < (numCols - l); j++) - { - /* Divide each element of the row of the input matrix - * by the pivot element */ - *pInT1 = *pInT1 / in; - pInT1++; - } - for (j = 0U; j < numCols; j++) - { - /* Divide each element of the row of the destination matrix - * by the pivot element */ - *pOutT1 = *pOutT1 / in; - pOutT1++; - } + SCALE_ROW_F32(pSrc,column,pivot,pivotRow); + SCALE_ROW_F32(pDst,0,pivot,pivotRow); + /* Replace the rows with the sum of that row and a multiple of row i * so that each new element in column i above row i is zero.*/ - /* Temporary pointers for input and destination matrices */ - pInT1 = pIn; - pOutT1 = pOut; - - for (i = 0U; i < numRows; i++) + rowNb = 0; + for (;rowNb < pivotRow; rowNb++) { - /* Check for the pivot element */ - if (i == l) - { - /* If the processing element is the pivot element, - only the columns to the right are to be processed */ - pInT1 += numCols - l; - pOutT1 += numCols; - } - else - { - /* Element of the reference row */ - in = *pInT1; - - /* Working pointers for input and destination pivot rows */ - pPRT_in = pPivotRowIn; - pPRT_pDst = pPivotRowDst; - - /* Loop over the number of columns to the right of the pivot element, - to replace the elements in the input matrix */ - for (j = 0U; j < (numCols - l); j++) - { - /* Replace the element by the sum of that row - and a multiple of the reference row */ - *pInT1 = *pInT1 - (in * *pPRT_in++); - pInT1++; - } + pTmp = ELEM(pSrc,rowNb,column) ; + pivot = *pTmp; - /* Loop over the number of columns to - replace the elements in the destination matrix */ - for (j = 0U; j < numCols; j++) - { - /* Replace the element by the sum of that row - and a multiple of the reference row */ - *pOutT1 = *pOutT1 - (in * *pPRT_pDst++); - pOutT1++; - } + MAS_ROW_F32(column,pSrc,rowNb,pivot,pSrc,pivotRow); + MAS_ROW_F32(0 ,pDst,rowNb,pivot,pDst,pivotRow); - } - /* Increment temporary input pointer */ - pInT1 = pInT1 + l; } - /* Increment the input pointer */ - pIn++; + for (rowNb = pivotRow + 1; rowNb < numRows; rowNb++) + { + pTmp = ELEM(pSrc,rowNb,column) ; + pivot = *pTmp; - /* Decrement the loop counter */ - loopCnt--; + MAS_ROW_F32(column,pSrc,rowNb,pivot,pSrc,pivotRow); + MAS_ROW_F32(0 ,pDst,rowNb,pivot,pDst,pivotRow); - /* Increment the index modifier */ - l++; - } + } -#endif /* #if defined (ARM_MATH_DSP) */ + } /* Set status as ARM_MATH_SUCCESS */ status = ARM_MATH_SUCCESS; - if ((flag != 1U) && (in == 0.0f)) + if ((flag != 1U) && (pivot == 0.0f)) { pIn = pSrc->pData; for (i = 0; i < numRows * numCols; i++) @@ -1583,9 +296,6 @@ arm_status arm_mat_inverse_f32( /* Return to application */ return (status); } -#endif /* #if defined(ARM_MATH_NEON) */ -#endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ - /** @} end of MatrixInv group */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_inverse_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_inverse_f64.c index 73bbbee..9b13e3b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_inverse_f64.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_inverse_f64.c @@ -5,13 +5,13 @@ * Title: arm_mat_inverse_f64.c * Description: Floating-point matrix inverse * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -29,6 +29,7 @@ */ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h" /** @ingroup groupMatrix @@ -56,16 +57,14 @@ arm_status arm_mat_inverse_f64( { float64_t *pIn = pSrc->pData; /* input data matrix pointer */ float64_t *pOut = pDst->pData; /* output data matrix pointer */ - float64_t *pInT1, *pInT2; /* Temporary input data matrix pointer */ - float64_t *pOutT1, *pOutT2; /* Temporary output data matrix pointer */ - float64_t *pPivotRowIn, *pPRT_in, *pPivotRowDst, *pPRT_pDst; /* Temporary input and output data matrix pointer */ + + float64_t *pTmp; uint32_t numRows = pSrc->numRows; /* Number of rows in the matrix */ uint32_t numCols = pSrc->numCols; /* Number of Cols in the matrix */ -#if defined (ARM_MATH_DSP) - float64_t Xchg, in = 0.0, in1; /* Temporary input values */ - uint32_t i, rowCnt, flag = 0U, j, loopCnt, k, l; /* loop counters */ + float64_t pivot = 0.0, newPivot=0.0; /* Temporary input values */ + uint32_t selectedRow,pivotRow,i, rowNb, rowCnt, flag = 0U, j,column; /* loop counters */ arm_status status; /* status of matrix inverse */ #ifdef ARM_MATH_MATRIX_CHECK @@ -83,7 +82,6 @@ arm_status arm_mat_inverse_f64( #endif /* #ifdef ARM_MATH_MATRIX_CHECK */ { - /*-------------------------------------------------------------------------------------------------------------- * Matrix Inverse can be solved using elementary row operations. * @@ -120,7 +118,7 @@ arm_status arm_mat_inverse_f64( *----------------------------------------------------------------------------------------------------------------*/ /* Working pointer for destination matrix */ - pOutT1 = pOut; + pTmp = pOut; /* Loop over the number of rows */ rowCnt = numRows; @@ -132,18 +130,18 @@ arm_status arm_mat_inverse_f64( j = numRows - rowCnt; while (j > 0U) { - *pOutT1++ = 0.0; + *pTmp++ = 0.0; j--; } /* Writing all ones in the diagonal of the destination matrix */ - *pOutT1++ = 1.0; + *pTmp++ = 1.0; /* Writing all zeroes in upper triangle of the destination matrix */ j = rowCnt - 1U; while (j > 0U) { - *pOutT1++ = 0.0; + *pTmp++ = 0.0; j--; } @@ -153,485 +151,99 @@ arm_status arm_mat_inverse_f64( /* Loop over the number of columns of the input matrix. All the elements in each column are processed by the row operations */ - loopCnt = numCols; /* Index modifier to navigate through the columns */ - l = 0U; - - while (loopCnt > 0U) + for(column = 0U; column < numCols; column++) { /* Check if the pivot element is zero.. * If it is zero then interchange the row with non zero row below. * If there is no non zero element to replace in the rows below, * then the matrix is Singular. */ - /* Working pointer for the input matrix that points - * to the pivot element of the particular row */ - pInT1 = pIn + (l * numCols); - - /* Working pointer for the destination matrix that points - * to the pivot element of the particular row */ - pOutT1 = pOut + (l * numCols); + pivotRow = column; /* Temporary variable to hold the pivot value */ - in = *pInT1; + pTmp = ELEM(pSrc,column,column) ; + pivot = *pTmp; + selectedRow = column; - /* Destination pointer modifier */ - k = 1U; + + /* Loop over the number rows present below */ - /* Check if the pivot element is zero */ - if (*pInT1 == 0.0) + for (rowNb = column+1; rowNb < numRows; rowNb++) { - /* Loop over the number rows present below */ - for (i = (l + 1U); i < numRows; i++) - { /* Update the input and destination pointers */ - pInT2 = pInT1 + (numCols * i); - pOutT2 = pOutT1 + (numCols * k); + pTmp = ELEM(pSrc,rowNb,column); + newPivot = *pTmp; + if (fabs(newPivot) > fabs(pivot)) + { + selectedRow = rowNb; + pivot = newPivot; + } + } /* Check if there is a non zero pivot element to * replace in the rows below */ - if (*pInT2 != 0.0) - { + if ((pivot != 0.0) && (selectedRow != column)) + { /* Loop over number of columns * to the right of the pilot element */ - j = numCols - l; - - while (j > 0U) - { - /* Exchange the row elements of the input matrix */ - Xchg = *pInT2; - *pInT2++ = *pInT1; - *pInT1++ = Xchg; - - /* Decrement the loop counter */ - j--; - } - /* Loop over number of columns of the destination matrix */ - j = numCols; - - while (j > 0U) - { - /* Exchange the row elements of the destination matrix */ - Xchg = *pOutT2; - *pOutT2++ = *pOutT1; - *pOutT1++ = Xchg; - - /* Decrement loop counter */ - j--; - } + SWAP_ROWS_F64(pSrc,column, pivotRow,selectedRow); + SWAP_ROWS_F64(pDst,0, pivotRow,selectedRow); + /* Flag to indicate whether exchange is done or not */ flag = 1U; - /* Break after exchange is done */ - break; - } - - /* Update the destination pointer modifier */ - k++; - - /* Decrement loop counter */ - i--; - } } + /* Update the status if the matrix is singular */ - if ((flag != 1U) && (in == 0.0)) + if ((flag != 1U) && (pivot == 0.0)) { return ARM_MATH_SINGULAR; } - /* Points to the pivot row of input and destination matrices */ - pPivotRowIn = pIn + (l * numCols); - pPivotRowDst = pOut + (l * numCols); - - /* Temporary pointers to the pivot row pointers */ - pInT1 = pPivotRowIn; - pInT2 = pPivotRowDst; - + /* Pivot element of the row */ - in = *pPivotRowIn; + pivot = 1.0 / pivot; - /* Loop over number of columns - * to the right of the pilot element */ - j = (numCols - l); - - while (j > 0U) - { - /* Divide each element of the row of the input matrix - * by the pivot element */ - in1 = *pInT1; - *pInT1++ = in1 / in; - - /* Decrement the loop counter */ - j--; - } - - /* Loop over number of columns of the destination matrix */ - j = numCols; - - while (j > 0U) - { - /* Divide each element of the row of the destination matrix - * by the pivot element */ - in1 = *pInT2; - *pInT2++ = in1 / in; - - /* Decrement the loop counter */ - j--; - } + SCALE_ROW_F64(pSrc,column,pivot,pivotRow); + SCALE_ROW_F64(pDst,0,pivot,pivotRow); + /* Replace the rows with the sum of that row and a multiple of row i * so that each new element in column i above row i is zero.*/ - /* Temporary pointers for input and destination matrices */ - pInT1 = pIn; - pInT2 = pOut; - - /* index used to check for pivot element */ - i = 0U; - - /* Loop over number of rows */ - /* to be replaced by the sum of that row and a multiple of row i */ - k = numRows; - - while (k > 0U) - { - /* Check for the pivot element */ - if (i == l) - { - /* If the processing element is the pivot element, - only the columns to the right are to be processed */ - pInT1 += numCols - l; - - pInT2 += numCols; - } - else - { - /* Element of the reference row */ - in = *pInT1; - - /* Working pointers for input and destination pivot rows */ - pPRT_in = pPivotRowIn; - pPRT_pDst = pPivotRowDst; - - /* Loop over the number of columns to the right of the pivot element, - to replace the elements in the input matrix */ - j = (numCols - l); - - while (j > 0U) - { - /* Replace the element by the sum of that row - and a multiple of the reference row */ - in1 = *pInT1; - *pInT1++ = in1 - (in * *pPRT_in++); - - /* Decrement the loop counter */ - j--; - } - - /* Loop over the number of columns to - replace the elements in the destination matrix */ - j = numCols; - - while (j > 0U) - { - /* Replace the element by the sum of that row - and a multiple of the reference row */ - in1 = *pInT2; - *pInT2++ = in1 - (in * *pPRT_pDst++); - - /* Decrement loop counter */ - j--; - } - - } - - /* Increment temporary input pointer */ - pInT1 = pInT1 + l; - - /* Decrement loop counter */ - k--; - - /* Increment pivot index */ - i++; - } - - /* Increment the input pointer */ - pIn++; - - /* Decrement the loop counter */ - loopCnt--; - - /* Increment the index modifier */ - l++; - } - - -#else - - float64_t Xchg, in = 0.0; /* Temporary input values */ - uint32_t i, rowCnt, flag = 0U, j, loopCnt, k, l; /* loop counters */ - arm_status status; /* status of matrix inverse */ - -#ifdef ARM_MATH_MATRIX_CHECK - - /* Check for matrix mismatch condition */ - if ((pSrc->numRows != pSrc->numCols) || - (pDst->numRows != pDst->numCols) || - (pSrc->numRows != pDst->numRows) ) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else - -#endif /* #ifdef ARM_MATH_MATRIX_CHECK */ - - { - - /*-------------------------------------------------------------------------------------------------------------- - * Matrix Inverse can be solved using elementary row operations. - * - * Gauss-Jordan Method: - * - * 1. First combine the identity matrix and the input matrix separated by a bar to form an - * augmented matrix as follows: - * _ _ _ _ _ _ _ _ - * | | a11 a12 | | | 1 0 | | | X11 X12 | - * | | | | | | | = | | - * |_ |_ a21 a22 _| | |_0 1 _| _| |_ X21 X21 _| - * - * 2. In our implementation, pDst Matrix is used as identity matrix. - * - * 3. Begin with the first row. Let i = 1. - * - * 4. Check to see if the pivot for row i is zero. - * The pivot is the element of the main diagonal that is on the current row. - * For instance, if working with row i, then the pivot element is aii. - * If the pivot is zero, exchange that row with a row below it that does not - * contain a zero in column i. If this is not possible, then an inverse - * to that matrix does not exist. - * - * 5. Divide every element of row i by the pivot. - * - * 6. For every row below and row i, replace that row with the sum of that row and - * a multiple of row i so that each new element in column i below row i is zero. - * - * 7. Move to the next row and column and repeat steps 2 through 5 until you have zeros - * for every element below and above the main diagonal. - * - * 8. Now an identical matrix is formed to the left of the bar(input matrix, src). - * Therefore, the matrix to the right of the bar is our solution(dst matrix, dst). - *----------------------------------------------------------------------------------------------------------------*/ - - /* Working pointer for destination matrix */ - pOutT1 = pOut; - - /* Loop over the number of rows */ - rowCnt = numRows; - - /* Making the destination matrix as identity matrix */ - while (rowCnt > 0U) - { - /* Writing all zeroes in lower triangle of the destination matrix */ - j = numRows - rowCnt; - while (j > 0U) - { - *pOutT1++ = 0.0; - j--; - } - - /* Writing all ones in the diagonal of the destination matrix */ - *pOutT1++ = 1.0; - - /* Writing all zeroes in upper triangle of the destination matrix */ - j = rowCnt - 1U; - while (j > 0U) - { - *pOutT1++ = 0.0; - j--; - } - - /* Decrement loop counter */ - rowCnt--; - } - - /* Loop over the number of columns of the input matrix. - All the elements in each column are processed by the row operations */ - loopCnt = numCols; - - /* Index modifier to navigate through the columns */ - l = 0U; - - while (loopCnt > 0U) - { - /* Check if the pivot element is zero.. - * If it is zero then interchange the row with non zero row below. - * If there is no non zero element to replace in the rows below, - * then the matrix is Singular. */ - - /* Working pointer for the input matrix that points - * to the pivot element of the particular row */ - pInT1 = pIn + (l * numCols); - - /* Working pointer for the destination matrix that points - * to the pivot element of the particular row */ - pOutT1 = pOut + (l * numCols); - - /* Temporary variable to hold the pivot value */ - in = *pInT1; - - /* Destination pointer modifier */ - k = 1U; - - /* Check if the pivot element is zero */ - if (*pInT1 == 0.0) + rowNb = 0; + for (;rowNb < pivotRow; rowNb++) { - /* Loop over the number rows present below */ - for (i = (l + 1U); i < numRows; i++) - { - /* Update the input and destination pointers */ - pInT2 = pInT1 + (numCols * i); - pOutT2 = pOutT1 + (numCols * k); - - /* Check if there is a non zero pivot element to - * replace in the rows below */ - if (*pInT2 != 0.0) - { - /* Loop over number of columns - * to the right of the pilot element */ - for (j = 0U; j < (numCols - l); j++) - { - /* Exchange the row elements of the input matrix */ - Xchg = *pInT2; - *pInT2++ = *pInT1; - *pInT1++ = Xchg; - } - - for (j = 0U; j < numCols; j++) - { - Xchg = *pOutT2; - *pOutT2++ = *pOutT1; - *pOutT1++ = Xchg; - } + pTmp = ELEM(pSrc,rowNb,column) ; + pivot = *pTmp; - /* Flag to indicate whether exchange is done or not */ - flag = 1U; + MAS_ROW_F64(column,pSrc,rowNb,pivot,pSrc,pivotRow); + MAS_ROW_F64(0 ,pDst,rowNb,pivot,pDst,pivotRow); - /* Break after exchange is done */ - break; - } - /* Update the destination pointer modifier */ - k++; - } } - /* Update the status if the matrix is singular */ - if ((flag != 1U) && (in == 0.0)) + for (rowNb = pivotRow + 1; rowNb < numRows; rowNb++) { - return ARM_MATH_SINGULAR; - } - - /* Points to the pivot row of input and destination matrices */ - pPivotRowIn = pIn + (l * numCols); - pPivotRowDst = pOut + (l * numCols); + pTmp = ELEM(pSrc,rowNb,column) ; + pivot = *pTmp; - /* Temporary pointers to the pivot row pointers */ - pInT1 = pPivotRowIn; - pOutT1 = pPivotRowDst; + MAS_ROW_F64(column,pSrc,rowNb,pivot,pSrc,pivotRow); + MAS_ROW_F64(0 ,pDst,rowNb,pivot,pDst,pivotRow); - /* Pivot element of the row */ - in = *(pIn + (l * numCols)); - - /* Loop over number of columns - * to the right of the pilot element */ - for (j = 0U; j < (numCols - l); j++) - { - /* Divide each element of the row of the input matrix - * by the pivot element */ - *pInT1 = *pInT1 / in; - pInT1++; } - for (j = 0U; j < numCols; j++) - { - /* Divide each element of the row of the destination matrix - * by the pivot element */ - *pOutT1 = *pOutT1 / in; - pOutT1++; - } - - /* Replace the rows with the sum of that row and a multiple of row i - * so that each new element in column i above row i is zero.*/ - - /* Temporary pointers for input and destination matrices */ - pInT1 = pIn; - pOutT1 = pOut; - for (i = 0U; i < numRows; i++) - { - /* Check for the pivot element */ - if (i == l) - { - /* If the processing element is the pivot element, - only the columns to the right are to be processed */ - pInT1 += numCols - l; - pOutT1 += numCols; - } - else - { - /* Element of the reference row */ - in = *pInT1; - - /* Working pointers for input and destination pivot rows */ - pPRT_in = pPivotRowIn; - pPRT_pDst = pPivotRowDst; - - /* Loop over the number of columns to the right of the pivot element, - to replace the elements in the input matrix */ - for (j = 0U; j < (numCols - l); j++) - { - /* Replace the element by the sum of that row - and a multiple of the reference row */ - *pInT1 = *pInT1 - (in * *pPRT_in++); - pInT1++; - } - - /* Loop over the number of columns to - replace the elements in the destination matrix */ - for (j = 0U; j < numCols; j++) - { - /* Replace the element by the sum of that row - and a multiple of the reference row */ - *pOutT1 = *pOutT1 - (in * *pPRT_pDst++); - pOutT1++; - } - - } - - /* Increment temporary input pointer */ - pInT1 = pInT1 + l; - } - - /* Increment the input pointer */ - pIn++; - - /* Decrement the loop counter */ - loopCnt--; - - /* Increment the index modifier */ - l++; } -#endif /* #if defined (ARM_MATH_DSP) */ - /* Set status as ARM_MATH_SUCCESS */ status = ARM_MATH_SUCCESS; - if ((flag != 1U) && (in == 0.0)) + if ((flag != 1U) && (pivot == 0.0)) { pIn = pSrc->pData; for (i = 0; i < numRows * numCols; i++) @@ -648,7 +260,6 @@ arm_status arm_mat_inverse_f64( /* Return to application */ return (status); } - /** @} end of MatrixInv group */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_ldlt_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_ldlt_f32.c index b974031..3fa0b43 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_ldlt_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_ldlt_f32.c @@ -5,11 +5,13 @@ * Title: arm_mat_ldl_f32.c * Description: Floating-point LDL decomposition * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -27,44 +29,12 @@ */ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h" - - +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h" #if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) - -/// @private -#define SWAP_ROWS(A,i,j) \ - { \ - int cnt = n; \ - \ - for(int w=0;w < n; w+=4) \ - { \ - f32x4_t tmpa,tmpb; \ - mve_pred16_t p0 = vctp32q(cnt); \ - \ - tmpa=vldrwq_z_f32(&A[i*n + w],p0);\ - tmpb=vldrwq_z_f32(&A[j*n + w],p0);\ - \ - vstrwq_p(&A[i*n + w], tmpb, p0); \ - vstrwq_p(&A[j*n + w], tmpa, p0); \ - \ - cnt -= 4; \ - } \ - } - -/// @private -#define SWAP_COLS(A,i,j) \ - for(int w=0;w < n; w++) \ - { \ - float32_t tmp; \ - tmp = A[w*n + i]; \ - A[w*n + i] = A[w*n + j];\ - A[w*n + j] = tmp; \ - } - /** @ingroup groupMatrix */ @@ -96,7 +66,7 @@ arm_status arm_mat_ldlt_f32( { arm_status status; /* status of matrix inverse */ - + #ifdef ARM_MATH_MATRIX_CHECK @@ -104,8 +74,7 @@ arm_status arm_mat_ldlt_f32( if ((pSrc->numRows != pSrc->numCols) || (pl->numRows != pl->numCols) || (pd->numRows != pd->numCols) || - (pp->numRows != pp->numCols) || - (pl->numRows != pl->numRows) ) + (pl->numRows != pd->numRows) ) { /* Set status as ARM_MATH_SIZE_MISMATCH */ status = ARM_MATH_SIZE_MISMATCH; @@ -120,6 +89,7 @@ arm_status arm_mat_ldlt_f32( int fullRank = 1, diag,k; float32_t *pA; + memset(pd->pData,0,sizeof(float32_t)*n*n); memcpy(pl->pData,pSrc->pData,n*n*sizeof(float32_t)); pA = pl->pData; @@ -143,7 +113,7 @@ arm_status arm_mat_ldlt_f32( { /* Find pivot */ float32_t m=F32_MIN,a; - int j=k; + int j=k; for(int r=k;rpData[row*n+col], zero, p0); + + vstrwq_p(&pl->pData[row*n+col], zero, p0); cnt -= 4; } @@ -293,15 +263,15 @@ arm_status arm_mat_ldlt_f32( for(int row=0; row < n;row++) { - mve_pred16_t p0; + mve_pred16_t p0; int cnt= n-row-1; f32x4_t zero=vdupq_n_f32(0.0f); - + for(int col=row+1; col < n;col+=4) { p0 = vctp32q(cnt); - - vstrwq_p(&pl->pData[row*n+col], zero, p0); + + vstrwq_p(&pl->pData[row*n+col], zero, p0); cnt -= 4; } @@ -312,36 +282,17 @@ arm_status arm_mat_ldlt_f32( pd->pData[d*n+d] = pl->pData[d*n+d]; pl->pData[d*n+d] = 1.0; } - + status = ARM_MATH_SUCCESS; } - + /* Return to application */ return (status); } #else -/// @private -#define SWAP_ROWS(A,i,j) \ - for(int w=0;w < n; w++) \ - { \ - float32_t tmp; \ - tmp = A[i*n + w]; \ - A[i*n + w] = A[j*n + w];\ - A[j*n + w] = tmp; \ - } - -/// @private -#define SWAP_COLS(A,i,j) \ - for(int w=0;w < n; w++) \ - { \ - float32_t tmp; \ - tmp = A[w*n + i]; \ - A[w*n + i] = A[w*n + j];\ - A[w*n + j] = tmp; \ - } /** @ingroup groupMatrix @@ -351,7 +302,7 @@ arm_status arm_mat_ldlt_f32( @addtogroup MatrixChol @{ */ - + /** * @brief Floating-point LDL^t decomposition of positive semi-definite matrix. * @param[in] pSrc points to the instance of the input floating-point matrix structure. @@ -374,7 +325,7 @@ arm_status arm_mat_ldlt_f32( { arm_status status; /* status of matrix inverse */ - + #ifdef ARM_MATH_MATRIX_CHECK @@ -382,8 +333,7 @@ arm_status arm_mat_ldlt_f32( if ((pSrc->numRows != pSrc->numCols) || (pl->numRows != pl->numCols) || (pd->numRows != pd->numCols) || - (pp->numRows != pp->numCols) || - (pl->numRows != pl->numRows) ) + (pl->numRows != pd->numRows) ) { /* Set status as ARM_MATH_SIZE_MISMATCH */ status = ARM_MATH_SIZE_MISMATCH; @@ -397,11 +347,13 @@ arm_status arm_mat_ldlt_f32( const int n=pSrc->numRows; int fullRank = 1, diag,k; float32_t *pA; + int row,d; + memset(pd->pData,0,sizeof(float32_t)*n*n); memcpy(pl->pData,pSrc->pData,n*n*sizeof(float32_t)); pA = pl->pData; - for(int k=0;k < n; k++) + for(k=0;k < n; k++) { pp[k] = k; } @@ -411,10 +363,13 @@ arm_status arm_mat_ldlt_f32( { /* Find pivot */ float32_t m=F32_MIN,a; - int j=k; + int j=k; - for(int r=k;r m) { @@ -425,8 +380,8 @@ arm_status arm_mat_ldlt_f32( if(j != k) { - SWAP_ROWS(pA,k,j); - SWAP_COLS(pA,k,j); + SWAP_ROWS_F32(pl,0,k,j); + SWAP_COLS_F32(pl,0,k,j); } @@ -434,27 +389,28 @@ arm_status arm_mat_ldlt_f32( a = pA[k*n+k]; - if (fabs(a) < 1.0e-8) + if (fabsf(a) < 1.0e-8f) { fullRank = 0; break; } - for(int w=k+1;wpData[row*n+col]=0.0; } } } - for(int row=0; row < n;row++) + for(row=0; row < n;row++) { - for(int col=row+1; col < n;col++) + int col; + for(col=row+1; col < n;col++) { pl->pData[row*n+col] = 0.0; } } - for(int d=0; d < diag;d++) + for(d=0; d < diag;d++) { pd->pData[d*n+d] = pl->pData[d*n+d]; pl->pData[d*n+d] = 1.0; } - + status = ARM_MATH_SUCCESS; } - + /* Return to application */ return (status); } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_ldlt_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_ldlt_f64.c index 64e4d1a..55b131a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_ldlt_f64.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_ldlt_f64.c @@ -5,11 +5,13 @@ * Title: arm_mat_ldl_f64.c * Description: Floating-point LDL decomposition * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -27,29 +29,11 @@ */ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h" -#include +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h" +#include -/// @private -#define SWAP_ROWS(A,i,j) \ - for(int w=0;w < n; w++) \ - { \ - float64_t tmp; \ - tmp = A[i*n + w]; \ - A[i*n + w] = A[j*n + w];\ - A[j*n + w] = tmp; \ - } -/// @private -#define SWAP_COLS(A,i,j) \ - for(int w=0;w < n; w++) \ - { \ - float64_t tmp; \ - tmp = A[w*n + i]; \ - A[w*n + i] = A[w*n + j];\ - A[w*n + j] = tmp; \ - } - /** @ingroup groupMatrix */ @@ -90,8 +74,7 @@ arm_status arm_mat_ldlt_f64( if ((pSrc->numRows != pSrc->numCols) || (pl->numRows != pl->numCols) || (pd->numRows != pd->numCols) || - (pp->numRows != pp->numCols) || - (pl->numRows != pl->numRows) ) + (pl->numRows != pd->numRows) ) { /* Set status as ARM_MATH_SIZE_MISMATCH */ status = ARM_MATH_SIZE_MISMATCH; @@ -106,10 +89,12 @@ arm_status arm_mat_ldlt_f64( int fullRank = 1, diag,k; float64_t *pA; + memset(pd->pData,0,sizeof(float64_t)*n*n); + memcpy(pl->pData,pSrc->pData,n*n*sizeof(float64_t)); pA = pl->pData; - for(int k=0;k < n; k++) + for(k=0;k < n; k++) { pp[k] = k; } @@ -119,10 +104,10 @@ arm_status arm_mat_ldlt_f64( { /* Find pivot */ float64_t m=F64_MIN,a; - int j=k; + int w,r,j=k; - for(int r=k;r m) { @@ -133,8 +118,8 @@ arm_status arm_mat_ldlt_f64( if(j != k) { - SWAP_ROWS(pA,k,j); - SWAP_COLS(pA,k,j); + SWAP_ROWS_F64(pl,0,k,j); + SWAP_COLS_F64(pl,0,k,j); } @@ -149,15 +134,16 @@ arm_status arm_mat_ldlt_f64( break; } - for(int w=k+1;wpData[row*n+col]=0.0; + int col; + for(col=k; col < n;col++) + { + pl->pData[row*n+col]=0.0; + } } } } - for(int row=0; row < n;row++) { - for(int col=row+1; col < n;col++) - { - pl->pData[row*n+col] = 0.0; - } + int row; + for(row=0; row < n;row++) + { + int col; + for(col=row+1; col < n;col++) + { + pl->pData[row*n+col] = 0.0; + } + } } - for(int d=0; d < diag;d++) { - pd->pData[d*n+d] = pl->pData[d*n+d]; - pl->pData[d*n+d] = 1.0; + int d; + for(d=0; d < diag;d++) + { + pd->pData[d*n+d] = pl->pData[d*n+d]; + pl->pData[d*n+d] = 1.0; + } } status = ARM_MATH_SUCCESS; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_f16.c index 571da6f..45c6570 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_f16.c @@ -5,13 +5,13 @@ * Title: arm_mat_mult_f16.c * Description: Floating-point matrix multiplication * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -404,7 +404,7 @@ arm_status arm_mat_mult_f16( (pSrcB->numCols != pDst->numCols) ) { /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; + return(ARM_MATH_SIZE_MISMATCH); } else @@ -689,16 +689,16 @@ arm_status arm_mat_mult_f16( /* c(m,n) = a(1,1) * b(1,1) + a(1,2) * b(2,1) + .... + a(m,p) * b(p,n) */ /* Perform the multiply-accumulates */ - sum += *pIn1++ * *pIn2; + sum += (_Float16)*pIn1++ * (_Float16)*pIn2; pIn2 += numColsB; - sum += *pIn1++ * *pIn2; + sum += (_Float16)*pIn1++ * (_Float16)*pIn2; pIn2 += numColsB; - sum += *pIn1++ * *pIn2; + sum += (_Float16)*pIn1++ * (_Float16)*pIn2; pIn2 += numColsB; - sum += *pIn1++ * *pIn2; + sum += (_Float16)*pIn1++ * (_Float16)*pIn2; pIn2 += numColsB; /* Decrement loop counter */ @@ -720,7 +720,7 @@ arm_status arm_mat_mult_f16( /* c(m,n) = a(1,1) * b(1,1) + a(1,2) * b(2,1) + .... + a(m,p) * b(p,n) */ /* Perform the multiply-accumulates */ - sum += *pIn1++ * *pIn2; + sum += (_Float16)*pIn1++ * (_Float16)*pIn2; pIn2 += numColsB; /* Decrement loop counter */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_f32.c index 26eaec6..ed1fe6e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_f32.c @@ -5,13 +5,13 @@ * Title: arm_mat_mult_f32.c * Description: Floating-point matrix multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -30,6 +30,10 @@ #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h" +#if defined(ARM_MATH_NEON) +#define GROUPOFROWS 8 +#endif + /** * @ingroup groupMatrix */ @@ -39,7 +43,27 @@ * * Multiplies two matrices. * - * \image html MatrixMultiplication.gif "Multiplication of two 3 x 3 matrices" + * @par Multiplication of two 3x3 matrices: + * + * \f[ + * \begin{pmatrix} + * a_{1,1} & a_{1,2} & a_{1,3} \\ + * a_{2,1} & a_{2,2} & a_{2,3} \\ + * a_{3,1} & a_{3,2} & a_{3,3} \\ + * \end{pmatrix} + * + * \begin{pmatrix} + * b_{1,1} & b_{1,2} & b_{1,3} \\ + * b_{2,1} & b_{2,2} & b_{2,3} \\ + * b_{3,1} & b_{3,2} & b_{3,3} \\ + * \end{pmatrix} + * = + * \begin{pmatrix} + * a_{1,1} b_{1,1}+a_{1,2} b_{2,1}+a_{1,3} b_{3,1} & a_{1,1} b_{1,2}+a_{1,2} b_{2,2}+a_{1,3} b_{3,2} & a_{1,1} b_{1,3}+a_{1,2} b_{2,3}+a_{1,3} b_{3,3} \\ + * a_{2,1} b_{1,1}+a_{2,2} b_{2,1}+a_{2,3} b_{3,1} & a_{2,1} b_{1,2}+a_{2,2} b_{2,2}+a_{2,3} b_{3,2} & a_{2,1} b_{1,3}+a_{2,2} b_{2,3}+a_{2,3} b_{3,3} \\ + * a_{3,1} b_{1,1}+a_{3,2} b_{2,1}+a_{3,3} b_{3,1} & a_{3,1} b_{1,2}+a_{3,2} b_{2,2}+a_{3,3} b_{3,2} & a_{3,1} b_{1,3}+a_{3,2} b_{2,3}+a_{3,3} b_{3,3} \\ + * \end{pmatrix} + * \f] * Matrix multiplication is only defined if the number of columns of the * first matrix equals the number of rows of the second matrix. @@ -56,14 +80,7 @@ * @{ */ -/** - * @brief Floating-point matrix multiplication. - * @param[in] *pSrcA points to the first input matrix structure - * @param[in] *pSrcB points to the second input matrix structure - * @param[out] *pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ + #if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) @@ -260,6 +277,14 @@ __STATIC_INLINE arm_status arm_mat_mult_f32_4x4_mve( } +/** + * @brief Floating-point matrix multiplication. + * @param[in] *pSrcA points to the first input matrix structure + * @param[in] *pSrcB points to the second input matrix structure + * @param[out] *pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ arm_status arm_mat_mult_f32( const arm_matrix_instance_f32 * pSrcA, const arm_matrix_instance_f32 * pSrcB, @@ -514,9 +539,14 @@ arm_status arm_mat_mult_f32( #else #if defined(ARM_MATH_NEON) - -#define GROUPOFROWS 8 - +/** + * @brief Floating-point matrix multiplication. + * @param[in] *pSrcA points to the first input matrix structure + * @param[in] *pSrcB points to the second input matrix structure + * @param[out] *pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ arm_status arm_mat_mult_f32( const arm_matrix_instance_f32 * pSrcA, const arm_matrix_instance_f32 * pSrcB, @@ -845,6 +875,14 @@ arm_status arm_mat_mult_f32( return (status); } #else +/** + * @brief Floating-point matrix multiplication. + * @param[in] *pSrcA points to the first input matrix structure + * @param[in] *pSrcB points to the second input matrix structure + * @param[out] *pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ arm_status arm_mat_mult_f32( const arm_matrix_instance_f32 * pSrcA, const arm_matrix_instance_f32 * pSrcB, diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_f64.c index 29e3a3e..08571c7 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_f64.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_f64.c @@ -5,13 +5,13 @@ * Title: arm_mat_mult_f64.c * Description: Floating-point matrix multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -34,23 +34,6 @@ * @ingroup groupMatrix */ -/** - * @defgroup MatrixMult Matrix Multiplication - * - * Multiplies two matrices. - * - * \image html MatrixMultiplication.gif "Multiplication of two 3 x 3 matrices" - - * Matrix multiplication is only defined if the number of columns of the - * first matrix equals the number of rows of the second matrix. - * Multiplying an M x N matrix with an N x P matrix results - * in an M x P matrix. - * When matrix size checking is enabled, the functions check: (1) that the inner dimensions of - * pSrcA and pSrcB are equal; and (2) that the size of the output - * matrix equals the outer dimensions of pSrcA and pSrcB. - */ - - /** * @addtogroup MatrixMult * @{ @@ -116,7 +99,7 @@ arm_status arm_mat_mult_f64( do { /* Set the variable sum, that acts as accumulator, to zero */ - sum = 0.0f; + sum = 0.0; /* Initialize pointer pIn1 to point to starting address of column being processed */ pIn1 = pInA; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_fast_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_fast_q15.c index 46981ff..57eda5b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_fast_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_fast_q15.c @@ -5,13 +5,13 @@ * Title: arm_mat_mult_fast_q15.c * Description: Q15 matrix multiplication (fast variant) * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -80,7 +80,7 @@ arm_status arm_mat_mult_fast_q15( uint16_t numRowsA = pSrcA->numRows; /* Number of rows of input matrix A */ uint16_t numColsB = pSrcB->numCols; /* Number of columns of input matrix B */ uint16_t numColsA = pSrcA->numCols; /* Number of columns of input matrix A */ - uint16_t numRowsB = pSrcB->numRows; /* Number of rows of input matrix A */ + uint16_t numRowsB = pSrcB->numRows; /* Number of rows of input matrix B */ uint32_t col, i = 0U, row = numRowsB, colCnt; /* Loop counters */ arm_status status; /* Status of matrix multiplication */ @@ -127,7 +127,7 @@ arm_status arm_mat_mult_fast_q15( #if defined (ARM_MATH_DSP) /* Read two elements from row */ - in = read_q15x2_ia ((q15_t **) &pInB); + in = read_q15x2_ia (&pInB); /* Unpack and store one element in destination */ #ifndef ARM_MATH_BIG_ENDIAN @@ -149,7 +149,7 @@ arm_status arm_mat_mult_fast_q15( /* Update pointer px to point to next row of transposed matrix */ px += numRowsB; - in = read_q15x2_ia ((q15_t **) &pInB); + in = read_q15x2_ia (&pInB); #ifndef ARM_MATH_BIG_ENDIAN *px = (q15_t) in; #else @@ -260,7 +260,7 @@ arm_status arm_mat_mult_fast_q15( pInA2 = pInA + numColsA; pInB2 = pInB + numRowsB; - /* Read in two elements at once - alows dual MAC instruction */ + /* Read in two elements at once - allows dual MAC instruction */ colCnt = numColsA >> 1U; #else colCnt = numColsA >> 2U; @@ -273,13 +273,13 @@ arm_status arm_mat_mult_fast_q15( #if defined (ARM_MATH_DSP) /* read real and imag values from pSrcA and pSrcB buffer */ - inA1 = read_q15x2_ia ((q15_t **) &pInA); - inB1 = read_q15x2_ia ((q15_t **) &pInB); + inA1 = read_q15x2_ia (&pInA); + inB1 = read_q15x2_ia (&pInB); - inA2 = read_q15x2_ia ((q15_t **) &pInA2); - inB2 = read_q15x2_ia ((q15_t **) &pInB2); + inA2 = read_q15x2_ia (&pInA2); + inB2 = read_q15x2_ia (&pInB2); - /* Multiply and Accumlates */ + /* Multiply and Accumulates */ sum = __SMLAD(inA1, inB1, sum); sum2 = __SMLAD(inA1, inB2, sum2); sum3 = __SMLAD(inA2, inB1, sum3); @@ -288,7 +288,7 @@ arm_status arm_mat_mult_fast_q15( /* read real and imag values from pSrcA and pSrcB buffer */ inA1 = *pInA++; inB1 = *pInB++; - /* Multiply and Accumlates */ + /* Multiply and Accumulates */ sum += inA1 * inB1; inA2 = *pInA++; @@ -391,10 +391,10 @@ arm_status arm_mat_mult_fast_q15( /* matrix multiplication */ while (colCnt > 0U) { - inA1 = read_q15x2_ia ((q15_t **) &pInA); - inA2 = read_q15x2_ia ((q15_t **) &pInA); - inB1 = read_q15x2_ia ((q15_t **) &pInB); - inB2 = read_q15x2_ia ((q15_t **) &pInB); + inA1 = read_q15x2_ia (&pInA); + inA2 = read_q15x2_ia (&pInA); + inB1 = read_q15x2_ia (&pInB); + inB2 = read_q15x2_ia (&pInB); sum = __SMLAD(inA1, inB1, sum); sum = __SMLAD(inA2, inB2, sum); @@ -443,10 +443,10 @@ arm_status arm_mat_mult_fast_q15( /* matrix multiplication */ while (colCnt > 0U) { - inA1 = read_q15x2_ia ((q15_t **) &pInA); - inA2 = read_q15x2_ia ((q15_t **) &pInA); - inB1 = read_q15x2_ia ((q15_t **) &pInB); - inB2 = read_q15x2_ia ((q15_t **) &pInB); + inA1 = read_q15x2_ia (&pInA); + inA2 = read_q15x2_ia (&pInA); + inB1 = read_q15x2_ia (&pInB); + inB2 = read_q15x2_ia (&pInB); sum = __SMLAD(inA1, inB1, sum); sum = __SMLAD(inA2, inB2, sum); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_fast_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_fast_q31.c index f4214af..1107562 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_fast_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_fast_q31.c @@ -5,13 +5,13 @@ * Title: arm_mat_mult_fast_q31.c * Description: Q31 matrix multiplication (fast variant) * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_opt_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_opt_q31.c new file mode 100644 index 0000000..69e0142 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_opt_q31.c @@ -0,0 +1,788 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mat_mult_opt_q31.c + * Description: Q31 matrix multiplication + * + * $Date: 3 Nov 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h" + +/** + @ingroup groupMatrix + */ + +/** + @addtogroup MatrixMult + @{ + */ + +/** + @brief Q31 matrix multiplication. + @param[in] pSrcA points to the first input matrix structure + @param[in] pSrcB points to the second input matrix structure + @param[out] pDst points to output matrix structure + @param[in] pState points to the array for storing intermediate results + @return execution status + - \ref ARM_MATH_SUCCESS : Operation successful + - \ref ARM_MATH_SIZE_MISMATCH : Matrix size check failed + + @par Scaling and Overflow Behavior + The function is implemented using an internal 64-bit accumulator. + The accumulator has a 2.62 format and maintains full precision of the intermediate + multiplication results but provides only a single guard bit. There is no saturation + on intermediate additions. Thus, if the accumulator overflows it wraps around and + distorts the result. The input signals should be scaled down to avoid intermediate + overflows. The input is thus scaled down by log2(numColsA) bits + to avoid overflows, as a total of numColsA additions are performed internally. + The 2.62 accumulator is right shifted by 31 bits and saturated to 1.31 format to yield the final result. + @remark + Refer to \ref arm_mat_mult_fast_q31() for a faster but less precise implementation of this function. + @remark + This function is a faster implementation of arm_mat_mult_q31 for MVE but it is requiring + additional storage for intermediate results. + */ +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#define MATRIX_DIM2 2 +#define MATRIX_DIM3 3 +#define MATRIX_DIM4 4 + +__STATIC_INLINE arm_status arm_mat_mult_opt_q31_2x2_mve( + const arm_matrix_instance_q31 * pSrcA, + const arm_matrix_instance_q31 * pSrcB, + arm_matrix_instance_q31 * pDst) +{ + q31_t *pInB = pSrcB->pData; /* input data matrix pointer B */ + q31_t *pInA = pSrcA->pData; /* input data matrix pointer A */ + q31_t *pOut = pDst->pData; /* output data matrix pointer */ + uint32x4_t vecColBOffs; + q31_t *pInA0 = pInA; + q31_t *pInA1 = pInA0 + MATRIX_DIM2; + q63_t acc0, acc1; + q31x4_t vecB, vecA0, vecA1; + /* enable predication to disable half of vector elements */ + mve_pred16_t p0 = vctp32q(MATRIX_DIM2); + + vecColBOffs = vidupq_u32((uint32_t)0, 1); + vecColBOffs = vecColBOffs * MATRIX_DIM2; + + pInB = pSrcB->pData; + + /* load 1st B column (partial load) */ + vecB = vldrwq_gather_shifted_offset_z_s32(pInB, vecColBOffs, p0); + + /* load A rows */ + vecA0 = vldrwq_s32(pInA0); + vecA1 = vldrwq_s32(pInA1); + + acc0 = vrmlaldavhq(vecA0, vecB); + acc1 = vrmlaldavhq(vecA1, vecB); + + acc0 = asrl(acc0, 23); + acc1 = asrl(acc1, 23); + + pOut[0 * MATRIX_DIM2] = (q31_t) acc0; + pOut[1 * MATRIX_DIM2] = (q31_t) acc1; + pOut++; + + /* move to next B column */ + pInB = pInB + 1; + + vecB = vldrwq_gather_shifted_offset_z_s32(pInB, vecColBOffs, p0); + + acc0 = vrmlaldavhq(vecA0, vecB); + acc1 = vrmlaldavhq(vecA1, vecB); + + acc0 = asrl(acc0, 23); + acc1 = asrl(acc1, 23); + + pOut[0 * MATRIX_DIM2] = (q31_t) acc0; + pOut[1 * MATRIX_DIM2] = (q31_t) acc1; + /* + * Return to application + */ + return (ARM_MATH_SUCCESS); +} + + + +__STATIC_INLINE arm_status arm_mat_mult_opt_q31_3x3_mve( + const arm_matrix_instance_q31 * pSrcA, + const arm_matrix_instance_q31 * pSrcB, + arm_matrix_instance_q31 * pDst) +{ + q31_t *pInB = pSrcB->pData; /* input data matrix pointer B */ + q31_t *pInA = pSrcA->pData; /* input data matrix pointer A */ + q31_t *pOut = pDst->pData; /* output data matrix pointer */ + uint32x4_t vecColBOffs; + q31_t *pInA0 = pInA; + q31_t *pInA1 = pInA0 + MATRIX_DIM3; + q31_t *pInA2 = pInA1 + MATRIX_DIM3; + q63_t acc0, acc1, acc2; + q31x4_t vecB, vecA; + /* enable predication to disable last (4th) vector element */ + mve_pred16_t p0 = vctp32q(MATRIX_DIM3); + + vecColBOffs = vidupq_u32((uint32_t)0, 1); + vecColBOffs = vecColBOffs * MATRIX_DIM3; + + pInB = pSrcB->pData; + + vecB = vldrwq_gather_shifted_offset_z_s32(pInB, vecColBOffs, p0); + + vecA = vldrwq_s32(pInA0); + acc0 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA1); + acc1 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA2); + acc2 = vrmlaldavhq(vecA, vecB); + + acc0 = asrl(acc0, 23); + acc1 = asrl(acc1, 23); + acc2 = asrl(acc2, 23); + + pOut[0 * MATRIX_DIM3] = (q31_t) acc0; + pOut[1 * MATRIX_DIM3] = (q31_t) acc1; + pOut[2 * MATRIX_DIM3] = (q31_t) acc2; + pOut++; + + /* move to next B column */ + pInB = pInB + 1; + + vecB = vldrwq_gather_shifted_offset_z_s32(pInB, vecColBOffs, p0); + + vecA = vldrwq_s32(pInA0); + acc0 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA1); + acc1 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA2); + acc2 = vrmlaldavhq(vecA, vecB); + + acc0 = asrl(acc0, 23); + acc1 = asrl(acc1, 23); + acc2 = asrl(acc2, 23); + + pOut[0 * MATRIX_DIM3] = (q31_t) acc0; + pOut[1 * MATRIX_DIM3] = (q31_t) acc1; + pOut[2 * MATRIX_DIM3] = (q31_t) acc2; + pOut++; + + /* move to next B column */ + pInB = pInB + 1; + + vecB = vldrwq_gather_shifted_offset_z_s32(pInB, vecColBOffs, p0); + + vecA = vldrwq_s32(pInA0); + acc0 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA1); + acc1 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA2); + acc2 = vrmlaldavhq(vecA, vecB); + + acc0 = asrl(acc0, 23); + acc1 = asrl(acc1, 23); + acc2 = asrl(acc2, 23); + + pOut[0 * MATRIX_DIM3] = (q31_t) acc0; + pOut[1 * MATRIX_DIM3] = (q31_t) acc1; + pOut[2 * MATRIX_DIM3] = (q31_t) acc2; + /* + * Return to application + */ + return (ARM_MATH_SUCCESS); +} + +__STATIC_INLINE arm_status arm_mat_mult_opt_q31_4x4_mve( + const arm_matrix_instance_q31 * pSrcA, + const arm_matrix_instance_q31 * pSrcB, + arm_matrix_instance_q31 * pDst) +{ + q31_t *pInB = pSrcB->pData; /* input data matrix pointer B */ + q31_t *pInA = pSrcA->pData; /* input data matrix pointer A */ + q31_t *pOut = pDst->pData; /* output data matrix pointer */ + uint32x4_t vecColBOffs; + q31_t *pInA0 = pInA; + q31_t *pInA1 = pInA0 + MATRIX_DIM4; + q31_t *pInA2 = pInA1 + MATRIX_DIM4; + q31_t *pInA3 = pInA2 + MATRIX_DIM4; + q63_t acc0, acc1, acc2, acc3; + q31x4_t vecB, vecA; + + vecColBOffs = vidupq_u32((uint32_t)0, 4); + + pInB = pSrcB->pData; + + vecB = vldrwq_gather_shifted_offset_s32(pInB, vecColBOffs); + + vecA = vldrwq_s32(pInA0); + acc0 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA1); + acc1 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA2); + acc2 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA3); + acc3 = vrmlaldavhq(vecA, vecB); + + acc0 = asrl(acc0, 23); + acc1 = asrl(acc1, 23); + acc2 = asrl(acc2, 23); + acc3 = asrl(acc3, 23); + + pOut[0 * MATRIX_DIM4] = (q31_t) acc0; + pOut[1 * MATRIX_DIM4] = (q31_t) acc1; + pOut[2 * MATRIX_DIM4] = (q31_t) acc2; + pOut[3 * MATRIX_DIM4] = (q31_t) acc3; + pOut++; + + /* move to next B column */ + pInB = pInB + 1; + + vecB = vldrwq_gather_shifted_offset_s32(pInB, vecColBOffs); + + vecA = vldrwq_s32(pInA0); + acc0 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA1); + acc1 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA2); + acc2 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA3); + acc3 = vrmlaldavhq(vecA, vecB); + + acc0 = asrl(acc0, 23); + acc1 = asrl(acc1, 23); + acc2 = asrl(acc2, 23); + acc3 = asrl(acc3, 23); + + pOut[0 * MATRIX_DIM4] = (q31_t) acc0; + pOut[1 * MATRIX_DIM4] = (q31_t) acc1; + pOut[2 * MATRIX_DIM4] = (q31_t) acc2; + pOut[3 * MATRIX_DIM4] = (q31_t) acc3; + + pOut++; + + /* move to next B column */ + pInB = pInB + 1; + + vecB = vldrwq_gather_shifted_offset_s32(pInB, vecColBOffs); + + vecA = vldrwq_s32(pInA0); + acc0 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA1); + acc1 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA2); + acc2 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA3); + acc3 = vrmlaldavhq(vecA, vecB); + + acc0 = asrl(acc0, 23); + acc1 = asrl(acc1, 23); + acc2 = asrl(acc2, 23); + acc3 = asrl(acc3, 23); + + pOut[0 * MATRIX_DIM4] = (q31_t) acc0; + pOut[1 * MATRIX_DIM4] = (q31_t) acc1; + pOut[2 * MATRIX_DIM4] = (q31_t) acc2; + pOut[3 * MATRIX_DIM4] = (q31_t) acc3; + + pOut++; + + /* move to next B column */ + pInB = pInB + 1; + + vecB = vldrwq_gather_shifted_offset_s32(pInB, vecColBOffs); + + vecA = vldrwq_s32(pInA0); + acc0 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA1); + acc1 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA2); + acc2 = vrmlaldavhq(vecA, vecB); + vecA = vldrwq_s32(pInA3); + acc3 = vrmlaldavhq(vecA, vecB); + + acc0 = asrl(acc0, 23); + acc1 = asrl(acc1, 23); + acc2 = asrl(acc2, 23); + acc3 = asrl(acc3, 23); + + pOut[0 * MATRIX_DIM4] = (q31_t) acc0; + pOut[1 * MATRIX_DIM4] = (q31_t) acc1; + pOut[2 * MATRIX_DIM4] = (q31_t) acc2; + pOut[3 * MATRIX_DIM4] = (q31_t) acc3; + /* + * Return to application + */ + return (ARM_MATH_SUCCESS); +} + + +arm_status arm_mat_mult_opt_q31( + const arm_matrix_instance_q31 * pSrcA, + const arm_matrix_instance_q31 * pSrcB, + arm_matrix_instance_q31 * pDst, + q31_t *pState) +{ + q31_t *pInA = pSrcA->pData; /* input data matrix pointer A */ + q31_t *pInB = pSrcB->pData; /* input data matrix pointer B */ + q31_t *pInA2; + q31_t *pInB2; + q31_t *px; /* Temporary output data matrix pointer */ + q31_t *px2; /* Temporary output data matrix pointer */ + uint32_t numRowsA = pSrcA->numRows; /* number of rows of input matrix A */ + uint32_t numColsB = pSrcB->numCols; /* number of columns of input matrix B */ + uint32_t numColsA = pSrcA->numCols; /* number of columns of input matrix A */ + uint32_t numRowsB = pSrcB->numRows; /* number of rows of input matrix A */ + uint32_t col, i = 0u, j, row = numRowsB; /* loop counters */ + q31_t *pSrcBT = pState; /* input data matrix pointer for transpose */ + uint32_t blkCnt; /* loop counters */ + arm_status status; /* Status of matrix multiplication */ + arm_matrix_instance_q31 BT; +#ifdef ARM_MATH_MATRIX_CHECK + + /* Check for matrix mismatch condition */ + if ((pSrcA->numCols != pSrcB->numRows) || + (pSrcA->numRows != pDst->numRows) || (pSrcB->numCols != pDst->numCols)) { + /* Set status as ARM_MATH_SIZE_MISMATCH */ + status = ARM_MATH_SIZE_MISMATCH; + } else +#endif /* #ifdef ARM_MATH_MATRIX_CHECK */ + { + + /* small squared matrix specialized routines */ + if(numRowsA == numColsB && numColsB == numColsA) { + if (numRowsA == 1) + { + q63_t sum = (q63_t) *pInA * *pInB; + pDst->pData[0] = (q31_t)(sum >> 31); + return (ARM_MATH_SUCCESS); + } + else if(numRowsA == 2) + return arm_mat_mult_opt_q31_2x2_mve(pSrcA, pSrcB, pDst); + else if(numRowsA == 3) + return arm_mat_mult_opt_q31_3x3_mve(pSrcA, pSrcB, pDst); + else if (numRowsA == 4) + return arm_mat_mult_opt_q31_4x4_mve(pSrcA, pSrcB, pDst); + } + + + /* + * Matrix transpose + */ + BT.numRows = numColsB; + BT.numCols = numRowsB; + BT.pData = pSrcBT; + + arm_mat_trans_q31(pSrcB, &BT); + + + /* + * Reset the variables for the usage in the following multiplication process + */ + i = 0; + row = numRowsA >> 1; + px = pDst->pData; + px2 = px + numColsB; + + /* + * main loop + * compute 2 x 2 output blocks + * with dot products (Matrix A rows * Transposed MAtrix B rows) + */ + while (row > 0u) { + /* + * For every row wise process, the column loop counter is to be initiated + * Compute 2 columns and 2 rows in parrallel + */ + col = numColsB >> 1; + j = 0; + + /* + * column pair loop + */ + while (col > 0u) { + q31_t const *pSrcAVec, *pSrcBVec, *pSrcA2Vec, *pSrcB2Vec; + q31x4_t vecA, vecA2, vecB, vecB2; + q63_t acc0, acc1, acc2, acc3; + + /* + * Initiate the pointers + * - 2 x consecutive Matrix A rows (i increment is 2 x numColsA) + * - 2 x consecutive Matrix B' rows (j increment is 2 x numRowsB) + */ + pInA = pSrcA->pData + i; + pInA2 = pInA + numColsA; + pInB = pSrcBT + j; + pInB2 = pInB + numRowsB; + + + pSrcAVec = (q31_t const *) pInA; + pSrcA2Vec = (q31_t const *) pInA2; + pSrcBVec = (q31_t const *) pInB; + pSrcB2Vec = (q31_t const *) pInB2; + + acc0 = 0LL; + acc1 = 0LL; + acc2 = 0LL; + acc3 = 0LL; + + /* load scheduling */ + vecA = vld1q(pSrcAVec); + pSrcAVec += 4; + + blkCnt = (numColsA / 4); + while (blkCnt > 0U) { + vecB = vld1q(pSrcBVec); + pSrcBVec += 4; + acc0 = vrmlaldavhaq(acc0, vecA, vecB); + vecA2 = vld1q(pSrcA2Vec); + pSrcA2Vec += 4; + acc1 = vrmlaldavhaq(acc1, vecA2, vecB); + vecB2 = vld1q(pSrcB2Vec); + pSrcB2Vec += 4; + acc2 = vrmlaldavhaq(acc2, vecA, vecB2); + vecA = vld1q(pSrcAVec); + pSrcAVec += 4; + acc3 = vrmlaldavhaq(acc3, vecA2, vecB2); + + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = (numColsA & 3); + if (blkCnt > 0U) { + mve_pred16_t p0 = vctp32q(blkCnt); + vecB = vld1q(pSrcBVec); + acc0 = vrmlaldavhaq_p(acc0, vecA, vecB, p0); + vecA2 = vld1q(pSrcA2Vec); + acc1 = vrmlaldavhaq_p(acc1, vecA2, vecB, p0); + vecB2 = vld1q(pSrcB2Vec); + acc2 = vrmlaldavhaq_p(acc2, vecA, vecB2, p0); + vecA = vld1q(pSrcAVec); + acc3 = vrmlaldavhaq_p(acc3, vecA2, vecB2, p0); + } + + /* Convert to 1.31 */ + acc0 = asrl(acc0, 23); + acc1 = asrl(acc1, 23); + acc2 = asrl(acc2, 23); + acc3 = asrl(acc3, 23); + + /* Store the results (2 x 2 block) in the destination buffer */ + *px++ = (q31_t) acc0; + *px++ = (q31_t) acc2; + *px2++ = (q31_t) acc1; + *px2++ = (q31_t) acc3; + + j += numRowsB * 2; + /* + * Decrement the column pair loop counter + */ + col--; + + } + + i = i + numColsA * 2; + px = px2 + (numColsB & 1u); + px2 = px + numColsB; + /* + * Decrement the row pair loop counter + */ + row--; + } + + /* + * Compute remaining row and/or column below + */ + if (numColsB & 1u) { + row = numRowsA & (~0x1); //avoid redundant computation + px = pDst->pData + numColsB - 1; + i = 0; + + /* + * row loop + */ + while (row > 0) { + q31_t const *pSrcAVec, *pSrcBVec; + q31x4_t vecA, vecB; + q63_t acc0; + + /* + * point to last column in matrix B + */ + pInB = pSrcBT + numRowsB * (numColsB - 1); + pInA = pSrcA->pData + i; + + pSrcAVec = (q31_t const *) pInA; + pSrcBVec = (q31_t const *) pInB; + + /* single dot-product */ + acc0 = 0LL; + blkCnt = (numColsA / 4); + while (blkCnt > 0U) { + vecA = vld1q(pSrcAVec); + pSrcAVec += 4; + vecB = vld1q(pSrcBVec); + pSrcBVec += 4; + acc0 = vrmlaldavhaq(acc0, vecA, vecB); + + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = (numColsA & 3); + if (blkCnt > 0U) { + mve_pred16_t p0 = vctp32q(blkCnt); + vecA = vld1q(pSrcAVec); + vecB = vld1q(pSrcBVec); + acc0 = vrmlaldavhaq_p(acc0, vecA, vecB, p0); + } + + acc0 = asrl(acc0, 23); + *px = (q31_t) acc0; + + px += numColsB; + + i += numColsA; + /* + * Decrement the row loop counter + */ + row--; + } + } + + if (numRowsA & 1u) { + col = numColsB; + i = 0u; + /* + * point to last row in output matrix + */ + px = pDst->pData + (numColsB) * (numRowsA - 1); + /* + * col loop + */ + while (col > 0) { + q31_t const *pSrcAVec, *pSrcBVec; + q31x4_t vecA, vecB; + q63_t acc0; + + /* + * point to last row in matrix A + */ + pInA = pSrcA->pData + (numRowsA - 1) * numColsA; + pInB = pSrcBT + i; + + /* + * Set the variable sum, that acts as accumulator, to zero + */ + pSrcAVec = (q31_t const *) pInA; + pSrcBVec = (q31_t const *) pInB; + acc0 = 0LL; + + blkCnt = (numColsA / 4); + while (blkCnt > 0U) { + vecA = vld1q(pSrcAVec); + pSrcAVec += 4; + vecB = vld1q(pSrcBVec); + pSrcBVec += 4; + acc0 = vrmlaldavhaq(acc0, vecA, vecB); + + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = (numColsA & 3); + if (blkCnt > 0U) { + mve_pred16_t p0 = vctp32q(blkCnt); + vecA = vld1q(pSrcAVec); + vecB = vld1q(pSrcBVec); + acc0 = vrmlaldavhaq_p(acc0, vecA, vecB, p0); + } + + acc0 = asrl(acc0, 23); + *px++ = (q31_t) acc0; + + i += numColsA; + /* + * Decrement the col loop counter + */ + col--; + } + } + /* Set status as ARM_MATH_SUCCESS */ + status = ARM_MATH_SUCCESS; + } + /* + * Return to application + */ + return (status); +} + +#else +arm_status arm_mat_mult_opt_q31( + const arm_matrix_instance_q31 * pSrcA, + const arm_matrix_instance_q31 * pSrcB, + arm_matrix_instance_q31 * pDst, + q31_t *pState) +{ + q31_t *pIn1 = pSrcA->pData; /* Input data matrix pointer A */ + q31_t *pIn2 = pSrcB->pData; /* Input data matrix pointer B */ + q31_t *pInA = pSrcA->pData; /* Input data matrix pointer A */ + q31_t *pInB = pSrcB->pData; /* Input data matrix pointer B */ + q31_t *pOut = pDst->pData; /* Output data matrix pointer */ + q31_t *px; /* Temporary output data matrix pointer */ + q63_t sum; /* Accumulator */ + uint16_t numRowsA = pSrcA->numRows; /* Number of rows of input matrix A */ + uint16_t numColsB = pSrcB->numCols; /* Number of columns of input matrix B */ + uint16_t numColsA = pSrcA->numCols; /* Number of columns of input matrix A */ + uint32_t col, i = 0U, row = numRowsA, colCnt; /* Loop counters */ + arm_status status; /* Status of matrix multiplication */ + (void)pState; +#ifdef ARM_MATH_MATRIX_CHECK + + /* Check for matrix mismatch condition */ + if ((pSrcA->numCols != pSrcB->numRows) || + (pSrcA->numRows != pDst->numRows) || + (pSrcB->numCols != pDst->numCols) ) + { + /* Set status as ARM_MATH_SIZE_MISMATCH */ + status = ARM_MATH_SIZE_MISMATCH; + } + else + +#endif /* #ifdef ARM_MATH_MATRIX_CHECK */ + + { + /* The following loop performs the dot-product of each row in pSrcA with each column in pSrcB */ + /* row loop */ + do + { + /* Output pointer is set to starting address of row being processed */ + px = pOut + i; + + /* For every row wise process, column loop counter is to be initiated */ + col = numColsB; + + /* For every row wise process, pIn2 pointer is set to starting address of pSrcB data */ + pIn2 = pSrcB->pData; + + /* column loop */ + do + { + /* Set the variable sum, that acts as accumulator, to zero */ + sum = 0; + + /* Initialize pointer pIn1 to point to starting address of column being processed */ + pIn1 = pInA; + +#if defined (ARM_MATH_LOOPUNROLL) + + /* Loop unrolling: Compute 4 MACs at a time. */ + colCnt = numColsA >> 2U; + + /* matrix multiplication */ + while (colCnt > 0U) + { + /* c(m,n) = a(1,1) * b(1,1) + a(1,2) * b(2,1) + .... + a(m,p) * b(p,n) */ + + /* Perform the multiply-accumulates */ + sum += (q63_t) *pIn1++ * *pIn2; + pIn2 += numColsB; + + sum += (q63_t) *pIn1++ * *pIn2; + pIn2 += numColsB; + + sum += (q63_t) *pIn1++ * *pIn2; + pIn2 += numColsB; + + sum += (q63_t) *pIn1++ * *pIn2; + pIn2 += numColsB; + + /* Decrement loop counter */ + colCnt--; + } + + /* Loop unrolling: Compute remaining MACs */ + colCnt = numColsA % 0x4U; + +#else + + /* Initialize cntCnt with number of columns */ + colCnt = numColsA; + +#endif /* #if defined (ARM_MATH_LOOPUNROLL) */ + + while (colCnt > 0U) + { + /* c(m,n) = a(1,1) * b(1,1) + a(1,2) * b(2,1) + .... + a(m,p) * b(p,n) */ + + /* Perform the multiply-accumulates */ + sum += (q63_t) *pIn1++ * *pIn2; + pIn2 += numColsB; + + /* Decrement loop counter */ + colCnt--; + } + + /* Convert result from 2.62 to 1.31 format and store in destination buffer */ + *px++ = (q31_t) (sum >> 31); + + /* Decrement column loop counter */ + col--; + + /* Update pointer pIn2 to point to starting address of next column */ + pIn2 = pInB + (numColsB - col); + + } while (col > 0U); + + /* Update pointer pInA to point to starting address of next row */ + i = i + numColsB; + pInA = pInA + numColsA; + + /* Decrement row loop counter */ + row--; + + } while (row > 0U); + + /* Set status as ARM_MATH_SUCCESS */ + status = ARM_MATH_SUCCESS; + } + + /* Return to application */ + return (status); +} +#endif /* defined(ARM_MATH_MVEI) */ + +/** + @} end of MatrixMult group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_q15.c index 612ad92..026a993 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_q15.c @@ -5,13 +5,13 @@ * Title: arm_mat_mult_q15.c * Description: Q15 matrix multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 3 Nov 2021 + * $Revision: V1.10.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -44,7 +44,7 @@ @param[in] pSrcA points to the first input matrix structure @param[in] pSrcB points to the second input matrix structure @param[out] pDst points to output matrix structure - @param[in] pState points to the array for storing intermediate results (Unused) + @param[in] pState points to the array for storing intermediate results @return execution status - \ref ARM_MATH_SUCCESS : Operation successful - \ref ARM_MATH_SIZE_MISMATCH : Matrix size check failed @@ -317,282 +317,309 @@ __STATIC_INLINE arm_status arm_mat_mult_q15_4x4_mve( return (ARM_MATH_SUCCESS); } + arm_status arm_mat_mult_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst, - q15_t * pState) + const arm_matrix_instance_q15 * pSrcA, + const arm_matrix_instance_q15 * pSrcB, + arm_matrix_instance_q15 * pDst, + q15_t * pState) { - q15_t *pInB = pSrcB->pData; /* input data matrix pointer B */ - q15_t *pInA = pSrcA->pData; /* input data matrix pointer A */ - q15_t *pOut = pDst->pData; /* output data matrix pointer */ - q15_t *px; /* Temporary output data matrix pointer */ - uint16_t numRowsA = pSrcA->numRows; /* number of rows of input matrix A */ - uint16_t numColsB = pSrcB->numCols; /* number of columns of input matrix B */ - uint16_t numColsA = pSrcA->numCols; /* number of columns of input matrix A */ - uint16_t col, i = 0U, row = numRowsA, colCnt; /* loop counters */ - uint16x8_t vecOffs, vecColBOffs; - uint32_t blkCnt,rowCnt; /* loop counters */ - arm_status status; /* Status of matrix multiplication */ - (void)pState; + q15_t *pInA = pSrcA->pData; /* input data matrix pointer A */ + q15_t *pInB = pSrcB->pData; /* input data matrix pointer B */ + q15_t *pInA2; + q15_t *pInB2; + q15_t *px; /* Temporary output data matrix pointer */ + q15_t *px2; /* Temporary output data matrix pointer */ + uint32_t numRowsA = pSrcA->numRows; /* number of rows of input matrix A */ + uint32_t numColsB = pSrcB->numCols; /* number of columns of input matrix B */ + uint32_t numColsA = pSrcA->numCols; /* number of columns of input matrix A */ + uint32_t numRowsB = pSrcB->numRows; /* number of rows of input matrix A */ + uint32_t col, i = 0u, j, row = numRowsB; /* loop counters */ + q15_t *pSrcBT = pState; /* input data matrix pointer for transpose */ + uint32_t blkCnt; /* loop counters */ + arm_status status; /* Status of matrix multiplication */ + arm_matrix_instance_q15 BT; #ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((pSrcA->numCols != pSrcB->numRows) || + /* Check for matrix mismatch condition */ + if ((pSrcA->numCols != pSrcB->numRows) || (pSrcA->numRows != pDst->numRows) || (pSrcB->numCols != pDst->numCols) ) - { - /* Set status as ARM_MATH_SIZE_MISMATCH */ - status = ARM_MATH_SIZE_MISMATCH; - } - else -#endif - { - /* small squared matrix specialized routines */ - if(numRowsA == numColsB && numColsB == numColsA) { - - if (numRowsA == 1) - { - q63_t sum; - sum = pInA[0] * pInB[0]; - pOut[0] = (q15_t) __SSAT((sum >> 15), 16); - return (ARM_MATH_SUCCESS); - } - else if(numRowsA == 2) - return arm_mat_mult_q15_2x2_mve(pSrcA, pSrcB, pDst); - else if(numRowsA == 3) - return arm_mat_mult_q15_3x3_mve(pSrcA, pSrcB, pDst); - else if (numRowsA == 4) - return arm_mat_mult_q15_4x4_mve(pSrcA, pSrcB, pDst); + { + /* Set status as ARM_MATH_SIZE_MISMATCH */ + status = ARM_MATH_SIZE_MISMATCH; } - - vecColBOffs = vidupq_u16((uint32_t)0, 1); - vecColBOffs = vecColBOffs * (uint16_t) (numColsB); - - /* - * The following loop performs the dot-product of each row in pSrcA with each column in pSrcB - */ - - /* - * row loop - */ - rowCnt = row >> 2; - while (rowCnt > 0U) + else +#endif { + /* small squared matrix specialized routines */ + if (numRowsA == numColsB && numColsB == numColsA) { + + if (numRowsA == 1) { + q63_t sum; + sum = pInA[0] * pInB[0]; + pDst->pData[0] = (q15_t) __SSAT((sum >> 15), 16); + return (ARM_MATH_SUCCESS); + } else if (numRowsA == 2) + return arm_mat_mult_q15_2x2_mve(pSrcA, pSrcB, pDst); + else if (numRowsA == 3) + return arm_mat_mult_q15_3x3_mve(pSrcA, pSrcB, pDst); + else if (numRowsA == 4) + return arm_mat_mult_q15_4x4_mve(pSrcA, pSrcB, pDst); + } + /* - * Output pointer is set to starting address of the row being processed + * Matrix transpose */ - px = pOut + i; - i = i + 4 * numColsB; + + BT.numRows = numColsB; + BT.numCols = numRowsB; + BT.pData = pSrcBT; + + arm_mat_trans_q15(pSrcB, &BT); + + /* - * For every row wise process, the column loop counter is to be initiated + * Reset the variables for the usage in the following multiplication process */ - col = numColsB; + i = 0; + row = numRowsA >> 1; + px = pDst->pData; + px2 = px + numColsB; + /* - * For every row wise process, the pInB pointer is set - * to the starting address of the pSrcB data + * The following loop performs the dot-product of each row in pSrcA with each column in pSrcB */ - pInB = pSrcB->pData; + /* - * column loop + * row loop */ - while (col > 0U) - { + while (row > 0u) { /* - * generate 4 columns elements + * For every row wise process, the column loop counter is to be initiated */ + col = numColsB >> 1; /* - * Matrix A columns number of MAC operations are to be performed + * For every row wise process, the pIn2 pointer is set + * to the starting address of the transposed pSrcB data */ - colCnt = numColsA; - - q15_t const *pSrcA0Vec, *pSrcA1Vec, *pSrcA2Vec, *pSrcA3Vec; - q15_t *pInA0 = pInA; - q15_t *pInA1 = pInA0 + numColsA; - q15_t *pInA2 = pInA1 + numColsA; - q15_t *pInA3 = pInA2 + numColsA; - q63_t acc0, acc1, acc2, acc3; - - acc0 = 0LL; - acc1 = 0LL; - acc2 = 0LL; - acc3 = 0LL; - - pSrcA0Vec = (q15_t const *) pInA0; - pSrcA1Vec = (q15_t const *) pInA1; - pSrcA2Vec = (q15_t const *) pInA2; - pSrcA3Vec = (q15_t const *) pInA3; - - vecOffs = vecColBOffs; - - blkCnt = (numColsA) >> 3; - while (blkCnt > 0U) - { - q15x8_t vecB, vecA; - - vecB = vldrhq_gather_shifted_offset((int16_t const *)pInB, vecOffs); - vecOffs = vecOffs + (uint16_t) (numColsB * 8); - - vecA = vld1q(pSrcA0Vec); pSrcA0Vec += 8; - acc0 = vmlaldavaq(acc0, vecA, vecB); - vecA = vld1q(pSrcA1Vec); pSrcA1Vec += 8; - acc1 = vmlaldavaq(acc1, vecA, vecB); - vecA = vld1q(pSrcA2Vec); pSrcA2Vec += 8; - acc2 = vmlaldavaq(acc2, vecA, vecB); - vecA = vld1q(pSrcA3Vec); pSrcA3Vec += 8; - acc3 = vmlaldavaq(acc3, vecA, vecB); - blkCnt--; + pInB = pSrcBT; + pInB2 = pInB + numRowsB; + j = 0; - } /* - * tail + * column loop */ - blkCnt = numColsA & 7; - if (blkCnt > 0U) - { - mve_pred16_t p0 = vctp16q(blkCnt); - q15x8_t vecB, vecA; - - vecB = vldrhq_gather_shifted_offset((int16_t const *)pInB, vecOffs); - vecOffs = vecOffs + (uint16_t) (numColsB * 8); - - vecA = vld1q(pSrcA0Vec); - acc0 = vmlaldavaq_p(acc0, vecA, vecB, p0); - vecA = vld1q(pSrcA1Vec); - acc1 = vmlaldavaq_p(acc1, vecA, vecB, p0); - vecA = vld1q(pSrcA2Vec); - acc2 = vmlaldavaq_p(acc2, vecA, vecB, p0); - vecA = vld1q(pSrcA3Vec); - acc3 = vmlaldavaq_p(acc3, vecA, vecB, p0); + while (col > 0u) { + q15_t const *pSrcAVec, *pSrcBVec, *pSrcA2Vec, *pSrcB2Vec; + q15x8_t vecA, vecA2, vecB, vecB2; + q63_t acc0, acc1, acc2, acc3; + + /* + * Initiate the pointer pIn1 to point to the starting address of the column being processed + */ + pInA = pSrcA->pData + i; + pInA2 = pInA + numColsA; + pInB = pSrcBT + j; + pInB2 = pInB + numRowsB; + + + pSrcAVec = (q15_t const *) pInA; + pSrcA2Vec = (q15_t const *) pInA2; + pSrcBVec = (q15_t const *) pInB; + pSrcB2Vec = (q15_t const *) pInB2; + + acc0 = 0LL; + acc1 = 0LL; + acc2 = 0LL; + acc3 = 0LL; + + vecA = vld1q(pSrcAVec); + pSrcAVec += 8; + + blkCnt = numColsA / 8; + while (blkCnt > 0U) { + vecB = vld1q(pSrcBVec); + pSrcBVec += 8; + acc0 = vmlaldavaq(acc0, vecA, vecB); + vecA2 = vld1q(pSrcA2Vec); + pSrcA2Vec += 8; + acc1 = vmlaldavaq(acc1, vecA2, vecB); + vecB2 = vld1q(pSrcB2Vec); + pSrcB2Vec += 8; + acc2 = vmlaldavaq(acc2, vecA, vecB2); + vecA = vld1q(pSrcAVec); + pSrcAVec += 8; + acc3 = vmlaldavaq(acc3, vecA2, vecB2); + + blkCnt--; + } + /* + * tail + */ + blkCnt = numColsA & 7; + if (blkCnt > 0U) { + mve_pred16_t p0 = vctp16q(blkCnt); + vecB = vld1q(pSrcBVec); + acc0 = vmlaldavaq_p(acc0, vecA, vecB, p0); + vecA2 = vld1q(pSrcA2Vec); + acc1 = vmlaldavaq_p(acc1, vecA2, vecB, p0); + vecB2 = vld1q(pSrcB2Vec); + acc2 = vmlaldavaq_p(acc2, vecA, vecB2, p0); + vecA = vld1q(pSrcAVec); + acc3 = vmlaldavaq_p(acc3, vecA2, vecB2, p0); + } + + *px++ = (q15_t) MVE_ASRL_SAT16(acc0, 15); + *px++ = (q15_t) MVE_ASRL_SAT16(acc2, 15); + *px2++ = (q15_t) MVE_ASRL_SAT16(acc1, 15); + *px2++ = (q15_t) MVE_ASRL_SAT16(acc3, 15); + j += numRowsB * 2; + /* + * Decrement the column loop counter + */ + col--; + } - px[0] = (q15_t)MVE_ASRL_SAT16(acc0, 15); - px[1 * numColsB] = (q15_t)MVE_ASRL_SAT16(acc1, 15); - px[2 * numColsB] = (q15_t)MVE_ASRL_SAT16(acc2, 15); - px[3 * numColsB] = (q15_t)MVE_ASRL_SAT16(acc3, 15); - px++; - /* - * Decrement the column loop counter - */ - col--; + i = i + numColsA * 2; + px = px2 + (numColsB & 1u); + px2 = px + numColsB; /* - * Update the pointer pInB to point to the starting address of the next column + * Decrement the row loop counter */ - pInB = pSrcB->pData + (numColsB - col); + row--; } /* - * Update the pointer pInA to point to the starting address of the next row - */ - pInA += (numColsA * 4); - /* - * Decrement the row loop counter - */ - rowCnt --; - - } - - rowCnt = row & 3; - while (rowCnt > 0U) - { - /* - * Output pointer is set to starting address of the row being processed - */ - px = pOut + i; - i = i + numColsB; - /* - * For every row wise process, the column loop counter is to be initiated + * Compute remaining row and/or column below */ - col = numColsB; - /* - * For every row wise process, the pInB pointer is set - * to the starting address of the pSrcB data - */ - pInB = pSrcB->pData; - /* - * column loop - */ - while (col > 0U) - { - /* - * generate 4 columns elements - */ - /* - * Matrix A columns number of MAC operations are to be performed - */ - colCnt = numColsA; - - q15_t const *pSrcA0Vec; - q15_t *pInA0 = pInA; - q63_t acc0; - - acc0 = 0LL; - - pSrcA0Vec = (q15_t const *) pInA0; - - vecOffs = vecColBOffs; - - blkCnt = (numColsA) >> 3; - while (blkCnt > 0U) - { - q15x8_t vecB, vecA; - vecB = vldrhq_gather_shifted_offset((int16_t const *)pInB, vecOffs); - vecOffs = vecOffs + (uint16_t) (numColsB * 8); + if (numColsB & 1u) { + row = numRowsA & (~0x1); //avoid redundant computation + px = pDst->pData + numColsB - 1; + i = 0; - vecA = vld1q(pSrcA0Vec); - pSrcA0Vec += 8; - acc0 = vmlaldavaq(acc0, vecA, vecB); - - blkCnt--; - - } /* - * tail + * row loop */ - blkCnt = numColsA & 7; - if (blkCnt > 0U) - { - mve_pred16_t p0 = vctp16q(blkCnt); - q15x8_t vecB, vecA; - - vecB = vldrhq_gather_shifted_offset((int16_t const *)pInB, vecOffs); - vecOffs = vecOffs + (uint16_t) (numColsB * 8); - - vecA = vld1q(pSrcA0Vec); - acc0 = vmlaldavaq_p(acc0, vecA, vecB, p0); - + while (row > 0) { + q15_t const *pSrcAVec, *pSrcBVec; + q15x8_t vecA, vecB; + q63_t acc0; + + /* + * point to last column in matrix B + */ + pInB = pSrcBT + numRowsB * (numColsB - 1); + pInA = pSrcA->pData + i; + + pSrcAVec = (q15_t const *) pInA; + pSrcBVec = (q15_t const *) pInB; + + acc0 = 0LL; + blkCnt = (numColsA) / 8; + while (blkCnt > 0U) { + vecA = vld1q(pSrcAVec); + pSrcAVec += 8; + vecB = vld1q(pSrcBVec); + pSrcBVec += 8; + acc0 = vmlaldavaq(acc0, vecA, vecB); + + blkCnt--; + } + /* + * tail + */ + blkCnt = (numColsA & 7); + if (blkCnt > 0U) { + mve_pred16_t p0 = vctp16q(blkCnt); + vecA = vld1q(pSrcAVec); + vecB = vld1q(pSrcBVec); + acc0 = vmlaldavaq_p(acc0, vecA, vecB, p0); + } + + *px = (q15_t) MVE_ASRL_SAT16(acc0, 15); + + px += numColsB; + + i += numColsA; + /* + * Decrement the row loop counter + */ + row--; } + } - px[0] = (q15_t)MVE_ASRL_SAT16(acc0, 15); - - px++; + if (numRowsA & 1u) { + col = numColsB; + i = 0u; /* - * Decrement the column loop counter + * point to last row in output matrix */ - col--; + px = pDst->pData + (numColsB) * (numRowsA - 1); /* - * Update the pointer pInB to point to the starting address of the next column + * col loop */ - pInB = pSrcB->pData + (numColsB - col); + while (col > 0) { + q15_t const *pSrcAVec, *pSrcBVec; + q15x8_t vecA, vecB; + q63_t acc0; + + /* + * point to last row in matrix A + */ + pInA = pSrcA->pData + (numRowsA - 1) * numColsA; + pInB = pSrcBT + i; + + /* + * Set the variable sum, that acts as accumulator, to zero + */ + pSrcAVec = (q15_t const *) pInA; + pSrcBVec = (q15_t const *) pInB; + acc0 = 0LL; + + blkCnt = ((numColsA) / 8); + while (blkCnt > 0U) { + vecA = vld1q(pSrcAVec); + pSrcAVec += 8; + vecB = vld1q(pSrcBVec); + pSrcBVec += 8; + acc0 = vmlaldavaq(acc0, vecA, vecB); + + blkCnt--; + } + /* + * tail + */ + blkCnt = (numColsA & 7); + if (blkCnt > 0U) { + mve_pred16_t p0 = vctp16q(blkCnt); + vecA = vld1q(pSrcAVec); + vecB = vld1q(pSrcBVec); + acc0 = vmlaldavaq_p(acc0, vecA, vecB, p0); + } + + *px++ = (q15_t) MVE_ASRL_SAT16(acc0, 15); + + i += numColsA; + + /* + * Decrement the col loop counter + */ + col--; + } } - /* - * Update the pointer pInA to point to the starting address of the next row - */ - pInA += (numColsA ); - rowCnt--; + /* Set status as ARM_MATH_SUCCESS */ + status = ARM_MATH_SUCCESS; } - /* Set status as ARM_MATH_SUCCESS */ - status = ARM_MATH_SUCCESS; - } - - /* Return to application */ - return (status); - + /* Return to application */ + return (status); } -#else + +#else arm_status arm_mat_mult_q15( const arm_matrix_instance_q15 * pSrcA, const arm_matrix_instance_q15 * pSrcB, @@ -610,12 +637,12 @@ arm_status arm_mat_mult_q15( uint16_t numRowsA = pSrcA->numRows; /* Number of rows of input matrix A */ uint16_t numColsB = pSrcB->numCols; /* Number of columns of input matrix B */ uint16_t numColsA = pSrcA->numCols; /* Number of columns of input matrix A */ - uint16_t numRowsB = pSrcB->numRows; /* Number of rows of input matrix A */ + uint16_t numRowsB = pSrcB->numRows; /* Number of rows of input matrix B */ uint32_t col, i = 0U, row = numRowsB, colCnt; /* Loop counters */ arm_status status; /* Status of matrix multiplication */ - - q31_t in; /* Temporary variable to hold the input value */ + q31_t inA1, inB1, inA2, inB2; + arm_matrix_instance_q15 BT; #ifdef ARM_MATH_MATRIX_CHECK @@ -630,89 +657,13 @@ arm_status arm_mat_mult_q15( else #endif /* #ifdef ARM_MATH_MATRIX_CHECK */ - { - /* Matrix transpose */ - do - { - /* The pointer px is set to starting address of column being processed */ - px = pSrcBT + i; - - /* Apply loop unrolling and exchange columns with row elements */ - col = numColsB >> 2U; - - /* First part of the processing with loop unrolling. Compute 4 outputs at a time. - ** a second loop below computes the remaining 1 to 3 samples. */ - while (col > 0U) - { - /* Read two elements from row */ - in = read_q15x2_ia ((q15_t **) &pInB); - - /* Unpack and store one element in destination */ -#ifndef ARM_MATH_BIG_ENDIAN - *px = (q15_t) in; -#else - *px = (q15_t) ((in & (q31_t) 0xffff0000) >> 16); -#endif /* #ifndef ARM_MATH_BIG_ENDIAN */ - - /* Update pointer px to point to next row of transposed matrix */ - px += numRowsB; - - /* Unpack and store second element in destination */ -#ifndef ARM_MATH_BIG_ENDIAN - *px = (q15_t) ((in & (q31_t) 0xffff0000) >> 16); -#else - *px = (q15_t) in; -#endif /* #ifndef ARM_MATH_BIG_ENDIAN */ - - /* Update pointer px to point to next row of transposed matrix */ - px += numRowsB; - - /* Read two elements from row */ - in = read_q15x2_ia ((q15_t **) &pInB); - - /* Unpack and store one element in destination */ -#ifndef ARM_MATH_BIG_ENDIAN - *px = (q15_t) in; -#else - *px = (q15_t) ((in & (q31_t) 0xffff0000) >> 16); -#endif /* #ifndef ARM_MATH_BIG_ENDIAN */ - px += numRowsB; - -#ifndef ARM_MATH_BIG_ENDIAN - *px = (q15_t) ((in & (q31_t) 0xffff0000) >> 16); -#else - *px = (q15_t) in; -#endif /* #ifndef ARM_MATH_BIG_ENDIAN */ - px += numRowsB; - - /* Decrement column loop counter */ - col--; - } - /* If the columns of pSrcB is not a multiple of 4, compute any remaining output samples here. - ** No loop unrolling is used. */ - col = numColsB % 0x4U; - - while (col > 0U) - { - /* Read and store input element in destination */ - *px = *pInB++; - - /* Update pointer px to point to next row of transposed matrix */ - px += numRowsB; - - /* Decrement column loop counter */ - col--; - } - - i++; - - /* Decrement row loop counter */ - row--; - - } while (row > 0U); + BT.numRows = numColsB; + BT.numCols = numRowsB; + BT.pData = pSrcBT; + arm_mat_trans_q15(pSrcB,&BT); /* Reset variables for usage in following multiplication process */ row = numRowsA; i = 0U; @@ -746,13 +697,13 @@ arm_status arm_mat_mult_q15( /* c(m,n) = a(1,1) * b(1,1) + a(1,2) * b(2,1) + .... + a(m,p) * b(p,n) */ /* read real and imag values from pSrcA and pSrcB buffer */ - inA1 = read_q15x2_ia ((q15_t **) &pInA); - inB1 = read_q15x2_ia ((q15_t **) &pInB); + inA1 = read_q15x2_ia (&pInA); + inB1 = read_q15x2_ia (&pInB); - inA2 = read_q15x2_ia ((q15_t **) &pInA); - inB2 = read_q15x2_ia ((q15_t **) &pInB); + inA2 = read_q15x2_ia (&pInA); + inB2 = read_q15x2_ia (&pInB); - /* Multiply and Accumlates */ + /* Multiply and Accumulates */ sum = __SMLALD(inA1, inB1, sum); sum = __SMLALD(inA2, inB2, sum); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_q31.c index 54f1c09..252eebf 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_q31.c @@ -5,13 +5,13 @@ * Title: arm_mat_mult_q31.c * Description: Q31 matrix multiplication * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -346,7 +346,7 @@ arm_status arm_mat_mult_q31( uint16_t numRowsA = pSrcA->numRows; /* number of rows of input matrix A */ uint16_t numColsB = pSrcB->numCols; /* number of columns of input matrix B */ uint16_t numColsA = pSrcA->numCols; /* number of columns of input matrix A */ - uint16_t col, i = 0U, row = numRowsA, colCnt; /* loop counters */ + uint16_t col, i = 0U, row = numRowsA; /* loop counters */ arm_status status; /* status of matrix multiplication */ uint32x4_t vecOffs, vecColBOffs; uint32_t blkCnt, rowCnt; /* loop counters */ @@ -420,7 +420,6 @@ arm_status arm_mat_mult_q31( /* * Matrix A columns number of MAC operations are to be performed */ - colCnt = numColsA; q31_t const *pSrcA0Vec, *pSrcA1Vec, *pSrcA2Vec, *pSrcA3Vec; q31_t const *pInA0 = pInA; @@ -543,7 +542,6 @@ arm_status arm_mat_mult_q31( /* * Matrix A columns number of MAC operations are to be performed */ - colCnt = numColsA; q31_t const *pSrcA0Vec; q31_t const *pInA0 = pInA; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_q7.c index 79334e9..e9541fa 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_mult_q7.c @@ -5,12 +5,14 @@ * Title: arm_mat_mult_q7.c * Description: Q15 matrix multiplication * - * $Date: 06. July 2020 + * $Date: 23 April 2021 * - * Target Processor: Cortex-M cores + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_qr_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_qr_f16.c new file mode 100644 index 0000000..1e04295 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_qr_f16.c @@ -0,0 +1,784 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mat_qr_f16.c + * Description: Half floating-point matrix QR decomposition. + * + * $Date: 15 June 2022 + * $Revision: V1.11.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions_f16.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h" + + +#if !defined(ARM_MATH_AUTOVECTORIZE) +#if defined(ARM_MATH_MVE_FLOAT16) +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" +#endif +#endif + +/** + @ingroup groupMatrix + */ + + +/** + @addtogroup MatrixQR + @{ + */ + +/** + @brief QR decomposition of a m x n half floating point matrix with m >= n. + @param[in] pSrc points to input matrix structure. The source matrix is modified by the function. + @param[in] threshold norm2 threshold. + @param[out] pOutR points to output R matrix structure of dimension m x n + @param[out] pOutQ points to output Q matrix structure of dimension m x m (can be NULL) + @param[out] pOutTau points to Householder scaling factors of dimension n + @param[inout] pTmpA points to a temporary vector of dimension m. + @param[inout] pTmpB points to a temporary vector of dimension m. + @return execution status + - \ref ARM_MATH_SUCCESS : Operation successful + - \ref ARM_MATH_SIZE_MISMATCH : Matrix size check failed + + @par pOutQ is optional: + pOutQ can be a NULL pointer. + In this case, the argument will be ignored + and the output Q matrix won't be computed. + + @par f16 implementation + The f16 implementation is not very accurate. + + @par Norm2 threshold + For the meaning of this argument please + refer to the \ref MatrixHouseholder documentation + + */ + +#if !defined(ARM_MATH_AUTOVECTORIZE) +#if defined(ARM_MATH_MVE_FLOAT16) + +arm_status arm_mat_qr_f16( + const arm_matrix_instance_f16 * pSrc, + const float16_t threshold, + arm_matrix_instance_f16 * pOutR, + arm_matrix_instance_f16 * pOutQ, + float16_t * pOutTau, + float16_t *pTmpA, + float16_t *pTmpB + ) + +{ + int32_t col=0; + int32_t nb,pos; + float16_t *pa,*pc; + float16_t beta; + float16_t *pv; + float16_t *pdst; + float16_t *p; + + if (pSrc->numRows < pSrc->numCols) + { + return(ARM_MATH_SIZE_MISMATCH); + } + + memcpy(pOutR->pData,pSrc->pData,pSrc->numCols * pSrc->numRows*sizeof(float16_t)); + pOutR->numCols = pSrc->numCols; + pOutR->numRows = pSrc->numRows; + + p = pOutR->pData; + + pc = pOutTau; + for(col=0 ; col < pSrc->numCols; col++) + { + int32_t j,k,blkCnt,blkCnt2; + float16_t *pa0,*pa1,*pa2,*pa3,*ptemp; + float16_t temp; + float16x8_t v1,v2,vtemp; + + COPY_COL_F16(pOutR,col,col,pTmpA); + + beta = arm_householder_f16(pTmpA,threshold,pSrc->numRows - col,pTmpA); + *pc++ = beta; + + pdst = pTmpB; + + /* v.T A(col:,col:) -> tmpb */ + pv = pTmpA; + pa = p; + + temp = *pv; + blkCnt = (pSrc->numCols-col) >> 3; + while (blkCnt > 0) + { + v1 = vld1q_f16(pa); + v2 = vmulq_n_f16(v1,temp); + vst1q_f16(pdst,v2); + + pa += 8; + pdst += 8; + blkCnt--; + } + blkCnt = (pSrc->numCols-col) & 7; + if (blkCnt > 0) + { + mve_pred16_t p0 = vctp16q(blkCnt); + v1 = vld1q_f16(pa); + v2 = vmulq_n_f16(v1,temp); + vst1q_p_f16(pdst,v2,p0); + + pa += blkCnt; + } + + pa += col; + pv++; + pdst = pTmpB; + + pa0 = pa; + pa1 = pa0 + pSrc->numCols; + pa2 = pa1 + pSrc->numCols; + pa3 = pa2 + pSrc->numCols; + + /* Unrolled loop */ + blkCnt = (pSrc->numRows-col - 1) >> 2; + k=1; + while(blkCnt > 0) + { + vtemp=vld1q_f16(pv); + + blkCnt2 = (pSrc->numCols-col) >> 3; + while (blkCnt2 > 0) + { + v1 = vld1q_f16(pdst); + + v2 = vld1q_f16(pa0); + v1 = vfmaq_n_f16(v1,v2,vgetq_lane(vtemp,0)); + + v2 = vld1q_f16(pa1); + v1 = vfmaq_n_f16(v1,v2,vgetq_lane(vtemp,1)); + + v2 = vld1q_f16(pa2); + v1 = vfmaq_n_f16(v1,v2,vgetq_lane(vtemp,2)); + + v2 = vld1q_f16(pa3); + v1 = vfmaq_n_f16(v1,v2,vgetq_lane(vtemp,3)); + + vst1q_f16(pdst,v1); + + pdst += 8; + pa0 += 8; + pa1 += 8; + pa2 += 8; + pa3 += 8; + blkCnt2--; + } + blkCnt2 = (pSrc->numCols-col) & 7; + if (blkCnt2 > 0) + { + mve_pred16_t p0 = vctp16q(blkCnt2); + + v1 = vld1q_f16(pdst); + + v2 = vld1q_f16(pa0); + v1 = vfmaq_n_f16(v1,v2,vgetq_lane(vtemp,0)); + + v2 = vld1q_f16(pa1); + v1 = vfmaq_n_f16(v1,v2,vgetq_lane(vtemp,1)); + + v2 = vld1q_f16(pa2); + v1 = vfmaq_n_f16(v1,v2,vgetq_lane(vtemp,2)); + + v2 = vld1q_f16(pa3); + v1 = vfmaq_n_f16(v1,v2,vgetq_lane(vtemp,3)); + + vst1q_p_f16(pdst,v1,p0); + + pa0 += blkCnt2; + pa1 += blkCnt2; + pa2 += blkCnt2; + pa3 += blkCnt2; + } + + pa0 += col + 3*pSrc->numCols; + pa1 += col + 3*pSrc->numCols; + pa2 += col + 3*pSrc->numCols; + pa3 += col + 3*pSrc->numCols; + pv += 4; + pdst = pTmpB; + k += 4; + blkCnt--; + } + + pa = pa0; + for(;knumRows-col; k++) + { + temp = *pv; + blkCnt2 = (pSrc->numCols-col) >> 3; + while (blkCnt2 > 0) + { + v1 = vld1q_f16(pa); + v2 = vld1q_f16(pdst); + v2 = vfmaq_n_f16(v2,v1,temp); + vst1q_f16(pdst,v2); + + pa += 8; + pdst += 8; + blkCnt2--; + } + blkCnt2 = (pSrc->numCols-col) & 7; + if (blkCnt2 > 0) + { + mve_pred16_t p0 = vctp16q(blkCnt2); + v1 = vld1q_f16(pa); + v2 = vld1q_f16(pdst); + v2 = vfmaq_n_f16(v2,v1,temp); + vst1q_p_f16(pdst,v2,p0); + + pa += blkCnt2; + } + + pa += col; + pv++; + pdst = pTmpB; + } + + /* A(col:,col:) - beta v tmpb */ + pa = p; + for(j=0;jnumRows-col; j++) + { + float16_t f = -(_Float16)beta * (_Float16)pTmpA[j]; + ptemp = pTmpB; + + blkCnt2 = (pSrc->numCols-col) >> 3; + while (blkCnt2 > 0) + { + v1 = vld1q_f16(pa); + v2 = vld1q_f16(ptemp); + v1 = vfmaq_n_f16(v1,v2,f); + vst1q_f16(pa,v1); + + pa += 8; + ptemp += 8; + + blkCnt2--; + } + blkCnt2 = (pSrc->numCols-col) & 7; + if (blkCnt2 > 0) + { + mve_pred16_t p0 = vctp16q(blkCnt2); + + v1 = vld1q_f16(pa); + v2 = vld1q_f16(ptemp); + v1 = vfmaq_n_f16(v1,v2,f); + vst1q_p_f16(pa,v1,p0); + + pa += blkCnt2; + } + + pa += col; + } + + /* Copy Householder reflectors into R matrix */ + pa = p + pOutR->numCols; + for(k=0;knumRows-col-1; k++) + { + *pa = pTmpA[k+1]; + pa += pOutR->numCols; + } + + p += 1 + pOutR->numCols; + } + + /* Generate Q if requested by user matrix */ + + if (pOutQ != NULL) + { + /* Initialize Q matrix to identity */ + memset(pOutQ->pData,0,sizeof(float16_t)*pOutQ->numRows*pOutQ->numRows); + + pa = pOutQ->pData; + for(col=0 ; col < pOutQ->numCols; col++) + { + *pa = 1.0f16; + pa += pOutQ->numCols+1; + } + + nb = pOutQ->numRows - pOutQ->numCols + 1; + + pc = pOutTau + pOutQ->numCols - 1; + for(col=0 ; col < pOutQ->numCols; col++) + { + int32_t j,k, blkCnt, blkCnt2; + float16_t *pa0,*pa1,*pa2,*pa3,*ptemp; + float16_t temp; + float16x8_t v1,v2,vtemp; + + pos = pSrc->numRows - nb; + p = pOutQ->pData + pos + pOutQ->numCols*pos ; + + + COPY_COL_F16(pOutR,pos,pos,pTmpA); + pTmpA[0] = 1.0f16; + pdst = pTmpB; + + /* v.T A(col:,col:) -> tmpb */ + + pv = pTmpA; + pa = p; + + temp = *pv; + blkCnt2 = (pOutQ->numRows-pos) >> 3; + while (blkCnt2 > 0) + { + v1 = vld1q_f16(pa); + v1 = vmulq_n_f16(v1, temp); + vst1q_f16(pdst,v1); + + pa += 8; + pdst += 8; + + blkCnt2--; + } + blkCnt2 = (pOutQ->numRows-pos) & 7; + if (blkCnt2 > 0) + { + mve_pred16_t p0 = vctp16q(blkCnt2); + + v1 = vld1q_f16(pa); + v1 = vmulq_n_f16(v1, temp); + vst1q_p_f16(pdst,v1,p0); + + pa += blkCnt2; + } + + pa += pos; + pv++; + pdst = pTmpB; + pa0 = pa; + pa1 = pa0 + pOutQ->numRows; + pa2 = pa1 + pOutQ->numRows; + pa3 = pa2 + pOutQ->numRows; + + /* Unrolled loop */ + blkCnt = (pOutQ->numRows-pos - 1) >> 2; + k=1; + while(blkCnt > 0) + { + + vtemp = vld1q_f16(pv); + blkCnt2 = (pOutQ->numRows-pos) >> 3; + while (blkCnt2 > 0) + { + v1 = vld1q_f16(pdst); + + v2 = vld1q_f16(pa0); + v1 = vfmaq_n_f16(v1, v2, vgetq_lane(vtemp,0)); + + v2 = vld1q_f16(pa1); + v1 = vfmaq_n_f16(v1, v2, vgetq_lane(vtemp,1)); + + v2 = vld1q_f16(pa2); + v1 = vfmaq_n_f16(v1, v2, vgetq_lane(vtemp,2)); + + v2 = vld1q_f16(pa3); + v1 = vfmaq_n_f16(v1, v2, vgetq_lane(vtemp,3)); + + vst1q_f16(pdst,v1); + + pa0 += 8; + pa1 += 8; + pa2 += 8; + pa3 += 8; + pdst += 8; + + blkCnt2--; + } + blkCnt2 = (pOutQ->numRows-pos) & 7; + if (blkCnt2 > 0) + { + mve_pred16_t p0 = vctp16q(blkCnt2); + + v1 = vld1q_f16(pdst); + + v2 = vld1q_f16(pa0); + v1 = vfmaq_n_f16(v1, v2, vgetq_lane(vtemp,0)); + + v2 = vld1q_f16(pa1); + v1 = vfmaq_n_f16(v1, v2, vgetq_lane(vtemp,1)); + + v2 = vld1q_f16(pa2); + v1 = vfmaq_n_f16(v1, v2, vgetq_lane(vtemp,2)); + + v2 = vld1q_f16(pa3); + v1 = vfmaq_n_f16(v1, v2, vgetq_lane(vtemp,3)); + + vst1q_p_f16(pdst,v1,p0); + + pa0 += blkCnt2; + pa1 += blkCnt2; + pa2 += blkCnt2; + pa3 += blkCnt2; + + } + + pa0 += pos + 3*pOutQ->numRows; + pa1 += pos + 3*pOutQ->numRows; + pa2 += pos + 3*pOutQ->numRows; + pa3 += pos + 3*pOutQ->numRows; + pv += 4; + pdst = pTmpB; + k += 4; + blkCnt--; + } + + pa = pa0; + for(;knumRows-pos; k++) + { + temp = *pv; + blkCnt2 = (pOutQ->numRows-pos) >> 3; + while (blkCnt2 > 0) + { + v1 = vld1q_f16(pdst); + v2 = vld1q_f16(pa); + v1 = vfmaq_n_f16(v1, v2, temp); + vst1q_f16(pdst,v1); + + pdst += 8; + pa += 8; + + blkCnt2--; + } + blkCnt2 = (pOutQ->numRows-pos) & 7; + if (blkCnt2 > 0) + { + mve_pred16_t p0 = vctp16q(blkCnt2); + v1 = vld1q_f16(pdst); + v2 = vld1q_f16(pa); + v1 = vfmaq_n_f16(v1, v2, temp); + vst1q_p_f16(pdst,v1,p0); + + pa += blkCnt2; + } + + pa += pos; + pv++; + pdst = pTmpB; + } + + pa = p; + beta = *pc--; + for(j=0;jnumRows-pos; j++) + { + float16_t f = -(_Float16)beta * (_Float16)pTmpA[j]; + ptemp = pTmpB; + + blkCnt2 = (pOutQ->numCols-pos) >> 3; + while (blkCnt2 > 0) + { + v1 = vld1q_f16(pa); + v2 = vld1q_f16(ptemp); + v1 = vfmaq_n_f16(v1,v2,f); + vst1q_f16(pa,v1); + + pa += 8; + ptemp += 8; + + blkCnt2--; + } + blkCnt2 = (pOutQ->numCols-pos) & 7; + if (blkCnt2 > 0) + { + mve_pred16_t p0 = vctp16q(blkCnt2); + + v1 = vld1q_f16(pa); + v2 = vld1q_f16(ptemp); + v1 = vfmaq_n_f16(v1,v2,f); + vst1q_p_f16(pa,v1,p0); + + pa += blkCnt2; + } + + pa += pos; + } + + + nb++; + } + } + + arm_status status = ARM_MATH_SUCCESS; + /* Return to application */ + return (status); +} + +#endif /*#if !defined(ARM_MATH_MVEF)*/ + + +#endif /*#if !defined(ARM_MATH_AUTOVECTORIZE)*/ + + +#if defined(ARM_FLOAT16_SUPPORTED) + +#if (!defined(ARM_MATH_MVE_FLOAT16)) || defined(ARM_MATH_AUTOVECTORIZE) + + +arm_status arm_mat_qr_f16( + const arm_matrix_instance_f16 * pSrc, + const float16_t threshold, + arm_matrix_instance_f16 * pOutR, + arm_matrix_instance_f16 * pOutQ, + float16_t * pOutTau, + float16_t *pTmpA, + float16_t *pTmpB + ) + +{ + int32_t col=0; + int32_t nb,pos; + float16_t *pa,*pc; + float16_t beta; + float16_t *pv; + float16_t *pdst; + float16_t *p; + + if (pSrc->numRows < pSrc->numCols) + { + return(ARM_MATH_SIZE_MISMATCH); + } + + memcpy(pOutR->pData,pSrc->pData,pSrc->numCols * pSrc->numRows*sizeof(float16_t)); + pOutR->numCols = pSrc->numCols; + pOutR->numRows = pSrc->numRows; + + p = pOutR->pData; + + pc = pOutTau; + for(col=0 ; col < pSrc->numCols; col++) + { + int32_t i,j,k,blkCnt; + float16_t *pa0,*pa1,*pa2,*pa3; + COPY_COL_F16(pOutR,col,col,pTmpA); + + beta = arm_householder_f16(pTmpA,threshold,pSrc->numRows - col,pTmpA); + *pc++ = beta; + + pdst = pTmpB; + + /* v.T A(col:,col:) -> tmpb */ + pv = pTmpA; + pa = p; + for(j=0;jnumCols-col; j++) + { + *pdst++ = (_Float16)*pv * (_Float16)*pa++; + } + pa += col; + pv++; + pdst = pTmpB; + + pa0 = pa; + pa1 = pa0 + pSrc->numCols; + pa2 = pa1 + pSrc->numCols; + pa3 = pa2 + pSrc->numCols; + + /* Unrolled loop */ + blkCnt = (pSrc->numRows-col - 1) >> 2; + k=1; + while(blkCnt > 0) + { + float16_t sum; + + for(j=0;jnumCols-col; j++) + { + sum = *pdst; + + sum += (_Float16)pv[0] * (_Float16)*pa0++; + sum += (_Float16)pv[1] * (_Float16)*pa1++; + sum += (_Float16)pv[2] * (_Float16)*pa2++; + sum += (_Float16)pv[3] * (_Float16)*pa3++; + + *pdst++ = sum; + } + pa0 += col + 3*pSrc->numCols; + pa1 += col + 3*pSrc->numCols; + pa2 += col + 3*pSrc->numCols; + pa3 += col + 3*pSrc->numCols; + pv += 4; + pdst = pTmpB; + k += 4; + blkCnt--; + } + + pa = pa0; + for(;knumRows-col; k++) + { + for(j=0;jnumCols-col; j++) + { + *pdst++ += (_Float16)*pv * (_Float16)*pa++; + } + pa += col; + pv++; + pdst = pTmpB; + } + + /* A(col:,col:) - beta v tmpb */ + pa = p; + for(j=0;jnumRows-col; j++) + { + float16_t f = (_Float16)beta * (_Float16)pTmpA[j]; + + for(i=0;inumCols-col; i++) + { + *pa = (_Float16)*pa - (_Float16)f * (_Float16)pTmpB[i] ; + pa++; + } + pa += col; + } + + /* Copy Householder reflectors into R matrix */ + pa = p + pOutR->numCols; + for(k=0;knumRows-col-1; k++) + { + *pa = pTmpA[k+1]; + pa += pOutR->numCols; + } + + p += 1 + pOutR->numCols; + } + + /* Generate Q if requested by user matrix */ + + if (pOutQ != NULL) + { + /* Initialize Q matrix to identity */ + memset(pOutQ->pData,0,sizeof(float16_t)*pOutQ->numRows*pOutQ->numRows); + + pa = pOutQ->pData; + for(col=0 ; col < pOutQ->numCols; col++) + { + *pa = 1.0f16; + pa += pOutQ->numCols+1; + } + + nb = pOutQ->numRows - pOutQ->numCols + 1; + + pc = pOutTau + pOutQ->numCols - 1; + for(col=0 ; col < pOutQ->numCols; col++) + { + int32_t i,j,k, blkCnt; + float16_t *pa0,*pa1,*pa2,*pa3; + pos = pSrc->numRows - nb; + p = pOutQ->pData + pos + pOutQ->numCols*pos ; + + + COPY_COL_F16(pOutR,pos,pos,pTmpA); + pTmpA[0] = 1.0f16; + pdst = pTmpB; + + /* v.T A(col:,col:) -> tmpb */ + + pv = pTmpA; + pa = p; + for(j=0;jnumRows-pos; j++) + { + *pdst++ = (_Float16)*pv * (_Float16)*pa++; + } + pa += pos; + pv++; + pdst = pTmpB; + pa0 = pa; + pa1 = pa0 + pOutQ->numRows; + pa2 = pa1 + pOutQ->numRows; + pa3 = pa2 + pOutQ->numRows; + + /* Unrolled loop */ + blkCnt = (pOutQ->numRows-pos - 1) >> 2; + k=1; + while(blkCnt > 0) + { + float16_t sum; + + for(j=0;jnumRows-pos; j++) + { + sum = *pdst; + + sum += (_Float16)pv[0] * (_Float16)*pa0++; + sum += (_Float16)pv[1] * (_Float16)*pa1++; + sum += (_Float16)pv[2] * (_Float16)*pa2++; + sum += (_Float16)pv[3] * (_Float16)*pa3++; + + *pdst++ = sum; + } + pa0 += pos + 3*pOutQ->numRows; + pa1 += pos + 3*pOutQ->numRows; + pa2 += pos + 3*pOutQ->numRows; + pa3 += pos + 3*pOutQ->numRows; + pv += 4; + pdst = pTmpB; + k += 4; + blkCnt--; + } + + pa = pa0; + for(;knumRows-pos; k++) + { + for(j=0;jnumRows-pos; j++) + { + *pdst++ += (_Float16)*pv * (_Float16)*pa++; + } + pa += pos; + pv++; + pdst = pTmpB; + } + + pa = p; + beta = *pc--; + for(j=0;jnumRows-pos; j++) + { + float16_t f = (_Float16)beta * (_Float16)pTmpA[j]; + + for(i=0;inumCols-pos; i++) + { + *pa = (_Float16)*pa - (_Float16)f * (_Float16)pTmpB[i] ; + pa++; + } + pa += pos; + } + + + nb++; + } + } + + arm_status status = ARM_MATH_SUCCESS; + /* Return to application */ + return (status); +} + +#endif /* end of test for Helium or Neon availability */ + +#endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ +/** + @} end of MatrixQR group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_qr_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_qr_f32.c new file mode 100644 index 0000000..3e3027e --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_qr_f32.c @@ -0,0 +1,854 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mat_qr_f32.c + * Description: Floating-point matrix QR decomposition. + * + * $Date: 15 June 2022 + * $Revision: V1.11.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h" + + +#if !defined(ARM_MATH_AUTOVECTORIZE) +#if defined(ARM_MATH_MVEF) +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" +#endif +#endif + +/** + @ingroup groupMatrix + */ + +/** + @defgroup MatrixQR QR decomposition of a Matrix + + Computes the QR decomposition of a matrix M using Householder algorithm. + + \f[ + M = Q R + \f] + + where Q is an orthogonal matrix and R is upper triangular. + No pivoting strategy is used. + + The returned value for R is using a format a bit similar + to LAPACK : it is not just containing the matrix R but + also the Householder reflectors. + + The function is also returning a vector \f$\tau\f$ + that is containing the scaling factor for the reflectors. + + Returned value R has the structure: + + \f[ + \begin{pmatrix} + r_{11} & r_{12} & \dots & r_{1n} \\ + v_{12} & r_{22} & \dots & r_{2n} \\ + v_{13} & v_{22} & \dots & r_{3n} \\ + \vdots & \vdots & \ddots & \vdots \\ + v_{1m} & v_{2(m-1)} & \dots & r_{mn} \\ + \end{pmatrix} + \f] + + where + + \f[ + v_1 = + \begin{pmatrix} + 1 \\ + v_{12} \\ + \vdots \\ + v_{1m} \\ + \end{pmatrix} + \f] + + is the first householder reflector. + + The Householder Matrix is given by \f$H_1\f$ + + \f[ + H_1 = I - \tau_1 v_1 v_1^T + \f] + + The Matrix Q is the product of the Householder matrices: + + \f[ + Q = H_1 H_2 \dots H_n + \f] + + The computation of the matrix Q by this function is + optional. + + And the matrix R, would be the returned value R without the + householder reflectors: + + \f[ + \begin{pmatrix} + r_{11} & r_{12} & \dots & r_{1n} \\ + 0 & r_{22} & \dots & r_{2n} \\ + 0 & 0 & \dots & r_{3n} \\ + \vdots & \vdots & \ddots & \vdots \\ + 0 & 0 & \dots & r_{mn} \\ + \end{pmatrix} + \f] + + + */ + +/** + @addtogroup MatrixQR + @{ + */ + +/** + @brief QR decomposition of a m x n floating point matrix with m >= n. + @param[in] pSrc points to input matrix structure. The source matrix is modified by the function. + @param[in] threshold norm2 threshold. + @param[out] pOutR points to output R matrix structure of dimension m x n + @param[out] pOutQ points to output Q matrix structure of dimension m x m (can be NULL) + @param[out] pOutTau points to Householder scaling factors of dimension n + @param[inout] pTmpA points to a temporary vector of dimension m. + @param[inout] pTmpB points to a temporary vector of dimension m. + @return execution status + - \ref ARM_MATH_SUCCESS : Operation successful + - \ref ARM_MATH_SIZE_MISMATCH : Matrix size check failed + + @par pOutQ is optional: + pOutQ can be a NULL pointer. + In this case, the argument will be ignored + and the output Q matrix won't be computed. + + + @par Norm2 threshold + For the meaning of this argument please + refer to the \ref MatrixHouseholder documentation + + */ + +#if !defined(ARM_MATH_AUTOVECTORIZE) +#if defined(ARM_MATH_MVEF) + +arm_status arm_mat_qr_f32( + const arm_matrix_instance_f32 * pSrc, + const float32_t threshold, + arm_matrix_instance_f32 * pOutR, + arm_matrix_instance_f32 * pOutQ, + float32_t * pOutTau, + float32_t *pTmpA, + float32_t *pTmpB + ) + +{ + int32_t col=0; + int32_t nb,pos; + float32_t *pa,*pc; + float32_t beta; + float32_t *pv; + float32_t *pdst; + float32_t *p; + + if (pSrc->numRows < pSrc->numCols) + { + return(ARM_MATH_SIZE_MISMATCH); + } + + memcpy(pOutR->pData,pSrc->pData,pSrc->numCols * pSrc->numRows*sizeof(float32_t)); + pOutR->numCols = pSrc->numCols; + pOutR->numRows = pSrc->numRows; + + p = pOutR->pData; + + pc = pOutTau; + for(col=0 ; col < pSrc->numCols; col++) + { + int32_t j,k,blkCnt,blkCnt2; + float32_t *pa0,*pa1,*pa2,*pa3,*ptemp; + float32_t temp; + float32x4_t v1,v2,vtemp; + + COPY_COL_F32(pOutR,col,col,pTmpA); + + beta = arm_householder_f32(pTmpA,threshold,pSrc->numRows - col,pTmpA); + *pc++ = beta; + + pdst = pTmpB; + + /* v.T A(col:,col:) -> tmpb */ + pv = pTmpA; + pa = p; + + temp = *pv; + blkCnt = (pSrc->numCols-col) >> 2; + while (blkCnt > 0) + { + v1 = vld1q_f32(pa); + v2 = vmulq_n_f32(v1,temp); + vst1q_f32(pdst,v2); + + pa += 4; + pdst += 4; + blkCnt--; + } + blkCnt = (pSrc->numCols-col) & 3; + if (blkCnt > 0) + { + mve_pred16_t p0 = vctp32q(blkCnt); + v1 = vld1q_f32(pa); + v2 = vmulq_n_f32(v1,temp); + vst1q_p_f32(pdst,v2,p0); + + pa += blkCnt; + } + + pa += col; + pv++; + pdst = pTmpB; + + pa0 = pa; + pa1 = pa0 + pSrc->numCols; + pa2 = pa1 + pSrc->numCols; + pa3 = pa2 + pSrc->numCols; + + /* Unrolled loop */ + blkCnt = (pSrc->numRows-col - 1) >> 2; + k=1; + while(blkCnt > 0) + { + vtemp=vld1q_f32(pv); + + blkCnt2 = (pSrc->numCols-col) >> 2; + while (blkCnt2 > 0) + { + v1 = vld1q_f32(pdst); + + v2 = vld1q_f32(pa0); + v1 = vfmaq_n_f32(v1,v2,vgetq_lane(vtemp,0)); + + v2 = vld1q_f32(pa1); + v1 = vfmaq_n_f32(v1,v2,vgetq_lane(vtemp,1)); + + v2 = vld1q_f32(pa2); + v1 = vfmaq_n_f32(v1,v2,vgetq_lane(vtemp,2)); + + v2 = vld1q_f32(pa3); + v1 = vfmaq_n_f32(v1,v2,vgetq_lane(vtemp,3)); + + vst1q_f32(pdst,v1); + + pdst += 4; + pa0 += 4; + pa1 += 4; + pa2 += 4; + pa3 += 4; + blkCnt2--; + } + blkCnt2 = (pSrc->numCols-col) & 3; + if (blkCnt2 > 0) + { + mve_pred16_t p0 = vctp32q(blkCnt2); + + v1 = vld1q_f32(pdst); + + v2 = vld1q_f32(pa0); + v1 = vfmaq_n_f32(v1,v2,vgetq_lane(vtemp,0)); + + v2 = vld1q_f32(pa1); + v1 = vfmaq_n_f32(v1,v2,vgetq_lane(vtemp,1)); + + v2 = vld1q_f32(pa2); + v1 = vfmaq_n_f32(v1,v2,vgetq_lane(vtemp,2)); + + v2 = vld1q_f32(pa3); + v1 = vfmaq_n_f32(v1,v2,vgetq_lane(vtemp,3)); + + vst1q_p_f32(pdst,v1,p0); + + pa0 += blkCnt2; + pa1 += blkCnt2; + pa2 += blkCnt2; + pa3 += blkCnt2; + } + + pa0 += col + 3*pSrc->numCols; + pa1 += col + 3*pSrc->numCols; + pa2 += col + 3*pSrc->numCols; + pa3 += col + 3*pSrc->numCols; + pv += 4; + pdst = pTmpB; + k += 4; + blkCnt--; + } + + pa = pa0; + for(;knumRows-col; k++) + { + temp = *pv; + blkCnt2 = (pSrc->numCols-col) >> 2; + while (blkCnt2 > 0) + { + v1 = vld1q_f32(pa); + v2 = vld1q_f32(pdst); + v2 = vfmaq_n_f32(v2,v1,temp); + vst1q_f32(pdst,v2); + + pa += 4; + pdst += 4; + blkCnt2--; + } + blkCnt2 = (pSrc->numCols-col) & 3; + if (blkCnt2 > 0) + { + mve_pred16_t p0 = vctp32q(blkCnt2); + v1 = vld1q_f32(pa); + v2 = vld1q_f32(pdst); + v2 = vfmaq_n_f32(v2,v1,temp); + vst1q_p_f32(pdst,v2,p0); + + pa += blkCnt2; + } + + pa += col; + pv++; + pdst = pTmpB; + } + + /* A(col:,col:) - beta v tmpb */ + pa = p; + for(j=0;jnumRows-col; j++) + { + float32_t f = -beta * pTmpA[j]; + ptemp = pTmpB; + + blkCnt2 = (pSrc->numCols-col) >> 2; + while (blkCnt2 > 0) + { + v1 = vld1q_f32(pa); + v2 = vld1q_f32(ptemp); + v1 = vfmaq_n_f32(v1,v2,f); + vst1q_f32(pa,v1); + + pa += 4; + ptemp += 4; + + blkCnt2--; + } + blkCnt2 = (pSrc->numCols-col) & 3; + if (blkCnt2 > 0) + { + mve_pred16_t p0 = vctp32q(blkCnt2); + + v1 = vld1q_f32(pa); + v2 = vld1q_f32(ptemp); + v1 = vfmaq_n_f32(v1,v2,f); + vst1q_p_f32(pa,v1,p0); + + pa += blkCnt2; + } + + pa += col; + } + + /* Copy Householder reflectors into R matrix */ + pa = p + pOutR->numCols; + for(k=0;knumRows-col-1; k++) + { + *pa = pTmpA[k+1]; + pa += pOutR->numCols; + } + + p += 1 + pOutR->numCols; + } + + /* Generate Q if requested by user matrix */ + + if (pOutQ != NULL) + { + /* Initialize Q matrix to identity */ + memset(pOutQ->pData,0,sizeof(float32_t)*pOutQ->numRows*pOutQ->numRows); + + pa = pOutQ->pData; + for(col=0 ; col < pOutQ->numCols; col++) + { + *pa = 1.0f; + pa += pOutQ->numCols+1; + } + + nb = pOutQ->numRows - pOutQ->numCols + 1; + + pc = pOutTau + pOutQ->numCols - 1; + for(col=0 ; col < pOutQ->numCols; col++) + { + int32_t j,k, blkCnt, blkCnt2; + float32_t *pa0,*pa1,*pa2,*pa3,*ptemp; + float32_t temp; + float32x4_t v1,v2,vtemp; + + pos = pSrc->numRows - nb; + p = pOutQ->pData + pos + pOutQ->numCols*pos ; + + + COPY_COL_F32(pOutR,pos,pos,pTmpA); + pTmpA[0] = 1.0f; + pdst = pTmpB; + + /* v.T A(col:,col:) -> tmpb */ + + pv = pTmpA; + pa = p; + + temp = *pv; + blkCnt2 = (pOutQ->numRows-pos) >> 2; + while (blkCnt2 > 0) + { + v1 = vld1q_f32(pa); + v1 = vmulq_n_f32(v1, temp); + vst1q_f32(pdst,v1); + + pa += 4; + pdst += 4; + + blkCnt2--; + } + blkCnt2 = (pOutQ->numRows-pos) & 3; + if (blkCnt2 > 0) + { + mve_pred16_t p0 = vctp32q(blkCnt2); + + v1 = vld1q_f32(pa); + v1 = vmulq_n_f32(v1, temp); + vst1q_p_f32(pdst,v1,p0); + + pa += blkCnt2; + } + + pa += pos; + pv++; + pdst = pTmpB; + pa0 = pa; + pa1 = pa0 + pOutQ->numRows; + pa2 = pa1 + pOutQ->numRows; + pa3 = pa2 + pOutQ->numRows; + + /* Unrolled loop */ + blkCnt = (pOutQ->numRows-pos - 1) >> 2; + k=1; + while(blkCnt > 0) + { + + vtemp = vld1q_f32(pv); + blkCnt2 = (pOutQ->numRows-pos) >> 2; + while (blkCnt2 > 0) + { + v1 = vld1q_f32(pdst); + + v2 = vld1q_f32(pa0); + v1 = vfmaq_n_f32(v1, v2, vgetq_lane(vtemp,0)); + + v2 = vld1q_f32(pa1); + v1 = vfmaq_n_f32(v1, v2, vgetq_lane(vtemp,1)); + + v2 = vld1q_f32(pa2); + v1 = vfmaq_n_f32(v1, v2, vgetq_lane(vtemp,2)); + + v2 = vld1q_f32(pa3); + v1 = vfmaq_n_f32(v1, v2, vgetq_lane(vtemp,3)); + + vst1q_f32(pdst,v1); + + pa0 += 4; + pa1 += 4; + pa2 += 4; + pa3 += 4; + pdst += 4; + + blkCnt2--; + } + blkCnt2 = (pOutQ->numRows-pos) & 3; + if (blkCnt2 > 0) + { + mve_pred16_t p0 = vctp32q(blkCnt2); + + v1 = vld1q_f32(pdst); + + v2 = vld1q_f32(pa0); + v1 = vfmaq_n_f32(v1, v2, vgetq_lane(vtemp,0)); + + v2 = vld1q_f32(pa1); + v1 = vfmaq_n_f32(v1, v2, vgetq_lane(vtemp,1)); + + v2 = vld1q_f32(pa2); + v1 = vfmaq_n_f32(v1, v2, vgetq_lane(vtemp,2)); + + v2 = vld1q_f32(pa3); + v1 = vfmaq_n_f32(v1, v2, vgetq_lane(vtemp,3)); + + vst1q_p_f32(pdst,v1,p0); + + pa0 += blkCnt2; + pa1 += blkCnt2; + pa2 += blkCnt2; + pa3 += blkCnt2; + + } + + pa0 += pos + 3*pOutQ->numRows; + pa1 += pos + 3*pOutQ->numRows; + pa2 += pos + 3*pOutQ->numRows; + pa3 += pos + 3*pOutQ->numRows; + pv += 4; + pdst = pTmpB; + k += 4; + blkCnt--; + } + + pa = pa0; + for(;knumRows-pos; k++) + { + temp = *pv; + blkCnt2 = (pOutQ->numRows-pos) >> 2; + while (blkCnt2 > 0) + { + v1 = vld1q_f32(pdst); + v2 = vld1q_f32(pa); + v1 = vfmaq_n_f32(v1, v2, temp); + vst1q_f32(pdst,v1); + + pdst += 4; + pa += 4; + + blkCnt2--; + } + blkCnt2 = (pOutQ->numRows-pos) & 3; + if (blkCnt2 > 0) + { + mve_pred16_t p0 = vctp32q(blkCnt2); + v1 = vld1q_f32(pdst); + v2 = vld1q_f32(pa); + v1 = vfmaq_n_f32(v1, v2, temp); + vst1q_p_f32(pdst,v1,p0); + + pa += blkCnt2; + } + + pa += pos; + pv++; + pdst = pTmpB; + } + + pa = p; + beta = *pc--; + for(j=0;jnumRows-pos; j++) + { + float32_t f = -beta * pTmpA[j]; + ptemp = pTmpB; + + blkCnt2 = (pOutQ->numCols-pos) >> 2; + while (blkCnt2 > 0) + { + v1 = vld1q_f32(pa); + v2 = vld1q_f32(ptemp); + v1 = vfmaq_n_f32(v1,v2,f); + vst1q_f32(pa,v1); + + pa += 4; + ptemp += 4; + + blkCnt2--; + } + blkCnt2 = (pOutQ->numCols-pos) & 3; + if (blkCnt2 > 0) + { + mve_pred16_t p0 = vctp32q(blkCnt2); + + v1 = vld1q_f32(pa); + v2 = vld1q_f32(ptemp); + v1 = vfmaq_n_f32(v1,v2,f); + vst1q_p_f32(pa,v1,p0); + + pa += blkCnt2; + } + + pa += pos; + } + + + nb++; + } + } + + arm_status status = ARM_MATH_SUCCESS; + /* Return to application */ + return (status); +} + +#endif /*#if !defined(ARM_MATH_MVEF)*/ + + +#endif /*#if !defined(ARM_MATH_AUTOVECTORIZE)*/ + + + +#if (!defined(ARM_MATH_MVEF)) || defined(ARM_MATH_AUTOVECTORIZE) + +arm_status arm_mat_qr_f32( + const arm_matrix_instance_f32 * pSrc, + const float32_t threshold, + arm_matrix_instance_f32 * pOutR, + arm_matrix_instance_f32 * pOutQ, + float32_t * pOutTau, + float32_t *pTmpA, + float32_t *pTmpB + ) + +{ + int32_t col=0; + int32_t nb,pos; + float32_t *pa,*pc; + float32_t beta; + float32_t *pv; + float32_t *pdst; + float32_t *p; + + if (pSrc->numRows < pSrc->numCols) + { + return(ARM_MATH_SIZE_MISMATCH); + } + + memcpy(pOutR->pData,pSrc->pData,pSrc->numCols * pSrc->numRows*sizeof(float32_t)); + pOutR->numCols = pSrc->numCols; + pOutR->numRows = pSrc->numRows; + + p = pOutR->pData; + + pc = pOutTau; + for(col=0 ; col < pSrc->numCols; col++) + { + int32_t i,j,k,blkCnt; + float32_t *pa0,*pa1,*pa2,*pa3; + COPY_COL_F32(pOutR,col,col,pTmpA); + + beta = arm_householder_f32(pTmpA,threshold,pSrc->numRows - col,pTmpA); + *pc++ = beta; + + pdst = pTmpB; + + /* v.T A(col:,col:) -> tmpb */ + pv = pTmpA; + pa = p; + for(j=0;jnumCols-col; j++) + { + *pdst++ = *pv * *pa++; + } + pa += col; + pv++; + pdst = pTmpB; + + pa0 = pa; + pa1 = pa0 + pSrc->numCols; + pa2 = pa1 + pSrc->numCols; + pa3 = pa2 + pSrc->numCols; + + /* Unrolled loop */ + blkCnt = (pSrc->numRows-col - 1) >> 2; + k=1; + while(blkCnt > 0) + { + float32_t sum; + + for(j=0;jnumCols-col; j++) + { + sum = *pdst; + + sum += pv[0] * *pa0++; + sum += pv[1] * *pa1++; + sum += pv[2] * *pa2++; + sum += pv[3] * *pa3++; + + *pdst++ = sum; + } + pa0 += col + 3*pSrc->numCols; + pa1 += col + 3*pSrc->numCols; + pa2 += col + 3*pSrc->numCols; + pa3 += col + 3*pSrc->numCols; + pv += 4; + pdst = pTmpB; + k += 4; + blkCnt--; + } + + pa = pa0; + for(;knumRows-col; k++) + { + for(j=0;jnumCols-col; j++) + { + *pdst++ += *pv * *pa++; + } + pa += col; + pv++; + pdst = pTmpB; + } + + /* A(col:,col:) - beta v tmpb */ + pa = p; + for(j=0;jnumRows-col; j++) + { + float32_t f = beta * pTmpA[j]; + + for(i=0;inumCols-col; i++) + { + *pa = *pa - f * pTmpB[i] ; + pa++; + } + pa += col; + } + + /* Copy Householder reflectors into R matrix */ + pa = p + pOutR->numCols; + for(k=0;knumRows-col-1; k++) + { + *pa = pTmpA[k+1]; + pa += pOutR->numCols; + } + + p += 1 + pOutR->numCols; + } + + /* Generate Q if requested by user matrix */ + + if (pOutQ != NULL) + { + /* Initialize Q matrix to identity */ + memset(pOutQ->pData,0,sizeof(float32_t)*pOutQ->numRows*pOutQ->numRows); + + pa = pOutQ->pData; + for(col=0 ; col < pOutQ->numCols; col++) + { + *pa = 1.0f; + pa += pOutQ->numCols+1; + } + + nb = pOutQ->numRows - pOutQ->numCols + 1; + + pc = pOutTau + pOutQ->numCols - 1; + for(col=0 ; col < pOutQ->numCols; col++) + { + int32_t i,j,k, blkCnt; + float32_t *pa0,*pa1,*pa2,*pa3; + pos = pSrc->numRows - nb; + p = pOutQ->pData + pos + pOutQ->numCols*pos ; + + + COPY_COL_F32(pOutR,pos,pos,pTmpA); + pTmpA[0] = 1.0f; + pdst = pTmpB; + + /* v.T A(col:,col:) -> tmpb */ + + pv = pTmpA; + pa = p; + for(j=0;jnumRows-pos; j++) + { + *pdst++ = *pv * *pa++; + } + pa += pos; + pv++; + pdst = pTmpB; + pa0 = pa; + pa1 = pa0 + pOutQ->numRows; + pa2 = pa1 + pOutQ->numRows; + pa3 = pa2 + pOutQ->numRows; + + /* Unrolled loop */ + blkCnt = (pOutQ->numRows-pos - 1) >> 2; + k=1; + while(blkCnt > 0) + { + float32_t sum; + + for(j=0;jnumRows-pos; j++) + { + sum = *pdst; + + sum += pv[0] * *pa0++; + sum += pv[1] * *pa1++; + sum += pv[2] * *pa2++; + sum += pv[3] * *pa3++; + + *pdst++ = sum; + } + pa0 += pos + 3*pOutQ->numRows; + pa1 += pos + 3*pOutQ->numRows; + pa2 += pos + 3*pOutQ->numRows; + pa3 += pos + 3*pOutQ->numRows; + pv += 4; + pdst = pTmpB; + k += 4; + blkCnt--; + } + + pa = pa0; + for(;knumRows-pos; k++) + { + for(j=0;jnumRows-pos; j++) + { + *pdst++ += *pv * *pa++; + } + pa += pos; + pv++; + pdst = pTmpB; + } + + pa = p; + beta = *pc--; + for(j=0;jnumRows-pos; j++) + { + float32_t f = beta * pTmpA[j]; + + for(i=0;inumCols-pos; i++) + { + *pa = *pa - f * pTmpB[i] ; + pa++; + } + pa += pos; + } + + + nb++; + } + } + + arm_status status = ARM_MATH_SUCCESS; + /* Return to application */ + return (status); +} + +#endif /* end of test for Helium or Neon availability */ + +/** + @} end of MatrixQR group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_qr_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_qr_f64.c new file mode 100644 index 0000000..84ce3fb --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_qr_f64.c @@ -0,0 +1,311 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mat_qr_f64.c + * Description: Double floating-point matrix QR decomposition. + * + * $Date: 15 June 2022 + * $Revision: V1.11.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_utils.h" + + + +/** + @ingroup groupMatrix + */ + + +/** + @addtogroup MatrixQR + @{ + */ + +/** + @brief QR decomposition of a m x n double floating point matrix with m >= n. + @param[in] pSrc points to input matrix structure. The source matrix is modified by the function. + @param[in] threshold norm2 threshold. + @param[out] pOutR points to output R matrix structure of dimension m x n + @param[out] pOutQ points to output Q matrix structure of dimension m x m (can be NULL) + @param[out] pOutTau points to Householder scaling factors of dimension n + @param[inout] pTmpA points to a temporary vector of dimension m. + @param[inout] pTmpB points to a temporary vector of dimension m. + @return execution status + - \ref ARM_MATH_SUCCESS : Operation successful + - \ref ARM_MATH_SIZE_MISMATCH : Matrix size check failed + + @par pOutQ is optional: + pOutQ can be a NULL pointer. + In this case, the argument will be ignored + and the output Q matrix won't be computed. + + + @par Norm2 threshold + For the meaning of this argument please + refer to the \ref MatrixHouseholder documentation + + */ + + + + +arm_status arm_mat_qr_f64( + const arm_matrix_instance_f64 * pSrc, + const float64_t threshold, + arm_matrix_instance_f64 * pOutR, + arm_matrix_instance_f64 * pOutQ, + float64_t * pOutTau, + float64_t *pTmpA, + float64_t *pTmpB + ) + +{ + int32_t col=0; + int32_t nb,pos; + float64_t *pa,*pc; + float64_t beta; + float64_t *pv; + float64_t *pdst; + float64_t *p; + + if (pSrc->numRows < pSrc->numCols) + { + return(ARM_MATH_SIZE_MISMATCH); + } + + memcpy(pOutR->pData,pSrc->pData,pSrc->numCols * pSrc->numRows*sizeof(float64_t)); + pOutR->numCols = pSrc->numCols; + pOutR->numRows = pSrc->numRows; + + p = pOutR->pData; + + pc = pOutTau; + for(col=0 ; col < pSrc->numCols; col++) + { + int32_t i,j,k,blkCnt; + float64_t *pa0,*pa1,*pa2,*pa3; + COPY_COL_F64(pOutR,col,col,pTmpA); + + beta = arm_householder_f64(pTmpA,threshold,pSrc->numRows - col,pTmpA); + *pc++ = beta; + + pdst = pTmpB; + + /* v.T A(col:,col:) -> tmpb */ + pv = pTmpA; + pa = p; + for(j=0;jnumCols-col; j++) + { + *pdst++ = *pv * *pa++; + } + pa += col; + pv++; + pdst = pTmpB; + + pa0 = pa; + pa1 = pa0 + pSrc->numCols; + pa2 = pa1 + pSrc->numCols; + pa3 = pa2 + pSrc->numCols; + + /* Unrolled loop */ + blkCnt = (pSrc->numRows-col - 1) >> 2; + k=1; + while(blkCnt > 0) + { + float64_t sum; + + for(j=0;jnumCols-col; j++) + { + sum = *pdst; + + sum += pv[0] * *pa0++; + sum += pv[1] * *pa1++; + sum += pv[2] * *pa2++; + sum += pv[3] * *pa3++; + + *pdst++ = sum; + } + pa0 += col + 3*pSrc->numCols; + pa1 += col + 3*pSrc->numCols; + pa2 += col + 3*pSrc->numCols; + pa3 += col + 3*pSrc->numCols; + pv += 4; + pdst = pTmpB; + k += 4; + blkCnt--; + } + + pa = pa0; + for(;knumRows-col; k++) + { + for(j=0;jnumCols-col; j++) + { + *pdst++ += *pv * *pa++; + } + pa += col; + pv++; + pdst = pTmpB; + } + + /* A(col:,col:) - beta v tmpb */ + pa = p; + for(j=0;jnumRows-col; j++) + { + float64_t f = beta * pTmpA[j]; + + for(i=0;inumCols-col; i++) + { + *pa = *pa - f * pTmpB[i] ; + pa++; + } + pa += col; + } + + /* Copy Householder reflectors into R matrix */ + pa = p + pOutR->numCols; + for(k=0;knumRows-col-1; k++) + { + *pa = pTmpA[k+1]; + pa += pOutR->numCols; + } + + p += 1 + pOutR->numCols; + } + + /* Generate Q if requested by user matrix */ + + if (pOutQ != NULL) + { + /* Initialize Q matrix to identity */ + memset(pOutQ->pData,0,sizeof(float64_t)*pOutQ->numRows*pOutQ->numRows); + + pa = pOutQ->pData; + for(col=0 ; col < pOutQ->numCols; col++) + { + *pa = 1.0; + pa += pOutQ->numCols+1; + } + + nb = pOutQ->numRows - pOutQ->numCols + 1; + + pc = pOutTau + pOutQ->numCols - 1; + for(col=0 ; col < pOutQ->numCols; col++) + { + int32_t i,j,k, blkCnt; + float64_t *pa0,*pa1,*pa2,*pa3; + pos = pSrc->numRows - nb; + p = pOutQ->pData + pos + pOutQ->numCols*pos ; + + + COPY_COL_F64(pOutR,pos,pos,pTmpA); + pTmpA[0] = 1.0; + pdst = pTmpB; + + /* v.T A(col:,col:) -> tmpb */ + + pv = pTmpA; + pa = p; + for(j=0;jnumRows-pos; j++) + { + *pdst++ = *pv * *pa++; + } + pa += pos; + pv++; + pdst = pTmpB; + pa0 = pa; + pa1 = pa0 + pOutQ->numRows; + pa2 = pa1 + pOutQ->numRows; + pa3 = pa2 + pOutQ->numRows; + + /* Unrolled loop */ + blkCnt = (pOutQ->numRows-pos - 1) >> 2; + k=1; + while(blkCnt > 0) + { + float64_t sum; + + for(j=0;jnumRows-pos; j++) + { + sum = *pdst; + + sum += pv[0] * *pa0++; + sum += pv[1] * *pa1++; + sum += pv[2] * *pa2++; + sum += pv[3] * *pa3++; + + *pdst++ = sum; + } + pa0 += pos + 3*pOutQ->numRows; + pa1 += pos + 3*pOutQ->numRows; + pa2 += pos + 3*pOutQ->numRows; + pa3 += pos + 3*pOutQ->numRows; + pv += 4; + pdst = pTmpB; + k += 4; + blkCnt--; + } + + pa = pa0; + for(;knumRows-pos; k++) + { + for(j=0;jnumRows-pos; j++) + { + *pdst++ += *pv * *pa++; + } + pa += pos; + pv++; + pdst = pTmpB; + } + + pa = p; + beta = *pc--; + for(j=0;jnumRows-pos; j++) + { + float64_t f = beta * pTmpA[j]; + + for(i=0;inumCols-pos; i++) + { + *pa = *pa - f * pTmpB[i] ; + pa++; + } + pa += pos; + } + + + nb++; + } + } + + arm_status status = ARM_MATH_SUCCESS; + /* Return to application */ + return (status); +} + + +/** + @} end of MatrixQR group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_scale_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_scale_f16.c index 4c8d4eb..3b14b51 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_scale_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_scale_f16.c @@ -5,13 +5,13 @@ * Title: arm_mat_scale_f16.c * Description: Multiplies a floating-point matrix by a scalar * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -163,10 +163,10 @@ arm_status arm_mat_scale_f16( /* C(m,n) = A(m,n) * scale */ /* Scale and store result in destination buffer. */ - *pOut++ = (*pIn++) * scale; - *pOut++ = (*pIn++) * scale; - *pOut++ = (*pIn++) * scale; - *pOut++ = (*pIn++) * scale; + *pOut++ = (_Float16)(*pIn++) * (_Float16)scale; + *pOut++ = (_Float16)(*pIn++) * (_Float16)scale; + *pOut++ = (_Float16)(*pIn++) * (_Float16)scale; + *pOut++ = (_Float16)(*pIn++) * (_Float16)scale; /* Decrement loop counter */ blkCnt--; @@ -187,7 +187,7 @@ arm_status arm_mat_scale_f16( /* C(m,n) = A(m,n) * scale */ /* Scale and store result in destination buffer. */ - *pOut++ = (*pIn++) * scale; + *pOut++ = (_Float16)(*pIn++) * (_Float16)scale; /* Decrement loop counter */ blkCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_scale_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_scale_f32.c index 5d1dfd5..63aad92 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_scale_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_scale_f32.c @@ -5,13 +5,13 @@ * Title: arm_mat_scale_f32.c * Description: Multiplies a floating-point matrix by a scalar * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -39,7 +39,22 @@ Multiplies a matrix by a scalar. This is accomplished by multiplying each element in the matrix by the scalar. For example: - \image html MatrixScale.gif "Matrix Scaling of a 3 x 3 matrix" + + @par Matrix Scaling of a 3 x 3 matrix + + \f[ + \begin{pmatrix} + a_{1,1} & a_{1,2} & a_{1,3} \\ + a_{2,1} & a_{2,2} & a_{2,3} \\ + a_{3,1} & a_{3,2} & a_{3,3} \\ + \end{pmatrix} + * K = + \begin{pmatrix} + K a_{1,1} & K a_{1,2} & K a_{1,3} \\ + K a_{2,1} & K a_{2,2} & K a_{2,3} \\ + K a_{3,1} & K a_{3,2} & K a_{3,3} \\ + \end{pmatrix} + \f] The function checks to make sure that the input and output matrices are of the same size. diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_scale_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_scale_q15.c index 800ca46..5d1ea8b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_scale_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_scale_q15.c @@ -5,13 +5,13 @@ * Title: arm_mat_scale_q15.c * Description: Multiplies a Q15 matrix by a scalar * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -179,8 +179,8 @@ arm_status arm_mat_scale_q15( #if defined (ARM_MATH_DSP) /* read 2 times 2 samples at a time from source */ - inA1 = read_q15x2_ia ((q15_t **) &pIn); - inA2 = read_q15x2_ia ((q15_t **) &pIn); + inA1 = read_q15x2_ia (&pIn); + inA2 = read_q15x2_ia (&pIn); /* Scale inputs and store result in temporary variables * in single cycle by packing the outputs */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_scale_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_scale_q31.c index 1292c65..f4e87e6 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_scale_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_scale_q31.c @@ -5,13 +5,13 @@ * Title: arm_mat_scale_q31.c * Description: Multiplies a Q31 matrix by a scalar * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_lower_triangular_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_lower_triangular_f16.c index 8833566..6b3de66 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_lower_triangular_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_lower_triangular_f16.c @@ -5,11 +5,13 @@ * Title: arm_mat_solve_lower_triangular_f16.c * Description: Solve linear system LT X = A with LT lower triangular matrix * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -63,9 +65,8 @@ #ifdef ARM_MATH_MATRIX_CHECK /* Check for matrix mismatch condition */ - if ((ut->numRows != lt->numCols) || - (a->numRows != a->numCols) || - (ut->numRows != a->numRows) ) + if ((lt->numRows != lt->numCols) || + (lt->numRows != a->numRows) ) { /* Set status as ARM_MATH_SIZE_MISMATCH */ status = ARM_MATH_SIZE_MISMATCH; @@ -83,9 +84,10 @@ x2 = (a2 - c2 x3) / b2 */ - int i,j,k,n; + int i,j,k,n,cols; n = dst->numRows; + cols = dst->numCols; float16_t *pX = dst->pData; float16_t *pLT = lt->pData; @@ -102,45 +104,45 @@ for(i=0; i < n ; i++) { - for(j=0; j+7 < n; j += 8) + for(j=0; j+7 < cols; j += 8) { - vecA = vld1q_f16(&pA[i * n + j]); + vecA = vld1q_f16(&pA[i * cols + j]); for(k=0; k < i; k++) { - vecX = vld1q_f16(&pX[n*k+j]); + vecX = vld1q_f16(&pX[cols*k+j]); vecA = vfmsq(vecA,vdupq_n_f16(pLT[n*i + k]),vecX); } - if (pLT[n*i + i]==0.0f16) + if ((_Float16)pLT[n*i + i]==0.0f16) { return(ARM_MATH_SINGULAR); } invLT = 1.0f16 / (_Float16)pLT[n*i + i]; vecA = vmulq(vecA,vdupq_n_f16(invLT)); - vst1q(&pX[i*n+j],vecA); + vst1q(&pX[i*cols+j],vecA); } - for(; j < n; j ++) + for(; j < cols; j ++) { a_col = &pA[j]; lt_row = &pLT[n*i]; - _Float16 tmp=a_col[i * n]; + _Float16 tmp=a_col[i * cols]; for(k=0; k < i; k++) { - tmp -= (_Float16)lt_row[k] * (_Float16)pX[n*k+j]; + tmp -= (_Float16)lt_row[k] * (_Float16)pX[cols*k+j]; } - if (lt_row[i]==0.0f16) + if ((_Float16)lt_row[i]==0.0f16) { return(ARM_MATH_SINGULAR); } tmp = tmp / (_Float16)lt_row[i]; - pX[i*n+j] = tmp; + pX[i*cols+j] = tmp; } } @@ -164,9 +166,8 @@ #ifdef ARM_MATH_MATRIX_CHECK /* Check for matrix mismatch condition */ - if ((ut->numRows != lt->numCols) || - (a->numRows != a->numCols) || - (ut->numRows != a->numRows) ) + if ((lt->numRows != lt->numCols) || + (lt->numRows != a->numRows) ) { /* Set status as ARM_MATH_SIZE_MISMATCH */ status = ARM_MATH_SIZE_MISMATCH; @@ -184,9 +185,10 @@ x2 = (a2 - c2 x3) / b2 */ - int i,j,k,n; + int i,j,k,n,cols; n = dst->numRows; + cols = dst->numCols; float16_t *pX = dst->pData; float16_t *pLT = lt->pData; @@ -195,7 +197,7 @@ float16_t *lt_row; float16_t *a_col; - for(j=0; j < n; j ++) + for(j=0; j < cols; j ++) { a_col = &pA[j]; @@ -203,19 +205,19 @@ { lt_row = &pLT[n*i]; - float16_t tmp=a_col[i * n]; + float16_t tmp=a_col[i * cols]; for(k=0; k < i; k++) { - tmp -= lt_row[k] * pX[n*k+j]; + tmp -= (_Float16)lt_row[k] * (_Float16)pX[cols*k+j]; } - if (lt_row[i]==0.0f) + if ((_Float16)lt_row[i]==0.0f16) { return(ARM_MATH_SINGULAR); } - tmp = tmp / lt_row[i]; - pX[i*n+j] = tmp; + tmp = (_Float16)tmp / (_Float16)lt_row[i]; + pX[i*cols+j] = tmp; } } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_lower_triangular_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_lower_triangular_f32.c index dcd529c..3ffd076 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_lower_triangular_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_lower_triangular_f32.c @@ -5,11 +5,13 @@ * Title: arm_mat_solve_lower_triangular_f32.c * Description: Solve linear system LT X = A with LT lower triangular matrix * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -62,9 +64,8 @@ #ifdef ARM_MATH_MATRIX_CHECK /* Check for matrix mismatch condition */ - if ((ut->numRows != lt->numCols) || - (a->numRows != a->numCols) || - (ut->numRows != a->numRows) ) + if ((lt->numRows != lt->numCols) || + (lt->numRows != a->numRows) ) { /* Set status as ARM_MATH_SIZE_MISMATCH */ status = ARM_MATH_SIZE_MISMATCH; @@ -82,9 +83,10 @@ x2 = (a2 - c2 x3) / b2 */ - int i,j,k,n; + int i,j,k,n,cols; n = dst->numRows; + cols = dst->numCols; float32_t *pX = dst->pData; float32_t *pLT = lt->pData; @@ -101,13 +103,13 @@ for(i=0; i < n ; i++) { - for(j=0; j+3 < n; j += 4) + for(j=0; j+3 < cols; j += 4) { - vecA = vld1q_f32(&pA[i * n + j]); + vecA = vld1q_f32(&pA[i * cols + j]); for(k=0; k < i; k++) { - vecX = vld1q_f32(&pX[n*k+j]); + vecX = vld1q_f32(&pX[cols*k+j]); vecA = vfmsq(vecA,vdupq_n_f32(pLT[n*i + k]),vecX); } @@ -118,20 +120,20 @@ invLT = 1.0f / pLT[n*i + i]; vecA = vmulq(vecA,vdupq_n_f32(invLT)); - vst1q(&pX[i*n+j],vecA); + vst1q(&pX[i*cols+j],vecA); } - for(; j < n; j ++) + for(; j < cols; j ++) { a_col = &pA[j]; lt_row = &pLT[n*i]; - float32_t tmp=a_col[i * n]; + float32_t tmp=a_col[i * cols]; for(k=0; k < i; k++) { - tmp -= lt_row[k] * pX[n*k+j]; + tmp -= lt_row[k] * pX[cols*k+j]; } if (lt_row[i]==0.0f) @@ -139,7 +141,7 @@ return(ARM_MATH_SINGULAR); } tmp = tmp / lt_row[i]; - pX[i*n+j] = tmp; + pX[i*cols+j] = tmp; } } @@ -163,9 +165,8 @@ #ifdef ARM_MATH_MATRIX_CHECK /* Check for matrix mismatch condition */ - if ((ut->numRows != lt->numCols) || - (a->numRows != a->numCols) || - (ut->numRows != a->numRows) ) + if ((lt->numRows != lt->numCols) || + (lt->numRows != a->numRows) ) { /* Set status as ARM_MATH_SIZE_MISMATCH */ status = ARM_MATH_SIZE_MISMATCH; @@ -183,9 +184,10 @@ x2 = (a2 - c2 x3) / b2 */ - int i,j,k,n; + int i,j,k,n,cols; n = dst->numRows; + cols = dst->numCols; float32_t *pX = dst->pData; float32_t *pLT = lt->pData; @@ -202,13 +204,13 @@ for(i=0; i < n ; i++) { - for(j=0; j+3 < n; j += 4) + for(j=0; j+3 < cols; j += 4) { - vecA = vld1q_f32(&pA[i * n + j]); + vecA = vld1q_f32(&pA[i * cols + j]); for(k=0; k < i; k++) { - vecX = vld1q_f32(&pX[n*k+j]); + vecX = vld1q_f32(&pX[cols*k+j]); vecA = vfmsq_f32(vecA,vdupq_n_f32(pLT[n*i + k]),vecX); } @@ -219,20 +221,20 @@ invLT = 1.0f / pLT[n*i + i]; vecA = vmulq_f32(vecA,vdupq_n_f32(invLT)); - vst1q_f32(&pX[i*n+j],vecA); + vst1q_f32(&pX[i*cols+j],vecA); } - for(; j < n; j ++) + for(; j < cols; j ++) { a_col = &pA[j]; lt_row = &pLT[n*i]; - float32_t tmp=a_col[i * n]; + float32_t tmp=a_col[i * cols]; for(k=0; k < i; k++) { - tmp -= lt_row[k] * pX[n*k+j]; + tmp -= lt_row[k] * pX[cols*k+j]; } if (lt_row[i]==0.0f) @@ -240,7 +242,7 @@ return(ARM_MATH_SINGULAR); } tmp = tmp / lt_row[i]; - pX[i*n+j] = tmp; + pX[i*cols+j] = tmp; } } @@ -261,11 +263,9 @@ #ifdef ARM_MATH_MATRIX_CHECK - /* Check for matrix mismatch condition */ - if ((ut->numRows != lt->numCols) || - (a->numRows != a->numCols) || - (ut->numRows != a->numRows) ) + if ((lt->numRows != lt->numCols) || + (lt->numRows != a->numRows) ) { /* Set status as ARM_MATH_SIZE_MISMATCH */ status = ARM_MATH_SIZE_MISMATCH; @@ -283,9 +283,7 @@ x2 = (a2 - c2 x3) / b2 */ - int i,j,k,n; - - n = dst->numRows; + int i,j,k,n,cols; float32_t *pX = dst->pData; float32_t *pLT = lt->pData; @@ -294,19 +292,23 @@ float32_t *lt_row; float32_t *a_col; - for(j=0; j < n; j ++) + n = dst->numRows; + cols = dst -> numCols; + + + for(j=0; j < cols; j ++) { a_col = &pA[j]; for(i=0; i < n ; i++) { - lt_row = &pLT[n*i]; + float32_t tmp=a_col[i * cols]; - float32_t tmp=a_col[i * n]; + lt_row = &pLT[n*i]; for(k=0; k < i; k++) { - tmp -= lt_row[k] * pX[n*k+j]; + tmp -= lt_row[k] * pX[cols*k+j]; } if (lt_row[i]==0.0f) @@ -314,7 +316,7 @@ return(ARM_MATH_SINGULAR); } tmp = tmp / lt_row[i]; - pX[i*n+j] = tmp; + pX[i*cols+j] = tmp; } } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_lower_triangular_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_lower_triangular_f64.c index 67dc3be..cc73005 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_lower_triangular_f64.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_lower_triangular_f64.c @@ -5,11 +5,13 @@ * Title: arm_mat_solve_lower_triangular_f64.c * Description: Solve linear system LT X = A with LT lower triangular matrix * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -57,9 +59,8 @@ #ifdef ARM_MATH_MATRIX_CHECK /* Check for matrix mismatch condition */ - if ((ut->numRows != lt->numCols) || - (a->numRows != a->numCols) || - (ut->numRows != a->numRows) ) + if ((lt->numRows != lt->numCols) || + (lt->numRows != a->numRows) ) { /* Set status as ARM_MATH_SIZE_MISMATCH */ status = ARM_MATH_SIZE_MISMATCH; @@ -77,9 +78,7 @@ x2 = (a2 - c2 x3) / b2 */ - int i,j,k,n; - - n = dst->numRows; + int i,j,k,n,cols; float64_t *pX = dst->pData; float64_t *pLT = lt->pData; @@ -88,27 +87,30 @@ float64_t *lt_row; float64_t *a_col; - for(j=0; j < n; j ++) + n = dst->numRows; + cols = dst->numCols; + + for(j=0; j < cols; j ++) { a_col = &pA[j]; for(i=0; i < n ; i++) { + float64_t tmp=a_col[i * cols]; + lt_row = &pLT[n*i]; - float64_t tmp=a_col[i * n]; - for(k=0; k < i; k++) { - tmp -= lt_row[k] * pX[n*k+j]; + tmp -= lt_row[k] * pX[cols*k+j]; } - if (lt_row[i]==0.0f) + if (lt_row[i]==0.0) { return(ARM_MATH_SINGULAR); } tmp = tmp / lt_row[i]; - pX[i*n+j] = tmp; + pX[i*cols+j] = tmp; } } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_upper_triangular_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_upper_triangular_f16.c index 427317c..0f03eaa 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_upper_triangular_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_upper_triangular_f16.c @@ -5,11 +5,13 @@ * Title: arm_mat_solve_upper_triangular_f16.c * Description: Solve linear system UT X = A with UT upper triangular matrix * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -66,7 +68,6 @@ arm_status status; /* status of matrix inverse */ /* Check for matrix mismatch condition */ if ((ut->numRows != ut->numCols) || - (a->numRows != a->numCols) || (ut->numRows != a->numRows) ) { /* Set status as ARM_MATH_SIZE_MISMATCH */ @@ -78,9 +79,10 @@ arm_status status; /* status of matrix inverse */ { - int i,j,k,n; + int i,j,k,n,cols; n = dst->numRows; + cols = dst->numCols; float16_t *pX = dst->pData; float16_t *pUT = ut->pData; @@ -96,17 +98,17 @@ arm_status status; /* status of matrix inverse */ for(i=n-1; i >= 0 ; i--) { - for(j=0; j+7 < n; j +=8) + for(j=0; j+7 < cols; j +=8) { - vecA = vld1q_f16(&pA[i * n + j]); + vecA = vld1q_f16(&pA[i * cols + j]); for(k=n-1; k > i; k--) { - vecX = vld1q_f16(&pX[n*k+j]); + vecX = vld1q_f16(&pX[cols*k+j]); vecA = vfmsq(vecA,vdupq_n_f16(pUT[n*i + k]),vecX); } - if (pUT[n*i + i]==0.0f16) + if ((_Float16)pUT[n*i + i]==0.0f16) { return(ARM_MATH_SINGULAR); } @@ -115,28 +117,28 @@ arm_status status; /* status of matrix inverse */ vecA = vmulq(vecA,vdupq_n_f16(invUT)); - vst1q(&pX[i*n+j],vecA); + vst1q(&pX[i*cols+j],vecA); } - for(; j < n; j ++) + for(; j < cols; j ++) { a_col = &pA[j]; ut_row = &pUT[n*i]; - _Float16 tmp=a_col[i * n]; + _Float16 tmp=a_col[i * cols]; for(k=n-1; k > i; k--) { - tmp -= (_Float16)ut_row[k] * (_Float16)pX[n*k+j]; + tmp -= (_Float16)ut_row[k] * (_Float16)pX[cols*k+j]; } - if (ut_row[i]==0.0f16) + if ((_Float16)ut_row[i]==0.0f16) { return(ARM_MATH_SINGULAR); } tmp = tmp / (_Float16)ut_row[i]; - pX[i*n+j] = tmp; + pX[i*cols+j] = tmp; } } @@ -162,7 +164,6 @@ arm_status status; /* status of matrix inverse */ /* Check for matrix mismatch condition */ if ((ut->numRows != ut->numCols) || - (a->numRows != a->numCols) || (ut->numRows != a->numRows) ) { /* Set status as ARM_MATH_SIZE_MISMATCH */ @@ -174,9 +175,10 @@ arm_status status; /* status of matrix inverse */ { - int i,j,k,n; + int i,j,k,n,cols; n = dst->numRows; + cols = dst->numCols; float16_t *pX = dst->pData; float16_t *pUT = ut->pData; @@ -185,7 +187,7 @@ arm_status status; /* status of matrix inverse */ float16_t *ut_row; float16_t *a_col; - for(j=0; j < n; j ++) + for(j=0; j < cols; j ++) { a_col = &pA[j]; @@ -193,19 +195,19 @@ arm_status status; /* status of matrix inverse */ { ut_row = &pUT[n*i]; - float16_t tmp=a_col[i * n]; + float16_t tmp=a_col[i * cols]; for(k=n-1; k > i; k--) { - tmp -= ut_row[k] * pX[n*k+j]; + tmp -= (_Float16)ut_row[k] * (_Float16)pX[cols*k+j]; } - if (ut_row[i]==0.0f) + if ((_Float16)ut_row[i]==0.0f16) { return(ARM_MATH_SINGULAR); } - tmp = tmp / ut_row[i]; - pX[i*n+j] = tmp; + tmp = (_Float16)tmp / (_Float16)ut_row[i]; + pX[i*cols+j] = tmp; } } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_upper_triangular_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_upper_triangular_f32.c index 074901d..4b3ef86 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_upper_triangular_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_upper_triangular_f32.c @@ -5,11 +5,13 @@ * Title: arm_mat_solve_upper_triangular_f32.c * Description: Solve linear system UT X = A with UT upper triangular matrix * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -63,7 +65,6 @@ arm_status status; /* status of matrix inverse */ /* Check for matrix mismatch condition */ if ((ut->numRows != ut->numCols) || - (a->numRows != a->numCols) || (ut->numRows != a->numRows) ) { /* Set status as ARM_MATH_SIZE_MISMATCH */ @@ -75,9 +76,10 @@ arm_status status; /* status of matrix inverse */ { - int i,j,k,n; + int i,j,k,n,cols; n = dst->numRows; + cols = dst->numCols; float32_t *pX = dst->pData; float32_t *pUT = ut->pData; @@ -93,13 +95,13 @@ arm_status status; /* status of matrix inverse */ for(i=n-1; i >= 0 ; i--) { - for(j=0; j+3 < n; j +=4) + for(j=0; j+3 < cols; j +=4) { - vecA = vld1q_f32(&pA[i * n + j]); + vecA = vld1q_f32(&pA[i * cols + j]); for(k=n-1; k > i; k--) { - vecX = vld1q_f32(&pX[n*k+j]); + vecX = vld1q_f32(&pX[cols*k+j]); vecA = vfmsq(vecA,vdupq_n_f32(pUT[n*i + k]),vecX); } @@ -112,20 +114,20 @@ arm_status status; /* status of matrix inverse */ vecA = vmulq(vecA,vdupq_n_f32(invUT)); - vst1q(&pX[i*n+j],vecA); + vst1q(&pX[i*cols+j],vecA); } - for(; j < n; j ++) + for(; j < cols; j ++) { a_col = &pA[j]; ut_row = &pUT[n*i]; - float32_t tmp=a_col[i * n]; + float32_t tmp=a_col[i * cols]; for(k=n-1; k > i; k--) { - tmp -= ut_row[k] * pX[n*k+j]; + tmp -= ut_row[k] * pX[cols*k+j]; } if (ut_row[i]==0.0f) @@ -133,7 +135,7 @@ arm_status status; /* status of matrix inverse */ return(ARM_MATH_SINGULAR); } tmp = tmp / ut_row[i]; - pX[i*n+j] = tmp; + pX[i*cols+j] = tmp; } } @@ -160,7 +162,6 @@ arm_status status; /* status of matrix inverse */ /* Check for matrix mismatch condition */ if ((ut->numRows != ut->numCols) || - (a->numRows != a->numCols) || (ut->numRows != a->numRows) ) { /* Set status as ARM_MATH_SIZE_MISMATCH */ @@ -172,9 +173,10 @@ arm_status status; /* status of matrix inverse */ { - int i,j,k,n; + int i,j,k,n,cols; n = dst->numRows; + cols = dst->numCols; float32_t *pX = dst->pData; float32_t *pUT = ut->pData; @@ -190,13 +192,13 @@ arm_status status; /* status of matrix inverse */ for(i=n-1; i >= 0 ; i--) { - for(j=0; j+3 < n; j +=4) + for(j=0; j+3 < cols; j +=4) { - vecA = vld1q_f32(&pA[i * n + j]); + vecA = vld1q_f32(&pA[i * cols + j]); for(k=n-1; k > i; k--) { - vecX = vld1q_f32(&pX[n*k+j]); + vecX = vld1q_f32(&pX[cols*k+j]); vecA = vfmsq_f32(vecA,vdupq_n_f32(pUT[n*i + k]),vecX); } @@ -209,20 +211,20 @@ arm_status status; /* status of matrix inverse */ vecA = vmulq_f32(vecA,vdupq_n_f32(invUT)); - vst1q_f32(&pX[i*n+j],vecA); + vst1q_f32(&pX[i*cols+j],vecA); } - for(; j < n; j ++) + for(; j < cols; j ++) { a_col = &pA[j]; ut_row = &pUT[n*i]; - float32_t tmp=a_col[i * n]; + float32_t tmp=a_col[i * cols]; for(k=n-1; k > i; k--) { - tmp -= ut_row[k] * pX[n*k+j]; + tmp -= ut_row[k] * pX[cols*k+j]; } if (ut_row[i]==0.0f) @@ -230,7 +232,7 @@ arm_status status; /* status of matrix inverse */ return(ARM_MATH_SINGULAR); } tmp = tmp / ut_row[i]; - pX[i*n+j] = tmp; + pX[i*cols+j] = tmp; } } @@ -256,7 +258,6 @@ arm_status status; /* status of matrix inverse */ /* Check for matrix mismatch condition */ if ((ut->numRows != ut->numCols) || - (a->numRows != a->numCols) || (ut->numRows != a->numRows) ) { /* Set status as ARM_MATH_SIZE_MISMATCH */ @@ -268,9 +269,7 @@ arm_status status; /* status of matrix inverse */ { - int i,j,k,n; - - n = dst->numRows; + int i,j,k,n,cols; float32_t *pX = dst->pData; float32_t *pUT = ut->pData; @@ -279,19 +278,22 @@ arm_status status; /* status of matrix inverse */ float32_t *ut_row; float32_t *a_col; - for(j=0; j < n; j ++) + n = dst->numRows; + cols = dst->numCols; + + for(j=0; j < cols; j ++) { a_col = &pA[j]; for(i=n-1; i >= 0 ; i--) { + float32_t tmp=a_col[i * cols]; + ut_row = &pUT[n*i]; - float32_t tmp=a_col[i * n]; - for(k=n-1; k > i; k--) { - tmp -= ut_row[k] * pX[n*k+j]; + tmp -= ut_row[k] * pX[cols*k+j]; } if (ut_row[i]==0.0f) @@ -299,7 +301,7 @@ arm_status status; /* status of matrix inverse */ return(ARM_MATH_SINGULAR); } tmp = tmp / ut_row[i]; - pX[i*n+j] = tmp; + pX[i*cols+j] = tmp; } } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_upper_triangular_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_upper_triangular_f64.c index d10eae2..ce6153b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_upper_triangular_f64.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_solve_upper_triangular_f64.c @@ -5,11 +5,13 @@ * Title: arm_mat_solve_upper_triangular_f64.c * Description: Solve linear system UT X = A with UT upper triangular matrix * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -58,7 +60,6 @@ arm_status status; /* status of matrix inverse */ /* Check for matrix mismatch condition */ if ((ut->numRows != ut->numCols) || - (a->numRows != a->numCols) || (ut->numRows != a->numRows) ) { /* Set status as ARM_MATH_SIZE_MISMATCH */ @@ -70,9 +71,7 @@ arm_status status; /* status of matrix inverse */ { - int i,j,k,n; - - n = dst->numRows; + int i,j,k,n,cols; float64_t *pX = dst->pData; float64_t *pUT = ut->pData; @@ -81,27 +80,30 @@ arm_status status; /* status of matrix inverse */ float64_t *ut_row; float64_t *a_col; - for(j=0; j < n; j ++) + n = dst->numRows; + cols = dst->numCols; + + for(j=0; j < cols; j ++) { a_col = &pA[j]; for(i=n-1; i >= 0 ; i--) { + float64_t tmp=a_col[i * cols]; + ut_row = &pUT[n*i]; - float64_t tmp=a_col[i * n]; - for(k=n-1; k > i; k--) { - tmp -= ut_row[k] * pX[n*k+j]; + tmp -= ut_row[k] * pX[cols*k+j]; } - if (ut_row[i]==0.0f) + if (ut_row[i]==0.0) { return(ARM_MATH_SINGULAR); } tmp = tmp / ut_row[i]; - pX[i*n+j] = tmp; + pX[i*cols+j] = tmp; } } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_f16.c index fb0f7b7..2e07194 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_f16.c @@ -5,13 +5,13 @@ * Title: arm_mat_sub_f16.c * Description: Floating-point matrix subtraction * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -62,7 +62,7 @@ arm_status arm_mat_sub_f16( arm_status status; /* status of matrix subtraction */ uint32_t numSamples; /* total number of elements in the matrix */ float16_t *pDataA, *pDataB, *pDataDst; - f16x8_t vecA, vecB, vecDst; + f16x8_t vecA, vecB, vecDst = { 0 }; float16_t const *pSrcAVec; float16_t const *pSrcBVec; uint32_t blkCnt; /* loop counters */ @@ -170,10 +170,10 @@ arm_status arm_mat_sub_f16( /* C(m,n) = A(m,n) - B(m,n) */ /* Subtract and store result in destination buffer. */ - *pOut++ = (*pInA++) - (*pInB++); - *pOut++ = (*pInA++) - (*pInB++); - *pOut++ = (*pInA++) - (*pInB++); - *pOut++ = (*pInA++) - (*pInB++); + *pOut++ = (_Float16)(*pInA++) - (_Float16)(*pInB++); + *pOut++ = (_Float16)(*pInA++) - (_Float16)(*pInB++); + *pOut++ = (_Float16)(*pInA++) - (_Float16)(*pInB++); + *pOut++ = (_Float16)(*pInA++) - (_Float16)(*pInB++); /* Decrement loop counter */ blkCnt--; @@ -194,7 +194,7 @@ arm_status arm_mat_sub_f16( /* C(m,n) = A(m,n) - B(m,n) */ /* Subtract and store result in destination buffer. */ - *pOut++ = (*pInA++) - (*pInB++); + *pOut++ = (_Float16)(*pInA++) - (_Float16)(*pInB++); /* Decrement loop counter */ blkCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_f32.c index 0748e08..df58b98 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_f32.c @@ -5,13 +5,13 @@ * Title: arm_mat_sub_f32.c * Description: Floating-point matrix subtraction * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -38,8 +38,27 @@ @defgroup MatrixSub Matrix Subtraction Subtract two matrices. - \image html MatrixSubtraction.gif "Subraction of two 3 x 3 matrices" - + @par Subraction of two 3 x 3 matrices + + \f[ + \begin{pmatrix} + a_{1,1} & a_{1,2} & a_{1,3} \\ + a_{2,1} & a_{2,2} & a_{2,3} \\ + a_{3,1} & a_{3,2} & a_{3,3} \\ + \end{pmatrix} + - + \begin{pmatrix} + b_{1,1} & b_{1,2} & b_{1,3} \\ + b_{2,1} & b_{2,2} & b_{2,3} \\ + b_{3,1} & b_{3,2} & b_{3,3} \\ + \end{pmatrix} + = + \begin{pmatrix} + a_{1,1}-b_{1,1} & a_{1,2}-b_{1,2} & a_{1,3}-b_{1,3} \\ + a_{2,1}-b_{2,1} & a_{2,2}-b_{2,2} & a_{2,3}-b_{2,3} \\ + a_{3,1}-b_{3,1} & a_{3,2}-b_{3,2} & a_{3,3}-b_{3,3} \\ + \end{pmatrix} + \f] The functions check to make sure that pSrcA, pSrcB, and pDst have the same number of rows and columns. @@ -68,7 +87,7 @@ arm_status arm_mat_sub_f32( arm_status status; /* status of matrix subtraction */ uint32_t numSamples; /* total number of elements in the matrix */ float32_t *pDataA, *pDataB, *pDataDst; - f32x4_t vecA, vecB, vecDst; + f32x4_t vecA, vecB, vecDst = { 0 }; float32_t const *pSrcAVec; float32_t const *pSrcBVec; uint32_t blkCnt; /* loop counters */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_f64.c index e41c7dc..3f405d6 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_f64.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_f64.c @@ -5,13 +5,13 @@ * Title: arm_mat_sub_f64.c * Description: Floating-point matrix subtraction * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -34,16 +34,6 @@ @ingroup groupMatrix */ -/** - @defgroup MatrixSub Matrix Subtraction - - Subtract two matrices. - \image html MatrixSubtraction.gif "Subraction of two 3 x 3 matrices" - - The functions check to make sure that - pSrcA, pSrcB, and pDst have the same - number of rows and columns. - */ /** @addtogroup MatrixSub diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_q15.c index dff3aa1..e611663 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_q15.c @@ -5,13 +5,13 @@ * Title: arm_mat_sub_q15.c * Description: Q15 Matrix subtraction * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -61,7 +61,7 @@ arm_status arm_mat_sub_q15( { uint32_t numSamples; /* total number of elements in the matrix */ q15_t *pDataA, *pDataB, *pDataDst; - q15x8_t vecA, vecB, vecDst; + q15x8_t vecA, vecB, vecDst = { 0 }; q15_t const *pSrcAVec; q15_t const *pSrcBVec; uint32_t blkCnt; /* loop counters */ @@ -169,8 +169,8 @@ arm_status arm_mat_sub_q15( /* Subtract, Saturate and store result in destination buffer. */ #if defined (ARM_MATH_DSP) - write_q15x2_ia (&pOut, __QSUB16(read_q15x2_ia ((q15_t **) &pInA), read_q15x2_ia ((q15_t **) &pInB))); - write_q15x2_ia (&pOut, __QSUB16(read_q15x2_ia ((q15_t **) &pInA), read_q15x2_ia ((q15_t **) &pInB))); + write_q15x2_ia (&pOut, __QSUB16(read_q15x2_ia (&pInA), read_q15x2_ia (&pInB))); + write_q15x2_ia (&pOut, __QSUB16(read_q15x2_ia (&pInA), read_q15x2_ia (&pInB))); #else *pOut++ = (q15_t) __SSAT(((q31_t) * pInA++ - *pInB++), 16); *pOut++ = (q15_t) __SSAT(((q31_t) * pInA++ - *pInB++), 16); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_q31.c index b81ca7c..9643bdc 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_sub_q31.c @@ -5,13 +5,13 @@ * Title: arm_mat_sub_q31.c * Description: Q31 matrix subtraction * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -60,7 +60,7 @@ arm_status arm_mat_sub_q31( { uint32_t numSamples; /* total number of elements in the matrix */ q31_t *pDataA, *pDataB, *pDataDst; - q31x4_t vecA, vecB, vecDst; + q31x4_t vecA, vecB, vecDst = { 0 }; q31_t const *pSrcAVec; q31_t const *pSrcBVec; uint32_t blkCnt; /* loop counters */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_f16.c index b63e988..b162f2c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_f16.c @@ -5,13 +5,13 @@ * Title: arm_mat_trans_f16.c * Description: Floating-point matrix transpose * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_f32.c index 906d755..b2baa63 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_f32.c @@ -5,13 +5,13 @@ * Title: arm_mat_trans_f32.c * Description: Floating-point matrix transpose * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -40,7 +40,23 @@ Tranposes a matrix. Transposing an M x N matrix flips it around the center diagonal and results in an N x M matrix. - \image html MatrixTranspose.gif "Transpose of a 3 x 3 matrix" + + @par Transpose of a 3 x 3 matrix + + \f[ + \begin{pmatrix} + a_{1,1} & a_{1,2} & a_{1,3} \\ + a_{2,1} & a_{2,2} & a_{2,3} \\ + a_{3,1} & a_{3,2} & a_{3,3} \\ + \end{pmatrix}^T + = + \begin{pmatrix} + a_{1,1} & a_{2,1} & a_{3,1} \\ + a_{1,2} & a_{2,2} & a_{3,2} \\ + a_{1,3} & a_{2,3} & a_{3,3} \\ + \end{pmatrix} + \f] + */ /** diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_f64.c index d4d94a4..d01ce3b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_f64.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_f64.c @@ -5,13 +5,13 @@ * Title: arm_mat_trans_f64.c * Description: Floating-point matrix transpose * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -34,14 +34,7 @@ @ingroup groupMatrix */ -/** - @defgroup MatrixTrans Matrix Transpose - - Tranposes a matrix. - Transposing an M x N matrix flips it around the center diagonal and results in an N x M matrix. - \image html MatrixTranspose.gif "Transpose of a 3 x 3 matrix" - */ /** @addtogroup MatrixTrans diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_q15.c index 9a39c08..de00d1b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_q15.c @@ -5,13 +5,13 @@ * Title: arm_mat_trans_q15.c * Description: Q15 matrix transpose * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -142,7 +142,7 @@ arm_status arm_mat_trans_q15( while (col > 0U) /* column loop */ { /* Read two elements from row */ - in = read_q15x2_ia ((q15_t **) &pIn); + in = read_q15x2_ia (&pIn); /* Unpack and store one element in destination */ #ifndef ARM_MATH_BIG_ENDIAN @@ -165,7 +165,7 @@ arm_status arm_mat_trans_q15( pOut += nRows; /* Read two elements from row */ - in = read_q15x2_ia ((q15_t **) &pIn); + in = read_q15x2_ia (&pIn); /* Unpack and store one element in destination */ #ifndef ARM_MATH_BIG_ENDIAN diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_q31.c index be2a306..4f77a28 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_q31.c @@ -5,13 +5,13 @@ * Title: arm_mat_trans_q31.c * Description: Q31 matrix transpose * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_q7.c index cd40f97..666cdfa 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_trans_q7.c @@ -5,13 +5,13 @@ * Title: arm_mat_trans_q7.c * Description: Q7 matrix transpose * - * $Date: 06. July 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -63,10 +63,10 @@ arm_status arm_mat_trans_q7(const arm_matrix_instance_q7 *pSrc, arm_matrix_insta #ifdef ARM_MATH_MATRIX_CHECK /* Check for matrix mismatch condition */ - if ((pSrc->numRows != pDst->dstCols) || (pSrc->srcCols != pDst->numCols)) + if ((pSrc->numRows != pDst->numCols) || (pSrc->numCols != pDst->numRows)) { /* Set status as ARM_MATH_SIZE_MISMATCH */ - return = ARM_MATH_SIZE_MISMATCH; + return ARM_MATH_SIZE_MISMATCH; } #endif diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_f16.c index 7944086..fb7e53c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_f16.c @@ -5,12 +5,14 @@ * Title: arm_mat_vec_mult_f16.c * Description: Floating-point matrix and vector multiplication * - * $Date: 07. July 202 + * $Date: 23 April 2021 * - * Target Processor: Cortex-M cores + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -310,10 +312,10 @@ void arm_mat_vec_mult_f16(const arm_matrix_instance_f16 *pSrcMat, const float16_ pInVec = pVec; /* Initialize accumulators */ - float16_t sum1 = 0.0f; - float16_t sum2 = 0.0f; - float16_t sum3 = 0.0f; - float16_t sum4 = 0.0f; + float16_t sum1 = 0.0f16; + float16_t sum2 = 0.0f16; + float16_t sum3 = 0.0f16; + float16_t sum4 = 0.0f16; /* Loop unrolling: process 2 columns per iteration */ colCnt = numCols; @@ -331,13 +333,13 @@ void arm_mat_vec_mult_f16(const arm_matrix_instance_f16 *pSrcMat, const float16_ vecData = *(pInVec)++; // Read 8 values from the matrix - 2 values from each of 4 rows, and do multiply accumulate matData = *(pInA1)++; - sum1 += matData * vecData; + sum1 += (_Float16)matData * (_Float16)vecData; matData = *(pInA2)++; - sum2 += matData * vecData; + sum2 += (_Float16)matData * (_Float16)vecData; matData = *(pInA3)++; - sum3 += matData * vecData; + sum3 += (_Float16)matData * (_Float16)vecData; matData = *(pInA4)++; - sum4 += matData * vecData; + sum4 += (_Float16)matData * (_Float16)vecData; // Decrement the loop counter colCnt--; @@ -359,7 +361,7 @@ void arm_mat_vec_mult_f16(const arm_matrix_instance_f16 *pSrcMat, const float16_ row = numRows & 3u; while (row > 0) { - float16_t sum = 0.0f; + float16_t sum = 0.0f16; pInVec = pVec; pInA1 = pSrcA + i; @@ -370,14 +372,14 @@ void arm_mat_vec_mult_f16(const arm_matrix_instance_f16 *pSrcMat, const float16_ vecData2 = *(pInVec)++; matData = *(pInA1)++; matData2 = *(pInA1)++; - sum += matData * vecData; - sum += matData2 * vecData2; + sum += (_Float16)matData * (_Float16)vecData; + sum += (_Float16)matData2 * (_Float16)vecData2; colCnt--; } // process remainder of row colCnt = numCols & 1u; while (colCnt > 0) { - sum += *pInA1++ * *pInVec++; + sum += (_Float16)*pInA1++ * (_Float16)*pInVec++; colCnt--; } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_f32.c index 67b390a..145ec15 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_f32.c @@ -5,12 +5,14 @@ * Title: arm_mat_vec_mult_f32.c * Description: Floating-point matrix and vector multiplication * - * $Date: 07. July 202 + * $Date: 23 April 2021 * - * Target Processor: Cortex-M cores + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -165,7 +167,7 @@ void arm_mat_vec_mult_f32( } /* - * compute 2 rows in parrallel + * compute 2 rows in parallel */ if (row >= 2) { @@ -310,16 +312,16 @@ void arm_mat_vec_mult_f32(const arm_matrix_instance_f32 *pSrcMat, const float32_ /* The following loop performs the dot-product of each row in pSrcA with the vector */ /* row loop */ while (row > 0) { - /* For every row wise process, the pInVec pointer is set - ** to the starting address of the vector */ - pInVec = pVec; - /* Initialize accumulators */ float32_t sum1 = 0.0f; float32_t sum2 = 0.0f; float32_t sum3 = 0.0f; float32_t sum4 = 0.0f; + /* For every row wise process, the pInVec pointer is set + ** to the starting address of the vector */ + pInVec = pVec; + /* Loop unrolling: process 2 columns per iteration */ colCnt = numCols; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_q15.c index 177de77..9d9b1b4 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_q15.c @@ -5,12 +5,14 @@ * Title: arm_mat_vec_mult_q15.c * Description: Q15 matrix and vector multiplication * - * $Date: 07. July 202 + * $Date: 23 April 2021 * - * Target Processor: Cortex-M cores + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -289,16 +291,16 @@ void arm_mat_vec_mult_q15(const arm_matrix_instance_q15 *pSrcMat, const q15_t *p /* The following loop performs the dot-product of each row in pSrcA with the vector */ /* row loop */ while (row > 0) { - /* For every row wise process, the pInVec pointer is set - ** to the starting address of the vector */ - pInVec = pVec; - /* Initialize accumulators */ q63_t sum1 = 0; q63_t sum2 = 0; q63_t sum3 = 0; q63_t sum4 = 0; + /* For every row wise process, the pInVec pointer is set + ** to the starting address of the vector */ + pInVec = pVec; + /* Loop unrolling: process 2 columns per iteration */ colCnt = numCols >> 1; @@ -311,16 +313,16 @@ void arm_mat_vec_mult_q15(const arm_matrix_instance_q15 *pSrcMat, const q15_t *p // Main loop: matrix-vector multiplication while (colCnt > 0u) { // Read 2 values from vector - vecData = read_q15x2_ia ((q15_t **) &pInVec); + vecData = read_q15x2_ia (&pInVec); // Read 8 values from the matrix - 2 values from each of 4 rows, and do multiply accumulate - matData = read_q15x2_ia ((q15_t **) &pInA1); + matData = read_q15x2_ia (&pInA1); sum1 = __SMLALD(matData, vecData, sum1); - matData = read_q15x2_ia ((q15_t **) &pInA2); + matData = read_q15x2_ia (&pInA2); sum2 = __SMLALD(matData, vecData, sum2); - matData = read_q15x2_ia ((q15_t **) &pInA3); + matData = read_q15x2_ia (&pInA3); sum3 = __SMLALD(matData, vecData, sum3); - matData = read_q15x2_ia ((q15_t **) &pInA4); + matData = read_q15x2_ia (&pInA4); sum4 = __SMLALD(matData, vecData, sum4); // Decrement the loop counter @@ -361,10 +363,10 @@ void arm_mat_vec_mult_q15(const arm_matrix_instance_q15 *pSrcMat, const q15_t *p colCnt = numCols >> 2; while (colCnt > 0) { - vecData = read_q15x2_ia ((q15_t **) &pInVec); - vecData2 = read_q15x2_ia ((q15_t **) &pInVec); - matData = read_q15x2_ia ((q15_t **) &pInA1); - matData2 = read_q15x2_ia ((q15_t **) &pInA1); + vecData = read_q15x2_ia (&pInVec); + vecData2 = read_q15x2_ia (&pInVec); + matData = read_q15x2_ia (&pInA1); + matData2 = read_q15x2_ia (&pInA1); sum = __SMLALD(matData, vecData, sum); sum = __SMLALD(matData2, vecData2, sum); colCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_q31.c index f9ab581..6e0b855 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_q31.c @@ -5,12 +5,14 @@ * Title: arm_mat_vec_mult_q31.c * Description: Q31 matrix and vector multiplication * - * $Date: 07. July 202 + * $Date: 23 April 2021 * - * Target Processor: Cortex-M cores + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -286,16 +288,16 @@ void arm_mat_vec_mult_q31(const arm_matrix_instance_q31 *pSrcMat, const q31_t *p /* The following loop performs the dot-product of each row in pSrcA with the vector */ /* row loop */ while (row > 0) { - /* For every row wise process, the pInVec pointer is set - ** to the starting address of the vector */ - pInVec = pVec; - /* Initialize accumulators */ q63_t sum1 = 0; q63_t sum2 = 0; q63_t sum3 = 0; q63_t sum4 = 0; + /* For every row wise process, the pInVec pointer is set + ** to the starting address of the vector */ + pInVec = pVec; + /* Loop unrolling: process 2 columns per iteration */ colCnt = numCols; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_q7.c index d4e4d21..5262ce3 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/MatrixFunctions/arm_mat_vec_mult_q7.c @@ -5,12 +5,14 @@ * Title: arm_mat_vec_mult_q7.c * Description: Q7 matrix and vector multiplication * - * $Date: 07. July 202 + * $Date: 23 April 2021 * - * Target Processor: Cortex-M cores + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -301,16 +303,16 @@ void arm_mat_vec_mult_q7(const arm_matrix_instance_q7 *pSrcMat, const q7_t *pVec /* The following loop performs the dot-product of each row in pSrcA with the vector */ while (row > 0) { - /* For every row wise process, the pInVec pointer is set - ** to the starting address of the vector */ - pInVec = pVec; - /* Initialize accumulators */ q31_t sum1 = 0; q31_t sum2 = 0; q31_t sum3 = 0; q31_t sum4 = 0; + /* For every row wise process, the pInVec pointer is set + ** to the starting address of the vector */ + pInVec = pVec; + /* Loop unrolling: process 4 columns per iteration */ colCnt = numCols >> 2; @@ -325,26 +327,26 @@ void arm_mat_vec_mult_q7(const arm_matrix_instance_q7 *pSrcMat, const q7_t *pVec while (colCnt > 0u) { // Read 4 values from vector - vecData = read_q7x4_ia ((q7_t **) &pInVec); + vecData = read_q7x4_ia (&pInVec); vecData2 = __SXTB16(__ROR(vecData, 8)); vecData = __SXTB16(vecData); // Read 16 values from the matrix - 4 values from each of 4 rows, and do multiply accumulate - matData = read_q7x4_ia ((q7_t **) &pInA1); + matData = read_q7x4_ia (&pInA1); matData2 = __SXTB16(__ROR(matData, 8)); matData = __SXTB16(matData); sum1 = __SMLAD(matData, vecData, sum1); sum1 = __SMLAD(matData2, vecData2, sum1); - matData = read_q7x4_ia ((q7_t **) &pInA2); + matData = read_q7x4_ia (&pInA2); matData2 = __SXTB16(__ROR(matData, 8)); matData = __SXTB16(matData); sum2 = __SMLAD(matData, vecData, sum2); sum2 = __SMLAD(matData2, vecData2, sum2); - matData = read_q7x4_ia ((q7_t **) &pInA3); + matData = read_q7x4_ia (&pInA3); matData2 = __SXTB16(__ROR(matData, 8)); matData = __SXTB16(matData); sum3 = __SMLAD(matData, vecData, sum3); sum3 = __SMLAD(matData2, vecData2, sum3); - matData = read_q7x4_ia ((q7_t **) &pInA4); + matData = read_q7x4_ia (&pInA4); matData2 = __SXTB16(__ROR(matData, 8)); matData = __SXTB16(matData); sum4 = __SMLAD(matData, vecData, sum4); @@ -391,10 +393,10 @@ void arm_mat_vec_mult_q7(const arm_matrix_instance_q7 *pSrcMat, const q7_t *pVec colCnt = numCols >> 2; while (colCnt > 0) { - vecData = read_q7x4_ia ((q7_t **) &pInVec); + vecData = read_q7x4_ia (&pInVec); vecData2 = __SXTB16(__ROR(vecData, 8)); vecData = __SXTB16(vecData); - matData = read_q7x4_ia ((q7_t **) &pInA1); + matData = read_q7x4_ia (&pInA1); matData2 = __SXTB16(__ROR(matData, 8)); matData = __SXTB16(matData); sum = __SMLAD(matData, vecData, sum); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion2rotation_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion2rotation_f32.c index 25ff0de..6d1ee09 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion2rotation_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion2rotation_f32.c @@ -5,8 +5,10 @@ * Title: arm_quaternion2rotation_f32.c * Description: Floating-point quaternion 2 rotation conversion * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. @@ -145,7 +147,8 @@ void arm_quaternion2rotation_f32(const float32_t *pInputQuaternions, float32_t *pOutputRotations, uint32_t nbQuaternions) { - for(uint32_t nb=0; nb < nbQuaternions; nb++) + uint32_t nb; + for(nb=0; nb < nbQuaternions; nb++) { float32_t q00 = SQ(pInputQuaternions[0 + nb * 4]); float32_t q11 = SQ(pInputQuaternions[1 + nb * 4]); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_conjugate_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_conjugate_f32.c index c6d6df1..c3d80f9 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_conjugate_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_conjugate_f32.c @@ -5,8 +5,10 @@ * Title: arm_quaternion_conjugate_f32.c * Description: Floating-point quaternion conjugate * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. @@ -81,7 +83,8 @@ void arm_quaternion_conjugate_f32(const float32_t *pInputQuaternions, float32_t *pConjugateQuaternions, uint32_t nbQuaternions) { - for(uint32_t i=0; i < nbQuaternions; i++) + uint32_t i; + for(i=0; i < nbQuaternions; i++) { pConjugateQuaternions[4 * i + 0] = pInputQuaternions[4 * i + 0]; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_inverse_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_inverse_f32.c index df24db7..d4227eb 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_inverse_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_inverse_f32.c @@ -5,8 +5,10 @@ * Title: arm_quaternion_inverse_f32.c * Description: Floating-point quaternion inverse * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. @@ -92,7 +94,8 @@ void arm_quaternion_inverse_f32(const float32_t *pInputQuaternions, { float32_t temp; - for(uint32_t i=0; i < nbQuaternions; i++) + uint32_t i; + for(i=0; i < nbQuaternions; i++) { temp = SQ(pInputQuaternions[4 * i + 0]) + diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_norm_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_norm_f32.c index a793d01..e5a6130 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_norm_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_norm_f32.c @@ -5,8 +5,10 @@ * Title: arm_quaternion_norm_f32.c * Description: Floating-point quaternion Norm * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. @@ -84,8 +86,9 @@ void arm_quaternion_norm_f32(const float32_t *pInputQuaternions, uint32_t nbQuaternions) { float32_t temp; + uint32_t i; - for(uint32_t i=0; i < nbQuaternions; i++) + for(i=0; i < nbQuaternions; i++) { temp = SQ(pInputQuaternions[4 * i + 0]) + SQ(pInputQuaternions[4 * i + 1]) + diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_normalize_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_normalize_f32.c index 70ec340..1380f6b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_normalize_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_normalize_f32.c @@ -5,8 +5,10 @@ * Title: arm_quaternion_normalize_f32.c * Description: Floating-point quaternion normalization * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. @@ -85,7 +87,8 @@ void arm_quaternion_normalize_f32(const float32_t *pInputQuaternions, { float32_t temp; - for(uint32_t i=0; i < nbQuaternions; i++) + uint32_t i; + for(i=0; i < nbQuaternions; i++) { temp = SQ(pInputQuaternions[4 * i + 0]) + SQ(pInputQuaternions[4 * i + 1]) + diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_product_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_product_f32.c index bfb996d..fef8388 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_product_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_product_f32.c @@ -5,8 +5,10 @@ * Title: arm_quaternion_product_f32.c * Description: Floating-point quaternion product * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. @@ -132,7 +134,8 @@ void arm_quaternion_product_f32(const float32_t *qa, float32_t *qr, uint32_t nbQuaternions) { - for(uint32_t i=0; i < nbQuaternions; i++) + uint32_t i; + for(i=0; i < nbQuaternions; i++) { arm_quaternion_product_single_f32(qa, qb, qr); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_product_single_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_product_single_f32.c index 54f56e8..e8149fd 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_product_single_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_quaternion_product_single_f32.c @@ -5,8 +5,10 @@ * Title: arm_quaternion_product_single_f32.c * Description: Floating-point quaternion product * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_rotation2quaternion_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_rotation2quaternion_f32.c index 0632ce7..54d56a1 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_rotation2quaternion_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/QuaternionMathFunctions/arm_rotation2quaternion_f32.c @@ -5,8 +5,10 @@ * Title: arm_rotation2quaternion_f32.c * Description: Floating-point rotation to quaternion conversion * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. @@ -100,51 +102,51 @@ void arm_rotation2quaternion_f32(const float32_t *pInputRotations, if (trace > 0) { - (void)arm_sqrt_f32(trace + 1.0, &doubler) ; // invs=4*qw - doubler = 2*doubler; - s = 1.0 / doubler; + (void)arm_sqrt_f32(trace + 1.0f, &doubler) ; // invs=4*qw + doubler = 2.0f*doubler; + s = 1.0f / doubler; q1 = vmulq_n_f32(q1,s); q2 = vmulq_n_f32(q2,s); - q[0] = 0.25 * doubler; + q[0] = 0.25f * doubler; q[1] = R21 - R12; q[2] = R02 - R20; q[3] = R10 - R01; } else if ((R00 > R11) && (R00 > R22) ) { - (void)arm_sqrt_f32(1.0 + R00 - R11 - R22,&doubler); // invs=4*qx - doubler = 2*doubler; - s = 1.0 / doubler; + (void)arm_sqrt_f32(1.0f + R00 - R11 - R22,&doubler); // invs=4*qx + doubler = 2.0f*doubler; + s = 1.0f / doubler; q1 = vmulq_n_f32(q1,s); q2 = vmulq_n_f32(q2,s); q[0] = R21 - R12; - q[1] = 0.25 * doubler; + q[1] = 0.25f * doubler; q[2] = R01 + R10; q[3] = R02 + R20; } else if (R11 > R22) { - (void)arm_sqrt_f32(1.0 + R11 - R00 - R22,&doubler); // invs=4*qy - doubler = 2*doubler; - s = 1.0 / doubler; + (void)arm_sqrt_f32(1.0f + R11 - R00 - R22,&doubler); // invs=4*qy + doubler = 2.0f*doubler; + s = 1.0f / doubler; q1 = vmulq_n_f32(q1,s); q2 = vmulq_n_f32(q2,s); q[0] = R02 - R20; q[1] = R01 + R10; - q[2] = 0.25 * doubler; + q[2] = 0.25f * doubler; q[3] = R12 + R21; } else { - (void)arm_sqrt_f32(1.0 + R22 - R00 - R11,&doubler); // invs=4*qz - doubler = 2*doubler; - s = 1.0 / doubler; + (void)arm_sqrt_f32(1.0f + R22 - R00 - R11,&doubler); // invs=4*qz + doubler = 2.0f*doubler; + s = 1.0f / doubler; q1 = vmulq_n_f32(q1,s); q2 = vmulq_n_f32(q2,s); @@ -152,7 +154,7 @@ void arm_rotation2quaternion_f32(const float32_t *pInputRotations, q[0] = R10 - R01; q[1] = R02 + R20; q[2] = R12 + R21; - q[3] = 0.25 * doubler; + q[3] = 0.25f * doubler; } vst1q(pOutputQuaternions, q); @@ -166,7 +168,8 @@ void arm_rotation2quaternion_f32(const float32_t *pInputRotations, float32_t *pOutputQuaternions, uint32_t nbQuaternions) { - for(uint32_t nb=0; nb < nbQuaternions; nb++) + uint32_t nb; + for(nb=0; nb < nbQuaternions; nb++) { const float32_t *r=&pInputRotations[nb*9]; float32_t *q=&pOutputQuaternions[nb*4]; @@ -178,41 +181,41 @@ void arm_rotation2quaternion_f32(const float32_t *pInputRotations, - if (trace > 0) + if (trace > 0.0f) { - doubler = sqrtf(trace + 1.0) * 2; // invs=4*qw - s = 1.0 / doubler; - q[0] = 0.25 * doubler; + doubler = sqrtf(trace + 1.0f) * 2.0f; // invs=4*qw + s = 1.0f / doubler; + q[0] = 0.25f * doubler; q[1] = (RI(2,1) - RI(1,2)) * s; q[2] = (RI(0,2) - RI(2,0)) * s; q[3] = (RI(1,0) - RI(0,1)) * s; } else if ((RI(0,0) > RI(1,1)) && (RI(0,0) > RI(2,2)) ) { - doubler = sqrtf(1.0 + RI(0,0) - RI(1,1) - RI(2,2)) * 2; // invs=4*qx - s = 1.0 / doubler; + doubler = sqrtf(1.0f + RI(0,0) - RI(1,1) - RI(2,2)) * 2.0f; // invs=4*qx + s = 1.0f / doubler; q[0] = (RI(2,1) - RI(1,2)) * s; - q[1] = 0.25 * doubler; + q[1] = 0.25f * doubler; q[2] = (RI(0,1) + RI(1,0)) * s; q[3] = (RI(0,2) + RI(2,0)) * s; } else if (RI(1,1) > RI(2,2)) { - doubler = sqrtf(1.0 + RI(1,1) - RI(0,0) - RI(2,2)) * 2; // invs=4*qy - s = 1.0 / doubler; + doubler = sqrtf(1.0f + RI(1,1) - RI(0,0) - RI(2,2)) * 2.0f; // invs=4*qy + s = 1.0f / doubler; q[0] = (RI(0,2) - RI(2,0)) * s; q[1] = (RI(0,1) + RI(1,0)) * s; - q[2] = 0.25 * doubler; + q[2] = 0.25f * doubler; q[3] = (RI(1,2) + RI(2,1)) * s; } else { - doubler = sqrtf(1.0 + RI(2,2) - RI(0,0) - RI(1,1)) * 2; // invs=4*qz - s = 1.0 / doubler; + doubler = sqrtf(1.0f + RI(2,2) - RI(0,0) - RI(1,1)) * 2.0f; // invs=4*qz + s = 1.0f / doubler; q[0] = (RI(1,0) - RI(0,1)) * s; q[1] = (RI(0,2) + RI(2,0)) * s; q[2] = (RI(1,2) + RI(2,1)) * s; - q[3] = 0.25 * doubler; + q[3] = 0.25f * doubler; } } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_linear_init_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_linear_init_f16.c index 1190975..71bb9cb 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_linear_init_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_linear_init_f16.c @@ -5,11 +5,13 @@ * Title: arm_svm_linear_init_f16.c * Description: SVM Linear Instance Initialization * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -33,20 +35,11 @@ #include #include -/** - * @defgroup groupSVM SVM Functions - * - */ /** @ingroup groupSVM */ -/** - @defgroup linearsvm Linear SVM - - Linear SVM classifier - */ /** * @addtogroup linearsvm diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_linear_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_linear_init_f32.c index 989bf76..4c92653 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_linear_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_linear_init_f32.c @@ -5,11 +5,13 @@ * Title: arm_svm_linear_init_f32.c * Description: SVM Linear Instance Initialization * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_linear_predict_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_linear_predict_f16.c index 2f9ca3c..8e5a55c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_linear_predict_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_linear_predict_f16.c @@ -5,11 +5,13 @@ * Title: arm_svm_linear_predict_f16.c * Description: SVM Linear Classifier * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -298,9 +300,9 @@ void arm_svm_linear_predict_f16( dot=0; for(j=0; j < S->vectorDimension; j++) { - dot = dot + in[j]* *pSupport++; + dot = (_Float16)dot + (_Float16)in[j]* (_Float16)*pSupport++; } - sum += S->dualCoefficients[i] * dot; + sum += (_Float16)S->dualCoefficients[i] * (_Float16)dot; } *pResult=S->classes[STEP(sum)]; } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_linear_predict_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_linear_predict_f32.c index b6d1dfe..8cf9678 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_linear_predict_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_linear_predict_f32.c @@ -5,11 +5,13 @@ * Title: arm_svm_linear_predict_f32.c * Description: SVM Linear Classifier * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_polynomial_init_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_polynomial_init_f16.c index 9dfe908..a2ed980 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_polynomial_init_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_polynomial_init_f16.c @@ -5,11 +5,13 @@ * Title: arm_svm_polynomial_init_f16.c * Description: SVM Polynomial Instance Initialization * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -37,11 +39,6 @@ @ingroup groupSVM */ -/** - @defgroup polysvm Polynomial SVM - - Polynomial SVM classifier - */ /** * @addtogroup polysvm diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_polynomial_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_polynomial_init_f32.c index cef8d12..082399b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_polynomial_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_polynomial_init_f32.c @@ -5,11 +5,13 @@ * Title: arm_svm_polynomial_init_f32.c * Description: SVM Polynomial Instance Initialization * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_polynomial_predict_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_polynomial_predict_f16.c index 3e8a127..3cd6912 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_polynomial_predict_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_polynomial_predict_f16.c @@ -5,11 +5,13 @@ * Title: arm_svm_polynomial_predict_f16.c * Description: SVM Polynomial Classifier * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -33,6 +35,28 @@ #include #include +#if !defined(ARM_MATH_MVE_FLOAT16) || defined(ARM_MATH_AUTOVECTORIZE) + +/* + +_Float16 is not supported in g++ so we avoid putting _Float16 definitions +in the public headers. + +This function should at some point be moved in FastMath. + +*/ +__STATIC_INLINE float16_t arm_exponent_f16(float16_t x, int32_t nb) +{ + float16_t r = x; + nb --; + while(nb > 0) + { + r = (_Float16)r * (_Float16)x; + nb--; + } + return(r); +} +#endif /** * @addtogroup polysvm @@ -40,6 +64,13 @@ */ + + +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_math_f16.h" + /** * @brief SVM polynomial prediction * @param[in] S Pointer to an instance of the polynomial SVM structure. @@ -48,12 +79,6 @@ * @return none. * */ - -#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) - -#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" -#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_math_f16.h" - void arm_svm_polynomial_predict_f16( const arm_svm_polynomial_instance_f16 *S, const float16_t * in, @@ -303,6 +328,16 @@ void arm_svm_polynomial_predict_f16( } #else + + +/** + * @brief SVM polynomial prediction + * @param[in] S Pointer to an instance of the polynomial SVM structure. + * @param[in] in Pointer to input vector + * @param[out] pResult Decision value + * @return none. + * + */ void arm_svm_polynomial_predict_f16( const arm_svm_polynomial_instance_f16 *S, const float16_t * in, @@ -318,9 +353,9 @@ void arm_svm_polynomial_predict_f16( dot=0; for(j=0; j < S->vectorDimension; j++) { - dot = dot + (_Float16)in[j]* (_Float16)*pSupport++; + dot = (_Float16)dot + (_Float16)in[j]* (_Float16)*pSupport++; } - sum += S->dualCoefficients[i] * (_Float16)arm_exponent_f16(S->gamma * dot + S->coef0, S->degree); + sum += (_Float16)S->dualCoefficients[i] * (_Float16)arm_exponent_f16((_Float16)S->gamma * (_Float16)dot + (_Float16)S->coef0, S->degree); } *pResult=S->classes[STEP(sum)]; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_polynomial_predict_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_polynomial_predict_f32.c index 31fc471..2d97e2b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_polynomial_predict_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_polynomial_predict_f32.c @@ -5,11 +5,13 @@ * Title: arm_svm_polynomial_predict_f32.c * Description: SVM Polynomial Classifier * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_rbf_init_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_rbf_init_f16.c index 1f0bcf5..5b2492f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_rbf_init_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_rbf_init_f16.c @@ -5,11 +5,13 @@ * Title: arm_svm_rbf_init_f16.c * Description: SVM Radial Basis Function Instance Initialization * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -37,11 +39,6 @@ @ingroup groupSVM */ -/** - @defgroup rbfsvm RBF SVM - - RBF SVM classifier - */ /** diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_rbf_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_rbf_init_f32.c index cd2c620..9fddb02 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_rbf_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_rbf_init_f32.c @@ -5,11 +5,13 @@ * Title: arm_svm_rbf_init_f32.c * Description: SVM Radial Basis Function Instance Initialization * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_rbf_predict_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_rbf_predict_f16.c index 056562f..15dd7e6 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_rbf_predict_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_rbf_predict_f16.c @@ -5,11 +5,13 @@ * Title: arm_svm_rbf_predict_f16.c * Description: SVM Radial Basis Function Classifier * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -70,7 +72,7 @@ void arm_svm_rbf_predict_f16( uint32_t blkCnt; /* loop counters */ const float16_t *pDualCoef = S->dualCoefficients; _Float16 sum = S->intercept; - f16x8_t vSum = vdupq_n_f16(0); + f16x8_t vSum = vdupq_n_f16(0.0f16); row = numRows; @@ -97,10 +99,10 @@ void arm_svm_rbf_predict_f16( /* * reset accumulators */ - acc0 = vdupq_n_f16(0.0f); - acc1 = vdupq_n_f16(0.0f); - acc2 = vdupq_n_f16(0.0f); - acc3 = vdupq_n_f16(0.0f); + acc0 = vdupq_n_f16(0.0f16); + acc1 = vdupq_n_f16(0.0f16); + acc2 = vdupq_n_f16(0.0f16); + acc3 = vdupq_n_f16(0.0f16); pSrcA0Vec = pInA0; pSrcA1Vec = pInA1; @@ -170,7 +172,7 @@ void arm_svm_rbf_predict_f16( vSum = vfmaq_m_f16(vSum, vld1q(pDualCoef), - vexpq_f16(vmulq_n_f16(vtmp, -S->gamma)),vctp16q(4)); + vexpq_f16(vmulq_n_f16(vtmp, -(_Float16)S->gamma)),vctp16q(4)); pDualCoef += 4; pSrcA += numCols * 4; /* @@ -199,8 +201,8 @@ void arm_svm_rbf_predict_f16( /* * reset accumulators */ - acc0 = vdupq_n_f16(0.0f); - acc1 = vdupq_n_f16(0.0f); + acc0 = vdupq_n_f16(0.0f16); + acc1 = vdupq_n_f16(0.0f16); pSrcA0Vec = pInA0; pSrcA1Vec = pInA1; @@ -248,7 +250,7 @@ void arm_svm_rbf_predict_f16( vSum = vfmaq_m_f16(vSum, vld1q(pDualCoef), - vexpq_f16(vmulq_n_f16(vtmp, -S->gamma)), vctp16q(2)); + vexpq_f16(vmulq_n_f16(vtmp, -(_Float16)S->gamma)), vctp16q(2)); pDualCoef += 2; pSrcA += numCols * 2; @@ -309,12 +311,12 @@ void arm_svm_rbf_predict_f16( vSum = vfmaq_m_f16(vSum, vld1q(pDualCoef), - vexpq_f16(vmulq_n_f16(vtmp, -S->gamma)), vctp16q(1)); + vexpq_f16(vmulq_n_f16(vtmp, -(_Float16)S->gamma)), vctp16q(1)); } - sum += vecAddAcrossF16Mve(vSum); + sum += (_Float16)vecAddAcrossF16Mve(vSum); *pResult = S->classes[STEP(sum)]; } @@ -337,7 +339,7 @@ void arm_svm_rbf_predict_f16( dot = dot + SQ((_Float16)in[j] - (_Float16) *pSupport); pSupport++; } - sum += (_Float16)S->dualCoefficients[i] * (_Float16)expf(-(_Float16)S->gamma * dot); + sum += (_Float16)S->dualCoefficients[i] * (_Float16)expf((float32_t)(-(_Float16)S->gamma * (_Float16)dot)); } *pResult=S->classes[STEP(sum)]; } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_rbf_predict_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_rbf_predict_f32.c index 52ab0d5..87d71e3 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_rbf_predict_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_rbf_predict_f32.c @@ -5,11 +5,13 @@ * Title: arm_svm_rbf_predict_f32.c * Description: SVM Radial Basis Function Classifier * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_sigmoid_init_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_sigmoid_init_f16.c index 60f33af..33aaf42 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_sigmoid_init_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_sigmoid_init_f16.c @@ -5,11 +5,13 @@ * Title: arm_svm_sigmoid_predict_f16.c * Description: SVM Sigmoid Instance Initialization * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -37,11 +39,6 @@ @ingroup groupSVM */ -/** - @defgroup sigmoidsvm Sigmoid SVM - - Sigmoid SVM classifier - */ /** * @addtogroup sigmoidsvm diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_sigmoid_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_sigmoid_init_f32.c index a483345..2274e72 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_sigmoid_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_sigmoid_init_f32.c @@ -5,11 +5,13 @@ * Title: arm_svm_sigmoid_predict_f32.c * Description: SVM Sigmoid Instance Initialization * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_sigmoid_predict_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_sigmoid_predict_f16.c index dcce835..572bc83 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_sigmoid_predict_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_sigmoid_predict_f16.c @@ -5,11 +5,13 @@ * Title: arm_svm_sigmoid_predict_f16.c * Description: SVM Sigmoid Classifier * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -295,7 +297,7 @@ void arm_svm_sigmoid_predict_f16( vtanhq_f16(vaddq_n_f16(vmulq_n_f16(vtmp, S->gamma), S->coef0)), vctp16q(1)); } - sum += vecAddAcrossF16Mve(vSum); + sum += (_Float16)vecAddAcrossF16Mve(vSum); *pResult = S->classes[STEP(sum)]; } @@ -316,9 +318,9 @@ void arm_svm_sigmoid_predict_f16( dot=0.0f16; for(j=0; j < S->vectorDimension; j++) { - dot = dot + (_Float16)in[j] * (_Float16)*pSupport++; + dot = (_Float16)dot + (_Float16)in[j] * (_Float16)*pSupport++; } - sum += (_Float16)S->dualCoefficients[i] * (_Float16)tanhf((_Float16)S->gamma * dot + (_Float16)S->coef0); + sum += (_Float16)S->dualCoefficients[i] * (_Float16)tanhf((float32_t)((_Float16)S->gamma * (_Float16)dot + (_Float16)S->coef0)); } *pResult=S->classes[STEP(sum)]; } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_sigmoid_predict_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_sigmoid_predict_f32.c index 94b2a50..b607820 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_sigmoid_predict_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SVMFunctions/arm_svm_sigmoid_predict_f32.c @@ -5,11 +5,13 @@ * Title: arm_svm_sigmoid_predict_f32.c * Description: SVM Sigmoid Classifier * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_f16.c new file mode 100644 index 0000000..2c50961 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_f16.c @@ -0,0 +1,278 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmax_f16.c + * Description: Maximum value of a absolute values of a floating-point vector + * + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions_f16.h" + +#if defined(ARM_FLOAT16_SUPPORTED) + +#if (defined(ARM_MATH_NEON) || defined(ARM_MATH_MVEF)) && !defined(ARM_MATH_AUTOVECTORIZE) +#include +#endif + +/** + @ingroup groupStats + */ + + +/** + @addtogroup AbsMax + @{ + */ + +/** + @brief Maximum value of absolute values of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @param[out] pIndex index of maximum value returned here + @return none + */ + +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" +void arm_absmax_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult, + uint32_t * pIndex) +{ + uint16_t blkCnt; /* loop counters */ + f16x8_t vecSrc; + float16_t const *pSrcVec; + f16x8_t curExtremValVec = vdupq_n_f16(F16_ABSMIN); + float16_t maxValue = F16_ABSMIN; + uint16_t idx = blockSize; + uint16x8_t indexVec; + uint16x8_t curExtremIdxVec; + mve_pred16_t p0; + + + indexVec = vidupq_u16((uint32_t)0, 1); + curExtremIdxVec = vdupq_n_u16(0); + + pSrcVec = (float16_t const *) pSrc; + blkCnt = blockSize >> 3; + while (blkCnt > 0U) + { + vecSrc = vldrhq_f16(pSrcVec); + pSrcVec += 8; + vecSrc = vabsq(vecSrc); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + p0 = vcmpgeq(vecSrc, curExtremValVec); + curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); + curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + + indexVec = indexVec + 8; + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 7; + if (blkCnt > 0U) + { + vecSrc = vldrhq_f16(pSrcVec); + pSrcVec += 8; + vecSrc = vabsq(vecSrc); + + p0 = vctp16q(blkCnt); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + p0 = vcmpgeq_m(vecSrc, curExtremValVec, p0); + curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); + curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + } + /* + * Get max value across the vector + */ + maxValue = vmaxnmvq(maxValue, curExtremValVec); + /* + * set index for lower values to max possible index + */ + p0 = vcmpgeq(curExtremValVec, maxValue); + indexVec = vpselq(curExtremIdxVec, vdupq_n_u16(blockSize), p0); + /* + * Get min index which is thus for a max value + */ + idx = vminvq(idx, indexVec); + /* + * Save result + */ + *pIndex = idx; + *pResult = maxValue; +} +#else +#if defined(ARM_MATH_LOOPUNROLL) +void arm_absmax_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult, + uint32_t * pIndex) +{ + float16_t cur_absmax, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt, outIndex; /* Loop counter */ \ + uint32_t index; /* index of maximum value */ \ + \ + /* Initialize index value to zero. */ \ + outIndex = 0U; \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = ((_Float16)out > 0.0f16) ? out : -(_Float16)out; \ + /* Initialize index of extrema value. */ \ + index = 0U; \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmax to next consecutive values one by one */ \ + cur_absmax = *pSrc++; \ + cur_absmax = ((_Float16)cur_absmax > 0.0f16) ? cur_absmax : -(_Float16)cur_absmax; \ + /* compare for the extrema value */ \ + if ((_Float16)cur_absmax > (_Float16)out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmax; \ + outIndex = index + 1U; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = ((_Float16)cur_absmax > 0.0f16) ? cur_absmax : -(_Float16)cur_absmax; \ + if ((_Float16)cur_absmax > (_Float16)out) \ + { \ + out = cur_absmax; \ + outIndex = index + 2U; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = ((_Float16)cur_absmax > 0.0f16) ? cur_absmax : -(_Float16)cur_absmax; \ + if ((_Float16)cur_absmax > (_Float16)out) \ + { \ + out = cur_absmax; \ + outIndex = index + 3U; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = ((_Float16)cur_absmax > 0.0f16) ? cur_absmax : -(_Float16)cur_absmax; \ + if ((_Float16)cur_absmax > (_Float16)out) \ + { \ + out = cur_absmax; \ + outIndex = index + 4U; \ + } \ + \ + index += 4U; \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmax = *pSrc++; \ + cur_absmax = ((_Float16)cur_absmax > 0.0f16) ? cur_absmax : -(_Float16)cur_absmax; \ + if ((_Float16)cur_absmax > (_Float16)out) \ + { \ + out = cur_absmax; \ + outIndex = blockSize - blkCnt; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ + *pIndex = outIndex; +} +#else +void arm_absmax_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult, + uint32_t * pIndex) +{ + float16_t maxVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt, outIndex; /* Loop counter */ + + /* Initialise index value to zero. */ + outIndex = 0U; + + /* Load first input value that act as reference value for comparision */ + out = (_Float16)fabsf((float32_t)*pSrc++); + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal = (_Float16)fabsf((float32_t)*pSrc++); + + /* compare for the maximum value */ + if ((_Float16)out < (_Float16)maxVal) + { + /* Update the maximum value and it's index */ + out = maxVal; + outIndex = blockSize - blkCnt; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the maximum value and it's index into destination pointers */ + *pResult = out; + *pIndex = outIndex; +} +#endif /* defined(ARM_MATH_LOOPUNROLL) */ +#endif /* defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMax group + */ + +#endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_f32.c new file mode 100644 index 0000000..7ddc9ae --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_f32.c @@ -0,0 +1,264 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmax_f32.c + * Description: Maximum value of absolute values of a floating-point vector + * + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" +#if (defined(ARM_MATH_NEON) || defined(ARM_MATH_MVEF)) && !defined(ARM_MATH_AUTOVECTORIZE) +#include +#endif + +/** + @ingroup groupStats + */ + +/** + @defgroup AbsMax Absolute Maximum + + Computes the maximum value of absolute values of an array of data. + The function returns both the maximum value and its position within the array. + There are separate functions for floating-point, Q31, Q15, and Q7 data types. + */ + +/** + @addtogroup AbsMax + @{ + */ + +/** + @brief Maximum value of absolute values of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @param[out] pIndex index of maximum value returned here + @return none + */ +#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_absmax_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult, + uint32_t * pIndex) +{ + int32_t blkSize = blockSize; + f32x4_t vecSrc; + f32x4_t curExtremValVec = vdupq_n_f32(F32_ABSMIN); + float32_t maxValue = F32_ABSMIN; + uint32_t idx = blockSize; + uint32x4_t indexVec; + uint32x4_t curExtremIdxVec; + uint32_t curIdx = 0; + mve_pred16_t p0; + + + indexVec = vidupq_wb_u32(&curIdx, 1); + curExtremIdxVec = vdupq_n_u32(0); + + do { + mve_pred16_t p = vctp32q(blkSize); + + vecSrc = vldrwq_z_f32((float32_t const *) pSrc, p); + vecSrc = vabsq_m(vuninitializedq_f32(), vecSrc, p); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + p0 = vcmpgeq_m(vecSrc, curExtremValVec, p); + curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); + curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + + /* Does TP detection works here ?? */ + indexVec = vidupq_wb_u32(&curIdx, 1); + + blkSize -= 4; + pSrc += 4; + } + while (blkSize > 0); + + /* + * Get max value across the vector + */ + maxValue = vmaxnmvq(maxValue, curExtremValVec); + /* + * set index for lower values to max possible index + */ + p0 = vcmpgeq(curExtremValVec, maxValue); + indexVec = vpselq(curExtremIdxVec, vdupq_n_u32(blockSize), p0); + /* + * Get min index which is thus for a max value + */ + idx = vminvq(idx, indexVec); + /* + * Save result + */ + *pIndex = idx; + *pResult = maxValue; +} + + +#else +#if defined(ARM_MATH_LOOPUNROLL) +void arm_absmax_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult, + uint32_t * pIndex) +{ + float32_t cur_absmax, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt, outIndex; /* Loop counter */ \ + uint32_t index; /* index of maximum value */ \ + \ + /* Initialize index value to zero. */ \ + outIndex = 0U; \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = (out > 0.0f) ? out : -out; \ + /* Initialize index of extrema value. */ \ + index = 0U; \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmax to next consecutive values one by one */ \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0.0f) ? cur_absmax : -cur_absmax; \ + /* compare for the extrema value */ \ + if (cur_absmax > out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmax; \ + outIndex = index + 1U; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0.0f) ? cur_absmax : -cur_absmax; \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + outIndex = index + 2U; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0.0f) ? cur_absmax : -cur_absmax; \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + outIndex = index + 3U; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0.0f) ? cur_absmax : -cur_absmax; \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + outIndex = index + 4U; \ + } \ + \ + index += 4U; \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0.0f) ? cur_absmax : -cur_absmax; \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + outIndex = blockSize - blkCnt; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ + *pIndex = outIndex; +} +#else +void arm_absmax_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult, + uint32_t * pIndex) +{ + float32_t maxVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt, outIndex; /* Loop counter */ + + + + /* Initialise index value to zero. */ + outIndex = 0U; + + /* Load first input value that act as reference value for comparision */ + out = fabsf(*pSrc++); + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + + while (blkCnt > 0U) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal = fabsf(*pSrc++); + + /* compare for the maximum value */ + if (out < maxVal) + { + /* Update the maximum value and it's index */ + out = maxVal; + outIndex = blockSize - blkCnt; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the maximum value and it's index into destination pointers */ + *pResult = out; + *pIndex = outIndex; +} +#endif /* defined(ARM_MATH_LOOPUNROLL) */ +#endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMax group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_f64.c new file mode 100644 index 0000000..23a4e4e --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_f64.c @@ -0,0 +1,96 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmax_f64.c + * Description: Maximum value of absolute values of a floating-point vector + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup AbsMax + @{ + */ + +/** + @brief Maximum value of absolute values of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @param[out] pIndex index of maximum value returned here + @return none + */ +void arm_absmax_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult, + uint32_t * pIndex) +{ + float64_t maxVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt, outIndex; /* Loop counter */ + + + + /* Initialise index value to zero. */ + outIndex = 0U; + + /* Load first input value that act as reference value for comparision */ + out = fabs(*pSrc++); + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal = fabs(*pSrc++); + + /* compare for the maximum value */ + if (out < maxVal) + { + /* Update the maximum value and it's index */ + out = maxVal; + outIndex = blockSize - blkCnt; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the maximum value and it's index into destination pointers */ + *pResult = out; + *pIndex = outIndex; +} + +/** + @} end of AbsMax group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_f16.c new file mode 100644 index 0000000..d1c225c --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_f16.c @@ -0,0 +1,232 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmax_no_idx_f16.c + * Description: Maximum value of a absolute values of a floating-point vector + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions_f16.h" + +#if defined(ARM_FLOAT16_SUPPORTED) + +#if (defined(ARM_MATH_NEON) || defined(ARM_MATH_MVEF)) && !defined(ARM_MATH_AUTOVECTORIZE) +#include +#endif + +/** + @ingroup groupStats + */ + + +/** + @addtogroup AbsMax + @{ + */ + +/** + @brief Maximum value of absolute values of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @return none + */ + +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" +void arm_absmax_no_idx_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult) +{ + uint16_t blkCnt; /* loop counters */ + f16x8_t vecSrc; + float16_t const *pSrcVec; + f16x8_t curExtremValVec = vdupq_n_f16(F16_ABSMIN); + float16_t maxValue = F16_ABSMIN; + mve_pred16_t p0; + + + pSrcVec = (float16_t const *) pSrc; + blkCnt = blockSize >> 3; + while (blkCnt > 0) + { + vecSrc = vldrhq_f16(pSrcVec); + pSrcVec += 8; + /* + * update per-lane max. + */ + curExtremValVec = vmaxnmaq(vecSrc, curExtremValVec); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 7; + if (blkCnt > 0U) + { + vecSrc = vldrhq_f16(pSrcVec); + pSrcVec += 8; + p0 = vctp16q(blkCnt); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + curExtremValVec = vmaxnmaq_m(curExtremValVec, vecSrc, p0); + } + /* + * Get max value across the vector + */ + maxValue = vmaxnmavq(maxValue, curExtremValVec); + *pResult = maxValue; +} +#else +#if defined(ARM_MATH_LOOPUNROLL) +void arm_absmax_no_idx_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult) +{ + float16_t cur_absmax, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt; /* Loop counter */ \ + \ + \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = ((_Float16)out > 0.0f16) ? out : -(_Float16)out; \ + \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmax to next consecutive values one by one */ \ + cur_absmax = *pSrc++; \ + cur_absmax = ((_Float16)cur_absmax > 0.0f16) ? cur_absmax : -(_Float16)cur_absmax; \ + /* compare for the extrema value */ \ + if ((_Float16)cur_absmax > (_Float16)out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmax; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = ((_Float16)cur_absmax > 0.0f16) ? cur_absmax : -(_Float16)cur_absmax; \ + if ((_Float16)cur_absmax > (_Float16)out) \ + { \ + out = cur_absmax; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = ((_Float16)cur_absmax > 0.0f16) ? cur_absmax : -(_Float16)cur_absmax; \ + if ((_Float16)cur_absmax > (_Float16)out) \ + { \ + out = cur_absmax; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = ((_Float16)cur_absmax > 0.0f16) ? cur_absmax : -(_Float16)cur_absmax; \ + if ((_Float16)cur_absmax > (_Float16)out) \ + { \ + out = cur_absmax; \ + } \ + \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmax = *pSrc++; \ + cur_absmax = ((_Float16)cur_absmax > 0.0f16) ? cur_absmax : -(_Float16)cur_absmax; \ + if ((_Float16)cur_absmax > (_Float16)out) \ + { \ + out = cur_absmax; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ +} +#else +void arm_absmax_no_idx_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult) +{ + float16_t maxVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* Loop counter */ + + + + /* Load first input value that act as reference value for comparision */ + out = (_Float16)fabsf((float32_t)*pSrc++); + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal = (_Float16)fabsf((float32_t)*pSrc++); + + /* compare for the maximum value */ + if ((_Float16)out < (_Float16)maxVal) + { + /* Update the maximum value and it's index */ + out = maxVal; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the maximum value and it's index into destination pointers */ + *pResult = out; +} +#endif /* defined(ARM_MATH_LOOPUNROLL) */ +#endif /* defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMax group + */ + +#endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_f32.c new file mode 100644 index 0000000..485ccd5 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_f32.c @@ -0,0 +1,229 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmax_no_idx_f32.c + * Description: Maximum value of absolute values of a floating-point vector + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" +#if (defined(ARM_MATH_NEON) || defined(ARM_MATH_MVEF)) && !defined(ARM_MATH_AUTOVECTORIZE) +#include +#endif + +/** + @ingroup groupStats + */ + + +/** + @addtogroup AbsMax + @{ + */ + +/** + @brief Maximum value of absolute values of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @return none + */ +#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_absmax_no_idx_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult) +{ + int32_t blkCnt; /* loop counters */ + f32x4_t vecSrc; + float32_t const *pSrcVec; + f32x4_t curExtremValVec = vdupq_n_f32(F32_ABSMIN); + float32_t maxValue = F32_ABSMIN; + mve_pred16_t p0; + + + pSrcVec = (float32_t const *) pSrc; + blkCnt = blockSize >> 2; + while (blkCnt > 0) + { + vecSrc = vldrwq_f32(pSrcVec); + pSrcVec += 4; + /* + * update per-lane max. + */ + curExtremValVec = vmaxnmaq(vecSrc, curExtremValVec); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 3; + if (blkCnt > 0) + { + vecSrc = vldrwq_f32(pSrcVec); + pSrcVec += 4; + p0 = vctp32q(blkCnt); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + curExtremValVec = vmaxnmaq_m(curExtremValVec, vecSrc, p0); + } + /* + * Get max value across the vector + */ + maxValue = vmaxnmavq(maxValue, curExtremValVec); + *pResult = maxValue; +} + + +#else +#if defined(ARM_MATH_LOOPUNROLL) +void arm_absmax_no_idx_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult) +{ + float32_t cur_absmax, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt; /* Loop counter */ \ + \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = (out > 0.0f) ? out : -out; \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmax to next consecutive values one by one */ \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0.0f) ? cur_absmax : -cur_absmax; \ + /* compare for the extrema value */ \ + if (cur_absmax > out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmax; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0.0f) ? cur_absmax : -cur_absmax; \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0.0f) ? cur_absmax : -cur_absmax; \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0.0f) ? cur_absmax : -cur_absmax; \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + } \ + \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0.0f) ? cur_absmax : -cur_absmax; \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ +} +#else +void arm_absmax_no_idx_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult) +{ + float32_t maxVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* Loop counter */ + + + + + + /* Load first input value that act as reference value for comparision */ + out = fabsf(*pSrc++); + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + + while (blkCnt > 0U) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal = fabsf(*pSrc++); + + /* compare for the maximum value */ + if (out < maxVal) + { + /* Update the maximum value and it's index */ + out = maxVal; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the maximum value and it's index into destination pointers */ + *pResult = out; +} +#endif /* defined(ARM_MATH_LOOPUNROLL) */ +#endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMax group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_f64.c new file mode 100644 index 0000000..017c588 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_f64.c @@ -0,0 +1,91 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmax_no_idx_f64.c + * Description: Maximum value of absolute values of a floating-point vector + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup AbsMax + @{ + */ + +/** + @brief Maximum value of absolute values of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @return none + */ +void arm_absmax_no_idx_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult) +{ + float64_t maxVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* Loop counter */ + + + + + + /* Load first input value that act as reference value for comparision */ + out = fabs(*pSrc++); + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal = fabs(*pSrc++); + + /* compare for the maximum value */ + if (out < maxVal) + { + /* Update the maximum value and it's index */ + out = maxVal; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the maximum value and it's index into destination pointers */ + *pResult = out; +} + +/** + @} end of AbsMax group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_q15.c new file mode 100644 index 0000000..9c3a86a --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_q15.c @@ -0,0 +1,224 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmax_no_idx_q15.c + * Description: Maximum value of absolute values of a Q15 vector + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup AbsMax + @{ + */ + +/** + @brief Maximum value of absolute values of a Q15 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @return none + */ +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_absmax_no_idx_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult) +{ + uint16_t blkCnt; /* loop counters */ + q15x8_t vecSrc; + q15_t const *pSrcVec; + uint16x8_t curExtremValVec = vdupq_n_s16(Q15_ABSMIN); + q15_t maxValue = Q15_ABSMIN; + mve_pred16_t p0; + + + pSrcVec = (q15_t const *) pSrc; + blkCnt = blockSize >> 3; + while (blkCnt > 0U) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 8; + /* + * update per-lane max. + */ + curExtremValVec = vmaxaq(curExtremValVec, vecSrc); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 7; + if (blkCnt > 0U) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 8; + p0 = vctp16q(blkCnt); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + curExtremValVec = vmaxaq_m(curExtremValVec, vecSrc, p0); + } + /* + * Get max value across the vector + */ + maxValue = vmaxavq(maxValue, (q15x8_t)curExtremValVec); + *pResult = maxValue; +} + +#else +#if defined(ARM_MATH_DSP) +void arm_absmax_no_idx_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult) +{ + q15_t cur_absmax, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt; /* Loop counter */ \ + \ + \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = (out > 0) ? out : (q15_t)__QSUB16(0, out); \ + \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmax to next consecutive values one by one */ \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q15_t)__QSUB16(0, cur_absmax); \ + /* compare for the extrema value */ \ + if (cur_absmax > out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmax; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q15_t)__QSUB16(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q15_t)__QSUB16(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q15_t)__QSUB16(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + } \ + \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q15_t)__QSUB16(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ +} +#else +void arm_absmax_no_idx_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult) +{ + q15_t maxVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* Loop counter */ + + + /* Load first input value that act as reference value for comparision */ + out = (*pSrc > 0) ? *pSrc : ((*pSrc == (q15_t) 0x8000) ? 0x7fff : -*pSrc); + pSrc++; + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal = (*pSrc > 0) ? *pSrc : ((*pSrc == (q15_t) 0x8000) ? 0x7fff : -*pSrc); + pSrc++; + + /* compare for the maximum value */ + if (out < maxVal) + { + /* Update the maximum value and it's index */ + out = maxVal; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the maximum value and it's index into destination pointers */ + *pResult = out; +} +#endif /* defined(ARM_MATH_DSP) */ +#endif /* defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMax group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_q31.c new file mode 100644 index 0000000..5610a8a --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_q31.c @@ -0,0 +1,224 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmax_no_idx_q31.c + * Description: Maximum value of absolute values of a Q31 vector + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup AbsMax + @{ + */ + +/** + @brief Maximum value of absolute values of a Q31 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @return none + */ + +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" +void arm_absmax_no_idx_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult) +{ + int32_t blkCnt; /* loop counters */ + q31x4_t vecSrc; + q31_t const *pSrcVec; + uint32x4_t curExtremValVec = vdupq_n_s32(Q31_ABSMIN); + q31_t maxValue = Q31_ABSMIN; + mve_pred16_t p0; + + + pSrcVec = (q31_t const *) pSrc; + blkCnt = blockSize >> 2; + while (blkCnt > 0) + { + vecSrc = vldrwq_s32(pSrcVec); + pSrcVec += 4; + /* + * update per-lane max. + */ + curExtremValVec = vmaxaq(curExtremValVec, vecSrc); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 3; + if (blkCnt > 0) + { + vecSrc = vldrwq_s32(pSrcVec); + pSrcVec += 4; + p0 = vctp32q(blkCnt); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + curExtremValVec = vmaxaq_m(curExtremValVec, vecSrc, p0); + } + /* + * Get max value across the vector + */ + maxValue = vmaxavq(maxValue, (q31x4_t)curExtremValVec); + *pResult = maxValue; +} +#else +#if defined(ARM_MATH_DSP) +void arm_absmax_no_idx_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult) +{ + q31_t cur_absmax, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt; /* Loop counter */ \ + \ + \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = (out > 0) ? out : (q31_t)__QSUB(0, out); \ + \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmax to next consecutive values one by one */ \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q31_t)__QSUB(0, cur_absmax); \ + /* compare for the extrema value */ \ + if (cur_absmax > out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmax; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q31_t)__QSUB(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q31_t)__QSUB(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q31_t)__QSUB(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + } \ + \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q31_t)__QSUB(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ +} +#else +void arm_absmax_no_idx_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult) +{ + q31_t maxVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* Loop counter */ + + + + /* Load first input value that act as reference value for comparision */ + out = (*pSrc > 0) ? *pSrc : ((*pSrc == INT32_MIN) ? INT32_MAX : -*pSrc); + pSrc++; + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal = (*pSrc > 0) ? *pSrc : ((*pSrc == INT32_MIN) ? INT32_MAX : -*pSrc); + pSrc++; + + /* compare for the maximum value */ + if (out < maxVal) + { + /* Update the maximum value and it's index */ + out = maxVal; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the maximum value and it's index into destination pointers */ + *pResult = out; +} +#endif /* defined(ARM_MATH_DSP) */ +#endif /* defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMax group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_q7.c new file mode 100644 index 0000000..26e1813 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_no_idx_q7.c @@ -0,0 +1,228 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmax_no_idx_q7.c + * Description: Maximum value of absolute values of a Q7 vector + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup AbsMax + @{ + */ + +/** + @brief Maximum value of absolute values of a Q7 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @return none + */ + +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + + + +void arm_absmax_no_idx_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult) +{ + int32_t blkCnt; /* loop counters */ + q7x16_t vecSrc; + q7_t const *pSrcVec; + uint8x16_t curExtremValVec = vdupq_n_s8(Q7_ABSMIN); + q7_t maxValue = Q7_ABSMIN; + mve_pred16_t p0; + + + pSrcVec = (q7_t const *) pSrc; + blkCnt = blockSize >> 4; + while (blkCnt > 0) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 16; + /* + * update per-lane max. + */ + curExtremValVec = vmaxaq(curExtremValVec, vecSrc); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 0xF; + if (blkCnt > 0) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 16; + p0 = vctp8q(blkCnt); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + curExtremValVec = vmaxaq_m(curExtremValVec, vecSrc, p0); + } + /* + * Get max value across the vector + */ + maxValue = vmaxavq(maxValue, (q7x16_t)curExtremValVec); + *pResult = maxValue; +} +#else +#if defined(ARM_MATH_DSP) +void arm_absmax_no_idx_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult) +{ + q7_t cur_absmax, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt; /* Loop counter */ \ + \ + \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = (out > 0) ? out : (q7_t)__QSUB8(0, out); \ + \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmax to next consecutive values one by one */ \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q7_t)__QSUB8(0, cur_absmax); \ + /* compare for the extrema value */ \ + if (cur_absmax > out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmax; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q7_t)__QSUB8(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q7_t)__QSUB8(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q7_t)__QSUB8(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + } \ + \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q7_t)__QSUB8(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ +} +#else +void arm_absmax_no_idx_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult) +{ + q7_t maxVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* Loop counter */ + + + + /* Load first input value that act as reference value for comparision */ + out = (*pSrc > 0) ? *pSrc : ((*pSrc == (q7_t) 0x80) ? (q7_t) 0x7f : -*pSrc); + pSrc++; + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal = (*pSrc > 0) ? *pSrc : ((*pSrc == (q7_t) 0x80) ? (q7_t) 0x7f : -*pSrc); + pSrc++; + + /* compare for the maximum value */ + if (out < maxVal) + { + /* Update the maximum value and it's index */ + out = maxVal; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the maximum value and it's index into destination pointers */ + *pResult = out; +} +#endif /* defined(ARM_MATH_DSP) */ +#endif /* defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMax group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_q15.c new file mode 100644 index 0000000..656fcf9 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_q15.c @@ -0,0 +1,240 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmax_q15.c + * Description: Maximum value of absolute values of a Q15 vector + * + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup AbsMax + @{ + */ + +/** + @brief Maximum value of absolute values of a Q15 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @param[out] pIndex index of maximum value returned here + @return none + */ +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_absmax_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult, + uint32_t * pIndex) +{ + int32_t blkCnt; /* loop counters */ + q15x8_t extremValVec = vdupq_n_s16(Q15_ABSMIN); + q15_t maxValue = Q15_ABSMIN; + uint16x8_t indexVec; + uint16x8_t extremIdxVec; + mve_pred16_t p0; + uint16_t extremIdxArr[8]; + + indexVec = vidupq_u16(0U, 1); + + blkCnt = blockSize; + do { + mve_pred16_t p = vctp16q(blkCnt); + q15x8_t extremIdxVal = vld1q_z_s16(pSrc, p); + + extremIdxVal = vqabsq(extremIdxVal); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + p0 = vcmpgeq_m(extremIdxVal, extremValVec, p); + + extremValVec = vorrq_m(extremValVec, extremIdxVal, extremIdxVal, p0); + /* store per-lane extrema indexes */ + vst1q_p_u16(extremIdxArr, indexVec, p0); + + indexVec += 8; + pSrc += 8; + blkCnt -= 8; + } + while (blkCnt > 0); + + + /* Get max value across the vector */ + maxValue = vmaxvq(maxValue, extremValVec); + + /* set index for lower values to max possible index */ + p0 = vcmpgeq(extremValVec, maxValue); + extremIdxVec = vld1q_u16(extremIdxArr); + + indexVec = vpselq(extremIdxVec, vdupq_n_u16(blockSize - 1), p0); + *pIndex = vminvq(blockSize - 1, indexVec); + *pResult = maxValue; +} + +#else +#if defined(ARM_MATH_DSP) +void arm_absmax_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult, + uint32_t * pIndex) +{ + q15_t cur_absmax, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt, outIndex; /* Loop counter */ \ + uint32_t index; /* index of maximum value */ \ + \ + /* Initialize index value to zero. */ \ + outIndex = 0U; \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = (out > 0) ? out : (q15_t)__QSUB16(0, out); \ + /* Initialize index of extrema value. */ \ + index = 0U; \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmax to next consecutive values one by one */ \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q15_t)__QSUB16(0, cur_absmax); \ + /* compare for the extrema value */ \ + if (cur_absmax > out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmax; \ + outIndex = index + 1U; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q15_t)__QSUB16(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + outIndex = index + 2U; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q15_t)__QSUB16(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + outIndex = index + 3U; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q15_t)__QSUB16(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + outIndex = index + 4U; \ + } \ + \ + index += 4U; \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q15_t)__QSUB16(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + outIndex = blockSize - blkCnt; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ + *pIndex = outIndex; +} +#else +void arm_absmax_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult, + uint32_t * pIndex) +{ + q15_t maxVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt, outIndex; /* Loop counter */ + + /* Initialise index value to zero. */ + outIndex = 0U; + /* Load first input value that act as reference value for comparision */ + out = (*pSrc > 0) ? *pSrc : ((*pSrc == (q15_t) 0x8000) ? 0x7fff : -*pSrc); + pSrc++; + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal = (*pSrc > 0) ? *pSrc : ((*pSrc == (q15_t) 0x8000) ? 0x7fff : -*pSrc); + pSrc++; + + /* compare for the maximum value */ + if (out < maxVal) + { + /* Update the maximum value and it's index */ + out = maxVal; + outIndex = blockSize - blkCnt; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the maximum value and it's index into destination pointers */ + *pResult = out; + *pIndex = outIndex; +} +#endif /* defined(ARM_MATH_DSP) */ +#endif /* defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMax group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_q31.c new file mode 100644 index 0000000..d3cfa3c --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_q31.c @@ -0,0 +1,240 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmax_q31.c + * Description: Maximum value of absolute values of a Q31 vector + * + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup AbsMax + @{ + */ + +/** + @brief Maximum value of absolute values of a Q31 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @param[out] pIndex index of maximum value returned here + @return none + */ + +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" +void arm_absmax_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult, + uint32_t * pIndex) +{ + int32_t blkCnt; /* loop counters */ + q31x4_t extremValVec = vdupq_n_s32(Q31_ABSMIN); + q31_t maxValue = Q31_ABSMIN; + uint32x4_t indexVec; + uint32x4_t extremIdxVec; + mve_pred16_t p0; + uint32_t extremIdxArr[4]; + + indexVec = vidupq_u32(0U, 1); + + blkCnt = blockSize; + do { + mve_pred16_t p = vctp32q(blkCnt); + q31x4_t extremIdxVal = vld1q_z_s32(pSrc, p); + + extremIdxVal = vqabsq(extremIdxVal); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + p0 = vcmpgeq_m(extremIdxVal, extremValVec, p); + + extremValVec = vorrq_m(extremValVec, extremIdxVal, extremIdxVal, p0); + /* store per-lane extrema indexes */ + vst1q_p_u32(extremIdxArr, indexVec, p0); + + indexVec += 4; + pSrc += 4; + blkCnt -= 4; + } + while (blkCnt > 0); + + + /* Get max value across the vector */ + maxValue = vmaxvq(maxValue, extremValVec); + + /* set index for lower values to max possible index */ + p0 = vcmpgeq(extremValVec, maxValue); + extremIdxVec = vld1q_u32(extremIdxArr); + + indexVec = vpselq(extremIdxVec, vdupq_n_u32(blockSize - 1), p0); + *pIndex = vminvq(blockSize - 1, indexVec); + *pResult = maxValue; +} +#else +#if defined(ARM_MATH_DSP) +void arm_absmax_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult, + uint32_t * pIndex) +{ + q31_t cur_absmax, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt, outIndex; /* Loop counter */ \ + uint32_t index; /* index of maximum value */ \ + \ + /* Initialize index value to zero. */ \ + outIndex = 0U; \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = (out > 0) ? out : (q31_t)__QSUB(0, out); \ + /* Initialize index of extrema value. */ \ + index = 0U; \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmax to next consecutive values one by one */ \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q31_t)__QSUB(0, cur_absmax); \ + /* compare for the extrema value */ \ + if (cur_absmax > out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmax; \ + outIndex = index + 1U; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q31_t)__QSUB(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + outIndex = index + 2U; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q31_t)__QSUB(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + outIndex = index + 3U; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q31_t)__QSUB(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + outIndex = index + 4U; \ + } \ + \ + index += 4U; \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q31_t)__QSUB(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + outIndex = blockSize - blkCnt; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ + *pIndex = outIndex; +} +#else +void arm_absmax_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult, + uint32_t * pIndex) +{ + q31_t maxVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt, outIndex; /* Loop counter */ + + + /* Initialise index value to zero. */ + outIndex = 0U; + /* Load first input value that act as reference value for comparision */ + out = (*pSrc > 0) ? *pSrc : ((*pSrc == INT32_MIN) ? INT32_MAX : -*pSrc); + pSrc++; + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal = (*pSrc > 0) ? *pSrc : ((*pSrc == INT32_MIN) ? INT32_MAX : -*pSrc); + pSrc++; + + /* compare for the maximum value */ + if (out < maxVal) + { + /* Update the maximum value and it's index */ + out = maxVal; + outIndex = blockSize - blkCnt; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the maximum value and it's index into destination pointers */ + *pResult = out; + *pIndex = outIndex; +} +#endif /* defined(ARM_MATH_DSP) */ +#endif /* defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMax group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_q7.c new file mode 100644 index 0000000..30595de --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmax_q7.c @@ -0,0 +1,298 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmax_q7.c + * Description: Maximum value of absolute values of a Q7 vector + * + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup AbsMax + @{ + */ + +/** + @brief Maximum value of absolute values of a Q7 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @param[out] pIndex index of maximum value returned here + @return none + */ + +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +#define MAX_BLKSZ_S8 (UINT8_MAX+1) + +static void arm_small_blk_absmax_q7( + const q7_t * pSrc, + uint16_t blockSize, + q7_t * pResult, + uint32_t * pIndex) +{ + int32_t blkCnt; /* loop counters */ + q7x16_t extremValVec = vdupq_n_s8(Q7_ABSMIN); + q7_t maxValue = Q7_ABSMIN; + uint8x16_t indexVec; + uint8x16_t extremIdxVec; + mve_pred16_t p0; + uint8_t extremIdxArr[16]; + + indexVec = vidupq_u8(0U, 1); + + blkCnt = blockSize; + do { + mve_pred16_t p = vctp8q(blkCnt); + q7x16_t extremIdxVal = vld1q_z_s8(pSrc, p); + + extremIdxVal = vqabsq(extremIdxVal); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + p0 = vcmpgeq_m(extremIdxVal, extremValVec, p); + + extremValVec = vorrq_m(extremValVec, extremIdxVal, extremIdxVal, p0); + /* store per-lane extrema indexes */ + vst1q_p_u8(extremIdxArr, indexVec, p0); + + indexVec += 16; + pSrc += 16; + blkCnt -= 16; + } + while (blkCnt > 0); + + + /* Get max value across the vector */ + maxValue = vmaxvq(maxValue, extremValVec); + + /* set index for lower values to max possible index */ + p0 = vcmpgeq(extremValVec, maxValue); + extremIdxVec = vld1q_u8(extremIdxArr); + + indexVec = vpselq(extremIdxVec, vdupq_n_u8(blockSize - 1), p0); + *pIndex = vminvq_u8(blockSize - 1, indexVec); + *pResult = maxValue; +} + +void arm_absmax_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult, + uint32_t * pIndex) +{ + int32_t totalSize = blockSize; + + if (totalSize <= MAX_BLKSZ_S8) + { + arm_small_blk_absmax_q7(pSrc, blockSize, pResult, pIndex); + } + else + { + uint32_t curIdx = 0; + q7_t curBlkExtr = Q7_MIN; + uint32_t curBlkPos = 0; + uint32_t curBlkIdx = 0; + /* + * process blocks of 255 elts + */ + while (totalSize >= MAX_BLKSZ_S8) + { + const q7_t *curSrc = pSrc; + + arm_small_blk_absmax_q7(curSrc, MAX_BLKSZ_S8, pResult, pIndex); + if (*pResult > curBlkExtr) + { + /* + * update partial extrema + */ + curBlkExtr = *pResult; + curBlkPos = *pIndex; + curBlkIdx = curIdx; + } + curIdx++; + pSrc += MAX_BLKSZ_S8; + totalSize -= MAX_BLKSZ_S8; + } + /* + * remainder + */ + arm_small_blk_absmax_q7(pSrc, totalSize, pResult, pIndex); + if (*pResult > curBlkExtr) + { + curBlkExtr = *pResult; + curBlkPos = *pIndex; + curBlkIdx = curIdx; + } + *pIndex = curBlkIdx * MAX_BLKSZ_S8 + curBlkPos; + *pResult = curBlkExtr; + } +} +#else +#if defined(ARM_MATH_DSP) +void arm_absmax_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult, + uint32_t * pIndex) +{ + q7_t cur_absmax, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt, outIndex; /* Loop counter */ \ + uint32_t index; /* index of maximum value */ \ + \ + /* Initialize index value to zero. */ \ + outIndex = 0U; \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = (out > 0) ? out : (q7_t)__QSUB8(0, out); \ + /* Initialize index of extrema value. */ \ + index = 0U; \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmax to next consecutive values one by one */ \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q7_t)__QSUB8(0, cur_absmax); \ + /* compare for the extrema value */ \ + if (cur_absmax > out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmax; \ + outIndex = index + 1U; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q7_t)__QSUB8(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + outIndex = index + 2U; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q7_t)__QSUB8(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + outIndex = index + 3U; \ + } \ + \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q7_t)__QSUB8(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + outIndex = index + 4U; \ + } \ + \ + index += 4U; \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmax = *pSrc++; \ + cur_absmax = (cur_absmax > 0) ? cur_absmax : (q7_t)__QSUB8(0, cur_absmax); \ + if (cur_absmax > out) \ + { \ + out = cur_absmax; \ + outIndex = blockSize - blkCnt; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ + *pIndex = outIndex; +} +#else +void arm_absmax_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult, + uint32_t * pIndex) +{ + q7_t maxVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt, outIndex; /* Loop counter */ + + + /* Initialise index value to zero. */ + outIndex = 0U; + /* Load first input value that act as reference value for comparision */ + out = (*pSrc > 0) ? *pSrc : ((*pSrc == (q7_t) 0x80) ? (q7_t) 0x7f : -*pSrc); + pSrc++; + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal = (*pSrc > 0) ? *pSrc : ((*pSrc == (q7_t) 0x80) ? (q7_t) 0x7f : -*pSrc); + pSrc++; + + /* compare for the maximum value */ + if (out < maxVal) + { + /* Update the maximum value and it's index */ + out = maxVal; + outIndex = blockSize - blkCnt; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the maximum value and it's index into destination pointers */ + *pResult = out; + *pIndex = outIndex; +} +#endif /* defined(ARM_MATH_DSP) */ +#endif /* defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMax group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_f16.c new file mode 100644 index 0000000..335f502 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_f16.c @@ -0,0 +1,280 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmin_f16.c + * Description: Minimum value of absolute values of a floating-point vector + * + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions_f16.h" + +#if defined(ARM_FLOAT16_SUPPORTED) + + +#if (defined(ARM_MATH_NEON) || defined(ARM_MATH_MVEF)) && !defined(ARM_MATH_AUTOVECTORIZE) +#include +#endif + + +/** + @ingroup groupStats + */ + +/** + @addtogroup AbsMin + @{ + */ + +/** + @brief Minimum value of absolute values of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @param[out] pIndex index of minimum value returned here + @return none + */ + +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" +void arm_absmin_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult, + uint32_t * pIndex) +{ + uint16_t blkCnt; /* loop counters */ + f16x8_t vecSrc; + float16_t const *pSrcVec; + f16x8_t curExtremValVec = vdupq_n_f16(F16_ABSMAX); + float16_t minValue = F16_ABSMAX; + uint16_t idx = blockSize; + uint16x8_t indexVec; + uint16x8_t curExtremIdxVec; + mve_pred16_t p0; + + + indexVec = vidupq_u16((uint32_t)0, 1); + curExtremIdxVec = vdupq_n_u16(0); + + pSrcVec = (float16_t const *) pSrc; + blkCnt = blockSize >> 3; + while (blkCnt > 0U) + { + vecSrc = vldrhq_f16(pSrcVec); + pSrcVec += 8; + vecSrc = vabsq(vecSrc); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + p0 = vcmpleq(vecSrc, curExtremValVec); + curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); + curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + + indexVec = indexVec + 8; + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 7; + if (blkCnt > 0U) + { + p0 = vctp16q(blkCnt); + + vecSrc = vldrhq_f16(pSrcVec); + pSrcVec += 8; + vecSrc = vabsq(vecSrc); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + p0 = vcmpleq_m(vecSrc, curExtremValVec, p0); + curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); + curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + } + /* + * Get min value across the vector + */ + minValue = vminnmvq(minValue, curExtremValVec); + /* + * set index for lower values to max possible index + */ + p0 = vcmpleq(curExtremValVec, minValue); + indexVec = vpselq(curExtremIdxVec, vdupq_n_u16(blockSize), p0); + /* + * Get min index which is thus for a max value + */ + idx = vminvq(idx, indexVec); + /* + * Save result + */ + *pIndex = idx; + *pResult = minValue; +} + +#else +#if defined(ARM_MATH_LOOPUNROLL) +void arm_absmin_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult, + uint32_t * pIndex) +{ + float16_t cur_absmin, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt, outIndex; /* Loop counter */ \ + uint32_t index; /* index of maximum value */ \ + \ + /* Initialize index value to zero. */ \ + outIndex = 0U; \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = ((_Float16)out > 0.0f16) ? out : -(_Float16)out; \ + /* Initialize index of extrema value. */ \ + index = 0U; \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmin to next consecutive values one by one */ \ + cur_absmin = *pSrc++; \ + cur_absmin = ((_Float16)cur_absmin > 0.0f16) ? cur_absmin : -(_Float16)cur_absmin; \ + /* compare for the extrema value */ \ + if ((_Float16)cur_absmin < (_Float16)out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmin; \ + outIndex = index + 1U; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = ((_Float16)cur_absmin > 0.0f16) ? cur_absmin : -(_Float16)cur_absmin; \ + if ((_Float16)cur_absmin < (_Float16)out) \ + { \ + out = cur_absmin; \ + outIndex = index + 2U; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = ((_Float16)cur_absmin > 0.0f16) ? cur_absmin : -(_Float16)cur_absmin; \ + if ((_Float16)cur_absmin < (_Float16)out) \ + { \ + out = cur_absmin; \ + outIndex = index + 3U; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = ((_Float16)cur_absmin > 0.0f16) ? cur_absmin : -(_Float16)cur_absmin; \ + if ((_Float16)cur_absmin < (_Float16)out) \ + { \ + out = cur_absmin; \ + outIndex = index + 4U; \ + } \ + \ + index += 4U; \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmin = *pSrc++; \ + cur_absmin = ((_Float16)cur_absmin > 0.0f16) ? cur_absmin : -(_Float16)cur_absmin; \ + if ((_Float16)cur_absmin < (_Float16)out) \ + { \ + out = cur_absmin; \ + outIndex = blockSize - blkCnt; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ + *pIndex = outIndex; +} +#else +void arm_absmin_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult, + uint32_t * pIndex) +{ + float16_t minVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt, outIndex; /* Loop counter */ + + /* Initialise index value to zero. */ + outIndex = 0U; + + /* Load first input value that act as reference value for comparision */ + out = (_Float16)fabsf((float32_t)*pSrc++); + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize minVal to the next consecutive values one by one */ + minVal = (_Float16)fabsf((float32_t)*pSrc++); + + /* compare for the minimum value */ + if ((_Float16)out > (_Float16)minVal) + { + /* Update the minimum value and it's index */ + out = minVal; + outIndex = blockSize - blkCnt; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the minimum value and it's index into destination pointers */ + *pResult = out; + *pIndex = outIndex; +} +#endif /* defined(ARM_MATH_LOOPUNROLL) */ +#endif /* defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMin group + */ + +#endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_f32.c new file mode 100644 index 0000000..521093a --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_f32.c @@ -0,0 +1,283 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmin_f32.c + * Description: Minimum value of absolute values of a floating-point vector + * + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +#if (defined(ARM_MATH_NEON) || defined(ARM_MATH_MVEF)) && !defined(ARM_MATH_AUTOVECTORIZE) +#include +#endif + + +/** + @ingroup groupStats + */ + +/** + @defgroup AbsMin Absolute Minimum + + Computes the minimum value of absolute values of an array of data. + The function returns both the minimum value and its position within the array. + There are separate functions for floating-point, Q31, Q15, and Q7 data types. + */ + +/** + @addtogroup AbsMin + @{ + */ + +/** + @brief Minimum value of absolute values of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @param[out] pIndex index of minimum value returned here + @return none + */ + +#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" +void arm_absmin_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult, + uint32_t * pIndex) +{ + int32_t blkCnt; /* loop counters */ + f32x4_t vecSrc; + float32_t const *pSrcVec; + f32x4_t curExtremValVec = vdupq_n_f32(F32_ABSMAX); + float32_t minValue = F32_ABSMAX; + uint32_t idx = blockSize; + uint32x4_t indexVec; + uint32x4_t curExtremIdxVec; + mve_pred16_t p0; + + + indexVec = vidupq_u32((uint32_t)0, 1); + curExtremIdxVec = vdupq_n_u32(0); + + pSrcVec = (float32_t const *) pSrc; + blkCnt = blockSize >> 2; + while (blkCnt > 0) + { + vecSrc = vldrwq_f32(pSrcVec); + pSrcVec += 4; + vecSrc = vabsq(vecSrc); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + p0 = vcmpleq(vecSrc, curExtremValVec); + curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); + curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + + indexVec = indexVec + 4; + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 3; + if (blkCnt > 0) + { + p0 = vctp32q(blkCnt); + + vecSrc = vldrwq_f32(pSrcVec); + pSrcVec += 4; + vecSrc = vabsq(vecSrc); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + p0 = vcmpleq_m(vecSrc, curExtremValVec, p0); + curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); + curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + } + /* + * Get min value across the vector + */ + minValue = vminnmvq(minValue, curExtremValVec); + /* + * set index for lower values to max possible index + */ + p0 = vcmpleq(curExtremValVec, minValue); + indexVec = vpselq(curExtremIdxVec, vdupq_n_u32(blockSize), p0); + /* + * Get min index which is thus for a max value + */ + idx = vminvq(idx, indexVec); + /* + * Save result + */ + *pIndex = idx; + *pResult = minValue; +} + +#else +#if defined(ARM_MATH_LOOPUNROLL) +void arm_absmin_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult, + uint32_t * pIndex) +{ + float32_t cur_absmin, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt, outIndex; /* Loop counter */ \ + uint32_t index; /* index of maximum value */ \ + \ + /* Initialize index value to zero. */ \ + outIndex = 0U; \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = (out > 0.0f) ? out : -out; \ + /* Initialize index of extrema value. */ \ + index = 0U; \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmin to next consecutive values one by one */ \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0.0f) ? cur_absmin : -cur_absmin; \ + /* compare for the extrema value */ \ + if (cur_absmin < out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmin; \ + outIndex = index + 1U; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0.0f) ? cur_absmin : -cur_absmin; \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + outIndex = index + 2U; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0.0f) ? cur_absmin : -cur_absmin; \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + outIndex = index + 3U; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0.0f) ? cur_absmin : -cur_absmin; \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + outIndex = index + 4U; \ + } \ + \ + index += 4U; \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0.0f) ? cur_absmin : -cur_absmin; \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + outIndex = blockSize - blkCnt; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ + *pIndex = outIndex; +} +#else +void arm_absmin_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult, + uint32_t * pIndex) +{ + float32_t minVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt, outIndex; /* Loop counter */ + + /* Initialise index value to zero. */ + outIndex = 0U; + + /* Load first input value that act as reference value for comparision */ + out = fabsf(*pSrc++); + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize minVal to the next consecutive values one by one */ + minVal = fabsf(*pSrc++); + + /* compare for the minimum value */ + if (out > minVal) + { + /* Update the minimum value and it's index */ + out = minVal; + outIndex = blockSize - blkCnt; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the minimum value and it's index into destination pointers */ + *pResult = out; + *pIndex = outIndex; +} + +#endif /* defined(ARM_MATH_LOOPUNROLL) */ +#endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMin group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_f64.c new file mode 100644 index 0000000..518651a --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_f64.c @@ -0,0 +1,94 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmin_f64.c + * Description: Minimum value of absolute values of a floating-point vector + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup AbsMin + @{ + */ + +/** + @brief Minimum value of absolute values of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @param[out] pIndex index of minimum value returned here + @return none + */ +void arm_absmin_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult, + uint32_t * pIndex) +{ + float64_t minVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt, outIndex; /* Loop counter */ + + /* Initialise index value to zero. */ + outIndex = 0U; + + /* Load first input value that act as reference value for comparision */ + out = fabs(*pSrc++); + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize minVal to the next consecutive values one by one */ + minVal = fabs(*pSrc++); + + /* compare for the minimum value */ + if (out > minVal) + { + /* Update the minimum value and it's index */ + out = minVal; + outIndex = blockSize - blkCnt; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the minimum value and it's index into destination pointers */ + *pResult = out; + *pIndex = outIndex; +} + +/** + @} end of AbsMin group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_f16.c new file mode 100644 index 0000000..1e90c91 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_f16.c @@ -0,0 +1,234 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmin_no_idx_f16.c + * Description: Minimum value of absolute values of a floating-point vector + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions_f16.h" + +#if defined(ARM_FLOAT16_SUPPORTED) + + +#if (defined(ARM_MATH_NEON) || defined(ARM_MATH_MVEF)) && !defined(ARM_MATH_AUTOVECTORIZE) +#include +#endif + + +/** + @ingroup groupStats + */ + +/** + @addtogroup AbsMin + @{ + */ + +/** + @brief Minimum value of absolute values of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ + +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" +void arm_absmin_no_idx_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult) +{ + int32_t blkCnt; /* loop counters */ + f16x8_t vecSrc; + float16_t const *pSrcVec; + f16x8_t curExtremValVec = vdupq_n_f16(F16_ABSMAX); + float16_t minValue = F16_ABSMAX; + mve_pred16_t p0; + + + pSrcVec = (float16_t const *) pSrc; + blkCnt = blockSize >> 3; + while (blkCnt > 0) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 8; + /* + * update per-lane min. + */ + curExtremValVec = vminnmaq(vecSrc, curExtremValVec); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 7; + if (blkCnt > 0) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 8; + p0 = vctp16q(blkCnt); + /* + * Get current min per lane and current index per lane + * when a min is selected + */ + curExtremValVec = vminnmaq_m(curExtremValVec, vecSrc, p0); + } + /* + * Get min value across the vector + */ + minValue = vminnmavq(minValue, curExtremValVec); + *pResult = minValue; +} + +#else +#if defined(ARM_MATH_LOOPUNROLL) +void arm_absmin_no_idx_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult) +{ + float16_t cur_absmin, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt; /* Loop counter */ \ + \ + \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = ((_Float16)out > 0.0f16) ? out : -(_Float16)out; \ + \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmin to next consecutive values one by one */ \ + cur_absmin = *pSrc++; \ + cur_absmin = ((_Float16)cur_absmin > 0.0f16) ? cur_absmin : -(_Float16)cur_absmin; \ + /* compare for the extrema value */ \ + if ((_Float16)cur_absmin < (_Float16)out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmin; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = ((_Float16)cur_absmin > 0.0f16) ? cur_absmin : -(_Float16)cur_absmin; \ + if ((_Float16)cur_absmin < (_Float16)out) \ + { \ + out = cur_absmin; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = ((_Float16)cur_absmin > 0.0f16) ? cur_absmin : -(_Float16)cur_absmin; \ + if ((_Float16)cur_absmin < (_Float16)out) \ + { \ + out = cur_absmin; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = ((_Float16)cur_absmin > 0.0f16) ? cur_absmin : -(_Float16)cur_absmin; \ + if ((_Float16)cur_absmin < (_Float16)out) \ + { \ + out = cur_absmin; \ + } \ + \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmin = *pSrc++; \ + cur_absmin = ((_Float16)cur_absmin > 0.0f16) ? cur_absmin : -(_Float16)cur_absmin; \ + if ((_Float16)cur_absmin < (_Float16)out) \ + { \ + out = cur_absmin; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ +} +#else +void arm_absmin_no_idx_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult) +{ + float16_t minVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* Loop counter */ + + + + /* Load first input value that act as reference value for comparision */ + out = (_Float16)fabsf((float32_t)*pSrc++); + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize minVal to the next consecutive values one by one */ + minVal = (_Float16)fabsf((float32_t)*pSrc++); + + /* compare for the minimum value */ + if ((_Float16)out > (_Float16)minVal) + { + /* Update the minimum value and it's index */ + out = minVal; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the minimum value and it's index into destination pointers */ + *pResult = out; +} +#endif /* defined(ARM_MATH_LOOPUNROLL) */ +#endif /* defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMin group + */ + +#endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_f32.c new file mode 100644 index 0000000..20aca41 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_f32.c @@ -0,0 +1,230 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmin_no_idx_f32.c + * Description: Minimum value of absolute values of a floating-point vector + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +#if (defined(ARM_MATH_NEON) || defined(ARM_MATH_MVEF)) && !defined(ARM_MATH_AUTOVECTORIZE) +#include +#endif + + +/** + @ingroup groupStats + */ + + +/** + @addtogroup AbsMin + @{ + */ + +/** + @brief Minimum value of absolute values of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ + +#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" +void arm_absmin_no_idx_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult) +{ + int32_t blkCnt; /* loop counters */ + f32x4_t vecSrc; + float32_t const *pSrcVec; + f32x4_t curExtremValVec = vdupq_n_f32(F32_ABSMAX); + float32_t minValue = F32_ABSMAX; + mve_pred16_t p0; + + + pSrcVec = (float32_t const *) pSrc; + blkCnt = blockSize >> 2; + while (blkCnt > 0) + { + vecSrc = vldrwq_f32(pSrcVec); + pSrcVec += 4; + /* + * update per-lane min. + */ + curExtremValVec = vminnmaq(vecSrc, curExtremValVec); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 3; + if (blkCnt > 0) + { + vecSrc = vldrwq_f32(pSrcVec); + pSrcVec += 4; + p0 = vctp32q(blkCnt); + /* + * Get current min per lane and current index per lane + * when a min is selected + */ + curExtremValVec = vminnmaq_m(curExtremValVec, vecSrc, p0); + } + /* + * Get min value across the vector + */ + minValue = vminnmavq(minValue, curExtremValVec); + *pResult = minValue; +} + +#else +#if defined(ARM_MATH_LOOPUNROLL) +void arm_absmin_no_idx_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult) +{ + float32_t cur_absmin, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt; /* Loop counter */ \ + \ + \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = (out > 0.0f) ? out : -out; \ + \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmin to next consecutive values one by one */ \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0.0f) ? cur_absmin : -cur_absmin; \ + /* compare for the extrema value */ \ + if (cur_absmin < out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmin; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0.0f) ? cur_absmin : -cur_absmin; \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0.0f) ? cur_absmin : -cur_absmin; \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0.0f) ? cur_absmin : -cur_absmin; \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + } \ + \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0.0f) ? cur_absmin : -cur_absmin; \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ +} +#else +void arm_absmin_no_idx_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult) +{ + float32_t minVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* Loop counter */ + + + + /* Load first input value that act as reference value for comparision */ + out = fabsf(*pSrc++); + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize minVal to the next consecutive values one by one */ + minVal = fabsf(*pSrc++); + + /* compare for the minimum value */ + if (out > minVal) + { + /* Update the minimum value and it's index */ + out = minVal; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the minimum value and it's index into destination pointers */ + *pResult = out; +} + +#endif /* defined(ARM_MATH_LOOPUNROLL) */ +#endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMin group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_f64.c new file mode 100644 index 0000000..143271d --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_f64.c @@ -0,0 +1,88 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmin_no_idx_f64.c + * Description: Minimum value of absolute values of a floating-point vector + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup AbsMin + @{ + */ + +/** + @brief Minimum value of absolute values of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ +void arm_absmin_no_idx_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult) +{ + float64_t minVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* Loop counter */ + + + /* Load first input value that act as reference value for comparision */ + out = fabs(*pSrc++); + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize minVal to the next consecutive values one by one */ + minVal = fabs(*pSrc++); + + /* compare for the minimum value */ + if (out > minVal) + { + /* Update the minimum value and it's index */ + out = minVal; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the minimum value and it's index into destination pointers */ + *pResult = out; +} + +/** + @} end of AbsMin group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_q15.c new file mode 100644 index 0000000..c6dd15e --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_q15.c @@ -0,0 +1,226 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmin_no_idx_q15.c + * Description: Minimum value of absolute values of a Q15 vector + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + + +/** + @addtogroup AbsMin + @{ + */ + +/** + @brief Minimum value of absolute values of a Q15 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_absmin_no_idx_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult) +{ + uint16_t blkCnt; /* loop counters */ + q15x8_t vecSrc; + q15_t const *pSrcVec; + uint16x8_t curExtremValVec = vdupq_n_s16(Q15_ABSMAX); + q15_t minValue = Q15_ABSMAX; + mve_pred16_t p0; + + + pSrcVec = (q15_t const *) pSrc; + blkCnt = blockSize >> 3; + while (blkCnt > 0) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 8; + /* + * update per-lane min. + */ + curExtremValVec = vminaq(curExtremValVec, vecSrc); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 7; + if (blkCnt > 0) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 8; + p0 = vctp16q(blkCnt); + /* + * Get current min per lane and current index per lane + * when a min is selected + */ + curExtremValVec = vminaq_m(curExtremValVec, vecSrc, p0); + } + /* + * Get min value across the vector + */ + minValue = vminavq(minValue, (q15x8_t)curExtremValVec); + *pResult = minValue; +} + +#else +#if defined(ARM_MATH_DSP) +void arm_absmin_no_idx_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult) +{ + q15_t cur_absmin, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt; /* Loop counter */ \ + \ + \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = (out > 0) ? out : (q15_t)__QSUB16(0, out); \ + \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmin to next consecutive values one by one */ \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q15_t)__QSUB16(0, cur_absmin); \ + /* compare for the extrema value */ \ + if (cur_absmin < out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmin; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q15_t)__QSUB16(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q15_t)__QSUB16(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q15_t)__QSUB16(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + } \ + \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q15_t)__QSUB16(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ +} +#else +void arm_absmin_no_idx_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult) +{ + q15_t minVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* Loop counter */ + + + + /* Load first input value that act as reference value for comparision */ + out = (*pSrc > 0) ? *pSrc : ((*pSrc == (q15_t) 0x8000) ? 0x7fff : -*pSrc); + pSrc++; + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize minVal to the next consecutive values one by one */ + minVal = (*pSrc > 0) ? *pSrc : ((*pSrc == (q15_t) 0x8000) ? 0x7fff : -*pSrc); + pSrc++; + + /* compare for the minimum value */ + if (out > minVal) + { + /* Update the minimum value and it's index */ + out = minVal; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the minimum value and it's index into destination pointers */ + *pResult = out; +} +#endif /* defined(ARM_MATH_DSP) */ +#endif /* defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMin group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_q31.c new file mode 100644 index 0000000..90281a4 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_q31.c @@ -0,0 +1,225 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmin_no_idx_q31.c + * Description: Minimum value of absolute values of a Q31 vector + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + + +/** + @addtogroup AbsMin + @{ + */ + +/** + @brief Minimum value of absolute values of a Q31 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ + +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_absmin_no_idx_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult) +{ + int32_t blkCnt; /* loop counters */ + q31x4_t vecSrc; + q31_t const *pSrcVec; + uint32x4_t curExtremValVec = vdupq_n_s32(Q31_ABSMAX); + q31_t minValue = Q31_ABSMAX; + mve_pred16_t p0; + + + pSrcVec = (q31_t const *) pSrc; + blkCnt = blockSize >> 2; + while (blkCnt > 0) + { + vecSrc = vldrwq_s32(pSrcVec); + pSrcVec += 4; + /* + * update per-lane min. + */ + curExtremValVec = vminaq(curExtremValVec, vecSrc); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 3; + if (blkCnt > 0) + { + vecSrc = vldrwq_s32(pSrcVec); + pSrcVec += 4; + p0 = vctp32q(blkCnt); + /* + * Get current min per lane and current index per lane + * when a min is selected + */ + curExtremValVec = vminaq_m(curExtremValVec, vecSrc, p0); + } + /* + * Get min value across the vector + */ + minValue = vminavq(minValue, (q31x4_t)curExtremValVec); + *pResult = minValue; +} + +#else +#if defined(ARM_MATH_DSP) +void arm_absmin_no_idx_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult) +{ + q31_t cur_absmin, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt; /* Loop counter */ \ + \ + \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = (out > 0) ? out : (q31_t)__QSUB(0, out); \ + \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmin to next consecutive values one by one */ \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q31_t)__QSUB(0, cur_absmin); \ + /* compare for the extrema value */ \ + if (cur_absmin < out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmin; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q31_t)__QSUB(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q31_t)__QSUB(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q31_t)__QSUB(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + } \ + \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q31_t)__QSUB(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ +} +#else +void arm_absmin_no_idx_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult) +{ + q31_t minVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* Loop counter */ + + /* Load first input value that act as reference value for comparision */ + out = (*pSrc > 0) ? *pSrc : ((*pSrc == INT32_MIN) ? INT32_MAX : -*pSrc); + pSrc++; + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize minVal to the next consecutive values one by one */ + minVal = (*pSrc > 0) ? *pSrc : ((*pSrc == INT32_MIN) ? INT32_MAX : -*pSrc); + pSrc++; + + /* compare for the minimum value */ + if (out > minVal) + { + /* Update the minimum value and it's index */ + out = minVal; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the minimum value and it's index into destination pointers */ + *pResult = out; +} +#endif /* defined(ARM_MATH_DSP) */ +#endif /* defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMin group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_q7.c new file mode 100644 index 0000000..e0f712b --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_no_idx_q7.c @@ -0,0 +1,227 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmin_no_idx_q7.c + * Description: Minimum value of absolute values of a Q7 vector + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + + +/** + @addtogroup AbsMin + @{ + */ + +/** + @brief Minimum value of absolute values of a Q7 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + + + +void arm_absmin_no_idx_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult) +{ + int32_t blkCnt; /* loop counters */ + q7x16_t vecSrc; + q7_t const *pSrcVec; + uint8x16_t curExtremValVec = vdupq_n_s8(Q7_ABSMAX); + q7_t minValue = Q7_ABSMAX; + mve_pred16_t p0; + + + pSrcVec = (q7_t const *) pSrc; + blkCnt = blockSize >> 4; + while (blkCnt > 0) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 16; + /* + * update per-lane min. + */ + curExtremValVec = vminaq(curExtremValVec, vecSrc); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 0xF; + if (blkCnt > 0) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 16; + p0 = vctp8q(blkCnt); + /* + * Get current min per lane and current index per lane + * when a min is selected + */ + curExtremValVec = vminaq_m(curExtremValVec, vecSrc, p0); + } + /* + * Get min value across the vector + */ + minValue = vminavq(minValue, (q7x16_t)curExtremValVec); + *pResult = minValue; +} + +#else +#if defined(ARM_MATH_DSP) +void arm_absmin_no_idx_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult) +{ + q7_t cur_absmin, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt; /* Loop counter */ \ + \ + \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = (out > 0) ? out : (q7_t)__QSUB8(0, out); \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmin to next consecutive values one by one */ \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q7_t)__QSUB8(0, cur_absmin); \ + /* compare for the extrema value */ \ + if (cur_absmin < out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmin; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q7_t)__QSUB8(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q7_t)__QSUB8(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q7_t)__QSUB8(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + } \ + \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q7_t)__QSUB8(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ +} +#else +void arm_absmin_no_idx_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult) +{ + q7_t minVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* Loop counter */ + + + /* Load first input value that act as reference value for comparision */ + out = (*pSrc > 0) ? *pSrc : ((*pSrc == (q7_t) 0x80) ? (q7_t) 0x7f : -*pSrc); + pSrc++; + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize minVal to the next consecutive values one by one */ + minVal = (*pSrc > 0) ? *pSrc : ((*pSrc == (q7_t) 0x80) ? (q7_t) 0x7f : -*pSrc); + pSrc++; + + /* compare for the minimum value */ + if (out > minVal) + { + /* Update the minimum value and it's index */ + out = minVal; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the minimum value and it's index into destination pointers */ + *pResult = out; +} +#endif /* defined(ARM_MATH_DSP) */ +#endif /* defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMin group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_q15.c new file mode 100644 index 0000000..ef389ba --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_q15.c @@ -0,0 +1,273 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmin_q15.c + * Description: Minimum value of absolute values of a Q15 vector + * + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + + +/** + @addtogroup AbsMin + @{ + */ + +/** + @brief Minimum value of absolute values of a Q15 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @param[out] pIndex index of minimum value returned here + @return none + */ +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_absmin_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult, + uint32_t * pIndex) +{ + uint16_t blkCnt; /* loop counters */ + q15x8_t vecSrc; + q15_t const *pSrcVec; + q15x8_t curExtremValVec = vdupq_n_s16(Q15_ABSMAX); + q15_t minValue = Q15_ABSMAX; + uint16_t idx = blockSize; + uint16x8_t indexVec; + uint16x8_t curExtremIdxVec; + uint32_t startIdx = 0; + mve_pred16_t p0; + + + indexVec = vidupq_wb_u16(&startIdx, 1); + curExtremIdxVec = vdupq_n_u16(0); + + pSrcVec = (q15_t const *) pSrc; + blkCnt = blockSize >> 3; + while (blkCnt > 0U) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 8; + vecSrc = vabsq(vecSrc); + /* + * Get current min per lane and current index per lane + * when a min is selected + */ + p0 = vcmpleq(vecSrc, curExtremValVec); + curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); + curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + + indexVec = vidupq_wb_u16(&startIdx, 1); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 7; + if (blkCnt > 0U) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 8; + vecSrc = vabsq(vecSrc); + + p0 = vctp16q(blkCnt); + /* + * Get current min per lane and current index per lane + * when a min is selected + */ + p0 = vcmpleq_m(vecSrc, curExtremValVec, p0); + curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); + curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + } + /* + * Get min value across the vector + */ + minValue = vminvq(minValue, curExtremValVec); + /* + * set index for lower values to min possible index + */ + p0 = vcmpleq(curExtremValVec, minValue); + indexVec = vpselq(curExtremIdxVec, vdupq_n_u16(blockSize), p0); + /* + * Get min index which is thus for a min value + */ + idx = vminvq(idx, indexVec); + /* + * Save result + */ + *pIndex = idx; + *pResult = minValue; +} + +#else +#if defined(ARM_MATH_DSP) +void arm_absmin_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult, + uint32_t * pIndex) +{ + q15_t cur_absmin, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt, outIndex; /* Loop counter */ \ + uint32_t index; /* index of maximum value */ \ + \ + /* Initialize index value to zero. */ \ + outIndex = 0U; \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = (out > 0) ? out : (q15_t)__QSUB16(0, out); \ + /* Initialize index of extrema value. */ \ + index = 0U; \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmin to next consecutive values one by one */ \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q15_t)__QSUB16(0, cur_absmin); \ + /* compare for the extrema value */ \ + if (cur_absmin < out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmin; \ + outIndex = index + 1U; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q15_t)__QSUB16(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + outIndex = index + 2U; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q15_t)__QSUB16(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + outIndex = index + 3U; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q15_t)__QSUB16(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + outIndex = index + 4U; \ + } \ + \ + index += 4U; \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q15_t)__QSUB16(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + outIndex = blockSize - blkCnt; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ + *pIndex = outIndex; +} +#else +void arm_absmin_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult, + uint32_t * pIndex) +{ + q15_t minVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt, outIndex; /* Loop counter */ + + + /* Initialise index value to zero. */ + outIndex = 0U; + /* Load first input value that act as reference value for comparision */ + out = (*pSrc > 0) ? *pSrc : ((*pSrc == (q15_t) 0x8000) ? 0x7fff : -*pSrc); + pSrc++; + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize minVal to the next consecutive values one by one */ + minVal = (*pSrc > 0) ? *pSrc : ((*pSrc == (q15_t) 0x8000) ? 0x7fff : -*pSrc); + pSrc++; + + /* compare for the minimum value */ + if (out > minVal) + { + /* Update the minimum value and it's index */ + out = minVal; + outIndex = blockSize - blkCnt; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the minimum value and it's index into destination pointers */ + *pResult = out; + *pIndex = outIndex; +} +#endif /* defined(ARM_MATH_DSP) */ +#endif /* defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMin group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_q31.c new file mode 100644 index 0000000..0f28026 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_q31.c @@ -0,0 +1,273 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmin_q31.c + * Description: Minimum value of absolute values of a Q31 vector + * + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + + +/** + @addtogroup AbsMin + @{ + */ + +/** + @brief Minimum value of absolute values of a Q31 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @param[out] pIndex index of minimum value returned here + @return none + */ + +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_absmin_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult, + uint32_t * pIndex) +{ + uint16_t blkCnt; /* loop counters */ + q31x4_t vecSrc; + q31_t const *pSrcVec; + q31x4_t curExtremValVec = vdupq_n_s32(Q31_ABSMAX); + q31_t minValue = Q31_ABSMAX; + uint16_t idx = blockSize; + uint32x4_t indexVec; + uint32x4_t curExtremIdxVec; + uint32_t startIdx = 0; + mve_pred16_t p0; + + + indexVec = vidupq_wb_u32(&startIdx, 1); + curExtremIdxVec = vdupq_n_u32(0); + + pSrcVec = (q31_t const *) pSrc; + blkCnt = blockSize >> 2; + while (blkCnt > 0U) + { + vecSrc = vldrwq_s32(pSrcVec); + pSrcVec += 4; + vecSrc = vabsq(vecSrc); + /* + * Get current min per lane and current index per lane + * when a min is selected + */ + p0 = vcmpleq(vecSrc, curExtremValVec); + curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); + curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + + indexVec = vidupq_wb_u32(&startIdx, 1); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 3; + if (blkCnt > 0U) + { + vecSrc = vldrwq_s32(pSrcVec); + pSrcVec += 4; + vecSrc = vabsq(vecSrc); + + p0 = vctp32q(blkCnt); + /* + * Get current min per lane and current index per lane + * when a min is selected + */ + p0 = vcmpleq_m(vecSrc, curExtremValVec, p0); + curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); + curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + } + /* + * Get min value across the vector + */ + minValue = vminvq(minValue, curExtremValVec); + /* + * set index for lower values to min possible index + */ + p0 = vcmpleq(curExtremValVec, minValue); + indexVec = vpselq(curExtremIdxVec, vdupq_n_u32(blockSize), p0); + /* + * Get min index which is thus for a min value + */ + idx = vminvq(idx, indexVec); + /* + * Save result + */ + *pIndex = idx; + *pResult = minValue; +} + +#else +#if defined(ARM_MATH_DSP) +void arm_absmin_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult, + uint32_t * pIndex) +{ + q31_t cur_absmin, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt, outIndex; /* Loop counter */ \ + uint32_t index; /* index of maximum value */ \ + \ + /* Initialize index value to zero. */ \ + outIndex = 0U; \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = (out > 0) ? out : (q31_t)__QSUB(0, out); \ + /* Initialize index of extrema value. */ \ + index = 0U; \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmin to next consecutive values one by one */ \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q31_t)__QSUB(0, cur_absmin); \ + /* compare for the extrema value */ \ + if (cur_absmin < out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmin; \ + outIndex = index + 1U; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q31_t)__QSUB(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + outIndex = index + 2U; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q31_t)__QSUB(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + outIndex = index + 3U; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q31_t)__QSUB(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + outIndex = index + 4U; \ + } \ + \ + index += 4U; \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q31_t)__QSUB(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + outIndex = blockSize - blkCnt; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ + *pIndex = outIndex; +} +#else +void arm_absmin_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult, + uint32_t * pIndex) +{ + q31_t minVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt, outIndex; /* Loop counter */ + + /* Initialise index value to zero. */ + outIndex = 0U; + /* Load first input value that act as reference value for comparision */ + out = (*pSrc > 0) ? *pSrc : ((*pSrc == INT32_MIN) ? INT32_MAX : -*pSrc); + pSrc++; + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize minVal to the next consecutive values one by one */ + minVal = (*pSrc > 0) ? *pSrc : ((*pSrc == INT32_MIN) ? INT32_MAX : -*pSrc); + pSrc++; + + /* compare for the minimum value */ + if (out > minVal) + { + /* Update the minimum value and it's index */ + out = minVal; + outIndex = blockSize - blkCnt; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the minimum value and it's index into destination pointers */ + *pResult = out; + *pIndex = outIndex; +} +#endif /* defined(ARM_MATH_DSP) */ +#endif /* defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMin group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_q7.c new file mode 100644 index 0000000..99bb473 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_absmin_q7.c @@ -0,0 +1,326 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_absmin_q7.c + * Description: Minimum value of absolute values of a Q7 vector + * + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + + +/** + @addtogroup AbsMin + @{ + */ + +/** + @brief Minimum value of absolute values of a Q7 vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @param[out] pIndex index of minimum value returned here + @return none + */ +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +#define MAX_BLKSZ_S8 (UINT8_MAX+1) + +static void arm_small_blk_absmin_q7( + const q7_t *pSrc, + uint32_t blockSize, + q7_t *pResult, + uint32_t *pIndex) +{ + uint16_t blkCnt; /* loop counters */ + q7x16_t vecSrc; + q7_t const *pSrcVec; + q7x16_t curExtremValVec = vdupq_n_s8(Q7_ABSMAX); + q7_t minValue = Q7_ABSMAX; + uint16_t idx = blockSize - 1; + uint8x16_t indexVec; + uint8x16_t curExtremIdxVec; + uint32_t startIdx = 0; + mve_pred16_t p0; + + + indexVec = vidupq_wb_u8(&startIdx, 1); + curExtremIdxVec = vdupq_n_u8(0); + + pSrcVec = (q7_t const *) pSrc; + blkCnt = blockSize >> 4; + while (blkCnt > 0U) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 16; + vecSrc = vabsq(vecSrc); + /* + * Get current min per lane and current index per lane + * when a min is selected + */ + p0 = vcmpleq(vecSrc, curExtremValVec); + curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); + curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + + indexVec = vidupq_wb_u8(&startIdx, 1); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 0xF; + if (blkCnt > 0U) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 16; + vecSrc = vabsq(vecSrc); + + p0 = vctp8q(blkCnt); + /* + * Get current min per lane and current index per lane + * when a min is selected + */ + p0 = vcmpleq_m(vecSrc, curExtremValVec, p0); + curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); + curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + } + /* + * Get min value across the vector + */ + minValue = vminvq(minValue, curExtremValVec); + /* + * set index for lower values to min possible index + */ + p0 = vcmpleq(curExtremValVec, minValue); + idx = vminvq_p_u8(idx, curExtremIdxVec, p0); + /* + * Save result + */ + *pIndex = idx; + *pResult = minValue; +} + + +void arm_absmin_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult, + uint32_t * pIndex) +{ + int32_t totalSize = blockSize; + + if (totalSize <= MAX_BLKSZ_S8) + { + arm_small_blk_absmin_q7(pSrc, blockSize, pResult, pIndex); + } + else + { + uint32_t curIdx = 0; + q7_t curBlkExtr = Q7_MAX; + uint32_t curBlkPos = 0; + uint32_t curBlkIdx = 0; + /* + * process blocks of 255 elts + */ + while (totalSize >= MAX_BLKSZ_S8) + { + const q7_t *curSrc = pSrc; + + arm_small_blk_absmin_q7(curSrc, MAX_BLKSZ_S8, pResult, pIndex); + if (*pResult < curBlkExtr) + { + /* + * update partial extrema + */ + curBlkExtr = *pResult; + curBlkPos = *pIndex; + curBlkIdx = curIdx; + } + curIdx++; + pSrc += MAX_BLKSZ_S8; + totalSize -= MAX_BLKSZ_S8; + } + /* + * remainder + */ + arm_small_blk_absmin_q7(pSrc, totalSize, pResult, pIndex); + if (*pResult < curBlkExtr) + { + curBlkExtr = *pResult; + curBlkPos = *pIndex; + curBlkIdx = curIdx; + } + *pIndex = curBlkIdx * MAX_BLKSZ_S8 + curBlkPos; + *pResult = curBlkExtr; + } +} + +#else +#if defined(ARM_MATH_DSP) +void arm_absmin_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult, + uint32_t * pIndex) +{ + q7_t cur_absmin, out; /* Temporary variables to store the output value. */\ + uint32_t blkCnt, outIndex; /* Loop counter */ \ + uint32_t index; /* index of maximum value */ \ + \ + /* Initialize index value to zero. */ \ + outIndex = 0U; \ + /* Load first input value that act as reference value for comparision */ \ + out = *pSrc++; \ + out = (out > 0) ? out : (q7_t)__QSUB8(0, out); \ + /* Initialize index of extrema value. */ \ + index = 0U; \ + \ + /* Loop unrolling: Compute 4 outputs at a time */ \ + blkCnt = (blockSize - 1U) >> 2U; \ + \ + while (blkCnt > 0U) \ + { \ + /* Initialize cur_absmin to next consecutive values one by one */ \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q7_t)__QSUB8(0, cur_absmin); \ + /* compare for the extrema value */ \ + if (cur_absmin < out) \ + { \ + /* Update the extrema value and it's index */ \ + out = cur_absmin; \ + outIndex = index + 1U; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q7_t)__QSUB8(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + outIndex = index + 2U; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q7_t)__QSUB8(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + outIndex = index + 3U; \ + } \ + \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q7_t)__QSUB8(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + outIndex = index + 4U; \ + } \ + \ + index += 4U; \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Loop unrolling: Compute remaining outputs */ \ + blkCnt = (blockSize - 1U) % 4U; \ + \ + \ + while (blkCnt > 0U) \ + { \ + cur_absmin = *pSrc++; \ + cur_absmin = (cur_absmin > 0) ? cur_absmin : (q7_t)__QSUB8(0, cur_absmin); \ + if (cur_absmin < out) \ + { \ + out = cur_absmin; \ + outIndex = blockSize - blkCnt; \ + } \ + \ + /* Decrement loop counter */ \ + blkCnt--; \ + } \ + \ + /* Store the extrema value and it's index into destination pointers */ \ + *pResult = out; \ + *pIndex = outIndex; +} +#else +void arm_absmin_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult, + uint32_t * pIndex) +{ + q7_t minVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt, outIndex; /* Loop counter */ + + /* Initialise index value to zero. */ + outIndex = 0U; + /* Load first input value that act as reference value for comparision */ + out = (*pSrc > 0) ? *pSrc : ((*pSrc == (q7_t) 0x80) ? (q7_t) 0x7f : -*pSrc); + pSrc++; + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize minVal to the next consecutive values one by one */ + minVal = (*pSrc > 0) ? *pSrc : ((*pSrc == (q7_t) 0x80) ? (q7_t) 0x7f : -*pSrc); + pSrc++; + + /* compare for the minimum value */ + if (out > minVal) + { + /* Update the minimum value and it's index */ + out = minVal; + outIndex = blockSize - blkCnt; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the minimum value and it's index into destination pointers */ + *pResult = out; + *pIndex = outIndex; +} +#endif /* defined(ARM_MATH_DSP) */ +#endif /* defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of AbsMin group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_accumulate_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_accumulate_f16.c new file mode 100644 index 0000000..71be5f1 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_accumulate_f16.c @@ -0,0 +1,125 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_accumulate_f16.c + * Description: accumulation value of a floating-point vector + * + * $Date: 14 July 2022 + * $Revision: V1.0.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions_f16.h" + +#if defined(ARM_FLOAT16_SUPPORTED) + + +/** + @ingroup groupStats + */ + +/** + @defgroup Accumulation Accumulation functions + + Calculates the accumulation of the input vector. Sum is defined as the addition of the elements in the vector. + The underlying algorithm is used: + +
+ Result = (pSrc[0] + pSrc[1] + pSrc[2] + ... + pSrc[blockSize-1]);
+ 
+ + There are separate functions for floating-point, Q31, Q15, and Q7 data types. + */ + +/** + @addtogroup Accumulation + @{ + */ + +/** + @brief accumulate value of a floating-point vector. + @param[in] pSrc points to the input vector. + @param[in] blockSize number of samples in input vector. + @param[out] pResult sum of values in input vector. + @return none + */ + +void arm_accumulate_f16( + const float16_t * pSrc, + uint32_t blockSize, + float16_t * pResult) +{ + uint32_t blkCnt; /* Loop counter */ + float16_t sum = 0.0f16; /* Temporary result storage */ + +#if defined (ARM_MATH_LOOPUNROLL) && !defined(ARM_MATH_AUTOVECTORIZE) + + /* Loop unrolling: Compute 4 outputs at a time */ + blkCnt = blockSize >> 2U; + + while (blkCnt > 0U) + { + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ + sum += (_Float16)*pSrc++; + + sum += (_Float16)*pSrc++; + + sum += (_Float16)*pSrc++; + + sum += (_Float16)*pSrc++; + + /* Decrement the loop counter */ + blkCnt--; + } + + /* Loop unrolling: Compute remaining outputs */ + blkCnt = blockSize % 0x4U; + +#else + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + +#endif /* #if defined (ARM_MATH_LOOPUNROLL) */ + + while (blkCnt > 0U) + { + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ + sum += (_Float16)*pSrc++; + + /* Decrement loop counter */ + blkCnt--; + } + + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ + /* Store result to destination */ + *pResult = sum ; +} +#endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ + +/** + @} end of Accumulation group + */ + + + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_accumulate_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_accumulate_f32.c new file mode 100644 index 0000000..353ab17 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_accumulate_f32.c @@ -0,0 +1,213 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_accumulate_f32.c + * Description: Sum value of a floating-point vector + * + * $Date: 14 July 2022 + * $Revision: V1.0.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + + +/** + @addtogroup Accumulation + @{ + */ + +/** + @brief Accumulation value of a floating-point vector. + @param[in] pSrc points to the input vector. + @param[in] blockSize number of samples in input vector. + @param[out] pResult sum of values in input vector. + @return none + */ + +#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_accumulate_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult) +{ + f32x4_t vecA; + f32x4_t vecSum; + uint32_t blkCnt; + float32_t sum = 0.0f; + vecSum = vdupq_n_f32(0.0f); + + /* Compute 4 outputs at a time */ + blkCnt = blockSize >> 2U; + while (blkCnt > 0U) + { + /* + * C = A[0]* B[0] + A[1]* B[1] + A[2]* B[2] + .....+ A[blockSize-1]* B[blockSize-1] + * Calculate dot product and then store the result in a temporary buffer. + * and advance vector source and destination pointers + */ + vecA = vld1q_f32(pSrc); + pSrc += 4; + + vecSum = vaddq_f32(vecSum, vecA); + /* + * Decrement the blockSize loop counter + */ + blkCnt --; + } + + + blkCnt = blockSize & 3; + if (blkCnt > 0U) + { + /* C = A[0]* B[0] + A[1]* B[1] + A[2]* B[2] + .....+ A[blockSize-1]* B[blockSize-1] */ + + mve_pred16_t p0 = vctp32q(blkCnt); + vecA = vld1q(pSrc); + vecSum = vaddq_m(vecSum,vecSum, vecA, p0); + } + + sum = vecAddAcrossF32Mve(vecSum); + + /* Store result in destination buffer */ + *pResult = sum; +} + +#else + +#if defined(ARM_MATH_NEON) && !defined(ARM_MATH_AUTOVECTORIZE) +void arm_accumulate_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult) +{ + float32_t sum = 0.0f; /* Temporary result storage */ + float32x4_t sumV = vdupq_n_f32(0.0f); /* Temporary result storage */ + float32x2_t sumV2; + + uint32_t blkCnt; /* Loop counter */ + + float32x4_t inV; + + blkCnt = blockSize >> 2U; + + /* Compute 4 outputs at a time. + ** a second loop below computes the remaining 1 to 3 samples. */ + while (blkCnt > 0U) + { + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ + inV = vld1q_f32(pSrc); + sumV = vaddq_f32(sumV, inV); + + pSrc += 4; + /* Decrement the loop counter */ + blkCnt--; + } + + sumV2 = vpadd_f32(vget_low_f32(sumV),vget_high_f32(sumV)); + sum = vget_lane_f32(sumV2, 0) + vget_lane_f32(sumV2, 1); + + /* If the blockSize is not a multiple of 4, compute any remaining output samples here. + ** No loop unrolling is used. */ + blkCnt = blockSize & 3; + + while (blkCnt > 0U) + { + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ + sum += *pSrc++; + + /* Decrement the loop counter */ + blkCnt--; + } + + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ + /* Store the result to the destination */ + *pResult = sum; +} + +#else +void arm_accumulate_f32( + const float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult) +{ + uint32_t blkCnt; /* Loop counter */ + float32_t sum = 0.0f; /* Temporary result storage */ + +#if defined (ARM_MATH_LOOPUNROLL) && !defined(ARM_MATH_AUTOVECTORIZE) + + /* Loop unrolling: Compute 4 outputs at a time */ + blkCnt = blockSize >> 2U; + + while (blkCnt > 0U) + { + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ + sum += *pSrc++; + + sum += *pSrc++; + + sum += *pSrc++; + + sum += *pSrc++; + + /* Decrement the loop counter */ + blkCnt--; + } + + /* Loop unrolling: Compute remaining outputs */ + blkCnt = blockSize % 0x4U; + +#else + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + +#endif /* #if defined (ARM_MATH_LOOPUNROLL) */ + + while (blkCnt > 0U) + { + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ + sum += *pSrc++; + + /* Decrement loop counter */ + blkCnt--; + } + + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ + /* Store result to destination */ + *pResult = sum ; +} +#endif /* #if defined(ARM_MATH_NEON) */ + +#endif /* #if defined(ARM_MATH_MVEF) */ +/** + @} end of Accumulation group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_accumulate_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_accumulate_f64.c new file mode 100644 index 0000000..25420ac --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_accumulate_f64.c @@ -0,0 +1,131 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_accumulate_f64.c + * Description: Accumulation value of a floating-point vector + * + * $Date: 14 July 2022 + * $Revision: V1.0.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h" + +/** + @ingroup groupStats + */ + + +/** + @addtogroup Accumulation + @{ + */ + +/** + @brief Accumulation value of a floating-point vector. + @param[in] pSrc points to the input vector. + @param[in] blockSize number of samples in input vector. + @param[out] pResult sum of values in input vector. + @return none + */ +#if defined(ARM_MATH_NEON) && defined(__aarch64__) +void arm_accumulate_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult) +{ + uint32_t blkCnt; /* Loop counter */ + + /*Neon buffers*/ + float64x2_t vSum = vdupq_n_f64(0.0); + float64x2_t afterLoad ; + + float64_t sum = 0.; /* Temporary result storage */ + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize >> 1U; + + + while (blkCnt > 0U) + { + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ + + afterLoad = vld1q_f64(pSrc); + vSum = vaddq_f64(vSum, afterLoad); + + /* Decrement loop counter */ + blkCnt--; + + pSrc += 2; + } + sum = vaddvq_f64(vSum); + + /* Tail */ + blkCnt = blockSize & 1 ; + + while (blkCnt > 0U) + { + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ + sum += *pSrc++; + + /* Decrement loop counter */ + blkCnt--; + } + + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ + /* Store result to destination */ + *pResult = sum; +} +#else +void arm_accumulate_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult) +{ + uint32_t blkCnt; /* Loop counter */ + float64_t sum = 0.; /* Temporary result storage */ + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ + sum += *pSrc++; + + /* Decrement loop counter */ + blkCnt--; + } + + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ + /* Store result to destination */ + *pResult = sum; +} + +#endif + + +/** + @} end of Accumulation group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_entropy_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_entropy_f16.c index 9a5bf6a..4e223c7 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_entropy_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_entropy_f16.c @@ -5,11 +5,13 @@ * Title: arm_logsumexp_f16.c * Description: LogSumExp * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -97,7 +99,7 @@ float16_t arm_entropy_f16(const float16_t * pSrcA,uint32_t blockSize) while(blkCnt > 0) { p = *pSrcA++; - accum += p * logf(p); + accum += p * (_Float16)logf((float32_t)p); blkCnt--; @@ -122,7 +124,7 @@ float16_t arm_entropy_f16(const float16_t * pSrcA,uint32_t blockSize) while(blkCnt > 0) { p = *pIn++; - accum += p * logf(p); + accum += p * (_Float16)logf((float32_t)p); blkCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_entropy_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_entropy_f32.c index 163f8be..290e5c1 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_entropy_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_entropy_f32.c @@ -5,11 +5,13 @@ * Title: arm_logsumexp_f32.c * Description: LogSumExp * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_entropy_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_entropy_f64.c index 5be9be9..5cb2ef5 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_entropy_f64.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_entropy_f64.c @@ -5,11 +5,13 @@ * Title: arm_logsumexp_f64.c * Description: LogSumExp * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -53,7 +55,7 @@ float64_t arm_entropy_f64(const float64_t * pSrcA, uint32_t blockSize) pIn = pSrcA; blkCnt = blockSize; - accum = 0.0f; + accum = 0.0; while(blkCnt > 0) { diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_kullback_leibler_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_kullback_leibler_f16.c index 10e1528..6c291fe 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_kullback_leibler_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_kullback_leibler_f16.c @@ -5,11 +5,13 @@ * Title: arm_logsumexp_f16.c * Description: LogSumExp * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -81,7 +83,7 @@ float16_t arm_kullback_leibler_f16(const float16_t * pSrcA,const float16_t * pSr accum = 0.0f16; - f16x8_t vSum = vdupq_n_f16(0.0f); + f16x8_t vSum = vdupq_n_f16(0.0f16); blkCnt = blockSize >> 3; while(blkCnt > 0) { @@ -108,7 +110,7 @@ float16_t arm_kullback_leibler_f16(const float16_t * pSrcA,const float16_t * pSr { pA = *pSrcA++; pB = *pSrcB++; - accum += pA * logf(pB / pA); + accum += pA * (_Float16)logf((float32_t)pB / (float32_t)pA); blkCnt--; @@ -134,7 +136,7 @@ float16_t arm_kullback_leibler_f16(const float16_t * pSrcA,const float16_t * pSr { pA = *pInA++; pB = *pInB++; - accum += pA * logf(pB / pA); + accum += pA * (_Float16)logf((float32_t)pB / (float32_t)pA); blkCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_kullback_leibler_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_kullback_leibler_f32.c index 7193b4e..993e102 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_kullback_leibler_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_kullback_leibler_f32.c @@ -5,11 +5,13 @@ * Title: arm_logsumexp_f32.c * Description: LogSumExp * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_kullback_leibler_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_kullback_leibler_f64.c index 1eede11..8bde9c2 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_kullback_leibler_f64.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_kullback_leibler_f64.c @@ -5,11 +5,13 @@ * Title: arm_logsumexp_f64.c * Description: LogSumExp * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -55,7 +57,7 @@ float64_t arm_kullback_leibler_f64(const float64_t * pSrcA, const float64_t * pS pInB = pSrcB; blkCnt = blockSize; - accum = 0.0f; + accum = 0.0; while(blkCnt > 0) { diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_logsumexp_dot_prod_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_logsumexp_dot_prod_f16.c index 28cb1df..08fb197 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_logsumexp_dot_prod_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_logsumexp_dot_prod_f16.c @@ -5,11 +5,13 @@ * Title: arm_logsumexp_f16.c * Description: LogSumExp * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_logsumexp_dot_prod_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_logsumexp_dot_prod_f32.c index 95ae872..bb5d90f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_logsumexp_dot_prod_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_logsumexp_dot_prod_f32.c @@ -5,11 +5,13 @@ * Title: arm_logsumexp_f32.c * Description: LogSumExp * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_logsumexp_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_logsumexp_f16.c index 1b809f3..dc151f7 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_logsumexp_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_logsumexp_f16.c @@ -5,11 +5,13 @@ * Title: arm_logsumexp_f16.c * Description: LogSumExp * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -111,12 +113,12 @@ float16_t arm_logsumexp_f16(const float16_t *in, uint32_t blockSize) while(blkCnt > 0) { tmp = *pIn++; - accum += expf(tmp - maxVal); + accum += (_Float16)expf((float32_t)((_Float16)tmp - (_Float16)maxVal)); blkCnt--; } - accum = maxVal + logf(accum); + accum = (_Float16)maxVal + (_Float16)logf((float32_t)accum); return (accum); } @@ -154,11 +156,11 @@ float16_t arm_logsumexp_f16(const float16_t *in, uint32_t blockSize) while(blkCnt > 0) { tmp = *pIn++; - accum += expf(tmp - maxVal); + accum += (_Float16)expf((float32_t)((_Float16)tmp - (_Float16)maxVal)); blkCnt--; } - accum = maxVal + logf(accum); + accum = (_Float16)maxVal + (_Float16)logf((float32_t)accum); return(accum); } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_logsumexp_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_logsumexp_f32.c index 6156a1a..8f0cc74 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_logsumexp_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_logsumexp_f32.c @@ -5,11 +5,13 @@ * Title: arm_logsumexp_f32.c * Description: LogSumExp * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -113,7 +115,7 @@ float32_t arm_logsumexp_f32(const float32_t *in, uint32_t blockSize) } - accum = maxVal + log(accum); + accum = maxVal + logf(accum); return (accum); } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_f16.c index c405ae2..3fb0512 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_f16.c @@ -5,13 +5,13 @@ * Title: arm_max_f16.c * Description: Maximum value of a floating-point vector * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -122,7 +122,7 @@ void arm_max_f16( tmp = *pSrc++; /* compare for the maximum value */ - if (maxValue < tmp) + if ((_Float16)maxValue < (_Float16)tmp) { /* Update the maximum value and it's index */ maxValue = tmp; @@ -173,7 +173,7 @@ void arm_max_f16( maxVal = *pSrc++; /* compare for the maximum value */ - if (out < maxVal) + if ((_Float16)out < (_Float16)maxVal) { /* Update the maximum value and it's index */ out = maxVal; @@ -181,21 +181,21 @@ void arm_max_f16( } maxVal = *pSrc++; - if (out < maxVal) + if ((_Float16)out < (_Float16)maxVal) { out = maxVal; outIndex = index + 2U; } maxVal = *pSrc++; - if (out < maxVal) + if ((_Float16)out < (_Float16)maxVal) { out = maxVal; outIndex = index + 3U; } maxVal = *pSrc++; - if (out < maxVal) + if ((_Float16)out < (_Float16)maxVal) { out = maxVal; outIndex = index + 4U; @@ -223,7 +223,7 @@ void arm_max_f16( maxVal = *pSrc++; /* compare for the maximum value */ - if (out < maxVal) + if ((_Float16)out < (_Float16)maxVal) { /* Update the maximum value and it's index */ out = maxVal; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_f32.c index 3ee95bb..4856c46 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_f32.c @@ -5,13 +5,13 @@ * Title: arm_max_f32.c * Description: Maximum value of a floating-point vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -167,7 +167,7 @@ void arm_max_f32( uint32x4_t countV; uint32x2_t countV2; - maxIdx = vdupq_n_u32(ULONG_MAX); + maxIdx = vdupq_n_u32(UINT_MAX); delta = vdupq_n_u32(4); index = vld1q_u32(indexInit); countV = vld1q_u32(countVInit); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_f64.c new file mode 100644 index 0000000..66cfd34 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_f64.c @@ -0,0 +1,94 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_max_f64.c + * Description: Maximum value of a floating-point vector + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup Max + @{ + */ + +/** + @brief Maximum value of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @param[out] pIndex index of maximum value returned here + @return none + */ +void arm_max_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult, + uint32_t * pIndex) +{ + float64_t maxVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt, outIndex; /* Loop counter */ + + /* Initialise index value to zero. */ + outIndex = 0U; + + /* Load first input value that act as reference value for comparision */ + out = *pSrc++; + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal = *pSrc++; + + /* compare for the maximum value */ + if (out < maxVal) + { + /* Update the maximum value and it's index */ + out = maxVal; + outIndex = blockSize - blkCnt; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the maximum value and it's index into destination pointers */ + *pResult = out; + *pIndex = outIndex; +} + +/** + @} end of Max group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_f16.c index 5a7b514..a7232da 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_f16.c @@ -5,13 +5,13 @@ * Title: arm_max_no_idx_f16.c * Description: Maximum value of a floating-point vector without returning the index * - * $Date: 16. October 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -97,7 +97,7 @@ void arm_max_no_idx_f16( newVal = *pSrc++; /* compare for the maximum value */ - if (maxValue < newVal) + if ((_Float16)maxValue < (_Float16)newVal) { /* Update the maximum value and it's index */ maxValue = newVal; @@ -124,7 +124,7 @@ void arm_max_no_idx_f16( newVal = *pSrc++; /* compare for the maximum value */ - if (maxValue < newVal) + if ((_Float16)maxValue < (_Float16)newVal) { /* Update the maximum value and it's index */ maxValue = newVal; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_f32.c index 3961416..c578e6b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_f32.c @@ -5,13 +5,13 @@ * Title: arm_max_no_idx_f32.c * Description: Maximum value of a floating-point vector without returning the index * - * $Date: 16. October 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_f64.c new file mode 100644 index 0000000..dcb7afb --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_f64.c @@ -0,0 +1,79 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_max_no_idx_f64.c + * Description: Maximum value of a floating-point vector without returning the index + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + + +/** + @addtogroup Max + @{ + */ + +/** + @brief Maximum value of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @return none + */ +void arm_max_no_idx_f64( + const float64_t *pSrc, + uint32_t blockSize, + float64_t *pResult) +{ + float64_t maxValue = F64_MIN; + float64_t newVal; + + while (blockSize > 0U) + { + newVal = *pSrc++; + + /* compare for the maximum value */ + if (maxValue < newVal) + { + /* Update the maximum value and it's index */ + maxValue = newVal; + } + + blockSize --; + } + + *pResult = maxValue; +} + +/** + @} end of Max group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_q15.c new file mode 100644 index 0000000..063a5e3 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_q15.c @@ -0,0 +1,146 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_max_no_idx_q15.c + * Description: Maximum value of a q15 vector without returning the index + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + + +/** + @ingroup groupStats + */ + +/** + @addtogroup Max + @{ + */ + +/** + @brief Maximum value of a q15 vector without index. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @return none + */ + +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_max_no_idx_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult) +{ + int32_t blkCnt; /* loop counters */ + q15x8_t vecSrc; + q15_t const *pSrcVec; + q15x8_t curExtremValVec = vdupq_n_s16(Q15_MIN); + q15_t maxValue = Q15_MIN; + mve_pred16_t p0; + + + pSrcVec = (q15_t const *) pSrc; + blkCnt = blockSize >> 3; + while (blkCnt > 0) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 8; + /* + * update per-lane max. + */ + curExtremValVec = vmaxq(vecSrc, curExtremValVec); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 7; + if (blkCnt > 0) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 8; + p0 = vctp16q(blkCnt); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + curExtremValVec = vmaxq_m(curExtremValVec, vecSrc, curExtremValVec, p0); + } + /* + * Get max value across the vector + */ + maxValue = vmaxvq(maxValue, curExtremValVec); + *pResult = maxValue; +} + +#else +void arm_max_no_idx_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult) +{ + q15_t maxVal1, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* loop counter */ + + /* Load first input value that act as reference value for comparision */ + out = *pSrc++; + + blkCnt = (blockSize - 1U); + + + while (blkCnt > 0U) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal1 = *pSrc++; + + /* compare for the maximum value */ + if (out < maxVal1) + { + /* Update the maximum value */ + out = maxVal1; + } + + /* Decrement the loop counter */ + blkCnt--; + } + + /* Store the maximum value into destination pointer */ + *pResult = out; +} + +#endif /* #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of Max group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_q31.c new file mode 100644 index 0000000..cffdd13 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_q31.c @@ -0,0 +1,146 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_max_no_idx_q31.c + * Description: Maximum value of a q31 vector without returning the index + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + + +/** + @ingroup groupStats + */ + +/** + @addtogroup Max + @{ + */ + +/** + @brief Maximum value of a q31 vector without index. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @return none + */ + +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_max_no_idx_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult) +{ + int32_t blkCnt; /* loop counters */ + q31x4_t vecSrc; + q31_t const *pSrcVec; + q31x4_t curExtremValVec = vdupq_n_s32(Q31_MIN); + q31_t maxValue = Q31_MIN; + mve_pred16_t p0; + + + pSrcVec = (q31_t const *) pSrc; + blkCnt = blockSize >> 2; + while (blkCnt > 0) + { + vecSrc = vldrwq_s32(pSrcVec); + pSrcVec += 4; + /* + * update per-lane max. + */ + curExtremValVec = vmaxq(vecSrc, curExtremValVec); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 3; + if (blkCnt > 0) + { + vecSrc = vldrwq_s32(pSrcVec); + pSrcVec += 4; + p0 = vctp32q(blkCnt); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + curExtremValVec = vmaxq_m(curExtremValVec, vecSrc, curExtremValVec, p0); + } + /* + * Get max value across the vector + */ + maxValue = vmaxvq(maxValue, curExtremValVec); + *pResult = maxValue; +} + +#else +void arm_max_no_idx_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult) +{ + q31_t maxVal1, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* loop counter */ + + /* Load first input value that act as reference value for comparision */ + out = *pSrc++; + + blkCnt = (blockSize - 1U); + + + while (blkCnt > 0U) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal1 = *pSrc++; + + /* compare for the maximum value */ + if (out < maxVal1) + { + /* Update the maximum value */ + out = maxVal1; + } + + /* Decrement the loop counter */ + blkCnt--; + } + + /* Store the maximum value into destination pointer */ + *pResult = out; +} + +#endif /* #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of Max group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_q7.c new file mode 100644 index 0000000..059acf5 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_no_idx_q7.c @@ -0,0 +1,147 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_max_no_idx_q7.c + * Description: Maximum value of a q7 vector without returning the index + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + + +/** + @ingroup groupStats + */ + +/** + @addtogroup Max + @{ + */ + +/** + @brief Maximum value of a q7 vector without index. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult maximum value returned here + @return none + */ + +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_max_no_idx_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult) +{ + int32_t blkCnt; /* loop counters */ + q7x16_t vecSrc; + q7_t const *pSrcVec; + q7x16_t curExtremValVec = vdupq_n_s8(Q7_MIN); + q7_t maxValue = Q7_MIN; + mve_pred16_t p0; + + + pSrcVec = (q7_t const *) pSrc; + blkCnt = blockSize >> 4; + while (blkCnt > 0) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 16; + /* + * update per-lane max. + */ + curExtremValVec = vmaxq(vecSrc, curExtremValVec); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 0xF; + if (blkCnt > 0) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 16; + p0 = vctp8q(blkCnt); + /* + * Get current max per lane and current index per lane + * when a max is selected + */ + curExtremValVec = vmaxq_m(curExtremValVec, vecSrc, curExtremValVec, p0); + } + /* + * Get max value across the vector + */ + maxValue = vmaxvq(maxValue, curExtremValVec); + *pResult = maxValue; +} + +#else + +void arm_max_no_idx_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult) +{ + q7_t maxVal1, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* loop counter */ + + /* Load first input value that act as reference value for comparision */ + out = *pSrc++; + + blkCnt = (blockSize - 1U); + + + while (blkCnt > 0U) + { + /* Initialize maxVal to the next consecutive values one by one */ + maxVal1 = *pSrc++; + + /* compare for the maximum value */ + if (out < maxVal1) + { + /* Update the maximum value */ + out = maxVal1; + } + + /* Decrement the loop counter */ + blkCnt--; + } + + /* Store the maximum value into destination pointer */ + *pResult = out; +} + +#endif /* #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of Max group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_q15.c index 32663e3..9f30ece 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_q15.c @@ -5,13 +5,13 @@ * Title: arm_max_q15.c * Description: Maximum value of a Q15 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -57,78 +57,49 @@ void arm_max_q15( q15_t * pResult, uint32_t * pIndex) { - uint32_t blkCnt; /* loop counters */ - q15x8_t vecSrc; - q15x8_t curExtremValVec = vdupq_n_s16(Q15_MIN); - q15_t maxValue = Q15_MIN, temp; - uint32_t idx = blockSize; - uint16x8_t indexVec; - uint16x8_t curExtremIdxVec; - mve_pred16_t p0; - - - indexVec = vidupq_u16((uint32_t)0, 1); - curExtremIdxVec = vdupq_n_u16(0); - - blkCnt = blockSize >> 3; - while (blkCnt > 0U) - { - vecSrc = vldrhq_s16(pSrc); - pSrc += 8; + int32_t blkCnt; /* loop counters */ + q15x8_t extremValVec = vdupq_n_s16(Q15_MIN); + q15_t maxValue = Q15_MIN; + uint16x8_t indexVec; + uint16x8_t extremIdxVec; + mve_pred16_t p0; + uint16_t extremIdxArr[8]; + + indexVec = vidupq_u16(0U, 1); + + blkCnt = blockSize; + do { + mve_pred16_t p = vctp16q(blkCnt); + q15x8_t extremIdxVal = vld1q_z_s16(pSrc, p); /* * Get current max per lane and current index per lane * when a max is selected */ - p0 = vcmpgeq(vecSrc, curExtremValVec); - curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); - curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + p0 = vcmpgeq_m(extremIdxVal, extremValVec, p); - indexVec = indexVec + 8; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - - /* - * Get max value across the vector - */ - maxValue = vmaxvq(maxValue, curExtremValVec); - /* - * set index for lower values to max possible index - */ - p0 = vcmpgeq(curExtremValVec, maxValue); - indexVec = vpselq(curExtremIdxVec, vdupq_n_u16(blockSize), p0); - /* - * Get min index which is thus for a max value - */ - idx = vminvq(idx, indexVec); - - /* Tail */ - blkCnt = blockSize & 0x7; - while (blkCnt > 0U) - { - /* Initialize temp to the next consecutive values one by one */ - temp = *pSrc++; - - /* compare for the maximum value */ - if (maxValue < temp) - { - /* Update the maximum value and it's index */ - maxValue = temp; - idx = blockSize - blkCnt; - } - - /* Decrement loop counter */ - blkCnt--; + extremValVec = vorrq_m(extremValVec, extremIdxVal, extremIdxVal, p0); + /* store per-lane extrema indexes */ + vst1q_p_u16(extremIdxArr, indexVec, p0); + + indexVec += 8; + pSrc += 8; + blkCnt -= 8; } + while (blkCnt > 0); + - /* - * Save result - */ - *pIndex = idx; + /* Get max value across the vector */ + maxValue = vmaxvq(maxValue, extremValVec); + + /* set index for lower values to max possible index */ + p0 = vcmpgeq(extremValVec, maxValue); + extremIdxVec = vld1q_u16(extremIdxArr); + + indexVec = vpselq(extremIdxVec, vdupq_n_u16(blockSize - 1), p0); + *pIndex = vminvq(blockSize - 1, indexVec); *pResult = maxValue; } + #else void arm_max_q15( const q15_t * pSrc, diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_q31.c index 2b3288c..d0665a4 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_q31.c @@ -5,13 +5,13 @@ * Title: arm_max_q31.c * Description: Maximum value of a Q31 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -52,86 +52,54 @@ #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" void arm_max_q31( - const q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult, - uint32_t * pIndex) + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult, + uint32_t * pIndex) { - uint32_t blkCnt; /* loop counters */ - q31x4_t vecSrc; - q31x4_t curExtremValVec = vdupq_n_s32( Q31_MIN); - q31_t maxValue = Q31_MIN; - q31_t temp; - uint32_t idx = blockSize; - uint32x4_t indexVec; - uint32x4_t curExtremIdxVec; - mve_pred16_t p0; - - - indexVec = vidupq_u32((uint32_t)0, 1); - curExtremIdxVec = vdupq_n_u32(0); - - /* Compute 4 outputs at a time */ - blkCnt = blockSize >> 2U; - while (blkCnt > 0U) - { - vecSrc = vldrwq_s32(pSrc); - pSrc += 4; + int32_t blkCnt; /* loop counters */ + q31x4_t extremValVec = vdupq_n_s32(Q31_MIN); + q31_t maxValue = Q31_MIN; + uint32x4_t indexVec; + uint32x4_t extremIdxVec; + mve_pred16_t p0; + uint32_t extremIdxArr[4]; + + indexVec = vidupq_u32(0U, 1); + + blkCnt = blockSize; + do { + mve_pred16_t p = vctp32q(blkCnt); + q31x4_t extremIdxVal = vld1q_z_s32(pSrc, p); /* * Get current max per lane and current index per lane * when a max is selected */ - p0 = vcmpgeq(vecSrc, curExtremValVec); - curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); - curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + p0 = vcmpgeq_m(extremIdxVal, extremValVec, p); - indexVec = indexVec + 4; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - - /* - * Get max value across the vector - */ - maxValue = vmaxvq(maxValue, curExtremValVec); - /* - * set index for lower values to max possible index - */ - p0 = vcmpgeq(curExtremValVec, maxValue); - indexVec = vpselq(curExtremIdxVec, vdupq_n_u32(blockSize), p0); - /* - * Get min index which is thus for a max value - */ - idx = vminvq(idx, indexVec); - - /* Tail */ - blkCnt = blockSize & 0x3; - - while (blkCnt > 0U) - { - /* Initialize maxVal to the next consecutive values one by one */ - temp = *pSrc++; - - /* compare for the maximum value */ - if (maxValue < temp) - { - /* Update the maximum value and it's index */ - maxValue = temp; - idx = blockSize - blkCnt; - } - - /* Decrement loop counter */ - blkCnt--; + extremValVec = vorrq_m(extremValVec, extremIdxVal, extremIdxVal, p0); + /* store per-lane extrema indexes */ + vst1q_p_u32(extremIdxArr, indexVec, p0); + + indexVec += 4; + pSrc += 4; + blkCnt -= 4; } + while (blkCnt > 0); - /* - * Save result - */ - *pIndex = idx; + + /* Get max value across the vector */ + maxValue = vmaxvq(maxValue, extremValVec); + + /* set index for lower values to max possible index */ + p0 = vcmpgeq(extremValVec, maxValue); + extremIdxVec = vld1q_u32(extremIdxArr); + + indexVec = vpselq(extremIdxVec, vdupq_n_u32(blockSize - 1), p0); + *pIndex = vminvq(blockSize - 1, indexVec); *pResult = maxValue; } + #else void arm_max_q31( const q31_t * pSrc, diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_q7.c index 72fdf31..377db4a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_max_q7.c @@ -5,13 +5,13 @@ * Title: arm_max_q7.c * Description: Maximum value of a Q7 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -53,83 +53,50 @@ static void arm_small_blk_max_q7( const q7_t * pSrc, - uint8_t blockSize, + uint16_t blockSize, q7_t * pResult, uint32_t * pIndex) { - uint32_t blkCnt; /* loop counters */ - q7x16_t vecSrc; - q7x16_t curExtremValVec = vdupq_n_s8( Q7_MIN); - q7_t maxValue = Q7_MIN, temp; - uint32_t idx = blockSize; - uint8x16_t indexVec; - uint8x16_t curExtremIdxVec; - mve_pred16_t p0; - - - indexVec = vidupq_u8((uint32_t)0, 1); - curExtremIdxVec = vdupq_n_u8(0); - - blkCnt = blockSize >> 4; - while (blkCnt > 0U) - { - vecSrc = vldrbq_s8(pSrc); - pSrc += 16; + int32_t blkCnt; /* loop counters */ + q7x16_t extremValVec = vdupq_n_s8(Q7_MIN); + q7_t maxValue = Q7_MIN; + uint8x16_t indexVec; + uint8x16_t extremIdxVec; + mve_pred16_t p0; + uint8_t extremIdxArr[16]; + + indexVec = vidupq_u8(0U, 1); + + blkCnt = blockSize; + do { + mve_pred16_t p = vctp8q(blkCnt); + q7x16_t extremIdxVal = vld1q_z_s8(pSrc, p); /* * Get current max per lane and current index per lane * when a max is selected */ - p0 = vcmpgeq(vecSrc, curExtremValVec); - curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); - curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + p0 = vcmpgeq_m(extremIdxVal, extremValVec, p); - indexVec = indexVec + 16; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - - - /* - * Get max value across the vector - */ - maxValue = vmaxvq(maxValue, curExtremValVec); - /* - * set index for lower values to max possible index - */ - p0 = vcmpgeq(curExtremValVec, maxValue); - indexVec = vpselq(curExtremIdxVec, vdupq_n_u8(blockSize), p0); - /* - * Get min index which is thus for a max value - */ - idx = vminvq(idx, indexVec); - - /* - * tail - */ - blkCnt = blockSize & 0xF; - - while (blkCnt > 0U) - { - /* Initialize temp to the next consecutive values one by one */ - temp = *pSrc++; - - /* compare for the maximum value */ - if (maxValue < temp) - { - /* Update the maximum value and it's index */ - maxValue = temp; - idx = blockSize - blkCnt; - } - - /* Decrement loop counter */ - blkCnt--; + extremValVec = vorrq_m(extremValVec, extremIdxVal, extremIdxVal, p0); + /* store per-lane extrema indexes */ + vst1q_p_u8(extremIdxArr, indexVec, p0); + + indexVec += 16; + pSrc += 16; + blkCnt -= 16; } - /* - * Save result - */ - *pIndex = idx; + while (blkCnt > 0); + + + /* Get max value across the vector */ + maxValue = vmaxvq(maxValue, extremValVec); + + /* set index for lower values to max possible index */ + p0 = vcmpgeq(extremValVec, maxValue); + extremIdxVec = vld1q_u8(extremIdxArr); + + indexVec = vpselq(extremIdxVec, vdupq_n_u8(blockSize - 1), p0); + *pIndex = vminvq_u8(blockSize - 1, indexVec); *pResult = maxValue; } @@ -140,8 +107,9 @@ void arm_max_q7( uint32_t * pIndex) { int32_t totalSize = blockSize; + const uint16_t sub_blk_sz = UINT8_MAX + 1; - if (totalSize <= UINT8_MAX) + if (totalSize <= sub_blk_sz) { arm_small_blk_max_q7(pSrc, blockSize, pResult, pIndex); } @@ -154,11 +122,11 @@ void arm_max_q7( /* * process blocks of 255 elts */ - while (totalSize >= UINT8_MAX) + while (totalSize >= sub_blk_sz) { const q7_t *curSrc = pSrc; - arm_small_blk_max_q7(curSrc, UINT8_MAX, pResult, pIndex); + arm_small_blk_max_q7(curSrc, sub_blk_sz, pResult, pIndex); if (*pResult > curBlkExtr) { /* @@ -169,8 +137,8 @@ void arm_max_q7( curBlkIdx = curIdx; } curIdx++; - pSrc += UINT8_MAX; - totalSize -= UINT8_MAX; + pSrc += sub_blk_sz; + totalSize -= sub_blk_sz; } /* * remainder @@ -182,7 +150,7 @@ void arm_max_q7( curBlkPos = *pIndex; curBlkIdx = curIdx; } - *pIndex = curBlkIdx * UINT8_MAX + curBlkPos; + *pIndex = curBlkIdx * sub_blk_sz + curBlkPos; *pResult = curBlkExtr; } } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_f16.c index a2739ac..19ded7d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_f16.c @@ -5,13 +5,13 @@ * Title: arm_mean_f16.c * Description: Mean value of a floating-point vector * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -87,7 +87,7 @@ void arm_mean_f16( } while (blkCnt > 0); - *pResult = vecAddAcrossF16Mve(sumVec) / (float16_t) blockSize; + *pResult = (_Float16)vecAddAcrossF16Mve(sumVec) / (_Float16) blockSize; } @@ -109,13 +109,13 @@ void arm_mean_f16( while (blkCnt > 0U) { /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ - sum += *pSrc++; + sum += (_Float16)*pSrc++; - sum += *pSrc++; + sum += (_Float16)*pSrc++; - sum += *pSrc++; + sum += (_Float16)*pSrc++; - sum += *pSrc++; + sum += (_Float16)*pSrc++; /* Decrement the loop counter */ blkCnt--; @@ -134,7 +134,7 @@ void arm_mean_f16( while (blkCnt > 0U) { /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ - sum += *pSrc++; + sum += (_Float16)*pSrc++; /* Decrement loop counter */ blkCnt--; @@ -142,7 +142,7 @@ void arm_mean_f16( /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) / blockSize */ /* Store result to destination */ - *pResult = (sum / (float16_t)blockSize); + *pResult = ((_Float16)sum / (_Float16)blockSize); } #endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_f32.c index 79bf476..99c6dbe 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_f32.c @@ -5,13 +5,13 @@ * Title: arm_mean_f32.c * Description: Mean value of a floating-point vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_f64.c new file mode 100644 index 0000000..cb91116 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_f64.c @@ -0,0 +1,79 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mean_f64.c + * Description: Mean value of a floating-point vector + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + + +/** + @addtogroup mean + @{ + */ + +/** + @brief Mean value of a floating-point vector. + @param[in] pSrc points to the input vector. + @param[in] blockSize number of samples in input vector. + @param[out] pResult mean value returned here. + @return none + */ +void arm_mean_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult) +{ + uint32_t blkCnt; /* Loop counter */ + float64_t sum = 0.; /* Temporary result storage */ + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ + sum += *pSrc++; + + /* Decrement loop counter */ + blkCnt--; + } + + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) / blockSize */ + /* Store result to destination */ + *pResult = (sum / blockSize); +} + +/** + @} end of mean group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_q15.c index de20f9a..0eefbdb 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_q15.c @@ -5,13 +5,13 @@ * Title: arm_mean_q15.c * Description: Mean value of a Q15 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -116,11 +116,11 @@ void arm_mean_q15( while (blkCnt > 0U) { /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ - in = read_q15x2_ia ((q15_t **) &pSrc); + in = read_q15x2_ia (&pSrc); sum += ((in << 16U) >> 16U); sum += (in >> 16U); - in = read_q15x2_ia ((q15_t **) &pSrc); + in = read_q15x2_ia (&pSrc); sum += ((in << 16U) >> 16U); sum += (in >> 16U); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_q31.c index 03e2327..1b95ce5 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_q31.c @@ -5,13 +5,13 @@ * Title: arm_mean_q31.c * Description: Mean value of a Q31 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -90,7 +90,7 @@ void arm_mean_q31( blkCnt --; } - *pResult = arm_div_q63_to_q31(sum, blockSize); + *pResult = arm_div_int64_to_int32(sum, blockSize); } #else void arm_mean_q31( diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_q7.c index 44ca51d..5ac4517 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mean_q7.c @@ -5,13 +5,13 @@ * Title: arm_mean_q7.c * Description: Mean value of a Q7 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -115,7 +115,7 @@ void arm_mean_q7( while (blkCnt > 0U) { /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ - in = read_q7x4_ia ((q7_t **) &pSrc); + in = read_q7x4_ia (&pSrc); sum += ((in << 24U) >> 24U); sum += ((in << 16U) >> 24U); sum += ((in << 8U) >> 24U); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_f16.c index 46ddb94..4e08799 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_f16.c @@ -5,13 +5,13 @@ * Title: arm_min_f16.c * Description: Minimum value of a floating-point vector * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -167,7 +167,7 @@ void arm_min_f16( minVal = *pSrc++; /* compare for the minimum value */ - if (out > minVal) + if ((_Float16)out > (_Float16)minVal) { /* Update the minimum value and it's index */ out = minVal; @@ -175,21 +175,21 @@ void arm_min_f16( } minVal = *pSrc++; - if (out > minVal) + if ((_Float16)out > (_Float16)minVal) { out = minVal; outIndex = index + 2U; } minVal = *pSrc++; - if (out > minVal) + if ((_Float16)out > (_Float16)minVal) { out = minVal; outIndex = index + 3U; } minVal = *pSrc++; - if (out > minVal) + if ((_Float16)out > (_Float16)minVal) { out = minVal; outIndex = index + 4U; @@ -217,7 +217,7 @@ void arm_min_f16( minVal = *pSrc++; /* compare for the minimum value */ - if (out > minVal) + if ((_Float16)out > (_Float16)minVal) { /* Update the minimum value and it's index */ out = minVal; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_f32.c index 6c49822..b581473 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_f32.c @@ -5,13 +5,13 @@ * Title: arm_min_f32.c * Description: Minimum value of a floating-point vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -168,7 +168,7 @@ void arm_min_f32( uint32x4_t countV; uint32x2_t countV2; - maxIdx = vdupq_n_u32(ULONG_MAX); + maxIdx = vdupq_n_u32(UINT_MAX); delta = vdupq_n_u32(4); index = vld1q_u32(indexInit); countV = vld1q_u32(countVInit); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_f64.c new file mode 100644 index 0000000..525470f --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_f64.c @@ -0,0 +1,94 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_min_f64.c + * Description: Minimum value of a floating-point vector + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup Min + @{ + */ + +/** + @brief Minimum value of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @param[out] pIndex index of minimum value returned here + @return none + */ +void arm_min_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult, + uint32_t * pIndex) +{ + float64_t minVal, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt, outIndex; /* Loop counter */ + + /* Initialise index value to zero. */ + outIndex = 0U; + + /* Load first input value that act as reference value for comparision */ + out = *pSrc++; + + /* Initialize blkCnt with number of samples */ + blkCnt = (blockSize - 1U); + + while (blkCnt > 0U) + { + /* Initialize minVal to the next consecutive values one by one */ + minVal = *pSrc++; + + /* compare for the minimum value */ + if (out > minVal) + { + /* Update the minimum value and it's index */ + out = minVal; + outIndex = blockSize - blkCnt; + } + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store the minimum value and it's index into destination pointers */ + *pResult = out; + *pIndex = outIndex; +} + +/** + @} end of Min group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_f16.c new file mode 100644 index 0000000..a2a64db --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_f16.c @@ -0,0 +1,148 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_min_no_idx_f16.c + * Description: Minimum value of a floating-point vector without returning the index + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions_f16.h" + +#if defined(ARM_FLOAT16_SUPPORTED) + +#if (defined(ARM_MATH_NEON) || defined(ARM_MATH_MVEF)) && !defined(ARM_MATH_AUTOVECTORIZE) +#include +#endif + +/** + @ingroup groupStats + */ + + +/** + @addtogroup Min + @{ + */ + +/** + @brief Minimum value of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ + +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) + +void arm_min_no_idx_f16( + const float16_t *pSrc, + uint32_t blockSize, + float16_t *pResult) +{ + f16x8_t vecSrc; + f16x8_t curExtremValVec = vdupq_n_f16(F16_MAX); + float16_t minValue = F16_MAX; + float16_t newVal; + uint32_t blkCnt; + + /* Loop unrolling: Compute 4 outputs at a time */ + blkCnt = blockSize >> 3U; + + while (blkCnt > 0U) + { + + vecSrc = vldrhq_f16(pSrc); + /* + * update per-lane min. + */ + curExtremValVec = vminnmq(vecSrc, curExtremValVec); + /* + * Decrement the blockSize loop counter + * Advance vector source and destination pointers + */ + pSrc += 8; + blkCnt --; + } + /* + * Get min value across the vector + */ + minValue = vminnmvq(minValue, curExtremValVec); + + blkCnt = blockSize & 7; + + while (blkCnt > 0U) + { + newVal = *pSrc++; + + /* compare for the minimum value */ + if ((_Float16)minValue > (_Float16)newVal) + { + /* Update the minimum value and it's index */ + minValue = newVal; + } + + blkCnt --; + } + + *pResult = minValue; +} + +#else + +void arm_min_no_idx_f16( + const float16_t *pSrc, + uint32_t blockSize, + float16_t *pResult) +{ + float16_t minValue = F16_MAX; + float16_t newVal; + + while (blockSize > 0U) + { + newVal = *pSrc++; + + /* compare for the minimum value */ + if ((_Float16)minValue > (_Float16)newVal) + { + /* Update the minimum value and it's index */ + minValue = newVal; + } + + blockSize --; + } + + *pResult = minValue; +} + +#endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ + +/** + @} end of Min group + */ + +#endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_f32.c new file mode 100644 index 0000000..eafae73 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_f32.c @@ -0,0 +1,142 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_min_no_idx_f32.c + * Description: Minimum value of a floating-point vector without returning the index + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" +#if (defined(ARM_MATH_NEON) || defined(ARM_MATH_MVEF)) && !defined(ARM_MATH_AUTOVECTORIZE) +#include +#endif + +/** + @ingroup groupStats + */ + + +/** + @addtogroup Min + @{ + */ + +/** + @brief Minimum value of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ + +#if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) + +void arm_min_no_idx_f32( + const float32_t *pSrc, + uint32_t blockSize, + float32_t *pResult) +{ + f32x4_t vecSrc; + f32x4_t curExtremValVec = vdupq_n_f32(F32_MAX); + float32_t minValue = F32_MAX; + float32_t newVal; + uint32_t blkCnt; + + /* Loop unrolling: Compute 4 outputs at a time */ + blkCnt = blockSize >> 2U; + + while (blkCnt > 0U) + { + + vecSrc = vldrwq_f32(pSrc); + /* + * update per-lane min. + */ + curExtremValVec = vminnmq(vecSrc, curExtremValVec); + /* + * Decrement the blockSize loop counter + * Advance vector source and destination pointers + */ + pSrc += 4; + blkCnt --; + } + /* + * Get min value across the vector + */ + minValue = vminnmvq(minValue, curExtremValVec); + + blkCnt = blockSize & 3; + + while (blkCnt > 0U) + { + newVal = *pSrc++; + + /* compare for the minimum value */ + if (minValue > newVal) + { + /* Update the minimum value and it's index */ + minValue = newVal; + } + + blkCnt --; + } + + *pResult = minValue; +} + +#else + +void arm_min_no_idx_f32( + const float32_t *pSrc, + uint32_t blockSize, + float32_t *pResult) +{ + float32_t minValue = F32_MAX; + float32_t newVal; + + while (blockSize > 0U) + { + newVal = *pSrc++; + + /* compare for the minimum value */ + if (minValue > newVal) + { + /* Update the minimum value and it's index */ + minValue = newVal; + } + + blockSize --; + } + + *pResult = minValue; +} + +#endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ + +/** + @} end of Min group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_f64.c new file mode 100644 index 0000000..5e3317e --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_f64.c @@ -0,0 +1,79 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_min_no_idx_f64.c + * Description: Maximum value of a floating-point vector without returning the index + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + + +/** + @addtogroup Min + @{ + */ + +/** + @brief Maximum value of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ +void arm_min_no_idx_f64( + const float64_t *pSrc, + uint32_t blockSize, + float64_t *pResult) +{ + float64_t minValue = F64_MAX; + float64_t newVal; + + while (blockSize > 0U) + { + newVal = *pSrc++; + + /* compare for the minimum value */ + if (minValue > newVal) + { + /* Update the minimum value and it's index */ + minValue = newVal; + } + + blockSize --; + } + + *pResult = minValue; +} + +/** + @} end of Min group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_q15.c new file mode 100644 index 0000000..f588e70 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_q15.c @@ -0,0 +1,146 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_min_no_idx_q15.c + * Description: Minimum value of a q15 vector without returning the index + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + + +/** + @ingroup groupStats + */ + +/** + @addtogroup Min + @{ + */ + +/** + @brief Minimum value of a q15 vector without index. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ + +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_min_no_idx_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult) +{ + int32_t blkCnt; /* loop counters */ + q15x8_t vecSrc; + q15_t const *pSrcVec; + q15x8_t curExtremValVec = vdupq_n_s16(Q15_MAX); + q15_t minValue = Q15_MAX; + mve_pred16_t p0; + + + pSrcVec = (q15_t const *) pSrc; + blkCnt = blockSize >> 3; + while (blkCnt > 0) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 8; + /* + * update per-lane min. + */ + curExtremValVec = vminq(vecSrc, curExtremValVec); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 7; + if (blkCnt > 0) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 8; + p0 = vctp16q(blkCnt); + /* + * Get current min per lane and current index per lane + * when a min is selected + */ + curExtremValVec = vminq_m(curExtremValVec, vecSrc, curExtremValVec, p0); + } + /* + * Get min value across the vector + */ + minValue = vminvq(minValue, curExtremValVec); + *pResult = minValue; +} + +#else +void arm_min_no_idx_q15( + const q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult) +{ + q15_t minVal1, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* loop counter */ + + /* Load first input value that act as reference value for comparision */ + out = *pSrc++; + + blkCnt = (blockSize - 1U); + + + while (blkCnt > 0U) + { + /* Initialize minVal to the next consecutive values one by one */ + minVal1 = *pSrc++; + + /* compare for the minimum value */ + if (out > minVal1) + { + /* Update the minimum value */ + out = minVal1; + } + + /* Decrement the loop counter */ + blkCnt--; + } + + /* Store the minimum value into destination pointer */ + *pResult = out; +} + +#endif /* #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of Min group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_q31.c new file mode 100644 index 0000000..b00a5ba --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_q31.c @@ -0,0 +1,145 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_min_no_idx_q31.c + * Description: Minimum value of a q31 vector without returning the index + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + + +/** + @ingroup groupStats + */ + +/** + @addtogroup Min + @{ + */ + +/** + @brief Minimum value of a q31 vector without index. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ + +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" +void arm_min_no_idx_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult) +{ + int32_t blkCnt; /* loop counters */ + q31x4_t vecSrc; + q31_t const *pSrcVec; + q31x4_t curExtremValVec = vdupq_n_s32(Q31_MAX); + q31_t minValue = Q31_MAX; + mve_pred16_t p0; + + + pSrcVec = (q31_t const *) pSrc; + blkCnt = blockSize >> 2; + while (blkCnt > 0) + { + vecSrc = vldrwq_s32(pSrcVec); + pSrcVec += 4; + /* + * update per-lane min. + */ + curExtremValVec = vminq(vecSrc, curExtremValVec); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 3; + if (blkCnt > 0) + { + vecSrc = vldrwq_s32(pSrcVec); + pSrcVec += 4; + p0 = vctp32q(blkCnt); + /* + * Get current min per lane and current index per lane + * when a min is selected + */ + curExtremValVec = vminq_m(curExtremValVec, vecSrc, curExtremValVec, p0); + } + /* + * Get min value across the vector + */ + minValue = vminvq(minValue, curExtremValVec); + *pResult = minValue; +} + +#else +void arm_min_no_idx_q31( + const q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult) +{ + q31_t minVal1, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* loop counter */ + + /* Load first input value that act as reference value for comparision */ + out = *pSrc++; + + blkCnt = (blockSize - 1U); + + + while (blkCnt > 0U) + { + /* Initialize minVal to the next consecutive values one by one */ + minVal1 = *pSrc++; + + /* compare for the minimum value */ + if (out > minVal1) + { + /* Update the minimum value */ + out = minVal1; + } + + /* Decrement the loop counter */ + blkCnt--; + } + + /* Store the minimum value into destination pointer */ + *pResult = out; +} + +#endif /* #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of Min group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_q7.c new file mode 100644 index 0000000..e0a8396 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_no_idx_q7.c @@ -0,0 +1,145 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_min_no_idx_q7.c + * Description: Minimum value of a q7 vector without returning the index + * + * $Date: 16 November 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + + +/** + @ingroup groupStats + */ + +/** + @addtogroup Min + @{ + */ + +/** + @brief Minimum value of a q7 vector without index. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult minimum value returned here + @return none + */ +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_min_no_idx_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult) +{ + int32_t blkCnt; /* loop counters */ + q7x16_t vecSrc; + q7_t const *pSrcVec; + q7x16_t curExtremValVec = vdupq_n_s8(Q7_MAX); + q7_t minValue = Q7_MAX; + mve_pred16_t p0; + + + pSrcVec = (q7_t const *) pSrc; + blkCnt = blockSize >> 4; + while (blkCnt > 0) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 16; + /* + * update per-lane min. + */ + curExtremValVec = vminq(vecSrc, curExtremValVec); + /* + * Decrement the blockSize loop counter + */ + blkCnt--; + } + /* + * tail + * (will be merged thru tail predication) + */ + blkCnt = blockSize & 0xF; + if (blkCnt > 0) + { + vecSrc = vld1q(pSrcVec); + pSrcVec += 16; + p0 = vctp8q(blkCnt); + /* + * Get current min per lane and current index per lane + * when a min is selected + */ + curExtremValVec = vminq_m(curExtremValVec, vecSrc, curExtremValVec, p0); + } + /* + * Get min value across the vector + */ + minValue = vminvq(minValue, curExtremValVec); + *pResult = minValue; +} + +#else +void arm_min_no_idx_q7( + const q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult) +{ + q7_t minVal1, out; /* Temporary variables to store the output value. */ + uint32_t blkCnt; /* loop counter */ + + /* Load first input value that act as reference value for comparision */ + out = *pSrc++; + + blkCnt = (blockSize - 1U); + + + while (blkCnt > 0U) + { + /* Initialize minVal to the next consecutive values one by one */ + minVal1 = *pSrc++; + + /* compare for the minimum value */ + if (out > minVal1) + { + /* Update the minimum value */ + out = minVal1; + } + + /* Decrement the loop counter */ + blkCnt--; + } + + /* Store the minimum value into destination pointer */ + *pResult = out; +} + +#endif /* #if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) */ +/** + @} end of Min group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_q15.c index 3f4a59f..3a4d99e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_q15.c @@ -5,13 +5,13 @@ * Title: arm_min_q15.c * Description: Minimum value of a Q15 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -58,79 +58,48 @@ void arm_min_q15( q15_t * pResult, uint32_t * pIndex) { - uint32_t blkCnt; /* loop counters */ - q15x8_t vecSrc; - q15x8_t curExtremValVec = vdupq_n_s16(Q15_MAX); - q15_t minValue = Q15_MAX,temp; - uint32_t idx = blockSize; - uint16x8_t indexVec; - uint16x8_t curExtremIdxVec; - mve_pred16_t p0; + int32_t blkCnt; /* loop counters */ + q15x8_t extremValVec = vdupq_n_s16(Q15_MAX); + q15_t minValue = Q15_MAX; + uint16x8_t indexVec; + uint16x8_t extremIdxVec; + mve_pred16_t p0; + uint16_t extremIdxArr[8]; - indexVec = vidupq_u16((uint32_t)0, 1); - curExtremIdxVec = vdupq_n_u16(0); + indexVec = vidupq_u16(0U, 1); - blkCnt = blockSize >> 3; - while (blkCnt > 0U) - { - vecSrc = vldrhq_s16(pSrc); - pSrc += 8; + blkCnt = blockSize; + do { + mve_pred16_t p = vctp16q(blkCnt); + q15x8_t extremIdxVal = vld1q_z_s16(pSrc, p); /* * Get current min per lane and current index per lane * when a min is selected */ - p0 = vcmpleq(vecSrc, curExtremValVec); - curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); - curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + p0 = vcmpleq_m(extremIdxVal, extremValVec, p); - indexVec = indexVec + 8; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - - /* - * Get min value across the vector - */ - minValue = vminvq(minValue, curExtremValVec); - /* - * set index for lower values to min possible index - */ - p0 = vcmpleq(curExtremValVec, minValue); - indexVec = vpselq(curExtremIdxVec, vdupq_n_u16(blockSize), p0); - /* - * Get min index which is thus for a min value - */ - idx = vminvq(idx, indexVec); - - /* - * tail - */ - blkCnt = blockSize & 7; - while (blkCnt > 0U) - { - /* Initialize minVal to the next consecutive values one by one */ - temp = *pSrc++; - - /* compare for the minimum value */ - if (minValue > temp) - { - /* Update the minimum value and it's index */ - minValue = temp; - idx = blockSize - blkCnt; - } - - /* Decrement loop counter */ - blkCnt--; + extremValVec = vorrq_m(extremValVec, extremIdxVal, extremIdxVal, p0); + /* store per-lane extrema indexes */ + vst1q_p_u16(extremIdxArr, indexVec, p0); + + indexVec += 8; + pSrc += 8; + blkCnt -= 8; } + while (blkCnt > 0); + + /* Get min value across the vector */ + minValue = vminvq(minValue, extremValVec); + + /* set index for lower values to min possible index */ + p0 = vcmpleq(extremValVec, minValue); + extremIdxVec = vld1q_u16(extremIdxArr); - /* - * Save result - */ - *pIndex = idx; + indexVec = vpselq(extremIdxVec, vdupq_n_u16(blockSize - 1), p0); + *pIndex = vminvq(blockSize - 1, indexVec); *pResult = minValue; + } #else void arm_min_q15( diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_q31.c index df96c95..7c889e5 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_q31.c @@ -5,13 +5,13 @@ * Title: arm_min_q31.c * Description: Minimum value of a Q31 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -58,79 +58,49 @@ void arm_min_q31( q31_t * pResult, uint32_t * pIndex) { - uint32_t blkCnt; /* loop counters */ - q31x4_t vecSrc; - q31x4_t curExtremValVec = vdupq_n_s32(Q31_MAX); - q31_t minValue = Q31_MAX, temp; - uint32_t idx = blockSize; - uint32x4_t indexVec; - uint32x4_t curExtremIdxVec; - mve_pred16_t p0; - - - indexVec = vidupq_u32((uint32_t)0, 1); - curExtremIdxVec = vdupq_n_u32(0); - - /* Compute 4 outputs at a time */ - blkCnt = blockSize >> 2U; - while (blkCnt > 0U) - { - vecSrc = vldrwq_s32(pSrc); - pSrc += 4; + int32_t blkCnt; /* loop counters */ + q31x4_t extremValVec = vdupq_n_s32(Q31_MAX); + q31_t minValue = Q31_MAX; + uint32x4_t indexVec; + uint32x4_t extremIdxVec; + mve_pred16_t p0; + uint32_t extremIdxArr[4]; + + indexVec = vidupq_u32(0U, 1); + + blkCnt = blockSize; + do { + mve_pred16_t p = vctp32q(blkCnt); + q31x4_t extremIdxVal = vld1q_z_s32(pSrc, p); /* * Get current min per lane and current index per lane * when a min is selected */ - p0 = vcmpleq(vecSrc, curExtremValVec); - curExtremValVec = vpselq(vecSrc, curExtremValVec, p0); - curExtremIdxVec = vpselq(indexVec, curExtremIdxVec, p0); + p0 = vcmpleq_m(extremIdxVal, extremValVec, p); - indexVec = indexVec + 4; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - - /* - * Get min value across the vector - */ - minValue = vminvq(minValue, curExtremValVec); - /* - * set index for lower values to min possible index - */ - p0 = vcmpleq(curExtremValVec, minValue); - indexVec = vpselq(curExtremIdxVec, vdupq_n_u32(blockSize), p0); - /* - * Get min index which is thus for a min value - */ - idx = vminvq(idx, indexVec); - - - /* Tail */ - blkCnt = blockSize & 0x3; - while (blkCnt > 0U) - { - /* Initialize temp to the next consecutive values one by one */ - temp = *pSrc++; - - /* compare for the minimum value */ - if (minValue > temp) - { - /* Update the minimum value and it's index */ - minValue = temp; - idx = blockSize - blkCnt; - } - - /* Decrement loop counter */ - blkCnt--; + extremValVec = vorrq_m(extremValVec, extremIdxVal, extremIdxVal, p0); + /* store per-lane extrema indexes */ + vst1q_p_u32(extremIdxArr, indexVec, p0); + + indexVec += 4; + pSrc += 4; + blkCnt -= 4; } - /* - * Save result - */ - *pIndex = idx; + while (blkCnt > 0); + + + /* Get min value across the vector */ + minValue = vminvq(minValue, extremValVec); + + /* set index for lower values to min possible index */ + p0 = vcmpleq(extremValVec, minValue); + extremIdxVec = vld1q_u32(extremIdxArr); + + indexVec = vpselq(extremIdxVec, vdupq_n_u32(blockSize - 1), p0); + *pIndex = vminvq(blockSize - 1, indexVec); *pResult = minValue; } + #else void arm_min_q31( const q31_t * pSrc, diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_q7.c index 25e607f..6d8451b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_min_q7.c @@ -5,13 +5,13 @@ * Title: arm_min_q7.c * Description: Minimum value of a Q7 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_f16.c new file mode 100644 index 0000000..20c8083 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_f16.c @@ -0,0 +1,207 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mse_f16.c + * Description: Half floating point mean square error + * + * $Date: 05 April 2022 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions_f16.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup MSE + @{ + */ + +/** + @brief Mean square error between two half floating point vectors. + @param[in] pSrcA points to the first input vector + @param[in] pSrcB points to the second input vector + @param[in] blockSize number of samples in input vector + @param[out] result mean square error + @return none + */ + +#if !defined(ARM_MATH_AUTOVECTORIZE) + +#if defined(ARM_MATH_MVE_FLOAT16) +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_mse_f16( + const float16_t * pSrcA, + const float16_t * pSrcB, + uint32_t blockSize, + float16_t * result) + +{ + float16x8_t vecA, vecB; + float16x8_t vecSum; + uint32_t blkCnt; + _Float16 sum = 0.0f16; + vecSum = vdupq_n_f16(0.0f16); + + blkCnt = (blockSize) >> 3; + while (blkCnt > 0U) + { + vecA = vld1q(pSrcA); + pSrcA += 8; + + vecB = vld1q(pSrcB); + pSrcB += 8; + + vecA = vsubq(vecA, vecB); + + vecSum = vfmaq(vecSum, vecA, vecA); + /* + * Decrement the blockSize loop counter + */ + blkCnt --; + } + + + blkCnt = (blockSize) & 7; + if (blkCnt > 0U) + { + mve_pred16_t p0 = vctp16q(blkCnt); + vecA = vld1q(pSrcA); + vecB = vld1q(pSrcB); + + vecA = vsubq(vecA, vecB); + vecSum = vfmaq_m(vecSum, vecA, vecA, p0); + } + + sum = vecAddAcrossF16Mve(vecSum); + + /* Store result in destination buffer */ + *result = (_Float16)sum / (_Float16)blockSize; + +} + +#endif + + +#endif /*#if !defined(ARM_MATH_AUTOVECTORIZE)*/ + + +#if defined(ARM_FLOAT16_SUPPORTED) + +#if (!defined(ARM_MATH_MVE_FLOAT16)) || defined(ARM_MATH_AUTOVECTORIZE) + + + +void arm_mse_f16( + const float16_t * pSrcA, + const float16_t * pSrcB, + uint32_t blockSize, + float16_t * result) + +{ + uint32_t blkCnt; /* Loop counter */ + _Float16 inA, inB; + _Float16 sum = 0.0f16; /* Temporary return variable */ +#if defined (ARM_MATH_LOOPUNROLL) + blkCnt = (blockSize) >> 3; + + + while (blkCnt > 0U) + { + inA = *pSrcA++; + inB = *pSrcB++; + inA = (_Float16)inA - (_Float16)inB; + sum += (_Float16)inA * (_Float16)inA; + + inA = *pSrcA++; + inB = *pSrcB++; + inA = (_Float16)inA - (_Float16)inB; + sum += (_Float16)inA * (_Float16)inA; + + inA = *pSrcA++; + inB = *pSrcB++; + inA = (_Float16)inA - (_Float16)inB; + sum += (_Float16)inA * (_Float16)inA; + + inA = *pSrcA++; + inB = *pSrcB++; + inA = (_Float16)inA - (_Float16)inB; + sum += (_Float16)inA * (_Float16)inA; + + inA = *pSrcA++; + inB = *pSrcB++; + inA = (_Float16)inA - (_Float16)inB; + sum += (_Float16)inA * (_Float16)inA; + + inA = *pSrcA++; + inB = *pSrcB++; + inA = (_Float16)inA - (_Float16)inB; + sum += (_Float16)inA * (_Float16)inA; + + inA = *pSrcA++; + inB = *pSrcB++; + inA = (_Float16)inA - (_Float16)inB; + sum += (_Float16)inA * (_Float16)inA; + + inA = *pSrcA++; + inB = *pSrcB++; + inA = (_Float16)inA - (_Float16)inB; + sum += (_Float16)inA * (_Float16)inA; + + /* Decrement loop counter */ + blkCnt--; + } + + + /* Loop unrolling: Compute remaining outputs */ + blkCnt = (blockSize) & 7; +#else + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; +#endif + while (blkCnt > 0U) + { + inA = *pSrcA++; + inB = *pSrcB++; + inA = (_Float16)inA - (_Float16)inB; + sum += (_Float16)inA * (_Float16)inA; + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store result in destination buffer */ + *result = (_Float16)sum / (_Float16)blockSize; +} + +#endif /* end of test for vector instruction availability */ + +#endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ +/** + @} end of MSE group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_f32.c new file mode 100644 index 0000000..622abb5 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_f32.c @@ -0,0 +1,251 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mse_f32.c + * Description: Floating point mean square error + * + * $Date: 05 April 2022 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup MSE + @{ + */ + +/** + @brief Mean square error between two floating point vectors. + @param[in] pSrcA points to the first input vector + @param[in] pSrcB points to the second input vector + @param[in] blockSize number of samples in input vector + @param[out] result mean square error + @return none + */ + +#if !defined(ARM_MATH_AUTOVECTORIZE) + +#if defined(ARM_MATH_MVEF) +#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" + +void arm_mse_f32( + const float32_t * pSrcA, + const float32_t * pSrcB, + uint32_t blockSize, + float32_t * result) + +{ + float32x4_t vecA, vecB; + float32x4_t vecSum; + uint32_t blkCnt; + float32_t sum = 0.0f; + vecSum = vdupq_n_f32(0.0f); + + /* Compute 4 outputs at a time */ + blkCnt = (blockSize) >> 2; + while (blkCnt > 0U) + { + vecA = vld1q(pSrcA); + pSrcA += 4; + + vecB = vld1q(pSrcB); + pSrcB += 4; + + vecA = vsubq(vecA, vecB); + + vecSum = vfmaq(vecSum, vecA, vecA); + /* + * Decrement the blockSize loop counter + */ + blkCnt --; + } + + + blkCnt = (blockSize) & 3; + if (blkCnt > 0U) + { + mve_pred16_t p0 = vctp32q(blkCnt); + vecA = vld1q(pSrcA); + vecB = vld1q(pSrcB); + + vecA = vsubq(vecA, vecB); + vecSum = vfmaq_m(vecSum, vecA, vecA, p0); + } + + sum = vecAddAcrossF32Mve(vecSum); + + /* Store result in destination buffer */ + *result = sum / blockSize; + +} + +#endif + +#if defined(ARM_MATH_NEON) +void arm_mse_f32( + const float32_t * pSrcA, + const float32_t * pSrcB, + uint32_t blockSize, + float32_t * result) + +{ + float32x4_t vecA, vecB; + float32x4_t vecSum; + uint32_t blkCnt; + float32_t inA, inB; + float32_t sum = 0.0f; + vecSum = vdupq_n_f32(0.0f); +#if !defined(__aarch64__) + f32x2_t tmp = vdup_n_f32(0.0f); +#endif + + /* Compute 4 outputs at a time */ + blkCnt = (blockSize) >> 2; + while (blkCnt > 0U) + { + vecA = vld1q_f32(pSrcA); + pSrcA += 4; + + vecB = vld1q_f32(pSrcB); + pSrcB += 4; + + vecA = vsubq_f32(vecA, vecB); + + vecSum = vfmaq_f32(vecSum, vecA, vecA); + /* + * Decrement the blockSize loop counter + */ + blkCnt --; + } + +#if defined(__aarch64__) + sum = vpadds_f32(vpadd_f32(vget_low_f32(vecSum), vget_high_f32(vecSum))); +#else + tmp = vpadd_f32(vget_low_f32(vecSum), vget_high_f32(vecSum)); + sum = vget_lane_f32(tmp, 0) + vget_lane_f32(tmp, 1); + +#endif + + blkCnt = (blockSize) & 3; + while (blkCnt > 0U) + { + /* Calculate dot product and store result in a temporary buffer. */ + inA = *pSrcA++; + inB = *pSrcB++; + inA = inA - inB; + sum += inA * inA; + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store result in destination buffer */ + *result = sum / blockSize; + +} +#endif + +#endif /*#if !defined(ARM_MATH_AUTOVECTORIZE)*/ + + + +#if (!defined(ARM_MATH_MVEF) && !defined(ARM_MATH_NEON)) || defined(ARM_MATH_AUTOVECTORIZE) + + +void arm_mse_f32( + const float32_t * pSrcA, + const float32_t * pSrcB, + uint32_t blockSize, + float32_t * result) + +{ + uint32_t blkCnt; /* Loop counter */ + float32_t inA, inB; + float32_t sum = 0.0f; /* Temporary return variable */ +#if defined (ARM_MATH_LOOPUNROLL) + /* Loop unrolling: Compute 4 outputs at a time */ + blkCnt = (blockSize) >> 2; + + /* First part of the processing with loop unrolling. Compute 4 outputs at a time. + ** a second loop below computes the remaining 1 to 3 samples. */ + while (blkCnt > 0U) + { + + inA = *pSrcA++; + inB = *pSrcB++; + inA = inA - inB; + sum += inA * inA; + + inA = *pSrcA++; + inB = *pSrcB++; + inA = inA - inB; + sum += inA * inA; + + inA = *pSrcA++; + inB = *pSrcB++; + inA = inA - inB; + sum += inA * inA; + + inA = *pSrcA++; + inB = *pSrcB++; + inA = inA - inB; + sum += inA * inA; + + /* Decrement loop counter */ + blkCnt--; + } + + + /* Loop unrolling: Compute remaining outputs */ + blkCnt = (blockSize) & 3; +#else + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; +#endif + while (blkCnt > 0U) + { + inA = *pSrcA++; + inB = *pSrcB++; + inA = inA - inB; + sum += inA * inA; + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store result in destination buffer */ + *result = sum / blockSize; +} + +#endif /* end of test for vector instruction availability */ + +/** + @} end of MSE group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_f64.c new file mode 100644 index 0000000..d63674b --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_f64.c @@ -0,0 +1,114 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mse_f64.c + * Description: Double floating point mean square error + * + * $Date: 05 April 2022 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup MSE + @{ + */ + +/** + @brief Mean square error between two double floating point vectors. + @param[in] pSrcA points to the first input vector + @param[in] pSrcB points to the second input vector + @param[in] blockSize number of samples in input vector + @param[out] result mean square error + @return none + */ + + + + + +void arm_mse_f64( + const float64_t * pSrcA, + const float64_t * pSrcB, + uint32_t blockSize, + float64_t * result) + +{ + uint32_t blkCnt; /* Loop counter */ + float64_t inA, inB; + float64_t sum = 0.0; /* Temporary return variable */ +#if defined (ARM_MATH_LOOPUNROLL) + blkCnt = (blockSize) >> 1; + + + while (blkCnt > 0U) + { + + + inA = *pSrcA++; + inB = *pSrcB++; + inA = inA - inB; + sum += inA * inA; + + inA = *pSrcA++; + inB = *pSrcB++; + inA = inA - inB; + sum += inA * inA; + + /* Decrement loop counter */ + blkCnt--; + } + + + /* Loop unrolling: Compute remaining outputs */ + blkCnt = (blockSize) & 1; +#else + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; +#endif + while (blkCnt > 0U) + { + inA = *pSrcA++; + inB = *pSrcB++; + inA = inA - inB; + sum += inA * inA; + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store result in destination buffer */ + *result = sum / blockSize; +} + + +/** + @} end of MSE group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_q15.c new file mode 100644 index 0000000..3412a4f --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_q15.c @@ -0,0 +1,179 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mse_q15.c + * Description: Mean square error between two Q15 vectors + * + * $Date: 04 April 2022 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + + +/** + @addtogroup MSE + @{ + */ + +/** + @brief Mean square error between two Q15 vectors. + @param[in] pSrcA points to the first input vector + @param[in] pSrcB points to the second input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult mean square error + @return none + */ +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) +void arm_mse_q15( + const q15_t * pSrcA, + const q15_t * pSrcB, + uint32_t blockSize, + q15_t * pResult) +{ + uint32_t blkCnt; /* loop counters */ + q15x8_t vecSrcA,vecSrcB; + q63_t sum = 0LL; + + blkCnt = blockSize >> 3U; + while (blkCnt > 0U) + { + vecSrcA = vld1q(pSrcA); + vecSrcB = vld1q(pSrcB); + + vecSrcA = vshrq(vecSrcA,1); + vecSrcB = vshrq(vecSrcB,1); + + vecSrcA = vqsubq(vecSrcA,vecSrcB); + /* + * sum lanes + */ + sum = vmlaldavaq(sum, vecSrcA, vecSrcA); + + blkCnt--; + pSrcA += 8; + pSrcB += 8; + } + + /* + * tail + */ + blkCnt = blockSize & 7; + if (blkCnt > 0U) + { + mve_pred16_t p0 = vctp16q(blkCnt); + vecSrcA = vld1q(pSrcA); + vecSrcB = vld1q(pSrcB); + + vecSrcA = vshrq(vecSrcA,1); + vecSrcB = vshrq(vecSrcB,1); + + vecSrcA = vqsubq(vecSrcA,vecSrcB); + + sum = vmlaldavaq_p(sum, vecSrcA, vecSrcA, p0); + } + + + + *pResult = (q15_t) __SSAT((q31_t) (sum / blockSize)>>13, 16); +} +#else +void arm_mse_q15( + const q15_t * pSrcA, + const q15_t * pSrcB, + uint32_t blockSize, + q15_t * pResult) +{ + uint32_t blkCnt; /* Loop counter */ + q63_t sum = 0; /* Temporary result storage */ + q15_t inA,inB; /* Temporary variable to store input value */ + + +#if defined (ARM_MATH_LOOPUNROLL) + + /* Loop unrolling: Compute 4 outputs at a time */ + blkCnt = blockSize >> 2U; + + while (blkCnt > 0U) + { + + inA = *pSrcA++ >> 1; + inB = *pSrcB++ >> 1; + inA = (q15_t) __SSAT(((q31_t) inA - (q31_t)inB), 16); + sum += (q63_t)((q31_t) inA * inA); + + inA = *pSrcA++ >> 1; + inB = *pSrcB++ >> 1; + inA = (q15_t) __SSAT(((q31_t) inA - (q31_t)inB), 16); + sum += (q63_t)((q31_t) inA * inA); + + inA = *pSrcA++ >> 1; + inB = *pSrcB++ >> 1; + inA = (q15_t) __SSAT(((q31_t) inA - (q31_t)inB), 16); + sum += (q63_t)((q31_t) inA * inA); + + inA = *pSrcA++ >> 1; + inB = *pSrcB++ >> 1; + inA = (q15_t) __SSAT(((q31_t) inA - (q31_t)inB), 16); + sum += (q63_t)((q31_t) inA * inA); + + /* Decrement loop counter */ + blkCnt--; + } + + /* Loop unrolling: Compute remaining outputs */ + blkCnt = blockSize % 0x4U; + +#else + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + +#endif /* #if defined (ARM_MATH_LOOPUNROLL) */ + + while (blkCnt > 0U) + { + + inA = *pSrcA++ >> 1; + inB = *pSrcB++ >> 1; + inA = (q15_t) __SSAT(((q31_t) inA - (q31_t)inB), 16); + sum += (q63_t)((q31_t) inA * inA); + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store result in q15 format */ + *pResult = (q15_t) __SSAT((q31_t) (sum / blockSize)>>13, 16); +} +#endif /* defined(ARM_MATH_MVEI) */ + +/** + @} end of MSE group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_q31.c new file mode 100644 index 0000000..f89a768 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_q31.c @@ -0,0 +1,180 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mse_q31.c + * Description: Mean square error between two Q31 vectors + * + * $Date: 04 April 2022 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + + +/** + @addtogroup MSE + @{ + */ + +/** + @brief Mean square error between two Q31 vectors. + @param[in] pSrcA points to the first input vector + @param[in] pSrcB points to the second input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult mean square error + @return none + */ +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) +void arm_mse_q31( + const q31_t * pSrcA, + const q31_t * pSrcB, + uint32_t blockSize, + q31_t * pResult) +{ + uint32_t blkCnt; /* loop counters */ + q31x4_t vecSrcA,vecSrcB; + q63_t sum = 0LL; + + /* Compute 4 outputs at a time */ + blkCnt = blockSize >> 2U; + while (blkCnt > 0U) + { + vecSrcA = vld1q(pSrcA); + vecSrcB = vld1q(pSrcB); + + vecSrcA = vshrq(vecSrcA,1); + vecSrcB = vshrq(vecSrcB,1); + + + vecSrcA = vqsubq(vecSrcA,vecSrcB); + /* + * sum lanes + */ + sum = vrmlaldavhaq(sum, vecSrcA, vecSrcA); + + blkCnt--; + pSrcA += 4; + pSrcB += 4; + } + + /* + * tail + */ + blkCnt = blockSize & 3; + if (blkCnt > 0U) + { + mve_pred16_t p0 = vctp32q(blkCnt); + vecSrcA = vld1q(pSrcA); + vecSrcB = vld1q(pSrcB); + + vecSrcA = vshrq(vecSrcA,1); + vecSrcB = vshrq(vecSrcB,1); + + vecSrcA = vqsubq(vecSrcA,vecSrcB); + + sum = vrmlaldavhaq_p(sum, vecSrcA, vecSrcA, p0); + } + + + *pResult = (q31_t) ((sum / blockSize)>>21); + +} +#else +void arm_mse_q31( + const q31_t * pSrcA, + const q31_t * pSrcB, + uint32_t blockSize, + q31_t * pResult) +{ + uint32_t blkCnt; /* Loop counter */ + q63_t sum = 0; /* Temporary result storage */ + + q31_t inA32,inB32; /* Temporary variable to store packed input value */ + +#if defined (ARM_MATH_LOOPUNROLL) + + /* Loop unrolling: Compute 4 outputs at a time */ + blkCnt = blockSize >> 2U; + + while (blkCnt > 0U) + { + inA32 = *pSrcA++ >> 1; + inB32 = *pSrcB++ >> 1; + inA32 = __QSUB(inA32, inB32); + sum += ((q63_t) inA32 * inA32) >> 14U; + + inA32 = *pSrcA++ >> 1; + inB32 = *pSrcB++ >> 1; + inA32 = __QSUB(inA32, inB32); + sum += ((q63_t) inA32 * inA32) >> 14U; + + inA32 = *pSrcA++ >> 1; + inB32 = *pSrcB++ >> 1; + inA32 = __QSUB(inA32, inB32); + sum += ((q63_t) inA32 * inA32) >> 14U; + + inA32 = *pSrcA++ >> 1; + inB32 = *pSrcB++ >> 1; + inA32 = __QSUB(inA32, inB32); + sum += ((q63_t) inA32 * inA32) >> 14U; + + + /* Decrement loop counter */ + blkCnt--; + } + + /* Loop unrolling: Compute remaining outputs */ + blkCnt = blockSize % 0x4U; + +#else + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + +#endif /* #if defined (ARM_MATH_LOOPUNROLL) */ + + while (blkCnt > 0U) + { + inA32 = *pSrcA++ >> 1; + inB32 = *pSrcB++ >> 1; + inA32 = __QSUB(inA32, inB32); + sum += ((q63_t) inA32 * inA32) >> 14U; + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store result in q31 format */ + *pResult = (q31_t) ((sum / blockSize)>>15); +} +#endif /* defined(ARM_MATH_MVEI) */ + +/** + @} end of MSE group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_q7.c new file mode 100644 index 0000000..fb28d90 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_mse_q7.c @@ -0,0 +1,183 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mse_q7.c + * Description: Mean square error between two Q7 vectors + * + * $Date: 04 April 2022 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @defgroup MSE Mean Square Error + + Calculates the mean square error between two vectors. + + */ + +/** + @addtogroup MSE + @{ + */ + +/** + @brief Mean square error between two Q7 vectors. + @param[in] pSrcA points to the first input vector + @param[in] pSrcB points to the second input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult mean square error + @return none + */ +#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) +void arm_mse_q7( + const q7_t * pSrcA, + const q7_t * pSrcB, + uint32_t blockSize, + q7_t * pResult) +{ + uint32_t blkCnt; /* loop counters */ + q7x16_t vecSrcA,vecSrcB; + q31_t sum = 0LL; + + /* Compute 16 outputs at a time */ + blkCnt = blockSize >> 4U; + while (blkCnt > 0U) + { + vecSrcA = vld1q(pSrcA); + vecSrcB = vld1q(pSrcB); + + vecSrcA = vshrq(vecSrcA,1); + vecSrcB = vshrq(vecSrcB,1); + + vecSrcA = vqsubq(vecSrcA,vecSrcB); + /* + * sum lanes + */ + sum = vmladavaq(sum, vecSrcA, vecSrcA); + + blkCnt--; + pSrcA += 16; + pSrcB += 16; + } + + /* + * tail + */ + blkCnt = blockSize & 0xF; + if (blkCnt > 0U) + { + mve_pred16_t p0 = vctp8q(blkCnt); + vecSrcA = vld1q(pSrcA); + vecSrcB = vld1q(pSrcB); + + vecSrcA = vshrq(vecSrcA,1); + vecSrcB = vshrq(vecSrcB,1); + + vecSrcA = vqsubq(vecSrcA,vecSrcB); + + sum = vmladavaq_p(sum, vecSrcA, vecSrcA, p0); + } + + *pResult = (q7_t) __SSAT((q15_t) (sum / blockSize)>>5, 8); +} +#else +void arm_mse_q7( + const q7_t * pSrcA, + const q7_t * pSrcB, + uint32_t blockSize, + q7_t * pResult) +{ + uint32_t blkCnt; /* Loop counter */ + q31_t sum = 0; /* Temporary result storage */ + q7_t inA,inB; /* Temporary variable to store input value */ + + +#if defined (ARM_MATH_LOOPUNROLL) + + /* Loop unrolling: Compute 4 outputs at a time */ + blkCnt = blockSize >> 2U; + + while (blkCnt > 0U) + { + inA = *pSrcA++ >> 1; + inB = *pSrcB++ >> 1; + inA = (q7_t) __SSAT((q15_t) inA - (q15_t)inB, 8); + sum += ((q15_t) inA * inA); + + inA = *pSrcA++ >> 1; + inB = *pSrcB++ >> 1; + inA = (q7_t) __SSAT((q15_t) inA - (q15_t)inB, 8); + sum += ((q15_t) inA * inA); + + inA = *pSrcA++ >> 1; + inB = *pSrcB++ >> 1; + inA = (q7_t) __SSAT((q15_t) inA - (q15_t)inB, 8); + sum += ((q15_t) inA * inA); + + inA = *pSrcA++ >> 1; + inB = *pSrcB++ >> 1; + inA = (q7_t) __SSAT((q15_t) inA - (q15_t)inB, 8); + sum += ((q15_t) inA * inA); + + /* Decrement loop counter */ + blkCnt--; + } + + /* Loop unrolling: Compute remaining outputs */ + blkCnt = blockSize % 0x4U; + +#else + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + +#endif /* #if defined (ARM_MATH_LOOPUNROLL) */ + + while (blkCnt > 0U) + { + inA = *pSrcA++ >> 1; + inB = *pSrcB++ >> 1; + + inA = (q7_t) __SSAT((q15_t) inA - (q15_t)inB, 8); + sum += ((q15_t) inA * inA); + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store result in q7 format */ + *pResult = (q7_t) __SSAT((q15_t) (sum / blockSize)>>5, 8);; +} +#endif /* defined(ARM_MATH_MVEI) */ + +/** + @} end of MSE group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_f16.c index 1a2d5b1..f9833c0 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_f16.c @@ -5,13 +5,13 @@ * Title: arm_power_f16.c * Description: Sum of the squares of the elements of a floating-point vector * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_f32.c index 80ed5d9..ec07058 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_f32.c @@ -5,13 +5,13 @@ * Title: arm_power_f32.c * Description: Sum of the squares of the elements of a floating-point vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_f64.c new file mode 100644 index 0000000..d2e1e03 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_f64.c @@ -0,0 +1,81 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_power_f64.c + * Description: Sum of the squares of the elements of a floating-point vector + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup power + @{ + */ + +/** + @brief Sum of the squares of the elements of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult sum of the squares value returned here + @return none + */ +void arm_power_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult) +{ + uint32_t blkCnt; /* Loop counter */ + float64_t sum = 0.; /* Temporary result storage */ + float64_t in; /* Temporary variable to store input value */ + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = A[0] * A[0] + A[1] * A[1] + ... + A[blockSize-1] * A[blockSize-1] */ + + /* Compute Power and store result in a temporary variable, sum. */ + in = *pSrc++; + sum += in * in; + + /* Decrement loop counter */ + blkCnt--; + } + + /* Store result to destination */ + *pResult = sum; +} + +/** + @} end of power group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_q15.c index 22c3afd..1cb3845 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_q15.c @@ -5,13 +5,13 @@ * Title: arm_power_q15.c * Description: Sum of the squares of the elements of a Q15 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -124,10 +124,10 @@ void arm_power_q15( /* Compute Power and store result in a temporary variable, sum. */ #if defined (ARM_MATH_DSP) - in32 = read_q15x2_ia ((q15_t **) &pSrc); + in32 = read_q15x2_ia (&pSrc); sum = __SMLALD(in32, in32, sum); - in32 = read_q15x2_ia ((q15_t **) &pSrc); + in32 = read_q15x2_ia (&pSrc); sum = __SMLALD(in32, in32, sum); #else in = *pSrc++; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_q31.c index 71ce6b5..db83d3b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_q31.c @@ -5,13 +5,13 @@ * Title: arm_power_q31.c * Description: Sum of the squares of the elements of a Q31 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_q7.c index bdbc041..7f74aa2 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_power_q7.c @@ -5,13 +5,13 @@ * Title: arm_power_q7.c * Description: Sum of the squares of the elements of a Q7 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -124,7 +124,7 @@ void arm_power_q7( /* Compute Power and store result in a temporary variable, sum. */ #if defined (ARM_MATH_DSP) - in32 = read_q7x4_ia ((q7_t **) &pSrc); + in32 = read_q7x4_ia (&pSrc); in1 = __SXTB16(__ROR(in32, 8)); in2 = __SXTB16(in32); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_rms_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_rms_f16.c index 3a98ffc..e2c878c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_rms_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_rms_f16.c @@ -5,13 +5,13 @@ * Title: arm_rms_f16.c * Description: Root mean square value of the elements of a floating-point vector * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -37,18 +37,7 @@ @ingroup groupStats */ -/** - @defgroup RMS Root mean square (RMS) - - Calculates the Root Mean Square of the elements in the input vector. - The underlying algorithm is used: -
-      Result = sqrt(((pSrc[0] * pSrc[0] + pSrc[1] * pSrc[1] + ... + pSrc[blockSize-1] * pSrc[blockSize-1]) / blockSize));
-  
- - There are separate functions for floating point, Q31, and Q15 data types. - */ /** @addtogroup RMS @@ -75,7 +64,7 @@ void arm_rms_f16( arm_power_f16(pSrc, blockSize, &pow); /* Compute Rms and store the result in the destination */ - arm_sqrt_f16(pow / (float16_t) blockSize, pResult); + arm_sqrt_f16((_Float16)pow / (_Float16) blockSize, pResult); } #else @@ -137,7 +126,7 @@ void arm_rms_f16( } /* Compute Rms and store result in destination */ - arm_sqrt_f16(sum / (float16_t) blockSize, pResult); + arm_sqrt_f16((_Float16)sum / (_Float16) blockSize, pResult); } #endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_rms_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_rms_f32.c index e86b7f2..7dadc34 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_rms_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_rms_f32.c @@ -5,13 +5,13 @@ * Title: arm_rms_f32.c * Description: Root mean square value of the elements of a floating-point vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_rms_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_rms_q15.c index 8e3dc55..2ed47f6 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_rms_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_rms_q15.c @@ -5,13 +5,13 @@ * Title: arm_rms_q15.c * Description: Root Mean Square of the elements of a Q15 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -95,10 +95,10 @@ void arm_rms_q15( /* Compute sum of squares and store result in a temporary variable. */ #if defined (ARM_MATH_DSP) - in32 = read_q15x2_ia ((q15_t **) &pSrc); + in32 = read_q15x2_ia (&pSrc); sum = __SMLALD(in32, in32, sum); - in32 = read_q15x2_ia ((q15_t **) &pSrc); + in32 = read_q15x2_ia (&pSrc); sum = __SMLALD(in32, in32, sum); #else in = *pSrc++; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_rms_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_rms_q31.c index 93303a8..f334db8 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_rms_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_rms_q31.c @@ -5,13 +5,13 @@ * Title: arm_rms_q31.c * Description: Root Mean Square of the elements of a Q31 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_f16.c index dc8f4a1..b941f24 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_f16.c @@ -5,13 +5,13 @@ * Title: arm_std_f16.c * Description: Standard deviation of the elements of a floating-point vector * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_f32.c index 245f27d..ea60d3c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_f32.c @@ -5,13 +5,13 @@ * Title: arm_std_f32.c * Description: Standard deviation of the elements of a floating-point vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_f64.c new file mode 100644 index 0000000..a193f57 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_f64.c @@ -0,0 +1,63 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_std_f64.c + * Description: Standard deviation of the elements of a floating-point vector + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup STD + @{ + */ + +/** + @brief Standard deviation of the elements of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult standard deviation value returned here + @return none + */ +void arm_std_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult) +{ + float64_t var; + arm_var_f64(pSrc,blockSize,&var); + *pResult = sqrt(var); +} + +/** + @} end of STD group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_q15.c index 08d205b..4e15a85 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_q15.c @@ -5,13 +5,13 @@ * Title: arm_std_q15.c * Description: Standard deviation of an array of Q15 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -102,12 +102,12 @@ void arm_std_q15( /* Compute sum of squares and store result in a temporary variable, sumOfSquares. */ /* Compute sum and store result in a temporary variable, sum. */ #if defined (ARM_MATH_DSP) - in32 = read_q15x2_ia ((q15_t **) &pSrc); + in32 = read_q15x2_ia (&pSrc); sumOfSquares = __SMLALD(in32, in32, sumOfSquares); sum += ((in32 << 16U) >> 16U); sum += (in32 >> 16U); - in32 = read_q15x2_ia ((q15_t **) &pSrc); + in32 = read_q15x2_ia (&pSrc); sumOfSquares = __SMLALD(in32, in32, sumOfSquares); sum += ((in32 << 16U) >> 16U); sum += (in32 >> 16U); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_q31.c index 2248665..3036a2b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_std_q31.c @@ -5,13 +5,13 @@ * Title: arm_std_q31.c * Description: Standard deviation of the elements of a Q31 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_f16.c index e2ffd47..8700428 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_f16.c @@ -5,13 +5,13 @@ * Title: arm_var_f16.c * Description: Variance of the elements of a floating-point vector * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -63,7 +63,7 @@ void arm_var_f16( { int32_t blkCnt; /* loop counters */ f16x8_t vecSrc; - f16x8_t sumVec = vdupq_n_f16((float16_t) 0.0); + f16x8_t sumVec = vdupq_n_f16(0.0f16); float16_t fMean; if (blockSize <= 1U) { @@ -74,15 +74,6 @@ void arm_var_f16( arm_mean_f16(pSrc, blockSize, &fMean); -/* 6.14 bug */ -#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100) && (__ARMCC_VERSION < 6150001) - __asm volatile( - " vmov.i32 %[acc], #0 \n" - : [acc] "+t"(sumVec) - : - : ); -#endif - blkCnt = blockSize; do { mve_pred16_t p = vctp16q(blkCnt); @@ -100,7 +91,7 @@ void arm_var_f16( while (blkCnt > 0); /* Variance */ - *pResult = vecAddAcrossF16Mve(sumVec) / (float16_t) (blockSize - 1.0f); + *pResult = (_Float16)vecAddAcrossF16Mve(sumVec) / (_Float16) (blockSize - 1.0f16); } #else @@ -130,10 +121,10 @@ void arm_var_f16( { /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ - sum += *pInput++; - sum += *pInput++; - sum += *pInput++; - sum += *pInput++; + sum += (_Float16)*pInput++; + sum += (_Float16)*pInput++; + sum += (_Float16)*pInput++; + sum += (_Float16)*pInput++; /* Decrement loop counter */ @@ -154,14 +145,14 @@ void arm_var_f16( { /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ - sum += *pInput++; + sum += (_Float16)*pInput++; /* Decrement loop counter */ blkCnt--; } /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) / blockSize */ - fMean = sum / (float16_t) blockSize; + fMean = (_Float16)sum / (_Float16) blockSize; pInput = pSrc; @@ -172,17 +163,17 @@ void arm_var_f16( while (blkCnt > 0U) { - fValue = *pInput++ - fMean; - fSum += fValue * fValue; + fValue = (_Float16)*pInput++ - (_Float16)fMean; + fSum += (_Float16)fValue * (_Float16)fValue; - fValue = *pInput++ - fMean; - fSum += fValue * fValue; + fValue = (_Float16)*pInput++ - (_Float16)fMean; + fSum += (_Float16)fValue * (_Float16)fValue; - fValue = *pInput++ - fMean; - fSum += fValue * fValue; + fValue = (_Float16)*pInput++ - (_Float16)fMean; + fSum += (_Float16)fValue * (_Float16)fValue; - fValue = *pInput++ - fMean; - fSum += fValue * fValue; + fValue = (_Float16)*pInput++ - (_Float16)fMean; + fSum += (_Float16)fValue * (_Float16)fValue; /* Decrement loop counter */ blkCnt--; @@ -200,15 +191,15 @@ void arm_var_f16( while (blkCnt > 0U) { - fValue = *pInput++ - fMean; - fSum += fValue * fValue; + fValue = (_Float16)*pInput++ - (_Float16)fMean; + fSum += (_Float16)fValue * (_Float16)fValue; /* Decrement loop counter */ blkCnt--; } /* Variance */ - *pResult = fSum / (float16_t)(blockSize - 1.0f); + *pResult = (_Float16)fSum / ((_Float16)blockSize - 1.0f16); } #endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_f32.c index b00b1ad..69ab060 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_f32.c @@ -5,13 +5,13 @@ * Title: arm_var_f32.c * Description: Variance of the elements of a floating-point vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_f64.c new file mode 100644 index 0000000..229db63 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_f64.c @@ -0,0 +1,104 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_var_f64.c + * Description: Variance of the elements of a floating-point vector + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" + +/** + @ingroup groupStats + */ + +/** + @addtogroup variance + @{ + */ + +/** + @brief Variance of the elements of a floating-point vector. + @param[in] pSrc points to the input vector + @param[in] blockSize number of samples in input vector + @param[out] pResult variance value returned here + @return none + */ +void arm_var_f64( + const float64_t * pSrc, + uint32_t blockSize, + float64_t * pResult) +{ + uint32_t blkCnt; /* Loop counter */ + float64_t sum = 0.; /* Temporary result storage */ + float64_t fSum = 0.; + float64_t fMean, fValue; + const float64_t * pInput = pSrc; + + if (blockSize <= 1U) + { + *pResult = 0; + return; + } + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) */ + + sum += *pInput++; + + /* Decrement loop counter */ + blkCnt--; + } + + /* C = (A[0] + A[1] + A[2] + ... + A[blockSize-1]) / blockSize */ + fMean = sum / (float64_t) blockSize; + + pInput = pSrc; + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + + while (blkCnt > 0U) + { + fValue = *pInput++ - fMean; + fSum += fValue * fValue; + + /* Decrement loop counter */ + blkCnt--; + } + + /* Variance */ + *pResult = fSum / (float64_t)(blockSize - 1.); +} + +/** + @} end of variance group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_q15.c index a6be746..9c78d34 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_q15.c @@ -5,13 +5,13 @@ * Title: arm_var_q15.c * Description: Variance of an array of Q15 type * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -113,10 +113,10 @@ void arm_var_q15( /* Compute Mean of squares of the input samples * and then store the result in a temporary variable, meanOfSquares. */ - meanOfSquares = arm_div_q63_to_q31(sumOfSquares, (blockSize - 1U)); + meanOfSquares = arm_div_int64_to_int32(sumOfSquares, (blockSize - 1U)); /* Compute square of mean */ - squareOfMean = arm_div_q63_to_q31((q63_t)sum * sum, (q31_t)(blockSize * (blockSize - 1U))); + squareOfMean = arm_div_int64_to_int32((q63_t)sum * sum, (q31_t)(blockSize * (blockSize - 1U))); /* mean of the squares minus the square of the mean. */ *pResult = (meanOfSquares - squareOfMean) >> 15; @@ -156,12 +156,12 @@ void arm_var_q15( /* Compute sum of squares and store result in a temporary variable, sumOfSquares. */ /* Compute sum and store result in a temporary variable, sum. */ #if defined (ARM_MATH_DSP) - in32 = read_q15x2_ia ((q15_t **) &pSrc); + in32 = read_q15x2_ia (&pSrc); sumOfSquares = __SMLALD(in32, in32, sumOfSquares); sum += ((in32 << 16U) >> 16U); sum += (in32 >> 16U); - in32 = read_q15x2_ia ((q15_t **) &pSrc); + in32 = read_q15x2_ia (&pSrc); sumOfSquares = __SMLALD(in32, in32, sumOfSquares); sum += ((in32 << 16U) >> 16U); sum += (in32 >> 16U); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_q31.c index 0da41b1..025cc56 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/StatisticsFunctions/arm_var_q31.c @@ -5,13 +5,13 @@ * Title: arm_var_q31.c * Description: Variance of an array of Q31 type * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_barycenter_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_barycenter_f16.c index 161b6ec..9a1aa6a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_barycenter_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_barycenter_f16.c @@ -5,11 +5,13 @@ * Title: arm_barycenter_f16.c * Description: Barycenter * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -105,7 +107,7 @@ void arm_barycenter_f16(const float16_t *in, w2 = *pW++; w3 = *pW++; w4 = *pW++; - accum += w1 + w2 + w3 + w4; + accum += (_Float16)w1 + (_Float16)w2 + (_Float16)w3 + (_Float16)w4; blkCntSample = vecDim >> 3; while (blkCntSample > 0) { @@ -131,10 +133,10 @@ void arm_barycenter_f16(const float16_t *in, blkCntSample = vecDim & 7; while (blkCntSample > 0) { - *pOut = *pOut + *pIn1++ * w1; - *pOut = *pOut + *pIn2++ * w2; - *pOut = *pOut + *pIn3++ * w3; - *pOut = *pOut + *pIn4++ * w4; + *pOut = (_Float16)*pOut + (_Float16)*pIn1++ * (_Float16)w1; + *pOut = (_Float16)*pOut + (_Float16)*pIn2++ * (_Float16)w2; + *pOut = (_Float16)*pOut + (_Float16)*pIn3++ * (_Float16)w3; + *pOut = (_Float16)*pOut + (_Float16)*pIn4++ * (_Float16)w4; pOut++; blkCntSample--; } @@ -156,7 +158,7 @@ void arm_barycenter_f16(const float16_t *in, pOut = out; w = *pW++; - accum += w; + accum += (_Float16)w; blkCntSample = vecDim >> 3; while (blkCntSample > 0) @@ -174,7 +176,7 @@ void arm_barycenter_f16(const float16_t *in, blkCntSample = vecDim & 7; while (blkCntSample > 0) { - *pOut = *pOut + *pIn++ * w; + *pOut = (_Float16)*pOut + (_Float16)*pIn++ * (_Float16)w; pOut++; blkCntSample--; } @@ -184,7 +186,7 @@ void arm_barycenter_f16(const float16_t *in, /* Normalize */ pOut = out; - accum = 1.0f / accum; + accum = 1.0f16 / (_Float16)accum; blkCntSample = vecDim >> 3; while (blkCntSample > 0) @@ -201,7 +203,7 @@ void arm_barycenter_f16(const float16_t *in, blkCntSample = vecDim & 7; while (blkCntSample > 0) { - *pOut = *pOut * accum; + *pOut = (_Float16)*pOut * (_Float16)accum; pOut++; blkCntSample--; } @@ -218,7 +220,7 @@ void arm_barycenter_f16(const float16_t *in, const float16_t *weights, float16_t blkCntVector = nbVectors; blkCntSample = vecDim; - accum = 0.0f; + accum = 0.0f16; pW = weights; pIn = in; @@ -229,7 +231,7 @@ void arm_barycenter_f16(const float16_t *in, const float16_t *weights, float16_t while(blkCntSample > 0) { - *pOut = 0.0f; + *pOut = 0.0f16; pOut++; blkCntSample--; } @@ -239,12 +241,12 @@ void arm_barycenter_f16(const float16_t *in, const float16_t *weights, float16_t { pOut = out; w = *pW++; - accum += w; + accum += (_Float16)w; blkCntSample = vecDim; while(blkCntSample > 0) { - *pOut = *pOut + *pIn++ * w; + *pOut = (_Float16)*pOut + (_Float16)*pIn++ * (_Float16)w; pOut++; blkCntSample--; } @@ -258,7 +260,7 @@ void arm_barycenter_f16(const float16_t *in, const float16_t *weights, float16_t while(blkCntSample > 0) { - *pOut = *pOut / accum; + *pOut = (_Float16)*pOut / (_Float16)accum; pOut++; blkCntSample--; } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_barycenter_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_barycenter_f32.c index 9f41c07..e941cbd 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_barycenter_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_barycenter_f32.c @@ -5,11 +5,13 @@ * Title: arm_barycenter_f32.c * Description: Barycenter * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -33,6 +35,7 @@ /** @ingroup barycenter + @{ */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_bitonic_sort_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_bitonic_sort_f32.c index 131a5da..05edb29 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_bitonic_sort_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_bitonic_sort_f32.c @@ -5,13 +5,13 @@ * Title: arm_bitonic_sort_f32.c * Description: Floating point bitonic sort * - * $Date: 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_bubble_sort_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_bubble_sort_f32.c index f84c057..4044ed0 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_bubble_sort_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_bubble_sort_f32.c @@ -5,13 +5,13 @@ * Title: arm_bubble_sort_f32.c * Description: Floating point bubble sort * - * $Date: 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_f16.c index a77f4e9..6d0003b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_f16.c @@ -5,13 +5,13 @@ * Title: arm_copy_f16.c * Description: Copies the elements of a floating-point vector * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_f32.c index 51c0b19..f6f2a33 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_f32.c @@ -5,13 +5,13 @@ * Title: arm_copy_f32.c * Description: Copies the elements of a floating-point vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_f64.c new file mode 100644 index 0000000..05c21e1 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_f64.c @@ -0,0 +1,75 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_copy_f64.c + * Description: Copies the elements of a floating-point vector + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/support_functions.h" + +/** + @ingroup groupSupport + */ + +/** + @addtogroup copy + @{ + */ + +/** + @brief Copies the elements of a floating-point vector. + @param[in] pSrc points to input vector + @param[out] pDst points to output vector + @param[in] blockSize number of samples in each vector + @return none + */ +void arm_copy_f64( + const float64_t * pSrc, + float64_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; /* Loop counter */ + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = A */ + + /* Copy and store result in destination buffer */ + *pDst++ = *pSrc++; + + /* Decrement loop counter */ + blkCnt--; + } +} + +/** + @} end of BasicCopy group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_q15.c index 765b038..fcb7d22 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_q15.c @@ -5,13 +5,13 @@ * Title: arm_copy_q15.c * Description: Copies the elements of a Q15 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -97,8 +97,8 @@ void arm_copy_q15( /* C = A */ /* read 2 times 2 samples at a time */ - write_q15x2_ia (&pDst, read_q15x2_ia ((q15_t **) &pSrc)); - write_q15x2_ia (&pDst, read_q15x2_ia ((q15_t **) &pSrc)); + write_q15x2_ia (&pDst, read_q15x2_ia (&pSrc)); + write_q15x2_ia (&pDst, read_q15x2_ia (&pSrc)); /* Decrement loop counter */ blkCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_q31.c index 07b9b22..1249380 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_q31.c @@ -5,13 +5,13 @@ * Title: arm_copy_q31.c * Description: Copies the elements of a Q31 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_q7.c index 1eaa857..70f7b7f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_copy_q7.c @@ -5,13 +5,13 @@ * Title: arm_copy_q7.c * Description: Copies the elements of a Q7 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -100,7 +100,7 @@ void arm_copy_q7( /* C = A */ /* read 4 samples at a time */ - write_q7x4_ia (&pDst, read_q7x4_ia ((q7_t **) &pSrc)); + write_q7x4_ia (&pDst, read_q7x4_ia (&pSrc)); /* Decrement loop counter */ blkCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_f16_to_float.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_f16_to_float.c index 87b1e46..cf4451f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_f16_to_float.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_f16_to_float.c @@ -5,13 +5,13 @@ * Title: arm_float_to_q15.c * Description: Converts the elements of the floating-point vector to Q15 vector * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -55,7 +55,11 @@ */ -#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) && defined(__CMSIS_GCC_H) +#pragma GCC warning "Scalar version of arm_f16_to_float built. Helium version has build issues with gcc." +#endif + +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) && !defined(__CMSIS_GCC_H) void arm_f16_to_float( const float16_t * pSrc, diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_f16_to_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_f16_to_q15.c index a454881..cdd714e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_f16_to_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_f16_to_q15.c @@ -5,13 +5,13 @@ * Title: arm_float_to_q15.c * Description: Converts the elements of the floating-point vector to Q15 vector * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -138,7 +138,7 @@ void arm_f16_to_q15( /* * convert from float to Q31 and then store the results in the destination buffer */ - *pDst++ = clip_q31_to_q15((q31_t) (*pIn++ * 32768.0)); + *pDst++ = clip_q31_to_q15((q31_t) ((_Float16)*pIn++ * 32768.0f16)); #endif /* #ifdef ARM_MATH_ROUNDING */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_f16.c index 6f46139..f52f505 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_f16.c @@ -5,13 +5,13 @@ * Title: arm_fill_f16.c * Description: Fills a constant value into a floating-point vector * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_f32.c index 14c851b..b06ceb3 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_f32.c @@ -5,13 +5,13 @@ * Title: arm_fill_f32.c * Description: Fills a constant value into a floating-point vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_f64.c new file mode 100644 index 0000000..152cb4c --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_f64.c @@ -0,0 +1,75 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_fill_f64.c + * Description: Fills a constant value into a floating-point vector + * + * $Date: 13 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/support_functions.h" + +/** + @ingroup groupSupport + */ + +/** + @addtogroup Fill + @{ + */ + +/** + @brief Fills a constant value into a floating-point vector. + @param[in] value input value to be filled + @param[out] pDst points to output vector + @param[in] blockSize number of samples in each vector + @return none + */ +void arm_fill_f64( + float64_t value, + float64_t * pDst, + uint32_t blockSize) +{ + uint32_t blkCnt; /* Loop counter */ + + /* Initialize blkCnt with number of samples */ + blkCnt = blockSize; + + while (blkCnt > 0U) + { + /* C = value */ + + /* Fill value in destination buffer */ + *pDst++ = value; + + /* Decrement loop counter */ + blkCnt--; + } +} + +/** + @} end of Fill group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_q15.c index c9b46c4..a45aae4 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_q15.c @@ -5,13 +5,13 @@ * Title: arm_fill_q15.c * Description: Fills a constant value into a Q15 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_q31.c index 4a9a6c1..9a8b129 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_q31.c @@ -5,13 +5,13 @@ * Title: arm_fill_q31.c * Description: Fills a constant value into a Q31 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_q7.c index 2050480..1211436 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_fill_q7.c @@ -5,13 +5,13 @@ * Title: arm_fill_q7.c * Description: Fills a constant value into a Q7 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_float_to_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_float_to_f16.c index 3a1e9a5..c726153 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_float_to_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_float_to_f16.c @@ -5,13 +5,13 @@ * Title: arm_float_to_q15.c * Description: Converts the elements of the floating-point vector to Q15 vector * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -51,7 +51,11 @@ */ -#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) && defined(__CMSIS_GCC_H) +#pragma GCC warning "Scalar version of arm_float_to_f16 built. Helium version has build issues with gcc." +#endif + +#if defined(ARM_MATH_MVE_FLOAT16) && !defined(ARM_MATH_AUTOVECTORIZE) && !defined(__CMSIS_GCC_H) void arm_float_to_f16( const float32_t * pSrc, diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_float_to_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_float_to_q15.c index c6bd214..dd5bab1 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_float_to_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_float_to_q15.c @@ -5,13 +5,13 @@ * Title: arm_float_to_q15.c * Description: Converts the elements of the floating-point vector to Q15 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -70,7 +70,7 @@ void arm_float_to_q15( uint32_t blkCnt; float32_t maxQ = (float32_t) Q15_MAX; f32x4x2_t tmp; - q15x8_t vecDst; + q15x8_t vecDst = { 0 }; #ifdef ARM_MATH_ROUNDING float32_t in; #endif diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_float_to_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_float_to_q31.c index 3cd44ad..76cd238 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_float_to_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_float_to_q31.c @@ -5,13 +5,13 @@ * Title: arm_float_to_q31.c * Description: Converts the elements of the floating-point vector to Q31 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_float_to_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_float_to_q7.c index 613976c..f64e6d2 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_float_to_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_float_to_q7.c @@ -5,13 +5,13 @@ * Title: arm_float_to_q7.c * Description: Converts the elements of the floating-point vector to Q7 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -69,8 +69,8 @@ void arm_float_to_q7( uint32_t blkCnt; /* loop counters */ float32_t maxQ = powf(2.0, 7); f32x4x4_t tmp; - q15x8_t evVec, oddVec; - q7x16_t vecDst; + q15x8_t evVec = { 0 }, oddVec = { 0 }; + q7x16_t vecDst = { 0 }; float32_t const *pSrcVec; #ifdef ARM_MATH_ROUNDING float32_t in; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_heap_sort_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_heap_sort_f32.c index 78985b7..aa52173 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_heap_sort_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_heap_sort_f32.c @@ -5,13 +5,13 @@ * Title: arm_heap_sort_f32.c * Description: Floating point heap sort * - * $Date: 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_insertion_sort_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_insertion_sort_f32.c index 440b26e..386c5ce 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_insertion_sort_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_insertion_sort_f32.c @@ -5,13 +5,13 @@ * Title: arm_insertion_sort_f32.c * Description: Floating point insertion sort * - * $Date: 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_merge_sort_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_merge_sort_f32.c index 13c7a33..a74a961 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_merge_sort_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_merge_sort_f32.c @@ -5,13 +5,13 @@ * Title: arm_merge_sort_f32.c * Description: Floating point merge sort * - * $Date: 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_merge_sort_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_merge_sort_init_f32.c index 901554a..73f916a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_merge_sort_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_merge_sort_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_merge_sort_init_f32.c * Description: Floating point merge sort initialization function * - * $Date: 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q15_to_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q15_to_f16.c index 8b95b12..a250b0b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q15_to_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q15_to_f16.c @@ -5,13 +5,13 @@ * Title: arm_q15_to_float.c * Description: Converts the elements of the Q15 vector to floating-point vector * - * $Date: 18. March 2020 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -38,7 +38,7 @@ */ /** - * @defgroup q15_to_x Convert 16-bit Integer value + * @defgroup q15_to_x Convert 16-bit fixed point value */ /** @@ -116,10 +116,10 @@ void arm_q15_to_f16( /* C = (float16_t) A / 32768 */ /* Convert from q15 to float and store result in destination buffer */ - *pDst++ = ((float16_t) * pIn++ / 32768.0f); - *pDst++ = ((float16_t) * pIn++ / 32768.0f); - *pDst++ = ((float16_t) * pIn++ / 32768.0f); - *pDst++ = ((float16_t) * pIn++ / 32768.0f); + *pDst++ = ((_Float16) * pIn++ / 32768.0f16); + *pDst++ = ((_Float16) * pIn++ / 32768.0f16); + *pDst++ = ((_Float16) * pIn++ / 32768.0f16); + *pDst++ = ((_Float16) * pIn++ / 32768.0f16); /* Decrement loop counter */ blkCnt--; @@ -140,7 +140,7 @@ void arm_q15_to_f16( /* C = (float16_t) A / 32768 */ /* Convert from q15 to float and store result in destination buffer */ - *pDst++ = ((float16_t) *pIn++ / 32768.0f); + *pDst++ = ((_Float16) *pIn++ / 32768.0f16); /* Decrement loop counter */ blkCnt--; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q15_to_float.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q15_to_float.c index 9f8dc33..1bc9729 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q15_to_float.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q15_to_float.c @@ -5,13 +5,13 @@ * Title: arm_q15_to_float.c * Description: Converts the elements of the Q15 vector to floating-point vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -35,7 +35,7 @@ */ /** - * @defgroup q15_to_x Convert 16-bit Integer value + * @defgroup q15_to_x Convert 16-bit fixed point value */ /** @@ -67,16 +67,16 @@ void arm_q15_to_float( q15x8_t vecDst; q15_t const *pSrcVec; - + pSrcVec = (q15_t const *) pSrc; blkCnt = blockSize >> 2; while (blkCnt > 0U) { /* C = (float32_t) A / 32768 */ /* convert from q15 to float and then store the results in the destination buffer */ - vecDst = vldrhq_s32(pSrcVec); + vecDst = vldrhq_s32(pSrcVec); pSrcVec += 4; - vstrwq(pDst, vcvtq_n_f32_s32(vecDst, 15)); + vstrwq(pDst, vcvtq_n_f32_s32((int32x4_t)vecDst, 15)); pDst += 4; /* * Decrement the blockSize loop counter @@ -131,7 +131,7 @@ void arm_q15_to_float( outV = vcvtq_n_f32_s32(inV1,15); vst1q_f32(pDst, outV); pDst += 4; - + /* Decrement the loop counter */ blkCnt--; } diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q15_to_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q15_to_q31.c index 3e59523..2a56392 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q15_to_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q15_to_q31.c @@ -5,13 +5,13 @@ * Title: arm_q15_to_q31.c * Description: Converts the elements of the Q15 vector to Q31 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -119,8 +119,8 @@ void arm_q15_to_q31( /* C = (q31_t)A << 16 */ /* Convert from q15 to q31 and store result in destination buffer */ - in1 = read_q15x2_ia ((q15_t **) &pIn); - in2 = read_q15x2_ia ((q15_t **) &pIn); + in1 = read_q15x2_ia (&pIn); + in2 = read_q15x2_ia (&pIn); #ifndef ARM_MATH_BIG_ENDIAN diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q15_to_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q15_to_q7.c index abb68b5..8a33729 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q15_to_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q15_to_q7.c @@ -5,13 +5,13 @@ * Title: arm_q15_to_q7.c * Description: Converts the elements of the Q15 vector to Q7 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -62,7 +62,7 @@ void arm_q15_to_q7( uint32_t blkCnt; /* loop counters */ q15x8x2_t tmp; q15_t const *pSrcVec; - q7x16_t vecDst; + q7x16_t vecDst = { 0 }; pSrcVec = (q15_t const *) pSrc; @@ -121,8 +121,8 @@ void arm_q15_to_q7( /* Convert from q15 to q7 and store result in destination buffer */ #if defined (ARM_MATH_DSP) - in1 = read_q15x2_ia ((q15_t **) &pIn); - in2 = read_q15x2_ia ((q15_t **) &pIn); + in1 = read_q15x2_ia (&pIn); + in2 = read_q15x2_ia (&pIn); #ifndef ARM_MATH_BIG_ENDIAN diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q31_to_float.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q31_to_float.c index fc4b280..a478044 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q31_to_float.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q31_to_float.c @@ -5,13 +5,13 @@ * Title: arm_q31_to_float.c * Description: Converts the elements of the Q31 vector to floating-point vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -35,7 +35,7 @@ */ /** - * @defgroup q31_to_x Convert 32-bit Integer value + * @defgroup q31_to_x Convert 32-bit fixed point value */ /** diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q31_to_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q31_to_q15.c index 27e04b5..2d0c58a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q31_to_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q31_to_q15.c @@ -5,13 +5,13 @@ * Title: arm_q31_to_q15.c * Description: Converts the elements of the Q31 vector to Q15 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -60,7 +60,7 @@ void arm_q31_to_q15( { uint32_t blkCnt; /* loop counters */ q31x4x2_t tmp; - q15x8_t vecDst; + q15x8_t vecDst = { 0 }; q31_t const *pSrcVec; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q31_to_q7.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q31_to_q7.c index 14f25bc..27d1423 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q31_to_q7.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q31_to_q7.c @@ -5,13 +5,13 @@ * Title: arm_q31_to_q7.c * Description: Converts the elements of the Q31 vector to Q7 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -60,8 +60,8 @@ void arm_q31_to_q7( { uint32_t blkCnt; /* loop counters */ q31x4x4_t tmp; - q15x8_t evVec, oddVec; - q7x16_t vecDst; + q15x8_t evVec = { 0 }, oddVec = { 0 }; + q7x16_t vecDst = { 0 }; q31_t const *pSrcVec; pSrcVec = (q31_t const *) pSrc; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q7_to_float.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q7_to_float.c index 6535dd0..f70206d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q7_to_float.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q7_to_float.c @@ -5,13 +5,13 @@ * Title: arm_q7_to_float.c * Description: Converts the elements of the Q7 vector to floating-point vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -35,7 +35,7 @@ */ /** - * @defgroup q7_to_x Convert 8-bit Integer value + * @defgroup q7_to_x Convert 8-bit fixed point value */ /** @@ -74,7 +74,7 @@ void arm_q7_to_float( /* convert from q7 to float and then store the results in the destination buffer */ vecDst = vldrbq_s32(pSrcVec); pSrcVec += 4; - vstrwq(pDst, vcvtq_n_f32_s32(vecDst, 7)); + vstrwq(pDst, vcvtq_n_f32_s32((int32x4_t)vecDst, 7)); pDst += 4; /* * Decrement the blockSize loop counter diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q7_to_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q7_to_q15.c index 75bb856..b169fba 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q7_to_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q7_to_q15.c @@ -5,13 +5,13 @@ * Title: arm_q7_to_q15.c * Description: Converts the elements of the Q7 vector to Q15 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -123,7 +123,7 @@ void arm_q7_to_q15( /* Convert from q7 to q15 and store result in destination buffer */ #if defined (ARM_MATH_DSP) - in = read_q7x4_ia ((q7_t **) &pIn); + in = read_q7x4_ia (&pIn); /* rotatate in by 8 and extend two q7_t values to q15_t values */ in1 = __SXTB16(__ROR(in, 8)); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q7_to_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q7_to_q31.c index a01894a..7867a08 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q7_to_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_q7_to_q31.c @@ -5,13 +5,13 @@ * Title: arm_q7_to_q31.c * Description: Converts the elements of the Q7 vector to Q31 vector * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -115,7 +115,7 @@ void arm_q7_to_q31( /* C = (q31_t) A << 24 */ /* Convert from q7 to q31 and store result in destination buffer */ - in = read_q7x4_ia ((q7_t **) &pIn); + in = read_q7x4_ia (&pIn); #ifndef ARM_MATH_BIG_ENDIAN diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_quick_sort_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_quick_sort_f32.c index 4723d13..6c0e638 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_quick_sort_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_quick_sort_f32.c @@ -5,13 +5,13 @@ * Title: arm_quick_sort_f32.c * Description: Floating point quick sort * - * $Date: 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_selection_sort_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_selection_sort_f32.c index 7100f04..7fa49ae 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_selection_sort_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_selection_sort_f32.c @@ -5,13 +5,13 @@ * Title: arm_selection_sort_f32.c * Description: Floating point selection sort * - * $Date: 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_sort_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_sort_f32.c index 3d3ecd8..931fc2d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_sort_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_sort_f32.c @@ -5,13 +5,13 @@ * Title: arm_sort_f32.c * Description: Floating point sort * - * $Date: 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_sort_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_sort_init_f32.c index 723db0b..7220b4c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_sort_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_sort_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_sort_init_f32.c * Description: Floating point sort initialization function * - * $Date: 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_weighted_sum_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_weighted_sum_f16.c index d0b6f99..2c80545 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_weighted_sum_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_weighted_sum_f16.c @@ -5,11 +5,13 @@ * Title: arm_weighted_sum_f16.c * Description: Weighted Sum * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_weighted_sum_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_weighted_sum_f32.c index 7f28207..243378d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_weighted_sum_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/SupportFunctions/arm_weighted_sum_f32.c @@ -5,11 +5,13 @@ * Title: arm_weighted_sum_f32.c * Description: Weighted Sum * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_bitreversal.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_bitreversal.c index a1504f1..cc8e8b0 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_bitreversal.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_bitreversal.c @@ -5,13 +5,13 @@ * Title: arm_bitreversal.c * Description: Bitreversal functions * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_bitreversal2.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_bitreversal2.c index a22e8cb..e093aec 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_bitreversal2.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_bitreversal2.c @@ -5,10 +5,10 @@ * Title: arm_bitreversal2.c * Description: Bitreversal functions * - * $Date: 18. March 2019 - * $Revision: V1.0.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* * Copyright (C) 2019 ARM Limited or its affiliates. All rights reserved. diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_bitreversal_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_bitreversal_f16.c index 7809ea9..bd13013 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_bitreversal_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_bitreversal_f16.c @@ -5,8 +5,10 @@ * Title: arm_bitreversal_f16.c * Description: Bitreversal functions * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. @@ -100,4 +102,5 @@ const uint16_t * pBitRevTab) } } #endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_f16.c index 2d6d436..ee4f926 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_f16.c @@ -5,13 +5,13 @@ * Title: arm_cfft_f32.c * Description: Combined Radix Decimation in Frequency CFFT Floating point processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -42,111 +42,51 @@ static float16_t arm_inverse_fft_length_f16(uint16_t fftLen) { float16_t retValue=1.0; - - switch (fftLen) - { - - case 4096U: - retValue = (float16_t)0.000244140625f; - break; - - case 2048U: - retValue = (float16_t)0.00048828125f; - break; - - case 1024U: - retValue = (float16_t)0.0009765625f; - break; - - case 512U: - retValue = (float16_t)0.001953125f; - break; - - case 256U: - retValue = (float16_t)0.00390625f; - break; - - case 128U: - retValue = (float16_t)0.0078125f; - break; - - case 64U: - retValue = (float16_t)0.015625f; - break; - - case 32U: - retValue = (float16_t)0.03125f; - break; - - case 16U: - retValue = (float16_t)0.0625f; - break; - - - default: - break; - } - return(retValue); -} - - -static void arm_bitreversal_f16_inpl_mve( - uint16_t *pSrc, - const uint16_t bitRevLen, - const uint16_t *pBitRevTab) - -{ - uint32_t *src = (uint32_t *)pSrc; - uint32_t blkCnt; /* loop counters */ - uint32x4_t bitRevTabOff; - uint16x8_t one = vdupq_n_u16(1); - - blkCnt = (bitRevLen / 2) / 4; - while (blkCnt > 0U) { - bitRevTabOff = vldrhq_u16(pBitRevTab); - pBitRevTab += 8; - uint32x4_t bitRevOff1 = vmullbq_int_u16(bitRevTabOff, one); - uint32x4_t bitRevOff2 = vmulltq_int_u16(bitRevTabOff, one); + switch (fftLen) + { - bitRevOff1 = bitRevOff1 >> 3; - bitRevOff2 = bitRevOff2 >> 3; + case 4096U: + retValue = (float16_t)0.000244140625f; + break; - uint32x4_t in1 = vldrwq_gather_shifted_offset_u32(src, bitRevOff1); - uint32x4_t in2 = vldrwq_gather_shifted_offset_u32(src, bitRevOff2); + case 2048U: + retValue = (float16_t)0.00048828125f; + break; - vstrwq_scatter_shifted_offset_u32(src, bitRevOff1, in2); - vstrwq_scatter_shifted_offset_u32(src, bitRevOff2, in1); + case 1024U: + retValue = (float16_t)0.0009765625f; + break; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } + case 512U: + retValue = (float16_t)0.001953125f; + break; + case 256U: + retValue = (float16_t)0.00390625f; + break; - /* - * tail - * (will be merged thru tail predication) - */ - blkCnt = bitRevLen & 7; - if (blkCnt > 0U) { - mve_pred16_t p0 = vctp16q(blkCnt); + case 128U: + retValue = (float16_t)0.0078125f; + break; - bitRevTabOff = vldrhq_z_u16(pBitRevTab, p0); + case 64U: + retValue = (float16_t)0.015625f; + break; - uint32x4_t bitRevOff1 = vmullbq_int_u16(bitRevTabOff, one); - uint32x4_t bitRevOff2 = vmulltq_int_u16(bitRevTabOff, one); + case 32U: + retValue = (float16_t)0.03125f; + break; - bitRevOff1 = bitRevOff1 >> 3; - bitRevOff2 = bitRevOff2 >> 3; + case 16U: + retValue = (float16_t)0.0625f; + break; - uint32x4_t in1 = vldrwq_gather_shifted_offset_z_u32(src, bitRevOff1, p0); - uint32x4_t in2 = vldrwq_gather_shifted_offset_z_u32(src, bitRevOff2, p0); - vstrwq_scatter_shifted_offset_p_u32(src, bitRevOff1, in2, p0); - vstrwq_scatter_shifted_offset_p_u32(src, bitRevOff2, in1, p0); - } + default: + break; + } + return(retValue); } @@ -159,39 +99,37 @@ static void _arm_radix4_butterfly_f16_mve(const arm_cfft_instance_f16 * S,float1 uint32_t n1, n2; uint32_t stage = 0; int32_t iter = 1; - static const uint32_t strides[4] = - {(0 - 16) * sizeof(float16_t *) - , (4 - 16) * sizeof(float16_t *) - , (8 - 16) * sizeof(float16_t *) - , (12 - 16) * sizeof(float16_t *)}; + static const int32_t strides[4] = + { ( 0 - 16) * (int32_t)sizeof(float16_t *) + , ( 4 - 16) * (int32_t)sizeof(float16_t *) + , ( 8 - 16) * (int32_t)sizeof(float16_t *) + , (12 - 16) * (int32_t)sizeof(float16_t *)}; n2 = fftLen; n1 = n2; n2 >>= 2u; for (int k = fftLen / 4u; k > 1; k >>= 2) { + float16_t const *p_rearranged_twiddle_tab_stride1 = + &S->rearranged_twiddle_stride1[ + S->rearranged_twiddle_tab_stride1_arr[stage]]; + float16_t const *p_rearranged_twiddle_tab_stride2 = + &S->rearranged_twiddle_stride2[ + S->rearranged_twiddle_tab_stride2_arr[stage]]; + float16_t const *p_rearranged_twiddle_tab_stride3 = + &S->rearranged_twiddle_stride3[ + S->rearranged_twiddle_tab_stride3_arr[stage]]; + float16_t * pBase = pSrc; for (int i = 0; i < iter; i++) { - float16_t const *p_rearranged_twiddle_tab_stride1 = - &S->rearranged_twiddle_stride1[ - S->rearranged_twiddle_tab_stride1_arr[stage]]; - float16_t const *p_rearranged_twiddle_tab_stride2 = - &S->rearranged_twiddle_stride2[ - S->rearranged_twiddle_tab_stride2_arr[stage]]; - float16_t const *p_rearranged_twiddle_tab_stride3 = - &S->rearranged_twiddle_stride3[ - S->rearranged_twiddle_tab_stride3_arr[stage]]; - float16_t const *pW1, *pW2, *pW3; - float16_t *inA = pSrc + CMPLX_DIM * i * n1; - float16_t *inB = inA + n2 * CMPLX_DIM; - float16_t *inC = inB + n2 * CMPLX_DIM; - float16_t *inD = inC + n2 * CMPLX_DIM; - f16x8_t vecW; - - - pW1 = p_rearranged_twiddle_tab_stride1; - pW2 = p_rearranged_twiddle_tab_stride2; - pW3 = p_rearranged_twiddle_tab_stride3; + float16_t *inA = pBase; + float16_t *inB = inA + n2 * CMPLX_DIM; + float16_t *inC = inB + n2 * CMPLX_DIM; + float16_t *inD = inC + n2 * CMPLX_DIM; + float16_t const *pW1 = p_rearranged_twiddle_tab_stride1; + float16_t const *pW2 = p_rearranged_twiddle_tab_stride2; + float16_t const *pW3 = p_rearranged_twiddle_tab_stride3; + f16x8_t vecW; blkCnt = n2 / 4; /* @@ -260,6 +198,7 @@ static void _arm_radix4_butterfly_f16_mve(const arm_cfft_instance_f16 * S,float1 blkCnt--; } + pBase += CMPLX_DIM * n1; } n1 = n2; n2 >>= 2u; @@ -270,7 +209,7 @@ static void _arm_radix4_butterfly_f16_mve(const arm_cfft_instance_f16 * S,float1 /* * start of Last stage process */ - uint32x4_t vecScGathAddr = *(uint32x4_t *) strides; + uint32x4_t vecScGathAddr = vld1q_u32((uint32_t*)strides); vecScGathAddr = vecScGathAddr + (uint32_t) pSrc; /* load scheduling */ @@ -362,16 +301,15 @@ static void _arm_radix4_butterfly_inverse_f16_mve(const arm_cfft_instance_f16 * f16x8_t vecTmp0, vecTmp1; f16x8_t vecSum0, vecDiff0, vecSum1, vecDiff1; f16x8_t vecA, vecB, vecC, vecD; - f16x8_t vecW; uint32_t blkCnt; uint32_t n1, n2; uint32_t stage = 0; int32_t iter = 1; - static const uint32_t strides[4] = { - (0 - 16) * sizeof(q31_t *), - (4 - 16) * sizeof(q31_t *), - (8 - 16) * sizeof(q31_t *), - (12 - 16) * sizeof(q31_t *) + static const int32_t strides[4] = { + ( 0 - 16) * (int32_t)sizeof(q31_t *), + ( 4 - 16) * (int32_t)sizeof(q31_t *), + ( 8 - 16) * (int32_t)sizeof(q31_t *), + (12 - 16) * (int32_t)sizeof(q31_t *) }; n2 = fftLen; @@ -379,26 +317,27 @@ static void _arm_radix4_butterfly_inverse_f16_mve(const arm_cfft_instance_f16 * n2 >>= 2u; for (int k = fftLen / 4; k > 1; k >>= 2) { + float16_t const *p_rearranged_twiddle_tab_stride1 = + &S->rearranged_twiddle_stride1[ + S->rearranged_twiddle_tab_stride1_arr[stage]]; + float16_t const *p_rearranged_twiddle_tab_stride2 = + &S->rearranged_twiddle_stride2[ + S->rearranged_twiddle_tab_stride2_arr[stage]]; + float16_t const *p_rearranged_twiddle_tab_stride3 = + &S->rearranged_twiddle_stride3[ + S->rearranged_twiddle_tab_stride3_arr[stage]]; + + float16_t * pBase = pSrc; for (int i = 0; i < iter; i++) { - float16_t const *p_rearranged_twiddle_tab_stride1 = - &S->rearranged_twiddle_stride1[ - S->rearranged_twiddle_tab_stride1_arr[stage]]; - float16_t const *p_rearranged_twiddle_tab_stride2 = - &S->rearranged_twiddle_stride2[ - S->rearranged_twiddle_tab_stride2_arr[stage]]; - float16_t const *p_rearranged_twiddle_tab_stride3 = - &S->rearranged_twiddle_stride3[ - S->rearranged_twiddle_tab_stride3_arr[stage]]; - float16_t const *pW1, *pW2, *pW3; - float16_t *inA = pSrc + CMPLX_DIM * i * n1; - float16_t *inB = inA + n2 * CMPLX_DIM; - float16_t *inC = inB + n2 * CMPLX_DIM; - float16_t *inD = inC + n2 * CMPLX_DIM; - - pW1 = p_rearranged_twiddle_tab_stride1; - pW2 = p_rearranged_twiddle_tab_stride2; - pW3 = p_rearranged_twiddle_tab_stride3; + float16_t *inA = pBase; + float16_t *inB = inA + n2 * CMPLX_DIM; + float16_t *inC = inB + n2 * CMPLX_DIM; + float16_t *inD = inC + n2 * CMPLX_DIM; + float16_t const *pW1 = p_rearranged_twiddle_tab_stride1; + float16_t const *pW2 = p_rearranged_twiddle_tab_stride2; + float16_t const *pW3 = p_rearranged_twiddle_tab_stride3; + f16x8_t vecW; blkCnt = n2 / 4; /* @@ -466,6 +405,7 @@ static void _arm_radix4_butterfly_inverse_f16_mve(const arm_cfft_instance_f16 * blkCnt--; } + pBase += CMPLX_DIM * n1; } n1 = n2; n2 >>= 2u; @@ -476,7 +416,7 @@ static void _arm_radix4_butterfly_inverse_f16_mve(const arm_cfft_instance_f16 * /* * start of Last stage process */ - uint32x4_t vecScGathAddr = *(uint32x4_t *) strides; + uint32x4_t vecScGathAddr = vld1q_u32((uint32_t*)strides); vecScGathAddr = vecScGathAddr + (uint32_t) pSrc; /* @@ -592,53 +532,53 @@ void arm_cfft_f16( float16_t * pSrc, uint8_t ifftFlag, uint8_t bitReverseFlag) -{ - uint32_t fftLen = S->fftLen; - - if (ifftFlag == 1U) { - - switch (fftLen) { - case 16: - case 64: - case 256: - case 1024: - case 4096: - _arm_radix4_butterfly_inverse_f16_mve(S, pSrc, fftLen, arm_inverse_fft_length_f16(S->fftLen)); - break; - - case 32: - case 128: - case 512: - case 2048: - arm_cfft_radix4by2_inverse_f16_mve(S, pSrc, fftLen); - break; - } - } else { - switch (fftLen) { - case 16: - case 64: - case 256: - case 1024: - case 4096: - _arm_radix4_butterfly_f16_mve(S, pSrc, fftLen); - break; - - case 32: - case 128: - case 512: - case 2048: - arm_cfft_radix4by2_f16_mve(S, pSrc, fftLen); - break; - } - } - - - if (bitReverseFlag) - { - - arm_bitreversal_f16_inpl_mve((uint16_t*)pSrc, S->bitRevLength, S->pBitRevTable); - - } +{ + uint32_t fftLen = S->fftLen; + + if (ifftFlag == 1U) { + + switch (fftLen) { + case 16: + case 64: + case 256: + case 1024: + case 4096: + _arm_radix4_butterfly_inverse_f16_mve(S, pSrc, fftLen, arm_inverse_fft_length_f16(S->fftLen)); + break; + + case 32: + case 128: + case 512: + case 2048: + arm_cfft_radix4by2_inverse_f16_mve(S, pSrc, fftLen); + break; + } + } else { + switch (fftLen) { + case 16: + case 64: + case 256: + case 1024: + case 4096: + _arm_radix4_butterfly_f16_mve(S, pSrc, fftLen); + break; + + case 32: + case 128: + case 512: + case 2048: + arm_cfft_radix4by2_f16_mve(S, pSrc, fftLen); + break; + } + } + + + if (bitReverseFlag) + { + + arm_bitreversal_16_inpl_mve((uint16_t*)pSrc, S->bitRevLength, S->pBitRevTable); + + } } #else @@ -666,162 +606,6 @@ extern void arm_radix4_butterfly_f16( @ingroup groupTransforms */ -/** - @defgroup ComplexFFT Complex FFT Functions - - @par - The Fast Fourier Transform (FFT) is an efficient algorithm for computing the - Discrete Fourier Transform (DFT). The FFT can be orders of magnitude faster - than the DFT, especially for long lengths. - The algorithms described in this section - operate on complex data. A separate set of functions is devoted to handling - of real sequences. - @par - There are separate algorithms for handling floating-point, Q15, and Q31 data - types. The algorithms available for each data type are described next. - @par - The FFT functions operate in-place. That is, the array holding the input data - will also be used to hold the corresponding result. The input data is complex - and contains 2*fftLen interleaved values as shown below. -
{real[0], imag[0], real[1], imag[1], ...} 
- The FFT result will be contained in the same array and the frequency domain - values will have the same interleaving. - - @par Floating-point - The floating-point complex FFT uses a mixed-radix algorithm. Multiple radix-8 - stages are performed along with a single radix-2 or radix-4 stage, as needed. - The algorithm supports lengths of [16, 32, 64, ..., 4096] and each length uses - a different twiddle factor table. - @par - The function uses the standard FFT definition and output values may grow by a - factor of fftLen when computing the forward transform. The - inverse transform includes a scale of 1/fftLen as part of the - calculation and this matches the textbook definition of the inverse FFT. - @par - For the MVE version, the new arm_cfft_init_f32 initialization function is - mandatory. Compilation flags are available to include only the required tables for the - needed FFTs. Other FFT versions can continue to be initialized as - explained below. - @par - For not MVE versions, pre-initialized data structures containing twiddle factors - and bit reversal tables are provided and defined in arm_const_structs.h. Include - this header in your function and then pass one of the constant structures as - an argument to arm_cfft_f32. For example: - @par - arm_cfft_f32(arm_cfft_sR_f32_len64, pSrc, 1, 1) - @par - computes a 64-point inverse complex FFT including bit reversal. - The data structures are treated as constant data and not modified during the - calculation. The same data structure can be reused for multiple transforms - including mixing forward and inverse transforms. - @par - Earlier releases of the library provided separate radix-2 and radix-4 - algorithms that operated on floating-point data. These functions are still - provided but are deprecated. The older functions are slower and less general - than the new functions. - @par - An example of initialization of the constants for the arm_cfft_f32 function follows: - @code - const static arm_cfft_instance_f32 *S; - ... - switch (length) { - case 16: - S = &arm_cfft_sR_f32_len16; - break; - case 32: - S = &arm_cfft_sR_f32_len32; - break; - case 64: - S = &arm_cfft_sR_f32_len64; - break; - case 128: - S = &arm_cfft_sR_f32_len128; - break; - case 256: - S = &arm_cfft_sR_f32_len256; - break; - case 512: - S = &arm_cfft_sR_f32_len512; - break; - case 1024: - S = &arm_cfft_sR_f32_len1024; - break; - case 2048: - S = &arm_cfft_sR_f32_len2048; - break; - case 4096: - S = &arm_cfft_sR_f32_len4096; - break; - } - @endcode - @par - The new arm_cfft_init_f32 can also be used. - @par Q15 and Q31 - The floating-point complex FFT uses a mixed-radix algorithm. Multiple radix-4 - stages are performed along with a single radix-2 stage, as needed. - The algorithm supports lengths of [16, 32, 64, ..., 4096] and each length uses - a different twiddle factor table. - @par - The function uses the standard FFT definition and output values may grow by a - factor of fftLen when computing the forward transform. The - inverse transform includes a scale of 1/fftLen as part of the - calculation and this matches the textbook definition of the inverse FFT. - @par - Pre-initialized data structures containing twiddle factors and bit reversal - tables are provided and defined in arm_const_structs.h. Include - this header in your function and then pass one of the constant structures as - an argument to arm_cfft_q31. For example: - @par - arm_cfft_q31(arm_cfft_sR_q31_len64, pSrc, 1, 1) - @par - computes a 64-point inverse complex FFT including bit reversal. - The data structures are treated as constant data and not modified during the - calculation. The same data structure can be reused for multiple transforms - including mixing forward and inverse transforms. - @par - Earlier releases of the library provided separate radix-2 and radix-4 - algorithms that operated on floating-point data. These functions are still - provided but are deprecated. The older functions are slower and less general - than the new functions. - @par - An example of initialization of the constants for the arm_cfft_q31 function follows: - @code - const static arm_cfft_instance_q31 *S; - ... - switch (length) { - case 16: - S = &arm_cfft_sR_q31_len16; - break; - case 32: - S = &arm_cfft_sR_q31_len32; - break; - case 64: - S = &arm_cfft_sR_q31_len64; - break; - case 128: - S = &arm_cfft_sR_q31_len128; - break; - case 256: - S = &arm_cfft_sR_q31_len256; - break; - case 512: - S = &arm_cfft_sR_q31_len512; - break; - case 1024: - S = &arm_cfft_sR_q31_len1024; - break; - case 2048: - S = &arm_cfft_sR_q31_len2048; - break; - case 4096: - S = &arm_cfft_sR_q31_len4096; - break; - } - @endcode - - */ - - /** @addtogroup ComplexFFT @{ @@ -855,7 +639,7 @@ void arm_cfft_f16( pSrc = p1 + 1; for(l=0; lpTwiddle); break; - + } if ( bitReverseFlag ) @@ -885,13 +669,13 @@ void arm_cfft_f16( if (ifftFlag == 1U) { - invL = 1.0f/(float16_t)L; + invL = 1.0f16/(_Float16)L; /* Conjugate and scale output data */ pSrc = p1; for(l=0; l 0U) { - bitRevTabOff = vldrhq_u32(pBitRevTab); - pBitRevTab += 4; + case 1024U: + retValue = 0.0009765625f; + break; - uint64x2_t bitRevOff1 = vmullbq_int_u32(bitRevTabOff, one); - uint64x2_t bitRevOff2 = vmulltq_int_u32(bitRevTabOff, one); + case 512U: + retValue = 0.001953125; + break; - uint64x2_t in1 = vldrdq_gather_offset_u64(src, bitRevOff1); - uint64x2_t in2 = vldrdq_gather_offset_u64(src, bitRevOff2); + case 256U: + retValue = 0.00390625f; + break; - vstrdq_scatter_offset_u64(src, bitRevOff1, in2); - vstrdq_scatter_offset_u64(src, bitRevOff2, in1); + case 128U: + retValue = 0.0078125; + break; - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } + case 64U: + retValue = 0.015625f; + break; + + case 32U: + retValue = 0.03125; + break; + + case 16U: + retValue = 0.0625f; + break; + + + default: + break; + } + return(retValue); } + + static void _arm_radix4_butterfly_f32_mve(const arm_cfft_instance_f32 * S,float32_t * pSrc, uint32_t fftLen) { - f32x4_t vecTmp0, vecTmp1; - f32x4_t vecSum0, vecDiff0, vecSum1, vecDiff1; - f32x4_t vecA, vecB, vecC, vecD; - uint32_t blkCnt; - uint32_t n1, n2; - uint32_t stage = 0; - int32_t iter = 1; - static const uint32_t strides[4] = { - (0 - 16) * sizeof(q31_t *), - (1 - 16) * sizeof(q31_t *), - (8 - 16) * sizeof(q31_t *), - (9 - 16) * sizeof(q31_t *) + f32x4_t vecTmp0, vecTmp1; + f32x4_t vecSum0, vecDiff0, vecSum1, vecDiff1; + f32x4_t vecA, vecB, vecC, vecD; + uint32_t blkCnt; + uint32_t n1, n2; + uint32_t stage = 0; + int32_t iter = 1; + static const int32_t strides[4] = { + (0 - 16) * (int32_t)sizeof(q31_t *), + (1 - 16) * (int32_t)sizeof(q31_t *), + (8 - 16) * (int32_t)sizeof(q31_t *), + (9 - 16) * (int32_t)sizeof(q31_t *) }; n2 = fftLen; @@ -143,29 +112,28 @@ static void _arm_radix4_butterfly_f32_mve(const arm_cfft_instance_f32 * S,float3 n2 >>= 2u; for (int k = fftLen / 4u; k > 1; k >>= 2) { + float32_t const *p_rearranged_twiddle_tab_stride1 = + &S->rearranged_twiddle_stride1[ + S->rearranged_twiddle_tab_stride1_arr[stage]]; + float32_t const *p_rearranged_twiddle_tab_stride2 = + &S->rearranged_twiddle_stride2[ + S->rearranged_twiddle_tab_stride2_arr[stage]]; + float32_t const *p_rearranged_twiddle_tab_stride3 = + &S->rearranged_twiddle_stride3[ + S->rearranged_twiddle_tab_stride3_arr[stage]]; + + float32_t * pBase = pSrc; for (int i = 0; i < iter; i++) { - float32_t const *p_rearranged_twiddle_tab_stride1 = - &S->rearranged_twiddle_stride1[ - S->rearranged_twiddle_tab_stride1_arr[stage]]; - float32_t const *p_rearranged_twiddle_tab_stride2 = - &S->rearranged_twiddle_stride2[ - S->rearranged_twiddle_tab_stride2_arr[stage]]; - float32_t const *p_rearranged_twiddle_tab_stride3 = - &S->rearranged_twiddle_stride3[ - S->rearranged_twiddle_tab_stride3_arr[stage]]; - float32_t const *pW1, *pW2, *pW3; - float32_t *inA = pSrc + CMPLX_DIM * i * n1; - float32_t *inB = inA + n2 * CMPLX_DIM; - float32_t *inC = inB + n2 * CMPLX_DIM; - float32_t *inD = inC + n2 * CMPLX_DIM; + float32_t *inA = pBase; + float32_t *inB = inA + n2 * CMPLX_DIM; + float32_t *inC = inB + n2 * CMPLX_DIM; + float32_t *inD = inC + n2 * CMPLX_DIM; + float32_t const *pW1 = p_rearranged_twiddle_tab_stride1; + float32_t const *pW2 = p_rearranged_twiddle_tab_stride2; + float32_t const *pW3 = p_rearranged_twiddle_tab_stride3; f32x4_t vecW; - - pW1 = p_rearranged_twiddle_tab_stride1; - pW2 = p_rearranged_twiddle_tab_stride2; - pW3 = p_rearranged_twiddle_tab_stride3; - blkCnt = n2 / 2; /* * load 2 f32 complex pair @@ -233,6 +201,7 @@ static void _arm_radix4_butterfly_f32_mve(const arm_cfft_instance_f32 * S,float3 blkCnt--; } + pBase += CMPLX_DIM * n1; } n1 = n2; n2 >>= 2u; @@ -243,7 +212,7 @@ static void _arm_radix4_butterfly_f32_mve(const arm_cfft_instance_f32 * S,float3 /* * start of Last stage process */ - uint32x4_t vecScGathAddr = *(uint32x4_t *) strides; + uint32x4_t vecScGathAddr = vld1q_u32((uint32_t*)strides); vecScGathAddr = vecScGathAddr + (uint32_t) pSrc; /* load scheduling */ @@ -335,16 +304,15 @@ static void _arm_radix4_butterfly_inverse_f32_mve(const arm_cfft_instance_f32 * f32x4_t vecTmp0, vecTmp1; f32x4_t vecSum0, vecDiff0, vecSum1, vecDiff1; f32x4_t vecA, vecB, vecC, vecD; - f32x4_t vecW; uint32_t blkCnt; uint32_t n1, n2; uint32_t stage = 0; int32_t iter = 1; - static const uint32_t strides[4] = { - (0 - 16) * sizeof(q31_t *), - (1 - 16) * sizeof(q31_t *), - (8 - 16) * sizeof(q31_t *), - (9 - 16) * sizeof(q31_t *) + static const int32_t strides[4] = { + (0 - 16) * (int32_t)sizeof(q31_t *), + (1 - 16) * (int32_t)sizeof(q31_t *), + (8 - 16) * (int32_t)sizeof(q31_t *), + (9 - 16) * (int32_t)sizeof(q31_t *) }; n2 = fftLen; @@ -352,26 +320,27 @@ static void _arm_radix4_butterfly_inverse_f32_mve(const arm_cfft_instance_f32 * n2 >>= 2u; for (int k = fftLen / 4; k > 1; k >>= 2) { + float32_t const *p_rearranged_twiddle_tab_stride1 = + &S->rearranged_twiddle_stride1[ + S->rearranged_twiddle_tab_stride1_arr[stage]]; + float32_t const *p_rearranged_twiddle_tab_stride2 = + &S->rearranged_twiddle_stride2[ + S->rearranged_twiddle_tab_stride2_arr[stage]]; + float32_t const *p_rearranged_twiddle_tab_stride3 = + &S->rearranged_twiddle_stride3[ + S->rearranged_twiddle_tab_stride3_arr[stage]]; + + float32_t * pBase = pSrc; for (int i = 0; i < iter; i++) { - float32_t const *p_rearranged_twiddle_tab_stride1 = - &S->rearranged_twiddle_stride1[ - S->rearranged_twiddle_tab_stride1_arr[stage]]; - float32_t const *p_rearranged_twiddle_tab_stride2 = - &S->rearranged_twiddle_stride2[ - S->rearranged_twiddle_tab_stride2_arr[stage]]; - float32_t const *p_rearranged_twiddle_tab_stride3 = - &S->rearranged_twiddle_stride3[ - S->rearranged_twiddle_tab_stride3_arr[stage]]; - float32_t const *pW1, *pW2, *pW3; - float32_t *inA = pSrc + CMPLX_DIM * i * n1; - float32_t *inB = inA + n2 * CMPLX_DIM; - float32_t *inC = inB + n2 * CMPLX_DIM; - float32_t *inD = inC + n2 * CMPLX_DIM; - - pW1 = p_rearranged_twiddle_tab_stride1; - pW2 = p_rearranged_twiddle_tab_stride2; - pW3 = p_rearranged_twiddle_tab_stride3; + float32_t *inA = pBase; + float32_t *inB = inA + n2 * CMPLX_DIM; + float32_t *inC = inB + n2 * CMPLX_DIM; + float32_t *inD = inC + n2 * CMPLX_DIM; + float32_t const *pW1 = p_rearranged_twiddle_tab_stride1; + float32_t const *pW2 = p_rearranged_twiddle_tab_stride2; + float32_t const *pW3 = p_rearranged_twiddle_tab_stride3; + f32x4_t vecW; blkCnt = n2 / 2; /* @@ -439,6 +408,7 @@ static void _arm_radix4_butterfly_inverse_f32_mve(const arm_cfft_instance_f32 * blkCnt--; } + pBase += CMPLX_DIM * n1; } n1 = n2; n2 >>= 2u; @@ -449,7 +419,7 @@ static void _arm_radix4_butterfly_inverse_f32_mve(const arm_cfft_instance_f32 * /* * start of Last stage process */ - uint32x4_t vecScGathAddr = *(uint32x4_t *) strides; + uint32x4_t vecScGathAddr = vld1q_u32 ((uint32_t*)strides); vecScGathAddr = vecScGathAddr + (uint32_t) pSrc; /* @@ -565,53 +535,53 @@ void arm_cfft_f32( float32_t * pSrc, uint8_t ifftFlag, uint8_t bitReverseFlag) -{ - uint32_t fftLen = S->fftLen; - - if (ifftFlag == 1U) { - - switch (fftLen) { - case 16: - case 64: - case 256: - case 1024: - case 4096: - _arm_radix4_butterfly_inverse_f32_mve(S, pSrc, fftLen, arm_inverse_fft_length_f32(S->fftLen)); - break; - - case 32: - case 128: - case 512: - case 2048: - arm_cfft_radix4by2_inverse_f32_mve(S, pSrc, fftLen); - break; - } - } else { - switch (fftLen) { - case 16: - case 64: - case 256: - case 1024: - case 4096: - _arm_radix4_butterfly_f32_mve(S, pSrc, fftLen); - break; - - case 32: - case 128: - case 512: - case 2048: - arm_cfft_radix4by2_f32_mve(S, pSrc, fftLen); - break; - } - } - - - if (bitReverseFlag) - { - - arm_bitreversal_f32_inpl_mve((uint32_t*)pSrc, S->bitRevLength, S->pBitRevTable); - - } +{ + uint32_t fftLen = S->fftLen; + + if (ifftFlag == 1U) { + + switch (fftLen) { + case 16: + case 64: + case 256: + case 1024: + case 4096: + _arm_radix4_butterfly_inverse_f32_mve(S, pSrc, fftLen, arm_inverse_fft_length_f32(S->fftLen)); + break; + + case 32: + case 128: + case 512: + case 2048: + arm_cfft_radix4by2_inverse_f32_mve(S, pSrc, fftLen); + break; + } + } else { + switch (fftLen) { + case 16: + case 64: + case 256: + case 1024: + case 4096: + _arm_radix4_butterfly_f32_mve(S, pSrc, fftLen); + break; + + case 32: + case 128: + case 512: + case 2048: + arm_cfft_radix4by2_f32_mve(S, pSrc, fftLen); + break; + } + } + + + if (bitReverseFlag) + { + + arm_bitreversal_32_inpl_mve((uint32_t*)pSrc, S->bitRevLength, S->pBitRevTable); + + } } @@ -633,7 +603,7 @@ extern void arm_bitreversal_32( /** @defgroup ComplexFFT Complex FFT Functions - + @par The Fast Fourier Transform (FFT) is an efficient algorithm for computing the Discrete Fourier Transform (DFT). The FFT can be orders of magnitude faster @@ -651,7 +621,7 @@ extern void arm_bitreversal_32(
{real[0], imag[0], real[1], imag[1], ...} 
The FFT result will be contained in the same array and the frequency domain values will have the same interleaving. - + @par Floating-point The floating-point complex FFT uses a mixed-radix algorithm. Multiple radix-8 stages are performed along with a single radix-2 or radix-4 stage, as needed. @@ -663,12 +633,12 @@ extern void arm_bitreversal_32( inverse transform includes a scale of 1/fftLen as part of the calculation and this matches the textbook definition of the inverse FFT. @par - For the MVE version, the new arm_cfft_init_f32 initialization function is + For the MVE version, the new arm_cfft_init_f32 initialization function is mandatory. Compilation flags are available to include only the required tables for the - needed FFTs. Other FFT versions can continue to be initialized as + needed FFTs. Other FFT versions can continue to be initialized as explained below. @par - For not MVE versions, pre-initialized data structures containing twiddle factors + For not MVE versions, pre-initialized data structures containing twiddle factors and bit reversal tables are provided and defined in arm_const_structs.h. Include this header in your function and then pass one of the constant structures as an argument to arm_cfft_f32. For example: @@ -689,36 +659,37 @@ extern void arm_bitreversal_32( @code const static arm_cfft_instance_f32 *S; ... - switch (length) { - case 16: - S = &arm_cfft_sR_f32_len16; - break; - case 32: - S = &arm_cfft_sR_f32_len32; - break; - case 64: - S = &arm_cfft_sR_f32_len64; - break; - case 128: - S = &arm_cfft_sR_f32_len128; - break; - case 256: - S = &arm_cfft_sR_f32_len256; - break; - case 512: - S = &arm_cfft_sR_f32_len512; - break; - case 1024: - S = &arm_cfft_sR_f32_len1024; - break; - case 2048: - S = &arm_cfft_sR_f32_len2048; - break; - case 4096: - S = &arm_cfft_sR_f32_len4096; - break; - } + switch (length) { + case 16: + S = &arm_cfft_sR_f32_len16; + break; + case 32: + S = &arm_cfft_sR_f32_len32; + break; + case 64: + S = &arm_cfft_sR_f32_len64; + break; + case 128: + S = &arm_cfft_sR_f32_len128; + break; + case 256: + S = &arm_cfft_sR_f32_len256; + break; + case 512: + S = &arm_cfft_sR_f32_len512; + break; + case 1024: + S = &arm_cfft_sR_f32_len1024; + break; + case 2048: + S = &arm_cfft_sR_f32_len2048; + break; + case 4096: + S = &arm_cfft_sR_f32_len4096; + break; + } @endcode + @par The new arm_cfft_init_f32 can also be used. @par Q15 and Q31 @@ -783,7 +754,7 @@ extern void arm_bitreversal_32( break; } @endcode - + */ void arm_cfft_radix8by2_f32 (arm_cfft_instance_f32 * S, float32_t * p1) diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_f64.c index 3f5a91b..83b2cd3 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_f64.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_f64.c @@ -5,13 +5,13 @@ * Title: arm_cfft_f64.c * Description: Combined Radix Decimation in Frequency CFFT Double Precision Floating point processing function * - * $Date: 29. November 2019 - * $Revision: V1.0.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -43,10 +43,6 @@ extern void arm_bitreversal_64( const uint16_t bitRevLen, const uint16_t * pBitRevTable); -/** -* @} end of ComplexFFT group -*/ - /* ---------------------------------------------------------------------- * Internal helper function used by the FFTs * ---------------------------------------------------------------------- */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_f16.c index 7dfaf62..ac8260a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_f16.c @@ -5,13 +5,13 @@ * Title: arm_cfft_init_f16.c * Description: Initialization function for cfft f16 instance * - * $Date: 07. January 2020 - * $Revision: V1.7.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_f32.c index 98db754..b82f5ce 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_cfft_init_f32.c * Description: Initialization function for cfft f32 instance * - * $Date: 07. January 2020 - * $Revision: V1.7.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_f64.c index 05e691a..cb2dae8 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_f64.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_f64.c @@ -5,13 +5,13 @@ * Title: arm_cfft_init_f64.c * Description: Initialization function for cfft f64 instance * - * $Date: 23. January 2020 - * $Revision: V1.7.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -72,7 +72,7 @@ arm_status arm_cfft_init_f64( /* Initializations of Instance structure depending on the FFT length */ switch (S->fftLen) { -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_f64_4096) && defined(ARM_TABLE_BITREVIDX_FLT_4096)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F64_4096) && defined(ARM_TABLE_BITREVIDX_FLT_4096)) /* Initializations of structure parameters for 4096 point FFT */ case 4096U: /* Initialise the bit reversal table modifier */ @@ -80,7 +80,7 @@ arm_status arm_cfft_init_f64( break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_f64_2048) && defined(ARM_TABLE_BITREVIDX_FLT_2048)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F64_2048) && defined(ARM_TABLE_BITREVIDX_FLT_2048)) /* Initializations of structure parameters for 2048 point FFT */ case 2048U: /* Initialise the bit reversal table modifier */ @@ -89,7 +89,7 @@ arm_status arm_cfft_init_f64( break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_f64_1024) && defined(ARM_TABLE_BITREVIDX_FLT_1024)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F64_1024) && defined(ARM_TABLE_BITREVIDX_FLT_1024)) /* Initializations of structure parameters for 1024 point FFT */ case 1024U: /* Initialise the bit reversal table modifier */ @@ -98,7 +98,7 @@ arm_status arm_cfft_init_f64( break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_f64_512) && defined(ARM_TABLE_BITREVIDX_FLT_512)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F64_512) && defined(ARM_TABLE_BITREVIDX_FLT_512)) /* Initializations of structure parameters for 512 point FFT */ case 512U: /* Initialise the bit reversal table modifier */ @@ -106,31 +106,31 @@ arm_status arm_cfft_init_f64( break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_f64_256) && defined(ARM_TABLE_BITREVIDX_FLT_256)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F64_256) && defined(ARM_TABLE_BITREVIDX_FLT_256)) case 256U: FFTINIT(f64,256); break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_f64_128) && defined(ARM_TABLE_BITREVIDX_FLT_128)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F64_128) && defined(ARM_TABLE_BITREVIDX_FLT_128)) case 128U: FFTINIT(f64,128); break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_f64_64) && defined(ARM_TABLE_BITREVIDX_FLT_64)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F64_64) && defined(ARM_TABLE_BITREVIDX_FLT_64)) case 64U: FFTINIT(f64,64); break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_f64_32) && defined(ARM_TABLE_BITREVIDX_FLT_32)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F64_32) && defined(ARM_TABLE_BITREVIDX_FLT_32)) case 32U: FFTINIT(f64,32); break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_f64_16) && defined(ARM_TABLE_BITREVIDX_FLT_16)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F64_16) && defined(ARM_TABLE_BITREVIDX_FLT_16)) case 16U: /* Initializations of structure parameters for 16 point FFT */ FFTINIT(f64,16); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_q15.c index d08b97e..a0f6356 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_q15.c @@ -5,13 +5,13 @@ * Title: arm_cfft_init_q15.c * Description: Initialization function for cfft q15 instance * - * $Date: 07. January 2020 - * $Revision: V1.7.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_q31.c index 8b9c970..0877d2c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_cfft_init_q31.c * Description: Initialization function for cfft q31 instance * - * $Date: 07. January 2020 - * $Revision: V1.7.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_q15.c index 1bebc2b..83ca024 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_q15.c @@ -5,13 +5,13 @@ * Title: arm_cfft_q15.c * Description: Combined Radix Decimation in Q15 Frequency CFFT processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -35,65 +35,6 @@ #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_fft.h" -static void arm_bitreversal_16_inpl_mve( - uint16_t *pSrc, - const uint16_t bitRevLen, - const uint16_t *pBitRevTab) - -{ - uint32_t *src = (uint32_t *)pSrc; - uint32_t blkCnt; /* loop counters */ - uint32x4_t bitRevTabOff; - uint16x8_t one = vdupq_n_u16(1); - - blkCnt = (bitRevLen / 2) / 4; - while (blkCnt > 0U) { - bitRevTabOff = vldrhq_u16(pBitRevTab); - pBitRevTab += 8; - - uint32x4_t bitRevOff1 = vmullbq_int_u16(bitRevTabOff, one); - uint32x4_t bitRevOff2 = vmulltq_int_u16(bitRevTabOff, one); - - bitRevOff1 = bitRevOff1 >> 3; - bitRevOff2 = bitRevOff2 >> 3; - - uint32x4_t in1 = vldrwq_gather_shifted_offset_u32(src, bitRevOff1); - uint32x4_t in2 = vldrwq_gather_shifted_offset_u32(src, bitRevOff2); - - vstrwq_scatter_shifted_offset_u32(src, bitRevOff1, in2); - vstrwq_scatter_shifted_offset_u32(src, bitRevOff2, in1); - - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } - - - /* - * tail - * (will be merged thru tail predication) - */ - blkCnt = bitRevLen & 7; - if (blkCnt > 0U) { - mve_pred16_t p0 = vctp16q(blkCnt); - - bitRevTabOff = vldrhq_z_u16(pBitRevTab, p0); - - uint32x4_t bitRevOff1 = vmullbq_int_u16(bitRevTabOff, one); - uint32x4_t bitRevOff2 = vmulltq_int_u16(bitRevTabOff, one); - - bitRevOff1 = bitRevOff1 >> 3; - bitRevOff2 = bitRevOff2 >> 3; - - uint32x4_t in1 = vldrwq_gather_shifted_offset_z_u32(src, bitRevOff1, p0); - uint32x4_t in2 = vldrwq_gather_shifted_offset_z_u32(src, bitRevOff2, p0); - - vstrwq_scatter_shifted_offset_p_u32(src, bitRevOff1, in2, p0); - vstrwq_scatter_shifted_offset_p_u32(src, bitRevOff2, in1, p0); - } -} - static void _arm_radix4_butterfly_q15_mve( const arm_cfft_instance_q15 * S, q15_t *pSrc, @@ -102,14 +43,13 @@ static void _arm_radix4_butterfly_q15_mve( q15x8_t vecTmp0, vecTmp1; q15x8_t vecSum0, vecDiff0, vecSum1, vecDiff1; q15x8_t vecA, vecB, vecC, vecD; - q15x8_t vecW; uint32_t blkCnt; uint32_t n1, n2; uint32_t stage = 0; int32_t iter = 1; - static const uint32_t strides[4] = { - (0 - 16) * sizeof(q15_t *), (4 - 16) * sizeof(q15_t *), - (8 - 16) * sizeof(q15_t *), (12 - 16) * sizeof(q15_t *) + static const int32_t strides[4] = { + (0 - 16) * (int32_t)sizeof(q15_t *), (4 - 16) * (int32_t)sizeof(q15_t *), + (8 - 16) * (int32_t)sizeof(q15_t *), (12 - 16) * (int32_t)sizeof(q15_t *) }; /* @@ -122,25 +62,26 @@ static void _arm_radix4_butterfly_q15_mve( for (int k = fftLen / 4u; k > 1; k >>= 2u) { + q15_t const *p_rearranged_twiddle_tab_stride2 = + &S->rearranged_twiddle_stride2[ + S->rearranged_twiddle_tab_stride2_arr[stage]]; + q15_t const *p_rearranged_twiddle_tab_stride3 = &S->rearranged_twiddle_stride3[ + S->rearranged_twiddle_tab_stride3_arr[stage]]; + q15_t const *p_rearranged_twiddle_tab_stride1 = + &S->rearranged_twiddle_stride1[ + S->rearranged_twiddle_tab_stride1_arr[stage]]; + + q15_t * pBase = pSrc; for (int i = 0; i < iter; i++) { - q15_t const *p_rearranged_twiddle_tab_stride2 = - &S->rearranged_twiddle_stride2[ - S->rearranged_twiddle_tab_stride2_arr[stage]]; - q15_t const *p_rearranged_twiddle_tab_stride3 = &S->rearranged_twiddle_stride3[ - S->rearranged_twiddle_tab_stride3_arr[stage]]; - q15_t const *p_rearranged_twiddle_tab_stride1 = - &S->rearranged_twiddle_stride1[ - S->rearranged_twiddle_tab_stride1_arr[stage]]; - q15_t const *pW1, *pW2, *pW3; - q15_t *inA = pSrc + CMPLX_DIM * i * n1; + q15_t *inA = pBase; q15_t *inB = inA + n2 * CMPLX_DIM; q15_t *inC = inB + n2 * CMPLX_DIM; q15_t *inD = inC + n2 * CMPLX_DIM; - - pW1 = p_rearranged_twiddle_tab_stride1; - pW2 = p_rearranged_twiddle_tab_stride2; - pW3 = p_rearranged_twiddle_tab_stride3; + q15_t const *pW1 = p_rearranged_twiddle_tab_stride1; + q15_t const *pW2 = p_rearranged_twiddle_tab_stride2; + q15_t const *pW3 = p_rearranged_twiddle_tab_stride3; + q15x8_t vecW; blkCnt = n2 / 4; /* @@ -173,7 +114,7 @@ static void _arm_radix4_butterfly_q15_mve( */ vecW = vld1q(pW2); pW2 += 8; - vecTmp1 = MVE_CMPLX_MULT_FX_AxB(vecW, vecTmp0); + vecTmp1 = MVE_CMPLX_MULT_FX_AxB(vecW, vecTmp0, q15x8_t); vst1q(inB, vecTmp1); inB += 8; @@ -186,7 +127,7 @@ static void _arm_radix4_butterfly_q15_mve( */ vecW = vld1q(pW1); pW1 += 8; - vecTmp1 = MVE_CMPLX_MULT_FX_AxB(vecW, vecTmp0); + vecTmp1 = MVE_CMPLX_MULT_FX_AxB(vecW, vecTmp0, q15x8_t); vst1q(inC, vecTmp1); inC += 8; @@ -199,7 +140,7 @@ static void _arm_radix4_butterfly_q15_mve( */ vecW = vld1q(pW3); pW3 += 8; - vecTmp1 = MVE_CMPLX_MULT_FX_AxB(vecW, vecTmp0); + vecTmp1 = MVE_CMPLX_MULT_FX_AxB(vecW, vecTmp0, q15x8_t); vst1q(inD, vecTmp1); inD += 8; @@ -208,6 +149,7 @@ static void _arm_radix4_butterfly_q15_mve( blkCnt--; } + pBase += CMPLX_DIM * n1; } n1 = n2; n2 >>= 2u; @@ -218,7 +160,7 @@ static void _arm_radix4_butterfly_q15_mve( /* * start of Last stage process */ - uint32x4_t vecScGathAddr = *(uint32x4_t *) strides; + uint32x4_t vecScGathAddr = vld1q_u32 ((uint32_t*)strides); vecScGathAddr = vecScGathAddr + (uint32_t) pSrc; /* @@ -245,16 +187,16 @@ static void _arm_radix4_butterfly_q15_mve( vecC = (q15x8_t) vldrwq_gather_base_s32(vecScGathAddr, 8); vecTmp0 = vhaddq(vecSum0, vecSum1); - vstrwq_scatter_base_s32(vecScGathAddr, -64, (q15x8_t) vecTmp0); + vstrwq_scatter_base_s32(vecScGathAddr, -64, (int32x4_t) vecTmp0); vecTmp0 = vhsubq(vecSum0, vecSum1); - vstrwq_scatter_base_s32(vecScGathAddr, -64 + 4, (q15x8_t) vecTmp0); + vstrwq_scatter_base_s32(vecScGathAddr, -64 + 4, (int32x4_t) vecTmp0); vecTmp0 = MVE_CMPLX_SUB_FX_A_ixB(vecDiff0, vecDiff1); - vstrwq_scatter_base_s32(vecScGathAddr, -64 + 8, (q15x8_t) vecTmp0); + vstrwq_scatter_base_s32(vecScGathAddr, -64 + 8, (int32x4_t) vecTmp0); vecTmp0 = MVE_CMPLX_ADD_FX_A_ixB(vecDiff0, vecDiff1); - vstrwq_scatter_base_s32(vecScGathAddr, -64 + 12, (q15x8_t) vecTmp0); + vstrwq_scatter_base_s32(vecScGathAddr, -64 + 12, (int32x4_t) vecTmp0); blkCnt--; } @@ -295,7 +237,7 @@ static void arm_cfft_radix4by2_q15_mve(const arm_cfft_instance_q15 *S, q15_t *pS pCoefVec += 8; vecDiff = vhsubq(vecIn0, vecIn1); - vecCmplxTmp = MVE_CMPLX_MULT_FX_AxConjB(vecDiff, vecTw); + vecCmplxTmp = MVE_CMPLX_MULT_FX_AxConjB(vecDiff, vecTw, q15x8_t); vst1q(pIn1, vecCmplxTmp); pIn1 += 8; @@ -337,14 +279,13 @@ static void _arm_radix4_butterfly_inverse_q15_mve(const arm_cfft_instance_q15 *S q15x8_t vecTmp0, vecTmp1; q15x8_t vecSum0, vecDiff0, vecSum1, vecDiff1; q15x8_t vecA, vecB, vecC, vecD; - q15x8_t vecW; uint32_t blkCnt; uint32_t n1, n2; uint32_t stage = 0; int32_t iter = 1; - static const uint32_t strides[4] = { - (0 - 16) * sizeof(q15_t *), (4 - 16) * sizeof(q15_t *), - (8 - 16) * sizeof(q15_t *), (12 - 16) * sizeof(q15_t *) + static const int32_t strides[4] = { + (0 - 16) * (int32_t)sizeof(q15_t *), (4 - 16) * (int32_t)sizeof(q15_t *), + (8 - 16) * (int32_t)sizeof(q15_t *), (12 - 16) * (int32_t)sizeof(q15_t *) }; @@ -358,25 +299,27 @@ static void _arm_radix4_butterfly_inverse_q15_mve(const arm_cfft_instance_q15 *S for (int k = fftLen / 4u; k > 1; k >>= 2u) { + q15_t const *p_rearranged_twiddle_tab_stride2 = + &S->rearranged_twiddle_stride2[ + S->rearranged_twiddle_tab_stride2_arr[stage]]; + q15_t const *p_rearranged_twiddle_tab_stride3 = &S->rearranged_twiddle_stride3[ + S->rearranged_twiddle_tab_stride3_arr[stage]]; + q15_t const *p_rearranged_twiddle_tab_stride1 = + &S->rearranged_twiddle_stride1[ + S->rearranged_twiddle_tab_stride1_arr[stage]]; + + q15_t * pBase = pSrc; for (int i = 0; i < iter; i++) { - q15_t const *p_rearranged_twiddle_tab_stride2 = - &S->rearranged_twiddle_stride2[ - S->rearranged_twiddle_tab_stride2_arr[stage]]; - q15_t const *p_rearranged_twiddle_tab_stride3 = &S->rearranged_twiddle_stride3[ - S->rearranged_twiddle_tab_stride3_arr[stage]]; - q15_t const *p_rearranged_twiddle_tab_stride1 = - &S->rearranged_twiddle_stride1[ - S->rearranged_twiddle_tab_stride1_arr[stage]]; - q15_t const *pW1, *pW2, *pW3; - q15_t *inA = pSrc + CMPLX_DIM * i * n1; + q15_t *inA = pBase; q15_t *inB = inA + n2 * CMPLX_DIM; q15_t *inC = inB + n2 * CMPLX_DIM; q15_t *inD = inC + n2 * CMPLX_DIM; + q15_t const *pW1 = p_rearranged_twiddle_tab_stride1; + q15_t const *pW2 = p_rearranged_twiddle_tab_stride2; + q15_t const *pW3 = p_rearranged_twiddle_tab_stride3; + q15x8_t vecW; - pW1 = p_rearranged_twiddle_tab_stride1; - pW2 = p_rearranged_twiddle_tab_stride2; - pW3 = p_rearranged_twiddle_tab_stride3; blkCnt = n2 / 4; /* @@ -409,7 +352,7 @@ static void _arm_radix4_butterfly_inverse_q15_mve(const arm_cfft_instance_q15 *S */ vecW = vld1q(pW2); pW2 += 8; - vecTmp1 = MVE_CMPLX_MULT_FX_AxConjB(vecTmp0, vecW); + vecTmp1 = MVE_CMPLX_MULT_FX_AxConjB(vecTmp0, vecW, q15x8_t); vst1q(inB, vecTmp1); inB += 8; @@ -422,7 +365,7 @@ static void _arm_radix4_butterfly_inverse_q15_mve(const arm_cfft_instance_q15 *S */ vecW = vld1q(pW1); pW1 += 8; - vecTmp1 = MVE_CMPLX_MULT_FX_AxConjB(vecTmp0, vecW); + vecTmp1 = MVE_CMPLX_MULT_FX_AxConjB(vecTmp0, vecW, q15x8_t); vst1q(inC, vecTmp1); inC += 8; /* @@ -434,7 +377,7 @@ static void _arm_radix4_butterfly_inverse_q15_mve(const arm_cfft_instance_q15 *S */ vecW = vld1q(pW3); pW3 += 8; - vecTmp1 = MVE_CMPLX_MULT_FX_AxConjB(vecTmp0, vecW); + vecTmp1 = MVE_CMPLX_MULT_FX_AxConjB(vecTmp0, vecW, q15x8_t); vst1q(inD, vecTmp1); inD += 8; @@ -443,6 +386,7 @@ static void _arm_radix4_butterfly_inverse_q15_mve(const arm_cfft_instance_q15 *S blkCnt--; } + pBase += CMPLX_DIM * n1; } n1 = n2; n2 >>= 2u; @@ -453,7 +397,7 @@ static void _arm_radix4_butterfly_inverse_q15_mve(const arm_cfft_instance_q15 *S /* * start of Last stage process */ - uint32x4_t vecScGathAddr = *(uint32x4_t *) strides; + uint32x4_t vecScGathAddr = vld1q_u32((uint32_t*)strides); vecScGathAddr = vecScGathAddr + (uint32_t) pSrc; /* @@ -480,16 +424,16 @@ static void _arm_radix4_butterfly_inverse_q15_mve(const arm_cfft_instance_q15 *S vecC = (q15x8_t) vldrwq_gather_base_s32(vecScGathAddr, 8); vecTmp0 = vhaddq(vecSum0, vecSum1); - vstrwq_scatter_base_s32(vecScGathAddr, -64, (q15x8_t) vecTmp0); + vstrwq_scatter_base_s32(vecScGathAddr, -64, (int32x4_t) vecTmp0); vecTmp0 = vhsubq(vecSum0, vecSum1); - vstrwq_scatter_base_s32(vecScGathAddr, -64 + 4, (q15x8_t) vecTmp0); + vstrwq_scatter_base_s32(vecScGathAddr, -64 + 4, (int32x4_t) vecTmp0); vecTmp0 = MVE_CMPLX_ADD_FX_A_ixB(vecDiff0, vecDiff1); - vstrwq_scatter_base_s32(vecScGathAddr, -64 + 8, (q15x8_t) vecTmp0); + vstrwq_scatter_base_s32(vecScGathAddr, -64 + 8, (int32x4_t) vecTmp0); vecTmp0 = MVE_CMPLX_SUB_FX_A_ixB(vecDiff0, vecDiff1); - vstrwq_scatter_base_s32(vecScGathAddr, -64 + 12, (q15x8_t) vecTmp0); + vstrwq_scatter_base_s32(vecScGathAddr, -64 + 12, (int32x4_t) vecTmp0); blkCnt--; } @@ -594,53 +538,53 @@ void arm_cfft_q15( q15_t * pSrc, uint8_t ifftFlag, uint8_t bitReverseFlag) -{ - uint32_t fftLen = S->fftLen; - - if (ifftFlag == 1U) { - - switch (fftLen) { - case 16: - case 64: - case 256: - case 1024: - case 4096: - _arm_radix4_butterfly_inverse_q15_mve(S, pSrc, fftLen); - break; - - case 32: - case 128: - case 512: - case 2048: - arm_cfft_radix4by2_inverse_q15_mve(S, pSrc, fftLen); - break; - } - } else { - switch (fftLen) { - case 16: - case 64: - case 256: - case 1024: - case 4096: - _arm_radix4_butterfly_q15_mve(S, pSrc, fftLen); - break; - - case 32: - case 128: - case 512: - case 2048: - arm_cfft_radix4by2_q15_mve(S, pSrc, fftLen); - break; - } - } - - - if (bitReverseFlag) - { - +{ + uint32_t fftLen = S->fftLen; + + if (ifftFlag == 1U) { + + switch (fftLen) { + case 16: + case 64: + case 256: + case 1024: + case 4096: + _arm_radix4_butterfly_inverse_q15_mve(S, pSrc, fftLen); + break; + + case 32: + case 128: + case 512: + case 2048: + arm_cfft_radix4by2_inverse_q15_mve(S, pSrc, fftLen); + break; + } + } else { + switch (fftLen) { + case 16: + case 64: + case 256: + case 1024: + case 4096: + _arm_radix4_butterfly_q15_mve(S, pSrc, fftLen); + break; + + case 32: + case 128: + case 512: + case 2048: + arm_cfft_radix4by2_q15_mve(S, pSrc, fftLen); + break; + } + } + + + if (bitReverseFlag) + { + arm_bitreversal_16_inpl_mve((uint16_t*)pSrc, S->bitRevLength, S->pBitRevTable); - - } + + } } #else @@ -776,7 +720,7 @@ void arm_cfft_radix4by2_q15( for (i = n2; i > 0; i--) { - coeff = read_q15x2_ia ((q15_t **) &pC); + coeff = read_q15x2_ia (&pC); T = read_q15x2 (pSi); T = __SHADD16(T, 0); /* this is just a SIMD arithmetic shift right by 1 */ @@ -875,7 +819,7 @@ void arm_cfft_radix4by2_inverse_q15( for (i = n2; i > 0; i--) { - coeff = read_q15x2_ia ((q15_t **) &pC); + coeff = read_q15x2_ia (&pC); T = read_q15x2 (pSi); T = __SHADD16(T, 0); /* this is just a SIMD arithmetic shift right by 1 */ diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_q31.c index d0fb253..373e8a7 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_q31.c @@ -5,13 +5,13 @@ * Title: arm_cfft_q31.c * Description: Combined Radix Decimation in Frequency CFFT fixed point processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -36,37 +36,6 @@ #include "edge-impulse-sdk/CMSIS/DSP/Include/arm_vec_fft.h" -static void arm_bitreversal_32_inpl_mve( - uint32_t *pSrc, - const uint16_t bitRevLen, - const uint16_t *pBitRevTab) - -{ - uint64_t *src = (uint64_t *) pSrc; - uint32_t blkCnt; /* loop counters */ - uint32x4_t bitRevTabOff; - uint32x4_t one = vdupq_n_u32(1); - - blkCnt = (bitRevLen / 2) / 2; - while (blkCnt > 0U) { - bitRevTabOff = vldrhq_u32(pBitRevTab); - pBitRevTab += 4; - - uint64x2_t bitRevOff1 = vmullbq_int_u32(bitRevTabOff, one); - uint64x2_t bitRevOff2 = vmulltq_int_u32(bitRevTabOff, one); - - uint64x2_t in1 = vldrdq_gather_offset_u64(src, bitRevOff1); - uint64x2_t in2 = vldrdq_gather_offset_u64(src, bitRevOff2); - - vstrdq_scatter_offset_u64(src, bitRevOff1, in2); - vstrdq_scatter_offset_u64(src, bitRevOff2, in1); - - /* - * Decrement the blockSize loop counter - */ - blkCnt--; - } -} static void _arm_radix4_butterfly_q31_mve( const arm_cfft_instance_q31 * S, @@ -76,14 +45,13 @@ static void _arm_radix4_butterfly_q31_mve( q31x4_t vecTmp0, vecTmp1; q31x4_t vecSum0, vecDiff0, vecSum1, vecDiff1; q31x4_t vecA, vecB, vecC, vecD; - q31x4_t vecW; uint32_t blkCnt; uint32_t n1, n2; uint32_t stage = 0; int32_t iter = 1; - static const uint32_t strides[4] = { - (0 - 16) * sizeof(q31_t *), (1 - 16) * sizeof(q31_t *), - (8 - 16) * sizeof(q31_t *), (9 - 16) * sizeof(q31_t *) + static const int32_t strides[4] = { + (0 - 16) * (int32_t)sizeof(q31_t *), (1 - 16) * (int32_t)sizeof(q31_t *), + (8 - 16) * (int32_t)sizeof(q31_t *), (9 - 16) * (int32_t)sizeof(q31_t *) }; @@ -97,25 +65,27 @@ static void _arm_radix4_butterfly_q31_mve( for (int k = fftLen / 4u; k > 1; k >>= 2u) { + q31_t const *p_rearranged_twiddle_tab_stride2 = + &S->rearranged_twiddle_stride2[ + S->rearranged_twiddle_tab_stride2_arr[stage]]; + q31_t const *p_rearranged_twiddle_tab_stride3 = &S->rearranged_twiddle_stride3[ + S->rearranged_twiddle_tab_stride3_arr[stage]]; + q31_t const *p_rearranged_twiddle_tab_stride1 = + &S->rearranged_twiddle_stride1[ + S->rearranged_twiddle_tab_stride1_arr[stage]]; + + q31_t * pBase = pSrc; for (int i = 0; i < iter; i++) { - q31_t const *p_rearranged_twiddle_tab_stride2 = - &S->rearranged_twiddle_stride2[ - S->rearranged_twiddle_tab_stride2_arr[stage]]; - q31_t const *p_rearranged_twiddle_tab_stride3 = &S->rearranged_twiddle_stride3[ - S->rearranged_twiddle_tab_stride3_arr[stage]]; - q31_t const *p_rearranged_twiddle_tab_stride1 = - &S->rearranged_twiddle_stride1[ - S->rearranged_twiddle_tab_stride1_arr[stage]]; - q31_t const *pW1, *pW2, *pW3; - q31_t *inA = pSrc + CMPLX_DIM * i * n1; + q31_t *inA = pBase; q31_t *inB = inA + n2 * CMPLX_DIM; q31_t *inC = inB + n2 * CMPLX_DIM; q31_t *inD = inC + n2 * CMPLX_DIM; + q31_t const *pW1 = p_rearranged_twiddle_tab_stride1; + q31_t const *pW2 = p_rearranged_twiddle_tab_stride2; + q31_t const *pW3 = p_rearranged_twiddle_tab_stride3; + q31x4_t vecW; - pW1 = p_rearranged_twiddle_tab_stride1; - pW2 = p_rearranged_twiddle_tab_stride2; - pW3 = p_rearranged_twiddle_tab_stride3; blkCnt = n2 / 2; /* @@ -148,7 +118,7 @@ static void _arm_radix4_butterfly_q31_mve( */ vecW = vld1q(pW2); pW2 += 4; - vecTmp1 = MVE_CMPLX_MULT_FX_AxB(vecW, vecTmp0); + vecTmp1 = MVE_CMPLX_MULT_FX_AxB(vecW, vecTmp0, q31x4_t); vst1q(inB, vecTmp1); inB += 4; @@ -161,7 +131,7 @@ static void _arm_radix4_butterfly_q31_mve( */ vecW = vld1q(pW1); pW1 += 4; - vecTmp1 = MVE_CMPLX_MULT_FX_AxB(vecW, vecTmp0); + vecTmp1 = MVE_CMPLX_MULT_FX_AxB(vecW, vecTmp0, q31x4_t); vst1q(inC, vecTmp1); inC += 4; /* @@ -173,7 +143,7 @@ static void _arm_radix4_butterfly_q31_mve( */ vecW = vld1q(pW3); pW3 += 4; - vecTmp1 = MVE_CMPLX_MULT_FX_AxB(vecW, vecTmp0); + vecTmp1 = MVE_CMPLX_MULT_FX_AxB(vecW, vecTmp0, q31x4_t); vst1q(inD, vecTmp1); inD += 4; @@ -182,6 +152,7 @@ static void _arm_radix4_butterfly_q31_mve( blkCnt--; } + pBase += CMPLX_DIM * n1; } n1 = n2; n2 >>= 2u; @@ -200,7 +171,7 @@ static void _arm_radix4_butterfly_q31_mve( /* * start of Last stage process */ - uint32x4_t vecScGathAddr = *(uint32x4_t *) strides; + uint32x4_t vecScGathAddr = vld1q_u32((uint32_t*)strides); vecScGathAddr = vecScGathAddr + (uint32_t) pSrc; /* @@ -281,7 +252,7 @@ static void arm_cfft_radix4by2_q31_mve(const arm_cfft_instance_q31 *S, q31_t *pS pCoef += 4; vecDiff = vhsubq(vecIn0, vecIn1); - vecCmplxTmp = MVE_CMPLX_MULT_FX_AxConjB(vecDiff, vecTw); + vecCmplxTmp = MVE_CMPLX_MULT_FX_AxConjB(vecDiff, vecTw, q31x4_t); vst1q(pIn1, vecCmplxTmp); pIn1 += 4; @@ -326,14 +297,13 @@ static void _arm_radix4_butterfly_inverse_q31_mve( q31x4_t vecTmp0, vecTmp1; q31x4_t vecSum0, vecDiff0, vecSum1, vecDiff1; q31x4_t vecA, vecB, vecC, vecD; - q31x4_t vecW; uint32_t blkCnt; uint32_t n1, n2; uint32_t stage = 0; int32_t iter = 1; - static const uint32_t strides[4] = { - (0 - 16) * sizeof(q31_t *), (1 - 16) * sizeof(q31_t *), - (8 - 16) * sizeof(q31_t *), (9 - 16) * sizeof(q31_t *) + static const int32_t strides[4] = { + (0 - 16) * (int32_t)sizeof(q31_t *), (1 - 16) * (int32_t)sizeof(q31_t *), + (8 - 16) * (int32_t)sizeof(q31_t *), (9 - 16) * (int32_t)sizeof(q31_t *) }; /* @@ -346,26 +316,26 @@ static void _arm_radix4_butterfly_inverse_q31_mve( for (int k = fftLen / 4u; k > 1; k >>= 2u) { + q31_t const *p_rearranged_twiddle_tab_stride2 = + &S->rearranged_twiddle_stride2[ + S->rearranged_twiddle_tab_stride2_arr[stage]]; + q31_t const *p_rearranged_twiddle_tab_stride3 = &S->rearranged_twiddle_stride3[ + S->rearranged_twiddle_tab_stride3_arr[stage]]; + q31_t const *p_rearranged_twiddle_tab_stride1 = + &S->rearranged_twiddle_stride1[ + S->rearranged_twiddle_tab_stride1_arr[stage]]; + + q31_t * pBase = pSrc; for (int i = 0; i < iter; i++) { - q31_t const *p_rearranged_twiddle_tab_stride2 = - &S->rearranged_twiddle_stride2[ - S->rearranged_twiddle_tab_stride2_arr[stage]]; - q31_t const *p_rearranged_twiddle_tab_stride3 = &S->rearranged_twiddle_stride3[ - S->rearranged_twiddle_tab_stride3_arr[stage]]; - q31_t const *p_rearranged_twiddle_tab_stride1 = - &S->rearranged_twiddle_stride1[ - S->rearranged_twiddle_tab_stride1_arr[stage]]; - - q31_t const *pW1, *pW2, *pW3; - q31_t *inA = pSrc + CMPLX_DIM * i * n1; + q31_t *inA = pBase; q31_t *inB = inA + n2 * CMPLX_DIM; q31_t *inC = inB + n2 * CMPLX_DIM; q31_t *inD = inC + n2 * CMPLX_DIM; - - pW1 = p_rearranged_twiddle_tab_stride1; - pW2 = p_rearranged_twiddle_tab_stride2; - pW3 = p_rearranged_twiddle_tab_stride3; + q31_t const *pW1 = p_rearranged_twiddle_tab_stride1; + q31_t const *pW2 = p_rearranged_twiddle_tab_stride2; + q31_t const *pW3 = p_rearranged_twiddle_tab_stride3; + q31x4_t vecW; blkCnt = n2 / 2; /* @@ -398,7 +368,7 @@ static void _arm_radix4_butterfly_inverse_q31_mve( */ vecW = vld1q(pW2); pW2 += 4; - vecTmp1 = MVE_CMPLX_MULT_FX_AxConjB(vecTmp0, vecW); + vecTmp1 = MVE_CMPLX_MULT_FX_AxConjB(vecTmp0, vecW, q31x4_t); vst1q(inB, vecTmp1); inB += 4; @@ -411,7 +381,7 @@ static void _arm_radix4_butterfly_inverse_q31_mve( */ vecW = vld1q(pW1); pW1 += 4; - vecTmp1 = MVE_CMPLX_MULT_FX_AxConjB(vecTmp0, vecW); + vecTmp1 = MVE_CMPLX_MULT_FX_AxConjB(vecTmp0, vecW, q31x4_t); vst1q(inC, vecTmp1); inC += 4; /* @@ -423,7 +393,7 @@ static void _arm_radix4_butterfly_inverse_q31_mve( */ vecW = vld1q(pW3); pW3 += 4; - vecTmp1 = MVE_CMPLX_MULT_FX_AxConjB(vecTmp0, vecW); + vecTmp1 = MVE_CMPLX_MULT_FX_AxConjB(vecTmp0, vecW, q31x4_t); vst1q(inD, vecTmp1); inD += 4; @@ -432,6 +402,7 @@ static void _arm_radix4_butterfly_inverse_q31_mve( blkCnt--; } + pBase += CMPLX_DIM * n1; } n1 = n2; n2 >>= 2u; @@ -450,7 +421,7 @@ static void _arm_radix4_butterfly_inverse_q31_mve( /* * start of Last stage process */ - uint32x4_t vecScGathAddr = *(uint32x4_t *) strides; + uint32x4_t vecScGathAddr = vld1q_u32((uint32_t*)strides); vecScGathAddr = vecScGathAddr + (uint32_t) pSrc; /* @@ -536,7 +507,7 @@ static void arm_cfft_radix4by2_inverse_q31_mve(const arm_cfft_instance_q31 *S, q pCoef += 4; vecDiff = vhsubq(vecIn0, vecIn1); - vecCmplxTmp = MVE_CMPLX_MULT_FX_AxB(vecDiff, vecTw); + vecCmplxTmp = MVE_CMPLX_MULT_FX_AxB(vecDiff, vecTw, q31x4_t); vst1q(pIn1, vecCmplxTmp); pIn1 += 4; @@ -600,55 +571,55 @@ void arm_cfft_q31( q31_t * pSrc, uint8_t ifftFlag, uint8_t bitReverseFlag) -{ - uint32_t fftLen = S->fftLen; - - if (ifftFlag == 1U) { - - switch (fftLen) { - case 16: - case 64: - case 256: - case 1024: - case 4096: - _arm_radix4_butterfly_inverse_q31_mve(S, pSrc, fftLen); - break; - - case 32: - case 128: - case 512: - case 2048: - arm_cfft_radix4by2_inverse_q31_mve(S, pSrc, fftLen); - break; - } - } else { - switch (fftLen) { - case 16: - case 64: - case 256: - case 1024: - case 4096: - _arm_radix4_butterfly_q31_mve(S, pSrc, fftLen); - break; - - case 32: - case 128: - case 512: - case 2048: - arm_cfft_radix4by2_q31_mve(S, pSrc, fftLen); - break; - } - } - - - if (bitReverseFlag) - { - +{ + uint32_t fftLen = S->fftLen; + + if (ifftFlag == 1U) { + + switch (fftLen) { + case 16: + case 64: + case 256: + case 1024: + case 4096: + _arm_radix4_butterfly_inverse_q31_mve(S, pSrc, fftLen); + break; + + case 32: + case 128: + case 512: + case 2048: + arm_cfft_radix4by2_inverse_q31_mve(S, pSrc, fftLen); + break; + } + } else { + switch (fftLen) { + case 16: + case 64: + case 256: + case 1024: + case 4096: + _arm_radix4_butterfly_q31_mve(S, pSrc, fftLen); + break; + + case 32: + case 128: + case 512: + case 2048: + arm_cfft_radix4by2_q31_mve(S, pSrc, fftLen); + break; + } + } + + + if (bitReverseFlag) + { + arm_bitreversal_32_inpl_mve((uint32_t*)pSrc, S->bitRevLength, S->pBitRevTable); - - } + + } } -#else +#else extern void arm_radix4_butterfly_q31( q31_t * pSrc, diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_f16.c index d45ec07..c95a01f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_f16.c @@ -5,13 +5,13 @@ * Title: arm_cfft_radix2_f16.c * Description: Radix-2 Decimation in Frequency CFFT & CIFFT Floating point processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -148,22 +148,22 @@ uint16_t twidCoefModifier) l = i + n2; /* Butterfly implementation */ - a0 = pSrc[2 * i] + pSrc[2 * l]; - xt = pSrc[2 * i] - pSrc[2 * l]; + a0 = (_Float16)pSrc[2 * i] + (_Float16)pSrc[2 * l]; + xt = (_Float16)pSrc[2 * i] - (_Float16)pSrc[2 * l]; - yt = pSrc[2 * i + 1] - pSrc[2 * l + 1]; - a1 = pSrc[2 * l + 1] + pSrc[2 * i + 1]; + yt = (_Float16)pSrc[2 * i + 1] - (_Float16)pSrc[2 * l + 1]; + a1 = (_Float16)pSrc[2 * l + 1] + (_Float16)pSrc[2 * i + 1]; - p0 = xt * cosVal; - p1 = yt * sinVal; - p2 = yt * cosVal; - p3 = xt * sinVal; + p0 = (_Float16)xt * (_Float16)cosVal; + p1 = (_Float16)yt * (_Float16)sinVal; + p2 = (_Float16)yt * (_Float16)cosVal; + p3 = (_Float16)xt * (_Float16)sinVal; pSrc[2 * i] = a0; pSrc[2 * i + 1] = a1; - pSrc[2 * l] = p0 + p1; - pSrc[2 * l + 1] = p2 - p3; + pSrc[2 * l] = (_Float16)p0 + (_Float16)p1; + pSrc[2 * l + 1] = (_Float16)p2 - (_Float16)p3; i++; } // groups loop end @@ -190,22 +190,22 @@ uint16_t twidCoefModifier) do { l = i + n2; - a0 = pSrc[2 * i] + pSrc[2 * l]; - xt = pSrc[2 * i] - pSrc[2 * l]; + a0 = (_Float16)pSrc[2 * i] + (_Float16)pSrc[2 * l]; + xt = (_Float16)pSrc[2 * i] - (_Float16)pSrc[2 * l]; - yt = pSrc[2 * i + 1] - pSrc[2 * l + 1]; - a1 = pSrc[2 * l + 1] + pSrc[2 * i + 1]; + yt = (_Float16)pSrc[2 * i + 1] - (_Float16)pSrc[2 * l + 1]; + a1 = (_Float16)pSrc[2 * l + 1] + (_Float16)pSrc[2 * i + 1]; - p0 = xt * cosVal; - p1 = yt * sinVal; - p2 = yt * cosVal; - p3 = xt * sinVal; + p0 = (_Float16)xt * (_Float16)cosVal; + p1 = (_Float16)yt * (_Float16)sinVal; + p2 = (_Float16)yt * (_Float16)cosVal; + p3 = (_Float16)xt * (_Float16)sinVal; pSrc[2 * i] = a0; pSrc[2 * i + 1] = a1; - pSrc[2 * l] = p0 + p1; - pSrc[2 * l + 1] = p2 - p3; + pSrc[2 * l] = (_Float16)p0 + (_Float16)p1; + pSrc[2 * l + 1] = (_Float16)p2 - (_Float16)p3; i += n1; } while ( i < fftLen ); // butterfly loop end @@ -217,11 +217,11 @@ uint16_t twidCoefModifier) // loop for butterfly for (i = 0; i < fftLen; i += 2) { - a0 = pSrc[2 * i] + pSrc[2 * i + 2]; - xt = pSrc[2 * i] - pSrc[2 * i + 2]; + a0 = (_Float16)pSrc[2 * i] + (_Float16)pSrc[2 * i + 2]; + xt = (_Float16)pSrc[2 * i] - (_Float16)pSrc[2 * i + 2]; - yt = pSrc[2 * i + 1] - pSrc[2 * i + 3]; - a1 = pSrc[2 * i + 3] + pSrc[2 * i + 1]; + yt = (_Float16)pSrc[2 * i + 1] - (_Float16)pSrc[2 * i + 3]; + a1 = (_Float16)pSrc[2 * i + 3] + (_Float16)pSrc[2 * i + 1]; pSrc[2 * i] = a0; pSrc[2 * i + 1] = a1; @@ -253,22 +253,22 @@ uint16_t twidCoefModifier) do { l = i + n2; - a0 = pSrc[2 * i] + pSrc[2 * l]; - xt = pSrc[2 * i] - pSrc[2 * l]; + a0 = (_Float16)pSrc[2 * i] + (_Float16)pSrc[2 * l]; + xt = (_Float16)pSrc[2 * i] - (_Float16)pSrc[2 * l]; - yt = pSrc[2 * i + 1] - pSrc[2 * l + 1]; - a1 = pSrc[2 * l + 1] + pSrc[2 * i + 1]; + yt = (_Float16)pSrc[2 * i + 1] - (_Float16)pSrc[2 * l + 1]; + a1 = (_Float16)pSrc[2 * l + 1] + (_Float16)pSrc[2 * i + 1]; - p0 = xt * cosVal; - p1 = yt * sinVal; - p2 = yt * cosVal; - p3 = xt * sinVal; + p0 = (_Float16)xt * (_Float16)cosVal; + p1 = (_Float16)yt * (_Float16)sinVal; + p2 = (_Float16)yt * (_Float16)cosVal; + p3 = (_Float16)xt * (_Float16)sinVal; pSrc[2 * i] = a0; pSrc[2 * i + 1] = a1; - pSrc[2 * l] = p0 + p1; - pSrc[2 * l + 1] = p2 - p3; + pSrc[2 * l] = (_Float16)p0 + (_Float16)p1; + pSrc[2 * l + 1] = (_Float16)p2 - (_Float16)p3; i += n1; } while (i < fftLen); @@ -309,22 +309,22 @@ float16_t onebyfftLen) ia += twidCoefModifier; l = i + n2; - a0 = pSrc[2 * i] + pSrc[2 * l]; - xt = pSrc[2 * i] - pSrc[2 * l]; + a0 = (_Float16)pSrc[2 * i] + (_Float16)pSrc[2 * l]; + xt = (_Float16)pSrc[2 * i] - (_Float16)pSrc[2 * l]; - yt = pSrc[2 * i + 1] - pSrc[2 * l + 1]; - a1 = pSrc[2 * l + 1] + pSrc[2 * i + 1]; + yt = (_Float16)pSrc[2 * i + 1] - (_Float16)pSrc[2 * l + 1]; + a1 = (_Float16)pSrc[2 * l + 1] + (_Float16)pSrc[2 * i + 1]; - p0 = xt * cosVal; - p1 = yt * sinVal; - p2 = yt * cosVal; - p3 = xt * sinVal; + p0 = (_Float16)xt * (_Float16)cosVal; + p1 = (_Float16)yt * (_Float16)sinVal; + p2 = (_Float16)yt * (_Float16)cosVal; + p3 = (_Float16)xt * (_Float16)sinVal; pSrc[2 * i] = a0; pSrc[2 * i + 1] = a1; - pSrc[2 * l] = p0 - p1; - pSrc[2 * l + 1] = p2 + p3; + pSrc[2 * l] = (_Float16)p0 - (_Float16)p1; + pSrc[2 * l + 1] = (_Float16)p2 + (_Float16)p3; } // groups loop end twidCoefModifier <<= 1U; @@ -349,22 +349,22 @@ float16_t onebyfftLen) do { l = i + n2; - a0 = pSrc[2 * i] + pSrc[2 * l]; - xt = pSrc[2 * i] - pSrc[2 * l]; + a0 = (_Float16)pSrc[2 * i] + (_Float16)pSrc[2 * l]; + xt = (_Float16)pSrc[2 * i] - (_Float16)pSrc[2 * l]; - yt = pSrc[2 * i + 1] - pSrc[2 * l + 1]; - a1 = pSrc[2 * l + 1] + pSrc[2 * i + 1]; + yt = (_Float16)pSrc[2 * i + 1] - (_Float16)pSrc[2 * l + 1]; + a1 = (_Float16)pSrc[2 * l + 1] + (_Float16)pSrc[2 * i + 1]; - p0 = xt * cosVal; - p1 = yt * sinVal; - p2 = yt * cosVal; - p3 = xt * sinVal; + p0 = (_Float16)xt * (_Float16)cosVal; + p1 = (_Float16)yt * (_Float16)sinVal; + p2 = (_Float16)yt * (_Float16)cosVal; + p3 = (_Float16)xt * (_Float16)sinVal; pSrc[2 * i] = a0; pSrc[2 * i + 1] = a1; - pSrc[2 * l] = p0 - p1; - pSrc[2 * l + 1] = p2 + p3; + pSrc[2 * l] = (_Float16)p0 - (_Float16)p1; + pSrc[2 * l + 1] = (_Float16)p2 + (_Float16)p3; i += n1; } while ( i < fftLen ); // butterfly loop end @@ -377,16 +377,16 @@ float16_t onebyfftLen) // loop for butterfly for (i = 0; i < fftLen; i += 2) { - a0 = pSrc[2 * i] + pSrc[2 * i + 2]; - xt = pSrc[2 * i] - pSrc[2 * i + 2]; + a0 = (_Float16)pSrc[2 * i] + (_Float16)pSrc[2 * i + 2]; + xt = (_Float16)pSrc[2 * i] - (_Float16)pSrc[2 * i + 2]; - a1 = pSrc[2 * i + 3] + pSrc[2 * i + 1]; - yt = pSrc[2 * i + 1] - pSrc[2 * i + 3]; + a1 = (_Float16)pSrc[2 * i + 3] + (_Float16)pSrc[2 * i + 1]; + yt = (_Float16)pSrc[2 * i + 1] - (_Float16)pSrc[2 * i + 3]; - p0 = a0 * onebyfftLen; - p2 = xt * onebyfftLen; - p1 = a1 * onebyfftLen; - p3 = yt * onebyfftLen; + p0 = (_Float16)a0 * (_Float16)onebyfftLen; + p2 = (_Float16)xt * (_Float16)onebyfftLen; + p1 = (_Float16)a1 * (_Float16)onebyfftLen; + p3 = (_Float16)yt * (_Float16)onebyfftLen; pSrc[2 * i] = p0; pSrc[2 * i + 1] = p1; @@ -418,22 +418,22 @@ float16_t onebyfftLen) do { l = i + n2; - a0 = pSrc[2 * i] + pSrc[2 * l]; - xt = pSrc[2 * i] - pSrc[2 * l]; + a0 = (_Float16)pSrc[2 * i] + (_Float16)pSrc[2 * l]; + xt = (_Float16)pSrc[2 * i] - (_Float16)pSrc[2 * l]; - yt = pSrc[2 * i + 1] - pSrc[2 * l + 1]; - a1 = pSrc[2 * l + 1] + pSrc[2 * i + 1]; + yt = (_Float16)pSrc[2 * i + 1] - (_Float16)pSrc[2 * l + 1]; + a1 = (_Float16)pSrc[2 * l + 1] + (_Float16)pSrc[2 * i + 1]; - p0 = xt * cosVal; - p1 = yt * sinVal; - p2 = yt * cosVal; - p3 = xt * sinVal; + p0 = (_Float16)xt * (_Float16)cosVal; + p1 = (_Float16)yt * (_Float16)sinVal; + p2 = (_Float16)yt * (_Float16)cosVal; + p3 = (_Float16)xt * (_Float16)sinVal; pSrc[2 * i] = a0; pSrc[2 * i + 1] = a1; - pSrc[2 * l] = p0 - p1; - pSrc[2 * l + 1] = p2 + p3; + pSrc[2 * l] = (_Float16)p0 - (_Float16)p1; + pSrc[2 * l + 1] = (_Float16)p2 + (_Float16)p3; i += n1; } while ( i < fftLen ); // butterfly loop end @@ -451,16 +451,16 @@ float16_t onebyfftLen) { l = i + n2; - a0 = pSrc[2 * i] + pSrc[2 * l]; - xt = pSrc[2 * i] - pSrc[2 * l]; + a0 = (_Float16)pSrc[2 * i] + (_Float16)pSrc[2 * l]; + xt = (_Float16)pSrc[2 * i] - (_Float16)pSrc[2 * l]; - a1 = pSrc[2 * l + 1] + pSrc[2 * i + 1]; - yt = pSrc[2 * i + 1] - pSrc[2 * l + 1]; + a1 = (_Float16)pSrc[2 * l + 1] + (_Float16)pSrc[2 * i + 1]; + yt = (_Float16)pSrc[2 * i + 1] - (_Float16)pSrc[2 * l + 1]; - p0 = a0 * onebyfftLen; - p2 = xt * onebyfftLen; - p1 = a1 * onebyfftLen; - p3 = yt * onebyfftLen; + p0 = (_Float16)a0 * (_Float16)onebyfftLen; + p2 = (_Float16)xt * (_Float16)onebyfftLen; + p1 = (_Float16)a1 * (_Float16)onebyfftLen; + p3 = (_Float16)yt * (_Float16)onebyfftLen; pSrc[2 * i] = p0; pSrc[2U * l] = p2; @@ -475,4 +475,5 @@ float16_t onebyfftLen) #endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_f32.c index bdad034..dba45f4 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_f32.c @@ -5,13 +5,13 @@ * Title: arm_cfft_radix2_f32.c * Description: Radix-2 Decimation in Frequency CFFT & CIFFT Floating point processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_f16.c index 4671765..17e7c80 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_f16.c @@ -5,10 +5,13 @@ * Title: arm_cfft_radix2_init_f16.c * Description: Radix-2 Decimation in Frequency Floating-point CFFT & CIFFT Initialization function * - * Target Processor: Cortex-M cores + * $Date: 23 April 2021 + * $Revision: V1.9.0 + * + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_f32.c index db63a37..71fba78 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_cfft_radix2_init_f32.c * Description: Radix-2 Decimation in Frequency Floating-point CFFT & CIFFT Initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_q15.c index 934cd54..f07cad4 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_q15.c @@ -5,13 +5,13 @@ * Title: arm_cfft_radix2_init_q15.c * Description: Radix-2 Decimation in Frequency Q15 FFT & IFFT initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -94,7 +94,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initialise the Flag for calculation Bit reversal or not */ S->bitReverseFlag = bitReverseFlag; -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_4096) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREV_1024) /* Initializations of structure parameters depending on the FFT length */ switch (S->fftLen) @@ -107,7 +107,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 1U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) armBitRevIndexTable_fixed_4096; + S->pBitRevTable = (uint16_t *) armBitRevTable; break; @@ -119,7 +119,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 2U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[1]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[1]; break; @@ -127,7 +127,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initializations of structure parameters for 1024 point FFT */ S->twidCoefModifier = 4U; S->bitRevFactor = 4U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[3]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[3]; break; @@ -135,7 +135,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initializations of structure parameters for 512 point FFT */ S->twidCoefModifier = 8U; S->bitRevFactor = 8U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[7]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[7]; break; @@ -143,7 +143,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initializations of structure parameters for 256 point FFT */ S->twidCoefModifier = 16U; S->bitRevFactor = 16U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[15]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[15]; break; @@ -151,7 +151,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initializations of structure parameters for 128 point FFT */ S->twidCoefModifier = 32U; S->bitRevFactor = 32U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[31]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[31]; break; @@ -159,7 +159,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initializations of structure parameters for 64 point FFT */ S->twidCoefModifier = 64U; S->bitRevFactor = 64U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[63]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[63]; break; @@ -167,7 +167,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initializations of structure parameters for 32 point FFT */ S->twidCoefModifier = 128U; S->bitRevFactor = 128U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[127]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[127]; break; @@ -175,7 +175,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initializations of structure parameters for 16 point FFT */ S->twidCoefModifier = 256U; S->bitRevFactor = 256U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[255]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[255]; break; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_q31.c index 8f171f7..5823559 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_cfft_radix2_init_q31.c * Description: Radix-2 Decimation in Frequency Fixed-point CFFT & CIFFT Initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -95,7 +95,7 @@ arm_status arm_cfft_radix2_init_q31( /* Initialise the Flag for calculation Bit reversal or not */ S->bitReverseFlag = bitReverseFlag; -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_4096) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREV_1024) /* Initializations of Instance structure depending on the FFT length */ switch (S->fftLen) @@ -107,7 +107,7 @@ arm_status arm_cfft_radix2_init_q31( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 1U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) armBitRevIndexTable_fixed_4096; + S->pBitRevTable = (uint16_t *) armBitRevTable; break; /* Initializations of structure parameters for 2048 point FFT */ @@ -117,7 +117,7 @@ arm_status arm_cfft_radix2_init_q31( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 2U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[1]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[1]; break; /* Initializations of structure parameters for 1024 point FFT */ @@ -127,7 +127,7 @@ arm_status arm_cfft_radix2_init_q31( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 4U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[3]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[3]; break; /* Initializations of structure parameters for 512 point FFT */ @@ -137,42 +137,42 @@ arm_status arm_cfft_radix2_init_q31( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 8U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[7]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[7]; break; case 256U: /* Initializations of structure parameters for 256 point FFT */ S->twidCoefModifier = 16U; S->bitRevFactor = 16U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[15]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[15]; break; case 128U: /* Initializations of structure parameters for 128 point FFT */ S->twidCoefModifier = 32U; S->bitRevFactor = 32U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[31]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[31]; break; case 64U: /* Initializations of structure parameters for 64 point FFT */ S->twidCoefModifier = 64U; S->bitRevFactor = 64U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[63]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[63]; break; case 32U: /* Initializations of structure parameters for 32 point FFT */ S->twidCoefModifier = 128U; S->bitRevFactor = 128U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[127]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[127]; break; case 16U: /* Initializations of structure parameters for 16 point FFT */ S->twidCoefModifier = 256U; S->bitRevFactor = 256U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[255]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[255]; break; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_q15.c index 8d3347b..49f6d9d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_q15.c @@ -5,13 +5,13 @@ * Title: arm_cfft_radix2_q15.c * Description: Radix-2 Decimation in Frequency CFFT & CIFFT Fixed point processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_q31.c index d647396..6f36181 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_q31.c @@ -5,13 +5,13 @@ * Title: arm_cfft_radix2_q31.c * Description: Radix-2 Decimation in Frequency CFFT & CIFFT Fixed point processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_f16.c index cbc0552..4c46bc1 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_f16.c @@ -5,13 +5,13 @@ * Title: arm_cfft_radix4_f16.c * Description: Radix-4 Decimation in Frequency CFFT & CIFFT Floating point processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -97,22 +97,22 @@ void arm_cfft_radix4by2_f16( l = i + n2; /* Butterfly implementation */ - a0 = pSrc[2 * i] + pSrc[2 * l]; - xt = pSrc[2 * i] - pSrc[2 * l]; + a0 = (_Float16)pSrc[2 * i] + (_Float16)pSrc[2 * l]; + xt = (_Float16)pSrc[2 * i] - (_Float16)pSrc[2 * l]; - yt = pSrc[2 * i + 1] - pSrc[2 * l + 1]; - a1 = pSrc[2 * l + 1] + pSrc[2 * i + 1]; + yt = (_Float16)pSrc[2 * i + 1] - (_Float16)pSrc[2 * l + 1]; + a1 = (_Float16)pSrc[2 * l + 1] + (_Float16)pSrc[2 * i + 1]; - p0 = xt * cosVal; - p1 = yt * sinVal; - p2 = yt * cosVal; - p3 = xt * sinVal; + p0 = (_Float16)xt * (_Float16)cosVal; + p1 = (_Float16)yt * (_Float16)sinVal; + p2 = (_Float16)yt * (_Float16)cosVal; + p3 = (_Float16)xt * (_Float16)sinVal; pSrc[2 * i] = a0; pSrc[2 * i + 1] = a1; - pSrc[2 * l] = p0 + p1; - pSrc[2 * l + 1] = p2 - p3; + pSrc[2 * l] = (_Float16)p0 + (_Float16)p1; + pSrc[2 * l + 1] = (_Float16)p2 - (_Float16)p3; } @@ -230,13 +230,13 @@ uint16_t twidCoefModifier) ydIn = pSrc[(2U * i3) + 1U]; /* xa + xc */ - Xaplusc = xaIn + xcIn; + Xaplusc = (_Float16)xaIn + (_Float16)xcIn; /* xb + xd */ - Xbplusd = xbIn + xdIn; + Xbplusd = (_Float16)xbIn + (_Float16)xdIn; /* ya + yc */ - Yaplusc = yaIn + ycIn; + Yaplusc = (_Float16)yaIn + (_Float16)ycIn; /* yb + yd */ - Ybplusd = ybIn + ydIn; + Ybplusd = (_Float16)ybIn + (_Float16)ydIn; /* index calculation for the coefficients */ ia2 = ia1 + ia1; @@ -244,31 +244,31 @@ uint16_t twidCoefModifier) si2 = pCoef[(ia2 * 2U) + 1U]; /* xa - xc */ - Xaminusc = xaIn - xcIn; + Xaminusc = (_Float16)xaIn - (_Float16)xcIn; /* xb - xd */ - Xbminusd = xbIn - xdIn; + Xbminusd = (_Float16)xbIn - (_Float16)xdIn; /* ya - yc */ - Yaminusc = yaIn - ycIn; + Yaminusc = (_Float16)yaIn - (_Float16)ycIn; /* yb - yd */ - Ybminusd = ybIn - ydIn; + Ybminusd = (_Float16)ybIn - (_Float16)ydIn; /* xa' = xa + xb + xc + xd */ - pSrc[(2U * i0)] = Xaplusc + Xbplusd; + pSrc[(2U * i0)] = (_Float16)Xaplusc + (_Float16)Xbplusd; /* ya' = ya + yb + yc + yd */ - pSrc[(2U * i0) + 1U] = Yaplusc + Ybplusd; + pSrc[(2U * i0) + 1U] = (_Float16)Yaplusc + (_Float16)Ybplusd; /* (xa - xc) + (yb - yd) */ - Xb12C_out = (Xaminusc + Ybminusd); + Xb12C_out = ((_Float16)Xaminusc + (_Float16)Ybminusd); /* (ya - yc) + (xb - xd) */ - Yb12C_out = (Yaminusc - Xbminusd); + Yb12C_out = ((_Float16)Yaminusc - (_Float16)Xbminusd); /* (xa + xc) - (xb + xd) */ - Xc12C_out = (Xaplusc - Xbplusd); + Xc12C_out = ((_Float16)Xaplusc - (_Float16)Xbplusd); /* (ya + yc) - (yb + yd) */ - Yc12C_out = (Yaplusc - Ybplusd); + Yc12C_out = ((_Float16)Yaplusc - (_Float16)Ybplusd); /* (xa - xc) - (yb - yd) */ - Xd12C_out = (Xaminusc - Ybminusd); + Xd12C_out = ((_Float16)Xaminusc - (_Float16)Ybminusd); /* (ya - yc) + (xb - xd) */ - Yd12C_out = (Xbminusd + Yaminusc); + Yd12C_out = ((_Float16)Xbminusd + (_Float16)Yaminusc); co1 = pCoef[ia1 * 2U]; si1 = pCoef[(ia1 * 2U) + 1U]; @@ -278,38 +278,38 @@ uint16_t twidCoefModifier) co3 = pCoef[ia3 * 2U]; si3 = pCoef[(ia3 * 2U) + 1U]; - Xb12_out = Xb12C_out * co1; - Yb12_out = Yb12C_out * co1; - Xc12_out = Xc12C_out * co2; - Yc12_out = Yc12C_out * co2; - Xd12_out = Xd12C_out * co3; - Yd12_out = Yd12C_out * co3; + Xb12_out = (_Float16)Xb12C_out * (_Float16)co1; + Yb12_out = (_Float16)Yb12C_out * (_Float16)co1; + Xc12_out = (_Float16)Xc12C_out * (_Float16)co2; + Yc12_out = (_Float16)Yc12C_out * (_Float16)co2; + Xd12_out = (_Float16)Xd12C_out * (_Float16)co3; + Yd12_out = (_Float16)Yd12C_out * (_Float16)co3; /* xb' = (xa+yb-xc-yd)co1 - (ya-xb-yc+xd)(si1) */ //Xb12_out -= Yb12C_out * si1; - p0 = Yb12C_out * si1; + p0 = (_Float16)Yb12C_out * (_Float16)si1; /* yb' = (ya-xb-yc+xd)co1 + (xa+yb-xc-yd)(si1) */ //Yb12_out += Xb12C_out * si1; - p1 = Xb12C_out * si1; + p1 = (_Float16)Xb12C_out * (_Float16)si1; /* xc' = (xa-xb+xc-xd)co2 - (ya-yb+yc-yd)(si2) */ //Xc12_out -= Yc12C_out * si2; - p2 = Yc12C_out * si2; + p2 = (_Float16)Yc12C_out * (_Float16)si2; /* yc' = (ya-yb+yc-yd)co2 + (xa-xb+xc-xd)(si2) */ //Yc12_out += Xc12C_out * si2; - p3 = Xc12C_out * si2; + p3 = (_Float16)Xc12C_out * (_Float16)si2; /* xd' = (xa-yb-xc+yd)co3 - (ya+xb-yc-xd)(si3) */ //Xd12_out -= Yd12C_out * si3; - p4 = Yd12C_out * si3; + p4 = (_Float16)Yd12C_out * (_Float16)si3; /* yd' = (ya+xb-yc-xd)co3 + (xa-yb-xc+yd)(si3) */ //Yd12_out += Xd12C_out * si3; - p5 = Xd12C_out * si3; + p5 = (_Float16)Xd12C_out * (_Float16)si3; - Xb12_out += p0; - Yb12_out -= p1; - Xc12_out += p2; - Yc12_out -= p3; - Xd12_out += p4; - Yd12_out -= p5; + Xb12_out += (_Float16)p0; + Yb12_out -= (_Float16)p1; + Xc12_out += (_Float16)p2; + Yc12_out -= (_Float16)p3; + Xd12_out += (_Float16)p4; + Yd12_out -= (_Float16)p5; /* xc' = (xa-xb+xc-xd)co2 + (ya-yb+yc-yd)(si2) */ pSrc[2U * i1] = Xc12_out; @@ -387,71 +387,71 @@ uint16_t twidCoefModifier) ydIn = pSrc[(2U * i3) + 1U]; /* xa - xc */ - Xaminusc = xaIn - xcIn; + Xaminusc = (_Float16)xaIn - (_Float16)xcIn; /* (xb - xd) */ - Xbminusd = xbIn - xdIn; + Xbminusd = (_Float16)xbIn - (_Float16)xdIn; /* ya - yc */ - Yaminusc = yaIn - ycIn; + Yaminusc = (_Float16)yaIn - (_Float16)ycIn; /* (yb - yd) */ - Ybminusd = ybIn - ydIn; + Ybminusd = (_Float16)ybIn - (_Float16)ydIn; /* xa + xc */ - Xaplusc = xaIn + xcIn; + Xaplusc = (_Float16)xaIn + (_Float16)xcIn; /* xb + xd */ - Xbplusd = xbIn + xdIn; + Xbplusd = (_Float16)xbIn + (_Float16)xdIn; /* ya + yc */ - Yaplusc = yaIn + ycIn; + Yaplusc = (_Float16)yaIn + (_Float16)ycIn; /* yb + yd */ - Ybplusd = ybIn + ydIn; + Ybplusd = (_Float16)ybIn + (_Float16)ydIn; /* (xa - xc) + (yb - yd) */ - Xb12C_out = (Xaminusc + Ybminusd); + Xb12C_out = ((_Float16)Xaminusc + (_Float16)Ybminusd); /* (ya - yc) - (xb - xd) */ - Yb12C_out = (Yaminusc - Xbminusd); + Yb12C_out = ((_Float16)Yaminusc - (_Float16)Xbminusd); /* xa + xc -(xb + xd) */ - Xc12C_out = (Xaplusc - Xbplusd); + Xc12C_out = ((_Float16)Xaplusc - (_Float16)Xbplusd); /* (ya + yc) - (yb + yd) */ - Yc12C_out = (Yaplusc - Ybplusd); + Yc12C_out = ((_Float16)Yaplusc - (_Float16)Ybplusd); /* (xa - xc) - (yb - yd) */ - Xd12C_out = (Xaminusc - Ybminusd); + Xd12C_out = ((_Float16)Xaminusc - (_Float16)Ybminusd); /* (ya - yc) + (xb - xd) */ - Yd12C_out = (Xbminusd + Yaminusc); + Yd12C_out = ((_Float16)Xbminusd + (_Float16)Yaminusc); - pSrc[(2U * i0)] = Xaplusc + Xbplusd; - pSrc[(2U * i0) + 1U] = Yaplusc + Ybplusd; + pSrc[(2U * i0)] = (_Float16)Xaplusc + (_Float16)Xbplusd; + pSrc[(2U * i0) + 1U] = (_Float16)Yaplusc + (_Float16)Ybplusd; - Xb12_out = Xb12C_out * co1; - Yb12_out = Yb12C_out * co1; - Xc12_out = Xc12C_out * co2; - Yc12_out = Yc12C_out * co2; - Xd12_out = Xd12C_out * co3; - Yd12_out = Yd12C_out * co3; + Xb12_out = (_Float16)Xb12C_out * (_Float16)co1; + Yb12_out = (_Float16)Yb12C_out * (_Float16)co1; + Xc12_out = (_Float16)Xc12C_out * (_Float16)co2; + Yc12_out = (_Float16)Yc12C_out * (_Float16)co2; + Xd12_out = (_Float16)Xd12C_out * (_Float16)co3; + Yd12_out = (_Float16)Yd12C_out * (_Float16)co3; /* xb' = (xa+yb-xc-yd)co1 - (ya-xb-yc+xd)(si1) */ //Xb12_out -= Yb12C_out * si1; - p0 = Yb12C_out * si1; + p0 = (_Float16)Yb12C_out * (_Float16)si1; /* yb' = (ya-xb-yc+xd)co1 + (xa+yb-xc-yd)(si1) */ //Yb12_out += Xb12C_out * si1; - p1 = Xb12C_out * si1; + p1 = (_Float16)Xb12C_out * (_Float16)si1; /* xc' = (xa-xb+xc-xd)co2 - (ya-yb+yc-yd)(si2) */ //Xc12_out -= Yc12C_out * si2; - p2 = Yc12C_out * si2; + p2 = (_Float16)Yc12C_out * (_Float16)si2; /* yc' = (ya-yb+yc-yd)co2 + (xa-xb+xc-xd)(si2) */ //Yc12_out += Xc12C_out * si2; - p3 = Xc12C_out * si2; + p3 = (_Float16)Xc12C_out * (_Float16)si2; /* xd' = (xa-yb-xc+yd)co3 - (ya+xb-yc-xd)(si3) */ //Xd12_out -= Yd12C_out * si3; - p4 = Yd12C_out * si3; + p4 = (_Float16)Yd12C_out * (_Float16)si3; /* yd' = (ya+xb-yc-xd)co3 + (xa-yb-xc+yd)(si3) */ //Yd12_out += Xd12C_out * si3; - p5 = Xd12C_out * si3; + p5 = (_Float16)Xd12C_out * (_Float16)si3; - Xb12_out += p0; - Yb12_out -= p1; - Xc12_out += p2; - Yc12_out -= p3; - Xd12_out += p4; - Yd12_out -= p5; + Xb12_out += (_Float16)p0; + Yb12_out -= (_Float16)p1; + Xc12_out += (_Float16)p2; + Yc12_out -= (_Float16)p3; + Xd12_out += (_Float16)p4; + Yd12_out -= (_Float16)p5; /* xc' = (xa-xb+xc-xd)co2 + (ya-yb+yc-yd)(si2) */ pSrc[2U * i1] = Xc12_out; @@ -494,45 +494,45 @@ uint16_t twidCoefModifier) ydIn = ptr1[7]; /* xa + xc */ - Xaplusc = xaIn + xcIn; + Xaplusc = (_Float16)xaIn + (_Float16)xcIn; /* xa - xc */ - Xaminusc = xaIn - xcIn; + Xaminusc = (_Float16)xaIn - (_Float16)xcIn; /* ya + yc */ - Yaplusc = yaIn + ycIn; + Yaplusc = (_Float16)yaIn + (_Float16)ycIn; /* ya - yc */ - Yaminusc = yaIn - ycIn; + Yaminusc = (_Float16)yaIn - (_Float16)ycIn; /* xb + xd */ - Xbplusd = xbIn + xdIn; + Xbplusd = (_Float16)xbIn + (_Float16)xdIn; /* yb + yd */ - Ybplusd = ybIn + ydIn; + Ybplusd = (_Float16)ybIn + (_Float16)ydIn; /* (xb-xd) */ - Xbminusd = xbIn - xdIn; + Xbminusd = (_Float16)xbIn - (_Float16)xdIn; /* (yb-yd) */ - Ybminusd = ybIn - ydIn; + Ybminusd = (_Float16)ybIn - (_Float16)ydIn; /* xa' = xa + xb + xc + xd */ - a0 = (Xaplusc + Xbplusd); + a0 = ((_Float16)Xaplusc + (_Float16)Xbplusd); /* ya' = ya + yb + yc + yd */ - a1 = (Yaplusc + Ybplusd); + a1 = ((_Float16)Yaplusc + (_Float16)Ybplusd); /* xc' = (xa-xb+xc-xd) */ - a2 = (Xaplusc - Xbplusd); + a2 = ((_Float16)Xaplusc - (_Float16)Xbplusd); /* yc' = (ya-yb+yc-yd) */ - a3 = (Yaplusc - Ybplusd); + a3 = ((_Float16)Yaplusc - (_Float16)Ybplusd); /* xb' = (xa+yb-xc-yd) */ - a4 = (Xaminusc + Ybminusd); + a4 = ((_Float16)Xaminusc + (_Float16)Ybminusd); /* yb' = (ya-xb-yc+xd) */ - a5 = (Yaminusc - Xbminusd); + a5 = ((_Float16)Yaminusc - (_Float16)Xbminusd); /* xd' = (xa-yb-xc+yd)) */ - a6 = (Xaminusc - Ybminusd); + a6 = ((_Float16)Xaminusc - (_Float16)Ybminusd); /* yd' = (ya+xb-yc-xd) */ - a7 = (Xbminusd + Yaminusc); + a7 = ((_Float16)Xbminusd + (_Float16)Yaminusc); ptr1[0] = a0; ptr1[1] = a1; @@ -590,70 +590,70 @@ uint16_t twidCoefModifier) i3 = i2 + n2; /* xa + xc */ - r1 = pSrc[(2U * i0)] + pSrc[(2U * i2)]; + r1 = (_Float16)pSrc[(2U * i0)] + (_Float16)pSrc[(2U * i2)]; /* xa - xc */ - r2 = pSrc[(2U * i0)] - pSrc[(2U * i2)]; + r2 = (_Float16)pSrc[(2U * i0)] - (_Float16)pSrc[(2U * i2)]; /* ya + yc */ - s1 = pSrc[(2U * i0) + 1U] + pSrc[(2U * i2) + 1U]; + s1 = (_Float16)pSrc[(2U * i0) + 1U] + (_Float16)pSrc[(2U * i2) + 1U]; /* ya - yc */ - s2 = pSrc[(2U * i0) + 1U] - pSrc[(2U * i2) + 1U]; + s2 = (_Float16)pSrc[(2U * i0) + 1U] - (_Float16)pSrc[(2U * i2) + 1U]; /* xb + xd */ - t1 = pSrc[2U * i1] + pSrc[2U * i3]; + t1 = (_Float16)pSrc[2U * i1] + (_Float16)pSrc[2U * i3]; /* xa' = xa + xb + xc + xd */ - pSrc[2U * i0] = r1 + t1; + pSrc[2U * i0] = (_Float16)r1 + (_Float16)t1; /* xa + xc -(xb + xd) */ - r1 = r1 - t1; + r1 = (_Float16)r1 - (_Float16)t1; /* yb + yd */ - t2 = pSrc[(2U * i1) + 1U] + pSrc[(2U * i3) + 1U]; + t2 = (_Float16)pSrc[(2U * i1) + 1U] + (_Float16)pSrc[(2U * i3) + 1U]; /* ya' = ya + yb + yc + yd */ - pSrc[(2U * i0) + 1U] = s1 + t2; + pSrc[(2U * i0) + 1U] = (_Float16)s1 + (_Float16)t2; /* (ya + yc) - (yb + yd) */ - s1 = s1 - t2; + s1 = (_Float16)s1 - (_Float16)t2; /* (yb - yd) */ - t1 = pSrc[(2U * i1) + 1U] - pSrc[(2U * i3) + 1U]; + t1 = (_Float16)pSrc[(2U * i1) + 1U] - (_Float16)pSrc[(2U * i3) + 1U]; /* (xb - xd) */ - t2 = pSrc[2U * i1] - pSrc[2U * i3]; + t2 = (_Float16)pSrc[2U * i1] - (_Float16)pSrc[2U * i3]; /* xc' = (xa-xb+xc-xd)co2 + (ya-yb+yc-yd)(si2) */ - pSrc[2U * i1] = (r1 * co2) + (s1 * si2); + pSrc[2U * i1] = ((_Float16)r1 * (_Float16)co2) + ((_Float16)s1 * (_Float16)si2); /* yc' = (ya-yb+yc-yd)co2 - (xa-xb+xc-xd)(si2) */ - pSrc[(2U * i1) + 1U] = (s1 * co2) - (r1 * si2); + pSrc[(2U * i1) + 1U] = ((_Float16)s1 * (_Float16)co2) - ((_Float16)r1 * (_Float16)si2); /* (xa - xc) + (yb - yd) */ - r1 = r2 + t1; + r1 = (_Float16)r2 + (_Float16)t1; /* (xa - xc) - (yb - yd) */ - r2 = r2 - t1; + r2 = (_Float16)r2 - (_Float16)t1; /* (ya - yc) - (xb - xd) */ - s1 = s2 - t2; + s1 = (_Float16)s2 - (_Float16)t2; /* (ya - yc) + (xb - xd) */ - s2 = s2 + t2; + s2 = (_Float16)s2 + (_Float16)t2; /* xb' = (xa+yb-xc-yd)co1 + (ya-xb-yc+xd)(si1) */ - pSrc[2U * i2] = (r1 * co1) + (s1 * si1); + pSrc[2U * i2] = ((_Float16)r1 * (_Float16)co1) + ((_Float16)s1 * (_Float16)si1); /* yb' = (ya-xb-yc+xd)co1 - (xa+yb-xc-yd)(si1) */ - pSrc[(2U * i2) + 1U] = (s1 * co1) - (r1 * si1); + pSrc[(2U * i2) + 1U] = ((_Float16)s1 * (_Float16)co1) - ((_Float16)r1 * (_Float16)si1); /* xd' = (xa-yb-xc+yd)co3 + (ya+xb-yc-xd)(si3) */ - pSrc[2U * i3] = (r2 * co3) + (s2 * si3); + pSrc[2U * i3] = ((_Float16)r2 * (_Float16)co3) + ((_Float16)s2 * (_Float16)si3); /* yd' = (ya+xb-yc-xd)co3 - (xa-yb-xc+yd)(si3) */ - pSrc[(2U * i3) + 1U] = (s2 * co3) - (r2 * si3); + pSrc[(2U * i3) + 1U] = ((_Float16)s2 * (_Float16)co3) - ((_Float16)r2 * (_Float16)si3); i0 += n1; } while ( i0 < fftLen); @@ -734,13 +734,13 @@ float16_t onebyfftLen) ydIn = pSrc[(2U * i3) + 1U]; /* xa + xc */ - Xaplusc = xaIn + xcIn; + Xaplusc = (_Float16)xaIn + (_Float16)xcIn; /* xb + xd */ - Xbplusd = xbIn + xdIn; + Xbplusd = (_Float16)xbIn + (_Float16)xdIn; /* ya + yc */ - Yaplusc = yaIn + ycIn; + Yaplusc = (_Float16)yaIn + (_Float16)ycIn; /* yb + yd */ - Ybplusd = ybIn + ydIn; + Ybplusd = (_Float16)ybIn + (_Float16)ydIn; /* index calculation for the coefficients */ ia2 = ia1 + ia1; @@ -748,32 +748,32 @@ float16_t onebyfftLen) si2 = pCoef[(ia2 * 2U) + 1U]; /* xa - xc */ - Xaminusc = xaIn - xcIn; + Xaminusc = (_Float16)xaIn - (_Float16)xcIn; /* xb - xd */ - Xbminusd = xbIn - xdIn; + Xbminusd = (_Float16)xbIn - (_Float16)xdIn; /* ya - yc */ - Yaminusc = yaIn - ycIn; + Yaminusc = (_Float16)yaIn - (_Float16)ycIn; /* yb - yd */ - Ybminusd = ybIn - ydIn; + Ybminusd = (_Float16)ybIn - (_Float16)ydIn; /* xa' = xa + xb + xc + xd */ - pSrc[(2U * i0)] = Xaplusc + Xbplusd; + pSrc[(2U * i0)] = (_Float16)Xaplusc + (_Float16)Xbplusd; /* ya' = ya + yb + yc + yd */ - pSrc[(2U * i0) + 1U] = Yaplusc + Ybplusd; + pSrc[(2U * i0) + 1U] = (_Float16)Yaplusc + (_Float16)Ybplusd; /* (xa - xc) - (yb - yd) */ - Xb12C_out = (Xaminusc - Ybminusd); + Xb12C_out = ((_Float16)Xaminusc - (_Float16)Ybminusd); /* (ya - yc) + (xb - xd) */ - Yb12C_out = (Yaminusc + Xbminusd); + Yb12C_out = ((_Float16)Yaminusc + (_Float16)Xbminusd); /* (xa + xc) - (xb + xd) */ - Xc12C_out = (Xaplusc - Xbplusd); + Xc12C_out = ((_Float16)Xaplusc - (_Float16)Xbplusd); /* (ya + yc) - (yb + yd) */ - Yc12C_out = (Yaplusc - Ybplusd); + Yc12C_out = ((_Float16)Yaplusc - (_Float16)Ybplusd); /* (xa - xc) + (yb - yd) */ - Xd12C_out = (Xaminusc + Ybminusd); + Xd12C_out = ((_Float16)Xaminusc + (_Float16)Ybminusd); /* (ya - yc) - (xb - xd) */ - Yd12C_out = (Yaminusc - Xbminusd); + Yd12C_out = ((_Float16)Yaminusc - (_Float16)Xbminusd); co1 = pCoef[ia1 * 2U]; si1 = pCoef[(ia1 * 2U) + 1U]; @@ -783,38 +783,38 @@ float16_t onebyfftLen) co3 = pCoef[ia3 * 2U]; si3 = pCoef[(ia3 * 2U) + 1U]; - Xb12_out = Xb12C_out * co1; - Yb12_out = Yb12C_out * co1; - Xc12_out = Xc12C_out * co2; - Yc12_out = Yc12C_out * co2; - Xd12_out = Xd12C_out * co3; - Yd12_out = Yd12C_out * co3; + Xb12_out = (_Float16)Xb12C_out * (_Float16)co1; + Yb12_out = (_Float16)Yb12C_out * (_Float16)co1; + Xc12_out = (_Float16)Xc12C_out * (_Float16)co2; + Yc12_out = (_Float16)Yc12C_out * (_Float16)co2; + Xd12_out = (_Float16)Xd12C_out * (_Float16)co3; + Yd12_out = (_Float16)Yd12C_out * (_Float16)co3; /* xb' = (xa+yb-xc-yd)co1 - (ya-xb-yc+xd)(si1) */ //Xb12_out -= Yb12C_out * si1; - p0 = Yb12C_out * si1; + p0 = (_Float16)Yb12C_out * (_Float16)si1; /* yb' = (ya-xb-yc+xd)co1 + (xa+yb-xc-yd)(si1) */ //Yb12_out += Xb12C_out * si1; - p1 = Xb12C_out * si1; + p1 = (_Float16)Xb12C_out * (_Float16)si1; /* xc' = (xa-xb+xc-xd)co2 - (ya-yb+yc-yd)(si2) */ //Xc12_out -= Yc12C_out * si2; - p2 = Yc12C_out * si2; + p2 = (_Float16)Yc12C_out * (_Float16)si2; /* yc' = (ya-yb+yc-yd)co2 + (xa-xb+xc-xd)(si2) */ //Yc12_out += Xc12C_out * si2; - p3 = Xc12C_out * si2; + p3 = (_Float16)Xc12C_out * (_Float16)si2; /* xd' = (xa-yb-xc+yd)co3 - (ya+xb-yc-xd)(si3) */ //Xd12_out -= Yd12C_out * si3; - p4 = Yd12C_out * si3; + p4 = (_Float16)Yd12C_out * (_Float16)si3; /* yd' = (ya+xb-yc-xd)co3 + (xa-yb-xc+yd)(si3) */ //Yd12_out += Xd12C_out * si3; - p5 = Xd12C_out * si3; + p5 =(_Float16) Xd12C_out * (_Float16)si3; - Xb12_out -= p0; - Yb12_out += p1; - Xc12_out -= p2; - Yc12_out += p3; - Xd12_out -= p4; - Yd12_out += p5; + Xb12_out -= (_Float16)p0; + Yb12_out += (_Float16)p1; + Xc12_out -= (_Float16)p2; + Yc12_out += (_Float16)p3; + Xd12_out -= (_Float16)p4; + Yd12_out += (_Float16)p5; /* xc' = (xa-xb+xc-xd)co2 - (ya-yb+yc-yd)(si2) */ pSrc[2U * i1] = Xc12_out; @@ -891,71 +891,71 @@ float16_t onebyfftLen) ydIn = pSrc[(2U * i3) + 1U]; /* xa - xc */ - Xaminusc = xaIn - xcIn; + Xaminusc = (_Float16)xaIn - (_Float16)xcIn; /* (xb - xd) */ - Xbminusd = xbIn - xdIn; + Xbminusd = (_Float16)xbIn - (_Float16)xdIn; /* ya - yc */ - Yaminusc = yaIn - ycIn; + Yaminusc = (_Float16)yaIn - (_Float16)ycIn; /* (yb - yd) */ - Ybminusd = ybIn - ydIn; + Ybminusd = (_Float16)ybIn - (_Float16)ydIn; /* xa + xc */ - Xaplusc = xaIn + xcIn; + Xaplusc = (_Float16)xaIn + (_Float16)xcIn; /* xb + xd */ - Xbplusd = xbIn + xdIn; + Xbplusd = (_Float16)xbIn + (_Float16)xdIn; /* ya + yc */ - Yaplusc = yaIn + ycIn; + Yaplusc = (_Float16)yaIn + (_Float16)ycIn; /* yb + yd */ - Ybplusd = ybIn + ydIn; + Ybplusd = (_Float16)ybIn + (_Float16)ydIn; /* (xa - xc) - (yb - yd) */ - Xb12C_out = (Xaminusc - Ybminusd); + Xb12C_out = ((_Float16)Xaminusc - (_Float16)Ybminusd); /* (ya - yc) + (xb - xd) */ - Yb12C_out = (Yaminusc + Xbminusd); + Yb12C_out = ((_Float16)Yaminusc + (_Float16)Xbminusd); /* xa + xc -(xb + xd) */ - Xc12C_out = (Xaplusc - Xbplusd); + Xc12C_out = ((_Float16)Xaplusc - (_Float16)Xbplusd); /* (ya + yc) - (yb + yd) */ - Yc12C_out = (Yaplusc - Ybplusd); + Yc12C_out = ((_Float16)Yaplusc - (_Float16)Ybplusd); /* (xa - xc) + (yb - yd) */ - Xd12C_out = (Xaminusc + Ybminusd); + Xd12C_out = ((_Float16)Xaminusc + (_Float16)Ybminusd); /* (ya - yc) - (xb - xd) */ - Yd12C_out = (Yaminusc - Xbminusd); + Yd12C_out = ((_Float16)Yaminusc - (_Float16)Xbminusd); - pSrc[(2U * i0)] = Xaplusc + Xbplusd; - pSrc[(2U * i0) + 1U] = Yaplusc + Ybplusd; + pSrc[(2U * i0)] = (_Float16)Xaplusc + (_Float16)Xbplusd; + pSrc[(2U * i0) + 1U] = (_Float16)Yaplusc + (_Float16)Ybplusd; - Xb12_out = Xb12C_out * co1; - Yb12_out = Yb12C_out * co1; - Xc12_out = Xc12C_out * co2; - Yc12_out = Yc12C_out * co2; - Xd12_out = Xd12C_out * co3; - Yd12_out = Yd12C_out * co3; + Xb12_out = (_Float16)Xb12C_out * (_Float16)co1; + Yb12_out = (_Float16)Yb12C_out * (_Float16)co1; + Xc12_out = (_Float16)Xc12C_out * (_Float16)co2; + Yc12_out = (_Float16)Yc12C_out * (_Float16)co2; + Xd12_out = (_Float16)Xd12C_out * (_Float16)co3; + Yd12_out = (_Float16)Yd12C_out * (_Float16)co3; /* xb' = (xa+yb-xc-yd)co1 - (ya-xb-yc+xd)(si1) */ //Xb12_out -= Yb12C_out * si1; - p0 = Yb12C_out * si1; + p0 = (_Float16)Yb12C_out * (_Float16)si1; /* yb' = (ya-xb-yc+xd)co1 + (xa+yb-xc-yd)(si1) */ //Yb12_out += Xb12C_out * si1; - p1 = Xb12C_out * si1; + p1 = (_Float16)Xb12C_out * (_Float16)si1; /* xc' = (xa-xb+xc-xd)co2 - (ya-yb+yc-yd)(si2) */ //Xc12_out -= Yc12C_out * si2; - p2 = Yc12C_out * si2; + p2 = (_Float16)Yc12C_out * (_Float16)si2; /* yc' = (ya-yb+yc-yd)co2 + (xa-xb+xc-xd)(si2) */ //Yc12_out += Xc12C_out * si2; - p3 = Xc12C_out * si2; + p3 = (_Float16)Xc12C_out * (_Float16)si2; /* xd' = (xa-yb-xc+yd)co3 - (ya+xb-yc-xd)(si3) */ //Xd12_out -= Yd12C_out * si3; - p4 = Yd12C_out * si3; + p4 = (_Float16)Yd12C_out * (_Float16)si3; /* yd' = (ya+xb-yc-xd)co3 + (xa-yb-xc+yd)(si3) */ //Yd12_out += Xd12C_out * si3; - p5 = Xd12C_out * si3; + p5 = (_Float16)Xd12C_out * (_Float16)si3; - Xb12_out -= p0; - Yb12_out += p1; - Xc12_out -= p2; - Yc12_out += p3; - Xd12_out -= p4; - Yd12_out += p5; + Xb12_out -= (_Float16)p0; + Yb12_out += (_Float16)p1; + Xc12_out -= (_Float16)p2; + Yc12_out += (_Float16)p3; + Xd12_out -= (_Float16)p4; + Yd12_out += (_Float16)p5; /* xc' = (xa-xb+xc-xd)co2 - (ya-yb+yc-yd)(si2) */ pSrc[2U * i1] = Xc12_out; @@ -1000,54 +1000,54 @@ float16_t onebyfftLen) /* Butterfly implementation */ /* xa + xc */ - Xaplusc = xaIn + xcIn; + Xaplusc = (_Float16)xaIn + (_Float16)xcIn; /* xa - xc */ - Xaminusc = xaIn - xcIn; + Xaminusc = (_Float16)xaIn - (_Float16)xcIn; /* ya + yc */ - Yaplusc = yaIn + ycIn; + Yaplusc = (_Float16)yaIn + (_Float16)ycIn; /* ya - yc */ - Yaminusc = yaIn - ycIn; + Yaminusc = (_Float16)yaIn - (_Float16)ycIn; /* xb + xd */ - Xbplusd = xbIn + xdIn; + Xbplusd = (_Float16)xbIn + (_Float16)xdIn; /* yb + yd */ - Ybplusd = ybIn + ydIn; + Ybplusd = (_Float16)ybIn + (_Float16)ydIn; /* (xb-xd) */ - Xbminusd = xbIn - xdIn; + Xbminusd = (_Float16)xbIn - (_Float16)xdIn; /* (yb-yd) */ - Ybminusd = ybIn - ydIn; + Ybminusd = (_Float16)ybIn - (_Float16)ydIn; /* xa' = (xa+xb+xc+xd) * onebyfftLen */ - a0 = (Xaplusc + Xbplusd); + a0 = ((_Float16)Xaplusc + (_Float16)Xbplusd); /* ya' = (ya+yb+yc+yd) * onebyfftLen */ - a1 = (Yaplusc + Ybplusd); + a1 = ((_Float16)Yaplusc + (_Float16)Ybplusd); /* xc' = (xa-xb+xc-xd) * onebyfftLen */ - a2 = (Xaplusc - Xbplusd); + a2 = ((_Float16)Xaplusc - (_Float16)Xbplusd); /* yc' = (ya-yb+yc-yd) * onebyfftLen */ - a3 = (Yaplusc - Ybplusd); + a3 = ((_Float16)Yaplusc - (_Float16)Ybplusd); /* xb' = (xa-yb-xc+yd) * onebyfftLen */ - a4 = (Xaminusc - Ybminusd); + a4 = ((_Float16)Xaminusc - (_Float16)Ybminusd); /* yb' = (ya+xb-yc-xd) * onebyfftLen */ - a5 = (Yaminusc + Xbminusd); + a5 = ((_Float16)Yaminusc + (_Float16)Xbminusd); /* xd' = (xa-yb-xc+yd) * onebyfftLen */ - a6 = (Xaminusc + Ybminusd); + a6 = ((_Float16)Xaminusc + (_Float16)Ybminusd); /* yd' = (ya-xb-yc+xd) * onebyfftLen */ - a7 = (Yaminusc - Xbminusd); + a7 = ((_Float16)Yaminusc - (_Float16)Xbminusd); - p0 = a0 * onebyfftLen; - p1 = a1 * onebyfftLen; - p2 = a2 * onebyfftLen; - p3 = a3 * onebyfftLen; - p4 = a4 * onebyfftLen; - p5 = a5 * onebyfftLen; - p6 = a6 * onebyfftLen; - p7 = a7 * onebyfftLen; + p0 = (_Float16)a0 * (_Float16)onebyfftLen; + p1 = (_Float16)a1 * (_Float16)onebyfftLen; + p2 = (_Float16)a2 * (_Float16)onebyfftLen; + p3 = (_Float16)a3 * (_Float16)onebyfftLen; + p4 = (_Float16)a4 * (_Float16)onebyfftLen; + p5 = (_Float16)a5 * (_Float16)onebyfftLen; + p6 = (_Float16)a6 * (_Float16)onebyfftLen; + p7 = (_Float16)a7 * (_Float16)onebyfftLen; /* xa' = (xa+xb+xc+xd) * onebyfftLen */ ptr1[0] = p0; @@ -1116,70 +1116,70 @@ float16_t onebyfftLen) i3 = i2 + n2; /* xa + xc */ - r1 = pSrc[(2U * i0)] + pSrc[(2U * i2)]; + r1 = (_Float16)pSrc[(2U * i0)] + (_Float16)pSrc[(2U * i2)]; /* xa - xc */ - r2 = pSrc[(2U * i0)] - pSrc[(2U * i2)]; + r2 = (_Float16)pSrc[(2U * i0)] - (_Float16)pSrc[(2U * i2)]; /* ya + yc */ - s1 = pSrc[(2U * i0) + 1U] + pSrc[(2U * i2) + 1U]; + s1 = (_Float16)pSrc[(2U * i0) + 1U] + (_Float16)pSrc[(2U * i2) + 1U]; /* ya - yc */ - s2 = pSrc[(2U * i0) + 1U] - pSrc[(2U * i2) + 1U]; + s2 = (_Float16)pSrc[(2U * i0) + 1U] - (_Float16)pSrc[(2U * i2) + 1U]; /* xb + xd */ - t1 = pSrc[2U * i1] + pSrc[2U * i3]; + t1 = (_Float16)pSrc[2U * i1] + (_Float16)pSrc[2U * i3]; /* xa' = xa + xb + xc + xd */ - pSrc[2U * i0] = r1 + t1; + pSrc[2U * i0] = (_Float16)r1 + (_Float16)t1; /* xa + xc -(xb + xd) */ - r1 = r1 - t1; + r1 = (_Float16)r1 - (_Float16)t1; /* yb + yd */ - t2 = pSrc[(2U * i1) + 1U] + pSrc[(2U * i3) + 1U]; + t2 = (_Float16)pSrc[(2U * i1) + 1U] + (_Float16)pSrc[(2U * i3) + 1U]; /* ya' = ya + yb + yc + yd */ - pSrc[(2U * i0) + 1U] = s1 + t2; + pSrc[(2U * i0) + 1U] = (_Float16)s1 + (_Float16)t2; /* (ya + yc) - (yb + yd) */ - s1 = s1 - t2; + s1 = (_Float16)s1 - (_Float16)t2; /* (yb - yd) */ - t1 = pSrc[(2U * i1) + 1U] - pSrc[(2U * i3) + 1U]; + t1 = (_Float16)pSrc[(2U * i1) + 1U] - (_Float16)pSrc[(2U * i3) + 1U]; /* (xb - xd) */ - t2 = pSrc[2U * i1] - pSrc[2U * i3]; + t2 = (_Float16)pSrc[2U * i1] - (_Float16)pSrc[2U * i3]; /* xc' = (xa-xb+xc-xd)co2 - (ya-yb+yc-yd)(si2) */ - pSrc[2U * i1] = (r1 * co2) - (s1 * si2); + pSrc[2U * i1] = ((_Float16)r1 * (_Float16)co2) - ((_Float16)s1 * (_Float16)si2); /* yc' = (ya-yb+yc-yd)co2 + (xa-xb+xc-xd)(si2) */ - pSrc[(2U * i1) + 1U] = (s1 * co2) + (r1 * si2); + pSrc[(2U * i1) + 1U] = ((_Float16)s1 * (_Float16)co2) + ((_Float16)r1 * (_Float16)si2); /* (xa - xc) - (yb - yd) */ - r1 = r2 - t1; + r1 = (_Float16)r2 - (_Float16)t1; /* (xa - xc) + (yb - yd) */ - r2 = r2 + t1; + r2 = (_Float16)r2 + (_Float16)t1; /* (ya - yc) + (xb - xd) */ - s1 = s2 + t2; + s1 = (_Float16)s2 + (_Float16)t2; /* (ya - yc) - (xb - xd) */ - s2 = s2 - t2; + s2 = (_Float16)s2 - (_Float16)t2; /* xb' = (xa+yb-xc-yd)co1 - (ya-xb-yc+xd)(si1) */ - pSrc[2U * i2] = (r1 * co1) - (s1 * si1); + pSrc[2U * i2] = ((_Float16)r1 * (_Float16)co1) - ((_Float16)s1 * (_Float16)si1); /* yb' = (ya-xb-yc+xd)co1 + (xa+yb-xc-yd)(si1) */ - pSrc[(2U * i2) + 1U] = (s1 * co1) + (r1 * si1); + pSrc[(2U * i2) + 1U] = ((_Float16)s1 * (_Float16)co1) + ((_Float16)r1 * (_Float16)si1); /* xd' = (xa-yb-xc+yd)co3 - (ya+xb-yc-xd)(si3) */ - pSrc[2U * i3] = (r2 * co3) - (s2 * si3); + pSrc[2U * i3] = ((_Float16)r2 * (_Float16)co3) - ((_Float16)s2 * (_Float16)si3); /* yd' = (ya+xb-yc-xd)co3 + (xa-yb-xc+yd)(si3) */ - pSrc[(2U * i3) + 1U] = (s2 * co3) + (r2 * si3); + pSrc[(2U * i3) + 1U] = ((_Float16)s2 * (_Float16)co3) + ((_Float16)r2 * (_Float16)si3); i0 += n1; } while ( i0 < fftLen); @@ -1202,74 +1202,75 @@ float16_t onebyfftLen) /* Butterfly implementation */ /* xa + xc */ - r1 = pSrc[2U * i0] + pSrc[2U * i2]; + r1 = (_Float16)pSrc[2U * i0] + (_Float16)pSrc[2U * i2]; /* xa - xc */ - r2 = pSrc[2U * i0] - pSrc[2U * i2]; + r2 = (_Float16)pSrc[2U * i0] - (_Float16)pSrc[2U * i2]; /* ya + yc */ - s1 = pSrc[(2U * i0) + 1U] + pSrc[(2U * i2) + 1U]; + s1 = (_Float16)pSrc[(2U * i0) + 1U] + (_Float16)pSrc[(2U * i2) + 1U]; /* ya - yc */ - s2 = pSrc[(2U * i0) + 1U] - pSrc[(2U * i2) + 1U]; + s2 = (_Float16)pSrc[(2U * i0) + 1U] - (_Float16)pSrc[(2U * i2) + 1U]; /* xc + xd */ - t1 = pSrc[2U * i1] + pSrc[2U * i3]; + t1 = (_Float16)pSrc[2U * i1] + (_Float16)pSrc[2U * i3]; /* xa' = xa + xb + xc + xd */ - pSrc[2U * i0] = (r1 + t1) * onebyfftLen; + pSrc[2U * i0] = ((_Float16)r1 + (_Float16)t1) * (_Float16)onebyfftLen; /* (xa + xb) - (xc + xd) */ - r1 = r1 - t1; + r1 = (_Float16)r1 - (_Float16)t1; /* yb + yd */ - t2 = pSrc[(2U * i1) + 1U] + pSrc[(2U * i3) + 1U]; + t2 = (_Float16)pSrc[(2U * i1) + 1U] + (_Float16)pSrc[(2U * i3) + 1U]; /* ya' = ya + yb + yc + yd */ - pSrc[(2U * i0) + 1U] = (s1 + t2) * onebyfftLen; + pSrc[(2U * i0) + 1U] = ((_Float16)s1 + (_Float16)t2) * (_Float16)onebyfftLen; /* (ya + yc) - (yb + yd) */ - s1 = s1 - t2; + s1 = (_Float16)s1 - (_Float16)t2; /* (yb-yd) */ - t1 = pSrc[(2U * i1) + 1U] - pSrc[(2U * i3) + 1U]; + t1 = (_Float16)pSrc[(2U * i1) + 1U] - (_Float16)pSrc[(2U * i3) + 1U]; /* (xb-xd) */ - t2 = pSrc[2U * i1] - pSrc[2U * i3]; + t2 = (_Float16)pSrc[2U * i1] - (_Float16)pSrc[2U * i3]; /* xc' = (xa-xb+xc-xd)co2 - (ya-yb+yc-yd)(si2) */ - pSrc[2U * i1] = r1 * onebyfftLen; + pSrc[2U * i1] = (_Float16)r1 * (_Float16)onebyfftLen; /* yc' = (ya-yb+yc-yd)co2 + (xa-xb+xc-xd)(si2) */ - pSrc[(2U * i1) + 1U] = s1 * onebyfftLen; + pSrc[(2U * i1) + 1U] = (_Float16)s1 * (_Float16)onebyfftLen; /* (xa - xc) - (yb-yd) */ - r1 = r2 - t1; + r1 = (_Float16)r2 - (_Float16)t1; /* (xa - xc) + (yb-yd) */ - r2 = r2 + t1; + r2 = (_Float16)r2 + (_Float16)t1; /* (ya - yc) + (xb-xd) */ - s1 = s2 + t2; + s1 = (_Float16)s2 + (_Float16)t2; /* (ya - yc) - (xb-xd) */ - s2 = s2 - t2; + s2 = (_Float16)s2 - (_Float16)t2; /* xb' = (xa+yb-xc-yd)co1 - (ya-xb-yc+xd)(si1) */ - pSrc[2U * i2] = r1 * onebyfftLen; + pSrc[2U * i2] = (_Float16)r1 * (_Float16)onebyfftLen; /* yb' = (ya-xb-yc+xd)co1 + (xa+yb-xc-yd)(si1) */ - pSrc[(2U * i2) + 1U] = s1 * onebyfftLen; + pSrc[(2U * i2) + 1U] = (_Float16)s1 * (_Float16)onebyfftLen; /* xd' = (xa-yb-xc+yd)co3 - (ya+xb-yc-xd)(si3) */ - pSrc[2U * i3] = r2 * onebyfftLen; + pSrc[2U * i3] = (_Float16)r2 * (_Float16)onebyfftLen; /* yd' = (ya+xb-yc-xd)co3 + (xa-yb-xc+yd)(si3) */ - pSrc[(2U * i3) + 1U] = s2 * onebyfftLen; + pSrc[(2U * i3) + 1U] = (_Float16)s2 * (_Float16)onebyfftLen; } #endif /* #if defined (ARM_MATH_DSP) */ } #endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_f32.c index 1bc2f77..4c7020a 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_f32.c @@ -5,13 +5,13 @@ * Title: arm_cfft_radix4_f32.c * Description: Radix-4 Decimation in Frequency CFFT & CIFFT Floating point processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_f16.c index d83e138..152542d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_f16.c @@ -5,13 +5,13 @@ * Title: arm_cfft_radix4_init_f16.c * Description: Radix-4 Decimation in Frequency Floating-point CFFT & CIFFT Initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_f32.c index d218140..3d1a5ef 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_cfft_radix4_init_f32.c * Description: Radix-4 Decimation in Frequency Floating-point CFFT & CIFFT Initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_q15.c index 49858ee..c4a024e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_q15.c @@ -5,13 +5,13 @@ * Title: arm_cfft_radix4_init_q15.c * Description: Radix-4 Decimation in Frequency Q15 FFT & IFFT initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -93,7 +93,7 @@ arm_status arm_cfft_radix4_init_q15( /* Initialise the Flag for calculation Bit reversal or not */ S->bitReverseFlag = bitReverseFlag; -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_4096) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREV_1024) /* Initializations of structure parameters depending on the FFT length */ switch (S->fftLen) @@ -106,7 +106,7 @@ arm_status arm_cfft_radix4_init_q15( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 1U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) armBitRevIndexTable_fixed_4096; + S->pBitRevTable = (uint16_t *) armBitRevTable; break; @@ -114,7 +114,7 @@ arm_status arm_cfft_radix4_init_q15( /* Initializations of structure parameters for 1024 point FFT */ S->twidCoefModifier = 4U; S->bitRevFactor = 4U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[3]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[3]; break; @@ -122,7 +122,7 @@ arm_status arm_cfft_radix4_init_q15( /* Initializations of structure parameters for 256 point FFT */ S->twidCoefModifier = 16U; S->bitRevFactor = 16U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[15]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[15]; break; @@ -130,7 +130,7 @@ arm_status arm_cfft_radix4_init_q15( /* Initializations of structure parameters for 64 point FFT */ S->twidCoefModifier = 64U; S->bitRevFactor = 64U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[63]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[63]; break; @@ -138,7 +138,7 @@ arm_status arm_cfft_radix4_init_q15( /* Initializations of structure parameters for 16 point FFT */ S->twidCoefModifier = 256U; S->bitRevFactor = 256U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[255]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[255]; break; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_q31.c index 6cde656..9b6273f 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_cfft_radix4_init_q31.c * Description: Radix-4 Decimation in Frequency Q31 FFT & IFFT initialization function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -80,7 +80,7 @@ arm_status arm_cfft_radix4_init_q31( #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_4096) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_4096) /* Initialise the default arm status */ status = ARM_MATH_SUCCESS; @@ -93,7 +93,7 @@ arm_status arm_cfft_radix4_init_q31( /* Initialise the Flag for calculation Bit reversal or not */ S->bitReverseFlag = bitReverseFlag; -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_4096) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREV_1024) /* Initializations of Instance structure depending on the FFT length */ switch (S->fftLen) @@ -105,7 +105,7 @@ arm_status arm_cfft_radix4_init_q31( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 1U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) armBitRevIndexTable_fixed_4096; + S->pBitRevTable = (uint16_t *) armBitRevTable; break; /* Initializations of structure parameters for 1024 point FFT */ @@ -115,28 +115,28 @@ arm_status arm_cfft_radix4_init_q31( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 4U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[3]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[3]; break; case 256U: /* Initializations of structure parameters for 256 point FFT */ S->twidCoefModifier = 16U; S->bitRevFactor = 16U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[15]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[15]; break; case 64U: /* Initializations of structure parameters for 64 point FFT */ S->twidCoefModifier = 64U; S->bitRevFactor = 64U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[63]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[63]; break; case 16U: /* Initializations of structure parameters for 16 point FFT */ S->twidCoefModifier = 256U; S->bitRevFactor = 256U; - S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[255]; + S->pBitRevTable = (uint16_t *) & armBitRevTable[255]; break; default: diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_q15.c index 33edbf1..33b5029 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_q15.c @@ -6,13 +6,13 @@ * Description: This file has function definition of Radix-4 FFT & IFFT function and * In-place bit reversal using bit reversal table * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -72,8 +72,21 @@ void arm_bitreversal_q15( Hence the output format is different for different FFT sizes. The input and output formats for different FFT sizes and number of bits to upscale are mentioned in the tables below for CFFT and CIFFT: @par - \image html CFFTQ15.gif "Input and Output Formats for Q15 CFFT" - \image html CIFFTQ15.gif "Input and Output Formats for Q15 CIFFT" + +| CFFT Size | Input format | Output format | Number of bits to upscale | +| --------: | ------------: | ------------: | ------------------------: | +| 16 | 1.15 | 5.11 | 4 | +| 64 | 1.15 | 7.9 | 6 | +| 256 | 1.15 | 9.7 | 8 | +| 1024 | 1.15 | 11.5 | 10 | + +| CIFFT Size | Input format | Output format | Number of bits to upscale | +| ---------: | ------------: | ------------: | ------------------------: | +| 16 | 1.15 | 5.11 | 0 | +| 64 | 1.15 | 7.9 | 0 | +| 256 | 1.15 | 9.7 | 0 | +| 1024 | 1.15 | 11.5 | 0 | + */ void arm_cfft_radix4_q15( @@ -497,16 +510,16 @@ void arm_radix4_butterfly_q15( do { /* Read xa (real), ya(imag) input */ - xaya = read_q15x2_ia ((q15_t **) &ptr1); + xaya = read_q15x2_ia (&ptr1); /* Read xb (real), yb(imag) input */ - xbyb = read_q15x2_ia ((q15_t **) &ptr1); + xbyb = read_q15x2_ia (&ptr1); /* Read xc (real), yc(imag) input */ - xcyc = read_q15x2_ia ((q15_t **) &ptr1); + xcyc = read_q15x2_ia (&ptr1); /* Read xd (real), yd(imag) input */ - xdyd = read_q15x2_ia ((q15_t **) &ptr1); + xdyd = read_q15x2_ia (&ptr1); /* R = packed((ya + yc), (xa + xc)) */ R = __QADD16(xaya, xcyc); @@ -1360,16 +1373,16 @@ void arm_radix4_butterfly_inverse_q15( do { /* Read xa (real), ya(imag) input */ - xaya = read_q15x2_ia ((q15_t **) &ptr1); + xaya = read_q15x2_ia (&ptr1); /* Read xb (real), yb(imag) input */ - xbyb = read_q15x2_ia ((q15_t **) &ptr1); + xbyb = read_q15x2_ia (&ptr1); /* Read xc (real), yc(imag) input */ - xcyc = read_q15x2_ia ((q15_t **) &ptr1); + xcyc = read_q15x2_ia (&ptr1); /* Read xd (real), yd(imag) input */ - xdyd = read_q15x2_ia ((q15_t **) &ptr1); + xdyd = read_q15x2_ia (&ptr1); /* R = packed((ya + yc), (xa + xc)) */ R = __QADD16(xaya, xcyc); diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_q31.c index 7e5d38b..bad1640 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_q31.c @@ -6,13 +6,13 @@ * Description: This file has function definition of Radix-4 FFT & IFFT function and * In-place bit reversal using bit reversal table * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -70,8 +70,21 @@ void arm_bitreversal_q31( Hence the output format is different for different FFT sizes. The input and output formats for different FFT sizes and number of bits to upscale are mentioned in the tables below for CFFT and CIFFT: @par - \image html CFFTQ31.gif "Input and Output Formats for Q31 CFFT" - \image html CIFFTQ31.gif "Input and Output Formats for Q31 CIFFT" + +| CFFT Size | Input format | Output format | Number of bits to upscale | +| --------: | ------------: | ------------: | ------------------------: | +| 16 | 1.31 | 5.27 | 4 | +| 64 | 1.31 | 7.25 | 6 | +| 256 | 1.31 | 9.23 | 8 | +| 1024 | 1.31 | 11.21 | 10 | + +| CIFFT Size | Input format | Output format | Number of bits to upscale | +| ---------: | ------------: | ------------: | ------------------------: | +| 16 | 1.31 | 5.27 | 0 | +| 64 | 1.31 | 7.25 | 0 | +| 256 | 1.31 | 9.23 | 0 | +| 1024 | 1.31 | 11.21 | 0 | + */ void arm_cfft_radix4_q31( diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix8_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix8_f16.c index d9582f5..77dfc5b 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix8_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix8_f16.c @@ -5,11 +5,13 @@ * Title: arm_cfft_radix8_f16.c * Description: Radix-8 Decimation in Frequency CFFT & CIFFT Floating point processing function * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -61,7 +63,7 @@ void arm_radix8_butterfly_f16( float16_t p1, p2, p3, p4; float16_t co2, co3, co4, co5, co6, co7, co8; float16_t si2, si3, si4, si5, si6, si7, si8; - const float16_t C81 = 0.70710678118f; + const float16_t C81 = 0.70710678118f16; n2 = fftLen; @@ -80,58 +82,58 @@ void arm_radix8_butterfly_f16( i6 = i5 + n2; i7 = i6 + n2; i8 = i7 + n2; - r1 = pSrc[2 * i1] + pSrc[2 * i5]; - r5 = pSrc[2 * i1] - pSrc[2 * i5]; - r2 = pSrc[2 * i2] + pSrc[2 * i6]; - r6 = pSrc[2 * i2] - pSrc[2 * i6]; - r3 = pSrc[2 * i3] + pSrc[2 * i7]; - r7 = pSrc[2 * i3] - pSrc[2 * i7]; - r4 = pSrc[2 * i4] + pSrc[2 * i8]; - r8 = pSrc[2 * i4] - pSrc[2 * i8]; - t1 = r1 - r3; - r1 = r1 + r3; - r3 = r2 - r4; - r2 = r2 + r4; - pSrc[2 * i1] = r1 + r2; - pSrc[2 * i5] = r1 - r2; - r1 = pSrc[2 * i1 + 1] + pSrc[2 * i5 + 1]; - s5 = pSrc[2 * i1 + 1] - pSrc[2 * i5 + 1]; - r2 = pSrc[2 * i2 + 1] + pSrc[2 * i6 + 1]; - s6 = pSrc[2 * i2 + 1] - pSrc[2 * i6 + 1]; - s3 = pSrc[2 * i3 + 1] + pSrc[2 * i7 + 1]; - s7 = pSrc[2 * i3 + 1] - pSrc[2 * i7 + 1]; - r4 = pSrc[2 * i4 + 1] + pSrc[2 * i8 + 1]; - s8 = pSrc[2 * i4 + 1] - pSrc[2 * i8 + 1]; - t2 = r1 - s3; - r1 = r1 + s3; - s3 = r2 - r4; - r2 = r2 + r4; - pSrc[2 * i1 + 1] = r1 + r2; - pSrc[2 * i5 + 1] = r1 - r2; - pSrc[2 * i3] = t1 + s3; - pSrc[2 * i7] = t1 - s3; - pSrc[2 * i3 + 1] = t2 - r3; - pSrc[2 * i7 + 1] = t2 + r3; - r1 = (r6 - r8) * C81; - r6 = (r6 + r8) * C81; - r2 = (s6 - s8) * C81; - s6 = (s6 + s8) * C81; - t1 = r5 - r1; - r5 = r5 + r1; - r8 = r7 - r6; - r7 = r7 + r6; - t2 = s5 - r2; - s5 = s5 + r2; - s8 = s7 - s6; - s7 = s7 + s6; - pSrc[2 * i2] = r5 + s7; - pSrc[2 * i8] = r5 - s7; - pSrc[2 * i6] = t1 + s8; - pSrc[2 * i4] = t1 - s8; - pSrc[2 * i2 + 1] = s5 - r7; - pSrc[2 * i8 + 1] = s5 + r7; - pSrc[2 * i6 + 1] = t2 - r8; - pSrc[2 * i4 + 1] = t2 + r8; + r1 = (_Float16)pSrc[2 * i1] + (_Float16)pSrc[2 * i5]; + r5 = (_Float16)pSrc[2 * i1] - (_Float16)pSrc[2 * i5]; + r2 = (_Float16)pSrc[2 * i2] + (_Float16)pSrc[2 * i6]; + r6 = (_Float16)pSrc[2 * i2] - (_Float16)pSrc[2 * i6]; + r3 = (_Float16)pSrc[2 * i3] + (_Float16)pSrc[2 * i7]; + r7 = (_Float16)pSrc[2 * i3] - (_Float16)pSrc[2 * i7]; + r4 = (_Float16)pSrc[2 * i4] + (_Float16)pSrc[2 * i8]; + r8 = (_Float16)pSrc[2 * i4] - (_Float16)pSrc[2 * i8]; + t1 = (_Float16)r1 - (_Float16)r3; + r1 = (_Float16)r1 + (_Float16)r3; + r3 = (_Float16)r2 - (_Float16)r4; + r2 = (_Float16)r2 + (_Float16)r4; + pSrc[2 * i1] = (_Float16)r1 + (_Float16)r2; + pSrc[2 * i5] = (_Float16)r1 - (_Float16)r2; + r1 = (_Float16)pSrc[2 * i1 + 1] + (_Float16)pSrc[2 * i5 + 1]; + s5 = (_Float16)pSrc[2 * i1 + 1] - (_Float16)pSrc[2 * i5 + 1]; + r2 = (_Float16)pSrc[2 * i2 + 1] + (_Float16)pSrc[2 * i6 + 1]; + s6 = (_Float16)pSrc[2 * i2 + 1] - (_Float16)pSrc[2 * i6 + 1]; + s3 = (_Float16)pSrc[2 * i3 + 1] + (_Float16)pSrc[2 * i7 + 1]; + s7 = (_Float16)pSrc[2 * i3 + 1] - (_Float16)pSrc[2 * i7 + 1]; + r4 = (_Float16)pSrc[2 * i4 + 1] + (_Float16)pSrc[2 * i8 + 1]; + s8 = (_Float16)pSrc[2 * i4 + 1] - (_Float16)pSrc[2 * i8 + 1]; + t2 = (_Float16)r1 - (_Float16)s3; + r1 = (_Float16)r1 + (_Float16)s3; + s3 = (_Float16)r2 - (_Float16)r4; + r2 = (_Float16)r2 + (_Float16)r4; + pSrc[2 * i1 + 1] = (_Float16)r1 + (_Float16)r2; + pSrc[2 * i5 + 1] = (_Float16)r1 - (_Float16)r2; + pSrc[2 * i3] = (_Float16)t1 + (_Float16)s3; + pSrc[2 * i7] = (_Float16)t1 - (_Float16)s3; + pSrc[2 * i3 + 1] = (_Float16)t2 - (_Float16)r3; + pSrc[2 * i7 + 1] = (_Float16)t2 + (_Float16)r3; + r1 = ((_Float16)r6 - (_Float16)r8) * (_Float16)C81; + r6 = ((_Float16)r6 + (_Float16)r8) * (_Float16)C81; + r2 = ((_Float16)s6 - (_Float16)s8) * (_Float16)C81; + s6 = ((_Float16)s6 + (_Float16)s8) * (_Float16)C81; + t1 = (_Float16)r5 - (_Float16)r1; + r5 = (_Float16)r5 + (_Float16)r1; + r8 = (_Float16)r7 - (_Float16)r6; + r7 = (_Float16)r7 + (_Float16)r6; + t2 = (_Float16)s5 - (_Float16)r2; + s5 = (_Float16)s5 + (_Float16)r2; + s8 = (_Float16)s7 - (_Float16)s6; + s7 = (_Float16)s7 + (_Float16)s6; + pSrc[2 * i2] = (_Float16)r5 + (_Float16)s7; + pSrc[2 * i8] = (_Float16)r5 - (_Float16)s7; + pSrc[2 * i6] = (_Float16)t1 + (_Float16)s8; + pSrc[2 * i4] = (_Float16)t1 - (_Float16)s8; + pSrc[2 * i2 + 1] = (_Float16)s5 - (_Float16)r7; + pSrc[2 * i8 + 1] = (_Float16)s5 + (_Float16)r7; + pSrc[2 * i6 + 1] = (_Float16)t2 - (_Float16)r8; + pSrc[2 * i4 + 1] = (_Float16)t2 + (_Float16)r8; i1 += n1; } while (i1 < fftLen); @@ -181,100 +183,100 @@ void arm_radix8_butterfly_f16( i6 = i5 + n2; i7 = i6 + n2; i8 = i7 + n2; - r1 = pSrc[2 * i1] + pSrc[2 * i5]; - r5 = pSrc[2 * i1] - pSrc[2 * i5]; - r2 = pSrc[2 * i2] + pSrc[2 * i6]; - r6 = pSrc[2 * i2] - pSrc[2 * i6]; - r3 = pSrc[2 * i3] + pSrc[2 * i7]; - r7 = pSrc[2 * i3] - pSrc[2 * i7]; - r4 = pSrc[2 * i4] + pSrc[2 * i8]; - r8 = pSrc[2 * i4] - pSrc[2 * i8]; - t1 = r1 - r3; - r1 = r1 + r3; - r3 = r2 - r4; - r2 = r2 + r4; - pSrc[2 * i1] = r1 + r2; - r2 = r1 - r2; - s1 = pSrc[2 * i1 + 1] + pSrc[2 * i5 + 1]; - s5 = pSrc[2 * i1 + 1] - pSrc[2 * i5 + 1]; - s2 = pSrc[2 * i2 + 1] + pSrc[2 * i6 + 1]; - s6 = pSrc[2 * i2 + 1] - pSrc[2 * i6 + 1]; - s3 = pSrc[2 * i3 + 1] + pSrc[2 * i7 + 1]; - s7 = pSrc[2 * i3 + 1] - pSrc[2 * i7 + 1]; - s4 = pSrc[2 * i4 + 1] + pSrc[2 * i8 + 1]; - s8 = pSrc[2 * i4 + 1] - pSrc[2 * i8 + 1]; - t2 = s1 - s3; - s1 = s1 + s3; - s3 = s2 - s4; - s2 = s2 + s4; - r1 = t1 + s3; - t1 = t1 - s3; - pSrc[2 * i1 + 1] = s1 + s2; - s2 = s1 - s2; - s1 = t2 - r3; - t2 = t2 + r3; - p1 = co5 * r2; - p2 = si5 * s2; - p3 = co5 * s2; - p4 = si5 * r2; - pSrc[2 * i5] = p1 + p2; - pSrc[2 * i5 + 1] = p3 - p4; - p1 = co3 * r1; - p2 = si3 * s1; - p3 = co3 * s1; - p4 = si3 * r1; - pSrc[2 * i3] = p1 + p2; - pSrc[2 * i3 + 1] = p3 - p4; - p1 = co7 * t1; - p2 = si7 * t2; - p3 = co7 * t2; - p4 = si7 * t1; - pSrc[2 * i7] = p1 + p2; - pSrc[2 * i7 + 1] = p3 - p4; - r1 = (r6 - r8) * C81; - r6 = (r6 + r8) * C81; - s1 = (s6 - s8) * C81; - s6 = (s6 + s8) * C81; - t1 = r5 - r1; - r5 = r5 + r1; - r8 = r7 - r6; - r7 = r7 + r6; - t2 = s5 - s1; - s5 = s5 + s1; - s8 = s7 - s6; - s7 = s7 + s6; - r1 = r5 + s7; - r5 = r5 - s7; - r6 = t1 + s8; - t1 = t1 - s8; - s1 = s5 - r7; - s5 = s5 + r7; - s6 = t2 - r8; - t2 = t2 + r8; - p1 = co2 * r1; - p2 = si2 * s1; - p3 = co2 * s1; - p4 = si2 * r1; - pSrc[2 * i2] = p1 + p2; - pSrc[2 * i2 + 1] = p3 - p4; - p1 = co8 * r5; - p2 = si8 * s5; - p3 = co8 * s5; - p4 = si8 * r5; - pSrc[2 * i8] = p1 + p2; - pSrc[2 * i8 + 1] = p3 - p4; - p1 = co6 * r6; - p2 = si6 * s6; - p3 = co6 * s6; - p4 = si6 * r6; - pSrc[2 * i6] = p1 + p2; - pSrc[2 * i6 + 1] = p3 - p4; - p1 = co4 * t1; - p2 = si4 * t2; - p3 = co4 * t2; - p4 = si4 * t1; - pSrc[2 * i4] = p1 + p2; - pSrc[2 * i4 + 1] = p3 - p4; + r1 = (_Float16)pSrc[2 * i1] + (_Float16)pSrc[2 * i5]; + r5 = (_Float16)pSrc[2 * i1] - (_Float16)pSrc[2 * i5]; + r2 = (_Float16)pSrc[2 * i2] + (_Float16)pSrc[2 * i6]; + r6 = (_Float16)pSrc[2 * i2] - (_Float16)pSrc[2 * i6]; + r3 = (_Float16)pSrc[2 * i3] + (_Float16)pSrc[2 * i7]; + r7 = (_Float16)pSrc[2 * i3] - (_Float16)pSrc[2 * i7]; + r4 = (_Float16)pSrc[2 * i4] + (_Float16)pSrc[2 * i8]; + r8 = (_Float16)pSrc[2 * i4] - (_Float16)pSrc[2 * i8]; + t1 = (_Float16)r1 - (_Float16)r3; + r1 = (_Float16)r1 + (_Float16)r3; + r3 = (_Float16)r2 - (_Float16)r4; + r2 = (_Float16)r2 + (_Float16)r4; + pSrc[2 * i1] = (_Float16)r1 + (_Float16)r2; + r2 = (_Float16)r1 - (_Float16)r2; + s1 = (_Float16)pSrc[2 * i1 + 1] + (_Float16)pSrc[2 * i5 + 1]; + s5 = (_Float16)pSrc[2 * i1 + 1] - (_Float16)pSrc[2 * i5 + 1]; + s2 = (_Float16)pSrc[2 * i2 + 1] + (_Float16)pSrc[2 * i6 + 1]; + s6 = (_Float16)pSrc[2 * i2 + 1] - (_Float16)pSrc[2 * i6 + 1]; + s3 = (_Float16)pSrc[2 * i3 + 1] + (_Float16)pSrc[2 * i7 + 1]; + s7 = (_Float16)pSrc[2 * i3 + 1] - (_Float16)pSrc[2 * i7 + 1]; + s4 = (_Float16)pSrc[2 * i4 + 1] + (_Float16)pSrc[2 * i8 + 1]; + s8 = (_Float16)pSrc[2 * i4 + 1] - (_Float16)pSrc[2 * i8 + 1]; + t2 = (_Float16)s1 - (_Float16)s3; + s1 = (_Float16)s1 + (_Float16)s3; + s3 = (_Float16)s2 - (_Float16)s4; + s2 = (_Float16)s2 + (_Float16)s4; + r1 = (_Float16)t1 + (_Float16)s3; + t1 = (_Float16)t1 - (_Float16)s3; + pSrc[2 * i1 + 1] = (_Float16)s1 + (_Float16)s2; + s2 = (_Float16)s1 - (_Float16)s2; + s1 = (_Float16)t2 - (_Float16)r3; + t2 = (_Float16)t2 + (_Float16)r3; + p1 = (_Float16)co5 * (_Float16)r2; + p2 = (_Float16)si5 * (_Float16)s2; + p3 = (_Float16)co5 * (_Float16)s2; + p4 = (_Float16)si5 * (_Float16)r2; + pSrc[2 * i5] = (_Float16)p1 + (_Float16)p2; + pSrc[2 * i5 + 1] = (_Float16)p3 - (_Float16)p4; + p1 = (_Float16)co3 * (_Float16)r1; + p2 = (_Float16)si3 * (_Float16)s1; + p3 = (_Float16)co3 * (_Float16)s1; + p4 = (_Float16)si3 * (_Float16)r1; + pSrc[2 * i3] = (_Float16)p1 + (_Float16)p2; + pSrc[2 * i3 + 1] = (_Float16)p3 - (_Float16)p4; + p1 = (_Float16)co7 * (_Float16)t1; + p2 = (_Float16)si7 * (_Float16)t2; + p3 = (_Float16)co7 * (_Float16)t2; + p4 = (_Float16)si7 * (_Float16)t1; + pSrc[2 * i7] = (_Float16)p1 + (_Float16)p2; + pSrc[2 * i7 + 1] = (_Float16)p3 - (_Float16)p4; + r1 = ((_Float16)r6 - (_Float16)r8) * (_Float16)C81; + r6 = ((_Float16)r6 + (_Float16)r8) * (_Float16)C81; + s1 = ((_Float16)s6 - (_Float16)s8) * (_Float16)C81; + s6 = ((_Float16)s6 + (_Float16)s8) * (_Float16)C81; + t1 = (_Float16)r5 - (_Float16)r1; + r5 = (_Float16)r5 + (_Float16)r1; + r8 = (_Float16)r7 - (_Float16)r6; + r7 = (_Float16)r7 + (_Float16)r6; + t2 = (_Float16)s5 - (_Float16)s1; + s5 = (_Float16)s5 + (_Float16)s1; + s8 = (_Float16)s7 - (_Float16)s6; + s7 = (_Float16)s7 + (_Float16)s6; + r1 = (_Float16)r5 + (_Float16)s7; + r5 = (_Float16)r5 - (_Float16)s7; + r6 = (_Float16)t1 + (_Float16)s8; + t1 = (_Float16)t1 - (_Float16)s8; + s1 = (_Float16)s5 - (_Float16)r7; + s5 = (_Float16)s5 + (_Float16)r7; + s6 = (_Float16)t2 - (_Float16)r8; + t2 = (_Float16)t2 + (_Float16)r8; + p1 = (_Float16)co2 * (_Float16)r1; + p2 = (_Float16)si2 * (_Float16)s1; + p3 = (_Float16)co2 * (_Float16)s1; + p4 = (_Float16)si2 * (_Float16)r1; + pSrc[2 * i2] = (_Float16)p1 + (_Float16)p2; + pSrc[2 * i2 + 1] = (_Float16)p3 - (_Float16)p4; + p1 = (_Float16)co8 * (_Float16)r5; + p2 = (_Float16)si8 * (_Float16)s5; + p3 = (_Float16)co8 * (_Float16)s5; + p4 = (_Float16)si8 * (_Float16)r5; + pSrc[2 * i8] = (_Float16)p1 + (_Float16)p2; + pSrc[2 * i8 + 1] = (_Float16)p3 - (_Float16)p4; + p1 = (_Float16)co6 * (_Float16)r6; + p2 = (_Float16)si6 * (_Float16)s6; + p3 = (_Float16)co6 * (_Float16)s6; + p4 = (_Float16)si6 * (_Float16)r6; + pSrc[2 * i6] = (_Float16)p1 + (_Float16)p2; + pSrc[2 * i6 + 1] = (_Float16)p3 - (_Float16)p4; + p1 = (_Float16)co4 * (_Float16)t1; + p2 = (_Float16)si4 * (_Float16)t2; + p3 = (_Float16)co4 * (_Float16)t2; + p4 = (_Float16)si4 * (_Float16)t1; + pSrc[2 * i4] = (_Float16)p1 + (_Float16)p2; + pSrc[2 * i4 + 1] = (_Float16)p3 - (_Float16)p4; i1 += n1; } while (i1 < fftLen); @@ -287,4 +289,5 @@ void arm_radix8_butterfly_f16( } #endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix8_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix8_f32.c index a37d50a..328a725 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix8_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix8_f32.c @@ -5,13 +5,13 @@ * Title: arm_cfft_radix8_f32.c * Description: Radix-8 Decimation in Frequency CFFT & CIFFT Floating point processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_f32.c index 2214ca6..7367b11 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_f32.c @@ -5,13 +5,13 @@ * Title: arm_dct4_f32.c * Description: Processing function of DCT4 & IDCT4 F32 * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -62,11 +62,15 @@ @par Algorithm The N-point type-IV DCT is defined as a real, linear transformation by the formula: - \image html DCT4Equation.gif + \f[ + X_c(k) = \sqrt{\frac{2}{N}}\sum_{n=0}^{N-1} x(n)cos\Big[\Big(n+\frac{1}{2}\Big)\Big(k+\frac{1}{2}\Big)\frac{\pi}{N}\Big] + \f] where k = 0, 1, 2, ..., N-1 @par Its inverse is defined as follows: - \image html IDCT4Equation.gif + \f[ + x(n) = \sqrt{\frac{2}{N}}\sum_{k=0}^{N-1} X_c(k)cos\Big[\Big(n+\frac{1}{2}\Big)\Big(k+\frac{1}{2}\Big)\frac{\pi}{N}\Big] + \f] where n = 0, 1, 2, ..., N-1 @par The DCT4 matrices become involutory (i.e. they are self-inverse) by multiplying with an overall scale factor of sqrt(2/N). diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_init_f32.c index adac8a4..957e01e 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_dct4_init_f32.c * Description: Initialization function of DCT-4 & IDCT4 F32 * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -56,7 +56,13 @@ The normalizing factor is sqrt(2/N), which depends on the size of transform N. Floating-point normalizing factors are mentioned in the table below for different DCT sizes: - \image html dct4NormalizingF32Table.gif + +| DCT Size | Normalizing factor value | +| --------: | ------------------------: | +| 2048 | 0.03125 | +| 512 | 0.0625 | +| 128 | 0.125 | + */ arm_status arm_dct4_init_f32( diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_init_q15.c index 20a2cd2..0cd18fb 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_init_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_init_q15.c @@ -5,13 +5,13 @@ * Title: arm_dct4_init_q15.c * Description: Initialization function of DCT-4 & IDCT4 Q15 * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -56,7 +56,12 @@ The normalizing factor is sqrt(2/N), which depends on the size of transform N. Normalizing factors in 1.15 format are mentioned in the table below for different DCT sizes: - \image html dct4NormalizingQ15Table.gif +| DCT Size | Normalizing factor value (hexadecimal) | +| --------: | ---------------------------------------:| +| 2048 | 0x400 | +| 512 | 0x800 | +| 128 | 0x1000 | + */ arm_status arm_dct4_init_q15( diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_init_q31.c index 0ee5da3..1d7d2f1 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_dct4_init_q31.c * Description: Initialization function of DCT-4 & IDCT4 Q31 * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -55,8 +55,13 @@ @par Normalizing factor: The normalizing factor is sqrt(2/N), which depends on the size of transform N. Normalizing factors in 1.31 format are mentioned in the table below for different DCT sizes: + +| DCT Size | Normalizing factor value (hexadecimal) | +| --------: | ---------------------------------------:| +| 2048 | 0x4000000 | +| 512 | 0x8000000 | +| 128 | 0x10000000 | - \image html dct4NormalizingQ31Table.gif */ arm_status arm_dct4_init_q31( diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_q15.c index b590c38..a9d4e78 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_q15.c @@ -5,13 +5,13 @@ * Title: arm_dct4_q15.c * Description: Processing function of DCT4 & IDCT4 Q15 * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -46,8 +46,14 @@ Internally inputs are downscaled in the RFFT process function to avoid overflows. Number of bits downscaled, depends on the size of the transform. The input and output formats for different DCT sizes and number of bits to upscale are mentioned in the table below: + +| DCT Size | Input format | Output format | Number of bits to upscale | +| --------: | ------------: | ------------: | ------------------------: | +| 2048 | 1.15 | 11.5 | 10 | +| 512 | 1.15 | 9.7 | 8 | +| 128 | 1.15 | 7.9 | 6 | + - \image html dct4FormatsQ15Table.gif */ void arm_dct4_q15( diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_q31.c index 259dc9a..5976bd0 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_dct4_q31.c @@ -5,13 +5,13 @@ * Title: arm_dct4_q31.c * Description: Processing function of DCT4 & IDCT4 Q31 * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -50,7 +50,12 @@ The input and output formats for different DCT sizes and number of bits to upscale are mentioned in the table below: - \image html dct4FormatsQ31Table.gif +| DCT Size | Input format | Output format | Number of bits to upscale | +| --------: | ------------: | ------------: | ------------------------: | +| 2048 | 2.30 | 12.20 | 11 | +| 512 | 2.30 | 10.22 | 9 | +| 128 | 2.30 | 8.24 | 7 | + */ void arm_dct4_q31( diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_f16.c new file mode 100644 index 0000000..f9cf6fd --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_f16.c @@ -0,0 +1,165 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mfcc_f16.c + * Description: MFCC function for the f16 version + * + * $Date: 07 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/transform_functions_f16.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions_f16.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions_f16.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/complex_math_functions_f16.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions_f16.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions_f16.h" + +#if defined(ARM_FLOAT16_SUPPORTED) + +/** + @ingroup groupTransforms + */ + + +/** + @defgroup MFCC MFCC + + MFCC Transform + + There are separate functions for floating-point, Q15, and Q31 data types. + */ + + + +/** + @addtogroup MFCC + @{ + */ + +/** + @brief MFCC F16 + @param[in] S points to the mfcc instance structure + @param[in] pSrc points to the input samples + @param[out] pDst points to the output MFCC values + @param[inout] pTmp points to a temporary buffer of complex + + @return none + + @par Description + The number of input samples if the FFT length used + when initializing the instance data structure. + + The temporary buffer has a 2*fft length size when MFCC + is implemented with CFFT. + It has length FFT Length + 2 when implemented with RFFT + (default implementation). + + The source buffer is modified by this function. + + */ +void arm_mfcc_f16( + const arm_mfcc_instance_f16 * S, + float16_t *pSrc, + float16_t *pDst, + float16_t *pTmp + ) +{ + float16_t maxValue; + uint32_t index; + uint32_t i; + float16_t result; + const float16_t *coefs=S->filterCoefs; + arm_matrix_instance_f16 pDctMat; + + /* Normalize */ + arm_absmax_f16(pSrc,S->fftLen,&maxValue,&index); + + arm_scale_f16(pSrc,1.0f16/(_Float16)maxValue,pSrc,S->fftLen); + + /* Multiply by window */ + arm_mult_f16(pSrc,S->windowCoefs,pSrc,S->fftLen); + + /* Compute spectrum magnitude + */ +#if defined(ARM_MFCC_CFFT_BASED) + /* some HW accelerator for CMSIS-DSP used in some boards + are only providing acceleration for CFFT. + With ARM_MFCC_CFFT_BASED enabled, CFFT is used and the MFCC + will be accelerated on those boards. + + The default is to use RFFT + */ + /* Convert from real to complex */ + for(i=0; i < S->fftLen ; i++) + { + pTmp[2*i] = pSrc[i]; + pTmp[2*i+1] = 0.0f16; + } + arm_cfft_f16(&(S->cfft),pTmp,0,1); +#else + /* Default RFFT based implementation */ + arm_rfft_fast_f16(&(S->rfft),pSrc,pTmp,0); + /* Unpack real values */ + pTmp[S->fftLen]=pTmp[1]; + pTmp[S->fftLen+1]=0.0f16; + pTmp[1]=0.0f; +#endif + arm_cmplx_mag_f16(pTmp,pSrc,S->fftLen); + + /* Apply MEL filters */ + for(i=0; inbMelFilters; i++) + { + arm_dot_prod_f16(pSrc+S->filterPos[i], + coefs, + S->filterLengths[i], + &result); + + coefs += S->filterLengths[i]; + + pTmp[i] = result; + + } + + /* Compute the log */ + arm_offset_f16(pTmp,1.0e-4f16,pTmp,S->nbMelFilters); + arm_vlog_f16(pTmp,pTmp,S->nbMelFilters); + + /* Multiply with the DCT matrix */ + + pDctMat.numRows=S->nbDctOutputs; + pDctMat.numCols=S->nbMelFilters; + pDctMat.pData=(float16_t*)S->dctCoefs; + + arm_mat_vec_mult_f16(&pDctMat, pTmp, pDst); + + +} + +#endif /* defined(ARM_FLOAT16_SUPPORTED) */ +/** + @} end of MFCC group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_f32.c new file mode 100644 index 0000000..544f717 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_f32.c @@ -0,0 +1,154 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mfcc_f32.c + * Description: MFCC function for the f32 version + * + * $Date: 07 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/transform_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/complex_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h" + +/** + @ingroup groupTransforms + */ + + + +/** + @addtogroup MFCC + @{ + */ + +/** + @brief MFCC F32 + @param[in] S points to the mfcc instance structure + @param[in] pSrc points to the input samples + @param[out] pDst points to the output MFCC values + @param[inout] pTmp points to a temporary buffer of complex + + @return none + + @par Description + The number of input samples if the FFT length used + when initializing the instance data structure. + + The temporary buffer has a 2*fft length size when MFCC + is implemented with CFFT. + It has length FFT Length + 2 when implemented with RFFT + (default implementation). + + The source buffer is modified by this function. + + */ +void arm_mfcc_f32( + const arm_mfcc_instance_f32 * S, + float32_t *pSrc, + float32_t *pDst, + float32_t *pTmp + ) +{ + float32_t maxValue; + uint32_t index; + uint32_t i; + float32_t result; + const float32_t *coefs=S->filterCoefs; + arm_matrix_instance_f32 pDctMat; + + /* Normalize */ + arm_absmax_f32(pSrc,S->fftLen,&maxValue,&index); + + arm_scale_f32(pSrc,1.0f/maxValue,pSrc,S->fftLen); + + /* Multiply by window */ + arm_mult_f32(pSrc,S->windowCoefs,pSrc,S->fftLen); + + /* Compute spectrum magnitude + */ +#if defined(ARM_MFCC_CFFT_BASED) + /* some HW accelerator for CMSIS-DSP used in some boards + are only providing acceleration for CFFT. + With ARM_MFCC_CFFT_BASED enabled, CFFT is used and the MFCC + will be accelerated on those boards. + + The default is to use RFFT + */ + /* Convert from real to complex */ + for(i=0; i < S->fftLen ; i++) + { + pTmp[2*i] = pSrc[i]; + pTmp[2*i+1] = 0.0f; + } + arm_cfft_f32(&(S->cfft),pTmp,0,1); +#else + /* Default RFFT based implementation */ + arm_rfft_fast_f32(&(S->rfft),pSrc,pTmp,0); + /* Unpack real values */ + pTmp[S->fftLen]=pTmp[1]; + pTmp[S->fftLen+1]=0.0f; + pTmp[1]=0.0f; +#endif + arm_cmplx_mag_f32(pTmp,pSrc,S->fftLen); + + /* Apply MEL filters */ + for(i=0; inbMelFilters; i++) + { + arm_dot_prod_f32(pSrc+S->filterPos[i], + coefs, + S->filterLengths[i], + &result); + + coefs += S->filterLengths[i]; + + pTmp[i] = result; + + } + + /* Compute the log */ + arm_offset_f32(pTmp,1.0e-6f,pTmp,S->nbMelFilters); + arm_vlog_f32(pTmp,pTmp,S->nbMelFilters); + + /* Multiply with the DCT matrix */ + + pDctMat.numRows=S->nbDctOutputs; + pDctMat.numCols=S->nbMelFilters; + pDctMat.pData=(float32_t*)S->dctCoefs; + + arm_mat_vec_mult_f32(&pDctMat, pTmp, pDst); + + +} + +/** + @} end of MFCC group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_init_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_init_f16.c new file mode 100644 index 0000000..74b6c3d --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_init_f16.c @@ -0,0 +1,114 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mfcc_init_f16.c + * Description: MFCC initialization function for the f16 version + * + * $Date: 07 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + @ingroup groupTransforms + */ + + +/** + @addtogroup MFCC + @{ + */ + + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/transform_functions_f16.h" + +#if defined(ARM_FLOAT16_SUPPORTED) + + + +/** + @brief Initialization of the MFCC F16 instance structure + @param[out] S points to the mfcc instance structure + @param[in] fftLen fft length + @param[in] nbMelFilters number of Mel filters + @param[in] nbDctOutputs number of Dct outputs + @param[in] dctCoefs points to an array of DCT coefficients + @param[in] filterPos points of the array of filter positions + @param[in] filterLengths points to the array of filter lengths + @param[in] filterCoefs points to the array of filter coefficients + @param[in] windowCoefs points to the array of window coefficients + + @return error status + + @par Description + The matrix of Mel filter coefficients is sparse. + Most of the coefficients are zero. + To avoid multiplying the spectrogram by those zeros, the + filter is applied only to a given position in the spectrogram + and on a given number of FFT bins (the filter length). + It is the reason for the arrays filterPos and filterLengths. + + window coefficients can describe (for instance) a Hamming window. + The array has the same size as the FFT length. + + The folder Scripts is containing a Python script which can be used + to generate the filter, dct and window arrays. + */ + +arm_status arm_mfcc_init_f16( + arm_mfcc_instance_f16 * S, + uint32_t fftLen, + uint32_t nbMelFilters, + uint32_t nbDctOutputs, + const float16_t *dctCoefs, + const uint32_t *filterPos, + const uint32_t *filterLengths, + const float16_t *filterCoefs, + const float16_t *windowCoefs + ) +{ + arm_status status; + + S->fftLen=fftLen; + S->nbMelFilters=nbMelFilters; + S->nbDctOutputs=nbDctOutputs; + S->dctCoefs=dctCoefs; + S->filterPos=filterPos; + S->filterLengths=filterLengths; + S->filterCoefs=filterCoefs; + S->windowCoefs=windowCoefs; + + #if defined(ARM_MFCC_CFFT_BASED) + status=arm_cfft_init_f16(&(S->cfft),fftLen); + #else + status=arm_rfft_fast_init_f16(&(S->rfft),fftLen); + #endif + + return(status); +} + +#endif /* defined(ARM_FLOAT16_SUPPORTED) */ +/** + @} end of MFCC group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_init_f32.c new file mode 100644 index 0000000..9e0bf0c --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_init_f32.c @@ -0,0 +1,111 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mfcc_init_f32.c + * Description: MFCC initialization function for the f32 version + * + * $Date: 07 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + @ingroup groupTransforms + */ + + +/** + @addtogroup MFCC + @{ + */ + + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/transform_functions.h" + + + +/** + @brief Initialization of the MFCC F32 instance structure + @param[out] S points to the mfcc instance structure + @param[in] fftLen fft length + @param[in] nbMelFilters number of Mel filters + @param[in] nbDctOutputs number of Dct outputs + @param[in] dctCoefs points to an array of DCT coefficients + @param[in] filterPos points of the array of filter positions + @param[in] filterLengths points to the array of filter lengths + @param[in] filterCoefs points to the array of filter coefficients + @param[in] windowCoefs points to the array of window coefficients + + @return error status + + @par Description + The matrix of Mel filter coefficients is sparse. + Most of the coefficients are zero. + To avoid multiplying the spectrogram by those zeros, the + filter is applied only to a given position in the spectrogram + and on a given number of FFT bins (the filter length). + It is the reason for the arrays filterPos and filterLengths. + + window coefficients can describe (for instance) a Hamming window. + The array has the same size as the FFT length. + + The folder Scripts is containing a Python script which can be used + to generate the filter, dct and window arrays. + */ + +arm_status arm_mfcc_init_f32( + arm_mfcc_instance_f32 * S, + uint32_t fftLen, + uint32_t nbMelFilters, + uint32_t nbDctOutputs, + const float32_t *dctCoefs, + const uint32_t *filterPos, + const uint32_t *filterLengths, + const float32_t *filterCoefs, + const float32_t *windowCoefs + ) +{ + arm_status status; + + S->fftLen=fftLen; + S->nbMelFilters=nbMelFilters; + S->nbDctOutputs=nbDctOutputs; + S->dctCoefs=dctCoefs; + S->filterPos=filterPos; + S->filterLengths=filterLengths; + S->filterCoefs=filterCoefs; + S->windowCoefs=windowCoefs; + + #if defined(ARM_MFCC_CFFT_BASED) + status=arm_cfft_init_f32(&(S->cfft),fftLen); + #else + status=arm_rfft_fast_init_f32(&(S->rfft),fftLen); + #endif + + return(status); +} + +/** + @} end of MFCC group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_init_q15.c new file mode 100644 index 0000000..ccd6da9 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_init_q15.c @@ -0,0 +1,111 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mfcc_init_q15.c + * Description: MFCC initialization function for the q15 version + * + * $Date: 07 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + @ingroup groupTransforms + */ + + +/** + @addtogroup MFCC + @{ + */ + + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/transform_functions.h" + + + +/** + @brief Initialization of the MFCC F32 instance structure + @param[out] S points to the mfcc instance structure + @param[in] fftLen fft length + @param[in] nbMelFilters number of Mel filters + @param[in] nbDctOutputs number of Dct outputs + @param[in] dctCoefs points to an array of DCT coefficients + @param[in] filterPos points of the array of filter positions + @param[in] filterLengths points to the array of filter lengths + @param[in] filterCoefs points to the array of filter coefficients + @param[in] windowCoefs points to the array of window coefficients + + @return error status + + @par Description + The matrix of Mel filter coefficients is sparse. + Most of the coefficients are zero. + To avoid multiplying the spectrogram by those zeros, the + filter is applied only to a given position in the spectrogram + and on a given number of FFT bins (the filter length). + It is the reason for the arrays filterPos and filterLengths. + + window coefficients can describe (for instance) a Hamming window. + The array has the same size as the FFT length. + + The folder Scripts is containing a Python script which can be used + to generate the filter, dct and window arrays. + */ + +arm_status arm_mfcc_init_q15( + arm_mfcc_instance_q15 * S, + uint32_t fftLen, + uint32_t nbMelFilters, + uint32_t nbDctOutputs, + const q15_t *dctCoefs, + const uint32_t *filterPos, + const uint32_t *filterLengths, + const q15_t *filterCoefs, + const q15_t *windowCoefs + ) +{ + arm_status status; + + S->fftLen=fftLen; + S->nbMelFilters=nbMelFilters; + S->nbDctOutputs=nbDctOutputs; + S->dctCoefs=dctCoefs; + S->filterPos=filterPos; + S->filterLengths=filterLengths; + S->filterCoefs=filterCoefs; + S->windowCoefs=windowCoefs; + + #if defined(ARM_MFCC_CFFT_BASED) + status=arm_cfft_init_q15(&(S->cfft),fftLen); + #else + status=arm_rfft_init_q15(&(S->rfft),fftLen,0,1); + #endif + + return(status); +} + +/** + @} end of MFCC group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_init_q31.c new file mode 100644 index 0000000..5573b33 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_init_q31.c @@ -0,0 +1,111 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mfcc_init_q31.c + * Description: MFCC initialization function for the q31 version + * + * $Date: 07 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + @ingroup groupTransforms + */ + + +/** + @addtogroup MFCC + @{ + */ + + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/transform_functions.h" + + + +/** + @brief Initialization of the MFCC F32 instance structure + @param[out] S points to the mfcc instance structure + @param[in] fftLen fft length + @param[in] nbMelFilters number of Mel filters + @param[in] nbDctOutputs number of Dct outputs + @param[in] dctCoefs points to an array of DCT coefficients + @param[in] filterPos points of the array of filter positions + @param[in] filterLengths points to the array of filter lengths + @param[in] filterCoefs points to the array of filter coefficients + @param[in] windowCoefs points to the array of window coefficients + + @return error status + + @par Description + The matrix of Mel filter coefficients is sparse. + Most of the coefficients are zero. + To avoid multiplying the spectrogram by those zeros, the + filter is applied only to a given position in the spectrogram + and on a given number of FFT bins (the filter length). + It is the reason for the arrays filterPos and filterLengths. + + window coefficients can describe (for instance) a Hamming window. + The array has the same size as the FFT length. + + The folder Scripts is containing a Python script which can be used + to generate the filter, dct and window arrays. + */ + +arm_status arm_mfcc_init_q31( + arm_mfcc_instance_q31 * S, + uint32_t fftLen, + uint32_t nbMelFilters, + uint32_t nbDctOutputs, + const q31_t *dctCoefs, + const uint32_t *filterPos, + const uint32_t *filterLengths, + const q31_t *filterCoefs, + const q31_t *windowCoefs + ) +{ + arm_status status; + + S->fftLen=fftLen; + S->nbMelFilters=nbMelFilters; + S->nbDctOutputs=nbDctOutputs; + S->dctCoefs=dctCoefs; + S->filterPos=filterPos; + S->filterLengths=filterLengths; + S->filterCoefs=filterCoefs; + S->windowCoefs=windowCoefs; + + #if defined(ARM_MFCC_CFFT_BASED) + status=arm_cfft_init_q31(&(S->cfft),fftLen); + #else + status=arm_rfft_init_q31(&(S->rfft),fftLen,0,1); + #endif + + return(status); +} + +/** + @} end of MFCC group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_q15.c new file mode 100644 index 0000000..9cbd447 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_q15.c @@ -0,0 +1,203 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mfcc_q15.c + * Description: MFCC function for the q15 version + * + * $Date: 07 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/transform_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/complex_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h" + +/* Constants for Q15 implementation */ +#define LOG2TOLOG_Q15 0x02C5C860 +#define MICRO_Q15 0x00000219 +#define SHIFT_MELFILTER_SATURATION_Q15 10 +/** + @ingroup groupTransforms + */ + + + +/** + @addtogroup MFCC + @{ + */ + +/** + @brief MFCC Q15 + @param[in] S points to the mfcc instance structure + @param[in] pSrc points to the input samples in Q15 + @param[out] pDst points to the output MFCC values in q8.7 format + @param[inout] pTmp points to a temporary buffer of complex + + @return none + + @par Description + The number of input samples is the FFT length used + when initializing the instance data structure. + + The temporary buffer has a 2*fft length. + + The source buffer is modified by this function. + + The function may saturate. If the FFT length is too + big and the number of MEL filters too small then the fixed + point computations may saturate. + + */ + +arm_status arm_mfcc_q15( + const arm_mfcc_instance_q15 * S, + q15_t *pSrc, + q15_t *pDst, + q31_t *pTmp + ) +{ + q15_t m; + uint32_t index; + uint32_t fftShift=0; + q31_t logExponent; + q63_t result; + arm_matrix_instance_q15 pDctMat; + uint32_t i; + uint32_t coefsPos; + uint32_t filterLimit; + q15_t *pTmp2=(q15_t*)pTmp; + + arm_status status = ARM_MATH_SUCCESS; + + // q15 + arm_absmax_q15(pSrc,S->fftLen,&m,&index); + + if (m !=0) + { + q15_t quotient; + int16_t shift; + + status = arm_divide_q15(0x7FFF,m,"ient,&shift); + if (status != ARM_MATH_SUCCESS) + { + return(status); + } + + arm_scale_q15(pSrc,quotient,shift,pSrc,S->fftLen); + } + + + // q15 + arm_mult_q15(pSrc,S->windowCoefs, pSrc, S->fftLen); + + + /* Compute spectrum magnitude + */ + fftShift = 31 - __CLZ(S->fftLen); +#if defined(ARM_MFCC_CFFT_BASED) + /* some HW accelerator for CMSIS-DSP used in some boards + are only providing acceleration for CFFT. + With ARM_MFCC_CFFT_BASED enabled, CFFT is used and the MFCC + will be accelerated on those boards. + + The default is to use RFFT + */ + /* Convert from real to complex */ + for(i=0; i < S->fftLen ; i++) + { + pTmp2[2*i] = pSrc[i]; + pTmp2[2*i+1] = 0; + } + arm_cfft_q15(&(S->cfft),pTmp2,0,1); +#else + /* Default RFFT based implementation */ + arm_rfft_q15(&(S->rfft),pSrc,pTmp2); +#endif + filterLimit = 1 + (S->fftLen >> 1); + + + // q15 - fftShift + arm_cmplx_mag_q15(pTmp2,pSrc,filterLimit); + // q14 - fftShift + + /* Apply MEL filters */ + coefsPos = 0; + for(i=0; inbMelFilters; i++) + { + arm_dot_prod_q15(pSrc+S->filterPos[i], + &(S->filterCoefs[coefsPos]), + S->filterLengths[i], + &result); + + coefsPos += S->filterLengths[i]; + + // q34.29 - fftShift + result += MICRO_Q15; + result >>= SHIFT_MELFILTER_SATURATION_Q15; + // q34.29 - fftShift - satShift + pTmp[i] = __SSAT(result,31) ; + + } + + + // q34.29 - fftShift - satShift + /* Compute the log */ + arm_vlog_q31(pTmp,pTmp,S->nbMelFilters); + + + // q5.26 + + logExponent = fftShift + 2 + SHIFT_MELFILTER_SATURATION_Q15; + logExponent = logExponent * LOG2TOLOG_Q15; + + + // q8.26 + arm_offset_q31(pTmp,logExponent,pTmp,S->nbMelFilters); + arm_shift_q31(pTmp,-19,pTmp,S->nbMelFilters); + for(i=0; inbMelFilters; i++) + { + pSrc[i] = __SSAT((q15_t)pTmp[i],16); + } + + // q8.7 + + pDctMat.numRows=S->nbDctOutputs; + pDctMat.numCols=S->nbMelFilters; + pDctMat.pData=(q15_t*)S->dctCoefs; + + arm_mat_vec_mult_q15(&pDctMat, pSrc, pDst); + + return(status); +} + +/** + @} end of MFCC group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_q31.c new file mode 100644 index 0000000..6993c55 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_mfcc_q31.c @@ -0,0 +1,202 @@ +#include "edge-impulse-sdk/dsp/config.hpp" +#if EIDSP_LOAD_CMSIS_DSP_SOURCES +/* ---------------------------------------------------------------------- + * Project: CMSIS DSP Library + * Title: arm_mfcc_q31.c + * Description: MFCC function for the q31 version + * + * $Date: 07 September 2021 + * $Revision: V1.10.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * -------------------------------------------------------------------- */ +/* + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + + +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/transform_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/statistics_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/basic_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/complex_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/fast_math_functions.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/matrix_functions.h" + +/* Constants for Q31 implementation */ +#define LOG2TOLOG_Q31 0x02C5C860 +#define MICRO_Q31 0x08637BD0 +#define SHIFT_MELFILTER_SATURATION_Q31 10 +/** + @ingroup groupTransforms + */ + + + +/** + @addtogroup MFCC + @{ + */ + +/** + @brief MFCC Q31 + @param[in] S points to the mfcc instance structure + @param[in] pSrc points to the input samples in Q31 + @param[out] pDst points to the output MFCC values in q8.23 format + @param[inout] pTmp points to a temporary buffer of complex + + @return none + + @par Description + The number of input samples is the FFT length used + when initializing the instance data structure. + + The temporary buffer has a 2*fft length. + + The source buffer is modified by this function. + + The function may saturate. If the FFT length is too + big and the number of MEL filters too small then the fixed + point computations may saturate. + + */ + + +arm_status arm_mfcc_q31( + const arm_mfcc_instance_q31 * S, + q31_t *pSrc, + q31_t *pDst, + q31_t *pTmp + ) +{ + q31_t m; + uint32_t index; + uint32_t fftShift=0; + q31_t logExponent; + q63_t result; + arm_matrix_instance_q31 pDctMat; + uint32_t i; + uint32_t coefsPos; + uint32_t filterLimit; + q31_t *pTmp2=(q31_t*)pTmp; + + arm_status status = ARM_MATH_SUCCESS; + + // q31 + arm_absmax_q31(pSrc,S->fftLen,&m,&index); + + if (m !=0) + { + q31_t quotient; + int16_t shift; + + status = arm_divide_q31(0x7FFFFFFF,m,"ient,&shift); + if (status != ARM_MATH_SUCCESS) + { + return(status); + } + + arm_scale_q31(pSrc,quotient,shift,pSrc,S->fftLen); + } + + + // q31 + arm_mult_q31(pSrc,S->windowCoefs, pSrc, S->fftLen); + + + /* Compute spectrum magnitude + */ + fftShift = 31 - __CLZ(S->fftLen); +#if defined(ARM_MFCC_CFFT_BASED) + /* some HW accelerator for CMSIS-DSP used in some boards + are only providing acceleration for CFFT. + With ARM_MFCC_CFFT_BASED enabled, CFFT is used and the MFCC + will be accelerated on those boards. + + The default is to use RFFT + */ + /* Convert from real to complex */ + for(i=0; i < S->fftLen ; i++) + { + pTmp2[2*i] = pSrc[i]; + pTmp2[2*i+1] = 0; + } + arm_cfft_q31(&(S->cfft),pTmp2,0,1); +#else + /* Default RFFT based implementation */ + arm_rfft_q31(&(S->rfft),pSrc,pTmp2); +#endif + filterLimit = 1 + (S->fftLen >> 1); + + + // q31 - fftShift + arm_cmplx_mag_q31(pTmp2,pSrc,filterLimit); + // q30 - fftShift + + + /* Apply MEL filters */ + coefsPos = 0; + for(i=0; inbMelFilters; i++) + { + arm_dot_prod_q31(pSrc+S->filterPos[i], + &(S->filterCoefs[coefsPos]), + S->filterLengths[i], + &result); + + coefsPos += S->filterLengths[i]; + + // q16.48 - fftShift + result += MICRO_Q31; + result >>= (SHIFT_MELFILTER_SATURATION_Q31 + 18); + // q16.29 - fftShift - satShift + pTmp[i] = __SSAT(result,31) ; + + } + + + // q16.29 - fftShift - satShift + /* Compute the log */ + arm_vlog_q31(pTmp,pTmp,S->nbMelFilters); + + + // q5.26 + + logExponent = fftShift + 2 + SHIFT_MELFILTER_SATURATION_Q31; + logExponent = logExponent * LOG2TOLOG_Q31; + + + // q5.26 + arm_offset_q31(pTmp,logExponent,pTmp,S->nbMelFilters); + arm_shift_q31(pTmp,-3,pTmp,S->nbMelFilters); + + + // q8.23 + + pDctMat.numRows=S->nbDctOutputs; + pDctMat.numCols=S->nbMelFilters; + pDctMat.pData=(q31_t*)S->dctCoefs; + + arm_mat_vec_mult_q31(&pDctMat, pTmp, pDst); + + return(status); +} + +/** + @} end of MFCC group + */ + +#endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_f32.c index 9d0a2a3..ea6d9df 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_f32.c @@ -5,13 +5,13 @@ * Title: arm_rfft_f32.c * Description: RFFT & RIFFT Floating point process function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_f16.c index d5b64a0..367b2ca 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_f16.c @@ -5,11 +5,13 @@ * Title: arm_rfft_fast_f16.c * Description: RFFT & RIFFT Floating point process function * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -72,15 +74,15 @@ void stage_rfft_f16( twI = *pCoeff++ ; // U1 = XA(1) + XB(1); % It is real - t1a = xBR + xAR ; + t1a = (_Float16)xBR + (_Float16)xAR ; // U2 = XB(1) - XA(1); % It is imaginary - t1b = xBI + xAI ; + t1b = (_Float16)xBI + (_Float16)xAI ; // real(tw * (xB - xA)) = twR * (xBR - xAR) - twI * (xBI - xAI); // imag(tw * (xB - xA)) = twI * (xBR - xAR) + twR * (xBI - xAI); - *pOut++ = 0.5f * ( t1a + t1b ); - *pOut++ = 0.5f * ( t1a - t1b ); + *pOut++ = 0.5f16 * ( (_Float16)t1a + (_Float16)t1b ); + *pOut++ = 0.5f16 * ( (_Float16)t1a - (_Float16)t1b ); // XA(1) = 1/2*( U1 - imag(U2) + i*( U1 +imag(U2) )); pB = p + 2*k - 14; @@ -174,18 +176,18 @@ void stage_rfft_f16( twR = *pCoeff++; twI = *pCoeff++; - t1a = xBR - xAR ; - t1b = xBI + xAI ; + t1a = (_Float16)xBR - (_Float16)xAR ; + t1b = (_Float16)xBI + (_Float16)xAI ; // real(tw * (xB - xA)) = twR * (xBR - xAR) - twI * (xBI - xAI); // imag(tw * (xB - xA)) = twI * (xBR - xAR) + twR * (xBI - xAI); - p0 = twR * t1a; - p1 = twI * t1a; - p2 = twR * t1b; - p3 = twI * t1b; + p0 = (_Float16)twR * (_Float16)t1a; + p1 = (_Float16)twI * (_Float16)t1a; + p2 = (_Float16)twR * (_Float16)t1b; + p3 = (_Float16)twI * (_Float16)t1b; - *pOut++ = 0.5f * (xAR + xBR + p0 + p3 ); //xAR - *pOut++ = 0.5f * (xAI - xBI + p1 - p2 ); //xAI + *pOut++ = 0.5f16 * ((_Float16)xAR + (_Float16)xBR + (_Float16)p0 + (_Float16)p3 ); //xAR + *pOut++ = 0.5f16 * ((_Float16)xAI - (_Float16)xBI + (_Float16)p1 - (_Float16)p2 ); //xAI pA += 2; pB -= 2; @@ -223,8 +225,8 @@ void merge_rfft_f16( pCoeff += 2 ; - *pOut++ = 0.5f * ( xAR + xAI ); - *pOut++ = 0.5f * ( xAR - xAI ); + *pOut++ = 0.5f16 * ( (_Float16)xAR + (_Float16)xAI ); + *pOut++ = 0.5f16 * ( (_Float16)xAR - (_Float16)xAI ); pB = p + 2*k - 14; pA += 2 ; @@ -293,18 +295,18 @@ void merge_rfft_f16( twR = *pCoeff++; twI = *pCoeff++; - t1a = xAR - xBR ; - t1b = xAI + xBI ; + t1a = (_Float16)xAR - (_Float16)xBR ; + t1b = (_Float16)xAI + (_Float16)xBI ; - r = twR * t1a; - s = twI * t1b; - t = twI * t1a; - u = twR * t1b; + r = (_Float16)twR * (_Float16)t1a; + s = (_Float16)twI * (_Float16)t1b; + t = (_Float16)twI * (_Float16)t1a; + u = (_Float16)twR * (_Float16)t1b; // real(tw * (xA - xB)) = twR * (xAR - xBR) - twI * (xAI - xBI); // imag(tw * (xA - xB)) = twI * (xAR - xBR) + twR * (xAI - xBI); - *pOut++ = 0.5f * (xAR + xBR - r - s ); //xAR - *pOut++ = 0.5f * (xAI - xBI + t - u ); //xAI + *pOut++ = 0.5f16 * ((_Float16)xAR + (_Float16)xBR - (_Float16)r - (_Float16)s ); //xAR + *pOut++ = 0.5f16 * ((_Float16)xAI - (_Float16)xBI + (_Float16)t - (_Float16)u ); //xAI pA += 2; pB -= 2; @@ -342,15 +344,15 @@ void stage_rfft_f16( // U1 = XA(1) + XB(1); % It is real - t1a = xBR + xAR ; + t1a = (_Float16)xBR + (_Float16)xAR ; // U2 = XB(1) - XA(1); % It is imaginary - t1b = xBI + xAI ; + t1b = (_Float16)xBI + (_Float16)xAI ; // real(tw * (xB - xA)) = twR * (xBR - xAR) - twI * (xBI - xAI); // imag(tw * (xB - xA)) = twI * (xBR - xAR) + twR * (xBI - xAI); - *pOut++ = 0.5f * ( t1a + t1b ); - *pOut++ = 0.5f * ( t1a - t1b ); + *pOut++ = 0.5f16 * ( (_Float16)t1a + (_Float16)t1b ); + *pOut++ = 0.5f16 * ( (_Float16)t1a - (_Float16)t1b ); // XA(1) = 1/2*( U1 - imag(U2) + i*( U1 +imag(U2) )); pB = p + 2*k; @@ -381,18 +383,18 @@ void stage_rfft_f16( twR = *pCoeff++; twI = *pCoeff++; - t1a = xBR - xAR ; - t1b = xBI + xAI ; + t1a = (_Float16)xBR - (_Float16)xAR ; + t1b = (_Float16)xBI + (_Float16)xAI ; // real(tw * (xB - xA)) = twR * (xBR - xAR) - twI * (xBI - xAI); // imag(tw * (xB - xA)) = twI * (xBR - xAR) + twR * (xBI - xAI); - p0 = twR * t1a; - p1 = twI * t1a; - p2 = twR * t1b; - p3 = twI * t1b; + p0 = (_Float16)twR * (_Float16)t1a; + p1 = (_Float16)twI * (_Float16)t1a; + p2 = (_Float16)twR * (_Float16)t1b; + p3 = (_Float16)twI * (_Float16)t1b; - *pOut++ = 0.5f * (xAR + xBR + p0 + p3 ); //xAR - *pOut++ = 0.5f * (xAI - xBI + p1 - p2 ); //xAI + *pOut++ = 0.5f16 * ((_Float16)xAR + (_Float16)xBR + (_Float16)p0 + (_Float16)p3 ); //xAR + *pOut++ = 0.5f16 * ((_Float16)xAI - (_Float16)xBI + (_Float16)p1 - (_Float16)p2 ); //xAI pA += 2; @@ -422,8 +424,8 @@ void merge_rfft_f16( pCoeff += 2 ; - *pOut++ = 0.5f * ( xAR + xAI ); - *pOut++ = 0.5f * ( xAR - xAI ); + *pOut++ = 0.5f16 * ( (_Float16)xAR + (_Float16)xAI ); + *pOut++ = 0.5f16 * ( (_Float16)xAR - (_Float16)xAI ); pB = p + 2*k ; pA += 2 ; @@ -441,18 +443,18 @@ void merge_rfft_f16( twR = *pCoeff++; twI = *pCoeff++; - t1a = xAR - xBR ; - t1b = xAI + xBI ; + t1a = (_Float16)xAR - (_Float16)xBR ; + t1b = (_Float16)xAI + (_Float16)xBI ; - r = twR * t1a; - s = twI * t1b; - t = twI * t1a; - u = twR * t1b; + r = (_Float16)twR * (_Float16)t1a; + s = (_Float16)twI * (_Float16)t1b; + t = (_Float16)twI * (_Float16)t1a; + u = (_Float16)twR * (_Float16)t1b; // real(tw * (xA - xB)) = twR * (xAR - xBR) - twI * (xAI - xBI); // imag(tw * (xA - xB)) = twI * (xAR - xBR) + twR * (xAI - xBI); - *pOut++ = 0.5f * (xAR + xBR - r - s ); //xAR - *pOut++ = 0.5f * (xAI - xBI + t - u ); //xAI + *pOut++ = 0.5f16 * ((_Float16)xAR + (_Float16)xBR - (_Float16)r - (_Float16)s ); //xAR + *pOut++ = 0.5f16 * ((_Float16)xAI - (_Float16)xBI + (_Float16)t - (_Float16)u ); //xAI pA += 2; pB -= 2; @@ -467,99 +469,6 @@ void merge_rfft_f16( @ingroup groupTransforms */ -/** - @defgroup RealFFT Real FFT Functions - - @par - The CMSIS DSP library includes specialized algorithms for computing the - FFT of real data sequences. The FFT is defined over complex data but - in many applications the input is real. Real FFT algorithms take advantage - of the symmetry properties of the FFT and have a speed advantage over complex - algorithms of the same length. - @par - The Fast RFFT algorith relays on the mixed radix CFFT that save processor usage. - @par - The real length N forward FFT of a sequence is computed using the steps shown below. - @par - \image html RFFT.gif "Real Fast Fourier Transform" - @par - The real sequence is initially treated as if it were complex to perform a CFFT. - Later, a processing stage reshapes the data to obtain half of the frequency spectrum - in complex format. Except the first complex number that contains the two real numbers - X[0] and X[N/2] all the data is complex. In other words, the first complex sample - contains two real values packed. - @par - The input for the inverse RFFT should keep the same format as the output of the - forward RFFT. A first processing stage pre-process the data to later perform an - inverse CFFT. - @par - \image html RIFFT.gif "Real Inverse Fast Fourier Transform" - @par - The algorithms for floating-point, Q15, and Q31 data are slightly different - and we describe each algorithm in turn. - @par Floating-point - The main functions are \ref arm_rfft_fast_f16() and \ref arm_rfft_fast_init_f16(). - - @par - The FFT of a real N-point sequence has even symmetry in the frequency domain. - The second half of the data equals the conjugate of the first half flipped in frequency. - Looking at the data, we see that we can uniquely represent the FFT using only N/2 complex numbers. - These are packed into the output array in alternating real and imaginary components: - @par - X = { real[0], imag[0], real[1], imag[1], real[2], imag[2] ... - real[(N/2)-1], imag[(N/2)-1 } - @par - It happens that the first complex number (real[0], imag[0]) is actually - all real. real[0] represents the DC offset, and imag[0] should be 0. - (real[1], imag[1]) is the fundamental frequency, (real[2], imag[2]) is - the first harmonic and so on. - @par - The real FFT functions pack the frequency domain data in this fashion. - The forward transform outputs the data in this form and the inverse - transform expects input data in this form. The function always performs - the needed bitreversal so that the input and output data is always in - normal order. The functions support lengths of [32, 64, 128, ..., 4096] - samples. - @par Q15 and Q31 - The real algorithms are defined in a similar manner and utilize N/2 complex - transforms behind the scenes. - @par - The complex transforms used internally include scaling to prevent fixed-point - overflows. The overall scaling equals 1/(fftLen/2). - Due to the use of complex transform internally, the source buffer is - modified by the rfft. - @par - A separate instance structure must be defined for each transform used but - twiddle factor and bit reversal tables can be reused. - @par - There is also an associated initialization function for each data type. - The initialization function performs the following operations: - - Sets the values of the internal structure fields. - - Initializes twiddle factor table and bit reversal table pointers. - - Initializes the internal complex FFT data structure. - @par - Use of the initialization function is optional **except for MVE versions where it is mandatory**. - If you don't use the initialization functions, then the structures should be initialized with code - similar to the one below: -
-      arm_rfft_instance_q31 S = {fftLenReal, fftLenBy2, ifftFlagR, bitReverseFlagR, twidCoefRModifier, pTwiddleAReal, pTwiddleBReal, pCfft};
-      arm_rfft_instance_q15 S = {fftLenReal, fftLenBy2, ifftFlagR, bitReverseFlagR, twidCoefRModifier, pTwiddleAReal, pTwiddleBReal, pCfft};
-  
- where fftLenReal is the length of the real transform; - fftLenBy2 length of the internal complex transform (fftLenReal/2). - ifftFlagR Selects forward (=0) or inverse (=1) transform. - bitReverseFlagR Selects bit reversed output (=0) or normal order - output (=1). - twidCoefRModifier stride modifier for the twiddle factor table. - The value is based on the FFT length; - pTwiddleARealpoints to the A array of twiddle coefficients; - pTwiddleBRealpoints to the B array of twiddle coefficients; - pCfft points to the CFFT Instance structure. The CFFT structure - must also be initialized. -@par - Note that with MVE versions you can't initialize instance structures directly and **must - use the initialization function**. - */ /** @addtogroup RealFFT @@ -610,4 +519,5 @@ void arm_rfft_fast_f16( */ #endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_f32.c index 7c58076..c93f6a0 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_f32.c @@ -5,13 +5,13 @@ * Title: arm_rfft_fast_f32.c * Description: RFFT & RIFFT Floating point process function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -473,7 +473,7 @@ void merge_rfft_f32( of the symmetry properties of the FFT and have a speed advantage over complex algorithms of the same length. @par - The Fast RFFT algorith relays on the mixed radix CFFT that save processor usage. + The Fast RFFT algorithm relays on the mixed radix CFFT that save processor usage. @par The real length N forward FFT of a sequence is computed using the steps shown below. @par @@ -497,6 +497,8 @@ void merge_rfft_f32( The main functions are \ref arm_rfft_fast_f32() and \ref arm_rfft_fast_init_f32(). The older functions \ref arm_rfft_f32() and \ref arm_rfft_init_f32() have been deprecated but are still documented. + For f16, the functions are \ref arm_rfft_fast_f16() and \ref arm_rfft_fast_init_f16(). + For f64, the functions are \ref arm_rfft_fast_f64() and \ref arm_rfft_fast_init_f64(). @par The FFT of a real N-point sequence has even symmetry in the frequency domain. The second half of the data equals the conjugate of the first half flipped in frequency. diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_f64.c index 01594b4..2b0ba10 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_f64.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_f64.c @@ -5,13 +5,13 @@ * Title: arm_rfft_fast_f64.c * Description: RFFT & RIFFT Double precision Floating point process function * - * $Date: 29. November 2019 - * $Revision: V1.0.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_init_f16.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_init_f16.c index 1d0dda6..1496b74 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_init_f16.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_init_f16.c @@ -5,11 +5,13 @@ * Title: arm_rfft_fast_init_f16.c * Description: Split Radix Decimation in Frequency CFFT Floating point processing function * + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -342,7 +344,7 @@ arm_status arm_rfft_fast_init_f16( break; #endif default: - return ARM_MATH_ARGUMENT_ERROR; + break; } if( ! fptr ) return ARM_MATH_ARGUMENT_ERROR; @@ -355,4 +357,5 @@ arm_status arm_rfft_fast_init_f16( */ #endif /* #if defined(ARM_FLOAT16_SUPPORTED) */ + #endif // EIDSP_LOAD_CMSIS_DSP_SOURCES diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_init_f32.c index bc181b3..f469ac4 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_rfft_fast_init_f32.c * Description: Split Radix Decimation in Frequency CFFT Floating point processing function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -341,7 +341,7 @@ arm_status arm_rfft_fast_init_f32( break; #endif default: - return ARM_MATH_ARGUMENT_ERROR; + break; } if( ! fptr ) return ARM_MATH_ARGUMENT_ERROR; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_init_f64.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_init_f64.c index 7423d9e..e653f86 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_init_f64.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_init_f64.c @@ -5,13 +5,13 @@ * Title: arm_rfft_fast_init_f64.c * Description: Split Radix Decimation in Frequency CFFT Double Precision Floating point processing function * - * $Date: 29. November 2019 - * $Revision: V1.0.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -333,7 +333,7 @@ arm_status arm_rfft_fast_init_f64( break; #endif default: - return ARM_MATH_ARGUMENT_ERROR; + break; } if( ! fptr ) return ARM_MATH_ARGUMENT_ERROR; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_init_f32.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_init_f32.c index 66f8ede..e1b088d 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_init_f32.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_init_f32.c @@ -5,13 +5,13 @@ * Title: arm_rfft_init_f32.c * Description: RFFT & RIFFT Floating point initialisation function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_init_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_init_q15.c index 9408d49..79b0f4c 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_init_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_init_q15.c @@ -5,13 +5,13 @@ * Title: arm_rfft_init_q15.c * Description: RFFT & RIFFT Q15 initialisation function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_init_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_init_q31.c index f9c5112..fa81090 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_init_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_init_q31.c @@ -5,13 +5,13 @@ * Title: arm_rfft_init_q31.c * Description: RFFT & RIFFT Q31 initialisation function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_q15.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_q15.c index 45307dc..ee8b613 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_q15.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_q15.c @@ -5,13 +5,13 @@ * Title: arm_rfft_q15.c * Description: RFFT & RIFFT Q15 process function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -66,10 +66,34 @@ void arm_split_rifft_q15( Internally input is downscaled by 2 for every stage to avoid saturations inside CFFT/CIFFT process. Hence the output format is different for different RFFT sizes. The input and output formats for different RFFT sizes and number of bits to upscale are mentioned in the tables below for RFFT and RIFFT: - @par - \image html RFFTQ15.gif "Input and Output Formats for Q15 RFFT" - @par - \image html RIFFTQ15.gif "Input and Output Formats for Q15 RIFFT" + @par Input and Output formats for RFFT Q15 + +| RFFT Size | Input Format | Output Format | Number of bits to upscale | +| ---------: | ------------: | -------------: | ------------------------: | +| 32 | 1.15 | 5.11 | 5 | +| 64 | 1.15 | 6.10 | 6 | +| 128 | 1.15 | 7.9 | 7 | +| 256 | 1.15 | 8.8 | 8 | +| 512 | 1.15 | 9.7 | 9 | +| 1024 | 1.15 | 10.6 | 10 | +| 2048 | 1.15 | 11.5 | 11 | +| 4096 | 1.15 | 12.4 | 12 | +| 8192 | 1.15 | 13.3 | 13 | + + @par Input and Output formats for RIFFT Q15 + +| RIFFT Size | Input Format | Output Format | Number of bits to upscale | +| ----------: | ------------: | -------------: | ------------------------: | +| 32 | 1.15 | 5.11 | 0 | +| 64 | 1.15 | 6.10 | 0 | +| 128 | 1.15 | 7.9 | 0 | +| 256 | 1.15 | 8.8 | 0 | +| 512 | 1.15 | 9.7 | 0 | +| 1024 | 1.15 | 10.6 | 0 | +| 2048 | 1.15 | 11.5 | 0 | +| 4096 | 1.15 | 12.4 | 0 | +| 8192 | 1.15 | 13.3 | 0 | + @par If the input buffer is of length N, the output buffer must have length 2*N. The input buffer is modified by this function. @@ -190,8 +214,8 @@ void arm_split_rfft_q15( q15x8_t out = vhaddq_s16(MVE_CMPLX_MULT_FX_AxB_S16(in1, coefA), MVE_CMPLX_MULT_FX_AxConjB_S16(coefB, in2)); #else - q15x8_t out = vhaddq_s16(MVE_CMPLX_MULT_FX_AxB(in1, coefA), - MVE_CMPLX_MULT_FX_AxConjB(coefB, in2)); + q15x8_t out = vhaddq_s16(MVE_CMPLX_MULT_FX_AxB(in1, coefA, q15x8_t), + MVE_CMPLX_MULT_FX_AxConjB(coefB, in2, q15x8_t)); #endif vst1q_s16(pOut1, out); pOut1 += 8; @@ -415,8 +439,8 @@ void arm_split_rifft_q15( q15x8_t coefB = vldrhq_gather_shifted_offset_s16(pCoefBb, offsetCoef); /* can we avoid the conjugate here ? */ - q15x8_t out = vhaddq_s16(MVE_CMPLX_MULT_FX_AxConjB(in1, coefA), - vmulq(conj, MVE_CMPLX_MULT_FX_AxB(in2, coefB))); + q15x8_t out = vhaddq_s16(MVE_CMPLX_MULT_FX_AxConjB(in1, coefA, q15x8_t), + vmulq(conj, MVE_CMPLX_MULT_FX_AxB(in2, coefB, q15x8_t))); vst1q_s16(pDst, out); pDst += 8; diff --git a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_q31.c b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_q31.c index 1741685..20d93cf 100644 --- a/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_q31.c +++ b/edge-impulse-sdk/CMSIS/DSP/Source/TransformFunctions/arm_rfft_q31.c @@ -5,13 +5,13 @@ * Title: arm_rfft_q31.c * Description: FFT & RIFFT Q31 process function * - * $Date: 18. March 2019 - * $Revision: V1.6.0 + * $Date: 23 April 2021 + * $Revision: V1.9.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M and Cortex-A cores * -------------------------------------------------------------------- */ /* - * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -66,10 +66,34 @@ void arm_split_rifft_q31( Internally input is downscaled by 2 for every stage to avoid saturations inside CFFT/CIFFT process. Hence the output format is different for different RFFT sizes. The input and output formats for different RFFT sizes and number of bits to upscale are mentioned in the tables below for RFFT and RIFFT: - @par - \image html RFFTQ31.gif "Input and Output Formats for Q31 RFFT" - @par - \image html RIFFTQ31.gif "Input and Output Formats for Q31 RIFFT" + @par Input and Output formats for RFFT Q31 + +| RFFT Size | Input Format | Output Format | Number of bits to upscale | +| ---------: | ------------: | -------------: | ------------------------: | +| 32 | 1.31 | 5.27 | 5 | +| 64 | 1.31 | 6.26 | 6 | +| 128 | 1.31 | 7.25 | 7 | +| 256 | 1.31 | 8.24 | 8 | +| 512 | 1.31 | 9.23 | 9 | +| 1024 | 1.31 | 10.22 | 10 | +| 2048 | 1.31 | 11.21 | 11 | +| 4096 | 1.31 | 12.20 | 12 | +| 8192 | 1.31 | 13.19 | 13 | + + @par Input and Output formats for RIFFT Q31 + +| RIFFT Size | Input Format | Output Format | Number of bits to upscale | +| ----------: | ------------: | -------------: | ------------------------: | +| 32 | 1.31 | 5.27 | 0 | +| 64 | 1.31 | 6.26 | 0 | +| 128 | 1.31 | 7.25 | 0 | +| 256 | 1.31 | 8.24 | 0 | +| 512 | 1.31 | 9.23 | 0 | +| 1024 | 1.31 | 10.22 | 0 | +| 2048 | 1.31 | 11.21 | 0 | +| 4096 | 1.31 | 12.20 | 0 | +| 8192 | 1.31 | 13.19 | 0 | + @par If the input buffer is of length N, the output buffer must have length 2*N. The input buffer is modified by this function. @@ -183,7 +207,8 @@ void arm_split_rfft_q31( #if defined(__CMSIS_GCC_H) q31x4_t out = vhaddq_s32(MVE_CMPLX_MULT_FX_AxB_S32(in1, coefA),MVE_CMPLX_MULT_FX_AxConjB_S32(coefB, in2)); #else - q31x4_t out = vhaddq_s32(MVE_CMPLX_MULT_FX_AxB(in1, coefA),MVE_CMPLX_MULT_FX_AxConjB(coefB, in2)); + q31x4_t out = vhaddq_s32(MVE_CMPLX_MULT_FX_AxB(in1, coefA, q31x4_t), + MVE_CMPLX_MULT_FX_AxConjB(coefB, in2, q31x4_t)); #endif vst1q(pOut1, out); pOut1 += 4; @@ -342,8 +367,8 @@ void arm_split_rifft_q31( q31x4_t out = vhaddq_s32(MVE_CMPLX_MULT_FX_AxConjB_S32(in1, coefA), vmulq_s32(conj, MVE_CMPLX_MULT_FX_AxB_S32(in2, coefB))); #else - q31x4_t out = vhaddq_s32(MVE_CMPLX_MULT_FX_AxConjB(in1, coefA), - vmulq_s32(conj, MVE_CMPLX_MULT_FX_AxB(in2, coefB))); + q31x4_t out = vhaddq_s32(MVE_CMPLX_MULT_FX_AxConjB(in1, coefA, q31x4_t), + vmulq_s32(conj, MVE_CMPLX_MULT_FX_AxB(in2, coefB, q31x4_t))); #endif vst1q_s32(pDst, out); pDst += 4; diff --git a/edge-impulse-sdk/CMSIS/NN/Include/arm_nn_math_types.h b/edge-impulse-sdk/CMSIS/NN/Include/arm_nn_math_types.h new file mode 100644 index 0000000..d650980 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Include/arm_nn_math_types.h @@ -0,0 +1,172 @@ +/* + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/****************************************************************************** + * @file arm_nn_math_types.h + * @brief Compiler include and basic types + * @version V1.2.0 + * @date 20 June 2022 + * Target Processor: Cortex-M + ******************************************************************************/ + +/** + Copied from CMSIS/DSP/arm_math_types.h and modified +*/ + +#ifndef _ARM_NN_MATH_TYPES_H_ + +#define _ARM_NN_MATH_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include +#include + +/* Integer aliases */ +typedef int8_t q7_t; +typedef int16_t q15_t; +typedef int32_t q31_t; +typedef int64_t q63_t; + +/* Compiler specific diagnostic adjustment */ +#if defined(__CC_ARM) + +#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + +#elif defined(__GNUC__) + +#elif defined(__ICCARM__) + +#elif defined(__TI_ARM__) + +#elif defined(__CSMC__) + +#elif defined(__TASKING__) + +#elif defined(_MSC_VER) + +#else +#error Unknown compiler +#endif + +/* Included for instrinsics definitions */ +#if defined(_MSC_VER) +#ifndef __STATIC_FORCEINLINE +#define __STATIC_FORCEINLINE static __forceinline +#endif +#ifndef __STATIC_INLINE +#define __STATIC_INLINE static __inline +#endif +#ifndef __ALIGNED +#define __ALIGNED(x) __declspec(align(x)) +#endif + +#elif defined(__GNUC_PYTHON__) +#ifndef __ALIGNED +#define __ALIGNED(x) __attribute__((aligned(x))) +#endif +#ifndef __STATIC_FORCEINLINE +#define __STATIC_FORCEINLINE static inline __attribute__((always_inline)) +#endif +#ifndef __STATIC_INLINE +#define __STATIC_INLINE static inline +#endif + +#else +#include "edge-impulse-sdk/CMSIS/Core/Include/cmsis_compiler.h" +#endif + +/* evaluate ARM DSP feature */ +#if (defined(__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) +#ifndef ARM_MATH_DSP +#define ARM_MATH_DSP 1 +#endif +#endif + +#if __ARM_FEATURE_MVE +#ifndef ARM_MATH_MVEI +#define ARM_MATH_MVEI +#endif +#endif + +/* Compiler specific diagnostic adjustment */ +#if defined(__CC_ARM) + +#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + +#elif defined(__GNUC__) +// #pragma GCC diagnostic pop + +#elif defined(__ICCARM__) + +#elif defined(__TI_ARM__) + +#elif defined(__CSMC__) + +#elif defined(__TASKING__) + +#elif defined(_MSC_VER) + +#else +#error Unknown compiler +#endif + +#ifdef __cplusplus +} +#endif + +#if __ARM_FEATURE_MVE +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Add necessary typedefs + */ + +#define NN_Q31_MAX ((q31_t)(0x7FFFFFFFL)) +#define NN_Q15_MAX ((q15_t)(0x7FFF)) +#define NN_Q7_MAX ((q7_t)(0x7F)) +#define NN_Q31_MIN ((q31_t)(0x80000000L)) +#define NN_Q15_MIN ((q15_t)(0x8000)) +#define NN_Q7_MIN ((q7_t)(0x80)) + +/** + * @brief Error status returned by some functions in the library. + */ + +typedef enum +{ + ARM_CMSIS_NN_SUCCESS = 0, /**< No error */ + ARM_CMSIS_NN_ARG_ERROR = -1, /**< One or more arguments are incorrect */ + ARM_CMSIS_NN_NO_IMPL_ERROR = -2, /**< No implementation available */ +} arm_cmsis_nn_status; + +#ifdef __cplusplus +} +#endif + +#endif /*ifndef _ARM_NN_MATH_TYPES_H_ */ diff --git a/edge-impulse-sdk/CMSIS/NN/Include/arm_nn_tables.h b/edge-impulse-sdk/CMSIS/NN/Include/arm_nn_tables.h index 3d2b534..85a7537 100644 --- a/edge-impulse-sdk/CMSIS/NN/Include/arm_nn_tables.h +++ b/edge-impulse-sdk/CMSIS/NN/Include/arm_nn_tables.h @@ -3,8 +3,8 @@ * Title: arm_nn_tables.h * Description: Extern declaration for NN tables * - * $Date: 09. October 2020 - * $Revision: V.1.0.1 + * $Date: 17. August 2021 + * $Revision: V.1.0.2 * * Target Processor: Cortex-M cores * -------------------------------------------------------------------- */ @@ -29,12 +29,12 @@ #ifndef _ARM_NN_TABLES_H #define _ARM_NN_TABLES_H -#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nn_math_types.h" /** -* @brief tables for various activation functions -* -*/ + * @brief tables for various activation functions + * + */ extern const q15_t sigmoidTable_q15[256]; extern const q7_t sigmoidTable_q7[256]; diff --git a/edge-impulse-sdk/CMSIS/NN/Include/arm_nn_types.h b/edge-impulse-sdk/CMSIS/NN/Include/arm_nn_types.h index 206af07..6040d72 100644 --- a/edge-impulse-sdk/CMSIS/NN/Include/arm_nn_types.h +++ b/edge-impulse-sdk/CMSIS/NN/Include/arm_nn_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved. + * Copyright (C) 2020-2022 Arm Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -22,8 +22,8 @@ * Description: Public header file to contain the CMSIS-NN structs for the * TensorFlowLite micro compliant functions * - * $Date: 09. October 2020 - * $Revision: V.1.0.0 + * $Date: 22. Februari 2022 + * $Revision: V.2.1.0 * * Target Processor: Cortex-M cores * -------------------------------------------------------------------- */ @@ -112,7 +112,7 @@ typedef struct typedef struct { int32_t input_offset; /**< Zero value for the input tensor */ - int32_t filter_offset; /**< Zero value for the filter tensor */ + int32_t filter_offset; /**< Zero value for the filter tensor. Not used */ int32_t output_offset; /**< Zero value for the output tensor */ cmsis_nn_activation activation; } cmsis_nn_fc_params; @@ -127,4 +127,11 @@ typedef struct cmsis_nn_activation output_activation; } cmsis_nn_svdf_params; +/** CMSIS-NN object for Softmax s16 layer parameters */ +typedef struct +{ + const int16_t *exp_lut; + const int16_t *one_by_one_lut; +} cmsis_nn_softmax_lut_s16; + #endif // _ARM_NN_TYPES_H diff --git a/edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h b/edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h index f43c0de..1548a20 100644 --- a/edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h +++ b/edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -21,8 +21,8 @@ * Title: arm_nnfunctions.h * Description: Public header file for CMSIS NN Library * - * $Date: 19 January 2021 - * $Revision: V.6.5.3 + * $Date: 7 Aug 2022 + * $Revision: V.10.1.2 * * Target Processor: Cortex-M CPUs * -------------------------------------------------------------------- */ @@ -51,6 +51,15 @@ * kernels are included in the function description. The implementation details are also * described in this paper [1]. * + * Supported Processors + * ------- + * CMSIS-NN targets Cortex-M processors with typically three different implementations for each function. Each + * targets a different group of processors. + * - Processors without SIMD capability (e.g, Cortex-M0) + * - Processors with DSP extention (e.g Cortex-M4) + * - Processors with MVE extension (e.g Cortex-M55) + * The right implementation is picked through feature flags and the user usually does not have to explicit set it. + * * Function Classification * -------- * The functions can be classified into two segments @@ -103,7 +112,7 @@ * Copyright Notice * ------------ * - * Copyright (C) 2010-2019 Arm Limited. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * [1] CMSIS-NN: Efficient Neural Network Kernels for Arm Cortex-M CPUs https://arxiv.org/abs/1801.06601 * @@ -124,809 +133,620 @@ #ifndef _ARM_NNFUNCTIONS_H #define _ARM_NNFUNCTIONS_H +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nn_math_types.h" #include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/none.h" -#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types.h" -#include "arm_nn_types.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nn_types.h" #define USE_INTRINSIC //#define ARM_NN_TRUNCATE /* This config the rounding model to floor or round to the nearest int */ #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif - /** - * @brief Struct for specifying activation function types - * - */ - typedef enum - { - ARM_SIGMOID = 0, - /**< Sigmoid activation function */ - ARM_TANH = 1, - /**< Tanh activation function */ - } arm_nn_activation_type; - - /** - * @defgroup NNConv Convolution Functions - * - * Collection of convolution, depthwise convolution functions and their variants. - * - * The convolution is implemented in 2 steps: im2col and GEMM - * - * im2col is a process of converting each patch of image data into - * a column. After im2col, the convolution is computed as matrix-matrix - * multiplication. - * - * To reduce the memory footprint, the im2col is performed partially. - * Each iteration, only a few column (i.e., patches) are generated and - * computed with GEMM kernels similar to CMSIS-DSP arm_mat_mult functions. - * - */ - - /** - * @brief s8 convolution layer wrapper function with the main purpose to call the optimal kernel available in - cmsis-nn - * to perform the convolution. - * - * @param[in, out] ctx Function context that contains the additional buffer if required by the function. - arm_convolve_wrapper_s8_get_buffer_size will return the buffer_size if required - * @param[in] conv_params Convolution parameters (e.g. strides, dilations, pads,...). - * Range of conv_params->input_offset : [-127, 128] - * Range of conv_params->output_offset : [-128, 127] - * @param[in] quant_params Per-channel quantization info. - * It contains the multiplier and shift values to be applied to each output channel - * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] - * @param[in] input_data Input (activation) data pointer. Data type: int8 - * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, HK, WK, C_IN] where HK and WK are the - * spatial filter dimensions - * @param[in] filter_data Filter data pointer. Data type: int8 - * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] - * @param[in] bias_data Bias data pointer. Data type: int32 - * @param[in] output_dims Output tensor dimensions. Format: [N, H, W, C_OUT] - * @param[out] output_data Output data pointer. Data type: int8 - * - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH if argument constraints fail. or, - * ARM_MATH_SUCCESS on successful completion. - * - */ - arm_status arm_convolve_wrapper_s8(const cmsis_nn_context *ctx, - const cmsis_nn_conv_params *conv_params, - const cmsis_nn_per_channel_quant_params *quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input_data, - const cmsis_nn_dims *filter_dims, - const q7_t *filter_data, - const cmsis_nn_dims *bias_dims, - const int32_t *bias_data, - const cmsis_nn_dims *output_dims, - q7_t *output_data); - - /** - * @brief Get the required buffer size for arm_convolve_wrapper_s8 - * - * @param[in] conv_params Convolution parameters (e.g. strides, dilations, pads,...). - * Range of conv_params->input_offset : [-127, 128] - * Range of conv_params->output_offset : [-128, 127] - * @param[in] input_dims Input (activation) dimensions. Format: [N, H, W, C_IN] - * @param[in] filter_dims Filter dimensions. Format: [C_OUT, HK, WK, C_IN] where HK and WK are the spatial - * filter dimensions - * @param[in] output_dims Output tensor dimensions. Format: [N, H, W, C_OUT] - * - * @return The function returns required buffer size(bytes) - * - */ - int32_t arm_convolve_wrapper_s8_get_buffer_size(const cmsis_nn_conv_params *conv_params, - const cmsis_nn_dims *input_dims, - const cmsis_nn_dims *filter_dims, - const cmsis_nn_dims *output_dims); - - /** - * @brief Basic s8 convolution function - * @param[in, out] ctx Function context that contains the additional buffer if required by the function. - arm_convolve_s8_get_buffer_size will return the buffer_size if required - * @param[in] conv_params Convolution parameters (e.g. strides, dilations, pads,...). - * Range of conv_params->input_offset : [-127, 128] - * Range of conv_params->output_offset : [-128, 127] - * @param[in] quant_params Per-channel quantization info. - * It contains the multiplier and shift values to be applied to each output channel - * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] - * @param[in] input_data Input (activation) data pointer. Data type: int8 - * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, HK, WK, C_IN] where HK and WK are the - * spatial filter dimensions - * @param[in] filter_data Filter data pointer. Data type: int8 - * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] - * @param[in] bias_data Optional bias data pointer. Data type: int32 - * @param[in] output_dims Output tensor dimensions. Format: [N, H, W, C_OUT] - * @param[out] output_data Output data pointer. Data type: int8 - - * @return The function returns ARM_MATH_SUCCESS - * - * @details - * 1. Supported framework: TensorFlow Lite micro - * 2. q7 is used as data type eventhough it is s8 data. It is done so to be consistent with existing APIs. - * 3. Additional memory is required for optimization. Refer to argument 'ctx' for details. - * - */ - arm_status arm_convolve_s8(const cmsis_nn_context *ctx, - const cmsis_nn_conv_params *conv_params, - const cmsis_nn_per_channel_quant_params *quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input_data, - const cmsis_nn_dims *filter_dims, - const q7_t *filter_data, - const cmsis_nn_dims *bias_dims, - const int32_t *bias_data, - const cmsis_nn_dims *output_dims, - q7_t *output_data); - - /** - * @brief Get the required buffer size for s8 convolution function - * - * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] - * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, HK, WK, C_IN] where HK and WK - * are the spatial filter dimensions - * @return The function returns required buffer size(bytes) - * - */ - int32_t arm_convolve_s8_get_buffer_size(const cmsis_nn_dims *input_dims, const cmsis_nn_dims *filter_dims); - - /** - * @brief Basic Q7 convolution function - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in input tensor dimension - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel filter kernel size - * @param[in] padding padding sizes - * @param[in] stride convolution stride - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out output tensor dimension - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns ARM_MATH_SUCCESS - * - */ - arm_status arm_convolve_HWC_q7_basic(const q7_t *Im_in, - const uint16_t dim_im_in, - const uint16_t ch_im_in, - const q7_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel, - const uint16_t padding, - const uint16_t stride, - const q7_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q7_t *Im_out, - const uint16_t dim_im_out, - q15_t *bufferA, - q7_t *bufferB); - - /** - * @brief Basic Q7 convolution function (non-square shape) - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in_x input tensor dimension x - * @param[in] dim_im_in_y input tensor dimension y - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel_x filter kernel size x - * @param[in] dim_kernel_y filter kernel size y - * @param[in] padding_x padding size x - * @param[in] padding_y padding size y - * @param[in] stride_x convolution stride x - * @param[in] stride_y convolution stride y - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out_x output tensor dimension x - * @param[in] dim_im_out_y output tensor dimension y - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns ARM_MATH_SUCCESS - */ - arm_status arm_convolve_HWC_q7_basic_nonsquare(const q7_t *Im_in, - const uint16_t dim_im_in_x, - const uint16_t dim_im_in_y, - const uint16_t ch_im_in, - const q7_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel_x, - const uint16_t dim_kernel_y, - const uint16_t padding_x, - const uint16_t padding_y, - const uint16_t stride_x, - const uint16_t stride_y, - const q7_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q7_t *Im_out, - const uint16_t dim_im_out_x, - const uint16_t dim_im_out_y, - q15_t *bufferA, - q7_t *bufferB); - - /** - * @brief Basic Q15 convolution function - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in input tensor dimension - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel filter kernel size - * @param[in] padding padding sizes - * @param[in] stride convolution stride - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out output tensor dimension - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns ARM_MATH_SUCCESS - * - */ - arm_status arm_convolve_HWC_q15_basic(const q15_t *Im_in, - const uint16_t dim_im_in, - const uint16_t ch_im_in, - const q15_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel, - const uint16_t padding, - const uint16_t stride, - const q15_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q15_t *Im_out, - const uint16_t dim_im_out, - q15_t *bufferA, - q7_t *bufferB); - - /** - * @brief Fast Q7 convolution function - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in input tensor dimension - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel filter kernel size - * @param[in] padding padding sizes - * @param[in] stride convolution stride - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out output tensor dimension - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - * - * This function is the version with full list of optimization tricks, but with - * some contraints: - * ch_im_in is multiple of 4 - * ch_im_out is multiple of 2 - */ - arm_status arm_convolve_HWC_q7_fast(const q7_t *Im_in, - const uint16_t dim_im_in, - const uint16_t ch_im_in, - const q7_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel, - const uint16_t padding, - const uint16_t stride, - const q7_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q7_t *Im_out, - const uint16_t dim_im_out, - q15_t *bufferA, - q7_t *bufferB); - - /** - * @brief Fast Q7 convolution function (non-sqaure shape) - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in_x input tensor dimension x - * @param[in] dim_im_in_y input tensor dimension y - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel_x filter kernel size x - * @param[in] dim_kernel_y filter kernel size y - * @param[in] padding_x padding size x - * @param[in] padding_y padding size y - * @param[in] stride_x convolution stride x - * @param[in] stride_y convolution stride y - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out_x output tensor dimension x - * @param[in] dim_im_out_y output tensor dimension y - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - * - * This function is the version with full list of optimization tricks, but with - * some contraints: - * ch_im_in is multiple of 4 - * ch_im_out is multiple of 2 - */ - - arm_status arm_convolve_HWC_q7_fast_nonsquare(const q7_t *Im_in, - const uint16_t dim_im_in_x, - const uint16_t dim_im_in_y, - const uint16_t ch_im_in, - const q7_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel_x, - const uint16_t dim_kernel_y, - const uint16_t padding_x, - const uint16_t padding_y, - const uint16_t stride_x, - const uint16_t stride_y, - const q7_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q7_t *Im_out, - const uint16_t dim_im_out_x, - const uint16_t dim_im_out_y, - q15_t *bufferA, - q7_t *bufferB); - - /** - * @brief Fast Q7 version of 1x1 convolution (non-sqaure shape) - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in_x input tensor dimension x - * @param[in] dim_im_in_y input tensor dimension y - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel_x filter kernel size x - * @param[in] dim_kernel_y filter kernel size y - * @param[in] padding_x padding size x - * @param[in] padding_y padding size y - * @param[in] stride_x convolution stride x - * @param[in] stride_y convolution stride y - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out_x output tensor dimension x - * @param[in] dim_im_out_y output tensor dimension y - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH if argument constraints fail. or, - * ARM_MATH_SUCCESS on successful completion. - * - * This function implement convolution with 1x1 kernel size (i.e., dim_kernel_x=1 - * and dim_kernel_y=1). It can be used for - * second half of MobileNets after depthwise separable convolution. - * - * This function is the version with full list of optimization tricks, but with - * some contraints: - * ch_im_in is multiple of 4 - * ch_im_out is multiple of 2 - */ - arm_status arm_convolve_1x1_HWC_q7_fast_nonsquare(const q7_t *Im_in, - const uint16_t dim_im_in_x, - const uint16_t dim_im_in_y, - const uint16_t ch_im_in, - const q7_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel_x, - const uint16_t dim_kernel_y, - const uint16_t padding_x, - const uint16_t padding_y, - const uint16_t stride_x, - const uint16_t stride_y, - const q7_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q7_t *Im_out, - const uint16_t dim_im_out_x, - const uint16_t dim_im_out_y, - q15_t *bufferA, - q7_t *bufferB); - - /** - * @brief Fast s8 version for 1x1 convolution (non-square shape) - * - * @param[in, out] ctx Function context that contains the additional buffer if required by the function. - arm_convolve_1x1_s8_fast_get_buffer_size will return the buffer_size if required - * @param[in] conv_params Convolution parameters (e.g. strides, dilations, pads,...). - * Range of conv_params->input_offset : [-127, 128] - * Range of conv_params->output_offset : [-128, 127] - * @param[in] quant_params Per-channel quantization info. - * It contains the multiplier and shift values to be applied to each output channel - * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] - * @param[in] input_data Input (activation) data pointer. Data type: int8 - * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, 1, 1, C_IN] - * @param[in] filter_data Filter data pointer. Data type: int8 - * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] - * @param[in] bias_data Optional bias data pointer. Data type: int32 - * @param[in] output_dims Output tensor dimensions. Format: [N, H, W, C_OUT] - * @param[out] output_data Output data pointer. Data type: int8 - * - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH if argument constraints fail. or, - * ARM_MATH_SUCCESS on successful completion. - * - * @details - * - Supported framework : TensorFlow Lite Micro - * - The following constrains on the arguments apply - * -# input_dims->c is a multiple of 4 - * -# conv_params->padding.w = conv_params->padding.h = 0 - * -# conv_params->stride.w = conv_params->stride.h = 1 - * - */ - arm_status arm_convolve_1x1_s8_fast(const cmsis_nn_context *ctx, - const cmsis_nn_conv_params *conv_params, - const cmsis_nn_per_channel_quant_params *quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input_data, - const cmsis_nn_dims *filter_dims, - const q7_t *filter_data, - const cmsis_nn_dims *bias_dims, - const int32_t *bias_data, - const cmsis_nn_dims *output_dims, - q7_t *output_data); - - /** - * @brief Get the required buffer size for arm_convolve_1x1_s8_fast - * - * @param[in] input_dims Input (activation) dimensions - * @return The function returns the required buffer size in bytes - * - */ - int32_t arm_convolve_1x1_s8_fast_get_buffer_size(const cmsis_nn_dims *input_dims); - - /** - * @brief 1xn convolution - * - * @param[in, out] ctx Function context that contains the additional buffer if required by the function. - arm_convolve_1_x_n_s8_get_buffer_size will return the buffer_size if required - * @param[in] conv_params Convolution parameters (e.g. strides, dilations, pads,...). - * Range of conv_params->input_offset : [-127, 128] - * Range of conv_params->output_offset : [-128, 127] - * @param[in] quant_params Per-channel quantization info. - * It contains the multiplier and shift values to be applied to each output channel - * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] - * @param[in] input_data Input (activation) data pointer. Data type: int8 - * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, 1, WK, C_IN] where WK is the horizontal - * spatial filter dimension - * @param[in] filter_data Filter data pointer. Data type: int8 - * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] - * @param[in] bias_data Optional bias data pointer. Data type: int32 - * @param[in] output_dims Output tensor dimensions. Format: [N, H, W, C_OUT] - * @param[out] output_data Output data pointer. Data type: int8 - * - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH if argument constraints fail. or, - * ARM_MATH_SUCCESS on successful completion. - * - * @details - * - Supported framework : TensorFlow Lite Micro - * - The following constrains on the arguments apply - * -# input_dims->n equals 1 - * -# ouput_dims->w is a multiple of 4 - * -# Explicit constraints(since it is for 1xN convolution) - * -## input_dims->h equals 1 - * -## output_dims->h equals 1 - * -## filter_dims->h equals 1 - *@todo Remove constraint on output_dims->w to make the function generic. - * - */ - arm_status arm_convolve_1_x_n_s8(const cmsis_nn_context *ctx, +/** + * @brief Struct for specifying activation function types + * + */ +typedef enum +{ + ARM_SIGMOID = 0, + /**< Sigmoid activation function */ + ARM_TANH = 1, + /**< Tanh activation function */ +} arm_nn_activation_type; + +/** + * @defgroup NNConv Convolution Functions + * + * Collection of convolution, depthwise convolution functions and their variants. + * + * The convolution is implemented in 2 steps: im2col and GEMM + * + * im2col is a process of converting each patch of image data into + * a column. After im2col, the convolution is computed as matrix-matrix + * multiplication. + * + * To reduce the memory footprint, the im2col is performed partially. + * Each iteration, only a few column (i.e., patches) are generated and + * computed with GEMM kernels similar to CMSIS-DSP arm_mat_mult functions. + * + */ + +/** + * @brief s8 convolution layer wrapper function with the main purpose to call the optimal kernel available in + * cmsis-nn to perform the convolution. + * + * @param[in, out] ctx Function context that contains the additional buffer if required by the function. + * arm_convolve_wrapper_s8_get_buffer_size will return the buffer_size if required. + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] conv_params Convolution parameters (e.g. strides, dilations, pads,...). + * Range of conv_params->input_offset : [-127, 128] + * Range of conv_params->output_offset : [-128, 127] + * @param[in] quant_params Per-channel quantization info. + * It contains the multiplier and shift values to be applied to each output channel + * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] + * @param[in] input_data Input (activation) data pointer. Data type: int8 + * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, HK, WK, C_IN] where HK and WK are the + * spatial filter dimensions + * @param[in] filter_data Filter data pointer. Data type: int8 + * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] + * @param[in] bias_data Bias data pointer. Data type: int32 + * @param[in] output_dims Output tensor dimensions. Format: [N, H, W, C_OUT] + * @param[out] output_data Output data pointer. Data type: int8 + * + * @return The function returns either + * ARM_CMSIS_NN_ARG_ERROR if argument constraints fail. or, + * ARM_CMSIS_NN_SUCCESS on successful completion. + * + */ +arm_cmsis_nn_status arm_convolve_wrapper_s8(const cmsis_nn_context *ctx, + const cmsis_nn_conv_params *conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int32_t *bias_data, + const cmsis_nn_dims *output_dims, + q7_t *output_data); + +/** + * @brief Get the required buffer size for arm_convolve_wrapper_s8 + * + * @param[in] conv_params Convolution parameters (e.g. strides, dilations, pads,...). + * Range of conv_params->input_offset : [-127, 128] + * Range of conv_params->output_offset : [-128, 127] + * @param[in] input_dims Input (activation) dimensions. Format: [N, H, W, C_IN] + * @param[in] filter_dims Filter dimensions. Format: [C_OUT, HK, WK, C_IN] where HK and WK are the spatial + * filter dimensions + * @param[in] output_dims Output tensor dimensions. Format: [N, H, W, C_OUT] + * + * @return The function returns required buffer size(bytes) + * + */ +int32_t arm_convolve_wrapper_s8_get_buffer_size(const cmsis_nn_conv_params *conv_params, + const cmsis_nn_dims *input_dims, + const cmsis_nn_dims *filter_dims, + const cmsis_nn_dims *output_dims); + +/** + * @brief s16 convolution layer wrapper function with the main purpose to call the optimal kernel available in + * cmsis-nn to perform the convolution. + * + * @param[in, out] ctx Function context that contains the additional buffer if required by the function. + * arm_convolve_wrapper_s8_get_buffer_size will return the buffer_size if required + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] conv_params Convolution parameters (e.g. strides, dilations, pads,...). + * conv_params->input_offset : Not used + * conv_params->output_offset : Not used + * @param[in] quant_params Per-channel quantization info. + * It contains the multiplier and shift values to be applied to each output channel + * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] + * @param[in] input_data Input (activation) data pointer. Data type: int16 + * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, HK, WK, C_IN] where HK and WK are the + * spatial filter dimensions + * @param[in] filter_data Filter data pointer. Data type: int8 + * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] + * @param[in] bias_data Bias data pointer. Data type: int64 + * @param[in] output_dims Output tensor dimensions. Format: [N, H, W, C_OUT] + * @param[out] output_data Output data pointer. Data type: int16 + * + * @return The function returns either + * ARM_CMSIS_NN_ARG_ERROR if argument constraints fail. or, + * ARM_CMSIS_NN_SUCCESS on successful completion. + * + */ +arm_cmsis_nn_status arm_convolve_wrapper_s16(const cmsis_nn_context *ctx, + const cmsis_nn_conv_params *conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q15_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int64_t *bias_data, + const cmsis_nn_dims *output_dims, + q15_t *output_data); + +/** + * @brief Get the required buffer size for arm_convolve_wrapper_s16 + * + * @param[in] conv_params Convolution parameters (e.g. strides, dilations, pads,...). + * conv_params->input_offset : Not used + * conv_params->output_offset : Not used + * @param[in] input_dims Input (activation) dimensions. Format: [N, H, W, C_IN] + * @param[in] filter_dims Filter dimensions. Format: [C_OUT, HK, WK, C_IN] where HK and WK are the spatial + * filter dimensions + * @param[in] output_dims Output tensor dimensions. Format: [N, H, W, C_OUT] + * + * @return The function returns required buffer size(bytes) + * + */ +int32_t arm_convolve_wrapper_s16_get_buffer_size(const cmsis_nn_conv_params *conv_params, + const cmsis_nn_dims *input_dims, + const cmsis_nn_dims *filter_dims, + const cmsis_nn_dims *output_dims); + +/** + * @brief Basic s8 convolution function + * @param[in, out] ctx Function context that contains the additional buffer if required by the function. + * arm_convolve_s8_get_buffer_size will return the buffer_size if required. + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] conv_params Convolution parameters (e.g. strides, dilations, pads,...). + * Range of conv_params->input_offset : [-127, 128] + * Range of conv_params->output_offset : [-128, 127] + * @param[in] quant_params Per-channel quantization info. + * It contains the multiplier and shift values to be applied to each output channel + * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] + * @param[in] input_data Input (activation) data pointer. Data type: int8 + * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, HK, WK, C_IN] where HK and WK are the + * spatial filter dimensions + * @param[in] filter_data Filter data pointer. Data type: int8 + * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] + * @param[in] bias_data Optional bias data pointer. Data type: int32 + * @param[in] output_dims Output tensor dimensions. Format: [N, H, W, C_OUT] + * @param[out] output_data Output data pointer. Data type: int8 + + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + * @details + * 1. Supported framework: TensorFlow Lite micro + * 2. q7 is used as data type eventhough it is s8 data. It is done so to be consistent with existing APIs. + * 3. Additional memory is required for optimization. Refer to argument 'ctx' for details. + * + */ +arm_cmsis_nn_status arm_convolve_s8(const cmsis_nn_context *ctx, + const cmsis_nn_conv_params *conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int32_t *bias_data, + const cmsis_nn_dims *output_dims, + q7_t *output_data); + +/** + * @brief Get the required buffer size for s8 convolution function + * + * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] + * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, HK, WK, C_IN] where HK and WK + * are the spatial filter dimensions + * @return The function returns required buffer size(bytes) + * + */ +int32_t arm_convolve_s8_get_buffer_size(const cmsis_nn_dims *input_dims, const cmsis_nn_dims *filter_dims); + +/** + * @brief Basic s16 convolution function + * @param[in, out] ctx Function context that contains the additional buffer if required by the function. + * arm_convolve_s16_get_buffer_size will return the buffer_size if required. + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] conv_params Convolution parameters (e.g. strides, dilations, pads,...). + * conv_params->input_offset : Not used + * conv_params->output_offset : Not used + * @param[in] quant_params Per-channel quantization info. + * It contains the multiplier and shift values to be applied to each output channel + * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] + * @param[in] input_data Input (activation) data pointer. Data type: int16 + * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, HK, WK, C_IN] where HK and WK are the + * spatial filter dimensions + * @param[in] filter_data Filter data pointer. Data type: int8 + * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] + * @param[in] bias_data Optional bias data pointer. Data type: int64 + * @param[in] output_dims Output tensor dimensions. Format: [N, H, W, C_OUT] + * @param[out] output_data Output data pointer. Data type: int16 + + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + * @details + * 1. Supported framework: TensorFlow Lite micro + * 2. q7/q15 is used as data type eventhough it is s8/s16 data. It is done so to be consistent with existing APIs. + * 3. Additional memory is required for optimization. Refer to argument 'ctx' for details. + * + */ +arm_cmsis_nn_status arm_convolve_s16(const cmsis_nn_context *ctx, const cmsis_nn_conv_params *conv_params, const cmsis_nn_per_channel_quant_params *quant_params, const cmsis_nn_dims *input_dims, - const q7_t *input_data, + const q15_t *input_data, const cmsis_nn_dims *filter_dims, const q7_t *filter_data, const cmsis_nn_dims *bias_dims, - const int32_t *bias_data, + const int64_t *bias_data, const cmsis_nn_dims *output_dims, - q7_t *output_data); - - /** - * @brief Get the required additional buffer size for 1xn convolution - * - * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] - * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, 1, WK, C_IN] where WK is the - * horizontal spatial filter dimension - * @return The function returns required buffer size(bytes) - * - */ - int32_t arm_convolve_1_x_n_s8_get_buffer_size(const cmsis_nn_dims *input_dims, const cmsis_nn_dims *filter_dims); - - /** - * @brief Q7 version of convolution for RGB image - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in input tensor dimension - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel filter kernel size - * @param[in] padding padding sizes - * @param[in] stride convolution stride - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out output tensor dimension - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - * - * This kernel is written exclusively for convolution with ch_im_in - * equals 3. This applies on the first layer of CNNs which has input - * image with RGB format. - */ - - arm_status arm_convolve_HWC_q7_RGB(const q7_t *Im_in, - const uint16_t dim_im_in, - const uint16_t ch_im_in, - const q7_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel, - const uint16_t padding, - const uint16_t stride, - const q7_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q7_t *Im_out, - const uint16_t dim_im_out, - q15_t *bufferA, - q7_t *bufferB); - - /** - * @brief Fast Q15 convolution function - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in input tensor dimension - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel filter kernel size - * @param[in] padding padding sizes - * @param[in] stride convolution stride - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out output tensor dimension - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - * - * This function is the version with full list of optimization tricks, but with - * some contraints: - * ch_im_in is multiple of 2 - * ch_im_out is multiple of 2 - */ - - arm_status arm_convolve_HWC_q15_fast(const q15_t *Im_in, - const uint16_t dim_im_in, - const uint16_t ch_im_in, - const q15_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel, - const uint16_t padding, - const uint16_t stride, - const q15_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q15_t *Im_out, - const uint16_t dim_im_out, - q15_t *bufferA, - q7_t *bufferB); - - /** - * @brief Fast Q15 convolution function (non-sqaure shape) - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in_x input tensor dimension x - * @param[in] dim_im_in_y input tensor dimension y - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel_x filter kernel size x - * @param[in] dim_kernel_y filter kernel size y - * @param[in] padding_x padding size x - * @param[in] padding_y padding size y - * @param[in] stride_x convolution stride x - * @param[in] stride_y convolution stride y - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out_x output tensor dimension x - * @param[in] dim_im_out_y output tensor dimension y - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - * - * @details - * - * Buffer size: - * - * bufferA size: 2*ch_im_in*dim_kernel*dim_kernel - * - * bufferB size: 0 - * - * Input dimension constraints: - * - * ch_im_in is multiple of 2 - * - * ch_im_out is multipe of 2 - * - */ - - arm_status arm_convolve_HWC_q15_fast_nonsquare(const q15_t *Im_in, - const uint16_t dim_im_in_x, - const uint16_t dim_im_in_y, - const uint16_t ch_im_in, - const q15_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel_x, - const uint16_t dim_kernel_y, - const uint16_t padding_x, - const uint16_t padding_y, - const uint16_t stride_x, - const uint16_t stride_y, - const q15_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q15_t *Im_out, - const uint16_t dim_im_out_x, - const uint16_t dim_im_out_y, - q15_t *bufferA, - q7_t *bufferB); - - /** - * @brief Q7 depthwise separable convolution function - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in input tensor dimension - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel filter kernel size - * @param[in] padding padding sizes - * @param[in] stride convolution stride - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out output tensor dimension - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - * - * This function is the version with full list of optimization tricks, but with - * some contraints: - * ch_im_in is multiple of 2 - * ch_im_out is multiple of 2 - */ - - arm_status arm_depthwise_separable_conv_HWC_q7(const q7_t *Im_in, - const uint16_t dim_im_in, - const uint16_t ch_im_in, - const q7_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel, - const uint16_t padding, - const uint16_t stride, - const q7_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q7_t *Im_out, - const uint16_t dim_im_out, - q15_t *bufferA, - q7_t *bufferB); - - /** - * @brief Q7 depthwise separable convolution function (non-square shape) - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in_x input tensor dimension x - * @param[in] dim_im_in_y input tensor dimension y - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel_x filter kernel size x - * @param[in] dim_kernel_y filter kernel size y - * @param[in] padding_x padding sizes x - * @param[in] padding_y padding sizes y - * @param[in] stride_x convolution stride x - * @param[in] stride_y convolution stride y - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out_x output tensor dimension x - * @param[in] dim_im_out_y output tensor dimension y - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - * - * This function is the version with full list of optimization tricks, but with - * some contraints: - * ch_im_in is multiple of 2 - * ch_im_out is multiple of 2 - */ - arm_status arm_depthwise_separable_conv_HWC_q7_nonsquare(const q7_t *Im_in, - const uint16_t dim_im_in_x, - const uint16_t dim_im_in_y, - const uint16_t ch_im_in, - const q7_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel_x, - const uint16_t dim_kernel_y, - const uint16_t padding_x, - const uint16_t padding_y, - const uint16_t stride_x, - const uint16_t stride_y, - const q7_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q7_t *Im_out, - const uint16_t dim_im_out_x, - const uint16_t dim_im_out_y, - q15_t *bufferA, - q7_t *bufferB); - - /** - * @brief Wrapper function to pick the right optimized s8 depthwise convolution function - * - * @param[in, out] ctx Function context (e.g. temporary buffer). Check the function - * definition file to see if an additional buffer is required. - * Optional function {API}_get_buffer_size() provides the buffer - * size if required. - * @param[in] dw_conv_params Depthwise convolution parameters (e.g. strides, dilations, pads,...) - * dw_conv_params->dilation is not used. - * Range of dw_conv_params->input_offset : [-127, 128] - * Range of dw_conv_params->output_offset : [-128, 127] - * @param[in] quant_params Per-channel quantization info. - * It contains the multiplier and shift values to be applied to each - * output channel - * @param[in] input_dims Input (activation) tensor dimensions. Format: [H, W, C_IN] - * Batch argument N is not used and assumed to be 1. - * @param[in] input_data Input (activation) data pointer. Data type: int8 - * @param[in] filter_dims Filter tensor dimensions. Format: [1, H, W, C_OUT] - * @param[in] filter_data Filter data pointer. Data type: int8 - * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] - * @param[in] bias_data Bias data pointer. Data type: int32 - * @param[in] output_dims Output tensor dimensions. Format: [1, H, W, C_OUT] - * @param[in, out] output_data Output data pointer. Data type: int8 - * @return The function returns - * ARM_MATH_SUCCESS - Successful completion. - * - * @details - * - Supported framework: TensorFlow Lite - * - Picks one of the the following functions - * -# arm_depthwise_conv_s8() - * -# arm_depthwise_conv_3x3_s8() - Cortex-M CPUs with DSP extension only - * -# arm_depthwise_conv_s8_opt() - * - q7 is used as data type eventhough it is s8 data. It is done so to be consistent with existing APIs. - * - Check details of arm_depthwise_conv_s8_opt() for potential data that can be accessed outside of the - * boundary. - */ - arm_status arm_depthwise_conv_wrapper_s8(const cmsis_nn_context *ctx, - const cmsis_nn_dw_conv_params *dw_conv_params, + q15_t *output_data); +/** + * @brief Optimized s16 convolution function + * @param[in, out] ctx Function context that contains the additional buffer if required by the function. + * arm_convolve_fast_s16_get_buffer_size will return the buffer_size if required. + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] conv_params Convolution parameters (e.g. strides, dilations, pads,...). + * conv_params->input_offset : Not used + * conv_params->output_offset : Not used + * @param[in] quant_params Per-channel quantization info. + * It contains the multiplier and shift values to be applied to each output channel + * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] + * @param[in] input_data Input (activation) data pointer. Data type: int16 + * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, HK, WK, C_IN] where HK and WK are the + * spatial filter dimensions. (filter_dims->w * filter_dims->h * input_dims->c) must not + exceed 512 + * @param[in] filter_data Filter data pointer. Data type: int8 + * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] + * @param[in] bias_data Optional bias data pointer. Data type: int64 + * @param[in] output_dims Output tensor dimensions. Format: [N, H, W, C_OUT] + * @param[out] output_data Output data pointer. Data type: int16 + + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + * @details + * 1. Supported framework: TensorFlow Lite micro + * 2. q7/q15 is used as data type eventhough it is s8/s16 data. It is done so to be consistent with existing APIs. + * 3. Additional memory is required for optimization. Refer to argument 'ctx' for details. + * 4. Implementation supports kernel volumes (filter width * filter height * input channels) < 512. + * + */ + +arm_cmsis_nn_status arm_convolve_fast_s16(const cmsis_nn_context *ctx, + const cmsis_nn_conv_params *conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q15_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int64_t *bias_data, + const cmsis_nn_dims *output_dims, + q15_t *output_data); + +/** + * @brief Get the required buffer size for s16 convolution function + * + * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] + * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, HK, WK, C_IN] where HK and WK + * are the spatial filter dimensions + * @return The function returns required buffer size(bytes) + * + */ +int32_t arm_convolve_s16_get_buffer_size(const cmsis_nn_dims *input_dims, const cmsis_nn_dims *filter_dims); + +/** + * @brief Get the required buffer size for fast s16 convolution function + * + * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] + * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, HK, WK, C_IN] where HK and WK + * are the spatial filter dimensions + * @return The function returns required buffer size(bytes) + * + */ +int32_t arm_convolve_fast_s16_get_buffer_size(const cmsis_nn_dims *input_dims, const cmsis_nn_dims *filter_dims); + +/** + * @brief Basic Q7 convolution function + * @param[in] Im_in pointer to input tensor + * @param[in] dim_im_in input tensor dimension + * @param[in] ch_im_in number of input tensor channels + * @param[in] wt pointer to kernel weights + * @param[in] ch_im_out number of filters, i.e., output tensor channels + * @param[in] dim_kernel filter kernel size + * @param[in] padding padding sizes + * @param[in] stride convolution stride + * @param[in] bias pointer to bias + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in,out] Im_out pointer to output tensor + * @param[in] dim_im_out output tensor dimension + * @param[in,out] bufferA pointer to buffer space for input + * @param[in,out] bufferB pointer to buffer space for output + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + */ +arm_cmsis_nn_status arm_convolve_HWC_q7_basic(const q7_t *Im_in, + const uint16_t dim_im_in, + const uint16_t ch_im_in, + const q7_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel, + const uint16_t padding, + const uint16_t stride, + const q7_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q7_t *Im_out, + const uint16_t dim_im_out, + q15_t *bufferA, + q7_t *bufferB); + +/** + * @brief Basic Q7 convolution function (non-square shape) + * @param[in] Im_in pointer to input tensor + * @param[in] dim_im_in_x input tensor dimension x + * @param[in] dim_im_in_y input tensor dimension y + * @param[in] ch_im_in number of input tensor channels + * @param[in] wt pointer to kernel weights + * @param[in] ch_im_out number of filters, i.e., output tensor channels + * @param[in] dim_kernel_x filter kernel size x + * @param[in] dim_kernel_y filter kernel size y + * @param[in] padding_x padding size x + * @param[in] padding_y padding size y + * @param[in] stride_x convolution stride x + * @param[in] stride_y convolution stride y + * @param[in] bias pointer to bias + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in,out] Im_out pointer to output tensor + * @param[in] dim_im_out_x output tensor dimension x + * @param[in] dim_im_out_y output tensor dimension y + * @param[in,out] bufferA pointer to buffer space for input + * @param[in,out] bufferB pointer to buffer space for output + * @return The function returns ARM_CMSIS_NN_SUCCESS + */ +arm_cmsis_nn_status arm_convolve_HWC_q7_basic_nonsquare(const q7_t *Im_in, + const uint16_t dim_im_in_x, + const uint16_t dim_im_in_y, + const uint16_t ch_im_in, + const q7_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel_x, + const uint16_t dim_kernel_y, + const uint16_t padding_x, + const uint16_t padding_y, + const uint16_t stride_x, + const uint16_t stride_y, + const q7_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q7_t *Im_out, + const uint16_t dim_im_out_x, + const uint16_t dim_im_out_y, + q15_t *bufferA, + q7_t *bufferB); + +/** + * @brief Basic Q15 convolution function + * @param[in] Im_in pointer to input tensor + * @param[in] dim_im_in input tensor dimension + * @param[in] ch_im_in number of input tensor channels + * @param[in] wt pointer to kernel weights + * @param[in] ch_im_out number of filters, i.e., output tensor channels + * @param[in] dim_kernel filter kernel size + * @param[in] padding padding sizes + * @param[in] stride convolution stride + * @param[in] bias pointer to bias + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in,out] Im_out pointer to output tensor + * @param[in] dim_im_out output tensor dimension + * @param[in,out] bufferA pointer to buffer space for input + * @param[in,out] bufferB pointer to buffer space for output + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + */ +arm_cmsis_nn_status arm_convolve_HWC_q15_basic(const q15_t *Im_in, + const uint16_t dim_im_in, + const uint16_t ch_im_in, + const q15_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel, + const uint16_t padding, + const uint16_t stride, + const q15_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q15_t *Im_out, + const uint16_t dim_im_out, + q15_t *bufferA, + q7_t *bufferB); + +/** + * @brief Fast Q7 convolution function + * @param[in] Im_in pointer to input tensor + * @param[in] dim_im_in input tensor dimension + * @param[in] ch_im_in number of input tensor channels + * @param[in] wt pointer to kernel weights + * @param[in] ch_im_out number of filters, i.e., output tensor channels + * @param[in] dim_kernel filter kernel size + * @param[in] padding padding sizes + * @param[in] stride convolution stride + * @param[in] bias pointer to bias + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in,out] Im_out pointer to output tensor + * @param[in] dim_im_out output tensor dimension + * @param[in,out] bufferA pointer to buffer space for input + * @param[in,out] bufferB pointer to buffer space for output + * @return The function returns either + * ARM_CMSIS_NN_ARG_ERROR or ARM_CMSIS_NN_SUCCESS based on the outcome of input arguments + * constraints checking. + * + * This function is the version with full list of optimization tricks, but with + * some contraints: + * ch_im_in is multiple of 4 + * ch_im_out is multiple of 2 + */ +arm_cmsis_nn_status arm_convolve_HWC_q7_fast(const q7_t *Im_in, + const uint16_t dim_im_in, + const uint16_t ch_im_in, + const q7_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel, + const uint16_t padding, + const uint16_t stride, + const q7_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q7_t *Im_out, + const uint16_t dim_im_out, + q15_t *bufferA, + q7_t *bufferB); + +/** + * @brief Fast Q7 convolution function (non-sqaure shape) + * @param[in] Im_in pointer to input tensor + * @param[in] dim_im_in_x input tensor dimension x + * @param[in] dim_im_in_y input tensor dimension y + * @param[in] ch_im_in number of input tensor channels + * @param[in] wt pointer to kernel weights + * @param[in] ch_im_out number of filters, i.e., output tensor channels + * @param[in] dim_kernel_x filter kernel size x + * @param[in] dim_kernel_y filter kernel size y + * @param[in] padding_x padding size x + * @param[in] padding_y padding size y + * @param[in] stride_x convolution stride x + * @param[in] stride_y convolution stride y + * @param[in] bias pointer to bias + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in,out] Im_out pointer to output tensor + * @param[in] dim_im_out_x output tensor dimension x + * @param[in] dim_im_out_y output tensor dimension y + * @param[in,out] bufferA pointer to buffer space for input + * @param[in,out] bufferB pointer to buffer space for output + * @return The function returns either + * ARM_CMSIS_NN_ARG_ERROR or ARM_CMSIS_NN_SUCCESS based on the outcome of input arguments + * constraints checking. + * + * This function is the version with full list of optimization tricks, but with + * some contraints: + * ch_im_in is multiple of 4 + * ch_im_out is multiple of 2 + */ + +arm_cmsis_nn_status arm_convolve_HWC_q7_fast_nonsquare(const q7_t *Im_in, + const uint16_t dim_im_in_x, + const uint16_t dim_im_in_y, + const uint16_t ch_im_in, + const q7_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel_x, + const uint16_t dim_kernel_y, + const uint16_t padding_x, + const uint16_t padding_y, + const uint16_t stride_x, + const uint16_t stride_y, + const q7_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q7_t *Im_out, + const uint16_t dim_im_out_x, + const uint16_t dim_im_out_y, + q15_t *bufferA, + q7_t *bufferB); + +/** + * @brief Fast Q7 version of 1x1 convolution (non-sqaure shape) + * @param[in] Im_in pointer to input tensor + * @param[in] dim_im_in_x input tensor dimension x + * @param[in] dim_im_in_y input tensor dimension y + * @param[in] ch_im_in number of input tensor channels + * @param[in] wt pointer to kernel weights + * @param[in] ch_im_out number of filters, i.e., output tensor channels + * @param[in] dim_kernel_x filter kernel size x + * @param[in] dim_kernel_y filter kernel size y + * @param[in] padding_x padding size x + * @param[in] padding_y padding size y + * @param[in] stride_x convolution stride x + * @param[in] stride_y convolution stride y + * @param[in] bias pointer to bias + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in,out] Im_out pointer to output tensor + * @param[in] dim_im_out_x output tensor dimension x + * @param[in] dim_im_out_y output tensor dimension y + * @param[in,out] bufferA pointer to buffer space for input + * @param[in,out] bufferB pointer to buffer space for output + * @return The function returns either + * ARM_CMSIS_NN_ARG_ERROR if argument constraints fail. or, + * ARM_CMSIS_NN_SUCCESS on successful completion. + * + * This function implement convolution with 1x1 kernel size (i.e., dim_kernel_x=1 + * and dim_kernel_y=1). It can be used for + * second half of MobileNets after depthwise separable convolution. + * + * This function is the version with full list of optimization tricks, but with + * some contraints: + * ch_im_in is multiple of 4 + * ch_im_out is multiple of 2 + */ +arm_cmsis_nn_status arm_convolve_1x1_HWC_q7_fast_nonsquare(const q7_t *Im_in, + const uint16_t dim_im_in_x, + const uint16_t dim_im_in_y, + const uint16_t ch_im_in, + const q7_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel_x, + const uint16_t dim_kernel_y, + const uint16_t padding_x, + const uint16_t padding_y, + const uint16_t stride_x, + const uint16_t stride_y, + const q7_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q7_t *Im_out, + const uint16_t dim_im_out_x, + const uint16_t dim_im_out_y, + q15_t *bufferA, + q7_t *bufferB); + +/** + * @brief Fast s8 version for 1x1 convolution (non-square shape) + * + * @param[in, out] ctx Function context that contains the additional buffer if required by the function. + * arm_convolve_1x1_s8_fast_get_buffer_size will return the buffer_size if required. + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] conv_params Convolution parameters (e.g. strides, dilations, pads,...). + * Range of conv_params->input_offset : [-127, 128] + * Range of conv_params->output_offset : [-128, 127] + * @param[in] quant_params Per-channel quantization info. + * It contains the multiplier and shift values to be applied to each output channel + * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] + * @param[in] input_data Input (activation) data pointer. Data type: int8 + * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, 1, 1, C_IN] + * @param[in] filter_data Filter data pointer. Data type: int8 + * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] + * @param[in] bias_data Optional bias data pointer. Data type: int32 + * @param[in] output_dims Output tensor dimensions. Format: [N, H, W, C_OUT] + * @param[out] output_data Output data pointer. Data type: int8 + * + * @return The function returns either + * ARM_CMSIS_NN_ARG_ERROR if argument constraints fail. or, + * ARM_CMSIS_NN_SUCCESS on successful completion. + * + * @details + * - Supported framework : TensorFlow Lite Micro + * - The following constrains on the arguments apply + * -# input_dims->c is a multiple of 4 + * -# conv_params->padding.w = conv_params->padding.h = 0 + * -# conv_params->stride.w = conv_params->stride.h = 1 + * + */ +arm_cmsis_nn_status arm_convolve_1x1_s8_fast(const cmsis_nn_context *ctx, + const cmsis_nn_conv_params *conv_params, const cmsis_nn_per_channel_quant_params *quant_params, const cmsis_nn_dims *input_dims, const q7_t *input_data, @@ -937,480 +757,966 @@ extern "C" const cmsis_nn_dims *output_dims, q7_t *output_data); - /** - * @brief Get size of additional buffer required by arm_depthwise_conv_wrapper_s8() - * - * @param[in] dw_conv_params Depthwise convolution parameters (e.g. strides, dilations, pads,...) - * dw_conv_params->dilation is not used. - * Range of dw_conv_params->input_offset : [-127, 128] - * Range of dw_conv_params->input_offset : [-128, 127] - * @param[in] input_dims Input (activation) tensor dimensions. Format: [H, W, C_IN] - * Batch argument N is not used and assumed to be 1. - * @param[in] filter_dims Filter tensor dimensions. Format: [1, H, W, C_OUT] - * @param[in] output_dims Output tensor dimensions. Format: [1, H, W, C_OUT] - * @return Size of additional memory required for optimizations in bytes. - * - */ - int32_t arm_depthwise_conv_wrapper_s8_get_buffer_size(const cmsis_nn_dw_conv_params *dw_conv_params, - const cmsis_nn_dims *input_dims, - const cmsis_nn_dims *filter_dims, - const cmsis_nn_dims *output_dims); - - /** - * @brief Basic s8 depthwise convolution function that doesn't have any constraints on the input dimensions. - * - * @param[in, out] ctx Function context (e.g. temporary buffer). Check the function - * definition file to see if an additional buffer is required. - * Optional function {API}_get_buffer_size() provides the buffer - * size if an additional buffer is required. - * exists if additional memory is. - * @param[in] dw_conv_params Depthwise convolution parameters (e.g. strides, dilations, pads,...) - * dw_conv_params->dilation is not used. - * Range of dw_conv_params->input_offset : [-127, 128] - * Range of dw_conv_params->input_offset : [-128, 127] - * @param[in] quant_params Per-channel quantization info. - * It contains the multiplier and shift values to be applied to each - * output channel - * @param[in] input_dims Input (activation) tensor dimensions. Format: [1, H, W, C_IN] - * Batch argument N is not used. - * @param[in] input_data Input (activation) data pointer. Data type: int8 - * @param[in] filter_dims Filter tensor dimensions. Format: [1, H, W, C_OUT] - * @param[in] filter_data Filter data pointer. Data type: int8 - * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] - * @param[in] bias_data Bias data pointer. Data type: int32 - * @param[in] output_dims Output tensor dimensions. Format: [1, H, W, C_OUT] - * @param[in, out] output_data Output data pointer. Data type: int8 - * @return The function returns ARM_MATH_SUCCESS - * - * @details - * - Supported framework: TensorFlow Lite - * - q7 is used as data type eventhough it is s8 data. It is done so to be consistent with existing APIs. - */ - arm_status arm_depthwise_conv_s8(const cmsis_nn_context *ctx, - const cmsis_nn_dw_conv_params *dw_conv_params, - const cmsis_nn_per_channel_quant_params *quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input_data, - const cmsis_nn_dims *filter_dims, - const q7_t *filter_data, - const cmsis_nn_dims *bias_dims, - const int32_t *bias_data, - const cmsis_nn_dims *output_dims, - q7_t *output_data); - - /** - * @brief Optimized s8 depthwise convolution function for 3x3 kernel size with some constraints on - * the input arguments(documented below). Refer arm_depthwise_conv_s8() for function - * argument details. - * - * @return The function returns one of the following - * ARM_MATH_SIZE_MISMATCH - Unsupported dimension of tensors - * ARM_MATH_ARGUMENT_ERROR - Unsupported pad size along the x axis - * ARM_MATH_SUCCESS - Successful operation - * - * @details - * - Supported framework : TensorFlow Lite Micro - * - The following constrains on the arguments apply - * -# Number of input channel equals number of output channels - * -# Filter height and width equals 3 - * -# Padding along x is either 0 or 1. - * - */ - arm_status arm_depthwise_conv_3x3_s8(const cmsis_nn_context *ctx, - const cmsis_nn_dw_conv_params *dw_conv_params, - const cmsis_nn_per_channel_quant_params *quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input_data, - const cmsis_nn_dims *filter_dims, - const q7_t *filter_data, - const cmsis_nn_dims *bias_dims, - const int32_t *bias_data, - const cmsis_nn_dims *output_dims, - q7_t *output_data); - - /** - * @brief Optimized s8 depthwise convolution function with constraint that in_channel equals out_channel. - * Refer arm_depthwise_conv_s8() for function argument details. - * - * @return The function returns one of the following - * ARM_MATH_SIZE_MISMATCH - input channel != output channel or - * ch_mult != 1 - * ARM_MATH_SUCCESS - Successful operation - * - * @note If number of channels is not a multiple of 4, upto 3 elements outside the boundary will be read out - * for the following if MVE optimizations(Arm Helium Technology) are used. - * - Output shift - * - Output multiplier - * - Output bias - * - kernel - * @details - * - Supported framework: TensorFlow Lite - * - The following constrains on the arguments apply - * -# Number of input channel equals number of output channels or ch_mult equals 1 - * - q7 is used as data type eventhough it is s8 data. It is done so to be consistent with existing APIs. - * - Reccomended when number of channels is 4 or greater. - * - */ - arm_status arm_depthwise_conv_s8_opt(const cmsis_nn_context *ctx, - const cmsis_nn_dw_conv_params *dw_conv_params, - const cmsis_nn_per_channel_quant_params *quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input_data, - const cmsis_nn_dims *filter_dims, - const q7_t *filter_data, - const cmsis_nn_dims *bias_dims, - const int32_t *bias_data, - const cmsis_nn_dims *output_dims, - q7_t *output_data); - - /** - * @brief Get the required buffer size for optimized s8 depthwise convolution - * function with constraint that in_channel equals out_channel. - * @param[in] input_dims Input (activation) tensor dimensions. Format: [1, H, W, C_IN] - * Batch argument N is not used. - * @param[in] filter_dims Filter tensor dimensions. Format: [1, H, W, C_OUT] - * @return The function returns required buffer size in bytes - * - */ - int32_t arm_depthwise_conv_s8_opt_get_buffer_size(const cmsis_nn_dims *input_dims, - const cmsis_nn_dims *filter_dims); - - /** - * @defgroup FC Fully-connected Layer Functions - * - * Collection of fully-connected and matrix multiplication functions. - * - * Fully-connected layer is basically a matrix-vector multiplication - * with bias. The matrix is the weights and the input/output vectors - * are the activation values. Supported {weight, activation} precisions - * include {8-bit, 8-bit}, {16-bit, 16-bit}, and {8-bit, 16-bit}. - * - * Here we have two types of kernel functions. The basic function - * implements the function using regular GEMV approach. The opt functions - * operates with weights in interleaved formats. - * - */ - - /** - *@brief Q7 basic fully-connected layer function - *@param[in] pV pointer to input vector - *@param[in] pM pointer to matrix weights - *@param[in] dim_vec length of the vector - *@param[in] num_of_rows number of rows in weight matrix - *@param[in] bias_shift amount of left-shift for bias - *@param[in] out_shift amount of right-shift for output - *@param[in] bias pointer to bias - *@param[in,out] pOut pointer to output vector - *@param[in,out] vec_buffer pointer to buffer space for input - *@return The function returns ARM_MATH_SUCCESS - * - */ - - arm_status arm_fully_connected_q7(const q7_t *pV, - const q7_t *pM, - const uint16_t dim_vec, - const uint16_t num_of_rows, - const uint16_t bias_shift, - const uint16_t out_shift, - const q7_t *bias, - q7_t *pOut, - q15_t *vec_buffer); - - /** - * @brief Basic s8 Fully Connected function. - * - * @param[in, out] ctx Function context (e.g. temporary buffer). Check the function - * definition file to see if an additional buffer is required. - * Optional function {API}_get_buffer_size() provides the buffer - * size if an additional buffer is required. - * @param[in] fc_params Fully Connected layer parameters (e.g. strides, dilations, pads,...) - * Range of fc_params->input_offset : [-127, 128] - * Range of fc_params->filter_offset : [-127, 128] - * Range of fc_params->output_offset : [-128, 127] - * @param[in] quant_params Per-tensor quantization info. - * It contains the multiplier and shift values to be applied to the output tensor. - * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] - * Input dimension is taken as Nx(H * W * C_IN) - * @param[in] input_data Input (activation) data pointer. Data type: int8 - * @param[in] filter_dims Two dimensional filter dimensions. Format: [N, C] - * N : accumulation depth and equals (H * W * C_IN) from input_dims - * C : output depth and equals C_OUT in output_dims - * H & W : Not used - * @param[in] filter_data Filter data pointer. Data type: int8 - * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] - * N, H, W : Not used - * @param[in] bias_data Bias data pointer. Data type: int32 - * @param[in] output_dims Output tensor dimensions. Format: [N, C_OUT] - * N : Batches - * C_OUT : Output depth - * H & W : Not used. - * @param[in, out] output_data Output data pointer. Data type: int8 - * @return The function returns ARM_MATH_SUCCESS - * - * @details - * - Supported framework: TensorFlow Lite - * - q7 is used as data type eventhough it is s8 data. It is done so to be consistent with existing APIs. - */ - arm_status arm_fully_connected_s8(const cmsis_nn_context *ctx, - const cmsis_nn_fc_params *fc_params, - const cmsis_nn_per_tensor_quant_params *quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input_data, - const cmsis_nn_dims *filter_dims, - const q7_t *filter_data, - const cmsis_nn_dims *bias_dims, - const int32_t *bias_data, - const cmsis_nn_dims *output_dims, - q7_t *output_data); - - /** - * @brief Get the required buffer size for S8 basic fully-connected and - * matrix multiplication layer function for TF Lite - * @param[in] filter_dims dimension of filter - * @return The function returns required buffer size in bytes - * - */ - int32_t arm_fully_connected_s8_get_buffer_size(const cmsis_nn_dims *filter_dims); - - /** - * @brief Q7 opt fully-connected layer function - * @param[in] pV pointer to input vector - * @param[in] pM pointer to matrix weights - * @param[in] dim_vec length of the vector - * @param[in] num_of_rows number of rows in weight matrix - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in] bias pointer to bias - * @param[in,out] pOut pointer to output vector - * @param[in,out] vec_buffer pointer to buffer space for input - * @return The function returns ARM_MATH_SUCCESS - * - */ - - arm_status arm_fully_connected_q7_opt(const q7_t *pV, - const q7_t *pM, - const uint16_t dim_vec, - const uint16_t num_of_rows, - const uint16_t bias_shift, - const uint16_t out_shift, - const q7_t *bias, - q7_t *pOut, - q15_t *vec_buffer); - - /** - * @brief Q15 basic fully-connected layer function - * @param[in] pV pointer to input vector - * @param[in] pM pointer to matrix weights - * @param[in] dim_vec length of the vector - * @param[in] num_of_rows number of rows in weight matrix - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in] bias pointer to bias - * @param[in,out] pOut pointer to output vector - * @param[in,out] vec_buffer pointer to buffer space for input - * @return The function returns ARM_MATH_SUCCESS - * - */ - - arm_status arm_fully_connected_q15(const q15_t *pV, - const q15_t *pM, - const uint16_t dim_vec, - const uint16_t num_of_rows, - const uint16_t bias_shift, - const uint16_t out_shift, - const q15_t *bias, - q15_t *pOut, - q15_t *vec_buffer); - - /** - * @brief Q15 opt fully-connected layer function - * @param[in] pV pointer to input vector - * @param[in] pM pointer to matrix weights - * @param[in] dim_vec length of the vector - * @param[in] num_of_rows number of rows in weight matrix - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in] bias pointer to bias - * @param[in,out] pOut pointer to output vector - * @param[in,out] vec_buffer pointer to buffer space for input - * @return The function returns ARM_MATH_SUCCESS - * - */ - - arm_status arm_fully_connected_q15_opt(const q15_t *pV, - const q15_t *pM, +/** + * @brief Get the required buffer size for arm_convolve_1x1_s8_fast + * + * @param[in] input_dims Input (activation) dimensions + * @return The function returns the required buffer size in bytes + * + */ +int32_t arm_convolve_1x1_s8_fast_get_buffer_size(const cmsis_nn_dims *input_dims); + +/** + * @brief 1xn convolution + * + * @param[in, out] ctx Function context that contains the additional buffer if required by the function. + * arm_convolve_1_x_n_s8_get_buffer_size will return the buffer_size if required + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] conv_params Convolution parameters (e.g. strides, dilations, pads,...). + * Range of conv_params->input_offset : [-127, 128] + * Range of conv_params->output_offset : [-128, 127] + * @param[in] quant_params Per-channel quantization info. + * It contains the multiplier and shift values to be applied to each output channel + * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] + * @param[in] input_data Input (activation) data pointer. Data type: int8 + * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, 1, WK, C_IN] where WK is the horizontal + * spatial filter dimension + * @param[in] filter_data Filter data pointer. Data type: int8 + * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] + * @param[in] bias_data Optional bias data pointer. Data type: int32 + * @param[in] output_dims Output tensor dimensions. Format: [N, H, W, C_OUT] + * @param[out] output_data Output data pointer. Data type: int8 + * + * @return The function returns either + * ARM_CMSIS_NN_ARG_ERROR if argument constraints fail. or, + * ARM_CMSIS_NN_SUCCESS on successful completion. + * + * @details + * - Supported framework : TensorFlow Lite Micro + * - The following constrains on the arguments apply + * -# input_dims->n equals 1 + * -# ouput_dims->w is a multiple of 4 + * -# Explicit constraints(since it is for 1xN convolution) + * -## input_dims->h equals 1 + * -## output_dims->h equals 1 + * -## filter_dims->h equals 1 + *@todo Remove constraint on output_dims->w to make the function generic. + * + */ +arm_cmsis_nn_status arm_convolve_1_x_n_s8(const cmsis_nn_context *ctx, + const cmsis_nn_conv_params *conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int32_t *bias_data, + const cmsis_nn_dims *output_dims, + q7_t *output_data); + +/** + * @brief Get the required additional buffer size for 1xn convolution + * + * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] + * @param[in] filter_dims Filter tensor dimensions. Format: [C_OUT, 1, WK, C_IN] where WK is the + * horizontal spatial filter dimension + * @return The function returns required buffer size(bytes) + * + */ +int32_t arm_convolve_1_x_n_s8_get_buffer_size(const cmsis_nn_dims *input_dims, const cmsis_nn_dims *filter_dims); + +/** + * @brief Q7 version of convolution for RGB image + * @param[in] Im_in pointer to input tensor + * @param[in] dim_im_in input tensor dimension + * @param[in] ch_im_in number of input tensor channels + * @param[in] wt pointer to kernel weights + * @param[in] ch_im_out number of filters, i.e., output tensor channels + * @param[in] dim_kernel filter kernel size + * @param[in] padding padding sizes + * @param[in] stride convolution stride + * @param[in] bias pointer to bias + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in,out] Im_out pointer to output tensor + * @param[in] dim_im_out output tensor dimension + * @param[in,out] bufferA pointer to buffer space for input + * @param[in,out] bufferB pointer to buffer space for output + * @return The function returns either + * ARM_CMSIS_NN_ARG_ERROR or ARM_CMSIS_NN_SUCCESS based on the outcome of input arguments + * constraints checking. + * + * This kernel is written exclusively for convolution with ch_im_in + * equals 3. This applies on the first layer of CNNs which has input + * image with RGB format. + */ + +arm_cmsis_nn_status arm_convolve_HWC_q7_RGB(const q7_t *Im_in, + const uint16_t dim_im_in, + const uint16_t ch_im_in, + const q7_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel, + const uint16_t padding, + const uint16_t stride, + const q7_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q7_t *Im_out, + const uint16_t dim_im_out, + q15_t *bufferA, + q7_t *bufferB); + +/** + * @brief Fast Q15 convolution function + * @param[in] Im_in pointer to input tensor + * @param[in] dim_im_in input tensor dimension + * @param[in] ch_im_in number of input tensor channels + * @param[in] wt pointer to kernel weights + * @param[in] ch_im_out number of filters, i.e., output tensor channels + * @param[in] dim_kernel filter kernel size + * @param[in] padding padding sizes + * @param[in] stride convolution stride + * @param[in] bias pointer to bias + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in,out] Im_out pointer to output tensor + * @param[in] dim_im_out output tensor dimension + * @param[in,out] bufferA pointer to buffer space for input + * @param[in,out] bufferB pointer to buffer space for output + * @return The function returns either + * ARM_CMSIS_NN_ARG_ERROR or ARM_CMSIS_NN_SUCCESS based on the outcome of input arguments + * constraints checking. + * + * This function is the version with full list of optimization tricks, but with + * some contraints: + * ch_im_in is multiple of 2 + * ch_im_out is multiple of 2 + * dim_im_out is a multiple of 2 + */ + +arm_cmsis_nn_status arm_convolve_HWC_q15_fast(const q15_t *Im_in, + const uint16_t dim_im_in, + const uint16_t ch_im_in, + const q15_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel, + const uint16_t padding, + const uint16_t stride, + const q15_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q15_t *Im_out, + const uint16_t dim_im_out, + q15_t *bufferA, + q7_t *bufferB); + +/** + * @brief Fast Q15 convolution function (non-sqaure shape) + * @param[in] Im_in pointer to input tensor + * @param[in] dim_im_in_x input tensor dimension x + * @param[in] dim_im_in_y input tensor dimension y + * @param[in] ch_im_in number of input tensor channels + * @param[in] wt pointer to kernel weights + * @param[in] ch_im_out number of filters, i.e., output tensor channels + * @param[in] dim_kernel_x filter kernel size x + * @param[in] dim_kernel_y filter kernel size y + * @param[in] padding_x padding size x + * @param[in] padding_y padding size y + * @param[in] stride_x convolution stride x + * @param[in] stride_y convolution stride y + * @param[in] bias pointer to bias + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in,out] Im_out pointer to output tensor + * @param[in] dim_im_out_x output tensor dimension x + * @param[in] dim_im_out_y output tensor dimension y + * @param[in,out] bufferA pointer to buffer space for input + * @param[in,out] bufferB pointer to buffer space for output + * @return The function returns either + * ARM_CMSIS_NN_ARG_ERROR or ARM_CMSIS_NN_SUCCESS based on the outcome of input arguments + * constraints checking. + * + * @details + * + * Buffer size: + * + * bufferA size: 2*ch_im_in*dim_kernel*dim_kernel + * + * bufferB size: 0 + * + * Input dimension constraints: + * + * ch_im_in is multiple of 2 + * + * ch_im_out is multipe of 2 + * + */ + +arm_cmsis_nn_status arm_convolve_HWC_q15_fast_nonsquare(const q15_t *Im_in, + const uint16_t dim_im_in_x, + const uint16_t dim_im_in_y, + const uint16_t ch_im_in, + const q15_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel_x, + const uint16_t dim_kernel_y, + const uint16_t padding_x, + const uint16_t padding_y, + const uint16_t stride_x, + const uint16_t stride_y, + const q15_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q15_t *Im_out, + const uint16_t dim_im_out_x, + const uint16_t dim_im_out_y, + q15_t *bufferA, + q7_t *bufferB); + +/** + * @brief Q7 depthwise separable convolution function + * @param[in] Im_in pointer to input tensor + * @param[in] dim_im_in input tensor dimension + * @param[in] ch_im_in number of input tensor channels + * @param[in] wt pointer to kernel weights + * @param[in] ch_im_out number of filters, i.e., output tensor channels + * @param[in] dim_kernel filter kernel size + * @param[in] padding padding sizes + * @param[in] stride convolution stride + * @param[in] bias pointer to bias + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in,out] Im_out pointer to output tensor + * @param[in] dim_im_out output tensor dimension + * @param[in,out] bufferA pointer to buffer space for input + * @param[in,out] bufferB pointer to buffer space for output + * @return The function returns either + * ARM_CMSIS_NN_ARG_ERROR or ARM_CMSIS_NN_SUCCESS based on the outcome of input arguments + * constraints checking. + * + * This function is the version with full list of optimization tricks, but with + * some contraints: + * ch_im_in is multiple of 2 + * ch_im_out is multiple of 2 + */ + +arm_cmsis_nn_status arm_depthwise_separable_conv_HWC_q7(const q7_t *Im_in, + const uint16_t dim_im_in, + const uint16_t ch_im_in, + const q7_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel, + const uint16_t padding, + const uint16_t stride, + const q7_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q7_t *Im_out, + const uint16_t dim_im_out, + q15_t *bufferA, + q7_t *bufferB); + +/** + * @brief Q7 depthwise separable convolution function (non-square shape) + * @param[in] Im_in pointer to input tensor + * @param[in] dim_im_in_x input tensor dimension x + * @param[in] dim_im_in_y input tensor dimension y + * @param[in] ch_im_in number of input tensor channels + * @param[in] wt pointer to kernel weights + * @param[in] ch_im_out number of filters, i.e., output tensor channels + * @param[in] dim_kernel_x filter kernel size x + * @param[in] dim_kernel_y filter kernel size y + * @param[in] padding_x padding sizes x + * @param[in] padding_y padding sizes y + * @param[in] stride_x convolution stride x + * @param[in] stride_y convolution stride y + * @param[in] bias pointer to bias + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in,out] Im_out pointer to output tensor + * @param[in] dim_im_out_x output tensor dimension x + * @param[in] dim_im_out_y output tensor dimension y + * @param[in,out] bufferA pointer to buffer space for input + * @param[in,out] bufferB pointer to buffer space for output + * @return The function returns either + * ARM_CMSIS_NN_ARG_ERROR or ARM_CMSIS_NN_SUCCESS based on the outcome of input arguments + * constraints checking. + * + * This function is the version with full list of optimization tricks, but with + * some contraints: + * ch_im_in is multiple of 2 + * ch_im_out is multiple of 2 + */ +arm_cmsis_nn_status arm_depthwise_separable_conv_HWC_q7_nonsquare(const q7_t *Im_in, + const uint16_t dim_im_in_x, + const uint16_t dim_im_in_y, + const uint16_t ch_im_in, + const q7_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel_x, + const uint16_t dim_kernel_y, + const uint16_t padding_x, + const uint16_t padding_y, + const uint16_t stride_x, + const uint16_t stride_y, + const q7_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q7_t *Im_out, + const uint16_t dim_im_out_x, + const uint16_t dim_im_out_y, + q15_t *bufferA, + q7_t *bufferB); + +/** + * @brief Wrapper function to pick the right optimized s8 depthwise convolution function + * + * @param[in, out] ctx Function context (e.g. temporary buffer). Check the function + * definition file to see if an additional buffer is required. + * Optional function {API}_get_buffer_size() provides the buffer + * size if required. + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] dw_conv_params Depthwise convolution parameters (e.g. strides, dilations, pads,...) + * dw_conv_params->dilation is not used. + * Range of dw_conv_params->input_offset : [-127, 128] + * Range of dw_conv_params->output_offset : [-128, 127] + * @param[in] quant_params Per-channel quantization info. + * It contains the multiplier and shift values to be applied to each + * output channel + * @param[in] input_dims Input (activation) tensor dimensions. Format: [H, W, C_IN] + * Batch argument N is not used and assumed to be 1. + * @param[in] input_data Input (activation) data pointer. Data type: int8 + * @param[in] filter_dims Filter tensor dimensions. Format: [1, H, W, C_OUT] + * @param[in] filter_data Filter data pointer. Data type: int8 + * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] + * @param[in] bias_data Bias data pointer. Data type: int32 + * @param[in] output_dims Output tensor dimensions. Format: [1, H, W, C_OUT] + * @param[in, out] output_data Output data pointer. Data type: int8 + * @return The function returns + * ARM_CMSIS_NN_SUCCESS - Successful completion. + * + * @details + * - Supported framework: TensorFlow Lite + * - Picks one of the the following functions + * -# arm_depthwise_conv_s8() + * -# arm_depthwise_conv_3x3_s8() - Cortex-M CPUs with DSP extension only + * -# arm_depthwise_conv_s8_opt() + * - q7 is used as data type eventhough it is s8 data. It is done so to be consistent with existing APIs. + * - Check details of arm_depthwise_conv_s8_opt() for potential data that can be accessed outside of the + * boundary. + */ +arm_cmsis_nn_status arm_depthwise_conv_wrapper_s8(const cmsis_nn_context *ctx, + const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int32_t *bias_data, + const cmsis_nn_dims *output_dims, + q7_t *output_data); + +/** + * @brief Get size of additional buffer required by arm_depthwise_conv_wrapper_s8() + * + * @param[in] dw_conv_params Depthwise convolution parameters (e.g. strides, dilations, pads,...) + * Range of dw_conv_params->input_offset : [-127, 128] + * Range of dw_conv_params->input_offset : [-128, 127] + * @param[in] input_dims Input (activation) tensor dimensions. Format: [H, W, C_IN] + * Batch argument N is not used and assumed to be 1. + * @param[in] filter_dims Filter tensor dimensions. Format: [1, H, W, C_OUT] + * @param[in] output_dims Output tensor dimensions. Format: [1, H, W, C_OUT] + * @return Size of additional memory required for optimizations in bytes. + * + */ +int32_t arm_depthwise_conv_wrapper_s8_get_buffer_size(const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_dims *input_dims, + const cmsis_nn_dims *filter_dims, + const cmsis_nn_dims *output_dims); + +/** + * @brief Basic s8 depthwise convolution function that doesn't have any constraints on the input dimensions. + * + * @param[in, out] ctx Function context (e.g. temporary buffer). Check the function + * definition file to see if an additional buffer is required. + * Optional function {API}_get_buffer_size() provides the buffer + * size if an additional buffer is required exists if additional memory is. + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] dw_conv_params Depthwise convolution parameters (e.g. strides, dilations, pads,...) + * dw_conv_params->dilation is not used. + * Range of dw_conv_params->input_offset : [-127, 128] + * Range of dw_conv_params->input_offset : [-128, 127] + * @param[in] quant_params Per-channel quantization info. + * It contains the multiplier and shift values to be applied to each + * output channel + * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] + * Batch argument N is not used. + * @param[in] input_data Input (activation) data pointer. Data type: int8 + * @param[in] filter_dims Filter tensor dimensions. Format: [1, H, W, C_OUT] + * @param[in] filter_data Filter data pointer. Data type: int8 + * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] + * @param[in] bias_data Bias data pointer. Data type: int32 + * @param[in] output_dims Output tensor dimensions. Format: [N, H, W, C_OUT] + * @param[in, out] output_data Output data pointer. Data type: int8 + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + * @details + * - Supported framework: TensorFlow Lite + * - q7 is used as data type eventhough it is s8 data. It is done so to be consistent with existing APIs. + */ +arm_cmsis_nn_status arm_depthwise_conv_s8(const cmsis_nn_context *ctx, + const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int32_t *bias_data, + const cmsis_nn_dims *output_dims, + q7_t *output_data); + +/** + * @brief Basic s16 depthwise convolution function that doesn't have any constraints on the input dimensions. + * + * @param[in, out] ctx Function context (e.g. temporary buffer). Check the function + * definition file to see if an additional buffer is required. + * Optional function {API}_get_buffer_size() provides the buffer + * size if an additional buffer is required. + * exists if additional memory is. + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] dw_conv_params Depthwise convolution parameters (e.g. strides, dilations, pads,...) + * conv_params->input_offset : Not used + * conv_params->output_offset : Not used + * @param[in] quant_params Per-channel quantization info. + * It contains the multiplier and shift values to be applied to each + * output channel + * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] + * Batch argument N is not used. + * @param[in] input_data Input (activation) data pointer. Data type: int8 + * @param[in] filter_dims Filter tensor dimensions. Format: [1, H, W, C_OUT] + * @param[in] filter_data Filter data pointer. Data type: int8 + * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] + * @param[in] bias_data Bias data pointer. Data type: int64 + * @param[in] output_dims Output tensor dimensions. Format: [N, H, W, C_OUT] + * @param[in, out] output_data Output data pointer. Data type: int16 + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + * @details + * - Supported framework: TensorFlow Lite + * - q15 is used as data type eventhough it is s16 data. It is done so to be consistent with existing APIs. + */ +arm_cmsis_nn_status arm_depthwise_conv_s16(const cmsis_nn_context *ctx, + const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q15_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int64_t *bias_data, + const cmsis_nn_dims *output_dims, + q15_t *output_data); + +/** + * @brief Wrapper function to pick the right optimized s16 depthwise convolution function + * + * @param[in, out] ctx Function context (e.g. temporary buffer). Check the function + * definition file to see if an additional buffer is required. + * Optional function {API}_get_buffer_size() provides the buffer + * size if required. + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] dw_conv_params Depthwise convolution parameters (e.g. strides, dilations, pads,...) + * dw_conv_params->dilation is not used. + * Range of dw_conv_params->input_offset : Not used + * Range of dw_conv_params->output_offset : Not used + * @param[in] quant_params Per-channel quantization info. + * It contains the multiplier and shift values to be applied to each + * output channel + * @param[in] input_dims Input (activation) tensor dimensions. Format: [H, W, C_IN] + * Batch argument N is not used and assumed to be 1. + * @param[in] input_data Input (activation) data pointer. Data type: int16 + * @param[in] filter_dims Filter tensor dimensions. Format: [1, H, W, C_OUT] + * @param[in] filter_data Filter data pointer. Data type: int8 + * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] + * @param[in] bias_data Bias data pointer. Data type: int64 + * @param[in] output_dims Output tensor dimensions. Format: [1, H, W, C_OUT] + * @param[in, out] output_data Output data pointer. Data type: int16 + * @return The function returns + * ARM_CMSIS_NN_SUCCESS - Successful completion. + * + * @details + * - Supported framework: TensorFlow Lite + * - Picks one of the the following functions + * -# arm_depthwise_conv_s16() + * -# arm_depthwise_conv_fast_s16() - Cortex-M CPUs with DSP extension only + * - q7 is used as data type eventhough it is s8 data. It is done so to be consistent with existing APIs. + */ +arm_cmsis_nn_status arm_depthwise_conv_wrapper_s16(const cmsis_nn_context *ctx, + const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q15_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int64_t *bias_data, + const cmsis_nn_dims *output_dims, + q15_t *output_data); + +/** + * @brief Get size of additional buffer required by arm_depthwise_conv_wrapper_s16() + * + * @param[in] dw_conv_params Depthwise convolution parameters (e.g. strides, dilations, pads,...) + * Range of dw_conv_params->input_offset : Not used + * Range of dw_conv_params->input_offset : Not used + * @param[in] input_dims Input (activation) tensor dimensions. Format: [H, W, C_IN] + * Batch argument N is not used and assumed to be 1. + * @param[in] filter_dims Filter tensor dimensions. Format: [1, H, W, C_OUT] + * @param[in] output_dims Output tensor dimensions. Format: [1, H, W, C_OUT] + * @return Size of additional memory required for optimizations in bytes. + * + */ +int32_t arm_depthwise_conv_wrapper_s16_get_buffer_size(const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_dims *input_dims, + const cmsis_nn_dims *filter_dims, + const cmsis_nn_dims *output_dims); + +/** + * @brief Optimized s16 depthwise convolution function with constraint that in_channel equals out_channel. + * Refer arm_depthwise_conv_s16() for function argument details. + * + * @return The function returns one of the following + * ARM_CMSIS_NN_ARG_ERROR - ctx-buff == NULL and + * arm_depthwise_conv_fast_s16_get_buffer_size() > 0 or + * input channel != output channel or + * ch_mult != 1 + * + * ARM_CMSIS_NN_SUCCESS - Successful operation + * + * @details + * - Supported framework: TensorFlow Lite + * - The following constrains on the arguments apply + * -# Number of input channel equals number of output channels or ch_mult equals 1 + * - q7 is used as data type eventhough it is s8 data. It is done so to be consistent with existing APIs. + * - Reccomended when number of channels is 4 or greater. + * + */ +arm_cmsis_nn_status arm_depthwise_conv_fast_s16(const cmsis_nn_context *ctx, + const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q15_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int64_t *bias_data, + const cmsis_nn_dims *output_dims, + q15_t *output_data); + +/** + * @brief Get the required buffer size for optimized s16 depthwise convolution + * function with constraint that in_channel equals out_channel. + * @param[in] input_dims Input (activation) tensor dimensions. Format: [1, H, W, C_IN] + * Batch argument N is not used. + * @param[in] filter_dims Filter tensor dimensions. Format: [1, H, W, C_OUT] + * @return The function returns required buffer size in bytes + * + */ +int32_t arm_depthwise_conv_fast_s16_get_buffer_size(const cmsis_nn_dims *input_dims, const cmsis_nn_dims *filter_dims); + +/** + * @brief Optimized s8 depthwise convolution function for 3x3 kernel size with some constraints on + * the input arguments(documented below). Refer arm_depthwise_conv_s8() for function + * argument details. + * + * @return The function returns one of the following + * ARM_CMSIS_NN_ARG_ERROR - Unsupported dimension of tensors + * - Unsupported pad size along the x axis + * ARM_CMSIS_NN_SUCCESS - Successful operation + * + * @details + * - Supported framework : TensorFlow Lite Micro + * - The following constrains on the arguments apply + * -# Number of input channel equals number of output channels + * -# Filter height and width equals 3 + * -# Padding along x is either 0 or 1. + * + */ +arm_cmsis_nn_status arm_depthwise_conv_3x3_s8(const cmsis_nn_context *ctx, + const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int32_t *bias_data, + const cmsis_nn_dims *output_dims, + q7_t *output_data); + +/** + * @brief Optimized s8 depthwise convolution function with constraint that in_channel equals out_channel. + * Refer arm_depthwise_conv_s8() for function argument details. + * + * @return The function returns one of the following + * ARM_CMSIS_NN_ARG_ERROR - input channel != output channel or + * ch_mult != 1 + * ARM_CMSIS_NN_SUCCESS - Successful operation + * + * @note If number of channels is not a multiple of 4, upto 3 elements outside the boundary will be read out + * for the following if MVE optimizations(Arm Helium Technology) are used. + * - Output shift + * - Output multiplier + * - Output bias + * - kernel + * @details + * - Supported framework: TensorFlow Lite + * - The following constrains on the arguments apply + * -# Number of input channel equals number of output channels or ch_mult equals 1 + * - q7 is used as data type eventhough it is s8 data. It is done so to be consistent with existing APIs. + * - Reccomended when number of channels is 4 or greater. + * + */ +arm_cmsis_nn_status arm_depthwise_conv_s8_opt(const cmsis_nn_context *ctx, + const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int32_t *bias_data, + const cmsis_nn_dims *output_dims, + q7_t *output_data); + +/** + * @brief Get the required buffer size for optimized s8 depthwise convolution + * function with constraint that in_channel equals out_channel. + * @param[in] input_dims Input (activation) tensor dimensions. Format: [1, H, W, C_IN] + * Batch argument N is not used. + * @param[in] filter_dims Filter tensor dimensions. Format: [1, H, W, C_OUT] + * @return The function returns required buffer size in bytes + * + */ +int32_t arm_depthwise_conv_s8_opt_get_buffer_size(const cmsis_nn_dims *input_dims, const cmsis_nn_dims *filter_dims); + +/** + * @defgroup FC Fully-connected Layer Functions + * + * Collection of fully-connected and matrix multiplication functions. + * + * Fully-connected layer is basically a matrix-vector multiplication + * with bias. The matrix is the weights and the input/output vectors + * are the activation values. Supported {weight, activation} precisions + * include {8-bit, 8-bit}, {16-bit, 16-bit}, and {8-bit, 16-bit}. + * + * Here we have two types of kernel functions. The basic function + * implements the function using regular GEMV approach. The opt functions + * operates with weights in interleaved formats. + * + */ + +/** + *@brief Q7 basic fully-connected layer function + *@param[in] pV pointer to input vector + *@param[in] pM pointer to matrix weights + *@param[in] dim_vec length of the vector + *@param[in] num_of_rows number of rows in weight matrix + *@param[in] bias_shift amount of left-shift for bias + *@param[in] out_shift amount of right-shift for output + *@param[in] bias pointer to bias + *@param[in,out] pOut pointer to output vector + *@param[in,out] vec_buffer pointer to buffer space for input + *@return The function returns ARM_CMSIS_NN_SUCCESS + * + */ + +arm_cmsis_nn_status arm_fully_connected_q7(const q7_t *pV, + const q7_t *pM, const uint16_t dim_vec, const uint16_t num_of_rows, const uint16_t bias_shift, const uint16_t out_shift, - const q15_t *bias, - q15_t *pOut, + const q7_t *bias, + q7_t *pOut, q15_t *vec_buffer); - /** - * @brief Mixed Q15-Q7 fully-connected layer function - * @param[in] pV pointer to input vector - * @param[in] pM pointer to matrix weights - * @param[in] dim_vec length of the vector - * @param[in] num_of_rows number of rows in weight matrix - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in] bias pointer to bias - * @param[in,out] pOut pointer to output vector - * @param[in,out] vec_buffer pointer to buffer space for input - * @return The function returns ARM_MATH_SUCCESS - * - */ - - arm_status arm_fully_connected_mat_q7_vec_q15(const q15_t *pV, - const q7_t *pM, - const uint16_t dim_vec, - const uint16_t num_of_rows, - const uint16_t bias_shift, - const uint16_t out_shift, - const q7_t *bias, - q15_t *pOut, - q15_t *vec_buffer); - - /** - * @brief Mixed Q15-Q7 opt fully-connected layer function - * @param[in] pV pointer to input vector - * @param[in] pM pointer to matrix weights - * @param[in] dim_vec length of the vector - * @param[in] num_of_rows number of rows in weight matrix - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in] bias pointer to bias - * @param[in,out] pOut pointer to output vector - * @param[in,out] vec_buffer pointer to buffer space for input - * @return The function returns ARM_MATH_SUCCESS - * - */ - - arm_status arm_fully_connected_mat_q7_vec_q15_opt(const q15_t *pV, - const q7_t *pM, - const uint16_t dim_vec, - const uint16_t num_of_rows, - const uint16_t bias_shift, - const uint16_t out_shift, - const q7_t *bias, - q15_t *pOut, - q15_t *vec_buffer); - - /** - * @brief Matrix-Multiplication Kernels for Convolution - * - * These functions are used within convolution layer functions for - * matrix multiplication. - * - * The implementation is similar to CMSIS-DSP arm_mat_mult functions - * with one Q7 and one Q15 operands. The Q15 operand is the im2col - * output which is always with 2 columns. - * - */ - - /** - * @brief Matrix-multiplication function for convolution - * @param[in] pA pointer to operand A - * @param[in] pInBuffer pointer to operand B, always conssists of 2 vectors - * @param[in] ch_im_out numRow of A - * @param[in] numCol_A numCol of A - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in] bias the bias - * @param[in,out] pOut pointer to output - * @return The function returns the incremented output pointer - */ - - q7_t *arm_nn_mat_mult_kernel_q7_q15(const q7_t *pA, - const q15_t *pInBuffer, - const uint16_t ch_im_out, - const uint16_t numCol_A, - const uint16_t bias_shift, - const uint16_t out_shift, - const q7_t *bias, - q7_t *pOut); - /** - * @brief Matrix-multiplication function for convolution with per-channel requantization. - * @param[in] input_a pointer to operand A - * @param[in] input_b pointer to operand B, always consists of 2 vectors. - * @param[in] output_ch number of rows of A - * @param[in] out_shift pointer to per output channel requantization shift parameter. - * @param[in] out_mult pointer to per output channel requantization multiplier parameter. - * @param[in] out_offset output tensor offset. - * @param[in] activation_min minimum value to clamp the output to. Range : int8 - * @param[in] activation_max maximum value to clamp the output to. Range : int8 - * @param[in] num_col_a number of columns of A - * @param[in] output_bias per output channel bias. Range : int32 - * @param[in,out] out_0 pointer to output - * @return The function returns one of the two - * 1. The incremented output pointer for a successful operation or - * 2. NULL if implementation is not available. - * - * @details This function does the matrix multiplication of weight matrix for all output channels - * with 2 columns from im2col and produces two elements/output_channel. The outputs are - * clamped in the range provided by activation min and max. - * Supported framework: TensorFlow Lite micro. - */ - q7_t *arm_nn_mat_mult_kernel_s8_s16(const q7_t *input_a, - const q15_t *input_b, - const uint16_t output_ch, - const int32_t *out_shift, - const int32_t *out_mult, - const int32_t out_offset, - const int16_t activation_min, - const int16_t activation_max, - const uint16_t num_col_a, - const int32_t *const output_bias, - q7_t *out_0); - - /** - * @brief Matrix-multiplication of re-ordered input B with A. - * - * @details For arguments, refer arm_nn_mat_mult_kernel_s8_s16. The re-ordering is a consequence - * of sign extension done by the SXTB16 command on input_b. The outputs are clamped in the range - * provided by activation min and max. - * * @details - * - Supported framework : TensorFlow Lite Micro - * - The following constrains on the arguments apply - * -# num_col_a is a multiple of 4 - * -# output_ch is a multiple of 2 - * - */ - q7_t *arm_nn_mat_mult_kernel_s8_s16_reordered(const q7_t *input_a, - const q15_t *input_b, - const uint16_t output_ch, - const int32_t *out_shift, - const int32_t *out_mult, - const int32_t out_offset, - const int16_t activation_min, - const int16_t activation_max, - const uint16_t num_col_a, - const int32_t *const output_bias, - q7_t *out_0); - - /** - *@brief Matrix-multiplication function for convolution with reordered columns - *@param[in] pA pointer to operand A - *@param[in] pInBuffer pointer to operand B, always conssists of 2 vectors - *@param[in] ch_im_out numRow of A - *@param[in] numCol_A numCol of A - *@param[in] bias_shift amount of left-shift for bias - *@param[in] out_shift amount of right-shift for output - *@param[in] bias the bias - *@param[in,out] pOut pointer to output - *@return The function returns the incremented output pointer - * - *@details This function assumes that data in pInBuffer are reordered - */ - q7_t *arm_nn_mat_mult_kernel_q7_q15_reordered(const q7_t *pA, - const q15_t *pInBuffer, - const uint16_t ch_im_out, - const uint16_t numCol_A, - const uint16_t bias_shift, - const uint16_t out_shift, - const q7_t *bias, - q7_t *pOut); +/** + * @brief Basic s8 Fully Connected function. + * + * @param[in, out] ctx Function context (e.g. temporary buffer). Check the function + * definition file to see if an additional buffer is required. + * Optional function {API}_get_buffer_size() provides the buffer + * size if an additional buffer is required. + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] fc_params Fully Connected layer parameters. + * Range of fc_params->input_offset : [-127, 128] + * fc_params->filter_offset : 0 + * Range of fc_params->output_offset : [-128, 127] + * @param[in] quant_params Per-tensor quantization info. + * It contains the multiplier and shift values to be applied to the output tensor. + * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] + * Input dimension is taken as Nx(H * W * C_IN) + * @param[in] input_data Input (activation) data pointer. Data type: int8 + * @param[in] filter_dims Two dimensional filter dimensions. Format: [N, C] + * N : accumulation depth and equals (H * W * C_IN) from input_dims + * C : output depth and equals C_OUT in output_dims + * H & W : Not used + * @param[in] filter_data Filter data pointer. Data type: int8 + * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] + * N, H, W : Not used + * @param[in] bias_data Bias data pointer. Data type: int32 + * @param[in] output_dims Output tensor dimensions. Format: [N, C_OUT] + * N : Batches + * C_OUT : Output depth + * H & W : Not used. + * @param[in, out] output_data Output data pointer. Data type: int8 + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + * @details + * - Supported framework: TensorFlow Lite + * - q7 is used as data type eventhough it is s8 data. It is done so to be consistent with existing APIs. + */ +arm_cmsis_nn_status arm_fully_connected_s8(const cmsis_nn_context *ctx, + const cmsis_nn_fc_params *fc_params, + const cmsis_nn_per_tensor_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int32_t *bias_data, + const cmsis_nn_dims *output_dims, + q7_t *output_data); + +/** + * @brief Get the required buffer size for S8 basic fully-connected and + * matrix multiplication layer function for TF Lite + * @param[in] filter_dims dimension of filter + * @return The function returns required buffer size in bytes + * + */ +int32_t arm_fully_connected_s8_get_buffer_size(const cmsis_nn_dims *filter_dims); + +/** + * @brief Basic s16 Fully Connected function. + * + * @param[in, out] ctx Function context (e.g. temporary buffer). Check the function + * definition file to see if an additional buffer is required. + * Optional function {API}_get_buffer_size() provides the buffer + * size if an additional buffer is required. + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] fc_params Fully Connected layer parameters. + * fc_params->input_offset : 0 + * fc_params->filter_offset : 0 + * fc_params->output_offset : 0 + * @param[in] quant_params Per-tensor quantization info. + * It contains the multiplier and shift values to be applied to the output tensor. + * @param[in] input_dims Input (activation) tensor dimensions. Format: [N, H, W, C_IN] + * Input dimension is taken as Nx(H * W * C_IN) + * @param[in] input_data Input (activation) data pointer. Data type: int16 + * @param[in] filter_dims Two dimensional filter dimensions. Format: [N, C] + * N : accumulation depth and equals (H * W * C_IN) from input_dims + * C : output depth and equals C_OUT in output_dims + * H & W : Not used + * @param[in] filter_data Filter data pointer. Data type: int8 + * @param[in] bias_dims Bias tensor dimensions. Format: [C_OUT] + * N, H, W : Not used + * @param[in] bias_data Bias data pointer. Data type: int64 + * @param[in] output_dims Output tensor dimensions. Format: [N, C_OUT] + * N : Batches + * C_OUT : Output depth + * H & W : Not used. + * @param[in, out] output_data Output data pointer. Data type: int16 + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + * @details + * - Supported framework: TensorFlow Lite + * - q15 is used as data type eventhough it is s16 data. It is done so to be consistent with existing APIs. + */ +arm_cmsis_nn_status arm_fully_connected_s16(const cmsis_nn_context *ctx, + const cmsis_nn_fc_params *fc_params, + const cmsis_nn_per_tensor_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q15_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int64_t *bias_data, + const cmsis_nn_dims *output_dims, + q15_t *output_data); + +/** + * @brief Get the required buffer size for S16 basic fully-connected and + * matrix multiplication layer function for TF Lite + * @param[in] filter_dims dimension of filter + * @return The function returns required buffer size in bytes + * + */ +int32_t arm_fully_connected_s16_get_buffer_size(const cmsis_nn_dims *filter_dims); + +/** + * @brief Q7 opt fully-connected layer function + * @param[in] pV pointer to input vector + * @param[in] pM pointer to matrix weights + * @param[in] dim_vec length of the vector + * @param[in] num_of_rows number of rows in weight matrix + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in] bias pointer to bias + * @param[in,out] pOut pointer to output vector + * @param[in,out] vec_buffer pointer to buffer space for input + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + */ + +arm_cmsis_nn_status arm_fully_connected_q7_opt(const q7_t *pV, + const q7_t *pM, + const uint16_t dim_vec, + const uint16_t num_of_rows, + const uint16_t bias_shift, + const uint16_t out_shift, + const q7_t *bias, + q7_t *pOut, + q15_t *vec_buffer); + +/** + * @brief Q15 basic fully-connected layer function + * @param[in] pV pointer to input vector + * @param[in] pM pointer to matrix weights + * @param[in] dim_vec length of the vector + * @param[in] num_of_rows number of rows in weight matrix + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in] bias pointer to bias + * @param[in,out] pOut pointer to output vector + * @param[in,out] vec_buffer pointer to buffer space for input + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + */ + +arm_cmsis_nn_status arm_fully_connected_q15(const q15_t *pV, + const q15_t *pM, + const uint16_t dim_vec, + const uint16_t num_of_rows, + const uint16_t bias_shift, + const uint16_t out_shift, + const q15_t *bias, + q15_t *pOut, + q15_t *vec_buffer); + +/** + * @brief Q15 opt fully-connected layer function + * @param[in] pV pointer to input vector + * @param[in] pM pointer to matrix weights + * @param[in] dim_vec length of the vector + * @param[in] num_of_rows number of rows in weight matrix + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in] bias pointer to bias + * @param[in,out] pOut pointer to output vector + * @param[in,out] vec_buffer pointer to buffer space for input + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + */ + +arm_cmsis_nn_status arm_fully_connected_q15_opt(const q15_t *pV, + const q15_t *pM, + const uint16_t dim_vec, + const uint16_t num_of_rows, + const uint16_t bias_shift, + const uint16_t out_shift, + const q15_t *bias, + q15_t *pOut, + q15_t *vec_buffer); + +/** + * @brief Mixed Q15-Q7 fully-connected layer function + * @param[in] pV pointer to input vector + * @param[in] pM pointer to matrix weights + * @param[in] dim_vec length of the vector + * @param[in] num_of_rows number of rows in weight matrix + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in] bias pointer to bias + * @param[in,out] pOut pointer to output vector + * @param[in,out] vec_buffer pointer to buffer space for input + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + */ + +arm_cmsis_nn_status arm_fully_connected_mat_q7_vec_q15(const q15_t *pV, + const q7_t *pM, + const uint16_t dim_vec, + const uint16_t num_of_rows, + const uint16_t bias_shift, + const uint16_t out_shift, + const q7_t *bias, + q15_t *pOut, + q15_t *vec_buffer); + +/** + * @brief Mixed Q15-Q7 opt fully-connected layer function + * @param[in] pV pointer to input vector + * @param[in] pM pointer to matrix weights + * @param[in] dim_vec length of the vector + * @param[in] num_of_rows number of rows in weight matrix + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in] bias pointer to bias + * @param[in,out] pOut pointer to output vector + * @param[in,out] vec_buffer pointer to buffer space for input + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + */ + +arm_cmsis_nn_status arm_fully_connected_mat_q7_vec_q15_opt(const q15_t *pV, + const q7_t *pM, + const uint16_t dim_vec, + const uint16_t num_of_rows, + const uint16_t bias_shift, + const uint16_t out_shift, + const q7_t *bias, + q15_t *pOut, + q15_t *vec_buffer); + +/** + * @brief Matrix-Multiplication Kernels for Convolution + * + * These functions are used within convolution layer functions for + * matrix multiplication. + * + * The implementation is similar to CMSIS-DSP arm_mat_mult functions + * with one Q7 and one Q15 operands. The Q15 operand is the im2col + * output which is always with 2 columns. + * + */ + +/** + * @brief Matrix-multiplication function for convolution + * @param[in] pA pointer to operand A + * @param[in] pInBuffer pointer to operand B, always conssists of 2 vectors + * @param[in] ch_im_out numRow of A + * @param[in] numCol_A numCol of A + * @param[in] bias_shift amount of left-shift for bias + * @param[in] out_shift amount of right-shift for output + * @param[in] bias the bias + * @param[in,out] pOut pointer to output + * @return The function returns the incremented output pointer + */ + +q7_t *arm_nn_mat_mult_kernel_q7_q15(const q7_t *pA, + const q15_t *pInBuffer, + const uint16_t ch_im_out, + const uint16_t numCol_A, + const uint16_t bias_shift, + const uint16_t out_shift, + const q7_t *bias, + q7_t *pOut); #ifdef __cplusplus } @@ -1423,676 +1729,925 @@ extern "C" */ #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif - /** - * @defgroup BasicMath Basic math functions - * - * Element wise add and multiplication functions. - * - */ - - /** - * @brief s8 element wise add of two vectors - * @param[in] input_1_vect pointer to input vector 1 - * @param[in] input_2_vect pointer to input vector 2 - * @param[in] input_1_offset offset for input 1. Range: Range: -127 to 128 - * @param[in] input_1_mult multiplier for input 1 - * @param[in] input_1_shift shift for input 1 - * @param[in] input_2_offset offset for input 2. Range: Range: -127 to 128 - * @param[in] input_2_mult multiplier for input 2 - * @param[in] input_2_shift shift for input 2 - * @param[in] left_shift input left shift - * @param[in,out] output pointer to output vector - * @param[in] out_offset output offset - * @param[in] out_mult output multiplier - * @param[in] out_shift output shift - * @param[in] out_activation_min minimum value to clamp output to - * @param[in] out_activation_max maximum value to clamp output to - * @param[in] block_size number of samples - * @return The function returns ARM_MATH_SUCCESS - */ - arm_status arm_elementwise_add_s8(const int8_t *input_1_vect, - const int8_t *input_2_vect, - const int32_t input_1_offset, - const int32_t input_1_mult, - const int32_t input_1_shift, - const int32_t input_2_offset, - const int32_t input_2_mult, - const int32_t input_2_shift, - const int32_t left_shift, - int8_t *output, - const int32_t out_offset, - const int32_t out_mult, - const int32_t out_shift, - const int32_t out_activation_min, - const int32_t out_activation_max, - const uint32_t block_size); - - /** - * @brief s8 element wise multiplication - * @param[in] input_1_vect pointer to input vector 1 - * @param[in] input_2_vect pointer to input vector 2 - * @param[in] input_1_offset offset for input 1. Range: Range: -127 to 128 - * @param[in] input_2_offset offset for input 2. Range: Range: -127 to 128 - * @param[in,out] output pointer to output vector - * @param[in] out_offset output offset - * @param[in] out_mult output multiplier - * @param[in] out_shift output shift - * @param[in] out_activation_min minimum value to clamp output to - * @param[in] out_activation_max maximum value to clamp output to - * @param[in] block_size number of samples - * @return The function returns ARM_MATH_SUCCESS - * - * @details Supported framework: TensorFlow Lite micro - */ - arm_status arm_elementwise_mul_s8(const int8_t *input_1_vect, - const int8_t *input_2_vect, - const int32_t input_1_offset, - const int32_t input_2_offset, - int8_t *output, - const int32_t out_offset, - const int32_t out_mult, - const int32_t out_shift, - const int32_t out_activation_min, - const int32_t out_activation_max, - const uint32_t block_size); - /** - * @defgroup Acti Activation Functions - * - * Perform activation layers, including ReLU (Rectified Linear Unit), - * sigmoid and tanh - * - */ - - /** - * @brief Q7 RELU function - * @param[in,out] data pointer to input - * @param[in] size number of elements - * @return none. - */ - - void arm_relu_q7(q7_t *data, uint16_t size); - - /** - * @brief s8 ReLU6 function - * @param[in,out] data pointer to input - * @param[in] size number of elements - */ - - void arm_relu6_s8(q7_t *data, uint16_t size); - - /** - * @brief Q15 RELU function - * @param[in,out] data pointer to input - * @param[in] size number of elements - * @return none. - */ - - void arm_relu_q15(q15_t *data, uint16_t size); - - /** - * @brief Q7 neural network activation function using direct table look-up - * @param[in,out] data pointer to input - * @param[in] size number of elements - * @param[in] int_width bit-width of the integer part, assume to be smaller than 3 - * @param[in] type type of activation functions - * @return none. - */ - - void arm_nn_activations_direct_q7(q7_t *data, uint16_t size, uint16_t int_width, arm_nn_activation_type type); - - /** - * @brief Q15 neural network activation function using direct table look-up - * @param[in,out] data pointer to input - * @param[in] size number of elements - * @param[in] int_width bit-width of the integer part, assume to be smaller than 3 - * @param[in] type type of activation functions - * @return none. - * - * @details - * - * This is the direct table look-up approach. - * - * Assume here the integer part of the fixed-point is <= 3. - * More than 3 just not making much sense, makes no difference with - * saturation followed by any of these activation functions. - */ - - void arm_nn_activations_direct_q15(q15_t *data, uint16_t size, uint16_t int_width, arm_nn_activation_type type); - - /** - * @defgroup Pooling Pooling Functions - * - * Perform pooling functions, including max pooling and average pooling - * - */ - - /** - * @brief Q7 max pooling function - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in input tensor dimension - * @param[in] ch_im_in number of input tensor channels - * @param[in] dim_kernel filter kernel size - * @param[in] padding padding sizes - * @param[in] stride convolution stride - * @param[in] dim_im_out output tensor dimension - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] Im_out pointer to output tensor - * @return none. - * - */ - - void arm_maxpool_q7_HWC(q7_t *Im_in, - const uint16_t dim_im_in, - const uint16_t ch_im_in, - const uint16_t dim_kernel, - const uint16_t padding, - const uint16_t stride, - const uint16_t dim_im_out, - q7_t *bufferA, - q7_t *Im_out); - - /** - * @brief Q7 average pooling function - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in input tensor dimension - * @param[in] ch_im_in number of input tensor channels - * @param[in] dim_kernel filter kernel size - * @param[in] padding padding sizes - * @param[in] stride convolution stride - * @param[in] dim_im_out output tensor dimension - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] Im_out pointer to output tensor - * @return none. - * - */ - - void arm_avepool_q7_HWC(q7_t *Im_in, - const uint16_t dim_im_in, - const uint16_t ch_im_in, - const uint16_t dim_kernel, - const uint16_t padding, - const uint16_t stride, - const uint16_t dim_im_out, - q7_t *bufferA, - q7_t *Im_out); - - /** - * @brief s8 average pooling function. - * - * @param[in, out] ctx Function context (e.g. temporary buffer). Check the function - * definition file to see if an additional buffer is required. - * Optional function {API}_get_buffer_size() provides the buffer - * size if an additional buffer is required. - * @param[in] pool_params Pooling parameters - * @param[in] input_dims Input (activation) tensor dimensions. Format: [H, W, C_IN] - * Argument 'N' is not used. - * @param[in] input_data Input (activation) data pointer. Data type: int8 - * @param[in] filter_dims Filter tensor dimensions. Format: [H, W] - * Argument N and C are not used. - * @param[in] output_dims Output tensor dimensions. Format: [H, W, C_OUT] - * Argument N is not used. - * C_OUT equals C_IN. - * @param[in, out] output_data Output data pointer. Data type: int8 - * @return The function returns - * ARM_MATH_SUCCESS - Successful operation - * - * @details - * - Supported Framework: TensorFlow Lite - * - */ - arm_status arm_avgpool_s8(const cmsis_nn_context *ctx, - const cmsis_nn_pool_params *pool_params, - const cmsis_nn_dims *input_dims, - const q7_t *input_data, - const cmsis_nn_dims *filter_dims, - const cmsis_nn_dims *output_dims, - q7_t *output_data); - - /** - * @brief Get the required buffer size for S8 average pooling function - * @param[in] dim_dst_width output tensor dimension - * @param[in] ch_src number of input tensor channels - * @return The function returns required buffer size in bytes - * - */ - int32_t arm_avgpool_s8_get_buffer_size(const int dim_dst_width, const int ch_src); - - /** - * @brief s8 max pooling function. - * - * @param[in, out] ctx Function context (e.g. temporary buffer). Check the function - * definition file to see if an additional buffer is required. - * Optional function {API}_get_buffer_size() provides the buffer - * size if an additional buffer is required. - * @param[in] pool_params Pooling parameters - * @param[in] input_dims Input (activation) tensor dimensions. Format: [H, W, C_IN] - * Argument 'N' is not used. - * @param[in] input_data Input (activation) data pointer. Data type: int8 - * @param[in] filter_dims Filter tensor dimensions. Format: [H, W] - * Argument N and C are not used. - * @param[in] output_dims Output tensor dimensions. Format: [H, W, C_OUT] - * Argument N is not used. - * C_OUT equals C_IN. - * @param[in, out] output_data Output data pointer. Data type: int8 - * @return The function returns - * ARM_MATH_SUCCESS - Successful operation - * - * @details - * - Supported Framework: TensorFlow Lite - * - */ - arm_status arm_max_pool_s8(const cmsis_nn_context *ctx, - const cmsis_nn_pool_params *pool_params, - const cmsis_nn_dims *input_dims, - const q7_t *input_data, - const cmsis_nn_dims *filter_dims, - const cmsis_nn_dims *output_dims, - q7_t *output_data); - /** - * @defgroup Softmax Softmax Functions - * - * EXP(2) based softmax functions. - * - */ - - /** - * @brief Q7 softmax function - * @param[in] vec_in pointer to input vector - * @param[in] dim_vec input vector dimension - * @param[out] p_out pointer to output vector - * - * @note This function is an optimized version which is not bit-accurate with - * TensorFlow Lite's kernel - * - */ - - void arm_softmax_q7(const q7_t *vec_in, const uint16_t dim_vec, q7_t *p_out); - - /** - * @brief Q7 softmax function with batch parameter - * @param[in] vec_in pointer to input vector - * @param[in] nb_batches number of batches - * @param[in] dim_vec input vector dimension - * @param[out] p_out pointer to output vector - * @return none. - * - * @note This function is an optimized version which is not bit-accurate with - * TensorFlow Lite's kernel - * - */ - - void arm_softmax_with_batch_q7(const q7_t *vec_in, const uint16_t nb_batches, const uint16_t dim_vec, q7_t *p_out); - /** - * @brief Q15 softmax function - * @param[in] vec_in pointer to input vector - * @param[in] dim_vec input vector dimension - * @param[out] p_out pointer to output vector - * @return none. - * - * @note This function is an optimized version which is not bit-accurate with - * TensorFlow Lite's kernel - * - */ - - void arm_softmax_q15(const q15_t *vec_in, const uint16_t dim_vec, q15_t *p_out); - - /** - * @brief S8 softmax function - * @param[in] input Pointer to the input tensor - * @param[in] num_rows Number of rows in the input tensor - * @param[in] row_size Number of elements in each input row - * @param[in] mult Input quantization multiplier - * @param[in] shift Input quantization shift within the range [0, 31] - * @param[in] diff_min Minimum difference with max in row. Used to check if - * the quantized exponential operation can be performed - * @param[out] output Pointer to the output tensor - * - * @note Supported framework: TensorFlow Lite micro (bit-accurate) - * - */ - - void arm_softmax_s8(const int8_t *input, - const int32_t num_rows, - const int32_t row_size, - const int32_t mult, - const int32_t shift, - const int32_t diff_min, - int8_t *output); - - /** - * @brief U8 softmax function - * @param[in] input Pointer to the input tensor - * @param[in] num_rows Number of rows in the input tensor - * @param[in] row_size Number of elements in each input row - * @param[in] mult Input quantization multiplier - * @param[in] shift Input quantization shift within the range [0, 31] - * @param[in] diff_min Minimum difference with max in row. Used to check if - * the quantized exponential operation can be performed - * @param[out] output Pointer to the output tensor - * - * @note Supported framework: TensorFlow Lite micro (bit-accurate) - * - */ - - void arm_softmax_u8(const uint8_t *input, +/** + * @defgroup BasicMath Basic math functions + * + * Elementwise add and multiplication functions. + * + */ + +/** + * @brief s8 elementwise add of two vectors + * @param[in] input_1_vect pointer to input vector 1 + * @param[in] input_2_vect pointer to input vector 2 + * @param[in] input_1_offset offset for input 1. Range: -127 to 128 + * @param[in] input_1_mult multiplier for input 1 + * @param[in] input_1_shift shift for input 1 + * @param[in] input_2_offset offset for input 2. Range: -127 to 128 + * @param[in] input_2_mult multiplier for input 2 + * @param[in] input_2_shift shift for input 2 + * @param[in] left_shift input left shift + * @param[in,out] output pointer to output vector + * @param[in] out_offset output offset. Range: -128 to 127 + * @param[in] out_mult output multiplier + * @param[in] out_shift output shift + * @param[in] out_activation_min minimum value to clamp output to. Min: -128 + * @param[in] out_activation_max maximum value to clamp output to. Max: 127 + * @param[in] block_size number of samples + * @return The function returns ARM_CMSIS_NN_SUCCESS + */ +arm_cmsis_nn_status arm_elementwise_add_s8(const int8_t *input_1_vect, + const int8_t *input_2_vect, + const int32_t input_1_offset, + const int32_t input_1_mult, + const int32_t input_1_shift, + const int32_t input_2_offset, + const int32_t input_2_mult, + const int32_t input_2_shift, + const int32_t left_shift, + int8_t *output, + const int32_t out_offset, + const int32_t out_mult, + const int32_t out_shift, + const int32_t out_activation_min, + const int32_t out_activation_max, + const int32_t block_size); + +/** + * @brief s16 elementwise add of two vectors + * @param[in] input_1_vect pointer to input vector 1 + * @param[in] input_2_vect pointer to input vector 2 + * @param[in] input_1_offset offset for input 1. Not used. + * @param[in] input_1_mult multiplier for input 1 + * @param[in] input_1_shift shift for input 1 + * @param[in] input_2_offset offset for input 2. Not used. + * @param[in] input_2_mult multiplier for input 2 + * @param[in] input_2_shift shift for input 2 + * @param[in] left_shift input left shift + * @param[in,out] output pointer to output vector + * @param[in] out_offset output offset. Not used. + * @param[in] out_mult output multiplier + * @param[in] out_shift output shift + * @param[in] out_activation_min minimum value to clamp output to. Min: -32768 + * @param[in] out_activation_max maximum value to clamp output to. Max: 32767 + * @param[in] block_size number of samples + * @return The function returns ARM_CMSIS_NN_SUCCESS + */ +arm_cmsis_nn_status arm_elementwise_add_s16(const int16_t *input_1_vect, + const int16_t *input_2_vect, + const int32_t input_1_offset, + const int32_t input_1_mult, + const int32_t input_1_shift, + const int32_t input_2_offset, + const int32_t input_2_mult, + const int32_t input_2_shift, + const int32_t left_shift, + int16_t *output, + const int32_t out_offset, + const int32_t out_mult, + const int32_t out_shift, + const int32_t out_activation_min, + const int32_t out_activation_max, + const int32_t block_size); + +/** + * @brief s8 elementwise multiplication + * @param[in] input_1_vect pointer to input vector 1 + * @param[in] input_2_vect pointer to input vector 2 + * @param[in] input_1_offset offset for input 1. Range: -127 to 128 + * @param[in] input_2_offset offset for input 2. Range: -127 to 128 + * @param[in,out] output pointer to output vector + * @param[in] out_offset output offset. Range: -128 to 127 + * @param[in] out_mult output multiplier + * @param[in] out_shift output shift + * @param[in] out_activation_min minimum value to clamp output to. Min: -128 + * @param[in] out_activation_max maximum value to clamp output to. Max: 127 + * @param[in] block_size number of samples + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + * @details Supported framework: TensorFlow Lite micro + */ +arm_cmsis_nn_status arm_elementwise_mul_s8(const int8_t *input_1_vect, + const int8_t *input_2_vect, + const int32_t input_1_offset, + const int32_t input_2_offset, + int8_t *output, + const int32_t out_offset, + const int32_t out_mult, + const int32_t out_shift, + const int32_t out_activation_min, + const int32_t out_activation_max, + const int32_t block_size); + +/** + * @brief s16 elementwise multiplication + * @param[in] input_1_vect pointer to input vector 1 + * @param[in] input_2_vect pointer to input vector 2 + * @param[in] input_1_offset offset for input 1. Not used. + * @param[in] input_2_offset offset for input 2. Not used. + * @param[in,out] output pointer to output vector + * @param[in] out_offset output offset. Not used. + * @param[in] out_mult output multiplier + * @param[in] out_shift output shift + * @param[in] out_activation_min minimum value to clamp output to. Min: -32768 + * @param[in] out_activation_max maximum value to clamp output to. Max: 32767 + * @param[in] block_size number of samples + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + * @details Supported framework: TensorFlow Lite micro + */ +arm_cmsis_nn_status arm_elementwise_mul_s16(const int16_t *input_1_vect, + const int16_t *input_2_vect, + const int32_t input_1_offset, + const int32_t input_2_offset, + int16_t *output, + const int32_t out_offset, + const int32_t out_mult, + const int32_t out_shift, + const int32_t out_activation_min, + const int32_t out_activation_max, + const int32_t block_size); + +/** + * @defgroup Acti Activation Functions + * + * Perform activation layers, including ReLU (Rectified Linear Unit), + * sigmoid and tanh + * + */ + +/** + * @brief Q7 RELU function + * @param[in,out] data pointer to input + * @param[in] size number of elements + */ + +void arm_relu_q7(q7_t *data, uint16_t size); + +/** + * @brief s8 ReLU6 function + * @param[in,out] data pointer to input + * @param[in] size number of elements + */ + +void arm_relu6_s8(q7_t *data, uint16_t size); + +/** + * @brief Q15 RELU function + * @param[in,out] data pointer to input + * @param[in] size number of elements + */ + +void arm_relu_q15(q15_t *data, uint16_t size); + +/** + * @brief Q7 neural network activation function using direct table look-up + * @param[in,out] data pointer to input + * @param[in] size number of elements + * @param[in] int_width bit-width of the integer part, assume to be smaller than 3 + * @param[in] type type of activation functions + */ + +void arm_nn_activations_direct_q7(q7_t *data, uint16_t size, uint16_t int_width, arm_nn_activation_type type); + +/** + * @brief Q15 neural network activation function using direct table look-up + * @param[in,out] data pointer to input + * @param[in] size number of elements + * @param[in] int_width bit-width of the integer part, assume to be smaller than 3 + * @param[in] type type of activation functions + * + * @details + * + * This is the direct table look-up approach. + * + * Assume here the integer part of the fixed-point is <= 3. + * More than 3 just not making much sense, makes no difference with + * saturation followed by any of these activation functions. + */ + +void arm_nn_activations_direct_q15(q15_t *data, uint16_t size, uint16_t int_width, arm_nn_activation_type type); + +/** + * @defgroup Pooling Pooling Functions + * + * Perform pooling functions, including max pooling and average pooling + * + */ + +/** + * @brief Q7 max pooling function + * @param[in] Im_in pointer to input tensor + * @param[in] dim_im_in input tensor dimension + * @param[in] ch_im_in number of input tensor channels + * @param[in] dim_kernel filter kernel size + * @param[in] padding padding sizes + * @param[in] stride convolution stride + * @param[in] dim_im_out output tensor dimension + * @param[in,out] bufferA pointer to buffer space for input + * @param[in,out] Im_out pointer to output tensor + * + */ + +void arm_maxpool_q7_HWC(q7_t *Im_in, + const uint16_t dim_im_in, + const uint16_t ch_im_in, + const uint16_t dim_kernel, + const uint16_t padding, + const uint16_t stride, + const uint16_t dim_im_out, + q7_t *bufferA, + q7_t *Im_out); + +/** + * @brief Q7 average pooling function + * @param[in] Im_in pointer to input tensor + * @param[in] dim_im_in input tensor dimension + * @param[in] ch_im_in number of input tensor channels + * @param[in] dim_kernel filter kernel size + * @param[in] padding padding sizes + * @param[in] stride convolution stride + * @param[in] dim_im_out output tensor dimension + * @param[in,out] bufferA pointer to buffer space for input + * @param[in,out] Im_out pointer to output tensor + * + */ + +void arm_avepool_q7_HWC(q7_t *Im_in, + const uint16_t dim_im_in, + const uint16_t ch_im_in, + const uint16_t dim_kernel, + const uint16_t padding, + const uint16_t stride, + const uint16_t dim_im_out, + q7_t *bufferA, + q7_t *Im_out); + +/** + * @brief s8 average pooling function. + * + * @param[in, out] ctx Function context (e.g. temporary buffer). Check the function + * definition file to see if an additional buffer is required. + * Optional function {API}_get_buffer_size() provides the buffer + * size if an additional buffer is required. + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] pool_params Pooling parameters + * @param[in] input_dims Input (activation) tensor dimensions. Format: [H, W, C_IN] + * Argument 'N' is not used. + * @param[in] input_data Input (activation) data pointer. Data type: int8 + * @param[in] filter_dims Filter tensor dimensions. Format: [H, W] + * Argument N and C are not used. + * @param[in] output_dims Output tensor dimensions. Format: [H, W, C_OUT] + * Argument N is not used. + * C_OUT equals C_IN. + * @param[in, out] output_data Output data pointer. Data type: int8 + * @return The function returns + * ARM_CMSIS_NN_SUCCESS - Successful operation + * + * @details + * - Supported Framework: TensorFlow Lite + * + */ +arm_cmsis_nn_status arm_avgpool_s8(const cmsis_nn_context *ctx, + const cmsis_nn_pool_params *pool_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *filter_dims, + const cmsis_nn_dims *output_dims, + q7_t *output_data); + +/** + * @brief Get the required buffer size for S8 average pooling function + * @param[in] dim_dst_width output tensor dimension + * @param[in] ch_src number of input tensor channels + * @return The function returns required buffer size in bytes + * + */ +int32_t arm_avgpool_s8_get_buffer_size(const int dim_dst_width, const int ch_src); + +/** + * @brief s16 average pooling function. + * + * @param[in, out] ctx Function context (e.g. temporary buffer). Check the function + * definition file to see if an additional buffer is required. + * Optional function {API}_get_buffer_size() provides the buffer + * size if an additional buffer is required. + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] pool_params Pooling parameters + * @param[in] input_dims Input (activation) tensor dimensions. Format: [H, W, C_IN] + * Argument 'N' is not used. + * @param[in] input_data Input (activation) data pointer. Data type: int16 + * @param[in] filter_dims Filter tensor dimensions. Format: [H, W] + * Argument N and C are not used. + * @param[in] output_dims Output tensor dimensions. Format: [H, W, C_OUT] + * Argument N is not used. + * C_OUT equals C_IN. + * @param[in, out] output_data Output data pointer. Data type: int16 + * @return The function returns + * ARM_CMSIS_NN_SUCCESS - Successful operation + * ARM_CMSIS_NN_ARG_ERROR - In case of invalid arguments + * + * @details + * - Supported Framework: TensorFlow Lite + * + */ +arm_cmsis_nn_status arm_avgpool_s16(const cmsis_nn_context *ctx, + const cmsis_nn_pool_params *pool_params, + const cmsis_nn_dims *input_dims, + const int16_t *input_data, + const cmsis_nn_dims *filter_dims, + const cmsis_nn_dims *output_dims, + int16_t *output_data); + +/** + * @brief Get the required buffer size for S16 average pooling function + * @param[in] dim_dst_width output tensor dimension + * @param[in] ch_src number of input tensor channels + * @return The function returns required buffer size in bytes + * + */ +int32_t arm_avgpool_s16_get_buffer_size(const int dim_dst_width, const int ch_src); + +/** + * @brief s8 max pooling function. + * + * @param[in, out] ctx Function context (e.g. temporary buffer). Check the function + * definition file to see if an additional buffer is required. + * Optional function {API}_get_buffer_size() provides the buffer + * size if an additional buffer is required. + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] pool_params Pooling parameters + * @param[in] input_dims Input (activation) tensor dimensions. Format: [H, W, C_IN] + * Argument 'N' is not used. + * @param[in] input_data Input (activation) data pointer. The input tensor must not + * overlap with the output tensor. Data type: int8 + * @param[in] filter_dims Filter tensor dimensions. Format: [H, W] + * Argument N and C are not used. + * @param[in] output_dims Output tensor dimensions. Format: [H, W, C_OUT] + * Argument N is not used. + * C_OUT equals C_IN. + * @param[in, out] output_data Output data pointer. Data type: int8 + * @return The function returns + * ARM_CMSIS_NN_SUCCESS - Successful operation + * + * @details + * - Supported Framework: TensorFlow Lite + * + */ +arm_cmsis_nn_status arm_max_pool_s8(const cmsis_nn_context *ctx, + const cmsis_nn_pool_params *pool_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *filter_dims, + const cmsis_nn_dims *output_dims, + q7_t *output_data); + +/** + * @brief s16 max pooling function. + * + * @param[in, out] ctx Function context (e.g. temporary buffer). Check the function + * definition file to see if an additional buffer is required. + * Optional function {API}_get_buffer_size() provides the buffer + * size if an additional buffer is required. + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] pool_params Pooling parameters + * @param[in] input_dims Input (activation) tensor dimensions. Format: [H, W, C_IN] + * Argument 'N' is not used. + * @param[in] src Input (activation) data pointer. The input tensor must not + * overlap with the output tensor. Data type: int16 + * @param[in] filter_dims Filter tensor dimensions. Format: [H, W] + * Argument N and C are not used. + * @param[in] output_dims Output tensor dimensions. Format: [H, W, C_OUT] + * Argument N is not used. + * C_OUT equals C_IN. + * @param[in, out] dst Output data pointer. Data type: int16 + * @return The function returns + * ARM_CMSIS_NN_SUCCESS - Successful operation + * + * @details + * - Supported Framework: TensorFlow Lite + * + */ +arm_cmsis_nn_status arm_max_pool_s16(const cmsis_nn_context *ctx, + const cmsis_nn_pool_params *pool_params, + const cmsis_nn_dims *input_dims, + const int16_t *src, + const cmsis_nn_dims *filter_dims, + const cmsis_nn_dims *output_dims, + int16_t *dst); + +/** + * @defgroup Softmax Softmax Functions + * + * EXP(2) based softmax functions. + * + */ + +/** + * @brief Q7 softmax function + * @param[in] vec_in pointer to input vector + * @param[in] dim_vec input vector dimension + * @param[out] p_out pointer to output vector + * + * @note This function is an optimized version which is not bit-accurate with + * TensorFlow Lite's kernel + * + */ + +void arm_softmax_q7(const q7_t *vec_in, const uint16_t dim_vec, q7_t *p_out); + +/** + * @brief Q7 softmax function with batch parameter + * @param[in] vec_in pointer to input vector + * @param[in] nb_batches number of batches + * @param[in] dim_vec input vector dimension + * @param[out] p_out pointer to output vector + * + * @note This function is an optimized version which is not bit-accurate with + * TensorFlow Lite's kernel + * + */ + +void arm_softmax_with_batch_q7(const q7_t *vec_in, const uint16_t nb_batches, const uint16_t dim_vec, q7_t *p_out); +/** + * @brief Q15 softmax function + * @param[in] vec_in pointer to input vector + * @param[in] dim_vec input vector dimension + * @param[out] p_out pointer to output vector + * + * @note This function is an optimized version which is not bit-accurate with + * TensorFlow Lite's kernel + * + */ + +void arm_softmax_q15(const q15_t *vec_in, const uint16_t dim_vec, q15_t *p_out); + +/** + * @brief S8 softmax function + * @param[in] input Pointer to the input tensor + * @param[in] num_rows Number of rows in the input tensor + * @param[in] row_size Number of elements in each input row + * @param[in] mult Input quantization multiplier + * @param[in] shift Input quantization shift within the range [0, 31] + * @param[in] diff_min Minimum difference with max in row. Used to check if + * the quantized exponential operation can be performed + * @param[out] output Pointer to the output tensor + * + * @note Supported framework: TensorFlow Lite micro (bit-accurate) + * + */ +void arm_softmax_s8(const int8_t *input, + const int32_t num_rows, + const int32_t row_size, + const int32_t mult, + const int32_t shift, + const int32_t diff_min, + int8_t *output); + +/** + * @brief S8 to s16 softmax function + * @param[in] input Pointer to the input tensor + * @param[in] num_rows Number of rows in the input tensor + * @param[in] row_size Number of elements in each input row + * @param[in] mult Input quantization multiplier + * @param[in] shift Input quantization shift within the range [0, 31] + * @param[in] diff_min Minimum difference with max in row. Used to check if + * the quantized exponential operation can be performed + * @param[out] output Pointer to the output tensor + * + * @note Supported framework: TensorFlow Lite micro (bit-accurate) + * + */ +void arm_softmax_s8_s16(const int8_t *input, const int32_t num_rows, const int32_t row_size, const int32_t mult, const int32_t shift, const int32_t diff_min, - uint8_t *output); - - /** - * @brief uint8 depthwise convolution function with asymmetric quantization - * Unless specified otherwise, arguments are mandatory. - * - * @param[in] input Pointer to input tensor - * @param[in] input_x Width of input tensor - * @param[in] input_y Height of input tensor - * @param[in] input_ch Channels in input tensor - * @param[in] kernel Pointer to kernel weights - * @param[in] kernel_x Width of kernel - * @param[in] kernel_y Height of kernel - * @param[in] ch_mult Number of channel multiplier - * @param[in] pad_x Padding sizes x - * @param[in] pad_y Padding sizes y - * @param[in] stride_x stride along the width - * @param[in] stride_y stride along the height - * @param[in] dilation_x Dilation along width. Not used and intended for future enhancement. - * @param[in] dilation_y Dilation along height. Not used and intended for future enhancement. - * @param[in] bias Pointer to optional bias values. If no bias is - * availble, NULL is expected - * @param[in] input_offset Input tensor zero offset - * @param[in] filter_offset Kernel tensor zero offset - * @param[in] output_offset Output tensor zero offset - * @param[in,out] output Pointer to output tensor - * @param[in] output_x Width of output tensor - * @param[in] output_y Height of output tensor - * @param[in] output_activation_min Minimum value to clamp the output to. Range : {0, 255} - * @param[in] output_activation_max Minimum value to clamp the output to. Range : {0, 255} - * @param[in] out_shift Amount of right-shift for output - * @param[in] out_mult Output multiplier for requantization - * @return The function returns the following - * ARM_MATH_SUCCESS - Successful operation - * - */ - arm_status arm_depthwise_conv_u8_basic_ver1(const uint8_t *input, - const uint16_t input_x, - const uint16_t input_y, - const uint16_t input_ch, - const uint8_t *kernel, - const uint16_t kernel_x, - const uint16_t kernel_y, - const int16_t ch_mult, - const int16_t pad_x, - const int16_t pad_y, - const int16_t stride_x, - const int16_t stride_y, - const int16_t dilation_x, - const int16_t dilation_y, - const int32_t *bias, - const int32_t input_offset, - const int32_t filter_offset, - const int32_t output_offset, - uint8_t *output, - const uint16_t output_x, - const uint16_t output_y, - const int32_t output_activation_min, - const int32_t output_activation_max, - const int32_t out_shift, - const int32_t out_mult); - - /** - * @defgroup Reshape Reshape Functions - * - */ - - /** - * @brief Reshape a s8 vector into another with different shape - * @param[in] input points to the s8 input vector - * @param[out] output points to the s8 output vector - * @param[in] total_size total size of the input and output vectors in bytes - * - * @note The output is expected to be in a memory area that does not overlap with the input's - * - */ - void arm_reshape_s8(const int8_t *input, int8_t *output, const uint32_t total_size); - - /** - * @defgroup Concatenation Concatenation Functions - * - */ - - /** - * @brief int8/uint8 concatenation function to be used for concatenating N-tensors along the X axis - * This function should be called for each input tensor to concatenate. The argument offset_x - * will be used to store the input tensor in the correct position in the output tensor - * - * i.e. offset_x = 0 - * for(i = 0 i < num_input_tensors; ++i) - * { - * arm_concatenation_s8_x(&input[i], ..., &output, ..., ..., offset_x) - * offset_x += input_x[i] - * } - * - * This function assumes that the output tensor has: - * -# The same height of the input tensor - * -# The same number of channels of the input tensor - * -# The same batch size of the input tensor - * - * Unless specified otherwise, arguments are mandatory. - * - * @note This function, data layout independent, can be used to concatenate either int8 or uint8 tensors because it - * does not involve any arithmetic operation - * - * @param[in] input Pointer to input tensor - * @param[in] input_x Width of input tensor - * @param[in] input_y Height of input tensor - * @param[in] input_z Channels in input tensor - * @param[in] input_w Batch size in input tensor - * @param[out] output Pointer to output tensor - * @param[in] output_x Width of output tensor - * @param[in] offset_x The offset (in number of elements) on the X axis to start concatenating the input tensor - * It is user responsibility to provide the correct value - * - * Input constraints - * offset_x is less than output_x - * - */ - void arm_concatenation_s8_x(const int8_t *input, - const uint16_t input_x, - const uint16_t input_y, - const uint16_t input_z, - const uint16_t input_w, - int8_t *output, - const uint16_t output_x, - const uint32_t offset_x); - - /** - * @brief int8/uint8 concatenation function to be used for concatenating N-tensors along the Y axis - * This function should be called for each input tensor to concatenate. The argument offset_y - * will be used to store the input tensor in the correct position in the output tensor - * - * i.e. offset_y = 0 - * for(i = 0 i < num_input_tensors; ++i) - * { - * arm_concatenation_s8_y(&input[i], ..., &output, ..., ..., offset_y) - * offset_y += input_y[i] - * } - * - * This function assumes that the output tensor has: - * -# The same width of the input tensor - * -# The same number of channels of the input tensor - * -# The same batch size of the input tensor - * - * Unless specified otherwise, arguments are mandatory. - * - * @note This function, data layout independent, can be used to concatenate either int8 or uint8 tensors because it - * does not involve any arithmetic operation - * - * @param[in] input Pointer to input tensor - * @param[in] input_x Width of input tensor - * @param[in] input_y Height of input tensor - * @param[in] input_z Channels in input tensor - * @param[in] input_w Batch size in input tensor - * @param[out] output Pointer to output tensor - * @param[in] output_y Height of output tensor - * @param[in] offset_y The offset on the Y axis to start concatenating the input tensor - * It is user responsibility to provide the correct value - * - * Input constraints - * offset_y is less than output_y - * - */ - void arm_concatenation_s8_y(const int8_t *input, - const uint16_t input_x, - const uint16_t input_y, - const uint16_t input_z, - const uint16_t input_w, - int8_t *output, - const uint16_t output_y, - const uint32_t offset_y); - - /** - * @brief int8/uint8 concatenation function to be used for concatenating N-tensors along the Z axis - * This function should be called for each input tensor to concatenate. The argument offset_z - * will be used to store the input tensor in the correct position in the output tensor - * - * i.e. offset_z = 0 - * for(i = 0 i < num_input_tensors; ++i) - * { - * arm_concatenation_s8_z(&input[i], ..., &output, ..., ..., offset_z) - * offset_z += input_z[i] - * } - * - * This function assumes that the output tensor has: - * -# The same width of the input tensor - * -# The same height of the input tensor - * -# The same batch size of the input tensor - * - * Unless specified otherwise, arguments are mandatory. - * - * @note This function, data layout independent, can be used to concatenate either int8 or uint8 tensors because it - * does not involve any arithmetic operation - * - * @param[in] input Pointer to input tensor - * @param[in] input_x Width of input tensor - * @param[in] input_y Height of input tensor - * @param[in] input_z Channels in input tensor - * @param[in] input_w Batch size in input tensor - * @param[out] output Pointer to output tensor - * @param[in] output_z Channels in output tensor - * @param[in] offset_z The offset on the Z axis to start concatenating the input tensor - * It is user responsibility to provide the correct value - * - * Input constraints - * offset_z is less than output_z - * - */ - void arm_concatenation_s8_z(const int8_t *input, - const uint16_t input_x, - const uint16_t input_y, - const uint16_t input_z, - const uint16_t input_w, - int8_t *output, - const uint16_t output_z, - const uint32_t offset_z); - - /** - * @brief int8/uint8 concatenation function to be used for concatenating N-tensors along the W axis (Batch size) - * This function should be called for each input tensor to concatenate. The argument offset_w - * will be used to store the input tensor in the correct position in the output tensor - * - * i.e. offset_w = 0 - * for(i = 0 i < num_input_tensors; ++i) - * { - * arm_concatenation_s8_w(&input[i], ..., &output, ..., ..., offset_w) - * offset_w += input_w[i] - * } - * - * This function assumes that the output tensor has: - * -# The same width of the input tensor - * -# The same height of the input tensor - * -# The same number o channels of the input tensor - * - * Unless specified otherwise, arguments are mandatory. - * - * @note This function, data layout independent, can be used to concatenate either int8 or uint8 tensors because it - * does not involve any arithmetic operation - * - * @param[in] input Pointer to input tensor - * @param[in] input_x Width of input tensor - * @param[in] input_y Height of input tensor - * @param[in] input_z Channels in input tensor - * @param[in] input_w Batch size in input tensor - * @param[out] output Pointer to output tensor - * @param[in] offset_w The offset on the W axis to start concatenating the input tensor - * It is user responsibility to provide the correct value - * - */ - void arm_concatenation_s8_w(const int8_t *input, - const uint16_t input_x, - const uint16_t input_y, - const uint16_t input_z, - const uint16_t input_w, - int8_t *output, - const uint32_t offset_w); - /** - * @defgroup SVDF SVDF Layer Functions - * - */ - - /** - * @brief s8 SVDF function - * - * @param[in] input_ctx Temporary scratch buffer - * @param[in] output_ctx Temporary output scratch buffer - * @param[in] svdf_params SVDF Parameters - * Range of svdf_params->input_offset : [-128, 127] - * Range of svdf_params->output_offset : [-128, 127] - * @param[in] input_quant_params Input quantization parameters - * @param[in] output_quant_params Output quantization parameters - * @param[in] input_dims Input tensor dimensions - * @param[in] input_data Pointer to input tensor - * @param[in] state_dims State tensor dimensions - * @param[in] state_data Pointer to state tensor - * @param[in] weights_feature_dims Weights (feature) tensor dimensions - * @param[in] weights_feature_data Pointer to the weights (feature) tensor - * @param[in] weights_time_dims Weights (time) tensor dimensions - * @param[in] weights_time_data Pointer to the weights (time) tensor - * @param[in] bias_dims Bias tensor dimensions - * @param[in] bias_data Pointer to bias tensor - * @param[in] output_dims Output tensor dimensions - * @param[out] output_data Pointer to the output tensor - * - * @return The function returns ARM_MATH_SUCCESS - * - * @details - * 1. Supported framework: TensorFlow Lite micro - * 2. q7 is used as data type eventhough it is s8 data. It is done so to be consistent with existing APIs. - * - */ - arm_status arm_svdf_s8(const cmsis_nn_context *input_ctx, - const cmsis_nn_context *output_ctx, - const cmsis_nn_svdf_params *svdf_params, - const cmsis_nn_per_tensor_quant_params *input_quant_params, - const cmsis_nn_per_tensor_quant_params *output_quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input_data, - const cmsis_nn_dims *state_dims, - q15_t *state_data, - const cmsis_nn_dims *weights_feature_dims, - const q7_t *weights_feature_data, - const cmsis_nn_dims *weights_time_dims, - const q15_t *weights_time_data, - const cmsis_nn_dims *bias_dims, - const q31_t *bias_data, - const cmsis_nn_dims *output_dims, - q7_t *output_data); + int16_t *output); + +/** + * @brief S16 softmax function + * @param[in] input Pointer to the input tensor + * @param[in] num_rows Number of rows in the input tensor + * @param[in] row_size Number of elements in each input row + * @param[in] mult Input quantization multiplier + * @param[in] shift Input quantization shift within the range [0, 31] + * @param[in] softmax_params Softmax s16 layer parameters with two pointers to LUTs speficied below. + * For indexing the high 9 bits are used and 7 remaining for interpolation. + * That means 512 entries for the 9-bit indexing and 1 extra for interpolation, i.e. 513 + * values for each LUT. + * - Lookup table for exp(x), where x uniform distributed between [-10.0 , 0.0] + * - Lookup table for 1 / (1 + x), where x uniform distributed between [0.0 , 1.0] + * @param[out] output Pointer to the output tensor + * @return The function returns + * ARM_CMSIS_NN_ARG_ERROR Argument error check failed + * ARM_CMSIS_NN_SUCCESS - Successful operation + * + * @note Supported framework: TensorFlow Lite micro (bit-accurate) + * + */ +arm_cmsis_nn_status arm_softmax_s16(const int16_t *input, + const int32_t num_rows, + const int32_t row_size, + const int32_t mult, + const int32_t shift, + const cmsis_nn_softmax_lut_s16 *softmax_params, + int16_t *output); + +/** + * @brief U8 softmax function + * @param[in] input Pointer to the input tensor + * @param[in] num_rows Number of rows in the input tensor + * @param[in] row_size Number of elements in each input row + * @param[in] mult Input quantization multiplier + * @param[in] shift Input quantization shift within the range [0, 31] + * @param[in] diff_min Minimum difference with max in row. Used to check if + * the quantized exponential operation can be performed + * @param[out] output Pointer to the output tensor + * + * @note Supported framework: TensorFlow Lite micro (bit-accurate) + * + */ + +void arm_softmax_u8(const uint8_t *input, + const int32_t num_rows, + const int32_t row_size, + const int32_t mult, + const int32_t shift, + const int32_t diff_min, + uint8_t *output); + +/** + * @brief uint8 depthwise convolution function with asymmetric quantization + * Unless specified otherwise, arguments are mandatory. + * + * @param[in] input Pointer to input tensor + * @param[in] input_x Width of input tensor + * @param[in] input_y Height of input tensor + * @param[in] input_ch Channels in input tensor + * @param[in] kernel Pointer to kernel weights + * @param[in] kernel_x Width of kernel + * @param[in] kernel_y Height of kernel + * @param[in] ch_mult Number of channel multiplier + * @param[in] pad_x Padding sizes x + * @param[in] pad_y Padding sizes y + * @param[in] stride_x stride along the width + * @param[in] stride_y stride along the height + * @param[in] dilation_x Dilation along width. Not used and intended for future enhancement. + * @param[in] dilation_y Dilation along height. Not used and intended for future enhancement. + * @param[in] bias Pointer to optional bias values. If no bias is + * availble, NULL is expected + * @param[in] input_offset Input tensor zero offset + * @param[in] filter_offset Kernel tensor zero offset + * @param[in] output_offset Output tensor zero offset + * @param[in,out] output Pointer to output tensor + * @param[in] output_x Width of output tensor + * @param[in] output_y Height of output tensor + * @param[in] output_activation_min Minimum value to clamp the output to. Range : {0, 255} + * @param[in] output_activation_max Minimum value to clamp the output to. Range : {0, 255} + * @param[in] out_shift Amount of right-shift for output + * @param[in] out_mult Output multiplier for requantization + * @return The function returns the following + * ARM_CMSIS_NN_SUCCESS - Successful operation + * + */ +arm_cmsis_nn_status arm_depthwise_conv_u8_basic_ver1(const uint8_t *input, + const uint16_t input_x, + const uint16_t input_y, + const uint16_t input_ch, + const uint8_t *kernel, + const uint16_t kernel_x, + const uint16_t kernel_y, + const int16_t ch_mult, + const int16_t pad_x, + const int16_t pad_y, + const int16_t stride_x, + const int16_t stride_y, + const int16_t dilation_x, + const int16_t dilation_y, + const int32_t *bias, + const int32_t input_offset, + const int32_t filter_offset, + const int32_t output_offset, + uint8_t *output, + const uint16_t output_x, + const uint16_t output_y, + const int32_t output_activation_min, + const int32_t output_activation_max, + const int32_t out_shift, + const int32_t out_mult); + +/** + * @defgroup Reshape Reshape Functions + * + */ + +/** + * @brief Reshape a s8 vector into another with different shape + * @param[in] input points to the s8 input vector + * @param[out] output points to the s8 output vector + * @param[in] total_size total size of the input and output vectors in bytes + * + * @note The output is expected to be in a memory area that does not overlap with the input's + * + */ +void arm_reshape_s8(const int8_t *input, int8_t *output, const uint32_t total_size); + +/** + * @defgroup Concatenation Concatenation Functions + * + */ + +/** + * @brief int8/uint8 concatenation function to be used for concatenating N-tensors along the X axis + * This function should be called for each input tensor to concatenate. The argument offset_x + * will be used to store the input tensor in the correct position in the output tensor + * + * i.e. offset_x = 0 + * for(i = 0 i < num_input_tensors; ++i) + * { + * arm_concatenation_s8_x(&input[i], ..., &output, ..., ..., offset_x) + * offset_x += input_x[i] + * } + * + * This function assumes that the output tensor has: + * -# The same height of the input tensor + * -# The same number of channels of the input tensor + * -# The same batch size of the input tensor + * + * Unless specified otherwise, arguments are mandatory. + * + * @note This function, data layout independent, can be used to concatenate either int8 or uint8 tensors because it + * does not involve any arithmetic operation + * + * @param[in] input Pointer to input tensor. Input tensor must not overlap with the output tensor. + * @param[in] input_x Width of input tensor + * @param[in] input_y Height of input tensor + * @param[in] input_z Channels in input tensor + * @param[in] input_w Batch size in input tensor + * @param[out] output Pointer to output tensor. Expected to be at least + * (input_x * input_y * input_z * input_w) + offset_x + * bytes. + * @param[in] output_x Width of output tensor + * @param[in] offset_x The offset (in number of elements) on the X axis to start concatenating the input tensor + * It is user responsibility to provide the correct value + * + * Input constraints + * offset_x is less than output_x + * + */ +void arm_concatenation_s8_x(const int8_t *input, + const uint16_t input_x, + const uint16_t input_y, + const uint16_t input_z, + const uint16_t input_w, + int8_t *output, + const uint16_t output_x, + const uint32_t offset_x); + +/** + * @brief int8/uint8 concatenation function to be used for concatenating N-tensors along the Y axis + * This function should be called for each input tensor to concatenate. The argument offset_y + * will be used to store the input tensor in the correct position in the output tensor + * + * i.e. offset_y = 0 + * for(i = 0 i < num_input_tensors; ++i) + * { + * arm_concatenation_s8_y(&input[i], ..., &output, ..., ..., offset_y) + * offset_y += input_y[i] + * } + * + * This function assumes that the output tensor has: + * -# The same width of the input tensor + * -# The same number of channels of the input tensor + * -# The same batch size of the input tensor + * + * Unless specified otherwise, arguments are mandatory. + * + * @note This function, data layout independent, can be used to concatenate either int8 or uint8 tensors because it + * does not involve any arithmetic operation + * + * @param[in] input Pointer to input tensor. Input tensor must not overlap with the output tensor. + * @param[in] input_x Width of input tensor + * @param[in] input_y Height of input tensor + * @param[in] input_z Channels in input tensor + * @param[in] input_w Batch size in input tensor + * @param[out] output Pointer to output tensor. Expected to be at least + * (input_z * input_w * input_x * input_y) + offset_y + * bytes. + * @param[in] output_y Height of output tensor + * @param[in] offset_y The offset on the Y axis to start concatenating the input tensor + * It is user responsibility to provide the correct value + * + * Input constraints + * offset_y is less than output_y + * + */ +void arm_concatenation_s8_y(const int8_t *input, + const uint16_t input_x, + const uint16_t input_y, + const uint16_t input_z, + const uint16_t input_w, + int8_t *output, + const uint16_t output_y, + const uint32_t offset_y); + +/** + * @brief int8/uint8 concatenation function to be used for concatenating N-tensors along the Z axis + * This function should be called for each input tensor to concatenate. The argument offset_z + * will be used to store the input tensor in the correct position in the output tensor + * + * i.e. offset_z = 0 + * for(i = 0 i < num_input_tensors; ++i) + * { + * arm_concatenation_s8_z(&input[i], ..., &output, ..., ..., offset_z) + * offset_z += input_z[i] + * } + * + * This function assumes that the output tensor has: + * -# The same width of the input tensor + * -# The same height of the input tensor + * -# The same batch size of the input tensor + * + * Unless specified otherwise, arguments are mandatory. + * + * @note This function, data layout independent, can be used to concatenate either int8 or uint8 tensors because it + * does not involve any arithmetic operation + * + * @param[in] input Pointer to input tensor. Input tensor must not overlap with output tensor. + * @param[in] input_x Width of input tensor + * @param[in] input_y Height of input tensor + * @param[in] input_z Channels in input tensor + * @param[in] input_w Batch size in input tensor + * @param[out] output Pointer to output tensor. Expected to be at least + * (input_x * input_y * input_z * input_w) + offset_z + * bytes. + * @param[in] output_z Channels in output tensor + * @param[in] offset_z The offset on the Z axis to start concatenating the input tensor + * It is user responsibility to provide the correct value + * + * Input constraints + * offset_z is less than output_z + * + */ +void arm_concatenation_s8_z(const int8_t *input, + const uint16_t input_x, + const uint16_t input_y, + const uint16_t input_z, + const uint16_t input_w, + int8_t *output, + const uint16_t output_z, + const uint32_t offset_z); + +/** + * @brief int8/uint8 concatenation function to be used for concatenating N-tensors along the W axis (Batch size) + * This function should be called for each input tensor to concatenate. The argument offset_w + * will be used to store the input tensor in the correct position in the output tensor + * + * i.e. offset_w = 0 + * for(i = 0 i < num_input_tensors; ++i) + * { + * arm_concatenation_s8_w(&input[i], ..., &output, ..., ..., offset_w) + * offset_w += input_w[i] + * } + * + * This function assumes that the output tensor has: + * -# The same width of the input tensor + * -# The same height of the input tensor + * -# The same number o channels of the input tensor + * + * Unless specified otherwise, arguments are mandatory. + * + * @note This function, data layout independent, can be used to concatenate either int8 or uint8 tensors because it + * does not involve any arithmetic operation + * + * @param[in] input Pointer to input tensor + * @param[in] input_x Width of input tensor + * @param[in] input_y Height of input tensor + * @param[in] input_z Channels in input tensor + * @param[in] input_w Batch size in input tensor + * @param[out] output Pointer to output tensor. Expected to be at least + * input_x * input_y * input_z * input_w + * bytes. + * @param[in] offset_w The offset on the W axis to start concatenating the input tensor + * It is user responsibility to provide the correct value + * + */ +void arm_concatenation_s8_w(const int8_t *input, + const uint16_t input_x, + const uint16_t input_y, + const uint16_t input_z, + const uint16_t input_w, + int8_t *output, + const uint32_t offset_w); +/** + * @defgroup SVDF SVDF Layer Functions + * + */ + +/** + * @brief s8 SVDF function with 8 bit state tensor and 8 bit time weights + * + * @param[in] input_ctx Temporary scratch buffer + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] output_ctx Temporary output scratch buffer + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] svdf_params SVDF Parameters + * Range of svdf_params->input_offset : [-128, 127] + * Range of svdf_params->output_offset : [-128, 127] + * @param[in] input_quant_params Input quantization parameters + * @param[in] output_quant_params Output quantization parameters + * @param[in] input_dims Input tensor dimensions + * @param[in] input_data Pointer to input tensor + * @param[in] state_dims State tensor dimensions + * @param[in] state_data Pointer to state tensor + * @param[in] weights_feature_dims Weights (feature) tensor dimensions + * @param[in] weights_feature_data Pointer to the weights (feature) tensor + * @param[in] weights_time_dims Weights (time) tensor dimensions + * @param[in] weights_time_data Pointer to the weights (time) tensor + * @param[in] bias_dims Bias tensor dimensions + * @param[in] bias_data Pointer to bias tensor + * @param[in] output_dims Output tensor dimensions + * @param[out] output_data Pointer to the output tensor + * + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + * @details + * 1. Supported framework: TensorFlow Lite micro + * 2. q7 is used as data type eventhough it is s8 data. It is done so to be consistent with existing APIs. + * + */ +arm_cmsis_nn_status arm_svdf_s8(const cmsis_nn_context *input_ctx, + const cmsis_nn_context *output_ctx, + const cmsis_nn_svdf_params *svdf_params, + const cmsis_nn_per_tensor_quant_params *input_quant_params, + const cmsis_nn_per_tensor_quant_params *output_quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *state_dims, + q7_t *state_data, + const cmsis_nn_dims *weights_feature_dims, + const q7_t *weights_feature_data, + const cmsis_nn_dims *weights_time_dims, + const q7_t *weights_time_data, + const cmsis_nn_dims *bias_dims, + const q31_t *bias_data, + const cmsis_nn_dims *output_dims, + q7_t *output_data); + +/** + * @brief s8 SVDF function with 16 bit state tensor and 16 bit time weights + * + * @param[in] input_ctx Temporary scratch buffer + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] output_ctx Temporary output scratch buffer + * The caller is expected to clear the buffer ,if applicable, for security reasons. + * @param[in] svdf_params SVDF Parameters + * Range of svdf_params->input_offset : [-128, 127] + * Range of svdf_params->output_offset : [-128, 127] + * @param[in] input_quant_params Input quantization parameters + * @param[in] output_quant_params Output quantization parameters + * @param[in] input_dims Input tensor dimensions + * @param[in] input_data Pointer to input tensor + * @param[in] state_dims State tensor dimensions + * @param[in] state_data Pointer to state tensor + * @param[in] weights_feature_dims Weights (feature) tensor dimensions + * @param[in] weights_feature_data Pointer to the weights (feature) tensor + * @param[in] weights_time_dims Weights (time) tensor dimensions + * @param[in] weights_time_data Pointer to the weights (time) tensor + * @param[in] bias_dims Bias tensor dimensions + * @param[in] bias_data Pointer to bias tensor + * @param[in] output_dims Output tensor dimensions + * @param[out] output_data Pointer to the output tensor + * + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + * @details + * 1. Supported framework: TensorFlow Lite micro + * 2. q7 is used as data type eventhough it is s8 data. It is done so to be consistent with existing APIs. + * + */ +arm_cmsis_nn_status arm_svdf_state_s16_s8(const cmsis_nn_context *input_ctx, + const cmsis_nn_context *output_ctx, + const cmsis_nn_svdf_params *svdf_params, + const cmsis_nn_per_tensor_quant_params *input_quant_params, + const cmsis_nn_per_tensor_quant_params *output_quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *state_dims, + q15_t *state_data, + const cmsis_nn_dims *weights_feature_dims, + const q7_t *weights_feature_data, + const cmsis_nn_dims *weights_time_dims, + const q15_t *weights_time_data, + const cmsis_nn_dims *bias_dims, + const q31_t *bias_data, + const cmsis_nn_dims *output_dims, + q7_t *output_data); #ifdef __cplusplus } diff --git a/edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h b/edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h index 3e2f941..232aa61 100644 --- a/edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h +++ b/edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -21,8 +21,8 @@ * Title: arm_nnsupportfunctions.h * Description: Public header file of support functions for CMSIS NN Library * - * $Date: 09. October 2020 - * $Revision: V.4.5.5 + * $Date: 8 August 2022 + * $Revision: V.10.0.0 * * Target Processor: Cortex-M CPUs * -------------------------------------------------------------------- */ @@ -30,8 +30,11 @@ #ifndef _ARM_NNSUPPORTFUNCTIONS_H_ #define _ARM_NNSUPPORTFUNCTIONS_H_ -#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_common_tables.h" -#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_math_types.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nn_math_types.h" +#include "edge-impulse-sdk/CMSIS/DSP/Include/dsp/none.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nn_types.h" + +#include #ifdef __cplusplus extern "C" { @@ -46,6 +49,27 @@ extern "C" { #define MAX(A, B) ((A) > (B) ? (A) : (B)) #define MIN(A, B) ((A) < (B) ? (A) : (B)) #define CLAMP(x, h, l) MAX(MIN((x), (h)), (l)) +#define REDUCE_MULTIPLIER(_mult) ((_mult < 0x7FFF0000) ? ((_mult + (1 << 15)) >> 16) : 0x7FFF) + +// Number of channels processed in a block for DW Conv(MVE) +// Requirement: Greater than 0 & less than 128 +// This can be fine tuned to match number of input channels for best performance. +// A layer with lower number of channels than CH_IN_BLOCK_MVE will result in higher +// scratch buffer usage and a layer with higher number of channels than CH_IN_BLOCK_MVE +// will result in lower scratch buffer usage. +#define CH_IN_BLOCK_MVE (124) + +/** + * @brief definition to pack four 8 bit values. + */ +#define PACK_Q7x4_32x1(v0, v1, v2, v3) \ + ((((int32_t)(v0) << 0) & (int32_t)0x000000FF) | (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \ + (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | (((int32_t)(v3) << 24) & (int32_t)0xFF000000)) + +/** + * @brief definition to pack two 16 bit values. + */ +#define PACK_Q15x2_32x1(v0, v1) (((int32_t)v0 & (int32_t)0xFFFF) | ((int32_t)v1 << 16)) /** * @brief Union for SIMD access of q31/q15/q7 types @@ -114,7 +138,6 @@ void arm_nn_add_q7(const q7_t *input, q31_t *output, uint32_t block_size); * @param[in] *pSrc points to the q7 input vector * @param[out] *pDst points to the q15 output vector * @param[in] blockSize length of the input vector - * @return none. * */ void arm_q7_to_q15_reordered_no_shift(const q7_t *pSrc, q15_t *pDst, uint32_t blockSize); @@ -143,7 +166,6 @@ void arm_q7_to_q15_with_offset(const q7_t *src, q15_t *dst, uint32_t block_size, * @param[out] dst pointer to the q15 output vector * @param[in] block_size length of the input vector * @param[in] offset offset to be added to each input vector element. - * @return none. * * @details This function does the q7 to q15 expansion with re-ordering of bytes. Re-ordering is a consequence of * the sign extension intrinsic(DSP extension). The tail (i.e., last (N % 4) elements) retains its @@ -236,58 +258,101 @@ q7_t *arm_nn_mat_mult_s8(const q7_t *input_row, const uint16_t row_len, const int32_t *const bias, q7_t *out); +/** + * @brief Matrix-multiplication function for convolution with per-channel requantization for 16 bits convolution. + * @param[in] input_a pointer to operand A + * @param[in] input_b pointer to operand B, always consists of 2 vectors. + * @param[in] output_ch number of rows of A + * @param[in] out_shift pointer to per output channel requantization shift parameter. + * @param[in] out_mult pointer to per output channel requantization multiplier parameter. + * @param[in] activation_min minimum value to clamp the output to. Range : int16 + * @param[in] activation_max maximum value to clamp the output to. Range : int16 + * @param[in] num_col_a number of columns of A + * @param[in] output_bias per output channel bias. Range : int64 + * @param[in,out] out_0 pointer to output + * @return The function returns one of the two + * 1. The incremented output pointer for a successful operation or + * 2. NULL if implementation is not available. + * + * @details This function does the matrix multiplication of weight matrix for all output channels + * with 2 columns from im2col and produces two elements/output_channel. The outputs are + * clamped in the range provided by activation min and max. + * Supported framework: TensorFlow Lite micro. + */ +q15_t *arm_nn_mat_mult_kernel_s16(const q7_t *input_a, + const q15_t *input_b, + const int32_t output_ch, + const int32_t *out_shift, + const int32_t *out_mult, + const int16_t activation_min, + const int16_t activation_max, + const int32_t num_col_a, + const int64_t *const output_bias, + q15_t *out_0); /** - * @brief General Matrix-multiplication without requantization for one row & one column - * @param[in] row_elements number of row elements - * @param[in] row_base pointer to row operand - * @param[in] col_base pointer to col operand - * @param[out] sum_col pointer to store sum of column elements - * @param[out] output pointer to store result of multiply-accumulate - * @return The function returns the multiply-accumulated result of the row by column. + * @brief General Vector by Matrix multiplication with requantization and storage of result. + * @param[in] row_elements number of row elements + * @param[in] skipped_row_elements number of row elements skipped due to padding. + * row_elements + skipped_row_elements = (kernel_x * kernel_y) * input_ch + * @param[in] row_base_ref pointer to row operand + * @param[in] col_base_ref pointer to col operand + * @param[out] out_ch Number of output channels + * @param[in] conv_params Pointer to convolution parameters like offsets and activation values + * @param[in] quant_params Pointer to per-channel quantization parameters + * @param[in] bias Pointer to optional per-channel bias + * @param[out] output Pointer to output where int8 results are stored. + * @return The function performs matrix(row_base_ref) multiplication with vector(col_base_ref) and + * scaled result is stored in memory. * * @details Pseudo-code * *output = 0 * sum_col = 0 + * for (j = 0; j < out_ch; j++) * for (i = 0; i < row_elements; i++) - * *output += row_base[i] * col_base[i] - * sum_col += col_base[i] + * *output += row_base_ref[i] * col_base_ref[i] + * sum_col += col_base_ref[i] + * scale sum_col using quant_params and bias + * store result in 'output' + * * */ -arm_status arm_nn_mat_mul_core_1x_s8(int32_t row_elements, - const int8_t *row_base, - const int8_t *col_base, - int32_t *const sum_col, - int32_t *const output); +arm_cmsis_nn_status arm_nn_mat_mul_core_1x_s8(int32_t row_elements, + const int32_t skipped_row_elements, + const int8_t *row_base_ref, + const int8_t *col_base_ref, + const int32_t out_ch, + const cmsis_nn_conv_params *conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const int32_t *bias, + int8_t *output); /** - * @brief General Matrix-multiplication without requantization for four rows and one column + * @brief Matrix-multiplication with requantization & activation function for four rows and one column * @param[in] row_elements number of row elements * @param[in] offset offset between rows. Can be the same as row_elements. * For e.g, in a 1x1 conv scenario with stride as 1. * @param[in] row_base pointer to row operand * @param[in] col_base pointer to col operand - * @param[out] sum_col pointer to store sum of column elements - * @param[out] output pointer to store result(4 int32's) of multiply-accumulate - * @return The function returns the multiply-accumulated result of the row by column + * @param[in] out_ch Number of output channels + * @param[in] conv_params Pointer to convolution parameters like offsets and activation values + * @param[in] quant_params Pointer to per-channel quantization parameters + * @param[in] bias Pointer to per-channel bias + * @param[out] output Pointer to output where int8 results are stored. * - * @details Pseudo-code - * output[0] = 0 - * .. - * output[3] = 0 - * sum_col = 0 - * for (i = 0; i < row_elements; i++) - * output[0] += row_base[i] * col_base[i] - * .. - * output[3] += row_base[i + (row_elements * 3)] * col_base[i] - * sum_col += col_base[i] + * @return The function returns the updated output pointer or NULL if implementation is not available. + * + * @details Compliant to TFLM int8 specification. MVE implementation only */ -arm_status arm_nn_mat_mul_core_4x_s8(const int32_t row_elements, - const int32_t offset, - const int8_t *row_base, - const int8_t *col_base, - int32_t *const sum_col, - int32_t *const output); +int8_t *arm_nn_mat_mul_core_4x_s8(const int32_t row_elements, + const int32_t offset, + const int8_t *row_base, + const int8_t *col_base, + const int32_t out_ch, + const cmsis_nn_conv_params *conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const int32_t *bias, + int8_t *output); /** * @brief General Matrix-multiplication function with per-channel requantization. @@ -315,22 +380,22 @@ arm_status arm_nn_mat_mul_core_4x_s8(const int32_t row_elements, * @param[in] activation_min Minimum value to clamp down the output. Range : int8 * @param[in] activation_max Maximum value to clamp up the output. Range : int8 * - * @return The function returns ARM_MATH_SUCCESS + * @return The function returns ARM_CMSIS_NN_SUCCESS * */ -arm_status arm_nn_mat_mult_nt_t_s8(const q7_t *lhs, - const q7_t *rhs, - const q31_t *bias, - q7_t *dst, - const int32_t *dst_multipliers, - const int32_t *dst_shifts, - const int32_t lhs_rows, - const int32_t rhs_rows, - const int32_t rhs_cols, - const int32_t lhs_offset, - const int32_t dst_offset, - const int32_t activation_min, - const int32_t activation_max); +arm_cmsis_nn_status arm_nn_mat_mult_nt_t_s8(const q7_t *lhs, + const q7_t *rhs, + const q31_t *bias, + q7_t *dst, + const int32_t *dst_multipliers, + const int32_t *dst_shifts, + const int32_t lhs_rows, + const int32_t rhs_rows, + const int32_t rhs_cols, + const int32_t lhs_offset, + const int32_t dst_offset, + const int32_t activation_min, + const int32_t activation_max); /** * @brief s8 Vector by Matrix (transposed) multiplication @@ -341,8 +406,7 @@ arm_status arm_nn_mat_mult_nt_t_s8(const q7_t *lhs, * @param[out] dst Output vector * @param[in] lhs_offset Offset to be added to the input values of the left-hand side vector. * Range: -127 to 128 - * @param[in] rhs_offset Offset to be added to the input values of the right-hand side matrix. - * Range: -127 to 128 + * @param[in] rhs_offset Not used * @param[in] dst_offset Offset to be added to the output values. Range: -127 to 128 * @param[in] dst_multiplier Output multiplier * @param[in] dst_shift Output shift @@ -350,23 +414,88 @@ arm_status arm_nn_mat_mult_nt_t_s8(const q7_t *lhs, * @param[in] rhs_rows Number of rows in the right-hand side input matrix * @param[in] activation_min Minimum value to clamp the output to. Range: int8 * @param[in] activation_max Maximum value to clamp the output to. Range: int8 + * @param[in] address_offset Memory position offset for dst. First output is stored at 'dst', the + * second at 'dst + address_offset' and so on. Default value is typically 1. * - * @return The function returns ARM_MATH_SUCCESS + * @return The function returns ARM_CMSIS_NN_SUCCESS * */ -arm_status arm_nn_vec_mat_mult_t_s8(const q7_t *lhs, - const q7_t *rhs, - const q31_t *bias, - q7_t *dst, - const int32_t lhs_offset, - const int32_t rhs_offset, - const int32_t dst_offset, - const int32_t dst_multiplier, - const int32_t dst_shift, - const int32_t rhs_cols, - const int32_t rhs_rows, - const int32_t activation_min, - const int32_t activation_max); +arm_cmsis_nn_status arm_nn_vec_mat_mult_t_s8(const q7_t *lhs, + const q7_t *rhs, + const q31_t *bias, + q7_t *dst, + const int32_t lhs_offset, + const int32_t rhs_offset, + const int32_t dst_offset, + const int32_t dst_multiplier, + const int32_t dst_shift, + const int32_t rhs_cols, + const int32_t rhs_rows, + const int32_t activation_min, + const int32_t activation_max, + const int32_t address_offset); + +/** + * @brief s16 Vector by Matrix (transposed) multiplication + * + * @param[in] lhs Input left-hand side vector + * @param[in] rhs Input right-hand side matrix (transposed) + * @param[in] bias Input bias + * @param[out] dst Output vector + * @param[in] dst_multiplier Output multiplier + * @param[in] dst_shift Output shift + * @param[in] rhs_cols Number of columns in the right-hand side input matrix + * @param[in] rhs_rows Number of rows in the right-hand side input matrix + * @param[in] activation_min Minimum value to clamp the output to. Range: int16 + * @param[in] activation_max Maximum value to clamp the output to. Range: int16 + * + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + */ +arm_cmsis_nn_status arm_nn_vec_mat_mult_t_s16(const q15_t *lhs, + const q7_t *rhs, + const q63_t *bias, + q15_t *dst, + const int32_t dst_multiplier, + const int32_t dst_shift, + const int32_t rhs_cols, + const int32_t rhs_rows, + const int32_t activation_min, + const int32_t activation_max); + +/** + * @brief s8 Vector by Matrix (transposed) multiplication with s16 output + * + * @param[in] lhs Input left-hand side vector + * @param[in] rhs Input right-hand side matrix (transposed) + * @param[out] dst Output vector + * @param[in] lhs_offset Offset to be added to the input values of the left-hand side + * vector. Range: -127 to 128 + * @param[in] rhs_offset Not used + * @param[in] scatter_offset Address offset for dst. First output is stored at 'dst', the + * second at 'dst + scatter_offset' and so on. + * @param[in] dst_multiplier Output multiplier + * @param[in] dst_shift Output shift + * @param[in] rhs_cols Number of columns in the right-hand side input matrix + * @param[in] rhs_rows Number of rows in the right-hand side input matrix + * @param[in] activation_min Minimum value to clamp the output to. Range: int16 + * @param[in] activation_max Maximum value to clamp the output to. Range: int16 + * + * @return The function returns ARM_CMSIS_NN_SUCCESS + * + */ +arm_cmsis_nn_status arm_nn_vec_mat_mult_t_svdf_s8(const q7_t *lhs, + const q7_t *rhs, + q15_t *dst, + const int32_t lhs_offset, + const int32_t rhs_offset, + const int32_t scatter_offset, + const int32_t dst_multiplier, + const int32_t dst_shift, + const int32_t rhs_cols, + const int32_t rhs_rows, + const int32_t activation_min, + const int32_t activation_max); /** * @brief Depthwise convolution of transposed rhs matrix with 4 lhs matrices. To be used in padded cases where @@ -375,7 +504,8 @@ arm_status arm_nn_vec_mat_mult_t_s8(const q7_t *lhs, * @param[in] lhs Input left-hand side matrix * @param[in] rhs Input right-hand side matrix (transposed) * @param[in] lhs_offset LHS matrix offset(input offset). Range: -127 to 128 - * @param[in] num_ch Number of channels in LHS/RHS + * @param[in] active_ch Subset of total_ch processed + * @param[in] total_ch Number of channels in LHS/RHS * @param[in] out_shift Per channel output shift. Length of vector is equal to number of channels * @param[in] out_mult Per channel output multiplier. Length of vector is equal to number of channels * @param[in] out_offset Offset to be added to the output values. Range: -127 to 128 @@ -386,7 +516,7 @@ arm_status arm_nn_vec_mat_mult_t_s8(const q7_t *lhs, * @param[in] out Output pointer * * @return The function returns one of the two - * - Updated output pointer if an implementaiton is available + * - Updated output pointer if an implementation is available * - NULL if no implementation is available. * * @note If number of channels is not a multiple of 4, upto 3 elements outside the boundary will be read @@ -396,18 +526,19 @@ arm_status arm_nn_vec_mat_mult_t_s8(const q7_t *lhs, * - Output bias * - rhs */ -q7_t *arm_nn_depthwise_conv_nt_t_padded_s8(const q7_t *lhs, - const q7_t *rhs, - const int32_t lhs_offset, - const uint16_t num_ch, - const int32_t *out_shift, - const int32_t *out_mult, - const int32_t out_offset, - const int32_t activation_min, - const int32_t activation_max, - const uint16_t row_x_col, - const int32_t *const output_bias, - q7_t *out); +arm_cmsis_nn_status arm_nn_depthwise_conv_nt_t_padded_s8(const q7_t *lhs, + const q7_t *rhs, + const int32_t lhs_offset, + const int32_t active_ch, + const int32_t total_ch, + const int32_t *out_shift, + const int32_t *out_mult, + const int32_t out_offset, + const int32_t activation_min, + const int32_t activation_max, + const uint16_t row_x_col, + const int32_t *const output_bias, + q7_t *out); /** * @brief Depthwise convolution of transposed rhs matrix with 4 lhs matrices. To be used in non-padded cases. @@ -416,7 +547,8 @@ q7_t *arm_nn_depthwise_conv_nt_t_padded_s8(const q7_t *lhs, * @param[in] lhs Input left-hand side matrix * @param[in] rhs Input right-hand side matrix (transposed) * @param[in] lhs_offset LHS matrix offset(input offset). Range: -127 to 128 - * @param[in] num_ch Number of channels in LHS/RHS + * @param[in] active_ch Subset of total_ch processed + * @param[in] total_ch Number of channels in LHS/RHS * @param[in] out_shift Per channel output shift. Length of vector is equal to number of channels. * @param[in] out_mult Per channel output multiplier. Length of vector is equal to number of channels. * @param[in] out_offset Offset to be added to the output values. Range: -127 to 128 @@ -427,7 +559,7 @@ q7_t *arm_nn_depthwise_conv_nt_t_padded_s8(const q7_t *lhs, * @param[in] out Output pointer * * @return The function returns one of the two - * - Updated output pointer if an implementaiton is available + * - Updated output pointer if an implementation is available * - NULL if no implementation is available. * * @note If number of channels is not a multiple of 4, upto 3 elements outside the boundary will be read @@ -437,18 +569,79 @@ q7_t *arm_nn_depthwise_conv_nt_t_padded_s8(const q7_t *lhs, * - Output bias * - rhs */ -q7_t *arm_nn_depthwise_conv_nt_t_s8(const q7_t *lhs, - const q7_t *rhs, - const int32_t lhs_offset, - const uint16_t num_ch, - const int32_t *out_shift, - const int32_t *out_mult, - const int32_t out_offset, - const int32_t activation_min, - const int32_t activation_max, - const uint16_t row_x_col, - const int32_t *const output_bias, - q7_t *out); +arm_cmsis_nn_status arm_nn_depthwise_conv_nt_t_s8(const q7_t *lhs, + const q7_t *rhs, + const int32_t lhs_offset, + const int32_t active_ch, + const int32_t total_ch, + const int32_t *out_shift, + const int32_t *out_mult, + const int32_t out_offset, + const int32_t activation_min, + const int32_t activation_max, + const uint16_t row_x_col, + const int32_t *const output_bias, + q7_t *out); + +/** + * @brief Depthwise convolution of transposed rhs matrix with 4 lhs matrices. To be used in non-padded cases. + * Dimensions are the same for lhs and rhs. + * + * @param[in] lhs Input left-hand side matrix + * @param[in] rhs Input right-hand side matrix (transposed) + * @param[in] num_ch Number of channels in LHS/RHS + * @param[in] out_shift Per channel output shift. Length of vector is equal to number of channels. + * @param[in] out_mult Per channel output multiplier. Length of vector is equal to number of channels. + * @param[in] activation_min Minimum value to clamp the output to. Range: int8 + * @param[in] activation_max Maximum value to clamp the output to. Range: int8 + * @param[in] row_x_col (row_dimension * col_dimension) of LHS/RHS matrix + * @param[in] output_bias Per channel output bias. Length of vector is equal to number of channels. + * @param[in] out Output pointer + * + * @return The function returns one of the two + * - Updated output pointer if an implementation is available + * - NULL if no implementation is available. + * + * @note If number of channels is not a multiple of 4, upto 3 elements outside the boundary will be read + * out for the following. + * - Output shift + * - Output multiplier + * - Output bias + * - rhs + */ +int16_t *arm_nn_depthwise_conv_nt_t_s16(const int16_t *lhs, + const q7_t *rhs, + const uint16_t num_ch, + const int32_t *out_shift, + const int32_t *out_mult, + const int32_t activation_min, + const int32_t activation_max, + const uint16_t row_x_col, + const int64_t *const output_bias, + int16_t *out); + +/** + *@brief Matrix-multiplication function for convolution with reordered columns + *@param[in] pA pointer to operand A + *@param[in] pInBuffer pointer to operand B, always conssists of 2 vectors + *@param[in] ch_im_out numRow of A + *@param[in] numCol_A numCol of A + *@param[in] bias_shift amount of left-shift for bias + *@param[in] out_shift amount of right-shift for output + *@param[in] bias the bias + *@param[in,out] pOut pointer to output + *@return The function returns the incremented output pointer + * + *@details This function assumes that data in pInBuffer are reordered + */ +q7_t *arm_nn_mat_mult_kernel_q7_q15_reordered(const q7_t *pA, + const q15_t *pInBuffer, + const uint16_t ch_im_out, + const uint16_t numCol_A, + const uint16_t bias_shift, + const uint16_t out_shift, + const q7_t *bias, + q7_t *pOut); /** @brief Read 2 q15 elements and post increment pointer. @@ -505,6 +698,17 @@ __STATIC_FORCEINLINE q31_t arm_nn_read_q7x4(const q7_t *in_q7) return (val); } +/** + @brief Write four q7 to q7 pointer and increment pointer afterwards. + @param[in] in Double pointer to input value + @param[in] value Four bytes to copy + */ +__STATIC_FORCEINLINE void arm_nn_write_q7x4_ia(q7_t **in, q31_t value) +{ + memcpy(*in, &value, 4); + *in += 4; +} + /** * @brief memset optimized for MVE * @param[in, out] dst Destination pointer @@ -518,11 +722,11 @@ __STATIC_FORCEINLINE void arm_memset_q7(q7_t *dst, const q7_t val, uint32_t bloc __asm volatile(" vdup.8 q0, %[set_val] \n" " wlstp.8 lr, %[cnt], 1f \n" "2: \n" - " vstrb.8 q0, [%[in]], 16 \n" + " vstrb.8 q0, [%[in]], #16 \n" " letp lr, 2b \n" "1: \n" - : [ in ] "+r"(dst) - : [ cnt ] "r"(block_size), [ set_val ] "r"(val) + : [in] "+r"(dst) + : [cnt] "r"(block_size), [set_val] "r"(val) : "q0", "memory", "r14"); #else memset(dst, val, block_size); @@ -538,7 +742,7 @@ __STATIC_FORCEINLINE void arm_memset_q7(q7_t *dst, const q7_t val, uint32_t bloc __STATIC_FORCEINLINE const q7_t *read_and_pad(const q7_t *source, q31_t *out1, q31_t *out2) { q31_t inA = arm_nn_read_q7x4_ia(&source); - q31_t inAbuf1 = __SXTB16(__ROR((uint32_t)inA, 8)); + q31_t inAbuf1 = __SXTB16_RORn((uint32_t)inA, 8); q31_t inAbuf2 = __SXTB16(inA); #ifndef ARM_MATH_BIG_ENDIAN @@ -607,7 +811,6 @@ read_and_pad_reordered_with_offset(const q7_t *source, q31_t *out1, q31_t *out2, * @param[out] *pDst pointer to the output vector * @param[in] out_shift amount of right-shift for output * @param[in] blockSize number of samples in each vector - * @return none. * * Scaling and Overflow Behavior: * \par @@ -624,7 +827,6 @@ void arm_nn_mult_q15(q15_t *pSrcA, q15_t *pSrcB, q15_t *pDst, const uint16_t out * @param[out] *pDst pointer to the output vector * @param[in] out_shift amount of right-shift for output * @param[in] blockSize number of samples in each vector - * @return none. * * Scaling and Overflow Behavior: * \par @@ -634,11 +836,69 @@ void arm_nn_mult_q15(q15_t *pSrcA, q15_t *pSrcB, q15_t *pDst, const uint16_t out void arm_nn_mult_q7(q7_t *pSrcA, q7_t *pSrcB, q7_t *pDst, const uint16_t out_shift, uint32_t blockSize); +/** + * @brief Matrix-multiplication function for convolution with per-channel requantization. + * @param[in] input_a pointer to operand A + * @param[in] input_b pointer to operand B, always consists of 2 vectors. + * @param[in] output_ch number of rows of A + * @param[in] out_shift pointer to per output channel requantization shift parameter. + * @param[in] out_mult pointer to per output channel requantization multiplier parameter. + * @param[in] out_offset output tensor offset. + * @param[in] activation_min minimum value to clamp the output to. Range : int8 + * @param[in] activation_max maximum value to clamp the output to. Range : int8 + * @param[in] num_col_a number of columns of A + * @param[in] output_bias per output channel bias. Range : int32 + * @param[in,out] out_0 pointer to output + * @return The function returns one of the two + * 1. The incremented output pointer for a successful operation or + * 2. NULL if implementation is not available. + * + * @details This function does the matrix multiplication of weight matrix for all output channels + * with 2 columns from im2col and produces two elements/output_channel. The outputs are + * clamped in the range provided by activation min and max. + * Supported framework: TensorFlow Lite micro. + */ +q7_t *arm_nn_mat_mult_kernel_s8_s16(const q7_t *input_a, + const q15_t *input_b, + const uint16_t output_ch, + const int32_t *out_shift, + const int32_t *out_mult, + const int32_t out_offset, + const int16_t activation_min, + const int16_t activation_max, + const uint16_t num_col_a, + const int32_t *const output_bias, + q7_t *out_0); + +/** + * @brief Common softmax function for s8 input and s8 or s16 output + * @param[in] input Pointer to the input tensor + * @param[in] num_rows Number of rows in the input tensor + * @param[in] row_size Number of elements in each input row + * @param[in] mult Input quantization multiplier + * @param[in] shift Input quantization shift within the range [0, 31] + * @param[in] diff_min Minimum difference with max in row. Used to check if + * the quantized exponential operation can be performed + * @param[in] int16_output Indicating s8 output if 0 else s16 output + * @param[out] output Pointer to the output tensor + * + * @note Supported framework: TensorFlow Lite micro (bit-accurate) + * + */ +void arm_nn_softmax_common_s8(const int8_t *input, + const int32_t num_rows, + const int32_t row_size, + const int32_t mult, + const int32_t shift, + const int32_t diff_min, + const bool int16_output, + void *output); + /** * @brief macro for adding rounding offset */ #ifndef ARM_NN_TRUNCATE -#define NN_ROUND(out_shift) ((0x1u << out_shift) >> 1) +#define NN_ROUND(out_shift) ((0x1 << out_shift) >> 1) #else #define NN_ROUND(out_shift) 0 #endif @@ -663,8 +923,8 @@ void arm_nn_mult_q7(q7_t *pSrcA, q7_t *pSrcB, q7_t *pDst, const uint16_t out_shi /** * @brief Saturating doubling high multiply. Result matches * NEON instruction VQRDMULH. - * @param[in] m1 Multiplicand. Range: {Q31_MIN, Q31_MAX} - * @param[in] m2 Multiplier. Range: {Q31_MIN, Q31_MAX} + * @param[in] m1 Multiplicand. Range: {NN_Q31_MIN, NN_Q31_MAX} + * @param[in] m2 Multiplier. Range: {NN_Q31_MIN, NN_Q31_MAX} * @return Result of multiplication. * */ @@ -685,9 +945,9 @@ __STATIC_FORCEINLINE q31_t arm_nn_doubling_high_mult(const q31_t m1, const q31_t // as well. result = (int32_t)(mult / (1ll << 31)); - if ((m1 == m2) && (m1 == (int32_t)Q31_MIN)) + if ((m1 == m2) && (m1 == (int32_t)NN_Q31_MIN)) { - result = Q31_MAX; + result = NN_Q31_MAX; } return result; } @@ -696,13 +956,13 @@ __STATIC_FORCEINLINE q31_t arm_nn_doubling_high_mult(const q31_t m1, const q31_t * @brief Doubling high multiply without saturation. This is intended * for requantization where the scale is a positive integer * - * @param[in] m1 Multiplicand. Range: {Q31_MIN, Q31_MAX} - * @param[in] m2 Multiplier Range: {Q31_MIN, Q31_MAX} + * @param[in] m1 Multiplicand. Range: {NN_Q31_MIN, NN_Q31_MAX} + * @param[in] m2 Multiplier Range: {NN_Q31_MIN, NN_Q31_MAX} * @return Result of multiplication. * @note The result of this matches that of neon instruction - * VQRDMULH for m1 in range {Q31_MIN, Q31_MAX} and m2 in - * range {Q31_MIN + 1, Q31_MAX}. Saturation occurs when - * m1 equals m2 equals Q31_MIN and that is not handled by + * VQRDMULH for m1 in range {NN_Q31_MIN, NN_Q31_MAX} and m2 in + * range {NN_Q31_MIN + 1, NN_Q31_MAX}. Saturation occurs when + * m1 equals m2 equals NN_Q31_MIN and that is not handled by * this function. * */ @@ -759,7 +1019,7 @@ __STATIC_FORCEINLINE q31_t arm_nn_divide_by_power_of_two(const q31_t dividend, c /** * @brief Requantize a given value. * @param[in] val Value to be requantized - * @param[in] multiplier multiplier. Range {Q31_MIN + 1, Q32_MAX} + * @param[in] multiplier multiplier. Range {NN_Q31_MIN + 1, Q32_MAX} * @param[in] shift left or right shift for 'val * multiplier' * * @return Returns (val * multiplier)/(2 ^ shift) @@ -767,8 +1027,38 @@ __STATIC_FORCEINLINE q31_t arm_nn_divide_by_power_of_two(const q31_t dividend, c */ __STATIC_FORCEINLINE q31_t arm_nn_requantize(const q31_t val, const q31_t multiplier, const q31_t shift) { +#ifdef CMSIS_NN_USE_SINGLE_ROUNDING + const int64_t total_shift = 31 - shift; + const int64_t new_val = val * (int64_t)multiplier; + + int32_t result = new_val >> (total_shift - 1); + result = (result + 1) >> 1; + + return result; +#else return arm_nn_divide_by_power_of_two(arm_nn_doubling_high_mult_no_sat(val * (1 << LEFT_SHIFT(shift)), multiplier), RIGHT_SHIFT(shift)); +#endif +} + +/** + * @brief Requantize a given 64 bit value. + * @param[in] val Value to be requantized in the range {-(1<<47)} to {(1<<47) - 1} + * @param[in] reduced_multiplier Reduced multiplier in the range {NN_Q31_MIN + 1, Q32_MAX} to {Q16_MIN + 1, + * Q16_MAX} + * @param[in] shift Left or right shift for 'val * multiplier' in the range {-31} to {7} + * + * @return Returns (val * multiplier)/(2 ^ shift) + * + */ +__STATIC_FORCEINLINE q31_t arm_nn_requantize_s64(const q63_t val, const q31_t reduced_multiplier, const q31_t shift) +{ + const q63_t new_val = val * reduced_multiplier; + + q31_t result = new_val >> (14 - shift); // 64->32 bit reduction + result = (result + 1) >> 1; // Last shift position and insert round + + return result; } /** @@ -783,18 +1073,30 @@ __STATIC_FORCEINLINE void arm_memcpy_q7(q7_t *__RESTRICT dst, const q7_t *__REST #if defined(ARM_MATH_MVEI) __asm volatile(" wlstp.8 lr, %[cnt], 1f \n" "2: \n" - " vldrb.8 q0, [%[in]], 16 \n" - " vstrb.8 q0, [%[out]], 16 \n" + " vldrb.8 q0, [%[in]], #16 \n" + " vstrb.8 q0, [%[out]], #16 \n" " letp lr, 2b \n" "1: \n" - : [ in ] "+r"(src), [ out ] "+r"(dst) - : [ cnt ] "r"(block_size) + : [in] "+r"(src), [out] "+r"(dst) + : [cnt] "r"(block_size) : "q0", "memory", "r14"); #else memcpy(dst, src, block_size); #endif } +/** + * @brief memcpy wrapper for int16 + * @param[in, out] dst Destination pointer + * @param[in] src Source pointer. + * @param[in] block_size Number of bytes to copy. + * + */ +__STATIC_FORCEINLINE void arm_memcpy_q15(q15_t *__RESTRICT dst, const q15_t *__RESTRICT src, uint32_t block_size) +{ + memcpy(dst, src, block_size); +} + #if defined(ARM_MATH_MVEI) /** * @brief Vector saturating doubling high multiply returning high half. @@ -835,8 +1137,21 @@ __STATIC_FORCEINLINE int32x4_t arm_divide_by_power_of_two_mve(const int32x4_t di */ __STATIC_FORCEINLINE int32x4_t arm_requantize_mve(const int32x4_t val, const q31_t multiplier, const q31_t shift) { +#ifdef CMSIS_NN_USE_SINGLE_ROUNDING + const int right_shift = MIN(-1, shift); + const int left_shift = shift - right_shift; + + const int32x4_t left_shift_dup = vdupq_n_s32(left_shift); + const int32x4_t right_shift_dup = vdupq_n_s32(right_shift); + + int32x4_t result = vqdmulhq_n_s32(vshlq_s32(val, left_shift_dup), multiplier); + result = vrshlq_s32(result, right_shift_dup); + + return result; +#else return arm_divide_by_power_of_two_mve( arm_doubling_high_mult_mve(vshlq_s32(val, vdupq_n_s32(LEFT_SHIFT(shift))), multiplier), RIGHT_SHIFT(shift)); +#endif } __STATIC_FORCEINLINE int32x4_t arm_doubling_high_mult_mve_32x4(const int32x4_t m1, const int32x4_t m2) @@ -856,6 +1171,15 @@ __STATIC_FORCEINLINE int32x4_t arm_requantize_mve_32x4(const int32x4_t val, const int32x4_t multiplier, const int32x4_t shift) { +#ifdef CMSIS_NN_USE_SINGLE_ROUNDING + const int32x4_t right_shift = vminq_s32(vdupq_n_s32(-1), shift); + const int32x4_t left_shift = vqsubq_s32(shift, right_shift); + + int32x4_t result = vqdmulhq_s32(vshlq_s32(val, left_shift), multiplier); + result = vrshlq_s32(result, right_shift); + + return result; +#else const int32x4_t zz = vdupq_n_s32(0); const mve_pred16_t p = vcmpgtq_n_s32(shift, 0); @@ -864,6 +1188,7 @@ __STATIC_FORCEINLINE int32x4_t arm_requantize_mve_32x4(const int32x4_t val, return arm_divide_by_power_of_two_mve_32x4(arm_doubling_high_mult_mve_32x4(vshlq_s32(val, left_shift), multiplier), right_shift); +#endif } #endif @@ -899,21 +1224,21 @@ __STATIC_FORCEINLINE int32_t arm_nn_exp_on_negative_values(int32_t val) #undef SELECT_IF_NON_ZERO mask = MASK_IF_ZERO(val); - return SELECT_USING_MASK(mask, Q31_MAX, result); + return SELECT_USING_MASK(mask, NN_Q31_MAX, result); } __STATIC_FORCEINLINE q31_t arm_nn_mult_by_power_of_two(const int32_t val, const int32_t exp) { const int32_t thresh = ((1 << (31 - exp)) - 1); int32_t result = val << exp; - result = SELECT_USING_MASK(MASK_IF_NON_ZERO(val > thresh), Q31_MAX, result); - result = SELECT_USING_MASK(MASK_IF_NON_ZERO(val < -thresh), Q31_MIN, result); + result = SELECT_USING_MASK(MASK_IF_NON_ZERO(val > thresh), NN_Q31_MAX, result); + result = SELECT_USING_MASK(MASK_IF_NON_ZERO(val < -thresh), NN_Q31_MIN, result); return result; } __STATIC_FORCEINLINE int32_t arm_nn_one_over_one_plus_x_for_x_in_0_1(int32_t val) { - const int64_t sum = (int64_t)val + (int64_t)Q31_MAX; + const int64_t sum = (int64_t)val + (int64_t)NN_Q31_MAX; const int32_t half_denominator = (int32_t)((sum + (sum >= 0 ? 1 : -1)) / 2L); int32_t x = 1515870810 + MUL_SAT(half_denominator, -1010580540); @@ -929,7 +1254,6 @@ __STATIC_FORCEINLINE int32_t arm_nn_one_over_one_plus_x_for_x_in_0_1(int32_t val @brief Write 2 q15 elements and post increment pointer. @param[in] dest_q15 Pointer to pointer that holds address of destination. @param[in] src_q31 Input value to be written. - @return none */ __STATIC_FORCEINLINE void arm_nn_write_q15x2_ia(q15_t **dest_q15, q31_t src_q31) { diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ActivationFunctions/arm_nn_activations_q7.c b/edge-impulse-sdk/CMSIS/NN/Source/ActivationFunctions/arm_nn_activations_q7.c index aedf55b..874f766 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ActivationFunctions/arm_nn_activations_q7.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ActivationFunctions/arm_nn_activations_q7.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2020, 2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_nn_activations_q7.c * Description: Q7 neural network activation function using direct table look-up * - * $Date: 09. October 2020 - * $Revision: V.1.0.1 + * $Date: 4 Aug 2022 + * $Revision: V.1.0.2 * * Target Processor: Cortex-M cores * @@ -42,20 +42,11 @@ * @{ */ -/** - * @brief Q7 neural network activation function using direct table look-up - * @param[in,out] data pointer to input - * @param[in] size number of elements - * @param[in] int_width bit-width of the integer part, assume to be smaller than 3 - * @param[in] type type of activation functions - * - * @details +/* + * Q7 neural network activation function using direct table look-up * - * This is the direct table look-up approach. + * Refer header file for details. * - * Assume here the integer part of the fixed-point is <= 3. - * More than 3 just not making much sense, makes no difference with - * saturation followed by any of these activation functions. */ void arm_nn_activations_direct_q7(q7_t *data, uint16_t size, uint16_t int_width, arm_nn_activation_type type) diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ActivationFunctions/arm_relu_q15.c b/edge-impulse-sdk/CMSIS/NN/Source/ActivationFunctions/arm_relu_q15.c index b408d2d..93ff722 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ActivationFunctions/arm_relu_q15.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ActivationFunctions/arm_relu_q15.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_relu_q15.c * Description: Q15 version of ReLU * - * $Date: 09. October 2020 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.1.0.3 * * Target Processor: Cortex-M cores * @@ -42,21 +42,17 @@ * @{ */ -/** - * @brief Q15 RELU function - * @param[in,out] data pointer to input - * @param[in] size number of elements - * - * @details +/* + * Q15 ReLu function * - * Optimized relu with QSUB instructions. + * Refer header file for details. * */ void arm_relu_q15(q15_t *data, uint16_t size) { -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for M cores with DSP extension */ uint16_t i = size >> 1; @@ -68,7 +64,7 @@ void arm_relu_q15(q15_t *data, uint16_t size) while (i) { - in = read_q15x2_ia(&input); + in = arm_nn_read_q15x2_ia((const q15_t **)&input); /* extract the first bit */ buf = __ROR(in & 0x80008000, 15); diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ActivationFunctions/arm_relu_q7.c b/edge-impulse-sdk/CMSIS/NN/Source/ActivationFunctions/arm_relu_q7.c index beb00fd..029b39a 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ActivationFunctions/arm_relu_q7.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ActivationFunctions/arm_relu_q7.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_relu_q7.c * Description: Q7 version of ReLU * - * $Date: 09. October 2020 - * $Revision: V.1.0.3 + * $Date: 4 Aug 2022 + * $Revision: V.1.1.4 * * Target Processor: Cortex-M cores * @@ -42,21 +42,17 @@ * @{ */ -/** - * @brief Q7 RELU function - * @param[in,out] data pointer to input - * @param[in] size number of elements - * - * @details +/* + * Q7 ReLu function * - * Optimized relu with QSUB instructions. + * Refer header file for details. * */ void arm_relu_q7(q7_t *data, uint16_t size) { -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for M cores with DSP extension */ uint16_t i = size >> 2; @@ -68,7 +64,7 @@ void arm_relu_q7(q7_t *data, uint16_t size) while (i) { - in = read_q7x4_ia(&input); + in = arm_nn_read_q7x4_ia((const q7_t **)&input); /* extract the first bit */ buf = (int32_t)__ROR((uint32_t)in & 0x80808080, 7); @@ -76,7 +72,7 @@ void arm_relu_q7(q7_t *data, uint16_t size) /* if MSB=1, mask will be 0xFF, 0x0 otherwise */ mask = __QSUB8(0x00000000, buf); - write_q7x4_ia(&output, in & (~mask)); + arm_nn_write_q7x4_ia(&output, in & (~mask)); i--; } diff --git a/edge-impulse-sdk/CMSIS/NN/Source/BasicMathFunctions/arm_elementwise_add_s16.c b/edge-impulse-sdk/CMSIS/NN/Source/BasicMathFunctions/arm_elementwise_add_s16.c new file mode 100644 index 0000000..7fbb104 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/BasicMathFunctions/arm_elementwise_add_s16.c @@ -0,0 +1,140 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * Copyright (C) 2022 Arm Limited or its affiliates. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_elementwise_add_s16 + * Description: Elementwise add + * + * $Date: 10 May 2022 + * $Revision: V.2.1.0 + * + * Target Processor: Cortex-M CPUs + * + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" + +/** + * @ingroup groupNN + */ + +/** + * @addtogroup BasicMath + * @{ + */ + +/* + * s16 elementwise add + * + * Refer header file for details. + * + */ + +/* Note: __SHIFT is expected to be <=0 */ + +arm_cmsis_nn_status arm_elementwise_add_s16(const int16_t *input_1_vect, + const int16_t *input_2_vect, + const int32_t input_1_offset, + const int32_t input_1_mult, + const int32_t input_1_shift, + const int32_t input_2_offset, + const int32_t input_2_mult, + const int32_t input_2_shift, + const int32_t left_shift, + int16_t *output, + const int32_t out_offset, + const int32_t out_mult, + const int32_t out_shift, + const int32_t out_activation_min, + const int32_t out_activation_max, + const int32_t block_size) +{ + (void)input_1_offset; + (void)input_2_offset; + (void)out_offset; + int32_t input_1; + int32_t input_2; + int32_t sum; + int32_t two_halfword_1, two_halfword_2; + int16_t sum_1, sum_2; + int32_t loop_count = block_size / 2; + + while (loop_count > 0) + { + two_halfword_1 = arm_nn_read_q15x2_ia(&input_1_vect); + two_halfword_2 = arm_nn_read_q15x2_ia(&input_2_vect); + + input_1 = (int16_t)(two_halfword_1 & 0xFFFF) << left_shift; + input_1 = arm_nn_requantize(input_1, input_1_mult, input_1_shift); + input_2 = (int16_t)(two_halfword_2 & 0xFFFF) << left_shift; + input_2 = arm_nn_requantize(input_2, input_2_mult, input_2_shift); + sum = input_1 + input_2; + sum = arm_nn_requantize(sum, out_mult, out_shift); + sum = MAX(sum, out_activation_min); + sum = MIN(sum, out_activation_max); + sum_1 = (int16_t)sum; + + input_1 = (int16_t)(two_halfword_1 >> 16) << left_shift; + input_1 = arm_nn_requantize(input_1, input_1_mult, input_1_shift); + input_2 = (int16_t)(two_halfword_2 >> 16) << left_shift; + input_2 = arm_nn_requantize(input_2, input_2_mult, input_2_shift); + sum = input_1 + input_2; + sum = arm_nn_requantize(sum, out_mult, out_shift); + sum = MAX(sum, out_activation_min); + sum = MIN(sum, out_activation_max); + sum_2 = (int16_t)sum; + + arm_nn_write_q15x2_ia(&output, PACK_Q15x2_32x1(sum_1, sum_2)); + + loop_count--; + } + loop_count = block_size & 0x1; + + while (loop_count > 0) + { + /* C = A + B */ + input_1 = *input_1_vect++ << left_shift; + input_2 = *input_2_vect++ << left_shift; + + input_1 = arm_nn_requantize(input_1, input_1_mult, input_1_shift); + input_2 = arm_nn_requantize(input_2, input_2_mult, input_2_shift); + + sum = input_1 + input_2; + sum = arm_nn_requantize(sum, out_mult, out_shift); + + sum = MAX(sum, out_activation_min); + sum = MIN(sum, out_activation_max); + + *output++ = (int16_t)sum; + + /* Decrement loop counter */ + loop_count--; + } + + return (ARM_CMSIS_NN_SUCCESS); +} + +/** + * @} end of BasicMath group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/BasicMathFunctions/arm_elementwise_add_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/BasicMathFunctions/arm_elementwise_add_s8.c index 7f51fc8..9ff0311 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/BasicMathFunctions/arm_elementwise_add_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/BasicMathFunctions/arm_elementwise_add_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2022 Arm Limited or its affiliates. * * SPDX-License-Identifier: Apache-2.0 * @@ -21,10 +21,10 @@ /* ---------------------------------------------------------------------- * Project: CMSIS NN Library * Title: arm_elementwise_add_s8 - * Description: Element wise add + * Description: Elementwise add * - * $Date: 09. October 2020 - * $Revision: V.2.5.2 + * $Date: 19 April 2022 + * $Revision: V.3.0.0 * * Target Processor: Cortex-M CPUs * @@ -32,24 +32,6 @@ #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" -#if defined(ARM_MATH_MVEI) -#include "edge-impulse-sdk/CMSIS/DSP/Include/arm_helium_utils.h" -#endif - -#if defined(ARM_MATH_MVEI) -#define SAT_INPUT_VECT(__INPUT_V, __MULT, __SHIFT) \ - __INPUT_V = arm_doubling_high_mult_mve(__INPUT_V, __MULT); \ - __INPUT_V = arm_divide_by_power_of_two_mve(__INPUT_V, -__SHIFT); -#endif - -/** - * @note The *_no_sat API does not mean that the input not saturated, Since - * __MULT is a positive integer, it is saturated. The API definition - * has more info about it. - */ -#define SAT_INPUT(__INPUT, __MULT, __SHIFT) \ - __INPUT = arm_nn_doubling_high_mult_no_sat(__INPUT, __MULT); \ - __INPUT = arm_nn_divide_by_power_of_two(__INPUT, -__SHIFT); /** * @ingroup groupNN @@ -61,7 +43,7 @@ */ /* - * s8 element wise add + * s8 elementwise add * * Refer header file for details. * @@ -69,25 +51,25 @@ /* Note: __SHIFT is expected to be <=0 */ -arm_status arm_elementwise_add_s8(const int8_t *input_1_vect, - const int8_t *input_2_vect, - const int32_t input_1_offset, - const int32_t input_1_mult, - const int32_t input_1_shift, - const int32_t input_2_offset, - const int32_t input_2_mult, - const int32_t input_2_shift, - const int32_t left_shift, - int8_t *output, - const int32_t out_offset, - const int32_t out_mult, - const int32_t out_shift, - const int32_t out_activation_min, - const int32_t out_activation_max, - const uint32_t block_size) +arm_cmsis_nn_status arm_elementwise_add_s8(const int8_t *input_1_vect, + const int8_t *input_2_vect, + const int32_t input_1_offset, + const int32_t input_1_mult, + const int32_t input_1_shift, + const int32_t input_2_offset, + const int32_t input_2_mult, + const int32_t input_2_shift, + const int32_t left_shift, + int8_t *output, + const int32_t out_offset, + const int32_t out_mult, + const int32_t out_shift, + const int32_t out_activation_min, + const int32_t out_activation_max, + const int32_t block_size) { #if defined(ARM_MATH_MVEI) - int32_t count = (int32_t)block_size; + int32_t count = block_size; while (count > 0) { @@ -105,11 +87,11 @@ arm_status arm_elementwise_add_s8(const int8_t *input_1_vect, vect_1 = vshlq_r_s32(vect_1, left_shift); vect_2 = vshlq_r_s32(vect_2, left_shift); - SAT_INPUT_VECT(vect_1, input_1_mult, input_1_shift); - SAT_INPUT_VECT(vect_2, input_2_mult, input_2_shift); + vect_1 = arm_requantize_mve(vect_1, input_1_mult, input_1_shift); + vect_2 = arm_requantize_mve(vect_2, input_2_mult, input_2_shift); vect_1 = vaddq_s32(vect_1, vect_2); - SAT_INPUT_VECT(vect_1, out_mult, out_shift); + vect_1 = arm_requantize_mve(vect_1, out_mult, out_shift); vect_1 = vaddq_n_s32(vect_1, out_offset); @@ -124,7 +106,7 @@ arm_status arm_elementwise_add_s8(const int8_t *input_1_vect, count -= 4; } #else - uint32_t loop_count; + int32_t loop_count; int32_t input_1; int32_t input_2; int32_t sum; @@ -141,7 +123,7 @@ arm_status arm_elementwise_add_s8(const int8_t *input_1_vect, loop_count = block_size >> 2; - while (loop_count > 0U) + while (loop_count > 0) { /* 4 outputs are calculated in one loop. The order of calculation is follows the order of output sign extension intrinsic */ @@ -155,62 +137,63 @@ arm_status arm_elementwise_add_s8(const int8_t *input_1_vect, b_2 = __SADD16(b_2, offset_2_packed); /* Sum 1 */ - input_1 = (int16_t)(b_1 & 0x0FFFFL) << left_shift; - SAT_INPUT(input_1, input_1_mult, input_1_shift); + input_1 = (b_1 & 0x0FFFF) << left_shift; - input_2 = (int16_t)(b_2 & 0x0FFFFL) << left_shift; - SAT_INPUT(input_2, input_2_mult, input_2_shift); + input_1 = arm_nn_requantize(input_1, input_1_mult, input_1_shift); + + input_2 = (b_2 & 0x0FFFF) << left_shift; + input_2 = arm_nn_requantize(input_2, input_2_mult, input_2_shift); sum = input_1 + input_2; - SAT_INPUT(sum, out_mult, out_shift); + sum = arm_nn_requantize(sum, out_mult, out_shift); sum += out_offset; sum = MAX(sum, out_activation_min); sum = MIN(sum, out_activation_max); r1 = (q7_t)sum; /* Sum 3 */ - input_1 = (int16_t)((b_1 >> 16) & 0x0FFFFL) << left_shift; - SAT_INPUT(input_1, input_1_mult, input_1_shift); + input_1 = ((b_1 >> 16) & 0x0FFFF) << left_shift; + input_1 = arm_nn_requantize(input_1, input_1_mult, input_1_shift); - input_2 = (int16_t)((b_2 >> 16) & 0x0FFFFL) << left_shift; - SAT_INPUT(input_2, input_2_mult, input_2_shift); + input_2 = ((b_2 >> 16) & 0x0FFFF) << left_shift; + input_2 = arm_nn_requantize(input_2, input_2_mult, input_2_shift); sum = input_1 + input_2; - SAT_INPUT(sum, out_mult, out_shift); + sum = arm_nn_requantize(sum, out_mult, out_shift); sum += out_offset; sum = MAX(sum, out_activation_min); sum = MIN(sum, out_activation_max); r3 = (q7_t)sum; /* Sum 2 */ - input_1 = (int16_t)(a_1 & 0x0FFFFL) << left_shift; - SAT_INPUT(input_1, input_1_mult, input_1_shift); + input_1 = (a_1 & 0x0FFFF) << left_shift; + input_1 = arm_nn_requantize(input_1, input_1_mult, input_1_shift); - input_2 = (int16_t)(a_2 & 0x0FFFFL) << left_shift; - SAT_INPUT(input_2, input_2_mult, input_2_shift); + input_2 = (a_2 & 0x0FFFF) << left_shift; + input_2 = arm_nn_requantize(input_2, input_2_mult, input_2_shift); sum = input_1 + input_2; - SAT_INPUT(sum, out_mult, out_shift); + sum = arm_nn_requantize(sum, out_mult, out_shift); sum += out_offset; sum = MAX(sum, out_activation_min); sum = MIN(sum, out_activation_max); r2 = (q7_t)sum; /* Sum 4 */ - input_1 = (int16_t)((a_1 >> 16) & 0x0FFFFL) << left_shift; - SAT_INPUT(input_1, input_1_mult, input_1_shift); + input_1 = ((a_1 >> 16) & 0x0FFFF) << left_shift; + input_1 = arm_nn_requantize(input_1, input_1_mult, input_1_shift); - input_2 = (int16_t)((a_2 >> 16) & 0x0FFFFL) << left_shift; - SAT_INPUT(input_2, input_2_mult, input_2_shift); + input_2 = ((a_2 >> 16) & 0x0FFFF) << left_shift; + input_2 = arm_nn_requantize(input_2, input_2_mult, input_2_shift); sum = input_1 + input_2; - SAT_INPUT(sum, out_mult, out_shift); + sum = arm_nn_requantize(sum, out_mult, out_shift); sum += out_offset; sum = MAX(sum, out_activation_min); sum = MIN(sum, out_activation_max); r4 = (q7_t)sum; - write_q7x4_ia(&output, __PACKq7(r1, r2, r3, r4)); + arm_nn_write_q7x4_ia(&output, PACK_Q7x4_32x1(r1, r2, r3, r4)); loop_count--; } @@ -220,21 +203,18 @@ arm_status arm_elementwise_add_s8(const int8_t *input_1_vect, loop_count = block_size; #endif - while (loop_count > 0U) + while (loop_count > 0) { /* C = A + B */ input_1 = (*input_1_vect++ + input_1_offset) << left_shift; input_2 = (*input_2_vect++ + input_2_offset) << left_shift; - input_1 = arm_nn_doubling_high_mult(input_1, input_1_mult); - input_1 = arm_nn_divide_by_power_of_two(input_1, -input_1_shift); - - input_2 = arm_nn_doubling_high_mult(input_2, input_2_mult); - input_2 = arm_nn_divide_by_power_of_two(input_2, -input_2_shift); + input_1 = arm_nn_requantize(input_1, input_1_mult, input_1_shift); + input_2 = arm_nn_requantize(input_2, input_2_mult, input_2_shift); sum = input_1 + input_2; - SAT_INPUT(sum, out_mult, out_shift); + sum = arm_nn_requantize(sum, out_mult, out_shift); sum += out_offset; sum = MAX(sum, out_activation_min); @@ -248,7 +228,7 @@ arm_status arm_elementwise_add_s8(const int8_t *input_1_vect, #endif /* ARM_MATH_MVEI */ - return (ARM_MATH_SUCCESS); + return (ARM_CMSIS_NN_SUCCESS); } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/BasicMathFunctions/arm_elementwise_mul_s16.c b/edge-impulse-sdk/CMSIS/NN/Source/BasicMathFunctions/arm_elementwise_mul_s16.c new file mode 100644 index 0000000..5d53550 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/BasicMathFunctions/arm_elementwise_mul_s16.c @@ -0,0 +1,126 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * Copyright (C) 2022 Arm Limited or its affiliates. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_elementwise_mul_s16 + * Description: Element wise multiplication + * + * $Date: 10 May 2022 + * $Revision: V.2.1.0 + * + * Target Processor: Cortex-M cores + * + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" + +/** + * @ingroup groupNN + */ + +/** + * @addtogroup BasicMath + * @{ + */ + +/** + * @brief s16 element wise multiplication of two vectors + * + * @note Refer header file for details. + * + */ +arm_cmsis_nn_status arm_elementwise_mul_s16(const int16_t *input_1_vect, + const int16_t *input_2_vect, + const int32_t input_1_offset, + const int32_t input_2_offset, + int16_t *output, + const int32_t out_offset, + const int32_t out_mult, + const int32_t out_shift, + const int32_t out_activation_min, + const int32_t out_activation_max, + const int32_t block_size) +{ + (void)input_1_offset; + (void)input_2_offset; + (void)out_offset; + int32_t input_1; + int32_t input_2; + int32_t mul_res; + int32_t two_halfword_1, two_halfword_2; + int16_t mul_1, mul_2; + int32_t loop_count = block_size / 2; + + while (loop_count > 0) + { + two_halfword_1 = arm_nn_read_q15x2_ia(&input_1_vect); + two_halfword_2 = arm_nn_read_q15x2_ia(&input_2_vect); + + input_1 = (int16_t)(two_halfword_1 & 0xFFFF); + input_2 = (int16_t)(two_halfword_2 & 0xFFFF); + mul_res = input_1 * input_2; + mul_res = arm_nn_requantize(mul_res, out_mult, out_shift); + mul_res = MAX(mul_res, out_activation_min); + mul_res = MIN(mul_res, out_activation_max); + mul_1 = (int16_t)mul_res; + + input_1 = (int16_t)(two_halfword_1 >> 16); + input_2 = (int16_t)(two_halfword_2 >> 16); + mul_res = input_1 * input_2; + mul_res = arm_nn_requantize(mul_res, out_mult, out_shift); + mul_res = MAX(mul_res, out_activation_min); + mul_res = MIN(mul_res, out_activation_max); + mul_2 = (int16_t)mul_res; + + arm_nn_write_q15x2_ia(&output, PACK_Q15x2_32x1(mul_1, mul_2)); + + loop_count--; + } + loop_count = block_size & 0x1; + + while (loop_count > 0) + { + /* C = A * B */ + + input_1 = *input_1_vect++; + input_2 = *input_2_vect++; + + mul_res = input_1 * input_2; + mul_res = arm_nn_requantize(mul_res, out_mult, out_shift); + + mul_res = MAX(mul_res, out_activation_min); + mul_res = MIN(mul_res, out_activation_max); + + *output++ = (int16_t)mul_res; + + /* Decrement loop counter */ + loop_count--; + } + + return ARM_CMSIS_NN_SUCCESS; +} + +/** + * @} end of BasicMath group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/BasicMathFunctions/arm_elementwise_mul_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/BasicMathFunctions/arm_elementwise_mul_s8.c index f38d024..663112a 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/BasicMathFunctions/arm_elementwise_mul_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/BasicMathFunctions/arm_elementwise_mul_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_elementwise_mul_s8 * Description: Element wise multiplication * - * $Date: January 26, 2021 - * $Revision: V.1.0.5 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,24 +42,24 @@ * @{ */ -/** - * @brief s8 element wise multiplication of two vectors +/* + * s8 element wise multiplication of two vectors * - * @note Refer header file for details. + * Refer header file for details. * */ -arm_status arm_elementwise_mul_s8(const int8_t *input_1_vect, - const int8_t *input_2_vect, - const int32_t input_1_offset, - const int32_t input_2_offset, - int8_t *output, - const int32_t out_offset, - const int32_t out_mult, - const int32_t out_shift, - const int32_t out_activation_min, - const int32_t out_activation_max, - const uint32_t block_size) +arm_cmsis_nn_status arm_elementwise_mul_s8(const int8_t *input_1_vect, + const int8_t *input_2_vect, + const int32_t input_1_offset, + const int32_t input_2_offset, + int8_t *output, + const int32_t out_offset, + const int32_t out_mult, + const int32_t out_shift, + const int32_t out_activation_min, + const int32_t out_activation_max, + const int32_t block_size) { int32_t loop_count; @@ -165,7 +165,7 @@ arm_status arm_elementwise_mul_s8(const int8_t *input_1_vect, mul_res = MIN(mul_res, out_activation_max); r4 = (q7_t)mul_res; - write_q7x4_ia(&output, __PACKq7(r1, r2, r3, r4)); + arm_nn_write_q7x4_ia(&output, PACK_Q7x4_32x1(r1, r2, r3, r4)); loop_count--; } @@ -194,7 +194,7 @@ arm_status arm_elementwise_mul_s8(const int8_t *input_1_vect, loop_count--; } #endif - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConcatenationFunctions/arm_concatenation_s8_w.c b/edge-impulse-sdk/CMSIS/NN/Source/ConcatenationFunctions/arm_concatenation_s8_w.c index b36c1a1..442a497 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConcatenationFunctions/arm_concatenation_s8_w.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConcatenationFunctions/arm_concatenation_s8_w.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2019 Arm Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 Arm Limited or its affiliates. * * SPDX-License-Identifier: Apache-2.0 * @@ -31,6 +31,7 @@ * -------------------------------------------------------------------- */ #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" /** * @ingroup groupNN @@ -59,7 +60,7 @@ void arm_concatenation_s8_w(const int8_t *input, output += offset_w * (input_x * input_y * input_z); - memcpy(output, input, input_copy_size); + arm_memcpy_q7(output, input, input_copy_size); } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConcatenationFunctions/arm_concatenation_s8_x.c b/edge-impulse-sdk/CMSIS/NN/Source/ConcatenationFunctions/arm_concatenation_s8_x.c index 0e11558..bcc0d38 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConcatenationFunctions/arm_concatenation_s8_x.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConcatenationFunctions/arm_concatenation_s8_x.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2019 Arm Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 Arm Limited or its affiliates. * * SPDX-License-Identifier: Apache-2.0 * @@ -31,6 +31,7 @@ * -------------------------------------------------------------------- */ #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" /** * @ingroup groupNN @@ -65,7 +66,7 @@ void arm_concatenation_s8_x(const int8_t *input, // Copy per row for (i = 0; i < num_iterations; ++i) { - memcpy(output, input, input_x); + arm_memcpy_q7(output, input, input_x); input += input_x; output += output_x; } diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConcatenationFunctions/arm_concatenation_s8_y.c b/edge-impulse-sdk/CMSIS/NN/Source/ConcatenationFunctions/arm_concatenation_s8_y.c index 55dbe27..b0f7f43 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConcatenationFunctions/arm_concatenation_s8_y.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConcatenationFunctions/arm_concatenation_s8_y.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2019 Arm Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 Arm Limited or its affiliates. * * SPDX-License-Identifier: Apache-2.0 * @@ -31,6 +31,7 @@ * -------------------------------------------------------------------- */ #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" /** * @ingroup groupNN @@ -66,7 +67,7 @@ void arm_concatenation_s8_y(const int8_t *input, // Copy per tile for (i = 0; i < num_iterations; ++i) { - memcpy(output, input, input_copy_size); + arm_memcpy_q7(output, input, input_copy_size); input += input_copy_size; output += output_stride; } diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConcatenationFunctions/arm_concatenation_s8_z.c b/edge-impulse-sdk/CMSIS/NN/Source/ConcatenationFunctions/arm_concatenation_s8_z.c index 2a82910..4ba99f5 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConcatenationFunctions/arm_concatenation_s8_z.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConcatenationFunctions/arm_concatenation_s8_z.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2019 Arm Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 Arm Limited or its affiliates. * * SPDX-License-Identifier: Apache-2.0 * @@ -31,6 +31,7 @@ * -------------------------------------------------------------------- */ #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" /** * @ingroup groupNN @@ -65,7 +66,7 @@ void arm_concatenation_s8_z(const int8_t *input, for (i = 0; i < input_w; ++i) { - memcpy(output, input, input_copy_size); + arm_memcpy_q7(output, input, input_copy_size); input += input_copy_size; output += output_stride; } diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_1_x_n_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_1_x_n_s8.c index ef0c5f0..64a24d6 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_1_x_n_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_1_x_n_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_convolve_1_x_n_s8.c * Description: s8 version of 1xN convolution using symmetric quantization. * - * $Date: January 26, 2021 - * $Revision: V.2.0.3 + * $Date: 20 June 2022 + * $Revision: V.3.1.0 * * Target Processor: Cortex-M cores * @@ -49,23 +49,24 @@ * */ -arm_status arm_convolve_1_x_n_s8(const cmsis_nn_context *ctx, - const cmsis_nn_conv_params *conv_params, - const cmsis_nn_per_channel_quant_params *quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input_data, - const cmsis_nn_dims *filter_dims, - const q7_t *filter_data, - const cmsis_nn_dims *bias_dims, - const int32_t *bias_data, - const cmsis_nn_dims *output_dims, - q7_t *output_data) +arm_cmsis_nn_status arm_convolve_1_x_n_s8(const cmsis_nn_context *ctx, + const cmsis_nn_conv_params *conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int32_t *bias_data, + const cmsis_nn_dims *output_dims, + q7_t *output_data) { (void)bias_dims; - arm_status status = ARM_MATH_SUCCESS; - if (output_dims->w % 4 != 0) + arm_cmsis_nn_status status = ARM_CMSIS_NN_SUCCESS; + /* The wrapper API is the ultimate reference for argument check */ + if ((input_dims->h != 1) || (output_dims->w % 4 != 0) || conv_params->dilation.w != 1) { - status = ARM_MATH_SIZE_MISMATCH; + status = ARM_CMSIS_NN_ARG_ERROR; goto out; } @@ -80,94 +81,55 @@ arm_status arm_convolve_1_x_n_s8(const cmsis_nn_context *ctx, const uint16_t pad_x = conv_params->padding.w; const uint16_t stride_x = conv_params->stride.w; - const int32_t input_offset = conv_params->input_offset; - const int32_t out_offset = conv_params->output_offset; - const int32_t out_activation_min = conv_params->activation.min; - const int32_t out_activation_max = conv_params->activation.max; - int32_t *output_mult = quant_params->multiplier; - int32_t *output_shift = quant_params->shift; - - for (int i_out_x = 0; i_out_x <= (output_x - 4); i_out_x += 4) + int i_batch; + for (i_batch = 0; i_batch < input_dims->n; i_batch++) { - int32_t input_begin_idx[4]; - int32_t ker_begin_idx[4]; - int32_t ker_end_idx[4]; - - for (int i = 0; i < 4; i++) + for (int i_out_x = 0; i_out_x <= (output_x - 4); i_out_x += 4) { - const int32_t est_input_x_idx = stride_x * (i_out_x + i) - pad_x; - input_begin_idx[i] = MAX(0, est_input_x_idx); - ker_begin_idx[i] = MAX(0, -est_input_x_idx); - ker_end_idx[i] = MIN(kernel_x, input_x - est_input_x_idx); - } + int32_t input_begin_idx[4]; + int32_t ker_begin_idx[4]; + int32_t ker_end_idx[4]; - for (int i_out_ch = 0; i_out_ch < output_ch; i_out_ch++) - { - int32x4_t s_offset; - int32_t acc[4]; - if ((ker_begin_idx[0] != 0) || (ker_end_idx[3] != kernel_x)) + for (int i = 0; i < 4; i++) { - int32_t sum_row[4]; - - (void)arm_nn_mat_mul_core_1x_s8((ker_end_idx[0] - ker_begin_idx[0]) * input_ch, - input_data + input_begin_idx[0] * input_ch, - filter_data + (input_ch * kernel_x * i_out_ch) + - (ker_begin_idx[0] * input_ch), - &sum_row[0], - &acc[0]); - (void)arm_nn_mat_mul_core_1x_s8((ker_end_idx[1] - ker_begin_idx[1]) * input_ch, - input_data + input_begin_idx[1] * input_ch, - filter_data + (input_ch * kernel_x * i_out_ch) + - (ker_begin_idx[1] * input_ch), - &sum_row[1], - &acc[1]); - - (void)arm_nn_mat_mul_core_1x_s8((ker_end_idx[2] - ker_begin_idx[2]) * input_ch, - input_data + input_begin_idx[2] * input_ch, - filter_data + (input_ch * kernel_x * i_out_ch) + - (ker_begin_idx[2] * input_ch), - &sum_row[2], - &acc[2]); - - (void)arm_nn_mat_mul_core_1x_s8((ker_end_idx[3] - ker_begin_idx[3]) * input_ch, - input_data + input_begin_idx[3] * input_ch, - filter_data + (input_ch * kernel_x * i_out_ch) + - (ker_begin_idx[3] * input_ch), - &sum_row[3], - &acc[3]); - - s_offset = vldrwq_s32(sum_row); + const int32_t est_input_x_idx = stride_x * (i_out_x + i) - pad_x; + input_begin_idx[i] = MAX(0, est_input_x_idx); + ker_begin_idx[i] = MAX(0, -est_input_x_idx); + ker_end_idx[i] = MIN(kernel_x, input_x - est_input_x_idx); } - else + + if ((ker_begin_idx[0] != 0) || (ker_end_idx[3] != kernel_x)) { - int32_t sum_row; - (void)arm_nn_mat_mul_core_4x_s8(kernel_x * input_ch, - stride_x * input_ch, - input_data + input_begin_idx[0] * input_ch, - filter_data + (input_ch * kernel_x * i_out_ch), - &sum_row, - acc); - - s_offset = vdupq_n_s32(sum_row); + for (int i = 0; i < 4; i++) + { + const int32_t actual_kernel_len = ker_end_idx[i] - ker_begin_idx[i]; + arm_nn_mat_mul_core_1x_s8(actual_kernel_len * input_ch, + (kernel_x - actual_kernel_len) * input_ch, + input_data + input_begin_idx[i] * input_ch, + filter_data + (ker_begin_idx[i] * input_ch), + output_ch, + conv_params, + quant_params, + bias_data, + output_data); + output_data += output_ch; + } } - int32x4_t res = vldrwq_s32(acc); - s_offset = vmulq_n_s32(s_offset, input_offset); - res = vaddq_s32(res, s_offset); - if (bias_data) + else { - res = vaddq_n_s32(res, bias_data[i_out_ch]); + output_data = arm_nn_mat_mul_core_4x_s8(kernel_x * input_ch, + stride_x * input_ch, + input_data + input_begin_idx[0] * input_ch, + filter_data, + output_ch, + conv_params, + quant_params, + bias_data, + output_data); } - res = arm_requantize_mve(res, output_mult[i_out_ch], output_shift[i_out_ch]); - res = vaddq_n_s32(res, out_offset); - - res = vmaxq_s32(res, vdupq_n_s32(out_activation_min)); - res = vminq_s32(res, vdupq_n_s32(out_activation_max)); - - const uint32x4_t scatter_offset = {0, output_ch, output_ch * 2, output_ch * 3}; - vstrbq_scatter_offset_s32(output_data, scatter_offset, res); - output_data++; } - output_data += (3 * output_ch); + /* Advance to the next batch */ + input_data += (input_x * input_ch); } #else @@ -191,8 +153,8 @@ arm_status arm_convolve_1_x_n_s8(const cmsis_nn_context *ctx, int32_t arm_convolve_1_x_n_s8_get_buffer_size(const cmsis_nn_dims *input_dims, const cmsis_nn_dims *filter_dims) { -#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) - return (2 * input_dims->c * filter_dims->w * filter_dims->h) * sizeof(int16_t); +#if !defined(ARM_MATH_MVEI) + return arm_convolve_s8_get_buffer_size(input_dims, filter_dims); #else (void)input_dims; (void)filter_dims; diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_1x1_HWC_q7_fast_nonsquare.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_1x1_HWC_q7_fast_nonsquare.c index e2a360b..d0abf21 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_1x1_HWC_q7_fast_nonsquare.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_1x1_HWC_q7_fast_nonsquare.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_convolve_1x1_HWC_q7_fast_nonsquare.c * Description: Fast Q7 version of 1x1 convolution (non-square shape) * - * $Date: January 26, 2021 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,67 +42,35 @@ * @{ */ -/** - * @brief Fast Q7 version of 1x1 convolution (non-sqaure shape) - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in_x input tensor dimention x - * @param[in] dim_im_in_y input tensor dimention y - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel_x filter kernel size x - * @param[in] dim_kernel_y filter kernel size y - * @param[in] padding_x padding size x - * @param[in] padding_y padding size y - * @param[in] stride_x convolution stride x - * @param[in] stride_y convolution stride y - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out_x output tensor dimension x - * @param[in] dim_im_out_y output tensor dimension y - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - * - * This function is optimized for convolution with 1x1 kernel size (i.e., dim_kernel_x=1 - * and dim_kernel_y=1). It can be used for the second half of MobileNets [1] after depthwise - * separable convolution. - * - * This function is the version with full list of optimization tricks, but with - * some contraints: - * ch_im_in is multiple of 4 - * ch_im_out is multiple of 2 +/* + * Fast Q7 version of 1x1 convolution (non-sqaure shape) + * Refer function header for details * - * [1] MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications - * https://arxiv.org/abs/1704.04861 */ -arm_status arm_convolve_1x1_HWC_q7_fast_nonsquare(const q7_t *Im_in, - const uint16_t dim_im_in_x, - const uint16_t dim_im_in_y, - const uint16_t ch_im_in, - const q7_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel_x, - const uint16_t dim_kernel_y, - const uint16_t padding_x, - const uint16_t padding_y, - const uint16_t stride_x, - const uint16_t stride_y, - const q7_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q7_t *Im_out, - const uint16_t dim_im_out_x, - const uint16_t dim_im_out_y, - q15_t *bufferA, - q7_t *bufferB) +arm_cmsis_nn_status arm_convolve_1x1_HWC_q7_fast_nonsquare(const q7_t *Im_in, + const uint16_t dim_im_in_x, + const uint16_t dim_im_in_y, + const uint16_t ch_im_in, + const q7_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel_x, + const uint16_t dim_kernel_y, + const uint16_t padding_x, + const uint16_t padding_y, + const uint16_t stride_x, + const uint16_t stride_y, + const q7_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q7_t *Im_out, + const uint16_t dim_im_out_x, + const uint16_t dim_im_out_y, + q15_t *bufferA, + q7_t *bufferB) { (void)bufferB; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ (void)dim_im_in_y; int16_t i_out_y, i_out_x; @@ -120,7 +88,7 @@ arm_status arm_convolve_1x1_HWC_q7_fast_nonsquare(const q7_t *Im_in, padding_y != 0 || stride_x != 1 || stride_y != 1) { /* check if the input dimension meets the constraints */ - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } for (i_out_y = 0; i_out_y < dim_im_out_y; i_out_y++) @@ -193,7 +161,7 @@ arm_status arm_convolve_1x1_HWC_q7_fast_nonsquare(const q7_t *Im_in, padding_y != 0 || stride_x != 1 || stride_y != 1) { /* check if the input dimension meets the constraints */ - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } for (i = 0; i < ch_im_out; i++) @@ -229,7 +197,7 @@ arm_status arm_convolve_1x1_HWC_q7_fast_nonsquare(const q7_t *Im_in, #endif /* ARM_MATH_DSP */ /* Return to application */ - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_1x1_s8_fast.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_1x1_s8_fast.c index 06c6f0a..98eb524 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_1x1_s8_fast.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_1x1_s8_fast.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,18 +23,16 @@ * Title: arm_convolve_1x1_s8_fast.c * Description: Fast q7 version of 1x1 convolution (non-square shape) * - * $Date: 09. October 2020 - * $Revision: V.2.0.3 + * $Date: 20 june 2022 + * $Revision: V.3.0.1 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M Processors * * -------------------------------------------------------------------- */ #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" - -#define DIM_KER_X (1U) -#define DIM_KER_Y (1U) +#include /** * @ingroup groupNN @@ -52,22 +50,22 @@ * */ -arm_status arm_convolve_1x1_s8_fast(const cmsis_nn_context *ctx, - const cmsis_nn_conv_params *conv_params, - const cmsis_nn_per_channel_quant_params *quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input_data, - const cmsis_nn_dims *filter_dims, - const q7_t *filter_data, - const cmsis_nn_dims *bias_dims, - const int32_t *bias_data, - const cmsis_nn_dims *output_dims, - q7_t *output_data) +arm_cmsis_nn_status arm_convolve_1x1_s8_fast(const cmsis_nn_context *ctx, + const cmsis_nn_conv_params *conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int32_t *bias_data, + const cmsis_nn_dims *output_dims, + q7_t *output_data) { - if (input_dims->c % 4 != 0 || conv_params->padding.w != 0 || conv_params->padding.h != 0 || - conv_params->stride.w != 1 || conv_params->stride.h != 1) + if (conv_params->padding.w != 0 || conv_params->padding.h != 0 || conv_params->stride.w != 1 || + conv_params->stride.h != 1) { - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } (void)ctx; @@ -79,70 +77,33 @@ arm_status arm_convolve_1x1_s8_fast(const cmsis_nn_context *ctx, const int32_t col_len = input_dims->w * input_dims->h * input_dims->n; const int32_t output_ch = output_dims->c; const int32_t input_ch = input_dims->c; - const int32_t input_offset = conv_params->input_offset; - const int32_t out_offset = conv_params->output_offset; - const int32_t out_activation_min = conv_params->activation.min; - const int32_t out_activation_max = conv_params->activation.max; - int32_t *output_mult = quant_params->multiplier; - int32_t *output_shift = quant_params->shift; for (int i_items = 0; i_items <= (col_len - 4); i_items += 4) { - for (int i_out_ch = 0; i_out_ch < output_ch; i_out_ch++) - { - int32_t sum_row = 0; - int32_t temp_out[4]; - - (void)arm_nn_mat_mul_core_4x_s8(input_ch, - input_ch, - input_data + i_items * input_ch, - filter_data + i_out_ch * input_ch, - &sum_row, - temp_out); - int32x4_t res = vldrwq_s32(temp_out); - if (bias_data) - { - res = vaddq_n_s32(res, bias_data[i_out_ch]); - } - sum_row = sum_row * input_offset; - res = vaddq_n_s32(res, sum_row); - res = arm_requantize_mve(res, output_mult[i_out_ch], output_shift[i_out_ch]); - res = vaddq_n_s32(res, out_offset); - - res = vmaxq_s32(res, vdupq_n_s32(out_activation_min)); - res = vminq_s32(res, vdupq_n_s32(out_activation_max)); - - const uint32x4_t scatter_offset = { - 0, (uint32_t)output_ch, (uint32_t)output_ch * 2, (uint32_t)output_ch * 3}; - vstrbq_scatter_offset_s32(output_data, scatter_offset, res); - output_data++; - } - output_data += (3 * output_ch); + output_data = arm_nn_mat_mul_core_4x_s8(input_ch, + input_ch, + input_data + i_items * input_ch, + filter_data, + output_ch, + conv_params, + quant_params, + bias_data, + output_data); } /* Handle left over elements */ for (int i_items = (col_len & ~0x3); i_items < col_len; i_items++) { - for (int i_out_ch = 0; i_out_ch < output_ch; i_out_ch++) - { - int32_t sum_row = 0; - - int32_t acc; - (void)arm_nn_mat_mul_core_1x_s8( - input_ch, input_data + i_items * input_ch, filter_data + i_out_ch * input_ch, &sum_row, &acc); - if (bias_data) - { - acc += bias_data[i_out_ch]; - } - sum_row = (sum_row * input_offset); - acc += sum_row; - acc = arm_nn_requantize(acc, output_mult[i_out_ch], output_shift[i_out_ch]); - acc += out_offset; - - acc = MAX(acc, out_activation_min); - acc = MIN(acc, out_activation_max); - *output_data++ = acc; - } + arm_nn_mat_mul_core_1x_s8(input_ch, + 0, + input_data + i_items * input_ch, + filter_data, + output_ch, + conv_params, + quant_params, + bias_data, + output_data); + output_data += output_ch; } #else @@ -169,7 +130,7 @@ arm_status arm_convolve_1x1_s8_fast(const cmsis_nn_context *ctx, #endif /* Return to application */ - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } int32_t arm_convolve_1x1_s8_fast_get_buffer_size(const cmsis_nn_dims *input_dims) diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q15_basic.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q15_basic.c index 11fd1d3..fe642d8 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q15_basic.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q15_basic.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_convolve_HWC_q15_basic.c * Description: Q15 version of convolution * - * $Date: January 26, 2021 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,55 +42,29 @@ * @{ */ -/** - * @brief Basic Q15 convolution function - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in input tensor dimention - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel filter kernel size - * @param[in] padding padding sizes - * @param[in] stride convolution stride - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out output tensor dimension - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns ARM_MATH_SUCCESS - * - * @details - * - * Buffer size: - * - * bufferA size: ch_im_in*dim_kernel*dim_kernel - * - * bufferB size: 0 - * - * This basic version is designed to work for any input tensor and weight - * dimension. +/* + * Basic Q15 convolution function + * Refer function header for details */ -arm_status arm_convolve_HWC_q15_basic(const q15_t *Im_in, - const uint16_t dim_im_in, - const uint16_t ch_im_in, - const q15_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel, - const uint16_t padding, - const uint16_t stride, - const q15_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q15_t *Im_out, - const uint16_t dim_im_out, - q15_t *bufferA, - q7_t *bufferB) +arm_cmsis_nn_status arm_convolve_HWC_q15_basic(const q15_t *Im_in, + const uint16_t dim_im_in, + const uint16_t ch_im_in, + const q15_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel, + const uint16_t padding, + const uint16_t stride, + const q15_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q15_t *Im_out, + const uint16_t dim_im_out, + q15_t *bufferA, + q7_t *bufferB) { (void)bufferB; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ int16_t i_out_y, i_out_x, i_ker_y, i_ker_x; @@ -203,7 +177,7 @@ arm_status arm_convolve_HWC_q15_basic(const q15_t *Im_in, #endif /* ARM_MATH_DSP */ /* Return to application */ - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q15_fast.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q15_fast.c index 8dd880b..a0bbd22 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q15_fast.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q15_fast.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_convolve_HWC_q15_fast.c * Description: Fast Q15 version of convolution * - * $Date: January 26, 2021 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,70 +42,39 @@ * @{ */ -/** - * @brief Fast Q15 convolution function - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in input tensor dimention - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel filter kernel size - * @param[in] padding padding sizes - * @param[in] stride convolution stride - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out output tensor dimension - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - * - * @details - * - * Buffer size: - * - * bufferA size: 2*ch_im_in*dim_kernel*dim_kernel - * - * bufferB size: 0 - * - * Input dimension constraints: - * - * ch_im_in is multiple of 2 - * - * ch_im_out is multipe of 2 - * +/* + * Fast Q15 convolution function + * Refer function header for details */ -arm_status arm_convolve_HWC_q15_fast(const q15_t *Im_in, - const uint16_t dim_im_in, - const uint16_t ch_im_in, - const q15_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel, - const uint16_t padding, - const uint16_t stride, - const q15_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q15_t *Im_out, - const uint16_t dim_im_out, - q15_t *bufferA, - q7_t *bufferB) +arm_cmsis_nn_status arm_convolve_HWC_q15_fast(const q15_t *Im_in, + const uint16_t dim_im_in, + const uint16_t ch_im_in, + const q15_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel, + const uint16_t padding, + const uint16_t stride, + const q15_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q15_t *Im_out, + const uint16_t dim_im_out, + q15_t *bufferA, + q7_t *bufferB) { (void)bufferB; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) int16_t i_out_y, i_out_x, i_ker_y, i_ker_x; q15_t *pBuffer = bufferA; q15_t *im_buffer = bufferA; q15_t *pOut = Im_out; - if (ch_im_in % 2 != 0 || ch_im_out % 2 != 0) + if (ch_im_in % 2 != 0 || ch_im_out % 2 != 0 || dim_im_out & 0x1) { /* check if the input dimension meets the constraints */ - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } /* Run the following code for Cortex-M4 and Cortex-M7 */ @@ -217,7 +186,7 @@ arm_status arm_convolve_HWC_q15_fast(const q15_t *Im_in, if (ch_im_in % 2 != 0 || ch_im_out % 2 != 0) { /* check if the input dimension meets the constraints */ - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } for (i = 0; i < ch_im_out; i++) @@ -251,7 +220,7 @@ arm_status arm_convolve_HWC_q15_fast(const q15_t *Im_in, #endif /* ARM_MATH_DSP */ /* Return to application */ - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q15_fast_nonsquare.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q15_fast_nonsquare.c index e24dd1c..7d62293 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q15_fast_nonsquare.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q15_fast_nonsquare.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_convolve_HWC_q15_fast.c * Description: Fast Q15 version of convolution * - * $Date: January 26, 2021 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,70 +42,34 @@ * @{ */ -/** - * @brief Fast Q15 convolution function (non-sqaure shape) - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in_x input tensor dimention x - * @param[in] dim_im_in_y input tensor dimention y - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel_x filter kernel size x - * @param[in] dim_kernel_y filter kernel size y - * @param[in] padding_x padding size x - * @param[in] padding_y padding size y - * @param[in] stride_x convolution stride x - * @param[in] stride_y convolution stride y - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out_x output tensor dimension x - * @param[in] dim_im_out_y output tensor dimension y - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - * - * @details - * - * Buffer size: - * - * bufferA size: 2*ch_im_in*dim_kernel*dim_kernel - * - * bufferB size: 0 - * - * Input dimension constraints: - * - * ch_im_in is multiple of 2 - * - * ch_im_out is multipe of 2 - * +/* + * Fast Q15 convolution function (non-sqaure shape) + * Refer function header for details */ -arm_status arm_convolve_HWC_q15_fast_nonsquare(const q15_t *Im_in, - const uint16_t dim_im_in_x, - const uint16_t dim_im_in_y, - const uint16_t ch_im_in, - const q15_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel_x, - const uint16_t dim_kernel_y, - const uint16_t padding_x, - const uint16_t padding_y, - const uint16_t stride_x, - const uint16_t stride_y, - const q15_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q15_t *Im_out, - const uint16_t dim_im_out_x, - const uint16_t dim_im_out_y, - q15_t *bufferA, - q7_t *bufferB) +arm_cmsis_nn_status arm_convolve_HWC_q15_fast_nonsquare(const q15_t *Im_in, + const uint16_t dim_im_in_x, + const uint16_t dim_im_in_y, + const uint16_t ch_im_in, + const q15_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel_x, + const uint16_t dim_kernel_y, + const uint16_t padding_x, + const uint16_t padding_y, + const uint16_t stride_x, + const uint16_t stride_y, + const q15_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q15_t *Im_out, + const uint16_t dim_im_out_x, + const uint16_t dim_im_out_y, + q15_t *bufferA, + q7_t *bufferB) { (void)bufferB; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) int16_t i_out_y, i_out_x, i_ker_y, i_ker_x; q15_t *pBuffer = bufferA; @@ -115,7 +79,7 @@ arm_status arm_convolve_HWC_q15_fast_nonsquare(const q15_t *Im_in, if (ch_im_in % 2 != 0 || ch_im_out % 2 != 0) { /* check if the input dimension meets the constraints */ - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } /* Run the following code for Cortex-M4 and Cortex-M7 */ @@ -229,7 +193,7 @@ arm_status arm_convolve_HWC_q15_fast_nonsquare(const q15_t *Im_in, if (ch_im_in % 2 != 0 || ch_im_out % 2 != 0) { /* check if the input dimension meets the constraints */ - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } for (i = 0; i < ch_im_out; i++) @@ -264,7 +228,7 @@ arm_status arm_convolve_HWC_q15_fast_nonsquare(const q15_t *Im_in, #endif /* ARM_MATH_DSP */ /* Return to application */ - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_RGB.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_RGB.c index 01ef762..ed388a5 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_RGB.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_RGB.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_convolve_HWC_q7_RGB.c * Description: Q7 version of convolution for RGB image * - * $Date: January 26, 2021 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,61 +42,29 @@ * @{ */ -/** - * @brief Q7 convolution function for RGB image - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in input tensor dimention - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel filter kernel size - * @param[in] padding padding sizes - * @param[in] stride convolution stride - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out output tensor dimension - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - * - * @details - * - * Buffer size: - * - * bufferA size: 2*ch_im_in*dim_kernel*dim_kernel - * - * bufferB size: 0 - * - * Input dimension constraints: - * - * ch_im_in equals 3 - * - * This kernel is written exclusively for convolution with ch_im_in - * equals 3. This applies on the first layer of CNNs which has input - * image with RGB format. +/* + * Q7 convolution function for RGB image + * Refer function header for details */ -arm_status arm_convolve_HWC_q7_RGB(const q7_t *Im_in, - const uint16_t dim_im_in, - const uint16_t ch_im_in, - const q7_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel, - const uint16_t padding, - const uint16_t stride, - const q7_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q7_t *Im_out, - const uint16_t dim_im_out, - q15_t *bufferA, - q7_t *bufferB) +arm_cmsis_nn_status arm_convolve_HWC_q7_RGB(const q7_t *Im_in, + const uint16_t dim_im_in, + const uint16_t ch_im_in, + const q7_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel, + const uint16_t padding, + const uint16_t stride, + const q7_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q7_t *Im_out, + const uint16_t dim_im_out, + q15_t *bufferA, + q7_t *bufferB) { (void)bufferB; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ int16_t i_out_y, i_out_x, i_ker_y, i_ker_x; @@ -110,7 +78,7 @@ arm_status arm_convolve_HWC_q7_RGB(const q7_t *Im_in, // check if number of input channels is 3 if (ch_im_in != 3) { - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } // This part implements the im2col function for (i_out_y = 0; i_out_y < dim_im_out; i_out_y++) @@ -124,8 +92,7 @@ arm_status arm_convolve_HWC_q7_RGB(const q7_t *Im_in, if (i_ker_y < 0 || i_ker_y >= dim_im_in || i_ker_x < 0 || i_ker_x >= dim_im_in) { /* Equivalent to arm_fill_q15(0, pBuffer, ch_im_in) with assumption: ch_im_in = 3 */ - *__SIMD32(pBuffer) = 0x0; - *(pBuffer + 2) = 0; + arm_memset_q7((q7_t *)pBuffer, (q7_t)0, 3 * sizeof(q15_t)); pBuffer += 3; } else @@ -157,7 +124,8 @@ arm_status arm_convolve_HWC_q7_RGB(const q7_t *Im_in, * version 2, no weight shuffling required */ *pBuffer++ = top.half_words[0]; - *__SIMD32(pBuffer) = __PKHBT(bottom.word, top.word, 0); + int32_t packed_word = __PKHBT(bottom.word, top.word, 0); + arm_memcpy_q7((q7_t *)pBuffer, (q7_t *)&packed_word, 4); #else /* * big-endian, | 1st | 2nd | 3rd | omit | @@ -171,7 +139,8 @@ arm_status arm_convolve_HWC_q7_RGB(const q7_t *Im_in, * version 2, no weight shuffling required */ *pBuffer++ = bottom.half_words[0]; - *__SIMD32(pBuffer) = __PKHTB(top.word, bottom.word, 0); + int32_t packed_word = __PKHTB(top.word, bottom.word, 0); + arm_memcpy_q7((q7_t *)pBuffer, (q7_t *)&packed_word, 4); #endif pBuffer += 2; } @@ -238,7 +207,7 @@ arm_status arm_convolve_HWC_q7_RGB(const q7_t *Im_in, // check if number of input channels is 3 if (ch_im_in != 3) { - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } for (i = 0; i < ch_im_out; i++) @@ -273,7 +242,7 @@ arm_status arm_convolve_HWC_q7_RGB(const q7_t *Im_in, #endif /* ARM_MATH_DSP */ /* Return to application */ - return (ARM_MATH_SUCCESS); + return (ARM_CMSIS_NN_SUCCESS); } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_basic.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_basic.c index ba9ebd7..a74a1a7 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_basic.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_basic.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_convolve_HWC_q7_basic.c * Description: Q7 version of convolution * - * $Date: 09. October 2020 - * $Revision: V.1.0.1 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,55 +42,29 @@ * @{ */ -/** - * @brief Basic Q7 convolution function - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in input tensor dimention - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel filter kernel size - * @param[in] padding padding sizes - * @param[in] stride convolution stride - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out output tensor dimension - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns ARM_MATH_SUCCESS - * - * @details - * - * Buffer size: - * - * bufferA size: 2*ch_im_in*dim_kernel*dim_kernel - * - * bufferB size: 0 - * - * This basic version is designed to work for any input tensor and weight - * dimension. +/* + * Basic Q7 convolution function + * Refer function header for details */ -arm_status arm_convolve_HWC_q7_basic(const q7_t *Im_in, - const uint16_t dim_im_in, - const uint16_t ch_im_in, - const q7_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel, - const uint16_t padding, - const uint16_t stride, - const q7_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q7_t *Im_out, - const uint16_t dim_im_out, - q15_t *bufferA, - q7_t *bufferB) +arm_cmsis_nn_status arm_convolve_HWC_q7_basic(const q7_t *Im_in, + const uint16_t dim_im_in, + const uint16_t ch_im_in, + const q7_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel, + const uint16_t padding, + const uint16_t stride, + const q7_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q7_t *Im_out, + const uint16_t dim_im_out, + q15_t *bufferA, + q7_t *bufferB) { (void)bufferB; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ int16_t i_out_y, i_out_x, i_ker_y, i_ker_x; @@ -184,7 +158,7 @@ arm_status arm_convolve_HWC_q7_basic(const q7_t *Im_in, } #else /* Run the following code as reference implementation for Cortex-M0 and Cortex-M3 */ - + (void)bufferA; int i, j, k, l, m, n; int conv_out; int in_row, in_col; @@ -221,7 +195,7 @@ arm_status arm_convolve_HWC_q7_basic(const q7_t *Im_in, #endif /* ARM_MATH_DSP */ /* Return to application */ - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_basic_nonsquare.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_basic_nonsquare.c index 0c1cf7c..9079695 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_basic_nonsquare.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_basic_nonsquare.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_convolve_HWC_q7_basic.c * Description: Q7 version of convolution * - * $Date: January 26, 2021 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,54 +42,35 @@ * @{ */ -/** - * @brief Basic Q7 convolution function (non-sqaure shape) - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in_x input tensor dimention x - * @param[in] dim_im_in_y input tensor dimention y - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel_x filter kernel size x - * @param[in] dim_kernel_y filter kernel size y - * @param[in] padding_x padding size x - * @param[in] padding_y padding size y - * @param[in] stride_x convolution stride x - * @param[in] stride_y convolution stride y - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out_x output tensor dimension x - * @param[in] dim_im_out_y output tensor dimension y - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns ARM_MATH_SUCCESS +/* + * Basic Q7 convolution function (non-sqaure shape) + * Refer function header for details + * */ -arm_status arm_convolve_HWC_q7_basic_nonsquare(const q7_t *Im_in, - const uint16_t dim_im_in_x, - const uint16_t dim_im_in_y, - const uint16_t ch_im_in, - const q7_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel_x, - const uint16_t dim_kernel_y, - const uint16_t padding_x, - const uint16_t padding_y, - const uint16_t stride_x, - const uint16_t stride_y, - const q7_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q7_t *Im_out, - const uint16_t dim_im_out_x, - const uint16_t dim_im_out_y, - q15_t *bufferA, - q7_t *bufferB) +arm_cmsis_nn_status arm_convolve_HWC_q7_basic_nonsquare(const q7_t *Im_in, + const uint16_t dim_im_in_x, + const uint16_t dim_im_in_y, + const uint16_t ch_im_in, + const q7_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel_x, + const uint16_t dim_kernel_y, + const uint16_t padding_x, + const uint16_t padding_y, + const uint16_t stride_x, + const uint16_t stride_y, + const q7_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q7_t *Im_out, + const uint16_t dim_im_out_x, + const uint16_t dim_im_out_y, + q15_t *bufferA, + q7_t *bufferB) { (void)bufferB; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ int16_t i_out_y, i_out_x, i_ker_y, i_ker_x; @@ -223,7 +204,7 @@ arm_status arm_convolve_HWC_q7_basic_nonsquare(const q7_t *Im_in, #endif /* ARM_MATH_DSP */ /* Return to application */ - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_fast.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_fast.c index 1792844..8f28bd6 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_fast.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_fast.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_convolve_HWC_q7_fast.c * Description: Fast Q7 version of convolution * - * $Date: January 26, 2021 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,72 +42,29 @@ * @{ */ -/** - * @brief Fast Q7 convolution function - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in input tensor dimention - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel filter kernel size - * @param[in] padding padding sizes - * @param[in] stride convolution stride - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out output tensor dimension - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - * - * @details - * - * Buffer size: - * - * bufferA size: 2*ch_im_in*dim_kernel*dim_kernel - * - * bufferB size: 0 - * - * Input dimension constraints: - * - * ch_im_in is multiple of 4 ( because of the SIMD32 read and swap ) - * - * ch_im_out is multipe of 2 ( bacause 2x2 mat_mult kernel ) - * - * The im2col converts the Q7 tensor input into Q15 column, which is stored in - * bufferA. There is reordering happenning during this im2col process with - * arm_q7_to_q15_reordered_no_shift. For every four elements, the second and - * third elements are swapped. - * - * The computation kernel arm_nn_mat_mult_kernel_q7_q15_reordered does the - * GEMM computation with the reordered columns. - * - * To speed-up the determination of the padding condition, we split the - * computation into 3x3 parts, i.e., {top, mid, bottom} X {left, mid, right}. - * This reduces the total number of boundary condition checks and improves - * the data copying performance. +/* + * Fast Q7 convolution function + * Refer function header for details */ -arm_status arm_convolve_HWC_q7_fast(const q7_t *Im_in, - const uint16_t dim_im_in, - const uint16_t ch_im_in, - const q7_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel, - const uint16_t padding, - const uint16_t stride, - const q7_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q7_t *Im_out, - const uint16_t dim_im_out, - q15_t *bufferA, - q7_t *bufferB) +arm_cmsis_nn_status arm_convolve_HWC_q7_fast(const q7_t *Im_in, + const uint16_t dim_im_in, + const uint16_t ch_im_in, + const q7_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel, + const uint16_t padding, + const uint16_t stride, + const q7_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q7_t *Im_out, + const uint16_t dim_im_out, + q15_t *bufferA, + q7_t *bufferB) { (void)bufferB; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ int16_t i_out_y, i_out_x, i_ker_y, i_ker_x; @@ -123,7 +80,7 @@ arm_status arm_convolve_HWC_q7_fast(const q7_t *Im_in, if (ch_im_in % 4 != 0 || ch_im_out % 2 != 0) { /* check if the input dimension meets the constraints */ - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } /* @@ -339,7 +296,7 @@ arm_status arm_convolve_HWC_q7_fast(const q7_t *Im_in, if (ch_im_in % 4 != 0 || ch_im_out % 2 != 0) { /* check if the input dimension meets the constraints */ - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } for (i = 0; i < ch_im_out; i++) @@ -374,7 +331,7 @@ arm_status arm_convolve_HWC_q7_fast(const q7_t *Im_in, #endif /* ARM_MATH_DSP */ /* Return to application */ - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_fast_nonsquare.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_fast_nonsquare.c index 4507d15..a091be3 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_fast_nonsquare.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_HWC_q7_fast_nonsquare.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_convolve_HWC_q7_fast_nonsquare.c * Description: Fast Q7 version of convolution (non-sqaure shape) * - * $Date: January 26, 2021 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,60 +42,34 @@ * @{ */ -/** - * @brief Fast Q7 convolution function (non-sqaure shape) - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in_x input tensor dimention x - * @param[in] dim_im_in_y input tensor dimention y - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel_x filter kernel size x - * @param[in] dim_kernel_y filter kernel size y - * @param[in] padding_x padding size x - * @param[in] padding_y padding size y - * @param[in] stride_x convolution stride x - * @param[in] stride_y convolution stride y - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out_x output tensor dimension x - * @param[in] dim_im_out_y output tensor dimension y - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - * - * This function is the version with full list of optimization tricks, but with - * some contraints: - * ch_im_in is multiple of 4 - * ch_im_out is multiple of 2 +/* + * Fast Q7 convolution function (non-sqaure shape) + * Refer function header for details */ -arm_status arm_convolve_HWC_q7_fast_nonsquare(const q7_t *Im_in, - const uint16_t dim_im_in_x, - const uint16_t dim_im_in_y, - const uint16_t ch_im_in, - const q7_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel_x, - const uint16_t dim_kernel_y, - const uint16_t padding_x, - const uint16_t padding_y, - const uint16_t stride_x, - const uint16_t stride_y, - const q7_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q7_t *Im_out, - const uint16_t dim_im_out_x, - const uint16_t dim_im_out_y, - q15_t *bufferA, - q7_t *bufferB) +arm_cmsis_nn_status arm_convolve_HWC_q7_fast_nonsquare(const q7_t *Im_in, + const uint16_t dim_im_in_x, + const uint16_t dim_im_in_y, + const uint16_t ch_im_in, + const q7_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel_x, + const uint16_t dim_kernel_y, + const uint16_t padding_x, + const uint16_t padding_y, + const uint16_t stride_x, + const uint16_t stride_y, + const q7_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q7_t *Im_out, + const uint16_t dim_im_out_x, + const uint16_t dim_im_out_y, + q15_t *bufferA, + q7_t *bufferB) { (void)bufferB; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ int16_t i_out_y, i_out_x, i_ker_y, i_ker_x; @@ -111,7 +85,7 @@ arm_status arm_convolve_HWC_q7_fast_nonsquare(const q7_t *Im_in, if (ch_im_in % 4 != 0 || ch_im_out % 2 != 0) { /* check if the input dimension meets the constraints */ - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } /* @@ -336,7 +310,7 @@ arm_status arm_convolve_HWC_q7_fast_nonsquare(const q7_t *Im_in, if (ch_im_in % 4 != 0 || ch_im_out % 2 != 0) { /* check if the input dimension meets the constraints */ - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } for (i = 0; i < ch_im_out; i++) @@ -372,7 +346,7 @@ arm_status arm_convolve_HWC_q7_fast_nonsquare(const q7_t *Im_in, #endif /* ARM_MATH_DSP */ /* Return to application */ - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_fast_s16.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_fast_s16.c new file mode 100644 index 0000000..26c64fa --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_fast_s16.c @@ -0,0 +1,245 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * Copyright (C) 2010-2022 Arm Limited or its affiliates. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_convolve_fast_s16.c + * Description: Optimized s16 version of convolution. + * + * $Date: 19 April 2022 + * $Revision: V.2.0.0 + * + * Target Processor: Cortex-M cores + * + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" + +/** + * @ingroup groupNN + */ + +/** + * @addtogroup NNConv + * @{ + */ + +/* + * Basic s16 convolution function. + * + * Refer header file for details. Optimal use case for the DSP/MVE implementation is when input and output channels + * are multiples of 4 or atleast greater than 4. + * + */ + +arm_cmsis_nn_status arm_convolve_fast_s16(const cmsis_nn_context *ctx, + const cmsis_nn_conv_params *conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q15_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int64_t *bias_data, + const cmsis_nn_dims *output_dims, + q15_t *output_data) +{ + (void)bias_dims; + if (filter_dims->w * filter_dims->h * input_dims->c >= 512) + { + return ARM_CMSIS_NN_ARG_ERROR; + } + + if (ctx->buf == NULL && arm_convolve_s8_get_buffer_size(input_dims, filter_dims) > 0) + { + return ARM_CMSIS_NN_ARG_ERROR; + } + q15_t *buffer_a = (q15_t *)ctx->buf; + + const int32_t input_batches = input_dims->n; + const int32_t input_x = input_dims->w; + const int32_t input_y = input_dims->h; + const int32_t input_ch = input_dims->c; + const int32_t kernel_x = filter_dims->w; + const int32_t kernel_y = filter_dims->h; + const int32_t output_x = output_dims->w; + const int32_t output_y = output_dims->h; + const int32_t output_ch = output_dims->c; + + const int32_t pad_x = conv_params->padding.w; + const int32_t pad_y = conv_params->padding.h; + const int32_t stride_x = conv_params->stride.w; + const int32_t stride_y = conv_params->stride.h; + + const int16_t out_activation_min = conv_params->activation.min; + const int16_t out_activation_max = conv_params->activation.max; + int32_t *output_mult = quant_params->multiplier; + int32_t *output_shift = quant_params->shift; + + for (int i_batch = 0; i_batch < input_batches; i_batch++) + { +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) + /* Generate two columns from the input tensor a GEMM computation */ + q15_t *two_column_buf = buffer_a; + q15_t *out = output_data; + /* This part implements the im2col function */ + for (int32_t i_out_y = 0; i_out_y < output_y; i_out_y++) + { + for (int32_t i_out_x = 0; i_out_x < output_x; i_out_x++) + { + for (int32_t i_ker_y = i_out_y * stride_y - pad_y; i_ker_y < i_out_y * stride_y - pad_y + kernel_y; + i_ker_y++) + { + for (int32_t i_ker_x = i_out_x * stride_x - pad_x; i_ker_x < i_out_x * stride_x - pad_x + kernel_x; + i_ker_x++) + { + if (i_ker_y < 0 || i_ker_y >= input_y || i_ker_x < 0 || i_ker_x >= input_x) + { + /* Filling 0 for out-of-bound paddings */ + arm_memset_q7((q7_t *)two_column_buf, 0, sizeof(q15_t) * input_ch); + } + else + { + arm_memcpy_q7((q7_t *)two_column_buf, + (const q7_t *)(input_data + (i_ker_y * input_x + i_ker_x) * input_ch), + input_ch * sizeof(q15_t)); + } + two_column_buf += input_ch; + } + } + /* Computation is filed for every 2 columns */ + if (two_column_buf == buffer_a + 2 * input_ch * kernel_y * kernel_x) + { + out = arm_nn_mat_mult_kernel_s16(filter_data, + buffer_a, + output_ch, + output_shift, + output_mult, + out_activation_min, + out_activation_max, + (input_ch * kernel_y * kernel_x), + bias_data, + out); + + /* Counter reset */ + two_column_buf = buffer_a; + } + } + } + + /* Left-over because odd number of output pixels */ + if (two_column_buf != buffer_a) + { + const q7_t *ker_a = filter_data; + int i; + + for (i = 0; i < output_ch; i++) + { + /* Init the accumulator*/ + q31_t sum = 0; + + /* Point to the beginning of the im2col buffer where the input is available as a rearranged column */ + const q15_t *ip_as_col = buffer_a; + + /* 4 multiply and accumulates are done in one loop. */ + uint16_t col_count = (input_ch * kernel_y * kernel_x) >> 2; + + while (col_count) + { + q31_t ker_a1, ker_a2; + q31_t ip_b1, ip_b2; + + ker_a = read_and_pad(ker_a, &ker_a1, &ker_a2); + + ip_b1 = arm_nn_read_q15x2_ia(&ip_as_col); + sum = __SMLAD(ker_a1, ip_b1, sum); + ip_b2 = arm_nn_read_q15x2_ia(&ip_as_col); + sum = __SMLAD(ker_a2, ip_b2, sum); + + col_count--; + } + /* Handle left over mac */ + col_count = input_ch * kernel_y * kernel_x & 0x3; + while (col_count) + { + q7_t ker_a1 = *ker_a++; + q15_t ip_b1 = *ip_as_col++; + sum += ker_a1 * ip_b1; + col_count--; + } + if (bias_data) + { + q31_t reduced_multiplier = REDUCE_MULTIPLIER(output_mult[i]); + q63_t acc_64 = sum + bias_data[i]; + sum = arm_nn_requantize_s64(acc_64, reduced_multiplier, output_shift[i]); + } + else + { + sum = arm_nn_requantize(sum, output_mult[i], output_shift[i]); + } + sum = MAX(sum, out_activation_min); + sum = MIN(sum, out_activation_max); + *out++ = (q15_t)sum; + } + } +#else + (void)input_data; + (void)output_data; + (void)bias_data; + (void)filter_data; + (void)buffer_a; + (void)kernel_x; + (void)kernel_y; + (void)pad_x; + (void)pad_y; + (void)stride_x; + (void)stride_y; + (void)out_activation_min; + (void)out_activation_max; + (void)output_mult; + (void)output_shift; + return ARM_CMSIS_NN_ARG_ERROR; +#endif + /* Advance to the next batch */ + input_data += (input_x * input_y * input_ch); + output_data += (output_x * output_y * output_ch); + } + + /* Return to application */ + return ARM_CMSIS_NN_SUCCESS; +} + +int32_t arm_convolve_fast_s16_get_buffer_size(const cmsis_nn_dims *input_dims, const cmsis_nn_dims *filter_dims) +{ +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) + return (2 * input_dims->c * filter_dims->w * filter_dims->h) * (int32_t)sizeof(int16_t); +#else + (void)input_dims; + (void)filter_dims; + return 0; +#endif +} + +/** + * @} end of NNConv group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_s16.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_s16.c new file mode 100644 index 0000000..7d8d14f --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_s16.c @@ -0,0 +1,160 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * Copyright (C) 2010-2022 Arm Limited or its affiliates. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_convolve_s16.c + * Description: s16 version of convolution using symmetric quantization. + * + * $Date: 19 April 2022 + * $Revision: V.2.0.0 + * + * Target Processor: Cortex-M cores + * + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" + +/** + * @ingroup groupNN + */ + +/** + * @addtogroup NNConv + * @{ + */ + +/* + * Basic s16 convolution function. + * + * Refer header file for details. Optimal use case for the DSP/MVE implementation is when input and output channels + * are multiples of 4 or atleast greater than 4. + * + */ + +arm_cmsis_nn_status arm_convolve_s16(const cmsis_nn_context *ctx, + const cmsis_nn_conv_params *conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q15_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int64_t *bias_data, + const cmsis_nn_dims *output_dims, + q15_t *output_data) +{ + (void)bias_dims; + (void)ctx; + + const int32_t input_batches = input_dims->n; + const int32_t input_x = input_dims->w; + const int32_t input_y = input_dims->h; + const int32_t input_ch = input_dims->c; + const int32_t kernel_x = filter_dims->w; + const int32_t kernel_y = filter_dims->h; + const int32_t output_x = output_dims->w; + const int32_t output_y = output_dims->h; + const int32_t output_ch = output_dims->c; + + const int32_t pad_x = conv_params->padding.w; + const int32_t pad_y = conv_params->padding.h; + const int32_t stride_x = conv_params->stride.w; + const int32_t stride_y = conv_params->stride.h; + const int32_t dilation_x = conv_params->dilation.w; + const int32_t dilation_y = conv_params->dilation.h; + + const int32_t out_activation_min = conv_params->activation.min; + const int32_t out_activation_max = conv_params->activation.max; + int32_t *output_mult = quant_params->multiplier; + int32_t *output_shift = quant_params->shift; + + for (int i_batch = 0; i_batch < input_batches; i_batch++) + { + /* Run the following code as reference implementation for Cortex-M0 and Cortex-M3 */ + for (int32_t i_out_ch = 0; i_out_ch < output_ch; i_out_ch++) + { + const q31_t reduced_multiplier = REDUCE_MULTIPLIER(output_mult[i_out_ch]); + + for (int32_t base_idx_y = -pad_y, i_out_y = 0; i_out_y < output_y; base_idx_y += stride_y, i_out_y++) + { + for (int32_t base_idx_x = -pad_x, i_out_x = 0; i_out_x < output_x; base_idx_x += stride_x, i_out_x++) + { + int64_t conv_out_acc = 0; + + const int32_t start_y_max = (-base_idx_y + dilation_y - 1) / dilation_y; + const int32_t ker_y_start = MAX(0, start_y_max); + const int32_t start_x_max = (-base_idx_x + dilation_x - 1) / dilation_x; + const int32_t ker_x_start = MAX(0, start_x_max); + const int32_t end_min_y = (input_y - base_idx_y + dilation_y - 1) / dilation_y; + const int32_t ker_y_end = MIN(kernel_y, end_min_y); + const int32_t end_min_x = (input_x - base_idx_x + dilation_x - 1) / dilation_x; + const int32_t ker_x_end = MIN(kernel_x, end_min_x); + + for (int32_t i_ker_y = ker_y_start; i_ker_y < ker_y_end; i_ker_y++) + { + for (int32_t i_ker_x = ker_x_start; i_ker_x < ker_x_end; i_ker_x++) + { + const int32_t in_row = base_idx_y + dilation_y * i_ker_y; + const int32_t in_col = base_idx_x + dilation_x * i_ker_x; + + for (int32_t i_input_ch = 0; i_input_ch < input_ch; i_input_ch++) + { + conv_out_acc += input_data[(in_row * input_x + in_col) * input_ch + i_input_ch] * + filter_data[i_out_ch * input_ch * kernel_y * kernel_x + + (i_ker_y * kernel_x + i_ker_x) * input_ch + i_input_ch]; + } + } + } + + if (bias_data) + { + conv_out_acc += bias_data[i_out_ch]; + } + + int32_t conv_out = arm_nn_requantize_s64(conv_out_acc, reduced_multiplier, output_shift[i_out_ch]); + conv_out = MAX(conv_out, out_activation_min); + conv_out = MIN(conv_out, out_activation_max); + output_data[i_out_ch + (i_out_y * output_x + i_out_x) * output_ch] = (int16_t)conv_out; + } + } + } + /* Advance to the next batch */ + input_data += (input_x * input_y * input_ch); + output_data += (output_x * output_y * output_ch); + } + + /* Return to application */ + return ARM_CMSIS_NN_SUCCESS; +} + +int32_t arm_convolve_s16_get_buffer_size(const cmsis_nn_dims *input_dims, const cmsis_nn_dims *filter_dims) +{ + (void)input_dims; + (void)filter_dims; + return 0; +} + +/** + * @} end of NNConv group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_s8.c index ab5dbf5..2782521 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2022 Arm Limited or its affiliates. * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_convolve_s8.c * Description: s8 version of convolution using symmetric quantization. * - * $Date: January 26, 2021 - * $Revision: V.2.0.4 + * $Date: 19 April 2022 + * $Revision: V.3.0.0 * * Target Processor: Cortex-M cores * @@ -50,22 +50,27 @@ * */ -arm_status arm_convolve_s8(const cmsis_nn_context *ctx, - const cmsis_nn_conv_params *conv_params, - const cmsis_nn_per_channel_quant_params *quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input_data, - const cmsis_nn_dims *filter_dims, - const q7_t *filter_data, - const cmsis_nn_dims *bias_dims, - const int32_t *bias_data, - const cmsis_nn_dims *output_dims, - q7_t *output_data) +arm_cmsis_nn_status arm_convolve_s8(const cmsis_nn_context *ctx, + const cmsis_nn_conv_params *conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int32_t *bias_data, + const cmsis_nn_dims *output_dims, + q7_t *output_data) { (void)bias_dims; + + if (ctx->buf == NULL && arm_convolve_s8_get_buffer_size(input_dims, filter_dims) > 0) + { + return ARM_CMSIS_NN_ARG_ERROR; + } q15_t *buffer_a = (q15_t *)ctx->buf; - const uint16_t input_batches = input_dims->n; + const int32_t input_batches = input_dims->n; const uint16_t input_x = input_dims->w; const uint16_t input_y = input_dims->h; const uint16_t input_ch = input_dims->c; @@ -97,26 +102,32 @@ arm_status arm_convolve_s8(const cmsis_nn_context *ctx, int32_t buffer_fill_cnt = 0; int32_t padded = 0; const int32_t num_elem = kernel_x * kernel_y * input_ch; + const int32_t dilation_x = conv_params->dilation.w; + const int32_t dilation_y = conv_params->dilation.h; /* This part implements the im2col function */ for (int i_out_y = 0; i_out_y < output_y; i_out_y++) { for (int i_out_x = 0; i_out_x < output_x; i_out_x++) { - for (int i_ker_y = i_out_y * stride_y - pad_y; i_ker_y < i_out_y * stride_y - pad_y + kernel_y; - i_ker_y++) + const int32_t base_idx_x = stride_x * i_out_x - pad_x; + const int32_t base_idx_y = stride_y * i_out_y - pad_y; + + for (int32_t i_ker_y = 0; i_ker_y < kernel_y; i_ker_y++) { - for (int i_ker_x = i_out_x * stride_x - pad_x; i_ker_x < i_out_x * stride_x - pad_x + kernel_x; - i_ker_x++) + for (int32_t i_ker_x = 0; i_ker_x < kernel_x; i_ker_x++) { - if (i_ker_y < 0 || i_ker_y >= input_y || i_ker_x < 0 || i_ker_x >= input_x) + const int32_t k_y = base_idx_y + dilation_y * i_ker_y; + const int32_t k_x = base_idx_x + dilation_x * i_ker_x; + + if (k_y < 0 || k_y >= input_y || k_x < 0 || k_x >= input_x) { memset(im2col_buf, (int8_t)-input_offset, sizeof(q7_t) * input_ch); padded = 1; } else { - arm_memcpy_q7(im2col_buf, input_data + (i_ker_y * input_x + i_ker_x) * input_ch, input_ch); + arm_memcpy_q7(im2col_buf, input_data + (k_y * input_x + k_x) * input_ch, input_ch); } im2col_buf += input_ch; } @@ -128,33 +139,15 @@ arm_status arm_convolve_s8(const cmsis_nn_context *ctx, if (buffer_fill_cnt == 4 && (padded == 0)) { buffer_fill_cnt = 0; - for (int i_out_ch = 0; i_out_ch < output_ch; i_out_ch++) - { - int32_t sum_row; - int32_t acc[4]; - - (void)arm_nn_mat_mul_core_4x_s8( - num_elem, num_elem, (q7_t *)buffer_a, filter_data + num_elem * i_out_ch, &sum_row, acc); - int32x4_t s_offset = vdupq_n_s32(sum_row); - - int32x4_t res = vldrwq_s32(acc); - s_offset = vmulq_n_s32(s_offset, input_offset); - if (bias_data) - { - res = vaddq_n_s32(res, bias_data[i_out_ch]); - } - res = vaddq_s32(res, s_offset); - res = arm_requantize_mve(res, output_mult[i_out_ch], output_shift[i_out_ch]); - res = vaddq_n_s32(res, out_offset); - - res = vmaxq_s32(res, vdupq_n_s32(out_activation_min)); - res = vminq_s32(res, vdupq_n_s32(out_activation_max)); - - const uint32x4_t scatter_offset = {0, output_ch, output_ch * 2, output_ch * 3}; - vstrbq_scatter_offset_s32(out, scatter_offset, res); - out++; - } - out += (3 * output_ch); + out = arm_nn_mat_mul_core_4x_s8(num_elem, + num_elem, + (q7_t *)buffer_a, + filter_data, + output_ch, + conv_params, + quant_params, + bias_data, + out); im2col_buf = (q7_t *)buffer_a; } else if (buffer_fill_cnt == 4 && (padded != 0)) @@ -198,8 +191,10 @@ arm_status arm_convolve_s8(const cmsis_nn_context *ctx, bias_data, out); } +#else // #if defined(ARM_MATH_MVEI) + const uint16_t dilation_x = conv_params->dilation.w; + const uint16_t dilation_y = conv_params->dilation.h; -#elif defined(ARM_MATH_DSP) int32_t i_out_y, i_out_x, i_ker_y, i_ker_x; /* Generate two columns from the input tensor a GEMM computation */ @@ -211,12 +206,17 @@ arm_status arm_convolve_s8(const cmsis_nn_context *ctx, { for (i_out_x = 0; i_out_x < output_x; i_out_x++) { - for (i_ker_y = i_out_y * stride_y - pad_y; i_ker_y < i_out_y * stride_y - pad_y + kernel_y; i_ker_y++) + const int32_t base_idx_y = stride_y * i_out_y - pad_y; + const int32_t base_idx_x = stride_x * i_out_x - pad_x; + + for (i_ker_y = 0; i_ker_y < kernel_y; i_ker_y++) { - for (i_ker_x = i_out_x * stride_x - pad_x; i_ker_x < i_out_x * stride_x - pad_x + kernel_x; - i_ker_x++) + for (i_ker_x = 0; i_ker_x < kernel_x; i_ker_x++) { - if (i_ker_y < 0 || i_ker_y >= input_y || i_ker_x < 0 || i_ker_x >= input_x) + const int32_t k_y = base_idx_y + dilation_y * i_ker_y; + const int32_t k_x = base_idx_x + dilation_x * i_ker_x; + + if (k_y < 0 || k_y >= input_y || k_x < 0 || k_x >= input_x) { /* Filling 0 for out-of-bound paddings */ memset(two_column_buf, 0, sizeof(q15_t) * input_ch); @@ -224,10 +224,8 @@ arm_status arm_convolve_s8(const cmsis_nn_context *ctx, else { /* Copying the pixel data to column */ - arm_q7_to_q15_with_offset(input_data + (i_ker_y * input_x + i_ker_x) * input_ch, - two_column_buf, - input_ch, - input_offset); + arm_q7_to_q15_with_offset( + input_data + (k_y * input_x + k_x) * input_ch, two_column_buf, input_ch, input_offset); } two_column_buf += input_ch; } @@ -273,6 +271,7 @@ arm_status arm_convolve_s8(const cmsis_nn_context *ctx, const q15_t *ip_as_col = buffer_a; /* 4 multiply and accumulates are done in one loop. */ +#if defined(ARM_MATH_DSP) uint16_t col_count = (input_ch * kernel_y * kernel_x) >> 2; while (col_count) @@ -291,6 +290,9 @@ arm_status arm_convolve_s8(const cmsis_nn_context *ctx, } /* Handle left over mac */ col_count = input_ch * kernel_y * kernel_x & 0x3; +#else + uint16_t col_count = input_ch * kernel_y * kernel_x; +#endif while (col_count) { q7_t ker_a1 = *ker_a++; @@ -306,74 +308,27 @@ arm_status arm_convolve_s8(const cmsis_nn_context *ctx, *out++ = (q7_t)sum; } } -#else - /* Run the following code as reference implementation for Cortex-M0 and Cortex-M3 */ - (void)buffer_a; - int32_t i_out_ch, i_out_y, i_out_x, i_input_ch, i_ker_y, i_ker_x; - int32_t conv_out; - - for (i_out_ch = 0; i_out_ch < output_ch; i_out_ch++) - { - for (i_out_y = 0; i_out_y < output_y; i_out_y++) - { - for (i_out_x = 0; i_out_x < output_x; i_out_x++) - { - conv_out = 0; - - const int32_t base_idx_y = stride_y * i_out_y - pad_y; - const int32_t base_idx_x = stride_x * i_out_x - pad_x; - - const int32_t ker_y_start = MAX(0, -base_idx_y); - const int32_t ker_x_start = MAX(0, -base_idx_x); - - const int32_t ker_y_end = MIN(kernel_y, input_y - base_idx_y); - const int32_t ker_x_end = MIN(kernel_x, input_x - base_idx_x); - - for (i_ker_y = ker_y_start; i_ker_y < ker_y_end; i_ker_y++) - { - for (i_ker_x = ker_x_start; i_ker_x < ker_x_end; i_ker_x++) - { - const int32_t in_row = base_idx_y + i_ker_y; - const int32_t in_col = base_idx_x + i_ker_x; - for (i_input_ch = 0; i_input_ch < input_ch; i_input_ch++) - { - conv_out += - (input_data[(in_row * input_x + in_col) * input_ch + i_input_ch] + input_offset) * - filter_data[i_out_ch * input_ch * kernel_y * kernel_x + - (i_ker_y * kernel_x + i_ker_x) * input_ch + i_input_ch]; - } - } - } - if (bias_data) - { - conv_out += bias_data[i_out_ch]; - } - conv_out = arm_nn_requantize(conv_out, output_mult[i_out_ch], output_shift[i_out_ch]); - conv_out += out_offset; - conv_out = MAX(conv_out, out_activation_min); - conv_out = MIN(conv_out, out_activation_max); - output_data[i_out_ch + (i_out_y * output_x + i_out_x) * output_ch] = (int8_t)conv_out; - } - } - } -#endif +#endif // #if defined(ARM_MATH_MVEI) /* Advance to the next batch */ input_data += (input_x * input_y * input_ch); output_data += (output_x * output_y * output_ch); } /* Return to application */ - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } int32_t arm_convolve_s8_get_buffer_size(const cmsis_nn_dims *input_dims, const cmsis_nn_dims *filter_dims) { -#if defined(ARM_MATH_DSP) - return (2 * input_dims->c * filter_dims->w * filter_dims->h) * (int32_t)sizeof(int16_t); +#if defined(ARM_MATH_MVEI) + int32_t col_length = input_dims->c * filter_dims->w * filter_dims->h; + // Get number of complete int16 lanes(multiple of 8) for given col_length. This is dependent on + // implementation of arm_nn_mat_mult_s8 + col_length = (col_length + 7) / 8; + // 4 -> number of im2col buffers, 8 -> 8 elements per Q register + return 4 * col_length * 8 * (int32_t)sizeof(int8_t); #else - (void)input_dims; - (void)filter_dims; - return 0; + return (2 * input_dims->c * filter_dims->w * filter_dims->h) * (int32_t)sizeof(int16_t); #endif } diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_wrapper_s16.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_wrapper_s16.c new file mode 100644 index 0000000..efdbc41 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_wrapper_s16.c @@ -0,0 +1,134 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * Copyright (C) 2021-2022 Arm Limited or its affiliates. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_convolve_wrapper_s16.c + * Description: s16 convolution layer wrapper function with the main purpose to call the optimal kernel available in + * cmsis-nn to perform the convolution. + * + * $Date: 19 April 2022 + * $Revision: V.2.0.0 + * + * Target Processor: Cortex-M cores + * + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" + +/** + * @ingroup groupNN + */ + +/** + * @addtogroup NNConv + * @{ + */ + +/* + * Convolution layer + * + * Refer header file for details. + * + */ + +arm_cmsis_nn_status arm_convolve_wrapper_s16(const cmsis_nn_context *ctx, + const cmsis_nn_conv_params *conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q15_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int64_t *bias_data, + const cmsis_nn_dims *output_dims, + q15_t *output_data) +{ +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) + if (filter_dims->w * filter_dims->h * input_dims->c < 512 && + (conv_params->dilation.w == 1 && conv_params->dilation.h == 1)) + { + return arm_convolve_fast_s16(ctx, + conv_params, + quant_params, + input_dims, + input_data, + filter_dims, + filter_data, + bias_dims, + bias_data, + output_dims, + output_data); + } + else + { + return arm_convolve_s16(ctx, + conv_params, + quant_params, + input_dims, + input_data, + filter_dims, + filter_data, + bias_dims, + bias_data, + output_dims, + output_data); + } +#else + return arm_convolve_s16(ctx, + conv_params, + quant_params, + input_dims, + input_data, + filter_dims, + filter_data, + bias_dims, + bias_data, + output_dims, + output_data); +#endif +} + +int32_t arm_convolve_wrapper_s16_get_buffer_size(const cmsis_nn_conv_params *conv_params, + const cmsis_nn_dims *input_dims, + const cmsis_nn_dims *filter_dims, + const cmsis_nn_dims *output_dims) +{ + (void)conv_params; + (void)output_dims; + +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) + if (filter_dims->w * filter_dims->h * input_dims->c < 512 && + (conv_params->dilation.w == 1 && conv_params->dilation.h == 1)) + { + return arm_convolve_fast_s16_get_buffer_size(input_dims, filter_dims); + } + + return arm_convolve_s16_get_buffer_size(input_dims, filter_dims); +#else + return arm_convolve_s16_get_buffer_size(input_dims, filter_dims); +#endif +} + +/** + * @} end of NNConv group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_wrapper_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_wrapper_s8.c index 662b427..9cd898e 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_wrapper_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_wrapper_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -24,8 +24,8 @@ * Description: s8 convolution layer wrapper function with the main purpose to call the optimal kernel available in * cmsis-nn to perform the convolution. * - * $Date: 09. October 2020 - * $Revision: V.1.0.1 + * $Date: 4 August 2022 + * $Revision: V.2.1.1 * * Target Processor: Cortex-M cores * @@ -49,20 +49,21 @@ * */ -arm_status arm_convolve_wrapper_s8(const cmsis_nn_context *ctx, - const cmsis_nn_conv_params *conv_params, - const cmsis_nn_per_channel_quant_params *quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input_data, - const cmsis_nn_dims *filter_dims, - const q7_t *filter_data, - const cmsis_nn_dims *bias_dims, - const int32_t *bias_data, - const cmsis_nn_dims *output_dims, - q7_t *output_data) +arm_cmsis_nn_status arm_convolve_wrapper_s8(const cmsis_nn_context *ctx, + const cmsis_nn_conv_params *conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *filter_dims, + const q7_t *filter_data, + const cmsis_nn_dims *bias_dims, + const int32_t *bias_data, + const cmsis_nn_dims *output_dims, + q7_t *output_data) { - if ((conv_params->padding.w == 0) && (conv_params->padding.h == 0) && (input_dims->c % 4 == 0) && - (conv_params->stride.w == 1) && (conv_params->stride.h == 1) && (filter_dims->w == 1) && (filter_dims->h == 1)) + if ((conv_params->padding.w == 0) && (conv_params->padding.h == 0) && (conv_params->stride.w == 1) && + (conv_params->stride.h == 1) && (filter_dims->w == 1) && (filter_dims->h == 1) && + (conv_params->dilation.w == 1 && conv_params->dilation.h == 1)) { return arm_convolve_1x1_s8_fast(ctx, conv_params, @@ -76,8 +77,7 @@ arm_status arm_convolve_wrapper_s8(const cmsis_nn_context *ctx, output_dims, output_data); } - else if ((output_dims->h == 1) && (input_dims->h == 1) && (filter_dims->h == 1) && (output_dims->w % 4 == 0) && - (input_dims->n == 1)) + else if ((input_dims->h == 1) && (output_dims->w % 4 == 0) && conv_params->dilation.w == 1 && (filter_dims->h == 1)) { return arm_convolve_1_x_n_s8(ctx, conv_params, @@ -112,13 +112,14 @@ int32_t arm_convolve_wrapper_s8_get_buffer_size(const cmsis_nn_conv_params *conv const cmsis_nn_dims *filter_dims, const cmsis_nn_dims *output_dims) { - if ((conv_params->padding.w == 0) && (conv_params->padding.h == 0) && (input_dims->c % 4 == 0) && - (conv_params->stride.w == 1) && (conv_params->stride.h == 1) && (filter_dims->w == 1) && (filter_dims->h == 1)) + if ((conv_params->padding.w == 0) && (conv_params->padding.h == 0) && (conv_params->stride.w == 1) && + (conv_params->stride.h == 1) && (filter_dims->w == 1) && (filter_dims->h == 1) && + (conv_params->dilation.w == 1 && conv_params->dilation.h == 1)) { return arm_convolve_1x1_s8_fast_get_buffer_size(input_dims); } - else if ((output_dims->h == 1) && (input_dims->h == 1) && (filter_dims->h == 1) && (output_dims->w % 4 == 0) && - (input_dims->n == 1)) + else if ((input_dims->h == 1) && (output_dims->w % 4 == 0) && (conv_params->dilation.w == 1) && + (filter_dims->h == 1)) { return arm_convolve_1_x_n_s8_get_buffer_size(input_dims, filter_dims); } diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_3x3_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_3x3_s8.c index bd0fbf5..def3b47 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_3x3_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_3x3_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -24,8 +24,8 @@ * Description: Optimized s8 depthwise convolution function for channel * multiplier of 1 and 3x3 kernel size. * - * $Date: 09. October 2020 - * $Revision: V.2.0.1 + * $Date: 19 July 2022 + * $Revision: V.3.1.0 * * Target Processor: Cortex-M CPUs * @@ -51,17 +51,17 @@ * */ -arm_status arm_depthwise_conv_3x3_s8(const cmsis_nn_context *ctx, - const cmsis_nn_dw_conv_params *dw_conv_params, - const cmsis_nn_per_channel_quant_params *quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input, - const cmsis_nn_dims *filter_dims, - const q7_t *kernel, - const cmsis_nn_dims *bias_dims, - const int32_t *bias, - const cmsis_nn_dims *output_dims, - q7_t *output) +arm_cmsis_nn_status arm_depthwise_conv_3x3_s8(const cmsis_nn_context *ctx, + const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input, + const cmsis_nn_dims *filter_dims, + const q7_t *kernel, + const cmsis_nn_dims *bias_dims, + const int32_t *bias, + const cmsis_nn_dims *output_dims, + q7_t *output) { (void)ctx; (void)bias_dims; @@ -86,14 +86,14 @@ arm_status arm_depthwise_conv_3x3_s8(const cmsis_nn_context *ctx, /* Check input constraints input_ch == output_ch */ if (input_ch != output_ch) { - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } /* Check input constraints pad_x <= 1 */ if (pad_x > 1 || filter_dims->w != 3 || filter_dims->h != 3) { - return ARM_MATH_ARGUMENT_ERROR; + return ARM_CMSIS_NN_ARG_ERROR; } - + const int32_t *bias_base = bias; for (int32_t in_h = -pad_y, out_h = 0, out_idx = 0; out_h < output_y; in_h += stride_y, ++out_h) { for (int32_t in_w = -pad_x, out_w = 0, ker_h_start = MAX(0, -in_h); out_w < output_x; in_w += stride_x, ++out_w) @@ -101,12 +101,20 @@ arm_status arm_depthwise_conv_3x3_s8(const cmsis_nn_context *ctx, int32_t in_ch = 0; int32_t ker_w_start = MAX(0, -in_w); + bias = bias_base; for (; in_ch <= (input_ch - 4); in_ch += 4) { - int32_t out_buff0 = bias[in_ch + 0]; - int32_t out_buff1 = bias[in_ch + 1]; - int32_t out_buff2 = bias[in_ch + 2]; - int32_t out_buff3 = bias[in_ch + 3]; + int32_t out_buff0 = 0; + int32_t out_buff1 = 0; + int32_t out_buff2 = 0; + int32_t out_buff3 = 0; + if (bias) + { + out_buff0 = *bias++; + out_buff1 = *bias++; + out_buff2 = *bias++; + out_buff3 = *bias++; + } const int8_t *input_ptr = input + (in_h + ker_h_start) * (input_ch * input_x) + in_w * input_ch + in_ch; const int8_t *kernel_ptr = kernel + ker_h_start * (input_ch * 3) + in_ch; @@ -174,7 +182,11 @@ arm_status arm_depthwise_conv_3x3_s8(const cmsis_nn_context *ctx, // Leftover for (; in_ch < input_ch; ++in_ch) { - int32_t out_buff = bias[in_ch]; + int32_t out_buff = 0; + if (bias) + { + out_buff = *bias++; + } const int8_t *input_ptr = input + (in_h + ker_h_start) * (input_ch * input_x) + in_w * input_ch + in_ch; const int8_t *kernel_ptr = kernel + ker_h_start * (input_ch * 3) + in_ch; @@ -206,7 +218,7 @@ arm_status arm_depthwise_conv_3x3_s8(const cmsis_nn_context *ctx, } /* Return to application */ - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_fast_s16.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_fast_s16.c new file mode 100644 index 0000000..20201b9 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_fast_s16.c @@ -0,0 +1,471 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * SPDX-FileCopyrightText: Copyright 2022 Arm Limited and/or its affiliates + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_depthwise_conv_fast_s16.c + * Description: Optimized s16 depthwise separable convolution function for + * channel multiplier of 1. + * + * $Date: 6 July 2022 + * $Revision: V.1.1.0 + * + * Target Processor: Cortex-M CPUs + * + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" + +/** + * @ingroup groupNN + */ + +/** + * @addtogroup NNConv + * @{ + */ + +/* + * Optimized s16 depthwise convolution function with constraint that in_channel equals out_channel + * + * Refer prototype header file for details. + * + */ + +arm_cmsis_nn_status arm_depthwise_conv_fast_s16(const cmsis_nn_context *ctx, + const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q15_t *input, + const cmsis_nn_dims *filter_dims, + const q7_t *kernel, + const cmsis_nn_dims *bias_dims, + const int64_t *bias, + const cmsis_nn_dims *output_dims, + q15_t *output) +{ + const int32_t input_ch = input_dims->c; + const int32_t output_ch = output_dims->c; + + /* Check input constraints input_ch == output_ch */ + if (input_ch != output_ch) + { + return ARM_CMSIS_NN_ARG_ERROR; + } + + if (filter_dims->w * filter_dims->h >= 512) + { + return ARM_CMSIS_NN_ARG_ERROR; + } + + if (ctx->buf == NULL && arm_depthwise_conv_fast_s16_get_buffer_size(input_dims, filter_dims) > 0) + { + return ARM_CMSIS_NN_ARG_ERROR; + } + +#if defined(ARM_MATH_DSP) + (void)bias_dims; + const int32_t input_x = input_dims->w; + const int32_t input_y = input_dims->h; + const int32_t input_batches = input_dims->n; + const int32_t kernel_x = filter_dims->w; + const int32_t kernel_y = filter_dims->h; + const int32_t pad_x = dw_conv_params->padding.w; + const int32_t pad_y = dw_conv_params->padding.h; + const int32_t stride_x = dw_conv_params->stride.w; + const int32_t stride_y = dw_conv_params->stride.h; + const int32_t *output_shift = quant_params->shift; + const int32_t *output_mult = quant_params->multiplier; + const int32_t output_x = output_dims->w; + const int32_t output_y = output_dims->h; + const int32_t output_activation_min = dw_conv_params->activation.min; + const int32_t output_activation_max = dw_conv_params->activation.max; + q15_t *buffer_a = (q15_t *)ctx->buf; + +#if defined(ARM_MATH_MVEI) + int16_t *lhs_buffer = buffer_a; + int16_t *out = output; + int buffer_count = 0; + const int32_t kernel_size = kernel_x * kernel_y; + + for (int i_batch = 0; i_batch < input_batches; i_batch++) + { + /* This part implements the im2col function */ + for (int i_out_y = 0, base_idx_y = -pad_y; i_out_y < output_y; base_idx_y += stride_y, i_out_y++) + { + for (int i_out_x = 0, base_idx_x = -pad_x; i_out_x < output_x; base_idx_x += stride_x, i_out_x++) + { + for (int i_ker_y = base_idx_y; i_ker_y < base_idx_y + kernel_y; i_ker_y++) + { + for (int i_ker_x = base_idx_x; i_ker_x < base_idx_x + kernel_x; i_ker_x++) + { + if (i_ker_y < 0 || i_ker_y >= input_y || i_ker_x < 0 || i_ker_x >= input_x) + { + memset(lhs_buffer, (int16_t)0, (uint32_t)(input_ch * sizeof(int16_t))); + } + else + { + arm_memcpy_q15(lhs_buffer, + (int16_t *)(input + (i_ker_y * input_x + i_ker_x) * input_ch), + (uint32_t)(input_ch * sizeof(int16_t))); + } + lhs_buffer += input_ch; + } + } + buffer_count++; + if (buffer_count == 4) + { + lhs_buffer = buffer_a; + + out = arm_nn_depthwise_conv_nt_t_s16(lhs_buffer, + kernel, + input_ch, + output_shift, + output_mult, + output_activation_min, + output_activation_max, + kernel_size, + bias, + out); + buffer_count = 0; + } + } + } + input += input_x * input_y * input_ch; + } + + /* Handle left over buffers */ + lhs_buffer = buffer_a; + for (int i_buf = 0; i_buf < buffer_count; i_buf++) + { + int32_t loop_count = (input_ch + 3) / 4; + int32_t num_ch_to_process = input_ch; + + for (int i_loop_cnt = 0, offset = 0; i_loop_cnt < loop_count; num_ch_to_process -= 4, offset += 4, i_loop_cnt++) + { + const int8_t *row_0 = kernel + offset; + const int16_t *col_0 = lhs_buffer + (kernel_size * input_ch * i_buf) + offset; + + int32x4_t out_0 = vdupq_n_s32(0); + + for (int i_ker = 0; i_ker < kernel_size; i_ker++) + { + const int32x4_t ker_0 = vldrbq_s32(row_0); + + int32x4_t ip_0 = vldrhq_s32(col_0); + out_0 += vmulq_s32(ip_0, ker_0); + + col_0 += input_ch; + row_0 += input_ch; + } + + int64_t in_requantize_0 = (int64_t)out_0[0]; + int64_t in_requantize_1 = (int64_t)out_0[1]; + int64_t in_requantize_2 = (int64_t)out_0[2]; + int64_t in_requantize_3 = (int64_t)out_0[3]; + + if (bias) + { + in_requantize_0 += bias[offset]; + in_requantize_1 += bias[offset + 1]; + in_requantize_2 += bias[offset + 2]; + in_requantize_3 += bias[offset + 3]; + } + + int32_t reduced_multiplier_0 = REDUCE_MULTIPLIER(output_mult[offset]); + int32_t reduced_multiplier_1 = REDUCE_MULTIPLIER(output_mult[offset + 1]); + int32_t reduced_multiplier_2 = REDUCE_MULTIPLIER(output_mult[offset + 2]); + int32_t reduced_multiplier_3 = REDUCE_MULTIPLIER(output_mult[offset + 3]); + + out_0[0] = arm_nn_requantize_s64(in_requantize_0, reduced_multiplier_0, output_shift[offset]); + out_0[1] = arm_nn_requantize_s64(in_requantize_1, reduced_multiplier_1, output_shift[offset + 1]); + out_0[2] = arm_nn_requantize_s64(in_requantize_2, reduced_multiplier_2, output_shift[offset + 2]); + out_0[3] = arm_nn_requantize_s64(in_requantize_3, reduced_multiplier_3, output_shift[offset + 3]); + + out_0 = vmaxq_s32(out_0, vdupq_n_s32(output_activation_min)); + out_0 = vminq_s32(out_0, vdupq_n_s32(output_activation_max)); + + mve_pred16_t p = vctp32q((uint32_t)num_ch_to_process); + vstrhq_p_s32(out, out_0, p); + + out += 4; + } + + const int tail_ch = input_ch & 0x3; + if (tail_ch != 0) + { + out -= (4 - tail_ch); + } + } + +#else // ARM_MATH_DSP + + /* Run the following code in cores using DSP extension */ + q15_t *const col_buffer_start = buffer_a; + q15_t *col_buffer = col_buffer_start; + const int64_t *const bias_start_pos = bias; + const int32_t *const out_mult_start_pos = output_mult; + const int32_t *const out_shift_start_pos = output_shift; + uint16_t row_count; + uint16_t row_shift; + int32_t result; + + for (int i_batch = 0; i_batch < input_batches; i_batch++) + { + for (int i_out_y = 0; i_out_y < output_y; i_out_y++) + { + const int16_t base_idx_y = (i_out_y * stride_y) - pad_y; + for (int i_out_x = 0; i_out_x < output_x; i_out_x++) + { + const int16_t base_idx_x = (i_out_x * stride_x) - pad_x; + + /* Out of bounds is only considered for the y axis as it provides a contiguous zero'ing opportunity than + along the x axis */ + const int ker_y_start = MAX(0, -base_idx_y); + /* Condition for kernel end dimension: (base_idx_y + ker_y_end) < input_y */ + const int ker_y_end = MIN(kernel_y, input_y - base_idx_y); + + int32_t index = 0; + if (ker_y_start != 0) + { + memset(&col_buffer[index], 0, (kernel_x * input_ch) * ker_y_start * sizeof(q15_t)); + index += (kernel_x * input_ch) * ker_y_start; + } + + for (int i_ker_y = ker_y_start; i_ker_y < ker_y_end; i_ker_y++) + { + const int32_t idx_y = base_idx_y + i_ker_y; + + for (int i_ker_x = 0; i_ker_x < kernel_x; i_ker_x++) + { + const int32_t idx_x = base_idx_x + i_ker_x; + + if (idx_x < 0 || idx_x >= input_x) + { + memset(&col_buffer[index], 0, input_ch * sizeof(q15_t)); + } + else + { + arm_memcpy_q15(&col_buffer[index], + input + (idx_y * input_x + idx_x) * input_ch, + input_ch * sizeof(q15_t)); + } + index += input_ch; + } + } + + const int diff = kernel_y - ker_y_end; + if (diff != 0) + { + memset(&col_buffer[index], 0, (kernel_x * input_ch) * diff * sizeof(q15_t)); + } + + row_count = output_ch / 4; + row_shift = 0; + bias = bias_start_pos; + output_mult = out_mult_start_pos; + output_shift = out_shift_start_pos; + + while (row_count) + { + q31_t sum_1 = 0; + q31_t sum_2 = 0; + q31_t sum_3 = 0; + q31_t sum_4 = 0; + + int32_t output_mult_1 = REDUCE_MULTIPLIER(output_mult[0]); + int32_t output_mult_2 = REDUCE_MULTIPLIER(output_mult[1]); + int32_t output_mult_3 = REDUCE_MULTIPLIER(output_mult[2]); + int32_t output_mult_4 = REDUCE_MULTIPLIER(output_mult[3]); + output_mult += 4; + + uint16_t col_count = (kernel_x * kernel_y) / 2; + q15_t *col_pos = col_buffer_start + row_shift; + const q7_t *row_pos = kernel + row_shift; + row_shift += 4; + + while (col_count) + { + /* General idea is to read 4 + 4 (input, kernel) pair and re-arrange them in the right order to + use in a SMLAD instruction . One run of this loop produces 4 partial outputs with 8 MACs. */ + q31_t row_a1, row_a2, row_b1, row_b2, col_a, row_c, col_b, col_c; + + /* Read 4 weights */ + row_b1 = arm_nn_read_q7x4(row_pos); + row_a1 = arm_nn_read_q7x4(row_pos + input_ch); + col_a = arm_nn_read_q15x2(col_pos); + col_b = arm_nn_read_q15x2(col_pos + input_ch); + + row_a2 = __SXTB16(row_b1); + row_b1 = __SXTB16(__ROR(row_b1, 8)); + + row_b2 = __SXTB16(row_a1); + row_a1 = __SXTB16(__ROR(row_a1, 8)); + + col_c = __PKHBT(col_b, col_a, 16); + col_a = __PKHTB(col_b, col_a, 16); + row_c = __PKHBT(row_b2, row_a2, 16); + sum_1 = __SMLAD(col_c, row_c, sum_1); + + row_c = __PKHBT(row_b1, row_a1, 16); + sum_2 = __SMLAD(col_a, row_c, sum_2); + + col_a = arm_nn_read_q15x2(col_pos + 2); + col_b = arm_nn_read_q15x2(col_pos + input_ch + 2); + + col_c = __PKHBT(col_b, col_a, 16); + col_a = __PKHTB(col_b, col_a, 16); + row_c = __PKHTB(row_a2, row_b2, 16); + sum_3 = __SMLAD(col_c, row_c, sum_3); + + row_c = __PKHTB(row_a1, row_b1, 16); + sum_4 = __SMLAD(col_a, row_c, sum_4); + + row_pos += input_ch << 1; + col_pos += input_ch << 1; + col_count--; + } + + col_count = (kernel_x * kernel_y) & 0x1; + while (col_count) + { + sum_1 += row_pos[0] * col_pos[0]; + sum_2 += row_pos[1] * col_pos[1]; + sum_3 += row_pos[2] * col_pos[2]; + sum_4 += row_pos[3] * col_pos[3]; + + row_pos += input_ch; + col_pos += input_ch; + + col_count--; + } + + int64_t acc_1 = sum_1; + int64_t acc_2 = sum_2; + int64_t acc_3 = sum_3; + int64_t acc_4 = sum_4; + + if (bias) + { + acc_1 += *bias++; + acc_2 += *bias++; + acc_3 += *bias++; + acc_4 += *bias++; + } + + result = arm_nn_requantize_s64(acc_1, output_mult_1, *output_shift++); + result = MAX(result, output_activation_min); + result = MIN(result, output_activation_max); + *output++ = (q15_t)result; + + result = arm_nn_requantize_s64(acc_2, output_mult_2, *output_shift++); + result = MAX(result, output_activation_min); + result = MIN(result, output_activation_max); + *output++ = (q15_t)result; + + result = arm_nn_requantize_s64(acc_3, output_mult_3, *output_shift++); + result = MAX(result, output_activation_min); + result = MIN(result, output_activation_max); + *output++ = (q15_t)result; + + result = arm_nn_requantize_s64(acc_4, output_mult_4, *output_shift++); + result = MAX(result, output_activation_min); + result = MIN(result, output_activation_max); + *output++ = (q15_t)result; + + row_count--; + } + + row_count = output_ch & 0x3; + while (row_count) + { + q15_t *col_pos = col_buffer_start + row_shift; + const q7_t *row_pos = kernel + row_shift; + q31_t sum = 0; + const uint16_t col_count = (kernel_x * kernel_y); + row_shift += 1; + + for (int i = 0; i < col_count; i++) + { + sum += row_pos[i * input_ch] * col_pos[i * input_ch]; + } + int64_t acc = sum; + if (bias) + { + acc += *bias++; + } + result = arm_nn_requantize_s64(acc, REDUCE_MULTIPLIER(*output_mult), *output_shift++); + output_mult++; + result = MAX(result, output_activation_min); + result = MIN(result, output_activation_max); + *output++ = (q15_t)result; + + row_count--; + } + // clear counter and pointers + col_buffer = col_buffer_start; + } + } + + /* Advance to the next batch */ + input += (input_x * input_y * input_ch); + } +#endif +#else + /* Run the following code as reference implementation for Cortex-M0 and Cortex-M3 */ + return arm_depthwise_conv_s16(ctx, + dw_conv_params, + quant_params, + input_dims, + input, + filter_dims, + kernel, + bias_dims, + bias, + output_dims, + output); +#endif /* ARM_MATH_MVEI | ARM_MATH_DSP */ + + /* Return to application */ + return ARM_CMSIS_NN_SUCCESS; +} + +int32_t arm_depthwise_conv_fast_s16_get_buffer_size(const cmsis_nn_dims *input_dims, const cmsis_nn_dims *filter_dims) +{ +#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_MVEI) + /* The + 8 accounts for a worst case out of bounds read of the lhs buffers in the *_nt_t_* function. */ + return 4 * input_dims->c * filter_dims->w * filter_dims->h * sizeof(int16_t) + 8; +#else // ARM_MATH_DSP + return input_dims->c * filter_dims->w * filter_dims->h * sizeof(int16_t); +#endif +#else + (void)input_dims; + (void)filter_dims; + return 0; +#endif +} + +/** + * @} end of NNConv group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_s16.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_s16.c new file mode 100644 index 0000000..e0e39ca --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_s16.c @@ -0,0 +1,296 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * Copyright (C) 2022 Arm Limited or its affiliates. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_depthwise_conv_s16.c + * Description: s16 version of depthwise convolution. + * + * $Date: 19 April 2022 + * $Revision: V.2.0.0 + * + * Target Processor: Cortex-M CPUs + * + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" + +/** + * @ingroup groupNN + */ + +/** + * @addtogroup NNConv + * @{ + */ + +static void __attribute__((unused)) depthwise_conv_s16_mult_4_s16(const int16_t *input, + const int32_t input_x, + const int32_t input_y, + const int32_t input_ch, + const int8_t *kernel, + const int32_t output_ch, + const int32_t ch_mult, + const int32_t kernel_x, + const int32_t kernel_y, + const int32_t pad_x, + const int32_t pad_y, + const int32_t stride_x, + const int32_t stride_y, + const int64_t *bias, + int16_t *output, + const int32_t *output_shift, + const int32_t *output_mult, + const int32_t output_x, + const int32_t output_y, + const int32_t output_activation_min, + const int32_t output_activation_max) +{ + for (int32_t in_h = -pad_y, out_h = 0, out_idx = 0; out_h < output_y; in_h += stride_y, ++out_h) + { + for (int32_t in_w = -pad_x, out_w = 0, ker_h_start = MAX(0, -in_h); out_w < output_x; in_w += stride_x, ++out_w) + { + for (int32_t in_ch = 0, out_ch = 0, ker_w_start = MAX(0, -in_w); out_ch < output_ch; + ++in_ch, out_ch += ch_mult) + { + for (int mult_tile = 0; mult_tile < ch_mult; mult_tile += 4) + { + int32_t out_buff32[4] = {REDUCE_MULTIPLIER(output_mult[out_ch + 0 + mult_tile]), + REDUCE_MULTIPLIER(output_mult[out_ch + 1 + mult_tile]), + REDUCE_MULTIPLIER(output_mult[out_ch + 2 + mult_tile]), + REDUCE_MULTIPLIER(output_mult[out_ch + 3 + mult_tile])}; + + int64_t out_buff[4] = {0, 0, 0, 0}; + + if (bias) + { + out_buff[0] = bias[out_ch + 0 + mult_tile]; + out_buff[1] = bias[out_ch + 1 + mult_tile]; + out_buff[2] = bias[out_ch + 2 + mult_tile]; + out_buff[3] = bias[out_ch + 3 + mult_tile]; + } + + for (int32_t ker_h = ker_h_start; ker_h < MIN(kernel_y, input_y - in_h); ++ker_h) + { + int32_t ker_idx = ker_h * (output_ch * kernel_x) + ker_w_start * output_ch + out_ch; + int32_t in_idx = (in_h + ker_h) * (input_ch * input_x) + in_w * input_ch + in_ch; +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) +#pragma clang loop unroll(disable) +#endif + for (int32_t ker_w = ker_w_start; ker_w < MIN(kernel_x, input_x - in_w); + ++ker_w, ker_idx += output_ch) + { + // TODO: Unroll of 4 with 64 bit accumulator will probably result in too much register + // spills. Try with unroll of 2 when enabling this. + int32_t in_val = input[in_idx + ker_w * input_ch]; + out_buff[0] += in_val * kernel[ker_idx + 0 + mult_tile]; + out_buff[1] += in_val * kernel[ker_idx + 1 + mult_tile]; + out_buff[2] += in_val * kernel[ker_idx + 2 + mult_tile]; + out_buff[3] += in_val * kernel[ker_idx + 3 + mult_tile]; + } + } + + out_buff32[0] = + arm_nn_requantize_s64(out_buff[0], out_buff32[0], output_shift[out_ch + 0 + mult_tile]); + out_buff32[1] = + arm_nn_requantize_s64(out_buff[1], out_buff32[1], output_shift[out_ch + 1 + mult_tile]); + out_buff32[2] = + arm_nn_requantize_s64(out_buff[2], out_buff32[2], output_shift[out_ch + 2 + mult_tile]); + out_buff32[3] = + arm_nn_requantize_s64(out_buff[3], out_buff32[3], output_shift[out_ch + 3 + mult_tile]); + + out_buff32[0] = MIN(MAX(out_buff32[0], output_activation_min), output_activation_max); + out_buff32[1] = MIN(MAX(out_buff32[1], output_activation_min), output_activation_max); + out_buff32[2] = MIN(MAX(out_buff32[2], output_activation_min), output_activation_max); + out_buff32[3] = MIN(MAX(out_buff32[3], output_activation_min), output_activation_max); + + output[out_idx++] = (int16_t)out_buff32[0]; + output[out_idx++] = (int16_t)out_buff32[1]; + output[out_idx++] = (int16_t)out_buff32[2]; + output[out_idx++] = (int16_t)out_buff32[3]; + } + } + } + } +} + +static void depthwise_conv_s16_generic_s16(const int16_t *input, + const uint16_t input_batches, + const uint16_t input_x, + const uint16_t input_y, + const uint16_t input_ch, + const int8_t *kernel, + const uint16_t ch_mult, + const uint16_t kernel_x, + const uint16_t kernel_y, + const uint16_t pad_x, + const uint16_t pad_y, + const uint16_t stride_x, + const uint16_t stride_y, + const int64_t *bias, + int16_t *output, + const int32_t *output_shift, + const int32_t *output_mult, + const uint16_t output_x, + const uint16_t output_y, + const int32_t output_activation_min, + const int32_t output_activation_max, + const uint16_t dilation_x, + const uint16_t dilation_y) + +{ + for (int i_batch = 0; i_batch < input_batches; i_batch++) + { + for (int i_out_y = 0; i_out_y < output_y; i_out_y++) + { + const int16_t base_idx_y = (i_out_y * stride_y) - pad_y; + for (int i_out_x = 0; i_out_x < output_x; i_out_x++) + { + const int16_t base_idx_x = (i_out_x * stride_x) - pad_x; + for (int i_input_ch = 0; i_input_ch < input_ch; i_input_ch++) + { + for (int i_ch_mult = 0; i_ch_mult < ch_mult; i_ch_mult++) + { + const int idx_out_ch = i_ch_mult + i_input_ch * ch_mult; + + const q31_t reduced_multiplier = REDUCE_MULTIPLIER(output_mult[idx_out_ch]); + int64_t acc_0 = 0; + + int ker_y_start; + int ker_x_start; + int ker_y_end; + int ker_x_end; + + if (dilation_x > 1) + { + const int32_t start_x_max = (-base_idx_x + dilation_x - 1) / dilation_x; + ker_x_start = MAX(0, start_x_max); + const int32_t end_min_x = (input_x - base_idx_x + dilation_x - 1) / dilation_x; + ker_x_end = MIN(kernel_x, end_min_x); + } + else + { + ker_x_start = MAX(0, -base_idx_x); + ker_x_end = MIN(kernel_x, input_x - base_idx_x); + } + + if (dilation_y > 1) + { + const int32_t start_y_max = (-base_idx_y + dilation_y - 1) / dilation_y; + ker_y_start = MAX(0, start_y_max); + const int32_t end_min_y = (input_y - base_idx_y + dilation_y - 1) / dilation_y; + ker_y_end = MIN(kernel_y, end_min_y); + } + else + { + ker_y_start = MAX(0, -base_idx_y); + ker_y_end = MIN(kernel_y, input_y - base_idx_y); + } + + if (bias) + { + acc_0 = bias[idx_out_ch]; + } + + for (int i_ker_y = ker_y_start; i_ker_y < ker_y_end; i_ker_y++) + { + const int32_t idx_y = base_idx_y + dilation_y * i_ker_y; + for (int i_ker_x = ker_x_start; i_ker_x < ker_x_end; i_ker_x++) + { + const int32_t idx_x = base_idx_x + dilation_x * i_ker_x; + int32_t idx_0 = (idx_y * input_x + idx_x) * input_ch + i_input_ch; + int32_t ker_idx_0 = (i_ker_y * kernel_x + i_ker_x) * (input_ch * ch_mult) + idx_out_ch; + + acc_0 += input[idx_0] * kernel[ker_idx_0]; + } + } + + /* Requantize and clamp output to provided range */ + int32_t result = arm_nn_requantize_s64(acc_0, reduced_multiplier, output_shift[idx_out_ch]); + result = MAX(result, output_activation_min); + result = MIN(result, output_activation_max); + *output++ = (int16_t)result; + } + } + } + } + /* Advance to the next batch */ + input += (input_x * input_y * input_ch); + } +} + +/* + * Basic s16 depthwise convolution function. + * + * Refer header file for details. + * + */ +arm_cmsis_nn_status arm_depthwise_conv_s16(const cmsis_nn_context *ctx, + const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q15_t *input, + const cmsis_nn_dims *filter_dims, + const q7_t *kernel, + const cmsis_nn_dims *bias_dims, + const int64_t *bias, + const cmsis_nn_dims *output_dims, + q15_t *output) +{ + const uint16_t dilation_x = dw_conv_params->dilation.w; + const uint16_t dilation_y = dw_conv_params->dilation.h; + + (void)bias_dims; + (void)ctx; + + depthwise_conv_s16_generic_s16(input, + input_dims->n, + input_dims->w, + input_dims->h, + input_dims->c, + kernel, + dw_conv_params->ch_mult, + filter_dims->w, + filter_dims->h, + dw_conv_params->padding.w, + dw_conv_params->padding.h, + dw_conv_params->stride.w, + dw_conv_params->stride.h, + bias, + output, + quant_params->shift, + quant_params->multiplier, + output_dims->w, + output_dims->h, + dw_conv_params->activation.min, + dw_conv_params->activation.max, + dilation_x, + dilation_y); + + /* Return to application */ + return ARM_CMSIS_NN_SUCCESS; +} + +/** + * @} end of NNConv group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_s8.c index 4f452c1..862e87f 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -21,10 +21,10 @@ /* ---------------------------------------------------------------------- * Project: CMSIS NN Library * Title: arm_depthwise_conv_s8.c - * Description: s8 version of depthwise convolution. + * Description: s8 version of depthwise convolution. * - * $Date: 09. October 2020 - * $Revision: V.2.0.1 + * $Date: 29 July 2022 + * $Revision: V.3.0.3 * * Target Processor: Cortex-M CPUs * @@ -42,67 +42,83 @@ * @{ */ -static void depthwise_conv_s8_mult_4(const int8_t *input, - const int32_t input_x, - const int32_t input_y, - const int32_t input_ch, - const int8_t *kernel, - const int32_t output_ch, - const int32_t ch_mult, - const int32_t kernel_x, - const int32_t kernel_y, - const int32_t pad_x, - const int32_t pad_y, - const int32_t stride_x, - const int32_t stride_y, - const int32_t *bias, - int8_t *output, - const int32_t *output_shift, - const int32_t *output_mult, - const int32_t output_x, - const int32_t output_y, - const int32_t output_offset, - const int32_t input_offset, - const int32_t output_activation_min, - const int32_t output_activation_max) +#if !defined(__ARMCC_VERSION) +__attribute__((optimize("no-unroll-loops"))) +#endif +static void +depthwise_conv_s8_mult_4(const int8_t *input, + const int32_t input_x, + const int32_t input_y, + const int32_t input_ch, + const int8_t *kernel, + const int32_t output_ch, + const int32_t ch_mult, + const int32_t kernel_x, + const int32_t kernel_y, + const int32_t pad_x, + const int32_t pad_y, + const int32_t stride_x, + const int32_t stride_y, + const int32_t *bias, + int8_t *output, + const int32_t *output_shift, + const int32_t *output_mult, + const int32_t output_x, + const int32_t output_y, + const int32_t output_offset, + const int32_t input_offset, + const int32_t output_activation_min, + const int32_t output_activation_max) { - for (int32_t in_h = -pad_y, out_h = 0, out_idx = 0; out_h < output_y; in_h += stride_y, ++out_h) + const int32_t *bias_base = bias; + const int32_t *mult_base = output_mult; + const int32_t *shift_base = output_shift; + const int8_t *kernel_base = kernel; + + for (int32_t in_h = -pad_y, out_h = 0; out_h < output_y; in_h += stride_y, ++out_h) { for (int32_t in_w = -pad_x, out_w = 0, ker_h_start = MAX(0, -in_h); out_w < output_x; in_w += stride_x, ++out_w) { + bias = bias_base; + output_mult = mult_base; + output_shift = shift_base; for (int32_t in_ch = 0, out_ch = 0, ker_w_start = MAX(0, -in_w); out_ch < output_ch; ++in_ch, out_ch += ch_mult) { for (int mult_tile = 0; mult_tile < ch_mult; mult_tile += 4) { - int32_t out_buff[4]; - - out_buff[0] = bias[out_ch + 0 + mult_tile]; - out_buff[1] = bias[out_ch + 1 + mult_tile]; - out_buff[2] = bias[out_ch + 2 + mult_tile]; - out_buff[3] = bias[out_ch + 3 + mult_tile]; + int32_t out_buff[4] = {0, 0, 0, 0}; + if (bias) + { + out_buff[0] = *bias++; + out_buff[1] = *bias++; + out_buff[2] = *bias++; + out_buff[3] = *bias++; + } for (int32_t ker_h = ker_h_start; ker_h < MIN(kernel_y, input_y - in_h); ++ker_h) { int32_t ker_idx = ker_h * (output_ch * kernel_x) + ker_w_start * output_ch + out_ch; + kernel = kernel_base + mult_tile + ker_idx; int32_t in_idx = (in_h + ker_h) * (input_ch * input_x) + in_w * input_ch + in_ch; - +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) +#pragma clang loop unroll(disable) +#endif for (int32_t ker_w = ker_w_start; ker_w < MIN(kernel_x, input_x - in_w); - ++ker_w, ker_idx += output_ch) + ++ker_w, kernel += output_ch) { int32_t in_val = input[in_idx + ker_w * input_ch] + input_offset; - out_buff[0] += in_val * kernel[ker_idx + 0 + mult_tile]; - out_buff[1] += in_val * kernel[ker_idx + 1 + mult_tile]; - out_buff[2] += in_val * kernel[ker_idx + 2 + mult_tile]; - out_buff[3] += in_val * kernel[ker_idx + 3 + mult_tile]; + out_buff[0] += in_val * kernel[0]; + out_buff[1] += in_val * kernel[1]; + out_buff[2] += in_val * kernel[2]; + out_buff[3] += in_val * kernel[3]; } } #if defined(ARM_MATH_MVEI) - (void)out_idx; int32x4_t res = vldrwq_s32(out_buff); - res = arm_requantize_mve_32x4(res, - vldrwq_s32(&output_mult[out_ch + mult_tile]), - vldrwq_s32(&output_shift[out_ch + mult_tile])); + res = arm_requantize_mve_32x4(res, vldrwq_s32(output_mult), vldrwq_s32(output_shift)); + output_mult += 4; + output_shift += 4; res = vaddq_n_s32(res, output_offset); res = vmaxq_s32(res, vdupq_n_s32(output_activation_min)); @@ -110,14 +126,10 @@ static void depthwise_conv_s8_mult_4(const int8_t *input, vstrbq_s32(output, res); output += 4; #else - out_buff[0] = arm_nn_requantize( - out_buff[0], output_mult[out_ch + 0 + mult_tile], output_shift[out_ch + 0 + mult_tile]); - out_buff[1] = arm_nn_requantize( - out_buff[1], output_mult[out_ch + 1 + mult_tile], output_shift[out_ch + 1 + mult_tile]); - out_buff[2] = arm_nn_requantize( - out_buff[2], output_mult[out_ch + 2 + mult_tile], output_shift[out_ch + 2 + mult_tile]); - out_buff[3] = arm_nn_requantize( - out_buff[3], output_mult[out_ch + 3 + mult_tile], output_shift[out_ch + 3 + mult_tile]); + out_buff[0] = arm_nn_requantize(out_buff[0], *output_mult++, *output_shift++); + out_buff[1] = arm_nn_requantize(out_buff[1], *output_mult++, *output_shift++); + out_buff[2] = arm_nn_requantize(out_buff[2], *output_mult++, *output_shift++); + out_buff[3] = arm_nn_requantize(out_buff[3], *output_mult++, *output_shift++); out_buff[0] += output_offset; out_buff[1] += output_offset; @@ -129,10 +141,10 @@ static void depthwise_conv_s8_mult_4(const int8_t *input, out_buff[2] = MIN(MAX(out_buff[2], output_activation_min), output_activation_max); out_buff[3] = MIN(MAX(out_buff[3], output_activation_min), output_activation_max); - output[out_idx++] = (int8_t)out_buff[0]; - output[out_idx++] = (int8_t)out_buff[1]; - output[out_idx++] = (int8_t)out_buff[2]; - output[out_idx++] = (int8_t)out_buff[3]; + *output++ = (int8_t)out_buff[0]; + *output++ = (int8_t)out_buff[1]; + *output++ = (int8_t)out_buff[2]; + *output++ = (int8_t)out_buff[3]; #endif } @@ -142,6 +154,7 @@ static void depthwise_conv_s8_mult_4(const int8_t *input, } static void depthwise_conv_s8_generic(const q7_t *input, + const uint16_t input_batches, const uint16_t input_x, const uint16_t input_y, const uint16_t input_ch, @@ -163,53 +176,92 @@ static void depthwise_conv_s8_generic(const q7_t *input, const int32_t output_offset, const int32_t input_offset, const int32_t output_activation_min, - const int32_t output_activation_max) + const int32_t output_activation_max, + const uint16_t dilation_x, + const uint16_t dilation_y) + { (void)output_ch; int i_out = 0; - for (int i_out_y = 0; i_out_y < output_y; i_out_y++) + int i_batch; + + for (i_batch = 0; i_batch < input_batches; i_batch++) { - const int16_t base_idx_y = (i_out_y * stride_y) - pad_y; - for (int i_out_x = 0; i_out_x < output_x; i_out_x++) + for (int i_out_y = 0; i_out_y < output_y; i_out_y++) { - const int16_t base_idx_x = (i_out_x * stride_x) - pad_x; - for (int i_input_ch = 0; i_input_ch < input_ch; i_input_ch++) + const int16_t base_idx_y = (i_out_y * stride_y) - pad_y; + for (int i_out_x = 0; i_out_x < output_x; i_out_x++) { - for (int i_ch_mult = 0; i_ch_mult < ch_mult; i_ch_mult++) + const int16_t base_idx_x = (i_out_x * stride_x) - pad_x; + for (int i_input_ch = 0; i_input_ch < input_ch; i_input_ch++) { - const int idx_out_ch = i_ch_mult + i_input_ch * ch_mult; - int32_t acc_0; - /* Condition for kernel start dimension: (base_idx_ + ker__start) >= 0 */ - const int ker_y_start = MAX(0, -base_idx_y); - const int ker_x_start = MAX(0, -base_idx_x); - /* Condition for kernel end dimension: (base_idx_ + ker__end) < input_ */ - const int ker_y_end = MIN(kernel_y, input_y - base_idx_y); - const int ker_x_end = MIN(kernel_x, input_x - base_idx_x); - acc_0 = bias[idx_out_ch]; - - for (int i_ker_y = ker_y_start; i_ker_y < ker_y_end; i_ker_y++) + for (int i_ch_mult = 0; i_ch_mult < ch_mult; i_ch_mult++) { - const int32_t idx_y = base_idx_y + i_ker_y; - for (int i_ker_x = ker_x_start; i_ker_x < ker_x_end; i_ker_x++) + const int idx_out_ch = i_ch_mult + i_input_ch * ch_mult; + int32_t acc_0 = 0; + + int ker_y_start; + int ker_x_start; + int ker_y_end; + int ker_x_end; + + if (dilation_x > 1) + { + const int32_t start_x_max = (-base_idx_x + dilation_x - 1) / dilation_x; + ker_x_start = MAX(0, start_x_max); + const int32_t end_min_x = (input_x - base_idx_x + dilation_x - 1) / dilation_x; + ker_x_end = MIN(kernel_x, end_min_x); + } + else { - const int32_t idx_x = base_idx_x + i_ker_x; - int32_t idx_0 = (idx_y * input_x + idx_x) * input_ch + i_input_ch; - int32_t ker_idx_0 = (i_ker_y * kernel_x + i_ker_x) * (input_ch * ch_mult) + idx_out_ch; + ker_x_start = MAX(0, -base_idx_x); + ker_x_end = MIN(kernel_x, input_x - base_idx_x); + } - acc_0 += (input[idx_0] + input_offset) * kernel[ker_idx_0]; + if (dilation_y > 1) + { + const int32_t start_y_max = (-base_idx_y + dilation_y - 1) / dilation_y; + ker_y_start = MAX(0, start_y_max); + const int32_t end_min_y = (input_y - base_idx_y + dilation_y - 1) / dilation_y; + ker_y_end = MIN(kernel_y, end_min_y); } - } + else + { + ker_y_start = MAX(0, -base_idx_y); + ker_y_end = MIN(kernel_y, input_y - base_idx_y); + } + + if (bias) + { + acc_0 = bias[idx_out_ch]; + } + + for (int i_ker_y = ker_y_start; i_ker_y < ker_y_end; i_ker_y++) + { + const int32_t idx_y = base_idx_y + dilation_y * i_ker_y; + for (int i_ker_x = ker_x_start; i_ker_x < ker_x_end; i_ker_x++) + { + const int32_t idx_x = base_idx_x + dilation_x * i_ker_x; + int32_t idx_0 = (idx_y * input_x + idx_x) * input_ch + i_input_ch; + int32_t ker_idx_0 = (i_ker_y * kernel_x + i_ker_x) * (input_ch * ch_mult) + idx_out_ch; - /* Requantize and clamp output to provided range */ - acc_0 = arm_nn_requantize(acc_0, output_mult[idx_out_ch], output_shift[idx_out_ch]); - acc_0 += output_offset; - acc_0 = MAX(acc_0, output_activation_min); - acc_0 = MIN(acc_0, output_activation_max); + acc_0 += (input[idx_0] + input_offset) * kernel[ker_idx_0]; + } + } - output[i_out++] = acc_0; + /* Requantize and clamp output to provided range */ + acc_0 = arm_nn_requantize(acc_0, output_mult[idx_out_ch], output_shift[idx_out_ch]); + acc_0 += output_offset; + acc_0 = MAX(acc_0, output_activation_min); + acc_0 = MIN(acc_0, output_activation_max); + + output[i_out++] = acc_0; + } } } } + /* Advance to the next batch */ + input += (input_x * input_y * input_ch); } } @@ -220,23 +272,26 @@ static void depthwise_conv_s8_generic(const q7_t *input, * Optimization using DSP extension is not available for the generic case where channel multiplier is > 1. * */ -arm_status arm_depthwise_conv_s8(const cmsis_nn_context *ctx, - const cmsis_nn_dw_conv_params *dw_conv_params, - const cmsis_nn_per_channel_quant_params *quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input, - const cmsis_nn_dims *filter_dims, - const q7_t *kernel, - const cmsis_nn_dims *bias_dims, - const int32_t *bias, - const cmsis_nn_dims *output_dims, - q7_t *output) +arm_cmsis_nn_status arm_depthwise_conv_s8(const cmsis_nn_context *ctx, + const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input, + const cmsis_nn_dims *filter_dims, + const q7_t *kernel, + const cmsis_nn_dims *bias_dims, + const int32_t *bias, + const cmsis_nn_dims *output_dims, + q7_t *output) { - (void)dw_conv_params->dilation; + const uint16_t dilation_x = dw_conv_params->dilation.w; + const uint16_t dilation_y = dw_conv_params->dilation.h; + (void)bias_dims; (void)ctx; - if (dw_conv_params->ch_mult % 4 == 0) + if (dw_conv_params->ch_mult % 4 == 0 && input_dims->n == 1 && dw_conv_params->dilation.w == 1 && + dw_conv_params->dilation.h == 1) { depthwise_conv_s8_mult_4(input, input_dims->w, @@ -265,6 +320,7 @@ arm_status arm_depthwise_conv_s8(const cmsis_nn_context *ctx, else { depthwise_conv_s8_generic(input, + input_dims->n, input_dims->w, input_dims->h, input_dims->c, @@ -286,11 +342,13 @@ arm_status arm_depthwise_conv_s8(const cmsis_nn_context *ctx, dw_conv_params->output_offset, dw_conv_params->input_offset, dw_conv_params->activation.min, - dw_conv_params->activation.max); + dw_conv_params->activation.max, + dilation_x, + dilation_y); } /* Return to application */ - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_s8_opt.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_s8_opt.c index b81d7ca..fc12e72 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_s8_opt.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_s8_opt.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -24,8 +24,8 @@ * Description: Optimized s8 depthwise separable convolution function for * channel multiplier of 1. * - * $Date: January 26, 2021 - * $Revision: V.2.0.3 + * $Date: 27 July 2022 + * $Revision: V.3.1.0 * * Target Processor: Cortex-M CPUs * @@ -50,28 +50,34 @@ * */ -arm_status arm_depthwise_conv_s8_opt(const cmsis_nn_context *ctx, - const cmsis_nn_dw_conv_params *dw_conv_params, - const cmsis_nn_per_channel_quant_params *quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input, - const cmsis_nn_dims *filter_dims, - const q7_t *kernel, - const cmsis_nn_dims *bias_dims, - const int32_t *bias, - const cmsis_nn_dims *output_dims, - q7_t *output) +arm_cmsis_nn_status arm_depthwise_conv_s8_opt(const cmsis_nn_context *ctx, + const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input, + const cmsis_nn_dims *filter_dims, + const q7_t *kernel, + const cmsis_nn_dims *bias_dims, + const int32_t *bias, + const cmsis_nn_dims *output_dims, + q7_t *output) { const int32_t input_ch = input_dims->c; const int32_t output_ch = output_dims->c; - /* Check input constraints input_ch == output_ch */ + /* Check depth multiplier is 1 */ if (input_ch != output_ch) { - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; + } + + if (ctx->buf == NULL && arm_depthwise_conv_s8_opt_get_buffer_size(input_dims, filter_dims) > 0) + { + return ARM_CMSIS_NN_ARG_ERROR; } #ifdef ARM_MATH_DSP + (void)bias_dims; const int32_t input_x = input_dims->w; const int32_t input_y = input_dims->h; const int32_t kernel_x = filter_dims->w; @@ -91,7 +97,6 @@ arm_status arm_depthwise_conv_s8_opt(const cmsis_nn_context *ctx, q15_t *buffer_a = (q15_t *)ctx->buf; #ifdef ARM_MATH_MVEI - (void)bias_dims; /* Generate two columns from the input tensor */ q7_t *lhs_buffer = (q7_t *)buffer_a; q7_t *out = output; @@ -99,116 +104,133 @@ arm_status arm_depthwise_conv_s8_opt(const cmsis_nn_context *ctx, int buffer_count = 0; const int32_t kernel_size = kernel_x * kernel_y; - /* This part implements the im2col function */ - for (int i_out_y = 0, base_idx_y = -pad_y; i_out_y < output_y; base_idx_y += stride_y, i_out_y++) + const int32_t ch_loop = (input_ch + (CH_IN_BLOCK_MVE - 1)) / CH_IN_BLOCK_MVE; + int32_t remaining_ch = output_ch; + int32_t active_ch = MIN(CH_IN_BLOCK_MVE, remaining_ch); + remaining_ch -= CH_IN_BLOCK_MVE; + + for (int i_ch = 0; i_ch < ch_loop; i_ch++) { - for (int i_out_x = 0, base_idx_x = -pad_x; i_out_x < output_x; base_idx_x += stride_x, i_out_x++) + out = output + i_ch * CH_IN_BLOCK_MVE; + const int8_t *input_slice = input + (i_ch * CH_IN_BLOCK_MVE); + + for (int i_out_y = 0, base_idx_y = -pad_y; i_out_y < output_y; base_idx_y += stride_y, i_out_y++) { - for (int i_ker_y = base_idx_y; i_ker_y < base_idx_y + kernel_y; i_ker_y++) + for (int i_out_x = 0, base_idx_x = -pad_x; i_out_x < output_x; base_idx_x += stride_x, i_out_x++) { - for (int i_ker_x = base_idx_x; i_ker_x < base_idx_x + kernel_x; i_ker_x++) + for (int i_ker_y = base_idx_y; i_ker_y < base_idx_y + kernel_y; i_ker_y++) + { + for (int i_ker_x = base_idx_x; i_ker_x < base_idx_x + kernel_x; i_ker_x++) + { + if (i_ker_y < 0 || i_ker_y >= input_y || i_ker_x < 0 || i_ker_x >= input_x) + { + arm_memset_q7(lhs_buffer, (int8_t)-input_offset, (uint32_t)active_ch); + padded = 1; + } + else + { + arm_memcpy_q7(lhs_buffer, + input_slice + (i_ker_y * input_x + i_ker_x) * input_ch, + (uint32_t)active_ch); + } + lhs_buffer += CH_IN_BLOCK_MVE; + } + } + buffer_count++; + + if (buffer_count == 4) { - if (i_ker_y < 0 || i_ker_y >= input_y || i_ker_x < 0 || i_ker_x >= input_x) + const int32_t block_offset = i_ch * CH_IN_BLOCK_MVE; + lhs_buffer = (q7_t *)buffer_a; + if (padded == 0) { - arm_memset_q7(lhs_buffer, (int8_t)-input_offset, (uint32_t)input_ch); - padded = 1; + arm_nn_depthwise_conv_nt_t_s8(lhs_buffer, + kernel + block_offset, + input_offset, + active_ch, + input_ch, + output_shift + block_offset, + output_mult + block_offset, + output_offset, + output_activation_min, + output_activation_max, + kernel_size, + bias + block_offset, + out); } else { - arm_memcpy_q7(lhs_buffer, input + (i_ker_y * input_x + i_ker_x) * input_ch, (uint32_t)input_ch); + arm_nn_depthwise_conv_nt_t_padded_s8(lhs_buffer, + kernel + block_offset, + input_offset, + active_ch, + input_ch, + output_shift + block_offset, + output_mult + block_offset, + output_offset, + output_activation_min, + output_activation_max, + kernel_size, + bias + block_offset, + out); + padded = 0; } - lhs_buffer += input_ch; + out += (4 * input_ch); + buffer_count = 0; } } - buffer_count++; + } + /* Handle left over buffers */ + lhs_buffer = (q7_t *)buffer_a; - if (buffer_count == 4) + int8_t *out_base = out; + for (int i_buf = 0; i_buf < buffer_count; i_buf++) + { + int32_t loop_count = (active_ch + 3) / 4; + int32_t num_ch_to_process = active_ch; + out = out_base + (i_buf * input_ch); + for (int i_loop_cnt = 0, offset = i_ch * CH_IN_BLOCK_MVE; i_loop_cnt < loop_count; + num_ch_to_process -= 4, offset += 4, i_loop_cnt++) { - lhs_buffer = (q7_t *)buffer_a; - if (padded == 0) + const int8_t *col_0 = lhs_buffer + (kernel_size * CH_IN_BLOCK_MVE * i_buf) + (i_loop_cnt * 4); + const int8_t *row_0 = kernel + offset; + int32x4_t out_0 = vdupq_n_s32(0); + if (bias) { - out = arm_nn_depthwise_conv_nt_t_s8(lhs_buffer, - kernel, - input_offset, - input_ch, - output_shift, - output_mult, - output_offset, - output_activation_min, - output_activation_max, - kernel_size, - bias, - out); + out_0 = vldrwq_s32(&bias[offset]); } - else - { - out = arm_nn_depthwise_conv_nt_t_padded_s8(lhs_buffer, - kernel, - input_offset, - input_ch, - output_shift, - output_mult, - output_offset, - output_activation_min, - output_activation_max, - kernel_size, - bias, - out); - padded = 0; - } - buffer_count = 0; - } - } - } - - /* Handle left over buffers */ - lhs_buffer = (q7_t *)buffer_a; - for (int i_buf = 0; i_buf < buffer_count; i_buf++) - { - int32_t loop_count = (input_ch + 3) / 4; + for (int i_ker = 0; i_ker < kernel_size; i_ker++) + { + const int32x4_t ker_0 = vldrbq_s32(row_0); + int32x4_t ip_0 = vldrbq_s32(col_0); + ip_0 = vaddq_n_s32(ip_0, input_offset); + out_0 += vmulq_s32(ip_0, ker_0); - int32_t num_ch_to_process = input_ch; - for (int i_loop_cnt = 0, offset = 0; i_loop_cnt < loop_count; num_ch_to_process -= 4, offset += 4, i_loop_cnt++) - { - const int8_t *col_0 = lhs_buffer + (kernel_size * input_ch * i_buf) + offset; - const int8_t *row_0 = kernel + offset; - int32x4_t out_0 = vldrwq_s32(&bias[offset]); + col_0 += CH_IN_BLOCK_MVE; + row_0 += input_ch; + } - for (int i_ker = 0; i_ker < kernel_size; i_ker++) - { - const int32x4_t ker_0 = vldrbq_s32(row_0); + const int32x4_t mult = vldrwq_s32(&output_mult[offset]); + const int32x4_t shift = vldrwq_s32(&output_shift[offset]); - int32x4_t ip_0 = vldrbq_s32(col_0); - ip_0 = vaddq_n_s32(ip_0, input_offset); - out_0 += vmulq_s32(ip_0, ker_0); + out_0 = arm_requantize_mve_32x4(out_0, mult, shift); + out_0 = vaddq_n_s32(out_0, output_offset); + out_0 = vmaxq_s32(out_0, vdupq_n_s32(output_activation_min)); + out_0 = vminq_s32(out_0, vdupq_n_s32(output_activation_max)); + mve_pred16_t p = vctp32q((uint32_t)num_ch_to_process); + vstrbq_p_s32(out, out_0, p); - col_0 += input_ch; - row_0 += input_ch; + out += 4; } - - const int32x4_t mult = vldrwq_s32(&output_mult[offset]); - const int32x4_t shift = vldrwq_s32(&output_shift[offset]); - - out_0 = arm_requantize_mve_32x4(out_0, mult, shift); - out_0 = vaddq_n_s32(out_0, output_offset); - out_0 = vmaxq_s32(out_0, vdupq_n_s32(output_activation_min)); - out_0 = vminq_s32(out_0, vdupq_n_s32(output_activation_max)); - mve_pred16_t p = vctp32q((uint32_t)num_ch_to_process); - vstrbq_p_s32(out, out_0, p); - - out += 4; } + buffer_count = 0; - const int tail_ch = input_ch & 0x3; - if (tail_ch != 0) - { - out -= (4 - tail_ch); - } + active_ch = MIN(CH_IN_BLOCK_MVE, remaining_ch); + remaining_ch -= CH_IN_BLOCK_MVE; } #else // ARM_MATH_DSP - (void)bias_dims; /* Run the following code in cores using DSP extension */ q15_t *const col_buffer_start = buffer_a; q15_t *col_buffer = col_buffer_start; @@ -274,10 +296,17 @@ arm_status arm_depthwise_conv_s8_opt(const cmsis_nn_context *ctx, while (row_count) { - q31_t sum = *bias++; - q31_t sum_2 = *bias++; - q31_t sum_3 = *bias++; - q31_t sum_4 = *bias++; + q31_t sum = 0; + q31_t sum_2 = 0; + q31_t sum_3 = 0; + q31_t sum_4 = 0; + if (bias) + { + sum = *bias++; + sum_2 = *bias++; + sum_3 = *bias++; + sum_4 = *bias++; + } uint16_t col_count = (kernel_x * kernel_y) / 2; q15_t *col_pos = col_buffer_start + row_shift; @@ -370,7 +399,11 @@ arm_status arm_depthwise_conv_s8_opt(const cmsis_nn_context *ctx, { q15_t *col_pos = col_buffer_start + row_shift; const q7_t *row_pos = kernel + row_shift; - q31_t sum = *bias++; + q31_t sum = 0; + if (bias) + { + sum = *bias++; + } const uint16_t col_count = (kernel_x * kernel_y); row_shift += 1; @@ -408,14 +441,14 @@ arm_status arm_depthwise_conv_s8_opt(const cmsis_nn_context *ctx, #endif /* ARM_MATH_MVEI | ARM_MATH_DSP */ /* Return to application */ - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } int32_t arm_depthwise_conv_s8_opt_get_buffer_size(const cmsis_nn_dims *input_dims, const cmsis_nn_dims *filter_dims) { #if defined(ARM_MATH_MVEI) - /* The + 4 accounts for out of bounds read of the lhs buffers in the *_nt_t_* functions. */ - return (2 * input_dims->c * filter_dims->w * filter_dims->h) * (int32_t)sizeof(int16_t) + 4; + (void)input_dims; + return (4 * CH_IN_BLOCK_MVE * filter_dims->w * filter_dims->h) * (int32_t)sizeof(int8_t); #elif defined(ARM_MATH_DSP) return (input_dims->c * filter_dims->w * filter_dims->h) * sizeof(int16_t); #else diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_u8_basic_ver1.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_u8_basic_ver1.c index 5daa300..0404276 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_u8_basic_ver1.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_u8_basic_ver1.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2022 Arm Limited or its affiliates. * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_depthwise_conv_u8_basic_ver1.c * Description: u8 depthwise convolution function * - * $Date: 09. October 2020 - * $Revision: V.1.1.1 + * $Date: 19 April 2022 + * $Revision: V.2.0.0 * * Target : Cortex-M CPUs * @@ -226,7 +226,7 @@ static void depthwise_conv_u8_generic(const uint8_t *input, * @param[in] dilation_x Dilation along width. Not used and intended for future enhancement. * @param[in] dilation_y Dilation along height. Not used and intended for future enhancement. * @param[in] bias Pointer to optional bias values. If no bias is - * availble, NULL is expected + * available, NULL is expected * @param[in] input_offset Input tensor zero offset * @param[in] filter_offset Kernel tensor zero offset * @param[in] output_offset Output tensor zero offset @@ -238,38 +238,35 @@ static void depthwise_conv_u8_generic(const uint8_t *input, * @param[in] output_shift Amount of right-shift for output * @param[in] output_mult Output multiplier for requantization * @return The function returns one of the following - * ARM_MATH_SIZE_MISMATCH - Not supported dimension of tensors - * ARM_MATH_SUCCESS - Successful operation - * ARM_MATH_ARGUMENT_ERROR - Implementation not available - * + * ARM_CMSIS_NN_SUCCESS - Successful operation * */ -arm_status arm_depthwise_conv_u8_basic_ver1(const uint8_t *input, - const uint16_t input_x, - const uint16_t input_y, - const uint16_t input_ch, - const uint8_t *kernel, - const uint16_t kernel_x, - const uint16_t kernel_y, - const int16_t ch_mult, - const int16_t pad_x, - const int16_t pad_y, - const int16_t stride_x, - const int16_t stride_y, - const int16_t dilation_x, - const int16_t dilation_y, - const int32_t *bias, - const int32_t input_offset, - const int32_t filter_offset, - const int32_t output_offset, - uint8_t *output, - const uint16_t output_x, - const uint16_t output_y, - const int32_t output_activation_min, - const int32_t output_activation_max, - const int32_t output_shift, - const int32_t output_mult) +arm_cmsis_nn_status arm_depthwise_conv_u8_basic_ver1(const uint8_t *input, + const uint16_t input_x, + const uint16_t input_y, + const uint16_t input_ch, + const uint8_t *kernel, + const uint16_t kernel_x, + const uint16_t kernel_y, + const int16_t ch_mult, + const int16_t pad_x, + const int16_t pad_y, + const int16_t stride_x, + const int16_t stride_y, + const int16_t dilation_x, + const int16_t dilation_y, + const int32_t *bias, + const int32_t input_offset, + const int32_t filter_offset, + const int32_t output_offset, + uint8_t *output, + const uint16_t output_x, + const uint16_t output_y, + const int32_t output_activation_min, + const int32_t output_activation_max, + const int32_t output_shift, + const int32_t output_mult) { (void)dilation_x; (void)dilation_y; @@ -330,7 +327,7 @@ arm_status arm_depthwise_conv_u8_basic_ver1(const uint8_t *input, } /* Return to application */ - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_wrapper_s16.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_wrapper_s16.c new file mode 100644 index 0000000..072e7ea --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_wrapper_s16.c @@ -0,0 +1,125 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_depthwise_conv_wrapper_s16.c + * Description: Wrapper API to select appropriate depthwise conv API based + * on dimensions. + * + * $Date: 6 July 2022 + * $Revision: V.1.0.1 + * + * Target Processor: Cortex-M CPUs + * + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" + +/** + * @ingroup groupNN + */ + +/** + * @addtogroup NNConv + * @{ + */ + +#define USE_FAST_DW_CONV_FUNCTION(dw_conv_params, filter_dims, input_dims) \ + (dw_conv_params->ch_mult == 1 && dw_conv_params->dilation.w == 1 && dw_conv_params->dilation.h == 1 && \ + filter_dims->w * filter_dims->h * input_dims->c < 512) + +/* + * s16 Depthwise conv wrapper function + * + * Refer header file for details. + * + */ +arm_cmsis_nn_status arm_depthwise_conv_wrapper_s16(const cmsis_nn_context *ctx, + const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q15_t *input, + const cmsis_nn_dims *filter_dims, + const q7_t *filter, + const cmsis_nn_dims *bias_dims, + const int64_t *bias, + const cmsis_nn_dims *output_dims, + q15_t *output) +{ + arm_cmsis_nn_status status = ARM_CMSIS_NN_SUCCESS; + + if (USE_FAST_DW_CONV_FUNCTION(dw_conv_params, filter_dims, input_dims)) + { + status = arm_depthwise_conv_fast_s16(ctx, + dw_conv_params, + quant_params, + input_dims, + input, + filter_dims, + filter, + bias_dims, + bias, + output_dims, + output); + } + else + { + status = arm_depthwise_conv_s16(ctx, + dw_conv_params, + quant_params, + input_dims, + input, + filter_dims, + filter, + bias_dims, + bias, + output_dims, + output); + } + + /* Return to application */ + return status; +} + +int32_t arm_depthwise_conv_wrapper_s16_get_buffer_size(const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_dims *input_dims, + const cmsis_nn_dims *filter_dims, + const cmsis_nn_dims *output_dims) +{ + (void)dw_conv_params; + (void)input_dims; + (void)filter_dims; + (void)output_dims; + int32_t size = 0; + + if (USE_FAST_DW_CONV_FUNCTION(dw_conv_params, filter_dims, input_dims)) + { + size = arm_depthwise_conv_fast_s16_get_buffer_size(input_dims, filter_dims); + } + + return size; +} + +/** + * @} end of NNConv group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_wrapper_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_wrapper_s8.c index 89913c9..df2bb64 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_wrapper_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_conv_wrapper_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2022 Arm Limited or its affiliates. * * SPDX-License-Identifier: Apache-2.0 * @@ -24,8 +24,8 @@ * Description: Wrapper API to select appropriate depthwise conv API based * on dimensions. * - * $Date: 09. October 2020 - * $Revision: V.1.0.2 + * $Date: 19 April 2022 + * $Revision: V.2.0.0 * * Target Processor: Cortex-M CPUs * @@ -48,23 +48,25 @@ * Refer header file for details. * */ -arm_status arm_depthwise_conv_wrapper_s8(const cmsis_nn_context *ctx, - const cmsis_nn_dw_conv_params *dw_conv_params, - const cmsis_nn_per_channel_quant_params *quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input, - const cmsis_nn_dims *filter_dims, - const q7_t *filter, - const cmsis_nn_dims *bias_dims, - const int32_t *bias, - const cmsis_nn_dims *output_dims, - q7_t *output) +arm_cmsis_nn_status arm_depthwise_conv_wrapper_s8(const cmsis_nn_context *ctx, + const cmsis_nn_dw_conv_params *dw_conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input, + const cmsis_nn_dims *filter_dims, + const q7_t *filter, + const cmsis_nn_dims *bias_dims, + const int32_t *bias, + const cmsis_nn_dims *output_dims, + q7_t *output) { - arm_status status = ARM_MATH_SUCCESS; - if (1 == dw_conv_params->ch_mult) + arm_cmsis_nn_status status = ARM_CMSIS_NN_SUCCESS; + if (1 == dw_conv_params->ch_mult && input_dims->n == 1 && dw_conv_params->dilation.w == 1 && + dw_conv_params->dilation.h == 1) { #if !defined(ARM_MATH_MVEI) - if ((filter_dims->w == 3) && (filter_dims->h == 3) && (dw_conv_params->padding.h <= 1)) + if ((filter_dims->w == 3) && (filter_dims->h == 3) && (dw_conv_params->padding.h <= 1) && + (dw_conv_params->padding.w <= 1)) { status = arm_depthwise_conv_3x3_s8(ctx, dw_conv_params, @@ -121,7 +123,8 @@ int32_t arm_depthwise_conv_wrapper_s8_get_buffer_size(const cmsis_nn_dw_conv_par (void)dw_conv_params; int32_t size = 0; - if (input_dims->c == output_dims->c) + if (input_dims->c == output_dims->c && input_dims->n == 1 && dw_conv_params->dilation.w == 1 && + dw_conv_params->dilation.h == 1) { size = arm_depthwise_conv_s8_opt_get_buffer_size(input_dims, filter_dims); } diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_separable_conv_HWC_q7.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_separable_conv_HWC_q7.c index f0526a2..0a91889 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_separable_conv_HWC_q7.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_separable_conv_HWC_q7.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_depthwise_separable_conv_HWC_q7.c * Description: Q7 depthwise separable convolution function * - * $Date: January 26, 2021 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,63 +42,29 @@ * @{ */ -/** - * @brief Q7 depthwise separable convolution function - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in input tensor dimension - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel filter kernel size - * @param[in] padding padding sizes - * @param[in] stride convolution stride - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out output tensor dimension - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - * - * @details - * - * Buffer size: - * - * bufferA size: 2*ch_im_in*dim_kernel*dim_kernel - * - * bufferB size: 0 - * - * Input dimension constraints: - * - * ch_im_in equals ch_im_out - * - * Implementation: - * There are 3 nested loop here: - * Inner loop: calculate each output value with MAC instruction over an accumulator - * Mid loop: loop over different output channel - * Outer loop: loop over different output (x, y) +/* + * Q7 depthwise separable convolution function + * Refer function header for details */ -arm_status arm_depthwise_separable_conv_HWC_q7(const q7_t *Im_in, - const uint16_t dim_im_in, - const uint16_t ch_im_in, - const q7_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel, - const uint16_t padding, - const uint16_t stride, - const q7_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q7_t *Im_out, - const uint16_t dim_im_out, - q15_t *bufferA, - q7_t *bufferB) +arm_cmsis_nn_status arm_depthwise_separable_conv_HWC_q7(const q7_t *Im_in, + const uint16_t dim_im_in, + const uint16_t ch_im_in, + const q7_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel, + const uint16_t padding, + const uint16_t stride, + const q7_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q7_t *Im_out, + const uint16_t dim_im_out, + q15_t *bufferA, + q7_t *bufferB) { (void)bufferB; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ int16_t i_out_y, i_out_x; @@ -113,7 +79,7 @@ arm_status arm_depthwise_separable_conv_HWC_q7(const q7_t *Im_in, /* do some checking here, basically ch_im_in == ch_im_out */ if (ch_im_in != ch_im_out) { - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } for (i_out_y = 0; i_out_y < dim_im_out; i_out_y++) @@ -265,13 +231,13 @@ arm_status arm_depthwise_separable_conv_HWC_q7(const q7_t *Im_in, "smlad %[sum4], r4, r5, %[sum4]\n" "subs %[colCnt], #1\n" "bne COL_LOOP_%=\n" - : [ sum ] "+r"(sum), - [ sum2 ] "+r"(sum2), - [ sum3 ] "+r"(sum3), - [ sum4 ] "+r"(sum4), - [ pB ] "+r"(pB), - [ pA ] "+r"(pA) - : [ colCnt ] "r"(colCnt), [ ch_im_in ] "r"(ch_im_in) + : [sum] "+r"(sum), + [sum2] "+r"(sum2), + [sum3] "+r"(sum3), + [sum4] "+r"(sum4), + [pB] "+r"(pB), + [pA] "+r"(pA) + : [colCnt] "r"(colCnt), [ch_im_in] "r"(ch_im_in) : "r0", "r1", "r2", "r3", "r4", "r5"); #else /* @@ -309,13 +275,13 @@ arm_status arm_depthwise_separable_conv_HWC_q7(const q7_t *Im_in, "smlad %[sum3], r4, r5, %[sum3]\n" "subs %[colCnt], #1\n" "bne COL_LOOP_%=\n" - : [ sum ] "+r"(sum), - [ sum2 ] "+r"(sum2), - [ sum3 ] "+r"(sum3), - [ sum4 ] "+r"(sum4), - [ pB ] "+r"(pB), - [ pA ] "+r"(pA) - : [ colCnt ] "r"(colCnt), [ ch_im_in ] "r"(ch_im_in) + : [sum] "+r"(sum), + [sum2] "+r"(sum2), + [sum3] "+r"(sum3), + [sum4] "+r"(sum4), + [pB] "+r"(pB), + [pA] "+r"(pA) + : [colCnt] "r"(colCnt), [ch_im_in] "r"(ch_im_in) : "r0", "r1", "r2", "r3", "r4", "r5"); #endif /* ARM_MATH_BIG_ENDIAN */ @@ -383,7 +349,7 @@ arm_status arm_depthwise_separable_conv_HWC_q7(const q7_t *Im_in, /* do some checking here, basically ch_im_in == ch_im_out */ if (ch_im_in != ch_im_out) { - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } for (i_out_y = 0; i_out_y < dim_im_out; i_out_y++) @@ -416,7 +382,7 @@ arm_status arm_depthwise_separable_conv_HWC_q7(const q7_t *Im_in, #endif /* ARM_MATH_DSP */ /* Return to application */ - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_separable_conv_HWC_q7_nonsquare.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_separable_conv_HWC_q7_nonsquare.c index 0c5d420..e85b01b 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_separable_conv_HWC_q7_nonsquare.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_depthwise_separable_conv_HWC_q7_nonsquare.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_depthwise_separable_conv_HWC_q7_nonsquare.c * Description: Q7 depthwise separable convolution function (non-square shape) * - * $Date: January 26, 2021 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,62 +42,36 @@ * @{ */ -/** - * @brief Q7 depthwise separable convolution function (non-square shape) - * @param[in] Im_in pointer to input tensor - * @param[in] dim_im_in_x input tensor dimension x - * @param[in] dim_im_in_y input tensor dimension y - * @param[in] ch_im_in number of input tensor channels - * @param[in] wt pointer to kernel weights - * @param[in] ch_im_out number of filters, i.e., output tensor channels - * @param[in] dim_kernel_x filter kernel size x - * @param[in] dim_kernel_y filter kernel size y - * @param[in] padding_x padding sizes x - * @param[in] padding_y padding sizes y - * @param[in] stride_x convolution stride x - * @param[in] stride_y convolution stride y - * @param[in] bias pointer to bias - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in,out] Im_out pointer to output tensor - * @param[in] dim_im_out_x output tensor dimension x - * @param[in] dim_im_out_y output tensor dimension y - * @param[in,out] bufferA pointer to buffer space for input - * @param[in,out] bufferB pointer to buffer space for output - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - * - * This function is the version with full list of optimization tricks, but with - * some contraints: - * ch_im_in is equal to ch_im_out - * +/* + * Q7 depthwise separable convolution function (non-square shape) + * Refer function header for details */ -arm_status arm_depthwise_separable_conv_HWC_q7_nonsquare(const q7_t *Im_in, - const uint16_t dim_im_in_x, - const uint16_t dim_im_in_y, - const uint16_t ch_im_in, - const q7_t *wt, - const uint16_t ch_im_out, - const uint16_t dim_kernel_x, - const uint16_t dim_kernel_y, - const uint16_t padding_x, - const uint16_t padding_y, - const uint16_t stride_x, - const uint16_t stride_y, - const q7_t *bias, - const uint16_t bias_shift, - const uint16_t out_shift, - q7_t *Im_out, - const uint16_t dim_im_out_x, - const uint16_t dim_im_out_y, - q15_t *bufferA, - q7_t *bufferB) +arm_cmsis_nn_status arm_depthwise_separable_conv_HWC_q7_nonsquare(const q7_t *Im_in, + const uint16_t dim_im_in_x, + const uint16_t dim_im_in_y, + const uint16_t ch_im_in, + const q7_t *wt, + const uint16_t ch_im_out, + const uint16_t dim_kernel_x, + const uint16_t dim_kernel_y, + const uint16_t padding_x, + const uint16_t padding_y, + const uint16_t stride_x, + const uint16_t stride_y, + const q7_t *bias, + const uint16_t bias_shift, + const uint16_t out_shift, + q7_t *Im_out, + const uint16_t dim_im_out_x, + const uint16_t dim_im_out_y, + q15_t *bufferA, + q7_t *bufferB) { (void)bufferB; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ /* @@ -121,7 +95,7 @@ arm_status arm_depthwise_separable_conv_HWC_q7_nonsquare(const q7_t *Im_in, /* do some checking here, basically ch_im_in == ch_im_out */ if (ch_im_in != ch_im_out) { - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } for (i_out_y = 0; i_out_y < dim_im_out_y; i_out_y++) @@ -272,13 +246,13 @@ arm_status arm_depthwise_separable_conv_HWC_q7_nonsquare(const q7_t *Im_in, "smlad %[sum4], r4, r5, %[sum4]\n" "subs %[colCnt], #1\n" "bne COL_LOOP\n" - : [ sum ] "+r"(sum), - [ sum2 ] "+r"(sum2), - [ sum3 ] "+r"(sum3), - [ sum4 ] "+r"(sum4), - [ pB ] "+r"(pB), - [ pA ] "+r"(pA) - : [ colCnt ] "r"(colCnt), [ ch_im_in ] "r"(ch_im_in) + : [sum] "+r"(sum), + [sum2] "+r"(sum2), + [sum3] "+r"(sum3), + [sum4] "+r"(sum4), + [pB] "+r"(pB), + [pA] "+r"(pA) + : [colCnt] "r"(colCnt), [ch_im_in] "r"(ch_im_in) : "r0", "r1", "r2", "r3", "r4", "r5"); #else // r0 r1 r2 r3 r4 r5 @@ -314,13 +288,13 @@ arm_status arm_depthwise_separable_conv_HWC_q7_nonsquare(const q7_t *Im_in, "smlad %[sum3], r4, r5, %[sum3]\n" "subs %[colCnt], #1\n" "bne COL_LOOP\n" - : [ sum ] "+r"(sum), - [ sum2 ] "+r"(sum2), - [ sum3 ] "+r"(sum3), - [ sum4 ] "+r"(sum4), - [ pB ] "+r"(pB), - [ pA ] "+r"(pA) - : [ colCnt ] "r"(colCnt), [ ch_im_in ] "r"(ch_im_in) + : [sum] "+r"(sum), + [sum2] "+r"(sum2), + [sum3] "+r"(sum3), + [sum4] "+r"(sum4), + [pB] "+r"(pB), + [pA] "+r"(pA) + : [colCnt] "r"(colCnt), [ch_im_in] "r"(ch_im_in) : "r0", "r1", "r2", "r3", "r4", "r5"); #endif /*ARM_MATH_BIG_ENDIAN */ @@ -388,7 +362,7 @@ arm_status arm_depthwise_separable_conv_HWC_q7_nonsquare(const q7_t *Im_in, /* do some checking here, basically ch_im_in == ch_im_out */ if (ch_im_in != ch_im_out) { - return ARM_MATH_SIZE_MISMATCH; + return ARM_CMSIS_NN_ARG_ERROR; } for (i_out_y = 0; i_out_y < dim_im_out_y; i_out_y++) @@ -421,7 +395,7 @@ arm_status arm_depthwise_separable_conv_HWC_q7_nonsquare(const q7_t *Im_in, #endif /* ARM_MATH_DSP */ /* Return to application */ - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_q7_q15.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_q7_q15.c index 17e6dc9..5c95485 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_q7_q15.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_q7_q15.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_nn_mat_mult_kernel_q7_q15.c * Description: Matrix-multiplication function for convolution * - * $Date: January 26, 2021 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.1.0.3 * * Target Processor: Cortex-M cores * -------------------------------------------------------------------- */ @@ -32,10 +32,10 @@ #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" -/** - * @brief Matrix-multiplication function for convolution. +/* + * Matrix-multiplication function for convolution. * - * @details Refer to header file for details. + * Refer to header file for details. * */ diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_q7_q15_reordered.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_q7_q15_reordered.c index 1217c11..29043c8 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_q7_q15_reordered.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_q7_q15_reordered.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_nn_mat_mult_kernel_q7_q15_reordered.c * Description: Matrix-multiplication function for convolution with reordered columns * - * $Date: January 26, 2021 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.1.0.3 * * Target Processor: Cortex-M cores * -------------------------------------------------------------------- */ @@ -32,10 +32,10 @@ #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" -/** - * @brief Matrix-multiplication function for convolution with re-ordered input. +/* + * Matrix-multiplication function for convolution with re-ordered input. * - * @details Refer to header file for details. + * Refer to header file for details. * */ diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_s8_s16.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_s8_s16.c index 8b37b34..62ee822 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_s8_s16.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_s8_s16.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_nn_mat_mult_kernel_s8_s16.c * Description: Matrix-multiplication function for convolution * - * $Date: 09. October 2020 - * $Revision: V.1.0.3 + * $Date: 14. December 2021 + * $Revision: V.1.1.0 * * Target Processor: Cortex-M cores * -------------------------------------------------------------------- */ @@ -51,174 +51,7 @@ q7_t *arm_nn_mat_mult_kernel_s8_s16(const q7_t *input_a, const int32_t *const output_bias, q7_t *out_0) { -#if defined(ARM_MATH_MVEI) -#define ROW_PER_LOOP (4) -#define COL_PER_LOOP (8) - - const q7_t *ip_a0_s8 = input_a; - q7_t *out_1 = out_0 + output_ch; - - const int32_t *bias = output_bias; - - int32_t row_count = output_ch / ROW_PER_LOOP; - - while (row_count) - { - const q15_t *ip_b0_s16 = input_b; - const q15_t *ip_b1_s16 = input_b + num_col_a; - - const q7_t *ip_a1_s8 = ip_a0_s8 + num_col_a; - const q7_t *ip_a2_s8 = ip_a0_s8 + num_col_a * 2; - const q7_t *ip_a3_s8 = ip_a0_s8 + num_col_a * 3; - - q31_t ch_0_out_n = bias[0]; - q31_t ch_1_out_n = bias[1]; - q31_t ch_2_out_n = bias[2]; - q31_t ch_3_out_n = bias[3]; - - q31_t ch_0_out_n1 = ch_0_out_n; - q31_t ch_1_out_n1 = ch_1_out_n; - q31_t ch_2_out_n1 = ch_2_out_n; - q31_t ch_3_out_n1 = ch_3_out_n; - bias += 4; - - int32_t col_count = num_col_a / COL_PER_LOOP; - - while (col_count) - { - // Load inputs - const int16x8_t ip_b0 = vld1q_s16(ip_b0_s16); - ip_b0_s16 += COL_PER_LOOP; - const int16x8_t ip_b1 = vld1q_s16(ip_b1_s16); - ip_b1_s16 += COL_PER_LOOP; - - // Load filters - const int16x8_t ip_a0 = vldrbq_s16(ip_a0_s8); - ip_a0_s8 += COL_PER_LOOP; - const int16x8_t ip_a1 = vldrbq_s16(ip_a1_s8); - ip_a1_s8 += COL_PER_LOOP; - const int16x8_t ip_a2 = vldrbq_s16(ip_a2_s8); - ip_a2_s8 += COL_PER_LOOP; - const int16x8_t ip_a3 = vldrbq_s16(ip_a3_s8); - ip_a3_s8 += COL_PER_LOOP; - - // MAC - ch_0_out_n += vmladavq_s16(ip_b0, ip_a0); - ch_1_out_n += vmladavq_s16(ip_b0, ip_a1); - ch_2_out_n += vmladavq_s16(ip_b0, ip_a2); - ch_3_out_n += vmladavq_s16(ip_b0, ip_a3); - ch_0_out_n1 += vmladavq_s16(ip_b1, ip_a0); - ch_1_out_n1 += vmladavq_s16(ip_b1, ip_a1); - ch_2_out_n1 += vmladavq_s16(ip_b1, ip_a2); - ch_3_out_n1 += vmladavq_s16(ip_b1, ip_a3); - - col_count--; - } - - /* Handle tail */ - col_count = (num_col_a & (COL_PER_LOOP - 1)) - 1; - while (col_count >= 0) - { - const int32_t b0 = ip_b0_s16[col_count]; - const int32_t b1 = ip_b1_s16[col_count]; - - ch_0_out_n += b0 * ip_a0_s8[col_count]; - ch_1_out_n += b0 * ip_a1_s8[col_count]; - ch_2_out_n += b0 * ip_a2_s8[col_count]; - ch_3_out_n += b0 * ip_a3_s8[col_count]; - - ch_0_out_n1 += b1 * ip_a0_s8[col_count]; - ch_1_out_n1 += b1 * ip_a1_s8[col_count]; - ch_2_out_n1 += b1 * ip_a2_s8[col_count]; - ch_3_out_n1 += b1 * ip_a3_s8[col_count]; - col_count--; - } - ip_a0_s8 += (num_col_a & (COL_PER_LOOP - 1)); - - int32x4_t out_vec_0; - int32x4_t out_vec_1; - out_vec_0[0] = ch_0_out_n; - out_vec_0[1] = ch_1_out_n; - out_vec_0[2] = ch_2_out_n; - out_vec_0[3] = ch_3_out_n; - - out_vec_1[0] = ch_0_out_n1; - out_vec_1[1] = ch_1_out_n1; - out_vec_1[2] = ch_2_out_n1; - out_vec_1[3] = ch_3_out_n1; - - int32x4_t mult = vldrwq_s32(out_mult); - int32x4_t shift = vldrwq_s32(out_shift); - out_mult += ROW_PER_LOOP; - out_shift += ROW_PER_LOOP; - - out_vec_0 = arm_requantize_mve_32x4(out_vec_0, mult, shift); - out_vec_1 = arm_requantize_mve_32x4(out_vec_1, mult, shift); - - out_vec_0 = vaddq_n_s32(out_vec_0, out_offset); - out_vec_0 = vmaxq_s32(out_vec_0, vdupq_n_s32(activation_min)); - out_vec_0 = vminq_s32(out_vec_0, vdupq_n_s32(activation_max)); - vstrbq_s32(out_0, out_vec_0); - out_0 += ROW_PER_LOOP; - - out_vec_1 = vaddq_n_s32(out_vec_1, out_offset); - out_vec_1 = vmaxq_s32(out_vec_1, vdupq_n_s32(activation_min)); - out_vec_1 = vminq_s32(out_vec_1, vdupq_n_s32(activation_max)); - vstrbq_s32(out_1, out_vec_1); - out_1 += ROW_PER_LOOP; - row_count--; - ip_a0_s8 += (num_col_a * 3); - } - - row_count = output_ch & (ROW_PER_LOOP - 1); - - if (row_count) - { - ip_a0_s8 = input_a + num_col_a * (output_ch & ~3); - const mve_pred16_t p = vctp32q((uint32_t)row_count); - int32x4_t out_vec_0 = vdupq_n_s32(0); - int32x4_t out_vec_1 = vdupq_n_s32(0); - int32x4_t mult_tail; - int32x4_t shift_tail; - - for (int i_ch = 0; i_ch < row_count; i_ch++) - { - int32_t output_0 = bias[i_ch]; - int32_t output_1 = bias[i_ch]; - const q15_t *ip_b0_s16 = input_b; - const q15_t *ip_b1_s16 = input_b + num_col_a; - - for (int i_idx = 0; i_idx < num_col_a; i_idx++) - { - output_0 += ip_b0_s16[i_idx] * ip_a0_s8[i_idx]; - output_1 += ip_b1_s16[i_idx] * ip_a0_s8[i_idx]; - } - - ip_a0_s8 += num_col_a; - out_vec_0[i_ch] = output_0; - out_vec_1[i_ch] = output_1; - mult_tail[i_ch] = out_mult[i_ch]; - shift_tail[i_ch] = out_shift[i_ch]; - } - out_vec_0 = arm_requantize_mve_32x4(out_vec_0, mult_tail, shift_tail); - out_vec_1 = arm_requantize_mve_32x4(out_vec_1, mult_tail, shift_tail); - - out_vec_0 = vaddq_n_s32(out_vec_0, out_offset); - out_vec_0 = vmaxq_s32(out_vec_0, vdupq_n_s32(activation_min)); - out_vec_0 = vminq_s32(out_vec_0, vdupq_n_s32(activation_max)); - vstrbq_p_s32(out_0, out_vec_0, p); - - out_vec_1 = vaddq_n_s32(out_vec_1, out_offset); - out_vec_1 = vmaxq_s32(out_vec_1, vdupq_n_s32(activation_min)); - out_vec_1 = vminq_s32(out_vec_1, vdupq_n_s32(activation_max)); - - vstrbq_p_s32(out_1, out_vec_1, p); - out_1 += row_count; - } - - return out_1; - -#elif defined(ARM_MATH_DSP) +#if !defined(ARM_MATH_MVEI) /* set up the second output pointers */ q7_t *out_1 = out_0 + output_ch; const int32_t *bias = output_bias; @@ -235,12 +68,20 @@ q7_t *arm_nn_mat_mult_kernel_s8_s16(const q7_t *input_a, /* align the second pointer for A */ const q7_t *ip_a1 = ip_a0 + num_col_a; + q31_t ch_0_out_0 = 0; + q31_t ch_0_out_1 = 0; + q31_t ch_1_out_0 = 0; + q31_t ch_1_out_1 = 0; /* Init accumulator with bias for channel N and N + 1 */ - q31_t ch_0_out_0 = *bias; - q31_t ch_0_out_1 = *bias++; - q31_t ch_1_out_0 = *bias; - q31_t ch_1_out_1 = *bias++; + if (bias) + { + ch_0_out_0 = *bias; + ch_0_out_1 = *bias++; + ch_1_out_0 = *bias; + ch_1_out_1 = *bias++; + } +#if defined(ARM_MATH_DSP) uint16_t col_count = num_col_a / 4; /* accumulate over the vector */ while (col_count) @@ -268,6 +109,9 @@ q7_t *arm_nn_mat_mult_kernel_s8_s16(const q7_t *input_a, col_count--; } /* while over col_count */ col_count = num_col_a & 0x3; +#else + uint16_t col_count = num_col_a; +#endif while (col_count) { q7_t a0 = *ip_a0++; @@ -322,10 +166,17 @@ q7_t *arm_nn_mat_mult_kernel_s8_s16(const q7_t *input_a, const q15_t *ip_b0 = input_b; const q15_t *ip_b1 = ip_b0 + num_col_a; + q31_t ch_0_out_0 = 0; + q31_t ch_0_out_1 = 0; + /* load the bias */ - q31_t ch_0_out_0 = *bias; - q31_t ch_0_out_1 = *bias++; + if (bias) + { + ch_0_out_0 = *bias; + ch_0_out_1 = *bias++; + } +#if defined(ARM_MATH_DSP) uint16_t col_count = num_col_a >> 2; while (col_count) { @@ -346,6 +197,9 @@ q7_t *arm_nn_mat_mult_kernel_s8_s16(const q7_t *input_a, col_count--; } col_count = num_col_a & 0x3; +#else + uint16_t col_count = num_col_a; +#endif while (col_count) { q7_t a0 = *ip_a0++; diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_s8.c index 0f0ddbe..9eed28f 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_nn_mat_mult_s8.c * Description: General Matrix-multiplication function * - * $Date: 09. October 2020 - * $Revision: V.2.0.5 + * $Date: 16 August 2022 + * $Revision: V.2.0.7 * * Target Processor: Cortex-M cores * -------------------------------------------------------------------- */ @@ -75,27 +75,27 @@ q7_t *arm_nn_mat_mult_s8(const q7_t *input_row, for (int i_row_loop = 0; i_row_loop < row_loop_cnt; i_row_loop++) { mve_pred16_t p = vctp16q((uint32_t)row_len_tmp); - const int16x8_t offset = vdupq_m_n_s16(vuninitializedq_s16(), col_offset, p); + const int16x8_t offset = vdupq_x_n_s16(col_offset, p); row_len_tmp -= 8; - int16x8_t r0 = vldrbq_z_s16(ip_r0, p); - ip_r0 += 8; - - int16x8_t c0 = vldrbq_z_s16(ip_c0, p); + int16x8_t c0 = vldrbq_s16(ip_c0); ip_c0 += 8; - c0 = vaddq_m_s16(vuninitializedq_s16(), c0, offset, p); + c0 = vaddq_s16(c0, offset); - int16x8_t c1 = vldrbq_z_s16(ip_c1, p); + int16x8_t c1 = vldrbq_s16(ip_c1); ip_c1 += 8; - c1 = vaddq_m_s16(vuninitializedq_s16(), c1, offset, p); + c1 = vaddq_s16(c1, offset); - int16x8_t c2 = vldrbq_z_s16(ip_c2, p); + int16x8_t c2 = vldrbq_s16(ip_c2); ip_c2 += 8; - c2 = vaddq_m_s16(vuninitializedq_s16(), c2, offset, p); + c2 = vaddq_s16(c2, offset); - int16x8_t c3 = vldrbq_z_s16(ip_c3, p); + int16x8_t c3 = vldrbq_s16(ip_c3); ip_c3 += 8; - c3 = vaddq_m_s16(vuninitializedq_s16(), c3, offset, p); + c3 = vaddq_s16(c3, offset); + + int16x8_t r0 = vldrbq_z_s16(ip_r0, p); + ip_r0 += 8; acc_0 = vmladavaq_p_s16(acc_0, r0, c0, p); acc_1 = vmladavaq_p_s16(acc_1, r0, c1, p); @@ -135,15 +135,15 @@ q7_t *arm_nn_mat_mult_s8(const q7_t *input_row, for (int i_row_loop = 0; i_row_loop < row_loop_cnt; i_row_loop++) { const mve_pred16_t p = vctp16q((uint32_t)row_len_tmp); - const int16x8_t offset = vdupq_m_n_s16(vuninitializedq_s16(), col_offset, p); + const int16x8_t offset = vdupq_x_n_s16(col_offset, p); row_len_tmp -= 8; - int16x8_t r0 = vldrbq_z_s16(ip_r0, p); - ip_r0 += 8; - int16x8_t c0 = vldrbq_z_s16(ip_c0, p); + int16x8_t c0 = vldrbq_s16(ip_c0); ip_c0 += 8; + c0 = vaddq_s16(c0, offset); - c0 = vaddq_m_s16(vuninitializedq_s16(), c0, offset, p); + int16x8_t r0 = vldrbq_z_s16(ip_r0, p); + ip_r0 += 8; acc_0 = vmladavaq_p_s16(acc_0, r0, c0, p); } diff --git a/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_mat_q7_vec_q15.c b/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_mat_q7_vec_q15.c index 8720a9e..0987a31 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_mat_q7_vec_q15.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_mat_q7_vec_q15.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_fully_connected_mat_q7_vec_q15.c * Description: Mixed Q15-Q7 fully-connected layer function * - * $Date: 09. October 2020 - * $Revision: V.1.0.1 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,43 +42,23 @@ * @{ */ -/** +/* * @brief Mixed Q15-Q7 fully-connected layer function - * @param[in] pV pointer to input vector - * @param[in] pM pointer to matrix weights - * @param[in] dim_vec length of the vector - * @param[in] num_of_rows number of rows in weight matrix - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in] bias pointer to bias - * @param[in,out] pOut pointer to output vector - * @param[in,out] vec_buffer pointer to buffer space for input - * @return The function returns ARM_MATH_SUCCESS - * - * @details - * - * Buffer size: - * - * vec_buffer size: 0 - * - * Q7_Q15 version of the fully connected layer - * - * Weights are in q7_t and Activations are in q15_t - * + * Refer function header for details */ -arm_status arm_fully_connected_mat_q7_vec_q15(const q15_t *pV, - const q7_t *pM, - const uint16_t dim_vec, - const uint16_t num_of_rows, - const uint16_t bias_shift, - const uint16_t out_shift, - const q7_t *bias, - q15_t *pOut, - q15_t *vec_buffer) +arm_cmsis_nn_status arm_fully_connected_mat_q7_vec_q15(const q15_t *pV, + const q7_t *pM, + const uint16_t dim_vec, + const uint16_t num_of_rows, + const uint16_t bias_shift, + const uint16_t out_shift, + const q7_t *bias, + q15_t *pOut, + q15_t *vec_buffer) { (void)vec_buffer; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ const q7_t *pB = pM; @@ -190,8 +170,8 @@ arm_status arm_fully_connected_mat_q7_vec_q15(const q15_t *pV, #endif /* ARM_MATH_DSP */ - /* Return to ARM_MATH_SUCCESS */ - return (ARM_MATH_SUCCESS); + /* Return to ARM_CMSIS_NN_SUCCESS */ + return (ARM_CMSIS_NN_SUCCESS); } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_mat_q7_vec_q15_opt.c b/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_mat_q7_vec_q15_opt.c index f59825b..f4872c1 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_mat_q7_vec_q15_opt.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_mat_q7_vec_q15_opt.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_fully_connected_mat_q7_vec_q15_opt.c * Description: Mixed Q15-Q7 opt fully-connected layer function * - * $Date: 09. October 2020 - * $Revision: V.1.0.1 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,92 +42,24 @@ * @{ */ -/** - * @brief Mixed Q15-Q7 opt fully-connected layer function - * @param[in] pV pointer to input vector - * @param[in] pM pointer to matrix weights - * @param[in] dim_vec length of the vector - * @param[in] num_of_rows number of rows in weight matrix - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in] bias pointer to bias - * @param[in,out] pOut pointer to output vector - * @param[in,out] vec_buffer pointer to buffer space for input - * @return The function returns ARM_MATH_SUCCESS - * - * @details - * - * Buffer size: - * - * vec_buffer size: 0 - * - * Q7_Q15 version of the fully connected layer - * - * Weights are in q7_t and Activations are in q15_t - * - * Limitation: x4 version requires weight reordering to work - * - * Here we use only one pointer to read 4 rows in the weight - * matrix. So if the original q7_t matrix looks like this: - * - * | a11 | a12 | a13 | a14 | a15 | a16 | a17 | - * - * | a21 | a22 | a23 | a24 | a25 | a26 | a27 | - * - * | a31 | a32 | a33 | a34 | a35 | a36 | a37 | - * - * | a41 | a42 | a43 | a44 | a45 | a46 | a47 | - * - * | a51 | a52 | a53 | a54 | a55 | a56 | a57 | - * - * | a61 | a62 | a63 | a64 | a65 | a66 | a67 | - * - * We operates on multiple-of-4 rows, so the first four rows becomes - * - * | a11 | a21 | a12 | a22 | a31 | a41 | a32 | a42 | - * - * | a13 | a23 | a14 | a24 | a33 | a43 | a34 | a44 | - * - * | a15 | a25 | a16 | a26 | a35 | a45 | a36 | a46 | - * - * The column left over will be in-order. - * which is: - * | a17 | a27 | a37 | a47 | - * - * For the left-over rows, we do 1x1 computation, so the data remains - * as its original order. - * - * So the stored weight matrix looks like this: - * - * | a11 | a21 | a12 | a22 | a31 | a41 | - * - * | a32 | a42 | a13 | a23 | a14 | a24 | - * - * | a33 | a43 | a34 | a44 | a15 | a25 | - * - * | a16 | a26 | a35 | a45 | a36 | a46 | - * - * | a17 | a27 | a37 | a47 | a51 | a52 | - * - * | a53 | a54 | a55 | a56 | a57 | a61 | - * - * | a62 | a63 | a64 | a65 | a66 | a67 | - * +/* + * Mixed Q15-Q7 opt fully-connected layer function + * Refer function header for details */ -arm_status arm_fully_connected_mat_q7_vec_q15_opt(const q15_t *pV, - const q7_t *pM, - const uint16_t dim_vec, - const uint16_t num_of_rows, - const uint16_t bias_shift, - const uint16_t out_shift, - const q7_t *bias, - q15_t *pOut, - q15_t *vec_buffer) +arm_cmsis_nn_status arm_fully_connected_mat_q7_vec_q15_opt(const q15_t *pV, + const q7_t *pM, + const uint16_t dim_vec, + const uint16_t num_of_rows, + const uint16_t bias_shift, + const uint16_t out_shift, + const q7_t *bias, + q15_t *pOut, + q15_t *vec_buffer) { (void)vec_buffer; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ const q7_t *pB = pM; @@ -206,55 +138,47 @@ arm_status arm_fully_connected_mat_q7_vec_q15_opt(const q15_t *pV, */ #ifndef ARM_MATH_BIG_ENDIAN - asm volatile("COL_LOOP_%=:\n" - "ldr.w r4, [%[pA]], #4\n" - "ldr.w r1, [%[pB]], #8\n" - "mov.w r0, r1, ror #8\n" - "sxtb16 r0, r0\n" - "sxtb16 r1, r1\n" - "smlad %[sum], r4, r1, %[sum]\n" - "smlad %[sum2], r4, r0, %[sum2]\n" - "ldr.w r3, [%[pB], #-4]\n" - "mov.w r2, r3, ror #8\n" - "sxtb16 r2, r2\n" - "sxtb16 r3, r3\n" - "smlad %[sum3], r4, r3, %[sum3]\n" - "smlad %[sum4], r4, r2, %[sum4]\n" - "subs %[colCnt], #1\n" - "bne COL_LOOP_%=\n" - : [ sum ] "+r"(sum), - [ sum2 ] "+r"(sum2), - [ sum3 ] "+r"(sum3), - [ sum4 ] "+r"(sum4), - [ pB ] "+r"(pB), - [ pA ] "+r"(pA) - : [ colCnt ] "r"(colCnt) - : "r0", "r1", "r2", "r3", "r4"); + asm volatile( + "COL_LOOP_%=:\n" + "ldr.w r4, [%[pA]], #4\n" + "ldr.w r1, [%[pB]], #8\n" + "mov.w r0, r1, ror #8\n" + "sxtb16 r0, r0\n" + "sxtb16 r1, r1\n" + "smlad %[sum], r4, r1, %[sum]\n" + "smlad %[sum2], r4, r0, %[sum2]\n" + "ldr.w r3, [%[pB], #-4]\n" + "mov.w r2, r3, ror #8\n" + "sxtb16 r2, r2\n" + "sxtb16 r3, r3\n" + "smlad %[sum3], r4, r3, %[sum3]\n" + "smlad %[sum4], r4, r2, %[sum4]\n" + "subs %[colCnt], #1\n" + "bne COL_LOOP_%=\n" + : [sum] "+r"(sum), [sum2] "+r"(sum2), [sum3] "+r"(sum3), [sum4] "+r"(sum4), [pB] "+r"(pB), [pA] "+r"(pA) + : [colCnt] "r"(colCnt) + : "r0", "r1", "r2", "r3", "r4"); #else - asm volatile("COL_LOOP_%=:\n" - "ldr.w r4, [%[pA]], #4\n" - "ldr.w r1, [%[pB]], #8\n" - "mov.w r0, r1, ror #8\n" - "sxtb16 r0, r0\n" - "sxtb16 r1, r1\n" - "smlad %[sum], r4, r0, %[sum]\n" - "smlad %[sum2], r4, r1, %[sum2]\n" - "ldr.w r3, [%[pB], #-4]\n" - "mov.w r2, r3, ror #8\n" - "sxtb16 r2, r2\n" - "sxtb16 r3, r3\n" - "smlad %[sum3], r4, r2, %[sum3]\n" - "smlad %[sum4], r4, r3, %[sum4]\n" - "subs %[colCnt], #1\n" - "bne COL_LOOP_%=\n" - : [ sum ] "+r"(sum), - [ sum2 ] "+r"(sum2), - [ sum3 ] "+r"(sum3), - [ sum4 ] "+r"(sum4), - [ pB ] "+r"(pB), - [ pA ] "+r"(pA) - : [ colCnt ] "r"(colCnt) - : "r0", "r1", "r2", "r3", "r4"); + asm volatile( + "COL_LOOP_%=:\n" + "ldr.w r4, [%[pA]], #4\n" + "ldr.w r1, [%[pB]], #8\n" + "mov.w r0, r1, ror #8\n" + "sxtb16 r0, r0\n" + "sxtb16 r1, r1\n" + "smlad %[sum], r4, r0, %[sum]\n" + "smlad %[sum2], r4, r1, %[sum2]\n" + "ldr.w r3, [%[pB], #-4]\n" + "mov.w r2, r3, ror #8\n" + "sxtb16 r2, r2\n" + "sxtb16 r3, r3\n" + "smlad %[sum3], r4, r2, %[sum3]\n" + "smlad %[sum4], r4, r3, %[sum4]\n" + "subs %[colCnt], #1\n" + "bne COL_LOOP_%=\n" + : [sum] "+r"(sum), [sum2] "+r"(sum2), [sum3] "+r"(sum3), [sum4] "+r"(sum4), [pB] "+r"(pB), [pA] "+r"(pA) + : [colCnt] "r"(colCnt) + : "r0", "r1", "r2", "r3", "r4"); #endif /* ARM_MATH_BIG_ENDIAN */ #endif /* USE_INTRINSIC */ @@ -410,8 +334,8 @@ arm_status arm_fully_connected_mat_q7_vec_q15_opt(const q15_t *pV, #endif /* ARM_MATH_DSP */ - /* Return to ARM_MATH_SUCCESS */ - return (ARM_MATH_SUCCESS); + /* Return to ARM_CMSIS_NN_SUCCESS */ + return (ARM_CMSIS_NN_SUCCESS); } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_q15.c b/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_q15.c index a41299d..6ea0b27 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_q15.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_q15.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_fully_connected_q15.c * Description: Q15 basic fully-connected layer function * - * $Date: 09. October 2020 - * $Revision: V.1.0.1 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,40 +42,23 @@ * @{ */ -/** - * @brief Q15 opt fully-connected layer function - * @param[in] pV pointer to input vector - * @param[in] pM pointer to matrix weights - * @param[in] dim_vec length of the vector - * @param[in] num_of_rows number of rows in weight matrix - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in] bias pointer to bias - * @param[in,out] pOut pointer to output vector - * @param[in,out] vec_buffer pointer to buffer space for input - * @return The function returns ARM_MATH_SUCCESS - * - * - * @details - * - * Buffer size: - * - * vec_buffer size: 0 - * +/* + * Q15 opt fully-connected layer function + * Refer function header for details */ -arm_status arm_fully_connected_q15(const q15_t *pV, - const q15_t *pM, - const uint16_t dim_vec, - const uint16_t num_of_rows, - const uint16_t bias_shift, - const uint16_t out_shift, - const q15_t *bias, - q15_t *pOut, - q15_t *vec_buffer) +arm_cmsis_nn_status arm_fully_connected_q15(const q15_t *pV, + const q15_t *pM, + const uint16_t dim_vec, + const uint16_t num_of_rows, + const uint16_t bias_shift, + const uint16_t out_shift, + const q15_t *bias, + q15_t *pOut, + q15_t *vec_buffer) { (void)vec_buffer; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ const q15_t *pB = pM; @@ -189,7 +172,7 @@ arm_status arm_fully_connected_q15(const q15_t *pV, #endif /* ARM_MATH_DSP */ /* Return to application */ - return (ARM_MATH_SUCCESS); + return (ARM_CMSIS_NN_SUCCESS); } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_q15_opt.c b/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_q15_opt.c index 76738f3..82887fa 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_q15_opt.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_q15_opt.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_fully_connected_q15_opt.c * Description: Q15 opt fully-connected layer function * - * $Date: 09. October 2020 - * $Revision: V.1.0.1 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,71 +42,23 @@ * @{ */ -/** +/* * @brief Q15 opt fully-connected layer function - * @param[in] pV pointer to input vector - * @param[in] pM pointer to matrix weights - * @param[in] dim_vec length of the vector - * @param[in] num_of_rows number of rows in weight matrix - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in] bias pointer to bias - * @param[in,out] pOut pointer to output vector - * @param[in,out] vec_buffer pointer to buffer space for input - * @return The function returns ARM_MATH_SUCCESS - * - * - * @details - * - * Buffer size: - * - * vec_buffer size: 0 - * - * Here we use only one pointer to read 4 rows in the weight - * matrix. So if the original matrix looks like this: - * - * | a11 | a12 | a13 | - * - * | a21 | a22 | a23 | - * - * | a31 | a32 | a33 | - * - * | a41 | a42 | a43 | - * - * | a51 | a52 | a53 | - * - * | a61 | a62 | a63 | - * - * We operates on multiple-of-4 rows, so the first four rows becomes - * - * | a11 | a12 | a21 | a22 | a31 | a32 | a41 | a42 | - * - * | a13 | a23 | a33 | a43 | - * - * Remaining rows are kept the same original order. - * - * So the stored weight matrix looks like this: - * - * - * | a11 | a12 | a21 | a22 | a31 | a32 | a41 | a42 | - * - * | a13 | a23 | a33 | a43 | a51 | a52 | a53 | a61 | - * - * | a62 | a63 | + * Refer function header for details */ -arm_status arm_fully_connected_q15_opt(const q15_t *pV, - const q15_t *pM, - const uint16_t dim_vec, - const uint16_t num_of_rows, - const uint16_t bias_shift, - const uint16_t out_shift, - const q15_t *bias, - q15_t *pOut, - q15_t *vec_buffer) +arm_cmsis_nn_status arm_fully_connected_q15_opt(const q15_t *pV, + const q15_t *pM, + const uint16_t dim_vec, + const uint16_t num_of_rows, + const uint16_t bias_shift, + const uint16_t out_shift, + const q15_t *bias, + q15_t *pOut, + q15_t *vec_buffer) { (void)vec_buffer; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ const q15_t *pB = pM; @@ -157,26 +109,22 @@ arm_status arm_fully_connected_q15_opt(const q15_t *pV, * activation data: inV */ - asm volatile("COL_LOOP_%=:\n" - "ldr.w r4, [%[pA]], #4\n" - "ldr.w r0, [%[pB]], #16\n" - "smlad %[sum], r4, r0, %[sum]\n" - "ldr.w r1, [%[pB] , #-12]\n" - "smlad %[sum2], r4, r1, %[sum2]\n" - "ldr.w r2, [%[pB] , #-8]\n" - "smlad %[sum3], r4, r2, %[sum3]\n" - "ldr.w r3, [%[pB] , #-4]\n" - "smlad %[sum4], r4, r3, %[sum4]\n" - "subs %[colCnt], #1\n" - "bne COL_LOOP_%=\n" - : [ sum ] "+r"(sum), - [ sum2 ] "+r"(sum2), - [ sum3 ] "+r"(sum3), - [ sum4 ] "+r"(sum4), - [ pB ] "+r"(pB), - [ pA ] "+r"(pA) - : [ colCnt ] "r"(colCnt) - : "r0", "r1", "r2", "r3", "r4"); + asm volatile( + "COL_LOOP_%=:\n" + "ldr.w r4, [%[pA]], #4\n" + "ldr.w r0, [%[pB]], #16\n" + "smlad %[sum], r4, r0, %[sum]\n" + "ldr.w r1, [%[pB] , #-12]\n" + "smlad %[sum2], r4, r1, %[sum2]\n" + "ldr.w r2, [%[pB] , #-8]\n" + "smlad %[sum3], r4, r2, %[sum3]\n" + "ldr.w r3, [%[pB] , #-4]\n" + "smlad %[sum4], r4, r3, %[sum4]\n" + "subs %[colCnt], #1\n" + "bne COL_LOOP_%=\n" + : [sum] "+r"(sum), [sum2] "+r"(sum2), [sum3] "+r"(sum3), [sum4] "+r"(sum4), [pB] "+r"(pB), [pA] "+r"(pA) + : [colCnt] "r"(colCnt) + : "r0", "r1", "r2", "r3", "r4"); #endif /* USE_INTRINSIC */ @@ -329,8 +277,8 @@ arm_status arm_fully_connected_q15_opt(const q15_t *pV, #endif /* ARM_MATH_DSP */ - /* Return to ARM_MATH_SUCCESS */ - return (ARM_MATH_SUCCESS); + /* Return to ARM_CMSIS_NN_SUCCESS */ + return (ARM_CMSIS_NN_SUCCESS); } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_q7.c b/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_q7.c index 7de8246..de67bb2 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_q7.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_q7.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_fully_connected_q7.c * Description: Q7 basic fully-connected layer function * - * $Date: January 26, 2021 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,42 +42,23 @@ * @{ */ -/** - * @brief Q7 basic fully-connected layer function - * @param[in] pV pointer to input vector - * @param[in] pM pointer to matrix weights - * @param[in] dim_vec length of the vector - * @param[in] num_of_rows number of rows in weight matrix - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in] bias pointer to bias - * @param[in,out] pOut pointer to output vector - * @param[in,out] vec_buffer pointer to buffer space for input - * @return The function returns ARM_MATH_SUCCESS - * - * @details - * - * Buffer size: - * - * vec_buffer size: dim_vec - * - * This basic function is designed to work with regular weight - * matrix without interleaving. - * +/* + * Q7 basic fully-connected layer function + * Refer function header for details */ -arm_status arm_fully_connected_q7(const q7_t *pV, - const q7_t *pM, - const uint16_t dim_vec, - const uint16_t num_of_rows, - const uint16_t bias_shift, - const uint16_t out_shift, - const q7_t *bias, - q7_t *pOut, - q15_t *vec_buffer) +arm_cmsis_nn_status arm_fully_connected_q7(const q7_t *pV, + const q7_t *pM, + const uint16_t dim_vec, + const uint16_t num_of_rows, + const uint16_t bias_shift, + const uint16_t out_shift, + const q7_t *bias, + q7_t *pOut, + q15_t *vec_buffer) { -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ const q7_t *pB = pM; @@ -193,8 +174,8 @@ arm_status arm_fully_connected_q7(const q7_t *pV, #endif /* ARM_MATH_DSP */ - /* Return to ARM_MATH_SUCCESS */ - return (ARM_MATH_SUCCESS); + /* Return to ARM_CMSIS_NN_SUCCESS */ + return (ARM_CMSIS_NN_SUCCESS); } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_q7_opt.c b/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_q7_opt.c index f5fb5e0..0c8eae6 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_q7_opt.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_q7_opt.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_fully_connected_q7_opt.c * Description: Q7 basic fully-connected layer function * - * $Date: 09. October 2020 - * $Revision: V.1.0.1 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.1 * * Target Processor: Cortex-M cores * @@ -42,103 +42,23 @@ * @{ */ -/** - * @brief Q7 opt fully-connected layer function - * @param[in] pV pointer to input vector - * @param[in] pM pointer to matrix weights - * @param[in] dim_vec length of the vector - * @param[in] num_of_rows number of rows in weight matrix - * @param[in] bias_shift amount of left-shift for bias - * @param[in] out_shift amount of right-shift for output - * @param[in] bias pointer to bias - * @param[in,out] pOut pointer to output vector - * @param[in,out] vec_buffer pointer to buffer space for input - * @return The function returns ARM_MATH_SUCCESS - * - * @details - * - * Buffer size: - * - * vec_buffer size: dim_vec - * - * This opt function is designed to work with interleaved weight - * matrix. The vector input is assumed in q7_t format, we call - * arm_q7_to_q15_no_shift_shuffle function to expand into - * q15_t format with certain weight re-ordering, refer to the function - * comments for more details. - * Here we use only one pointer to read 4 rows in the weight - * matrix. So if the original q7_t matrix looks like this: - * - * | a11 | a12 | a13 | a14 | a15 | a16 | a17 | - * - * | a21 | a22 | a23 | a24 | a25 | a26 | a27 | - * - * | a31 | a32 | a33 | a34 | a35 | a36 | a37 | - * - * | a41 | a42 | a43 | a44 | a45 | a46 | a47 | - * - * | a51 | a52 | a53 | a54 | a55 | a56 | a57 | - * - * | a61 | a62 | a63 | a64 | a65 | a66 | a67 | - * - * - * We operates on multiple-of-4 rows, so the first four rows becomes - * - * | a11 | a21 | a13 | a23 | a31 | a41 | a33 | a43 | - * - * | a12 | a22 | a14 | a24 | a32 | a42 | a34 | a44 | - * - * | a15 | a25 | a35 | a45 | a16 | a26 | a36 | a46 | - * - * So within the kernel, we first read the re-ordered vector in as: - * - * | b1 | b3 | and | b2 | b4 | - * - * the four q31_t weights will look like - * - * | a11 | a13 |, | a21 | a23 |, | a31 | a33 |, | a41 | a43 | - * - * | a12 | a14 |, | a22 | a24 |, | a32 | a34 |, | a42 | a44 | - * - * The column left over will be in-order. - * which is: - * - * | a17 | a27 | a37 | a47 | - * - * For the left-over rows, we do 1x1 computation, so the data remains - * as its original order. - * - * So the stored weight matrix looks like this: - * - * | a11 | a21 | a13 | a23 | a31 | a41 | - * - * | a33 | a43 | a12 | a22 | a14 | a24 | - * - * | a32 | a42 | a34 | a44 | a15 | a25 | - * - * | a35 | a45 | a16 | a26 | a36 | a46 | - * - * | a17 | a27 | a37 | a47 | a51 | a52 | - * - * | a53 | a54 | a55 | a56 | a57 | a61 | - * - * | a62 | a63 | a64 | a65 | a66 | a67 | - * - * +/* + * Q7 opt fully-connected layer function + * Refer function header for details */ -arm_status arm_fully_connected_q7_opt(const q7_t *pV, - const q7_t *pM, - const uint16_t dim_vec, - const uint16_t num_of_rows, - const uint16_t bias_shift, - const uint16_t out_shift, - const q7_t *bias, - q7_t *pOut, - q15_t *vec_buffer) +arm_cmsis_nn_status arm_fully_connected_q7_opt(const q7_t *pV, + const q7_t *pM, + const uint16_t dim_vec, + const uint16_t num_of_rows, + const uint16_t bias_shift, + const uint16_t out_shift, + const q7_t *bias, + q7_t *pOut, + q15_t *vec_buffer) { -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ const q7_t *pB = pM; @@ -239,81 +159,73 @@ arm_status arm_fully_connected_q7_opt(const q7_t *pV, */ #ifndef ARM_MATH_BIG_ENDIAN - asm volatile("COL_LOOP_%=:\n" - "ldr.w r4, [%[pA]], #8\n" - "ldr.w r1, [%[pB]], #16\n" - "mov.w r0, r1, ror #8\n" - "sxtb16 r0, r0\n" - "sxtb16 r1, r1\n" - "smlad %[sum], r4, r1, %[sum]\n" - "smlad %[sum2], r4, r0, %[sum2]\n" - "ldr.w r3, [%[pB], #-12]\n" - "mov.w r2, r3, ror #8\n" - "sxtb16 r2, r2\n" - "sxtb16 r3, r3\n" - "smlad %[sum3], r4, r3, %[sum3]\n" - "smlad %[sum4], r4, r2, %[sum4]\n" - "ldr.w r4, [%[pA], #-4]\n" - "ldr.w r1, [%[pB], #-8]\n" - "mov.w r0, r1, ror #8\n" - "sxtb16 r0, r0\n" - "sxtb16 r1, r1\n" - "smlad %[sum], r4, r1, %[sum]\n" - "smlad %[sum2], r4, r0, %[sum2]\n" - "ldr.w r3, [%[pB], #-4]\n" - "mov.w r2, r3, ror #8\n" - "sxtb16 r2, r2\n" - "sxtb16 r3, r3\n" - "smlad %[sum3], r4, r3, %[sum3]\n" - "smlad %[sum4], r4, r2, %[sum4]\n" - "subs %[colCnt], #1\n" - "bne COL_LOOP_%=\n" - : [ sum ] "+r"(sum), - [ sum2 ] "+r"(sum2), - [ sum3 ] "+r"(sum3), - [ sum4 ] "+r"(sum4), - [ pB ] "+r"(pB), - [ pA ] "+r"(pA) - : [ colCnt ] "r"(colCnt) - : "r0", "r1", "r2", "r3", "r4"); + asm volatile( + "COL_LOOP_%=:\n" + "ldr.w r4, [%[pA]], #8\n" + "ldr.w r1, [%[pB]], #16\n" + "mov.w r0, r1, ror #8\n" + "sxtb16 r0, r0\n" + "sxtb16 r1, r1\n" + "smlad %[sum], r4, r1, %[sum]\n" + "smlad %[sum2], r4, r0, %[sum2]\n" + "ldr.w r3, [%[pB], #-12]\n" + "mov.w r2, r3, ror #8\n" + "sxtb16 r2, r2\n" + "sxtb16 r3, r3\n" + "smlad %[sum3], r4, r3, %[sum3]\n" + "smlad %[sum4], r4, r2, %[sum4]\n" + "ldr.w r4, [%[pA], #-4]\n" + "ldr.w r1, [%[pB], #-8]\n" + "mov.w r0, r1, ror #8\n" + "sxtb16 r0, r0\n" + "sxtb16 r1, r1\n" + "smlad %[sum], r4, r1, %[sum]\n" + "smlad %[sum2], r4, r0, %[sum2]\n" + "ldr.w r3, [%[pB], #-4]\n" + "mov.w r2, r3, ror #8\n" + "sxtb16 r2, r2\n" + "sxtb16 r3, r3\n" + "smlad %[sum3], r4, r3, %[sum3]\n" + "smlad %[sum4], r4, r2, %[sum4]\n" + "subs %[colCnt], #1\n" + "bne COL_LOOP_%=\n" + : [sum] "+r"(sum), [sum2] "+r"(sum2), [sum3] "+r"(sum3), [sum4] "+r"(sum4), [pB] "+r"(pB), [pA] "+r"(pA) + : [colCnt] "r"(colCnt) + : "r0", "r1", "r2", "r3", "r4"); #else - asm volatile("COL_LOOP_%=:\n" - "ldr.w r4, [%[pA]], #8\n" - "ldr.w r1, [%[pB]], #16\n" - "mov.w r0, r1, ror #8\n" - "sxtb16 r0, r0\n" - "sxtb16 r1, r1\n" - "smlad %[sum], r4, r0, %[sum]\n" - "smlad %[sum2], r4, r1, %[sum2]\n" - "ldr.w r3, [%[pB], #-12]\n" - "mov.w r2, r3, ror #8\n" - "sxtb16 r2, r2\n" - "sxtb16 r3, r3\n" - "smlad %[sum3], r4, r2, %[sum3]\n" - "smlad %[sum4], r4, r3, %[sum4]\n" - "ldr.w r4, [%[pA], #-4]\n" - "ldr.w r1, [%[pB], #-8]\n" - "mov.w r0, r1, ror #8\n" - "sxtb16 r0, r0\n" - "sxtb16 r1, r1\n" - "smlad %[sum], r4, r0, %[sum]\n" - "smlad %[sum2], r4, r1, %[sum2]\n" - "ldr.w r3, [%[pB], #-4]\n" - "mov.w r2, r3, ror #8\n" - "sxtb16 r2, r2\n" - "sxtb16 r3, r3\n" - "smlad %[sum3], r4, r2, %[sum3]\n" - "smlad %[sum4], r4, r3, %[sum4]\n" - "subs %[colCnt], #1\n" - "bne COL_LOOP_%=\n" - : [ sum ] "+r"(sum), - [ sum2 ] "+r"(sum2), - [ sum3 ] "+r"(sum3), - [ sum4 ] "+r"(sum4), - [ pB ] "+r"(pB), - [ pA ] "+r"(pA) - : [ colCnt ] "r"(colCnt) - : "r0", "r1", "r2", "r3", "r4"); + asm volatile( + "COL_LOOP_%=:\n" + "ldr.w r4, [%[pA]], #8\n" + "ldr.w r1, [%[pB]], #16\n" + "mov.w r0, r1, ror #8\n" + "sxtb16 r0, r0\n" + "sxtb16 r1, r1\n" + "smlad %[sum], r4, r0, %[sum]\n" + "smlad %[sum2], r4, r1, %[sum2]\n" + "ldr.w r3, [%[pB], #-12]\n" + "mov.w r2, r3, ror #8\n" + "sxtb16 r2, r2\n" + "sxtb16 r3, r3\n" + "smlad %[sum3], r4, r2, %[sum3]\n" + "smlad %[sum4], r4, r3, %[sum4]\n" + "ldr.w r4, [%[pA], #-4]\n" + "ldr.w r1, [%[pB], #-8]\n" + "mov.w r0, r1, ror #8\n" + "sxtb16 r0, r0\n" + "sxtb16 r1, r1\n" + "smlad %[sum], r4, r0, %[sum]\n" + "smlad %[sum2], r4, r1, %[sum2]\n" + "ldr.w r3, [%[pB], #-4]\n" + "mov.w r2, r3, ror #8\n" + "sxtb16 r2, r2\n" + "sxtb16 r3, r3\n" + "smlad %[sum3], r4, r2, %[sum3]\n" + "smlad %[sum4], r4, r3, %[sum4]\n" + "subs %[colCnt], #1\n" + "bne COL_LOOP_%=\n" + : [sum] "+r"(sum), [sum2] "+r"(sum2), [sum3] "+r"(sum3), [sum4] "+r"(sum4), [pB] "+r"(pB), [pA] "+r"(pA) + : [colCnt] "r"(colCnt) + : "r0", "r1", "r2", "r3", "r4"); #endif /* ARM_MATH_BIG_ENDIAN */ #endif /* USE_INTRINSIC */ @@ -384,6 +296,7 @@ arm_status arm_fully_connected_q7_opt(const q7_t *pV, #else /* Run the following code as reference implementation for Cortex-M0 and Cortex-M3 */ + (void)vec_buffer; uint16_t rowCnt = num_of_rows >> 2; const q7_t *pB = pM; const q7_t *pA; @@ -487,8 +400,8 @@ arm_status arm_fully_connected_q7_opt(const q7_t *pV, #endif /* ARM_MATH_DSP */ - /* Return to ARM_MATH_SUCCESS */ - return (ARM_MATH_SUCCESS); + /* Return to ARM_CMSIS_NN_SUCCESS */ + return (ARM_CMSIS_NN_SUCCESS); } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_s16.c b/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_s16.c new file mode 100644 index 0000000..8e43b71 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_s16.c @@ -0,0 +1,101 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * Copyright (C) 2010-2022 Arm Limited or its affiliates. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_fully_connected_s16 + * Description: Fully connected function compatible with TF Lite. + * + * $Date: 19 April 2022 + * $Revision: V.2.0.0 + * + * Target Processor: Cortex-M and Cortex-A cores + * + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" + +/** + * @ingroup groupNN + */ + +/** + * @addtogroup FC + * @{ + */ + +/* + * S16 basic fully-connected and matrix multiplication layer function for TensorFlow Lite + * + * Refer header file for details. + * + */ +arm_cmsis_nn_status arm_fully_connected_s16(const cmsis_nn_context *ctx, + const cmsis_nn_fc_params *fc_params, + const cmsis_nn_per_tensor_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q15_t *input, + const cmsis_nn_dims *filter_dims, + const q7_t *kernel, + const cmsis_nn_dims *bias_dims, + const int64_t *bias, + const cmsis_nn_dims *output_dims, + q15_t *output) +{ + (void)bias_dims; + (void)ctx; + (void)fc_params->filter_offset; + + int32_t batch_cnt = input_dims->n; + + const q31_t reduced_multiplier = REDUCE_MULTIPLIER(quant_params->multiplier); + + while (batch_cnt) + { + arm_nn_vec_mat_mult_t_s16(input, + kernel, + bias, + output, + reduced_multiplier, + quant_params->shift, + filter_dims->n, /* col_dim or accum_depth */ + output_dims->c, /* row_dim or output_depth */ + fc_params->activation.min, + fc_params->activation.max); + input += filter_dims->n; + output += output_dims->c; + batch_cnt--; + } + + return (ARM_CMSIS_NN_SUCCESS); +} + +int32_t arm_fully_connected_s16_get_buffer_size(const cmsis_nn_dims *filter_dims) +{ + (void)filter_dims; + return 0; +} + +/** + * @} end of FC group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_s8.c index e91039b..08f100a 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/FullyConnectedFunctions/arm_fully_connected_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2022 Arm Limited or its affiliates. * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_fully_connected_s8 * Description: Fully connected function compatible with TF Lite. * - * $Date: 09. October 2020 - * $Revision: V.2.0.1 + * $Date: 19 April 2022 + * $Revision: V.4.0.0 * * Target Processor: Cortex-M and Cortex-A cores * @@ -49,20 +49,22 @@ * */ -arm_status arm_fully_connected_s8(const cmsis_nn_context *ctx, - const cmsis_nn_fc_params *fc_params, - const cmsis_nn_per_tensor_quant_params *quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input, - const cmsis_nn_dims *filter_dims, - const q7_t *kernel, - const cmsis_nn_dims *bias_dims, - const int32_t *bias, - const cmsis_nn_dims *output_dims, - q7_t *output) +arm_cmsis_nn_status arm_fully_connected_s8(const cmsis_nn_context *ctx, + const cmsis_nn_fc_params *fc_params, + const cmsis_nn_per_tensor_quant_params *quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input, + const cmsis_nn_dims *filter_dims, + const q7_t *kernel, + const cmsis_nn_dims *bias_dims, + const int32_t *bias, + const cmsis_nn_dims *output_dims, + q7_t *output) { (void)bias_dims; (void)ctx; + (void)fc_params->filter_offset; + int32_t batch_cnt = input_dims->n; while (batch_cnt) @@ -72,19 +74,20 @@ arm_status arm_fully_connected_s8(const cmsis_nn_context *ctx, bias, output, fc_params->input_offset, - fc_params->filter_offset, + 0, fc_params->output_offset, quant_params->multiplier, quant_params->shift, filter_dims->n, /* col_dim or accum_depth */ output_dims->c, /* row_dim or output_depth */ fc_params->activation.min, - fc_params->activation.max); + fc_params->activation.max, + 1L); input += filter_dims->n; output += output_dims->c; batch_cnt--; } - return (ARM_MATH_SUCCESS); + return (ARM_CMSIS_NN_SUCCESS); } int32_t arm_fully_connected_s8_get_buffer_size(const cmsis_nn_dims *filter_dims) diff --git a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_accumulate_q7_to_q15.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_accumulate_q7_to_q15.c index e2bba44..7875682 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_accumulate_q7_to_q15.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_accumulate_q7_to_q15.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_nn_accumulate_q7_to_q15.c * Description: Accumulate q7 vector into q15 one. * - * $Date: 09. October 2020 - * $Revision: V.1.0.2 + * $Date: 20 July 2021 + * $Revision: V.1.1.2 * * pSrc Processor: Cortex-M CPUs * @@ -46,11 +46,13 @@ void arm_nn_accumulate_q7_to_q15(q15_t *pDst, const q7_t *pSrc, uint32_t length) { q15_t *pCnt = pDst; const q7_t *pV = pSrc; + int32_t count = length; +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) q31_t v1, v2, vo1, vo2; - int32_t cnt = length >> 2; + count = length >> 2; q31_t in; - while (cnt > 0l) + while (count > 0l) { q31_t value = arm_nn_read_q7x4_ia(&pV); v1 = __SXTB16(__ROR((uint32_t)value, 8)); @@ -69,13 +71,14 @@ void arm_nn_accumulate_q7_to_q15(q15_t *pDst, const q7_t *pSrc, uint32_t length) in = arm_nn_read_q15x2(pCnt); arm_nn_write_q15x2_ia(&pCnt, __QADD16(vo2, in)); - cnt--; + count--; } - cnt = length & 0x3; - while (cnt > 0l) + count = length & 0x3; +#endif + while (count > 0l) { *pCnt++ += *pV++; - cnt--; + count--; } } diff --git a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_add_q7.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_add_q7.c index 9df8a83..7ff743d 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_add_q7.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_add_q7.c @@ -23,8 +23,8 @@ * Title: arm_nn_add_q7.c * Description: Non saturating addition of elements of a q7 vector. * - * $Date: 09. October 2020 - * $Revision: V.1.0.1 + * $Date: 20. July 2021 + * $Revision: V.1.1.1 * * Target Processor: Cortex-M cores * @@ -46,7 +46,7 @@ void arm_nn_add_q7(const q7_t *input, q31_t *output, uint32_t block_size) { uint32_t block_count; q31_t result = 0; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Loop unrolling: Compute 4 outputs at a time */ block_count = block_size >> 2U; diff --git a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_depthwise_conv_nt_t_padded_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_depthwise_conv_nt_t_padded_s8.c index f5725d6..7d12144 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_depthwise_conv_nt_t_padded_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_depthwise_conv_nt_t_padded_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2020, 2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_nn_depthwise_conv_nt_t_padded_s8.c * Description: Depthwise convolution with padded matrices. * - * $Date: 09. October 2020 - * $Revision: V.1.0.2 + * $Date: 27. July 2022 + * $Revision: V.2.0.0 * * Target Processor: Cortex-M processors with MVE extension * -------------------------------------------------------------------- */ @@ -48,38 +48,43 @@ * */ -q7_t *arm_nn_depthwise_conv_nt_t_padded_s8(const q7_t *lhs, - const q7_t *rhs, - const int32_t input_offset, - const uint16_t num_ch, - const int32_t *out_shift, - const int32_t *out_mult, - const int32_t out_offset, - const int32_t activation_min, - const int32_t activation_max, - const uint16_t row_x_col, - const int32_t *const output_bias, - q7_t *out) +arm_cmsis_nn_status arm_nn_depthwise_conv_nt_t_padded_s8(const q7_t *lhs, + const q7_t *rhs, + const int32_t input_offset, + const int32_t active_ch, + const int32_t total_ch, + const int32_t *out_shift, + const int32_t *out_mult, + const int32_t out_offset, + const int32_t activation_min, + const int32_t activation_max, + const uint16_t row_x_col, + const int32_t *const output_bias, + q7_t *out) { #if defined(ARM_MATH_MVEI) - int32_t loop_count = (num_ch + 3) / 4; + int32_t loop_count = (active_ch + 3) / 4; const int32_t *bias = output_bias; - uint32_t num_ch_to_process = num_ch; + uint32_t num_ch_to_process = active_ch; for (int i_loop_cnt = 0, offset = 0; i_loop_cnt < loop_count; num_ch_to_process -= 4, out += 4, offset += 4, i_loop_cnt++) { - int32x4_t out_0 = vldrwq_s32(bias); + int32x4_t out_0 = vdupq_n_s32(0); + if (bias) + { + out_0 = vldrwq_s32(bias); + bias += 4; + } int32x4_t out_1 = out_0; int32x4_t out_2 = out_0; int32x4_t out_3 = out_0; - bias += 4; const int8_t *rhs_0 = rhs + offset; const int8_t *lhs_0 = lhs + offset; - const int8_t *lhs_1 = lhs + row_x_col * num_ch + offset; - const int8_t *lhs_2 = lhs + (row_x_col * num_ch * 2) + offset; - const int8_t *lhs_3 = lhs + (row_x_col * num_ch * 3) + offset; + const int8_t *lhs_1 = lhs + row_x_col * CH_IN_BLOCK_MVE + offset; + const int8_t *lhs_2 = lhs + (row_x_col * CH_IN_BLOCK_MVE * 2) + offset; + const int8_t *lhs_3 = lhs + (row_x_col * CH_IN_BLOCK_MVE * 3) + offset; for (int i_row_x_col = 0; i_row_x_col < row_x_col; i_row_x_col++) { @@ -102,12 +107,12 @@ q7_t *arm_nn_depthwise_conv_nt_t_padded_s8(const q7_t *lhs, out_3 += vmulq_s32(ip_3, ker_0); - lhs_0 += num_ch; - lhs_1 += num_ch; - lhs_2 += num_ch; - lhs_3 += num_ch; + lhs_0 += CH_IN_BLOCK_MVE; + lhs_1 += CH_IN_BLOCK_MVE; + lhs_2 += CH_IN_BLOCK_MVE; + lhs_3 += CH_IN_BLOCK_MVE; - rhs_0 += num_ch; + rhs_0 += total_ch; } const int32x4_t mult = vldrwq_s32(out_mult); @@ -126,33 +131,29 @@ q7_t *arm_nn_depthwise_conv_nt_t_padded_s8(const q7_t *lhs, out_1 = vaddq_n_s32(out_1, out_offset); out_1 = vmaxq_s32(out_1, vdupq_n_s32(activation_min)); out_1 = vminq_s32(out_1, vdupq_n_s32(activation_max)); - vstrbq_p_s32(out + num_ch, out_1, p); + vstrbq_p_s32(out + total_ch, out_1, p); out_2 = arm_requantize_mve_32x4(out_2, mult, shift); out_2 = vaddq_n_s32(out_2, out_offset); out_2 = vmaxq_s32(out_2, vdupq_n_s32(activation_min)); out_2 = vminq_s32(out_2, vdupq_n_s32(activation_max)); - vstrbq_p_s32(out + 2 * num_ch, out_2, p); + vstrbq_p_s32(out + 2 * total_ch, out_2, p); out_3 = arm_requantize_mve_32x4(out_3, mult, shift); out_3 = vaddq_n_s32(out_3, out_offset); out_3 = vmaxq_s32(out_3, vdupq_n_s32(activation_min)); out_3 = vminq_s32(out_3, vdupq_n_s32(activation_max)); - vstrbq_p_s32(out + 3 * num_ch, out_3, p); + vstrbq_p_s32(out + 3 * total_ch, out_3, p); } - const int tail_ch = num_ch & 0x3; - if (tail_ch != 0) - { - out -= (4 - tail_ch); - } - return out + (3 * num_ch); + return ARM_CMSIS_NN_SUCCESS; #else (void)lhs; (void)rhs; (void)input_offset; - (void)num_ch; + (void)active_ch; + (void)total_ch; (void)out_shift; (void)out_mult; (void)out_offset; @@ -161,7 +162,7 @@ q7_t *arm_nn_depthwise_conv_nt_t_padded_s8(const q7_t *lhs, (void)row_x_col; (void)output_bias; (void)out; - return NULL; + return ARM_CMSIS_NN_NO_IMPL_ERROR; #endif } diff --git a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_depthwise_conv_nt_t_s16.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_depthwise_conv_nt_t_s16.c new file mode 100644 index 0000000..503aa64 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_depthwise_conv_nt_t_s16.c @@ -0,0 +1,175 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * SPDX-FileCopyrightText: Copyright 2022 Arm Limited and/or its affiliates + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_nn_depthwise_conv_nt_t_s16.c + * Description: Depthwise convolution on matrices with no padding. + * + * $Date: 6 July 2022 + * $Revision: V.1.0.0 + * + * Target Processor: Cortex-M processors with MVE extension + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" + +/** + * @ingroup groupSupport + */ + +/** + * @addtogroup NNBasicMath + * @{ + */ + +/* + * Depthwise convolution of rhs matrix with 4 lhs matrices with no padding. Dimensions are the same for lhs and rhs. + * + * Refer header file for details. + * + */ +int16_t *arm_nn_depthwise_conv_nt_t_s16(const int16_t *lhs, + const q7_t *rhs, + const uint16_t num_ch, + const int32_t *out_shift, + const int32_t *out_mult, + const int32_t activation_min, + const int32_t activation_max, + const uint16_t row_x_col, + const int64_t *const output_bias, + int16_t *out) +{ +#if defined(ARM_MATH_MVEI) + + const int64_t *bias = output_bias; + int32_t loop_count = (num_ch + 3) / 4; + uint32_t num_ch_to_process = num_ch; + + for (int i_loop_cnt = 0, offset = 0; i_loop_cnt < loop_count; + num_ch_to_process -= 4, offset += 4, out += 4, i_loop_cnt++) + { + const int8_t *rhs_0 = rhs + offset; + const int16_t *lhs_0 = lhs + offset; + const int16_t *lhs_1 = lhs + row_x_col * num_ch + offset; + const int16_t *lhs_2 = lhs + (row_x_col * num_ch * 2) + offset; + const int16_t *lhs_3 = lhs + (row_x_col * num_ch * 3) + offset; + + int32x4_t out_0 = vdupq_n_s32(0); + int32x4_t out_1 = vdupq_n_s32(0); + int32x4_t out_2 = vdupq_n_s32(0); + int32x4_t out_3 = vdupq_n_s32(0); + + for (int i_row_x_col = 0; i_row_x_col < row_x_col; i_row_x_col++) + { + const int32x4_t ker_0 = vldrbq_s32(rhs_0); + + int32x4_t ip_0 = vldrhq_s32(lhs_0); + out_0 += vmulq_s32(ip_0, ker_0); + + int32x4_t ip_1 = vldrhq_s32(lhs_1); + out_1 += vmulq_s32(ip_1, ker_0); + + int32x4_t ip_2 = vldrhq_s32(lhs_2); + out_2 += vmulq_s32(ip_2, ker_0); + + int32x4_t ip_3 = vldrhq_s32(lhs_3); + out_3 += vmulq_s32(ip_3, ker_0); + + lhs_0 += num_ch; + lhs_1 += num_ch; + lhs_2 += num_ch; + lhs_3 += num_ch; + + rhs_0 += num_ch; + } + + for (int i_requantize = 0; i_requantize < 4; i_requantize++) + { + int32_t reduced_multiplier = REDUCE_MULTIPLIER(out_mult[i_requantize]); + int32_t shift = out_shift[i_requantize]; + int64_t in_requantize_0 = (int64_t)out_0[i_requantize]; + int64_t in_requantize_1 = (int64_t)out_1[i_requantize]; + int64_t in_requantize_2 = (int64_t)out_2[i_requantize]; + int64_t in_requantize_3 = (int64_t)out_3[i_requantize]; + + if (bias) + { + in_requantize_0 += *bias; + in_requantize_1 += *bias; + in_requantize_2 += *bias; + in_requantize_3 += *bias; + bias++; + } + + out_0[i_requantize] = arm_nn_requantize_s64(in_requantize_0, reduced_multiplier, shift); + out_1[i_requantize] = arm_nn_requantize_s64(in_requantize_1, reduced_multiplier, shift); + out_2[i_requantize] = arm_nn_requantize_s64(in_requantize_2, reduced_multiplier, shift); + out_3[i_requantize] = arm_nn_requantize_s64(in_requantize_3, reduced_multiplier, shift); + } + + mve_pred16_t p = vctp32q(num_ch_to_process); + + out_0 = vmaxq_s32(out_0, vdupq_n_s32(activation_min)); + out_0 = vminq_s32(out_0, vdupq_n_s32(activation_max)); + vstrhq_p_s32(out, out_0, p); + + out_1 = vmaxq_s32(out_1, vdupq_n_s32(activation_min)); + out_1 = vminq_s32(out_1, vdupq_n_s32(activation_max)); + vstrhq_p_s32(out + num_ch, out_1, p); + + out_2 = vmaxq_s32(out_2, vdupq_n_s32(activation_min)); + out_2 = vminq_s32(out_2, vdupq_n_s32(activation_max)); + vstrhq_p_s32(out + 2 * num_ch, out_2, p); + + out_3 = vmaxq_s32(out_3, vdupq_n_s32(activation_min)); + out_3 = vminq_s32(out_3, vdupq_n_s32(activation_max)); + vstrhq_p_s32(out + 3 * num_ch, out_3, p); + + out_mult += 4; + out_shift += 4; + } + const int tail_ch = num_ch & 0x3; + if (tail_ch != 0) + { + out -= (4 - tail_ch); + } + + return out + (3 * num_ch); +#else + (void)lhs; + (void)rhs; + (void)num_ch; + (void)out_shift; + (void)out_mult; + (void)activation_min; + (void)activation_max; + (void)row_x_col; + (void)output_bias; + (void)out; + return NULL; +#endif +} + +/** + * @} end of NNBasicMath group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_depthwise_conv_nt_t_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_depthwise_conv_nt_t_s8.c index 66beef8..b8d0871 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_depthwise_conv_nt_t_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_depthwise_conv_nt_t_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2020, 2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_nn_depthwise_conv_nt_t_s8.c * Description: Depthwise convolution on matrices with no padding. * - * $Date: 09. October 2020 - * $Revision: V.1.0.2 + * $Date: 27. July 2022 + * $Revision: V.2.0.0 * * Target Processor: Cortex-M processors with MVE extension. * -------------------------------------------------------------------- */ @@ -46,39 +46,43 @@ * Refer header file for details. * */ - -q7_t *arm_nn_depthwise_conv_nt_t_s8(const q7_t *lhs, - const q7_t *rhs, - const int32_t input_offset, - const uint16_t num_ch, - const int32_t *out_shift, - const int32_t *out_mult, - const int32_t out_offset, - const int32_t activation_min, - const int32_t activation_max, - const uint16_t row_x_col, - const int32_t *const output_bias, - q7_t *out) +arm_cmsis_nn_status arm_nn_depthwise_conv_nt_t_s8(const q7_t *lhs, + const q7_t *rhs, + const int32_t input_offset, + const int32_t active_ch, + const int32_t total_ch, + const int32_t *out_shift, + const int32_t *out_mult, + const int32_t out_offset, + const int32_t activation_min, + const int32_t activation_max, + const uint16_t row_x_col, + const int32_t *const output_bias, + q7_t *out) { #if defined(ARM_MATH_MVEI) const int32_t *bias = output_bias; - int32_t loop_count = (num_ch + 3) / 4; - uint32_t num_ch_to_process = num_ch; + int32_t loop_count = (active_ch + 3) / 4; + uint32_t num_ch_to_process = active_ch; for (int i_loop_cnt = 0, offset = 0; i_loop_cnt < loop_count; num_ch_to_process -= 4, offset += 4, out += 4, i_loop_cnt++) { - int32x4_t out_0 = vldrwq_s32(bias); + int32x4_t out_0 = vdupq_n_s32(0); + if (bias) + { + out_0 = vldrwq_s32(bias); + bias += 4; + } int32x4_t out_1 = out_0; int32x4_t out_2 = out_0; int32x4_t out_3 = out_0; - bias += 4; const int8_t *rhs_0 = rhs + offset; const int8_t *lhs_0 = lhs + offset; - const int8_t *lhs_1 = lhs + row_x_col * num_ch + offset; - const int8_t *lhs_2 = lhs + (row_x_col * num_ch * 2) + offset; - const int8_t *lhs_3 = lhs + (row_x_col * num_ch * 3) + offset; + const int8_t *lhs_1 = lhs + row_x_col * CH_IN_BLOCK_MVE + offset; + const int8_t *lhs_2 = lhs + (row_x_col * CH_IN_BLOCK_MVE * 2) + offset; + const int8_t *lhs_3 = lhs + (row_x_col * CH_IN_BLOCK_MVE * 3) + offset; int32x4_t ker_sum = vdupq_n_s32(0); for (int i_row_x_col = 0; i_row_x_col < row_x_col; i_row_x_col++) @@ -98,12 +102,12 @@ q7_t *arm_nn_depthwise_conv_nt_t_s8(const q7_t *lhs, int32x4_t ip_3 = vldrbq_s32(lhs_3); out_3 += vmulq_s32(ip_3, ker_0); - lhs_0 += num_ch; - lhs_1 += num_ch; - lhs_2 += num_ch; - lhs_3 += num_ch; + lhs_0 += CH_IN_BLOCK_MVE; + lhs_1 += CH_IN_BLOCK_MVE; + lhs_2 += CH_IN_BLOCK_MVE; + lhs_3 += CH_IN_BLOCK_MVE; - rhs_0 += num_ch; + rhs_0 += total_ch; } ker_sum = vmulq_n_s32(ker_sum, input_offset); @@ -128,33 +132,28 @@ q7_t *arm_nn_depthwise_conv_nt_t_s8(const q7_t *lhs, out_1 = vaddq_n_s32(out_1, out_offset); out_1 = vmaxq_s32(out_1, vdupq_n_s32(activation_min)); out_1 = vminq_s32(out_1, vdupq_n_s32(activation_max)); - vstrbq_p_s32(out + num_ch, out_1, p); + vstrbq_p_s32(out + total_ch, out_1, p); out_2 = arm_requantize_mve_32x4(out_2, mult, shift); out_2 = vaddq_n_s32(out_2, out_offset); out_2 = vmaxq_s32(out_2, vdupq_n_s32(activation_min)); out_2 = vminq_s32(out_2, vdupq_n_s32(activation_max)); - vstrbq_p_s32(out + 2 * num_ch, out_2, p); + vstrbq_p_s32(out + 2 * total_ch, out_2, p); out_3 = arm_requantize_mve_32x4(out_3, mult, shift); out_3 = vaddq_n_s32(out_3, out_offset); out_3 = vmaxq_s32(out_3, vdupq_n_s32(activation_min)); out_3 = vminq_s32(out_3, vdupq_n_s32(activation_max)); - vstrbq_p_s32(out + 3 * num_ch, out_3, p); - } - - const int tail_ch = num_ch & 0x3; - if (tail_ch != 0) - { - out -= (4 - tail_ch); + vstrbq_p_s32(out + 3 * total_ch, out_3, p); } - return out + (3 * num_ch); + return ARM_CMSIS_NN_SUCCESS; #else (void)lhs; (void)rhs; (void)input_offset; - (void)num_ch; + (void)active_ch; + (void)total_ch; (void)out_shift; (void)out_mult; (void)out_offset; @@ -163,7 +162,7 @@ q7_t *arm_nn_depthwise_conv_nt_t_s8(const q7_t *lhs, (void)row_x_col; (void)output_bias; (void)out; - return NULL; + return ARM_CMSIS_NN_NO_IMPL_ERROR; #endif } diff --git a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mat_mul_core_1x_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mat_mul_core_1x_s8.c index 9b96f86..67685df 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mat_mul_core_1x_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mat_mul_core_1x_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_nn_mat_mul_core_1x_s8.c * Description: General Matrix-multiplication function * - * $Date: 09. October 2020 - * $Revision: V.1.0.2 + * $Date: 22 Aug 2022 + * $Revision: V.3.1.0 * * Target Processor: Cortex-M cores * -------------------------------------------------------------------- */ @@ -46,41 +46,106 @@ * Refer header file for details. * */ - -arm_status arm_nn_mat_mul_core_1x_s8(int32_t row_elements, - const int8_t *row_base, - const int8_t *col_base, - int32_t *const sum_col, - int32_t *const output) +arm_cmsis_nn_status arm_nn_mat_mul_core_1x_s8(int32_t row_elements, + const int32_t skipped_row_elements, + const int8_t *row_base_ref, + const int8_t *col_base_ref, + const int32_t out_ch, + const cmsis_nn_conv_params *conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const int32_t *bias, + int8_t *output) { - int32_t acc_n0 = 0; - int32_t sum_tmp = 0; +#if defined(ARM_MATH_MVEI) + const int8_t *col_base = col_base_ref; + int32_t *output_mult = quant_params->multiplier; + int32_t *output_shift = quant_params->shift; + const int32_t out_offset = conv_params->output_offset; + const int32_t out_activation_min = conv_params->activation.min; + const int32_t out_activation_max = conv_params->activation.max; + + int32_t acc[4]; + for (int i = 0; i < out_ch; i++) + { + int32_t acc_n0 = 0; + const int8_t *row_base = row_base_ref; -#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) + int32_t sum_tmp = 0; - __ASM volatile(" vldrb.8 q0, [%[col]], 16 \n" - " wlstp.8 lr, %[cnt], 1f \n" - "2: \n" - " vaddva.s8 %[sum], q0 \n" - " vldrb.8 q1, [%[row0]], 16 \n" - " vmladava.s8 %[out0], q0, q1 \n" - " vldrb.8 q0, [%[col]], 16 \n" - " letp lr, 2b \n" - "1: \n" - : [col] "+r"(col_base), [sum] "+Te"(sum_tmp), [row0] "+r"(row_base), [out0] "+Te"(acc_n0) - : [cnt] "r"(row_elements) - : "q0", "q1", "memory", "r14"); +#if defined(ARM_MATH_AUTOVECTORIZE) + for (int j = 0; j < row_elements; j++) + { + int32_t col = col_base[j]; + sum_tmp += col; + acc_n0 += row_base[j] * col; + } #else - for (int i = 0; i < row_elements; i++) + __ASM volatile(" vldrb.8 q0, [%[col]], #16 \n" + " wlstp.8 lr, %[cnt], 1f \n" + "2: \n" + " vaddva.s8 %[sum], q0 \n" + " vldrb.8 q1, [%[row0]], #16 \n" + " vmladava.s8 %[out0], q0, q1 \n" + " vldrb.8 q0, [%[col]], #16 \n" + " letp lr, 2b \n" + "1: \n" + : [col] "+r"(col_base), [sum] "+Te"(sum_tmp), [row0] "+r"(row_base), [out0] "+Te"(acc_n0) + : [cnt] "r"(row_elements) + : "q0", "q1", "memory", "r14"); +#endif + + sum_tmp *= conv_params->input_offset; + acc_n0 += sum_tmp; + + const int32_t index = i & 0x3; + acc[index] = acc_n0; + + if (index == 3) + { + int32x4_t res = vldrwq_s32(acc); + if (bias) + { + res = vaddq_s32(res, vldrwq_s32(bias)); + bias += 4; + } + res = arm_requantize_mve_32x4(res, vldrwq_s32(output_mult), vldrwq_s32(output_shift)); + output_mult += 4; + output_shift += 4; + res = vaddq_n_s32(res, out_offset); + res = vmaxq_s32(res, vdupq_n_s32(out_activation_min)); + res = vminq_s32(res, vdupq_n_s32(out_activation_max)); + vstrbq_s32(output, res); + output += 4; + } + col_base = col_base_ref + (i + 1) * (row_elements + skipped_row_elements); + } + // Handle left over elements + for (int i = 0; i < (out_ch & 0x3); i++) { - sum_tmp += col_base[i]; - acc_n0 += row_base[i] * col_base[i]; + int32_t acc_n0 = acc[i]; + if (bias) + { + acc_n0 += bias[i]; + } + acc_n0 = arm_nn_requantize(acc_n0, output_mult[i], output_shift[i]); + acc_n0 += conv_params->output_offset; + acc_n0 = MAX(acc_n0, conv_params->activation.min); + acc_n0 = MIN(acc_n0, conv_params->activation.max); + *output++ = (q7_t)acc_n0; } -#endif - *sum_col = sum_tmp; - *output = acc_n0; - return ARM_MATH_SUCCESS; +#else + (void)row_elements; + (void)skipped_row_elements; + (void)row_base_ref; + (void)col_base_ref; + (void)out_ch; + (void)conv_params; + (void)quant_params; + (void)bias; + (void)output; +#endif + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mat_mul_core_4x_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mat_mul_core_4x_s8.c index e4ec2b2..b0ea228 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mat_mul_core_4x_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mat_mul_core_4x_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,14 +23,13 @@ * Title: arm_nn_mat_mul_core_4x_s8.c * Description: General matrix multiplication function for MVE extension * - * $Date: 09. October 2020 - * $Revision: V.2.0.1 + * $Date: 22. Aug 2022 + * $Revision: V.3.1.0 * - * Target Processor: Cortex-M cores + * Target Processor: Cortex-M processors * -------------------------------------------------------------------- */ - +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nn_types.h" #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" - /** * @ingroup groupSupport */ @@ -46,71 +45,105 @@ * Refer header file for details. * */ -arm_status arm_nn_mat_mul_core_4x_s8(const int32_t row_elements, - const int32_t offset, - const int8_t *row_base, - const int8_t *col_base, - int32_t *const sum_col, - int32_t *const output) + +int8_t *arm_nn_mat_mul_core_4x_s8(const int32_t row_elements, + const int32_t offset, + const int8_t *row_base, + const int8_t *col_base_ref, + const int32_t out_ch, + const cmsis_nn_conv_params *conv_params, + const cmsis_nn_per_channel_quant_params *quant_params, + const int32_t *bias, + int8_t *output) { - int32_t acc_n0 = 0; - int32_t acc_n1 = 0; - int32_t acc_n2 = 0; - int32_t acc_n3 = 0; - const int8_t *ip_row_0 = row_base; - const int8_t *ip_row_1 = row_base + offset; - const int8_t *ip_row_2 = row_base + (2 * offset); - const int8_t *ip_row_3 = row_base + (3 * offset); - int32_t sum_tmp = 0; +#if defined(ARM_MATH_MVEI) + for (int i = 0; i < out_ch; i++) + { + int32_t acc_n0 = 0; + int32_t acc_n1 = 0; + int32_t acc_n2 = 0; + int32_t acc_n3 = 0; -#if defined(ARM_MATH_MVEI) && !defined(ARM_MATH_AUTOVECTORIZE) - __ASM volatile(" vldrb.8 q0, [%[col]], 16 \n" - " wlstp.8 lr, %[cnt], 1f \n" - "2: \n" - " vaddva.s8 %[sum], q0 \n" - " vldrb.8 q1, [%[row0]], 16 \n" - " vmladava.s8 %[out0], q0, q1 \n" - " vldrb.8 q2, [%[row1]], 16 \n" - " vmladava.s8 %[out1], q0, q2 \n" - " vldrb.8 q3, [%[row2]], 16 \n" - " vmladava.s8 %[out2], q0, q3 \n" - " vldrb.8 q4, [%[row3]], 16 \n" - " vmladava.s8 %[out3], q0, q4 \n" - " vldrb.8 q0, [%[col]], 16 \n" - " letp lr, 2b \n" - "1: \n" - : [col] "+r"(col_base), - [sum] "+Te"(sum_tmp), - [row0] "+r"(ip_row_0), - [row1] "+r"(ip_row_1), - [row2] "+r"(ip_row_2), - [row3] "+r"(ip_row_3), - [out0] "+Te"(acc_n0), - [out1] "+Te"(acc_n1), - [out2] "+Te"(acc_n2), - [out3] "+Te"(acc_n3) - : [cnt] "r"(row_elements) - : "q0", "q1", "q2", "q3", "q4", "memory", "r14"); + const int8_t *ip_row_0 = row_base; + const int8_t *ip_row_1 = row_base + offset; + const int8_t *ip_row_2 = row_base + (2 * offset); + const int8_t *ip_row_3 = row_base + (3 * offset); + const int8_t *col_base = col_base_ref + i * row_elements; + int32_t sum_tmp = 0; + +#if defined(ARM_MATH_AUTOVECTORIZE) + for (int j = 0; j < row_elements; j++) + { + int32_t col = col_base[j]; + sum_tmp += col; + acc_n0 += ip_row_0[j] * col; + acc_n1 += ip_row_1[j] * col; + acc_n2 += ip_row_2[j] * col; + acc_n3 += ip_row_3[j] * col; + } #else - for (int i = 0; i < row_elements; i++) - { - int32_t col = col_base[i]; - sum_tmp += col; - acc_n0 += ip_row_0[i] * col; - acc_n1 += ip_row_1[i] * col; - acc_n2 += ip_row_2[i] * col; - acc_n3 += ip_row_3[i] * col; - } + __ASM volatile(" vldrb.8 q0, [%[col]], #16 \n" + " wlstp.8 lr, %[cnt], 1f \n" + "2: \n" + " vaddva.s8 %[sum], q0 \n" + " vldrb.8 q1, [%[row0]], #16 \n" + " vmladava.s8 %[out0], q0, q1 \n" + " vldrb.8 q2, [%[row1]], #16 \n" + " vmladava.s8 %[out1], q0, q2 \n" + " vldrb.8 q3, [%[row2]], #16 \n" + " vmladava.s8 %[out2], q0, q3 \n" + " vldrb.8 q4, [%[row3]], #16 \n" + " vmladava.s8 %[out3], q0, q4 \n" + " vldrb.8 q0, [%[col]], #16 \n" + " letp lr, 2b \n" + "1: \n" + : [col] "+r"(col_base), + [sum] "+Te"(sum_tmp), + [row0] "+r"(ip_row_0), + [row1] "+r"(ip_row_1), + [row2] "+r"(ip_row_2), + [row3] "+r"(ip_row_3), + [out0] "+Te"(acc_n0), + [out1] "+Te"(acc_n1), + [out2] "+Te"(acc_n2), + [out3] "+Te"(acc_n3) + : [cnt] "r"(row_elements) + : "q0", "q1", "q2", "q3", "q4", "memory", "r14"); #endif - output[0] = acc_n0; - output[1] = acc_n1; - output[2] = acc_n2; - output[3] = acc_n3; - *sum_col = sum_tmp; + int32x4_t res = {acc_n0, acc_n1, acc_n2, acc_n3}; + sum_tmp *= conv_params->input_offset; + if (bias) + { + sum_tmp += bias[i]; + } + res = vaddq_n_s32(res, sum_tmp); - return ARM_MATH_SUCCESS; + res = arm_requantize_mve(res, quant_params->multiplier[i], quant_params->shift[i]); + res = vaddq_n_s32(res, conv_params->output_offset); + + res = vmaxq_s32(res, vdupq_n_s32(conv_params->activation.min)); + res = vminq_s32(res, vdupq_n_s32(conv_params->activation.max)); + + const uint32x4_t scatter_offset = {0, (uint32_t)out_ch, (uint32_t)out_ch * 2, (uint32_t)out_ch * 3}; + vstrbq_scatter_offset_s32(output, scatter_offset, res); + output++; + } + + return output + (3 * out_ch); +#else + (void)row_elements; + (void)offset; + (void)row_base; + (void)col_base_ref; + (void)out_ch; + (void)conv_params; + (void)quant_params; + (void)bias; + (void)output; + return NULL; +#endif } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_s8_s16_reordered.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mat_mul_kernel_s16.c similarity index 50% rename from edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_s8_s16_reordered.c rename to edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mat_mul_kernel_s16.c index 4a3e2eb..b93e078 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_s8_s16_reordered.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mat_mul_kernel_s16.c @@ -20,11 +20,11 @@ /* ---------------------------------------------------------------------- * Project: CMSIS NN Library - * Title: arm_nn_mat_mult_kernel_s8_s16_reordered.c - * Description: Matrix-multiplication function for convolution with reordered columns + * Title: arm_nn_mat_mult_kernel_s16.c + * Description: Matrix-multiplication function for convolution * - * $Date: 09. October 2020 - * $Revision: V.1.0.3 + * $Date: 12 August 2021 + * $Revision: V.1.1.0 * * Target Processor: Cortex-M cores * -------------------------------------------------------------------- */ @@ -33,34 +33,31 @@ #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" /* - * Matrix-multiplication with re-ordered input and bias inputs for convolution with per-channel - * requantization. The re-ordering is a consequence of sign extension is done by the SXTB16 command. + * Matrix-multiplication function for convolution with per-channel requantization. * - * Refer header file for details. This function differs from arm_nn_mat_mult_kernel_s8_s16(), in that it uses - * read_and_pad_reordered() instead of arm_nn_mat_mult_kernel_s8_s16(). Investigating the cycles impact and - * unifying these two functions is a potential future improvement. + * Refer header file for details. * */ -q7_t *arm_nn_mat_mult_kernel_s8_s16_reordered(const q7_t *input_a, - const q15_t *input_b, - const uint16_t output_ch, - const int32_t *out_shift, - const int32_t *out_mult, - const int32_t out_offset, - const int16_t activation_min, - const int16_t activation_max, - const uint16_t num_col_a, - const int32_t *const output_bias, - q7_t *out_0) +q15_t *arm_nn_mat_mult_kernel_s16(const q7_t *input_a, + const q15_t *input_b, + const int32_t output_ch, + const int32_t *out_shift, + const int32_t *out_mult, + const int16_t activation_min, + const int16_t activation_max, + const int32_t num_col_a, + const int64_t *const output_bias, + q15_t *out_0) { -#if defined(ARM_MATH_DSP) - /* set up the second output pointers */ - q7_t *out_1 = out_0 + output_ch; - const int32_t *bias = output_bias; +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) + /* set up the second output pointers */ + q15_t *out_1 = out_0 + output_ch; + const int64_t *bias = output_bias; uint16_t row_count = output_ch / 2; const q7_t *ip_a0 = input_a; + /* this loop over rows in A */ while (row_count) { @@ -71,11 +68,11 @@ q7_t *arm_nn_mat_mult_kernel_s8_s16_reordered(const q7_t *input_a, /* align the second pointer for A */ const q7_t *ip_a1 = ip_a0 + num_col_a; - /* Init accumulator with bias for channel N and N + 1 */ - q31_t ch_0_out_0 = *bias; - q31_t ch_0_out_1 = *bias++; - q31_t ch_1_out_0 = *bias; - q31_t ch_1_out_1 = *bias++; + /* Init accumulator for channel N and N + 1 */ + q31_t ch_0_out_0 = 0; + q31_t ch_0_out_1 = 0; + q31_t ch_1_out_0 = 0; + q31_t ch_1_out_1 = 0; uint16_t col_count = num_col_a / 4; /* accumulate over the vector */ @@ -85,8 +82,8 @@ q7_t *arm_nn_mat_mult_kernel_s8_s16_reordered(const q7_t *input_a, q31_t b0 = arm_nn_read_q15x2_ia(&ip_b0); q31_t b1 = arm_nn_read_q15x2_ia(&ip_b1); - ip_a0 = read_and_pad_reordered(ip_a0, &a01, &a02); - ip_a1 = read_and_pad_reordered(ip_a1, &a11, &a12); + ip_a0 = read_and_pad(ip_a0, &a01, &a02); + ip_a1 = read_and_pad(ip_a1, &a11, &a12); ch_0_out_0 = __SMLAD(a01, b0, ch_0_out_0); ch_0_out_1 = __SMLAD(a01, b1, ch_0_out_1); @@ -103,33 +100,66 @@ q7_t *arm_nn_mat_mult_kernel_s8_s16_reordered(const q7_t *input_a, col_count--; } /* while over col_count */ - - ch_0_out_0 = arm_nn_requantize(ch_0_out_0, *out_mult, *out_shift); - ch_0_out_0 += out_offset; + col_count = num_col_a & 0x3; + while (col_count) + { + q7_t a0 = *ip_a0++; + q15_t b0 = *ip_b0++; + q7_t a1 = *ip_a1++; + q15_t b1 = *ip_b1++; + + ch_0_out_0 += a0 * b0; + ch_0_out_1 += a0 * b1; + ch_1_out_0 += a1 * b0; + ch_1_out_1 += a1 * b1; + col_count--; + } /* while over col_count */ + if (bias) + { + q31_t reduced_multiplier = REDUCE_MULTIPLIER(*out_mult); + q63_t acc_64 = ch_0_out_0 + *bias; + ch_0_out_0 = arm_nn_requantize_s64(acc_64, reduced_multiplier, *out_shift); + acc_64 = ch_0_out_1 + *bias++; + ch_0_out_1 = arm_nn_requantize_s64(acc_64, reduced_multiplier, *out_shift); + out_mult++; + } + else + { + ch_0_out_0 = arm_nn_requantize(ch_0_out_0, *out_mult, *out_shift); + ch_0_out_1 = arm_nn_requantize(ch_0_out_1, *out_mult, *out_shift); + out_mult++; + } ch_0_out_0 = MAX(ch_0_out_0, activation_min); ch_0_out_0 = MIN(ch_0_out_0, activation_max); - *out_0++ = (q7_t)ch_0_out_0; + *out_0++ = (q15_t)ch_0_out_0; - ch_0_out_1 = arm_nn_requantize(ch_0_out_1, *out_mult, *out_shift); - ch_0_out_1 += out_offset; ch_0_out_1 = MAX(ch_0_out_1, activation_min); ch_0_out_1 = MIN(ch_0_out_1, activation_max); - *out_1++ = (q7_t)ch_0_out_1; - out_mult++; + *out_1++ = (q15_t)ch_0_out_1; out_shift++; - ch_1_out_0 = arm_nn_requantize(ch_1_out_0, *out_mult, *out_shift); - ch_1_out_0 += out_offset; + if (bias) + { + q31_t reduced_multiplier = REDUCE_MULTIPLIER(*out_mult); + q63_t acc_64 = ch_1_out_0 + *bias; + ch_1_out_0 = arm_nn_requantize_s64(acc_64, reduced_multiplier, *out_shift); + acc_64 = ch_1_out_1 + *bias++; + ch_1_out_1 = arm_nn_requantize_s64(acc_64, reduced_multiplier, *out_shift); + out_mult++; + } + else + { + ch_1_out_0 = arm_nn_requantize(ch_1_out_0, *out_mult, *out_shift); + ch_1_out_1 = arm_nn_requantize(ch_1_out_1, *out_mult, *out_shift); + out_mult++; + } ch_1_out_0 = MAX(ch_1_out_0, activation_min); ch_1_out_0 = MIN(ch_1_out_0, activation_max); - *out_0++ = (q7_t)ch_1_out_0; + *out_0++ = (q15_t)ch_1_out_0; - ch_1_out_1 = arm_nn_requantize(ch_1_out_1, *out_mult, *out_shift); - ch_1_out_1 += out_offset; ch_1_out_1 = MAX(ch_1_out_1, activation_min); ch_1_out_1 = MIN(ch_1_out_1, activation_max); - *out_1++ = (q7_t)ch_1_out_1; - out_mult++; + *out_1++ = (q15_t)ch_1_out_1; out_shift++; /* skip row */ @@ -137,48 +167,68 @@ q7_t *arm_nn_mat_mult_kernel_s8_s16_reordered(const q7_t *input_a, row_count--; } - if (output_ch & 1) + /* compute the last odd numbered row if any */ + if (output_ch & 0x1) { /* setup pointers for B */ const q15_t *ip_b0 = input_b; const q15_t *ip_b1 = ip_b0 + num_col_a; - /* Init accumulator with bias for channel N + 1 */ - q31_t ch_0_out_0 = *bias; - q31_t ch_0_out_1 = ch_0_out_0; + q31_t ch_0_out_0 = 0; + q31_t ch_0_out_1 = 0; - int32_t col_count = num_col_a / 4; + uint16_t col_count = num_col_a >> 2; while (col_count) { q31_t a01, a02; q31_t b0 = arm_nn_read_q15x2_ia(&ip_b0); q31_t b1 = arm_nn_read_q15x2_ia(&ip_b1); - ip_a0 = read_and_pad_reordered(ip_a0, &a01, &a02); + ip_a0 = read_and_pad(ip_a0, &a01, &a02); ch_0_out_0 = __SMLAD(a01, b0, ch_0_out_0); ch_0_out_1 = __SMLAD(a01, b1, ch_0_out_1); b0 = arm_nn_read_q15x2_ia(&ip_b0); b1 = arm_nn_read_q15x2_ia(&ip_b1); - ch_0_out_0 = __SMLAD(a02, b0, ch_0_out_0); ch_0_out_1 = __SMLAD(a02, b1, ch_0_out_1); col_count--; - } /* while over col_count */ + } + col_count = num_col_a & 0x3; + while (col_count) + { + q7_t a0 = *ip_a0++; + q15_t b0 = *ip_b0++; + q15_t b1 = *ip_b1++; - ch_0_out_0 = arm_nn_requantize(ch_0_out_0, *out_mult, *out_shift); - ch_0_out_0 += out_offset; + ch_0_out_0 += a0 * b0; + ch_0_out_1 += a0 * b1; + col_count--; + } + if (bias) + { + q31_t reduced_multiplier = REDUCE_MULTIPLIER(*out_mult); + q63_t acc_64 = ch_0_out_0 + *bias; + ch_0_out_0 = arm_nn_requantize_s64(acc_64, reduced_multiplier, *out_shift); + acc_64 = ch_0_out_1 + *bias++; + ch_0_out_1 = arm_nn_requantize_s64(acc_64, reduced_multiplier, *out_shift); + } + else + { + ch_0_out_0 = arm_nn_requantize(ch_0_out_0, *out_mult, *out_shift); + ch_0_out_1 = arm_nn_requantize(ch_0_out_1, *out_mult, *out_shift); + } ch_0_out_0 = MAX(ch_0_out_0, activation_min); ch_0_out_0 = MIN(ch_0_out_0, activation_max); - *out_0++ = (q7_t)ch_0_out_0; + *out_0++ = (q15_t)ch_0_out_0; - ch_0_out_1 = arm_nn_requantize(ch_0_out_1, *out_mult, *out_shift); - ch_0_out_1 += out_offset; ch_0_out_1 = MAX(ch_0_out_1, activation_min); ch_0_out_1 = MIN(ch_0_out_1, activation_max); - *out_1++ = (q7_t)ch_0_out_1; + *out_1++ = (q15_t)ch_0_out_1; + out_mult++; + out_shift++; } out_0 += output_ch; @@ -191,7 +241,6 @@ q7_t *arm_nn_mat_mult_kernel_s8_s16_reordered(const q7_t *input_a, (void)output_ch; (void)out_shift; (void)out_mult; - (void)out_offset; (void)activation_min; (void)activation_max; (void)num_col_a; diff --git a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mat_mult_nt_t_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mat_mult_nt_t_s8.c index 71d0b6d..552a4e1 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mat_mult_nt_t_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mat_mult_nt_t_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved. + * Copyright (C) 2020-2022 Arm Limited or its affiliates. * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_nn_mat_mult_s8_nt_t_s8 * Description: Matrix multiplication support function with the right-hand-side (rhs) matrix transposed * - * $Date: 09. October 2020 - * $Revision: V.1.0.3 + * $Date: 19 April 2022 + * $Revision: V.2.0.0 * * Target Processor: Cortex-M * @@ -47,19 +47,19 @@ * Refer header file for details. * */ -arm_status arm_nn_mat_mult_nt_t_s8(const q7_t *lhs, - const q7_t *rhs, - const q31_t *bias, - q7_t *dst, - const int32_t *dst_multipliers, - const int32_t *dst_shifts, - const int32_t lhs_rows, - const int32_t rhs_rows, - const int32_t rhs_cols, - const int32_t lhs_offset, - const int32_t dst_offset, - const int32_t activation_min, - const int32_t activation_max) +arm_cmsis_nn_status arm_nn_mat_mult_nt_t_s8(const q7_t *lhs, + const q7_t *rhs, + const q31_t *bias, + q7_t *dst, + const int32_t *dst_multipliers, + const int32_t *dst_shifts, + const int32_t lhs_rows, + const int32_t rhs_rows, + const int32_t rhs_cols, + const int32_t lhs_offset, + const int32_t dst_offset, + const int32_t activation_min, + const int32_t activation_max) { #if defined(ARM_MATH_DSP) const int32_t off0 = rhs_cols - 4; @@ -576,7 +576,7 @@ arm_status arm_nn_mat_mult_nt_t_s8(const q7_t *lhs, } } #endif - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mult_q15.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mult_q15.c index bc2d868..ec58c86 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mult_q15.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mult_q15.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2018 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_nn_mult_q15.c * Description: Q15 vector multiplication with variable output shifts * - * $Date: 09. October 2020 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.1.1.3 * * Target Processor: Cortex-M cores * @@ -41,88 +41,15 @@ * @{ */ -/** - * @brief Q7 vector multiplication with variable output shifts - * @param[in] *pSrcA pointer to the first input vector - * @param[in] *pSrcB pointer to the second input vector - * @param[out] *pDst pointer to the output vector - * @param[in] out_shift amount of right-shift for output - * @param[in] blockSize number of samples in each vector +/* + * Q7 vector multiplication with variable output shifts + * Refer function header for details * - * Scaling and Overflow Behavior: - * \par - * The function uses saturating arithmetic. - * Results outside of the allowable Q15 range [0x8000 0x7FFF] will be saturated. */ void arm_nn_mult_q15(q15_t *pSrcA, q15_t *pSrcB, q15_t *pDst, const uint16_t out_shift, uint32_t blockSize) { - uint32_t blkCnt; /* loop counters */ - -#if defined(ARM_MATH_DSP) - - /* Run the below code for Cortex-M4 and Cortex-M3 */ - q31_t inA1, inA2, inB1, inB2; /* temporary input variables */ - q15_t out1, out2, out3, out4; /* temporary output variables */ - q31_t mul1, mul2, mul3, mul4; /* temporary variables */ - - /* loop Unrolling */ - blkCnt = blockSize >> 2U; - - /* First part of the processing with loop unrolling. Compute 4 outputs at a time. - ** a second loop below computes the remaining 1 to 3 samples. */ - while (blkCnt > 0U) - { - /* read two samples at a time from sourceA */ - inA1 = arm_nn_read_q15x2_ia((const q15_t **)&pSrcA); - /* read two samples at a time from sourceB */ - inB1 = arm_nn_read_q15x2_ia((const q15_t **)&pSrcB); - /* read two samples at a time from sourceA */ - inA2 = arm_nn_read_q15x2_ia((const q15_t **)&pSrcA); - /* read two samples at a time from sourceB */ - inB2 = arm_nn_read_q15x2_ia((const q15_t **)&pSrcB); - - /* multiply mul = sourceA * sourceB */ - mul1 = (q31_t)((q15_t)(inA1 >> 16) * (q15_t)(inB1 >> 16)); - mul2 = (q31_t)((q15_t)inA1 * (q15_t)inB1); - mul3 = (q31_t)((q15_t)(inA2 >> 16) * (q15_t)(inB2 >> 16)); - mul4 = (q31_t)((q15_t)inA2 * (q15_t)inB2); - - /* saturate result to 16 bit */ - out1 = (q15_t)__SSAT((q31_t)(mul1 + NN_ROUND(out_shift)) >> out_shift, 16); - out2 = (q15_t)__SSAT((q31_t)(mul2 + NN_ROUND(out_shift)) >> out_shift, 16); - out3 = (q15_t)__SSAT((q31_t)(mul3 + NN_ROUND(out_shift)) >> out_shift, 16); - out4 = (q15_t)__SSAT((q31_t)(mul4 + NN_ROUND(out_shift)) >> out_shift, 16); - - /* store the result */ -#ifndef ARM_MATH_BIG_ENDIAN - - *__SIMD32(pDst)++ = __PKHBT(out2, out1, 16); - *__SIMD32(pDst)++ = __PKHBT(out4, out3, 16); - -#else - - *__SIMD32(pDst)++ = __PKHBT(out2, out1, 16); - *__SIMD32(pDst)++ = __PKHBT(out4, out3, 16); - -#endif /* #ifndef ARM_MATH_BIG_ENDIAN */ - - /* Decrement the blockSize loop counter */ - blkCnt--; - } - - /* If the blockSize is not a multiple of 4, compute any remaining output samples here. - ** No loop unrolling is used. */ - blkCnt = blockSize % 0x4U; - -#else - - /* Run the below code for Cortex-M0 */ - - /* Initialize blkCnt with number of samples */ - blkCnt = blockSize; - -#endif /* #if defined (ARM_MATH_DSP) */ + uint32_t blkCnt = blockSize; /* loop counters */ while (blkCnt > 0U) { diff --git a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mult_q7.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mult_q7.c index 07aa7af..0d02f9a 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mult_q7.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_mult_q7.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2018 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_nn_mult_q7.c * Description: Q7 vector multiplication with variable output shifts * - * $Date: 09. October 2020 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.1.1.3 * * Target Processor: Cortex-M cores * @@ -41,62 +41,14 @@ * @{ */ -/** - * @brief Q7 vector multiplication with variable output shifts - * @param[in] *pSrcA pointer to the first input vector - * @param[in] *pSrcB pointer to the second input vector - * @param[out] *pDst pointer to the output vector - * @param[in] out_shift amount of right-shift for output - * @param[in] blockSize number of samples in each vector - * - * Scaling and Overflow Behavior: - * \par - * The function uses saturating arithmetic. - * Results outside of the allowable Q7 range [0x80 0x7F] will be saturated. +/* + * Q7 vector multiplication with variable output shifts + * Refer function header for details */ void arm_nn_mult_q7(q7_t *pSrcA, q7_t *pSrcB, q7_t *pDst, const uint16_t out_shift, uint32_t blockSize) { - uint32_t blkCnt; /* loop counters */ - -#if defined(ARM_MATH_DSP) - - /* Run the below code for Cortex-M4 and Cortex-M3 */ - q7_t out1, out2, out3, out4; /* Temporary variables to store the product */ - - /* loop Unrolling */ - blkCnt = blockSize >> 2U; - - /* First part of the processing with loop unrolling. Compute 4 outputs at a time. - ** a second loop below computes the remaining 1 to 3 samples. */ - while (blkCnt > 0U) - { - /* C = A * B */ - /* Multiply the inputs and store the results in temporary variables */ - out1 = (q7_t)__SSAT(((q15_t)((q15_t)(*pSrcA++) * (*pSrcB++) + NN_ROUND(out_shift)) >> out_shift), 8); - out2 = (q7_t)__SSAT(((q15_t)((q15_t)(*pSrcA++) * (*pSrcB++) + NN_ROUND(out_shift)) >> out_shift), 8); - out3 = (q7_t)__SSAT(((q15_t)((q15_t)(*pSrcA++) * (*pSrcB++) + NN_ROUND(out_shift)) >> out_shift), 8); - out4 = (q7_t)__SSAT(((q15_t)((q15_t)(*pSrcA++) * (*pSrcB++) + NN_ROUND(out_shift)) >> out_shift), 8); - - /* Store the results of 4 inputs in the destination buffer in single cycle by packing */ - *__SIMD32(pDst)++ = __PACKq7(out1, out2, out3, out4); - - /* Decrement the blockSize loop counter */ - blkCnt--; - } - - /* If the blockSize is not a multiple of 4, compute any remaining output samples here. - ** No loop unrolling is used. */ - blkCnt = blockSize % 0x4U; - -#else - - /* Run the below code for Cortex-M0 */ - - /* Initialize blkCnt with number of samples */ - blkCnt = blockSize; - -#endif /* #if defined (ARM_MATH_DSP) */ + uint32_t blkCnt = blockSize; /* loop counters */ while (blkCnt > 0U) { diff --git a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_s16.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_s16.c new file mode 100644 index 0000000..54f5403 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_s16.c @@ -0,0 +1,372 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * SPDX-FileCopyrightText: Copyright 2020-2022 Arm Limited and/or its affiliates + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_nn_vec_mat_mult_t_s16 + * Description: s16 vector by matrix (transposed) multiplication + * + * $Date: 11 August 2022 + * $Revision: V.2.1.0 + * + * Target Processor: Cortex-M + * + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" +#define MAX_COL_COUNT (512) + +/** + * @ingroup groupSupport + */ + +/** + * @addtogroup NNBasicMath + * @{ + */ + +/* + * s16 vector(lhs) by matrix (transposed) multiplication + * + * Refer header file for details. + * + */ +arm_cmsis_nn_status arm_nn_vec_mat_mult_t_s16(const q15_t *lhs, + const q7_t *rhs, + const q63_t *bias, + q15_t *dst, + const int32_t dst_multiplier, + const int32_t dst_shift, + const int32_t rhs_cols, + const int32_t rhs_rows, + const int32_t activation_min, + const int32_t activation_max) +{ +#if defined(ARM_MATH_DSP) + + int32_t rhs_cols_fast = rhs_cols; + + if (rhs_cols > MAX_COL_COUNT) + { + rhs_cols_fast = MAX_COL_COUNT; + } + +#if defined(ARM_MATH_MVEI) + int32_t row_loop_cnt = rhs_rows / 4; + int32_t col_loop_cnt = (rhs_cols_fast + 7) / 8; + + for (int32_t i_row_loop_count = 0; i_row_loop_count < row_loop_cnt; i_row_loop_count++) + { + int32_t col_cnt = rhs_cols_fast; + + const int16_t *lhs_ptr = lhs; + const int8_t *rhs_ptr_0 = rhs; + const int8_t *rhs_ptr_1 = rhs + rhs_cols; + const int8_t *rhs_ptr_2 = rhs + rhs_cols * 2; + const int8_t *rhs_ptr_3 = rhs + rhs_cols * 3; + + int32_t result_0 = 0; + int32_t result_1 = 0; + int32_t result_2 = 0; + int32_t result_3 = 0; + + for (int i_col_loop_cnt = 0; i_col_loop_cnt < col_loop_cnt; i_col_loop_cnt++) + { + mve_pred16_t pred = vctp16q(col_cnt); + col_cnt -= 8; + + int16x8_t lhs_input = vldrhq_z_s16(lhs_ptr, pred); + + int16x8_t rhs_input_0 = vldrbq_z_s16(rhs_ptr_0, pred); + int16x8_t rhs_input_1 = vldrbq_z_s16(rhs_ptr_1, pred); + int16x8_t rhs_input_2 = vldrbq_z_s16(rhs_ptr_2, pred); + int16x8_t rhs_input_3 = vldrbq_z_s16(rhs_ptr_3, pred); + + result_0 = vmladavaq_s16(result_0, lhs_input, rhs_input_0); + result_1 = vmladavaq_s16(result_1, lhs_input, rhs_input_1); + result_2 = vmladavaq_s16(result_2, lhs_input, rhs_input_2); + result_3 = vmladavaq_s16(result_3, lhs_input, rhs_input_3); + + lhs_ptr += 8; + + rhs_ptr_0 += 8; + rhs_ptr_1 += 8; + rhs_ptr_2 += 8; + rhs_ptr_3 += 8; + } + + int64_t result_64_0 = result_0; + int64_t result_64_1 = result_1; + int64_t result_64_2 = result_2; + int64_t result_64_3 = result_3; + + if (rhs_cols > MAX_COL_COUNT) + { + for (int i_rhs_cols = MAX_COL_COUNT; i_rhs_cols < rhs_cols; i_rhs_cols++) + { + const int16_t lhs_temp = *lhs_ptr++; + + result_64_0 += *rhs_ptr_0++ * lhs_temp; + result_64_1 += *rhs_ptr_1++ * lhs_temp; + result_64_2 += *rhs_ptr_2++ * lhs_temp; + result_64_3 += *rhs_ptr_3++ * lhs_temp; + } + } + + if (bias) + { + result_64_0 += *bias++; + result_64_1 += *bias++; + result_64_2 += *bias++; + result_64_3 += *bias++; + } + + int32_t tmp; + tmp = arm_nn_requantize_s64(result_64_0, dst_multiplier, dst_shift); + tmp = MAX(tmp, activation_min); + tmp = MIN(tmp, activation_max); + *dst++ = (q15_t)tmp; + + tmp = 0; + tmp = arm_nn_requantize_s64(result_64_1, dst_multiplier, dst_shift); + tmp = MAX(tmp, activation_min); + tmp = MIN(tmp, activation_max); + *dst++ = (q15_t)tmp; + + tmp = 0; + tmp = arm_nn_requantize_s64(result_64_2, dst_multiplier, dst_shift); + tmp = MAX(tmp, activation_min); + tmp = MIN(tmp, activation_max); + *dst++ = (q15_t)tmp; + + tmp = 0; + tmp = arm_nn_requantize_s64(result_64_3, dst_multiplier, dst_shift); + tmp = MAX(tmp, activation_min); + tmp = MIN(tmp, activation_max); + *dst++ = (q15_t)tmp; + + rhs += 4 * rhs_cols; + } + + for (int8_t rows_left = rhs_rows & 0x3; rows_left > 0; rows_left--) + { + int32_t result = 0; + + col_loop_cnt = (rhs_cols_fast + 7) / 8; + + const int16_t *lhs_ptr = lhs; + const int8_t *rhs_ptr = rhs; + + int32_t col_cnt = (int32_t)rhs_cols_fast; + + for (int i_col_loop_cnt = 0; i_col_loop_cnt < col_loop_cnt; i_col_loop_cnt++) + { + mve_pred16_t pred = vctp16q(col_cnt); + col_cnt -= 8; + + int16x8_t lhs_input = vldrhq_z_s16(lhs_ptr, pred); + int16x8_t rhs_input = vldrbq_z_s16(rhs_ptr, pred); + + result = vmladavaq_p_s16(result, lhs_input, rhs_input, pred); + + lhs_ptr += 8; + rhs_ptr += 8; + } + + int64_t result_64 = result; + + if (bias) + { + result_64 += *bias++; + } + + if (rhs_cols > MAX_COL_COUNT) + { + for (int i_rhs_cols = MAX_COL_COUNT; i_rhs_cols < rhs_cols; i_rhs_cols++) + { + const int16_t lhs_temp = *lhs_ptr++; + + result_64 += *rhs_ptr++ * lhs_temp; + } + } + + int32_t tmp = 0; + tmp = arm_nn_requantize_s64(result_64, dst_multiplier, dst_shift); + tmp = MAX(tmp, activation_min); + tmp = MIN(tmp, activation_max); + *dst++ = (q15_t)tmp; + + rhs += rhs_cols; + } + +#else // ARM_MATH_MVEI + + const int32_t row_loop_cnt = rhs_rows / 2; + + for (int32_t i = 0; i < row_loop_cnt; i++) + { + + q63_t acc_64_0 = 0; + q63_t acc_64_1 = 0; + int32_t acc_0 = 0; + int32_t acc_1 = 0; + + const int32_t col_loop_cnt = rhs_cols_fast / 4; + + const int16_t *lhs_vec = lhs; + const int8_t *rhs_0 = rhs; + const int8_t *rhs_1 = rhs + rhs_cols; + rhs += 2 * rhs_cols; + + for (int j = col_loop_cnt; j != 0; j--) + { + int32_t ker_0, ker_1, vec_part_0, vec_part_1; + + vec_part_0 = arm_nn_read_q15x2_ia(&lhs_vec); + vec_part_1 = arm_nn_read_q15x2_ia(&lhs_vec); + + rhs_0 = read_and_pad(rhs_0, &ker_0, &ker_1); + + acc_0 = __SMLAD(ker_0, vec_part_0, acc_0); + acc_0 = __SMLAD(ker_1, vec_part_1, acc_0); + + rhs_1 = read_and_pad(rhs_1, &ker_0, &ker_1); + + acc_1 = __SMLAD(ker_0, vec_part_0, acc_1); + acc_1 = __SMLAD(ker_1, vec_part_1, acc_1); + } + + acc_64_0 += acc_0; + acc_64_1 += acc_1; + + for (int k = col_loop_cnt * 4; k < rhs_cols; k++) + { + const int32_t lhs_temp = (*lhs_vec); + lhs_vec++; + acc_64_0 += lhs_temp * (*rhs_0); + rhs_0++; + acc_64_1 += lhs_temp * (*rhs_1); + rhs_1++; + } + + if (bias) + { + acc_64_0 += *bias++; + acc_64_1 += *bias++; + } + q31_t tmp; + + tmp = arm_nn_requantize_s64(acc_64_0, dst_multiplier, dst_shift); + tmp = MAX(tmp, activation_min); + tmp = MIN(tmp, activation_max); + *dst++ = (q15_t)tmp; + + tmp = arm_nn_requantize_s64(acc_64_1, dst_multiplier, dst_shift); + tmp = MAX(tmp, activation_min); + tmp = MIN(tmp, activation_max); + *dst++ = (q15_t)tmp; + } + + if (rhs_rows & 0x1) + { + q63_t acc_64_0 = 0; + int32_t acc_0 = 0; + const int32_t col_loop_cnt = rhs_cols_fast / 4; + + const int16_t *lhs_vec = lhs; + const int8_t *rhs_0 = rhs; + + for (int i = col_loop_cnt; i != 0; i--) + { + int32_t ker_0, ker_1, vec; + rhs_0 = read_and_pad(rhs_0, &ker_0, &ker_1); + + vec = arm_nn_read_q15x2_ia(&lhs_vec); + acc_0 = __SMLAD(ker_0, vec, acc_0); + + vec = arm_nn_read_q15x2_ia(&lhs_vec); + acc_0 = __SMLAD(ker_1, vec, acc_0); + } + + acc_64_0 += acc_0; + + for (int j = col_loop_cnt * 4; j < rhs_cols; j++) + { + const int32_t lhs_temp = (*lhs_vec); + lhs_vec++; + acc_64_0 += lhs_temp * (*rhs_0); + rhs_0++; + } + + if (bias) + { + acc_64_0 += *bias++; + } + q31_t tmp; + tmp = arm_nn_requantize_s64(acc_64_0, dst_multiplier, dst_shift); + tmp = MAX(tmp, activation_min); + tmp = MIN(tmp, activation_max); + *dst++ = (q15_t)tmp; + } + +#endif // ARM_MATH_MVEI +#else // ARM_MATH_DSP + for (int i_row_loop_cnt = 0; i_row_loop_cnt < rhs_rows; i_row_loop_cnt++) + { + const q15_t *lhs_ptr = lhs; + const q7_t *rhs_ptr_0 = &rhs[0]; + + q63_t result = 0; + + for (int32_t rhs_cols_idx = 0; rhs_cols_idx < rhs_cols; ++rhs_cols_idx) + { + const q63_t rhs_value0 = (int8_t)*rhs_ptr_0; + const q63_t lhs_value = *lhs_ptr; + + result += lhs_value * rhs_value0; + + ++rhs_ptr_0; + ++lhs_ptr; + } + + if (bias) + { + result += *bias++; + } + // Quantize down + result = arm_nn_requantize_s64(result, dst_multiplier, dst_shift); + + // Clamp the result + result = ((result) > (activation_min) ? (result) : (activation_min)); + result = ((result) < (activation_max) ? (result) : (activation_max)); + + *dst++ = (q15_t)result; + rhs += rhs_cols; + } +#endif // ARM_MATH_DSP + + return ARM_CMSIS_NN_SUCCESS; +} + +/** + * @} end of NNBasicMath group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_s8.c index e3e3a33..7663bb6 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2020-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_nn_vec_mat_mult_t_s8 * Description: s8 vector by matrix (transposed) multiplication * - * $Date: 09. October 2020 - * $Revision: V.1.5.1 + * $Date: 16 Aug 2022 + * $Revision: V.4.0.2 * * Target Processor: Cortex-M * @@ -47,38 +47,25 @@ * Refer header file for details. * */ -arm_status arm_nn_vec_mat_mult_t_s8(const q7_t *lhs, - const q7_t *rhs, - const q31_t *bias, - q7_t *dst, - const int32_t lhs_offset, - const int32_t rhs_offset, - const int32_t dst_offset, - const int32_t dst_multiplier, - const int32_t dst_shift, - const int32_t rhs_cols, - const int32_t rhs_rows, - const int32_t activation_min, - const int32_t activation_max) +arm_cmsis_nn_status arm_nn_vec_mat_mult_t_s8(const q7_t *lhs, + const q7_t *rhs, + const q31_t *bias, + q7_t *dst, + const int32_t lhs_offset, + const int32_t rhs_offset, + const int32_t dst_offset, + const int32_t dst_multiplier, + const int32_t dst_shift, + const int32_t rhs_cols, + const int32_t rhs_rows, + const int32_t activation_min, + const int32_t activation_max, + const int32_t address_offset) { + (void)rhs_offset; #if defined(ARM_MATH_MVEI) - int32_t row_loop_cnt = rhs_rows / 3; - - int32_t lhs_sum = 0; - { - const int32_t col_loop_cnt = (rhs_cols + 15) / 16; - uint32_t col_cnt = (uint32_t)rhs_cols; - const int8_t *lhs_vec = lhs; - for (int i = 0; i < col_loop_cnt; i++) - { - mve_pred16_t p = vctp8q(col_cnt); - col_cnt -= 16; - - const int8x16_t input = vldrbq_z_s8(lhs_vec, p); - lhs_sum = vaddvaq_p_s8(lhs_sum, input, p); - lhs_vec += 16; - } - } + const int32_t row_loop_cnt = rhs_rows / 3; + const uint32x4_t address_offset_array = {0, address_offset, address_offset * 2, address_offset * 3}; for (int i_row_loop_cnt = 0; i_row_loop_cnt < row_loop_cnt; i_row_loop_cnt++) { @@ -130,21 +117,26 @@ arm_status arm_nn_vec_mat_mult_t_s8(const q7_t *lhs, if (bias) { int32x4_t b = vldrwq_z_s32(bias, p); - acc = vaddq_m_s32(vuninitializedq_s32(), acc, b, p); + acc = vaddq_x_s32(acc, b, p); bias += 3; } const int32x4_t rhs_sum = {rhs_sum_0, rhs_sum_1, rhs_sum_2, 0}; - acc += vdupq_n_s32(lhs_offset) * rhs_sum; - acc += vdupq_n_s32(rhs_offset * lhs_sum); - acc += vdupq_n_s32(lhs_offset * rhs_offset * rhs_cols); acc = arm_requantize_mve(acc, dst_multiplier, dst_shift); acc = vaddq_s32(acc, vdupq_n_s32(dst_offset)); acc = vmaxq_s32(acc, vdupq_n_s32(activation_min)); acc = vminq_s32(acc, vdupq_n_s32(activation_max)); - vstrbq_p_s32(dst, acc, p); - dst += 3; + + if (address_offset > 1L) + { + vstrbq_scatter_offset_s32(dst, address_offset_array, acc); + } + else + { + vstrbq_p_s32(dst, acc, p); + } + dst += 3 * address_offset; } const int loop_cnt = rhs_rows % 3; @@ -177,8 +169,7 @@ arm_status arm_nn_vec_mat_mult_t_s8(const q7_t *lhs, acc_0 += *bias; bias++; } - const int32_t offsets = - (rhs_sum_0 * lhs_offset) + (lhs_sum * rhs_offset) + (lhs_offset * rhs_offset * rhs_cols); + const int32_t offsets = rhs_sum_0 * lhs_offset; acc_0 += offsets; acc_0 = arm_nn_requantize(acc_0, dst_multiplier, dst_shift); acc_0 += dst_offset; @@ -186,279 +177,189 @@ arm_status arm_nn_vec_mat_mult_t_s8(const q7_t *lhs, // Clamp the result acc_0 = MAX(acc_0, activation_min); *dst = MIN(acc_0, activation_max); - dst++; + dst += address_offset; } #elif defined(ARM_MATH_DSP) - const int32_t off0 = rhs_cols - 4; - const int16_t lhs_offset_s16 = lhs_offset; - const int16_t rhs_offset_s16 = rhs_offset; - + const int32_t row_loop_cnt = rhs_rows / 2; + const int16_t lhs_offset_s16 = (int16_t)lhs_offset; const uint32_t lhs_offset_s16x2 = __PKHBT(lhs_offset_s16, lhs_offset_s16, 16); - const uint32_t rhs_offset_s16x2 = __PKHBT(rhs_offset_s16, rhs_offset_s16, 16); - for (int32_t rhs_rows_idx = 0; rhs_rows_idx <= (rhs_rows - 2); rhs_rows_idx += 2) + for (int32_t i = 0; i < row_loop_cnt; i++) { - const q7_t *lhs_ptr = &lhs[0]; - const q7_t *rhs_ptr = &rhs[0]; - - q31_t res00 = 0; - q31_t res01 = 0; + int32_t acc_0 = 0; + int32_t acc_1 = 0; if (bias) { - res00 = *bias++; - res01 = *bias++; + acc_0 = *bias++; + acc_1 = *bias++; } - int32_t rhs_cols_idx = 0; + const int32_t col_loop_cnt = rhs_cols / 4; - q31_t val0, val1, val2, val3, val4, val5; - for (; rhs_cols_idx <= (rhs_cols - 16); rhs_cols_idx += 16) - { - // Read 4 x int8 values from the RHS matrix - val0 = arm_nn_read_q7x4_ia((const q7_t **)&rhs_ptr); - val2 = __SXTAB16(rhs_offset_s16x2, val0); - // Read 4 x int8 values from the LHS vector - val1 = arm_nn_read_q7x4_ia((const q7_t **)&lhs_ptr); - val0 = __SXTAB16(rhs_offset_s16x2, __ROR(val0, 8)); - val3 = __SXTAB16(lhs_offset_s16x2, val1); - // Read 4 x int8 values from the RHS matrix - val4 = arm_nn_read_q7x4((const q7_t *)rhs_ptr + off0); - val1 = __SXTAB16(lhs_offset_s16x2, __ROR(val1, 8)); - - // Perform the accumulations - res00 = __SMLAD(val3, val2, res00); - val5 = __SXTAB16(rhs_offset_s16x2, val4); - res00 = __SMLAD(val1, val0, res00); - val4 = __SXTAB16(rhs_offset_s16x2, __ROR(val4, 8)); - // Read 4 x int8 values from the RHS matrix - val0 = arm_nn_read_q7x4_ia((const q7_t **)&rhs_ptr); - res01 = __SMLAD(val3, val5, res01); - res01 = __SMLAD(val1, val4, res01); - - val2 = __SXTAB16(rhs_offset_s16x2, val0); - // Read 4 x int8 values from the LHS vector - val1 = arm_nn_read_q7x4_ia((const q7_t **)&lhs_ptr); - val0 = __SXTAB16(rhs_offset_s16x2, __ROR(val0, 8)); - val3 = __SXTAB16(lhs_offset_s16x2, val1); - // Read 4 x int8 values from the RHS matrix - val4 = arm_nn_read_q7x4((const q7_t *)rhs_ptr + off0); - val1 = __SXTAB16(lhs_offset_s16x2, __ROR(val1, 8)); - - // Perform the accumulations - res00 = __SMLAD(val3, val2, res00); - val5 = __SXTAB16(rhs_offset_s16x2, val4); - res00 = __SMLAD(val1, val0, res00); - val4 = __SXTAB16(rhs_offset_s16x2, __ROR(val4, 8)); - // Read 4 x int8 values from the RHS matrix - val0 = arm_nn_read_q7x4_ia((const q7_t **)&rhs_ptr); - res01 = __SMLAD(val3, val5, res01); - res01 = __SMLAD(val1, val4, res01); - - val2 = __SXTAB16(rhs_offset_s16x2, val0); - // Read 4 x int8 values from the LHS vector - val1 = arm_nn_read_q7x4_ia((const q7_t **)&lhs_ptr); - val0 = __SXTAB16(rhs_offset_s16x2, __ROR(val0, 8)); - val3 = __SXTAB16(lhs_offset_s16x2, val1); - // Read 4 x int8 values from the RHS matrix - val4 = arm_nn_read_q7x4((const q7_t *)rhs_ptr + off0); - val1 = __SXTAB16(lhs_offset_s16x2, __ROR(val1, 8)); - - // Perform the accumulations - res00 = __SMLAD(val3, val2, res00); - val5 = __SXTAB16(rhs_offset_s16x2, val4); - res00 = __SMLAD(val1, val0, res00); - val4 = __SXTAB16(rhs_offset_s16x2, __ROR(val4, 8)); - // Read 4 x int8 values from the RHS matrix - val0 = arm_nn_read_q7x4_ia((const q7_t **)&rhs_ptr); - res01 = __SMLAD(val3, val5, res01); - res01 = __SMLAD(val1, val4, res01); - - val2 = __SXTAB16(rhs_offset_s16x2, val0); - // Read 4 x int8 values from the LHS vector - val1 = arm_nn_read_q7x4_ia((const q7_t **)&lhs_ptr); - val0 = __SXTAB16(rhs_offset_s16x2, __ROR(val0, 8)); - val3 = __SXTAB16(lhs_offset_s16x2, val1); - // Read 4 x int8 values from the RHS matrix - val4 = arm_nn_read_q7x4((const q7_t *)rhs_ptr + off0); - val1 = __SXTAB16(lhs_offset_s16x2, __ROR(val1, 8)); - - // Perform the accumulations - res00 = __SMLAD(val3, val2, res00); - val5 = __SXTAB16(rhs_offset_s16x2, val4); - res00 = __SMLAD(val1, val0, res00); - val4 = __SXTAB16(rhs_offset_s16x2, __ROR(val4, 8)); - res01 = __SMLAD(val3, val5, res01); - res01 = __SMLAD(val1, val4, res01); - } + const int8_t *lhs_vec = lhs; + const int8_t *rhs_0 = rhs; + const int8_t *rhs_1 = rhs + rhs_cols; + rhs += 2 * rhs_cols; - for (; rhs_cols_idx < rhs_cols; ++rhs_cols_idx) + for (int j = col_loop_cnt; j != 0; j--) { - q31_t rhs_value0 = rhs_ptr[0] + rhs_offset; - q31_t rhs_value1 = rhs_ptr[rhs_cols] + rhs_offset; - q31_t lhs_value = lhs_ptr[0] + lhs_offset; + int32_t vec_0 = arm_nn_read_q7x4_ia(&lhs_vec); + int32_t vec_1 = __SXTAB16_RORn(lhs_offset_s16x2, (uint32_t)vec_0, 8); - res00 += lhs_value * rhs_value0; - res01 += lhs_value * rhs_value1; + vec_0 = __SXTAB16(lhs_offset_s16x2, vec_0); - ++rhs_ptr; - ++lhs_ptr; - } + int32_t ker_0 = arm_nn_read_q7x4_ia(&rhs_0); + int32_t ker_1 = __SXTB16_RORn((uint32_t)ker_0, 8); + ker_0 = __SXTB16(ker_0); - // Quantize down - res00 = arm_nn_requantize(res00, dst_multiplier, dst_shift); - res01 = arm_nn_requantize(res01, dst_multiplier, dst_shift); + acc_0 = __SMLAD(ker_1, vec_1, acc_0); + acc_0 = __SMLAD(ker_0, vec_0, acc_0); - // Add offset - res00 += dst_offset; - res01 += dst_offset; + ker_0 = arm_nn_read_q7x4_ia(&rhs_1); + ker_1 = __SXTB16_RORn((uint32_t)ker_0, 8); + ker_0 = __SXTB16(ker_0); - // Clamp the result - res00 = MAX(res00, activation_min); - res00 = MIN(res00, activation_max); - res01 = MAX(res01, activation_min); - res01 = MIN(res01, activation_max); + acc_1 = __SMLAD(ker_1, vec_1, acc_1); + acc_1 = __SMLAD(ker_0, vec_0, acc_1); + } - *dst++ = (q7_t)res00; - *dst++ = (q7_t)res01; + for (int k = col_loop_cnt * 4; k < rhs_cols; k++) + { + const int32_t lhs_temp = (*lhs_vec + lhs_offset); + lhs_vec++; + acc_0 += lhs_temp * (*rhs_0); + rhs_0++; + acc_1 += lhs_temp * (*rhs_1); + rhs_1++; + } - rhs += 2 * rhs_cols; + acc_0 = arm_nn_requantize(acc_0, dst_multiplier, dst_shift); + acc_1 = arm_nn_requantize(acc_1, dst_multiplier, dst_shift); + + // Add offset + acc_0 += dst_offset; + acc_1 += dst_offset; + // Clamp the result + acc_0 = MAX(acc_0, activation_min); + acc_0 = MIN(acc_0, activation_max); + acc_1 = MAX(acc_1, activation_min); + acc_1 = MIN(acc_1, activation_max); + *dst = (int8_t)acc_0; + *(dst + address_offset) = (int8_t)acc_1; + dst += 2 * address_offset; } - if (rhs_rows % 2) + if (rhs_rows & 0x1) { - const q7_t *lhs_ptr = &lhs[0]; - const q7_t *rhs_ptr = &rhs[0]; - - q31_t res00 = 0; + int32_t acc_0 = 0; if (bias) { - res00 = *bias++; + acc_0 = *bias++; } + const int32_t col_loop_cnt = rhs_cols / 4; - int32_t rhs_cols_idx = 0; + const int8_t *lhs_vec = lhs; + const int8_t *rhs_0 = rhs; - q31_t val0, val1, val2, val3; - for (; rhs_cols_idx <= (rhs_cols - 16); rhs_cols_idx += 16) + for (int i = col_loop_cnt; i != 0; i--) { - val0 = arm_nn_read_q7x4_ia((const q7_t **)&rhs_ptr); - val1 = __SXTAB16(rhs_offset_s16x2, val0); - val2 = arm_nn_read_q7x4_ia((const q7_t **)&lhs_ptr); - val0 = __SXTAB16(rhs_offset_s16x2, __ROR(val0, 8)); - val3 = __SXTAB16(lhs_offset_s16x2, val2); - val2 = __SXTAB16(lhs_offset_s16x2, __ROR(val2, 8)); - - // Partial accumulations - res00 = __SMLAD(val3, val1, res00); - res00 = __SMLAD(val2, val0, res00); - - val0 = arm_nn_read_q7x4_ia((const q7_t **)&rhs_ptr); - val1 = __SXTAB16(rhs_offset_s16x2, val0); - val2 = arm_nn_read_q7x4_ia((const q7_t **)&lhs_ptr); - val0 = __SXTAB16(rhs_offset_s16x2, __ROR(val0, 8)); - val3 = __SXTAB16(lhs_offset_s16x2, val2); - val2 = __SXTAB16(lhs_offset_s16x2, __ROR(val2, 8)); - - // Partial accumulations - res00 = __SMLAD(val3, val1, res00); - res00 = __SMLAD(val2, val0, res00); - - val0 = arm_nn_read_q7x4_ia((const q7_t **)&rhs_ptr); - val1 = __SXTAB16(rhs_offset_s16x2, val0); - val2 = arm_nn_read_q7x4_ia((const q7_t **)&lhs_ptr); - val0 = __SXTAB16(rhs_offset_s16x2, __ROR(val0, 8)); - val3 = __SXTAB16(lhs_offset_s16x2, val2); - val2 = __SXTAB16(lhs_offset_s16x2, __ROR(val2, 8)); - - // Partial accumulations - res00 = __SMLAD(val3, val1, res00); - res00 = __SMLAD(val2, val0, res00); - - val0 = arm_nn_read_q7x4_ia((const q7_t **)&rhs_ptr); - val1 = __SXTAB16(rhs_offset_s16x2, val0); - val2 = arm_nn_read_q7x4_ia((const q7_t **)&lhs_ptr); - val0 = __SXTAB16(rhs_offset_s16x2, __ROR(val0, 8)); - val3 = __SXTAB16(lhs_offset_s16x2, val2); - val2 = __SXTAB16(lhs_offset_s16x2, __ROR(val2, 8)); - - // Partial accumulations - res00 = __SMLAD(val3, val1, res00); - res00 = __SMLAD(val2, val0, res00); - } + int32_t vec_0 = arm_nn_read_q7x4_ia(&lhs_vec); + int32_t vec_1 = __SXTAB16_RORn(lhs_offset_s16x2, (uint32_t)vec_0, 8); + vec_0 = __SXTAB16(lhs_offset_s16x2, vec_0); - for (; rhs_cols_idx < rhs_cols; ++rhs_cols_idx) - { - q31_t rhs_value0 = rhs_ptr[0] + rhs_offset; - q31_t lhs_value = lhs_ptr[0] + lhs_offset; + int32_t ker_0 = arm_nn_read_q7x4_ia(&rhs_0); + int32_t ker_1 = __SXTB16_RORn((uint32_t)ker_0, 8); + ker_0 = __SXTB16(ker_0); - res00 += lhs_value * rhs_value0; + acc_0 = __SMLAD(ker_1, vec_1, acc_0); + acc_0 = __SMLAD(ker_0, vec_0, acc_0); + } - ++rhs_ptr; - ++lhs_ptr; + for (int j = col_loop_cnt * 4; j < rhs_cols; j++) + { + const int32_t lhs_temp = (*lhs_vec + lhs_offset); + lhs_vec++; + acc_0 += lhs_temp * (*rhs_0); + rhs_0++; } - // Quantize down - res00 = arm_nn_requantize(res00, dst_multiplier, dst_shift); + acc_0 = arm_nn_requantize(acc_0, dst_multiplier, dst_shift); // Add offset - res00 += dst_offset; - + acc_0 += dst_offset; // Clamp the result - res00 = MAX(res00, activation_min); - res00 = MIN(res00, activation_max); - - *dst = (q7_t)res00; + acc_0 = MAX(acc_0, activation_min); + acc_0 = MIN(acc_0, activation_max); + *dst = (int8_t)acc_0; + dst += address_offset; } #else - for (int32_t rhs_rows_idx = 0; rhs_rows_idx <= (rhs_rows - 2); rhs_rows_idx += 2) + const int32_t row_loop_cnt = rhs_rows / 3; + + for (int i_row_loop_cnt = 0; i_row_loop_cnt < row_loop_cnt; i_row_loop_cnt++) { - const q7_t *lhs_ptr = &lhs[0]; - const q7_t *rhs_ptr = &rhs[0]; + const q7_t *lhs_ptr = lhs; + const q7_t *rhs_ptr_0 = &rhs[0]; + const q7_t *rhs_ptr_1 = &rhs[rhs_cols]; + const q7_t *rhs_ptr_2 = &rhs[rhs_cols * 2]; q31_t res00 = 0; q31_t res01 = 0; + q31_t res02 = 0; if (bias) { res00 = *bias++; res01 = *bias++; + res02 = *bias++; } - for (int32_t rhs_cols_idx = 0; rhs_cols_idx < rhs_cols; ++rhs_cols_idx) { - q31_t rhs_value0 = rhs_ptr[0] + rhs_offset; - q31_t rhs_value1 = rhs_ptr[rhs_cols] + rhs_offset; - q31_t lhs_value = lhs_ptr[0] + lhs_offset; + const q31_t rhs_value0 = (int8_t)*rhs_ptr_0; + const q31_t rhs_value1 = (int8_t)*rhs_ptr_1; + const q31_t rhs_value2 = (int8_t)*rhs_ptr_2; + const q31_t lhs_value = (int8_t)*lhs_ptr + lhs_offset; res00 += lhs_value * rhs_value0; res01 += lhs_value * rhs_value1; + res02 += lhs_value * rhs_value2; - ++rhs_ptr; + ++rhs_ptr_0; + ++rhs_ptr_1; + ++rhs_ptr_2; ++lhs_ptr; } - // Quantize down res00 = arm_nn_requantize(res00, dst_multiplier, dst_shift); res01 = arm_nn_requantize(res01, dst_multiplier, dst_shift); + res02 = arm_nn_requantize(res02, dst_multiplier, dst_shift); // Add offset res00 += dst_offset; res01 += dst_offset; + res02 += dst_offset; // Clamp the result res00 = MAX(res00, activation_min); res00 = MIN(res00, activation_max); res01 = MAX(res01, activation_min); res01 = MIN(res01, activation_max); + res02 = MAX(res02, activation_min); + res02 = MIN(res02, activation_max); - *dst++ = (q7_t)res00; - *dst++ = (q7_t)res01; + *dst = (q7_t)res00; + *(dst + address_offset) = (q7_t)res01; + *(dst + 2 * address_offset) = (q7_t)res02; + dst += 3 * address_offset; - rhs += 2 * rhs_cols; + rhs += 3 * rhs_cols; } - if (rhs_rows % 2) + const int loop_cnt = rhs_rows % 3; + + for (int i_loop_cnt = 0; i_loop_cnt < loop_cnt; i_loop_cnt++) { const q7_t *lhs_ptr = &lhs[0]; const q7_t *rhs_ptr = &rhs[0]; @@ -471,8 +372,8 @@ arm_status arm_nn_vec_mat_mult_t_s8(const q7_t *lhs, for (int32_t rhs_cols_idx = 0; rhs_cols_idx < rhs_cols; ++rhs_cols_idx) { - q31_t rhs_value0 = rhs_ptr[0] + rhs_offset; - q31_t lhs_value = lhs_ptr[0] + lhs_offset; + q31_t rhs_value0 = (int8_t)rhs_ptr[0]; + q31_t lhs_value = (int8_t)lhs_ptr[0] + lhs_offset; res00 += lhs_value * rhs_value0; @@ -490,11 +391,12 @@ arm_status arm_nn_vec_mat_mult_t_s8(const q7_t *lhs, res00 = MAX(res00, activation_min); res00 = MIN(res00, activation_max); - *dst = (q7_t)res00; + *dst = (int8_t)res00; + dst += address_offset; + rhs += rhs_cols; } #endif - - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_svdf_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_svdf_s8.c new file mode 100644 index 0000000..293edb2 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_nn_vec_mat_mult_t_svdf_s8.c @@ -0,0 +1,345 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * Copyright (C) 2021-2022 Arm Limited or its affiliates. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_nn_vec_mat_mult_t_svdf_s8 + * Description: s8 vector by matrix (transposed) multiplication with + * s16 output. Targetted at SVDF operator. + * + * $Date: 19 April 2022 + * $Revision: V.2.0.0 + * + * Target Processor: Cortex-M + * + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" + +/** + * @ingroup groupSupport + */ + +/** + * @addtogroup NNBasicMath + * @{ + */ + +/* + * s8 vector(lhs) by matrix (transposed) multiplication + * + * Refer header file for details. + * + */ +arm_cmsis_nn_status arm_nn_vec_mat_mult_t_svdf_s8(const q7_t *lhs, + const q7_t *rhs, + q15_t *dst, + const int32_t lhs_offset, + const int32_t rhs_offset, + const int32_t dst_offset, + const int32_t dst_multiplier, + const int32_t dst_shift, + const int32_t rhs_cols, + const int32_t rhs_rows, + const int32_t activation_min, + const int32_t activation_max) +{ + (void)rhs_offset; + if (rhs_cols < 0 || (NN_Q31_MAX - rhs_cols) < 16 || dst_offset < 0) + { + return ARM_CMSIS_NN_ARG_ERROR; + } + + (void)rhs_offset; +#if defined(ARM_MATH_MVEI) + int32_t row_loop_cnt = rhs_rows / 3; + + for (int i_row_loop_cnt = 0; i_row_loop_cnt < row_loop_cnt; i_row_loop_cnt++) + { + int32_t acc_0 = 0; + int32_t acc_1 = 0; + int32_t acc_2 = 0; + + const int32_t col_loop_cnt = (rhs_cols + 15) / 16; + + const int8_t *lhs_vec = lhs; + const int8_t *rhs_0 = rhs; + const int8_t *rhs_1 = rhs + rhs_cols; + const int8_t *rhs_2 = rhs + 2 * rhs_cols; + + int32_t rhs_sum_0 = 0; + int32_t rhs_sum_1 = 0; + int32_t rhs_sum_2 = 0; + + uint32_t col_cnt = (uint32_t)rhs_cols; + + for (int i = 0; i < col_loop_cnt; i++) + { + mve_pred16_t p = vctp8q(col_cnt); + col_cnt -= 16; + + const int8x16_t input = vldrbq_z_s8(lhs_vec, p); + + const int8x16_t ker_0 = vldrbq_z_s8(rhs_0, p); + rhs_sum_0 = vaddvaq_p_s8(rhs_sum_0, ker_0, p); + acc_0 = vmladavaq_p_s8(acc_0, ker_0, input, p); + + const int8x16_t ker_1 = vldrbq_z_s8(rhs_1, p); + rhs_sum_1 = vaddvaq_p_s8(rhs_sum_1, ker_1, p); + acc_1 = vmladavaq_p_s8(acc_1, ker_1, input, p); + + const int8x16_t ker_2 = vldrbq_z_s8(rhs_2, p); + rhs_sum_2 = vaddvaq_p_s8(rhs_sum_2, ker_2, p); + acc_2 = vmladavaq_p_s8(acc_2, ker_2, input, p); + + lhs_vec += 16; + rhs_0 += 16; + rhs_1 += 16; + rhs_2 += 16; + } + rhs += 3 * rhs_cols; + + int32x4_t acc = {acc_0, acc_1, acc_2, 0}; + const int32x4_t rhs_sum = {rhs_sum_0, rhs_sum_1, rhs_sum_2, 0}; + acc += vdupq_n_s32(lhs_offset) * rhs_sum; + + acc = arm_requantize_mve(acc, dst_multiplier, dst_shift); + acc = vmaxq_s32(acc, vdupq_n_s32(activation_min)); + acc = vminq_s32(acc, vdupq_n_s32(activation_max)); + *(dst) = (int16_t)acc[0]; + *(dst + dst_offset) = (int16_t)acc[1]; + *(dst + 2 * dst_offset) = (int16_t)acc[2]; + dst += 3 * dst_offset; + } + + const int loop_cnt = rhs_rows % 3; + for (int i_row_loop_cnt = 0; i_row_loop_cnt < loop_cnt; i_row_loop_cnt++) + { + int32_t acc_0 = 0; + const int32_t col_loop_cnt = (rhs_cols + 15) / 16; + const int8_t *lhs_vec = lhs; + const int8_t *rhs_0 = rhs; + int32_t rhs_sum_0 = 0; + uint32_t col_cnt = (uint32_t)rhs_cols; + + for (int i = 0; i < col_loop_cnt; i++) + { + mve_pred16_t p = vctp8q(col_cnt); + col_cnt -= 16; + const int8x16_t input = vldrbq_z_s8(lhs_vec, p); + + const int8x16_t ker_0 = vldrbq_z_s8(rhs_0, p); + rhs_sum_0 = vaddvaq_p_s8(rhs_sum_0, ker_0, p); + acc_0 = vmladavaq_p_s8(acc_0, ker_0, input, p); + + lhs_vec += 16; + rhs_0 += 16; + } + rhs += rhs_cols; + + const int32_t offsets = rhs_sum_0 * lhs_offset; + acc_0 = __QADD(acc_0, offsets); + acc_0 = arm_nn_requantize(acc_0, dst_multiplier, dst_shift); + + // Clamp the result + acc_0 = MAX(acc_0, activation_min); + *dst = (q15_t)MIN(acc_0, activation_max); + dst += dst_offset; + } + +#elif defined(ARM_MATH_DSP) + int32_t row_loop_cnt = rhs_rows / 2; + + const int16_t lhs_offset_s16 = lhs_offset; + const int16_t rhs_offset_s16 = rhs_offset; + + const uint32_t lhs_offset_s16x2 = __PKHBT(lhs_offset_s16, lhs_offset_s16, 16); + const uint32_t rhs_offset_s16x2 = __PKHBT(rhs_offset_s16, rhs_offset_s16, 16); + for (int32_t i = 0; i < row_loop_cnt; i++) + { + int32_t acc_0 = 0; + int32_t acc_1 = 0; + + const int32_t col_loop_cnt = rhs_cols / 4; + const int8_t *lhs_vec = lhs; + const int8_t *rhs_0 = rhs; + const int8_t *rhs_1 = rhs + rhs_cols; + rhs += 2 * rhs_cols; + for (int j = col_loop_cnt; j != 0; j--) + { + int32_t vec_0 = arm_nn_read_q7x4_ia(&lhs_vec); + int32_t vec_1 = __SXTAB16_RORn(lhs_offset_s16x2, (uint32_t)vec_0, 8); + vec_0 = __SXTAB16(lhs_offset_s16x2, vec_0); + int32_t ker_0 = arm_nn_read_q7x4_ia(&rhs_0); + int32_t ker_1 = __SXTAB16_RORn(rhs_offset_s16x2, (uint32_t)ker_0, 8); + ker_0 = __SXTAB16(rhs_offset_s16x2, ker_0); + acc_0 = __SMLAD(ker_1, vec_1, acc_0); + acc_0 = __SMLAD(ker_0, vec_0, acc_0); + ker_0 = arm_nn_read_q7x4_ia(&rhs_1); + ker_1 = __SXTAB16_RORn(rhs_offset_s16x2, (uint32_t)ker_0, 8); + ker_0 = __SXTAB16(rhs_offset_s16x2, ker_0); + acc_1 = __SMLAD(ker_1, vec_1, acc_1); + acc_1 = __SMLAD(ker_0, vec_0, acc_1); + } + for (int k = col_loop_cnt * 4; k < rhs_cols; k++) + { + const int32_t lhs_temp = (*lhs_vec + lhs_offset); + lhs_vec++; + acc_0 += lhs_temp * (*rhs_0 + rhs_offset); + rhs_0++; + acc_1 += lhs_temp * (*rhs_1 + rhs_offset); + rhs_1++; + } + acc_0 = arm_nn_requantize(acc_0, dst_multiplier, dst_shift); + acc_1 = arm_nn_requantize(acc_1, dst_multiplier, dst_shift); + + // Clamp the result + acc_0 = MAX(acc_0, activation_min); + acc_0 = MIN(acc_0, activation_max); + acc_1 = MAX(acc_1, activation_min); + acc_1 = MIN(acc_1, activation_max); + *dst = (q15_t)acc_0; + *(dst + dst_offset) = (q15_t)acc_1; + dst += 2 * dst_offset; + } + if (rhs_rows & 0x1) + { + int32_t acc_0 = 0; + const int32_t col_loop_cnt = rhs_cols / 4; + const int8_t *lhs_vec = lhs; + const int8_t *rhs_0 = rhs; + for (int i = col_loop_cnt; i != 0; i--) + { + int32_t vec_0 = arm_nn_read_q7x4_ia(&lhs_vec); + int32_t vec_1 = __SXTAB16(lhs_offset_s16x2, __ROR((uint32_t)vec_0, 8)); + vec_0 = __SXTAB16(lhs_offset_s16x2, vec_0); + int32_t ker_0 = arm_nn_read_q7x4_ia(&rhs_0); + int32_t ker_1 = __SXTAB16(rhs_offset_s16x2, __ROR((uint32_t)ker_0, 8)); + ker_0 = __SXTAB16(rhs_offset_s16x2, ker_0); + acc_0 = __SMLAD(ker_1, vec_1, acc_0); + acc_0 = __SMLAD(ker_0, vec_0, acc_0); + } + for (int j = col_loop_cnt * 4; j < rhs_cols; j++) + { + const int32_t lhs_temp = (*lhs_vec + lhs_offset); + lhs_vec++; + acc_0 += lhs_temp * (*rhs_0 + rhs_offset); + rhs_0++; + } + acc_0 = arm_nn_requantize(acc_0, dst_multiplier, dst_shift); + + // Clamp the result + acc_0 = MAX(acc_0, activation_min); + acc_0 = MIN(acc_0, activation_max); + *dst = (q15_t)acc_0; + dst += dst_offset; + } + +#else + + int32_t row_loop_cnt = rhs_rows / 3; + + for (int i_row_loop_cnt = 0; i_row_loop_cnt < row_loop_cnt; i_row_loop_cnt++) + { + const q7_t *lhs_ptr = lhs; + const q7_t *rhs_ptr_0 = &rhs[0]; + const q7_t *rhs_ptr_1 = &rhs[rhs_cols]; + const q7_t *rhs_ptr_2 = &rhs[rhs_cols * 2]; + + q31_t res00 = 0; + q31_t res01 = 0; + q31_t res02 = 0; + for (int32_t rhs_cols_idx = 0; rhs_cols_idx < rhs_cols; ++rhs_cols_idx) + { + const q31_t rhs_value0 = (int8_t)*rhs_ptr_0; + const q31_t rhs_value1 = (int8_t)*rhs_ptr_1; + const q31_t rhs_value2 = (int8_t)*rhs_ptr_2; + const q31_t lhs_value = (int8_t)*lhs_ptr + lhs_offset; + + res00 += lhs_value * rhs_value0; + res01 += lhs_value * rhs_value1; + res02 += lhs_value * rhs_value2; + + ++rhs_ptr_0; + ++rhs_ptr_1; + ++rhs_ptr_2; + ++lhs_ptr; + } + // Quantize down + res00 = arm_nn_requantize(res00, dst_multiplier, dst_shift); + res01 = arm_nn_requantize(res01, dst_multiplier, dst_shift); + res02 = arm_nn_requantize(res02, dst_multiplier, dst_shift); + + // Clamp the result + res00 = MAX(res00, activation_min); + res00 = MIN(res00, activation_max); + res01 = MAX(res01, activation_min); + res01 = MIN(res01, activation_max); + res02 = MAX(res02, activation_min); + res02 = MIN(res02, activation_max); + + *dst = (q15_t)res00; + *(dst + dst_offset) = (q15_t)res01; + *(dst + 2 * dst_offset) = (q15_t)res02; + dst += 3 * dst_offset; + rhs += 3 * rhs_cols; + } + + const int loop_cnt = rhs_rows % 3; + + for (int i_loop_cnt = 0; i_loop_cnt < loop_cnt; i_loop_cnt++) + { + const q7_t *lhs_ptr = &lhs[0]; + const q7_t *rhs_ptr = &rhs[0]; + + q31_t res00 = 0; + + for (int32_t rhs_cols_idx = 0; rhs_cols_idx < rhs_cols; ++rhs_cols_idx) + { + q31_t rhs_value0 = (int8_t)rhs_ptr[0] + rhs_offset; + q31_t lhs_value = (int8_t)lhs_ptr[0] + lhs_offset; + + res00 += lhs_value * rhs_value0; + + ++rhs_ptr; + ++lhs_ptr; + } + + // Quantize down + res00 = arm_nn_requantize(res00, dst_multiplier, dst_shift); + + // Clamp the result + res00 = MAX(res00, activation_min); + res00 = MIN(res00, activation_max); + + *dst = (q15_t)res00; + dst += dst_offset; + rhs += rhs_cols; + } +#endif + + return ARM_CMSIS_NN_SUCCESS; +} + +/** + * @} end of NNBasicMath group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_q7_to_q15_no_shift.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_q7_to_q15_no_shift.c index 5478451..110a93b 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_q7_to_q15_no_shift.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_q7_to_q15_no_shift.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_q7_to_q15_no_shift.c * Description: Converts the elements of the Q7 vector to Q15 vector without left-shift * - * $Date: May 29, 2020 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.1.0.3 * * Target Processor: Cortex-M cores * @@ -41,20 +41,9 @@ * @{ */ -/** +/* * @brief Converts the elements of the Q7 vector to Q15 vector without left-shift - * @param[in] *pSrc points to the Q7 input vector - * @param[out] *pDst points to the Q15 output vector - * @param[in] blockSize length of the input vector - * - * \par Description: - * - * The equation used for the conversion process is: - * - *
- * 	pDst[n] = (q15_t) pSrc[n];   0 <= n < blockSize.
- * 
- * + * Refer function header for details */ void arm_q7_to_q15_no_shift(const q7_t *pSrc, q15_t *pDst, uint32_t blockSize) diff --git a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_q7_to_q15_reordered_no_shift.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_q7_to_q15_reordered_no_shift.c index 5f58691..c7ee063 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_q7_to_q15_reordered_no_shift.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_q7_to_q15_reordered_no_shift.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_q7_to_q15_reordered_no_shift.c * Description: Converts the elements of the Q7 vector to reordered Q15 vector without left-shift * - * $Date: May 29, 2020 - * $Revision: V.1.0.1 + * $Date: 4 Aug 2022 + * $Revision: V.1.1.2 * * Target Processor: Cortex-M cores * @@ -41,13 +41,10 @@ * @{ */ -/** - * @brief Converts the elements of the Q7 vector to reordered Q15 vector without left-shift - * @param[in] *pSrc points to the Q7 input vector - * @param[out] *pDst points to the Q15 output vector - * @param[in] blockSize length of the input vector +/* + * Converts the elements of the Q7 vector to reordered Q15 vector without left-shift * - * @details + * Refer to header for details * * This function does the q7 to q15 expansion with re-ordering * @@ -81,7 +78,7 @@ void arm_q7_to_q15_reordered_no_shift(const q7_t *pSrc, q15_t *pDst, uint32_t bl const q7_t *pIn = pSrc; /* Src pointer */ uint32_t blkCnt; /* loop counter */ -#ifndef ARM_MATH_CM0_FAMILY +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) q31_t in; q31_t in1, in2; @@ -105,11 +102,11 @@ void arm_q7_to_q15_reordered_no_shift(const q7_t *pSrc, q15_t *pDst, uint32_t bl in2 = __SXTB16(in); #ifndef ARM_MATH_BIG_ENDIAN - *__SIMD32(pDst)++ = in2; - *__SIMD32(pDst)++ = in1; + arm_nn_write_q7x4_ia((q7_t **)&pDst, in2); + arm_nn_write_q7x4_ia((q7_t **)&pDst, in1); #else - *__SIMD32(pDst)++ = in1; - *__SIMD32(pDst)++ = in2; + arm_nn_write_q7x4_ia((q7_t **)&pDst, in1); + arm_nn_write_q7x4_ia((q7_t **)&pDst, in2); #endif /* Decrement the loop counter */ diff --git a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_q7_to_q15_reordered_with_offset.c b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_q7_to_q15_reordered_with_offset.c index d547c42..572c7bc 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_q7_to_q15_reordered_with_offset.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/NNSupportFunctions/arm_q7_to_q15_reordered_with_offset.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -24,8 +24,8 @@ * Description: Converts the elements of the Q7 vector to a reordered Q15 vector with an added offset. The re-ordering * is a signature of sign extension intrinsic(DSP extension). * - * $Date: May 29, 2020 - * $Revision: V.2.0.3 + * $Date: 4 Aug 2022 + * $Revision: V.2.0.4 * * Target Processor: Cortex-M cores * @@ -42,10 +42,10 @@ * @{ */ -/** - * @brief Converts the elements of the Q7 vector to a reordered Q15 vector with an added offset. +/* + * Converts the elements of the Q7 vector to a reordered Q15 vector with an added offset. * - * @note Refer header file for details. + * Refer header file for details. * */ diff --git a/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_avgpool_s16.c b/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_avgpool_s16.c new file mode 100644 index 0000000..be5b7f0 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_avgpool_s16.c @@ -0,0 +1,311 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * SPDX-FileCopyrightText: Copyright 2022 Arm Limited and/or its affiliates + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_avgpool_s16.c + * Description: Pooling function implementations + * + * $Date: 27 July 2022 + * $Revision: V.2.2.0 + * + * Target Processor: Cortex-M CPUs + * + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" + +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) + +static void scale_q31_to_q15_and_clamp(const q31_t *buffer, + q15_t *target, + int32_t length, + const int32_t count, + const int act_min, + const int act_max) +{ + const int half_count = count / 2; + + for (int i = 0; i < length; i++) + { + int32_t sum = buffer[i] > 0 ? (buffer[i] + half_count) : (buffer[i] - half_count); + sum = sum / count; + sum = MAX(sum, act_min); + sum = MIN(sum, act_max); + + target[i] = (q15_t)sum; + } +} +#endif + +/** + * @ingroup groupNN + + */ + +/** + * @addtogroup Pooling + * @{ + */ + +/* + * s16 average pooling function + * + * Refer to header file for details. + * + */ +arm_cmsis_nn_status arm_avgpool_s16(const cmsis_nn_context *ctx, + const cmsis_nn_pool_params *pool_params, + const cmsis_nn_dims *input_dims, + const q15_t *src, + const cmsis_nn_dims *filter_dims, + const cmsis_nn_dims *output_dims, + q15_t *dst) +{ + const int32_t input_y = input_dims->h; + const int32_t input_x = input_dims->w; + const int32_t output_y = output_dims->h; + const int32_t output_x = output_dims->w; + const int32_t stride_y = pool_params->stride.h; + const int32_t stride_x = pool_params->stride.w; + const int32_t kernel_y = filter_dims->h; + const int32_t kernel_x = filter_dims->w; + const int32_t pad_y = pool_params->padding.h; + const int32_t pad_x = pool_params->padding.w; + const int32_t act_min = pool_params->activation.min; + const int32_t act_max = pool_params->activation.max; + const int32_t ch_src = input_dims->c; +#if defined(ARM_MATH_MVEI) + (void)ctx; + for (int i_y = 0; i_y < output_y; i_y++) + { + for (int i_x = 0; i_x < output_x; i_x++) + { + const int32_t k_y_start = MAX(0, i_y * stride_y - pad_y); + const int32_t k_y_end = MIN(i_y * stride_y - pad_y + kernel_y, input_y); + + const int32_t k_x_start = MAX(0, i_x * stride_x - pad_x); + const int32_t k_x_end = MIN(i_x * stride_x - pad_x + kernel_x, input_x); + + const int16_t *src_base = src; + int16_t *out = &dst[ch_src * (i_x + i_y * output_x)]; + + int32_t ch_count = (ch_src + 7) / 8; + int32_t channels = ch_src; + + while (ch_count > 0) + { + int32_t count = 0; + + int32x4_t sum_1 = vdupq_n_s32(0); + int32x4_t sum_2 = vdupq_n_s32(0); + // Load store tail predicate + const mve_pred16_t ld_st_p = vctp16q(channels); + channels -= 8; + + for (int k_y = k_y_start; k_y < k_y_end; k_y++) + { + for (int k_x = k_x_start; k_x < k_x_end; k_x++) + { + const int16_t *src_inner = src_base + (ch_src * (k_x + k_y * input_x)); + const int16x8_t temp = vldrhq_z_s16(src_inner, ld_st_p); + + const int32x4_t temp_lo = vmovlbq_s16(temp); + const int32x4_t temp_hi = vmovltq_s16(temp); + + sum_1 = vaddq_s32(sum_1, temp_lo); + sum_2 = vaddq_s32(sum_2, temp_hi); + + count++; + } + } + + // Prevent static code issue DIVIDE_BY_ZERO. + if (count == 0) + { + return ARM_CMSIS_NN_ARG_ERROR; + } + + // Perform the following operation + // sum = sum > 0 ? (sum + count / 2) / count : (sum - count / 2) / count; + const int32_t half_count = count / 2; + // Predicate for 'sum > 0' operation + mve_pred16_t p = vcmpgtq_n_s32(sum_1, 0); + sum_1 = vaddq_m_n_s32(sum_1, sum_1, half_count, p); + sum_1 = vsubq_m_n_s32(sum_1, sum_1, half_count, ~p); + + p = vcmpgtq_n_s32(sum_2, 0); + sum_2 = vaddq_m_n_s32(sum_2, sum_2, half_count, p); + sum_2 = vsubq_m_n_s32(sum_2, sum_2, half_count, ~p); + + for (int i = 0; i < 4; i++) + { + sum_1[i] = sum_1[i] / count; + sum_2[i] = sum_2[i] / count; + } + + sum_1 = vmaxq_s32(sum_1, vdupq_n_s32(act_min)); + sum_1 = vminq_s32(sum_1, vdupq_n_s32(act_max)); + + sum_2 = vmaxq_s32(sum_2, vdupq_n_s32(act_min)); + sum_2 = vminq_s32(sum_2, vdupq_n_s32(act_max)); + + int16x8_t temp = vdupq_n_s16(0); + temp = vmovnbq_s32(temp, sum_1); + temp = vmovntq_s32(temp, sum_2); + + vstrhq_p_s16(out, temp, ld_st_p); + + out += 8; + ch_count--; + src_base += 8; + } + } + } +#elif defined(ARM_MATH_DSP) + + q31_t *buffer = (q31_t *)ctx->buf; + + if (buffer == NULL) + { + return ARM_CMSIS_NN_ARG_ERROR; + } + + /* Run the following code for CPU's with DSP extension + */ + for (int i_y = 0, idx_y = -pad_y; i_y < output_y; idx_y += stride_y, i_y++) + { + for (int i_x = 0, idx_x = -pad_x; i_x < output_x; idx_x += stride_x, i_x++) + { + /* Condition for kernel start dimension: + (base_idx_ + kernel__start) >= 0 */ + const int32_t kernel_y_start = MAX(0, -idx_y); + const int32_t kernel_x_start = MAX(0, -idx_x); + + /* Condition for kernel end dimension: + (base_idx_ + kernel__end) < dim_src_ */ + const int32_t kernel_y_end = MIN(kernel_y, input_y - idx_y); + const int32_t kernel_x_end = MIN(kernel_x, input_x - idx_x); + + int count = 0; + + for (int k_y = kernel_y_start; k_y < kernel_y_end; k_y++) + { + for (int k_x = kernel_x_start; k_x < kernel_x_end; k_x++) + { + const q15_t *start = src + ch_src * (k_x + idx_x + (k_y + idx_y) * input_x); + + if (count == 0) + { + for (int i = 0; i < ch_src; i++) + { + buffer[i] = start[i]; + } + } + else + { + for (int i = 0; i < ch_src; i++) + { + buffer[i] = __QADD(start[i], buffer[i]); + } + } + count++; + } + } + + // Prevent static code issue DIVIDE_BY_ZERO. + if (count == 0) + { + return ARM_CMSIS_NN_ARG_ERROR; + } + + scale_q31_to_q15_and_clamp(buffer, dst, ch_src, count, act_min, act_max); + dst += ch_src; + } + } + +#else + /* Reference C code adapted from CMSIS-NN arm_avgpool_s8.c. + */ + + (void)ctx; + + for (int i_y = 0, base_idx_y = -pad_y; i_y < output_y; base_idx_y += stride_y, i_y++) + { + for (int i_x = 0, base_idx_x = -pad_x; i_x < output_x; base_idx_x += stride_x, i_x++) + { + /* Condition for kernel start dimension: (base_idx_ + kernel__start) >= 0 */ + const int32_t ker_y_start = MAX(0, -base_idx_y); + const int32_t ker_x_start = MAX(0, -base_idx_x); + + /* Condition for kernel end dimension: (base_idx_ + kernel__end) < dim_src_ */ + const int32_t kernel_y_end = MIN(kernel_y, input_y - base_idx_y); + const int32_t kernel_x_end = MIN(kernel_x, input_x - base_idx_x); + + for (int i_ch_in = 0; i_ch_in < ch_src; i_ch_in++) + { + int sum = 0; + int count = 0; + + for (int k_y = ker_y_start; k_y < kernel_y_end; k_y++) + { + for (int k_x = ker_x_start; k_x < kernel_x_end; k_x++) + { + sum += src[i_ch_in + ch_src * (k_x + base_idx_x + (k_y + base_idx_y) * input_x)]; + count++; + } + } + + // Prevent static code issue DIVIDE_BY_ZERO. + if (count == 0) + { + return ARM_CMSIS_NN_ARG_ERROR; + } + + sum = sum > 0 ? (sum + count / 2) / count : (sum - count / 2) / count; + sum = MAX(sum, act_min); + sum = MIN(sum, act_max); + + dst[i_ch_in + ch_src * (i_x + i_y * output_x)] = sum; + } + } + } +#endif + + return ARM_CMSIS_NN_SUCCESS; +} + +int32_t arm_avgpool_s16_get_buffer_size(const int output_x, const int ch_src) +{ + (void)output_x; +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) + return (ch_src * (int32_t)sizeof(int32_t)); +#else + (void)ch_src; +#endif + return 0; +} + +/** + * @} end of Pooling group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_avgpool_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_avgpool_s8.c index 0b41118..05c284f 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_avgpool_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_avgpool_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_avgpool_s8.c * Description: Pooling function implementations * - * $Date: 09. October 2020 - * $Revision: V.2.0.3 + * $Date: 7 July 2022 + * $Revision: V.3.0.2 * * Target Processor: Cortex-M CPUs * @@ -34,7 +34,6 @@ #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" #if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) - static void scale_q31_to_q7_and_clamp(const q31_t *buffer, q7_t *target, int32_t length, @@ -43,6 +42,7 @@ static void scale_q31_to_q7_and_clamp(const q31_t *buffer, const int act_max) { const int half_count = count / 2; + for (int i = 0; i < length; i++) { int32_t sum = buffer[i] > 0 ? (buffer[i] + half_count) : (buffer[i] - half_count); @@ -73,13 +73,13 @@ static void scale_q31_to_q7_and_clamp(const q31_t *buffer, #if defined(ARM_MATH_MVEI) -arm_status arm_avgpool_s8(const cmsis_nn_context *ctx, - const cmsis_nn_pool_params *pool_params, - const cmsis_nn_dims *input_dims, - const q7_t *src, - const cmsis_nn_dims *filter_dims, - const cmsis_nn_dims *output_dims, - q7_t *dst) +arm_cmsis_nn_status arm_avgpool_s8(const cmsis_nn_context *ctx, + const cmsis_nn_pool_params *pool_params, + const cmsis_nn_dims *input_dims, + const q7_t *src, + const cmsis_nn_dims *filter_dims, + const cmsis_nn_dims *output_dims, + q7_t *dst) { (void)ctx; const int32_t input_y = input_dims->h; @@ -96,153 +96,136 @@ arm_status arm_avgpool_s8(const cmsis_nn_context *ctx, const int32_t act_max = pool_params->activation.max; const int32_t ch_src = input_dims->c; - int32_t i_x, i_y; - int32_t k_x, k_y; - - for (i_y = 0; i_y < output_y; i_y++) + for (int i_y = 0; i_y < output_y; i_y++) { - for (i_x = 0; i_x < output_x; i_x++) + for (int i_x = 0; i_x < output_x; i_x++) { + const int32_t k_y_start = MAX(0, i_y * stride_y - pad_y); + const int32_t k_y_end = MIN(i_y * stride_y - pad_y + kernel_y, input_y); - int32_t k_y_start, k_y_end; - int32_t k_x_start, k_x_end; - int32_t chCnt; - const int8_t *pTmp, *pTmpInner; - int8_t *pDst; + const int32_t k_x_start = MAX(0, i_x * stride_x - pad_x); + const int32_t k_x_end = MIN(i_x * stride_x - pad_x + kernel_x, input_x); - k_y_start = MAX(0, i_y * stride_y - pad_y); - k_y_end = MIN(i_y * stride_y - pad_y + kernel_y, input_y); + const int8_t *src_base = src; + int8_t *out = &dst[ch_src * (i_x + i_y * output_x)]; - k_x_start = MAX(0, i_x * stride_x - pad_x); - k_x_end = MIN(i_x * stride_x - pad_x + kernel_x, input_x); + int32_t ch_count = (ch_src + 15) / 16; + int32_t channels = ch_src; - pTmp = src; - pDst = &dst[ch_src * (i_x + i_y * output_x)]; - - chCnt = ch_src >> 4; - while (chCnt > 0) + while (ch_count > 0) { - int32x4_t sumV1, sumV2, sumV3, sumV4; - - int8x16_t tempV; - int16x8_t tempVLO, tempVHI; - int32x4_t tempVLOLO, tempVLOHI, tempVHILO, tempVHIHI; + int8x16_t temp; + int16x8_t temp_lo, temp_hi; + int32x4_t temp_lo_lo, temp_lo_hi, temp_hi_lo, temp_hi_hi; int32_t count = 0; - sumV1 = vdupq_n_s32(0); - sumV2 = vdupq_n_s32(0); - sumV3 = vdupq_n_s32(0); - sumV4 = vdupq_n_s32(0); + int32x4_t sum_1 = vdupq_n_s32(0); + int32x4_t sum_2 = vdupq_n_s32(0); + int32x4_t sum_3 = vdupq_n_s32(0); + int32x4_t sum_4 = vdupq_n_s32(0); + // Load store tail predicate + const mve_pred16_t ld_st_p = vctp8q(channels); + channels -= 16; - for (k_y = k_y_start; k_y < k_y_end; k_y++) + for (int k_y = k_y_start; k_y < k_y_end; k_y++) { - for (k_x = k_x_start; k_x < k_x_end; k_x++) + for (int k_x = k_x_start; k_x < k_x_end; k_x++) { - pTmpInner = pTmp + (ch_src * (k_x + k_y * input_x)); - tempV = vldrbq_s8(pTmpInner); + const int8_t *src_inner = src_base + (ch_src * (k_x + k_y * input_x)); + temp = vldrbq_z_s8(src_inner, ld_st_p); - tempVLO = vmovlbq_s8(tempV); - tempVHI = vmovltq_s8(tempV); + temp_lo = vmovlbq_s8(temp); + temp_hi = vmovltq_s8(temp); - tempVLOLO = vmovlbq_s16(tempVLO); - tempVLOHI = vmovltq_s16(tempVLO); + temp_lo_lo = vmovlbq_s16(temp_lo); + temp_lo_hi = vmovltq_s16(temp_lo); - tempVHILO = vmovlbq_s16(tempVHI); - tempVHIHI = vmovltq_s16(tempVHI); + temp_hi_lo = vmovlbq_s16(temp_hi); + temp_hi_hi = vmovltq_s16(temp_hi); - sumV1 = vaddq_s32(sumV1, tempVLOLO); - sumV2 = vaddq_s32(sumV2, tempVLOHI); - sumV3 = vaddq_s32(sumV3, tempVHILO); - sumV4 = vaddq_s32(sumV4, tempVHIHI); + sum_1 = vaddq_s32(sum_1, temp_lo_lo); + sum_2 = vaddq_s32(sum_2, temp_lo_hi); + sum_3 = vaddq_s32(sum_3, temp_hi_lo); + sum_4 = vaddq_s32(sum_4, temp_hi_hi); count++; } } - sumV1[0] = sumV1[0] > 0 ? (sumV1[0] + count / 2) / count : (sumV1[0] - count / 2) / count; - sumV1[1] = sumV1[1] > 0 ? (sumV1[1] + count / 2) / count : (sumV1[1] - count / 2) / count; - sumV1[2] = sumV1[2] > 0 ? (sumV1[2] + count / 2) / count : (sumV1[2] - count / 2) / count; - sumV1[3] = sumV1[3] > 0 ? (sumV1[3] + count / 2) / count : (sumV1[3] - count / 2) / count; + // Prevent static code issue DIVIDE_BY_ZERO. + if (count == 0) + { + return ARM_CMSIS_NN_ARG_ERROR; + } - sumV2[0] = sumV2[0] > 0 ? (sumV2[0] + count / 2) / count : (sumV2[0] - count / 2) / count; - sumV2[1] = sumV2[1] > 0 ? (sumV2[1] + count / 2) / count : (sumV2[1] - count / 2) / count; - sumV2[2] = sumV2[2] > 0 ? (sumV2[2] + count / 2) / count : (sumV2[2] - count / 2) / count; - sumV2[3] = sumV2[3] > 0 ? (sumV2[3] + count / 2) / count : (sumV2[3] - count / 2) / count; + // Perform the following operation + // sum = sum > 0 ? (sum + count / 2) / count : (sum - count / 2) / count; + const int32_t half_count = count / 2; + // Predicate for 'sum > 0' operation + mve_pred16_t p = vcmpgtq_n_s32(sum_1, 0); + sum_1 = vaddq_m_n_s32(sum_1, sum_1, half_count, p); + sum_1 = vsubq_m_n_s32(sum_1, sum_1, half_count, ~p); - sumV3[0] = sumV3[0] > 0 ? (sumV3[0] + count / 2) / count : (sumV3[0] - count / 2) / count; - sumV3[1] = sumV3[1] > 0 ? (sumV3[1] + count / 2) / count : (sumV3[1] - count / 2) / count; - sumV3[2] = sumV3[2] > 0 ? (sumV3[2] + count / 2) / count : (sumV3[2] - count / 2) / count; - sumV3[3] = sumV3[3] > 0 ? (sumV3[3] + count / 2) / count : (sumV3[3] - count / 2) / count; + p = vcmpgtq_n_s32(sum_2, 0); + sum_2 = vaddq_m_n_s32(sum_2, sum_2, half_count, p); + sum_2 = vsubq_m_n_s32(sum_2, sum_2, half_count, ~p); - sumV4[0] = sumV4[0] > 0 ? (sumV4[0] + count / 2) / count : (sumV4[0] - count / 2) / count; - sumV4[1] = sumV4[1] > 0 ? (sumV4[1] + count / 2) / count : (sumV4[1] - count / 2) / count; - sumV4[2] = sumV4[2] > 0 ? (sumV4[2] + count / 2) / count : (sumV4[2] - count / 2) / count; - sumV4[3] = sumV4[3] > 0 ? (sumV4[3] + count / 2) / count : (sumV4[3] - count / 2) / count; + p = vcmpgtq_n_s32(sum_3, 0); + sum_3 = vaddq_m_n_s32(sum_3, sum_3, half_count, p); + sum_3 = vsubq_m_n_s32(sum_3, sum_3, half_count, ~p); - sumV1 = vmaxq_s32(sumV1, vdupq_n_s32(act_min)); - sumV1 = vminq_s32(sumV1, vdupq_n_s32(act_max)); + p = vcmpgtq_n_s32(sum_4, 0); + sum_4 = vaddq_m_n_s32(sum_4, sum_4, half_count, p); + sum_4 = vsubq_m_n_s32(sum_4, sum_4, half_count, ~p); - sumV2 = vmaxq_s32(sumV2, vdupq_n_s32(act_min)); - sumV2 = vminq_s32(sumV2, vdupq_n_s32(act_max)); + for (int i = 0; i < 4; i++) + { + sum_1[i] = sum_1[i] / count; + sum_2[i] = sum_2[i] / count; + sum_3[i] = sum_3[i] / count; + sum_4[i] = sum_4[i] / count; + } - sumV3 = vmaxq_s32(sumV3, vdupq_n_s32(act_min)); - sumV3 = vminq_s32(sumV3, vdupq_n_s32(act_max)); + sum_1 = vmaxq_s32(sum_1, vdupq_n_s32(act_min)); + sum_1 = vminq_s32(sum_1, vdupq_n_s32(act_max)); - sumV4 = vmaxq_s32(sumV4, vdupq_n_s32(act_min)); - sumV4 = vminq_s32(sumV4, vdupq_n_s32(act_max)); + sum_2 = vmaxq_s32(sum_2, vdupq_n_s32(act_min)); + sum_2 = vminq_s32(sum_2, vdupq_n_s32(act_max)); - tempVLO = vmovnbq_s32(tempVLO, sumV1); - tempVLO = vmovntq_s32(tempVLO, sumV2); + sum_3 = vmaxq_s32(sum_3, vdupq_n_s32(act_min)); + sum_3 = vminq_s32(sum_3, vdupq_n_s32(act_max)); - tempVHI = vmovnbq_s32(tempVHI, sumV3); - tempVHI = vmovntq_s32(tempVHI, sumV4); + sum_4 = vmaxq_s32(sum_4, vdupq_n_s32(act_min)); + sum_4 = vminq_s32(sum_4, vdupq_n_s32(act_max)); - tempV = vmovnbq_s16(tempV, tempVLO); - tempV = vmovntq_s16(tempV, tempVHI); + temp_lo = vmovnbq_s32(temp_lo, sum_1); + temp_lo = vmovntq_s32(temp_lo, sum_2); - vstrbq_s8(pDst, tempV); - pDst += 16; + temp_hi = vmovnbq_s32(temp_hi, sum_3); + temp_hi = vmovntq_s32(temp_hi, sum_4); - chCnt--; - pTmp += 16; - } + temp = vmovnbq_s16(temp, temp_lo); + temp = vmovntq_s16(temp, temp_hi); - chCnt = ch_src & 0xF; - while (chCnt > 0) - { - int32_t sum = 0; - int32_t count = 0; + vstrbq_p_s8(out, temp, ld_st_p); + out += 16; - for (k_y = k_y_start; k_y < k_y_end; k_y++) - { - for (k_x = k_x_start; k_x < k_x_end; k_x++) - { - sum += pTmp[ch_src * (k_x + k_y * input_x)]; - count++; - } - } - sum = sum > 0 ? (sum + count / 2) / count : (sum - count / 2) / count; - sum = MAX(sum, act_min); - sum = MIN(sum, act_max); - - *pDst++ = sum; - - chCnt--; - pTmp++; + ch_count--; + src_base += 16; } } } - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } #else -arm_status arm_avgpool_s8(const cmsis_nn_context *ctx, - const cmsis_nn_pool_params *pool_params, - const cmsis_nn_dims *input_dims, - const q7_t *src, - const cmsis_nn_dims *filter_dims, - const cmsis_nn_dims *output_dims, - q7_t *dst) +arm_cmsis_nn_status arm_avgpool_s8(const cmsis_nn_context *ctx, + const cmsis_nn_pool_params *pool_params, + const cmsis_nn_dims *input_dims, + const q7_t *src, + const cmsis_nn_dims *filter_dims, + const cmsis_nn_dims *output_dims, + q7_t *dst) { const int32_t input_y = input_dims->h; const int32_t input_x = input_dims->w; @@ -257,6 +240,11 @@ arm_status arm_avgpool_s8(const cmsis_nn_context *ctx, const int32_t act_min = pool_params->activation.min; const int32_t act_max = pool_params->activation.max; const int32_t ch_src = input_dims->c; + + if (ctx->buf == NULL && arm_avgpool_s8_get_buffer_size(output_dims->w, input_dims->c)) + { + return ARM_CMSIS_NN_ARG_ERROR; + } q31_t *buffer = (q31_t *)ctx->buf; #if defined(ARM_MATH_DSP) @@ -302,6 +290,13 @@ arm_status arm_avgpool_s8(const cmsis_nn_context *ctx, count++; } } + + // Prevent static code issue DIVIDE_BY_ZERO. + if (count == 0) + { + return ARM_CMSIS_NN_ARG_ERROR; + } + scale_q31_to_q7_and_clamp(buffer, dst, ch_src, count, act_min, act_max); dst += ch_src; } @@ -311,20 +306,18 @@ arm_status arm_avgpool_s8(const cmsis_nn_context *ctx, /* Reference C code adapted from CMSIS-NN arm_avepool_q7_HWC. */ (void)buffer; - int16_t i_ch_in, i_x, i_y; - int16_t k_x, k_y; - for (i_y = 0; i_y < output_y; i_y++) + for (int i_y = 0; i_y < output_y; i_y++) { - for (i_x = 0; i_x < output_x; i_x++) + for (int i_x = 0; i_x < output_x; i_x++) { - for (i_ch_in = 0; i_ch_in < ch_src; i_ch_in++) + for (int i_ch_in = 0; i_ch_in < ch_src; i_ch_in++) { int sum = 0; int count = 0; - for (k_y = i_y * stride_y - pad_y; k_y < i_y * stride_y - pad_y + kernel_y; k_y++) + for (int k_y = i_y * stride_y - pad_y; k_y < i_y * stride_y - pad_y + kernel_y; k_y++) { - for (k_x = i_x * stride_x - pad_x; k_x < i_x * stride_x - pad_x + kernel_x; k_x++) + for (int k_x = i_x * stride_x - pad_x; k_x < i_x * stride_x - pad_x + kernel_x; k_x++) { if (k_y >= 0 && k_x >= 0 && k_y < input_y && k_x < input_x) { @@ -333,6 +326,13 @@ arm_status arm_avgpool_s8(const cmsis_nn_context *ctx, } } } + + // Prevent static code issue DIVIDE_BY_ZERO. + if (count == 0) + { + return ARM_CMSIS_NN_ARG_ERROR; + } + sum = sum > 0 ? (sum + count / 2) / count : (sum - count / 2) / count; sum = MAX(sum, act_min); sum = MIN(sum, act_max); @@ -343,7 +343,7 @@ arm_status arm_avgpool_s8(const cmsis_nn_context *ctx, } #endif - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } #endif /* ARM_MATH_MVEI */ diff --git a/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_max_pool_s16.c b/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_max_pool_s16.c new file mode 100644 index 0000000..0b39d5e --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_max_pool_s16.c @@ -0,0 +1,216 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * SPDX-FileCopyrightText: Copyright 2022 Arm Limited and/or its affiliates + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_max_pool_s16.c + * Description: Pooling function implementations + * + * $Date: 16 August 2022 + * $Revision: V.2.1.1 + * + * Target Processor: Cortex-M CPUs + * + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" + +static void compare_and_replace_if_larger(int16_t *base, const int16_t *target, int32_t length) +{ +#if defined(ARM_MATH_MVEI) + int32_t loop_count = (length + 7) / 8; + for (int i = 0; i < loop_count; i++) + { + mve_pred16_t p = vctp16q((uint32_t)length); + const int16x8_t op_1 = vldrhq_z_s16(base, p); + const int16x8_t op_2 = vldrhq_z_s16(target, p); + const int16x8_t max = vmaxq_s16(op_1, op_2); + vstrhq_p_s16(base, max, p); + base += 8; + target += 8; + length -= 8; + } +#else + q15_t *dst = base; + const q15_t *src = target; + union arm_nnword ref_max; + union arm_nnword comp_max; + int32_t cnt = length >> 1; + + while (cnt > 0l) + { + ref_max.word = arm_nn_read_q15x2(dst); + comp_max.word = arm_nn_read_q15x2_ia(&src); + + if (comp_max.half_words[0] > ref_max.half_words[0]) + { + ref_max.half_words[0] = comp_max.half_words[0]; + } + if (comp_max.half_words[1] > ref_max.half_words[1]) + { + ref_max.half_words[1] = comp_max.half_words[1]; + } + + arm_nn_write_q15x2_ia(&dst, ref_max.word); + + cnt--; + } + + if (length & 0x1) + { + if (*src > *dst) + { + *dst = *src; + } + } +#endif +} + +static void clamp_output(int16_t *source, int32_t length, const int16_t act_min, const int16_t act_max) +{ +#if defined(ARM_MATH_MVEI) + const int16x8_t min = vdupq_n_s16((int16_t)act_min); + const int16x8_t max = vdupq_n_s16((int16_t)act_max); + + int32_t loop_count = (length + 7) / 8; + for (int i = 0; i < loop_count; i++) + { + mve_pred16_t p = vctp16q((uint32_t)length); + length -= 8; + const int16x8_t src = vldrhq_z_s16(source, p); + int16x8_t res = vmaxq_x_s16(src, min, p); + res = vminq_x_s16(res, max, p); + vstrhq_p_s16(source, res, p); + source += 8; + } +#else + union arm_nnword in; + int32_t cnt = length >> 1; + + while (cnt > 0l) + { + in.word = arm_nn_read_q15x2(source); + + in.half_words[0] = MAX(in.half_words[0], act_min); + in.half_words[0] = MIN(in.half_words[0], act_max); + in.half_words[1] = MAX(in.half_words[1], act_min); + in.half_words[1] = MIN(in.half_words[1], act_max); + + arm_nn_write_q15x2_ia(&source, in.word); + cnt--; + } + + if (length & 0x1) + { + int16_t comp = *source; + comp = MAX(comp, act_min); + comp = MIN(comp, act_max); + *source = comp; + } +#endif +} + +/** + * @ingroup groupNN + */ + +/** + * @addtogroup Pooling + * @{ + */ + +/* + * Optimized s16 max pooling function + * + * Refer to header file for details. + * + */ + +arm_cmsis_nn_status arm_max_pool_s16(const cmsis_nn_context *ctx, + const cmsis_nn_pool_params *pool_params, + const cmsis_nn_dims *input_dims, + const int16_t *src, + const cmsis_nn_dims *filter_dims, + const cmsis_nn_dims *output_dims, + int16_t *dst) +{ + const int32_t input_y = input_dims->h; + const int32_t input_x = input_dims->w; + const int32_t output_y = output_dims->h; + const int32_t output_x = output_dims->w; + const int32_t stride_y = pool_params->stride.h; + const int32_t stride_x = pool_params->stride.w; + const int32_t kernel_y = filter_dims->h; + const int32_t kernel_x = filter_dims->w; + const int32_t pad_y = pool_params->padding.h; + const int32_t pad_x = pool_params->padding.w; + const int16_t act_min = pool_params->activation.min; + const int16_t act_max = pool_params->activation.max; + const int32_t channel_in = input_dims->c; + (void)ctx; + int16_t *dst_base = dst; + + for (int i_y = 0, base_idx_y = -pad_y; i_y < output_y; base_idx_y += stride_y, i_y++) + { + for (int i_x = 0, base_idx_x = -pad_x; i_x < output_x; base_idx_x += stride_x, i_x++) + { + /* Condition for kernel start dimension: (base_idx_ + kernel__start) >= 0 */ + const int32_t ker_y_start = MAX(0, -base_idx_y); + const int32_t ker_x_start = MAX(0, -base_idx_x); + + /* Condition for kernel end dimension: (base_idx_ + kernel__end) < dim_src_ */ + const int32_t kernel_y_end = MIN(kernel_y, input_y - base_idx_y); + const int32_t kernel_x_end = MIN(kernel_x, input_x - base_idx_x); + + int count = 0; + + for (int k_y = ker_y_start; k_y < kernel_y_end; k_y++) + { + for (int k_x = ker_x_start; k_x < kernel_x_end; k_x++) + { + const int16_t *start = src + channel_in * (k_x + base_idx_x + (k_y + base_idx_y) * input_x); + + if (count == 0) + { + memcpy(dst, start, channel_in * sizeof(int16_t)); + count++; + } + else + { + compare_and_replace_if_larger(dst, start, channel_in); + } + } + } + /* 'count' is expected to be non-zero here. */ + dst += channel_in; + } + } + + clamp_output(dst_base, output_x * output_y * channel_in, act_min, act_max); + + return ARM_CMSIS_NN_SUCCESS; +} + +/** + * @} end of Pooling group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_max_pool_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_max_pool_s8.c index 9442df0..581a8c6 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_max_pool_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_max_pool_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_max_pool_s8.c * Description: Pooling function implementations * - * $Date: 19. Februari 2021 - * $Revision: V.2.0.2 + * $Date: 16 August 2022 + * $Revision: V.3.0.1 * * Target Processor: Cortex-M CPUs * @@ -42,7 +42,7 @@ static void compare_and_replace_if_larger_q7(q7_t *base, const q7_t *target, int mve_pred16_t p = vctp8q((uint32_t)length); const int8x16_t op_1 = vldrbq_z_s8(base, p); const int8x16_t op_2 = vldrbq_z_s8(target, p); - const int8x16_t max = vmaxq_m_s8(vuninitializedq_s8(), op_1, op_2, p); + const int8x16_t max = vmaxq_x_s8(op_1, op_2, p); vstrbq_p_s8(base, max, p); base += 16; target += 16; @@ -77,7 +77,7 @@ static void compare_and_replace_if_larger_q7(q7_t *base, const q7_t *target, int ref_max.bytes[3] = comp_max.bytes[3]; } - write_q7x4_ia(&dst, ref_max.word); + arm_nn_write_q7x4_ia(&dst, ref_max.word); cnt--; } @@ -100,15 +100,16 @@ static void clamp_output(q7_t *source, int32_t length, const int32_t act_min, co { #if defined(ARM_MATH_MVEI) int32_t loop_count = (length + 15) / 16; + const int8x16_t vmin = vdupq_n_s8((int8_t)act_min); + const int8x16_t vmax = vdupq_n_s8((int8_t)act_max); + for (int i = 0; i < loop_count; i++) { mve_pred16_t p = vctp8q((uint32_t)length); length -= 16; const int8x16_t src = vldrbq_z_s8(source, p); - const int8x16_t predicated_min = vdupq_m_n_s8(vuninitializedq_s8(), (int8_t)act_min, p); - const int8x16_t predicated_max = vdupq_m_n_s8(vuninitializedq_s8(), (int8_t)act_max, p); - int8x16_t res = vmaxq_m_s8(vuninitializedq_s8(), src, predicated_min, p); - res = vminq_m_s8(vuninitializedq_s8(), res, predicated_max, p); + int8x16_t res = vmaxq_x_s8(src, vmin, p); + res = vminq_x_s8(res, vmax, p); vstrbq_p_s8(source, res, p); source += 16; } @@ -129,7 +130,7 @@ static void clamp_output(q7_t *source, int32_t length, const int32_t act_min, co in.bytes[3] = MAX(in.bytes[3], act_min); in.bytes[3] = MIN(in.bytes[3], act_max); - write_q7x4_ia(&source, in.word); + arm_nn_write_q7x4_ia(&source, in.word); cnt--; } @@ -161,13 +162,13 @@ static void clamp_output(q7_t *source, int32_t length, const int32_t act_min, co * */ -arm_status arm_max_pool_s8(const cmsis_nn_context *ctx, - const cmsis_nn_pool_params *pool_params, - const cmsis_nn_dims *input_dims, - const q7_t *src, - const cmsis_nn_dims *filter_dims, - const cmsis_nn_dims *output_dims, - q7_t *dst) +arm_cmsis_nn_status arm_max_pool_s8(const cmsis_nn_context *ctx, + const cmsis_nn_pool_params *pool_params, + const cmsis_nn_dims *input_dims, + const q7_t *src, + const cmsis_nn_dims *filter_dims, + const cmsis_nn_dims *output_dims, + q7_t *dst) { const int32_t input_y = input_dims->h; const int32_t input_x = input_dims->w; @@ -207,7 +208,7 @@ arm_status arm_max_pool_s8(const cmsis_nn_context *ctx, if (count == 0) { - memcpy(dst, start, channel_in); + arm_memcpy_q7(dst, start, channel_in); count++; } else @@ -223,7 +224,7 @@ arm_status arm_max_pool_s8(const cmsis_nn_context *ctx, clamp_output(dst_base, output_x * output_y * channel_in, act_min, act_max); - return ARM_MATH_SUCCESS; + return ARM_CMSIS_NN_SUCCESS; } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_pool_q7_HWC.c b/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_pool_q7_HWC.c index 5590fc8..c88fc24 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_pool_q7_HWC.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_pool_q7_HWC.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2018 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_pool_q7_HWC.c * Description: Pooling function implementations * - * $Date: 09. October 2020 - * $Revision: V.1.0.1 + * $Date: 4 Aug 2022 + * $Revision: V.1.1.2 * * Target Processor: Cortex-M cores * @@ -33,10 +33,10 @@ #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) -/** - * @brief A few utility functions used by pooling functions +/* + * A few utility functions used by pooling functions * * */ @@ -77,7 +77,7 @@ static void compare_and_replace_if_larger_q7(q7_t *base, // base data if (com.bytes[3] > in.bytes[3]) in.bytes[3] = com.bytes[3]; - *__SIMD32(pIn)++ = in.word; + arm_nn_write_q7x4_ia(&pIn, in.word); cnt--; } @@ -121,10 +121,10 @@ static void accumulate_q7_to_q15(q15_t *base, q7_t *target, const uint16_t lengt #endif in = arm_nn_read_q15x2(pCnt); - *__SIMD32(pCnt)++ = __QADD16(vo1, in); + arm_nn_write_q15x2_ia(&pCnt, __QADD16(vo1, in)); in = arm_nn_read_q15x2(pCnt); - *__SIMD32(pCnt)++ = __QADD16(vo2, in); + arm_nn_write_q15x2_ia(&pCnt, __QADD16(vo2, in)); cnt--; } @@ -180,7 +180,7 @@ void arm_maxpool_q7_HWC(q7_t *Im_in, q7_t *Im_out) { (void)bufferA; -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ int16_t i_x, i_y; @@ -336,7 +336,7 @@ void arm_avepool_q7_HWC(q7_t *Im_in, q7_t *Im_out) { -#if defined(ARM_MATH_DSP) +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) /* Run the following code for Cortex-M4 and Cortex-M7 */ q15_t *buffer = (q15_t *)bufferA; diff --git a/edge-impulse-sdk/CMSIS/NN/Source/ReshapeFunctions/arm_reshape_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/ReshapeFunctions/arm_reshape_s8.c index 7751b4e..0b1892b 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/ReshapeFunctions/arm_reshape_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/ReshapeFunctions/arm_reshape_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2019 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,14 +23,15 @@ * Title: arm_reshape_s8.c * Description: Reshape a s8 vector * - * $Date: September 2019 - * $Revision: V.1.0.0 + * $Date: 4 Aug 2022 + * $Revision: V.1.0.1 * * Target Processor: Cortex-M cores * * -------------------------------------------------------------------- */ #include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" /** * @ingroup groupNN @@ -41,7 +42,7 @@ * @{ */ -/** +/* * Basic s8 reshape function. * * Refer header file for details. @@ -50,10 +51,11 @@ void arm_reshape_s8(const int8_t *input, int8_t *output, const uint32_t total_size) { - memcpy(output, input, total_size); + arm_memcpy_q7(output, input, total_size); } /** * @} end of Reshape group */ + #endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/SVDFunctions/arm_svdf_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/SVDFunctions/arm_svdf_s8.c index f3763ee..3d386e8 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/SVDFunctions/arm_svdf_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/SVDFunctions/arm_svdf_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2022 Arm Limited or its affiliates. * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_svdf_s8.c * Description: S8 basic SVDF layer function * - * $Date: 09. October 2020 - * $Revision: V.1.0.1 + * $Date: 4 May 2022 + * $Revision: V.4.0.1 * * Target Processor: Cortex-M processors * @@ -43,29 +43,29 @@ */ /* - * S8 SVDF layer function for TensorFlow Lite + * S8 SVDF layer function for TensorFlow Lite with 8 bit state tensor * * Refer to header file for details. * */ -arm_status arm_svdf_s8(const cmsis_nn_context *input_ctx, - const cmsis_nn_context *output_ctx, - const cmsis_nn_svdf_params *svdf_params, - const cmsis_nn_per_tensor_quant_params *input_quant_params, - const cmsis_nn_per_tensor_quant_params *output_quant_params, - const cmsis_nn_dims *input_dims, - const q7_t *input_data, - const cmsis_nn_dims *state_dims, - q15_t *state_data, - const cmsis_nn_dims *weights_feature_dims, - const q7_t *weights_feature_data, - const cmsis_nn_dims *weights_time_dims, - const q15_t *weights_time_data, - const cmsis_nn_dims *bias_dims, - const q31_t *bias_data, - const cmsis_nn_dims *output_dims, - q7_t *output_data) +arm_cmsis_nn_status arm_svdf_s8(const cmsis_nn_context *input_ctx, + const cmsis_nn_context *output_ctx, + const cmsis_nn_svdf_params *svdf_params, + const cmsis_nn_per_tensor_quant_params *input_quant_params, + const cmsis_nn_per_tensor_quant_params *output_quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *state_dims, + q7_t *state_data, + const cmsis_nn_dims *weights_feature_dims, + const q7_t *weights_feature_data, + const cmsis_nn_dims *weights_time_dims, + const q7_t *weights_time_data, + const cmsis_nn_dims *bias_dims, + const q31_t *bias_data, + const cmsis_nn_dims *output_dims, + q7_t *output_data) { (void)bias_dims; (void)state_dims; @@ -83,139 +83,189 @@ arm_status arm_svdf_s8(const cmsis_nn_context *input_ctx, const int32_t out_activation_max = svdf_params->output_activation.max; const int16_t rank = svdf_params->rank; - int32_t zp_32 = (-zp_in & 0xffff) | ((-zp_in & 0xffff) << 16); - const int32_t input_batches = input_dims->n; const int32_t input_height = input_dims->h; const int32_t feature_batches = weights_feature_dims->n; const int32_t time_batches = weights_time_dims->h; const int32_t unit_count = feature_batches / rank; + if (input_ctx->buf == NULL) + { + return ARM_CMSIS_NN_ARG_ERROR; + } q31_t *buffer_a = (q31_t *)input_ctx->buf; + + if (output_ctx->buf == NULL) + { + return ARM_CMSIS_NN_ARG_ERROR; + } q31_t *buffer_b = (q31_t *)output_ctx->buf; - memmove((q15_t *)state_data, - (q15_t *)state_data + 1, - (size_t)(input_batches * feature_batches * time_batches * (int32_t)sizeof(int16_t))); + // Left shift state + memmove((int8_t *)state_data, + (int8_t *)state_data + 1, + (size_t)((input_batches * feature_batches * time_batches - 1) * (int32_t)sizeof(int8_t))); - q15_t *res_ptr = state_data + (time_batches - 1); + // Matrix multiplication input * feature weight for (int i_batch = 0; i_batch < input_batches; i_batch++) { - const q7_t *buffer_1 = weights_feature_data; - for (int r = 0; r < feature_batches; r++) - { - q31_t dot_prod = 0; + q7_t *res_ptr = state_data + (time_batches * i_batch * feature_batches) + (time_batches - 1); + const q7_t *weight = weights_feature_data; + const q7_t *input = input_data + i_batch * input_height; - const q7_t *buffer_2 = input_data + i_batch * input_height; + arm_cmsis_nn_status res = arm_nn_vec_mat_mult_t_s8(input, + weight, + NULL, + res_ptr, + -zp_in, + 0, + 0, + multiplier_in, + shift_in, + input_height, + feature_batches, + in_activation_min, + in_activation_max, + time_batches); -#if defined(ARM_MATH_DSP) - int c = 0; - int32_t block_count = input_height >> 2; - for (int i = 0; i < block_count; i++) - { - c += 4; + if (res != ARM_CMSIS_NN_SUCCESS) + { + return res; + } + } - q31_t r1 = arm_nn_read_q7x4_ia(&buffer_1); - q31_t r1_a = __SXTB16(r1); - q31_t r1_b = __SXTB16(__ROR((uint32_t)r1, 8)); + // Matrix multiplicate time weight * state tensors + { + q31_t *ptr_a = buffer_a; + const int8_t *v2 = state_data; + for (int i_batch = 0; i_batch < input_batches; i_batch++) + { + const int8_t *v1 = weights_time_data; - q31_t r2 = arm_nn_read_q7x4_ia(&buffer_2); - q31_t r2_a = __SXTAB16(zp_32, r2); - q31_t r2_b = __SXTAB16(zp_32, __ROR((uint32_t)r2, 8)); + for (int i_feature_batch = 0; i_feature_batch < feature_batches; i_feature_batch++) + { + *ptr_a = 0; + int32_t sum = 0; +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) + // Perform matrix multiplication in blocks of four + int j = 0; + int32_t block_count = time_batches >> 2; + for (int i = 0; i < block_count; i++) + { + j += 4; - dot_prod = __SMLAD(r1_a, r2_a, dot_prod); - dot_prod = __SMLAD(r1_b, r2_b, dot_prod); - } + q31_t r1_1, r1_2, r2_1, r2_2; + v1 = read_and_pad_reordered(v1, &r1_1, &r1_2); + v2 = read_and_pad_reordered(v2, &r2_1, &r2_2); + sum = __SMLAD(r1_1, r2_1, sum); + sum = __SMLAD(r1_2, r2_2, sum); + } - for (; c < input_height; c++) - { - dot_prod += *buffer_1 * (*buffer_2 - zp_in); - buffer_1++; - buffer_2++; - } + // Process the remaining data + for (; j < time_batches; j++) + { + sum += *v1 * *v2; + v1++; + v2++; + } #else - for (int c = 0; c < input_height; c++) - { - dot_prod += *buffer_1 * (*buffer_2 - zp_in); - buffer_1++; - buffer_2++; - } + for (int j = 0; j < time_batches; j++) + { + sum += *v1 * *v2; + v1++; + v2++; + } #endif - dot_prod = arm_nn_requantize(dot_prod, multiplier_in, shift_in); - dot_prod = CLAMP(dot_prod, in_activation_max, in_activation_min); - *res_ptr = dot_prod; - res_ptr += time_batches; + *ptr_a = sum; + ptr_a++; + } } } - for (int i_batch = 0; i_batch < input_batches; i_batch++) + if (bias_data) { - q31_t *ptr_a = buffer_a + i_batch * feature_batches; - - const q15_t *v1 = weights_time_data; - const q15_t *v2 = state_data + i_batch * time_batches * feature_batches; - for (int i_feature_batch = 0; i_feature_batch < feature_batches; i_feature_batch++) + if (unit_count == feature_batches) { - *ptr_a = 0; - - int32_t sum = 0; -#if defined(ARM_MATH_DSP) - int j = 0; - int32_t block_count = time_batches >> 1; - for (int i = 0; i < block_count; i++) + for (int i = 0; i < input_batches; i++) { - j += 2; - q31_t r1 = arm_nn_read_q15x2_ia(&v1); - q31_t r2 = arm_nn_read_q15x2_ia(&v2); + q31_t *output_temp = buffer_b + i * feature_batches; + const q31_t *ptr_a = buffer_a + i * feature_batches; - sum = __SMLAD(r1, r2, sum); - } - - // Process the remaining data - for (; j < time_batches; j++) - { - sum += *v1 * *v2; - v1++; - v2++; + const int32_t *bi = bias_data; + for (int j = 0; j < feature_batches; j++) + { + output_temp[j] = ptr_a[j] + bi[j]; + } } -#else - for (int j = 0; j < time_batches; j++) + } + else + { + for (int i_batch = 0; i_batch < input_batches; i_batch++) { - sum += *v1 * *v2; - v1++; - v2++; - } -#endif + q31_t *output_data_temp = buffer_b + i_batch * unit_count; + q31_t *ptr_a = buffer_a + i_batch * feature_batches; - *ptr_a = sum; - ptr_a++; + for (int i = 0; i < unit_count; i++) + { + int32_t sum = bias_data[i]; + for (int j = 0; j < rank; j++) + { + sum += *ptr_a; + ptr_a++; + } + output_data_temp[i] = sum; + } + } } } - - for (int i_batch = 0; i_batch < input_batches; i_batch++) + else { - q31_t *output_data_temp = buffer_b + i_batch * unit_count; - q31_t *ptr_a = buffer_a + i_batch * feature_batches; - - for (int i = 0; i < unit_count; i++) + for (int i_batch = 0; i_batch < input_batches; i_batch++) { - output_data_temp[i] = bias_data[i]; - for (int j = 0; j < rank; j++) + q31_t *output_data_temp = buffer_b + i_batch * unit_count; + q31_t *ptr_a = buffer_a + i_batch * feature_batches; + + for (int i = 0; i < unit_count; i++) { - output_data_temp[i] += *ptr_a; - ptr_a++; + int32_t sum = 0; + for (int j = 0; j < rank; j++) + { + sum += *ptr_a; + ptr_a++; + } + output_data_temp[i] = sum; } } } +#if defined(ARM_MATH_MVEI) + int32_t num_elements = input_batches * unit_count; + const int32_t loop_count = (num_elements + 3) / 4; + for (int i_op = 0; i_op < loop_count; i_op++) + { + mve_pred16_t p = vctp32q((uint32_t)num_elements); + int32x4_t op = vldrwq_z_s32(buffer_b, p); + op = arm_requantize_mve(op, multiplier_out, shift_2); + op = vaddq_n_s32(op, zp_out); + const int32x4_t min_vec = vdupq_n_s32((int8_t)out_activation_min); + const int32x4_t max_vec = vdupq_n_s32((int8_t)out_activation_max); + op = vmaxq_s32(op, min_vec); + op = vminq_s32(op, max_vec); + vstrbq_p_s32(output_data, op, p); + output_data += 4; + buffer_b += 4; + num_elements -= 4; + } +#else for (int i = 0; i < input_batches * unit_count; i++) { output_data[i] = (q7_t)CLAMP( arm_nn_requantize(buffer_b[i], multiplier_out, shift_2) + zp_out, out_activation_max, out_activation_min); } +#endif - return (ARM_MATH_SUCCESS); + return (ARM_CMSIS_NN_SUCCESS); } /** diff --git a/edge-impulse-sdk/CMSIS/NN/Source/SVDFunctions/arm_svdf_state_s16_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/SVDFunctions/arm_svdf_state_s16_s8.c new file mode 100644 index 0000000..d804121 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/SVDFunctions/arm_svdf_state_s16_s8.c @@ -0,0 +1,271 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * Copyright (C) 2022 Arm Limited or its affiliates. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_svdf_s8.c + * Description: S8 basic SVDF layer function with s16 state tensor + * + * $Date: 4 May 2022 + * $Revision: V.2.0.1 + * + * Target Processor: Cortex-M processors + * + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" + +/** + * @ingroup groupNN + */ + +/** + * @addtogroup SVDF + * @{ + */ + +/* + * S8 SVDF layer function for TensorFlow Lite with 16 bit state tensor + * + * Refer to header file for details. + * + */ + +arm_cmsis_nn_status arm_svdf_state_s16_s8(const cmsis_nn_context *input_ctx, + const cmsis_nn_context *output_ctx, + const cmsis_nn_svdf_params *svdf_params, + const cmsis_nn_per_tensor_quant_params *input_quant_params, + const cmsis_nn_per_tensor_quant_params *output_quant_params, + const cmsis_nn_dims *input_dims, + const q7_t *input_data, + const cmsis_nn_dims *state_dims, + q15_t *state_data, + const cmsis_nn_dims *weights_feature_dims, + const q7_t *weights_feature_data, + const cmsis_nn_dims *weights_time_dims, + const q15_t *weights_time_data, + const cmsis_nn_dims *bias_dims, + const q31_t *bias_data, + const cmsis_nn_dims *output_dims, + q7_t *output_data) +{ + (void)bias_dims; + (void)state_dims; + (void)output_dims; + + const q31_t multiplier_in = input_quant_params->multiplier; + const q31_t shift_in = input_quant_params->shift; + const q31_t multiplier_out = output_quant_params->multiplier; + const q31_t shift_2 = output_quant_params->shift; + const int32_t zp_in = svdf_params->input_offset; + const int32_t zp_out = svdf_params->output_offset; + const int32_t in_activation_min = svdf_params->input_activation.min; + const int32_t in_activation_max = svdf_params->input_activation.max; + const int32_t out_activation_min = svdf_params->output_activation.min; + const int32_t out_activation_max = svdf_params->output_activation.max; + const int16_t rank = svdf_params->rank; + + const int32_t input_batches = input_dims->n; + const int32_t input_height = input_dims->h; + const int32_t feature_batches = weights_feature_dims->n; + const int32_t time_batches = weights_time_dims->h; + const int32_t unit_count = feature_batches / rank; + + if (input_ctx->buf == NULL) + { + return ARM_CMSIS_NN_ARG_ERROR; + } + q31_t *buffer_a = (q31_t *)input_ctx->buf; + + if (output_ctx->buf == NULL) + { + return ARM_CMSIS_NN_ARG_ERROR; + } + q31_t *buffer_b = (q31_t *)output_ctx->buf; + + // Left shift state + memmove((q15_t *)state_data, + (q15_t *)state_data + 1, + (size_t)((input_batches * feature_batches * time_batches - 1) * (int32_t)sizeof(int16_t))); + + // Matrix multiplication input * feature weight + for (int i_batch = 0; i_batch < input_batches; i_batch++) + { + q15_t *res_ptr = state_data + (time_batches * i_batch * feature_batches) + (time_batches - 1); + const q7_t *weight = weights_feature_data; + const q7_t *input = input_data + i_batch * input_height; + + arm_cmsis_nn_status res = arm_nn_vec_mat_mult_t_svdf_s8(input, + weight, + res_ptr, + -zp_in, + 0, + time_batches, + multiplier_in, + shift_in, + input_height, + feature_batches, + in_activation_min, + in_activation_max); + + if (res != ARM_CMSIS_NN_SUCCESS) + { + return res; + } + } + + { + // Matrix multiplication time weight * state tensors + q31_t *ptr_a = buffer_a; + const q15_t *v2 = state_data; + for (int i_batch = 0; i_batch < input_batches; i_batch++) + { + const q15_t *v1 = weights_time_data; + + for (int i_feature_batch = 0; i_feature_batch < feature_batches; i_feature_batch++) + { + *ptr_a = 0; + int32_t sum = 0; +#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI) + // Perform matrix multiplication in blocks of two + int j = 0; + int32_t block_count = time_batches >> 1; + for (int i = 0; i < block_count; i++) + { + j += 2; + q31_t r1 = arm_nn_read_q15x2_ia(&v1); + q31_t r2 = arm_nn_read_q15x2_ia(&v2); + + sum = __SMLAD(r1, r2, sum); + } + + // Process the remaining data + for (; j < time_batches; j++) + { + sum += *v1 * *v2; + v1++; + v2++; + } +#else + for (int j = 0; j < time_batches; j++) + { + sum += *v1 * *v2; + v1++; + v2++; + } +#endif + + *ptr_a = sum; + ptr_a++; + } + } + } + + if (bias_data) + { + if (unit_count == feature_batches) + { + for (int i = 0; i < input_batches; i++) + { + q31_t *output_temp = buffer_b + i * feature_batches; + const q31_t *ptr_a = buffer_a + i * feature_batches; + + const int32_t *bi = bias_data; + for (int j = 0; j < feature_batches; j++) + { + output_temp[j] = ptr_a[j] + bi[j]; + } + } + } + else + { + for (int i_batch = 0; i_batch < input_batches; i_batch++) + { + q31_t *output_data_temp = buffer_b + i_batch * unit_count; + q31_t *ptr_a = buffer_a + i_batch * feature_batches; + + for (int i = 0; i < unit_count; i++) + { + int32_t sum = bias_data[i]; + for (int j = 0; j < rank; j++) + { + sum += *ptr_a; + ptr_a++; + } + output_data_temp[i] = sum; + } + } + } + } + else + { + for (int i_batch = 0; i_batch < input_batches; i_batch++) + { + q31_t *output_data_temp = buffer_b + i_batch * unit_count; + q31_t *ptr_a = buffer_a + i_batch * feature_batches; + + for (int i = 0; i < unit_count; i++) + { + int32_t sum = 0; + for (int j = 0; j < rank; j++) + { + sum += *ptr_a; + ptr_a++; + } + output_data_temp[i] = sum; + } + } + } + +#if defined(ARM_MATH_MVEI) + int32_t num_elements = input_batches * unit_count; + const int32_t loop_count = (num_elements + 3) / 4; + for (int i_op = 0; i_op < loop_count; i_op++) + { + mve_pred16_t p = vctp32q((uint32_t)num_elements); + int32x4_t op = vldrwq_z_s32(buffer_b, p); + op = arm_requantize_mve(op, multiplier_out, shift_2); + op = vaddq_n_s32(op, zp_out); + const int32x4_t min_vec = vdupq_n_s32((int8_t)out_activation_min); + const int32x4_t max_vec = vdupq_n_s32((int8_t)out_activation_max); + op = vmaxq_s32(op, min_vec); + op = vminq_s32(op, max_vec); + vstrbq_p_s32(output_data, op, p); + output_data += 4; + buffer_b += 4; + num_elements -= 4; + } +#else + for (int i = 0; i < input_batches * unit_count; i++) + { + output_data[i] = (q7_t)CLAMP( + arm_nn_requantize(buffer_b[i], multiplier_out, shift_2) + zp_out, out_activation_max, out_activation_min); + } +#endif + + return (ARM_CMSIS_NN_SUCCESS); +} + +/** + * @} end of SVDF group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_nn_softmax_common_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_nn_softmax_common_s8.c new file mode 100644 index 0000000..5328340 --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_nn_softmax_common_s8.c @@ -0,0 +1,151 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * Copyright (C) 2022 Arm Limited or its affiliates. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_nn_softmax_common_s8.c + * Description: Softmax with s8 input and output of s8 or s16. + * + * $Date: 17 March 2022 + * $Revision: V.1.0.1 + * + * Target Processor: Cortex-M processors + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" + +#define ACCUM_BITS 12 + +/** + * @ingroup groupSupport + */ + +/** + * @addtogroup Softmax + * @{ + */ + +/* + * Softmax function with s8 input and output of s8 or s16. + * + * Refer header file for details. + * + */ +void arm_nn_softmax_common_s8(const int8_t *input, + const int32_t num_rows, + const int32_t row_size, + const int32_t mult, + const int32_t shift, + const int32_t diff_min, + const bool int16_output, + void *output) +{ + const int32_t mask = (1 << shift); + + int32_t col = 0; + int32_t row_idx; + + for (row_idx = 0; row_idx < num_rows; ++row_idx) + { + // Find the maximum value in order to ensure numerical stability + int8_t max = *input; + + for (col = 1; col < row_size; ++col) + { + max = MAX(max, input[col]); + } + + int32_t diff = 0; + int32_t sum = 0; + + for (col = 0; col < row_size; ++col) + { + diff = input[col] - max; + if (diff >= diff_min) + { + sum += DIV_POW2(EXP_ON_NEG(MUL_SAT(diff * mask, mult)), ACCUM_BITS); + } + } + + const int32_t headroom = __CLZ(sum); + const int32_t shifted_scale = ONE_OVER1((sum > 0 ? sum << headroom : 0) - (1 << 31)); + int32_t bits_over_unit; + + if (int16_output) + { +#if EI_TFLITE_DISABLE_SOFTMAX_IN_I16 + return; +#endif + int16_t *output_s16 = (int16_t *)output + row_idx * row_size; + + bits_over_unit = ACCUM_BITS - headroom + 15; + + for (col = 0; col < row_size; ++col) + { + diff = input[col] - max; + + if (diff >= diff_min) + { + const int32_t res = + DIV_POW2(MUL_SAT(shifted_scale, EXP_ON_NEG(MUL_SAT(diff * mask, mult))), bits_over_unit) + + NN_Q15_MIN; + output_s16[col] = (int16_t)CLAMP(res, (int32_t)NN_Q15_MAX, (int32_t)NN_Q15_MIN); + } + else + { + output_s16[col] = NN_Q15_MIN; + } + } + } + else + { +#if EI_TFLITE_DISABLE_SOFTMAX_IN_I8 + return; +#endif + int8_t *output_s8 = (int8_t *)output + row_idx * row_size; + + bits_over_unit = ACCUM_BITS - headroom + 23; + + for (col = 0; col < row_size; ++col) + { + diff = input[col] - max; + if (diff >= diff_min) + { + const int32_t res = + DIV_POW2(MUL_SAT(shifted_scale, EXP_ON_NEG(MUL_SAT(diff * mask, mult))), bits_over_unit) + + NN_Q7_MIN; + output_s8[col] = (int8_t)CLAMP(res, (int32_t)NN_Q7_MAX, (int32_t)NN_Q7_MIN); + } + else + { + output_s8[col] = NN_Q7_MIN; + } + } + } + + input += row_size; + } +} + +/** + * @} end of NNBasicMath group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_q15.c b/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_q15.c index 559ca5f..550c111 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_q15.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_q15.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2018 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2018, 2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_softmax_q15.c * Description: Q15 softmax function * - * $Date: 09. October 2020 - * $Revision: V.1.0.1 + * $Date: 4 Aug 2022 + * $Revision: V.1.0.2 * * Target Processor: Cortex-M cores * @@ -41,13 +41,9 @@ * @{ */ -/** - * @brief Q15 softmax function - * @param[in] vec_in pointer to input vector - * @param[in] dim_vec input vector dimention - * @param[out] p_out pointer to output vector +/* + * Q15 softmax function * - * @details * * Here, instead of typical e based softmax, we use * 2-based softmax, i.e.,: diff --git a/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_q7.c b/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_q7.c index 7894d47..bb37660 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_q7.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_q7.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2020, 2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_softmax_q7.c * Description: Q7 softmax function * - * $Date: 09. October 2020 - * $Revision: V.1.0.2 + * $Date: 4 Aug 2022 + * $Revision: V.1.0.3 * * Target Processor: Cortex-M cores * @@ -41,13 +41,8 @@ * @{ */ -/** - * @brief Q7 softmax function - * @param[in] vec_in pointer to input vector - * @param[in] dim_vec input vector dimention - * @param[out] p_out pointer to output vector - * - * @details +/* + * Q7 softmax function * * Here, instead of typical natural logarithm e based softmax, we use * 2-based softmax here, i.e.,: diff --git a/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_s16.c b/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_s16.c new file mode 100644 index 0000000..be45eae --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_s16.c @@ -0,0 +1,126 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * Copyright (C) 2022 Arm Limited or its affiliates. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_softmax_s16.c + * Description: S16 softmax function + * + * $Date: 19 April 2022 + * $Revision: V.2.0.0 + * + * Target Processor: Cortex-M cores + * + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" + +/** + * @addtogroup Softmax + * @{ + */ + +arm_cmsis_nn_status arm_softmax_s16(const int16_t *input, + const int32_t num_rows, + const int32_t row_size, + const int32_t mult, + const int32_t shift, + const cmsis_nn_softmax_lut_s16 *softmax_params, + int16_t *output) +{ + int32_t col = 0; + int32_t row_idx; + + if (softmax_params->exp_lut == NULL || softmax_params->one_by_one_lut == NULL) + { + return ARM_CMSIS_NN_ARG_ERROR; + } + + for (row_idx = 0; row_idx < num_rows; ++row_idx) + { + // Find the maximum value in order to ensure numerical stability + int16_t max = *input; + for (col = 1; col < row_size; ++col) + { + max = MAX(max, input[col]); + } + + int32_t diff = 0; + int32_t sum = 0; + int16_t *cached_exp_results = output; + + for (col = 0; col < row_size; ++col) + { + diff = input[col] - max; + const int32_t scaled_diff = arm_nn_requantize(diff, mult, shift); + const int32_t symmetric_scaled_diff = scaled_diff + NN_Q15_MAX; + const int16_t saturated_symmetric_scaled_diff = MIN(MAX(symmetric_scaled_diff, NN_Q15_MIN), NN_Q15_MAX); + + // Lookup from exp table and cache result for next step + const int16_t index = (256 + (saturated_symmetric_scaled_diff >> 7)); + const int16_t offset = saturated_symmetric_scaled_diff & 0x7f; + const int16_t base = softmax_params->exp_lut[index]; + const int16_t slope = softmax_params->exp_lut[index + 1] - softmax_params->exp_lut[index]; + const int16_t delta = (slope * offset + 64) >> 7; + const int16_t result = (base + delta); + cached_exp_results[col] = result; + + sum += cached_exp_results[col]; + } + + const int32_t headroom = __CLZ(sum); + + // Compute the reciprocal 1/sum + const int32_t shifted_sum = (((sum) << (headroom - 1)) + (1 << 13)) >> 14; + + // Since LUT computes 1/(1 + x), compute x = (sum - 1) => -65536 + // Since LUT expects a symmetrical input, recenter from [UINT16_MIN, UINT16_MAX] to [INT16_MIN, INT16_MAX] => + // -32768 ==> So in total -65536 -32768 => -98304 + const int16_t symmetric_shifted_sum = shifted_sum - 98304; + + // Lookup from one by one table + const int16_t index = (256 + (symmetric_shifted_sum >> 7)); + const int16_t offset = symmetric_shifted_sum & 0x7f; + const int16_t base = softmax_params->one_by_one_lut[index]; + const int16_t slope = softmax_params->one_by_one_lut[index + 1] - softmax_params->one_by_one_lut[index]; + const int16_t delta = (slope * offset + 64) >> 7; + const int16_t one_by_one_result = (base + delta); + + for (col = 0; col < row_size; ++col) + { + const int16_t right_shift = 30 - headroom; + int32_t result = (cached_exp_results[col] * one_by_one_result) >> right_shift; + result = (result + 1) >> 1; // Last shift position and insert round + output[col] = (int16_t)result; + } + + output += row_size; + input += row_size; + } + + return ARM_CMSIS_NN_SUCCESS; +} + +/** + * @} end of Softmax group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_s8.c b/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_s8.c index d017d1b..2de8707 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_s8.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_s8.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved. + * Copyright (C) 2010-2022 Arm Limited or its affiliates. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_softmax_s8.c * Description: S8 softmax function * - * $Date: 09. October 2020 - * $Revision: V.2.0.1 + * $Date: 9 March 2022 + * $Revision: V.2.1.0 * * Target Processor: Cortex-M cores * @@ -71,7 +71,7 @@ static int32x4_t arm_exp_on_negative_values_mve_32x4(int32x4_t val) mve_pred16_t p = vcmpeqq_n_s32(val, 0); mask = vmvnq_m_s32(vdupq_n_s32(0), vdupq_n_s32(0), p); - result = SELECT_USING_MASK(mask, vdupq_n_s32(Q31_MAX), result); + result = SELECT_USING_MASK(mask, vdupq_n_s32(NN_Q31_MAX), result); return result; } #endif @@ -95,8 +95,8 @@ void arm_softmax_s8(const int8_t *input, { #ifdef ARM_MATH_MVEI -#define ACT_MIN ((int8_t)Q7_MIN) -#define ACT_MAX ((int8_t)Q7_MAX) +#define ACT_MIN ((int8_t)NN_Q7_MIN) +#define ACT_MAX ((int8_t)NN_Q7_MAX) const int32_t mask = (1 << shift); @@ -151,7 +151,7 @@ void arm_softmax_s8(const int8_t *input, const int32_t headroom = __CLZ((uint32_t)sum); const int32_t bits_over_unit = ACCUM_BITS - headroom + 23; - const int32_t shifted_scale = ONE_OVER1((sum << headroom) - (1 << 31)); + const int32_t shifted_scale = ONE_OVER1((sum > 0 ? sum << headroom : 0) - (1 << 31)); vec_count = row_size / 4; idx = 0; @@ -194,7 +194,8 @@ void arm_softmax_s8(const int8_t *input, if (diff >= diff_min) { const int32_t res = - DIV_POW2(MUL_SAT(shifted_scale, EXP_ON_NEG(MUL_SAT(diff * mask, mult))), bits_over_unit) - 128; + DIV_POW2(MUL_SAT(shifted_scale, EXP_ON_NEG(MUL_SAT(diff * mask, mult))), bits_over_unit) + + NN_Q7_MIN; output[tail_idx + i] = (int8_t)CLAMP(res, (int32_t)ACT_MAX, (int32_t)ACT_MIN); } else @@ -207,57 +208,10 @@ void arm_softmax_s8(const int8_t *input, output += row_size; } #else - const int32_t mask = (1 << shift); - - int32_t col = 0; - int32_t row_idx; - - for (row_idx = 0; row_idx < num_rows; ++row_idx) - { - // Find the maximum value in order to ensure numerical stability - int8_t max = *input; - - for (col = 1; col < row_size; ++col) - { - max = MAX(max, input[col]); - } - - int32_t diff = 0; - int32_t sum = 0; - - for (col = 0; col < row_size; ++col) - { - diff = input[col] - max; - if (diff >= diff_min) - { - sum += DIV_POW2(EXP_ON_NEG(MUL_SAT(diff * mask, mult)), ACCUM_BITS); - } - } - - const int32_t headroom = __CLZ(sum); - const int32_t bits_over_unit = ACCUM_BITS - headroom + 23; - const int32_t shifted_scale = ONE_OVER1((sum << headroom) - (1 << 31)); - - for (col = 0; col < row_size; ++col) - { - diff = input[col] - max; - if (diff >= diff_min) - { - const int32_t res = - DIV_POW2(MUL_SAT(shifted_scale, EXP_ON_NEG(MUL_SAT(diff * mask, mult))), bits_over_unit) - 128; - output[col] = (int8_t)CLAMP(res, (int32_t)127, (int32_t)-128); - } - else - { - output[col] = -128; - } - } - input += row_size; - output += row_size; - } - + arm_nn_softmax_common_s8(input, num_rows, row_size, mult, shift, diff_min, false, (void *)output); #endif } + /** * @} end of Softmax group */ diff --git a/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_s8_s16.c b/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_s8_s16.c new file mode 100644 index 0000000..a6eb67a --- /dev/null +++ b/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_s8_s16.c @@ -0,0 +1,59 @@ +#include "edge-impulse-sdk/classifier/ei_classifier_config.h" +#if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES +/* + * Copyright (C) 2022 Arm Limited or its affiliates. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------- + * Project: CMSIS NN Library + * Title: arm_softmax_s8_s16.c + * Description: S8 to s16 softmax function + * + * $Date: 7 January 2022 + * $Revision: V.1.0.0 + * + * Target Processor: Cortex-M cores + * + * -------------------------------------------------------------------- */ + +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnfunctions.h" +#include "edge-impulse-sdk/CMSIS/NN/Include/arm_nnsupportfunctions.h" + +/** + * @ingroup groupNN + */ + +/** + * @addtogroup Softmax + * @{ + */ + +void arm_softmax_s8_s16(const int8_t *input, + const int32_t num_rows, + const int32_t row_size, + const int32_t mult, + const int32_t shift, + const int32_t diff_min, + int16_t *output) +{ + arm_nn_softmax_common_s8(input, num_rows, row_size, mult, shift, diff_min, true, (void *)output); +} +/** + * @} end of Softmax group + */ + +#endif // EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES diff --git a/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_with_batch_q7.c b/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_with_batch_q7.c index e6691e5..25220fe 100644 --- a/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_with_batch_q7.c +++ b/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_with_batch_q7.c @@ -1,7 +1,7 @@ #include "edge-impulse-sdk/classifier/ei_classifier_config.h" #if EI_CLASSIFIER_TFLITE_LOAD_CMSIS_NN_SOURCES /* - * Copyright (C) 2010-2019 Arm Limited or its affiliates. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2010-2019, 2022 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -23,8 +23,8 @@ * Title: arm_softmax_with_batch_q7.c * Description: Q7 softmax function * - * $Date: 09. October 2020 - * $Revision: V.1.0.1 + * $Date: 4 Aug 2022 + * $Revision: V.1.0.2 * * Target Processor: Cortex-M and Cortex-A cores * @@ -41,14 +41,10 @@ * @{ */ -/** - * @brief Q7 softmax function with batch parameter - * @param[in] vec_in pointer to input vector - * @param[in] nb_batches number of batches - * @param[in] dim_vec input vector dimention - * @param[out] p_out pointer to output vector +/* + * Q7 softmax function with batch parameter * - * @details + * details * * Here, instead of typical natural logarithm e based softmax, we use * 2-based softmax here, i.e.,: diff --git a/edge-impulse-sdk/Doxyfile b/edge-impulse-sdk/Doxyfile new file mode 100644 index 0000000..98b3852 --- /dev/null +++ b/edge-impulse-sdk/Doxyfile @@ -0,0 +1,2582 @@ +# Doxyfile 1.8.17 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "Edge Impulse C++ SDK" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc/doxygen/ + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all generated output in the proper direction. +# Possible values are: None, LTR, RTL and Context. +# The default value is: None. + +OUTPUT_TEXT_DIRECTION = None + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. +# When you need a literal { or } or , in the value part of an alias you have to +# escape them by means of a backslash (\), this can lead to conflicts with the +# commands \{ and \} for these it is advised to use the version @{ and @} or use +# a double escape (\\{ and \\}) + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, +# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is +# Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the +# documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# (including Cygwin) ands Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. If +# EXTRACT_ALL is set to YES then this flag will automatically be disabled. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = classifier/ \ + dsp/ \ + porting/ + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), +# *.doc (to be provided as doxygen C comment), *.txt (to be provided as doxygen +# C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f, *.for, *.tcl, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.doc \ + *.txt \ + *.py \ + *.pyw \ + *.f90 \ + *.f95 \ + *.f03 \ + *.f08 \ + *.f \ + *.for \ + *.tcl \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf \ + *.ice + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files +# were built. This is equivalent to specifying the "-p" option to a clang tool, +# such as clang-check. These options will then be passed to the parser. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. + +CLANG_DATABASE_PATH = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = NO + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: https://developer.apple.com/xcode/), introduced with OSX +# 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/ + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /