From b59f5f9c859d388cf8e67c6521614abd6709e208 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Sun, 4 Feb 2024 19:46:34 +0100 Subject: [PATCH] aco: print neg prettier for packed math MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_print_ir.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/amd/compiler/aco_print_ir.cpp b/src/amd/compiler/aco_print_ir.cpp index 92d9b0ebf0e..dc1cb50a355 100644 --- a/src/amd/compiler/aco_print_ir.cpp +++ b/src/amd/compiler/aco_print_ir.cpp @@ -816,8 +816,9 @@ aco_print_instr(enum amd_gfx_level gfx_level, const Instruction* instr, FILE* ou opsel = f2f32 & vop3p.opsel_lo; } else if (instr->isVOP3P()) { const VALU_instruction& vop3p = instr->valu(); - neg_lo = vop3p.neg_lo; - neg_hi = vop3p.neg_hi; + neg = vop3p.neg_lo & vop3p.neg_hi; + neg_lo = vop3p.neg_lo & ~neg; + neg_hi = vop3p.neg_hi & ~neg; opsel_lo = vop3p.opsel_lo; opsel_hi = vop3p.opsel_hi; } else if (instr->isVALU()) { @@ -854,11 +855,9 @@ aco_print_instr(enum amd_gfx_level gfx_level, const Instruction* instr, FILE* ou if (opsel_lo[i] || !opsel_hi[i]) fprintf(output, ".%c%c", opsel_lo[i] ? 'y' : 'x', opsel_hi[i] ? 'y' : 'x'); - if (neg_lo[i] && neg_hi[i]) - fprintf(output, "*[-1,-1]"); - else if (neg_lo[i]) + if (neg_lo[i]) fprintf(output, "*[-1,1]"); - else if (neg_hi[i]) + if (neg_hi[i]) fprintf(output, "*[1,-1]"); } }