nir/serialize: omit serializing fp_math_ctrl if it has to be 0

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39966>
This commit is contained in:
Georg Lehmann 2026-02-18 15:40:32 +01:00 committed by Marge Bot
parent 9109c0aa3c
commit 62f3be87c4

View file

@ -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++) {