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

src: added intel assembly for sha algs #208

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

edtubbs
Copy link
Collaborator

@edtubbs edtubbs commented Mar 5, 2024

  • Updated SHA256/SHA512 algorithms using Intel AVX/SSE assembly.
  • Updated CMake and Makefile for AVX/SSE, NASM and assembly support.
  • Added benchmarks for SHA256 and Scrypt with assembly optimizations.
  • Added AVX/SSE and benchmark configuration options.

Copy link
Member

@xanimo xanimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only nit so far is to add bench to .gitignore

Copy link
Member

@xanimo xanimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything looks good to me with exception to adding bench to .gitignore. i'll ack after that. pretty stoked to get benchmarks in here! here are my results:
https://gist.github.com/xanimo/017c64171781eca50d0df497a3c637f7

@edtubbs edtubbs force-pushed the 0.1.4-dev-sha-assembly branch from 3a77fb5 to 529f3d2 Compare March 19, 2024 01:50
Copy link
Member

@xanimo xanimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not entirely sure what's going on here but have included output when building with --enable-intel-sse:

/bin/bash ./libtool  --tag=CC   --mode=link gcc -I./include -I./src/logdb/include -fPIC   -g -O2 -W -std=gnu99 -pedantic -Wall -Wextra -Wno-long-long -Wno-overlength-strings -msse4.2 -static  -o such src/cli/such-such.o libdogecoin.la src/secp256k1/libsecp256k1.la src/intel/sse_t1/sha1_one_block_sse.o src/intel/sse_t1/sha256_one_block_sse.o src/intel/sse_t1/sha512_one_block_sse.o -levent_core  -lunistring
libtool: link: gcc -I./include -I./src/logdb/include -fPIC -g -O2 -W -std=gnu99 -pedantic -Wall -Wextra -Wno-long-long -Wno-overlength-strings -msse4.2 -o such src/cli/such-such.o src/intel/sse_t1/sha1_one_block_sse.o src/intel/sse_t1/sha256_one_block_sse.o src/intel/sse_t1/sha512_one_block_sse.o  ./.libs/libdogecoin.a src/secp256k1/.libs/libsecp256k1.a -levent_core -lunistring
gcc: error: src/intel/sse_t1/sha1_one_block_sse.o: No such file or directory
gcc: error: src/intel/sse_t1/sha256_one_block_sse.o: No such file or directory
gcc: error: src/intel/sse_t1/sha512_one_block_sse.o: No such file or directory
make[1]: *** [Makefile:1234: such] Error 1
make[1]: Leaving directory '/mnt/source/repos/libdogecoin'
make: *** [Makefile:2469: all-recursive] Error 1

Building avx2 and scrypt-sse2 work fine but as soon as I purge the dir and run the process over something is not going right.

cmake: added avx/sse, nasm and assembly
cmake: added bench
config: added avx2/sse options
config: added bench
make: added avx/sse, nasm and assembly
sha2: added assembly function definitions
sha2: added sha256_one_block_avx/sse to sha256_transform
sha2: added sha512_one_block_avx/sse to sha512_transform
src: added bench for sha256 and scrypt
git: added bench to git ignore
@edtubbs edtubbs force-pushed the 0.1.4-dev-sha-assembly branch from 529f3d2 to 4d077c1 Compare March 19, 2024 20:51
Copy link
Member

@xanimo xanimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xanimo xanimo merged commit c5c3c40 into dogecoinfoundation:0.1.4-dev Mar 21, 2024
15 checks passed
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