avi_crak.videocrak

Proposal - add the __BIC function to the standard cmsis set.

Discussion created by avi_crak.videocrak on Feb 2, 2018
Latest reply on Feb 13, 2018 by avi_crak.videocrak

The GCC developers created many errors using the BIC command, which they decided to ban. In the standard cmsis, this definition is not. The BIC command does not have a syntactic analog of the C language, and it is not reversible. This creates certain difficulties in the automatic application of the GCC compiler. Although other compilers can apply BIC.

However, manual application always turns out to be correct.


Using the function saves one inversion command when data is reset via a mask. At the same time, you do not need to make a mask.

/// Bit operation, 1 in the mask resets the data __attribute__( ( always_inline ) ) static inline uint32_t __BIC (uint32_t data, uint32_t mask) {   uint32_t result;   asm volatile ("bic %0, %1, %2" : "=l" (result) : "l" (data), "l" (mask) );   return(result); }

Proposal - add the __BIC function to the standard cmsis set.

Outcomes