mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
[Arm] Don't expose DotProd kernels, fix CMakeLists.txt
Don't define HAS_*_NEON_DOTPROD for 32-bit Arm platforms, since they are only defined in *_neon64.cc for now. Also define -DLIBYUV_NEON=1 and pass -mfpu=neon to *_neon.cc for 32-bit Arm platforms, since otherwise __ARM_NEON__ is not defined. Also fix a typo: ly_lib_static should be ly_lib_name in the name of the common object files. The existing code happens to work since they are defined to the same thing. Change-Id: Ibdc9e5d0391f7ff8db1ca83384e5bd45ac9950a2 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5439562 Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
parent
9d200b704f
commit
3af6cafe8d
@ -22,7 +22,6 @@ SET ( ly_common_source_files
|
|||||||
${ly_src_dir}/compare_common.cc
|
${ly_src_dir}/compare_common.cc
|
||||||
${ly_src_dir}/compare_gcc.cc
|
${ly_src_dir}/compare_gcc.cc
|
||||||
${ly_src_dir}/compare_msa.cc
|
${ly_src_dir}/compare_msa.cc
|
||||||
${ly_src_dir}/compare_neon.cc
|
|
||||||
${ly_src_dir}/compare_win.cc
|
${ly_src_dir}/compare_win.cc
|
||||||
${ly_src_dir}/convert_argb.cc
|
${ly_src_dir}/convert_argb.cc
|
||||||
${ly_src_dir}/convert.cc
|
${ly_src_dir}/convert.cc
|
||||||
@ -42,7 +41,6 @@ SET ( ly_common_source_files
|
|||||||
${ly_src_dir}/rotate_gcc.cc
|
${ly_src_dir}/rotate_gcc.cc
|
||||||
${ly_src_dir}/rotate_lsx.cc
|
${ly_src_dir}/rotate_lsx.cc
|
||||||
${ly_src_dir}/rotate_msa.cc
|
${ly_src_dir}/rotate_msa.cc
|
||||||
${ly_src_dir}/rotate_neon.cc
|
|
||||||
${ly_src_dir}/rotate_win.cc
|
${ly_src_dir}/rotate_win.cc
|
||||||
${ly_src_dir}/row_any.cc
|
${ly_src_dir}/row_any.cc
|
||||||
${ly_src_dir}/row_common.cc
|
${ly_src_dir}/row_common.cc
|
||||||
@ -50,7 +48,6 @@ SET ( ly_common_source_files
|
|||||||
${ly_src_dir}/row_lasx.cc
|
${ly_src_dir}/row_lasx.cc
|
||||||
${ly_src_dir}/row_lsx.cc
|
${ly_src_dir}/row_lsx.cc
|
||||||
${ly_src_dir}/row_msa.cc
|
${ly_src_dir}/row_msa.cc
|
||||||
${ly_src_dir}/row_neon.cc
|
|
||||||
${ly_src_dir}/row_rvv.cc
|
${ly_src_dir}/row_rvv.cc
|
||||||
${ly_src_dir}/row_win.cc
|
${ly_src_dir}/row_win.cc
|
||||||
${ly_src_dir}/scale_any.cc
|
${ly_src_dir}/scale_any.cc
|
||||||
@ -60,7 +57,6 @@ SET ( ly_common_source_files
|
|||||||
${ly_src_dir}/scale_gcc.cc
|
${ly_src_dir}/scale_gcc.cc
|
||||||
${ly_src_dir}/scale_lsx.cc
|
${ly_src_dir}/scale_lsx.cc
|
||||||
${ly_src_dir}/scale_msa.cc
|
${ly_src_dir}/scale_msa.cc
|
||||||
${ly_src_dir}/scale_neon.cc
|
|
||||||
${ly_src_dir}/scale_rgb.cc
|
${ly_src_dir}/scale_rgb.cc
|
||||||
${ly_src_dir}/scale_rvv.cc
|
${ly_src_dir}/scale_rvv.cc
|
||||||
${ly_src_dir}/scale_uv.cc
|
${ly_src_dir}/scale_uv.cc
|
||||||
@ -82,11 +78,23 @@ SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|||||||
# Build the set of objects that do not need to be compiled with flags to enable
|
# Build the set of objects that do not need to be compiled with flags to enable
|
||||||
# particular architecture features.
|
# particular architecture features.
|
||||||
ADD_LIBRARY( ${ly_lib_name}_common_objects OBJECT ${ly_common_source_files} )
|
ADD_LIBRARY( ${ly_lib_name}_common_objects OBJECT ${ly_common_source_files} )
|
||||||
SET(ly_lib_parts $<TARGET_OBJECTS:${ly_lib_static}_common_objects>)
|
SET(ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_common_objects>)
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
STRING(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" arch_lowercase)
|
STRING(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" arch_lowercase)
|
||||||
|
|
||||||
|
if(arch_lowercase STREQUAL "arm")
|
||||||
|
# Enable Arm Neon kernels.
|
||||||
|
ADD_DEFINITIONS(-DLIBYUV_NEON=1)
|
||||||
|
ADD_LIBRARY(${ly_lib_name}_neon OBJECT
|
||||||
|
${ly_src_dir}/compare_neon.cc
|
||||||
|
${ly_src_dir}/rotate_neon.cc
|
||||||
|
${ly_src_dir}/row_neon.cc
|
||||||
|
${ly_src_dir}/scale_neon.cc)
|
||||||
|
TARGET_COMPILE_OPTIONS(${ly_lib_name}_neon PRIVATE -mfpu=neon)
|
||||||
|
LIST(APPEND ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_neon>)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(arch_lowercase STREQUAL "aarch64")
|
if(arch_lowercase STREQUAL "aarch64")
|
||||||
# Enable AArch64 Neon dot-product and i8mm kernels.
|
# Enable AArch64 Neon dot-product and i8mm kernels.
|
||||||
ADD_LIBRARY(${ly_lib_name}_neon64 OBJECT
|
ADD_LIBRARY(${ly_lib_name}_neon64 OBJECT
|
||||||
|
|||||||
@ -421,9 +421,7 @@ extern "C" {
|
|||||||
#define HAS_ABGRTOUVJROW_NEON
|
#define HAS_ABGRTOUVJROW_NEON
|
||||||
#define HAS_ABGRTOUVROW_NEON
|
#define HAS_ABGRTOUVROW_NEON
|
||||||
#define HAS_ABGRTOYJROW_NEON
|
#define HAS_ABGRTOYJROW_NEON
|
||||||
#define HAS_ABGRTOYJROW_NEON_DOTPROD
|
|
||||||
#define HAS_ABGRTOYROW_NEON
|
#define HAS_ABGRTOYROW_NEON
|
||||||
#define HAS_ABGRTOYROW_NEON_DOTPROD
|
|
||||||
#define HAS_AR64TOARGBROW_NEON
|
#define HAS_AR64TOARGBROW_NEON
|
||||||
#define HAS_ARGB1555TOARGBROW_NEON
|
#define HAS_ARGB1555TOARGBROW_NEON
|
||||||
#define HAS_ARGB1555TOUVROW_NEON
|
#define HAS_ARGB1555TOUVROW_NEON
|
||||||
@ -445,15 +443,12 @@ extern "C" {
|
|||||||
#define HAS_ARGBTOUVJROW_NEON
|
#define HAS_ARGBTOUVJROW_NEON
|
||||||
#define HAS_ARGBTOUVROW_NEON
|
#define HAS_ARGBTOUVROW_NEON
|
||||||
#define HAS_ARGBTOYJROW_NEON
|
#define HAS_ARGBTOYJROW_NEON
|
||||||
#define HAS_ARGBTOYJROW_NEON_DOTPROD
|
|
||||||
#define HAS_ARGBTOYROW_NEON
|
#define HAS_ARGBTOYROW_NEON
|
||||||
#define HAS_ARGBTOYROW_NEON_DOTPROD
|
|
||||||
#define HAS_AYUVTOUVROW_NEON
|
#define HAS_AYUVTOUVROW_NEON
|
||||||
#define HAS_AYUVTOVUROW_NEON
|
#define HAS_AYUVTOVUROW_NEON
|
||||||
#define HAS_AYUVTOYROW_NEON
|
#define HAS_AYUVTOYROW_NEON
|
||||||
#define HAS_BGRATOUVROW_NEON
|
#define HAS_BGRATOUVROW_NEON
|
||||||
#define HAS_BGRATOYROW_NEON
|
#define HAS_BGRATOYROW_NEON
|
||||||
#define HAS_BGRATOYROW_NEON_DOTPROD
|
|
||||||
#define HAS_BYTETOFLOATROW_NEON
|
#define HAS_BYTETOFLOATROW_NEON
|
||||||
#define HAS_CONVERT16TO8ROW_NEON
|
#define HAS_CONVERT16TO8ROW_NEON
|
||||||
#define HAS_COPYROW_NEON
|
#define HAS_COPYROW_NEON
|
||||||
@ -517,9 +512,7 @@ extern "C" {
|
|||||||
#define HAS_RGB565TOYROW_NEON
|
#define HAS_RGB565TOYROW_NEON
|
||||||
#define HAS_RGBATOUVROW_NEON
|
#define HAS_RGBATOUVROW_NEON
|
||||||
#define HAS_RGBATOYJROW_NEON
|
#define HAS_RGBATOYJROW_NEON
|
||||||
#define HAS_RGBATOYJROW_NEON_DOTPROD
|
|
||||||
#define HAS_RGBATOYROW_NEON
|
#define HAS_RGBATOYROW_NEON
|
||||||
#define HAS_RGBATOYROW_NEON_DOTPROD
|
|
||||||
#define HAS_SETROW_NEON
|
#define HAS_SETROW_NEON
|
||||||
#define HAS_SPLITARGBROW_NEON
|
#define HAS_SPLITARGBROW_NEON
|
||||||
#define HAS_SPLITRGBROW_NEON
|
#define HAS_SPLITRGBROW_NEON
|
||||||
@ -558,6 +551,17 @@ extern "C" {
|
|||||||
#define HAS_SOBELYROW_NEON
|
#define HAS_SOBELYROW_NEON
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// The following are available on AArch64 platforms:
|
||||||
|
#if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__)
|
||||||
|
#define HAS_ABGRTOYJROW_NEON_DOTPROD
|
||||||
|
#define HAS_ABGRTOYROW_NEON_DOTPROD
|
||||||
|
#define HAS_ARGBTOYJROW_NEON_DOTPROD
|
||||||
|
#define HAS_ARGBTOYROW_NEON_DOTPROD
|
||||||
|
#define HAS_BGRATOYROW_NEON_DOTPROD
|
||||||
|
#define HAS_RGBATOYJROW_NEON_DOTPROD
|
||||||
|
#define HAS_RGBATOYROW_NEON_DOTPROD
|
||||||
|
#endif
|
||||||
|
|
||||||
// The following are available on AArch64 SVE platforms:
|
// The following are available on AArch64 SVE platforms:
|
||||||
#if !defined(LIBYUV_DISABLE_SVE) && defined(__aarch64__)
|
#if !defined(LIBYUV_DISABLE_SVE) && defined(__aarch64__)
|
||||||
#define HAS_I444TOARGBROW_SVE2
|
#define HAS_I444TOARGBROW_SVE2
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user