<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div id="spnEditorContent"><p style="margin: 0;">Hi Hari,</p><p style="margin: 0;"><br></p><p style="margin: 0;">The new version looks good, thank you.</p><p style="margin: 0;"><br></p><p style="margin: 0;">Regards,</p><p style="margin: 0;">Chen</p></div><pre>At 2024-08-01 17:29:01, "Hari Limaye" <hari.limaye@arm.com> wrote:
>Hi Chen,
>
>Thank you for reviewing the SAD patches.
>
>I am putting this patch up to handle emitting warnings for platforms
>where compile time feature detection is not implemented - as this is
>currently true for all the existing find_package(*) scripts for AArch64
>feature detection.
>
>Note: this patch is based on the `AArch64 SAD/SADxN Optimisations`
>stack.
>
>Many thanks,
>Hari
>
>---
>As compile time feature detection for AArch64 platforms is currently
>only supported on Linux and Darwin platforms, emit a warning message
>when compiling for any other platform.
>---
> source/CMakeLists.txt | 41 ++++++++++++++++++++++++-----------------
> 1 file changed, 24 insertions(+), 17 deletions(-)
>
>diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
>index 8288fd234..55e4926c6 100755
>--- a/source/CMakeLists.txt
>+++ b/source/CMakeLists.txt
>@@ -265,25 +265,32 @@ if(GCC)
> set(CPU_HAS_NEON 1)
> add_definitions(-DX265_ARCH_ARM64=1 -DHAVE_NEON=1)
>
>- # Handle cross-compilation options.
>- if(CROSS_COMPILE_NEON_DOTPROD)
>- set(CPU_HAS_NEON_DOTPROD 1)
>- endif()
>- if(CROSS_COMPILE_SVE)
>- set(CPU_HAS_SVE 1)
>- # We impose the constraint that SVE implies Neon DotProd.
>- set(CPU_HAS_NEON_DOTPROD 1)
>- endif()
>- if(CROSS_COMPILE_SVE2)
>- set(CPU_HAS_SVE2 1)
>- # SVE2 implies SVE and Neon DotProd.
>- set(CPU_HAS_SVE 1)
>- set(CPU_HAS_NEON_DOTPROD 1)
>+ if(CROSS_COMPILE_ARM64)
>+ # Handle cross-compilation options.
>+ if(CROSS_COMPILE_NEON_DOTPROD)
>+ set(CPU_HAS_NEON_DOTPROD 1)
>+ endif()
>+ if(CROSS_COMPILE_SVE)
>+ set(CPU_HAS_SVE 1)
>+ # We impose the constraint that SVE implies Neon DotProd.
>+ set(CPU_HAS_NEON_DOTPROD 1)
>+ endif()
>+ if(CROSS_COMPILE_SVE2)
>+ set(CPU_HAS_SVE2 1)
>+ # SVE2 implies SVE and Neon DotProd.
>+ set(CPU_HAS_SVE 1)
>+ set(CPU_HAS_NEON_DOTPROD 1)
>+ endif()
>+ else()
>+ if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
>+ find_package(NEON_DOTPROD)
>+ find_package(SVE)
>+ find_package(SVE2)
>+ else()
>+ message(STATUS "Compile time feature detection unsupported on this platform")
>+ endif()
> endif()
>
>- find_package(NEON_DOTPROD)
>- find_package(SVE)
>- find_package(SVE2)
> if(CPU_HAS_NEON_DOTPROD)
> # Neon DotProd is mandatory from Armv8.4.
> message(STATUS "Found Neon DotProd")
>--
>2.42.1
>
</pre></div>