Re: [Mesa-dev] [PATCH 1/3] glsl: Add support for constant expression evaluation on round(), roundEven().

2011-10-05 Thread Kenneth Graunke
On 10/04/2011 01:23 PM, Eric Anholt wrote: On Tue, 4 Oct 2011 04:42:55 +0200, Henri Verbeet hverb...@gmail.com wrote: On 4 October 2011 00:41, Eric Anholt e...@anholt.net wrote: They're both implemented the same in GLSL IR (since round() has undefined behavior for n + 0.5). The specification

[Mesa-dev] [PATCH 1/3] glsl: Add support for constant expression evaluation on round(), roundEven().

2011-10-03 Thread Eric Anholt
They're both implemented the same in GLSL IR (since round() has undefined behavior for n + 0.5). The specification of the C function in use here is a bit unclear: rint(3) says that nearbyint() is like rint() in that it uses the current rounding direction from fesetround(3). fesetround(3) says