diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2025-02-11 12:58:27 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2025-02-11 13:00:26 +0000 |
| commit | f0c29a02343d733154a64271124609cb5f117797 (patch) | |
| tree | ac11fca386a061abf39af7400dd19bc833430fe4 /fpu/softfloat.c | |
| parent | ffaf7f0376f8040ce9068d71ae9ae8722505c42e (diff) | |
| download | focaccia-qemu-f0c29a02343d733154a64271124609cb5f117797.tar.gz focaccia-qemu-f0c29a02343d733154a64271124609cb5f117797.zip | |
target/alpha: Don't corrupt error_code with unknown softfloat flags
In do_cvttq() we set env->error_code with what is supposed to be a
set of FPCR exception bit values. However, if the set of float
exception flags we get back from softfloat for the conversion
includes a flag which is not one of the three we expect here
(invalid_cvti, invalid, inexact) then we will fall through the
if-ladder and set env->error_code to the unconverted softfloat
exception_flag value. This will then cause us to take a spurious
exception.
This is harmless now, but when we add new floating point exception
flags to softfloat it will cause problems. Add an else clause to the
if-ladder to make it ignore any float exception flags it doesn't care
about.
Specifically, without this fix, 'make check-tcg' will fail for Alpha
when the commit adding float_flag_input_denormal_used lands.
Fixes: aa3bad5b59e7 ("target/alpha: Use float64_to_int64_modulo for CVTTQ")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'fpu/softfloat.c')
0 files changed, 0 insertions, 0 deletions