cyb70289 commented on code in PR #14515:
URL: https://github.com/apache/arrow/pull/14515#discussion_r1005763894


##########
cpp/cmake_modules/SetupCxxFlags.cmake:
##########
@@ -496,14 +494,24 @@ if(ARROW_CPU_FLAG STREQUAL "armv8")
     endif()
     set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} ${ARROW_ARMV8_ARCH_FLAG}")
 
+    set(ARROW_HAVE_NEON ON)
     add_definitions(-DARROW_HAVE_NEON)
 
-    if(ARROW_ARMV8_ARCH_FLAG MATCHES "\\+crypto")
-      add_definitions(-DARROW_HAVE_ARMV8_CRYPTO)
-    endif()
-    # armv8.1+ implies crc support
-    if(ARROW_ARMV8_ARCH_FLAG MATCHES "armv8\\.[1-9]|\\+crc")
-      add_definitions(-DARROW_HAVE_ARMV8_CRC)
+    if(ARROW_SIMD_LEVEL MATCHES "SVE[0-9]*")
+      if(NOT ARROW_ARMV8_ARCH_FLAG MATCHES "\\+sve")
+        message(FATAL_ERROR "SIMD Level is set to ${ARROW_SIMD_LEVEL} but SVE 
is not enabled in compiler options. "
+                            "Add \"-DARROW_ARMV8_ARCH=armv8-a+sve\" to cmake 
command line to enable SVE."

Review Comment:
   I'm thinking about removing this cmake option `ARROW_ARMV8_ARCH`, and use 
only `ARROW_SIMD_LEVEL`.
   
https://github.com/apache/arrow/blob/master/cpp/cmake_modules/DefineOptions.cmake#L204
   
   `ARROW_ARMV8_ARCH` is append to `gcc -march=???`, it's only for Arm. x86 
doesn't need `-march` as x86 has compiler options for each feature, e.g., 
`-msse4.2`, `-mavx2`, etc, to enable specific SIMD instructions.
   But Arm doesn't have these compiler options, CPU features are set by 
`-march` only, e.g., `-march=armv8-a+sve`, `-march=armv8.2-a+crypto`, etc.
   Specify `-march` by cmake command line gives more flexibility, but looks 
most of the time it also introduces unnecessary complexity.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to