glsl: Add ir_unop_i2u and ir_unop_u2i operations.
authorBryan Cain <bryancain3@gmail.com>
Wed, 15 Jun 2011 06:34:11 +0000 (23:34 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 29 Jun 2011 23:07:12 +0000 (16:07 -0700)
commit20ef96c7ff3f17fbf97e0452a37553249b2b005c
tree7ee422b49092e7e0fc48ecf3e90c38ccd0a4fe10
parent4f799e614264d2409fd32e3e3992405bb3fd924f
glsl: Add ir_unop_i2u and ir_unop_u2i operations.

These are necessary to handle int/uint constructor conversions.  For
example, the following code currently results in a type mismatch:

int x = 7;
uint y = uint(x);

In particular, uint(x) still has type int.

This commit simply adds the new operations; it does not generate them,
nor does it add backend support for them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/ir.cpp
src/glsl/ir.h
src/glsl/ir_constant_expression.cpp
src/glsl/ir_validate.cpp