i965/vs: Add support for bit-shift operations.
authorEric Anholt <eric@anholt.net>
Tue, 27 Sep 2011 21:48:56 +0000 (14:48 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 28 Sep 2011 19:09:09 +0000 (12:09 -0700)
Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp

index e5eda2210445489a94c04c967ae4c3c35835a534..98ecd251ddfd1954766ab1c5dd3c2f32801accf7 100644 (file)
@@ -1254,8 +1254,14 @@ vec4_visitor::visit(ir_expression *ir)
       break;
 
    case ir_binop_lshift:
+      inst = emit(BRW_OPCODE_SHL, result_dst, op[0], op[1]);
+      break;
+
    case ir_binop_rshift:
-      assert(!"GLSL 1.30 features unsupported");
+      if (ir->type->base_type == GLSL_TYPE_INT)
+        inst = emit(BRW_OPCODE_ASR, result_dst, op[0], op[1]);
+      else
+        inst = emit(BRW_OPCODE_SHR, result_dst, op[0], op[1]);
       break;
 
    case ir_quadop_vector: