From: Dave Airlie Date: Mon, 9 Jan 2012 11:50:14 +0000 (+0000) Subject: st_glsl_to_tgsi: use ISSG and fixup IABS X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cc94f0541c7729bca95f21b879c2071722ca3017;p=mesa.git 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 --- diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 3b8e2fe3742..e450d130eb1 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]);