i965/fs: Add support for bit-shift operations.
authorEric Anholt <eric@anholt.net>
Tue, 27 Sep 2011 21:32:42 +0000 (14:32 -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_fs_visitor.cpp

index e4746db60189933dca0a9a961a9826a0d5b87ad7..3af57807eff545100e75d607056a1cf0968e8869 100644 (file)
@@ -445,8 +445,14 @@ fs_visitor::visit(ir_expression *ir)
       break;
 
    case ir_binop_lshift:
+      inst = emit(BRW_OPCODE_SHL, this->result, 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, this->result, op[0], op[1]);
+      else
+        inst = emit(BRW_OPCODE_SHR, this->result, op[0], op[1]);
       break;
    }
 }