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
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev