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 8a0866312499151ec7995300e4386fdfab41ac97..f0ef5167351433ca78999024e3589362224c840f 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),
                                 "");