On Mon, 30 Apr 2012 13:19:05 +0200, Olivier Galibert <galib...@pobox.com> wrote:
> This patch expects to be applied after the "Constants through builtins
> evaluation rewrite" for two reasons:
> - a line of that patch appears in the context
> - the ir_function side changes that the old method would need are not
>   present (and they would conflict)
> 
> At that point a "test_out = floatBitsToUint(-1.0);" fired through the
> glsl compiler gives a correct "(assign (x) (var_ref test_out)
> (constant uint (3212836864)))"

> 
> Signed-off-by: Olivier Galibert <galib...@pobox.com>
> ---
>  src/glsl/ir_constant_expression.cpp |   47 
> +++++++++++++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)
> 
> diff --git a/src/glsl/ir_constant_expression.cpp 
> b/src/glsl/ir_constant_expression.cpp
> index a7aafaa..5e6c164 100644
> --- a/src/glsl/ir_constant_expression.cpp
> +++ b/src/glsl/ir_constant_expression.cpp
> @@ -71,6 +71,29 @@ dot(ir_constant *op0, ir_constant *op1)
>     return result;
>  }
>  
> +/* This method is the only one supported by gcc.  Unions in particular
> + * are iffy, and read-through-converted-pointer is killed by strict
> + * aliasing.  OTOH, the compiler sees through the memcpy, so the
> + * resulting asm is reasonable.
> + */

While the compiler guys may wish we didn't do the union trick, we (and
projects all over) rely on the union trick to keep working.

That said, I'm not opposed to doing it the memcmp way.

Other than the little nitpick on patch 1, patches 1-5 are:

Reviewed-by: Eric Anholt <e...@anholt.net>

Attachment: pgp0EE6N2OXRZ.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to