qemu/target
Stephen Longfield b2ba5ff272 target/arm: Use uint32_t in t32_expandimm_imm()
In t32_expandimm_imm(), we take an 8 bit value XY and construct a
32-bit value which might be of the form XY, 00XY00XY, XY00XY00, or
XYXYXYXY.  We do this with multiplications, and we use an 'int' type.
For the cases where we're setting the high byte of the 32-bit value
to XY, this means that we do an integer multiplication that might
overflow, and rely on the -fwrapv semantics to keep this from being
undefined behaviour.

It's clearer to use an unsigned type here, because we're really
doing operations on the value considered as a set of bits. The
result is the same.

The return value from the function remains 'int', because this
is a decodetree !function function, and follows the API for those
functions.

Signed-off-by: Stephen Longfield <slongfield@google.com>
Signed-off-by: Roque Arcudia Hernandez <roqueh@google.com>
Message-id: 20250219165534.3387376-1-slongfield@google.com
[PMM: Rewrote the commit message]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2025-02-20 14:20:29 +00:00
..
alpha fpu: allow flushing of output denormals to be after rounding 2025-02-11 16:22:07 +00:00
arm target/arm: Use uint32_t in t32_expandimm_imm() 2025-02-20 14:20:29 +00:00
avr target/*: Remove TARGET_LONG_BITS from cpu-param.h 2025-02-08 12:41:33 -08:00
hexagon target/*: Remove TARGET_LONG_BITS from cpu-param.h 2025-02-08 12:41:33 -08:00
hppa fpu: allow flushing of output denormals to be after rounding 2025-02-11 16:22:07 +00:00
i386 overall: Remove unnecessary g_strdup_printf() calls 2025-02-14 08:49:06 +03:00
loongarch target/loongarch: Use VADDR_PRIx for logging pc_next 2025-02-18 08:28:54 -08:00
m68k target/*: Remove TARGET_LONG_BITS from cpu-param.h 2025-02-08 12:41:33 -08:00
microblaze target/*: Remove TARGET_LONG_BITS from cpu-param.h 2025-02-08 12:41:33 -08:00
mips target/mips: Use VADDR_PRIx for logging pc_next 2025-02-18 08:29:02 -08:00
openrisc target/*: Remove TARGET_LONG_BITS from cpu-param.h 2025-02-08 12:41:33 -08:00
ppc fpu: allow flushing of output denormals to be after rounding 2025-02-11 16:22:07 +00:00
riscv tcg: Remove TCG_OVERSIZED_GUEST 2025-02-18 07:33:42 -08:00
rx fpu: allow flushing of output denormals to be after rounding 2025-02-11 16:22:07 +00:00
s390x QAPI patches patches for 2025-02-10 2025-02-10 10:47:31 -05:00
sh4 fpu: allow flushing of output denormals to be after rounding 2025-02-11 16:22:07 +00:00
sparc target/sparc: fake UltraSPARC T1 PCR and PIC registers 2025-02-18 08:29:03 -08:00
tricore fpu: allow flushing of output denormals to be after rounding 2025-02-11 16:22:07 +00:00
xtensa target/*: Remove TARGET_LONG_BITS from cpu-param.h 2025-02-08 12:41:33 -08:00
Kconfig target/cris: Remove the deprecated CRIS target 2024-09-13 20:11:13 +02:00
meson.build target/cris: Remove the deprecated CRIS target 2024-09-13 20:11:13 +02:00