mirror of
https://github.com/hashcat/hashcat.git
synced 2025-07-25 16:08:39 +00:00
Fix compile error on apple silicon
This commit is contained in:
parent
d60658102b
commit
c8d81016ca
@ -7,7 +7,10 @@
|
|||||||
#define HC_CPU_FEATURES_H
|
#define HC_CPU_FEATURES_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#if defined(__x86_64__) || defined(_M_X64)
|
||||||
#include <cpuid.h>
|
#include <cpuid.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// SIMD detection
|
// SIMD detection
|
||||||
|
|
||||||
|
@ -7,6 +7,16 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "cpu_features.h"
|
#include "cpu_features.h"
|
||||||
|
|
||||||
|
#if defined(__aarch64__) || defined(__arm64__)
|
||||||
|
|
||||||
|
int cpu_supports_sse2 () { return 1; }
|
||||||
|
int cpu_supports_ssse3 () { return 0; }
|
||||||
|
int cpu_supports_xop () { return 0; }
|
||||||
|
int cpu_supports_avx2 () { return 0; }
|
||||||
|
int cpu_supports_avx512f () { return 0; }
|
||||||
|
int cpu_supports_avx512vl () { return 0; }
|
||||||
|
|
||||||
|
#else
|
||||||
static inline void cpuid (u32 leaf, u32 subleaf, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx)
|
static inline void cpuid (u32 leaf, u32 subleaf, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx)
|
||||||
{
|
{
|
||||||
__cpuid_count (leaf, subleaf, *eax, *ebx, *ecx, *edx);
|
__cpuid_count (leaf, subleaf, *eax, *ebx, *ecx, *edx);
|
||||||
@ -28,7 +38,7 @@ int cpu_supports_sse2 ()
|
|||||||
{
|
{
|
||||||
u32 eax, ebx, ecx, edx;
|
u32 eax, ebx, ecx, edx;
|
||||||
|
|
||||||
cpuid(1, 0, &eax, &ebx, &ecx, &edx);
|
cpuid (1, 0, &eax, &ebx, &ecx, &edx);
|
||||||
|
|
||||||
return (edx & bit_SSE2) != 0;
|
return (edx & bit_SSE2) != 0;
|
||||||
}
|
}
|
||||||
@ -120,6 +130,7 @@ int cpu_supports_avx512vl ()
|
|||||||
|
|
||||||
return (ebx & (1u << 31)) != 0;
|
return (ebx & (1u << 31)) != 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int cpu_chipset_test ()
|
int cpu_chipset_test ()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user