<div dir="ltr">Not exactly different, just limited - as the GCC wiki page mentions, GCC supported (& continues to support) the <a href="https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-g_t_0040code_007btarget_007d-function-attribute-3220">target attribute</a> without the multiversioning feature. That's all that Clang has implemented - you specify you want a certain function compiled for a certain architecture/feature/etc, and then it's up to you how you dispatch to that function to ensure that you only call it when running in the right environment.<br><br>Implementing actual multiversioning (with the overloads, ifunc relocations/stub generation, etc) is not implemented currently and while I don't know of anyone who has plans to, it's certainly something that could be done (ie: the project isn't philosophically opposed to the feature or anything).<br><br>- Dave</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 8, 2015 at 4:55 AM, Dmitry Polukhin via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>Clang documentation claims that __attribute__ ((target("XXX"))) is supported in clang, seeĀ <a href="http://clang.llvm.org/docs/AttributeReference.html#target-gnu-target" target="_blank">http://clang.llvm.org/docs/AttributeReference.html#target-gnu-target</a> But the semantic of the attribute is significantly different in Clang and GCC (see GCC documentation <a href="https://gcc.gnu.org/wiki/FunctionMultiVersioning" target="_blank">https://gcc.gnu.org/wiki/FunctionMultiVersioning</a>). In short Clang allows to specify target CPU for a single function but GCC allows to specify set of functions optimized for different CPUs and generates dynamic dispatching code. Is it intentional difference in the semantic of the attribute or it is just missing feature that needs to be implemented?</div><div><br></div><div>--</div><div>Best regards,</div><div>Dmitry Polukhin</div><div>Software Engineer</div><div>Intel Compiler Team</div><div><br></div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>