Skip to content

Commit 75c75fc

Browse files
authored
[RISCV]Add svvptc extension (#113882)
1 parent 056cf93 commit 75c75fc

File tree

8 files changed

+24
-1
lines changed

8 files changed

+24
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
// CHECK-NEXT: svinval 1.0 'Svinval' (Fine-Grained Address-Translation Cache Invalidation)
148148
// CHECK-NEXT: svnapot 1.0 'Svnapot' (NAPOT Translation Contiguity)
149149
// CHECK-NEXT: svpbmt 1.0 'Svpbmt' (Page-Based Memory Types)
150+
// CHECK-NEXT: svvptc 1.0 'svvptc' (Obviating Memory-Management Instructions after Marking PTEs Valid)
150151
// CHECK-NEXT: xcvalu 1.0 'XCValu' (CORE-V ALU Operations)
151152
// CHECK-NEXT: xcvbi 1.0 'XCVbi' (CORE-V Immediate Branching)
152153
// CHECK-NEXT: xcvbitmanip 1.0 'XCVbitmanip' (CORE-V Bit Manipulation)

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
// CHECK-NOT: __riscv_svinval {{.*$}}
5353
// CHECK-NOT: __riscv_svnapot {{.*$}}
5454
// CHECK-NOT: __riscv_svpbmt {{.*$}}
55+
// CHECK-NOT: __riscv_svvptc {{.*$}}
5556
// CHECK-NOT: __riscv_v {{.*$}}
5657
// CHECK-NOT: __riscv_v_elen {{.*$}}
5758
// CHECK-NOT: __riscv_v_elen_fp {{.*$}}
@@ -516,6 +517,14 @@
516517
// RUN: -o - | FileCheck --check-prefix=CHECK-SVPBMT-EXT %s
517518
// CHECK-SVPBMT-EXT: __riscv_svpbmt 1000000{{$}}
518519

520+
// RUN: %clang --target=riscv32-unknown-linux-gnu \
521+
// RUN: -march=rv32isvvptc -E -dM %s \
522+
// RUN: -o - | FileCheck --check-prefix=CHECK-SVVPTC-EXT %s
523+
// RUN: %clang --target=riscv64-unknown-linux-gnu \
524+
// RUN: -march=rv64isvvptc -E -dM %s \
525+
// RUN: -o - | FileCheck --check-prefix=CHECK-SVVPTC-EXT %s
526+
// CHECK-SVVPTC-EXT: __riscv_svvptc 1000000{{$}}
527+
519528
// RUN: %clang --target=riscv32-unknown-linux-gnu \
520529
// RUN: -march=rv32iv1p0 -E -dM %s \
521530
// RUN: -o - | FileCheck --check-prefix=CHECK-V-EXT %s

llvm/docs/RISCVUsage.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ on support follow.
156156
``Svinval`` Assembly Support
157157
``Svnapot`` Assembly Support
158158
``Svpbmt`` Supported
159+
``Svvptc`` Supported
159160
``V`` Supported
160161
``Za128rs`` Supported (`See note <#riscv-profiles-extensions-note>`__)
161162
``Za64rs`` Supported (`See note <#riscv-profiles-extensions-note>`__)

llvm/docs/ReleaseNotes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Changes to the RISC-V Backend
178178
means Zve32x and Zve32f will also require Zvl64b. The prior support was
179179
largely untested.
180180
* The `Zvbc32e` and `Zvkgs` extensions are now supported experimentally.
181-
* Added `Smctr` and `Ssctr` extensions.
181+
* Added `Smctr`, `Ssctr` and `Svvptc` extensions.
182182
* `-mcpu=syntacore-scr7` was added.
183183
* The `Zacas` extension is no longer marked as experimental.
184184
* The `Smmpm`, `Smnpm`, `Ssnpm`, `Supm`, and `Sspm` pointer masking extensions

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,10 @@ def FeatureStdExtSvpbmt
10291029
: RISCVExtension<"svpbmt", 1, 0,
10301030
"'Svpbmt' (Page-Based Memory Types)">;
10311031

1032+
def FeatureStdExtSvvptc
1033+
: RISCVExtension<"svvptc", 1, 0,
1034+
"'svvptc' (Obviating Memory-Management Instructions after Marking PTEs Valid)">;
1035+
10321036
def FeatureStdExtSha
10331037
: RISCVExtension<"sha", 1, 0,
10341038
"'Sha' (Augmented Hypervisor)",

llvm/test/CodeGen/RISCV/attributes.ll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
; RUN: llc -mtriple=riscv32 -mattr=+svbare %s -o - | FileCheck --check-prefixes=CHECK,RV32SVBARE %s
6363
; RUN: llc -mtriple=riscv32 -mattr=+svnapot %s -o - | FileCheck --check-prefixes=CHECK,RV32SVNAPOT %s
6464
; RUN: llc -mtriple=riscv32 -mattr=+svpbmt %s -o - | FileCheck --check-prefixes=CHECK,RV32SVPBMT %s
65+
; RUN: llc -mtriple=riscv32 -mattr=+svvptc %s -o - | FileCheck --check-prefixes=CHECK,RV32SVVPTC %s
6566
; RUN: llc -mtriple=riscv32 -mattr=+svinval %s -o - | FileCheck --check-prefixes=CHECK,RV32SVINVAL %s
6667
; RUN: llc -mtriple=riscv32 -mattr=+xcvalu %s -o - | FileCheck --check-prefix=RV32XCVALU %s
6768
; RUN: llc -mtriple=riscv32 -mattr=+xcvbitmanip %s -o - | FileCheck --check-prefix=RV32XCVBITMANIP %s
@@ -202,6 +203,7 @@
202203
; RUN: llc -mtriple=riscv64 -mattr=+svbare %s -o - | FileCheck --check-prefixes=CHECK,RV64SVBARE %s
203204
; RUN: llc -mtriple=riscv64 -mattr=+svnapot %s -o - | FileCheck --check-prefixes=CHECK,RV64SVNAPOT %s
204205
; RUN: llc -mtriple=riscv64 -mattr=+svpbmt %s -o - | FileCheck --check-prefixes=CHECK,RV64SVPBMT %s
206+
; RUN: llc -mtriple=riscv64 -mattr=+svvptc %s -o - | FileCheck --check-prefixes=CHECK,RV64SVVPTC %s
205207
; RUN: llc -mtriple=riscv64 -mattr=+svinval %s -o - | FileCheck --check-prefixes=CHECK,RV64SVINVAL %s
206208
; RUN: llc -mtriple=riscv64 -mattr=+xventanacondops %s -o - | FileCheck --check-prefixes=CHECK,RV64XVENTANACONDOPS %s
207209
; RUN: llc -mtriple=riscv64 -mattr=+xsfvfwmaccqqq %s -o - | FileCheck --check-prefix=RV64XSFVFWMACCQQQ %s
@@ -358,6 +360,7 @@
358360
; RV32SVBARE: .attribute 5, "rv32i2p1_svbare1p0"
359361
; RV32SVNAPOT: .attribute 5, "rv32i2p1_svnapot1p0"
360362
; RV32SVPBMT: .attribute 5, "rv32i2p1_svpbmt1p0"
363+
; RV32SVVPTC: .attribute 5, "rv32i2p1_svvptc1p0"
361364
; RV32SVINVAL: .attribute 5, "rv32i2p1_svinval1p0"
362365
; RV32XCVALU: .attribute 5, "rv32i2p1_xcvalu1p0"
363366
; RV32XCVBITMANIP: .attribute 5, "rv32i2p1_xcvbitmanip1p0"
@@ -500,6 +503,7 @@
500503
; RV64SVBARE: .attribute 5, "rv64i2p1_svbare1p0"
501504
; RV64SVNAPOT: .attribute 5, "rv64i2p1_svnapot1p0"
502505
; RV64SVPBMT: .attribute 5, "rv64i2p1_svpbmt1p0"
506+
; RV64SVVPTC: .attribute 5, "rv64i2p1_svvptc1p0"
503507
; RV64SVINVAL: .attribute 5, "rv64i2p1_svinval1p0"
504508
; RV64XVENTANACONDOPS: .attribute 5, "rv64i2p1_xventanacondops1p0"
505509
; RV64XSFVFWMACCQQQ: .attribute 5, "rv64i2p1_f2p2_zicsr2p0_zve32f1p0_zve32x1p0_zvfbfmin1p0_zvl32b1p0_xsfvfwmaccqqq1p0"

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,9 @@
375375
.attribute arch, "rv32i_svbare1p0"
376376
# CHECK: attribute 5, "rv32i2p1_svbare1p0"
377377

378+
.attribute arch, "rv32i_svvptc1p0"
379+
# CHECK: attribute 5, "rv32i2p1_svvptc1p0"
380+
378381
.attribute arch, "rv32i_zfbfmin1p0"
379382
# CHECK: .attribute 5, "rv32i2p1_f2p2_zicsr2p0_zfbfmin1p0"
380383

llvm/unittests/TargetParser/RISCVISAInfoTest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,7 @@ R"(All available -march extensions for RISC-V
10921092
svinval 1.0
10931093
svnapot 1.0
10941094
svpbmt 1.0
1095+
svvptc 1.0
10951096
xcvalu 1.0
10961097
xcvbi 1.0
10971098
xcvbitmanip 1.0

0 commit comments

Comments
 (0)