intel/disasm: Don't rely on FALLTHROUGHTs to print unsupported SFID
The code works but is a bit fragile if we ever add a case that has a less strict requirement (a smaller gen) than the case above. To avoid having to reason about this, refactor code to use a variable to indicate whether the SFID is supported or not. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7742>
This commit is contained in:

committed by
Marge Bot

parent
ae27d7faae
commit
ff9ea469f6
@@ -1874,6 +1874,7 @@ brw_disassemble_inst(FILE *file, const struct gen_device_info *devinfo,
|
||||
if (!has_imm_desc) {
|
||||
format(file, " indirect");
|
||||
} else {
|
||||
bool unsupported = false;
|
||||
switch (sfid) {
|
||||
case BRW_SFID_MATH:
|
||||
err |= control(file, "math function", math_function,
|
||||
@@ -2038,9 +2039,10 @@ brw_disassemble_inst(FILE *file, const struct gen_device_info *devinfo,
|
||||
brw_dp_desc_msg_control(devinfo, imm_desc));
|
||||
}
|
||||
format(file, ")");
|
||||
break;
|
||||
} else {
|
||||
unsupported = true;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
break;
|
||||
|
||||
case HSW_SFID_DATAPORT_DATA_CACHE_1: {
|
||||
if (devinfo->gen >= 7) {
|
||||
@@ -2088,10 +2090,11 @@ brw_disassemble_inst(FILE *file, const struct gen_device_info *devinfo,
|
||||
format(file, "0x%x", msg_ctrl);
|
||||
}
|
||||
format(file, ")");
|
||||
break;
|
||||
} else {
|
||||
unsupported = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case GEN7_SFID_PIXEL_INTERPOLATOR:
|
||||
if (devinfo->gen >= 7) {
|
||||
@@ -2099,23 +2102,28 @@ brw_disassemble_inst(FILE *file, const struct gen_device_info *devinfo,
|
||||
brw_inst_pi_nopersp(devinfo, inst) ? "linear" : "persp",
|
||||
pixel_interpolator_msg_types[brw_inst_pi_message_type(devinfo, inst)],
|
||||
brw_inst_pi_message_data(devinfo, inst));
|
||||
break;
|
||||
} else {
|
||||
unsupported = true;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
break;
|
||||
|
||||
case GEN_RT_SFID_RAY_TRACE_ACCELERATOR:
|
||||
if (devinfo->has_ray_tracing) {
|
||||
format(file, " SIMD%d,",
|
||||
brw_rt_trace_ray_desc_exec_size(devinfo, imm_desc));
|
||||
break;
|
||||
} else {
|
||||
unsupported = true;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
break;
|
||||
|
||||
default:
|
||||
format(file, "unsupported shared function ID %d", sfid);
|
||||
unsupported = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (unsupported)
|
||||
format(file, "unsupported shared function ID %d", sfid);
|
||||
|
||||
if (space)
|
||||
string(file, " ");
|
||||
}
|
||||
|
Reference in New Issue
Block a user