[v3] Print ints directly to streambuf

Jerry Quinn jlquinn@optonline.net
Sat Mar 8 03:31:00 GMT 2003


Benjamin Kosnik writes:
 > 
 > Can you update this to use __builtin_clz as suggested by Richard? 

Sure.  From the discussion, it sounds like it's worth having this
ifdef'd by the platforms on which it's a win.  Richard listed x86,
ppc, alphaev67, arm, and ia64.

Can I do something like

#ifdef __i386__ || __powerpc__ || __alphaev67__ || __arm__ || __ia64__
  __builtin_clz
#else
  regular code
#endif

so other targets still get a reasonable inline implementation?
Mainly, I'm not sure what macros I can count on.

Jerry



More information about the Libstdc++ mailing list