mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
i965/fs: Optimize sqrt+inv into rsq.
Transform sqrt a, b rcp c, a into sqrt a, b rsq c, b The improvement here is that we've broken a dependency between these instructions. Leads to 330 fewer INV instructions and 330 more RSQ. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
b52126b44f
commit
94b68109fb
1 changed files with 11 additions and 0 deletions
|
|
@ -2334,6 +2334,17 @@ fs_visitor::opt_algebraic()
|
|||
}
|
||||
}
|
||||
break;
|
||||
case SHADER_OPCODE_RCP: {
|
||||
fs_inst *prev = (fs_inst *)inst->prev;
|
||||
if (prev->opcode == SHADER_OPCODE_SQRT) {
|
||||
if (inst->src[0].equals(prev->dst)) {
|
||||
inst->opcode = SHADER_OPCODE_RSQ;
|
||||
inst->src[0] = prev->src[0];
|
||||
progress = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue