From 9eb04d8f969c86238b33513adbff56e0a0557c49 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timur=20Krist=C3=B3f?= Date: Sun, 19 Feb 2023 14:07:10 +0100 Subject: [PATCH] aco: Simplify get_phi_operand using Operand::c32_or_c64. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Timur Kristóf Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 1cd3c42..c87cddf 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -9874,12 +9874,8 @@ get_phi_operand(isel_context* ctx, nir_ssa_def* ssa, RegClass rc, bool logical) return Operand(rc); } else if (logical && ssa->bit_size == 1 && ssa->parent_instr->type == nir_instr_type_load_const) { - if (ctx->program->wave_size == 64) - return Operand::c64(nir_instr_as_load_const(ssa->parent_instr)->value[0].b ? UINT64_MAX - : 0u); - else - return Operand::c32(nir_instr_as_load_const(ssa->parent_instr)->value[0].b ? UINT32_MAX - : 0u); + bool val = nir_instr_as_load_const(ssa->parent_instr)->value[0].b; + return Operand::c32_or_c64(val ? -1 : 0, ctx->program->lane_mask == s2); } else { return Operand(tmp); } -- 2.7.4