This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [4.7][google]Support for getting CPU type and feature information at run-time. (issue4893046)


On Fri, Aug 26, 2011 at 10:10 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Aug 26, 2011 at 10:06 AM, Sriraman Tallam <tmsriram@google.com> wrote:
>> On Thu, Aug 25, 2011 at 6:02 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>> On Thu, Aug 25, 2011 at 5:37 PM, Sriraman Tallam <tmsriram@google.com> wrote:
>>>> Hi,
>>>>
>>>> ?Thanks for all the comments. I am attaching a new patch
>>>> incorporating all of the changes mentioned, mainly :
>>>>
>>>> 1) Make __cpu_indicator_init a constructor in libgcc and guard to call
>>>> it only once.
>>>
>>> This is unreliable and you don't need 3 symbols from libgcc. You can use
>>
>> Do you mean it is unreliable because of the constructor ordering problem?
>>
>
> You do not have total control when __cpu_indicator_init is called.

Like  discussed before, for non-ctor functions, which in my opinion is
the common use case, it works out great because __cpu_indicator_init
is guaranteed to be called and I save doing an extra check. It is only
for other ctors where this is a problem. So other ctors call this
explicitly.  What did I miss?

Thanks,
-Sri.

>
> Also you shouldn't use bitfield in
>
> struct __processor_model
> +{
> + ?unsigned int __cpu_is_amd : 1;
> + ?unsigned int __cpu_is_intel : 1;
> + ?unsigned int __cpu_is_intel_atom : 1;
> + ?unsigned int __cpu_is_intel_core2 : 1;
> + ?unsigned int __cpu_is_intel_corei7_nehalem : 1;
> + ?unsigned int __cpu_is_intel_corei7_westmere : 1;
> + ?unsigned int __cpu_is_intel_corei7_sandybridge : 1;
> + ?unsigned int __cpu_is_amdfam10_barcelona : 1;
> + ?unsigned int __cpu_is_amdfam10_shanghai : 1;
> + ?unsigned int __cpu_is_amdfam10_istanbul : 1;
> +} __cpu_model = {0};
> +
>
> A processor can't be both Atom and Core 2.
>
> --
> H.J.
>


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