Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sve: Add ARM SVE compile support #765

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions gen/archs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,20 @@ at the top, as a last resort.
<check name="neon"></check>
</arch>

<arch name="sve">
<flag compiler="gnu">-march=armv8-a+sve</flag>
<flag compiler="clang">-march=armv8-a+sve</flag>
<alignment>16</alignment>
<check name="sve"></check>
</arch>

<arch name="sve2">
<flag compiler="gnu">-march=armv8-a+sve2</flag>
<flag compiler="clang">-march=armv8-a+sve2</flag>
<alignment>16</alignment>
<check name="sve2"></check>
</arch>

<arch name="sse3">
<check name="sse3"></check>
<flag compiler="gnu">-msse3</flag>
Expand Down
8 changes: 8 additions & 0 deletions gen/machines.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
<archs>generic neon neonv8 orc|</archs>
</machine>

<machine name="sve">
<archs>generic neon neonv8 sve orc|</archs>
</machine>

<machine name="sve2">
<archs>generic neon neonv8 sve sve2 orc|</archs>
</machine>

<!-- trailing | bar means generate without either for MSVC -->
<machine name="sse2">
<archs>generic 32|64| mmx| sse sse2 orc|</archs>
Expand Down
4 changes: 4 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ if(NOT CPU_IS_x86)
overrule_arch(sse4_1 "Architecture is not x86 or x86_64")
overrule_arch(sse4_2 "Architecture is not x86 or x86_64")
overrule_arch(avx "Architecture is not x86 or x86_64")
overrule_arch(avx2 "Architecture is not x86 or x86_64")
overrule_arch(fma "Architecture is not x86 or x86_64")
overrule_arch(avx512f "Architecture is not x86 or x86_64")
overrule_arch(avx512cd "Architecture is not x86 or x86_64")
endif(NOT CPU_IS_x86)
Expand Down Expand Up @@ -239,6 +241,8 @@ else(neon_compile_result)
overrule_arch(neon "Compiler doesn't support NEON")
overrule_arch(neonv7 "Compiler doesn't support NEON")
overrule_arch(neonv8 "Compiler doesn't support NEON")
overrule_arch(sve "Compiler doesn't support SVE")
overrule_arch(sve2 "Compiler doesn't support SVE2")
endif(neon_compile_result)

########################################################################
Expand Down
4 changes: 4 additions & 0 deletions tmpl/volk_cpu.tmpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ static int i_can_has_${arch.name} (void) {
%if "neon" in arch.name:
#if defined(CPU_FEATURES_ARCH_ARM)
if (GetArmInfo().features.${check} == 0){ return 0; }
#endif
%elif "neon" in arch.name or "sve" in arch.name:
#if defined(CPU_FEATURES_ARCH_AARCH64)
if (GetAarch64Info().features.${check} == 0){ return 0; }
#endif
%elif "mips" in arch.name:
#if defined(CPU_FEATURES_ARCH_MIPS)
Expand Down
Loading