From 38e0a766f38b5eb7f51666ec71de729c4f4fa38b 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 95279670e8b..d4fdcf46f1a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -103,7 +103,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 eb2eea64ed2..be0e2a96f8a 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -3439,6 +3439,11 @@ void 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;