Skip to content

chore(pasta): lazy point x86-64 assembly experiment - #237

Draft
TalDerei wants to merge 3 commits into
pasta-x86-64-asmfrom
pasta-lazy-point-asm-experiment
Draft

chore(pasta): lazy point x86-64 assembly experiment#237
TalDerei wants to merge 3 commits into
pasta-x86-64-asmfrom
pasta-lazy-point-asm-experiment

Conversation

@TalDerei

@TalDerei TalDerei commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Stacks on #222.

Adds lazy x86-64 Pasta point arithmetic: additions improve 0.5–1.7%, but doubling slows 4–5%, scalar multiplication 1%, and GLV 2.2–2.4%.


Screenshot 2026-08-27 at 3 24 01 PM

ValarDragon and others added 3 commits August 27, 2026 14:52
* Share the portable Pasta field squaring primitive

Move the identical pure-Rust wide-squaring routine used by Fp and Fq into a private limb-array helper. Each field retains its existing Montgomery reduction and all other arithmetic paths.

* Use the low-half squaring reduction on x86-64

Cancel the low half of portable square products before adding the high half, matching the dependency shape of the Apple assembly implementation. Select this path only on x86-64; other architectures retain their existing classical reduction, and multiplication is untouched.

* Skip corrections within portable squaring chains

Keep portable repeated-squaring accumulators below twice the field modulus and canonicalize only at the end of a chain. Specialize the x86-64 lazy reducer for the shared Pasta modulus shape, while retaining the Apple AArch64 assembly paths.
@TalDerei TalDerei self-assigned this Aug 27, 2026
@TalDerei TalDerei changed the title chore(pasta): lazy point asm experiment chore(pasta): lazy point x86-64 assembly experiment Aug 27, 2026
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.

2 participants