From: José Fonseca Date: Tue, 15 May 2012 21:36:09 +0000 (+0100) Subject: gallivm: Fix lp_build_sgn for normalized/fixed-point integers. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9fb4eef6a159fb5af97694b15a5f9b5998e9f6e5;p=mesa.git gallivm: Fix lp_build_sgn for normalized/fixed-point integers. These types got broken with the recent commit that fixed lp_build_sgn for negative integers. --- diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c index 3a74790e89f..d112f1a59b4 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c @@ -926,7 +926,8 @@ lp_build_sgn(struct lp_build_context *bld, } else { - LLVMValueRef minus_one = lp_build_const_int_vec(bld->gallivm, type, -1.0); + /* signed int/norm/fixed point */ + LLVMValueRef minus_one = lp_build_const_vec(bld->gallivm, type, -1.0); cond = lp_build_cmp(bld, PIPE_FUNC_GREATER, a, bld->zero); res = lp_build_select(bld, cond, bld->one, minus_one); }