Skip to content

Commit 5191469

Browse files
committed
fixup! [RISCV] Add support for Smepmp 1.0
1 parent ab316ea commit 5191469

File tree

6 files changed

+23
-14
lines changed

6 files changed

+23
-14
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139

140140
// Experimental extensions
141141

142+
// CHECK-NOT: __riscv_smepmp {{.*$}}
142143
// CHECK-NOT: __riscv_zacas {{.*$}}
143144
// CHECK-NOT: __riscv_zcmop {{.*$}}
144145
// CHECK-NOT: __riscv_zfbfmin {{.*$}}
@@ -1108,6 +1109,14 @@
11081109
// RUN: -o - | FileCheck --check-prefix=CHECK-SSAIA-EXT %s
11091110
// CHECK-SSAIA-EXT: __riscv_ssaia 1000000{{$}}
11101111

1112+
// RUN: %clang --target=riscv32 -menable-experimental-extensions \
1113+
// RUN: -march=rv32ismepmp1p0 -x c -E -dM %s \
1114+
// RUN: -o - | FileCheck --check-prefix=CHECK-SMEPMP-EXT %s
1115+
// RUN: %clang --target=riscv64 -menable-experimental-extensions \
1116+
// RUN: -march=rv64ismepmp1p0 -x c -E -dM %s \
1117+
// RUN: -o - | FileCheck --check-prefix=CHECK-SMEPMP-EXT %s
1118+
// CHECK-SMEPMP-EXT: __riscv_smepmp 1000000{{$}}
1119+
11111120
// RUN: %clang --target=riscv32-unknown-linux-gnu \
11121121
// RUN: -march=rv32izfa -x c -E -dM %s \
11131122
// RUN: -o - | FileCheck --check-prefix=CHECK-ZFA-EXT %s

llvm/docs/RISCVUsage.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ on support follow.
9292
``H`` Assembly Support
9393
``M`` Supported
9494
``Smaia`` Supported
95+
``Smepmp`` Supported
9596
``Ssaia`` Supported
9697
``Svinval`` Assembly Support
9798
``Svnapot`` Assembly Support

llvm/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ Changes to the RISC-V Backend
160160
* Support was added for the Ziccif, Ziccrse, Ziccamoa, Zicclsm, Za64rs, Za128rs
161161
and Zic64b extensions which were introduced as a part of the RISC-V Profiles
162162
specification.
163+
* The Smepmp 1.0 extension is now supported.
163164

164165
Changes to the WebAssembly Backend
165166
----------------------------------

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -743,18 +743,16 @@ def FeatureStdExtSmaia
743743
"'Smaia' (Advanced Interrupt Architecture Machine "
744744
"Level)", []>;
745745

746-
def FeatureStdExtSmepmp
747-
: SubtargetFeature<"smepmp", "HasStdExtSmepmp", "true",
748-
"'Smepmp' (Smepmp prevents privileged processes from "
749-
"executing or accessing unprivileged programs and"
750-
"data.)",
751-
[]>;
752-
753746
def FeatureStdExtSsaia
754747
: SubtargetFeature<"ssaia", "HasStdExtSsaia", "true",
755748
"'Ssaia' (Advanced Interrupt Architecture Supervisor "
756749
"Level)", []>;
757750

751+
def FeatureStdExtSmepmp
752+
: SubtargetFeature<"smepmp", "HasStdExtSmepmp", "true",
753+
"'Smepmp' (PMP Enhancements for memory access and "
754+
"execution prevention on Machine mode)", []>;
755+
758756
def HasHalfFPLoadStoreMove
759757
: Predicate<"Subtarget->hasHalfFPLoadStoreMove()">,
760758
AssemblerPredicate<(any_of FeatureStdExtZfh, FeatureStdExtZfhmin,

llvm/test/CodeGen/RISCV/attributes.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@
8888
; RUN: llc -mtriple=riscv32 -mattr=+experimental-zimop %s -o - | FileCheck --check-prefix=RV32ZIMOP %s
8989
; RUN: llc -mtriple=riscv32 -mattr=+experimental-zcmop %s -o - | FileCheck --check-prefix=RV32ZCMOP %s
9090
; RUN: llc -mtriple=riscv32 -mattr=+smaia %s -o - | FileCheck --check-prefixes=CHECK,RV32SMAIA %s
91-
; RUN: llc -mtriple=riscv32 -mattr=+smepmp %s -o - | FileCheck --check-prefixes=CHECK,RV32SMEPMP %s
9291
; RUN: llc -mtriple=riscv32 -mattr=+ssaia %s -o - | FileCheck --check-prefixes=CHECK,RV32SSAIA %s
92+
; RUN: llc -mtriple=riscv32 -mattr=+smepmp %s -o - | FileCheck --check-prefixes=CHECK,RV32SMEPMP %s
9393
; RUN: llc -mtriple=riscv32 -mattr=+experimental-zfbfmin %s -o - | FileCheck --check-prefixes=CHECK,RV32ZFBFMIN %s
9494
; RUN: llc -mtriple=riscv32 -mattr=+experimental-zvfbfmin %s -o - | FileCheck --check-prefixes=CHECK,RV32ZVFBFMIN %s
9595
; RUN: llc -mtriple=riscv32 -mattr=+experimental-zvfbfwma %s -o - | FileCheck --check-prefixes=CHECK,RV32ZVFBFWMA %s
@@ -190,8 +190,8 @@
190190
; RUN: llc -mtriple=riscv64 -mattr=+experimental-zimop %s -o - | FileCheck --check-prefix=RV64ZIMOP %s
191191
; RUN: llc -mtriple=riscv64 -mattr=+experimental-zcmop %s -o - | FileCheck --check-prefix=RV64ZCMOP %s
192192
; RUN: llc -mtriple=riscv64 -mattr=+smaia %s -o - | FileCheck --check-prefixes=CHECK,RV64SMAIA %s
193-
; RUN: llc -mtriple=riscv64 -mattr=+smepmp %s -o - | FileCheck --check-prefixes=CHECK,RV64SMEPMP %s
194193
; RUN: llc -mtriple=riscv64 -mattr=+ssaia %s -o - | FileCheck --check-prefixes=CHECK,RV64SSAIA %s
194+
; RUN: llc -mtriple=riscv64 -mattr=+smepmp %s -o - | FileCheck --check-prefixes=CHECK,RV64SMEPMP %s
195195
; RUN: llc -mtriple=riscv64 -mattr=+experimental-zfbfmin %s -o - | FileCheck --check-prefixes=CHECK,RV64ZFBFMIN %s
196196
; RUN: llc -mtriple=riscv64 -mattr=+experimental-zvfbfmin %s -o - | FileCheck --check-prefixes=CHECK,RV64ZVFBFMIN %s
197197
; RUN: llc -mtriple=riscv64 -mattr=+experimental-zvfbfwma %s -o - | FileCheck --check-prefixes=CHECK,RV64ZVFBFWMA %s
@@ -287,8 +287,8 @@
287287
; RV32ZIMOP: .attribute 5, "rv32i2p1_zimop0p1"
288288
; RV32ZCMOP: .attribute 5, "rv32i2p1_zca1p0_zcmop0p2"
289289
; RV32SMAIA: .attribute 5, "rv32i2p1_smaia1p0"
290-
; RV32SMEPMP: .attribute 5, "rv32i2p1_smepmp1p0"
291290
; RV32SSAIA: .attribute 5, "rv32i2p1_ssaia1p0"
291+
; RV32SMEPMP: .attribute 5, "rv32i2p1_smepmp1p0"
292292
; RV32ZFBFMIN: .attribute 5, "rv32i2p1_f2p2_zicsr2p0_zfbfmin1p0"
293293
; RV32ZVFBFMIN: .attribute 5, "rv32i2p1_f2p2_zicsr2p0_zve32f1p0_zve32x1p0_zvfbfmin1p0_zvl32b1p0"
294294
; RV32ZVFBFWMA: .attribute 5, "rv32i2p1_f2p2_zicsr2p0_zfbfmin1p0_zve32f1p0_zve32x1p0_zvfbfmin1p0_zvfbfwma1p0_zvl32b1p0"
@@ -388,8 +388,8 @@
388388
; RV64ZIMOP: .attribute 5, "rv64i2p1_zimop0p1"
389389
; RV64ZCMOP: .attribute 5, "rv64i2p1_zca1p0_zcmop0p2"
390390
; RV64SMAIA: .attribute 5, "rv64i2p1_smaia1p0"
391-
; RV64SMEPMP: .attribute 5, "rv64i2p1_smepmp1p0"
392391
; RV64SSAIA: .attribute 5, "rv64i2p1_ssaia1p0"
392+
; RV64SMEPMP: .attribute 5, "rv64i2p1_smepmp1p0"
393393
; RV64ZFBFMIN: .attribute 5, "rv64i2p1_f2p2_zicsr2p0_zfbfmin1p0"
394394
; RV64ZVFBFMIN: .attribute 5, "rv64i2p1_f2p2_zicsr2p0_zve32f1p0_zve32x1p0_zvfbfmin1p0_zvl32b1p0"
395395
; RV64ZVFBFWMA: .attribute 5, "rv64i2p1_f2p2_zicsr2p0_zfbfmin1p0_zve32f1p0_zve32x1p0_zvfbfmin1p0_zvfbfwma1p0_zvl32b1p0"

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,12 @@
291291
.attribute arch, "rv32i_smaia1p0"
292292
# CHECK: attribute 5, "rv32i2p1_smaia1p0"
293293

294-
.attribute arch, "rv32i_smepmp1p0"
295-
# CHECK: attribute 5, "rv32i2p1_smepmp1p0"
296-
297294
.attribute arch, "rv32i_ssaia1p0"
298295
# CHECK: attribute 5, "rv32i2p1_ssaia1p0"
299296

297+
.attribute arch, "rv32i_smepmp1p0"
298+
# CHECK: attribute 5, "rv32i2p1_smepmp1p0"
299+
300300
.attribute arch, "rv32i_zfbfmin1p0"
301301
# CHECK: .attribute 5, "rv32i2p1_f2p2_zicsr2p0_zfbfmin1p0"
302302

0 commit comments

Comments
 (0)