Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12527: cpp_bin_float: Anal fixation. Part 3. Double rounding when result of convert_to<double>() is a subnormal
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-11-19 22:58:53
#12527: cpp_bin_float: Anal fixation. Part 3. Double rounding when result of
convert_to<double>() is a subnormal
-------------------------------+----------------------------
Reporter: Michael Shatz | Owner: johnmaddock
Type: Bugs | Status: reopened
Milestone: To Be Determined | Component: multiprecision
Version: Boost 1.62.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+----------------------------
Comment (by Michael Shatz):
I finally came to testing your new version.
It is not bad. Appears to produce correct results. It is not quite as fast
as the one, I suggested in comment 14.
But the difference (on gcc 5.3.0/Mingw x64/Intel Ivy Bridge) is only 30-35
clocks, so it's not mighty important.
In the process I figured out why ldexp() was painfully slow in part of my
measurement and rather acceptable in the others. The reason is a
performance bug in my version of gcc when the code is compiled with -mavx
flag (my personal default).
gcc/mingw64 implementation of ldexp() is the same for -mavx and -mno-avx.
It uses "legacy" SSE instructions. So, when the function is called from
AVX code, compiler should have been inserting zeroupper instruction before
the call. But gcc forgot to do it, which leads to the switching penalty of
150-200 clocks on all Intel processors starting from Sandy Bridge and up
to Broadwell. I heard that on Skylake the penalty is much smaller, but
still exists.
gcc maintainers practically never fix anything in their old versions, not
even obvious mistakes in documentation, so it does not make much practical
sense reporting bugs in 5.3.0.
But if you see similar behavior in 6.2.0 then it's worth reporting.
I can't do it easily myself, because right now I how no machine with 6.2
installed.
Regard,
Michael
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12527#comment:20> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC