summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStafford Horne2020-01-10 22:28:43 +0100
committerRichard Henderson2020-01-17 01:50:43 +0100
commit97a254b3f03a184136e381c6d9fd80475e1795ac (patch)
tree0e2f6c1cadccbb62d061fd88c1c0313a0cbb454a
parentui/gtk: Get display refresh rate with GDK version 3.22 or later (diff)
downloadqemu-97a254b3f03a184136e381c6d9fd80475e1795ac.tar.gz
qemu-97a254b3f03a184136e381c6d9fd80475e1795ac.tar.xz
qemu-97a254b3f03a184136e381c6d9fd80475e1795ac.zip
target/openrisc: Fix FPCSR mask to allow setting DZF
The mask used when setting FPCSR allows setting bits 10 to 1. However, OpenRISC has flags and config bits in 11 to 1, 11 being Divide by Zero Flag (DZF). This seems like an off-by-one bug. This was found when testing the GLIBC test suite which has test cases to set and clear all bits. Signed-off-by: Stafford Horne <shorne@gmail.com> Message-Id: <20200110212843.27335-1-shorne@gmail.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--target/openrisc/fpu_helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/openrisc/fpu_helper.c b/target/openrisc/fpu_helper.c
index 59e1413279..6f75ea0505 100644
--- a/target/openrisc/fpu_helper.c
+++ b/target/openrisc/fpu_helper.c
@@ -70,7 +70,7 @@ void cpu_set_fpcsr(CPUOpenRISCState *env, uint32_t val)
float_round_down
};
- env->fpcsr = val & 0x7ff;
+ env->fpcsr = val & 0xfff;
set_float_rounding_mode(rm_to_sf[extract32(val, 1, 2)], &env->fp_status);
}