https://gcc.gnu.org/g:ea9eb0dc1a00bd8c88786cfcb99a1813a5ec74c8
commit r16-7679-gea9eb0dc1a00bd8c88786cfcb99a1813a5ec74c8 Author: Sandra Loosemore <[email protected]> Date: Thu Feb 19 17:15:05 2026 +0000 doc, riscv: Tidy RISC-V attribute documentation gcc/ChangeLog * doc/extend.texi (RISC-V Attributes): Format and index options for the "target" attribute consistently with the documentation for other back ends. Diff: --- gcc/doc/extend.texi | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index b7ac2ede1f30..dfe1ef01046d 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -8322,15 +8322,20 @@ void foo() __attribute__((riscv_vector_cc)); [[riscv::vector_cc]] void foo(); // For C++11 and C23 @end smallexample -@end table +@cindex @code{target} function attribute +@item target (@var{options}) +This attribute applies to functions. -The following target-specific function attributes are available for the +As discussed in @ref{Common Attributes}, this attribute +allows specification of target-specific compilation options. + +The following options are available for the RISC-V target. For the most part, these options mirror the behavior of similar command-line options (@pxref{RISC-V Options}), but on a per-function basis. -@table @code -@cindex @code{arch=} function attribute, RISC-V +@table @samp +@cindex @code{target("arch=")} function attribute, RISC-V @item arch= Specifies the architecture version and architectural extensions to use for this function. The behavior and permissible arguments are the same as @@ -8340,19 +8345,19 @@ like @code{arch=+zba} means enable @code{zba} extension. Multiple extension can be enabled by separating them with a comma. For example: @code{arch=+zba,+zbb}. -@cindex @code{tune=} function attribute, RISC-V +@cindex @code{target("tune=")} function attribute, RISC-V @item tune= Specifies the core for which to tune the performance of this function. The behavior and permissible arguments are the same as for the @option{-mtune=} command-line option. -@cindex @code{cpu=} function attribute, RISC-V +@cindex @code{target("cpu=")} function attribute, RISC-V @item cpu= Specifies the core for which to tune the performance of this function and also whose architectural features to use. The behavior and valid arguments are the same as for the @option{-mcpu=} command-line option. -@cindex @code{max-vectorization} function attribute, RISC-V +@cindex @code{target("max-vectorization")} function attribute, RISC-V @item max-vectorization @itemx no-max-vectorization @code{max-vectorization} tells GCC's vectorizer to treat all vector @@ -8391,6 +8396,9 @@ foo (int a) is valid and compiles function @code{foo} with @code{zba} and @code{zbb} extensions and tunes it for @code{rocket}. +@end table + + @node RL78 Attributes @subsubsection RL78 Attributes
