intel/compiler: Fix missing break in switch
CoverityID: 1487496
Fixes: cde9ca616d
"intel/compiler: Make decision based on source type instead of opcode"
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11985>
This commit is contained in:
@@ -376,6 +376,8 @@ static bool
|
|||||||
can_promote_src_as_imm(const struct intel_device_info *devinfo, fs_inst *inst,
|
can_promote_src_as_imm(const struct intel_device_info *devinfo, fs_inst *inst,
|
||||||
unsigned src_idx)
|
unsigned src_idx)
|
||||||
{
|
{
|
||||||
|
bool can_promote = false;
|
||||||
|
|
||||||
/* Experiment shows that we can only support src0 as immediate */
|
/* Experiment shows that we can only support src0 as immediate */
|
||||||
if (src_idx != 0)
|
if (src_idx != 0)
|
||||||
return false;
|
return false;
|
||||||
@@ -386,31 +388,36 @@ can_promote_src_as_imm(const struct intel_device_info *devinfo, fs_inst *inst,
|
|||||||
/* TODO - Fix the codepath below to use a bfloat16 immediate on XeHP,
|
/* TODO - Fix the codepath below to use a bfloat16 immediate on XeHP,
|
||||||
* since HF/F mixed mode has been removed from the hardware.
|
* since HF/F mixed mode has been removed from the hardware.
|
||||||
*/
|
*/
|
||||||
switch(inst->src[src_idx].type) {
|
switch (inst->src[src_idx].type) {
|
||||||
case BRW_REGISTER_TYPE_F: {
|
case BRW_REGISTER_TYPE_F: {
|
||||||
uint16_t hf;
|
uint16_t hf;
|
||||||
if (representable_as_hf(inst->src[src_idx].f, &hf)) {
|
if (representable_as_hf(inst->src[src_idx].f, &hf)) {
|
||||||
inst->src[src_idx] = retype(brw_imm_uw(hf), BRW_REGISTER_TYPE_HF);
|
inst->src[src_idx] = retype(brw_imm_uw(hf), BRW_REGISTER_TYPE_HF);
|
||||||
return true;
|
can_promote = true;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case BRW_REGISTER_TYPE_W: {
|
case BRW_REGISTER_TYPE_W: {
|
||||||
int16_t w;
|
int16_t w;
|
||||||
if (representable_as_w(inst->src[src_idx].d, &w)) {
|
if (representable_as_w(inst->src[src_idx].d, &w)) {
|
||||||
inst->src[src_idx] = brw_imm_w(w);
|
inst->src[src_idx] = brw_imm_w(w);
|
||||||
return true;
|
can_promote = true;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case BRW_REGISTER_TYPE_UW: {
|
case BRW_REGISTER_TYPE_UW: {
|
||||||
uint16_t uw;
|
uint16_t uw;
|
||||||
if (representable_as_uw(inst->src[src_idx].ud, &uw)) {
|
if (representable_as_uw(inst->src[src_idx].ud, &uw)) {
|
||||||
inst->src[src_idx] = brw_imm_uw(uw);
|
inst->src[src_idx] = brw_imm_uw(uw);
|
||||||
return true;
|
can_promote = true;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return false;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return can_promote;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
Reference in New Issue
Block a user