[cfe-dev] __attribute__ ((target("XXX"))) semantic in clang and gcc

Dmitry Polukhin via cfe-dev cfe-dev at lists.llvm.org
Tue Dec 8 04:55:19 PST 2015

Hi All,

Clang documentation claims that __attribute__ ((target("XXX"))) is
supported in clang, see
http://clang.llvm.org/docs/AttributeReference.html#target-gnu-target But
the semantic of the attribute is significantly different in Clang and GCC
(see GCC documentation https://gcc.gnu.org/wiki/FunctionMultiVersioning).
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

Best regards,
Dmitry Polukhin
Software Engineer
Intel Compiler Team
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151208/2c3744d8/attachment.html>

More information about the cfe-dev mailing list