From 425c86179791cd32e2d4ce0ae7f269940b4b0663 Mon Sep 17 00:00:00 2001 From: Can Celik Date: Thu, 10 Sep 2026 21:51:57 +0300 Subject: chore: upgrade libghostty and preserve terminal behavior (#3906) --- vendor/libghostty-vt/src/simd/main.zig | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'vendor/libghostty-vt/src/simd/main.zig') diff --git a/vendor/libghostty-vt/src/simd/main.zig b/vendor/libghostty-vt/src/simd/main.zig index aabdd21d..8a3f0067 100644 --- a/vendor/libghostty-vt/src/simd/main.zig +++ b/vendor/libghostty-vt/src/simd/main.zig @@ -9,6 +9,18 @@ pub const index_of = @import("index_of.zig"); pub const vt = @import("vt.zig"); pub const codepointWidth = codepoint_width.codepointWidth; +/// The number of vector lanes to use for manually vectorized hot +/// loops operating on elements of type T, or null if the target has +/// no usable SIMD support and a plain scalar loop should be used +/// instead (e.g. wasm32 without simd128). +/// +/// This is twice the native vector width so that each iteration works +/// two vector registers, giving better instruction-level parallelism. +pub fn lanes(comptime T: type) ?comptime_int { + const native = std.simd.suggestVectorLength(T) orelse return null; + return native * 2; +} + test { @import("std").testing.refAllDecls(@This()); } -- cgit v1.2.3