Implementation notes: amd64, h8atom, crypto_kem/titaniumccastd

Computer: h8atom
Microarchitecture: amd64; Bonnell (30661)
Architecture: amd64
CPU ID: GenuineIntel-00030661-bfebfbff
SUPERCOP version: 20240107
Operation: crypto_kem
Primitive: titaniumccastd
TimeObject sizeTest sizeImplementationCompilerBenchmark dateSUPERCOP version
2783707562019 0 36248174 840 1600T:optclang_-march=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023123120231212
2787612157705 0 36242686 840 1600T:optclang_-march=native_-O2_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023123120231212
2879051051305 0 36234656 832 1600T:optclang_-march=native_-Os_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023123120231212
2890248979227 0 64265172 800 1664T:optgcc_-march=native_-mtune=native_-O3_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023123120231212
2925125067323 0 36253502 840 1600T:optclang_-mcpu=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023123120231212
2960582851671 0 36235750 840 1600T:optclang_-march=native_-O_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023123120231212
3038541150962 0 64235884 800 1664T:optgcc_-march=native_-mtune=native_-O2_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023123120231212
3333971950842 0 64235260 800 1664T:optgcc_-march=native_-mtune=native_-O_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023123120231212
175338079736720 0 36221646 840 1600T:refclang_-march=native_-O2_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023123120231212
175536680244505 0 36230638 840 1600T:refclang_-march=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023123120231212
180200277633046 0 36216264 832 1600T:refclang_-march=native_-Os_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023123120231212
180942652833599 0 36217662 840 1600T:refclang_-march=native_-O_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023123120231212
183136627155303 0 36241454 840 1600T:refclang_-mcpu=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023123120231212
230745996650215 0 64236140 800 1664T:refgcc_-march=native_-mtune=native_-O3_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023123120231212
231655550033559 0 64218300 800 1664T:refgcc_-march=native_-mtune=native_-O2_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023123120231212
233914338033748 0 64217980 800 1664T:refgcc_-march=native_-mtune=native_-O_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023123120231212

Compiler output

Implementation: T:avx2
Security model: timingleaks
Compiler: clang -march=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
encrypt.c: encrypt.c:67:8: error: always_inline function '_mm256_loadu_si256' requires target feature 'avx', but would be inlined into function 'crypto_encrypt_keypair' that is compiled without support for 'avx'
encrypt.c: u = _mm256_loadu_si256((__m256i *)(a[i] + j));
encrypt.c: ^
encrypt.c: encrypt.c:67:8: error: AVX vector return of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
encrypt.c: encrypt.c:68:8: error: always_inline function '_mm256_loadu_si256' requires target feature 'avx', but would be inlined into function 'crypto_encrypt_keypair' that is compiled without support for 'avx'
encrypt.c: v = _mm256_loadu_si256((__m256i *)(s + j));
encrypt.c: ^
encrypt.c: encrypt.c:68:8: error: AVX vector return of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
encrypt.c: encrypt.c:69:8: error: always_inline function '_mm256_mul_epu32' requires target feature 'avx2', but would be inlined into function 'crypto_encrypt_keypair' that is compiled without support for 'avx2'
encrypt.c: t = _mm256_mul_epu32(u, v);
encrypt.c: ^
encrypt.c: encrypt.c:69:8: error: AVX vector argument of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
encrypt.c: encrypt.c:70:4: error: always_inline function '_mm256_storeu_si256' requires target feature 'avx', but would be inlined into function 'crypto_encrypt_keypair' that is compiled without support for 'avx'
encrypt.c: _mm256_storeu_si256((__m256i *)(a[i] + j), t);
encrypt.c: ^
encrypt.c: encrypt.c:70:4: error: AVX vector argument of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
encrypt.c: encrypt.c:82:8: error: always_inline function '_mm256_loadu_si256' requires target feature 'avx', but would be inlined into function 'crypto_encrypt_keypair' that is compiled without support for 'avx'
encrypt.c: u = _mm256_loadu_si256((__m256i *)(a[i] + j));
encrypt.c: ^
encrypt.c: encrypt.c:82:8: error: AVX vector return of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
encrypt.c: encrypt.c:83:8: error: always_inline function '_mm256_loadu_si256' requires target feature 'avx', but would be inlined into function 'crypto_encrypt_keypair' that is compiled without support for 'avx'
encrypt.c: v = _mm256_loadu_si256((__m256i *)(e[i] + j));
encrypt.c: ^
encrypt.c: encrypt.c:83:8: error: AVX vector return of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
encrypt.c: encrypt.c:84:8: error: always_inline function '_mm256_add_epi64' requires target feature 'avx2', but would be inlined into function 'crypto_encrypt_keypair' that is compiled without support for 'avx2'
encrypt.c: ...

Number of similar (compiler,implementation) pairs: 5, namely:
CompilerImplementations
clang -march=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:avx2
clang -march=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:avx2
clang -march=native -O -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:avx2
clang -march=native -Os -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:avx2
clang -mcpu=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:avx2

Compiler output

Implementation: T:avx2
Security model: timingleaks
Compiler: gcc -march=native -mtune=native -O2 -fomit-frame-pointer -fwrapv -fPIC -fPIE
encrypt.c: encrypt.c: In function 'crypto_encrypt_keypair':
encrypt.c: encrypt.c:67:27: warning: AVX vector return without AVX enabled changes the ABI [-Wpsabi]
encrypt.c: 67 | u = _mm256_loadu_si256((__m256i *)(a[i] + j));
encrypt.c: | ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
encrypt.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:43,
encrypt.c: from /usr/lib/gcc/x86_64-linux-gnu/11/include/x86intrin.h:32,
encrypt.c: from encrypt.c:18:
encrypt.c: /usr/lib/gcc/x86_64-linux-gnu/11/include/avxintrin.h:933:1: error: inlining failed in call to 'always_inline' '_mm256_storeu_si256': target specific option mismatch
encrypt.c: 933 | _mm256_storeu_si256 (__m256i_u *__P, __m256i __A)
encrypt.c: | ^~~~~~~~~~~~~~~~~~~
encrypt.c: encrypt.c:70:25: note: called from here
encrypt.c: 70 | _mm256_storeu_si256((__m256i *)(a[i] + j), t);
encrypt.c: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
encrypt.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:47,
encrypt.c: from /usr/lib/gcc/x86_64-linux-gnu/11/include/x86intrin.h:32,
encrypt.c: from encrypt.c:18:
encrypt.c: /usr/lib/gcc/x86_64-linux-gnu/11/include/avx2intrin.h:567:1: error: inlining failed in call to 'always_inline' '_mm256_mul_epu32': target specific option mismatch
encrypt.c: 567 | _mm256_mul_epu32 (__m256i __A, __m256i __B)
encrypt.c: | ^~~~~~~~~~~~~~~~
encrypt.c: encrypt.c:69:29: note: called from here
encrypt.c: 69 | t = _mm256_mul_epu32(u, v);
encrypt.c: | ^~~~~~~~~~~~~~~~~~~~~~
encrypt.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:43,
encrypt.c: from /usr/lib/gcc/x86_64-linux-gnu/11/include/x86intrin.h:32,
encrypt.c: from encrypt.c:18:
encrypt.c: ...

Number of similar (compiler,implementation) pairs: 4, namely:
CompilerImplementations
gcc -march=native -mtune=native -O2 -fomit-frame-pointer -fwrapv -fPIC -fPIE T:avx2
gcc -march=native -mtune=native -O3 -fomit-frame-pointer -fwrapv -fPIC -fPIE T:avx2
gcc -march=native -mtune=native -O -fomit-frame-pointer -fwrapv -fPIC -fPIE T:avx2
gcc -march=native -mtune=native -Os -fomit-frame-pointer -fwrapv -fPIC -fPIE T:avx2

Compiler output

Implementation: T:opt
Security model: timingleaks
Compiler: gcc -march=native -mtune=native -Os -fomit-frame-pointer -fwrapv -fPIC -fPIE
try.c: /usr/bin/ld: libcrypto_kem_titaniumccastd.a(encrypt.o): in function `crypto_encrypt_keypair':
try.c: encrypt.c:(.text+0x...): undefined reference to `barrett_4q2'
try.c: /usr/bin/ld: encrypt.c:(.text+0x...): undefined reference to `barrett_4q'
try.c: /usr/bin/ld: libcrypto_kem_titaniumccastd.a(encrypt.o): in function `crypto_encrypt':
try.c: encrypt.c:(.text+0x...): undefined reference to `barrett_4q2'
try.c: /usr/bin/ld: encrypt.c:(.text+0x...): undefined reference to `barrett_4q2'
try.c: /usr/bin/ld: libcrypto_kem_titaniumccastd.a(encrypt.o): in function `crypto_encrypt_open':
try.c: encrypt.c:(.text+0x...): undefined reference to `barrett_4q2'
try.c: /usr/bin/ld: libcrypto_kem_titaniumccastd.a(fastrandombytes.o): in function `fastrandombytes':
try.c: fastrandombytes.c:(.text+0x...): undefined reference to `load_32'
try.c: /usr/bin/ld: fastrandombytes.c:(.text+0x...): undefined reference to `store_32'
try.c: /usr/bin/ld: libcrypto_kem_titaniumccastd.a(ntt.o): in function `ntt_2':
try.c: ntt.c:(.text+0x...): undefined reference to `barrett_4q'
try.c: /usr/bin/ld: ntt.c:(.text+0x...): undefined reference to `barrett_4q'
try.c: /usr/bin/ld: ntt.c:(.text+0x...): undefined reference to `barrett_4q'
try.c: /usr/bin/ld: ntt.c:(.text+0x...): undefined reference to `barrett_4q2'
try.c: /usr/bin/ld: ntt.c:(.text+0x...): undefined reference to `barrett_4q'
try.c: /usr/bin/ld: ntt.c:(.text+0x...): undefined reference to `barrett_4q'
try.c: /usr/bin/ld: ntt.c:(.text+0x...): undefined reference to `barrett_4q'
try.c: /usr/bin/ld: ntt.c:(.text+0x...): undefined reference to `barrett_4q2'
try.c: /usr/bin/ld: ntt.c:(.text+0x...): undefined reference to `barrett_4q'
try.c: /usr/bin/ld: ntt.c:(.text+0x...): undefined reference to `barrett_4q'
try.c: /usr/bin/ld: libcrypto_kem_titaniumccastd.a(ntt.o): in function `ntt_core':
try.c: ntt.c:(.text+0x...): undefined reference to `barrett_2q2'
try.c: /usr/bin/ld: libcrypto_kem_titaniumccastd.a(ntt.o): in function `intt_core':
try.c: ...

Number of similar (compiler,implementation) pairs: 1, namely:
CompilerImplementations
gcc -march=native -mtune=native -Os -fomit-frame-pointer -fwrapv -fPIC -fPIE T:opt

Compiler output

Implementation: T:ref
Security model: timingleaks
Compiler: gcc -march=native -mtune=native -Os -fomit-frame-pointer -fwrapv -fPIC -fPIE
try.c: /usr/bin/ld: libcrypto_kem_titaniumccastd.a(fastrandombytes.o): in function `fastrandombytes':
try.c: fastrandombytes.c:(.text+0x...): undefined reference to `load_32'
try.c: /usr/bin/ld: fastrandombytes.c:(.text+0x...): undefined reference to `store_32'
try.c: /usr/bin/ld: libcrypto_kem_titaniumccastd.a(sampler.o): in function `sampler_zq':
try.c: sampler.c:(.text+0x...): undefined reference to `load_24'
try.c: collect2: error: ld returned 1 exit status

Number of similar (compiler,implementation) pairs: 1, namely:
CompilerImplementations
gcc -march=native -mtune=native -Os -fomit-frame-pointer -fwrapv -fPIC -fPIE T:ref