]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: Add support for fmv priority syntax.
authorAlfie Richards <alfie.richards@arm.com>
Tue, 7 Oct 2025 14:16:16 +0000 (14:16 +0000)
committerAlfie Richards <alfie.richards@arm.com>
Wed, 7 Jan 2026 11:51:07 +0000 (11:51 +0000)
commit558918d6b2ac3d726d74543e1a2ccc200bf0fa35
treeec1ee39fcb1f87f12f99dc10c68efe66853c3081
parent3ecc4d571f76d22cb08333c1cfe147674fd8c2cc
aarch64: Add support for fmv priority syntax.

Adds support for the AArch64 fmv priority syntax.

This allows users to override the default function ordering.

For example:

```c
int bar [[gnu::target_version("default")]] (int){
  return 1;
}

int bar [[gnu::target_version("dotprod;priority=2")]] (int) {
  return 2;
}

int bar [[gnu::target_version("sve;priority=1")]] (int) {
  return 3;
}
```

gcc/ChangeLog:

* config/aarch64/aarch64.cc (aarch64_parse_fmv_features): Add parsing
for priority arguments.
(aarch64_process_target_version_attr): Update call to
aarch64_parse_fmv_features.
(get_feature_mask_for_version): Update call to
aarch64_parse_fmv_features.
(aarch64_compare_version_priority): Add logic to order by priority if present.
(aarch64_functions_b_resolvable_from_a): Update call to
aarch64_parse_fmv_features.
(aarch64_mangle_decl_assembler_name): Update call to
aarch64_parse_fmv_features.
(dispatch_function_versions): Add logic to sort by priority.
(aarch64_same_function_versions): Add diagnostic if invalid use of
priority syntax.
(aarch64_merge_decl_attributes): Add logic to make suer priority
arguments are preserved.
(aarch64_check_target_clone_version): Update call to
aarch64_parse_fmv_features.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/fmv_priority3.c: New test.
* gcc.target/aarch64/fmv_priority_error1.c: New test.
* gcc.target/aarch64/fmv_priority_error2.c: New test.
gcc/config/aarch64/aarch64.cc
gcc/testsuite/gcc.target/aarch64/fmv_priority3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/fmv_priority_error1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/fmv_priority_error2.c [new file with mode: 0644]