Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add BabyBear and KoalaBear 31bits fields vanilla Go impl #558

Merged
merged 40 commits into from
Dec 10, 2024

Conversation

gbotrel
Copy link
Collaborator

@gbotrel gbotrel commented Nov 25, 2024

Description

Adds 31bit fields support (i.e. template generate Golang code with uint32).

Perf work and vectorization (AVX, NEON) to come in future PRs.

		{"koalabear", "0x7f000001"}, // 2^31 - 2^24 + 1 ==> the cube map (x -> x^3) is an automorphism of the multiplicative group
		{"babybear", "0x78000001"},  // 2^31 - 2^27 + 1 ==> 2-adicity 27

Unit benchmarks are misleading; while it does seem that koalabear.Mul is slightly slower than goldilocks.Mul , the code generated by the compiler is as compact as it could be (with no branch) and is 50 to 70% more performant when inlined in vector ops for example.

@gbotrel gbotrel requested review from Tabaie and yelhousni November 25, 2024 20:26
Base automatically changed from perf/v2_arm64 to master December 10, 2024 14:36
@gbotrel gbotrel requested a review from Tabaie December 10, 2024 14:44
@gbotrel gbotrel merged commit 77d62f9 into master Dec 10, 2024
5 checks passed
@gbotrel gbotrel deleted the experiment/31bits branch December 10, 2024 19:00
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