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] | |
Here's another approach.I'm not sure to understand: you mean, by default we are going to use mutexes?!? Sorry, but if this what you are really saying, it's unacceptable performance-wise: by default everyone (on x86_64 too!) will notice a huge regression, please-please let's not do that. In my opinion, on i686 by default we should simply provide out of line __atomic_add and __exchange_and_add implemented in terms of the builtins (we should use builtins instead of assembly, like you are correctly suggesting elsewhere).
The attached patch clarifies the atomics config. In a nutshell, if
there exists a config/cpu/*/atomicity.h file, it's used. If there
isn't, either the builtins are used (and inlined) if they are proved to
exist, or the mutex fall-back is used.
There should never be the case where the cpu has both builtins and a configure atomicity.h. Thus, this patch removes config/cpu/i486 because the builtin atomics for this cpu are better.
As-is, this changes the default behavior for default x86 compiles. What
happens? Well, say the host is i686, check. But, the i386 atomicity.h
is skipped over, and there is no i686 atomicity.h, since there are
actually builtins for this host. However, the check for builtins fails,
since the default -march for this host is i386. Thus, mutex-ville.
Well, I'm seeing more-than-slight degradations, some numbers, in string_append for example, are horrible (10x !?!), I cannot believe we are talking about the same machine!?! Are you really-really sure we are talking about the right config? Not even mutexes would explain such huge differences...I did some performance testing, original vs. patch + CXXFLAGS="-march=i686". Results are attached. Surprisingly, there is some slight degradation,
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |