mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 18:28:12 +02:00
nv50/ir/opt: don't lose saturation in tryCollapseChainedMULs
This commit is contained in:
parent
38a20281fc
commit
28d6a268af
1 changed files with 3 additions and 2 deletions
|
|
@ -564,7 +564,7 @@ ConstantFolding::tryCollapseChainedMULs(Instruction *mul2,
|
|||
insn = mul2->getSrc(t)->getInsn();
|
||||
if (!mul2->src(t).mod && insn->op == OP_MUL && insn->dType == TYPE_F32)
|
||||
mul1 = insn;
|
||||
if (mul1) {
|
||||
if (mul1 && !mul1->saturate) {
|
||||
int s1;
|
||||
|
||||
if (mul1->src(s1 = 0).getImmediate(imm1) ||
|
||||
|
|
@ -584,10 +584,11 @@ ConstantFolding::tryCollapseChainedMULs(Instruction *mul2,
|
|||
if (f < 0)
|
||||
mul1->src(0).mod *= Modifier(NV50_IR_MOD_NEG);
|
||||
}
|
||||
mul1->saturate = mul2->saturate;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (mul2->getDef(0)->refCount() == 1) {
|
||||
if (mul2->getDef(0)->refCount() == 1 && !mul2->saturate) {
|
||||
// b = mul a, imm
|
||||
// d = mul b, c -> d = mul_x_imm a, c
|
||||
int s2, t2;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue