<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Glyphy demo throws unhandled Integer division by zero exception"
href="https://bugs.freedesktop.org/show_bug.cgi?id=83570#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Glyphy demo throws unhandled Integer division by zero exception"
href="https://bugs.freedesktop.org/show_bug.cgi?id=83570">bug 83570</a>
from <span class="vcard"><a class="email" href="mailto:rconde01@hotmail.com" title="rconde01@hotmail.com">rconde01@hotmail.com</a>
</span></b>
<pre>I haven't really gotten a grasp on the code base, but my assessment is that the
issue is:
tgsi_exec.c
static void
micro_idiv(union tgsi_exec_channel *dst,
const union tgsi_exec_channel *src0,
const union tgsi_exec_channel *src1)
{
dst->i[0] = src0->i[0] / src1->i[0];
dst->i[1] = src0->i[1] / src1->i[1];
dst->i[2] = src0->i[2] / src1->i[2];
dst->i[3] = src0->i[3] / src1->i[3];
}
Section 4.1.3 of the 4.40 spec says:
"Division and multiplication operations resulting in overflow or underflow will
not cause any exception but will result in an undefined value."
Therefore I believe it should be changed to:
static void
micro_idiv(union tgsi_exec_channel *dst,
const union tgsi_exec_channel *src0,
const union tgsi_exec_channel *src1)
{
dst->i[0] = src1->i[0] != 0 ? src0->i[0] / src1->i[0] : 0;
dst->i[1] = src1->i[1] != 0 ? src0->i[1] / src1->i[1] : 0;
dst->i[2] = src1->i[2] != 0 ? src0->i[2] / src1->i[2] : 0;
dst->i[3] = src1->i[3] != 0 ? src0->i[3] / src1->i[3] : 0;
}
I've confirmed that this fixes my particular issue.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>