[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PATCH v3 07/15] s390x/tcg: Fix simulated-IEEE exceptions
From: |
David Hildenbrand |
Subject: |
[qemu-s390x] [PATCH v3 07/15] s390x/tcg: Fix simulated-IEEE exceptions |
Date: |
Mon, 18 Feb 2019 13:27:02 +0100 |
The trap is triggered based on priority of the enabled signaling flags.
Only overflow and underflow allow a concurrent inexact exception.
z14 PoP, 9-33, Figure 9-21
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
---
target/s390x/fpu_helper.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/target/s390x/fpu_helper.c b/target/s390x/fpu_helper.c
index ea5a37ac5e..7508c0748e 100644
--- a/target/s390x/fpu_helper.c
+++ b/target/s390x/fpu_helper.c
@@ -789,6 +789,19 @@ void HELPER(sfas)(CPUS390XState *env, uint64_t fpc)
*/
s390_exc = (signalling >> 16) & (fpc >> 24);
if (s390_exc) {
+ if (s390_exc & S390_IEEE_MASK_INVALID) {
+ s390_exc = S390_IEEE_MASK_INVALID;
+ } else if (s390_exc & S390_IEEE_MASK_DIVBYZERO) {
+ s390_exc = S390_IEEE_MASK_DIVBYZERO;
+ } else if (s390_exc & S390_IEEE_MASK_OVERFLOW) {
+ s390_exc &= (S390_IEEE_MASK_OVERFLOW | S390_IEEE_MASK_INEXACT);
+ } else if (s390_exc & S390_IEEE_MASK_UNDERFLOW) {
+ s390_exc &= (S390_IEEE_MASK_UNDERFLOW | S390_IEEE_MASK_INEXACT);
+ } else if (s390_exc & S390_IEEE_MASK_INEXACT) {
+ s390_exc = S390_IEEE_MASK_INEXACT;
+ } else if (s390_exc & S390_IEEE_MASK_QUANTUM) {
+ s390_exc = S390_IEEE_MASK_QUANTUM;
+ }
tcg_s390_data_exception(env, s390_exc | 3, GETPC());
}
}
--
2.17.2
- [qemu-s390x] [PATCH v3 00/15] s390x/tcg: Implement floating-point extension facility, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 01/15] s390x/tcg: Fix TEST DATA CLASS instructions, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 02/15] s390x/tcg: Fix rounding from float128 to uint64_t/uin32_t, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 04/15] s390x/tcg: Fix parts of IEEE exception handling, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 05/15] s390x/tcg: Hide IEEE underflows in some scenarios, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 03/15] s390x/tcg: Factor out conversion of softfloat exceptions, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 06/15] s390x/tcg: Refactor SET FPC AND SIGNAL handling, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 07/15] s390x/tcg: Fix simulated-IEEE exceptions,
David Hildenbrand <=
- [qemu-s390x] [PATCH v3 08/15] s390x/tcg: Handle SET FPC AND LOAD FPC 3-bit BFP rounding modes, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 09/15] s390x/tcg: Check for exceptions in SET BFP ROUNDING MODE, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 10/15] s390x/tcg: Refactor saving/restoring the bfp rounding mode, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 11/15] s390x/tcg: Prepare for IEEE-inexact-exception control (XxC), David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 13/15] s390x/tcg: Implement rounding mode and XxC for LOAD ROUNDED, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 14/15] s390x/tcg: Handle all rounding modes overwritten by BFP instructions, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 12/15] s390x/tcg: Implement XxC and checks for most FP instructions, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 15/15] s390x: Add floating-point extension facility to "qemu" cpu model, David Hildenbrand, 2019/02/18