From 9db4e8ee65e80f314351c3478c96a7ed4f7d5da8 Mon Sep 17 00:00:00 2001 From: skipper123123 <123skipper123@mail.ru> Date: Wed, 16 Sep 2026 18:07:26 +0300 Subject: [PATCH] Add missing macro for __builtin_clzll function --- Drivers/CMSIS/Core/Include/cmsis_armclang.h | 10 +++++++++- Drivers/CMSIS/Core/Include/cmsis_gcc.h | 10 +++++++++- Drivers/CMSIS/Core_A/Include/cmsis_armclang.h | 13 +++++++++++-- Drivers/CMSIS/Core_A/Include/cmsis_gcc.h | 13 +++++++++++-- Drivers/CMSIS/Include/cmsis_armclang.h | 10 +++++++++- Drivers/CMSIS/Include/cmsis_gcc.h | 10 +++++++++- 6 files changed, 58 insertions(+), 8 deletions(-) diff --git a/Drivers/CMSIS/Core/Include/cmsis_armclang.h b/Drivers/CMSIS/Core/Include/cmsis_armclang.h index 162a400ea..a6f394e4b 100644 --- a/Drivers/CMSIS/Core/Include/cmsis_armclang.h +++ b/Drivers/CMSIS/Core/Include/cmsis_armclang.h @@ -903,13 +903,21 @@ __STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) #define __RBIT __builtin_arm_rbit /** - \brief Count leading zeros + \brief Count leading zeros for the unsigned int type. \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 */ #define __CLZ (uint8_t)__builtin_clz +/** + \brief Count leading zeros for the unsigned long long type. + \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 + */ +#define __CLZLL (uint8_t)__builtin_clzll + #if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ diff --git a/Drivers/CMSIS/Core/Include/cmsis_gcc.h b/Drivers/CMSIS/Core/Include/cmsis_gcc.h index 2d9db15a5..f7f70667f 100644 --- a/Drivers/CMSIS/Core/Include/cmsis_gcc.h +++ b/Drivers/CMSIS/Core/Include/cmsis_gcc.h @@ -1003,13 +1003,21 @@ __STATIC_FORCEINLINE uint32_t __RBIT(uint32_t value) /** - \brief Count leading zeros + \brief Count leading zeros for the unsigned int type. \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 */ #define __CLZ (uint8_t)__builtin_clz +/** + \brief Count leading zeros for the unsigned long long type. + \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 + */ +#define __CLZLL (uint8_t)__builtin_clzll + #if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ diff --git a/Drivers/CMSIS/Core_A/Include/cmsis_armclang.h b/Drivers/CMSIS/Core_A/Include/cmsis_armclang.h index 5883364c3..55e203a79 100644 --- a/Drivers/CMSIS/Core_A/Include/cmsis_armclang.h +++ b/Drivers/CMSIS/Core_A/Include/cmsis_armclang.h @@ -210,11 +210,20 @@ __STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) #define __RBIT __builtin_arm_rbit /** - \brief Count leading zeros + \brief Count leading zeros for the unsigned int type. + \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 */ -#define __CLZ (uint8_t)__builtin_clz +#define __CLZ (uint8_t)__builtin_clz + +/** + \brief Count leading zeros for the unsigned long long type. + \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 + */ +#define __CLZLL (uint8_t)__builtin_clzll /** \brief LDR Exclusive (8 bit) diff --git a/Drivers/CMSIS/Core_A/Include/cmsis_gcc.h b/Drivers/CMSIS/Core_A/Include/cmsis_gcc.h index 4f464627a..4a4ca306a 100644 --- a/Drivers/CMSIS/Core_A/Include/cmsis_gcc.h +++ b/Drivers/CMSIS/Core_A/Include/cmsis_gcc.h @@ -263,11 +263,20 @@ __STATIC_FORCEINLINE uint32_t __RBIT(uint32_t value) } /** - \brief Count leading zeros + \brief Count leading zeros for the unsigned int type. + \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 */ -#define __CLZ (uint8_t)__builtin_clz +#define __CLZ (uint8_t)__builtin_clz + +/** + \brief Count leading zeros for the unsigned long long type. + \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 + */ +#define __CLZLL (uint8_t)__builtin_clzll /** \brief LDR Exclusive (8 bit) diff --git a/Drivers/CMSIS/Include/cmsis_armclang.h b/Drivers/CMSIS/Include/cmsis_armclang.h index 162a400ea..a6f394e4b 100644 --- a/Drivers/CMSIS/Include/cmsis_armclang.h +++ b/Drivers/CMSIS/Include/cmsis_armclang.h @@ -903,13 +903,21 @@ __STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) #define __RBIT __builtin_arm_rbit /** - \brief Count leading zeros + \brief Count leading zeros for the unsigned int type. \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 */ #define __CLZ (uint8_t)__builtin_clz +/** + \brief Count leading zeros for the unsigned long long type. + \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 + */ +#define __CLZLL (uint8_t)__builtin_clzll + #if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ diff --git a/Drivers/CMSIS/Include/cmsis_gcc.h b/Drivers/CMSIS/Include/cmsis_gcc.h index 2d9db15a5..f7f70667f 100644 --- a/Drivers/CMSIS/Include/cmsis_gcc.h +++ b/Drivers/CMSIS/Include/cmsis_gcc.h @@ -1003,13 +1003,21 @@ __STATIC_FORCEINLINE uint32_t __RBIT(uint32_t value) /** - \brief Count leading zeros + \brief Count leading zeros for the unsigned int type. \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 */ #define __CLZ (uint8_t)__builtin_clz +/** + \brief Count leading zeros for the unsigned long long type. + \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 + */ +#define __CLZLL (uint8_t)__builtin_clzll + #if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \