From 23d416d6f32539bc7e44afa2bec6ce0128dbed0b Mon Sep 17 00:00:00 2001 From: Frank Barchard Date: Mon, 31 Mar 2025 16:37:34 -0700 Subject: [PATCH] Detect SME without SVE dependency Bug: None Change-Id: Ibe29488e893a493699ea3fae1a1a54a4fff5969c Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/6418571 Reviewed-by: Wan-Teh Chang --- README.chromium | 2 +- include/libyuv/version.h | 2 +- source/cpu_id.cc | 13 +++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.chromium b/README.chromium index 46ed8e341..52aa1fb5b 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: https://chromium.googlesource.com/libyuv/libyuv/ -Version: 1907 +Version: 1908 License: BSD-3-Clause License File: LICENSE Shipped: yes diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 2b72bc4e2..e4f992117 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 1907 +#define LIBYUV_VERSION 1908 #endif // INCLUDE_LIBYUV_VERSION_H_ diff --git a/source/cpu_id.cc b/source/cpu_id.cc index daa8e2b95..0e0740b41 100644 --- a/source/cpu_id.cc +++ b/source/cpu_id.cc @@ -209,12 +209,13 @@ LIBYUV_API SAFEBUFFERS int AArch64CpuCaps(unsigned long hwcap, features |= kCpuHasSVE; if (hwcap2 & YUV_AARCH64_HWCAP2_SVE2) { features |= kCpuHasSVE2; - if (hwcap2 & YUV_AARCH64_HWCAP2_SME) { - features |= kCpuHasSME; - if (hwcap2 & YUV_AARCH64_HWCAP2_SME2) { - features |= kCpuHasSME2; - } - } + } + } + // SME may be present without SVE + if (hwcap2 & YUV_AARCH64_HWCAP2_SME) { + features |= kCpuHasSME; + if (hwcap2 & YUV_AARCH64_HWCAP2_SME2) { + features |= kCpuHasSME2; } } }