https://bugs.freedesktop.org/show_bug.cgi?id=83570

--- Comment #1 from rcond...@hotmail.com ---
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to