[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/18] target-alpha: Ignore the unused fp_status exce
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 12/18] target-alpha: Ignore the unused fp_status exceptions |
Date: |
Wed, 9 Jul 2014 09:20:28 -0700 |
Mask out the exceptions that have no correspondance on
Alpha so that zero/non-zero tests work as expected.
Reported-by: Al Viro <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
target-alpha/fpu_helper.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/target-alpha/fpu_helper.c b/target-alpha/fpu_helper.c
index 9b297de..f7fe31e 100644
--- a/target-alpha/fpu_helper.c
+++ b/target-alpha/fpu_helper.c
@@ -68,12 +68,17 @@ static inline void fp_exc_raise1(CPUAlphaState *env,
uintptr_t retaddr,
arith_excp(env, retaddr, hw_exc, 1ull << regno);
}
+/* There are several flags that softfloat raises that are irrelevant. */
+#define EXC_MASK (float_flag_invalid | float_flag_int_overflow \
+ | float_flag_divbyzero | float_flag_overflow \
+ | float_flag_underflow | float_flag_inexact)
+
/* Raise exceptions for ieee fp insns without software completion.
In that case there are no exceptions that don't trap; the mask
doesn't apply. */
void helper_fp_exc_raise(CPUAlphaState *env, uint32_t ignore, uint32_t regno)
{
- uint32_t exc = (uint8_t)env->fp_status.float_exception_flags;
+ uint32_t exc = env->fp_status.float_exception_flags & EXC_MASK;
if (exc) {
env->fpcr_exc_status |= exc;
exc &= ~ignore;
@@ -86,7 +91,7 @@ void helper_fp_exc_raise(CPUAlphaState *env, uint32_t ignore,
uint32_t regno)
/* Raise exceptions for ieee fp insns with software completion. */
void helper_fp_exc_raise_s(CPUAlphaState *env, uint32_t ignore, uint32_t regno)
{
- uint32_t exc = (uint8_t)env->fp_status.float_exception_flags;
+ uint32_t exc = env->fp_status.float_exception_flags & EXC_MASK;
if (exc) {
env->fpcr_exc_status |= exc;
exc &= ~ignore;
--
1.9.3
- [Qemu-devel] [PULL 16/18] target-alpha: Rename fcvtql, (continued)
- [Qemu-devel] [PULL 16/18] target-alpha: Rename fcvtql, Richard Henderson, 2014/07/09
- [Qemu-devel] [PULL 15/18] target-alpha: Raise IOV from CVTQL, Richard Henderson, 2014/07/09
- [Qemu-devel] [PULL 11/18] target-alpha: Disallow literal operand to 1C.30 to 1C.37, Richard Henderson, 2014/07/09
- [Qemu-devel] [PULL 17/18] target-alpha: Fix fpcr_flush_to_zero initialization, Richard Henderson, 2014/07/09
- [Qemu-devel] [PULL 18/18] target-alpha: Remove DNOD bit from FPCR, Richard Henderson, 2014/07/09
- [Qemu-devel] [PULL 09/18] target-alpha: Fix integer overflow checking insns, Richard Henderson, 2014/07/10
- [Qemu-devel] [PULL 05/18] target-alpha: Set EXC_M_SWC for exceptions from /S insns, Richard Henderson, 2014/07/10
- [Qemu-devel] [PULL 14/18] target-alpha: Suppress underflow from CVTTQ if DNZ, Richard Henderson, 2014/07/10
- [Qemu-devel] [PULL 13/18] target-alpha: Raise EXC_M_INV properly for fp inputs, Richard Henderson, 2014/07/10
- [Qemu-devel] [PULL 01/18] target-alpha: Forget installed round mode after MT_FPCR, Richard Henderson, 2014/07/10
- [Qemu-devel] [PULL 12/18] target-alpha: Ignore the unused fp_status exceptions,
Richard Henderson <=
- [Qemu-devel] [PULL 03/18] target-alpha: Store IOV exception in fp_status, Richard Henderson, 2014/07/10