Mesa (master): st_glsl_to_tgsi: use ISSG and fixup IABS
Dave Airlie
airlied at kemper.freedesktop.org
Wed Jan 11 13:51:50 UTC 2012
Module: Mesa
Branch: master
Commit: cc94f0541c7729bca95f21b879c2071722ca3017
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cc94f0541c7729bca95f21b879c2071722ca3017
Author: Dave Airlie <airlied at redhat.com>
Date: Mon Jan 9 11:50:14 2012 +0000
st_glsl_to_tgsi: use ISSG and fixup IABS
It doesn't look like the GLSL compiler will produce sign op
for an unsigned anyways (seems insane anyways).
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 8 ++++----
1 files changed, 4 insertions(+), 4 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..e450d13 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -664,6 +664,9 @@ glsl_to_tgsi_visitor::get_opcode(ir_instruction *ir, unsigned op,
case3(SLT, ISLT, USLT);
case2iu(ISHR, USHR);
+
+ case2fi(SSG, ISSG);
+ case3(ABS, IABS, IABS);
default: break;
}
@@ -1410,10 +1413,7 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
}
break;
case ir_unop_abs:
- if (result_dst.type == GLSL_TYPE_INT || result_dst.type == GLSL_TYPE_UINT)
- emit(ir, TGSI_OPCODE_IABS, result_dst, op[0]);
- else
- emit(ir, TGSI_OPCODE_ABS, result_dst, op[0]);
+ emit(ir, TGSI_OPCODE_ABS, result_dst, op[0]);
break;
case ir_unop_sign:
emit(ir, TGSI_OPCODE_SSG, result_dst, op[0]);
More information about the mesa-commit
mailing list