mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 17:00:09 +01:00
i965/fs: Perform CSE on MAD instructions with final arguments switched.
Multiplication is commutative. instructions in affected programs: 48314 -> 47954 (-0.75%) Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
d056863b3c
commit
b65bd9583b
1 changed files with 5 additions and 1 deletions
|
|
@ -128,7 +128,11 @@ operands_match(fs_inst *a, fs_inst *b)
|
|||
fs_reg *xs = a->src;
|
||||
fs_reg *ys = b->src;
|
||||
|
||||
if (!is_expression_commutative(a->opcode)) {
|
||||
if (a->opcode == BRW_OPCODE_MAD) {
|
||||
return xs[0].equals(ys[0]) &&
|
||||
((xs[1].equals(ys[1]) && xs[2].equals(ys[2])) ||
|
||||
(xs[2].equals(ys[1]) && xs[1].equals(ys[2])));
|
||||
} else if (!is_expression_commutative(a->opcode)) {
|
||||
bool match = true;
|
||||
for (int i = 0; i < a->sources; i++) {
|
||||
if (!xs[i].equals(ys[i])) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue