Skip to content

Commit 63f742c

Browse files
[RISCV] Add sifive-p670 processor (#79015)
This is an OOO core that has a vector unit. For more information see https://www.sifive.com/cores/performance-p650-670. Scheduler model and other tuning will come in separate patches.
1 parent 7bda0ce commit 63f742c

File tree

4 files changed

+88
-3
lines changed

4 files changed

+88
-3
lines changed

clang/test/Driver/riscv-cpus.c

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,54 @@
247247
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+zbb"
248248
// MCPU-SIFIVE-P450-SAME: "-target-feature" "+zbs"
249249
// MCPU-SIFIVE-P450-SAME: "-target-abi" "lp64d"
250-
//
250+
251+
// RUN: %clang -target riscv64 -### -c %s 2>&1 -mcpu=sifive-p670 | FileCheck -check-prefix=MCPU-SIFIVE-P670 %s
252+
// MCPU-SIFIVE-P670: "-target-cpu" "sifive-p670"
253+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+m"
254+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+a"
255+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+f"
256+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+d"
257+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+c"
258+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+v"
259+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zic64b"
260+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zicbom"
261+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zicbop"
262+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zicboz"
263+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+ziccamoa"
264+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+ziccif"
265+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zicclsm"
266+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+ziccrse"
267+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zicsr"
268+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zifencei"
269+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zihintntl"
270+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zihintpause"
271+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zihpm"
272+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+za64rs"
273+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zfhmin"
274+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zba"
275+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zbb"
276+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zbs"
277+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvbb"
278+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvbc"
279+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zve32f"
280+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zve32x"
281+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zve64d"
282+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zve64f"
283+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zve64x"
284+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvkg"
285+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvkn"
286+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvknc"
287+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvkned"
288+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvkng"
289+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvknhb"
290+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvks"
291+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvksc"
292+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvksed"
293+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvksg"
294+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvksh"
295+
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvkt"
296+
// MCPU-SIFIVE-P670-SAME: "-target-abi" "lp64d"
297+
251298
// Check failed cases
252299

253300
// 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-p450, 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-p670, 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-p450, 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-p670, sifive-s21, sifive-s51, sifive-s54, sifive-s76, sifive-u54, sifive-u74, sifive-x280, veyron-v1, xiangshan-nanhu, generic, rocket, sifive-7-series{{$}}

llvm/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ Changes to the RISC-V Backend
180180
and Zic64b extensions which were introduced as a part of the RISC-V Profiles
181181
specification.
182182
* The Smepmp 1.0 extension is now supported.
183+
* ``-mcpu=sifive-p670`` was added.
183184

184185
Changes to the WebAssembly Backend
185186
----------------------------------

llvm/lib/Target/RISCV/RISCVProcessors.td

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,43 @@ def SIFIVE_P450 : RISCVProcessorModel<"sifive-p450", SiFiveP400Model,
245245
TuneLUIADDIFusion,
246246
TuneAUIPCADDIFusion]>;
247247

248+
def SIFIVE_P670 : RISCVProcessorModel<"sifive-p670", NoSchedModel,
249+
[Feature64Bit,
250+
FeatureStdExtZifencei,
251+
FeatureStdExtM,
252+
FeatureStdExtA,
253+
FeatureStdExtF,
254+
FeatureStdExtD,
255+
FeatureStdExtC,
256+
FeatureStdExtZa64rs,
257+
FeatureStdExtZic64b,
258+
FeatureStdExtZicbop,
259+
FeatureStdExtZicbom,
260+
FeatureStdExtZicboz,
261+
FeatureStdExtZiccamoa,
262+
FeatureStdExtZiccif,
263+
FeatureStdExtZicclsm,
264+
FeatureStdExtZiccrse,
265+
FeatureStdExtZihintntl,
266+
FeatureStdExtZihintpause,
267+
FeatureStdExtZihpm,
268+
FeatureStdExtZba,
269+
FeatureStdExtZbb,
270+
FeatureStdExtZbs,
271+
FeatureStdExtZfhmin,
272+
FeatureStdExtV,
273+
FeatureStdExtZvl128b,
274+
FeatureStdExtZvbb,
275+
FeatureStdExtZvknc,
276+
FeatureStdExtZvkng,
277+
FeatureStdExtZvksc,
278+
FeatureStdExtZvksg,
279+
FeatureFastUnalignedAccess],
280+
[TuneNoDefaultUnroll,
281+
TuneConditionalCompressedMoveFusion,
282+
TuneLUIADDIFusion,
283+
TuneAUIPCADDIFusion]>;
284+
248285
def SYNTACORE_SCR1_BASE : RISCVProcessorModel<"syntacore-scr1-base",
249286
SyntacoreSCR1Model,
250287
[Feature32Bit,

0 commit comments

Comments
 (0)