Closes: #7652
Fixes:
45a111c21c2 ("nir/opt_algebraic: Fuse c - a * b to FMA")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19776>
src.neg = asrc->negate || (alu->op == nir_op_fneg);
src.abs = asrc->abs || (alu->op == nir_op_fabs);
} else {
- assert(!asrc->negate && alu->op != nir_op_fneg);
+ assert(alu->op != nir_op_fneg);
assert(!asrc->abs && alu->op != nir_op_fabs);
+
+ if (src.imm_type > 0)
+ assert(!asrc->negate);
+
+ if (asrc->negate && src.imm_type == 0)
+ src.imm_val ^= 0x80000;
}
srcs[i] = src;