diff options
author | Roland Scheidegger <[email protected]> | 2015-08-09 02:03:33 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2015-08-26 02:57:37 +0200 |
commit | 941346a80323c9419b70e3987b900a69ebb08fb4 (patch) | |
tree | 50d34b353c5cdb19cae1e0f79b25b4dca81574c3 /src/gallium/auxiliary/util/u_debug.c | |
parent | c1452983b44cc8ee238b8c7e2cfca1105c707487 (diff) |
gallium/auxiliary: optimize rgb9e5 helper a bit
This code (lifted straight from the extension) was doing things the most
inefficient way you could think of.
This drops some of the more expensive float operations, in particular
- int-cast floors (pointless, values always positive)
- 2 raised to (signed) integers (replace with simple exponent manipulation),
getting rid of a misguided comment in the process (implement with table...)
- float division (replace with mul of reverse of those exponents)
This is like 3 times faster (measured for float3_to_rgb9e5), though it depends
(e.g. llvm is clever enough to replace exp2 with ldexp whereas gcc is not,
division is not too bad on cpus with early-exit divs).
Note that keeping the double math for now (float x + 0.5), as the results may
otherwise differ.
Acked-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util/u_debug.c')
0 files changed, 0 insertions, 0 deletions