Add some basic documentation for the __attribute__((target(""))) support.

Describes the general syntax of how it's used with the unfortunate
usage of "subtarget features" and some examples from the x86 port
to help users.

llvm-svn: 241524
This commit is contained in:
Eric Christopher 2015-07-06 23:51:56 +00:00
parent 00409fbe19
commit 93d6adfb46
1 changed files with 19 additions and 0 deletions

View File

@ -678,6 +678,25 @@ The semantics are as follows:
}];
}
def TargetDocs : Documentation {
let Category = DocCatFunction;
let Content = [{
Clang supports the GNU style ``__attribute__((target("OPTIONS")))`` attribute.
This attribute may be attached to a function definition and instructs
the backend to use different code generation options than were passed on the
command line.
The current set of options correspond to the existing "subtarget features" for
the target with or without a "-mno-" in front corresponding to the absence
of the feature, as well as ``arch="CPU"`` which will change the default "CPU"
for the function.
Example "subtarget features" from the x86 backend include: "mmx", "sse", "sse4.2",
"avx", "xop" and largely correspond to the machine specific options handled by
the front end.
}];
}
def DocCatAMDGPURegisterAttributes :
DocumentationCategory<"AMD GPU Register Attributes"> {
let Content = [{