Implementation notes: amd64, comet, crypto_stream/speck128256ctr

Computer: comet
Microarchitecture: amd64; Comet Lake (806ec)
Architecture: amd64
CPU ID: GenuineIntel-000806ec-bfebfbff
SUPERCOP version: 20240625
Operation: crypto_stream
Primitive: speck128256ctr
TimeObject sizeTest sizeImplementationCompilerBenchmark dateSUPERCOP version
217935734 0 049247 844 1024T:avx2clang_-march=native_-Os_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062920240625
218035832 0 052209 852 992T:avx2clang_-march=native_-O2_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062920240625
218135928 0 052601 852 1024T:avx2clang_-march=native_-O3_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062920240625
218236184 0 048793 852 960T:avx2clang_-march=native_-O_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062920240625
219736674 0 049403 772 1024T:avx2gcc_-march=native_-mtune=native_-O_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062920240625
228038059 0 053260 780 1024T:avx2gcc_-march=native_-mtune=native_-O3_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062920240625
228236860 0 050092 780 1024T:avx2gcc_-march=native_-mtune=native_-O2_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062920240625
230535976 0 047543 756 992T:avx2gcc_-march=native_-mtune=native_-Os_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062920240625
417328460 0 045257 852 1024T:sse4clang_-march=native_-O3_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062920240625
417628460 0 044961 852 992T:sse4clang_-march=native_-O2_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062920240625
418628331 0 041943 844 1024T:sse4clang_-march=native_-Os_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062920240625
420628588 0 041321 852 960T:sse4clang_-march=native_-O_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062920240625
648716045 0 029292 780 1024T:sse4gcc_-march=native_-mtune=native_-O2_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062920240625
651317156 0 032348 780 1024T:sse4gcc_-march=native_-mtune=native_-O3_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062920240625

Compiler output


stream.c: stream.c:301:3: error: always_inline function '_mm256_set_epi64x' requires target feature 'avx', but would be inlined into function 'ExpandKey' that is compiled without support for 'avx'
stream.c:   EK(A,B,C,D,rk,key);
stream.c:   ^
stream.c: ./Speck128256AVX2.h:55:28: note: expanded from macro 'EK'
stream.c: #define EK(A,B,C,D,k,key) (RK(B,A,k,key,0),  RK(C,A,k,key,1),  RK(D,A,k,key,2),  RK(B,A,k,key,3),  RK(C,A,k,key,4),  RK(D,A,k,key,5),  RK(B,A,k,key,6), \
stream.c:                            ^
stream.c: ./Speck128256AVX2.h:53:28: note: expanded from macro 'RK'
stream.c: #define RK(X,Y,k,key,i)   (SET1(k[i],Y), key[i]=Y, X=RCS(X,8), X+=Y, X^=i, Y=LCS(Y,3), Y^=X)
stream.c:                            ^
stream.c: ./Intrinsics_AVX2_128block.h:25:22: note: expanded from macro 'SET1'
stream.c: #define SET1(X,c) (X=SET(c,c,c,c))
stream.c:                      ^
stream.c: ./Intrinsics_AVX2_128block.h:24:13: note: expanded from macro 'SET'
stream.c: #define SET _mm256_set_epi64x
stream.c:             ^
stream.c: stream.c:301:3: error: AVX vector return of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
stream.c: ./Speck128256AVX2.h:55:28: note: expanded from macro 'EK'
stream.c: #define EK(A,B,C,D,k,key) (RK(B,A,k,key,0),  RK(C,A,k,key,1),  RK(D,A,k,key,2),  RK(B,A,k,key,3),  RK(C,A,k,key,4),  RK(D,A,k,key,5),  RK(B,A,k,key,6), \
stream.c:                            ^
stream.c: ./Speck128256AVX2.h:53:28: note: expanded from macro 'RK'
stream.c: #define RK(X,Y,k,key,i)   (SET1(k[i],Y), key[i]=Y, X=RCS(X,8), X+=Y, X^=i, Y=LCS(Y,3), Y^=X)
stream.c:                            ^
stream.c: ./Intrinsics_AVX2_128block.h:25:22: note: expanded from macro 'SET1'
stream.c: #define SET1(X,c) (X=SET(c,c,c,c))
stream.c:                      ^
stream.c: ...

Number of similar (implementation,compiler) pairs: 1, namely:
ImplementationCompiler
T:avx2clang -mcpu=native -O3 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Debian_Clang_14.0.6)

Compiler output


stream.c: stream.c:267:10: warning: unused variable 'j' [-Wunused-variable]
stream.c:   u64  i,j,x[2],y[2];
stream.c:          ^
stream.c: stream.c:267:8: warning: unused variable 'i' [-Wunused-variable]
stream.c:   u64  i,j,x[2],y[2];
stream.c:        ^
stream.c: stream.c:336:3: error: always_inline function '_mm512_set_epi64' requires target feature 'avx512f', but would be inlined into function 'ExpandKey' that is compiled without support for 'avx512f'
stream.c:   EK(A,B,C,D,rk,key);
stream.c:   ^
stream.c: ./Speck128256AVX512.h:63:28: note: expanded from macro 'EK'
stream.c: #define EK(A,B,C,D,k,key) (RK(B,A,k,key,0),  RK(C,A,k,key,1),  RK(D,A,k,key,2),  RK(B,A,k,key,3),  RK(C,A,k,key,4),  RK(D,A,k,key,5),  RK(B,A,k,key,6), \
stream.c:                            ^
stream.c: ./Speck128256AVX512.h:61:28: note: expanded from macro 'RK'
stream.c: #define RK(X,Y,k,key,i)   (SET1(k[i],Y), key[i]=Y, X=RCS(X,8), X+=Y, X^=i, Y=LCS(Y,3), Y^=X)
stream.c:                            ^
stream.c: ./Intrinsics_AVX512_128block.h:25:22: note: expanded from macro 'SET1'
stream.c: #define SET1(X,c) (X=SET(c,c,c,c,c,c,c,c))
stream.c:                      ^
stream.c: ./Intrinsics_AVX512_128block.h:16:13: note: expanded from macro 'SET'
stream.c: #define SET _mm512_set_epi64
stream.c:             ^
stream.c: stream.c:336:3: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'avx512f' enabled changes the ABI
stream.c: ./Speck128256AVX512.h:63:28: note: expanded from macro 'EK'
stream.c: #define EK(A,B,C,D,k,key) (RK(B,A,k,key,0),  RK(C,A,k,key,1),  RK(D,A,k,key,2),  RK(B,A,k,key,3),  RK(C,A,k,key,4),  RK(D,A,k,key,5),  RK(B,A,k,key,6), \
stream.c:                            ^
stream.c: ...

Number of similar (implementation,compiler) pairs: 2, namely:
ImplementationCompiler
T:avx512clang -march=native -O2 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Debian_Clang_14.0.6)
T:avx512clang -march=native -Os -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Debian_Clang_14.0.6)

Compiler output


stream.c: stream.c:267:8: warning: unused variable 'i' [-Wunused-variable]
stream.c:   u64  i,j,x[2],y[2];
stream.c:        ^
stream.c: stream.c:267:10: warning: unused variable 'j' [-Wunused-variable]
stream.c:   u64  i,j,x[2],y[2];
stream.c:          ^
stream.c: stream.c:336:3: error: always_inline function '_mm512_set_epi64' requires target feature 'avx512f', but would be inlined into function 'ExpandKey' that is compiled without support for 'avx512f'
stream.c:   EK(A,B,C,D,rk,key);
stream.c:   ^
stream.c: ./Speck128256AVX512.h:63:28: note: expanded from macro 'EK'
stream.c: #define EK(A,B,C,D,k,key) (RK(B,A,k,key,0),  RK(C,A,k,key,1),  RK(D,A,k,key,2),  RK(B,A,k,key,3),  RK(C,A,k,key,4),  RK(D,A,k,key,5),  RK(B,A,k,key,6), \
stream.c:                            ^
stream.c: ./Speck128256AVX512.h:61:28: note: expanded from macro 'RK'
stream.c: #define RK(X,Y,k,key,i)   (SET1(k[i],Y), key[i]=Y, X=RCS(X,8), X+=Y, X^=i, Y=LCS(Y,3), Y^=X)
stream.c:                            ^
stream.c: ./Intrinsics_AVX512_128block.h:25:22: note: expanded from macro 'SET1'
stream.c: #define SET1(X,c) (X=SET(c,c,c,c,c,c,c,c))
stream.c:                      ^
stream.c: ./Intrinsics_AVX512_128block.h:16:13: note: expanded from macro 'SET'
stream.c: #define SET _mm512_set_epi64
stream.c:             ^
stream.c: stream.c:336:3: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'avx512f' enabled changes the ABI
stream.c: ./Speck128256AVX512.h:63:28: note: expanded from macro 'EK'
stream.c: #define EK(A,B,C,D,k,key) (RK(B,A,k,key,0),  RK(C,A,k,key,1),  RK(D,A,k,key,2),  RK(B,A,k,key,3),  RK(C,A,k,key,4),  RK(D,A,k,key,5),  RK(B,A,k,key,6), \
stream.c:                            ^
stream.c: ...

Number of similar (implementation,compiler) pairs: 3, namely:
ImplementationCompiler
T:avx512clang -march=native -O3 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Debian_Clang_14.0.6)
T:avx512clang -march=native -O -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Debian_Clang_14.0.6)
T:avx512clang -mcpu=native -O3 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Debian_Clang_14.0.6)

Compiler output


stream.c: stream.c: In function 'Encrypt_Xor':
stream.c: stream.c:267:10: warning: unused variable 'j' [-Wunused-variable]
stream.c:   267 |   u64  i,j,x[2],y[2];
stream.c:       |          ^
stream.c: stream.c:267:8: warning: unused variable 'i' [-Wunused-variable]
stream.c:   267 |   u64  i,j,x[2],y[2];
stream.c:       |        ^
stream.c: In file included from Speck128256AVX512.h:17,
stream.c:                  from stream.c:21:
stream.c: stream.c: In function 'Encrypt':
stream.c: Intrinsics_AVX512_128block.h:25:21: warning: AVX512F vector return without AVX512F enabled changes the ABI [-Wpsabi]
stream.c:    25 | #define SET1(X,c) (X=SET(c,c,c,c,c,c,c,c))
stream.c:       |                   ~~^~~~~~~~~~~~~~~~~~~~~~
stream.c: stream.c:139:5: note: in expansion of macro 'SET1'
stream.c:   139 |     SET1(X[0],nonce[1]); SET8(Y[0],nonce[0]);
stream.c:       |     ^~~~
stream.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/12/include/immintrin.h:49,
stream.c:                  from Intrinsics_AVX512_128block.h:5:
stream.c: /usr/lib/gcc/x86_64-linux-gnu/12/include/avx512fintrin.h:6523:1: error: inlining failed in call to 'always_inline' '_mm512_storeu_si512': target specific option mismatch
stream.c:  6523 | _mm512_storeu_si512 (void *__P, __m512i __A)
stream.c:       | ^~~~~~~~~~~~~~~~~~~
stream.c: Intrinsics_AVX512_128block.h:32:18: note: called from here
stream.c:    32 | #define ST(ip,X) _mm512_storeu_si512((void *)(ip),X)
stream.c:       |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stream.c: Intrinsics_AVX512_128block.h:33:43: note: in expansion of macro 'ST'
stream.c: ...

Number of similar (implementation,compiler) pairs: 4, namely:
ImplementationCompiler
T:avx512gcc -march=native -mtune=native -O2 -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (12.2.0)
T:avx512gcc -march=native -mtune=native -O3 -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (12.2.0)
T:avx512gcc -march=native -mtune=native -O -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (12.2.0)
T:avx512gcc -march=native -mtune=native -Os -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (12.2.0)

Compiler output


stream.c: stream.c:118:21: error: always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'Encrypt' that is compiled without support for 'ssse3'
stream.c:   if (numbytes==32) Enc(X,Y,rk,2);
stream.c:                     ^
stream.c: ./Speck128256SSE4.h:42:23: note: expanded from macro 'Enc'
stream.c: #define Enc(X,Y,k,n) (Rx##n(X,Y,k[0]),  Rx##n(X,Y,k[1]),  Rx##n(X,Y,k[2]),  Rx##n(X,Y,k[3]),  Rx##n(X,Y,k[4]),  Rx##n(X,Y,k[5]),  Rx##n(X,Y,k[6]),  Rx##n(X,Y,k[7]), \
stream.c:                       ^
stream.c: <scratch space>:107:1: note: expanded from here
stream.c: Rx2
stream.c: ^
stream.c: ./Speck128256SSE4.h:25:21: note: expanded from macro 'Rx2'
stream.c: #define Rx2(X,Y,k) (R(X[0],Y[0],k))
stream.c:                     ^
stream.c: ./Speck128256SSE4.h:23:29: note: expanded from macro 'R'
stream.c: #define R(X,Y,k) (X=XOR(ADD(ROR8(X),Y),k), Y=XOR(ROL(Y,3),X))
stream.c:                             ^
stream.c: ./Intrinsics_SSE4_128block.h:41:19: note: expanded from macro 'ROR8'
stream.c: #define ROR8(X)  (SHFL(X,R8))
stream.c:                   ^
stream.c: ./Intrinsics_SSE4_128block.h:37:14: note: expanded from macro 'SHFL'
stream.c: #define SHFL _mm_shuffle_epi8
stream.c:              ^
stream.c: stream.c:118:21: error: always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'Encrypt' that is compiled without support for 'ssse3'
stream.c: ./Speck128256SSE4.h:42:41: note: expanded from macro 'Enc'
stream.c: #define Enc(X,Y,k,n) (Rx##n(X,Y,k[0]),  Rx##n(X,Y,k[1]),  Rx##n(X,Y,k[2]),  Rx##n(X,Y,k[3]),  Rx##n(X,Y,k[4]),  Rx##n(X,Y,k[5]),  Rx##n(X,Y,k[6]),  Rx##n(X,Y,k[7]), \
stream.c:                                         ^
stream.c: ...

Number of similar (implementation,compiler) pairs: 1, namely:
ImplementationCompiler
T:sse4clang -mcpu=native -O3 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Debian_Clang_14.0.6)

Compiler output


stream.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/12/include/pmmintrin.h:31,
stream.c:                  from /usr/lib/gcc/x86_64-linux-gnu/12/include/tmmintrin.h:31,
stream.c:                  from /usr/lib/gcc/x86_64-linux-gnu/12/include/smmintrin.h:32,
stream.c:                  from Intrinsics_SSE4_128block.h:5,
stream.c:                  from Speck128256SSE4.h:17,
stream.c:                  from stream.c:20:
stream.c: In function '_mm_unpackhi_epi64',
stream.c:     inlined from 'Encrypt' at stream.c:136:22:
stream.c: /usr/lib/gcc/x86_64-linux-gnu/12/include/emmintrin.h:1024:19: warning: 'Y[2]' may be used uninitialized [-Wmaybe-uninitialized]
stream.c:  1024 |   return (__m128i)__builtin_ia32_punpckhqdq128 ((__v2di)__A, (__v2di)__B);
stream.c:       |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stream.c: stream.c: In function 'Encrypt':
stream.c: stream.c:106:13: note: 'Y[2]' was declared here
stream.c:   106 |   u128 X[4],Y[4],Z[4];
stream.c:       |             ^
stream.c: In function '_mm_unpackhi_epi64',
stream.c:     inlined from 'Encrypt' at stream.c:136:22:
stream.c: /usr/lib/gcc/x86_64-linux-gnu/12/include/emmintrin.h:1024:19: warning: 'X[2]' may be used uninitialized [-Wmaybe-uninitialized]
stream.c:  1024 |   return (__m128i)__builtin_ia32_punpckhqdq128 ((__v2di)__A, (__v2di)__B);
stream.c:       |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stream.c: stream.c: In function 'Encrypt':
stream.c: stream.c:106:8: note: 'X[2]' was declared here
stream.c:   106 |   u128 X[4],Y[4],Z[4];
stream.c:       |        ^
stream.c: In function '_mm_unpackhi_epi64',
stream.c: ...

Number of similar (implementation,compiler) pairs: 2, namely:
ImplementationCompiler
T:sse4gcc -march=native -mtune=native -O2 -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (12.2.0)
T:sse4gcc -march=native -mtune=native -O3 -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (12.2.0)

Compiler output


stream.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/12/include/pmmintrin.h:31,
stream.c:                  from /usr/lib/gcc/x86_64-linux-gnu/12/include/tmmintrin.h:31,
stream.c:                  from /usr/lib/gcc/x86_64-linux-gnu/12/include/smmintrin.h:32,
stream.c:                  from Intrinsics_SSE4_128block.h:5,
stream.c:                  from Speck128256SSE4.h:17,
stream.c:                  from stream.c:20:
stream.c: In function '_mm_unpackhi_epi64',
stream.c:     inlined from 'Encrypt' at stream.c:136:22:
stream.c: /usr/lib/gcc/x86_64-linux-gnu/12/include/emmintrin.h:1024:19: warning: 'Y[2]' may be used uninitialized [-Wmaybe-uninitialized]
stream.c:  1024 |   return (__m128i)__builtin_ia32_punpckhqdq128 ((__v2di)__A, (__v2di)__B);
stream.c:       |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stream.c: stream.c: In function 'Encrypt':
stream.c: stream.c:106:13: note: 'Y[2]' was declared here
stream.c:   106 |   u128 X[4],Y[4],Z[4];
stream.c:       |             ^
stream.c: In function '_mm_unpackhi_epi64',
stream.c:     inlined from 'Encrypt' at stream.c:135:22:
stream.c: /usr/lib/gcc/x86_64-linux-gnu/12/include/emmintrin.h:1024:19: warning: 'Y[1]' may be used uninitialized [-Wmaybe-uninitialized]
stream.c:  1024 |   return (__m128i)__builtin_ia32_punpckhqdq128 ((__v2di)__A, (__v2di)__B);
stream.c:       |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stream.c: stream.c: In function 'Encrypt':
stream.c: stream.c:106:13: note: 'Y[1]' was declared here
stream.c:   106 |   u128 X[4],Y[4],Z[4];
stream.c:       |             ^
stream.c: In function '_mm_unpackhi_epi64',
stream.c: ...

Number of similar (implementation,compiler) pairs: 1, namely:
ImplementationCompiler
T:sse4gcc -march=native -mtune=native -O -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (12.2.0)

Compiler output


stream.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/12/include/pmmintrin.h:31,
stream.c:                  from /usr/lib/gcc/x86_64-linux-gnu/12/include/tmmintrin.h:31,
stream.c:                  from /usr/lib/gcc/x86_64-linux-gnu/12/include/smmintrin.h:32,
stream.c:                  from Intrinsics_SSE4_128block.h:5,
stream.c:                  from Speck128256SSE4.h:17,
stream.c:                  from stream.c:20:
stream.c: In function '_mm_unpackhi_epi64',
stream.c:     inlined from 'Encrypt' at stream.c:136:22:
stream.c: /usr/lib/gcc/x86_64-linux-gnu/12/include/emmintrin.h:1024:19: warning: 'Y[2]' may be used uninitialized [-Wmaybe-uninitialized]
stream.c:  1024 |   return (__m128i)__builtin_ia32_punpckhqdq128 ((__v2di)__A, (__v2di)__B);
stream.c:       |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stream.c: stream.c: In function 'Encrypt':
stream.c: stream.c:106:13: note: 'Y[2]' was declared here
stream.c:   106 |   u128 X[4],Y[4],Z[4];
stream.c:       |             ^
stream.c: In function '_mm_unpacklo_epi64',
stream.c:     inlined from 'Encrypt' at stream.c:135:22:
stream.c: /usr/lib/gcc/x86_64-linux-gnu/12/include/emmintrin.h:1048:19: warning: 'Y[1]' may be used uninitialized [-Wmaybe-uninitialized]
stream.c:  1048 |   return (__m128i)__builtin_ia32_punpcklqdq128 ((__v2di)__A, (__v2di)__B);
stream.c:       |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stream.c: stream.c: In function 'Encrypt':
stream.c: stream.c:106:13: note: 'Y[1]' was declared here
stream.c:   106 |   u128 X[4],Y[4],Z[4];
stream.c:       |             ^
stream.c: In function '_mm_unpackhi_epi64',
stream.c: ...

Number of similar (implementation,compiler) pairs: 1, namely:
ImplementationCompiler
T:sse4gcc -march=native -mtune=native -Os -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (12.2.0)