Skip to content

Commit 7d439bd

Browse files
yetingkyuxuanchen1997
authored andcommitted
[RISCV] Bump the version of Zicfilp/Zicfiss to 1.0 (#98891)
Summary: Both of them are ratified now. https://wiki.riscv.org/display/HOME/Ratified+Extensions This patch does not set them to non-experimental, since Zicfilp lacks lld support and Zicfiss also lacks compiler-rt/libunwind support. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251754
1 parent d0e88a5 commit 7d439bd

File tree

8 files changed

+22
-21
lines changed

8 files changed

+22
-21
lines changed

clang/test/Driver/print-supported-extensions-riscv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@
169169
// CHECK-NEXT: xwchc 2.2 'Xwchc' (WCH/QingKe additional compressed opcodes)
170170
// CHECK-EMPTY:
171171
// CHECK-NEXT: Experimental extensions
172-
// CHECK-NEXT: zicfilp 0.4 'Zicfilp' (Landing pad)
173-
// CHECK-NEXT: zicfiss 0.4 'Zicfiss' (Shadow stack)
172+
// CHECK-NEXT: zicfilp 1.0 'Zicfilp' (Landing pad)
173+
// CHECK-NEXT: zicfiss 1.0 'Zicfiss' (Shadow stack)
174174
// CHECK-NEXT: zalasr 0.1 'Zalasr' (Load-Acquire and Store-Release Instructions)
175175
// CHECK-NEXT: smmpm 1.0 'Smmpm' (Machine-level Pointer Masking for M-mode)
176176
// CHECK-NEXT: smnpm 1.0 'Smnpm' (Machine-level Pointer Masking for next lower privilege mode)

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,12 +1643,12 @@
16431643
// CHECK-ZFBFMIN-EXT: __riscv_zfbfmin 1000000{{$}}
16441644

16451645
// RUN: %clang --target=riscv32 -menable-experimental-extensions \
1646-
// RUN: -march=rv32i_zicfilp0p4 -E -dM %s \
1646+
// RUN: -march=rv32i_zicfilp1p0 -E -dM %s \
16471647
// RUN: -o - | FileCheck --check-prefix=CHECK-ZICFILP-EXT %s
16481648
// RUN: %clang --target=riscv64 -menable-experimental-extensions \
1649-
// RUN: -march=rv64i_zicfilp0p4 -E -dM %s \
1649+
// RUN: -march=rv64i_zicfilp1p0 -E -dM %s \
16501650
// RUN: -o - | FileCheck --check-prefix=CHECK-ZICFILP-EXT %s
1651-
// CHECK-ZICFILP-EXT: __riscv_zicfilp 4000{{$}}
1651+
// CHECK-ZICFILP-EXT: __riscv_zicfilp 1000000{{$}}
16521652

16531653
// RUN: %clang --target=riscv32-unknown-linux-gnu \
16541654
// RUN: -march=rv32iztso1p0 -E -dM %s \
@@ -1675,12 +1675,12 @@
16751675
// CHECK-ZVFBFWMA-EXT: __riscv_zvfbfwma 1000000{{$}}
16761676

16771677
// RUN: %clang -target riscv32 -menable-experimental-extensions \
1678-
// RUN: -march=rv32izicfiss0p4 -E -dM %s \
1678+
// RUN: -march=rv32izicfiss1p0 -E -dM %s \
16791679
// RUN: -o - | FileCheck --check-prefix=CHECK-ZICFISS-EXT %s
16801680
// RUN: %clang -target riscv64 -menable-experimental-extensions \
1681-
// RUN: -march=rv64izicfiss0p4 -E -dM %s \
1681+
// RUN: -march=rv64izicfiss1p0 -E -dM %s \
16821682
// RUN: -o - | FileCheck --check-prefix=CHECK-ZICFISS-EXT %s
1683-
// CHECK-ZICFISS-EXT: __riscv_zicfiss 4000{{$}}
1683+
// CHECK-ZICFISS-EXT: __riscv_zicfiss 1000000{{$}}
16841684

16851685
// RUN: %clang --target=riscv32 -menable-experimental-extensions \
16861686
// RUN: -march=rv32i_ssnpm1p0 -E -dM %s \

llvm/docs/RISCVUsage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ The primary goal of experimental support is to assist in the process of ratifica
303303
LLVM implements the `0.0.5 draft specification <https://github.com/mehnadnerd/riscv-zalasr>`__.
304304

305305
``experimental-zicfilp``, ``experimental-zicfiss``
306-
LLVM implements the `0.4 draft specification <https://github.com/riscv/riscv-cfi/releases/tag/v0.4.0>`__.
306+
LLVM implements the `1.0 release specification <https://github.com/riscv/riscv-cfi/releases/tag/v1.0>`__.
307307

308308
To use an experimental extension from `clang`, you must add `-menable-experimental-extensions` to the command line, and specify the exact version of the experimental extension you are using. To use an experimental extension with LLVM's internal developer tools (e.g. `llc`, `llvm-objdump`, `llvm-mc`), you must prefix the extension name with `experimental-`. Note that you don't need to specify the version with internal tools, and shouldn't include the `experimental-` prefix with `clang`.
309309

llvm/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ Changes to the RISC-V Backend
204204
* The WCH / Nanjing Qinheng Microelectronics QingKe "XW" compressed opcodes are
205205
supported under the name "Xwchc".
206206
* ``-mcpu=native`` now detects available features with hwprobe (RISC-V Hardware Probing Interface) on Linux 6.4 or later.
207+
* The version of Zicfilp/Zicfiss is updated to 1.0.
207208

208209
Changes to the WebAssembly Backend
209210
----------------------------------

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def HasStdExtZimop : Predicate<"Subtarget->hasStdExtZimop()">,
151151
"'Zimop' (May-Be-Operations)">;
152152

153153
def FeatureStdExtZicfilp
154-
: RISCVExperimentalExtension<"zicfilp", 0, 4,
154+
: RISCVExperimentalExtension<"zicfilp", 1, 0,
155155
"'Zicfilp' (Landing pad)",
156156
[FeatureStdExtZicsr]>;
157157
def HasStdExtZicfilp : Predicate<"Subtarget->hasStdExtZicfilp()">,
@@ -161,7 +161,7 @@ def NoStdExtZicfilp : Predicate<"!Subtarget->hasStdExtZicfilp()">,
161161
AssemblerPredicate<(all_of (not FeatureStdExtZicfilp))>;
162162

163163
def FeatureStdExtZicfiss
164-
: RISCVExperimentalExtension<"zicfiss", 0, 4,
164+
: RISCVExperimentalExtension<"zicfiss", 1, 0,
165165
"'Zicfiss' (Shadow stack)",
166166
[FeatureStdExtZicsr, FeatureStdExtZimop]>;
167167
def HasStdExtZicfiss : Predicate<"Subtarget->hasStdExtZicfiss()">,

llvm/test/CodeGen/RISCV/attributes.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@
407407
; RV32ZACAS: .attribute 5, "rv32i2p1_a2p1_zacas1p0"
408408
; RV32ZALASR: .attribute 5, "rv32i2p1_zalasr0p1"
409409
; RV32ZAMA16B: .attribute 5, "rv32i2p1_zama16b1p0"
410-
; RV32ZICFILP: .attribute 5, "rv32i2p1_zicfilp0p4_zicsr2p0"
410+
; RV32ZICFILP: .attribute 5, "rv32i2p1_zicfilp1p0_zicsr2p0"
411411
; RV32ZABHA: .attribute 5, "rv32i2p1_a2p1_zabha1p0"
412412
; RV32SSNPM: .attribute 5, "rv32i2p1_ssnpm1p0"
413413
; RV32SMNPM: .attribute 5, "rv32i2p1_smnpm1p0"
@@ -543,7 +543,7 @@
543543
; RV64ZVFBFWMA: .attribute 5, "rv64i2p1_f2p2_zicsr2p0_zfbfmin1p0_zve32f1p0_zve32x1p0_zvfbfmin1p0_zvfbfwma1p0_zvl32b1p0"
544544
; RV64ZACAS: .attribute 5, "rv64i2p1_a2p1_zacas1p0"
545545
; RV64ZALASR: .attribute 5, "rv64i2p1_zalasr0p1"
546-
; RV64ZICFILP: .attribute 5, "rv64i2p1_zicfilp0p4_zicsr2p0"
546+
; RV64ZICFILP: .attribute 5, "rv64i2p1_zicfilp1p0_zicsr2p0"
547547
; RV64ZABHA: .attribute 5, "rv64i2p1_a2p1_zabha1p0"
548548
; RV64SSNPM: .attribute 5, "rv64i2p1_ssnpm1p0"
549549
; RV64SMNPM: .attribute 5, "rv64i2p1_smnpm1p0"

llvm/test/MC/RISCV/attribute-arch.s

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,11 +408,11 @@
408408
.attribute arch, "rv32i_xcvbi"
409409
# CHECK: attribute 5, "rv32i2p1_xcvbi1p0"
410410

411-
.attribute arch, "rv32i_zicfilp0p4"
412-
# CHECK: attribute 5, "rv32i2p1_zicfilp0p4_zicsr2p0"
411+
.attribute arch, "rv32i_zicfilp1p0"
412+
# CHECK: attribute 5, "rv32i2p1_zicfilp1p0_zicsr2p0"
413413

414-
.attribute arch, "rv32i_zicfiss0p4"
415-
# CHECK: .attribute 5, "rv32i2p1_zicfiss0p4_zicsr2p0_zimop1p0"
414+
.attribute arch, "rv32i_zicfiss1p0"
415+
# CHECK: .attribute 5, "rv32i2p1_zicfiss1p0_zicsr2p0_zimop1p0"
416416

417417
.attribute arch, "rv64i_xsfvfwmaccqqq"
418418
# CHECK: attribute 5, "rv64i2p1_f2p2_zicsr2p0_zve32f1p0_zve32x1p0_zvfbfmin1p0_zvl32b1p0_xsfvfwmaccqqq1p0"

llvm/unittests/TargetParser/RISCVISAInfoTest.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,8 +1026,8 @@ R"(All available -march extensions for RISC-V
10261026
xwchc 2.2
10271027
10281028
Experimental extensions
1029-
zicfilp 0.4 This is a long dummy description
1030-
zicfiss 0.4
1029+
zicfilp 1.0 This is a long dummy description
1030+
zicfiss 1.0
10311031
zalasr 0.1
10321032
smmpm 1.0
10331033
smnpm 1.0
@@ -1079,9 +1079,9 @@ R"(Extensions enabled for the given RISC-V target
10791079
i 2.1 'I' (Base Integer Instruction Set)
10801080
10811081
Experimental extensions
1082-
zicfilp 0.4 'Zicfilp' (Landing pad)
1082+
zicfilp 1.0 'Zicfilp' (Landing pad)
10831083
1084-
ISA String: rv64i2p1_zicfilp0p4_zicsr2p0
1084+
ISA String: rv64i2p1_zicfilp1p0_zicsr2p0
10851085
)";
10861086
// clang-format on
10871087

0 commit comments

Comments
 (0)