From 9fb4eef6a159fb5af97694b15a5f9b5998e9f6e5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Tue, 15 May 2012 22:36:09 +0100 Subject: [PATCH] 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. --- src/gallium/auxiliary/gallivm/lp_bld_arit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- 2.30.2