diff options
author | José Fonseca <[email protected]> | 2011-07-20 14:53:59 -0700 |
---|---|---|
committer | José Fonseca <[email protected]> | 2011-07-22 18:52:09 -0700 |
commit | 5161aff48af2fe0171be06fc727a000ad300fbd9 (patch) | |
tree | e3b2a6d94f8b91f571be0c1efb1a177b059f24f2 | |
parent | af82ff556cdd748f9f6b0d60d53afaaf369b1c5b (diff) |
gallivm: Add a note about log2 computation and denormalized numbers.
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_arit.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c index 0c075bafb2c..2be8598704e 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c @@ -2465,6 +2465,12 @@ lp_build_log2_approx(struct lp_build_context *bld, assert(type.floating && type.width == 32); + /* + * We don't explicitly handle denormalized numbers. They will yield a + * result in the neighbourhood of -127, which appears to be adequate + * enough. + */ + i = LLVMBuildBitCast(builder, x, int_vec_type, ""); /* exp = (float) exponent(x) */ |