This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, libstdc++, complex] complex multiplication algorithm improved


On Wed, 15 Sep 2010, Paolo Carlini wrote:

... note that we are talking about the code *in the primary template*,
not in the specializations for float / double / long double and that the
behavior when instantiating with anything else outside float / double /
long double is *unspecified* in the Standard.

For float/double/long double, the code with 3 multiplications is actually significantly slower on many architectures (including x86 and x86_64) because of all the extra additions. So it only makes sense if you expect complex<T> to be used mostly with T that has costly multiplications (double on some archs, multi-precision, etc).


--
Marc Glisse


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]