math: Optimize the implementation of log2ceil and log2floor

and move common math funtions to math32.h:
div_round_up
div_round_closest
is_power_of_2
roundup_pow_of_two
rounddown_pow_of_two

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
This commit is contained in:
lipengfei28
2024-06-21 15:47:59 +08:00
committed by Alin Jerpelea
parent 4fd78583f7
commit ca39dc2e74
11 changed files with 90 additions and 192 deletions
-4
View File
@@ -43,10 +43,6 @@ CSRCS += lib_crc64.c lib_crc32.c lib_crc16.c lib_crc16ccitt.c lib_crc8.c
CSRCS += lib_crc8ccitt.c lib_crc8table.c lib_glob.c lib_execinfo.c
CSRCS += lib_ftok.c lib_err.c lib_instrument.c
# Add generic integer math functions
CSRCS += lib_log2ceil.c lib_log2floor.c
# Keyboard driver encoder/decoder
ifeq ($(CONFIG_LIBC_KBDCODEC),y)