From dcfe11a7588fcd42471159453810abc9b7720a57 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Thu, 7 May 2026 18:29:21 +0300 Subject: build: update libghostty-vt vendor vendor ghostty 063ac3e and remove the musl libc++ link workaround. expose the new selection formatter and hyperlink uri apis for follow-up rendering work. add manual artifact validation for static linux builds. --- vendor/libghostty-vt/src/simd/index_of.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'vendor/libghostty-vt/src/simd/index_of.h') diff --git a/vendor/libghostty-vt/src/simd/index_of.h b/vendor/libghostty-vt/src/simd/index_of.h index 531af9f8..172c9357 100644 --- a/vendor/libghostty-vt/src/simd/index_of.h +++ b/vendor/libghostty-vt/src/simd/index_of.h @@ -7,8 +7,7 @@ #include -#include -#include +#include HWY_BEFORE_NAMESPACE(); namespace ghostty { @@ -16,12 +15,16 @@ namespace HWY_NAMESPACE { namespace hn = hwy::HWY_NAMESPACE; +// Sentinel value returned by IndexOfChunk when no match is found. +static constexpr size_t kNotFound = static_cast(-1); + // Return the index of the first occurrence of `needle` in `input`, where -// the input and needle are already loaded into vectors. +// the input and needle are already loaded into vectors. Returns kNotFound +// if no match is found. template > -std::optional IndexOfChunk(D d, - hn::Vec needle_vec, - hn::Vec input_vec) { +size_t IndexOfChunk(D d, + hn::Vec needle_vec, + hn::Vec input_vec) { // Compare the input vector with the needle vector. This produces // a vector where each lane is 0xFF if the corresponding lane in // `input_vec` is equal to the corresponding lane in `needle_vec`. @@ -32,9 +35,9 @@ std::optional IndexOfChunk(D d, // If we found a match, return the index into the input. if (pos >= 0) { - return std::optional(static_cast(pos)); + return static_cast(pos); } else { - return std::nullopt; + return kNotFound; } } @@ -58,8 +61,9 @@ size_t IndexOfImpl(D d, T needle, const T* HWY_RESTRICT input, size_t count) { for (; i + N <= count; i += N) { // Load the N elements from our input into a vector and check the chunk. const hn::Vec input_vec = hn::LoadU(d, input + i); - if (auto pos = IndexOfChunk(d, needle_vec, input_vec)) { - return i + pos.value(); + const size_t pos = IndexOfChunk(d, needle_vec, input_vec); + if (pos != kNotFound) { + return i + pos; } } -- cgit v1.2.3