r600/asm: Fixes for ensuring that AR setting and usage are in the same clause
The "Fix AR force_add_cf setting if a clause is not open" commit makes the condition match that in SFN's AssamblerVisitor::emit_index_reg
. I'm not sure when and if that can occur — if setting AR right in the beginning of the shader to a fixed-function input like the vertex ID maybe?
Another fix adds the same logic to CF_IDX
setting on Evergreen in eg_asm.c
, which is done through AR
that doesn't persist across clauses.
I'm not fully sure about the number 110 though. If I recall correctly, at most 128 instructions can be placed in one clause, but 128 minus 110 is 18, while an instruction group can be at most 7 qwords long (5 instructions, 1 XY literal pair, 1 ZW literal pair), so 2 instruction groups can take up at most 14 qwords — are there some other instructions that the assembler can emit that have to stay within the clause, and thus some space must be left for them too?