From 7633ab2c60b40bd5aa67ef391b2a0d149685742f Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 14:10:31 +0300 Subject: Optimize screen scrolling, SIMD wrap padding, and reflow loops - Batch full-screen scroll rotations, eliminating row-by-row scroll loops - Use block memmove for sub-region scrolling, eliminating heap/stack row swaps - Vectorize CELL_WRAP_PAD flag setting with AVX2/SSE2/NEON in screen.h - Replace scalar tab-stop loops with 64-bit word stamping - Optimize active row backwards scan in resize and erase mode 2 --- src/selection.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/selection.c') diff --git a/src/selection.c b/src/selection.c index 0eda34f..b05a43c 100644 --- a/src/selection.c +++ b/src/selection.c @@ -187,8 +187,7 @@ static const struct cell *line_seg_cells(const struct lines *L, uint64_t id, int if (got < L->cols) { fill_cells(buf + got, L->cols - got, TERM_COLOR_FG, TERM_COLOR_BG); if (wrapped) - for (int x = got; x < L->cols; x++) - buf[x].flags |= CELL_WRAP_PAD; + set_cells_wrap_pad(buf + got, L->cols - got); } if (out_wrapped) *out_wrapped = wrapped; @@ -678,8 +677,7 @@ static char *range_text_inner(const struct term *t, if (got < t->cols) { fill_cells(row_buf + got, t->cols - got, TERM_COLOR_FG, TERM_COLOR_BG); if (row_wrapped) - for (int x = got; x < t->cols; x++) - row_buf[x].flags |= CELL_WRAP_PAD; + set_cells_wrap_pad(row_buf + got, t->cols - got); } cells = row_buf; } -- cgit v1.2.3