]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Add Zalrsc and Zaamo testsuite support
authorPatrick O'Neill <patrick@rivosinc.com>
Mon, 10 Jun 2024 21:12:40 +0000 (14:12 -0700)
committerPatrick O'Neill <patrick@rivosinc.com>
Tue, 11 Jun 2024 17:05:16 +0000 (10:05 -0700)
Convert testsuite infrastructure to use Zalrsc and Zaamo rather than A.

gcc/ChangeLog:

* doc/sourcebuild.texi: Add docs for atomic extension testsuite infra.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/amo-table-a-6-amo-add-1.c: Use Zaamo rather than A.
* gcc.target/riscv/amo-table-a-6-amo-add-2.c: Ditto.
* gcc.target/riscv/amo-table-a-6-amo-add-3.c: Ditto.
* gcc.target/riscv/amo-table-a-6-amo-add-4.c: Ditto.
* gcc.target/riscv/amo-table-a-6-amo-add-5.c: Ditto.
* gcc.target/riscv/amo-table-a-6-compare-exchange-1.c: Use Zalrsc rather
than A.
* gcc.target/riscv/amo-table-a-6-compare-exchange-2.c: Ditto.
* gcc.target/riscv/amo-table-a-6-compare-exchange-3.c: Ditto.
* gcc.target/riscv/amo-table-a-6-compare-exchange-4.c: Ditto.
* gcc.target/riscv/amo-table-a-6-compare-exchange-5.c: Ditto.
* gcc.target/riscv/amo-table-a-6-compare-exchange-6.c: Ditto.
* gcc.target/riscv/amo-table-a-6-compare-exchange-7.c: Ditto.
* gcc.target/riscv/amo-table-a-6-subword-amo-add-1.c: Use Zaamo rather
than A.
* gcc.target/riscv/amo-table-a-6-subword-amo-add-2.c: Ditto.
* gcc.target/riscv/amo-table-a-6-subword-amo-add-3.c: Ditto.
* gcc.target/riscv/amo-table-a-6-subword-amo-add-4.c: Ditto.
* gcc.target/riscv/amo-table-a-6-subword-amo-add-5.c: Ditto.
* gcc.target/riscv/amo-table-ztso-amo-add-1.c: Add Zaamo option.
* gcc.target/riscv/amo-table-ztso-amo-add-2.c: Ditto.
* gcc.target/riscv/amo-table-ztso-amo-add-3.c: Ditto.
* gcc.target/riscv/amo-table-ztso-amo-add-4.c: Ditto.
* gcc.target/riscv/amo-table-ztso-amo-add-5.c: Ditto.
* gcc.target/riscv/amo-table-ztso-compare-exchange-1.c: Use Zalrsc rather
than A.
* gcc.target/riscv/amo-table-ztso-compare-exchange-2.c: Ditto.
* gcc.target/riscv/amo-table-ztso-compare-exchange-3.c: Ditto.
* gcc.target/riscv/amo-table-ztso-compare-exchange-4.c: Ditto.
* gcc.target/riscv/amo-table-ztso-compare-exchange-5.c: Ditto.
* gcc.target/riscv/amo-table-ztso-compare-exchange-6.c: Ditto.
* gcc.target/riscv/amo-table-ztso-compare-exchange-7.c: Ditto.
* gcc.target/riscv/amo-table-ztso-subword-amo-add-1.c: Ditto.
* gcc.target/riscv/amo-table-ztso-subword-amo-add-2.c: Ditto.
* gcc.target/riscv/amo-table-ztso-subword-amo-add-3.c: Ditto.
* gcc.target/riscv/amo-table-ztso-subword-amo-add-4.c: Ditto.
* gcc.target/riscv/amo-table-ztso-subword-amo-add-5.c: Ditto.
* lib/target-supports.exp: Add testsuite infrastructure support for
Zaamo and Zalrsc.

Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
36 files changed:
gcc/doc/sourcebuild.texi
gcc/testsuite/gcc.target/riscv/amo-table-a-6-amo-add-1.c
gcc/testsuite/gcc.target/riscv/amo-table-a-6-amo-add-2.c
gcc/testsuite/gcc.target/riscv/amo-table-a-6-amo-add-3.c
gcc/testsuite/gcc.target/riscv/amo-table-a-6-amo-add-4.c
gcc/testsuite/gcc.target/riscv/amo-table-a-6-amo-add-5.c
gcc/testsuite/gcc.target/riscv/amo-table-a-6-compare-exchange-1.c
gcc/testsuite/gcc.target/riscv/amo-table-a-6-compare-exchange-2.c
gcc/testsuite/gcc.target/riscv/amo-table-a-6-compare-exchange-3.c
gcc/testsuite/gcc.target/riscv/amo-table-a-6-compare-exchange-4.c
gcc/testsuite/gcc.target/riscv/amo-table-a-6-compare-exchange-5.c
gcc/testsuite/gcc.target/riscv/amo-table-a-6-compare-exchange-6.c
gcc/testsuite/gcc.target/riscv/amo-table-a-6-compare-exchange-7.c
gcc/testsuite/gcc.target/riscv/amo-table-a-6-subword-amo-add-1.c
gcc/testsuite/gcc.target/riscv/amo-table-a-6-subword-amo-add-2.c
gcc/testsuite/gcc.target/riscv/amo-table-a-6-subword-amo-add-3.c
gcc/testsuite/gcc.target/riscv/amo-table-a-6-subword-amo-add-4.c
gcc/testsuite/gcc.target/riscv/amo-table-a-6-subword-amo-add-5.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-amo-add-1.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-amo-add-2.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-amo-add-3.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-amo-add-4.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-amo-add-5.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-compare-exchange-1.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-compare-exchange-2.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-compare-exchange-3.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-compare-exchange-4.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-compare-exchange-5.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-compare-exchange-6.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-compare-exchange-7.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-subword-amo-add-1.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-subword-amo-add-2.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-subword-amo-add-3.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-subword-amo-add-4.c
gcc/testsuite/gcc.target/riscv/amo-table-ztso-subword-amo-add-5.c
gcc/testsuite/lib/target-supports.exp

index e997dbec3334bf5e012a48d5d9361bcee9eea552..e37fb85f3b31657dc43e87cfed19bd49eb8250ce 100644 (file)
@@ -2513,8 +2513,17 @@ Test system has an integer register width of 32 bits.
 @item rv64
 Test system has an integer register width of 64 bits.
 
-@item cv_bi
-Test system has support for the CORE-V BI extension.
+@item riscv_a
+Test target architecture has support for the A extension.
+
+@item riscv_zaamo
+Test target architecture has support for the zaamo extension.
+
+@item riscv_zlrsc
+Test target architecture has support for the zalrsc extension.
+
+@item riscv_ztso
+Test target architecture has support for the ztso extension.
 
 @end table
 
@@ -2534,6 +2543,9 @@ Test system has support for the CORE-V ELW extension.
 @item cv_simd
 Test system has support for the CORE-V SIMD extension.
 
+@item cv_bi
+Test system has support for the CORE-V BI extension.
+
 @end table
 
 @subsubsection Other hardware attributes
index 8ab1a02b40c6bfcddaa242da38e49fd6f8886ec2..9c2ba39789ae0e411dbb30904b94cebd9406eca9 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* Verify that atomic op mappings match Table A.6's recommended mapping.  */
 /* { dg-options "-O3" } */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zaamo } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index a5a841abdcd889bc30e2bc0a4b1e1ca51535be53..b7682a5bab41c3f9733f74883d6b012893318f52 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* Verify that atomic op mappings match Table A.6's recommended mapping.  */
 /* { dg-options "-O3" } */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zaamo } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index f523821b65835a3157ca9d97d4a99d8e2a2b391d..c8776872d9159484400718067b30180bbcb6cae3 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* Verify that atomic op mappings match Table A.6's recommended mapping.  */
 /* { dg-options "-O3" } */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zaamo } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index f1561b52c894d68d71d72bb1a497103784033080..b37c4c3f242e79e06216690bef156847a293d180 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* Verify that atomic op mappings match Table A.6's recommended mapping.  */
 /* { dg-options "-O3" } */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zaamo } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index 81f876ee625890af680e1fed3a7e367c2ae3dbcb..8d45ca7a3476f6b0f3ec6335e1377d3d71b2e1cc 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* Verify that atomic op mappings match Table A.6's recommended mapping.  */
 /* { dg-options "-O3" } */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zaamo } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
 
index dc445f0316ac2d7629f197593270da53d951b171..4917cd6bd2b6f56754da817cfcd6821d8345971c 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match Table A.6's recommended mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
 
index 7e8ab7bb5ef157aac97b197ed1ed3466d9db97c3..121936507e3d4caf5382f11be1e0f2cef7492ba4 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match Table A.6's recommended mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-final { scan-assembler-times "lr.w.aq\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
 
index 4cb6c42221372a64934b79f9833c69bce776f131..649c7d2b1feb6bb59352e0898bd09f8446343088 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match Table A.6's recommended mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-final { scan-assembler-times "lr.w.aq\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
 
index da81c34b92c5d61659e3bd11292954a5afcfe83d..5f7fdeb1b21e5603a6a9072a2bfd5e6fc70749c5 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match Table A.6's recommended mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w.rl\t" 1 } } */
 
index bb16ccc754ccf9be85678b1ab5f65115b0c3ff4d..f4bd7d6d84280198392887eb0c32d1ad87db8b32 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match Table A.6's recommended mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-final { scan-assembler-times "lr.w.aqrl\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w.rl\t" 1 } } */
 
index 0f3f0b49d95152d6c19daf171c0a387d1bedbe12..154764425ae9e4f7fd8f792e413d6ddbc4483689 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match Table A.6's recommended mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* Mixed mappings need to be unioned.  */
 /* { dg-final { scan-assembler-times "lr.w.aq\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w.rl\t" 1 } } */
index d51de56cc78496b7c3ca7bf0c085c8447e3462ac..16712540919342490aa756c1a72990f5079a8c47 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match Table A.6's recommended mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-final { scan-assembler-times "lr.w.aqrl\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w.rl\t" 1 } } */
 
index ca8aa715bed056103c907dfa0b9abaff77cb96db..4174fdee352bd1a87fb37692ff0d4f2479b3eb1c 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that subword atomic op mappings match Table A.6's recommended mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
 
index e64759a54aeeccce85615e53cf1f5b15eb6a2a8f..4c06c90b55826573921833546f001dd684ba942b 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that subword atomic op mappings match Table A.6's recommended mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-final { scan-assembler-times "lr.w.aq\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
 
index 9d3f69264fa5777279f930624912d1b9eb2c075a..7e791c901b6672e3d928e56a2230c666226ecd10 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that subword atomic op mappings match Table A.6's recommended mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w.rl\t" 1 } } */
 
index ba32ed59c2fe8fdf0c49a31b97f60f536d2efefd..76f3be2711083202ee79b4d66a1484e1ec4ca04a 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that subword atomic op mappings match Table A.6's recommended mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-final { scan-assembler-times "lr.w.aq\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w.rl\t" 1 } } */
 
index f9be8c5e6281ae4889dcc366be6d77374cc23021..8dbfa9c4fc82671c47668fdc2879ce0a4fbaa42e 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that subword atomic op mappings match Table A.6's recommended mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-final { scan-assembler-times "lr.w.aqrl\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w.rl\t" 1 } } */
 
index a9edc33ff39dfa7251d6d3295fc839661d77fe5e..82169390925ed2decafff1549de3dbbe4878508e 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* Verify that atomic op mappings match the Ztso suggested mapping.  */
 /* { dg-options "-O3" } */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zaamo } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
index ad843402bcc75e9018c1901a6da33f4474978c98..a238c6f44030298f95ca9ff2d5c7681126729f1d 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* Verify that atomic op mappings the Ztso suggested mapping.  */
 /* { dg-options "-O3" } */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zaamo } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
index bdae5bb83a60c5289d68aa6e6ed71ec869445842..c97bf467c63bc0b4f7fc12b99918f086ecf1bd57 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* Verify that atomic op mappings match the Ztso suggested mapping.  */
 /* { dg-options "-O3" } */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zaamo } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
index 815a72f1e56487563421ca4df296dd10d35f1c9f..14e632ba2f276b1f9142f350bff8a0347be26cb5 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* Verify that atomic op mappings match the Ztso suggested mapping.  */
 /* { dg-options "-O3" } */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zaamo } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
index eda6f01096ea7573379e92439915f746c32d4067..74d8df99ddcac536a187a171bb50eb5beaf513ce 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* Verify that atomic op mappings match the Ztso suggested mapping.  */
 /* { dg-options "-O3" } */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zaamo } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
 /* { dg-final { check-function-bodies "**" "" } } */
index b6315c45e85ed6e947dfc06dae81b864f282626f..46a9f0c918a494390b2b7bb9feb3c0d6b73229bc 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match the Ztso suggested mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
index e487184f6cf9d5c1d9867391301cacb0fe5b72c2..20e325f2e7cc0eaf90c0bd9a2913819e4375b109 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match the Ztso suggested mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
index e9c925f0923c62ad44a34b31c0168c377a6af6e5..0a443b461f326583ebbf383a86fda4f1c7357de2 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match the Ztso suggested mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
index 6b4545596339fba271cd674560cef1fc0e532ad8..35e01cdc8be05bc2f6fe79664d258bb19bc7cda3 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match the Ztso suggested mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
index 02c9f0ada778e5d171edfc62efd3e840c6d605f0..cd884931bdfb408c5044ac395552282de4877e15 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match the Ztso suggested mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w.aqrl\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w.rl\t" 1 } } */
index 75abd5d3dfbde75fa7ef34cede118b01c0eaae14..7da3b1dce48d6da5dbea092ded4e55ca4f97f262 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match the Ztso suggested mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
index 33928c0eac41677a7bcd4aaf959e078c1df0cdf8..53f6e6ace0bede3cee95f8f65a6053d7ccb728a6 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that compare exchange mappings match the Ztso suggested mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w.aqrl\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w.rl\t" 1 } } */
index 2a40d6b13761a6103878de66fa6556d3c4d5aa5c..5c0a8b8f6e9f741b76d26aaa1b79ff08edb0cd49 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that subword atomic op mappings match the Ztso suggested mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
index c79380f2611798350ea06051a34f2ab102c58315..551078186ec924ac12a0a020d3196257b0a64526 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that subword atomic op mappings match the Ztso suggested mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
index d1a94eccfa837268ca7fbbf457d101aaadec44e5..5f0f78707210b89ad4df85eeaf46b4d43c6506a1 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that subword atomic op mappings match the Ztso suggested mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
index 3d65bc2f64aa52cb849a23b796b596c84b2a1628..24f4f02dceaf7f9599552caf204bdda05191bf48 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that subword atomic op mappings match the Ztso suggested mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w\t" 1 } } */
index 10354387a1376bd37fdbe6667d1c6dd935bc4673..405e498fb40f40427111fddf008ea36f7a2067d2 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Verify that subword atomic op mappings match the Ztso suggested mapping.  */
-/* { dg-add-options riscv_a } */
+/* { dg-add-options riscv_zalrsc } */
 /* { dg-add-options riscv_ztso } */
 /* { dg-final { scan-assembler-times "lr.w.aqrl\t" 1 } } */
 /* { dg-final { scan-assembler-times "sc.w.rl\t" 1 } } */
index 5c0a3dade222777402d2a44e63cb5be305341471..e862a8932449507c9c7637fd865bf7be81580a84 100644 (file)
@@ -1889,6 +1889,28 @@ proc check_effective_target_riscv_a { } {
     }]
 }
 
+# Return 1 if the target arch supports the atomic LRSC extension, 0 otherwise.
+# Cache the result.
+
+proc check_effective_target_riscv_zalrsc { } {
+    return [check_no_compiler_messages riscv_ext_zalrsc assembly {
+       #ifndef __riscv_zalrsc
+       #error "Not __riscv_zalrsc"
+       #endif
+    }]
+}
+
+# Return 1 if the target arch supports the atomic AMO extension, 0 otherwise.
+# Cache the result.
+
+proc check_effective_target_riscv_zaamo { } {
+    return [check_no_compiler_messages riscv_ext_zaamo assembly {
+       #ifndef __riscv_zaamo
+       #error "Not __riscv_zaamo"
+       #endif
+    }]
+}
+
 # Return 1 if the target arch supports the double precision floating point
 # extension, 0 otherwise.  Cache the result.
 
@@ -2107,7 +2129,7 @@ proc check_effective_target_riscv_v_misalign_ok { } {
 proc riscv_get_arch { } {
     set gcc_march ""
     # ??? do we neeed to add more extensions to the list below?
-    foreach ext { i m a f d q c v zicsr zifencei zfh zba zbb zbc zbs zvbb zvfh ztso } {
+    foreach ext { i m a f d q c v zicsr zifencei zfh zba zbb zbc zbs zvbb zvfh ztso zaamo zalrsc } {
        if { [check_no_compiler_messages  riscv_ext_$ext assembly [string map [list DEF __riscv_$ext] {
                #ifndef DEF
                #error "Not DEF"
@@ -2166,6 +2188,30 @@ proc add_options_for_riscv_v { flags } {
     return "$flags -march=[regsub {[[:alnum:]]*} [riscv_get_arch] &v]"
 }
 
+proc add_options_for_riscv_zaamo { flags } {
+    if { [lsearch $flags -march=*] >= 0 } {
+       # If there are multiple -march flags, we have to adjust all of them.
+       set flags [regsub -all -- {(?:^|[[:space:]])-march=[[:alnum:]_.]*} $flags &_zaamo ]
+       return [regsub -all -- {((?:^|[[:space:]])-march=[[:alnum:]_.]*_zaamo[[:alnum:]_.]*)_zaamo} $flags \\1 ]
+    }
+    if { [check_effective_target_riscv_zaamo] } {
+       return "$flags"
+    }
+    return "$flags -march=[riscv_get_arch]_zaamo"
+}
+
+proc add_options_for_riscv_zalrsc { flags } {
+    if { [lsearch $flags -march=*] >= 0 } {
+       # If there are multiple -march flags, we have to adjust all of them.
+       set flags [regsub -all -- {(?:^|[[:space:]])-march=[[:alnum:]_.]*} $flags &_zalrsc ]
+       return [regsub -all -- {((?:^|[[:space:]])-march=[[:alnum:]_.]*_zalrsc[[:alnum:]_.]*)_zalrsc} $flags \\1 ]
+    }
+    if { [check_effective_target_riscv_zalrsc] } {
+       return "$flags"
+    }
+    return "$flags -march=[riscv_get_arch]_zalrsc"
+}
+
 proc add_options_for_riscv_zfh { flags } {
     if { [lsearch $flags -march=*] >= 0 } {
        # If there are multiple -march flags, we have to adjust all of them.