gallium/util: add fast half float conversion functions
authorLuca Barbieri <luca@luca-barbieri.com>
Wed, 24 Mar 2010 17:12:45 +0000 (18:12 +0100)
committerMichal Krol <michal@vmware.com>
Thu, 1 Apr 2010 11:33:07 +0000 (13:33 +0200)
commit3ff175d6de89ad92d167362355501f99d06f0f97
tree6332294693fc3581785927a9df6013aecf9aca22
parent110e039d0df08ae1642adf4bd20f07992b9ffe9c
gallium/util: add fast half float conversion functions

This adds a fast half float conversion facility to Gallium.

Mesa already contains such a facility, but using a much worse algorithm.

This one is an implementation of
www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf
and uses a branch-less algorithm with some lookup tables small enough
to fit in the L1 cache.

Ideally, Mesa should start using these functions too, but I'm not sure
how to arrange that with the current build system.

A new "u_gctors.cpp" is added that defines a global C++ constructor
allowing to initialize to conversion lookup tables at library init.
src/gallium/auxiliary/Makefile
src/gallium/auxiliary/util/u_gctors.cpp [new file with mode: 0644]
src/gallium/auxiliary/util/u_half.c [new file with mode: 0644]
src/gallium/auxiliary/util/u_half.h [new file with mode: 0644]