[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/18] target-alpha: Store IOV exception in fp_status
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 03/18] target-alpha: Store IOV exception in fp_status |
Date: |
Wed, 9 Jul 2014 09:20:19 -0700 |
We were not representing the IOV (integer overflow) exception at all.
For ease of implementation, allocate a generic bit in softfloat, even
though softfloat will never raise the exception itself.
This can be licensed under either the softfloat-2a or -2b license.
Reported-by: Al Viro <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
include/fpu/softfloat.h | 13 +++++++------
target-alpha/fpu_helper.c | 3 +++
target-alpha/helper.c | 6 ++++++
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index 77177c5..946fd3e 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -159,12 +159,13 @@ enum {
| Software IEC/IEEE floating-point exception flags.
*----------------------------------------------------------------------------*/
enum {
- float_flag_invalid = 1,
- float_flag_divbyzero = 4,
- float_flag_overflow = 8,
- float_flag_underflow = 16,
- float_flag_inexact = 32,
- float_flag_input_denormal = 64,
+ float_flag_invalid = 1,
+ float_flag_int_overflow = 2,
+ float_flag_divbyzero = 4,
+ float_flag_overflow = 8,
+ float_flag_underflow = 16,
+ float_flag_inexact = 32,
+ float_flag_input_denormal = 64,
float_flag_output_denormal = 128
};
diff --git a/target-alpha/fpu_helper.c b/target-alpha/fpu_helper.c
index d2d776c..aa83766 100644
--- a/target-alpha/fpu_helper.c
+++ b/target-alpha/fpu_helper.c
@@ -53,6 +53,9 @@ static inline void inline_fp_exc_raise(CPUAlphaState *env,
uintptr_t retaddr,
if (exc & float_flag_invalid) {
hw_exc |= EXC_M_INV;
}
+ if (exc & float_flag_int_overflow) {
+ hw_exc |= EXC_M_IOV;
+ }
if (exc & float_flag_divbyzero) {
hw_exc |= EXC_M_DZE;
}
diff --git a/target-alpha/helper.c b/target-alpha/helper.c
index 8d1df2d..6bcde21 100644
--- a/target-alpha/helper.c
+++ b/target-alpha/helper.c
@@ -36,6 +36,9 @@ uint64_t cpu_alpha_load_fpcr (CPUAlphaState *env)
if (t & float_flag_invalid) {
r |= FPCR_INV;
}
+ if (t & float_flag_int_overflow) {
+ r |= FPCR_IOV;
+ }
if (t & float_flag_divbyzero) {
r |= FPCR_DZE;
}
@@ -103,6 +106,9 @@ void cpu_alpha_store_fpcr (CPUAlphaState *env, uint64_t val)
if (val & FPCR_INV) {
t |= float_flag_invalid;
}
+ if (val & FPCR_IOV) {
+ t |= float_flag_int_overflow;
+ }
if (val & FPCR_DZE) {
t |= float_flag_divbyzero;
}
--
1.9.3
- [Qemu-devel] [PULL 15/18] target-alpha: Raise IOV from CVTQL, (continued)
- [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, 2014/07/10
- [Qemu-devel] [PULL 03/18] target-alpha: Store IOV exception in fp_status,
Richard Henderson <=