mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
freedreno/afuc: Avoid ubsan warns about shifting to the top bit of 'int'
I think maybe it's being promoted to int due to the mismatched bitfield sizes of the uint32_t values being referenced here? Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
This commit is contained in:
parent
ba9e994034
commit
d5a80781aa
1 changed files with 2 additions and 2 deletions
|
|
@ -402,7 +402,7 @@ disasm_instr(uint32_t *instrs, unsigned pc)
|
|||
printf(" << %u", instr->movi.shift);
|
||||
|
||||
if ((instr->movi.dst == REG_ADDR) && (instr->movi.shift >= 16)) {
|
||||
uint32_t val = instr->movi.uimm << instr->movi.shift;
|
||||
uint32_t val = (uint32_t)instr->movi.uimm << (uint32_t)instr->movi.shift;
|
||||
val &= ~0x40000; /* b18 seems to be a flag */
|
||||
|
||||
if ((val & 0x00ffffff) == 0) {
|
||||
|
|
@ -439,7 +439,7 @@ disasm_instr(uint32_t *instrs, unsigned pc)
|
|||
}
|
||||
}
|
||||
|
||||
print_gpu_reg(instr->movi.uimm << instr->movi.shift);
|
||||
print_gpu_reg((uint32_t)instr->movi.uimm << (uint32_t)instr->movi.shift);
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue