etnaviv: Support negative float inline immediates

Closes: #7652
Fixes: 45a111c21c ("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>
This commit is contained in:
Christian Gmeiner 2022-11-11 19:05:24 +01:00 committed by Marge Bot
parent 74ff3f70bb
commit 7d78fe4a86

View file

@ -498,8 +498,14 @@ emit_alu(struct etna_compile *c, nir_alu_instr * alu)
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;