mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 19:57:48 +02:00
fix cpu check for arm
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
9e580de53c
commit
6f91e3988c
1 changed files with 1 additions and 8 deletions
|
@ -29,36 +29,29 @@ namespace cpu
|
||||||
|
|
||||||
void Detect()
|
void Detect()
|
||||||
{
|
{
|
||||||
__builtin_cpu_init();
|
|
||||||
#if defined(__AES__) || defined(__AVX__)
|
|
||||||
|
|
||||||
#if defined(__x86_64__) || defined(__i386__)
|
#if defined(__x86_64__) || defined(__i386__)
|
||||||
|
__builtin_cpu_init();
|
||||||
int info[4];
|
int info[4];
|
||||||
__cpuid(0, info[0], info[1], info[2], info[3]);
|
__cpuid(0, info[0], info[1], info[2], info[3]);
|
||||||
if (info[0] >= 0x00000001) {
|
if (info[0] >= 0x00000001) {
|
||||||
__cpuid(0x00000001, info[0], info[1], info[2], info[3]);
|
__cpuid(0x00000001, info[0], info[1], info[2], info[3]);
|
||||||
#ifdef __AES__
|
|
||||||
if (__builtin_cpu_supports("aes")) {
|
if (__builtin_cpu_supports("aes")) {
|
||||||
aesni = info[2] & bit_AES; // AESNI
|
aesni = info[2] & bit_AES; // AESNI
|
||||||
}
|
}
|
||||||
#endif // __AES__
|
|
||||||
if (__builtin_cpu_supports("avx")) {
|
if (__builtin_cpu_supports("avx")) {
|
||||||
avx = info[2] & bit_AVX; // AVX
|
avx = info[2] & bit_AVX; // AVX
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // defined(__x86_64__) || defined(__i386__)
|
#endif // defined(__x86_64__) || defined(__i386__)
|
||||||
|
|
||||||
#ifdef __AES__
|
|
||||||
if(aesni)
|
if(aesni)
|
||||||
{
|
{
|
||||||
LogPrint(eLogInfo, "AESNI enabled");
|
LogPrint(eLogInfo, "AESNI enabled");
|
||||||
}
|
}
|
||||||
#endif // __AES__
|
|
||||||
if(avx)
|
if(avx)
|
||||||
{
|
{
|
||||||
LogPrint(eLogInfo, "AVX enabled");
|
LogPrint(eLogInfo, "AVX enabled");
|
||||||
}
|
}
|
||||||
#endif // defined(__AES__) || defined(__AVX__)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue