Implementation notes: amd64, hydra8, crypto_kem/firesaber2

Computer: hydra8
Microarchitecture: amd64; Ivy Bridge+AES (306a9)
Architecture: amd64
CPU ID: GenuineIntel-000306a9-bfebfbff
SUPERCOP version: 20240107
Operation: crypto_kem
Primitive: firesaber2

Compiler output

Implementation: T:avx2
Security model: timingleaks
Compiler: clang -march=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
SABER_indcpa.c: In file included from SABER_indcpa.c:9:
SABER_indcpa.c: In file included from ././polymul/toom-cook_4way.c:6:
SABER_indcpa.c: ././polymul/scm_avx.c:43:9: error: always_inline function '_mm256_mullo_epi16' requires target feature 'avx2', but would be inlined into function 'schoolbook_avx_new3_acc' that is compiled without support for 'avx2'
SABER_indcpa.c: temp = _mm256_mullo_epi16 (a0, b1);
SABER_indcpa.c: ^
SABER_indcpa.c: ././polymul/scm_avx.c:45:13: error: always_inline function '_mm256_add_epi16' requires target feature 'avx2', but would be inlined into function 'schoolbook_avx_new3_acc' that is compiled without support for 'avx2'
SABER_indcpa.c: c_avx[1] = _mm256_add_epi16(temp, c_avx[1]);
SABER_indcpa.c: ^
SABER_indcpa.c: ././polymul/scm_avx.c:48:9: error: always_inline function '_mm256_mullo_epi16' requires target feature 'avx2', but would be inlined into function 'schoolbook_avx_new3_acc' that is compiled without support for 'avx2'
SABER_indcpa.c: temp = _mm256_mullo_epi16 (a0, b2);
SABER_indcpa.c: ^
SABER_indcpa.c: ././polymul/scm_avx.c:51:13: error: always_inline function '_mm256_add_epi16' requires target feature 'avx2', but would be inlined into function 'schoolbook_avx_new3_acc' that is compiled without support for 'avx2'
SABER_indcpa.c: c_avx[2] = _mm256_add_epi16(temp, c_avx[2]);
SABER_indcpa.c: ^
SABER_indcpa.c: ././polymul/scm_avx.c:54:9: error: always_inline function '_mm256_mullo_epi16' requires target feature 'avx2', but would be inlined into function 'schoolbook_avx_new3_acc' that is compiled without support for 'avx2'
SABER_indcpa.c: temp = _mm256_mullo_epi16 (a0, b3);
SABER_indcpa.c: ^
SABER_indcpa.c: ././polymul/scm_avx.c:58:13: error: always_inline function '_mm256_add_epi16' requires target feature 'avx2', but would be inlined into function 'schoolbook_avx_new3_acc' that is compiled without support for 'avx2'
SABER_indcpa.c: c_avx[3] = _mm256_add_epi16(temp, c_avx[3]);
SABER_indcpa.c: ^
SABER_indcpa.c: ././polymul/scm_avx.c:60:9: error: always_inline function '_mm256_mullo_epi16' requires target feature 'avx2', but would be inlined into function 'schoolbook_avx_new3_acc' that is compiled without support for 'avx2'
SABER_indcpa.c: temp = _mm256_mullo_epi16 (a0, b4);
SABER_indcpa.c: ^
SABER_indcpa.c: ././polymul/scm_avx.c:65:13: error: always_inline function '_mm256_add_epi16' requires target feature 'avx2', but would be inlined into function 'schoolbook_avx_new3_acc' that is compiled without support for 'avx2'
SABER_indcpa.c: c_avx[4] = _mm256_add_epi16(temp, c_avx[4]);
SABER_indcpa.c: ...

Number of similar (compiler,implementation) pairs: 4, 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

Compiler output

Implementation: T:avx2
Security model: timingleaks
Compiler: clang -mcpu=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
SABER_indcpa.c: In file included from SABER_indcpa.c:9:
SABER_indcpa.c: In file included from ././polymul/toom-cook_4way.c:6:
SABER_indcpa.c: ././polymul/scm_avx.c:40:13: warning: AVX vector argument of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI [-Wpsabi]
SABER_indcpa.c: c_avx[0] = mul_add(a0, b0, c_avx[0]);
SABER_indcpa.c: ^
SABER_indcpa.c: ././polymul/scm_avx.c:43:9: error: always_inline function '_mm256_mullo_epi16' requires target feature 'avx2', but would be inlined into function 'schoolbook_avx_new3_acc' that is compiled without support for 'avx2'
SABER_indcpa.c: temp = _mm256_mullo_epi16 (a0, b1);
SABER_indcpa.c: ^
SABER_indcpa.c: ././polymul/scm_avx.c:43:9: error: AVX vector argument of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
SABER_indcpa.c: ././polymul/scm_avx.c:44:7: warning: AVX vector argument of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI [-Wpsabi]
SABER_indcpa.c: temp=mul_add(a1, b0, temp);
SABER_indcpa.c: ^
SABER_indcpa.c: ././polymul/scm_avx.c:45:13: error: always_inline function '_mm256_add_epi16' requires target feature 'avx2', but would be inlined into function 'schoolbook_avx_new3_acc' that is compiled without support for 'avx2'
SABER_indcpa.c: c_avx[1] = _mm256_add_epi16(temp, c_avx[1]);
SABER_indcpa.c: ^
SABER_indcpa.c: ././polymul/scm_avx.c:45:13: error: AVX vector argument of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
SABER_indcpa.c: ././polymul/scm_avx.c:48:9: error: always_inline function '_mm256_mullo_epi16' requires target feature 'avx2', but would be inlined into function 'schoolbook_avx_new3_acc' that is compiled without support for 'avx2'
SABER_indcpa.c: temp = _mm256_mullo_epi16 (a0, b2);
SABER_indcpa.c: ^
SABER_indcpa.c: ././polymul/scm_avx.c:48:9: error: AVX vector argument of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
SABER_indcpa.c: ././polymul/scm_avx.c:49:9: warning: AVX vector argument of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI [-Wpsabi]
SABER_indcpa.c: temp = mul_add(a1, b1, temp);
SABER_indcpa.c: ^
SABER_indcpa.c: ././polymul/scm_avx.c:50:7: warning: AVX vector argument of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI [-Wpsabi]
SABER_indcpa.c: temp=mul_add(a2, b0, temp);
SABER_indcpa.c: ...

Number of similar (compiler,implementation) pairs: 1, namely:
CompilerImplementations
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
SABER_indcpa.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:47,
SABER_indcpa.c: from SABER_indcpa.h:4,
SABER_indcpa.c: from SABER_indcpa.c:5:
SABER_indcpa.c: ./polymul/scm_avx.c: In function 'mul_add':
SABER_indcpa.c: /usr/lib/gcc/x86_64-linux-gnu/11/include/avx2intrin.h:112:1: error: inlining failed in call to 'always_inline' '_mm256_add_epi16': target specific option mismatch
SABER_indcpa.c: 112 | _mm256_add_epi16 (__m256i __A, __m256i __B)
SABER_indcpa.c: | ^~~~~~~~~~~~~~~~
SABER_indcpa.c: In file included from ./polymul/toom-cook_4way.c:6,
SABER_indcpa.c: from SABER_indcpa.c:9:
SABER_indcpa.c: ./polymul/scm_avx.c:7:12: note: called from here
SABER_indcpa.c: 7 | return _mm256_add_epi16(_mm256_mullo_epi16(a, b), c);
SABER_indcpa.c: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SABER_indcpa.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:47,
SABER_indcpa.c: from SABER_indcpa.h:4,
SABER_indcpa.c: from SABER_indcpa.c:5:
SABER_indcpa.c: /usr/lib/gcc/x86_64-linux-gnu/11/include/avx2intrin.h:553:1: error: inlining failed in call to 'always_inline' '_mm256_mullo_epi16': target specific option mismatch
SABER_indcpa.c: 553 | _mm256_mullo_epi16 (__m256i __A, __m256i __B)
SABER_indcpa.c: | ^~~~~~~~~~~~~~~~~~
SABER_indcpa.c: In file included from ./polymul/toom-cook_4way.c:6,
SABER_indcpa.c: from SABER_indcpa.c:9:
SABER_indcpa.c: ./polymul/scm_avx.c:7:12: note: called from here
SABER_indcpa.c: 7 | return _mm256_add_epi16(_mm256_mullo_epi16(a, b), c);
SABER_indcpa.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:avx2_nttmul
Security model: timingleaks
Compiler: clang -march=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
poly.c: poly.c:43:10: error: always_inline function '_mm256_sub_epi16' requires target feature 'avx2', but would be inlined into function 'nttmul_poly_crt' that is compiled without support for 'avx2'
poly.c: f1 = _mm256_sub_epi16(f1,f0);
poly.c: ^
poly.c: poly.c:45:10: error: always_inline function '_mm256_mullo_epi16' requires target feature 'avx2', but would be inlined into function 'nttmul_poly_crt' that is compiled without support for 'avx2'
poly.c: f1 = _mm256_mullo_epi16(f1,p0);
poly.c: ^
poly.c: poly.c:46:10: error: always_inline function '_mm256_add_epi16' requires target feature 'avx2', but would be inlined into function 'nttmul_poly_crt' that is compiled without support for 'avx2'
poly.c: f0 = _mm256_add_epi16(f0,f1);
poly.c: ^
poly.c: poly.c:47:10: error: always_inline function '_mm256_and_si256' requires target feature 'avx2', but would be inlined into function 'nttmul_poly_crt' that is compiled without support for 'avx2'
poly.c: f0 = _mm256_and_si256(f0,mod);
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 T:avx2_nttmul
clang -march=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:avx2_nttmul
clang -march=native -O -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:avx2_nttmul
clang -march=native -Os -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:avx2_nttmul

Compiler output

Implementation: T:avx2_nttmul
Security model: timingleaks
Compiler: clang -mcpu=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
poly.c: poly.c:31:26: error: always_inline function '_mm256_set1_epi16' requires target feature 'avx', but would be inlined into function 'nttmul_poly_crt' that is compiled without support for 'avx'
poly.c: const __m256i u_pinv = _mm256_set1_epi16(CRT_U_PINV);
poly.c: ^
poly.c: poly.c:31:26: error: AVX vector return of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
poly.c: poly.c:32:21: error: always_inline function '_mm256_set1_epi16' requires target feature 'avx', but would be inlined into function 'nttmul_poly_crt' that is compiled without support for 'avx'
poly.c: const __m256i u = _mm256_set1_epi16(CRT_U);
poly.c: ^
poly.c: poly.c:32:21: error: AVX vector return of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
poly.c: poly.c:33:22: error: always_inline function '_mm256_load_si256' requires target feature 'avx', but would be inlined into function 'nttmul_poly_crt' that is compiled without support for 'avx'
poly.c: const __m256i p0 = _mm256_load_si256((__m256i *)&PDATA0[_16XP]);
poly.c: ^
poly.c: poly.c:33:22: error: AVX vector return of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
poly.c: poly.c:34:22: error: always_inline function '_mm256_load_si256' requires target feature 'avx', but would be inlined into function 'nttmul_poly_crt' that is compiled without support for 'avx'
poly.c: const __m256i p1 = _mm256_load_si256((__m256i *)&PDATA1[_16XP]);
poly.c: ^
poly.c: poly.c:34:22: error: AVX vector return of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
poly.c: poly.c:35:23: error: always_inline function '_mm256_set1_epi16' requires target feature 'avx', but would be inlined into function 'nttmul_poly_crt' that is compiled without support for 'avx'
poly.c: const __m256i mod = _mm256_set1_epi16(KEM_Q-1);
poly.c: ^
poly.c: poly.c:35:23: error: AVX vector return of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
poly.c: poly.c:36:30: error: always_inline function '_mm256_load_si256' requires target feature 'avx', but would be inlined into function 'nttmul_poly_crt' that is compiled without support for 'avx'
poly.c: const __m256i mont0_pinv = _mm256_load_si256((__m256i *)&PDATA0[_16XMONT_PINV]);
poly.c: ^
poly.c: poly.c:36:30: error: AVX vector return of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
poly.c: poly.c:37:25: error: always_inline function '_mm256_load_si256' requires target feature 'avx', but would be inlined into function 'nttmul_poly_crt' that is compiled without support for 'avx'
poly.c: ...

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

Compiler output

Implementation: T:avx2_nttmul
Security model: timingleaks
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/11/include/immintrin.h:47,
poly.c: from poly.c:3:
poly.c: poly.c: In function 'mulmod':
poly.c: /usr/lib/gcc/x86_64-linux-gnu/11/include/avx2intrin.h:808:1: error: inlining failed in call to 'always_inline' '_mm256_sub_epi16': target specific option mismatch
poly.c: 808 | _mm256_sub_epi16 (__m256i __A, __m256i __B)
poly.c: | ^~~~~~~~~~~~~~~~
poly.c: poly.c:12:7: note: called from here
poly.c: 12 | t = _mm256_sub_epi16(u,t);
poly.c: | ^~~~~~~~~~~~~~~~~~~~~
poly.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:47,
poly.c: from poly.c:3:
poly.c: /usr/lib/gcc/x86_64-linux-gnu/11/include/avx2intrin.h:546:1: error: inlining failed in call to 'always_inline' '_mm256_mulhi_epi16': target specific option mismatch
poly.c: 546 | _mm256_mulhi_epi16 (__m256i __A, __m256i __B)
poly.c: | ^~~~~~~~~~~~~~~~~~
poly.c: poly.c:11:7: note: called from here
poly.c: 11 | t = _mm256_mulhi_epi16(t,p);
poly.c: | ^~~~~~~~~~~~~~~~~~~~~~~
poly.c: In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:47,
poly.c: from poly.c:3:
poly.c: /usr/lib/gcc/x86_64-linux-gnu/11/include/avx2intrin.h:546:1: error: inlining failed in call to 'always_inline' '_mm256_mulhi_epi16': target specific option mismatch
poly.c: 546 | _mm256_mulhi_epi16 (__m256i __A, __m256i __B)
poly.c: | ^~~~~~~~~~~~~~~~~~
poly.c: poly.c:10:7: note: called from here
poly.c: 10 | u = _mm256_mulhi_epi16(a,b);
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 T:avx2_nttmul
gcc -march=native -mtune=native -O3 -fomit-frame-pointer -fwrapv -fPIC -fPIE T:avx2_nttmul
gcc -march=native -mtune=native -O -fomit-frame-pointer -fwrapv -fPIC -fPIE T:avx2_nttmul
gcc -march=native -mtune=native -Os -fomit-frame-pointer -fwrapv -fPIC -fPIE T:avx2_nttmul

Compiler output

Implementation: T:ref
Security model: timingleaks
Compiler: clang -march=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
try.c: /usr/bin/ld: libcrypto_kem_firesaber2.a(SABER_indcpa.o):(.bss+0x0): multiple definition of `clock1'; libcrypto_kem_firesaber2.a(kem.o):(.bss+0x0): first defined here
try.c: /usr/bin/ld: libcrypto_kem_firesaber2.a(SABER_indcpa.o):(.bss+0x8): multiple definition of `clock2'; libcrypto_kem_firesaber2.a(kem.o):(.bss+0x8): first defined here
try.c: /usr/bin/ld: libcrypto_kem_firesaber2.a(SABER_indcpa.o):(.bss+0x10): multiple definition of `clock_kp_mv'; libcrypto_kem_firesaber2.a(kem.o):(.bss+0x10): first defined here
try.c: /usr/bin/ld: libcrypto_kem_firesaber2.a(SABER_indcpa.o):(.bss+0x18): multiple definition of `clock_cl_mv'; libcrypto_kem_firesaber2.a(kem.o):(.bss+0x18): first defined here
try.c: /usr/bin/ld: libcrypto_kem_firesaber2.a(SABER_indcpa.o):(.bss+0x20): multiple definition of `clock_kp_sm'; libcrypto_kem_firesaber2.a(kem.o):(.bss+0x20): first defined here
try.c: /usr/bin/ld: libcrypto_kem_firesaber2.a(SABER_indcpa.o):(.bss+0x28): multiple definition of `clock_cl_sm'; libcrypto_kem_firesaber2.a(kem.o):(.bss+0x28): first defined here
try.c: clang: error: linker command failed with exit code 1 (use -v to see invocation)

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

Compiler output

Implementation: T:ref
Security model: timingleaks
Compiler: gcc -march=native -mtune=native -O2 -fomit-frame-pointer -fwrapv -fPIC -fPIE
try.c: /usr/bin/ld: libcrypto_kem_firesaber2.a(SABER_indcpa.o):(.bss+0x0): multiple definition of `clock_cl_sm'; libcrypto_kem_firesaber2.a(kem.o):(.bss+0x0): first defined here
try.c: /usr/bin/ld: libcrypto_kem_firesaber2.a(SABER_indcpa.o):(.bss+0x8): multiple definition of `clock_kp_sm'; libcrypto_kem_firesaber2.a(kem.o):(.bss+0x8): first defined here
try.c: /usr/bin/ld: libcrypto_kem_firesaber2.a(SABER_indcpa.o):(.bss+0x10): multiple definition of `clock_cl_mv'; libcrypto_kem_firesaber2.a(kem.o):(.bss+0x10): first defined here
try.c: /usr/bin/ld: libcrypto_kem_firesaber2.a(SABER_indcpa.o):(.bss+0x18): multiple definition of `clock_kp_mv'; libcrypto_kem_firesaber2.a(kem.o):(.bss+0x18): first defined here
try.c: /usr/bin/ld: libcrypto_kem_firesaber2.a(SABER_indcpa.o):(.bss+0x20): multiple definition of `clock2'; libcrypto_kem_firesaber2.a(kem.o):(.bss+0x20): first defined here
try.c: /usr/bin/ld: libcrypto_kem_firesaber2.a(SABER_indcpa.o):(.bss+0x28): multiple definition of `clock1'; libcrypto_kem_firesaber2.a(kem.o):(.bss+0x28): first defined here
try.c: collect2: error: ld returned 1 exit status

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