[RFA] Using the new atomicity builtins

Paolo Carlini pcarlini@suse.de
Sat May 21 08:59:00 GMT 2005


Hi,

now that RTH kindly implemented the atomicity builtins + target bits for
most of the most widespread targets (I remember at least x86(x86_64),
ia64, powerpc, alpha), I think we can start migrating. Ideally, if the
target bits were ready for *every* target we could even envisage using
the builtins directly in the generic code. But we can't do that in the
short term, and I'm not sure we are going to do that later, because
builtins for i386 and old Sparcs will not (cannot, in general: we are
talking about the complete set of ia64-type builtins) be implemented. 
My modest proposal for the 4.1 time frame would be instead using the
builtins in  the implementation of __exchange_and_add and __atomic_add,
when available: in a nutshell, the code would become very similar to
what we currently have for ia64.

Are there any disagreements about this minimal project?

A separate issue is about *other* atomicity primitives, that we used to
have, open coded in inline assembly of course, for operations like CAS,
that now would be useful again in some areas of TR1. In this case the
idea would be, again, simply estoring the old code and using the
builtins when available. Jonathan should be interested in this, for
applications in shared_ptr, for instance.

Paolo.



More information about the Libstdc++ mailing list