[AArch64] Add missing "+i8mm" feature when building SME

FEAT_I8MM is not unconditionally enabled with -march=armv9-a since it
only becomes mandatory from Armv9.1-A, so explicitly specify it in both
BUILD.gn and CMakeLists.txt.

Also flip the order of +sve2+i8mm => +i8mm+sve2 to match occurrences
elsewhere.

Change-Id: I8c37580d3718f380b772cdb726d8c30bcd5b9e2c
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/6656718
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
George Steed 2025-06-13 09:06:02 +01:00 committed by Frank Barchard
parent 6f729fbe65
commit 1724c4be72
2 changed files with 4 additions and 4 deletions

View File

@ -254,7 +254,7 @@ if (libyuv_use_sve) {
public_configs = [ ":libyuv_config" ]
# SVE2 is an Armv9-A feature.
cflags = [ "-march=armv9-a+sve2+i8mm" ]
cflags = [ "-march=armv9-a+i8mm+sve2" ]
}
}
@ -271,7 +271,7 @@ if (libyuv_use_sme) {
public_configs = [ ":libyuv_config" ]
# SME is an Armv9-A feature.
cflags = [ "-march=armv9-a+sme" ]
cflags = [ "-march=armv9-a+i8mm+sme" ]
}
}

View File

@ -123,7 +123,7 @@ if(NOT MSVC)
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(OLD_CMAKE_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -march=armv9-a+sme")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -march=armv9-a+i8mm+sme")
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
# Check whether the compiler can compile SME functions; this fails
# with Clang for Windows.
@ -140,7 +140,7 @@ int main(void) { return 0; }
${ly_src_dir}/rotate_sme.cc
${ly_src_dir}/row_sme.cc
${ly_src_dir}/scale_sme.cc)
target_compile_options(${ly_lib_name}_sme PRIVATE -march=armv9-a+sme)
target_compile_options(${ly_lib_name}_sme PRIVATE -march=armv9-a+i8mm+sme)
list(APPEND ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_sme>)
else()
add_definitions(-DLIBYUV_DISABLE_SME)