This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [cxx-conversion] Make double_int a class with methods and operators. (issue6443093)
Hi,
On Thu, 9 Aug 2012, Mike Stump wrote:
> > Ah. For simple objects like double_int I prefer to have either all
> > ops mutating or all ops non-mutating.
>
> wide_int, which replaces double_int for int types, is always
> non-mutating, by value interface. In C++, it will be const & input
> parameters, to avoid the copies and retain the performance. We maintain
> a cache under it, and reuse out of it for the long lived objects, for
> short lived, we just allocate the on the stack as needed.
Hmm. And maintaining a cache is faster than
passing/returning/manipulating two registers?
Ciao,
Michael.