qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Emilio G. Cota" <cota@braap.org>, qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [Qemu-devel] [PATCH 1/2] fp-bench: fix update_random_ops
Date: Mon, 7 Jan 2019 18:51:59 +0100	[thread overview]
Message-ID: <0f16e9a4-9a5c-d1b0-16d3-daa480fc1491@redhat.com> (raw)
In-Reply-To: <20181221195200.6544-2-cota@braap.org>

On 12/21/18 8:51 PM, Emilio G. Cota wrote:
> The second test in the branches is wrong; fix while converting
> to a switch statement, which is easier to get right.
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>
> ---
>  tests/fp/fp-bench.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/fp/fp-bench.c b/tests/fp/fp-bench.c
> index f5bc5edebf..546bac9c9c 100644
> --- a/tests/fp/fp-bench.c
> +++ b/tests/fp/fp-bench.c
> @@ -143,15 +143,20 @@ static void update_random_ops(int n_ops, enum precision prec)
>      for (i = 0; i < n_ops; i++) {
>          uint64_t r = random_ops[i];
>  
> -        if (prec == PREC_SINGLE || PREC_FLOAT32) {

:)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> +        switch (prec) {
> +        case PREC_SINGLE:
> +        case PREC_FLOAT32:
>              do {
>                  r = xorshift64star(r);
>              } while (!float32_is_normal(r));
> -        } else if (prec == PREC_DOUBLE || PREC_FLOAT64) {
> +            break;
> +        case PREC_DOUBLE:
> +        case PREC_FLOAT64:
>              do {
>                  r = xorshift64star(r);
>              } while (!float64_is_normal(r));
> -        } else {
> +            break;
> +        default:
>              g_assert_not_reached();
>          }
>          random_ops[i] = r;
> 

  parent reply	other threads:[~2019-01-07 17:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21 19:51 [Qemu-devel] [PATCH 0/2] fp-bench fixes Emilio G. Cota
2018-12-21 19:51 ` [Qemu-devel] [PATCH 1/2] fp-bench: fix update_random_ops Emilio G. Cota
2018-12-25 20:45   ` Richard Henderson
2019-01-07 17:51   ` Philippe Mathieu-Daudé [this message]
2018-12-21 19:52 ` [Qemu-devel] [PATCH 2/2] fp-bench: remove wrong exponent raise in fill_random Emilio G. Cota
2018-12-25 20:46   ` Richard Henderson
2019-01-07 11:37 ` [Qemu-devel] [PATCH 0/2] fp-bench fixes Alex Bennée

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=0f16e9a4-9a5c-d1b0-16d3-daa480fc1491@redhat.com \
    --to=philmd@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=cota@braap.org \
    --cc=qemu-devel@nongnu.org \
    /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).