From: "Alex Bennée" <alex.bennee@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>,
armbru@redhat.com
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 [thread overview]
Message-ID: <871rxpnq27.fsf@linaro.org> (raw)
In-Reply-To: <02e9e013-da2d-38cd-6d92-035023f0d963@linaro.org>
Richard Henderson <richard.henderson@linaro.org> 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
next prev parent reply other threads:[~2019-08-13 13:39 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-13 12:49 [Qemu-devel] [PATCH v3 00/13] softfloat updates (include tweaks, rm LIT64) Alex Bennée
2019-08-13 12:49 ` [Qemu-devel] [PATCH v3 01/13] fpu: replace LIT64 usage with UINT64_C for specialize constants Alex Bennée
2019-08-13 12:59 ` Richard Henderson
2019-08-13 12:49 ` [Qemu-devel] [PATCH v3 02/13] fpu: convert float[16/32/64]_squash_denormal to new modern style Alex Bennée
2019-08-13 13:11 ` Richard Henderson
2019-08-13 13:38 ` Alex Bennée [this message]
2019-08-13 12:49 ` [Qemu-devel] [PATCH v3 03/13] fpu: optimise float[16/32/64]_squash_denormal (HACK?) Alex Bennée
2019-08-13 13:12 ` Richard Henderson
2019-08-13 12:49 ` [Qemu-devel] [PATCH v3 04/13] fpu: use min/max values from stdint.h for integral overflow Alex Bennée
2019-08-13 13:13 ` Richard Henderson
2019-08-15 14:48 ` Aleksandar Markovic
2019-08-15 15:49 ` Alex Bennée
2019-08-13 12:49 ` [Qemu-devel] [PATCH v3 05/13] fpu: replace LIT64 with UINT64_C macros Alex Bennée
2019-08-13 13:14 ` Richard Henderson
2019-08-13 12:49 ` [Qemu-devel] [PATCH v3 06/13] target/m68k: " Alex Bennée
2019-08-13 13:15 ` Richard Henderson
2019-08-13 12:49 ` [Qemu-devel] [PATCH v3 07/13] fpu: remove the LIT64 macro Alex Bennée
2019-08-13 13:15 ` Richard Henderson
2019-08-13 12:49 ` [Qemu-devel] [PATCH v3 08/13] fpu: move inline helpers into a separate header Alex Bennée
2019-08-13 12:49 ` [Qemu-devel] [PATCH v3 09/13] fpu: make softfloat-macros "self-contained" Alex Bennée
2019-08-13 12:49 ` [Qemu-devel] [PATCH v3 10/13] fpu: rename softfloat-specialize.h -> .inc.c Alex Bennée
2019-08-13 12:49 ` [Qemu-devel] [PATCH v3 11/13] target/mips: rationalise softfloat includes Alex Bennée
2019-08-13 12:49 ` [Qemu-riscv] [PATCH v3 12/13] target/riscv: " Alex Bennée
2019-08-13 12:49 ` [Qemu-devel] " Alex Bennée
2019-08-13 13:05 ` [Qemu-riscv] " Philippe Mathieu-Daudé
2019-08-13 13:05 ` Philippe Mathieu-Daudé
2019-08-13 12:49 ` [Qemu-devel] [PATCH v3 13/13] targets (various): use softfloat-helpers.h where we can Alex Bennée
2019-08-13 13:15 ` Philippe Mathieu-Daudé
2019-08-13 13:19 ` [Qemu-devel] [PATCH v3 00/13] softfloat updates (include tweaks, rm LIT64) no-reply
2019-08-13 13:30 ` no-reply
2019-08-13 13:57 ` Markus Armbruster
2019-08-13 14:15 ` 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=871rxpnq27.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=aurelien@aurel32.net \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.