Skip to content
Merged
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
2 changes: 1 addition & 1 deletion libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if(LIBC_TARGET_ARCHITECTURE_IS_X86_64)
set(ALL_CPU_FEATURES SSE2 SSE4_2 AVX AVX2 AVX512F AVX512BW FMA)
set(LIBC_COMPILE_OPTIONS_NATIVE -march=native)
elseif(LIBC_TARGET_ARCHITECTURE_IS_AARCH64)
set(ALL_CPU_FEATURES "FullFP16")
set(ALL_CPU_FEATURES FullFP16 MOPS SVE SVE2)
set(LIBC_COMPILE_OPTIONS_NATIVE -mcpu=native)
endif()

Expand Down
5 changes: 5 additions & 0 deletions libc/cmake/modules/cpu_features/check_MOPS.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "src/__support/macros/properties/cpu_features.h"

#ifndef LIBC_TARGET_CPU_HAS_MOPS
#error unsupported
#endif
5 changes: 5 additions & 0 deletions libc/cmake/modules/cpu_features/check_SVE.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "src/__support/macros/properties/cpu_features.h"

#ifndef LIBC_TARGET_CPU_HAS_SVE
#error unsupported
#endif
5 changes: 5 additions & 0 deletions libc/cmake/modules/cpu_features/check_SVE2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "src/__support/macros/properties/cpu_features.h"

#ifndef LIBC_TARGET_CPU_HAS_SVE2
#error unsupported
#endif
12 changes: 12 additions & 0 deletions libc/src/__support/macros/properties/cpu_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
#define LIBC_TARGET_CPU_HAS_FULLFP16
#endif

#if defined(__ARM_FEATURE_SVE)
#define LIBC_TARGET_CPU_HAS_SVE
#endif

#if defined(__ARM_FEATURE_SVE2)
#define LIBC_TARGET_CPU_HAS_SVE2
#endif

#if defined(__ARM_FEATURE_MOPS)
#define LIBC_TARGET_CPU_HAS_MOPS
#endif

#if defined(__SSE2__)
#define LIBC_TARGET_CPU_HAS_SSE2
#define LIBC_TARGET_CPU_HAS_FPU_FLOAT
Expand Down
Loading