[Mesa-dev] [Bug 59701] lp_test_arit fails on non-sse41 capable machines, breaking make check

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Jan 22 11:28:07 PST 2013


--- Comment #3 from Roland Scheidegger <sroland at vmware.com> ---
I'm wondering if something like this (in horrible pseudo-code) would be a
solution (for ifloor):
xtruncint = fptoint(x)
xtrunc = inttofp(xtruncint)
mask = xtrunc > x
maskone = mask & 1
xintfloor = xtruncint - maskone;

I think this might work for all values as long as they don't exceed integer
range, including negative zero as long as cmp(negzero, poszero) equals true
which I think it should. It has also similar complexity as what we're doing
For floor() if you'd also want it to work with huge exponents I think you'd
need to additionally compare the original number (with masked out sign bit)
with 2^24 and if it's larger just use the original value (which will already
represent an exact integer in this case) using some select (given that you
didn't have round in the first place meaning another and/andnot/or).
For NaNs etc. the results will probably remain pretty unpredictable unless you
check for those as well but that's probably getting silly.
Honestly I don't know if it's worth fixing this.

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/20130122/f3f3b868/attachment-0001.html>

More information about the mesa-dev mailing list