qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: mmorrell@tachyum.com, qemu-devel@nongnu.org
Subject: Re: [PATCH 03/11] softfloat: Introduce float_flag_inorm_denormal
Date: Mon, 7 Jun 2021 13:52:52 -0700	[thread overview]
Message-ID: <2d66f57e-7ff0-4d57-22e1-d5156665e2fb@linaro.org> (raw)
In-Reply-To: <87pmwxmw0i.fsf@linaro.org>

On 6/7/21 10:19 AM, Alex Bennée wrote:
>> If you've got a better ordering of operations for this, do tell.
> 
> What I really want is to know which instructions translate into the if
> (s->flush_inputs_to_zero) and verifying that is only checked once. Maybe
> I'm just suspicious of compilers ability to optimise things away...




>   Dump of assembler code for function float32_mul:
>      0x0000000000895d60 <+0>:	movzbl 0x1(%rdx),%eax
>      0x0000000000895d64 <+4>:	test   $0x10,%al
>      0x0000000000895d66 <+6>:	je     0x895e30 <float32_mul+208>

s->float_exception_flags & float_flag_inexact

>      0x0000000000895d6c <+12>:	cmpb   $0x0,(%rdx)
>      0x0000000000895d6f <+15>:	jne    0x895e30 <float32_mul+208>

s->float_rounding_mode == float_round_nearest_even

>      0x0000000000895d75 <+21>:	test   $0x7f800000,%edi
>      0x0000000000895d7b <+27>:	jne    0x895da0 <float32_mul+64>
>      0x0000000000895d7d <+29>:	test   $0x7fffffff,%edi
>      0x0000000000895d83 <+35>:	je     0x895da0 <float32_mul+64>

float32_is_denormal

>      0x0000000000895d85 <+37>:	cmpb   $0x0,0x5(%rdx)
>      0x0000000000895d89 <+41>:	je     0x895e60 <float32_mul+256>

s->flush_inputs_to_zero

>      0x0000000000895d8f <+47>:	or     $0x40,%eax
>      0x0000000000895d92 <+50>:	and    $0x80000000,%edi
>      0x0000000000895d98 <+56>:	mov    %al,0x1(%rdx)

flush-to-zero and set iflush_denormal

>      0x0000000000895da0 <+64>:	test   $0x7f800000,%esi
>      0x0000000000895da6 <+70>:	jne    0x895dd0 <float32_mul+112>
>      0x0000000000895da8 <+72>:	test   $0x7fffffff,%esi
>      0x0000000000895dae <+78>:	je     0x895dd0 <float32_mul+112>

float32_is_denormal (second operand)

>      0x0000000000895db0 <+80>:	cmpb   $0x0,0x5(%rdx)
>      0x0000000000895db4 <+84>:	movzbl 0x1(%rdx),%eax
>      0x0000000000895db8 <+88>:	je     0x895e50 <float32_mul+240>
>      0x0000000000895dbe <+94>:	or     $0x40,%eax
>      0x0000000000895dc1 <+97>:	and    $0x80000000,%esi

s->flush_inputs_to_zero,
flush-to-zero,
set iflush_denormal.

...

>      0x0000000000895e50 <+240>:	or     $0x20,%eax
>      0x0000000000895e53 <+243>:	mov    %al,0x1(%rdx)
>      0x0000000000895e56 <+246>:	jmpq   0x895dd0 <float32_mul+112>

set inorm_denormal (second operand)

>      0x0000000000895e60 <+256>:	or     $0x20,%eax
>      0x0000000000895e63 <+259>:	mov    %al,0x1(%rdx)
>      0x0000000000895e66 <+262>:	jmpq   0x895da0 <float32_mul+64>

set inorm_denormal (first operand)

There do seem to be 3 reads/writes to exception_flags for float_raise.


r~


  reply	other threads:[~2021-06-07 20:53 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27  4:13 [PATCH 00/11] softfloat: Improve denormal handling Richard Henderson
2021-05-27  4:13 ` [PATCH 01/11] softfloat: Rename float_flag_input_denormal to float_flag_iflush_denormal Richard Henderson
2021-06-07 15:16   ` Alex Bennée
2021-06-19 15:08   ` Philippe Mathieu-Daudé
2021-05-27  4:13 ` [PATCH 02/11] softfloat: Rename float_flag_output_denormal to float_flag_oflush_denormal Richard Henderson
2021-06-07 15:16   ` Alex Bennée
2021-06-19 15:08   ` Philippe Mathieu-Daudé
2021-05-27  4:13 ` [PATCH 03/11] softfloat: Introduce float_flag_inorm_denormal Richard Henderson
2021-05-28 17:41   ` Michael Morrell
2021-05-29 15:21     ` Richard Henderson
2021-07-14 16:44       ` Michael Morrell
2021-07-14 16:57         ` Richard Henderson
2021-07-14 17:50           ` Michael Morrell
2022-01-12  0:02             ` Michael Morrell
2021-06-07 15:35   ` Alex Bennée
2021-06-07 16:28     ` Alex Bennée
2021-06-07 16:41     ` Richard Henderson
2021-06-07 17:19       ` Alex Bennée
2021-06-07 20:52         ` Richard Henderson [this message]
2021-05-27  4:13 ` [PATCH 04/11] softfloat: Introduce float_flag_result_denormal Richard Henderson
2021-06-07 16:30   ` Alex Bennée
2021-06-19 15:10   ` Philippe Mathieu-Daudé
2021-05-27  4:13 ` [PATCH 05/11] target/i386: Use float_flag_inorm_denormal Richard Henderson
2021-06-19 18:41   ` Richard Henderson
2021-05-27  4:14 ` [PATCH 06/11] target/rx: Handle the FPSW.DN bit in helper_set_fpsw Richard Henderson
2021-05-28 15:34   ` Yoshinori Sato
2021-05-27  4:14 ` [PATCH 07/11] target/rx: Use FloatRoundMode " Richard Henderson
2021-05-28 15:35   ` Yoshinori Sato
2021-06-01  3:27   ` Philippe Mathieu-Daudé
2021-05-27  4:14 ` [PATCH 08/11] target/rx: Fix setting of FPSW.CE Richard Henderson
2021-05-28 15:35   ` Yoshinori Sato
2021-05-27  4:14 ` [PATCH 09/11] target/mips: Drop inline markers from msa_helper.c Richard Henderson
2021-06-01  3:27   ` Philippe Mathieu-Daudé
2021-05-27  4:14 ` [PATCH 10/11] target/mips: Do not check MSACSR_FS_MASK in update_msacsr Richard Henderson
2021-06-19 15:15   ` Philippe Mathieu-Daudé
2021-05-27  4:14 ` [PATCH 11/11] target/mips: Drop denormal operand to update_msacsr Richard Henderson
2021-06-01  3:29   ` Philippe Mathieu-Daudé
2021-06-07 16:31 ` [PATCH 00/11] softfloat: Improve denormal handling 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=2d66f57e-7ff0-4d57-22e1-d5156665e2fb@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=mmorrell@tachyum.com \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).