From: Cornelia Huck <cohuck@redhat.com>
To: Ulrich Weigand <ulrich.weigand@de.ibm.com>,
Richard Henderson <richard.henderson@linaro.org>,
david@redhat.com, thuth@redhat.com, qemu-s390x@nongnu.org,
qemu-devel@nongnu.org
Subject: Re: [PATCH v3] target/s390x: Fix CC set by CONVERT TO FIXED/LOGICAL
Date: Thu, 01 Jul 2021 15:56:36 +0200 [thread overview]
Message-ID: <87czs2jfxn.fsf@redhat.com> (raw)
In-Reply-To: <20210630105058.GA29130@oc3748833570.ibm.com>
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 parent reply other threads:[~2021-07-01 13:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-30 10:50 [PATCH v3] target/s390x: Fix CC set by CONVERT TO FIXED/LOGICAL Ulrich Weigand
2021-06-30 18:47 ` Richard Henderson
2021-07-01 13:56 ` Cornelia Huck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87czs2jfxn.fsf@redhat.com \
--to=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
--cc=ulrich.weigand@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.