From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>, qemu-devel@nongnu.org
Cc: jsnow@redhat.com,
Richard Henderson <richard.henderson@linaro.org>,
f4bug@amsat.org, Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH v3 01/33] target/alpha: Use array for FPCR_DYN conversion
Date: Thu, 26 Sep 2019 00:35:43 +0200 [thread overview]
Message-ID: <0efac54b-e14c-03f0-1011-860f48aa9fdd@redhat.com> (raw)
In-Reply-To: <20190924210106.27117-2-alex.bennee@linaro.org>
On 9/24/19 11:00 PM, Alex Bennée wrote:
> From: Richard Henderson <richard.henderson@linaro.org>
>
> This is a bit more straight-forward than using a switch statement.
> No functional change.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Message-Id: <20190921043256.4575-2-richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> target/alpha/helper.c | 24 ++++++++----------------
> 1 file changed, 8 insertions(+), 16 deletions(-)
>
> diff --git a/target/alpha/helper.c b/target/alpha/helper.c
> index 19cda0a2db5..6c1703682e0 100644
> --- a/target/alpha/helper.c
> +++ b/target/alpha/helper.c
> @@ -36,6 +36,13 @@ uint64_t cpu_alpha_load_fpcr(CPUAlphaState *env)
>
> void cpu_alpha_store_fpcr(CPUAlphaState *env, uint64_t val)
> {
> + static const uint8_t rm_map[] = {
> + [FPCR_DYN_NORMAL >> FPCR_DYN_SHIFT] = float_round_nearest_even,
> + [FPCR_DYN_CHOPPED >> FPCR_DYN_SHIFT] = float_round_to_zero,
> + [FPCR_DYN_MINUS >> FPCR_DYN_SHIFT] = float_round_down,
> + [FPCR_DYN_PLUS >> FPCR_DYN_SHIFT] = float_round_up,
> + };
> +
> uint32_t fpcr = val >> 32;
> uint32_t t = 0;
>
> @@ -48,22 +55,7 @@ void cpu_alpha_store_fpcr(CPUAlphaState *env, uint64_t val)
> env->fpcr = fpcr;
> env->fpcr_exc_enable = ~t & FPCR_STATUS_MASK;
>
> - switch (fpcr & FPCR_DYN_MASK) {
> - case FPCR_DYN_NORMAL:
> - default:
> - t = float_round_nearest_even;
> - break;
> - case FPCR_DYN_CHOPPED:
> - t = float_round_to_zero;
> - break;
> - case FPCR_DYN_MINUS:
> - t = float_round_down;
> - break;
> - case FPCR_DYN_PLUS:
> - t = float_round_up;
> - break;
> - }
> - env->fpcr_dyn_round = t;
> + env->fpcr_dyn_round = rm_map[(fpcr & FPCR_DYN_MASK) >> FPCR_DYN_SHIFT];
>
> env->fpcr_flush_to_zero = (fpcr & FPCR_UNFD) && (fpcr & FPCR_UNDZ);
> env->fp_status.flush_inputs_to_zero = (fpcr & FPCR_DNZ) != 0;
>
next prev parent reply other threads:[~2019-09-25 22:36 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-24 21:00 [PATCH v3 00/33] testing/next (docker,tcg, alpha ;-) Alex Bennée
2019-09-24 21:00 ` [PATCH v3 01/33] target/alpha: Use array for FPCR_DYN conversion Alex Bennée
2019-09-25 22:35 ` Philippe Mathieu-Daudé [this message]
2019-09-24 21:00 ` [PATCH v3 02/33] target/alpha: Fix SWCR_MAP_UMZ Alex Bennée
2019-09-24 21:00 ` [PATCH v3 03/33] target/alpha: Fix SWCR_TRAP_ENABLE_MASK Alex Bennée
2019-09-25 22:35 ` Philippe Mathieu-Daudé
2019-09-24 21:00 ` [PATCH v3 04/33] target/alpha: Handle SWCR_MAP_DMZ earlier Alex Bennée
2019-09-24 21:00 ` [PATCH v3 05/33] target/alpha: Write to fpcr_flush_to_zero once Alex Bennée
2019-09-24 21:00 ` [PATCH v3 06/33] target/alpha: Mask IOV exception with INV for user-only Alex Bennée
2019-09-24 21:00 ` [PATCH v3 07/33] target/alpha: Tidy helper_fp_exc_raise_s Alex Bennée
2019-09-25 22:30 ` Philippe Mathieu-Daudé
2019-09-24 21:00 ` [PATCH v3 08/33] tests/migration: Fail on unexpected migration states Alex Bennée
2019-09-25 22:30 ` Philippe Mathieu-Daudé
2019-09-24 21:00 ` [PATCH v3 09/33] tests/migration/postcopy: trim migration bandwidth Alex Bennée
2019-09-24 21:00 ` [PATCH v3 10/33] migration/postcopy: Recognise the recovery states as 'in_postcopy' Alex Bennée
2019-09-24 21:00 ` [PATCH v3 11/33] target/ppc: fix signal delivery for ppc64abi32 Alex Bennée
2019-09-24 21:00 ` [PATCH v3 12/33] tests/docker: add sanitizers back to clang build Alex Bennée
2019-09-24 21:00 ` [PATCH v3 13/33] tests/docker: fix DOCKER_PARTIAL_IMAGES Alex Bennée
2019-09-24 21:00 ` [PATCH v3 14/33] tests/docker: remove python2.7 from debian9-mxe Alex Bennée
2019-09-25 22:27 ` Philippe Mathieu-Daudé
2019-09-24 21:00 ` [PATCH v3 15/33] tests/docker: reduce scary warnings by cleaning up clean up Alex Bennée
2019-09-25 18:55 ` Richard Henderson
2019-09-24 21:00 ` [PATCH v3 16/33] podman: fix command invocation Alex Bennée
2019-09-25 12:36 ` Thomas Huth
2019-09-24 21:00 ` [PATCH v3 17/33] tests/tcg: clean-up some comments after the de-tangling Alex Bennée
2019-09-25 22:07 ` Philippe Mathieu-Daudé
2019-09-25 22:10 ` Philippe Mathieu-Daudé
2019-09-24 21:00 ` [PATCH v3 18/33] tests/tcg: re-enable linux-test for ppc64abi32 Alex Bennée
2019-09-25 18:54 ` Richard Henderson
2019-09-25 22:13 ` Philippe Mathieu-Daudé
2019-09-24 21:00 ` [PATCH v3 19/33] tests/tcg: add float_madds test to multiarch Alex Bennée
2019-09-25 22:17 ` Philippe Mathieu-Daudé
2019-09-24 21:00 ` [PATCH v3 20/33] tests/tcg: add generic version of float_convs Alex Bennée
2019-09-25 22:26 ` Philippe Mathieu-Daudé
2019-09-24 21:00 ` [PATCH v3 21/33] tests/tcg: add simple record/replay smoke test for aarch64 Alex Bennée
2019-09-25 22:20 ` Philippe Mathieu-Daudé
2019-09-24 21:00 ` [PATCH v3 22/33] configure: preserve PKG_CONFIG for subdir builds Alex Bennée
2019-09-25 22:25 ` Philippe Mathieu-Daudé
2019-09-24 21:00 ` [PATCH v3 23/33] docs/devel: add "check-tcg" to testing.rst Alex Bennée
2019-09-25 18:58 ` Richard Henderson
2019-09-25 22:16 ` Philippe Mathieu-Daudé
2019-09-24 21:00 ` [PATCH v3 24/33] target/i386: Fix broken build with WHPX enabled Alex Bennée
2019-09-24 21:00 ` [PATCH v3 25/33] tests/docker: Add fedora-win10sdk-cross image Alex Bennée
2019-09-25 20:27 ` Philippe Mathieu-Daudé
2019-09-25 21:08 ` Alex Bennée
2019-09-24 21:00 ` [PATCH v3 26/33] .shippable.yml: Build WHPX enabled binaries Alex Bennée
2019-09-24 21:01 ` [PATCH v3 27/33] docker: remove debian8-mxe definitions Alex Bennée
2019-09-24 21:01 ` [PATCH v3 28/33] docker: removed unused debian8 partial image Alex Bennée
2019-09-25 12:43 ` Philippe Mathieu-Daudé
2019-09-24 21:01 ` [PATCH v3 29/33] docker: remove 'deprecated' image definitions Alex Bennée
2019-09-25 22:23 ` Philippe Mathieu-Daudé
2019-09-25 23:34 ` Alex Bennée
2019-09-26 4:28 ` Philippe Mathieu-Daudé
2019-09-26 16:04 ` Alex Bennée
2019-09-26 16:08 ` Philippe Mathieu-Daudé
2019-09-26 17:38 ` John Snow
2019-09-24 21:01 ` [PATCH v3 30/33] docker: remove unused debian-ports Alex Bennée
2019-09-25 22:23 ` Philippe Mathieu-Daudé
2019-09-24 21:01 ` [PATCH v3 31/33] docker: remove unused debian-sid Alex Bennée
2019-09-25 22:22 ` Philippe Mathieu-Daudé
2019-09-24 21:01 ` [PATCH v3 32/33] docker: move tests from python2 to python3 Alex Bennée
2019-09-25 22:22 ` Philippe Mathieu-Daudé
2019-09-24 21:01 ` [PATCH v3 33/33] tests/docker: remove debian-powerpc-user-cross Alex Bennée
2019-09-25 18:57 ` Richard Henderson
2019-09-25 22:21 ` Philippe Mathieu-Daudé
2019-09-27 12:08 ` [PATCH v3 00/33] testing/next (docker,tcg, alpha ;-) no-reply
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=0efac54b-e14c-03f0-1011-860f48aa9fdd@redhat.com \
--to=philmd@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=f4bug@amsat.org \
--cc=jsnow@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=rth@twiddle.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).