Skip to content

Perf: vectorised element-wise buffer loops keeping per-element atomicity (#226) - #270

Merged
b-re-w merged 1 commit into
developfrom
feat/tp-vec-atomic
Oct 25, 2026
Merged

b-re-w merged 1 commit into
developfrom
feat/tp-vec-atomic

Conversation

@b-re-w

@b-re-w b-re-w commented Oct 24, 2026

Copy link
Copy Markdown
Member

Closes #226

On aarch64, a proven x[i] = f(...) loop over F64 buffers uses inline-asm ldr/str q helpers (precise Q operands, volatile, no C-level non-atomic access), 4 elements per step; per-element single-copy atomicity from Arm ARM DDI 0487 B2.2.1 (64-bit aligned 128-bit SIMD access = two single-copy atomic 64-bit accesses; alignment checked by tp_buf_enter). x86-64 stays scalar (Intel SDM guarantees only up to an aligned quadword). Design note records the per-target argument (the B2.2.1 wording is to be checked against the manual revision).

Scale kernel, one run, load 8.7 (not quiet): plain 0.684 ms, atomic scalar 0.853 ms (1.25x), new 0.646 ms (0.94x). Mutant (plain C store in the helper) fails the guard test. Tests: test_buffer_arrays 61, test_runtime 264, test_cgen 59, test_eval_breaker 8 passed. Merge held for the macOS runner freeze.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant