[Mesa-dev] [Bug 83570] Glyphy demo throws unhandled Integer division by zero exception
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Mon Sep 8 10:36:05 PDT 2014
https://bugs.freedesktop.org/show_bug.cgi?id=83570
--- Comment #10 from rconde01 at hotmail.com ---
Could be totally borked, but this is what I have at the moment:
if (type.floating) {
return LLVMBuildFDiv(builder, a, b, "");
}
else {
//The spec says divide by zero is undefined, but shouldn't throw an
exception
LLVMValueRef zeromask = lp_build_cmp(bld,
PIPE_FUNC_EQUAL,
b,
lp_build_zero(bld->gallivm,type));
if (type.sign) {
return lp_build_select(bld,
zeromask,
bld->undef,
LLVMBuildSDiv(builder, a, b, ""));
}
else {
return lp_build_select(bld,
zeromask,
bld->undef,
LLVMBuildUDiv(builder, a, b, ""));
}
}
I'll take a look at udiv_emit_cpu
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140908/164b3fb0/attachment-0001.html>
More information about the mesa-dev
mailing list