[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
- [Qemu-devel] [PATCH v3 00/13] softfloat updates (include tweaks, rm LIT64), Alex Bennée, 2019/08/13
- [Qemu-devel] [PATCH v3 01/13] fpu: replace LIT64 usage with UINT64_C for specialize constants, Alex Bennée, 2019/08/13
- [Qemu-devel] [PATCH v3 02/13] fpu: convert float[16/32/64]_squash_denormal to new modern style, Alex Bennée, 2019/08/13
- [Qemu-devel] [PATCH v3 04/13] fpu: use min/max values from stdint.h for integral overflow, Alex Bennée, 2019/08/13
- [Qemu-devel] [PATCH v3 03/13] fpu: optimise float[16/32/64]_squash_denormal (HACK?), Alex Bennée, 2019/08/13
- [Qemu-devel] [PATCH v3 07/13] fpu: remove the LIT64 macro, Alex Bennée, 2019/08/13
- [Qemu-devel] [PATCH v3 05/13] fpu: replace LIT64 with UINT64_C macros, Alex Bennée, 2019/08/13