multiarch

This commit is contained in:
quackerd 2023-03-16 09:43:19 +01:00
parent bb9792cf06
commit 4effb3f1bd

View File

@ -1,10 +1,8 @@
#pragma once
#include <cstdint>
#include <cstdlib>
#include <cstring>
#if defined(__x86_64__)
#include <immintrin.h>
#endif
#include <ctime>
#include <cstdio>
#include <sys/types.h>
@ -35,7 +33,7 @@ cmask_get_next_cpu(uint64_t *mask)
static inline int
cmask_get_num_cpus(const uint64_t mask)
{
return _mm_popcnt_u64(mask);
return __builtin_popcount(mask);
}
#endif