Currently we don't properly support using he two IDX registers in the
same ALU CF, so work around this by enforcing a new CF if both indices
are used.
Fixes:
d21054b4bc92a1a9240841dca719f81a142fd5cc
r600/sfn: Add pass to split addess and index register loads
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
int bank{0};
int addr{0};
int len{0};
+ int index_mode{0};
enum KCacheLockMode {
free,
lock_1,
int bank = u.kcache_bank();
int sel = (u.sel() - 512);
int line = sel >> 4;
+ EBufferIndexMode index_mode = bim_none;
+
+ if (auto addr = u.buf_addr())
+ index_mode = addr->sel() == AddressRegister::idx0 ? bim_zero : bim_one;
bool found = false;
if (kcache[i].bank < bank)
continue;
+
+ if (kcache[i].bank == bank &&
+ kcache[i].index_mode != bim_none &&
+ kcache[i].index_mode != index_mode) {
+ return false;
+ }
if ((kcache[i].bank == bank && kcache[i].addr > line + 1) ||
kcache[i].bank > bank) {
if (kcache[kcache_banks - 1].mode)
kcache[i].mode = KCacheLine::lock_1;
kcache[i].bank = bank;
kcache[i].addr = line;
+ kcache[i].index_mode = index_mode;
return true;
}
kcache[i].mode = KCacheLine::lock_1;
kcache[i].bank = bank;
kcache[i].addr = line;
+ kcache[i].index_mode = index_mode;
return true;
}
}
assert(!group->has_lds_group_start());
assert(m_current_block->expected_ar_uses() == 0);
start_new_block(out_blocks, Block::alu);
+ m_current_block->try_reserve_kcache(*group);
}
if (addr->sel() == AddressRegister::idx1 && m_idx1_pending) {
assert(!group->has_lds_group_start());
assert(m_current_block->expected_ar_uses() == 0);
start_new_block(out_blocks, Block::alu);
+ m_current_block->try_reserve_kcache(*group);
}
}
ALU MOV S4.x@chgr : KC1[IDX0][0].x {WL}
ALU_GROUP_END
ALU_GROUP_BEGIN
- ALU MOVA_INT IDX0 : S3.z@free {}
- ALU MOV S4.y@chgr : KC1[IDX1][0].y {WL}
+ ALU MOVA_INT IDX0 : S3.z@free {L}
ALU_GROUP_END
BLOCK_END
BLOCK_START
ALU_GROUP_BEGIN
- ALU MOVA_INT IDX1 : S3.w@free {}
ALU MOV S4.z@chgr : KC1[IDX0][0].z {WL}
ALU_GROUP_END
BLOCK_END
BLOCK_START
ALU_GROUP_BEGIN
+ ALU MOV S4.y@chgr : KC1[IDX1][0].y {WL}
+ALU_GROUP_END
+ALU_GROUP_BEGIN
+ ALU MOVA_INT IDX1 : S3.w@free {L}
+ALU_GROUP_END
+BLOCK_END
+BLOCK_START
+ALU_GROUP_BEGIN
ALU MOV S4.w@chgr : KC1[IDX1][0].w {WL}
ALU_GROUP_END
BLOCK_END