Hi,GCC 6's __attribute__((target_clones)) feature looks quite exciting to me, but I cannot understand why it is designed to take, say, a single string option like "sse2,avx2" and make it two separate __attribute__((target)) clones. Using commas in single option strings sounds like defeating the whole purpose of allowing multiple options; furthermore, after some inspection on the source, it seems that all the options will be smashed together with a comma and processed as a single string.
So take __attribute__((target_clones("sse3,tune=generic,default", "arch=ivybridge"))) as an example. Instead of creating two clones with targets "sse3,tune=generic,default" and "arch=ivybridge" respectively, GCC's target_clones would create three clones with their targets defined as "sse3" "default", "tune=generic", and "arch=ivybridge". This behavior, although documented somehow, is confusing.
Could anyone please tell me why GCC decided to go with such "smash the string options together and split later" design? Is it possible to have GCC change this behavior in later releases, if it is indeed a design flaw?
-- Regards, Confused Arthur2e5
Attachment:
signature.asc
Description: OpenPGP digital signature