Skip to content

Commit b03f0c5

Browse files
authored
[RISCV] Add sifive-p450 CPU. (#75760)
This is an out of order core with no vector unit. More information: https://www.sifive.com/cores/performance-p450-470 Scheduler model and other tuning will come in separate patches.
1 parent 7a87ff6 commit b03f0c5

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

clang/test/Driver/riscv-cpus.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,27 @@
222222
// MCPU-SIFIVE-X280-SAME: "-target-feature" "+zvl512b" "-target-feature" "+zvl64b"
223223
// MCPU-SIFIVE-X280-SAME: "-target-abi" "lp64d"
224224

225+
// RUN: %clang -target riscv64 -### -c %s 2>&1 -mcpu=sifive-p450 | FileCheck -check-prefix=MCPU-SIFIVE-P450 %s
226+
// MCPU-SIFIVE-P450: "-nostdsysteminc" "-target-cpu" "sifive-p450"
227+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+m"
228+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+a"
229+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+f"
230+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+d"
231+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+c"
232+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+zicbom"
233+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+zicbop"
234+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+zicboz"
235+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+zicsr"
236+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+zifencei"
237+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+zihintntl"
238+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+zihintpause"
239+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+zihpm"
240+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+zfhmin"
241+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+zba"
242+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+zbb"
243+
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+zbs"
244+
// MCPU-SIFIVE-P450-SAME: "-target-abi" "lp64d"
245+
//
225246
// Check failed cases
226247

227248
// RUN: not %clang --target=riscv32 -### -c %s 2>&1 -mcpu=generic-rv321 | FileCheck -check-prefix=FAIL-MCPU-NAME %s

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@
8585

8686
// RUN: not %clang_cc1 -triple riscv64 -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix RISCV64
8787
// RISCV64: error: unknown target CPU 'not-a-cpu'
88-
// RISCV64-NEXT: note: valid target CPU values are: generic-rv64, rocket-rv64, sifive-s21, sifive-s51, sifive-s54, sifive-s76, sifive-u54, sifive-u74, sifive-x280, veyron-v1, xiangshan-nanhu{{$}}
88+
// RISCV64-NEXT: note: valid target CPU values are: generic-rv64, rocket-rv64, sifive-p450, sifive-s21, sifive-s51, sifive-s54, sifive-s76, sifive-u54, sifive-u74, sifive-x280, veyron-v1, xiangshan-nanhu{{$}}
8989

9090
// RUN: not %clang_cc1 -triple riscv32 -tune-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix TUNE-RISCV32
9191
// TUNE-RISCV32: error: unknown target CPU 'not-a-cpu'
9292
// TUNE-RISCV32-NEXT: note: valid target CPU values are: generic-rv32, rocket-rv32, sifive-e20, sifive-e21, sifive-e24, sifive-e31, sifive-e34, sifive-e76, syntacore-scr1-base, syntacore-scr1-max, generic, rocket, sifive-7-series{{$}}
9393

9494
// RUN: not %clang_cc1 -triple riscv64 -tune-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix TUNE-RISCV64
9595
// TUNE-RISCV64: error: unknown target CPU 'not-a-cpu'
96-
// TUNE-RISCV64-NEXT: note: valid target CPU values are: generic-rv64, rocket-rv64, sifive-s21, sifive-s51, sifive-s54, sifive-s76, sifive-u54, sifive-u74, sifive-x280, veyron-v1, xiangshan-nanhu, generic, rocket, sifive-7-series{{$}}
96+
// TUNE-RISCV64-NEXT: note: valid target CPU values are: generic-rv64, rocket-rv64, sifive-p450, sifive-s21, sifive-s51, sifive-s54, sifive-s76, sifive-u54, sifive-u74, sifive-x280, veyron-v1, xiangshan-nanhu, generic, rocket, sifive-7-series{{$}}

llvm/lib/Target/RISCV/RISCVProcessors.td

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,25 @@ def SIFIVE_X280 : RISCVProcessorModel<"sifive-x280", SiFive7Model,
216216
[TuneSiFive7,
217217
TuneDLenFactor2]>;
218218

219+
def SIFIVE_P450 : RISCVProcessorModel<"sifive-p450", NoSchedModel,
220+
[Feature64Bit,
221+
FeatureStdExtZifencei,
222+
FeatureStdExtM,
223+
FeatureStdExtA,
224+
FeatureStdExtF,
225+
FeatureStdExtD,
226+
FeatureStdExtC,
227+
FeatureStdExtZicbop,
228+
FeatureStdExtZicbom,
229+
FeatureStdExtZicboz,
230+
FeatureStdExtZihintntl,
231+
FeatureStdExtZihintpause,
232+
FeatureStdExtZihpm,
233+
FeatureStdExtZba,
234+
FeatureStdExtZbb,
235+
FeatureStdExtZbs,
236+
FeatureStdExtZfhmin]>;
237+
219238
def SYNTACORE_SCR1_BASE : RISCVProcessorModel<"syntacore-scr1-base",
220239
SyntacoreSCR1Model,
221240
[Feature32Bit,

0 commit comments

Comments
 (0)