From b8abfafe8690847dc09bb63a5674dc2e2228a56a Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 16 Jan 2020 14:04:49 +0100 Subject: [PATCH] aco: fix constant folding of SMRD instructions on GFX6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit SMRD instructions have an 8-bit dword offset on SI. Signed-off-by: Samuel Pitoiset Reviewed-By: Timur Kristóf Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_optimizer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 8c2514598f0..7e05204d3b5 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -817,7 +817,9 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr& instr) Temp base; uint32_t offset; if (i == 1 && info.is_constant_or_literal() && - (ctx.program->chip_class < GFX8 || info.val <= 0xFFFFF)) { + ((ctx.program->chip_class == GFX6 && info.val <= 0x3FF) || + (ctx.program->chip_class == GFX7 && info.val <= 0xFFFFFFFF) || + (ctx.program->chip_class >= GFX8 && info.val <= 0xFFFFF))) { instr->operands[i] = Operand(info.val); continue; } else if (i == 1 && parse_base_offset(ctx, instr.get(), i, &base, &offset) && base.regClass() == s1 && offset <= 0xFFFFF && ctx.program->chip_class >= GFX9) { -- 2.30.2