summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2014-09-23 19:29:33 +0200
committerEmil Velikov <emil.l.velikov@gmail.com>2014-09-27 16:04:03 +0100
commit08923a1029522f5015f09205e997c4cef4461d99 (patch)
tree5feda51ad30498466d796420f6037dbd4e95a4a9 /src/gallium/auxiliary
parentfc8fc3bfc8713164207b694164375ead4240708a (diff)
gallivm: fix idiv
ffeb77c7b0552a8624e46e65d6347240ac5ae84d had a typo which turned all signed integer divisions into unsigned ones. Oops. This gets us back the 51 little piglits (all from glsl built-in-functions, fs/vs/gs-op-div-int-ivec2 and similar). Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> Reviewed-by: Jose Fonseca <jfonseca@vmware.com> (cherry picked from commit 5e1fcc625824ae962d5f658e151e6bc2665adce8)
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c
index 4a9bc1f0ebe..722aa9a137d 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c
@@ -1252,18 +1252,16 @@ idiv_emit_cpu(
LLVMValueRef div_mask = lp_build_cmp(&bld_base->uint_bld,
PIPE_FUNC_EQUAL, emit_data->args[1],
bld_base->uint_bld.zero);
- /* We want to make sure that we never divide/mod by zero to not
- * generate sigfpe. We don't want to crash just because the
+ /* We want to make sure that we never divide/mod by zero to not
+ * generate sigfpe. We don't want to crash just because the
* shader is doing something weird. */
LLVMValueRef divisor = LLVMBuildOr(builder,
div_mask,
emit_data->args[1], "");
- LLVMValueRef result = lp_build_div(&bld_base->uint_bld,
+ LLVMValueRef result = lp_build_div(&bld_base->int_bld,
emit_data->args[0], divisor);
-
LLVMValueRef not_div_mask = LLVMBuildNot(builder,
div_mask,"");
-
/* idiv by zero doesn't have a guaranteed return value chose 0 for now. */
emit_data->output[emit_data->chan] = LLVMBuildAnd(builder,
not_div_mask,
@@ -1693,8 +1691,8 @@ udiv_emit_cpu(
LLVMValueRef div_mask = lp_build_cmp(&bld_base->uint_bld,
PIPE_FUNC_EQUAL, emit_data->args[1],
bld_base->uint_bld.zero);
- /* We want to make sure that we never divide/mod by zero to not
- * generate sigfpe. We don't want to crash just because the
+ /* We want to make sure that we never divide/mod by zero to not
+ * generate sigfpe. We don't want to crash just because the
* shader is doing something weird. */
LLVMValueRef divisor = LLVMBuildOr(builder,
div_mask,