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

Precomputed tables instead of C++-compiler generated? #15

Open
sipa opened this issue Jun 10, 2019 · 0 comments
Open

Precomputed tables instead of C++-compiler generated? #15

sipa opened this issue Jun 10, 2019 · 0 comments

Comments

@sipa
Copy link
Owner

sipa commented Jun 10, 2019

The linear mapping tables for squaring/squarerooting/solving x^2+x+a/converting between field representations are currently all encoded very compactly in the C++ code, and get expanded at compile time (through constexpr) into full lookup tables.

Given that the compact encoding (mapping of every power-of-two) is already generated using Sage code, and we have little hope of avoiding that, I wonder if we shouldn't drop the whole constexpr construction, and instead generate the full expanded tables directly in Sage. That would massively increase the source code size, but probably cut down compilation times too (and perhaps enable a few small optimizations too).

One reason to not do this is if we'd want to make the layout of the tables dynamic (for example, we realize that on certain hardware constructing the table using 6-bit lookups is sufficiently suboptimal that we want to use a different layout there). If the tables are stored in expanded form, that would require duplicating the tables.

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

No branches or pull requests

1 participant