diff options
author | Stef O'Rear | 2018-03-03 12:46:00 +0100 |
---|---|---|
committer | Peter Maydell | 2018-03-09 15:30:12 +0100 |
commit | cffad426f520d39c19db64485d8a429fc95b8aca (patch) | |
tree | 83dc7634406fddf9dfef823a46b5d2c49a8de4e6 /fpu | |
parent | Merge remote-tracking branch 'remotes/riscv/tags/riscv-qemu-upstream-v8.2' in... (diff) | |
download | qemu-cffad426f520d39c19db64485d8a429fc95b8aca.tar.gz qemu-cffad426f520d39c19db64485d8a429fc95b8aca.tar.xz qemu-cffad426f520d39c19db64485d8a429fc95b8aca.zip |
softfloat: fix crash on int conversion of SNaN
Signed-off-by: Stef O'Rear <sorear2@gmail.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'fpu')
-rw-r--r-- | fpu/softfloat.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fpu/softfloat.c b/fpu/softfloat.c index e124df9f7e..6e16284e66 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -1342,6 +1342,8 @@ static int64_t round_to_int_and_pack(FloatParts in, int rmode, switch (p.cls) { case float_class_snan: case float_class_qnan: + case float_class_dnan: + case float_class_msnan: return max; case float_class_inf: return p.sign ? min : max; @@ -1430,6 +1432,8 @@ static uint64_t round_to_uint_and_pack(FloatParts in, int rmode, uint64_t max, switch (p.cls) { case float_class_snan: case float_class_qnan: + case float_class_dnan: + case float_class_msnan: s->float_exception_flags = orig_flags | float_flag_invalid; return max; case float_class_inf: |