[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 03/11] softfloat: Introduce float_flag_inorm_denormal
From: |
Richard Henderson |
Subject: |
Re: [PATCH 03/11] softfloat: Introduce float_flag_inorm_denormal |
Date: |
Mon, 7 Jun 2021 13:52:52 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 |
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~