From 3525d29a8d8ee9156618c50ff338433c3aecaba4 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Wed, 18 May 2022 22:27:39 +0200 Subject: [PATCH] r600: Make sure that LDS instructions only use bank swizzle 012 Not sure whether this is really needed. With the TGSI code path no other bank swizzle is emitted for LDS ops, so make sure it's the same here. Signed-off-by: Gert Wollny Reviewed-by: Filip Gawin Part-of: --- src/gallium/drivers/r600/r600_asm.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c index 0d7e5dff027..92ea9c5bbdb 100644 --- a/src/gallium/drivers/r600/r600_asm.c +++ b/src/gallium/drivers/r600/r600_asm.c @@ -612,7 +612,7 @@ static int check_and_set_bank_swizzle(const struct r600_bytecode *bc, /* Just check every possible combination of bank swizzle. * Not very efficent, but works on the first try in most of the cases. */ for (i = 0; i < 4; i++) - if (!slots[i] || !slots[i]->bank_swizzle_force) + if (!slots[i] || !slots[i]->bank_swizzle_force || slots[i]->is_lds_idx_op) bank_swizzle[i] = SQ_ALU_VEC_012; else bank_swizzle[i] = slots[i]->bank_swizzle; @@ -647,7 +647,7 @@ static int check_and_set_bank_swizzle(const struct r600_bytecode *bc, bank_swizzle[4]++; } else { for (i = 0; i < max_slots; i++) { - if (!slots[i] || !slots[i]->bank_swizzle_force) { + if (!slots[i] || (!slots[i]->bank_swizzle_force && !slots[i]->is_lds_idx_op)) { bank_swizzle[i]++; if (bank_swizzle[i] <= SQ_ALU_VEC_210) break; @@ -1270,13 +1270,14 @@ int r600_bytecode_add_alu_type(struct r600_bytecode *bc, if (bc->cf_last != NULL && bc->cf_last->op != type) { /* check if we could add it anyway */ - if (bc->cf_last->op == CF_OP_ALU && - type == CF_OP_ALU_PUSH_BEFORE) { - LIST_FOR_EACH_ENTRY(lalu, &bc->cf_last->alu, list) { - if (lalu->execute_mask) { + if ((bc->cf_last->op == CF_OP_ALU && type == CF_OP_ALU_PUSH_BEFORE) || + (bc->cf_last->op == CF_OP_ALU_PUSH_BEFORE && type == CF_OP_ALU)) { + LIST_FOR_EACH_ENTRY(lalu, &bc->cf_last->alu, list) { + if (lalu->execute_mask) { bc->force_add_cf = 1; break; } + type = CF_OP_ALU_PUSH_BEFORE; } } else bc->force_add_cf = 1;