build with filc

This commit is contained in:
Daniel Lemire
2026-04-21 23:19:11 -04:00
parent 7662d7e57f
commit b2d39e9cda
3 changed files with 31 additions and 3 deletions
+8 -2
View File
@@ -52,13 +52,17 @@ POSSIBILITY OF SUCH DAMAGE.
#include <cstdlib>
#if defined(_MSC_VER)
#include <intrin.h>
#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 <cpuid.h>
#endif
#if defined(__loongarch__) && defined(__linux__)
#include <sys/auxv.h>
#endif
#ifdef __FILC__
#include <stdfil.h>
#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));
+12 -1
View File
@@ -1,3 +1,12 @@
#ifdef __FILC__
#include <stdio.h>
#include <stdlib.h>
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 <windows.h>
#include <sysinfoapi.h>
@@ -86,4 +95,6 @@ int main() {
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
}
#endif // This test is not relevant for FILC
+11
View File
@@ -1,3 +1,12 @@
#ifdef __FILC__
#include <stdio.h>
#include <stdlib.h>
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 <cstdio>
@@ -195,3 +204,5 @@ int main() {
}
#endif // SIMDJSON_CPLUSPLUS17
#endif // This test is not relevant for FILC