33 Commits

Author SHA1 Message Date
Elvina Yakubova
69835d8f6d
[clang][AArch64] Parse more features in getHostCPUFeatures (#146323)
Add parsing of some crypto features to display them properly when
-mcpu=native is used
2025-07-09 11:43:08 +01:00
Elvina Yakubova
bd6e9047dd
[LLVM][AArch64] Relax SVE codegen predicates for sm4 instructions (#147524)
Adds sve-sm4 to reference FEAT_SVE_SM4 without specifically enabling
SVE2.
2025-07-08 17:04:21 +01:00
Ricardo Jesus
84e54515bc
[AArch64] Add support for -mcpu=gb10. (#146515)
This patch adds support for -mcpu=gb10 (NVIDIA GB10). This is a
big.LITTLE cluster of Cortex-X925 and Cortex-A725 cores. The appropriate
MIDR numbers are added to detect them in -mcpu=native.

We did not add an -mcpu=cortex-x925.cortex-a725 option because GB10 does
include the crypto instructions which we want on by default, and the
current convention is to not enable such extensions for Arm Cortex cores
in -mcpu where they are optional in the IP.

Relevant GCC patch:
https://gcc.gnu.org/pipermail/gcc-patches/2025-June/687005.html
2025-07-07 11:14:26 +01:00
Jim Lin
ce159d20e5 [RISCV] Put REQUIRES: riscv-registered-target in the first line of the file. NFC.
To be more consistent with other files.
2025-07-01 12:18:16 +08:00
Paul Walker
635acfbfca
[LLVM][AArch64] Relax SVE/SME codegen predicates for crypto and bitperm instructions. (#145696)
Adds sve-sha3 to reference FEAT_SVE_SHA3 without specifically enabling
SVE2. The SVE2 requirement for AES, SHA3 and Bitperm is replaced with
SVE for non-streaming function.
2025-06-26 13:01:07 +01:00
Jim Lin
2f9c97c030
[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.
2025-06-24 08:57:55 +08:00
Jim Lin
f78819aeef Revert "Revert "[RISCV] Remove B and Zbc extension from Andes series cpus." (#144402)"
Since the fix https://github.com/llvm/llvm-project/pull/144848 for post-commit CI failure
has landed.

This reverts commit f83d09a1f60aee28a8ed9020cd72971ec2885f24.
2025-06-22 17:54:37 +08:00
Aaron Ballman
f83d09a1f6
Revert "[RISCV] Remove B and Zbc extension from Andes series cpus." (#144402)
Reverts llvm/llvm-project#144022

This has been failing postcommit CI for two days:
https://lab.llvm.org/buildbot/#/builders/63
2025-06-16 14:53:15 -04:00
Jim Lin
24c8d900c4
[RISCV] Remove B and Zbc extension from Andes series cpus. (#144022)
The Andes CPU is configurable with optional extensions. The minimal
required extension set does not include `B` and `Zbc` extensions. So we
decided to remove them.
2025-06-15 11:38:04 +08:00
Min-Yih Hsu
feb21e26fa
[RISCV] Add SiFive X390 processor definition (#142517)
X390 is an in-order core designed for AI/ML workload, with VLEN=1024.
https://www.sifive.com/cores/intelligence-x300-series

Scheduling model will be added in a follow-up patch.
2025-06-04 09:25:59 -07:00
Jim Lin
04211ba727
[RISCV] Add FeatureVendorXAndesPerf to Andes N45/NX45/A45/AX45 (#141007)
Andes N45/NX45/A45/AX45 also support XAndesPerf.
2025-05-22 14:41:58 +08:00
Jim Lin
8b2c013564
[RISCV] Use print-enabled-extensions to check the extensions of Andes n45/nx45/a45/ax45 cpus. NFC. (#140979)
Similarly to what #137725 did for the SiFive P870.
2025-05-22 13:04:30 +08:00
Jim Lin
569b6f6dad
[RISCV] Add Andes A25/AX25 processor definition (#140681)
Andes A25/AX25 are 32/64bit, 5-stage pipeline, linux-capable CPUs that
implement the RV[32|64]IMAFDC_Zba_Zbb_Zbc_Zbs ISA extensions. They are
developed by Andes Technology https://www.andestech.com, a RISC-V IP
provider.

The overviews for A25/AX25:
https://www.andestech.com/en/products-solutions/andescore-processors/riscv-a25/
https://www.andestech.com/en/products-solutions/andescore-processors/riscv-ax25/

Scheduling model will be implemented in a later PR.
2025-05-22 09:22:32 +08:00
Ties Stuij
269f5fe91e
[AARCH64] Add support for Cortex-A320 (#139055)
This patch adds initial support for the recently announced Armv9
Cortex-A320 processor.

For more information, including the Technical Reference Manual, see:
https://developer.arm.com/Processors/Cortex-A320

---------

Co-authored-by: Oliver Stannard <oliver.stannard@arm.com>
2025-05-09 16:24:48 +01:00
Yuta Mukai
9d5a5424f0
[AArch64] Fix feature list for FUJITSU-MONAKA processor (#139212)
FEAT_FP8DOT4 and FEAT_FP8FMA are supported by FUJITSU-MONAKA. These were
previously enabled due to dependencies, but now require explicit
activation due to modifications in the dependencies.
2025-05-09 17:07:19 +09:00
Min-Yih Hsu
ca1ebff9de
[RISCV] Add processor definition for SiFive P870 (#137725)
SiFive P870 is a RVA23 compatible high-performance CPU:
https://www.sifive.com/cores/performance-p800

Scheduling model will be added in a follow-up PR.
2025-05-05 18:48:21 -07:00
jyli0116
064f9d03f2
[AArch64] Add FEAT_FPAC to supported CPUs (#137330)
Added FEAT_FPAC onto supported AArch64 CPUs which don't have it under
the processor description.
2025-04-28 14:49:06 +01:00
Sjoerd Meijer
c0cce43739
[AArch64] Add FEAT_FPAC to Neoverse V2 (#133054)
This feature is implemented in the Neoverse V2 core, but wasn't specified
in the CPU definition.
2025-03-26 15:21:21 +00:00
Ricardo Jesus
847e46ca01
[AArch64] Add initial support for -mcpu=olympus. (#132368)
This patch adds support for the NVIDIA Olympus core.

This does not add any special tuning decisions, and those may come
later.
2025-03-25 08:09:04 +00:00
Elvina Yakubova
404f94ac7d
[AArch64] Add optional extensions enabled on Grace (#127620)
Enable optional ISA extensions on Grace when mcpu=grace
is used: sve2-sm4, sve2-aes, sve2-sha3.
Grace is no longer an alias, but a separate CPU definition.
2025-02-19 11:27:38 +00:00
Jon Roelofs
75ce2dc475
[llvm][AArch64] apple-m4 does not have FEAT_{SPEv1p2,SEL2,MPAM} (#123827)
This commit addresses some uncertainty raised in 84fa1755a5b7845ddaeaa513a3786013c76c9c88 as to which features Apple M4 has.
2025-01-22 09:00:02 -08:00
Oliver Stannard
84fa1755a5
[AArch64] FEAT_SPEv1p2 is optional in v8.7-A and v9.2-A (#123336)
The FEAT_SPEv1p2 feature (known to LLVM as FeatureSPE_EEF and +spe-eef)
was incorrectly marked as a required feature of Armv8.7-A (and later),
which is incorrect because it is optional, and some CPUs do not
implement it. This moves it to the default features list, so that it is
still enabled by -march=armv8.7-a, but can be configured individually
for each processor.

For Cortex-A520 and Cortex-A520AE, I've checked that these do not have any of
the FEAT_SPE* features, so updated the tests accordingly. All other
Arm-designed v8.7A+ and v9.2A+ CPUs should continue to have it enabled. For
Ampere1B and Fujitsu Monaka, these CPUs do not have the feature, so I've
removed it from their tests. For Apple M4, I haven't found any reference for
whether that CPU should have this feature, so I've added it to the CPU
definition to avoid this being a functional change.
2025-01-21 10:12:36 +00:00
Lukacma
5e7d7fb1f0
[AArch64] Fix aarch64-fujitsu-monaka.c test (#122716) 2025-01-13 15:05:47 +00:00
Jonathan Thackray
952c8d3054
[AArch64] Enable FEAT_SVE2p1 by default for Armv9.4-A and later (#120753)
The ArmARM says:
```
    "In an Armv9.4 implementation, if FEAT_SVE2 is implemented,
     FEAT_SVE2p1 is implemented."
```
Since FEAT_SVE2 is already enabled for Armv9.0-A and later, then
FEAT_SVE2p1 should also be enabled by default.
2024-12-20 17:27:08 +00:00
Shao-Ce SUN
d280a9c5e2
[NFC] [RISCV] Refactor class RISCVExtension (#120040)
I think typo can be avoided by reducing the number of times we re-enter
the extension name.
2024-12-16 19:53:23 +08:00
Kinoshita Kotaro
a1197a2ca8
[AArch64] Add initial support for FUJITSU-MONAKA (#118432)
This patch adds initial support for FUJITSU-MONAKA CPU (-mcpu=fujitsu-monaka).

The scheduling model will be corrected in the future.
2024-12-09 09:56:02 +09:00
amilendra
31af00fda7
[AArch64][v8.7-A] Fix inconsistency in SPE_EEF feature (#115296)
The `SPE-EEF` system-register only feature introduced in Armv8.7-a adds
support for an extra system register (`PMSNEVFR_EL1`) to the Statistical
Profiling extension.

However, `SPE-EEF` is gated even for Armv8.7-a and the `spe-eef`
subtarget-feature is needed to enable it.

This behavior is inconsistent with the implementation for other
system-register only features as they can be used ungated under
supported architectures.
(e.g. HCX : Enable Armv8.7-A `HCRX_EL2` system register).
GCC/Binutils too do not add command line flags for features that only
enable system registers.

Fix by enabling `SPE-EEF` unconditionally under v8.7-A and above.
2024-11-08 10:56:46 +00:00
Tomas Matheson
362142c4bb
[AArch64] Add a check for invalid default features (#104435)
This adds a check that all ExtensionWithMArch which are marked as
implied features for an architecture are also present in the list of
default features. It doesn't make sense to have something mandatory but
not on by default.

There were a number of existing cases that violated this rule, and some
changes to which features are mandatory (indicated by the Implies
field).

This resulted in a bug where if a feature was marked as `Implies` but
was not added to `DefaultExt`, then for `-march=base_arch+nofeat` the
Driver would consider `feat` to have never been added and therefore
would do nothing to disable it (no `-target-feature -feat` would be
added, but the backend would enable the feature by default because of
`Implies`). See
clang/test/Driver/aarch64-negative-modifiers-for-default-features.c.

Note that the processor definitions do not respect the architecture
DefaultExts. These apply only when specifying `-march=<some architecture
version>`. So when a feature is moved from `Implies` to `DefaultExts` on
the Architecture definition, the feature needs to be added to all
processor definitions (that are based on that architecture) in order to
preserve the existing behaviour. I have checked the TRMs for many cases
(see specific commit messages) but in other cases I have just kept the
current behaviour and not tried to fix it.
2024-08-17 13:36:40 +01:00
Alex Bradbury
3f0d3fd3de [clang][test][RISCV] Add simple litmus test for --print-enabled-extensions
There's some coverage in RISCVISAInfoTest, but it's worth adding a quick
test to ensure nothing happens to the frontend handling of this option.
2024-08-14 14:09:17 +01:00
Ahmed Bougacha
265fbfa063
[AArch64] Add FPAC to apple- processors that have it. (#102072)
We added FPAC recently in d7e8a7487cd7 to allow ptrauth codegen to rely
on the cpu auth failure checks rather than emitting its own auth failure
check/brk sequence.

Add it to the Apple processors that do have it: A15, A16, A17, M4.

While there, tweak the description to refer to Armv8.3-A rather than
v8.3-A, matching the other features.
2024-08-05 20:28:45 -07:00
Jonathan Thackray
b94c2488f0
[AArch64] Make user-visible Arm architecture version strings consistent (#98550)
Textual strings for architecture feature flags have not been
consistently written, so there are a wide variety of styles,
capitalisation, etc. and some are missing information. I have
tidied this up mechanically for AArch64, so that the output of
`--print-supported-extensions` looks much more consistent,
since it's user-visible.
2024-07-12 15:53:02 +01:00
Jon Roelofs
c66e1d6f34
[llvm][AArch64] apple-m4 is armv9.2-a (#98267)
But since SVE and friends have been added to the default extensions
list, and every CPU was opted into those extensions by default, we
couldn't correctly announce its architecutral version to the backend.
Additionally, we FEAT_MEC from llvm's "required" list for v9.0 to the
optional list for v9.2, as the spec considers it optional, and M4 does
not implement it. Similarly, fixes up several bugs w.r.t. FEAT_RME.

As a drive-by, I noticed that saphira did not have an
AArch64CPUTestParams entry, and thus added one.
2024-07-11 07:46:51 -07:00
Tomas Matheson
b9254ade77
[AArch64][RISCV] Improve the tests for --print-enabled-extensions and --print-supported-extensions (#97829)
For AArch64, we have existing tests for `--print-enabled-extensions` for
each architecture. However:
- These are added to the end of the existing tests which check for
`"-target-feature"`, which complicates them slightly.
- They do not test the descriptions printed next to each feature.
- Part of the output was tested separately in `TargetParserTest`.
- We did not have _any_ tests of this output for CPUs (only for
architectures).

Similarly, the tests for `--print-supported-extensions` do not give
complete coverage of either the full list of features or the
descriptions.

In my opinion we should be testing the full output, as this is what the
user sees. Descriptions and formatting can contain errors and be
accidentally broken.
2024-07-08 13:47:01 +01:00