[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] target/s390x: Fix CC set by CONVERT TO FIXED/LOGICAL
From: |
Cornelia Huck |
Subject: |
Re: [PATCH v3] target/s390x: Fix CC set by CONVERT TO FIXED/LOGICAL |
Date: |
Thu, 01 Jul 2021 15:56:36 +0200 |
User-agent: |
Notmuch/0.32.1 (https://notmuchmail.org) |
On Wed, Jun 30 2021, Ulrich Weigand <ulrich.weigand@de.ibm.com> wrote:
> The FP-to-integer conversion instructions need to set CC 3 whenever
> a "special case" occurs; this is the case whenever the instruction
> also signals the IEEE invalid exception. (See e.g. figure 19-18
> in the Principles of Operation.)
>
> However, qemu currently will set CC 3 only in the case where the
> input was a NaN. This is indeed one of the special cases, but
> there are others, most notably the case where the input is out
> of range of the target data type.
>
> This patch fixes the problem by switching these instructions to
> the "static" CC method and computing the correct result directly
> in the helper. (It cannot be re-computed later as the information
> about the invalid exception is no longer available.)
>
> This fixes a bug observed when running the wasmtime test suite
> under the s390x-linux-user target.
>
> Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
> ---
> target/s390x/fpu_helper.c | 63
> ++++++++++++++++++++++++++++++++++++++++++++---
> target/s390x/helper.h | 24 +++++++++---------
> target/s390x/translate.c | 39 +++++++++--------------------
> 3 files changed, 83 insertions(+), 43 deletions(-)
Thanks, applied.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v3] target/s390x: Fix CC set by CONVERT TO FIXED/LOGICAL,
Cornelia Huck <=