diff options
author | Patrick O'Neill <patrick@rivosinc.com> | 2024-06-24 12:06:15 -0700 |
---|---|---|
committer | Patrick O'Neill <patrick@rivosinc.com> | 2024-06-24 13:09:46 -0700 |
commit | 580c37f1ef7db8e7a398184eb8f5d7555124d30a (patch) | |
tree | 0abf4b3fc888b79a5f2fd923f522109c6ad45574 /gcc/doc | |
parent | f02c70dafd384f0c44d7a0920f4a75a30e267045 (diff) | |
download | gcc-580c37f1ef7db8e7a398184eb8f5d7555124d30a.zip gcc-580c37f1ef7db8e7a398184eb8f5d7555124d30a.tar.gz gcc-580c37f1ef7db8e7a398184eb8f5d7555124d30a.tar.bz2 |
RISC-V: Add dg-remove-option for z* extensions
This introduces testsuite support infra for removing extensions.
Since z* extensions don't have ordering requirements the logic for
adding/removing those extensions has also been consolidated.
This fixes RVWMO compile testcases failing on Ztso targets by removing
the extension from the -march string.
gcc/ChangeLog:
* doc/sourcebuild.texi (dg-remove-option): Add documentation.
(dg-add-option): Add documentation for riscv_{a,zaamo,zalrsc,ztso}
gcc/testsuite/ChangeLog:
* gcc.target/riscv/amo/amo-table-a-6-amo-add-1.c: Add dg-remove-options
for ztso.
* gcc.target/riscv/amo/amo-table-a-6-amo-add-2.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-amo-add-3.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-amo-add-4.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-amo-add-5.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-compare-exchange-1.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-compare-exchange-2.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-compare-exchange-3.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-compare-exchange-4.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-compare-exchange-5.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-compare-exchange-6.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-compare-exchange-7.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-fence-1.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-fence-2.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-fence-3.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-fence-4.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-fence-5.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-load-1.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-load-2.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-load-3.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-store-1.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-store-2.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-store-compat-3.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-subword-amo-add-1.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-subword-amo-add-2.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-subword-amo-add-3.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-subword-amo-add-4.c: Ditto.
* gcc.target/riscv/amo/amo-table-a-6-subword-amo-add-5.c: Ditto.
* gcc.target/riscv/amo/amo-zalrsc-amo-add-1.c: Replace manually
specified -march string with dg-add/remove-options directives.
* gcc.target/riscv/amo/amo-zalrsc-amo-add-2.c: Ditto.
* gcc.target/riscv/amo/amo-zalrsc-amo-add-3.c: Ditto.
* gcc.target/riscv/amo/amo-zalrsc-amo-add-4.c: Ditto.
* gcc.target/riscv/amo/amo-zalrsc-amo-add-5.c: Ditto.
* lib/target-supports-dg.exp: Add dg-remove-options.
* lib/target-supports.exp: Add dg-remove-options and consolidate z*
extension add/remove-option code.
Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/sourcebuild.texi | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index e37fb85..c6bb41d 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -1015,6 +1015,7 @@ FIXME: discuss non-C testsuites here. * Selectors:: Selecting targets to which a test applies. * Effective-Target Keywords:: Keywords describing target attributes. * Add Options:: Features for @code{dg-add-options} +* Remove Options:: Features for @code{dg-remove-options} * Require Support:: Variants of @code{dg-require-@var{support}} * Final Actions:: Commands for use in @code{dg-final} @end menu @@ -1085,6 +1086,13 @@ default, or that don't provide them at all. It must come after all @code{dg-options} directives. For supported values of @var{feature} see @ref{Add Options, ,}. +@item @{ dg-remove-options @var{feature} @dots{} @} +Remove any compiler options that are needed to access certain features. +This directive does nothing on targets that disable the features by +default, or that don't provide them at all. It must come after +all @code{dg-options} and @code{dg-add-options} directives. +For supported values of @var{feature} see @ref{Remove Options, ,}. + @item @{ dg-additional-options @var{options} [@{ target @var{selector} @}] @} This directive provides a list of compiler options, to be used if the target system matches @var{selector}, that are added to the default @@ -3278,6 +3286,18 @@ compliance mode. @code{mips16} function attributes. Only MIPS targets support this feature, and only then in certain modes. +@item riscv_a +Add the 'A' extension to the -march string on RISC-V targets. + +@item riscv_zaamo +Add the zaamo extension to the -march string on RISC-V targets. + +@item riscv_zalrsc +Add the zalrsc extension to the -march string on RISC-V targets. + +@item riscv_ztso +Add the ztso extension to the -march string on RISC-V targets. + @item stack_size @anchor{stack_size_ao} Add the flags needed to define macro STACK_SIZE and set it to the stack size @@ -3300,6 +3320,29 @@ a target, if any. This requires the target to have an implementation of the Add the flags needed to enable support for weak undefined symbols. @end table +@node Remove Options +@subsection Features for @code{dg-remove-options} + +The supported values of @var{feature} for directive @code{dg-remove-options} +are: + +@table @code +@item riscv_a +Remove the 'A' extension and all implied extensions from the -march string on +RISC-V targets. + +@item riscv_zaamo +Remove the zaamo extension from the -march string on RISC-V. If the 'A' +extension is present downgrade it to zalrsc. + +@item riscv_zalrsc +Remove the zalrsc extension from the -march string on RISC-V. If the 'A' +extension is present downgrade it to zaamo. + +@item riscv_ztso +Remove the ztso extension from the -march string on RISC-V targets. +@end table + @node Require Support @subsection Variants of @code{dg-require-@var{support}} |