r600/sfn: Add source mod propagation also to fp64 ops

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23754>
This commit is contained in:
Gert Wollny 2023-06-20 21:13:23 +02:00 committed by Marge Bot
parent 255eee10ac
commit e853332805
2 changed files with 9 additions and 5 deletions

View file

@ -1960,8 +1960,6 @@ emit_alu_neg(const nir_alu_instr& alu, Shader& shader)
{
auto& value_factory = shader.value_factory();
auto group = new AluGroup();
AluInstr *ir = nullptr;
for (unsigned i = 0; i < nir_dest_num_components(alu.dest.dest); ++i) {
@ -1970,13 +1968,13 @@ emit_alu_neg(const nir_alu_instr& alu, Shader& shader)
value_factory.dest(alu.dest, 2 * i + c, pin_chan),
value_factory.src64(alu.src[0], i, c),
{alu_write});
group->add_instruction(ir);
shader.emit_instruction(ir);
}
ir->set_source_mod(0, AluInstr::mod_neg);
}
if (ir)
ir->set_alu_flag(alu_last_instr);
shader.emit_instruction(group);
return true;
}

View file

@ -25,6 +25,7 @@
*/
#include "sfn_peephole.h"
#include "sfn_instr_alugroup.h"
namespace r600 {
@ -122,7 +123,7 @@ PeepholeVisitor::visit(AluInstr *instr)
}
auto opinfo = alu_ops.at(instr->opcode());
if (opinfo.can_srcmod && !opinfo.is_fp64)
if (opinfo.can_srcmod)
apply_source_mods(instr);
}
@ -138,6 +139,11 @@ PeepholeVisitor::convert_to_mov(AluInstr *alu, int src_idx)
void
PeepholeVisitor::visit(UNUSED AluGroup *instr)
{
for (auto alu : *instr) {
if (!alu)
continue;
visit(alu);
}
}
void