Commit Graph

47 Commits

Author SHA1 Message Date
Mitchell Hashimoto
f3f9af6129 pkg/highway: vendor and modify to remain all libc usage 2026-04-23 20:28:43 -07:00
Mitchell Hashimoto
e51de8b58f libghostty: Remove all libc++ and libc++ ABI dependencies
This updates simdutf to my fork which has a SIMDUTF_NO_LIBCXX option
that removes all libc++ and libc++ ABI dependencies. 

From there, the hand-written simd code we have has been updated to also
no longer use any libc++ features. Part of this required removing utfcpp
since it depended on libc++ (`<iterator>`).

libghostty-vt now only depends on libc.
2026-04-15 10:27:05 -07:00
Mitchell Hashimoto
3e6a65f73f pkg/highway: drop libc++ from vendored hwy
The vendored Highway package was being built with libc++ even though
Ghostty only uses its runtime target selection and dispatch support.
That pulled in extra C++ runtime baggage from upstream support files
such as abort, timer, print, and benchmark helpers.

Build Highway in HWY_NO_LIBCXX mode, only compile the target dispatch
sources we actually need, and compile Ghostty's SIMD translation units
with the same define so the header ABI stays consistent. Replace the
upstream abort implementation with a small local bridge that provides
Highway's Warn/Abort hooks and the target-query shim without depending
on libc++.

This keeps the Highway archive down to the dispatch pieces Ghostty
uses while preserving the existing dynamic dispatch behavior. The
bridge is documented so it is clear why Ghostty carries this small
local replacement.
2026-04-11 14:28:56 -07:00
Mitchell Hashimoto
afa8f059e5 build: skip linkLibCpp on MSVC targets
Zig's bundled libc++/libc++abi conflicts with the MSVC C++ runtime
headers (vcruntime_typeinfo.h, vcruntime_exception.h, etc.) when
targeting native-native-msvc. This caused compilation failures in
the SIMD C++ code due to -nostdinc++ suppressing MSVC headers and
libc++ types clashing with MSVC runtime types.

Skip linkLibCpp() for MSVC targets across all packages (highway,
simdutf, utfcpp) and the main build (SharedDeps, GhosttyZig) since
MSVC provides its own C++ standard library natively. Also add
missing <iterator> and <cstddef> includes that were previously
pulled in transitively through libc++ headers but are not
guaranteed by MSVC's headers.
2026-03-23 11:57:14 -07:00
Mitchell Hashimoto
dbfc3eb679 Remove unused imports 2025-11-27 13:37:53 -08:00
Qwerasd
6d5b4a3426 perf: replace std.debug.assert with inlined version
See doc comment in `quirks.zig` for reasoning
2025-11-17 12:13:56 -07:00
Jacob Sandlund
c2a9c5ee5b fix comment 2025-09-23 09:48:09 -04:00
Jacob Sandlund
b01770c21c Merge remote-tracking branch 'upstream/main' into jacob/uucode 2025-09-23 09:36:41 -04:00
Mitchell Hashimoto
8477b6a21a simd: scalar base64 ignores invalid padding 2025-09-22 09:44:58 -07:00
Mitchell Hashimoto
530633b9e9 simd: fix scalar utf8 decoding 2025-09-22 09:29:08 -07:00
Mitchell Hashimoto
6893024c51 simd: add scalar fallbacks to all for build_options.simd false 2025-09-22 08:26:53 -07:00
Jacob Sandlund
cf3b514efc pr feedback: get, remove todos for case_folding_simple 2025-09-19 01:24:13 -04:00
Jacob Sandlund
6bd5da7354 update commented out test 2025-09-18 14:24:24 -04:00
Jacob Sandlund
2af08bdbe3 trying a bunch of things to get performance to match 2025-09-06 10:42:02 -04:00
Jacob Sandlund
e84d8535f5 removing all ziglyph imports (aside from unicode/grapheme.zig) 2025-08-17 21:24:27 -04:00
Mitchell Hashimoto
601acf4059 pkg/highway: upgrade to fix compilation issues on LLVM18 2025-03-12 11:03:54 -07:00
Mitchell Hashimoto
29de3e80f1 config: yeet usingns 2024-08-16 10:49:37 -07:00
Mitchell Hashimoto
27acd71105 simd: add base64 functions from simdutf 2024-07-16 20:12:45 -07:00
Mitchell Hashimoto
4e2502c11e simd/codepoint-width: assertions for avx512 padding 2024-02-07 15:23:43 -08:00
Mitchell Hashimoto
e5c7d4e3ee simd: increase padding for avx 2024-02-07 14:43:08 -08:00
Mitchell Hashimoto
ae74117269 simd: use less vector ops for 16-bit 2024-02-07 14:31:06 -08:00
Mitchell Hashimoto
a69d3c7f1c simd/codepoint-width: split by 16-bit 2024-02-07 14:04:48 -08:00
Mitchell Hashimoto
17dc64053e terminal: swap codepointwidth implementations 2024-02-07 09:38:17 -08:00
Mitchell Hashimoto
3c31217f3c simd: minor tweaks 2024-02-07 09:28:56 -08:00
Mitchell Hashimoto
46a887578a simd: remove ziglyph fallback 2024-02-07 09:21:33 -08:00
Mitchell Hashimoto
697fbe21ec simd/codepoint-width: reinclude correct file 2024-02-07 09:18:02 -08:00
Mitchell Hashimoto
d949f1bd84 simd/codepoint-width: match ziglyph 2024-02-07 09:11:02 -08:00
Mitchell Hashimoto
88d81602fa simd/codepoint-width: wip 2024-02-06 22:28:26 -08:00
Mitchell Hashimoto
fdc67a08f4 terminal: add tests for incomplete utf-8, fix one bug 2024-02-06 08:45:41 -08:00
Mitchell Hashimoto
120273aa1a pkg/utfcpp 2024-02-05 21:22:27 -08:00
Mitchell Hashimoto
626d4170fe move simdutf to a pkg 2024-02-05 21:22:27 -08:00
Mitchell Hashimoto
12885a445a simd: remove old attempts 2024-02-05 21:22:27 -08:00
Mitchell Hashimoto
50e7159288 simd: implement utf8 decode until esc in C++ 2024-02-05 21:22:27 -08:00
Mitchell Hashimoto
c751619b7e terminal: use highway-based indexOf to support all targets 2024-02-05 21:22:26 -08:00
Mitchell Hashimoto
4fa3ea604b simd/aarch64: additional intrinsics 2024-02-05 21:22:04 -08:00
Mitchell Hashimoto
c042b052b2 simd: convert indexOf, mess around with simdvt 2024-02-05 21:22:04 -08:00
Mitchell Hashimoto
a66174678b simd: utf decode using simdutf 2024-02-05 21:22:04 -08:00
Mitchell Hashimoto
9391048e1a simd: utf8 decode 2024-02-05 21:22:04 -08:00
Mitchell Hashimoto
fe098f80cc simd: simplify isa.funcMap, find Zig compiler bug 2024-02-05 21:22:04 -08:00
Mitchell Hashimoto
1e51cedd94 simd: isa.funcMap to ensure only possible ISAs are analyzed 2024-02-05 21:22:04 -08:00
Mitchell Hashimoto
6523721846 simd: utf8 count 2024-02-05 21:22:04 -08:00
Mitchell Hashimoto
5b295cf6e2 simd: only ref buildable decls 2024-02-05 21:22:03 -08:00
Mitchell Hashimoto
e682cea911 simd/utf8: document neon better 2024-02-05 21:22:03 -08:00
Mitchell Hashimoto
987c5d213e simd: utf8 validation 2024-02-05 21:22:03 -08:00
Mitchell Hashimoto
dc041f86fd src/simd: improve isa detection 2024-02-05 21:22:03 -08:00
Mitchell Hashimoto
7feba12eab simd: indexOf implementation using NEON 2024-02-05 21:22:03 -08:00
Mitchell Hashimoto
31d5785105 simd: basic ISA detection, boilerplate 2024-02-05 21:22:03 -08:00