User directed Function Multiversioning via Function Overloading (issue5752064)

Diego Novillo dnovillo@google.com
Fri Oct 26 14:11:00 GMT 2012


On Fri, Oct 19, 2012 at 10:33 PM, Sriraman Tallam <tmsriram@google.com> 
wrote:

> Yes, the support is only for C++ for now. "target" attribute is not
> new and if the user tries to use this with 'C' then a duplicate
> defintion error would occur just like now.
> I have plans to implement this for C too.

Would it be hard to emit a diagnostic that specifically states that 
"target" is not a valid attribute in C?

> So, callee here is the dispatcher function and it points to the set of
> semantically identical function versions. At this point, the
> dispatcher (callee) should have all the function versions chained in
> function_version, which is what the assert is checking.

Great, could you add this explanation as a comment?  It wasn't at all 
clear to me what was going on.

>>> +  enum feature_priority
>>> +  {
>>> +    P_ZERO = 0,
>>> +    P_MMX,
>>> +    P_SSE,
>>> +    P_SSE2,
>>> +    P_SSE3,
>>> +    P_SSSE3,
>>> +    P_PROC_SSSE3,
>>> +    P_SSE4_a,
>>> +    P_PROC_SSE4_a,
>>> +    P_SSE4_1,
>>> +    P_SSE4_2,
>>> +    P_PROC_SSE4_2,
>>> +    P_POPCNT,
>>> +    P_AVX,
>>> +    P_AVX2,
>>> +    P_FMA,
>>> +    P_PROC_FMA
>>> +  };
>>
>>
>> There's no need to have this list dynamically defined, right?
>
> I dont understand, why expose the enum outside the function?

To allow altering the list of priorities.  But if it doesn't make sense, 
ignore me.

The patch is OK with the changes above addressed.  Thanks.

Please be on the lookout for failures.


Diego.



More information about the Gcc-patches mailing list