[Mesa-dev] [PATCH] r600g: Fix instruction group merge when there are predicated insts.
Vincent Lejeune
vljn at ovi.com
Sat Aug 4 10:19:55 PDT 2012
---
src/gallium/drivers/r600/r600_asm.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
index 0f28824..58c3e03 100644
--- a/src/gallium/drivers/r600/r600_asm.c
+++ b/src/gallium/drivers/r600/r600_asm.c
@@ -1039,7 +1039,7 @@ static int merge_inst_groups(struct r600_bytecode *bc, struct r600_bytecode_alu
unsigned nliteral = 0, prev_nliteral = 0;
int i, j, r, src, num_src;
- int num_once_inst = 0;
+ int num_once_inst = 0, num_pred = 0;
int have_mova = 0, have_rel = 0;
int max_slots = bc->chip_class == CAYMAN ? 4 : 5;
@@ -1062,6 +1062,9 @@ static int merge_inst_groups(struct r600_bytecode *bc, struct r600_bytecode_alu
have_mova = 1;
}
num_once_inst += is_alu_once_inst(bc, prev[i]);
+
+ if (prev[i]->pred_sel)
+ num_pred += 1;
}
if (slots[i] && r600_bytecode_alu_nliterals(bc, slots[i], literal, &nliteral))
return 0;
@@ -1103,6 +1106,9 @@ static int merge_inst_groups(struct r600_bytecode *bc, struct r600_bytecode_alu
alu = slots[i];
num_once_inst += is_alu_once_inst(bc, alu);
+
+ if (alu->pred_sel)
+ num_pred += 1;
/* don't reschedule NOPs */
if (is_nop_inst(bc, alu))
@@ -1144,6 +1150,10 @@ static int merge_inst_groups(struct r600_bytecode *bc, struct r600_bytecode_alu
/* more than one PRED_ or KILL_ ? */
if (num_once_inst > 1)
return 0;
+
+ /* PRED_ and PRED_SEL ? */
+ if (num_pred > 0)
+ return 0;
/* check if the result can still be swizzlet */
r = check_and_set_bank_swizzle(bc, result);
--
1.7.11.2
More information about the mesa-dev
mailing list