[Mesa-dev] [PATCH] Add an accelerated version of F_TO_I for x86_64

Kenneth Graunke kenneth at whitecape.org
Mon Jul 28 15:01:42 PDT 2014


On Monday, July 28, 2014 05:34:59 PM Roland Scheidegger wrote:
> Looking all good, though it got me thinking about these numerous
> float-to-int rounding functions in mesa in various places a bit more.
> There is, for instance, a _mesa_round_to_even() function, which claims
> that the c99 lrintf() and friends functions can't be used because the
> environment might use a different rounding mode. This is of course true
> though I wonder why it would matter there and not here for instance,
> since of course cvtss2si is affected by that as well.

_mesa_round_to_even() is currently only used by the GLSL compiler.

The GLSL compiler implements round() as round-to-even on the GPU, so we want to make sure that CPU-side constant expression evaluation rounds the same way.

I don't think other code needs to be as paranoid.

--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140728/c79cedeb/attachment.sig>


More information about the mesa-dev mailing list