From 6a7776c1ee1da36715ff5ff2600de0d1c9c97e81 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Mon, 6 Jul 2015 23:51:56 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241524 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/AttrDocs.td | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/clang/Basic/AttrDocs.td b/include/clang/Basic/AttrDocs.td index 107458e461..e4ca0cb477 100644 --- a/include/clang/Basic/AttrDocs.td +++ b/include/clang/Basic/AttrDocs.td @@ -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 = [{ -- 2.40.0