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: notes on current atomics config and usage


Benjamin Kosnik wrote:

> 1) probe for builtins, if found, use
> 2) if not, look for atomics config, if found, use
> 3) fall back to mutex

FWIW, this makes sense to me.  But, for the atomics config, shouldn't we
look for atomics that match the -march (whether default or explicit),
rather than the target triplet?  If the default -march for the compiler
I build is i386, then don't I want the i386 atomics.h (if it exists)?
(If that's going to result in bad performance, then I'd suggest we make
the default arch for i686-pc-linux-gnu be, i486 instead; i.e., change
the compiler, not the library.)

Also, were I you, I wouldn't be afraid to modify the compiler to make it
easier to get information that you need.  For example, add a
__GCC_ATOMIC_BUILTINS macro that's predefined if we have the builtins,
or add a -print-features option to the driver that prints out things like:

 atomic-builtins;tls;hardware-fp;...

I'm not saying you *should* do this; just that it seems a reasonable way
to go if dealing with autoconf probes is unreasonably hard.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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