configure: Check for the AArch64 CRC extension

Name the feature "arm_crc" rather than plain "crc", to make it
clear that this is about a CPU feature extension, not CRC
implementations in general.

This requires dealing with the extension slightly differently
than other extensions, as the name of the feature and the
".arch_extension" extension name differ.

Naming it with an "arm" prefix rather than "aarch64", as the
CPU extension also is available in 32 bit ARM form, even though
we don't intend to use it there.
This commit is contained in:
Martin Storsjö
2025-10-07 15:33:37 +03:00
committed by Andreas Rheinhardt
parent 34784c89bf
commit 3dcbcce80c
2 changed files with 15 additions and 1 deletions

7
configure vendored
View File

@@ -476,6 +476,7 @@ Optimization options (experts only):
--disable-armv6t2 disable armv6t2 optimizations
--disable-vfp disable VFP optimizations
--disable-neon disable NEON optimizations
--disable-arm-crc disable ARM/AArch64 CRC optimizations
--disable-dotprod disable DOTPROD optimizations
--disable-i8mm disable I8MM optimizations
--disable-sve disable SVE optimizations
@@ -2231,6 +2232,7 @@ ARCH_EXT_LIST_ARM="
armv6
armv6t2
armv8
arm_crc
dotprod
i8mm
neon
@@ -2504,6 +2506,7 @@ SYSTEM_LIBRARIES="
TOOLCHAIN_FEATURES="
as_arch_directive
as_archext_crc_directive
as_archext_dotprod_directive
as_archext_i8mm_directive
as_archext_sve_directive
@@ -2838,6 +2841,7 @@ intrinsics_sse2_deps="sse2"
vfp_deps="arm"
vfpv3_deps="vfp"
setend_deps="arm"
arm_crc_deps="aarch64"
dotprod_deps="aarch64 neon"
i8mm_deps="aarch64 neon"
sve_deps="aarch64 neon"
@@ -6470,7 +6474,8 @@ if enabled aarch64; then
# internal assembler in clang 3.3 does not support this instruction
enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
archext_list="dotprod i8mm sve sve2 sme"
archext_list="arm_crc dotprod i8mm sve sve2 sme"
enabled arm_crc && check_archext_name_insn arm_crc crc 'crc32x w0, w0, x0'
enabled dotprod && check_archext_insn dotprod 'udot v0.4s, v0.16b, v0.16b'
enabled i8mm && check_archext_insn i8mm 'usdot v0.4s, v0.16b, v0.16b'
enabled sve && check_archext_insn sve 'whilelt p0.s, x0, x1'

View File

@@ -40,6 +40,14 @@
.arch AS_ARCH_LEVEL
#endif
#if HAVE_AS_ARCHEXT_CRC_DIRECTIVE
#define ENABLE_ARM_CRC .arch_extension crc
#define DISABLE_ARM_CRC .arch_extension nocrc
#else
#define ENABLE_ARM_CRC
#define DISABLE_ARM_CRC
#endif
#if HAVE_AS_ARCHEXT_DOTPROD_DIRECTIVE
#define ENABLE_DOTPROD .arch_extension dotprod
#define DISABLE_DOTPROD .arch_extension nodotprod
@@ -80,6 +88,7 @@
#define DISABLE_SME
#endif
DISABLE_ARM_CRC
DISABLE_DOTPROD
DISABLE_I8MM
DISABLE_SVE