summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-08-03 14:12:35 -0700
committerJason Ekstrand <[email protected]>2015-08-10 11:45:43 -0700
commit17c978166185a7d3a9759f828a4370c1f2169776 (patch)
treeaf225423632ed645b5d9fba4e8f7cbd3676495dd /src/mesa/drivers/dri/i965
parent9901aeb1c74648cbe1aa1d18d590a689c844cbad (diff)
i965/nir: Use nir_op_info.output_type for determining when to resolve
Previously, we were explicitly listing every instruction that needs a resolve. However, those instructions were precicely the ones that returned booleans so there's no reason why we shouldn't just have that check. Also, all of the reduction opcodes such as bany and ball were missing so it didn't properly flag stuff on vec4. If an opcode gets added in the future that returns a bool but doesn't need a resolve, we can special-case that. Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r--src/mesa/drivers/dri/i965/brw_nir_analyze_boolean_resolves.c40
1 files changed, 15 insertions, 25 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_nir_analyze_boolean_resolves.c b/src/mesa/drivers/dri/i965/brw_nir_analyze_boolean_resolves.c
index 9eb0ed9bd79..d1fc06dd526 100644
--- a/src/mesa/drivers/dri/i965/brw_nir_analyze_boolean_resolves.c
+++ b/src/mesa/drivers/dri/i965/brw_nir_analyze_boolean_resolves.c
@@ -109,30 +109,6 @@ analyze_boolean_resolves_block(nir_block *block, void *void_state)
uint8_t resolve_status;
nir_alu_instr *alu = nir_instr_as_alu(instr);
switch (alu->op) {
- case nir_op_flt:
- case nir_op_ilt:
- case nir_op_ult:
- case nir_op_fge:
- case nir_op_ige:
- case nir_op_uge:
- case nir_op_feq:
- case nir_op_ieq:
- case nir_op_fne:
- case nir_op_ine:
- case nir_op_f2b:
- case nir_op_i2b:
- /* This instruction will turn into a CMP when we actually emit
- * so the result will have to be resolved before it can be used.
- */
- resolve_status = BRW_NIR_BOOLEAN_UNRESOLVED;
-
- /* Even though the destination is allowed to be left unresolved,
- * the sources are treated as regular integers or floats so
- * they need to be resolved.
- */
- nir_foreach_src(instr, src_mark_needs_resolve, NULL);
- break;
-
case nir_op_imov:
case nir_op_inot:
/* This is a single-source instruction. Just copy the resolve
@@ -169,7 +145,21 @@ analyze_boolean_resolves_block(nir_block *block, void *void_state)
}
default:
- resolve_status = BRW_NIR_NON_BOOLEAN;
+ if (nir_op_infos[alu->op].output_type == nir_type_bool) {
+ /* This instructions will turn into a CMP when we actually emit
+ * them so the result will have to be resolved before it can be
+ * used.
+ */
+ resolve_status = BRW_NIR_BOOLEAN_UNRESOLVED;
+
+ /* Even though the destination is allowed to be left
+ * unresolved, the sources are treated as regular integers or
+ * floats so they need to be resolved.
+ */
+ nir_foreach_src(instr, src_mark_needs_resolve, NULL);
+ } else {
+ resolve_status = BRW_NIR_NON_BOOLEAN;
+ }
}
/* If the destination is SSA, go ahead allow unresolved booleans.