Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d41a73a

Browse files
committedFeb 19, 2023
[RISCV][MC] Mark Zawrs extension as non-experimental
Support for the unratified 1.0-rc3 specification was introduced in D133443. The specification has since been ratified (in November 2022 according to the recently ratified extensions list <https://wiki.riscv.org/display/HOME/Recently+Ratified+Extensions>. A review of the diff <riscvarchive/riscv-zawrs@V1.0-rc3...main> of the 1.0-rc3 spec vs the current/ratified document shows no changes to the instruction encoding or naming. At one point, a note was added <riscvarchive/riscv-zawrs@e84f424> indicating Zawrs depends on the Zalrsc extension (not officially specified, but I believe to be just the LR/SC instructions from the A extension). The final text ended up as "The instructions in the Zawrs extension are only useful in conjunction with the LR instructions, which are provided by the A extension, and which we also expect to be provided by a narrower Zalrsc extension in the future." I think it's consistent with this phrasing to not require the A extension for Zawrs, which matches what was implemented. No intrinsics are implemented for Zawrs currently, meaning we don't need to additionally review whether those intrinsics can be considered finalised and ready for exposure to end users. Differential Revision: https://reviews.llvm.org/D143507
1 parent 7f31a5c commit d41a73a

File tree

7 files changed

+17
-18
lines changed

7 files changed

+17
-18
lines changed
 

‎clang/test/Preprocessor/riscv-target-features.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,11 @@
424424
// RUN: -o - | FileCheck --check-prefix=CHECK-ZICBOP-EXT %s
425425
// CHECK-ZICBOP-EXT: __riscv_zicbop 1000000{{$}}
426426

427-
// RUN: %clang -target riscv32-unknown-linux-gnu -menable-experimental-extensions \
428-
// RUN: -march=rv32izawrs1p0 -x c -E -dM %s \
427+
// RUN: %clang -target riscv32-unknown-linux-gnu \
428+
// RUN: -march=rv32izawrs -x c -E -dM %s \
429429
// RUN: -o - | FileCheck --check-prefix=CHECK-ZAWRS-EXT %s
430-
// RUN: %clang -target riscv64-unknown-linux-gnu -menable-experimental-extensions \
431-
// RUN: -march=rv64izawrs1p0 -x c -E -dM %s \
430+
// RUN: %clang -target riscv64-unknown-linux-gnu \
431+
// RUN: -march=rv64izawrs -x c -E -dM %s \
432432
// RUN: -o - | FileCheck --check-prefix=CHECK-ZAWRS-EXT %s
433433
// CHECK-ZAWRS-EXT: __riscv_zawrs 1000000{{$}}
434434

‎llvm/docs/RISCVUsage.rst

+1-3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ on support follow.
5757
``Svnapot`` Assembly Support
5858
``Svpbmt`` Supported
5959
``V`` Supported
60+
``Zawrs`` Assembly Support
6061
``Zba`` Supported
6162
``Zbb`` Supported
6263
``Zbc`` Supported
@@ -139,9 +140,6 @@ LLVM supports (to various degrees) a number of experimental extensions. All exp
139140

140141
The primary goal of experimental support is to assist in the process of ratification by providing an existence proof of an implementation, and simplifying efforts to validate the value of a proposed extension against large code bases. Experimental extensions are expected to either transition to ratified status, or be eventually removed. The decision on whether to accept an experimental extension is currently done on an entirely case by case basis; if you want to propose one, attending the bi-weekly RISC-V sync-up call is strongly advised.
141142

142-
``experimental-zawrs``
143-
LLVM implements the `1.0-rc3 draft specification <https://github.com/riscv/riscv-zawrs/releases/download/V1.0-rc3/Zawrs.pdf>`_. Note that have been backwards incompatible changes made between release candidates for the 1.0 draft.
144-
145143
``experimental-zca``
146144
LLVM implements the `1.0.1 draft specification <https://github.com/riscv/riscv-code-size-reduction/releases/tag/v1.0.1>`_.
147145

‎llvm/docs/ReleaseNotes.rst

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ Changes to the RISC-V Backend
112112
* Adds support for the vendor-defined XTHeadBb (basic bit-manipulation) extension.
113113
* Adds support for the vendor-defined XTHeadBs (single-bit) extension.
114114
* Adds support for the vendor-defined XTHeadMac (multiply-accumulate instructions) extension.
115+
* Support for the now-ratified Zawrs extension is no longer experimental.
115116

116117
Changes to the WebAssembly Backend
117118
----------------------------------

‎llvm/lib/Support/RISCVISAInfo.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ static const RISCVSupportedExtension SupportedExtensions[] = {
106106
{"zicsr", RISCVExtensionVersion{2, 0}},
107107
{"zifencei", RISCVExtensionVersion{2, 0}},
108108

109+
{"zawrs", RISCVExtensionVersion{1, 0}},
110+
109111
{"svnapot", RISCVExtensionVersion{1, 0}},
110112
{"svpbmt", RISCVExtensionVersion{1, 0}},
111113
{"svinval", RISCVExtensionVersion{1, 0}},
@@ -128,7 +130,6 @@ static const RISCVSupportedExtension SupportedExperimentalExtensions[] = {
128130
{"zcf", RISCVExtensionVersion{1, 0}},
129131
{"zfa", RISCVExtensionVersion{0, 1}},
130132
{"zvfh", RISCVExtensionVersion{0, 1}},
131-
{"zawrs", RISCVExtensionVersion{1, 0}},
132133
{"ztso", RISCVExtensionVersion{0, 1}},
133134
};
134135

‎llvm/lib/Target/RISCV/RISCVFeatures.td

+2-3
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,8 @@ def HasStdExtZtso : Predicate<"Subtarget->hasStdExtZTso()">,
467467
AssemblerPredicate<(all_of FeatureStdExtZtso),
468468
"'Ztso' (Memory Model - Total Store Order)">;
469469

470-
def FeatureStdExtZawrs
471-
: SubtargetFeature<"experimental-zawrs", "HasStdExtZawrs", "true",
472-
"'Zawrs' (Wait on Reservation Set)">;
470+
def FeatureStdExtZawrs : SubtargetFeature<"zawrs", "HasStdExtZawrs", "true",
471+
"'Zawrs' (Wait on Reservation Set)">;
473472
def HasStdExtZawrs : Predicate<"Subtarget->hasStdExtZawrs()">,
474473
AssemblerPredicate<(all_of FeatureStdExtZawrs),
475474
"'Zawrs' (Wait on Reservation Set)">;

‎llvm/test/CodeGen/RISCV/attributes.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
; RUN: llc -mtriple=riscv64 -mattr=+xtheadbs %s -o - | FileCheck --check-prefixes=CHECK,RV64XTHEADBS %s
9898
; RUN: llc -mtriple=riscv64 -mattr=+xtheadmac %s -o - | FileCheck --check-prefixes=CHECK,RV64XTHEADMAC %s
9999
; RUN: llc -mtriple=riscv64 -mattr=+xtheadvdot %s -o - | FileCheck --check-prefixes=CHECK,RV64XTHEADVDOT %s
100-
; RUN: llc -mtriple=riscv64 -mattr=+experimental-zawrs %s -o - | FileCheck --check-prefixes=CHECK,RV64ZAWRS %s
100+
; RUN: llc -mtriple=riscv64 -mattr=+zawrs %s -o - | FileCheck --check-prefixes=CHECK,RV64ZAWRS %s
101101
; RUN: llc -mtriple=riscv64 -mattr=+experimental-ztso %s -o - | FileCheck --check-prefixes=CHECK,RV64ZTSO %s
102102
; RUN: llc -mtriple=riscv64 -mattr=+experimental-zca %s -o - | FileCheck --check-prefixes=CHECK,RV64ZCA %s
103103
; RUN: llc -mtriple=riscv64 -mattr=+experimental-zcb %s -o - | FileCheck --check-prefixes=CHECK,RV64ZCB %s

‎llvm/test/MC/RISCV/Zawrs-valid.s

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-zawrs -riscv-no-aliases -show-encoding \
1+
# RUN: llvm-mc %s -triple=riscv32 -mattr=+zawrs -riscv-no-aliases -show-encoding \
22
# RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
3-
# RUN: llvm-mc %s -triple=riscv64 -mattr=+experimental-zawrs -riscv-no-aliases -show-encoding \
3+
# RUN: llvm-mc %s -triple=riscv64 -mattr=+zawrs -riscv-no-aliases -show-encoding \
44
# RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
5-
# RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+experimental-zawrs < %s \
6-
# RUN: | llvm-objdump --mattr=+experimental-zawrs -M no-aliases -d -r - \
5+
# RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+zawrs < %s \
6+
# RUN: | llvm-objdump --mattr=+zawrs -M no-aliases -d -r - \
77
# RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s
8-
# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+experimental-zawrs < %s \
9-
# RUN: | llvm-objdump --mattr=+experimental-zawrs -M no-aliases -d -r - \
8+
# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+zawrs < %s \
9+
# RUN: | llvm-objdump --mattr=+zawrs -M no-aliases -d -r - \
1010
# RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s
1111

1212
# CHECK-ASM-AND-OBJ: wrs.nto

0 commit comments

Comments
 (0)
Failed to load comments.