intel/brw: Fix decoding of cond_modifier and saturate in EU validation

These fields are only valid in certain formats, so set them accordingly.
Note the check if !is_send is used because FORMAT_BASIC is reused for
SEND/SENDS in some platforms.  If we start to see more cases like that,
we can create a new FORMAT for it.

The cond_modifier is trickier because on top of that, it is not valid
for 64-bit immediates in some platforms.  Found when EU validation
complained about moving 64-bit immediates with higher bits.

Fixes: e4440df2d8 ("intel/brw: Add pred/cmod/sat to brw_hw_decoded_inst")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32287>
This commit is contained in:
Caio Oliveira 2024-11-21 13:11:28 -08:00 committed by Marge Bot
parent 480fcf7aff
commit 1d704af515

View file

@ -2208,9 +2208,7 @@ brw_hw_decode_inst(const struct brw_isa_info *isa,
}
inst->access_mode = brw_inst_access_mode(devinfo, raw);
inst->cond_modifier = brw_inst_cond_modifier(devinfo, raw);
inst->pred_control = brw_inst_pred_control(devinfo, raw);
inst->saturate = brw_inst_saturate(devinfo, raw);
RETURN_ERROR_IF(inst->num_sources == 3 && inst->access_mode == BRW_ALIGN_1 && devinfo->ver == 9,
"Align1 mode not allowed on Gfx9 for 3-src instructions");
@ -2510,6 +2508,20 @@ brw_hw_decode_inst(const struct brw_isa_info *isa,
"Invalid source register type encoding.");
}
if ((format == FORMAT_BASIC ||
format == FORMAT_BASIC_THREE_SRC ||
format == FORMAT_DPAS_THREE_SRC) &&
!inst_is_send(inst)) {
inst->saturate = brw_inst_saturate(devinfo, raw);
if (inst->num_sources > 1 ||
devinfo->ver < 12 ||
inst->src[0].file != IMM ||
brw_type_size_bytes(inst->src[0].type) < 8) {
inst->cond_modifier = brw_inst_cond_modifier(devinfo, raw);
}
}
return error_msg;
}