From b2d39e9cda8ef366fe82b8370628202d491da8fb Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Tue, 21 Apr 2026 23:19:11 -0400 Subject: [PATCH] build with filc --- src/internal/isadetection.h | 10 ++++++++-- tests/ondemand/ondemand_cacheline.cpp | 13 ++++++++++++- tests/ondemand/ondemand_padded_input.cpp | 11 +++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/internal/isadetection.h b/src/internal/isadetection.h index 19e09d2b9..0b8da954d 100644 --- a/src/internal/isadetection.h +++ b/src/internal/isadetection.h @@ -52,13 +52,17 @@ POSSIBILITY OF SUCH DAMAGE. #include #if defined(_MSC_VER) #include -#elif defined(HAVE_GCC_GET_CPUID) && defined(USE_GCC_GET_CPUID) +#elif (defined(HAVE_GCC_GET_CPUID) && defined(USE_GCC_GET_CPUID)) || defined(__FILC__) #include #endif #if defined(__loongarch__) && defined(__linux__) #include #endif +#ifdef __FILC__ +#include +#endif + namespace simdjson { namespace internal { @@ -109,7 +113,7 @@ static inline void cpuid(uint32_t *eax, uint32_t *ebx, uint32_t *ecx, *ebx = cpu_info[1]; *ecx = cpu_info[2]; *edx = cpu_info[3]; -#elif defined(HAVE_GCC_GET_CPUID) && defined(USE_GCC_GET_CPUID) +#elif (defined(HAVE_GCC_GET_CPUID) && defined(USE_GCC_GET_CPUID)) || defined(__FILC__) uint32_t level = *eax; __get_cpuid(level, eax, ebx, ecx, edx); #else @@ -126,6 +130,8 @@ static inline void cpuid(uint32_t *eax, uint32_t *ebx, uint32_t *ecx, static inline uint64_t xgetbv() { #if defined(_MSC_VER) return _xgetbv(0); +#elif defined(__FILC__) + return zxgetbv(); #else uint32_t xcr0_lo, xcr0_hi; asm volatile("xgetbv\n\t" : "=a" (xcr0_lo), "=d" (xcr0_hi) : "c" (0)); diff --git a/tests/ondemand/ondemand_cacheline.cpp b/tests/ondemand/ondemand_cacheline.cpp index 6fa990beb..282705578 100644 --- a/tests/ondemand/ondemand_cacheline.cpp +++ b/tests/ondemand/ondemand_cacheline.cpp @@ -1,3 +1,12 @@ +#ifdef __FILC__ +#include +#include +int main() { + printf("This test is not relevant for FILC.\n"); + return EXIT_SUCCESS; +} +#else // This test is not relevant for FILC + #ifdef _WIN32 #include #include @@ -86,4 +95,6 @@ int main() { return EXIT_FAILURE; } return EXIT_SUCCESS; -} \ No newline at end of file +} + +#endif // This test is not relevant for FILC \ No newline at end of file diff --git a/tests/ondemand/ondemand_padded_input.cpp b/tests/ondemand/ondemand_padded_input.cpp index 9bdaeb500..2925e7437 100644 --- a/tests/ondemand/ondemand_padded_input.cpp +++ b/tests/ondemand/ondemand_padded_input.cpp @@ -1,3 +1,12 @@ +#ifdef __FILC__ +#include +#include +int main() { + printf("This test is not relevant for FILC.\n"); + return EXIT_SUCCESS; +} +#else // This test is not relevant for FILC + #include "simdjson.h" #include "simdjson/padded_string_view.h" #include @@ -195,3 +204,5 @@ int main() { } #endif // SIMDJSON_CPLUSPLUS17 + +#endif // This test is not relevant for FILC \ No newline at end of file