Implementation notes: amd64, saber214, crypto_hashblocks/sha256

Computer: saber214
Microarchitecture: amd64; Bulldozer (600f20)
Architecture: amd64
CPU ID: AuthenticAMD-00600f20-1789c3f5
SUPERCOP version: 20240625
Operation: crypto_hashblocks
Primitive: sha256
TimeObject sizeTest sizeImplementationCompilerBenchmark dateSUPERCOP version
2873811113 0 021894 776 800inplacegcc_-march=native_-mtune=native_-O2_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
2901111201 0 021942 776 800refgcc_-march=native_-mtune=native_-O2_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
2976911325 0 020865 752 768refgcc_-march=native_-mtune=native_-Os_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
2978411193 0 020721 752 768inplacegcc_-march=native_-mtune=native_-Os_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
2991111690 0 023934 776 800inplacegcc_-march=native_-mtune=native_-O3_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
3006211919 0 024126 776 800refgcc_-march=native_-mtune=native_-O3_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
3163911657 0 022221 768 800inplacegcc_-march=native_-mtune=native_-O_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
3173811485 0 021300 816 728inplaceclang_-march=native_-O_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
3194711515 0 021332 816 728refclang_-march=native_-O_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
3203011749 0 022285 768 800refgcc_-march=native_-mtune=native_-O_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
3230911650 0 022716 816 728refclang_-march=native_-O2_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
3232811652 0 025108 816 744inplaceclang_-march=native_-O3_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
3233311652 0 022716 816 728inplaceclang_-march=native_-O2_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
3244311650 0 025108 816 744refclang_-march=native_-O3_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
3390411619 0 023796 816 728refclang_-mcpu=native_-O3_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
3414211721 0 023908 816 728inplaceclang_-mcpu=native_-O3_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
3866211348 0 020782 808 728inplaceclang_-march=native_-Os_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
3897111335 0 020766 808 728refclang_-march=native_-Os_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625

Compiler output


blocks.c: blocks.c:176:3: error: always_inline function '_mm_sha256rnds2_epu32' requires target feature 'sha', but would be inlined into function 'crypto_hashblocks_sha256_dolbeau_amd64_sha_constbranchindex' that is compiled without support for 'sha'
blocks.c:                 DO16ROUNDS(i0, i1, i2, i3, c0, c1, c2, c3);
blocks.c:                 ^
blocks.c: blocks.c:129:8: note: expanded from macro 'DO16ROUNDS'
blocks.c:                 x1 = _mm_sha256rnds2_epu32(s1, s0, h0); \
blocks.c:                      ^
blocks.c: blocks.c:176:3: error: always_inline function '_mm_sha256rnds2_epu32' requires target feature 'sha', but would be inlined into function 'crypto_hashblocks_sha256_dolbeau_amd64_sha_constbranchindex' that is compiled without support for 'sha'
blocks.c: blocks.c:131:8: note: expanded from macro 'DO16ROUNDS'
blocks.c:                 x0 = _mm_sha256rnds2_epu32(s0, x1, h0); \
blocks.c:                      ^
blocks.c: blocks.c:176:3: error: always_inline function '_mm_sha256rnds2_epu32' requires target feature 'sha', but would be inlined into function 'crypto_hashblocks_sha256_dolbeau_amd64_sha_constbranchindex' that is compiled without support for 'sha'
blocks.c: blocks.c:134:8: note: expanded from macro 'DO16ROUNDS'
blocks.c:                 s1 = _mm_sha256rnds2_epu32(x1, x0, h1); \
blocks.c:                      ^
blocks.c: blocks.c:176:3: error: always_inline function '_mm_sha256rnds2_epu32' requires target feature 'sha', but would be inlined into function 'crypto_hashblocks_sha256_dolbeau_amd64_sha_constbranchindex' that is compiled without support for 'sha'
blocks.c: blocks.c:136:8: note: expanded from macro 'DO16ROUNDS'
blocks.c:                 s0 = _mm_sha256rnds2_epu32(x0, s1, h1); \
blocks.c:                      ^
blocks.c: blocks.c:176:3: error: always_inline function '_mm_sha256rnds2_epu32' requires target feature 'sha', but would be inlined into function 'crypto_hashblocks_sha256_dolbeau_amd64_sha_constbranchindex' that is compiled without support for 'sha'
blocks.c: blocks.c:139:8: note: expanded from macro 'DO16ROUNDS'
blocks.c:                 x1 = _mm_sha256rnds2_epu32(s1, s0, h0); \
blocks.c:                      ^
blocks.c: blocks.c:176:3: error: always_inline function '_mm_sha256rnds2_epu32' requires target feature 'sha', but would be inlined into function 'crypto_hashblocks_sha256_dolbeau_amd64_sha_constbranchindex' that is compiled without support for 'sha'
blocks.c: blocks.c:141:8: note: expanded from macro 'DO16ROUNDS'
blocks.c:                 x0 = _mm_sha256rnds2_epu32(s0, x1, h0); \
blocks.c: ...

Number of similar (implementation,compiler) pairs: 4, namely:
ImplementationCompiler
dolbeau/amd64-shaclang -march=native -O2 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
dolbeau/amd64-shaclang -march=native -O3 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
dolbeau/amd64-shaclang -march=native -O -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
dolbeau/amd64-shaclang -march=native -Os -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)

Compiler output


blocks.c: blocks.c:85:7: error: always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'crypto_hashblocks_sha256_dolbeau_amd64_sha_constbranchindex' that is compiled without support for 'ssse3'
blocks.c:         d0 = _mm_shuffle_epi8(d0, vperm);
blocks.c:              ^
blocks.c: blocks.c:86:7: error: always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'crypto_hashblocks_sha256_dolbeau_amd64_sha_constbranchindex' that is compiled without support for 'ssse3'
blocks.c:         d1 = _mm_shuffle_epi8(d1, vperm);
blocks.c:              ^
blocks.c: blocks.c:97:7: error: '__builtin_ia32_palignr128' needs target feature ssse3
blocks.c:         d0 = _mm_alignr_epi8(d0, d1, 0x08);
blocks.c:              ^
blocks.c: /usr/lib/llvm-14/lib/clang/14.0.0/include/tmmintrin.h:152:13: note: expanded from macro '_mm_alignr_epi8'
blocks.c:   ((__m128i)__builtin_ia32_palignr128((__v16qi)(__m128i)(a), \
blocks.c:             ^
blocks.c: blocks.c:98:7: error: '__builtin_ia32_pblendw128' needs target feature sse4.1
blocks.c:         d1 = _mm_blend_epi16(d1, s0, 0xf0);
blocks.c:              ^
blocks.c: /usr/lib/llvm-14/lib/clang/14.0.0/include/smmintrin.h:520:14: note: expanded from macro '_mm_blend_epi16'
blocks.c:   ((__m128i) __builtin_ia32_pblendw128 ((__v8hi)(__m128i)(V1), \
blocks.c:              ^
blocks.c: blocks.c:113:8: error: always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'crypto_hashblocks_sha256_dolbeau_amd64_sha_constbranchindex' that is compiled without support for 'ssse3'
blocks.c:                 i0 = _mm_shuffle_epi8(i0, vperm);
blocks.c:                      ^
blocks.c: blocks.c:114:8: error: always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'crypto_hashblocks_sha256_dolbeau_amd64_sha_constbranchindex' that is compiled without support for 'ssse3'
blocks.c:                 i1 = _mm_shuffle_epi8(i1, vperm);
blocks.c:                      ^
blocks.c: blocks.c:115:8: error: always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'crypto_hashblocks_sha256_dolbeau_amd64_sha_constbranchindex' that is compiled without support for 'ssse3'
blocks.c: ...

Number of similar (implementation,compiler) pairs: 1, namely:
ImplementationCompiler
dolbeau/amd64-shaclang -mcpu=native -O3 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)

Compiler output


blocks.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:97,
blocks.c:                  from blocks.c:37:
blocks.c: blocks.c: In function 'crypto_hashblocks_sha256_dolbeau_amd64_sha_constbranchindex':
blocks.c: /usr/lib/gcc/x86_64-linux-gnu/11/include/shaintrin.h:87:1: error: inlining failed in call to 'always_inline' '_mm_sha256rnds2_epu32': target specific option mismatch
blocks.c:    87 | _mm_sha256rnds2_epu32 (__m128i __A, __m128i __B, __m128i __C)
blocks.c:       | ^~~~~~~~~~~~~~~~~~~~~
blocks.c: blocks.c:146:22: note: called from here
blocks.c:   146 |                 s0 = _mm_sha256rnds2_epu32(x0, s1, h1)
blocks.c:       |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
blocks.c: blocks.c:188:17: note: in expansion of macro 'DO16ROUNDS'
blocks.c:   188 |                 DO16ROUNDS(j0, j1, j2, j3, cc, cd, ce, cf);
blocks.c:       |                 ^~~~~~~~~~
blocks.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:97,
blocks.c:                  from blocks.c:37:
blocks.c: /usr/lib/gcc/x86_64-linux-gnu/11/include/shaintrin.h:87:1: error: inlining failed in call to 'always_inline' '_mm_sha256rnds2_epu32': target specific option mismatch
blocks.c:    87 | _mm_sha256rnds2_epu32 (__m128i __A, __m128i __B, __m128i __C)
blocks.c:       | ^~~~~~~~~~~~~~~~~~~~~
blocks.c: blocks.c:144:22: note: called from here
blocks.c:   144 |                 s1 = _mm_sha256rnds2_epu32(x1, x0, h1); \
blocks.c:       |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
blocks.c: blocks.c:188:17: note: in expansion of macro 'DO16ROUNDS'
blocks.c:   188 |                 DO16ROUNDS(j0, j1, j2, j3, cc, cd, ce, cf);
blocks.c:       |                 ^~~~~~~~~~
blocks.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:97,
blocks.c:                  from blocks.c:37:
blocks.c: ...

Number of similar (implementation,compiler) pairs: 4, namely:
ImplementationCompiler
dolbeau/amd64-shagcc -march=native -mtune=native -O2 -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
dolbeau/amd64-shagcc -march=native -mtune=native -O3 -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
dolbeau/amd64-shagcc -march=native -mtune=native -O -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
dolbeau/amd64-shagcc -march=native -mtune=native -Os -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)

TIMECOP error (can be valgrind bug)


Process terminating with default action of signal 4 (SIGILL)
 Illegal opcode at address 0x10C0B1
   at 0x...: crypto_hashblocks_sha256_inplace_constbranchindex (blocks.c:188)
   by 0x...: test (try.c:91)
   by 0x...: main (try-anything.c:345)

Number of similar (implementation,compiler) pairs: 1, namely:
ImplementationCompiler
inplaceclang -march=native -O2 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)

TIMECOP error (can be valgrind bug)


Process terminating with default action of signal 4 (SIGILL)
 Illegal opcode at address 0x10C151
   at 0x...: crypto_hashblocks_sha256_inplace_constbranchindex (blocks.c:188)
   by 0x...: test (try.c:91)
   by 0x...: main (try-anything.c:345)

Number of similar (implementation,compiler) pairs: 1, namely:
ImplementationCompiler
inplaceclang -march=native -O3 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)

TIMECOP error (can be valgrind bug)


Process terminating with default action of signal 4 (SIGILL)
 Illegal opcode at address 0x10B8D5
   at 0x...: crypto_hashblocks_sha256_inplace_constbranchindex (blocks.c:188)
   by 0x...: test (try.c:91)
   by 0x...: main (try-anything.c:345)

Number of similar (implementation,compiler) pairs: 1, namely:
ImplementationCompiler
inplaceclang -march=native -Os -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)

TIMECOP error (can be valgrind bug)


Process terminating with default action of signal 4 (SIGILL)
 Illegal opcode at address 0x109CFD
   at 0x...: salsa20.part.0 (try-anything.c:102)
   by 0x...: salsa20 (try-anything.c:85)
   by 0x...: testvector (try-anything.c:124)
   by 0x...: myrandom (try-anything.c:132)
   by 0x...: test (try.c:85)
   by 0x...: main (try-anything.c:345)

Number of similar (implementation,compiler) pairs: 2, namely:
ImplementationCompiler
inplacegcc -march=native -mtune=native -O2 -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
refgcc -march=native -mtune=native -O2 -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)

TIMECOP error (can be valgrind bug)


Process terminating with default action of signal 4 (SIGILL)
 Illegal opcode at address 0x10994A
   at 0x...: core (try-anything.c:53)
   by 0x...: salsa20 (try-anything.c:101)
   by 0x...: salsa20 (try-anything.c:81)
   by 0x...: testvector (try-anything.c:124)
   by 0x...: myrandom (try-anything.c:132)
   by 0x...: test (try.c:85)
   by 0x...: main (try-anything.c:345)

Number of similar (implementation,compiler) pairs: 2, namely:
ImplementationCompiler
inplacegcc -march=native -mtune=native -O3 -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
refgcc -march=native -mtune=native -O3 -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)

TIMECOP error (can be valgrind bug)


Process terminating with default action of signal 4 (SIGILL)
 Illegal opcode at address 0x10C115
   at 0x...: crypto_hashblocks_sha256_ref_constbranchindex (blocks.c:142)
   by 0x...: test (try.c:91)
   by 0x...: main (try-anything.c:345)

Number of similar (implementation,compiler) pairs: 1, namely:
ImplementationCompiler
refclang -march=native -O2 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)

TIMECOP error (can be valgrind bug)


Process terminating with default action of signal 4 (SIGILL)
 Illegal opcode at address 0x10C1B5
   at 0x...: crypto_hashblocks_sha256_ref_constbranchindex (blocks.c:142)
   by 0x...: test (try.c:91)
   by 0x...: main (try-anything.c:345)

Number of similar (implementation,compiler) pairs: 1, namely:
ImplementationCompiler
refclang -march=native -O3 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)

TIMECOP error (can be valgrind bug)


Process terminating with default action of signal 4 (SIGILL)
 Illegal opcode at address 0x10B8C3
   at 0x...: crypto_hashblocks_sha256_ref_constbranchindex (blocks.c:142)
   by 0x...: test (try.c:91)
   by 0x...: main (try-anything.c:345)

Number of similar (implementation,compiler) pairs: 1, namely:
ImplementationCompiler
refclang -march=native -Os -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)

Passed TIMECOP


TIMECOP iterations: 10

Number of similar (implementation,compiler) pairs: 8, namely:
ImplementationCompiler
inplaceclang -march=native -O -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
inplaceclang -mcpu=native -O3 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
inplacegcc -march=native -mtune=native -O -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
inplacegcc -march=native -mtune=native -Os -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
refclang -march=native -O -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
refclang -mcpu=native -O3 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
refgcc -march=native -mtune=native -O -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
refgcc -march=native -mtune=native -Os -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)