]> git.proxmox.com Git - mirror_qemu.git/commit
target/arm: Fix float16 to/from int16
authorRichard Henderson <richard.henderson@linaro.org>
Thu, 10 May 2018 17:10:58 +0000 (18:10 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 18 Jul 2018 15:46:52 +0000 (10:46 -0500)
commitc708ce7d6ea9fdaf108fc3510beee5d6ad96f598
treea219de36853a2fa881a4d2adaa427660c32d296b
parent0aaf1cca02dd166aa1f1585afc26cb703ed7c8ee
target/arm: Fix float16 to/from int16

The instruction "ucvtf v0.4h, v04h, #2", with input 0x8000u,
overflows the intermediate float16 to infinity before we have a
chance to scale the output.  Use float64 as the intermediate type
so that no input argument (uint32_t in this case) can overflow
or round before scaling.  Given the declared argument, the signed
int32_t function has the same problem.

When converting from float16 to integer, using u/int32_t instead
of u/int16_t means that the bounding is incorrect.

Cc: qemu-stable@nongnu.org
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20180502221552.3873-4-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 88808a022c06f98d81cd3f2d105a5734c5614839)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
target/arm/helper.c
target/arm/helper.h
target/arm/translate-a64.c