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: Alex Bennée
Subject: Re: [Qemu-devel] [PULL v3 08/15] tests/fp: add fp-bench
Date: Tue, 18 Dec 2018 14:38:15 +0000
User-agent: mu4e 1.1.0; emacs 26.1.90

Emilio G. Cota <address@hidden> writes:

> 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.

I spoke too soon - it got merged today. If you can send a proper patch
I'll add it to my queue.

--
Alex Bennée



reply via email to

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