gallivm: better support for fast rsqrt
authorRoland Scheidegger <sroland@vmware.com>
Thu, 11 Jul 2013 21:15:44 +0000 (23:15 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Sat, 13 Jul 2013 16:42:17 +0000 (18:42 +0200)
commit9b8d97e5bf76219e84e4f4e9c90c16a543eb837d
tree19a50aa27f05b4fa8cd762656cb0eea6016ea401
parent45574ab2e92f0bf74b18448baff49cb2eb5db620
gallivm: better support for fast rsqrt

We had to disable fast rsqrt before because it wasn't precise enough etc.
However in situations when we know we're not going to need more precision
we can still use a fast rsqrt (which can be several times faster than
the quite expensive sqrt). Hence introduce a new helper which does exactly
that - it is probably not useful calling it in some situations if there's
no fast rsqrt available so make it queryable if it's available too.

v2: use fast_rsqrt consistently instead of rsqrt_fast, fix indentation,
let rsqrt use fast_rsqrt.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_arit.c
src/gallium/auxiliary/gallivm/lp_bld_arit.h