qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 02/13] fpu: convert float[16/32/64]_squash_de


From: Alex Bennée
Subject: Re: [Qemu-devel] [PATCH v3 02/13] fpu: convert float[16/32/64]_squash_denormal to new modern style
Date: Tue, 13 Aug 2019 14:38:24 +0100
User-agent: mu4e 1.3.4; emacs 27.0.50

Richard Henderson <address@hidden> writes:

> On 8/13/19 1:49 PM, Alex Bennée wrote:
>> +static FloatParts parts_squash_denormal(FloatParts p, float_status *status)
>> +{
>> +    if (p.exp == 0 && p.frac != 0) {
>> +        float_raise(float_flag_input_denormal, status);
>> +        p.frac = 0;
>> +        p.cls = float_class_zero;
>> +    }
>> +
>> +    return p;
>> +}
>> +
>> +float16 float16_squash_input_denormal(float16 a, float_status *status)
>> +{
>> +    if (status->flush_inputs_to_zero) {
>> +        FloatParts p = float16_unpack_raw(a);
>> +        p = parts_squash_denormal(p, status);
>> +        return float16_pack_raw(p);
>> +    }
>> +    return a;
>> +}
>
> Hmm.  Maybe avoid the re-pack in the likely chance that we can?
>
> static bool parts_squash_denormal(FloatParts p, float_status *status)
> {
>     if (p.exp == 0 && p.frac != 0) {
>         float_raise(float_flag_input_denormal, status);
>         return true;
>     }
>     return false;
> }
>
> float16 float16_squash_input_denormal(float16 a, float_status *status)
> {
>     if (status->flush_inputs_to_zero) {
>         FloatParts p = float16_unpack_raw(a);
>         if (parts_squash_denormal(p, status)) {
>             return float16_set_sign(float16_zero, p.sign);
>         }

I'll squash with the next patch and use the set_sign rather than
make_float and see if it's the same.

>     }
>     return a;
> }


--
Alex Bennée



reply via email to

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