diff --git a/include/internal/hwcaps.h b/include/internal/hwcaps.h index fcc229ba..8ead5c53 100644 --- a/include/internal/hwcaps.h +++ b/include/internal/hwcaps.h @@ -28,255 +28,255 @@ CPU_FEATURES_START_CPP_NAMESPACE // constants here. // 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) +#define AARCH64_HWCAP_FP (UINT64_C(1) << 0) +#define AARCH64_HWCAP_ASIMD (UINT64_C(1) << 1) +#define AARCH64_HWCAP_EVTSTRM (UINT64_C(1) << 2) +#define AARCH64_HWCAP_AES (UINT64_C(1) << 3) +#define AARCH64_HWCAP_PMULL (UINT64_C(1) << 4) +#define AARCH64_HWCAP_SHA1 (UINT64_C(1) << 5) +#define AARCH64_HWCAP_SHA2 (UINT64_C(1) << 6) +#define AARCH64_HWCAP_CRC32 (UINT64_C(1) << 7) +#define AARCH64_HWCAP_ATOMICS (UINT64_C(1) << 8) +#define AARCH64_HWCAP_FPHP (UINT64_C(1) << 9) +#define AARCH64_HWCAP_ASIMDHP (UINT64_C(1) << 10) +#define AARCH64_HWCAP_CPUID (UINT64_C(1) << 11) +#define AARCH64_HWCAP_ASIMDRDM (UINT64_C(1) << 12) +#define AARCH64_HWCAP_JSCVT (UINT64_C(1) << 13) +#define AARCH64_HWCAP_FCMA (UINT64_C(1) << 14) +#define AARCH64_HWCAP_LRCPC (UINT64_C(1) << 15) +#define AARCH64_HWCAP_DCPOP (UINT64_C(1) << 16) +#define AARCH64_HWCAP_SHA3 (UINT64_C(1) << 17) +#define AARCH64_HWCAP_SM3 (UINT64_C(1) << 18) +#define AARCH64_HWCAP_SM4 (UINT64_C(1) << 19) +#define AARCH64_HWCAP_ASIMDDP (UINT64_C(1) << 20) +#define AARCH64_HWCAP_SHA512 (UINT64_C(1) << 21) +#define AARCH64_HWCAP_SVE (UINT64_C(1) << 22) +#define AARCH64_HWCAP_ASIMDFHM (UINT64_C(1) << 23) +#define AARCH64_HWCAP_DIT (UINT64_C(1) << 24) +#define AARCH64_HWCAP_USCAT (UINT64_C(1) << 25) +#define AARCH64_HWCAP_ILRCPC (UINT64_C(1) << 26) +#define AARCH64_HWCAP_FLAGM (UINT64_C(1) << 27) +#define AARCH64_HWCAP_SSBS (UINT64_C(1) << 28) +#define AARCH64_HWCAP_SB (UINT64_C(1) << 29) +#define AARCH64_HWCAP_PACA (UINT64_C(1) << 30) +#define AARCH64_HWCAP_PACG (UINT64_C(1) << 31) -#define AARCH64_HWCAP2_DCPODP (1UL << 0) -#define AARCH64_HWCAP2_SVE2 (1UL << 1) -#define AARCH64_HWCAP2_SVEAES (1UL << 2) -#define AARCH64_HWCAP2_SVEPMULL (1UL << 3) -#define AARCH64_HWCAP2_SVEBITPERM (1UL << 4) -#define AARCH64_HWCAP2_SVESHA3 (1UL << 5) -#define AARCH64_HWCAP2_SVESM4 (1UL << 6) -#define AARCH64_HWCAP2_FLAGM2 (1UL << 7) -#define AARCH64_HWCAP2_FRINT (1UL << 8) -#define AARCH64_HWCAP2_SVEI8MM (1UL << 9) -#define AARCH64_HWCAP2_SVEF32MM (1UL << 10) -#define AARCH64_HWCAP2_SVEF64MM (1UL << 11) -#define AARCH64_HWCAP2_SVEBF16 (1UL << 12) -#define AARCH64_HWCAP2_I8MM (1UL << 13) -#define AARCH64_HWCAP2_BF16 (1UL << 14) -#define AARCH64_HWCAP2_DGH (1UL << 15) -#define AARCH64_HWCAP2_RNG (1UL << 16) -#define AARCH64_HWCAP2_BTI (1UL << 17) -#define AARCH64_HWCAP2_MTE (1UL << 18) -#define AARCH64_HWCAP2_ECV (1UL << 19) -#define AARCH64_HWCAP2_AFP (1UL << 20) -#define AARCH64_HWCAP2_RPRES (1UL << 21) -#define AARCH64_HWCAP2_MTE3 (1UL << 22) -#define AARCH64_HWCAP2_SME (1UL << 23) -#define AARCH64_HWCAP2_SME_I16I64 (1UL << 24) -#define AARCH64_HWCAP2_SME_F64F64 (1UL << 25) -#define AARCH64_HWCAP2_SME_I8I32 (1UL << 26) -#define AARCH64_HWCAP2_SME_F16F32 (1UL << 27) -#define AARCH64_HWCAP2_SME_B16F32 (1UL << 28) -#define AARCH64_HWCAP2_SME_F32F32 (1UL << 29) -#define AARCH64_HWCAP2_SME_FA64 (1UL << 30) -#define AARCH64_HWCAP2_WFXT (1UL << 31) -#define AARCH64_HWCAP2_EBF16 (1UL << 32) -#define AARCH64_HWCAP2_SVE_EBF16 (1UL << 33) -#define AARCH64_HWCAP2_CSSC (1UL << 34) -#define AARCH64_HWCAP2_RPRFM (1UL << 35) -#define AARCH64_HWCAP2_SVE2P1 (1UL << 36) -#define AARCH64_HWCAP2_SME2 (1UL << 37) -#define AARCH64_HWCAP2_SME2P1 (1UL << 38) -#define AARCH64_HWCAP2_SME_I16I32 (1UL << 39) -#define AARCH64_HWCAP2_SME_BI32I32 (1UL << 40) -#define AARCH64_HWCAP2_SME_B16B16 (1UL << 41) -#define AARCH64_HWCAP2_SME_F16F16 (1UL << 42) -#define AARCH64_HWCAP2_MOPS (1UL << 43) -#define AARCH64_HWCAP2_HBC (1UL << 44) -#define AARCH64_HWCAP2_SVE_B16B16 (1UL << 45) -#define AARCH64_HWCAP2_LRCPC3 (1UL << 46) -#define AARCH64_HWCAP2_LSE128 (1UL << 47) -#define AARCH64_HWCAP2_FPMR (1UL << 48) -#define AARCH64_HWCAP2_LUT (1UL << 49) -#define AARCH64_HWCAP2_FAMINMAX (1UL << 50) -#define AARCH64_HWCAP2_F8CVT (1UL << 51) -#define AARCH64_HWCAP2_F8FMA (1UL << 52) -#define AARCH64_HWCAP2_F8DP4 (1UL << 53) -#define AARCH64_HWCAP2_F8DP2 (1UL << 54) -#define AARCH64_HWCAP2_F8E4M3 (1UL << 55) -#define AARCH64_HWCAP2_F8E5M2 (1UL << 56) -#define AARCH64_HWCAP2_SME_LUTV2 (1UL << 57) -#define AARCH64_HWCAP2_SME_F8F16 (1UL << 58) -#define AARCH64_HWCAP2_SME_F8F32 (1UL << 59) -#define AARCH64_HWCAP2_SME_SF8FMA (1UL << 60) -#define AARCH64_HWCAP2_SME_SF8DP4 (1UL << 61) -#define AARCH64_HWCAP2_SME_SF8DP2 (1UL << 62) -#define AARCH64_HWCAP2_POE (1UL << 63) +#define AARCH64_HWCAP2_DCPODP (UINT64_C(1) << 0) +#define AARCH64_HWCAP2_SVE2 (UINT64_C(1) << 1) +#define AARCH64_HWCAP2_SVEAES (UINT64_C(1) << 2) +#define AARCH64_HWCAP2_SVEPMULL (UINT64_C(1) << 3) +#define AARCH64_HWCAP2_SVEBITPERM (UINT64_C(1) << 4) +#define AARCH64_HWCAP2_SVESHA3 (UINT64_C(1) << 5) +#define AARCH64_HWCAP2_SVESM4 (UINT64_C(1) << 6) +#define AARCH64_HWCAP2_FLAGM2 (UINT64_C(1) << 7) +#define AARCH64_HWCAP2_FRINT (UINT64_C(1) << 8) +#define AARCH64_HWCAP2_SVEI8MM (UINT64_C(1) << 9) +#define AARCH64_HWCAP2_SVEF32MM (UINT64_C(1) << 10) +#define AARCH64_HWCAP2_SVEF64MM (UINT64_C(1) << 11) +#define AARCH64_HWCAP2_SVEBF16 (UINT64_C(1) << 12) +#define AARCH64_HWCAP2_I8MM (UINT64_C(1) << 13) +#define AARCH64_HWCAP2_BF16 (UINT64_C(1) << 14) +#define AARCH64_HWCAP2_DGH (UINT64_C(1) << 15) +#define AARCH64_HWCAP2_RNG (UINT64_C(1) << 16) +#define AARCH64_HWCAP2_BTI (UINT64_C(1) << 17) +#define AARCH64_HWCAP2_MTE (UINT64_C(1) << 18) +#define AARCH64_HWCAP2_ECV (UINT64_C(1) << 19) +#define AARCH64_HWCAP2_AFP (UINT64_C(1) << 20) +#define AARCH64_HWCAP2_RPRES (UINT64_C(1) << 21) +#define AARCH64_HWCAP2_MTE3 (UINT64_C(1) << 22) +#define AARCH64_HWCAP2_SME (UINT64_C(1) << 23) +#define AARCH64_HWCAP2_SME_I16I64 (UINT64_C(1) << 24) +#define AARCH64_HWCAP2_SME_F64F64 (UINT64_C(1) << 25) +#define AARCH64_HWCAP2_SME_I8I32 (UINT64_C(1) << 26) +#define AARCH64_HWCAP2_SME_F16F32 (UINT64_C(1) << 27) +#define AARCH64_HWCAP2_SME_B16F32 (UINT64_C(1) << 28) +#define AARCH64_HWCAP2_SME_F32F32 (UINT64_C(1) << 29) +#define AARCH64_HWCAP2_SME_FA64 (UINT64_C(1) << 30) +#define AARCH64_HWCAP2_WFXT (UINT64_C(1) << 31) +#define AARCH64_HWCAP2_EBF16 (UINT64_C(1) << 32) +#define AARCH64_HWCAP2_SVE_EBF16 (UINT64_C(1) << 33) +#define AARCH64_HWCAP2_CSSC (UINT64_C(1) << 34) +#define AARCH64_HWCAP2_RPRFM (UINT64_C(1) << 35) +#define AARCH64_HWCAP2_SVE2P1 (UINT64_C(1) << 36) +#define AARCH64_HWCAP2_SME2 (UINT64_C(1) << 37) +#define AARCH64_HWCAP2_SME2P1 (UINT64_C(1) << 38) +#define AARCH64_HWCAP2_SME_I16I32 (UINT64_C(1) << 39) +#define AARCH64_HWCAP2_SME_BI32I32 (UINT64_C(1) << 40) +#define AARCH64_HWCAP2_SME_B16B16 (UINT64_C(1) << 41) +#define AARCH64_HWCAP2_SME_F16F16 (UINT64_C(1) << 42) +#define AARCH64_HWCAP2_MOPS (UINT64_C(1) << 43) +#define AARCH64_HWCAP2_HBC (UINT64_C(1) << 44) +#define AARCH64_HWCAP2_SVE_B16B16 (UINT64_C(1) << 45) +#define AARCH64_HWCAP2_LRCPC3 (UINT64_C(1) << 46) +#define AARCH64_HWCAP2_LSE128 (UINT64_C(1) << 47) +#define AARCH64_HWCAP2_FPMR (UINT64_C(1) << 48) +#define AARCH64_HWCAP2_LUT (UINT64_C(1) << 49) +#define AARCH64_HWCAP2_FAMINMAX (UINT64_C(1) << 50) +#define AARCH64_HWCAP2_F8CVT (UINT64_C(1) << 51) +#define AARCH64_HWCAP2_F8FMA (UINT64_C(1) << 52) +#define AARCH64_HWCAP2_F8DP4 (UINT64_C(1) << 53) +#define AARCH64_HWCAP2_F8DP2 (UINT64_C(1) << 54) +#define AARCH64_HWCAP2_F8E4M3 (UINT64_C(1) << 55) +#define AARCH64_HWCAP2_F8E5M2 (UINT64_C(1) << 56) +#define AARCH64_HWCAP2_SME_LUTV2 (UINT64_C(1) << 57) +#define AARCH64_HWCAP2_SME_F8F16 (UINT64_C(1) << 58) +#define AARCH64_HWCAP2_SME_F8F32 (UINT64_C(1) << 59) +#define AARCH64_HWCAP2_SME_SF8FMA (UINT64_C(1) << 60) +#define AARCH64_HWCAP2_SME_SF8DP4 (UINT64_C(1) << 61) +#define AARCH64_HWCAP2_SME_SF8DP2 (UINT64_C(1) << 62) +#define AARCH64_HWCAP2_POE (UINT64_C(1) << 63) // http://elixir.free-electrons.com/linux/latest/source/arch/arm/include/uapi/asm/hwcap.h -#define ARM_HWCAP_SWP (1UL << 0) -#define ARM_HWCAP_HALF (1UL << 1) -#define ARM_HWCAP_THUMB (1UL << 2) -#define ARM_HWCAP_26BIT (1UL << 3) -#define ARM_HWCAP_FAST_MULT (1UL << 4) -#define ARM_HWCAP_FPA (1UL << 5) -#define ARM_HWCAP_VFP (1UL << 6) -#define ARM_HWCAP_EDSP (1UL << 7) -#define ARM_HWCAP_JAVA (1UL << 8) -#define ARM_HWCAP_IWMMXT (1UL << 9) -#define ARM_HWCAP_CRUNCH (1UL << 10) -#define ARM_HWCAP_THUMBEE (1UL << 11) -#define ARM_HWCAP_NEON (1UL << 12) -#define ARM_HWCAP_VFPV3 (1UL << 13) -#define ARM_HWCAP_VFPV3D16 (1UL << 14) -#define ARM_HWCAP_TLS (1UL << 15) -#define ARM_HWCAP_VFPV4 (1UL << 16) -#define ARM_HWCAP_IDIVA (1UL << 17) -#define ARM_HWCAP_IDIVT (1UL << 18) -#define ARM_HWCAP_VFPD32 (1UL << 19) -#define ARM_HWCAP_LPAE (1UL << 20) -#define ARM_HWCAP_EVTSTRM (1UL << 21) -#define ARM_HWCAP2_AES (1UL << 0) -#define ARM_HWCAP2_PMULL (1UL << 1) -#define ARM_HWCAP2_SHA1 (1UL << 2) -#define ARM_HWCAP2_SHA2 (1UL << 3) -#define ARM_HWCAP2_CRC32 (1UL << 4) +#define ARM_HWCAP_SWP (UINT64_C(1) << 0) +#define ARM_HWCAP_HALF (UINT64_C(1) << 1) +#define ARM_HWCAP_THUMB (UINT64_C(1) << 2) +#define ARM_HWCAP_26BIT (UINT64_C(1) << 3) +#define ARM_HWCAP_FAST_MULT (UINT64_C(1) << 4) +#define ARM_HWCAP_FPA (UINT64_C(1) << 5) +#define ARM_HWCAP_VFP (UINT64_C(1) << 6) +#define ARM_HWCAP_EDSP (UINT64_C(1) << 7) +#define ARM_HWCAP_JAVA (UINT64_C(1) << 8) +#define ARM_HWCAP_IWMMXT (UINT64_C(1) << 9) +#define ARM_HWCAP_CRUNCH (UINT64_C(1) << 10) +#define ARM_HWCAP_THUMBEE (UINT64_C(1) << 11) +#define ARM_HWCAP_NEON (UINT64_C(1) << 12) +#define ARM_HWCAP_VFPV3 (UINT64_C(1) << 13) +#define ARM_HWCAP_VFPV3D16 (UINT64_C(1) << 14) +#define ARM_HWCAP_TLS (UINT64_C(1) << 15) +#define ARM_HWCAP_VFPV4 (UINT64_C(1) << 16) +#define ARM_HWCAP_IDIVA (UINT64_C(1) << 17) +#define ARM_HWCAP_IDIVT (UINT64_C(1) << 18) +#define ARM_HWCAP_VFPD32 (UINT64_C(1) << 19) +#define ARM_HWCAP_LPAE (UINT64_C(1) << 20) +#define ARM_HWCAP_EVTSTRM (UINT64_C(1) << 21) +#define ARM_HWCAP2_AES (UINT64_C(1) << 0) +#define ARM_HWCAP2_PMULL (UINT64_C(1) << 1) +#define ARM_HWCAP2_SHA1 (UINT64_C(1) << 2) +#define ARM_HWCAP2_SHA2 (UINT64_C(1) << 3) +#define ARM_HWCAP2_CRC32 (UINT64_C(1) << 4) // http://elixir.free-electrons.com/linux/latest/source/arch/mips/include/uapi/asm/hwcap.h -#define MIPS_HWCAP_R6 (1UL << 0) -#define MIPS_HWCAP_MSA (1UL << 1) -#define MIPS_HWCAP_CRC32 (1UL << 2) -#define MIPS_HWCAP_MIPS16 (1UL << 3) -#define MIPS_HWCAP_MDMX (1UL << 4) -#define MIPS_HWCAP_MIPS3D (1UL << 5) -#define MIPS_HWCAP_SMARTMIPS (1UL << 6) -#define MIPS_HWCAP_DSP (1UL << 7) -#define MIPS_HWCAP_DSP2 (1UL << 8) -#define MIPS_HWCAP_DSP3 (1UL << 9) +#define MIPS_HWCAP_R6 (UINT64_C(1) << 0) +#define MIPS_HWCAP_MSA (UINT64_C(1) << 1) +#define MIPS_HWCAP_CRC32 (UINT64_C(1) << 2) +#define MIPS_HWCAP_MIPS16 (UINT64_C(1) << 3) +#define MIPS_HWCAP_MDMX (UINT64_C(1) << 4) +#define MIPS_HWCAP_MIPS3D (UINT64_C(1) << 5) +#define MIPS_HWCAP_SMARTMIPS (UINT64_C(1) << 6) +#define MIPS_HWCAP_DSP (UINT64_C(1) << 7) +#define MIPS_HWCAP_DSP2 (UINT64_C(1) << 8) +#define MIPS_HWCAP_DSP3 (UINT64_C(1) << 9) // http://elixir.free-electrons.com/linux/latest/source/arch/powerpc/include/uapi/asm/cputable.h #ifndef _UAPI__ASM_POWERPC_CPUTABLE_H /* in AT_HWCAP */ -#define PPC_FEATURE_32 0x80000000 -#define PPC_FEATURE_64 0x40000000 -#define PPC_FEATURE_601_INSTR 0x20000000 -#define PPC_FEATURE_HAS_ALTIVEC 0x10000000 -#define PPC_FEATURE_HAS_FPU 0x08000000 -#define PPC_FEATURE_HAS_MMU 0x04000000 -#define PPC_FEATURE_HAS_4xxMAC 0x02000000 -#define PPC_FEATURE_UNIFIED_CACHE 0x01000000 -#define PPC_FEATURE_HAS_SPE 0x00800000 -#define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000 -#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 -#define PPC_FEATURE_NO_TB 0x00100000 -#define PPC_FEATURE_POWER4 0x00080000 -#define PPC_FEATURE_POWER5 0x00040000 -#define PPC_FEATURE_POWER5_PLUS 0x00020000 -#define PPC_FEATURE_CELL 0x00010000 -#define PPC_FEATURE_BOOKE 0x00008000 -#define PPC_FEATURE_SMT 0x00004000 -#define PPC_FEATURE_ICACHE_SNOOP 0x00002000 -#define PPC_FEATURE_ARCH_2_05 0x00001000 -#define PPC_FEATURE_PA6T 0x00000800 -#define PPC_FEATURE_HAS_DFP 0x00000400 -#define PPC_FEATURE_POWER6_EXT 0x00000200 -#define PPC_FEATURE_ARCH_2_06 0x00000100 -#define PPC_FEATURE_HAS_VSX 0x00000080 +#define PPC_FEATURE_32 UINT64_C(0x80000000) +#define PPC_FEATURE_64 UINT64_C(0x40000000) +#define PPC_FEATURE_601_INSTR UINT64_C(0x20000000) +#define PPC_FEATURE_HAS_ALTIVEC UINT64_C(0x10000000) +#define PPC_FEATURE_HAS_FPU UINT64_C(0x08000000) +#define PPC_FEATURE_HAS_MMU UINT64_C(0x04000000) +#define PPC_FEATURE_HAS_4xxMAC UINT64_C(0x02000000) +#define PPC_FEATURE_UNIFIED_CACHE UINT64_C(0x01000000) +#define PPC_FEATURE_HAS_SPE UINT64_C(0x00800000) +#define PPC_FEATURE_HAS_EFP_SINGLE UINT64_C(0x00400000) +#define PPC_FEATURE_HAS_EFP_DOUBLE UINT64_C(0x00200000) +#define PPC_FEATURE_NO_TB UINT64_C(0x00100000) +#define PPC_FEATURE_POWER4 UINT64_C(0x00080000) +#define PPC_FEATURE_POWER5 UINT64_C(0x00040000) +#define PPC_FEATURE_POWER5_PLUS UINT64_C(0x00020000) +#define PPC_FEATURE_CELL UINT64_C(0x00010000) +#define PPC_FEATURE_BOOKE UINT64_C(0x00008000) +#define PPC_FEATURE_SMT UINT64_C(0x00004000) +#define PPC_FEATURE_ICACHE_SNOOP UINT64_C(0x00002000) +#define PPC_FEATURE_ARCH_2_05 UINT64_C(0x00001000) +#define PPC_FEATURE_PA6T UINT64_C(0x00000800) +#define PPC_FEATURE_HAS_DFP UINT64_C(0x00000400) +#define PPC_FEATURE_POWER6_EXT UINT64_C(0x00000200) +#define PPC_FEATURE_ARCH_2_06 UINT64_C(0x00000100) +#define PPC_FEATURE_HAS_VSX UINT64_C(0x00000080) -#define PPC_FEATURE_PSERIES_PERFMON_COMPAT 0x00000040 +#define PPC_FEATURE_PSERIES_PERFMON_COMPAT UINT64_C(0x00000040) /* Reserved - do not use 0x00000004 */ -#define PPC_FEATURE_TRUE_LE 0x00000002 -#define PPC_FEATURE_PPC_LE 0x00000001 +#define PPC_FEATURE_TRUE_LE UINT64_C(0x00000002) +#define PPC_FEATURE_PPC_LE UINT64_C(0x00000001) /* in AT_HWCAP2 */ -#define PPC_FEATURE2_ARCH_2_07 0x80000000 -#define PPC_FEATURE2_HTM 0x40000000 -#define PPC_FEATURE2_DSCR 0x20000000 -#define PPC_FEATURE2_EBB 0x10000000 -#define PPC_FEATURE2_ISEL 0x08000000 -#define PPC_FEATURE2_TAR 0x04000000 -#define PPC_FEATURE2_VEC_CRYPTO 0x02000000 -#define PPC_FEATURE2_HTM_NOSC 0x01000000 -#define PPC_FEATURE2_ARCH_3_00 0x00800000 -#define PPC_FEATURE2_HAS_IEEE128 0x00400000 -#define PPC_FEATURE2_DARN 0x00200000 -#define PPC_FEATURE2_SCV 0x00100000 -#define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 +#define PPC_FEATURE2_ARCH_2_07 UINT64_C(0x80000000) +#define PPC_FEATURE2_HTM UINT64_C(0x40000000) +#define PPC_FEATURE2_DSCR UINT64_C(0x20000000) +#define PPC_FEATURE2_EBB UINT64_C(0x10000000) +#define PPC_FEATURE2_ISEL UINT64_C(0x08000000) +#define PPC_FEATURE2_TAR UINT64_C(0x04000000) +#define PPC_FEATURE2_VEC_CRYPTO UINT64_C(0x02000000) +#define PPC_FEATURE2_HTM_NOSC UINT64_C(0x01000000) +#define PPC_FEATURE2_ARCH_3_00 UINT64_C(0x00800000) +#define PPC_FEATURE2_HAS_IEEE128 UINT64_C(0x00400000) +#define PPC_FEATURE2_DARN UINT64_C(0x00200000) +#define PPC_FEATURE2_SCV UINT64_C(0x00100000) +#define PPC_FEATURE2_HTM_NO_SUSPEND UINT64_C(0x00080000) #endif // https://elixir.bootlin.com/linux/v6.0-rc6/source/arch/s390/include/asm/elf.h -#define HWCAP_S390_ESAN3 1 -#define HWCAP_S390_ZARCH 2 -#define HWCAP_S390_STFLE 4 -#define HWCAP_S390_MSA 8 -#define HWCAP_S390_LDISP 16 -#define HWCAP_S390_EIMM 32 -#define HWCAP_S390_DFP 64 -#define HWCAP_S390_HPAGE 128 -#define HWCAP_S390_ETF3EH 256 -#define HWCAP_S390_HIGH_GPRS 512 -#define HWCAP_S390_TE 1024 -#define HWCAP_S390_VX 2048 -#define HWCAP_S390_VXRS HWCAP_S390_VX -#define HWCAP_S390_VXD 4096 -#define HWCAP_S390_VXRS_BCD HWCAP_S390_VXD -#define HWCAP_S390_VXE 8192 -#define HWCAP_S390_VXRS_EXT HWCAP_S390_VXE -#define HWCAP_S390_GS 16384 -#define HWCAP_S390_VXRS_EXT2 32768 -#define HWCAP_S390_VXRS_PDE 65536 -#define HWCAP_S390_SORT 131072 -#define HWCAP_S390_DFLT 262144 -#define HWCAP_S390_VXRS_PDE2 524288 -#define HWCAP_S390_NNPA 1048576 -#define HWCAP_S390_PCI_MIO 2097152 -#define HWCAP_S390_SIE 4194304 +#define HWCAP_S390_ESAN3 UINT64_C(1) +#define HWCAP_S390_ZARCH UINT64_C(2) +#define HWCAP_S390_STFLE UINT64_C(4) +#define HWCAP_S390_MSA UINT64_C(8) +#define HWCAP_S390_LDISP UINT64_C(16) +#define HWCAP_S390_EIMM UINT64_C(32) +#define HWCAP_S390_DFP UINT64_C(64) +#define HWCAP_S390_HPAGE UINT64_C(128) +#define HWCAP_S390_ETF3EH UINT64_C(256) +#define HWCAP_S390_HIGH_GPRS UINT64_C(512) +#define HWCAP_S390_TE UINT64_C(1024) +#define HWCAP_S390_VX UINT64_C(2048) +#define HWCAP_S390_VXRS HWCAP_S390_VX +#define HWCAP_S390_VXD UINT64_C(4096) +#define HWCAP_S390_VXRS_BCD HWCAP_S390_VXD +#define HWCAP_S390_VXE UINT64_C(8192) +#define HWCAP_S390_VXRS_EXT HWCAP_S390_VXE +#define HWCAP_S390_GS UINT64_C(16384) +#define HWCAP_S390_VXRS_EXT2 UINT64_C(32768) +#define HWCAP_S390_VXRS_PDE UINT64_C(65536) +#define HWCAP_S390_SORT UINT64_C(131072) +#define HWCAP_S390_DFLT UINT64_C(262144) +#define HWCAP_S390_VXRS_PDE2 UINT64_C(524288) +#define HWCAP_S390_NNPA UINT64_C(1048576) +#define HWCAP_S390_PCI_MIO UINT64_C(2097152) +#define HWCAP_S390_SIE UINT64_C(4194304) // https://elixir.bootlin.com/linux/latest/source/arch/riscv/include/uapi/asm/hwcap.h -#define RISCV_HWCAP_32 0x32 -#define RISCV_HWCAP_64 0x64 -#define RISCV_HWCAP_128 0x128 -#define RISCV_HWCAP_M (1UL << ('M' - 'A')) -#define RISCV_HWCAP_A (1UL << ('A' - 'A')) -#define RISCV_HWCAP_F (1UL << ('F' - 'A')) -#define RISCV_HWCAP_D (1UL << ('D' - 'A')) -#define RISCV_HWCAP_Q (1UL << ('Q' - 'A')) -#define RISCV_HWCAP_C (1UL << ('C' - 'A')) -#define RISCV_HWCAP_V (1UL << ('V' - 'A')) +#define RISCV_HWCAP_32 UINT64_C(0x32) +#define RISCV_HWCAP_64 UINT64_C(0x64) +#define RISCV_HWCAP_128 UINT64_C(0x128) +#define RISCV_HWCAP_M (UINT64_C(1) << ('M' - 'A')) +#define RISCV_HWCAP_A (UINT64_C(1) << ('A' - 'A')) +#define RISCV_HWCAP_F (UINT64_C(1) << ('F' - 'A')) +#define RISCV_HWCAP_D (UINT64_C(1) << ('D' - 'A')) +#define RISCV_HWCAP_Q (UINT64_C(1) << ('Q' - 'A')) +#define RISCV_HWCAP_C (UINT64_C(1) << ('C' - 'A')) +#define RISCV_HWCAP_V (UINT64_C(1) << ('V' - 'A')) // https://github.com/torvalds/linux/blob/master/arch/loongarch/include/uapi/asm/hwcap.h -#define HWCAP_LOONGARCH_CPUCFG (1 << 0) -#define HWCAP_LOONGARCH_LAM (1 << 1) -#define HWCAP_LOONGARCH_UAL (1 << 2) -#define HWCAP_LOONGARCH_FPU (1 << 3) -#define HWCAP_LOONGARCH_LSX (1 << 4) -#define HWCAP_LOONGARCH_LASX (1 << 5) -#define HWCAP_LOONGARCH_CRC32 (1 << 6) -#define HWCAP_LOONGARCH_COMPLEX (1 << 7) -#define HWCAP_LOONGARCH_CRYPTO (1 << 8) -#define HWCAP_LOONGARCH_LVZ (1 << 9) -#define HWCAP_LOONGARCH_LBT_X86 (1 << 10) -#define HWCAP_LOONGARCH_LBT_ARM (1 << 11) -#define HWCAP_LOONGARCH_LBT_MIPS (1 << 12) -#define HWCAP_LOONGARCH_PTW (1 << 13) +#define HWCAP_LOONGARCH_CPUCFG (UINT64_C(1) << 0) +#define HWCAP_LOONGARCH_LAM (UINT64_C(1) << 1) +#define HWCAP_LOONGARCH_UAL (UINT64_C(1) << 2) +#define HWCAP_LOONGARCH_FPU (UINT64_C(1) << 3) +#define HWCAP_LOONGARCH_LSX (UINT64_C(1) << 4) +#define HWCAP_LOONGARCH_LASX (UINT64_C(1) << 5) +#define HWCAP_LOONGARCH_CRC32 (UINT64_C(1) << 6) +#define HWCAP_LOONGARCH_COMPLEX (UINT64_C(1) << 7) +#define HWCAP_LOONGARCH_CRYPTO (UINT64_C(1) << 8) +#define HWCAP_LOONGARCH_LVZ (UINT64_C(1) << 9) +#define HWCAP_LOONGARCH_LBT_X86 (UINT64_C(1) << 10) +#define HWCAP_LOONGARCH_LBT_ARM (UINT64_C(1) << 11) +#define HWCAP_LOONGARCH_LBT_MIPS (UINT64_C(1) << 12) +#define HWCAP_LOONGARCH_PTW (UINT64_C(1) << 13) typedef struct { - unsigned long hwcaps; - unsigned long hwcaps2; + uint64_t hwcaps; + uint64_t hwcaps2; } HardwareCapabilities; // Retrieves values from auxiliary vector for types AT_HWCAP and AT_HWCAP2. diff --git a/src/define_introspection_and_hwcaps.inl b/src/define_introspection_and_hwcaps.inl index c31b60d9..b01dd355 100644 --- a/src/define_introspection_and_hwcaps.inl +++ b/src/define_introspection_and_hwcaps.inl @@ -15,8 +15,14 @@ #include "define_introspection.inl" #include "internal/hwcaps.h" +#if defined(_MSC_VER) && !defined(__clang__) +#define LINE(ENUM, NAME, CPUINFO_FLAG, HWCAP, HWCAP2) \ + [ENUM] = {HWCAP, HWCAP2}, +#else #define LINE(ENUM, NAME, CPUINFO_FLAG, HWCAP, HWCAP2) \ [ENUM] = (HardwareCapabilities){HWCAP, HWCAP2}, +#endif + static const HardwareCapabilities kHardwareCapabilities[] = { INTROSPECTION_TABLE}; #undef LINE diff --git a/src/hwcaps.c b/src/hwcaps.c index 6e2e9a85..918761e2 100644 --- a/src/hwcaps.c +++ b/src/hwcaps.c @@ -16,7 +16,7 @@ #include -static bool IsSet(const uint32_t mask, const uint32_t value) { +static bool IsSet(const uint64_t mask, const uint64_t value) { if (mask == 0) return false; return (value & mask) == mask; } diff --git a/src/impl_aarch64_windows.c b/src/impl_aarch64_windows.c index 371f3927..f5648528 100644 --- a/src/impl_aarch64_windows.c +++ b/src/impl_aarch64_windows.c @@ -19,71 +19,7 @@ #include "cpuinfo_aarch64.h" -//////////////////////////////////////////////////////////////////////////////// -// Definitions for introspection. -//////////////////////////////////////////////////////////////////////////////// -#define INTROSPECTION_TABLE \ - LINE(AARCH64_FP, fp, , , ) \ - LINE(AARCH64_ASIMD, asimd, , , ) \ - LINE(AARCH64_EVTSTRM, evtstrm, , , ) \ - LINE(AARCH64_AES, aes, , , ) \ - LINE(AARCH64_PMULL, pmull, , , ) \ - LINE(AARCH64_SHA1, sha1, , , ) \ - LINE(AARCH64_SHA2, sha2, , , ) \ - LINE(AARCH64_CRC32, crc32, , , ) \ - LINE(AARCH64_ATOMICS, atomics, , , ) \ - LINE(AARCH64_FPHP, fphp, , , ) \ - LINE(AARCH64_ASIMDHP, asimdhp, , , ) \ - LINE(AARCH64_CPUID, cpuid, , , ) \ - LINE(AARCH64_ASIMDRDM, asimdrdm, , , ) \ - LINE(AARCH64_JSCVT, jscvt, , , ) \ - LINE(AARCH64_FCMA, fcma, , , ) \ - LINE(AARCH64_LRCPC, lrcpc, , , ) \ - LINE(AARCH64_DCPOP, dcpop, , , ) \ - LINE(AARCH64_SHA3, sha3, , , ) \ - LINE(AARCH64_SM3, sm3, , , ) \ - LINE(AARCH64_SM4, sm4, , , ) \ - LINE(AARCH64_ASIMDDP, asimddp, , , ) \ - LINE(AARCH64_SHA512, sha512, , , ) \ - LINE(AARCH64_SVE, sve, , , ) \ - LINE(AARCH64_ASIMDFHM, asimdfhm, , , ) \ - LINE(AARCH64_DIT, dit, , , ) \ - LINE(AARCH64_USCAT, uscat, , , ) \ - LINE(AARCH64_ILRCPC, ilrcpc, , , ) \ - LINE(AARCH64_FLAGM, flagm, , , ) \ - LINE(AARCH64_SSBS, ssbs, , , ) \ - LINE(AARCH64_SB, sb, , , ) \ - LINE(AARCH64_PACA, paca, , , ) \ - LINE(AARCH64_PACG, pacg, , , ) \ - LINE(AARCH64_DCPODP, dcpodp, , , ) \ - LINE(AARCH64_SVE2, sve2, , , ) \ - LINE(AARCH64_SVEAES, sveaes, , , ) \ - LINE(AARCH64_SVEPMULL, svepmull, , , ) \ - LINE(AARCH64_SVEBITPERM, svebitperm, , , ) \ - LINE(AARCH64_SVESHA3, svesha3, , , ) \ - LINE(AARCH64_SVESM4, svesm4, , , ) \ - LINE(AARCH64_FLAGM2, flagm2, , , ) \ - LINE(AARCH64_FRINT, frint, , , ) \ - LINE(AARCH64_SVEI8MM, svei8mm, , , ) \ - LINE(AARCH64_SVEF32MM, svef32mm, , , ) \ - LINE(AARCH64_SVEF64MM, svef64mm, , , ) \ - LINE(AARCH64_SVEBF16, svebf16, , , ) \ - LINE(AARCH64_I8MM, i8mm, , , ) \ - LINE(AARCH64_BF16, bf16, , , ) \ - LINE(AARCH64_DGH, dgh, , , ) \ - LINE(AARCH64_RNG, rng, , , ) \ - LINE(AARCH64_BTI, bti, , , ) \ - LINE(AARCH64_MTE, mte, , , ) \ - LINE(AARCH64_ECV, ecv, , , ) \ - LINE(AARCH64_AFP, afp, , , ) \ - LINE(AARCH64_RPRES, rpres, , , ) -#define INTROSPECTION_PREFIX Aarch64 -#define INTROSPECTION_ENUM_PREFIX AARCH64 -#include "define_introspection.inl" - -//////////////////////////////////////////////////////////////////////////////// -// Implementation. -//////////////////////////////////////////////////////////////////////////////// +#include "impl_aarch64__base_implementation.inl" #include