mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
aco/gfx11: use fmamk/fmaak with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23059>
This commit is contained in:
parent
6a53af3fc8
commit
12b28d64ab
1 changed files with 10 additions and 6 deletions
|
|
@ -4720,7 +4720,12 @@ select_instruction(opt_ctx& ctx, aco_ptr<Instruction>& instr)
|
|||
if (!(literal_mask & 0b100) && !(vgpr_mask & 0b100))
|
||||
literal_mask = 0;
|
||||
|
||||
if (instr->usesModifiers())
|
||||
/* opsel with GFX11+ is the only modifier supported by fmamk/fmaak*/
|
||||
if (instr->valu().abs || instr->valu().neg || instr->valu().omod || instr->valu().clamp ||
|
||||
(instr->valu().opsel && ctx.program->gfx_level < GFX11))
|
||||
literal_mask = 0;
|
||||
|
||||
if (instr->valu().opsel & ~vgpr_mask)
|
||||
literal_mask = 0;
|
||||
|
||||
/* We can't use three unique fp16 literals */
|
||||
|
|
@ -5140,13 +5145,12 @@ apply_literals(opt_ctx& ctx, aco_ptr<Instruction>& instr)
|
|||
instr->operands[i] = Operand::literal32(literal);
|
||||
}
|
||||
if (madak) { /* add literal -> madak */
|
||||
if (!instr->operands[1].isTemp() ||
|
||||
instr->operands[1].getTemp().type() == RegType::sgpr)
|
||||
std::swap(instr->operands[0], instr->operands[1]);
|
||||
if (!instr->operands[1].isOfType(RegType::vgpr))
|
||||
instr->valu().swapOperands(0, 1);
|
||||
} else { /* mul literal -> madmk */
|
||||
if (!(info->literal_mask & 0b10))
|
||||
std::swap(instr->operands[0], instr->operands[1]);
|
||||
std::swap(instr->operands[1], instr->operands[2]);
|
||||
instr->valu().swapOperands(0, 1);
|
||||
instr->valu().swapOperands(1, 2);
|
||||
}
|
||||
ctx.instructions.emplace_back(std::move(instr));
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue