mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-02-08 17:20:45 -07:00
s390x/tcg: Fix simulated-IEEE exceptions
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 <richard.henderson@linaro.org> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20190218122710.23639-8-david@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
This commit is contained in:
parent
f66a0ecf23
commit
8772bbe4e7
1 changed files with 13 additions and 0 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue