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

Rework towering #148

Merged
merged 19 commits into from
Feb 6, 2021
Merged

Rework towering #148

merged 19 commits into from
Feb 6, 2021

Conversation

mratsim
Copy link
Owner

@mratsim mratsim commented Feb 6, 2021

This PR revamps towering:

  • Performance:

    • towering proc handle aliasing internally, for example a.inv(a) or a.prod(a, b) will work
      without saving a as a temporary. This required an extra temporary internally but it is 1/2 the size for quadratic extensions or 1/3 for cubic extensions
    • The fancy greek letters for non-residue have been removed
    • There is no more distinction between the towering non-residue and sextic twist non-residue
      since sextic twist is chosen to allow an efficient towering
    • No more Fp2, Fp, Fp6 as return value, those are too big and lead to bad codegen.
    • pairing is now 28% faster on BLS12-381
    • before
      image
    • after
      image
  • Organization:

    • extensions fields are now in a single file, this might help Nim with avoiding creating quintillion of proc definition when we have quadratic->cubic->quadratic Concepts building on each other: duplicated procs in C codegen nim-lang/Nim#13982. This might also help the C compiler with inline and deduplication without using --icf or -lto. This might also reduce Nim compilation times since all definitions are in a single file.
    • procs now have a clear internal and exported sections within consistent {.push inline.}/{.pop.} section

@mratsim mratsim linked an issue Feb 6, 2021 that may be closed by this pull request
@mratsim mratsim merged commit c312210 into master Feb 6, 2021
@mratsim mratsim deleted the drop-out-of-place-proc branch February 7, 2021 08:47
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.

Out-of-place functions lead to bad codegen
1 participant