mirror of
https://github.com/google/cpu_features.git
synced 2025-07-01 05:11:15 +02:00
Update features for AArch64.
Add all missing features up to Linux v5.0. Features added: evtstrm, atomics, fphp, asimdhp, cpuid, asimdrdm, jscvt, fcma, lrcpc, dcpop, sha3, sm3, sm4, asimddp, sha512, sve, asimdfhm, dit, uscat, ilrcpc, flagm, ssbs, sb, paca, pacg.
This commit is contained in:
@ -21,13 +21,38 @@
|
||||
CPU_FEATURES_START_CPP_NAMESPACE
|
||||
|
||||
typedef struct {
|
||||
int fp : 1; // Floating-point.
|
||||
int asimd : 1; // Advanced SIMD.
|
||||
int aes : 1; // Hardware-accelerated Advanced Encryption Standard.
|
||||
int pmull : 1; // Polynomial multiply long.
|
||||
int sha1 : 1; // Hardware-accelerated SHA1.
|
||||
int sha2 : 1; // Hardware-accelerated SHA2-256.
|
||||
int crc32 : 1; // Hardware-accelerated CRC-32.
|
||||
int fp : 1; // Floating-point.
|
||||
int asimd : 1; // Advanced SIMD.
|
||||
int evtstrm : 1; // Generic timer generated events.
|
||||
int aes : 1; // Hardware-accelerated Advanced Encryption Standard.
|
||||
int pmull : 1; // Polynomial multiply long.
|
||||
int sha1 : 1; // Hardware-accelerated SHA1.
|
||||
int sha2 : 1; // Hardware-accelerated SHA2-256.
|
||||
int crc32 : 1; // Hardware-accelerated CRC-32.
|
||||
int atomics : 1; // Armv8.1 atomic instructions.
|
||||
int fphp : 1; // Half-precision floating point support.
|
||||
int asimdhp : 1; // Advanced SIMD half-precision support.
|
||||
int cpuid : 1; // Access to certain ID registers.
|
||||
int asimdrdm : 1; // Rounding Double Multiply Accumulate/Subtract.
|
||||
int jscvt : 1; // Support for JavaScript conversion.
|
||||
int fcma : 1; // Floating point complex numbers.
|
||||
int lrcpc : 1; // Support for weaker release consistency.
|
||||
int dcpop : 1; // Data persistence writeback.
|
||||
int sha3 : 1; // Hardware-accelerated SHA3.
|
||||
int sm3 : 1; // Hardware-accelerated SM3.
|
||||
int sm4 : 1; // Hardware-accelerated SM4.
|
||||
int asimddp : 1; // Dot product instruction.
|
||||
int sha512 : 1; // Hardware-accelerated SHA512.
|
||||
int sve : 1; // Scalable Vector Extension.
|
||||
int asimdfhm : 1; // Additional half-precision instructions.
|
||||
int dit : 1; // Data independent timing.
|
||||
int uscat : 1; // Unaligned atomics support.
|
||||
int ilrcpc : 1; // Additional support for weaker release consistency.
|
||||
int flagm : 1; // Flag manipulation instructions.
|
||||
int ssbs : 1; // Speculative Store Bypass Safe PSTATE bit.
|
||||
int sb : 1; // Speculation barrier.
|
||||
int paca : 1; // Address authentication.
|
||||
int pacg : 1; // Generic authentication.
|
||||
|
||||
// Make sure to update Aarch64FeaturesEnum below if you add a field here.
|
||||
} Aarch64Features;
|
||||
@ -48,11 +73,36 @@ Aarch64Info GetAarch64Info(void);
|
||||
typedef enum {
|
||||
AARCH64_FP,
|
||||
AARCH64_ASIMD,
|
||||
AARCH64_EVTSTRM,
|
||||
AARCH64_AES,
|
||||
AARCH64_PMULL,
|
||||
AARCH64_SHA1,
|
||||
AARCH64_SHA2,
|
||||
AARCH64_CRC32,
|
||||
AARCH64_ATOMICS,
|
||||
AARCH64_FPHP,
|
||||
AARCH64_ASIMDHP,
|
||||
AARCH64_CPUID,
|
||||
AARCH64_ASIMDRDM,
|
||||
AARCH64_JSCVT,
|
||||
AARCH64_FCMA,
|
||||
AARCH64_LRCPC,
|
||||
AARCH64_DCPOP,
|
||||
AARCH64_SHA3,
|
||||
AARCH64_SM3,
|
||||
AARCH64_SM4,
|
||||
AARCH64_ASIMDDP,
|
||||
AARCH64_SHA512,
|
||||
AARCH64_SVE,
|
||||
AARCH64_ASIMDFHM,
|
||||
AARCH64_DIT,
|
||||
AARCH64_USCAT,
|
||||
AARCH64_ILRCPC,
|
||||
AARCH64_FLAGM,
|
||||
AARCH64_SSBS,
|
||||
AARCH64_SB,
|
||||
AARCH64_PACA,
|
||||
AARCH64_PACG,
|
||||
AARCH64_LAST_,
|
||||
} Aarch64FeaturesEnum;
|
||||
|
||||
|
@ -28,11 +28,36 @@ CPU_FEATURES_START_CPP_NAMESPACE
|
||||
// http://elixir.free-electrons.com/linux/latest/source/arch/arm64/include/uapi/asm/hwcap.h
|
||||
#define AARCH64_HWCAP_FP (1UL << 0)
|
||||
#define AARCH64_HWCAP_ASIMD (1UL << 1)
|
||||
#define AARCH64_HWCAP_EVTSTRM (1UL << 2)
|
||||
#define AARCH64_HWCAP_AES (1UL << 3)
|
||||
#define AARCH64_HWCAP_PMULL (1UL << 4)
|
||||
#define AARCH64_HWCAP_SHA1 (1UL << 5)
|
||||
#define AARCH64_HWCAP_SHA2 (1UL << 6)
|
||||
#define AARCH64_HWCAP_CRC32 (1UL << 7)
|
||||
#define AARCH64_HWCAP_ATOMICS (1UL << 8)
|
||||
#define AARCH64_HWCAP_FPHP (1UL << 9)
|
||||
#define AARCH64_HWCAP_ASIMDHP (1UL << 10)
|
||||
#define AARCH64_HWCAP_CPUID (1UL << 11)
|
||||
#define AARCH64_HWCAP_ASIMDRDM (1UL << 12)
|
||||
#define AARCH64_HWCAP_JSCVT (1UL << 13)
|
||||
#define AARCH64_HWCAP_FCMA (1UL << 14)
|
||||
#define AARCH64_HWCAP_LRCPC (1UL << 15)
|
||||
#define AARCH64_HWCAP_DCPOP (1UL << 16)
|
||||
#define AARCH64_HWCAP_SHA3 (1UL << 17)
|
||||
#define AARCH64_HWCAP_SM3 (1UL << 18)
|
||||
#define AARCH64_HWCAP_SM4 (1UL << 19)
|
||||
#define AARCH64_HWCAP_ASIMDDP (1UL << 20)
|
||||
#define AARCH64_HWCAP_SHA512 (1UL << 21)
|
||||
#define AARCH64_HWCAP_SVE (1UL << 22)
|
||||
#define AARCH64_HWCAP_ASIMDFHM (1UL << 23)
|
||||
#define AARCH64_HWCAP_DIT (1UL << 24)
|
||||
#define AARCH64_HWCAP_USCAT (1UL << 25)
|
||||
#define AARCH64_HWCAP_ILRCPC (1UL << 26)
|
||||
#define AARCH64_HWCAP_FLAGM (1UL << 27)
|
||||
#define AARCH64_HWCAP_SSBS (1UL << 28)
|
||||
#define AARCH64_HWCAP_SB (1UL << 29)
|
||||
#define AARCH64_HWCAP_PACA (1UL << 30)
|
||||
#define AARCH64_HWCAP_PACG (1UL << 31)
|
||||
|
||||
// http://elixir.free-electrons.com/linux/latest/source/arch/arm/include/uapi/asm/hwcap.h
|
||||
#define ARM_HWCAP_SWP (1UL << 0)
|
||||
|
Reference in New Issue
Block a user