mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 15:40:11 +01:00
intel/compiler: invert the logic of lower_integer_multiplication()
Invert the logic of how progress is handled: remove the continue statements and mark progress inside the places where it actually happens. We're going to add a new lowering that also looks for BRW_OPCODE_MUL, so inverting the logic here makes the resulting code much easier to follow. Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
This commit is contained in:
parent
6ba4717924
commit
9217cf3b5e
1 changed files with 10 additions and 13 deletions
|
|
@ -4062,24 +4062,21 @@ fs_visitor::lower_integer_multiplication()
|
||||||
|
|
||||||
foreach_block_and_inst_safe(block, fs_inst, inst, cfg) {
|
foreach_block_and_inst_safe(block, fs_inst, inst, cfg) {
|
||||||
if (inst->opcode == BRW_OPCODE_MUL) {
|
if (inst->opcode == BRW_OPCODE_MUL) {
|
||||||
if (inst->dst.is_accumulator() ||
|
if (!inst->dst.is_accumulator() &&
|
||||||
(inst->dst.type != BRW_REGISTER_TYPE_D &&
|
(inst->dst.type == BRW_REGISTER_TYPE_D ||
|
||||||
inst->dst.type != BRW_REGISTER_TYPE_UD))
|
inst->dst.type == BRW_REGISTER_TYPE_UD) &&
|
||||||
continue;
|
!devinfo->has_integer_dword_mul) {
|
||||||
|
|
||||||
if (devinfo->has_integer_dword_mul)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
lower_mul_dword_inst(inst, block);
|
lower_mul_dword_inst(inst, block);
|
||||||
} else if (inst->opcode == SHADER_OPCODE_MULH) {
|
|
||||||
lower_mulh_inst(inst, block);
|
|
||||||
} else {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
inst->remove(block);
|
inst->remove(block);
|
||||||
progress = true;
|
progress = true;
|
||||||
}
|
}
|
||||||
|
} else if (inst->opcode == SHADER_OPCODE_MULH) {
|
||||||
|
lower_mulh_inst(inst, block);
|
||||||
|
inst->remove(block);
|
||||||
|
progress = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (progress)
|
if (progress)
|
||||||
invalidate_live_intervals();
|
invalidate_live_intervals();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue