Implementation notes: amd64, saber214, crypto_aead/aeadaes256ocbtaglen128v1

Computer: saber214
Microarchitecture: amd64; Bulldozer (600f20)
Architecture: amd64
CPU ID: AuthenticAMD-00600f20-1789c3f5
SUPERCOP version: 20240625
Operation: crypto_aead
Primitive: aeadaes256ocbtaglen128v1
TimeObject sizeTest sizeImplementationCompilerBenchmark dateSUPERCOP version
1173810796 21 033613 829 928T:optgcc_-march=native_-mtune=native_-O3_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
128617988 21 028860 861 856T:optclang_-march=native_-O2_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
135589531 21 032788 861 872T:optclang_-march=native_-O3_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
321426462 21 027837 829 928T:optgcc_-march=native_-mtune=native_-O2_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
324336498 21 027340 821 928T:optgcc_-march=native_-mtune=native_-O_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
331935474 21 024686 853 856T:optclang_-march=native_-Os_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
338995875 21 025380 861 856T:optclang_-march=native_-O_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
349525815 21 025056 805 896T:optgcc_-march=native_-mtune=native_-Os_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625
487806638 18 029497 922 856T:optclang_-mcpu=native_-O3_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062720240625

Compiler output


encrypt.c: encrypt.c:74:34: warning: incompatible pointer types passing 'const unsigned int *' to parameter of type 'const __m128i_u *' [-Wincompatible-pointer-types]
encrypt.c:   __m128i key0 = _mm_loadu_si128((const unsigned int *)(key+0));
encrypt.c:                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
encrypt.c: /usr/lib/llvm-14/lib/clang/14.0.0/include/emmintrin.h:3552:34: note: passing argument to parameter '__p' here
encrypt.c: _mm_loadu_si128(__m128i_u const *__p)
encrypt.c:                                  ^
encrypt.c: encrypt.c:75:34: warning: incompatible pointer types passing 'const unsigned int *' to parameter of type 'const __m128i_u *' [-Wincompatible-pointer-types]
encrypt.c:   __m128i key1 = _mm_loadu_si128((const unsigned int *)(key+16));
encrypt.c:                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
encrypt.c: /usr/lib/llvm-14/lib/clang/14.0.0/include/emmintrin.h:3552:34: note: passing argument to parameter '__p' here
encrypt.c: _mm_loadu_si128(__m128i_u const *__p)
encrypt.c:                                  ^
encrypt.c: encrypt.c:470:2: warning: misleading indentation; statement is not part of the previous 'for' [-Wmisleading-indentation]
encrypt.c:         break;
encrypt.c:         ^
encrypt.c: encrypt.c:468:7: note: previous statement is here
encrypt.c:       for (i = 5; i < ntz ; i++)
encrypt.c:       ^
encrypt.c: encrypt.c:639:25: warning: variable 'sum' is uninitialized when used here [-Wuninitialized]
encrypt.c:     sum = _mm_xor_si128(sum,sum);
encrypt.c:                         ^~~
encrypt.c: encrypt.c:581:5: note: variable 'sum' is declared here
encrypt.c:     __m128i lstar, ldollar, sum, offset, ktop, pad, nonce, tag, tmp, outv;
encrypt.c:     ^
encrypt.c: encrypt.c:125:20: warning: unused function 'aes256ni_setkey_decrypt' [-Wunused-function]
encrypt.c: ...

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

Compiler output


encrypt.c: encrypt.c:55: warning: "_bswap64" redefined
encrypt.c:    55 | #define _bswap64(a) __builtin_bswap64(a)
encrypt.c:       |
encrypt.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/x86gprintrin.h:33,
encrypt.c:                  from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:27,
encrypt.c:                  from encrypt.c:45:
encrypt.c: /usr/lib/gcc/x86_64-linux-gnu/11/include/ia32intrin.h:273: note: this is the location of the previous definition
encrypt.c:   273 | #define _bswap64(a)             __bswapq(a)
encrypt.c:       |
encrypt.c: encrypt.c:56: warning: "_bswap" redefined
encrypt.c:    56 | #define _bswap(a) __builtin_bswap32(a)
encrypt.c:       |
encrypt.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/x86gprintrin.h:33,
encrypt.c:                  from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:27,
encrypt.c:                  from encrypt.c:45:
encrypt.c: /usr/lib/gcc/x86_64-linux-gnu/11/include/ia32intrin.h:307: note: this is the location of the previous definition
encrypt.c:   307 | #define _bswap(a)               __bswapd(a)
encrypt.c:       |
encrypt.c: encrypt.c: In function 'aes256ni_setkey_encrypt':
encrypt.c: encrypt.c:74:34: warning: passing argument 1 of '_mm_loadu_si128' from incompatible pointer type [-Wincompatible-pointer-types]
encrypt.c:    74 |   __m128i key0 = _mm_loadu_si128((const unsigned int *)(key+0));
encrypt.c:       |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
encrypt.c:       |                                  |
encrypt.c:       |                                  const unsigned int *
encrypt.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/xmmintrin.h:1316,
encrypt.c: ...

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

Compiler output


encrypt.c: encrypt.c:86:5: warning: 'AES_set_encrypt_key' is deprecated [-Wdeprecated-declarations]
encrypt.c:     AES_set_encrypt_key(k, KEYBYTES*8, &aes_key);
encrypt.c:     ^
encrypt.c: /usr/include/openssl/aes.h:50:1: note: 'AES_set_encrypt_key' has been explicitly marked deprecated here
encrypt.c: OSSL_DEPRECATEDIN_3_0
encrypt.c: ^
encrypt.c: /usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
encrypt.c: #   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
encrypt.c:                                                 ^
encrypt.c: /usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
encrypt.c: #     define OSSL_DEPRECATED(since) __attribute__((deprecated))
encrypt.c:                                                    ^
encrypt.c: encrypt.c:88:5: warning: 'AES_encrypt' is deprecated [-Wdeprecated-declarations]
encrypt.c:     AES_encrypt(tmp, lstar, &aes_key);
encrypt.c:     ^
encrypt.c: /usr/include/openssl/aes.h:56:1: note: 'AES_encrypt' has been explicitly marked deprecated here
encrypt.c: OSSL_DEPRECATEDIN_3_0
encrypt.c: ^
encrypt.c: /usr/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
encrypt.c: #   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
encrypt.c:                                                 ^
encrypt.c: /usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
encrypt.c: #     define OSSL_DEPRECATED(since) __attribute__((deprecated))
encrypt.c:                                                    ^
encrypt.c: encrypt.c:104:9: warning: 'AES_encrypt' is deprecated [-Wdeprecated-declarations]
encrypt.c: ...

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

Compiler output


encrypt.c: encrypt.c: In function 'hash':
encrypt.c: encrypt.c:86:5: warning: 'AES_set_encrypt_key' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
encrypt.c:    86 |     AES_set_encrypt_key(k, KEYBYTES*8, &aes_key);
encrypt.c:       |     ^~~~~~~~~~~~~~~~~~~
encrypt.c: In file included from encrypt.c:39:
encrypt.c: /usr/include/openssl/aes.h:51:5: note: declared here
encrypt.c:    51 | int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
encrypt.c:       |     ^~~~~~~~~~~~~~~~~~~
encrypt.c: encrypt.c:88:5: warning: 'AES_encrypt' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
encrypt.c:    88 |     AES_encrypt(tmp, lstar, &aes_key);
encrypt.c:       |     ^~~~~~~~~~~
encrypt.c: In file included from encrypt.c:39:
encrypt.c: /usr/include/openssl/aes.h:57:6: note: declared here
encrypt.c:    57 | void AES_encrypt(const unsigned char *in, unsigned char *out,
encrypt.c:       |      ^~~~~~~~~~~
encrypt.c: encrypt.c:104:9: warning: 'AES_encrypt' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
encrypt.c:   104 |         AES_encrypt(tmp, tmp, &aes_key);
encrypt.c:       |         ^~~~~~~~~~~
encrypt.c: In file included from encrypt.c:39:
encrypt.c: /usr/include/openssl/aes.h:57:6: note: declared here
encrypt.c:    57 | void AES_encrypt(const unsigned char *in, unsigned char *out,
encrypt.c:       |      ^~~~~~~~~~~
encrypt.c: encrypt.c:120:9: warning: 'AES_encrypt' is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
encrypt.c:   120 |         AES_encrypt(tmp, tmp, &aes_key);
encrypt.c:       |         ^~~~~~~~~~~
encrypt.c: ...

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

Compiler output


ocb_vaes.c: ocb_vaes.c:668:19: error: always_inline function '_mm256_broadcastsi128_si256' requires target feature 'avx2', but would be inlined into function 'ae_encrypt' that is compiled without support for 'avx2'
ocb_vaes.c:         k256[i] = _mm256_broadcastsi128_si256(load128(ctx->encrypt_key.rd_key+i));
ocb_vaes.c:                   ^
ocb_vaes.c: ocb_vaes.c:669:14: error: always_inline function '_mm256_broadcastsi128_si256' requires target feature 'avx2', but would be inlined into function 'ae_encrypt' that is compiled without support for 'avx2'
ocb_vaes.c:     m[M01] = _mm256_broadcastsi128_si256(xor128(load128(ctx->L+0), load128(ctx->L+1)));
ocb_vaes.c:              ^
ocb_vaes.c: ocb_vaes.c:670:14: error: always_inline function '_mm256_broadcastsi128_si256' requires target feature 'avx2', but would be inlined into function 'ae_encrypt' that is compiled without support for 'avx2'
ocb_vaes.c:     m[M02] = _mm256_broadcastsi128_si256(xor128(load128(ctx->L+0), load128(ctx->L+2)));
ocb_vaes.c:              ^
ocb_vaes.c: ocb_vaes.c:671:14: error: always_inline function '_mm256_broadcastsi128_si256' requires target feature 'avx2', but would be inlined into function 'ae_encrypt' that is compiled without support for 'avx2'
ocb_vaes.c:     m[M03] = _mm256_broadcastsi128_si256(xor128(load128(ctx->L+0), load128(ctx->L+3)));
ocb_vaes.c:              ^
ocb_vaes.c: ocb_vaes.c:693:20: error: always_inline function '_mm256_broadcastsi128_si256' requires target feature 'avx2', but would be inlined into function 'ae_encrypt' that is compiled without support for 'avx2'
ocb_vaes.c:     oa[0] = xor256(_mm256_broadcastsi128_si256(offset), m[M0_01]);
ocb_vaes.c:                    ^
ocb_vaes.c: ocb_vaes.c:693:13: error: always_inline function '_mm256_xor_si256' requires target feature 'avx2', but would be inlined into function 'ae_encrypt' that is compiled without support for 'avx2'
ocb_vaes.c:     oa[0] = xor256(_mm256_broadcastsi128_si256(offset), m[M0_01]);
ocb_vaes.c:             ^
ocb_vaes.c: ocb_vaes.c:142:27: note: expanded from macro 'xor256'
ocb_vaes.c: #define xor256(x,y)       _mm256_xor_si256(x,y)
ocb_vaes.c:                           ^
ocb_vaes.c: ocb_vaes.c:694:13: error: always_inline function '_mm256_xor_si256' requires target feature 'avx2', but would be inlined into function 'ae_encrypt' that is compiled without support for 'avx2'
ocb_vaes.c:     oa[2] = xor256x3(oa[0], m[M01], m[M02]);
ocb_vaes.c:             ^
ocb_vaes.c: ocb_vaes.c:143:34: note: expanded from macro 'xor256x3'
ocb_vaes.c: ...

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

Compiler output


ocb_vaes.c: ocb_vaes.c:476:15: error: always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'ae_init' that is compiled without support for 'ssse3'
ocb_vaes.c:     tmp_blk = reverse_bytes(load128(&ctx->Lstar));
ocb_vaes.c:               ^
ocb_vaes.c: ocb_vaes.c:155:5: note: expanded from macro 'reverse_bytes'
ocb_vaes.c:     _mm_shuffle_epi8(b,_mm_set_epi8(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15))
ocb_vaes.c:     ^
ocb_vaes.c: ocb_vaes.c:478:29: error: always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'ae_init' that is compiled without support for 'ssse3'
ocb_vaes.c:     store128(&ctx->Ldollar, reverse_bytes(tmp_blk));
ocb_vaes.c:                             ^
ocb_vaes.c: ocb_vaes.c:155:5: note: expanded from macro 'reverse_bytes'
ocb_vaes.c:     _mm_shuffle_epi8(b,_mm_set_epi8(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15))
ocb_vaes.c:     ^
ocb_vaes.c: ocb_vaes.c:480:24: error: always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'ae_init' that is compiled without support for 'ssse3'
ocb_vaes.c:     store128(ctx->L+0, reverse_bytes(tmp_blk));
ocb_vaes.c:                        ^
ocb_vaes.c: ocb_vaes.c:155:5: note: expanded from macro 'reverse_bytes'
ocb_vaes.c:     _mm_shuffle_epi8(b,_mm_set_epi8(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15))
ocb_vaes.c:     ^
ocb_vaes.c: ocb_vaes.c:483:25: error: always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'ae_init' that is compiled without support for 'ssse3'
ocb_vaes.c:         store128(ctx->L+i, reverse_bytes(tmp_blk));
ocb_vaes.c:                            ^
ocb_vaes.c: ocb_vaes.c:155:5: note: expanded from macro 'reverse_bytes'
ocb_vaes.c:     _mm_shuffle_epi8(b,_mm_set_epi8(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15))
ocb_vaes.c:     ^
ocb_vaes.c: 4 errors generated.

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

Compiler output


ocb_vaes.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:47,
ocb_vaes.c:                  from ocb_vaes.c:71:
ocb_vaes.c: ocb_vaes.c: In function 'process_ad':
ocb_vaes.c: /usr/lib/gcc/x86_64-linux-gnu/11/include/avx2intrin.h:913:1: error: inlining failed in call to 'always_inline' '_mm256_xor_si256': target specific option mismatch
ocb_vaes.c:   913 | _mm256_xor_si256 (__m256i __A, __m256i __B)
ocb_vaes.c:       | ^~~~~~~~~~~~~~~~
ocb_vaes.c: ocb_vaes.c:142:27: note: called from here
ocb_vaes.c:   142 | #define xor256(x,y)       _mm256_xor_si256(x,y)
ocb_vaes.c:       |                           ^~~~~~~~~~~~~~~~~~~~~
ocb_vaes.c: ocb_vaes.c:551:13: note: in expansion of macro 'xor256'
ocb_vaes.c:   551 |     oa[5] = xor256(oa[4], _mm256_blend_epi32(m[M01], m[M02], 0xf0));
ocb_vaes.c:       |             ^~~~~~
ocb_vaes.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:47,
ocb_vaes.c:                  from ocb_vaes.c:71:
ocb_vaes.c: /usr/lib/gcc/x86_64-linux-gnu/11/include/avx2intrin.h:974:1: error: inlining failed in call to 'always_inline' '_mm256_blend_epi32': target specific option mismatch
ocb_vaes.c:   974 | _mm256_blend_epi32 (__m256i __X, __m256i __Y, const int __M)
ocb_vaes.c:       | ^~~~~~~~~~~~~~~~~~
ocb_vaes.c: ocb_vaes.c:142:27: note: called from here
ocb_vaes.c:   142 | #define xor256(x,y)       _mm256_xor_si256(x,y)
ocb_vaes.c:       |                           ^~~~~~~~~~~~~~~~~~~~~
ocb_vaes.c: ocb_vaes.c:551:13: note: in expansion of macro 'xor256'
ocb_vaes.c:   551 |     oa[5] = xor256(oa[4], _mm256_blend_epi32(m[M01], m[M02], 0xf0));
ocb_vaes.c:       |             ^~~~~~
ocb_vaes.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:47,
ocb_vaes.c:                  from ocb_vaes.c:71:
ocb_vaes.c: ...

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