From fcbe22c59c2a7aa462a0f51e148b6afb90bbe7d9 Mon Sep 17 00:00:00 2001 From: George Steed Date: Tue, 11 Jun 2024 16:12:52 +0100 Subject: [PATCH] [AArch64] Enable SME feature detection on Apple Silicon Check for availability of SME and SME2 by looking for the hw.optional.arm.FEAT_SME2 feature string in sysctlbyname. Non-streaming SVE is not supported but for our purposes the features can be treated as orthogonal since our SME code will only ever run in streaming mode. Change-Id: I7e9d242e0f581217b625d74c7c3b0c76a0fe03da Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5683128 Reviewed-by: Frank Barchard --- source/cpu_id.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/cpu_id.cc b/source/cpu_id.cc index a31e89cd6..e34a3a905 100644 --- a/source/cpu_id.cc +++ b/source/cpu_id.cc @@ -256,6 +256,9 @@ LIBYUV_API SAFEBUFFERS int AArch64CpuCaps() { features |= kCpuHasNeonDotProd; if (have_feature("hw.optional.arm.FEAT_I8MM")) { features |= kCpuHasNeonI8MM; + if (have_feature("hw.optional.arm.FEAT_SME2")) { + features |= kCpuHasSME; + } } } // No SVE feature detection available here at time of writing.