Skip to content

Commit 5d03235

Browse files
authored
[RISCV] Add -mcpu=sifive-p550. (#122164)
This is the CPU in SiFive's HiFive Premier P550 development board. Scheduler model will come in a later patch.
1 parent 929b90b commit 5d03235

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

clang/test/Driver/riscv-cpus.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,19 @@
433433
// MCPU-SIFIVE-P470-SAME: "-target-feature" "+zvkt"
434434
// MCPU-SIFIVE-P470-SAME: "-target-abi" "lp64d"
435435

436+
// RUN: %clang -target riscv64 -### -c %s 2>&1 -mcpu=sifive-p550 | FileCheck -check-prefix=MCPU-SIFIVE-P550 %s
437+
// MCPU-SIFIVE-P550: "-nostdsysteminc" "-target-cpu" "sifive-p550"
438+
// MCPU-SIFIVE-P550-SAME: "-target-feature" "+m"
439+
// MCPU-SIFIVE-P550-SAME: "-target-feature" "+a"
440+
// MCPU-SIFIVE-P550-SAME: "-target-feature" "+f"
441+
// MCPU-SIFIVE-P550-SAME: "-target-feature" "+d"
442+
// MCPU-SIFIVE-P550-SAME: "-target-feature" "+c"
443+
// MCPU-SIFIVE-P550-SAME: "-target-feature" "+zicsr"
444+
// MCPU-SIFIVE-P550-SAME: "-target-feature" "+zifencei"
445+
// MCPU-SIFIVE-P550-SAME: "-target-feature" "+zba"
446+
// MCPU-SIFIVE-P550-SAME: "-target-feature" "+zbb"
447+
// MCPU-SIFIVE-P550-SAME: "-target-abi" "lp64d"
448+
436449
// RUN: %clang -target riscv64 -### -c %s 2>&1 -mcpu=sifive-p670 | FileCheck -check-prefix=MCPU-SIFIVE-P670 %s
437450
// MCPU-SIFIVE-P670: "-target-cpu" "sifive-p670"
438451
// MCPU-SIFIVE-P670-SAME: "-target-feature" "+m"

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
// RISCV64-SAME: {{^}}, rocket-rv64
3030
// RISCV64-SAME: {{^}}, sifive-p450
3131
// RISCV64-SAME: {{^}}, sifive-p470
32+
// RISCV64-SAME: {{^}}, sifive-p550
3233
// RISCV64-SAME: {{^}}, sifive-p670
3334
// RISCV64-SAME: {{^}}, sifive-s21
3435
// RISCV64-SAME: {{^}}, sifive-s51
@@ -77,6 +78,7 @@
7778
// TUNE-RISCV64-SAME: {{^}}, rocket-rv64
7879
// TUNE-RISCV64-SAME: {{^}}, sifive-p450
7980
// TUNE-RISCV64-SAME: {{^}}, sifive-p470
81+
// TUNE-RISCV64-SAME: {{^}}, sifive-p550
8082
// TUNE-RISCV64-SAME: {{^}}, sifive-p670
8183
// TUNE-RISCV64-SAME: {{^}}, sifive-s21
8284
// TUNE-RISCV64-SAME: {{^}}, sifive-s51

llvm/docs/ReleaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ Changes to the RISC-V Backend
198198
* `-mcpu=syntacore-scr7` was added.
199199
* `-mcpu=tt-ascalon-d8` was added.
200200
* `-mcpu=mips-p8700` was added.
201+
* `-mcpu=sifive-p550` was added.
201202
* The `Zacas` extension is no longer marked as experimental.
202203
* Added Smdbltrp, Ssdbltrp extensions to -march.
203204
* The `Smmpm`, `Smnpm`, `Ssnpm`, `Supm`, and `Sspm` pointer masking extensions

llvm/lib/Target/RISCV/RISCVProcessors.td

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,25 @@ def SIFIVE_P470 : RISCVProcessorModel<"sifive-p470", SiFiveP400Model,
321321
[TuneNoSinkSplatOperands,
322322
TuneVXRMPipelineFlush])>;
323323

324+
defvar SiFiveP500TuneFeatures = [TuneNoDefaultUnroll,
325+
TuneConditionalCompressedMoveFusion,
326+
TuneLUIADDIFusion,
327+
TuneAUIPCADDIFusion,
328+
TunePostRAScheduler];
329+
330+
def SIFIVE_P550 : RISCVProcessorModel<"sifive-p550", NoSchedModel,
331+
[Feature64Bit,
332+
FeatureStdExtI,
333+
FeatureStdExtZifencei,
334+
FeatureStdExtM,
335+
FeatureStdExtA,
336+
FeatureStdExtF,
337+
FeatureStdExtD,
338+
FeatureStdExtC,
339+
FeatureStdExtZba,
340+
FeatureStdExtZbb],
341+
SiFiveP500TuneFeatures>;
342+
324343
def SIFIVE_P670 : RISCVProcessorModel<"sifive-p670", SiFiveP600Model,
325344
!listconcat(RVA22U64Features,
326345
[FeatureStdExtV,

0 commit comments

Comments
 (0)