Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9233: Suboptimal shift by multiples of 8 bits
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-02-26 10:19:04
#9233: Suboptimal shift by multiples of 8 bits
-------------------------------+----------------------------
Reporter: psiha | Owner: johnmaddock
Type: Bugs | Status: closed
Milestone: To Be Determined | Component: multiprecision
Version: Boost 1.54.0 | Severity: Optimization
Resolution: wontfix | Keywords:
-------------------------------+----------------------------
Comment (by psiha):
Replying to [comment:3 johnmaddock]:
> Fixed in
https://github.com/boostorg/multiprecision/commit/cb1a41835f4566987b96c7a7034088e22d83f77b
Thanks John :)
I no longer use/need this functionality so I didn't test but from a
cursory skim it looks good...except that maybe the (little) endian checks
are not really necessary: if you make them in only one place - where you
decide on the underlying/raw/limb layout - if you order the limbs in
'machine endianess' (I'm guessing) the rest of the code can be endianness
agnostic (and more readily assume correct byte ordering/use
memcpy/move/set more easily)...
> It turns out that memmove is (very slightly) faster than moving whole
limbs so that's the preferred method when available.
It's also smaller (one call instead of a loop for every instantiation;)
> Limbs are half the size of the largest available integers - so 32-bit
for msvc as there's no 128-bit integer support (unlike mingw for example).
Thanks for the explanation ;)
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9233#comment:4> 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:19 UTC