OSDN Git Service

gallivm: Fixed overflow in lp_build_clamped_float_to_unsigned_norm.
authorJames Benton <jbenton@vmware.com>
Fri, 18 May 2012 15:01:25 +0000 (16:01 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 21 May 2012 19:24:44 +0000 (20:24 +0100)
Tested with lp_test_conv and lp_test_format, reduced errors.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_conv.c

index 8a08663..f0ef516 100644 (file)
@@ -190,7 +190,7 @@ lp_build_clamped_float_to_unsigned_norm(struct gallivm_state *gallivm,
       /*
        * Align the most significant bit to the right.
        */
-      rshifted =  LLVMBuildAShr(builder, res,
+      rshifted =  LLVMBuildLShr(builder, res,
                                 lp_build_const_int_vec(gallivm, src_type, rshift),
                                 "");