From: Samuel Pitoiset Date: Thu, 16 Jan 2020 13:04:49 +0000 (+0100) Subject: aco: fix constant folding of SMRD instructions on GFX6 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b8abfafe8690847dc09bb63a5674dc2e2228a56a;p=mesa.git aco: fix constant folding of SMRD instructions on GFX6 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: --- 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) {