diff --git a/CMSIS/Include/cmsis_gcc.h b/CMSIS/Include/cmsis_gcc.h index d868f2e..e826c66 100644 --- a/CMSIS/Include/cmsis_gcc.h +++ b/CMSIS/Include/cmsis_gcc.h @@ -335,11 +335,15 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FPSCR(void) __attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr) { #if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) +#ifdef __clang__ + __builtin_arm_set_fpscr(fpscr); +#else /* Empty asm statement works as a scheduling barrier */ __ASM volatile (""); __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc"); __ASM volatile (""); #endif +#endif } #endif /* (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) */ diff --git a/CMSIS/RTOS/RTX/INC/RTX_CM_lib.h b/CMSIS/RTOS/RTX/INC/RTX_CM_lib.h index 8bdc4b9..8ad7ffb 100644 --- a/CMSIS/RTOS/RTX/INC/RTX_CM_lib.h +++ b/CMSIS/RTOS/RTX/INC/RTX_CM_lib.h @@ -36,7 +36,9 @@ #pragma O3 #define __USED __attribute__((used)) #elif defined (__GNUC__) +#if !defined(__clang__) #pragma GCC optimize ("O3") +#endif #define __USED __attribute__((used)) #elif defined (__ICCARM__) #define __USED __root