summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2014-09-08 13:56:13 +0200
committerRoland Scheidegger <[email protected]>2014-09-09 01:44:08 +0200
commit08f13ff43950a732cf3e7693565e4277feccf2e4 (patch)
tree4e6e08aa52eee2ce7e0235f423ce398dc3b53fd4
parent51b52ea013e5b146130ab359ecd47bb076b787d0 (diff)
gallivm: (trivial) don't try to use rcp when the division 1/x is integer
This would just crash. Noticed by accident while checking int divisions by zero with a quickly hacked piglit test. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_arit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
index 8f3b5687752..f9c07998f28 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
@@ -1073,7 +1073,7 @@ lp_build_div(struct lp_build_context *bld,
if(a == bld->zero)
return bld->zero;
- if(a == bld->one)
+ if(a == bld->one && type.floating)
return lp_build_rcp(bld, b);
if(b == bld->zero)
return bld->undef;