Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions clang/test/Driver/riscv-cpus.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,60 @@
// RUN: %clang --target=riscv32 -### -c %s 2>&1 -mtune=syntacore-scr1-max | FileCheck -check-prefix=MTUNE-SYNTACORE-SCR1-MAX %s
// MTUNE-SYNTACORE-SCR1-MAX: "-tune-cpu" "syntacore-scr1-max"

// RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=tt-ascalon-d8 | FileCheck -check-prefix=MTUNE-TT-ASCALON-D8 %s
// MTUNE-TT-ASCALON-D8: "-tune-cpu" "tt-ascalon-d8"

// RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=tt-ascalon-d8 | FileCheck -check-prefix=MCPU-TT-ASCALON-D8 %s
// MCPU-TT-ASCALON-D8: "-target-cpu" "tt-ascalon-d8"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+m" "-target-feature" "+a"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+f" "-target-feature" "+d"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+c" "-target-feature" "+v"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+h" "-target-feature" "+zicbom"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zicbop"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zicboz"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zicntr"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zicond"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zicsr"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zifencei"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zihintntl"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zihintpause"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zihpm"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zmmul"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zawrs"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zfa"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zfbfmin"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zfh"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zfhmin"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zca" "-target-feature" "+zcb"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zba" "-target-feature" "+zbb"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zbs" "-target-feature" "+zkt"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvbb"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvbc"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zve32f"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zve32x"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zve64d"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zve64f"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zve64x"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvfbfmin"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvfbfwma"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvfh"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvfhmin"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvkb"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvkg"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvkn"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvknc"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvkned"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvkng"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvknhb"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvkt"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvl128b"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvl256b"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvl32b"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+zvl64b"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+svinval"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+svnapot"
// MCPU-TT-ASCALON-D8-SAME: "-target-feature" "+svpbmt"

// RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=veyron-v1 | FileCheck -check-prefix=MCPU-VEYRON-V1 %s
// MCPU-VEYRON-V1: "-target-cpu" "veyron-v1"
// MCPU-VEYRON-V1: "-target-feature" "+m"
Expand Down
2 changes: 2 additions & 0 deletions clang/test/Misc/target-invalid-cpu-note/riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
// RISCV64-SAME: {{^}}, syntacore-scr4-rv64
// RISCV64-SAME: {{^}}, syntacore-scr5-rv64
// RISCV64-SAME: {{^}}, syntacore-scr7
// RISCV64-SAME: {{^}}, tt-ascalon-d8
// RISCV64-SAME: {{^}}, veyron-v1
// RISCV64-SAME: {{^}}, xiangshan-nanhu
// RISCV64-SAME: {{$}}
Expand Down Expand Up @@ -87,6 +88,7 @@
// TUNE-RISCV64-SAME: {{^}}, syntacore-scr4-rv64
// TUNE-RISCV64-SAME: {{^}}, syntacore-scr5-rv64
// TUNE-RISCV64-SAME: {{^}}, syntacore-scr7
// TUNE-RISCV64-SAME: {{^}}, tt-ascalon-d8
// TUNE-RISCV64-SAME: {{^}}, veyron-v1
// TUNE-RISCV64-SAME: {{^}}, xiangshan-nanhu
// TUNE-RISCV64-SAME: {{^}}, generic
Expand Down
1 change: 1 addition & 0 deletions llvm/docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ Changes to the RISC-V Backend
* The `Zvbc32e` and `Zvkgs` extensions are now supported experimentally.
* Added `Smctr`, `Ssctr` and `Svvptc` extensions.
* `-mcpu=syntacore-scr7` was added.
* `-mcpu=tt-ascalon-d8` was added.
* The `Zacas` extension is no longer marked as experimental.
* The `Smmpm`, `Smnpm`, `Ssnpm`, `Supm`, and `Sspm` pointer masking extensions
are no longer marked as experimental.
Expand Down
48 changes: 48 additions & 0 deletions llvm/lib/Target/RISCV/RISCVProcessors.td
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,54 @@ def SYNTACORE_SCR7 : RISCVProcessorModel<"syntacore-scr7",
FeatureStdExtZkn],
[TuneNoDefaultUnroll, FeaturePostRAScheduler]>;

def TENSTORRENT_ASCALON_D8 : RISCVProcessorModel<"tt-ascalon-d8",
NoSchedModel,
[Feature64Bit,
FeatureStdExtI,
FeatureStdExtZifencei,
FeatureStdExtZicsr,
FeatureStdExtZicntr,
FeatureStdExtZihpm,
FeatureStdExtZihintpause,
FeatureStdExtM,
FeatureStdExtA,
FeatureStdExtF,
FeatureStdExtD,
FeatureStdExtC,
FeatureStdExtV,
FeatureStdExtZvl256b,
FeatureStdExtZfh,
FeatureStdExtZvfh,
FeatureStdExtZba,
FeatureStdExtZbb,
FeatureStdExtZbs,
FeatureStdExtZicbom,
FeatureStdExtZicbop,
FeatureStdExtZicboz,
FeatureStdExtH,
FeatureStdExtZihintntl,
FeatureStdExtZfhmin,
FeatureStdExtZfa,
FeatureStdExtZkt,
FeatureStdExtZcb,
FeatureStdExtZvbb,
FeatureStdExtZvbc,
FeatureStdExtZawrs,
FeatureStdExtZvkng,
FeatureStdExtZicond,
FeatureUnalignedScalarMem,
FeatureUnalignedVectorMem,
FeatureStdExtSvnapot,
FeatureStdExtSvpbmt,
FeatureStdExtSvinval,
FeatureStdExtZfbfmin,
FeatureStdExtZvfbfmin,
FeatureStdExtZvfbfwma],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I just did a quick google and it says here that it's rva23 compliant: https://tenstorrent.com/assets/one-pagers/08.21.24_Ascalon.pdf

Should we use RVA23U64Features here? I'm noticing that Zimop is missing in this list though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, and we do support Zimop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zimop addressed, need to double check the rest, there might be more missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed what is available, we might need to add a couple features eventually, but I'll do that in separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed.

[TuneNoDefaultUnroll,
TuneOptimizedZeroStrideLoad,
TuneNoSinkSplatOperands,
FeaturePostRAScheduler]>;

def VENTANA_VEYRON_V1 : RISCVProcessorModel<"veyron-v1",
NoSchedModel,
[Feature64Bit,
Expand Down
Loading