Am 21.07.2014 17:53, schrieb Richard Sandiford: > Fallback cases in lp_bld_arit.c used 2^24 to mean "2 to the power 24", > but in C it's "2 xor 24", i.e. 26. Fixed by using 1<< instead. > > Signed-off-by: Richard Sandiford <rsand...@linux.vnet.ibm.com> > --- > src/gallium/auxiliary/gallivm/lp_bld_arit.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c > b/src/gallium/auxiliary/gallivm/lp_bld_arit.c > index 82ddb5a..a7a88ed 100644 > --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c > +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c > @@ -1872,7 +1872,7 @@ lp_build_trunc(struct lp_build_context *bld, > const struct lp_type type = bld->type; > struct lp_type inttype; > struct lp_build_context intbld; > - LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 2^24); > + LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 1<<24); > LLVMValueRef trunc, res, anosign, mask; > LLVMTypeRef int_vec_type = bld->int_vec_type; > LLVMTypeRef vec_type = bld->vec_type; > @@ -1927,7 +1927,7 @@ lp_build_round(struct lp_build_context *bld, > const struct lp_type type = bld->type; > struct lp_type inttype; > struct lp_build_context intbld; > - LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 2^24); > + LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 1<<24); > LLVMValueRef res, anosign, mask; > LLVMTypeRef int_vec_type = bld->int_vec_type; > LLVMTypeRef vec_type = bld->vec_type; > @@ -1980,7 +1980,7 @@ lp_build_floor(struct lp_build_context *bld, > const struct lp_type type = bld->type; > struct lp_type inttype; > struct lp_build_context intbld; > - LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 2^24); > + LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 1<<24); > LLVMValueRef trunc, res, anosign, mask; > LLVMTypeRef int_vec_type = bld->int_vec_type; > LLVMTypeRef vec_type = bld->vec_type; > @@ -2049,7 +2049,7 @@ lp_build_ceil(struct lp_build_context *bld, > const struct lp_type type = bld->type; > struct lp_type inttype; > struct lp_build_context intbld; > - LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 2^24); > + LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 1<<24); > LLVMValueRef trunc, res, anosign, mask, tmp; > LLVMTypeRef int_vec_type = bld->int_vec_type; > LLVMTypeRef vec_type = bld->vec_type; >
Oops not sure what I was thinking when I wrote that. I guess when testing it passed lp_test_arit because there are actually no values between 26 and 2^24 which get tested, but in practice the results are probably pretty terrible... I think this should be candidate for stable. Reviewed-by: Roland Scheidegger <srol...@vmware.com> _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev