This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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++/8761 and libstdc++/7076


Mark Mitchell writes:
 > 
 > 
 > --On Friday, January 10, 2003 01:50:20 AM -0500 Jerry Quinn 
 > <jlquinn@optonline.net> wrote:
 > 
 > >         * config/locale/generic/c_locale.cc (__convert_from_v<long>,
 > > 	__convert_from_v<unsigned long>, __convert_from_v<long long>,
 > > 	__convert_from_v<unsigned long long>):  Add specializations.
 > 
 > Couldn't a lot of that code be shared?  It looks like each of the
 > specializations is pretty similar.

I played last night with merging the signed and unsigned version
together, and that only sacrifices about 0.3 second on my machine.
This results in two functions, instead of four.  It also allows for
optimizing the long long case by switching over to the long routine
when the number being printed is small enough.  I found that in the
gcc 2.95 sources and could pull it forward if there is interest.

I could also make an integer-specific template routine, which will
share all the code and make maintenance easier,but it will still get
expanded into four real routines.  It will also make it harder to do
the long long optimization, requiring an rtti call or something else
clever.

 
 > Sure can't argue with the performance improvement. :-)

Yup!  Although I still haven't been able to whittle it completely down
to 2.95 levels :-(


Jerry Quinn


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