]> begriffs open source - cmsis/commit
Avoid __builtin_clz(0)
authorKevin Bracey <kevin.bracey@arm.com>
Thu, 20 Dec 2018 09:19:42 +0000 (11:19 +0200)
committerJonatan Antoni <jonatan.antoni@arm.com>
Mon, 7 Jan 2019 10:25:25 +0000 (11:25 +0100)
commit6d86504efa66da88fe982808469d14b456a10ab5
treec82c9cebdf24d2707ae57463108bc39aad20026c
parent7464127a1c9a522f8d14950e9c2b4849cdb067ae
Avoid __builtin_clz(0)

__builtin_clz(0) is specified as undefined behaviour, so ensure __CLZ
avoids it. Current ARM compilers eliminate the test for 0 at low
optimisation levels, leaving just the CLZ instruction.
CMSIS/Core/Include/cmsis_armclang.h
CMSIS/Core/Include/cmsis_armclang_ltm.h
CMSIS/Core/Include/cmsis_gcc.h
CMSIS/Core_A/Include/cmsis_armclang.h
CMSIS/Core_A/Include/cmsis_gcc.h