From 5aa5af7776f8a1183d69bc5252f4dda843291561 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 15 Nov 2021 16:40:53 +0000 Subject: aco: handle read2st64/write2st64 in optimizer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Reviewed-by: Timur Kristóf Part-of: --- src/amd/compiler/aco_optimizer.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 763bfdf3396..e2f540c94e3 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -1390,15 +1390,21 @@ label_instruction(opt_ctx& ctx, aco_ptr& 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) { -- cgit v1.2.3