mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
aco: handle read2st64/write2st64 in optimizer
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13778>
This commit is contained in:
parent
2135c88d9c
commit
5aa5af7776
1 changed files with 15 additions and 9 deletions
|
|
@ -1390,15 +1390,21 @@ label_instruction(opt_ctx& ctx, aco_ptr<Instruction>& instr)
|
|||
if (instr->opcode == aco_opcode::ds_write2_b32 ||
|
||||
instr->opcode == aco_opcode::ds_read2_b32 ||
|
||||
instr->opcode == aco_opcode::ds_write2_b64 ||
|
||||
instr->opcode == aco_opcode::ds_read2_b64) {
|
||||
unsigned mask = (instr->opcode == aco_opcode::ds_write2_b64 ||
|
||||
instr->opcode == aco_opcode::ds_read2_b64)
|
||||
? 0x7
|
||||
: 0x3;
|
||||
unsigned shifts = (instr->opcode == aco_opcode::ds_write2_b64 ||
|
||||
instr->opcode == aco_opcode::ds_read2_b64)
|
||||
? 3
|
||||
: 2;
|
||||
instr->opcode == aco_opcode::ds_read2_b64 ||
|
||||
instr->opcode == aco_opcode::ds_write2st64_b32 ||
|
||||
instr->opcode == aco_opcode::ds_read2st64_b32 ||
|
||||
instr->opcode == aco_opcode::ds_write2st64_b64 ||
|
||||
instr->opcode == aco_opcode::ds_read2st64_b64) {
|
||||
bool is64bit = instr->opcode == aco_opcode::ds_write2_b64 ||
|
||||
instr->opcode == aco_opcode::ds_read2_b64 ||
|
||||
instr->opcode == aco_opcode::ds_write2st64_b64 ||
|
||||
instr->opcode == aco_opcode::ds_read2st64_b64;
|
||||
bool st64 = instr->opcode == aco_opcode::ds_write2st64_b32 ||
|
||||
instr->opcode == aco_opcode::ds_read2st64_b32 ||
|
||||
instr->opcode == aco_opcode::ds_write2st64_b64 ||
|
||||
instr->opcode == aco_opcode::ds_read2st64_b64;
|
||||
unsigned shifts = (is64bit ? 3 : 2) + (st64 ? 6 : 0);
|
||||
unsigned mask = BITFIELD_MASK(shifts);
|
||||
|
||||
if ((offset & mask) == 0 && ds.offset0 + (offset >> shifts) <= 255 &&
|
||||
ds.offset1 + (offset >> shifts) <= 255) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue