diff --git a/libcpuid/asm-bits.c b/libcpuid/asm-bits.c index bfabd40..6f8358a 100644 --- a/libcpuid/asm-bits.c +++ b/libcpuid/asm-bits.c @@ -180,6 +180,9 @@ void cpu_rdtsc(uint64_t* result) #ifdef PLATFORM_ARM low_part = 0; hi_part = 0; +#elif defined(PLATFORM_AARCH64) + low_part = 0; + hi_part = 0; #else __asm __volatile ( " rdtsc\n" @@ -213,6 +216,7 @@ void busy_sse_loop(int cycles) # define XALIGN ".align 4\n" #endif #ifdef PLATFORM_ARM +#elif defined(PLATFORM_AARCH64) #else __asm __volatile ( " xorps %%xmm0, %%xmm0\n" diff --git a/libcpuid/asm-bits.h b/libcpuid/asm-bits.h index 9049e2f..847871a 100644 --- a/libcpuid/asm-bits.h +++ b/libcpuid/asm-bits.h @@ -55,11 +55,15 @@ #if !defined(PLATFORM_ARM) # define PLATFORM_ARM #endif +#elif defined(__aarch64__) +#if !defined(PLATFORM_ARM) +# define PLATFORM_AARCH64 +#endif #endif /* Under Windows/AMD64 with MSVC, inline assembly isn't supported */ #if (((defined(COMPILER_GCC) || defined(COMPILER_CLANG))) && \ - (defined(PLATFORM_X64) || defined(PLATFORM_X86) || defined(PLATFORM_ARM))) || \ + (defined(PLATFORM_X64) || defined(PLATFORM_X86) || defined(PLATFORM_ARM) || defined(PLATFORM_AARCH64))) || \ (defined(COMPILER_MICROSOFT) && defined(PLATFORM_X86)) # define INLINE_ASM_SUPPORTED #endif