<div dir="ltr"><div><div>Hmm, I'm not sure this is totally correct. We actually ran into this back in June, and I believe the conclusion is that we should actually be using nextafterf/nextafter for calculating the tolerances for a given ulp.<br><br></div>See the email thread that started with my first patch here:<br><a href="http://lists.freedesktop.org/archives/piglit/2015-June/016238.html">http://lists.freedesktop.org/archives/piglit/2015-June/016238.html</a><br><br></div>--Aaron<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 15, 2015 at 8:37 AM, Zoltan Gilian <span dir="ltr"><<a href="mailto:zoltan.gilian@gmail.com" target="_blank">zoltan.gilian@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The uint ulp value is compared to the float diff instead of<br>
reinterpreting the ulp as float.<br>
---<br>
Note: I'm new to contributing to piglit, and I don't have commit access.<br>
tests/util/piglit-util-cl.c | 2 +-<br>
1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/tests/util/piglit-util-cl.c b/tests/util/piglit-util-cl.c<br>
index 47e0c7a..b49665a 100644<br>
--- a/tests/util/piglit-util-cl.c<br>
+++ b/tests/util/piglit-util-cl.c<br>
@@ -80,7 +80,7 @@ piglit_cl_probe_floating(float value, float expect, uint32_t ulp)<br>
<br>
diff = fabsf(value - expect);<br>
<br>
- if(diff > ulp || isnan(value)) {<br>
+ if(diff > t.f || isnan(value)) {<br>
printf("Expecting %f (0x%x) with tolerance %f (%u ulps), but got %f (0x%x)\n",<br>
e.f, e.u, t.f, t.u, v.f, v.u);<br>
return false;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.4.6<br>
<br>
_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</font></span></blockquote></div><br></div>