configure: Add detection of assembler support for SVE/SVE2

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö 2023-10-12 23:18:28 +03:00
parent 067abbfe9d
commit e6e56fd7a7
3 changed files with 33 additions and 1 deletions

14
configure vendored
View File

@ -467,6 +467,8 @@ Optimization options (experts only):
--disable-neon disable NEON optimizations --disable-neon disable NEON optimizations
--disable-dotprod disable DOTPROD optimizations --disable-dotprod disable DOTPROD optimizations
--disable-i8mm disable I8MM optimizations --disable-i8mm disable I8MM optimizations
--disable-sve disable SVE optimizations
--disable-sve2 disable SVE2 optimizations
--disable-inline-asm disable use of inline assembly --disable-inline-asm disable use of inline assembly
--disable-x86asm disable use of standalone x86 assembly --disable-x86asm disable use of standalone x86 assembly
--disable-mipsdsp disable MIPS DSP ASE R1 optimizations --disable-mipsdsp disable MIPS DSP ASE R1 optimizations
@ -2163,6 +2165,8 @@ ARCH_EXT_LIST_ARM="
vfp vfp
vfpv3 vfpv3
setend setend
sve
sve2
" "
ARCH_EXT_LIST_MIPS=" ARCH_EXT_LIST_MIPS="
@ -2432,6 +2436,8 @@ TOOLCHAIN_FEATURES="
as_arch_directive as_arch_directive
as_archext_dotprod_directive as_archext_dotprod_directive
as_archext_i8mm_directive as_archext_i8mm_directive
as_archext_sve_directive
as_archext_sve2_directive
as_dn_directive as_dn_directive
as_fpu_directive as_fpu_directive
as_func as_func
@ -2752,6 +2758,8 @@ vfpv3_deps="vfp"
setend_deps="arm" setend_deps="arm"
dotprod_deps="aarch64 neon" dotprod_deps="aarch64 neon"
i8mm_deps="aarch64 neon" i8mm_deps="aarch64 neon"
sve_deps="aarch64 neon"
sve2_deps="aarch64 neon sve"
map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
@ -6234,9 +6242,11 @@ if enabled aarch64; then
# internal assembler in clang 3.3 does not support this instruction # internal assembler in clang 3.3 does not support this instruction
enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1' enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
archext_list="dotprod i8mm" archext_list="dotprod i8mm sve sve2"
enabled dotprod && check_archext_insn dotprod 'udot v0.4s, v0.16b, v0.16b' 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 i8mm && check_archext_insn i8mm 'usdot v0.4s, v0.16b, v0.16b'
enabled sve && check_archext_insn sve 'whilelt p0.s, x0, x1'
enabled sve2 && check_archext_insn sve2 'sqrdmulh z0.s, z0.s, z0.s'
# Disable the main feature (e.g. HAVE_NEON) if neither inline nor external # Disable the main feature (e.g. HAVE_NEON) if neither inline nor external
# assembly support the feature out of the box. Skip this for the features # assembly support the feature out of the box. Skip this for the features
@ -7919,6 +7929,8 @@ if enabled aarch64; then
echo "NEON enabled ${neon-no}" echo "NEON enabled ${neon-no}"
echo "DOTPROD enabled ${dotprod-no}" echo "DOTPROD enabled ${dotprod-no}"
echo "I8MM enabled ${i8mm-no}" echo "I8MM enabled ${i8mm-no}"
echo "SVE enabled ${sve-no}"
echo "SVE2 enabled ${sve2-no}"
fi fi
if enabled arm; then if enabled arm; then
echo "ARMv5TE enabled ${armv5te-no}" echo "ARMv5TE enabled ${armv5te-no}"

View File

@ -3,6 +3,8 @@ OBJS-$(HAVE_ARMV6) += $(ARMV6-OBJS) $(ARMV6-OBJS-yes)
OBJS-$(HAVE_ARMV8) += $(ARMV8-OBJS) $(ARMV8-OBJS-yes) OBJS-$(HAVE_ARMV8) += $(ARMV8-OBJS) $(ARMV8-OBJS-yes)
OBJS-$(HAVE_VFP) += $(VFP-OBJS) $(VFP-OBJS-yes) OBJS-$(HAVE_VFP) += $(VFP-OBJS) $(VFP-OBJS-yes)
OBJS-$(HAVE_NEON) += $(NEON-OBJS) $(NEON-OBJS-yes) OBJS-$(HAVE_NEON) += $(NEON-OBJS) $(NEON-OBJS-yes)
OBJS-$(HAVE_SVE) += $(SVE-OBJS) $(SVE-OBJS-yes)
OBJS-$(HAVE_SVE2) += $(SVE2-OBJS) $(SVE2-OBJS-yes)
OBJS-$(HAVE_MIPSFPU) += $(MIPSFPU-OBJS) $(MIPSFPU-OBJS-yes) OBJS-$(HAVE_MIPSFPU) += $(MIPSFPU-OBJS) $(MIPSFPU-OBJS-yes)
OBJS-$(HAVE_MIPSDSP) += $(MIPSDSP-OBJS) $(MIPSDSP-OBJS-yes) OBJS-$(HAVE_MIPSDSP) += $(MIPSDSP-OBJS) $(MIPSDSP-OBJS-yes)

View File

@ -56,8 +56,26 @@
#define DISABLE_I8MM #define DISABLE_I8MM
#endif #endif
#if HAVE_AS_ARCHEXT_SVE_DIRECTIVE
#define ENABLE_SVE .arch_extension sve
#define DISABLE_SVE .arch_extension nosve
#else
#define ENABLE_SVE
#define DISABLE_SVE
#endif
#if HAVE_AS_ARCHEXT_SVE2_DIRECTIVE
#define ENABLE_SVE2 .arch_extension sve2
#define DISABLE_SVE2 .arch_extension nosve2
#else
#define ENABLE_SVE2
#define DISABLE_SVE2
#endif
DISABLE_DOTPROD DISABLE_DOTPROD
DISABLE_I8MM DISABLE_I8MM
DISABLE_SVE
DISABLE_SVE2
/* Support macros for /* Support macros for