gallivm: Fix lp_build_sgn for normalized/fixed-point integers.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Tue, 15 May 2012 21:36:09 +0000 (22:36 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Tue, 15 May 2012 21:39:24 +0000 (22:39 +0100)
These types got broken with the recent commit that fixed lp_build_sgn
for negative integers.

src/gallium/auxiliary/gallivm/lp_bld_arit.c

index 3a74790e89f580c79b6ecb5d615ddd90d680ec32..d112f1a59b4d1f7dd7f00be3ffae834ef5a22dcb 100644 (file)
@@ -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);
    }