mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
nv50/ir: propagate modifier to right arg when const-folding mad
An immediate has to be the second arg of an ADD operation. However we
were mistakenly propagating the modifier of the non-folded value to the
folded immediate argument.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91117
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ad62ec8316)
This commit is contained in:
parent
3c4570e3fc
commit
16b6fa972d
1 changed files with 4 additions and 1 deletions
|
|
@ -572,9 +572,12 @@ ConstantFolding::expr(Instruction *i,
|
|||
case OP_FMA: {
|
||||
i->op = OP_ADD;
|
||||
|
||||
/* Move the immediate to the second arg, otherwise the ADD operation
|
||||
* won't be emittable
|
||||
*/
|
||||
i->setSrc(1, i->getSrc(0));
|
||||
i->src(1).mod = i->src(2).mod;
|
||||
i->setSrc(0, i->getSrc(2));
|
||||
i->src(0).mod = i->src(2).mod;
|
||||
i->setSrc(2, NULL);
|
||||
|
||||
ImmediateValue src0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue