From: José Fonseca Date: Wed, 20 Jul 2011 21:53:59 +0000 (-0700) Subject: gallivm: Add a note about log2 computation and denormalized numbers. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5161aff48af2fe0171be06fc727a000ad300fbd9;p=mesa.git gallivm: Add a note about log2 computation and denormalized numbers. --- 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) */