qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PULL v3 08/15] tests/fp: add fp-bench


From: Emilio G. Cota
Subject: Re: [Qemu-devel] [PULL v3 08/15] tests/fp: add fp-bench
Date: Mon, 17 Dec 2018 20:47:07 -0500
User-agent: Mutt/1.9.4 (2018-02-28)

On Mon, Dec 17, 2018 at 10:56:43 +0000, Alex Bennée wrote:
> From: "Emilio G. Cota" <address@hidden>
> +static void update_random_ops(int n_ops, enum precision prec)
> +{
> +    int i;
> +
> +    for (i = 0; i < n_ops; i++) {
> +        uint64_t r = random_ops[i];
> +
> +        if (prec == PREC_SINGLE || PREC_FLOAT32) {
> +            do {
> +                r = xorshift64star(r);
> +            } while (!float32_is_normal(r));
> +        } else if (prec == PREC_DOUBLE || PREC_FLOAT64) {

I just noticed that there's a bug here (I was seeing non-normals
where I didn't expect any):

     for (i = 0; i < n_ops; i++) {
         uint64_t r = random_ops[i];
 
-        if (prec == PREC_SINGLE || PREC_FLOAT32) {
+        if (prec == PREC_SINGLE || prec == PREC_FLOAT32) {
             do {
                 r = xorshift64star(r);
             } while (!float32_is_normal(r));
-        } else if (prec == PREC_DOUBLE || PREC_FLOAT64) {
+        } else if (prec == PREC_DOUBLE || prec == PREC_FLOAT64) {
             do {
                 r = xorshift64star(r);
             } while (!float64_is_normal(r));

Let me know if you want me to send a proper patch (this is non-critical
so it's OK to fix after merging) or you'd rather fix it up directly.

Thanks,

                E.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]