Skip to content

Commit 2f9c97c

Browse files
authored
[RISCV] Add Andes AX45MPV processor definition (#145267)
Andes AX45MPV is 64-bit in-order dual-issue 8-stage pipeline linux-capable CPU implementing the RV64IMAFDCV ISA extension. That is developed by Andes Technology https://www.andestech.com, a RISC-V IP provider. The overviews for AX45MPV: https://www.andestech.com/en/products-solutions/andescore-processors/riscv-ax45mpv/ Scheduling model for RVV extension will be implemented a follow-up PR.
1 parent 9d570d5 commit 2f9c97c

File tree

5 files changed

+59
-0
lines changed

5 files changed

+59
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// RUN: %clang --target=riscv64 -mcpu=andes-ax45mpv --print-enabled-extensions | FileCheck %s
2+
// REQUIRES: riscv-registered-target
3+
4+
// CHECK: Extensions enabled for the given RISC-V target
5+
// CHECK-EMPTY:
6+
// CHECK-NEXT: Name Version Description
7+
// CHECK-NEXT: i 2.1 'I' (Base Integer Instruction Set)
8+
// CHECK-NEXT: m 2.0 'M' (Integer Multiplication and Division)
9+
// CHECK-NEXT: a 2.1 'A' (Atomic Instructions)
10+
// CHECK-NEXT: f 2.2 'F' (Single-Precision Floating-Point)
11+
// CHECK-NEXT: d 2.2 'D' (Double-Precision Floating-Point)
12+
// CHECK-NEXT: c 2.0 'C' (Compressed Instructions)
13+
// CHECK-NEXT: v 1.0 'V' (Vector Extension for Application Processors)
14+
// CHECK-NEXT: zicsr 2.0 'Zicsr' (CSRs)
15+
// CHECK-NEXT: zifencei 2.0 'Zifencei' (fence.i)
16+
// CHECK-NEXT: zmmul 1.0 'Zmmul' (Integer Multiplication)
17+
// CHECK-NEXT: zaamo 1.0 'Zaamo' (Atomic Memory Operations)
18+
// CHECK-NEXT: zalrsc 1.0 'Zalrsc' (Load-Reserved/Store-Conditional)
19+
// CHECK-NEXT: zca 1.0 'Zca' (part of the C extension, excluding compressed floating point loads/stores)
20+
// CHECK-NEXT: zcd 1.0 'Zcd' (Compressed Double-Precision Floating-Point Instructions)
21+
// CHECK-NEXT: zve32f 1.0 'Zve32f' (Vector Extensions for Embedded Processors with maximal 32 EEW and F extension)
22+
// CHECK-NEXT: zve32x 1.0 'Zve32x' (Vector Extensions for Embedded Processors with maximal 32 EEW)
23+
// CHECK-NEXT: zve64d 1.0 'Zve64d' (Vector Extensions for Embedded Processors with maximal 64 EEW, F and D extension)
24+
// CHECK-NEXT: zve64f 1.0 'Zve64f' (Vector Extensions for Embedded Processors with maximal 64 EEW and F extension)
25+
// CHECK-NEXT: zve64x 1.0 'Zve64x' (Vector Extensions for Embedded Processors with maximal 64 EEW)
26+
// CHECK-NEXT: zvl128b 1.0 'Zvl128b' (Minimum Vector Length 128)
27+
// CHECK-NEXT: zvl32b 1.0 'Zvl32b' (Minimum Vector Length 32)
28+
// CHECK-NEXT: zvl64b 1.0 'Zvl64b' (Minimum Vector Length 64)
29+
// CHECK-NEXT: xandesperf 5.0 'XAndesPerf' (Andes Performance Extension)
30+
// CHECK-EMPTY:
31+
// CHECK-NEXT: Experimental extensions
32+
// CHECK-EMPTY:
33+
// CHECK-NEXT: ISA String: rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_v1p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0_zcd1p0_zve32f1p0_zve32x1p0_zve64d1p0_zve64f1p0_zve64x1p0_zvl128b1p0_zvl32b1p0_zvl64b1p0_xandesperf5p0

clang/test/Driver/riscv-cpus.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,3 +751,11 @@
751751

752752
// RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=andes-ax45 | FileCheck -check-prefix=MTUNE-ANDES-AX45 %s
753753
// MTUNE-ANDES-AX45: "-tune-cpu" "andes-ax45"
754+
755+
// RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=andes-ax45mpv | FileCheck -check-prefix=MCPU-ANDES-AX45MPV %s
756+
// COM: The list of extensions are tested in `test/Driver/print-enabled-extensions/riscv-andes-ax45mpv.c`
757+
// MCPU-ANDES-AX45MPV: "-target-cpu" "andes-ax45mpv"
758+
// MCPU-ANDES-AX45MPV-SAME: "-target-abi" "lp64d"
759+
760+
// RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=andes-ax45mpv | FileCheck -check-prefix=MTUNE-ANDES-AX45MPV %s
761+
// MTUNE-ANDES-AX45MPV: "-tune-cpu" "andes-ax45mpv"

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-NEXT: note: valid target CPU values are:
3030
// RISCV64-SAME: {{^}} andes-ax25
3131
// RISCV64-SAME: {{^}}, andes-ax45
32+
// RISCV64-SAME: {{^}}, andes-ax45mpv
3233
// RISCV64-SAME: {{^}}, andes-nx45
3334
// RISCV64-SAME: {{^}}, generic-rv64
3435
// RISCV64-SAME: {{^}}, mips-p8700
@@ -89,6 +90,7 @@
8990
// TUNE-RISCV64-NEXT: note: valid target CPU values are:
9091
// TUNE-RISCV64-SAME: {{^}} andes-ax25
9192
// TUNE-RISCV64-SAME: {{^}}, andes-ax45
93+
// TUNE-RISCV64-SAME: {{^}}, andes-ax45mpv
9294
// TUNE-RISCV64-SAME: {{^}}, andes-nx45
9395
// TUNE-RISCV64-SAME: {{^}}, generic-rv64
9496
// TUNE-RISCV64-SAME: {{^}}, mips-p8700

llvm/docs/ReleaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ Changes to the RISC-V Backend
211211
* `-mcpu=sifive-x390` was added.
212212
* `-mtune=andes-45-series` was added.
213213
* Adds assembler support for the Andes `XAndesvbfhcvt` (Andes Vector BFLOAT16 Conversion extension).
214+
* `-mcpu=andes-ax45mpv` was added.
214215

215216
Changes to the WebAssembly Backend
216217
----------------------------------

llvm/lib/Target/RISCV/RISCVProcessors.td

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,3 +782,18 @@ def ANDES_AX45 : RISCVProcessorModel<"andes-ax45",
782782
FeatureStdExtC,
783783
FeatureVendorXAndesPerf],
784784
Andes45TuneFeatures>;
785+
786+
def ANDES_AX45MPV : RISCVProcessorModel<"andes-ax45mpv",
787+
Andes45Model,
788+
[Feature64Bit,
789+
FeatureStdExtI,
790+
FeatureStdExtZicsr,
791+
FeatureStdExtZifencei,
792+
FeatureStdExtM,
793+
FeatureStdExtA,
794+
FeatureStdExtF,
795+
FeatureStdExtD,
796+
FeatureStdExtC,
797+
FeatureStdExtV,
798+
FeatureVendorXAndesPerf],
799+
Andes45TuneFeatures>;

0 commit comments

Comments
 (0)