Skip to content

Commit 820f3d7

Browse files
joyeecheungv8-scoped@luci-project-accounts.iam.gserviceaccount.com
authored andcommitted
[simd] Disable SVE implementation of array search for older ClangCL
The Microsoft C++ ABI mangler in older ClangCL cannot mangle these built-ins. Disable SVE in this case. Refs: llvm/llvm-project#196170 Refs: nodejs/node#65161 Change-Id: I35e49dd4bfc0617bfa31cb7e3af1a475b4fb1bef Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8420284 Reviewed-by: Leszek Swirski <[email protected]> Commit-Queue: Joyee Cheung <[email protected]> Cr-Commit-Position: refs/heads/main@{#109945}
1 parent 8324ee4 commit 820f3d7

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎src/objects/simd.cc‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,11 @@ uintptr_t fast_search_avx(T* array, uintptr_t array_len, uintptr_t index,
349349
#endif // ifdef __SSE3__
350350

351351
// When built with other toolchains, do not count on it to expose
352-
// __builtin_sve_* on a per-function basis. Fallback to Neon.
353-
#if defined(NEON64) && defined(__clang__)
352+
// __builtin_sve_* on a per-function basis. Clang only supports
353+
// mangling SVE types with the Microsoft C++ ABI since version 21.
354+
// Fallback to Neon in cases where SVE is not supported.
355+
#if defined(NEON64) && defined(__clang__) && \
356+
(!defined(V8_TARGET_OS_WIN) || __clang_major__ >= 21)
354357
#define V8_ENABLE_SIMD_SVE 1
355358

356359
template <typename ScalarType>
@@ -631,7 +634,8 @@ TARGET_SVE inline uintptr_t fast_search_sve(T* array, uintptr_t array_len,
631634
return no_match;
632635
}
633636

634-
#endif // defined(NEON64) && defined(__clang__)
637+
#endif // defined(NEON64) && defined(__clang__) &&
638+
// (!defined(V8_TARGET_OS_WIN) || __clang_major__ >= 21)
635639

636640
#undef IS_CLANG_WIN
637641
#undef VECTORIZED_LOOP_Neon

0 commit comments

Comments
 (0)