Implementation notes: amd64, gcc123, crypto_sign/dilithium2aes

Computer: gcc123
Architecture: amd64
CPU ID: GenuineIntel-000206d7-bfebfbff
SUPERCOP version: 20220213
Operation: crypto_sign
Primitive: dilithium2aes
TimeObject sizeTest sizeImplementationCompilerBenchmark dateSUPERCOP version
308925441702 0 062010 820 1736refclang_-mcpu=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2021020820210125
315054542326 0 064850 820 1736refclang_-march=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2021020820210125
339081643026 0 062615 836 1768refgcc_-march=native_-mtune=native_-O3_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2021020820210125
339138834170 0 055010 820 1736refclang_-march=native_-O2_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2021020820210125
339155134170 0 055010 820 1736refclang_-march=native_-O_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2021020820210125
346814423740 0 040936 812 1736refclang_-march=native_-Os_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2021020820210125
364648724789 0 043095 836 1768refgcc_-march=native_-mtune=native_-O2_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2021020820210125
384976523885 0 041943 836 1768refgcc_-march=native_-mtune=native_-O_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2021020820210125
399126321721 0 038703 828 1736refgcc_-march=native_-mtune=native_-Os_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2021020820210125

Compiler output

Implementation: avx2
Security model: constbranchindex
Compiler: clang -march=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
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_dilithium2aes_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:51:9: error: always_inline function '_mm256_srai_epi32' requires target feature 'avx2', but would be inlined into function 'crypto_sign_dilithium2aes_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:52:9: error: always_inline function '_mm256_mullo_epi32' requires target feature 'avx2', but would be inlined into function 'crypto_sign_dilithium2aes_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:53:9: error: always_inline function '_mm256_sub_epi32' requires target feature 'avx2', but would be inlined into function 'crypto_sign_dilithium2aes_avx2_constbranchindex_poly_reduce' that is compiled without support for 'avx2'
poly.c: f = _mm256_sub_epi32(f,g);
poly.c: ^
poly.c: 4 errors generated.

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-7/lib/clang/7.0.1/include/__wmmintrin_aes.h:150: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-7/lib/clang/7.0.1/include/__wmmintrin_aes.h:150: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-7/lib/clang/7.0.1/include/__wmmintrin_aes.h:150: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: In file included from /usr/lib/gcc/x86_64-linux-gnu/8/include/immintrin.h:43,
poly.c: from poly.c:2:
poly.c: poly.c: In function 'crypto_sign_dilithium2aes_avx2_constbranchindex_poly_reduce':
poly.c: /usr/lib/gcc/x86_64-linux-gnu/8/include/avx2intrin.h:815:1: error: inlining failed in call to always_inline '_mm256_sub_epi32': target specific option mismatch
poly.c: _mm256_sub_epi32 (__m256i __A, __m256i __B)
poly.c: ^~~~~~~~~~~~~~~~
poly.c: poly.c:53:9: note: called from here
poly.c: f = _mm256_sub_epi32(f,g);
poly.c: ^~~~~~~~~~~~~~~~~~~~~
poly.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/8/include/immintrin.h:43,
poly.c: from poly.c:2:
poly.c: /usr/lib/gcc/x86_64-linux-gnu/8/include/avx2intrin.h:560:1: error: inlining failed in call to always_inline '_mm256_mullo_epi32': target specific option mismatch
poly.c: _mm256_mullo_epi32 (__m256i __A, __m256i __B)
poly.c: ^~~~~~~~~~~~~~~~~~
poly.c: poly.c:52:9: note: called from here
poly.c: g = _mm256_mullo_epi32(g,q);
poly.c: ^~~~~~~~~~~~~~~~~~~~~~~
poly.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/8/include/immintrin.h:43,
poly.c: from poly.c:2:
poly.c: /usr/lib/gcc/x86_64-linux-gnu/8/include/avx2intrin.h:724:1: error: inlining failed in call to always_inline '_mm256_srai_epi32': target specific option mismatch
poly.c: _mm256_srai_epi32 (__m256i __A, int __B)
poly.c: ^~~~~~~~~~~~~~~~~
poly.c: poly.c:51:9: note: called from here
poly.c: g = _mm256_srai_epi32(g,23);
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