diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-15 13:04:01 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-15 13:04:01 +0300 |
| commit | dcebf9c7f954a55350b68d0ead1935612c4e2e05 (patch) | |
| tree | 3eb3e9f6154c6760bcb89a565f8ddc8f8b66cb90 /src/text_run.c | |
| parent | bd8222e615134c3ec5e7a07b6b1fa97c9bd4a471 (diff) | |
Rename the library to wsap_vtcore
ncurses installs <term.h> and defines struct term. In a file that
includes both headers, an ncurses TERMINAL * and this library's terminal
are silently the same type. The name wsap_vtcore avoids the clash.
The public header is now <wsap_vtcore/wsap_vtcore.h>. Every global
symbol uses the wsap_vtcore_ prefix, every macro uses WSAP_VTCORE_, and
the shared library is libwsap_vtcore.so.0. The default terminal name is
now "wsap_vtcore". The ISA override variable is WSAP_VTCORE_ISA.
No other behavior changes. The amalgamation writes wsap_vtcore.c and
wsap_vtcore.h.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Diffstat (limited to 'src/text_run.c')
| -rw-r--r-- | src/text_run.c | 180 |
1 files changed, 90 insertions, 90 deletions
diff --git a/src/text_run.c b/src/text_run.c index c48b73e..872c8de 100644 --- a/src/text_run.c +++ b/src/text_run.c @@ -10,16 +10,16 @@ static uint8_t unicode_fast_class[65536]; static int8_t unicode_width_bmp[65536]; /* Runs of code points with one fast class, for the AVX-512 width cache. */ -#define TERM_WIDTH_RUNS_MAX 1024 -static uint16_t width_run_lo[TERM_WIDTH_RUNS_MAX]; -static uint16_t width_run_hi[TERM_WIDTH_RUNS_MAX]; -static uint8_t width_run_class[TERM_WIDTH_RUNS_MAX]; +#define WSAP_VTCORE_WIDTH_RUNS_MAX 1024 +static uint16_t width_run_lo[WSAP_VTCORE_WIDTH_RUNS_MAX]; +static uint16_t width_run_hi[WSAP_VTCORE_WIDTH_RUNS_MAX]; +static uint8_t width_run_class[WSAP_VTCORE_WIDTH_RUNS_MAX]; static int width_run_count; -void term_text_tables_init(void) +void wsap_vtcore_text_tables_init(void) { for (uint32_t cp = 0; cp < 65536; cp++) { - int w = term_unicode_width(cp); + int w = wsap_vtcore_unicode_width(cp); unicode_fast_class[cp] = (w == 1 || w == 2) && !cluster_contextual(cp) ? (uint8_t)w : 0; unicode_width_bmp[cp] = (int8_t)w; @@ -28,7 +28,7 @@ void term_text_tables_init(void) uint8_t k = unicode_fast_class[cp]; uint32_t lo = cp; while (cp < 65536 && unicode_fast_class[cp] == k) cp++; - if (width_run_count == TERM_WIDTH_RUNS_MAX) { + if (width_run_count == WSAP_VTCORE_WIDTH_RUNS_MAX) { width_run_count = 0; break; } @@ -39,7 +39,7 @@ void term_text_tables_init(void) } } -static TERM_MAYBE_UNUSED int width_run_find(uint32_t cp) +static WSAP_VTCORE_MAYBE_UNUSED int width_run_find(uint32_t cp) { int lo = 0, hi = width_run_count - 1; while (lo < hi) { @@ -50,24 +50,24 @@ static TERM_MAYBE_UNUSED int width_run_find(uint32_t cp) return width_run_count > 0 ? lo : -1; } -static TERM_MAYBE_UNUSED uint16_t width_cache_covers(const struct width_cache *wc, +static WSAP_VTCORE_MAYBE_UNUSED uint16_t width_cache_covers(const struct width_cache *wc, const uint32_t *cp) { uint16_t covered = 0; for (int l = 0; l < 16; l++) { bool hit = false; - for (int k = 0; k < TERM_WIDTH_SLOTS; k++) + for (int k = 0; k < WSAP_VTCORE_WIDTH_SLOTS; k++) hit |= cp[l] - wc->lo[k] <= wc->span[k]; covered |= (uint16_t)(hit << l); } return covered; } -static TERM_MAYBE_UNUSED bool width_cache_extend(struct width_cache *wc, const uint32_t *cp, +static WSAP_VTCORE_MAYBE_UNUSED bool width_cache_extend(struct width_cache *wc, const uint32_t *cp, uint16_t covered) { unsigned miss = (unsigned)~covered & 0xFFFFu; - int r = width_run_find(cp[miss ? term_ctz32(miss) : 0]); + int r = width_run_find(cp[miss ? wsap_vtcore_ctz32(miss) : 0]); if (r < 0) return false; uint8_t k = width_run_class[r]; if (k != 1 && k != 2) return false; @@ -77,25 +77,25 @@ static TERM_MAYBE_UNUSED bool width_cache_extend(struct width_cache *wc, const u wc->klass = k; wc->next = 0; } - for (int added = 0; added < TERM_WIDTH_SLOTS; added++) { + for (int added = 0; added < WSAP_VTCORE_WIDTH_SLOTS; added++) { wc->lo[wc->next] = width_run_lo[r]; wc->span[wc->next] = (uint32_t)(width_run_hi[r] - width_run_lo[r]); - wc->next = (uint8_t)((wc->next + 1) % TERM_WIDTH_SLOTS); + wc->next = (uint8_t)((wc->next + 1) % WSAP_VTCORE_WIDTH_SLOTS); covered = width_cache_covers(wc, cp); if (covered == 0xFFFF) return true; - r = width_run_find(cp[term_ctz32((unsigned)~covered & 0xFFFFu)]); + r = width_run_find(cp[wsap_vtcore_ctz32((unsigned)~covered & 0xFFFFu)]); if (r < 0 || width_run_class[r] != k) return false; } return false; } -int term_text_class(uint32_t cp) +int wsap_vtcore_text_class(uint32_t cp) { - assert(term_tables_ready()); - return TERM_EXPECT(cp < 65536, 1) ? (int)unicode_width_bmp[cp] : term_unicode_width(cp); + assert(wsap_vtcore_tables_ready()); + return WSAP_VTCORE_EXPECT(cp < 65536, 1) ? (int)unicode_width_bmp[cp] : wsap_vtcore_unicode_width(cp); } -#if defined(TERM_KERNEL_AVX512) +#if defined(WSAP_VTCORE_KERNEL_AVX512) static const uint8_t utf8_3byte_shuffle[64] = { 2, 1, 0, 48, 5, 4, 3, 48, 8, 7, 6, 48, 11, 10, 9, 48, @@ -122,7 +122,7 @@ static const uint8_t utf8_3byte_want[64] = { }; #define UTF8_3BYTE_SPAN 0x0000FFFFFFFFFFFFull -TERM_TARGET_AVX512 +WSAP_VTCORE_TARGET_AVX512 static inline __m512i utf8_3byte_decode(__m512i packed) { __m512i b2 = _mm512_and_si512(packed, _mm512_set1_epi32(0x003F)); @@ -132,70 +132,70 @@ static inline __m512i utf8_3byte_decode(__m512i packed) } struct width_ranges { - __m512i lo[TERM_WIDTH_SLOTS]; - __m512i span[TERM_WIDTH_SLOTS]; + __m512i lo[WSAP_VTCORE_WIDTH_SLOTS]; + __m512i span[WSAP_VTCORE_WIDTH_SLOTS]; }; -TERM_TARGET_AVX512 +WSAP_VTCORE_TARGET_AVX512 static inline struct width_ranges width_ranges_load(const struct width_cache *wc) { struct width_ranges r; - for (int k = 0; k < TERM_WIDTH_SLOTS; k++) { + for (int k = 0; k < WSAP_VTCORE_WIDTH_SLOTS; k++) { r.lo[k] = _mm512_set1_epi32((int)wc->lo[k]); r.span[k] = _mm512_set1_epi32((int)wc->span[k]); } return r; } -TERM_TARGET_AVX512 +WSAP_VTCORE_TARGET_AVX512 static inline __mmask16 width_ranges_cover(const struct width_ranges *r, __m512i cps) { __mmask16 covered = 0; - for (int k = 0; k < TERM_WIDTH_SLOTS; k++) + for (int k = 0; k < WSAP_VTCORE_WIDTH_SLOTS; k++) covered |= _mm512_cmple_epu32_mask(_mm512_sub_epi32(cps, r->lo[k]), r->span[k]); return covered; } -TERM_TARGET_AVX512 +WSAP_VTCORE_TARGET_AVX512 static inline void store_wide_cells(uint64_t * restrict dst, __m512i base, __m512i cps) { -#define TERM_WIDE_PAIR(k) _mm512_storeu_si512((void *)(dst + 8 * (k)), \ +#define WSAP_VTCORE_WIDE_PAIR(k) _mm512_storeu_si512((void *)(dst + 8 * (k)), \ _mm512_mask_permutexvar_epi32(base, 0x0101, \ _mm512_setr_epi32((k) * 2, 0, 0, 0, 0, 0, 0, 0, \ (k) * 2 + 1, 0, 0, 0, 0, 0, 0, 0), cps)) - TERM_WIDE_PAIR(0); TERM_WIDE_PAIR(1); TERM_WIDE_PAIR(2); TERM_WIDE_PAIR(3); - TERM_WIDE_PAIR(4); TERM_WIDE_PAIR(5); TERM_WIDE_PAIR(6); TERM_WIDE_PAIR(7); -#undef TERM_WIDE_PAIR + WSAP_VTCORE_WIDE_PAIR(0); WSAP_VTCORE_WIDE_PAIR(1); WSAP_VTCORE_WIDE_PAIR(2); WSAP_VTCORE_WIDE_PAIR(3); + WSAP_VTCORE_WIDE_PAIR(4); WSAP_VTCORE_WIDE_PAIR(5); WSAP_VTCORE_WIDE_PAIR(6); WSAP_VTCORE_WIDE_PAIR(7); +#undef WSAP_VTCORE_WIDE_PAIR } -TERM_TARGET_AVX512 +WSAP_VTCORE_TARGET_AVX512 static inline void store_narrow_cells(uint64_t * restrict dst, __m512i base, __m512i cps) { -#define TERM_NARROW_QUAD(k) _mm512_storeu_si512((void *)(dst + 8 * (k)), \ +#define WSAP_VTCORE_NARROW_QUAD(k) _mm512_storeu_si512((void *)(dst + 8 * (k)), \ _mm512_mask_permutexvar_epi32(base, 0x1111, \ _mm512_setr_epi32((k) * 4, 0, 0, 0, (k) * 4 + 1, 0, 0, 0, \ (k) * 4 + 2, 0, 0, 0, (k) * 4 + 3, 0, 0, 0), cps)) - TERM_NARROW_QUAD(0); TERM_NARROW_QUAD(1); TERM_NARROW_QUAD(2); TERM_NARROW_QUAD(3); -#undef TERM_NARROW_QUAD + WSAP_VTCORE_NARROW_QUAD(0); WSAP_VTCORE_NARROW_QUAD(1); WSAP_VTCORE_NARROW_QUAD(2); WSAP_VTCORE_NARROW_QUAD(3); +#undef WSAP_VTCORE_NARROW_QUAD } /* Both cell and history writers validate and classify the same UTF-8 block. */ -TERM_TARGET_AVX512 +WSAP_VTCORE_TARGET_AVX512 static inline bool classify_3byte_block(__m512i in, struct width_ranges *ranges, struct width_cache *wc, __m512i *cps) { - if (TERM_EXPECT(_mm512_test_epi8_mask( + if (WSAP_VTCORE_EXPECT(_mm512_test_epi8_mask( _mm512_xor_si512(in, _mm512_loadu_si512(utf8_3byte_want)), _mm512_loadu_si512(utf8_3byte_bits)) & UTF8_3BYTE_SPAN, 0)) return false; *cps = utf8_3byte_decode(_mm512_permutexvar_epi8(_mm512_loadu_si512(utf8_3byte_shuffle), in)); - if (_mm512_cmplt_epu32_mask(*cps, _mm512_set1_epi32((int)TERM_UTF8_3BYTE_MIN)) || + if (_mm512_cmplt_epu32_mask(*cps, _mm512_set1_epi32((int)WSAP_VTCORE_UTF8_3BYTE_MIN)) || _mm512_cmple_epu32_mask( - _mm512_sub_epi32(*cps, _mm512_set1_epi32((int)TERM_UTF8_SURROGATE_LO)), - _mm512_set1_epi32((int)(TERM_UTF8_SURROGATE_HI - TERM_UTF8_SURROGATE_LO)))) + _mm512_sub_epi32(*cps, _mm512_set1_epi32((int)WSAP_VTCORE_UTF8_SURROGATE_LO)), + _mm512_set1_epi32((int)(WSAP_VTCORE_UTF8_SURROGATE_HI - WSAP_VTCORE_UTF8_SURROGATE_LO)))) return false; __mmask16 covered = width_ranges_cover(ranges, *cps); - if (TERM_EXPECT(covered != 0xFFFF || wc->klass == 0, 0)) { + if (WSAP_VTCORE_EXPECT(covered != 0xFFFF || wc->klass == 0, 0)) { uint32_t cp[16]; _mm512_storeu_si512(cp, *cps); if (!width_cache_extend(wc, cp, covered)) return false; @@ -204,8 +204,8 @@ static inline bool classify_3byte_block(__m512i in, struct width_ranges *ranges, return true; } -TERM_TARGET_AVX512 -static TERM_NOINLINE int +WSAP_VTCORE_TARGET_AVX512 +static WSAP_VTCORE_NOINLINE int decode_3byte_blocks(uint64_t * restrict dst, const char * restrict buf, int len, int cols_left, __m512i base_wide_pair, __m512i base_narrow_quad, struct width_cache * restrict wc, @@ -241,8 +241,8 @@ decode_3byte_blocks(uint64_t * restrict dst, const char * restrict buf, int len, /* decode_3byte_blocks() that writes the history format: a narrow block * copies its 48 bytes, a wide block puts 0xF5 before each character. */ -TERM_TARGET_AVX512 -static TERM_NOINLINE int +WSAP_VTCORE_TARGET_AVX512 +static WSAP_VTCORE_NOINLINE int text_3byte_blocks(uint8_t * restrict dst, const char * restrict buf, int len, int cols_left, struct width_cache * restrict wc, int * restrict out_cols, int * restrict out_bytes, bool * restrict wide, uint32_t * restrict last_cp) @@ -286,19 +286,19 @@ text_3byte_blocks(uint8_t * restrict dst, const char * restrict buf, int len, in } #endif -struct text_run_bytes term_text_run_bytes(uint8_t *restrict dst, const char *restrict buf, int len, +struct text_run_bytes wsap_vtcore_text_run_bytes(uint8_t *restrict dst, const char *restrict buf, int len, int max_cols, uint32_t last, struct width_cache *restrict wc) { - if (TERM_EXPECT(last == 0x200D || term_grapheme_is_handle(last), 0)) + if (WSAP_VTCORE_EXPECT(last == 0x200D || wsap_vtcore_grapheme_is_handle(last), 0)) return (struct text_run_bytes){ .last = last, .narrow = true }; - /* Unlike term_text_run(), this fills up to the edge and up to the end of + /* Unlike wsap_vtcore_text_run(), this fills up to the edge and up to the end of * buf: the cells path writes those characters one by one with the same * result, and a text row should not settle for them. */ int i = 0, cx = 0, o = 0, chars = 0; bool wide = false, narrow = true; (void)wc; -#if defined(TERM_KERNEL_AVX512) - bool blocks = term_use_avx512(); +#if defined(WSAP_VTCORE_KERNEL_AVX512) + bool blocks = wsap_vtcore_use_avx512(); #endif while (i < len && cx < max_cols) { unsigned char c = (unsigned char)buf[i]; @@ -316,7 +316,7 @@ struct text_run_bytes term_text_run_bytes(uint8_t *restrict dst, const char *res } if (c < 0x20) break; -#if defined(TERM_KERNEL_AVX512) +#if defined(WSAP_VTCORE_KERNEL_AVX512) if ((c & UTF8_LEAD3_MASK) == UTF8_LEAD3_TAG && len - i >= 48 && max_cols - cx >= 32 && ((unsigned char)buf[i + 21] & UTF8_LEAD3_MASK) == UTF8_LEAD3_TAG && blocks) { int cols, bytes; @@ -335,10 +335,10 @@ struct text_run_bytes term_text_run_bytes(uint8_t *restrict dst, const char *res } #endif uint32_t cp; - int bytes = term_utf8_decode_one(buf + i, (size_t)(len - i), &cp); + int bytes = wsap_vtcore_utf8_decode_one(buf + i, (size_t)(len - i), &cp); if (!bytes) break; - int w = bytes < 4 ? unicode_fast_class[cp] : term_text_class(cp); + int w = bytes < 4 ? unicode_fast_class[cp] : wsap_vtcore_text_class(cp); if (w <= 0 || (bytes == 4 && can_extend_cluster(last, cp, w)) || cx + w > max_cols) break; if (w == 2) { @@ -356,8 +356,8 @@ struct text_run_bytes term_text_run_bytes(uint8_t *restrict dst, const char *res return (struct text_run_bytes){ i, cx, o, chars, last, wide, narrow }; } -#if defined(TERM_KERNEL_AVX512) -TERM_TARGET_AVX512 +#if defined(WSAP_VTCORE_KERNEL_AVX512) +WSAP_VTCORE_TARGET_AVX512 static inline __m512i wide_pair_base(uint32_t fg, uint32_t bg, uint32_t flags) { return _mm512_setr_epi32( @@ -367,7 +367,7 @@ static inline __m512i wide_pair_base(uint32_t fg, uint32_t bg, uint32_t flags) 0, fg, bg, (flags & ~CELL_WIDE) | CELL_TRAIL); } -TERM_TARGET_AVX512 +WSAP_VTCORE_TARGET_AVX512 static inline int try_3byte_blocks(uint64_t * restrict dst, const char * restrict buf, int len, int cols_left, uint32_t fg, uint32_t bg, uint32_t flags, struct width_cache * restrict wc, @@ -384,7 +384,7 @@ static inline int try_3byte_blocks(uint64_t * restrict dst, const char * restric } /* Two wide cells side by side: cp and next_cp. */ -TERM_TARGET_AVX512 +WSAP_VTCORE_TARGET_AVX512 static inline void store_wide_pair(uint64_t *dst, uint32_t fg, uint32_t bg, uint32_t flags, uint32_t cp, uint32_t next_cp) { @@ -457,14 +457,14 @@ static inline uint64_t *store_cell_wide(uint64_t * restrict dst, return dst + 4; } -#if defined(TERM_KERNEL_AVX2) +#if defined(WSAP_VTCORE_KERNEL_AVX2) /* * Decode runs of 3-byte UTF-8 four code points at a time. A quad stops the * run when a byte is not a 3-byte sequence, a code point is overlong or a * surrogate, or a code point has no fast width class. The scalar loop then * handles that code point, so both paths store the same cells. */ -TERM_TARGET_AVX2 +WSAP_VTCORE_TARGET_AVX2 static inline int decode_3byte_quads(uint64_t **dst_io, const char *buf, int len, int cols_left, const struct cell_bases *b, int *out_cols, uint32_t *last) @@ -493,9 +493,9 @@ static inline int decode_3byte_quads(uint64_t **dst_io, const char *buf, int len _mm_and_si128(_mm_srli_epi32(packed, 2), _mm_set1_epi32(0x0FC0))), _mm_and_si128(_mm_srli_epi32(packed, 4), _mm_set1_epi32(0xF000))); __m128i bad = _mm_or_si128( - _mm_cmplt_epi32(cps, _mm_set1_epi32((int)TERM_UTF8_3BYTE_MIN)), + _mm_cmplt_epi32(cps, _mm_set1_epi32((int)WSAP_VTCORE_UTF8_3BYTE_MIN)), _mm_cmpeq_epi32(_mm_and_si128(cps, _mm_set1_epi32(0xF800)), - _mm_set1_epi32((int)TERM_UTF8_SURROGATE_LO))); + _mm_set1_epi32((int)WSAP_VTCORE_UTF8_SURROGATE_LO))); if (_mm_movemask_epi8(bad)) break; alignas(16) uint32_t cp[4]; @@ -523,14 +523,14 @@ static inline int decode_3byte_quads(uint64_t **dst_io, const char *buf, int len /* One body for every level. isa is a constant in each copy below, so each * copy keeps only its own kernels. */ -static inline TERM_ALWAYS_INLINE struct text_run_result +static inline WSAP_VTCORE_ALWAYS_INLINE struct text_run_result text_run_body(struct cell *restrict row, const char *restrict buf, int len, int max_cols, uint32_t fg, uint32_t bg, uint32_t flags, uint32_t last, struct width_cache *restrict wc, int isa) { int i = 0; int cx = 0; - if (TERM_EXPECT(last == 0x200D || term_grapheme_is_handle(last), 0)) + if (WSAP_VTCORE_EXPECT(last == 0x200D || wsap_vtcore_grapheme_is_handle(last), 0)) return (struct text_run_result){0, 0, last}; const struct cell_bases bases = cell_bases_make(fg, bg, flags); @@ -538,8 +538,8 @@ text_run_body(struct cell *restrict row, const char *restrict buf, int len, int (void)wc; (void)isa; -#if defined(TERM_KERNEL_AVX512) - if (isa == TERM_ISA_AVX512) { +#if defined(WSAP_VTCORE_KERNEL_AVX512) + if (isa == WSAP_VTCORE_ISA_AVX512) { int cols; i += try_3byte_blocks(dst, buf, len, max_cols, fg, bg, flags, wc, &cols, &last); cx += cols; @@ -563,8 +563,8 @@ text_run_body(struct cell *restrict row, const char *restrict buf, int len, int cx++; i++; } -#if defined(TERM_KERNEL_AVX512) - if (isa == TERM_ISA_AVX512 && ascii_at == 0) { +#if defined(WSAP_VTCORE_KERNEL_AVX512) + if (isa == WSAP_VTCORE_ISA_AVX512 && ascii_at == 0) { int cols; i += try_3byte_blocks(dst, buf + i, len - i, max_cols - cx, fg, bg, flags, wc, &cols, &last); @@ -579,9 +579,9 @@ text_run_body(struct cell *restrict row, const char *restrict buf, int len, int break; } -#if defined(TERM_KERNEL_AVX2) - if (isa == TERM_ISA_AVX2 && - TERM_EXPECT((c & UTF8_LEAD3_MASK) == UTF8_LEAD3_TAG && i + 16 <= len && +#if defined(WSAP_VTCORE_KERNEL_AVX2) + if (isa == WSAP_VTCORE_ISA_AVX2 && + WSAP_VTCORE_EXPECT((c & UTF8_LEAD3_MASK) == UTF8_LEAD3_TAG && i + 16 <= len && ((unsigned char)buf[i + 9] & UTF8_LEAD3_MASK) == UTF8_LEAD3_TAG, 0)) { int cols; int used = decode_3byte_quads(&dst, buf + i, len - i, max_cols - cx, @@ -593,14 +593,14 @@ text_run_body(struct cell *restrict row, const char *restrict buf, int len, int } #endif uint32_t cp; - int bytes = term_utf8_decode_one(buf + i, (size_t)(len - i), &cp); + int bytes = wsap_vtcore_utf8_decode_one(buf + i, (size_t)(len - i), &cp); if (!bytes) break; - int w = bytes < 4 ? unicode_fast_class[cp] : term_text_class(cp); + int w = bytes < 4 ? unicode_fast_class[cp] : wsap_vtcore_text_class(cp); if (w <= 0 || (bytes == 4 && can_extend_cluster(last, cp, w))) break; -#if defined(TERM_KERNEL_AVX512) - if (isa == TERM_ISA_AVX512 && bytes == 3 && w == 2 && i + 6 <= len && cx + 4 <= max_cols) { +#if defined(WSAP_VTCORE_KERNEL_AVX512) + if (isa == WSAP_VTCORE_ISA_AVX512 && bytes == 3 && w == 2 && i + 6 <= len && cx + 4 <= max_cols) { uint32_t next_cp; - if (term_utf8_decode_one(buf + i + 3, (size_t)(len - i - 3), &next_cp) == 3 && + if (wsap_vtcore_utf8_decode_one(buf + i + 3, (size_t)(len - i - 3), &next_cp) == 3 && unicode_fast_class[next_cp] == 2) { store_wide_pair(dst, fg, bg, flags, cp, next_cp); dst += 8; @@ -630,35 +630,35 @@ text_run_body(struct cell *restrict row, const char *restrict buf, int len, int struct width_cache *restrict wc #define TEXT_RUN_ARGS row, buf, len, max_cols, fg, bg, flags, last, wc -#if defined(TERM_KERNEL_AVX512) -TERM_TARGET_AVX512 -static TERM_NOINLINE struct text_run_result text_run_avx512(TEXT_RUN_PARAMS) +#if defined(WSAP_VTCORE_KERNEL_AVX512) +WSAP_VTCORE_TARGET_AVX512 +static WSAP_VTCORE_NOINLINE struct text_run_result text_run_avx512(TEXT_RUN_PARAMS) { - return text_run_body(TEXT_RUN_ARGS, TERM_ISA_AVX512); + return text_run_body(TEXT_RUN_ARGS, WSAP_VTCORE_ISA_AVX512); } #endif -#if defined(TERM_KERNEL_AVX2) -TERM_TARGET_AVX2 -static TERM_NOINLINE struct text_run_result text_run_avx2(TEXT_RUN_PARAMS) +#if defined(WSAP_VTCORE_KERNEL_AVX2) +WSAP_VTCORE_TARGET_AVX2 +static WSAP_VTCORE_NOINLINE struct text_run_result text_run_avx2(TEXT_RUN_PARAMS) { - return text_run_body(TEXT_RUN_ARGS, TERM_ISA_AVX2); + return text_run_body(TEXT_RUN_ARGS, WSAP_VTCORE_ISA_AVX2); } #endif -static TERM_NOINLINE struct text_run_result text_run_base(TEXT_RUN_PARAMS) +static WSAP_VTCORE_NOINLINE struct text_run_result text_run_base(TEXT_RUN_PARAMS) { - return text_run_body(TEXT_RUN_ARGS, TERM_ISA_BASE); + return text_run_body(TEXT_RUN_ARGS, WSAP_VTCORE_ISA_BASE); } -struct text_run_result term_text_run(TEXT_RUN_PARAMS) +struct text_run_result wsap_vtcore_text_run(TEXT_RUN_PARAMS) { -#if defined(TERM_KERNEL_AVX512) - if (term_use_avx512()) +#if defined(WSAP_VTCORE_KERNEL_AVX512) + if (wsap_vtcore_use_avx512()) return text_run_avx512(TEXT_RUN_ARGS); #endif -#if defined(TERM_KERNEL_AVX2) - if (term_use_avx2()) +#if defined(WSAP_VTCORE_KERNEL_AVX2) + if (wsap_vtcore_use_avx2()) return text_run_avx2(TEXT_RUN_ARGS); #endif return text_run_base(TEXT_RUN_ARGS); |
