aboutsummaryrefslogtreecommitdiff
path: root/hw/arm/omap_sx1.c
diff options
context:
space:
mode:
authorStephen Longfield <slongfield@google.com>2025-02-19 16:55:34 +0000
committerPeter Maydell <peter.maydell@linaro.org>2025-02-20 14:20:29 +0000
commitb2ba5ff272e0738c6b82197fe61f73344e5edcfb (patch)
tree01e5181ec44d29403fc9e31be090ae0e8277c952 /hw/arm/omap_sx1.c
parent464ce71a963b3dfc290cd59c3d1bfedf11c004df (diff)
downloadqemu-b2ba5ff272e0738c6b82197fe61f73344e5edcfb.zip
qemu-b2ba5ff272e0738c6b82197fe61f73344e5edcfb.tar.gz
qemu-b2ba5ff272e0738c6b82197fe61f73344e5edcfb.tar.bz2
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>
Diffstat (limited to 'hw/arm/omap_sx1.c')
0 files changed, 0 insertions, 0 deletions