diff options
author | Roland Scheidegger <[email protected]> | 2013-07-11 23:15:44 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2013-07-13 18:42:17 +0200 |
commit | 9b8d97e5bf76219e84e4f4e9c90c16a543eb837d (patch) | |
tree | 19a50aa27f05b4fa8cd762656cb0eea6016ea401 /src/gallium/auxiliary/gallivm/lp_bld_arit.h | |
parent | 45574ab2e92f0bf74b18448baff49cb2eb5db620 (diff) |
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 <[email protected]>
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_arit.h')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_arit.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.h b/src/gallium/auxiliary/gallivm/lp_bld_arit.h index 966796c3c4d..920e339cda5 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.h @@ -231,6 +231,13 @@ LLVMValueRef lp_build_rsqrt(struct lp_build_context *bld, LLVMValueRef a); +boolean +lp_build_fast_rsqrt_available(struct lp_type type); + +LLVMValueRef +lp_build_fast_rsqrt(struct lp_build_context *bld, + LLVMValueRef a); + LLVMValueRef lp_build_cos(struct lp_build_context *bld, LLVMValueRef a); |