]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: Add cpu feature detection to libgcc
authorAndrew Carlotti <andrew.carlotti@arm.com>
Wed, 20 Sep 2023 11:22:09 +0000 (12:22 +0100)
committerAndrew Carlotti <andrew.carlotti@arm.com>
Sat, 16 Dec 2023 00:38:41 +0000 (00:38 +0000)
commit2c200a12c12f84a4d373aafaae8ff01fb0381b46
tree08c658316a9548912fc060684b31034c7395ea66
parent06f64b95bafc06c318efc7b6d7c03cd34fe4be78
aarch64: Add cpu feature detection to libgcc

This is added to enable function multiversioning, but can also be used
directly.  The interface is chosen to match that used in LLVM's
compiler-rt, to facilitate cross-compiler compatibility.

The content of the patch is derived almost entirely from Pavel's prior
contributions to compiler-rt/lib/builtins/cpu_model.c. I have made minor
changes to align more closely with GCC coding style, and to exclude any code
from other LLVM contributors, and am adding this to GCC with Pavel's approval.

libgcc/ChangeLog:

* config/aarch64/t-aarch64: Include cpuinfo.c
* config/aarch64/cpuinfo.c: New file
(__init_cpu_features_constructor) New.
(__init_cpu_features_resolver) New.
(__init_cpu_features) New.

Co-authored-by: Pavel Iliin <Pavel.Iliin@arm.com>
libgcc/config/aarch64/cpuinfo.c [new file with mode: 0644]
libgcc/config/aarch64/t-aarch64