ir_to_mesa: "Support" u2f, i2u, and u2i operations by doing nothing.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 15 Jun 2011 04:41:10 +0000 (21:41 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 29 Jun 2011 23:07:12 +0000 (16:07 -0700)
Mesa IR actually stores all numbers as floating point, so this is
totally a farce, but we may as well keep it going.

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/mesa/program/ir_to_mesa.cpp

index 00869979dd87e2a8945ef60cc430d234e0208ce3..67adb8f3dcd4999314fdd0cf12b0a2e13c9fc1eb 100644 (file)
@@ -1296,8 +1296,11 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
       emit_scalar(ir, OPCODE_RSQ, result_dst, op[0]);
       break;
    case ir_unop_i2f:
+   case ir_unop_u2f:
    case ir_unop_b2f:
    case ir_unop_b2i:
+   case ir_unop_i2u:
+   case ir_unop_u2i:
       /* Mesa IR lacks types, ints are stored as truncated floats. */
       result_src = op[0];
       break;
@@ -1335,7 +1338,6 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
       break;
 
    case ir_unop_bit_not:
-   case ir_unop_u2f:
    case ir_binop_lshift:
    case ir_binop_rshift:
    case ir_binop_bit_and: