util: Fix util_fast_pow/exp2/log2.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 30 Sep 2008 16:13:40 +0000 (01:13 +0900)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 30 Sep 2008 16:13:40 +0000 (01:13 +0900)
commit8415d06d90a197e16554dab98d160334fd9f9f93
tree25d004929ecac18de0e4b8bf4180bb2b33ba45f7
parent5dc8e67078be8b8c42a809311debd275ac7d64a7
util: Fix util_fast_pow/exp2/log2.

- Use a lookup table for log2.

- Compute (float) (1 << ipart) by tweaking with the exponent directly to
avoid integer overflow and float conversion.

- Also table negative exponents to avoid float division and branching.

- Implement util_fast_exp as function of util_fast_exp2.
src/gallium/auxiliary/util/u_math.c
src/gallium/auxiliary/util/u_math.h