From 41dd733ca7123c9ac4bfc6c781697a660e95b052 Mon Sep 17 00:00:00 2001 From: Can Celik Date: Sat, 4 Apr 2026 19:22:04 +0300 Subject: feat: finish ghostty pane backend integration --- vendor/libghostty-vt/src/simd/index_of.cpp | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 vendor/libghostty-vt/src/simd/index_of.cpp (limited to 'vendor/libghostty-vt/src/simd/index_of.cpp') diff --git a/vendor/libghostty-vt/src/simd/index_of.cpp b/vendor/libghostty-vt/src/simd/index_of.cpp new file mode 100644 index 00000000..b070ae3b --- /dev/null +++ b/vendor/libghostty-vt/src/simd/index_of.cpp @@ -0,0 +1,53 @@ +// Generates code for every target that this compiler can support. +#undef HWY_TARGET_INCLUDE +#define HWY_TARGET_INCLUDE "simd/index_of.cpp" // this file +#include // must come before highway.h +#include + +#include + +#include + +HWY_BEFORE_NAMESPACE(); +namespace ghostty { +namespace HWY_NAMESPACE { + +namespace hn = hwy::HWY_NAMESPACE; + +size_t IndexOf(const uint8_t needle, + const uint8_t* HWY_RESTRICT input, + size_t count) { + const hn::ScalableTag d; + return IndexOfImpl(d, needle, input, count); +} + +} // namespace HWY_NAMESPACE +} // namespace ghostty +HWY_AFTER_NAMESPACE(); + +// HWY_ONCE is true for only one of the target passes +#if HWY_ONCE + +namespace ghostty { + +// This macro declares a static array used for dynamic dispatch. +HWY_EXPORT(IndexOf); + +size_t IndexOf(const uint8_t needle, + const uint8_t* HWY_RESTRICT input, + size_t count) { + return HWY_DYNAMIC_DISPATCH(IndexOf)(needle, input, count); +} + +} // namespace ghostty + +extern "C" { + +size_t ghostty_simd_index_of(const uint8_t needle, + const uint8_t* HWY_RESTRICT input, + size_t count) { + return ghostty::IndexOf(needle, input, count); +} +} + +#endif // HWY_ONCE -- cgit v1.2.3