Skip to content

fix: clobbered bp issue in assembly on e2 impl#32

Merged
ThomasPiellard merged 7 commits intodevelopfrom
fix/clobbered_bp
Mar 5, 2021
Merged

fix: clobbered bp issue in assembly on e2 impl#32
ThomasPiellard merged 7 commits intodevelopfrom
fix/clobbered_bp

Conversation

@gbotrel
Copy link
Copy Markdown
Collaborator

@gbotrel gbotrel commented Mar 4, 2021

No API changes in this PR. Since Go1.16, go vet notices when BP register is clobbered with a non-zero frame size. Assembly code now doesn't use BP in those settings.

  • updated to latest goff, with some minor refactoring on the asm code generation part.
  • refactored E2.Mul and E2.Square assembly impl for bn256 and bls381 to be almost identical
  • tried to not inline fp.Mul in assembly, to reduce code size. Behaves well on Intel, poorly on AMD, so reverted.
  • this PR results in minor perf improvements:

bn256:

benchmark               old ns/op     new ns/op     delta
BenchmarkPairing-8      531315        510955        -3.83%
BenchmarkE2Mul-8        58.0          51.2          -11.76%
BenchmarkE2Square-8     37.1          35.6          -3.86%

bls381:

benchmark               old ns/op     new ns/op     delta
BenchmarkPairing-8      791640        748398        -5.46%
BenchmarkE2Mul-8        108           106           -1.30%
BenchmarkE2Square-8     67.5          65.9          -2.49%

@gbotrel gbotrel requested a review from ThomasPiellard March 4, 2021 17:21
@ThomasPiellard ThomasPiellard merged commit 8346d8a into develop Mar 5, 2021
@gbotrel gbotrel deleted the fix/clobbered_bp branch March 15, 2021 23: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