Skip to content

Commit 8f8f449

Browse files
authored
[RISCV] Recognize veyron-v1 processor in clang driver. (#66703)
Subsequent PRs will add the scheduling model and support for macro fusions.
1 parent e25cd08 commit 8f8f449

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

clang/test/Driver/riscv-cpus.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,31 @@
3737
// RUN: %clang --target=riscv32 -### -c %s 2>&1 -mtune=syntacore-scr1-max | FileCheck -check-prefix=MTUNE-SYNTACORE-SCR1-MAX %s
3838
// MTUNE-SYNTACORE-SCR1-MAX: "-tune-cpu" "syntacore-scr1-max"
3939

40+
// RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=veyron-v1 | FileCheck -check-prefix=MCPU-VEYRON-V1 %s
41+
// MCPU-VEYRON-V1: "-target-cpu" "veyron-v1"
42+
// MCPU-VEYRON-V1: "-target-feature" "+m"
43+
// MCPU-VEYRON-V1: "-target-feature" "+a"
44+
// MCPU-VEYRON-V1: "-target-feature" "+f"
45+
// MCPU-VEYRON-V1: "-target-feature" "+d"
46+
// MCPU-VEYRON-V1: "-target-feature" "+c"
47+
// MCPU-VEYRON-V1: "-target-feature" "+zicbom"
48+
// MCPU-VEYRON-V1: "-target-feature" "+zicbop"
49+
// MCPU-VEYRON-V1: "-target-feature" "+zicboz"
50+
// MCPU-VEYRON-V1: "-target-feature" "+zicntr"
51+
// MCPU-VEYRON-V1: "-target-feature" "+zicsr"
52+
// MCPU-VEYRON-V1: "-target-feature" "+zifencei"
53+
// MCPU-VEYRON-V1: "-target-feature" "+zihintpause"
54+
// MCPU-VEYRON-V1: "-target-feature" "+zihpm"
55+
// MCPU-VEYRON-V1: "-target-feature" "+zba"
56+
// MCPU-VEYRON-V1: "-target-feature" "+zbb"
57+
// MCPU-VEYRON-V1: "-target-feature" "+zbc"
58+
// MCPU-VEYRON-V1: "-target-feature" "+zbs"
59+
// MCPU-VEYRON-V1: "-target-feature" "+xventanacondops"
60+
// MCPU-VEYRON-V1: "-target-abi" "lp64d"
61+
62+
// RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=veyron-v1 | FileCheck -check-prefix=MTUNE-VEYRON-V1 %s
63+
// MTUNE-VEYRON-V1: "-tune-cpu" "veyron-v1"
64+
4065
// Check mtune alias CPU has resolved to the right CPU according XLEN.
4166
// RUN: %clang --target=riscv32 -### -c %s 2>&1 -mtune=generic | FileCheck -check-prefix=MTUNE-GENERIC-32 %s
4267
// MTUNE-GENERIC-32: "-tune-cpu" "generic"

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{{$}}
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{{$}}
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, generic, rocket, sifive-7-series{{$}}
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, generic, rocket, sifive-7-series{{$}}

llvm/lib/Target/RISCV/RISCVProcessors.td

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,25 @@ def SYNTACORE_SCR1_MAX : RISCVProcessorModel<"syntacore-scr1-max",
201201
FeatureStdExtM,
202202
FeatureStdExtC],
203203
[TuneNoDefaultUnroll]>;
204+
205+
def VENTANA_VEYRON_V1 : RISCVProcessorModel<"veyron-v1",
206+
NoSchedModel,
207+
[Feature64Bit,
208+
FeatureStdExtZifencei,
209+
FeatureStdExtZicsr,
210+
FeatureStdExtZicntr,
211+
FeatureStdExtZihpm,
212+
FeatureStdExtZihintpause,
213+
FeatureStdExtM,
214+
FeatureStdExtA,
215+
FeatureStdExtF,
216+
FeatureStdExtD,
217+
FeatureStdExtC,
218+
FeatureStdExtZba,
219+
FeatureStdExtZbb,
220+
FeatureStdExtZbc,
221+
FeatureStdExtZbs,
222+
FeatureStdExtZicbom,
223+
FeatureStdExtZicbop,
224+
FeatureStdExtZicboz,
225+
FeatureVendorXVentanaCondOps]>;

0 commit comments

Comments
 (0)