aco: don't create v_madmk_f32/v_madak_f32 from v_fma_legacy_f16

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5105
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12004>
(cherry picked from commit 211d1dfd34)
This commit is contained in:
Rhys Perry 2021-07-21 20:18:12 +01:00 committed by Dylan Baker
parent 0342e7f91f
commit b850f72628
2 changed files with 6 additions and 1 deletions

View file

@ -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
},

View file

@ -3753,6 +3753,11 @@ select_instruction(opt_ctx& ctx, aco_ptr<Instruction>& 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;