Commit Graph

8 Commits

Author SHA1 Message Date
Michal Krol f447eea4de util: Add log2() definition for MSC. 2008-11-12 17:14:07 +01:00
Brian 325cbeb29a 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.

--------

Cherry-picked from gallium-0.2: 8415d06d90

This fixes some pow() glitches seen in fslight.c, spectex.c, etc.

Conflicts:
       src/gallium/auxiliary/util/u_math.h
2008-11-09 10:17:43 -07:00
José Fonseca 451888ee8f util: Add missing p_debug.h include. 2008-09-18 23:23:02 +09:00
Brian Paul 75c19eb5a1 gallium: add another value check to util_fast_pow()
Fixes glitches seen in morph3d demo.
2008-09-13 15:22:52 -06:00
Brian Paul 4f25420bdd gallium: refactor/replace p_util.h with util/u_memory.h and util/u_math.h
Also, rename p_tile.[ch] to u_tile.[ch]
2008-08-24 17:48:55 -06:00
Brian Paul f9c04d55d0 gallium: insert __cplusplus/extern wrappings 2008-08-22 15:53:28 -06:00
Brian Paul a22bdd42d7 gallium: move math macros from p_util.h to u_math.h
More can be done...
2008-08-22 15:51:38 -06:00
Brian Paul 9e2b867b3f gallium: new u_math.[ch] files for math functions
So far, optimized/low-precision versions of exp(), exp2(), log2(), pow().
2008-08-22 15:13:47 -06:00