diff --git a/include/libyuv/cpu_id.h b/include/libyuv/cpu_id.h index bdb81174c..9ae1d719e 100644 --- a/include/libyuv/cpu_id.h +++ b/include/libyuv/cpu_id.h @@ -28,8 +28,9 @@ static const int kCpuHasNeonDotProd = 0x200; static const int kCpuHasNeonI8MM = 0x400; static const int kCpuHasSVE = 0x800; static const int kCpuHasSVE2 = 0x1000; -static const int kCpuHasSME = 0x2000; -static const int kCpuHasSME2 = 0x4000; +static const int kCpuHasSVEF32MM = 0x2000; +static const int kCpuHasSME = 0x4000; +static const int kCpuHasSME2 = 0x8000; // These flags are only valid on RISCV processors. static const int kCpuHasRISCV = 0x4; diff --git a/source/cpu_id.cc b/source/cpu_id.cc index dd5813a6c..535c4e9e9 100644 --- a/source/cpu_id.cc +++ b/source/cpu_id.cc @@ -185,6 +185,7 @@ LIBYUV_API SAFEBUFFERS int ArmCpuCaps(const char* cpuinfo_name) { #define YUV_AARCH64_HWCAP_ASIMDDP (1UL << 20) #define YUV_AARCH64_HWCAP_SVE (1UL << 22) #define YUV_AARCH64_HWCAP2_SVE2 (1UL << 1) +#define YUV_AARCH64_HWCAP2_SVEF32MM (1UL << 10) #define YUV_AARCH64_HWCAP2_I8MM (1UL << 13) #define YUV_AARCH64_HWCAP2_SME (1UL << 23) #define YUV_AARCH64_HWCAP2_SME2 (1UL << 37) @@ -207,6 +208,9 @@ LIBYUV_API SAFEBUFFERS int AArch64CpuCaps(unsigned long hwcap, features |= kCpuHasNeonI8MM; if (hwcap & YUV_AARCH64_HWCAP_SVE) { features |= kCpuHasSVE; + if (hwcap2 & YUV_AARCH64_HWCAP2_SVEF32MM) { + features |= kCpuHasSVEF32MM; + } if (hwcap2 & YUV_AARCH64_HWCAP2_SVE2) { features |= kCpuHasSVE2; } diff --git a/unit_test/cpu_test.cc b/unit_test/cpu_test.cc index 8feaeb9e6..80186de7a 100644 --- a/unit_test/cpu_test.cc +++ b/unit_test/cpu_test.cc @@ -100,6 +100,7 @@ TEST_F(LibYUVBaseTest, TestCpuHas) { int has_neon_i8mm = TestCpuFlag(kCpuHasNeonI8MM); int has_sve = TestCpuFlag(kCpuHasSVE); int has_sve2 = TestCpuFlag(kCpuHasSVE2); + int has_sve_f32mm = TestCpuFlag(kCpuHasSVEF32MM); int has_sme = TestCpuFlag(kCpuHasSME); int has_sme2 = TestCpuFlag(kCpuHasSME2); printf("Has Arm 0x%x\n", has_arm); @@ -108,6 +109,7 @@ TEST_F(LibYUVBaseTest, TestCpuHas) { printf("Has Neon I8MM 0x%x\n", has_neon_i8mm); printf("Has SVE 0x%x\n", has_sve); printf("Has SVE2 0x%x\n", has_sve2); + printf("Has SVE F32MM 0x%x\n", has_sve_f32mm); printf("Has SME 0x%x\n", has_sme); printf("Has SME2 0x%x\n", has_sme2); diff --git a/util/cpuid.c b/util/cpuid.c index 68bdbb142..38b2c0e9d 100644 --- a/util/cpuid.c +++ b/util/cpuid.c @@ -60,6 +60,7 @@ int main(int argc, const char* argv[]) { int has_neon_i8mm = TestCpuFlag(kCpuHasNeonI8MM); int has_sve = TestCpuFlag(kCpuHasSVE); int has_sve2 = TestCpuFlag(kCpuHasSVE2); + int has_sve_f32mm = TestCpuFlag(kCpuHasSVEF32MM); int has_sme = TestCpuFlag(kCpuHasSME); int has_sme2 = TestCpuFlag(kCpuHasSME2); printf("Has Arm 0x%x\n", has_arm); @@ -68,6 +69,7 @@ int main(int argc, const char* argv[]) { printf("Has Neon I8MM 0x%x\n", has_neon_i8mm); printf("Has SVE 0x%x\n", has_sve); printf("Has SVE2 0x%x\n", has_sve2); + printf("Has SVE F32MM 0x%x\n", has_sve_f32mm); printf("Has SME 0x%x\n", has_sme); printf("Has SME2 0x%x\n", has_sme2);