Skip to content

Commit 8ef1290

Browse files
committed
FeatureAnalyserComputation: Fix ARM detection - also make work for 64bit
1 parent 33371c2 commit 8ef1290

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

modules/FeatureAnalyzerComputation/iACPUID.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: GPL-3.0-or-later
33
#pragma once
44

5-
#ifndef __arm__
5+
#if (not defined(__arm__) && not defined(__aarch64__))
66
#ifdef _WIN32
77
#include <intrin.h>
88
using uint32_t = unsigned __int32;
@@ -15,11 +15,8 @@ using uint32_t = unsigned __int32;
1515
//! Retrieves and holds information on the CPU the program runs on.
1616
class iACPUID
1717
{
18-
#ifndef __arm__
18+
#if (not defined(__arm__) && not defined(__aarch64__))
1919
uint32_t regs[4];
20-
#endif
21-
public:
22-
#ifndef __arm__
2320
explicit iACPUID(unsigned i)
2421
{
2522
#ifdef _WIN32
@@ -40,9 +37,11 @@ class iACPUID
4037

4138
#endif
4239

40+
public:
41+
4342
static QString cpuVendor()
4443
{
45-
#ifdef __arm__
44+
#if (defined(__arm__) || defined(__aarch64__))
4645
return "ARM";
4746
#else
4847
QString vendor;
@@ -56,7 +55,7 @@ class iACPUID
5655

5756
static QString cpuBrand()
5857
{
59-
#ifdef __arm__
58+
#if (defined(__arm__) || defined(__aarch64__))
6059
return "Unknown";
6160
#else
6261
iACPUID cpuID(0x80000000);

0 commit comments

Comments
 (0)