r600/asm: Make sure MOVA and SET_CF_IDX are in the same clause
authorVitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Mon, 7 Aug 2023 19:41:46 +0000 (22:41 +0300)
committerMarge Bot <emma+marge@anholt.net>
Fri, 11 Aug 2023 08:04:05 +0000 (08:04 +0000)
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24545>

src/gallium/drivers/r600/eg_asm.c

index a0eb629..a55e74a 100644 (file)
@@ -186,6 +186,11 @@ int egcm_load_index_reg(struct r600_bytecode *bc, unsigned id, bool inside_alu_c
        if (bc->index_loaded[id])
                return 0;
 
+       /* Hack to put MOVA and SET_CF_IDX in the same clause as AR only persists for one clause */
+       if (bc->gfx_level == EVERGREEN && (bc->cf_last == NULL || (bc->cf_last->ndw >> 1) >= 110)) {
+               bc->force_add_cf = 1;
+       }
+
        memset(&alu, 0, sizeof(alu));
        alu.op = ALU_OP1_MOVA_INT;
        alu.src[0].sel = bc->index_reg[id];