From: Christian Gmeiner Date: Thu, 27 Jul 2023 10:12:08 +0000 (+0200) Subject: etnaviv: switch to log2f(..) X-Git-Tag: upstream/23.3.3~3370 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=16915c7a71eb8ffd1043a495bf5f88344b3854ea;p=platform%2Fupstream%2Fmesa.git etnaviv: switch to log2f(..) Drop our custom calculation of the logarithm base 2 and switch to log2f(..). Signed-off-by: Christian Gmeiner Reviewed-by: Lucas Stach Part-of: --- diff --git a/src/gallium/drivers/etnaviv/etnaviv_util.h b/src/gallium/drivers/etnaviv/etnaviv_util.h index 48b1e7d..5caf17e 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_util.h +++ b/src/gallium/drivers/etnaviv/etnaviv_util.h @@ -43,9 +43,6 @@ etna_cfloat_to_uint8(float f) return f * 256.0f; } -/* 1/log10(2) */ -#define RCPLOG2 (1.4426950408889634f) - /* float to fixp 5.5 */ static inline uint32_t etna_float_to_fixp55(float f) @@ -76,14 +73,14 @@ etna_float_to_fixp88(float f) static inline uint32_t etna_log2_fixp55(unsigned width) { - return etna_float_to_fixp55(logf((float)width) * RCPLOG2); + return etna_float_to_fixp55(log2f((float)width)); } /* texture size to log2 in fixp 8.8 format */ static inline uint32_t etna_log2_fixp88(unsigned width) { - return etna_float_to_fixp88(logf((float)width) * RCPLOG2); + return etna_float_to_fixp88(log2f((float)width)); } /* float to fixp 16.16 */