Mesa (master): i965/vs: Add support for bit-shift operations.

Eric Anholt anholt at kemper.freedesktop.org
Wed Sep 28 19:15:02 UTC 2011


Module: Mesa
Branch: master
Commit: 158a5854502ce071e3f07d4ad9622b8ddb3c9859
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=158a5854502ce071e3f07d4ad9622b8ddb3c9859

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Sep 27 14:48:56 2011 -0700

i965/vs: Add support for bit-shift operations.

Reviewed-by: Chad Versace <chad at chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index e5eda22..98ecd25 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -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:




More information about the mesa-commit mailing list