Skip to content

Commit 2faeea3

Browse files
authored
[RISCV] Add Ssqosid support to -march. (#80747)
1 parent 6eb7273 commit 2faeea3

File tree

8 files changed

+30
-4
lines changed

8 files changed

+30
-4
lines changed

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
// CHECK-NOT: __riscv_smnpm{{.*$}}
164164
// CHECK-NOT: __riscv_ssnpm{{.*$}}
165165
// CHECK-NOT: __riscv_sspm{{.*$}}
166+
// CHECK-NOT: __riscv_ssqosid{{.*$}}
166167
// CHECK-NOT: __riscv_supm{{.*$}}
167168
// CHECK-NOT: __riscv_zaamo {{.*$}}
168169
// CHECK-NOT: __riscv_zacas {{.*$}}
@@ -1599,19 +1600,27 @@
15991600
// RUN: %clang --target=riscv32 -menable-experimental-extensions \
16001601
// RUN: -march=rv32i_sspm0p8 -E -dM %s \
16011602
// RUN: -o - | FileCheck --check-prefix=CHECK-SSPM-EXT %s
1602-
// RUN: %clang --target=riscv64 \
1603-
// RUN: -march=rv64i_sspm0p8 -E -dM %s -menable-experimental-extensions \
1603+
// RUN: %clang --target=riscv64 -menable-experimental-extensions \
1604+
// RUN: -march=rv64i_sspm0p8 -E -dM %s \
16041605
// RUN: -o - | FileCheck --check-prefix=CHECK-SSPM-EXT %s
16051606
// CHECK-SSPM-EXT: __riscv_sspm 8000{{$}}
16061607

16071608
// RUN: %clang --target=riscv32 -menable-experimental-extensions \
16081609
// RUN: -march=rv32i_supm0p8 -E -dM %s \
16091610
// RUN: -o - | FileCheck --check-prefix=CHECK-SUPM-EXT %s
1610-
// RUN: %clang --target=riscv64 \
1611-
// RUN: -march=rv64i_supm0p8 -E -dM %s -menable-experimental-extensions \
1611+
// RUN: %clang --target=riscv64 -menable-experimental-extensions \
1612+
// RUN: -march=rv64i_supm0p8 -E -dM %s \
16121613
// RUN: -o - | FileCheck --check-prefix=CHECK-SUPM-EXT %s
16131614
// CHECK-SUPM-EXT: __riscv_supm 8000{{$}}
16141615

1616+
// RUN: %clang --target=riscv32 -menable-experimental-extensions \
1617+
// RUN: -march=rv32i_ssqosid1p0 -E -dM %s \
1618+
// RUN: -o - | FileCheck --check-prefix=CHECK-SSQOSID-EXT %s
1619+
// RUN: %clang --target=riscv64 -menable-experimental-extensions \
1620+
// RUN: -march=rv64i_ssqosid1p0 -E -dM %s \
1621+
// RUN: -o - | FileCheck --check-prefix=CHECK-SSQOSID-EXT %s
1622+
// CHECK-SSQOSID-EXT: __riscv_ssqosid 1000000{{$}}
1623+
16151624
// Misaligned
16161625

16171626
// RUN: %clang --target=riscv32-unknown-linux-gnu -march=rv32i -E -dM %s \

llvm/docs/RISCVUsage.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ The primary goal of experimental support is to assist in the process of ratifica
246246
``experimental-ssnpm``, ``experimental-smnpm``, ``experimental-smmpm``, ``experimental-sspm``, ``experimental-supm``
247247
LLVM implements the `v0.8.1 draft specification <https://github.com/riscv/riscv-j-extension/blob/master/zjpm-spec.pdf>`
248248

249+
``experimental-ssqosid``
250+
LLVM implements assembler support for the `v1.0-rc1 draft specification <https://github.com/riscv/riscv-ssqosid/releases/tag/v1.0-rc1>`_.
251+
249252
``experimental-zabha``
250253
LLVM implements assembler support for the `v1.0-rc1 draft specification <https://github.com/riscv/riscv-zabha/tree/v1.0-rc1>`_.
251254

llvm/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ Changes to the RISC-V Backend
102102
names in the RISC-V profiles specification are now recognised.
103103
* Codegen support was added for the Zimop (May-Be-Operations) extension.
104104
* The experimental Ssnpm, Smnpm, Smmpm, Sspm, and Supm 0.8.1 Pointer Masking extensions are supported.
105+
* The experimental Ssqosid extension is supported.
105106

106107
Changes to the WebAssembly Backend
107108
----------------------------------

llvm/lib/Support/RISCVISAInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ static const RISCVSupportedExtension SupportedExperimentalExtensions[] = {
215215
{"smnpm", {0, 8}},
216216
{"ssnpm", {0, 8}},
217217
{"sspm", {0, 8}},
218+
{"ssqosid", {1, 0}},
218219
{"supm", {0, 8}},
219220

220221
{"zaamo", {0, 2}},

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,10 @@ def FeatureStdExtSstc
828828
: SubtargetFeature<"sstc", "HasStdExtSstc", "true",
829829
"'Sstc' (Supervisor-mode timer interrupts)", []>;
830830

831+
def FeaturesSsqosid
832+
: SubtargetFeature<"experimental-ssqosid", "HasStdExtSsqosid", "true",
833+
"'Ssqosid' (Quality-of-Service (QoS) Identifiers)", []>;
834+
831835
def FeatureStdExtShtvala
832836
: SubtargetFeature<"shtvala", "HasStdExtShtvala", "true",
833837
"'Shtvala' (htval provides all needed values)", []>;

llvm/test/CodeGen/RISCV/attributes.ll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
; RUN: llc -mtriple=riscv32 -mattr=+experimental-smmpm %s -o - | FileCheck --check-prefix=RV32SMMPM %s
122122
; RUN: llc -mtriple=riscv32 -mattr=+experimental-sspm %s -o - | FileCheck --check-prefix=RV32SSPM %s
123123
; RUN: llc -mtriple=riscv32 -mattr=+experimental-supm %s -o - | FileCheck --check-prefix=RV32SUPM %s
124+
; RUN: llc -mtriple=riscv32 -mattr=+experimental-ssqosid %s -o - | FileCheck --check-prefix=RV32SSQOSID %s
124125

125126
; RUN: llc -mtriple=riscv64 %s -o - | FileCheck %s
126127
; RUN: llc -mtriple=riscv64 -mattr=+m %s -o - | FileCheck --check-prefixes=CHECK,RV64M %s
@@ -249,6 +250,7 @@
249250
; RUN: llc -mtriple=riscv64 -mattr=+experimental-smmpm %s -o - | FileCheck --check-prefix=RV64SMMPM %s
250251
; RUN: llc -mtriple=riscv64 -mattr=+experimental-sspm %s -o - | FileCheck --check-prefix=RV64SSPM %s
251252
; RUN: llc -mtriple=riscv64 -mattr=+experimental-supm %s -o - | FileCheck --check-prefix=RV64SUPM %s
253+
; RUN: llc -mtriple=riscv64 -mattr=+experimental-ssqosid %s -o - | FileCheck --check-prefix=RV64SSQOSID %s
252254

253255
; CHECK: .attribute 4, 16
254256

@@ -372,6 +374,7 @@
372374
; RV32SMMPM: .attribute 5, "rv32i2p1_smmpm0p8"
373375
; RV32SSPM: .attribute 5, "rv32i2p1_sspm0p8"
374376
; RV32SUPM: .attribute 5, "rv32i2p1_supm0p8"
377+
; RV32SSQOSID: .attribute 5, "rv32i2p1_ssqosid1p0"
375378

376379
; RV64M: .attribute 5, "rv64i2p1_m2p0"
377380
; RV64ZMMUL: .attribute 5, "rv64i2p1_zmmul1p0"
@@ -499,6 +502,7 @@
499502
; RV64SMMPM: .attribute 5, "rv64i2p1_smmpm0p8"
500503
; RV64SSPM: .attribute 5, "rv64i2p1_sspm0p8"
501504
; RV64SUPM: .attribute 5, "rv64i2p1_supm0p8"
505+
; RV64SSQOSID: .attribute 5, "rv64i2p1_ssqosid1p0"
502506

503507
define i32 @addi(i32 %a) {
504508
%1 = add i32 %a, 1

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@
321321
.attribute arch, "rv32i_sscounterenw1p0"
322322
# CHECK: attribute 5, "rv32i2p1_sscounterenw1p0"
323323

324+
.attribute arch, "rv32i_ssqosid1p0"
325+
# CHECK: attribute 5, "rv32i2p1_ssqosid1p0"
326+
324327
.attribute arch, "rv32i_ssstateen1p0"
325328
# CHECK: attribute 5, "rv32i2p1_ssstateen1p0"
326329

llvm/unittests/Support/RISCVISAInfoTest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,7 @@ Experimental extensions
885885
smnpm 0.8
886886
ssnpm 0.8
887887
sspm 0.8
888+
ssqosid 1.0
888889
supm 0.8
889890
890891
Use -march to specify the target's extension.

0 commit comments

Comments
 (0)