arch-specific template code
Paolo Carlini
paolo.carlini@oracle.com
Mon Sep 10 09:28:00 GMT 2012
Hi,
On 09/09/2012 03:37 AM, Ulrich Drepper wrote:
> On Sat, Sep 8, 2012 at 5:19 AM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
>> Good, good. I don't see any problem with integrating the code more or less
>> as-is, we have only to figure out a suited, neat, scheme for the includes.
> How about the attached patch?
>
> - the cpu/* directories have a subdir opt/ which will contain the
> headers with optimizations
>
> - there always has to be an appropriate header in config/generic/opt/*
>
> - it will be necessary to differentiate between optimizations used in,
> say, <random> and <ext/random>. This is the perhaps not so clean
> part. The problem is that the file has to be included between the
> definition of the data structures and the #include of the .tcc file.
> As you can see in the patch, we need for function which are not
> template specialization be able to prevent the definition in .tcc
> files to happen
>
>
> This scheme is scalable and shouldn't be confusing. The patch so far
> only cleans up the existing <ext/random> file. I haven't added the
> specialization yet.
>
> OK?
I guess it's Ok, yes, but this is a different case, we aren't simply
adding specializations via the __generate infrastructure, we are
replacing code. Thus, if I understand correctly, the idea is that
opt_random.h is included before the default implementations in *.tcc and
can decide to replace some functions, define a macro and that way
prevent the next *.tcc from providing the default one. Works for me.
I'll rather wait a couple of days for comment from other interested
parties, maybe we could handle first some of those straightforward cases
which you presented earlier, which simply add __generate (double*,
double*, ...)
Paolo.
More information about the Libstdc++
mailing list