Call for compiler help/advice: atomic builtins for v3
Richard Guenther
richard.guenther@gmail.com
Sun Nov 6 13:50:00 GMT 2005
On 11/6/05, Paolo Carlini <pcarlini@suse.de> wrote:
> Richard Guenther wrote:
> > We could just provide fallback libcalls in libgcc
> Indeed, this is an option. Not one I can implement myself quickly, but I
> think the idea of issuing a library call when the builtin is not
> available was actually meant to enable this kind of solution.
>
> Can you work on it?
> > - though usually you
> > would want a fallback on a higher level to avoid too much overhead.
> >
> Well, we are talking about i386... But yes, that could make sense, for
> example if you want to compile once both for i386 and i686 and obtain
> decent performance everywhere. Consider, however, that currently we end
> up doing a function call anyway, no inlining, so...
> > So - can't you work with some preprocessor magic and a define, if
> > the builtins are available?
> >
> I don't really understand this last remark of yours: is it an alternate
> solution?!? Any preprocessor magic has to rely on a new preprocessor
> builtin, in case, because there is no consistent, unequivocal way to
> know whether the builtins are available for the actual target, we
> already explored that some time ago, in our (SUSE) gcc-development list too.
Can you point me to some libstdc++ class/file where you use the
builtins or other solution? Of course I meant having another builtin
preprocessor macro. As the builtins are pretty low-level, somebody
might provide a low-level workaround if they're missing, too, instead
of having libcalls to libgcc (like for a freestanding environment like
the kernel). So ultimately a preprocessor driven solution maybe the
better one.
Richard.
More information about the Libstdc++
mailing list