Implementation notes: amd64, cherry, crypto_sign/dilithium3aes

Computer: cherry
Microarchitecture: amd64; Silvermont (406c4)
Architecture: amd64
CPU ID: GenuineIntel-000406c4-bfebfbff
SUPERCOP version: 20240425
Operation: crypto_sign
Primitive: dilithium3aes
TimeObject sizeTest sizeImplementationCompilerBenchmark dateSUPERCOP version
571955941545 0 062112 820 1720refclang_-mcpu=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024042820240425
611987929479 0 048800 820 1720refclang_-march=native_-O2_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024042820240425
634057222304 0 039934 812 1720refclang_-march=native_-Os_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024042820240425
649481840174 0 061144 820 1720refclang_-march=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024042820240425
650917953988 0 074432 788 1784refgcc_-march=native_-mtune=native_-O3_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024042820240425
714819125848 0 045304 788 1784refgcc_-march=native_-mtune=native_-O2_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024042820240425
740997924686 0 043062 812 1720refclang_-march=native_-O_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024042820240425
763959423200 0 042248 788 1784refgcc_-march=native_-mtune=native_-O_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024042820240425
876739521741 0 039256 780 1752refgcc_-march=native_-mtune=native_-Os_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024042820240425

Compiler output

Implementation: avx2
Security model: constbranchindex
Compiler: clang -march=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
poly.c: poly.c:44:21: error: always_inline function '_mm256_load_si256' requires target feature 'avx', but would be inlined into function 'crypto_sign_dilithium3aes_avx2_constbranchindex_poly_reduce' that is compiled without support for 'avx'
poly.c: const __m256i q = _mm256_load_si256(&qdata.vec[_8XQ/8]);
poly.c: ^
poly.c: poly.c:44:21: error: AVX vector return of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
poly.c: poly.c:45:23: error: always_inline function '_mm256_set1_epi32' requires target feature 'avx', but would be inlined into function 'crypto_sign_dilithium3aes_avx2_constbranchindex_poly_reduce' that is compiled without support for 'avx'
poly.c: const __m256i off = _mm256_set1_epi32(1<<22);
poly.c: ^
poly.c: poly.c:45:23: error: AVX vector return of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
poly.c: poly.c:49:9: error: always_inline function '_mm256_load_si256' requires target feature 'avx', but would be inlined into function 'crypto_sign_dilithium3aes_avx2_constbranchindex_poly_reduce' that is compiled without support for 'avx'
poly.c: f = _mm256_load_si256(&a->vec[i]);
poly.c: ^
poly.c: poly.c:49:9: error: AVX vector return of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
poly.c: poly.c:50:9: error: always_inline function '_mm256_add_epi32' requires target feature 'avx2', but would be inlined into function 'crypto_sign_dilithium3aes_avx2_constbranchindex_poly_reduce' that is compiled without support for 'avx2'
poly.c: g = _mm256_add_epi32(f,off);
poly.c: ^
poly.c: poly.c:50:9: error: AVX vector argument of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
poly.c: poly.c:51:9: error: always_inline function '_mm256_srai_epi32' requires target feature 'avx2', but would be inlined into function 'crypto_sign_dilithium3aes_avx2_constbranchindex_poly_reduce' that is compiled without support for 'avx2'
poly.c: g = _mm256_srai_epi32(g,23);
poly.c: ^
poly.c: poly.c:51:9: error: AVX vector argument of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
poly.c: poly.c:52:9: error: always_inline function '_mm256_mullo_epi32' requires target feature 'avx2', but would be inlined into function 'crypto_sign_dilithium3aes_avx2_constbranchindex_poly_reduce' that is compiled without support for 'avx2'
poly.c: g = _mm256_mullo_epi32(g,q);
poly.c: ^
poly.c: poly.c:52:9: error: AVX vector argument of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
poly.c: poly.c:53:9: error: always_inline function '_mm256_sub_epi32' requires target feature 'avx2', but would be inlined into function 'crypto_sign_dilithium3aes_avx2_constbranchindex_poly_reduce' that is compiled without support for 'avx2'
poly.c: ...

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

Compiler output

Implementation: avx2
Security model: constbranchindex
Compiler: clang -mcpu=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
aes256ctr.c: aes256ctr.c:90:3: error: '__builtin_ia32_aeskeygenassist128' needs target feature aes
aes256ctr.c: BLOCK1(0x01);
aes256ctr.c: ^
aes256ctr.c: aes256ctr.c:71:11: note: expanded from macro 'BLOCK1'
aes256ctr.c: temp1 = _mm_aeskeygenassist_si128(temp2, IMM); \
aes256ctr.c: ^
aes256ctr.c: /usr/lib/llvm-11/lib/clang/11.0.1/include/__wmmintrin_aes.h:136:12: note: expanded from macro '_mm_aeskeygenassist_si128'
aes256ctr.c: (__m128i)__builtin_ia32_aeskeygenassist128((__v2di)(__m128i)(C), (int)(R))
aes256ctr.c: ^
aes256ctr.c: aes256ctr.c:91:3: error: '__builtin_ia32_aeskeygenassist128' needs target feature aes
aes256ctr.c: BLOCK2(0x01);
aes256ctr.c: ^
aes256ctr.c: aes256ctr.c:81:11: note: expanded from macro 'BLOCK2'
aes256ctr.c: temp1 = _mm_aeskeygenassist_si128(temp0, IMM); \
aes256ctr.c: ^
aes256ctr.c: /usr/lib/llvm-11/lib/clang/11.0.1/include/__wmmintrin_aes.h:136:12: note: expanded from macro '_mm_aeskeygenassist_si128'
aes256ctr.c: (__m128i)__builtin_ia32_aeskeygenassist128((__v2di)(__m128i)(C), (int)(R))
aes256ctr.c: ^
aes256ctr.c: aes256ctr.c:93:3: error: '__builtin_ia32_aeskeygenassist128' needs target feature aes
aes256ctr.c: BLOCK1(0x02);
aes256ctr.c: ^
aes256ctr.c: aes256ctr.c:71:11: note: expanded from macro 'BLOCK1'
aes256ctr.c: temp1 = _mm_aeskeygenassist_si128(temp2, IMM); \
aes256ctr.c: ^
aes256ctr.c: /usr/lib/llvm-11/lib/clang/11.0.1/include/__wmmintrin_aes.h:136:12: note: expanded from macro '_mm_aeskeygenassist_si128'
aes256ctr.c: ...

Number of similar (compiler,implementation) pairs: 1, namely:
CompilerImplementations
clang -mcpu=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE avx2

Compiler output

Implementation: avx2
Security model: constbranchindex
Compiler: gcc -march=native -mtune=native -O2 -fomit-frame-pointer -fwrapv -fPIC -fPIE
poly.c: poly.c: In function 'crypto_sign_dilithium3aes_avx2_constbranchindex_poly_reduce':
poly.c: poly.c:44:17: warning: AVX vector return without AVX enabled changes the ABI [-Wpsabi]
poly.c: 44 | const __m256i q = _mm256_load_si256(&qdata.vec[_8XQ/8]);
poly.c: | ^
poly.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/10/include/immintrin.h:51,
poly.c: from poly.c:2:
poly.c: /usr/lib/gcc/x86_64-linux-gnu/10/include/avxintrin.h:1319:1: error: inlining failed in call to 'always_inline' '_mm256_set1_epi32': target specific option mismatch
poly.c: 1319 | _mm256_set1_epi32 (int __A)
poly.c: | ^~~~~~~~~~~~~~~~~
poly.c: poly.c:45:23: note: called from here
poly.c: 45 | const __m256i off = _mm256_set1_epi32(1<<22);
poly.c: | ^~~~~~~~~~~~~~~~~~~~~~~~
poly.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/10/include/immintrin.h:51,
poly.c: from poly.c:2:
poly.c: /usr/lib/gcc/x86_64-linux-gnu/10/include/avxintrin.h:908:1: error: inlining failed in call to 'always_inline' '_mm256_load_si256': target specific option mismatch
poly.c: 908 | _mm256_load_si256 (__m256i const *__P)
poly.c: | ^~~~~~~~~~~~~~~~~
poly.c: poly.c:44:21: note: called from here
poly.c: 44 | const __m256i q = _mm256_load_si256(&qdata.vec[_8XQ/8]);
poly.c: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
poly.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/10/include/immintrin.h:51,
poly.c: from poly.c:2:
poly.c: /usr/lib/gcc/x86_64-linux-gnu/10/include/avxintrin.h:914:1: error: inlining failed in call to 'always_inline' '_mm256_store_si256': target specific option mismatch
poly.c: 914 | _mm256_store_si256 (__m256i *__P, __m256i __A)
poly.c: | ^~~~~~~~~~~~~~~~~~
poly.c: ...

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