mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
Experimental SVE FMMLA detect
Detect if arm cpu support FMMLA instruction Bug: None Change-Id: Ia7b83bf2735ddeeb8a85da44177e708c34e4b1fb
This commit is contained in:
parent
500f45652c
commit
f39d0b21a5
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user