summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-01-18 12:58:45 -0800
committerEric Anholt <[email protected]>2012-01-23 12:50:54 -0800
commit1fde76b8771350933d0a0b562ff1bd91e8340ac5 (patch)
treeca9be4afbcff17089269d7a40c475fabec727941 /src/mesa/drivers
parent06ad64ad29e7aa9e2d001f6bd1f8c1c1f77050b8 (diff)
i965/vs: Use the embedded-comparison SEL on gen6+, like the FS does.
Shaves a few instructions off of the VS in Lightsmark, but no statistically significant performance difference on gen7 (n=5). Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 06bde92c8d8..2436bc9336a 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -1285,16 +1285,26 @@ vec4_visitor::visit(ir_expression *ir)
break;
case ir_binop_min:
- emit(CMP(result_dst, op[0], op[1], BRW_CONDITIONAL_L));
+ if (intel->gen >= 6) {
+ inst = emit(BRW_OPCODE_SEL, result_dst, op[0], op[1]);
+ inst->conditional_mod = BRW_CONDITIONAL_L;
+ } else {
+ emit(CMP(result_dst, op[0], op[1], BRW_CONDITIONAL_L));
- inst = emit(BRW_OPCODE_SEL, result_dst, op[0], op[1]);
- inst->predicate = BRW_PREDICATE_NORMAL;
+ inst = emit(BRW_OPCODE_SEL, result_dst, op[0], op[1]);
+ inst->predicate = BRW_PREDICATE_NORMAL;
+ }
break;
case ir_binop_max:
- emit(CMP(result_dst, op[0], op[1], BRW_CONDITIONAL_G));
+ if (intel->gen >= 6) {
+ inst = emit(BRW_OPCODE_SEL, result_dst, op[0], op[1]);
+ inst->conditional_mod = BRW_CONDITIONAL_G;
+ } else {
+ emit(CMP(result_dst, op[0], op[1], BRW_CONDITIONAL_G));
- inst = emit(BRW_OPCODE_SEL, result_dst, op[0], op[1]);
- inst->predicate = BRW_PREDICATE_NORMAL;
+ inst = emit(BRW_OPCODE_SEL, result_dst, op[0], op[1]);
+ inst->predicate = BRW_PREDICATE_NORMAL;
+ }
break;
case ir_binop_pow: