File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -496,14 +496,31 @@ else()
496496 set_target_properties (${TORQUE_APP_NAME} PROPERTIES LINK_FLAGS "-Wl,-rpath,./" )
497497endif ()
498498
499+ string (TOLOWER "${CMAKE_SYSTEM_PROCESSOR } " ARCH)
500+
501+ set (IS_X86 FALSE )
502+ set (IS_ARM FALSE )
503+
504+ if (ARCH MATCHES "x86_64|amd64|i[3-6]86" )
505+ set (IS_X86 TRUE )
506+ elseif (ARCH MATCHES "arm64|aarch64" )
507+ set (IS_ARM TRUE )
508+ endif ()
509+
510+ # always available
499511add_math_backend (scalar MATH_SIMD_SCALAR )
500- add_math_backend (sse2 MATH_SIMD_SSE2 )
501- add_math_backend (sse41 MATH_SIMD_SSE41 )
502- add_math_backend (avx MATH_SIMD_AVX )
503- add_math_backend (avx2 MATH_SIMD_AVX2 )
504- # Only on ARM
505- if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64" )
506- add_math_backend (neon MATH_SIMD_NEON )
512+
513+ # x86 family
514+ if (IS_X86)
515+ add_math_backend (sse2 MATH_SIMD_SSE2 )
516+ add_math_backend (sse41 MATH_SIMD_SSE41 )
517+ add_math_backend (avx MATH_SIMD_AVX )
518+ add_math_backend (avx2 MATH_SIMD_AVX2 )
519+ endif ()
520+
521+ # ARM family
522+ if (IS_ARM)
523+ add_math_backend (neon MATH_SIMD_NEON )
507524endif ()
508525
509526if (MSVC )
You can’t perform that action at this time.
0 commit comments