gallium: remove TGSI_OPCODE_SUB
[mesa.git] / src / mesa / state_tracker / st_glsl_to_tgsi.cpp
index 3daf60a31e64901a03b8b9c8ca4097288f23a468..df7a1bc0cfeb7750609c3f0349a064e0f10996c1 100644 (file)
@@ -1702,7 +1702,8 @@ glsl_to_tgsi_visitor::visit_expression(ir_expression* ir, st_src_reg *op)
       emit_asm(ir, TGSI_OPCODE_ADD, result_dst, op[0], op[1]);
       break;
    case ir_binop_sub:
-      emit_asm(ir, TGSI_OPCODE_SUB, result_dst, op[0], op[1]);
+      op[1].negate = ~op[1].negate;
+      emit_asm(ir, TGSI_OPCODE_ADD, result_dst, op[0], op[1]);
       break;
 
    case ir_binop_mul: