From 62f3be87c4e623024315df5a47bd00120c72908b Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Wed, 18 Feb 2026 15:40:32 +0100 Subject: [PATCH] nir/serialize: omit serializing fp_math_ctrl if it has to be 0 Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir_serialize.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_serialize.c b/src/compiler/nir/nir_serialize.c index de7e7846f34..e4248c78d86 100644 --- a/src/compiler/nir/nir_serialize.c +++ b/src/compiler/nir/nir_serialize.c @@ -732,7 +732,8 @@ write_alu(write_ctx *ctx, const nir_alu_instr *alu) } write_def(ctx, &alu->def, header, alu->instr.type); - blob_write_uint32(ctx->blob, alu->fp_math_ctrl); + if (nir_op_infos[alu->op].valid_fp_math_ctrl) + blob_write_uint32(ctx->blob, alu->fp_math_ctrl); if (header.alu.packed_src_ssa_16bit) { for (unsigned i = 0; i < num_srcs; i++) { @@ -786,7 +787,8 @@ read_alu(read_ctx *ctx, union packed_instr header) alu->no_unsigned_wrap = header.alu.no_unsigned_wrap; read_def(ctx, &alu->def, &alu->instr, header); - alu->fp_math_ctrl = blob_read_uint32(ctx->blob); + if (nir_op_infos[alu->op].valid_fp_math_ctrl) + alu->fp_math_ctrl = blob_read_uint32(ctx->blob); if (header.alu.packed_src_ssa_16bit) { for (unsigned i = 0; i < num_srcs; i++) {