summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2015-05-08 12:55:00 -0700
committerIan Romanick <[email protected]>2017-10-30 09:27:09 -0700
commit6403efbe7458d05cf117adb41c8a152ed6e28bdd (patch)
tree74c392361a08b0f04895ca667d828ac7083ad304 /src/mesa
parent34f7e761bc61d3086c1e4e42285c31678b256107 (diff)
glsl: Remove ir_binop_greater and ir_binop_lequal expressions
NIR does not have these instructions. TGSI and Mesa IR both implement them using < and >=, repsectively. Removing them deletes a bunch of code and means I don't have to add code to the SPIR-V generator for them. v2: Rebase on 2+ years of change... and fix a major bug added in the rebase. text data bss dec hex filename 8255291 268856 294072 8818219 868e2b 32-bit i965_dri.so before 8254235 268856 294072 8817163 868a0b 32-bit i965_dri.so after 7815339 345592 420592 8581523 82f193 64-bit i965_dri.so before 7813995 345560 420592 8580147 82ec33 64-bit i965_dri.so after Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp30
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp20
2 files changed, 0 insertions, 50 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index e4803aa4903..aa330638836 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -1135,22 +1135,6 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
case ir_binop_less:
emit(ir, OPCODE_SLT, result_dst, op[0], op[1]);
break;
- case ir_binop_greater:
- /* Negating the operands (as opposed to switching the order of the
- * operands) produces the correct result when both are +/-Inf.
- */
- op[0].negate = ~op[0].negate;
- op[1].negate = ~op[1].negate;
- emit(ir, OPCODE_SLT, result_dst, op[0], op[1]);
- break;
- case ir_binop_lequal:
- /* Negating the operands (as opposed to switching the order of the
- * operands) produces the correct result when both are +/-Inf.
- */
- op[0].negate = ~op[0].negate;
- op[1].negate = ~op[1].negate;
- emit(ir, OPCODE_SGE, result_dst, op[0], op[1]);
- break;
case ir_binop_gequal:
emit(ir, OPCODE_SGE, result_dst, op[0], op[1]);
break;
@@ -1758,10 +1742,6 @@ ir_to_mesa_visitor::process_move_condition(ir_rvalue *ir)
/* a is - 0 + - 0 +
* (a < 0) T F F ( a < 0) T F F
* (0 < a) F F T (-a < 0) F F T
- * (a <= 0) T T F (-a < 0) F F T (swap order of other operands)
- * (0 <= a) F T T ( a < 0) T F F (swap order of other operands)
- * (a > 0) F F T (-a < 0) F F T
- * (0 > a) T F F ( a < 0) T F F
* (a >= 0) F T T ( a < 0) T F F (swap order of other operands)
* (0 >= a) T T F (-a < 0) F F T (swap order of other operands)
*
@@ -1775,16 +1755,6 @@ ir_to_mesa_visitor::process_move_condition(ir_rvalue *ir)
negate = zero_on_left;
break;
- case ir_binop_greater:
- switch_order = false;
- negate = !zero_on_left;
- break;
-
- case ir_binop_lequal:
- switch_order = true;
- negate = !zero_on_left;
- break;
-
case ir_binop_gequal:
switch_order = true;
negate = zero_on_left;
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index eaed052a17d..54e1961830c 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -1499,12 +1499,6 @@ glsl_to_tgsi_visitor::visit_expression(ir_expression* ir, st_src_reg *op)
case ir_binop_less:
emit_asm(ir, TGSI_OPCODE_SLT, result_dst, op[0], op[1]);
break;
- case ir_binop_greater:
- emit_asm(ir, TGSI_OPCODE_SLT, result_dst, op[1], op[0]);
- break;
- case ir_binop_lequal:
- emit_asm(ir, TGSI_OPCODE_SGE, result_dst, op[1], op[0]);
- break;
case ir_binop_gequal:
emit_asm(ir, TGSI_OPCODE_SGE, result_dst, op[0], op[1]);
break;
@@ -2807,10 +2801,6 @@ glsl_to_tgsi_visitor::process_move_condition(ir_rvalue *ir)
/* a is - 0 + - 0 +
* (a < 0) T F F ( a < 0) T F F
* (0 < a) F F T (-a < 0) F F T
- * (a <= 0) T T F (-a < 0) F F T (swap order of other operands)
- * (0 <= a) F T T ( a < 0) T F F (swap order of other operands)
- * (a > 0) F F T (-a < 0) F F T
- * (0 > a) T F F ( a < 0) T F F
* (a >= 0) F T T ( a < 0) T F F (swap order of other operands)
* (0 >= a) T T F (-a < 0) F F T (swap order of other operands)
*
@@ -2824,16 +2814,6 @@ glsl_to_tgsi_visitor::process_move_condition(ir_rvalue *ir)
negate = zero_on_left;
break;
- case ir_binop_greater:
- switch_order = false;
- negate = !zero_on_left;
- break;
-
- case ir_binop_lequal:
- switch_order = true;
- negate = !zero_on_left;
- break;
-
case ir_binop_gequal:
switch_order = true;
negate = zero_on_left;