Skip to content

Commit 52e9f2c

Browse files
authored
[RISCV] Add MIPS P8700 processor (#119882)
The P8700 is a high-performance processor from MIPS designed to meet the demands of modern workloads, offering exceptional scalability and efficiency. It builds on MIPS's established architectural strengths while introducing enhancements that set it apart. For more details, you can check out the official product page here: https://mips.com/products/hardware/p8700/. Scheduling model will be added in a separate commit/PR.
1 parent 64da33a commit 52e9f2c

File tree

5 files changed

+39
-0
lines changed

5 files changed

+39
-0
lines changed

clang/test/Driver/riscv-cpus.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,23 @@
9898
// RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=rocket-rv64 | FileCheck -check-prefix=MTUNE-ROCKET64 %s
9999
// MTUNE-ROCKET64: "-tune-cpu" "rocket-rv64"
100100

101+
// RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=mips-p8700 | FileCheck -check-prefix=MTUNE-MIPS-P8700 %s
102+
// MTUNE-MIPS-P8700: "-tune-cpu" "mips-p8700"
103+
104+
// RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=mips-p8700 | FileCheck -check-prefix=MCPU-MIPS-P8700 %s
105+
// MCPU-MIPS-P8700: "-target-cpu" "mips-p8700"
106+
// MCPU-MIPS-P8700-SAME: "-target-feature" "+m"
107+
// MCPU-MIPS-P8700-SAME: "-target-feature" "+a"
108+
// MCPU-MIPS-P8700-SAME: "-target-feature" "+f"
109+
// MCPU-MIPS-P8700-SAME: "-target-feature" "+d"
110+
// MCPU-MIPS-P8700-SAME: "-target-feature" "+c"
111+
// MCPU-MIPS-P8700-SAME: "-target-feature" "+zicsr"
112+
// MCPU-MIPS-P8700-SAME: "-target-feature" "+zifencei"
113+
// MCPU-MIPS-P8700-SAME: "-target-feature" "+zaamo"
114+
// MCPU-MIPS-P8700-SAME: "-target-feature" "+zalrsc"
115+
// MCPU-MIPS-P8700-SAME: "-target-feature" "+zba"
116+
// MCPU-MIPS-P8700-SAME: "-target-feature" "+zbb"
117+
101118
// RUN: %clang --target=riscv32 -### -c %s 2>&1 -mtune=syntacore-scr1-base | FileCheck -check-prefix=MTUNE-SYNTACORE-SCR1-BASE %s
102119
// MTUNE-SYNTACORE-SCR1-BASE: "-tune-cpu" "syntacore-scr1-base"
103120

clang/test/Misc/target-invalid-cpu-note/riscv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
// RISCV64: error: unknown target CPU 'not-a-cpu'
2626
// RISCV64-NEXT: note: valid target CPU values are:
2727
// RISCV64-SAME: {{^}} generic-rv64
28+
// RISCV64-SAME: {{^}}, mips-p8700
2829
// RISCV64-SAME: {{^}}, rocket-rv64
2930
// RISCV64-SAME: {{^}}, sifive-p450
3031
// RISCV64-SAME: {{^}}, sifive-p470
@@ -72,6 +73,7 @@
7273
// TUNE-RISCV64: error: unknown target CPU 'not-a-cpu'
7374
// TUNE-RISCV64-NEXT: note: valid target CPU values are:
7475
// TUNE-RISCV64-SAME: {{^}} generic-rv64
76+
// TUNE-RISCV64-SAME: {{^}}, mips-p8700
7577
// TUNE-RISCV64-SAME: {{^}}, rocket-rv64
7678
// TUNE-RISCV64-SAME: {{^}}, sifive-p450
7779
// TUNE-RISCV64-SAME: {{^}}, sifive-p470

llvm/docs/ReleaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ Changes to the RISC-V Backend
195195
* Added `Smctr`, `Ssctr` and `Svvptc` extensions.
196196
* `-mcpu=syntacore-scr7` was added.
197197
* `-mcpu=tt-ascalon-d8` was added.
198+
* `-mcpu=mips-p8700` was added.
198199
* The `Zacas` extension is no longer marked as experimental.
199200
* Added Smdbltrp, Ssdbltrp extensions to -march.
200201
* 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
@@ -1493,6 +1493,10 @@ def TuneConditionalCompressedMoveFusion
14931493
def HasConditionalMoveFusion : Predicate<"Subtarget->hasConditionalMoveFusion()">;
14941494
def NoConditionalMoveFusion : Predicate<"!Subtarget->hasConditionalMoveFusion()">;
14951495

1496+
def TuneMIPSP8700
1497+
: SubtargetFeature<"mips-p8700", "RISCVProcFamily", "Others",
1498+
"MIPS p8700 processor">;
1499+
14961500
def TuneSiFive7 : SubtargetFeature<"sifive7", "RISCVProcFamily", "SiFive7",
14971501
"SiFive 7-Series processors">;
14981502

llvm/lib/Target/RISCV/RISCVProcessors.td

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,21 @@ def GENERIC_RV64 : RISCVProcessorModel<"generic-rv64",
9595
// to change to the appropriate rv32/rv64 version.
9696
def GENERIC : RISCVTuneProcessorModel<"generic", NoSchedModel>, GenericTuneInfo;
9797

98+
def MIPS_P8700 : RISCVProcessorModel<"mips-p8700",
99+
NoSchedModel,
100+
[Feature64Bit,
101+
FeatureStdExtI,
102+
FeatureStdExtM,
103+
FeatureStdExtA,
104+
FeatureStdExtF,
105+
FeatureStdExtD,
106+
FeatureStdExtC,
107+
FeatureStdExtZba,
108+
FeatureStdExtZbb,
109+
FeatureStdExtZifencei,
110+
FeatureStdExtZicsr],
111+
[TuneMIPSP8700]>;
112+
98113
def ROCKET_RV32 : RISCVProcessorModel<"rocket-rv32",
99114
RocketModel,
100115
[Feature32Bit,

0 commit comments

Comments
 (0)