From b850f7262866a095dbdd1cb2923b9555c68b9c00 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 21 Jul 2021 20:18:12 +0100 Subject: [PATCH] aco: don't create v_madmk_f32/v_madak_f32 from v_fma_legacy_f16 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5105 Cc: mesa-stable Part-of: (cherry picked from commit 211d1dfd34499d57709c15d10bdadc514e9e13c2) --- .pick_status.json | 2 +- src/amd/compiler/aco_optimizer.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 1d67fbc6038..65b634942a1 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -940,7 +940,7 @@ "description": "aco: don't create v_madmk_f32/v_madak_f32 from v_fma_legacy_f16", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 238a24df69b..3a09e939b9a 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -3753,6 +3753,11 @@ select_instruction(opt_ctx& ctx, aco_ptr& instr) if ((instr->opcode == aco_opcode::v_fma_f32 || instr->opcode == aco_opcode::v_fma_f16) && ctx.program->chip_class < GFX10) return; + /* There are no v_fmaak_legacy_f16/v_fmamk_legacy_f16 and on chips where VOP3 can take + * literals (GFX10+), these instructions don't exist. + */ + if (instr->opcode == aco_opcode::v_fma_legacy_f16) + return; bool sgpr_used = false; uint32_t literal_idx = 0;