diff options
author | John Platts <john_platts@hotmail.com> | 2023-11-10 18:41:42 +0000 |
---|---|---|
committer | Cédric Le Goater <clg@kaod.org> | 2023-11-21 08:39:58 +0100 |
commit | d18b0652869a39688d0fd2897bc035b309d1b6e8 (patch) | |
tree | e174c127967ec4da22e5225e0e9d69bf236d65eb /qemu-io.c | |
parent | 8bc5ae046d15fcd3e5de65225d5d3a8f1a5a6413 (diff) | |
download | qemu-d18b0652869a39688d0fd2897bc035b309d1b6e8.zip qemu-d18b0652869a39688d0fd2897bc035b309d1b6e8.tar.gz qemu-d18b0652869a39688d0fd2897bc035b309d1b6e8.tar.bz2 |
target/ppc: Fix bugs in VSX_CVT_FP_TO_INT and VSX_CVT_FP_TO_INT2 macros
The patch below fixes a bug in the VSX_CVT_FP_TO_INT and VSX_CVT_FP_TO_INT2
macros in target/ppc/fpu_helper.c where a non-NaN floating point value from the
source vector is incorrectly converted to 0, 0x80000000, or 0x8000000000000000
instead of the expected value if a preceding source floating point value from
the same source vector was a NaN.
The bug in the VSX_CVT_FP_TO_INT and VSX_CVT_FP_TO_INT2 macros in
target/ppc/fpu_helper.c was introduced with commit c3f24257e3c0.
This patch also adds a new vsx_f2i_nan test in tests/tcg/ppc64 that checks that
the VSX xvcvspsxws, xvcvspuxws, xvcvspsxds, xvcvspuxds, xvcvdpsxws, xvcvdpuxws,
xvcvdpsxds, and xvcvdpuxds instructions correctly convert non-NaN floating point
values to integer values if the source vector contains NaN floating point values.
Fixes: c3f24257e3c0 ("target/ppc: Clear fpstatus flags on helpers missing it")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1941
Signed-off-by: John Platts <john_platts@hotmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'qemu-io.c')
0 files changed, 0 insertions, 0 deletions