LoongArch: Add SHA-2 assembly implementation for better performance by HeliC829 · Pull Request #27904 · openssl/openssl · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

LoongArch: Add SHA-2 assembly implementation for better performance #27904

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

HeliC829
Copy link
Contributor

This PR adds SHA-2 assembly implementation for loongarch platforms.
For SHA-256, assembly implementation gets about 20%~ better performance than compiler-generated code.
For SHA-512, assembly implementation also gets a better performance on small-size data, and inot worse on large-size data.
Please see benchmark results below for more details.

Special thanks to @loongson-community/1024 for providing the testing 3A6000 machine.

Benchmark result:

For SHA-256:

Implementation 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes
C Compiled 33057.89 83904.60 156370.43 199317.66 216331.61 217732.44
Assembly 40331.31 101350.10 193465.11 248759.30 271461.03 274240.85
C Compiled 100% 100% 100% 100% 100% 100%
Assembly 122.00% 120.79% 123.72% 124.81% 125.48% 125.95%

For SHA-512:

Implementation 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes
C Compiled 32301.50 127619.16 236190.38 354342.57 412707.50 417704.62
Assembly 33834.43 135554.35 239562.67 357283.50 417139.37 421915.31
C Compiled 100% 100% 100% 100% 100% 100%
Assembly 104.75% 106.22% 101.43% 100.83% 101.07% 101.01%

HeliC829 added 2 commits June 26, 2025 14:19
It can get about 25%~ better performance than compiler-generated code (gcc version 15.1.1).

Signed-off-by: Julian Zhu <jz531210@gmail.com>
… on small-size data

Signed-off-by: Julian Zhu <jz531210@gmail.com>
@github-actions github-actions bot added the severity: fips change The pull request changes FIPS provider sources label Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity: fips change The pull request changes FIPS provider sources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.