[Mesa-dev] [PATCH 2/2] st_glsl_to_tgsi: use ISSG

2012-01-09 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

Signed-off-by: Dave Airlie airl...@redhat.com
---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 3b8e2fe..460bc04 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -1416,7 +1416,10 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
  emit(ir, TGSI_OPCODE_ABS, result_dst, op[0]);
   break;
case ir_unop_sign:
-  emit(ir, TGSI_OPCODE_SSG, result_dst, op[0]);
+  if (result_dst.type == GLSL_TYPE_INT || result_dst.type == 
GLSL_TYPE_UINT)
+ emit(ir, TGSI_OPCODE_ISSG, result_dst, op[0]);
+  else
+ emit(ir, TGSI_OPCODE_SSG, result_dst, op[0]);
   break;
case ir_unop_rcp:
   emit_scalar(ir, TGSI_OPCODE_RCP, result_dst, op[0]);
-- 
1.7.7.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] st_glsl_to_tgsi: use ISSG

2012-01-09 Thread Brian Paul

On 01/09/2012 04:54 AM, Dave Airlie wrote:

From: Dave Airlieairl...@redhat.com

Signed-off-by: Dave Airlieairl...@redhat.com
---
  src/mesa/state_tracker/st_glsl_to_tgsi.cpp |5 -
  1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 3b8e2fe..460bc04 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -1416,7 +1416,10 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
   emit(ir, TGSI_OPCODE_ABS, result_dst, op[0]);
break;
 case ir_unop_sign:
-  emit(ir, TGSI_OPCODE_SSG, result_dst, op[0]);
+  if (result_dst.type == GLSL_TYPE_INT || result_dst.type == 
GLSL_TYPE_UINT)
+ emit(ir, TGSI_OPCODE_ISSG, result_dst, op[0]);
+  else
+ emit(ir, TGSI_OPCODE_SSG, result_dst, op[0]);
break;
 case ir_unop_rcp:
emit_scalar(ir, TGSI_OPCODE_RCP, result_dst, op[0]);


Is ISSG going to work properly for unsigned integers?  Maybe 
ISSG(UINT) should be replaced by a set-not-equal-to-zero instruction?


-Brian
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev