Implementation notes: riscv64, riscvunleashed000, crypto_kem/lightsaber2

Computer: riscvunleashed000
Microarchitecture: riscv64; U54 (sifive,u54-mc)
Architecture: riscv64
CPU ID: unknown CPU ID
SUPERCOP version: 20240107
Operation: crypto_kem
Primitive: lightsaber2
TimeObject sizeTest sizeImplementationCompilerBenchmark dateSUPERCOP version
373757714667 0 029552 792 1592T:refclang_-mcpu=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024013120231222
373765114667 0 029552 792 1592T:refclang_-march=rv64imafdc_-mtune=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024013120231222
373935312027 0 026488 792 1592T:refclang_-march=rv64imafdc_-mtune=native_-O_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024013120231222
373990612027 0 026488 792 1592T:refclang_-march=rv64imafdc_-mtune=native_-O2_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024013120231222
374625310163 0 023046 784 1585T:refclang_-march=rv64imafdc_-mtune=native_-Os_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024013120231222

Compiler output

Implementation: T:avx2
Security model: timingleaks
Compiler: clang -march=rv64imafdc -mtune=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
SABER_indcpa.c: In file included from SABER_indcpa.c:5:
SABER_indcpa.c: In file included from ./SABER_indcpa.h:4:
SABER_indcpa.c: In file included from /usr/lib/llvm-10/lib/clang/10.0.0/include/immintrin.h:14:
SABER_indcpa.c: /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:50:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
SABER_indcpa.c: return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
SABER_indcpa.c: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SABER_indcpa.c: /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:129:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
SABER_indcpa.c: return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
SABER_indcpa.c: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SABER_indcpa.c: /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:159:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
SABER_indcpa.c: return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2);
SABER_indcpa.c: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SABER_indcpa.c: /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:189:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
SABER_indcpa.c: return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2);
SABER_indcpa.c: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SABER_indcpa.c: /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:216:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
SABER_indcpa.c: return (__m64)__builtin_ia32_punpckhbw((__v8qi)__m1, (__v8qi)__m2);
SABER_indcpa.c: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SABER_indcpa.c: /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:239:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
SABER_indcpa.c: return (__m64)__builtin_ia32_punpckhwd((__v4hi)__m1, (__v4hi)__m2);
SABER_indcpa.c: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SABER_indcpa.c: /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:260:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
SABER_indcpa.c: return (__m64)__builtin_ia32_punpckhdq((__v2si)__m1, (__v2si)__m2);
SABER_indcpa.c: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SABER_indcpa.c: /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:287:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
SABER_indcpa.c: ...

Number of similar (compiler,implementation) pairs: 5, namely:
CompilerImplementations
clang -march=rv64imafdc -mtune=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:avx2
clang -march=rv64imafdc -mtune=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:avx2
clang -march=rv64imafdc -mtune=native -O -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:avx2
clang -march=rv64imafdc -mtune=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 -mcpu=sifive-u54 -O2 -fomit-frame-pointer -fwrapv -fPIC -fPIE
SABER_indcpa.c: In file included from SABER_indcpa.c:5:
SABER_indcpa.c: SABER_indcpa.h:4:10: fatal error: immintrin.h: No such file or directory
SABER_indcpa.c: 4 | #include <immintrin.h>
SABER_indcpa.c: | ^~~~~~~~~~~~~
SABER_indcpa.c: compilation terminated.

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

Compiler output

Implementation: T:avx2_nttmul
Security model: timingleaks
Compiler: clang -march=rv64imafdc -mtune=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
SABER_indcpa.c: In file included from SABER_indcpa.c:20:
SABER_indcpa.c: In file included from ./SABER_indcpa.h:4:
SABER_indcpa.c: In file included from /usr/lib/llvm-10/lib/clang/10.0.0/include/immintrin.h:14:
SABER_indcpa.c: /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:50:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
SABER_indcpa.c: return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
SABER_indcpa.c: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SABER_indcpa.c: /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:129:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
SABER_indcpa.c: return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
SABER_indcpa.c: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SABER_indcpa.c: /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:159:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
SABER_indcpa.c: return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2);
SABER_indcpa.c: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SABER_indcpa.c: /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:189:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
SABER_indcpa.c: return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2);
SABER_indcpa.c: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SABER_indcpa.c: /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:216:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
SABER_indcpa.c: return (__m64)__builtin_ia32_punpckhbw((__v8qi)__m1, (__v8qi)__m2);
SABER_indcpa.c: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SABER_indcpa.c: /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:239:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
SABER_indcpa.c: return (__m64)__builtin_ia32_punpckhwd((__v4hi)__m1, (__v4hi)__m2);
SABER_indcpa.c: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SABER_indcpa.c: /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:260:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
SABER_indcpa.c: return (__m64)__builtin_ia32_punpckhdq((__v2si)__m1, (__v2si)__m2);
SABER_indcpa.c: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SABER_indcpa.c: /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:287:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
SABER_indcpa.c: ...

Number of similar (compiler,implementation) pairs: 5, namely:
CompilerImplementations
clang -march=rv64imafdc -mtune=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:avx2_nttmul
clang -march=rv64imafdc -mtune=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:avx2_nttmul
clang -march=rv64imafdc -mtune=native -O -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:avx2_nttmul
clang -march=rv64imafdc -mtune=native -Os -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:avx2_nttmul
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 -mcpu=sifive-u54 -O2 -fomit-frame-pointer -fwrapv -fPIC -fPIE
SABER_indcpa.c: In file included from SABER_indcpa.c:20:
SABER_indcpa.c: SABER_indcpa.h:4:10: fatal error: immintrin.h: No such file or directory
SABER_indcpa.c: 4 | #include <immintrin.h>
SABER_indcpa.c: | ^~~~~~~~~~~~~
SABER_indcpa.c: compilation terminated.

Number of similar (compiler,implementation) pairs: 4, namely:
CompilerImplementations
gcc -mcpu=sifive-u54 -O2 -fomit-frame-pointer -fwrapv -fPIC -fPIE T:avx2_nttmul
gcc -mcpu=sifive-u54 -O3 -fomit-frame-pointer -fwrapv -fPIC -fPIE T:avx2_nttmul
gcc -mcpu=sifive-u54 -O -fomit-frame-pointer -fwrapv -fPIC -fPIE T:avx2_nttmul
gcc -mcpu=sifive-u54 -Os -fomit-frame-pointer -fwrapv -fPIC -fPIE T:avx2_nttmul

Compiler output

Implementation: T:ref
Security model: timingleaks
Compiler: gcc -mcpu=sifive-u54 -O2 -fomit-frame-pointer -fwrapv -fPIC -fPIE
try.c: /usr/bin/ld: libcrypto_kem_lightsaber2.a(SABER_indcpa.o):(.bss+0x0): multiple definition of `clock_cl_sm'; libcrypto_kem_lightsaber2.a(kem.o):(.bss+0x0): first defined here
try.c: /usr/bin/ld: libcrypto_kem_lightsaber2.a(SABER_indcpa.o):(.bss+0x8): multiple definition of `clock_kp_sm'; libcrypto_kem_lightsaber2.a(kem.o):(.bss+0x8): first defined here
try.c: /usr/bin/ld: libcrypto_kem_lightsaber2.a(SABER_indcpa.o):(.bss+0x10): multiple definition of `clock_cl_mv'; libcrypto_kem_lightsaber2.a(kem.o):(.bss+0x10): first defined here
try.c: /usr/bin/ld: libcrypto_kem_lightsaber2.a(SABER_indcpa.o):(.bss+0x18): multiple definition of `clock_kp_mv'; libcrypto_kem_lightsaber2.a(kem.o):(.bss+0x18): first defined here
try.c: /usr/bin/ld: libcrypto_kem_lightsaber2.a(SABER_indcpa.o):(.bss+0x20): multiple definition of `clock2'; libcrypto_kem_lightsaber2.a(kem.o):(.bss+0x20): first defined here
try.c: /usr/bin/ld: libcrypto_kem_lightsaber2.a(SABER_indcpa.o):(.bss+0x28): multiple definition of `clock1'; libcrypto_kem_lightsaber2.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 -mcpu=sifive-u54 -O2 -fomit-frame-pointer -fwrapv -fPIC -fPIE T:ref
gcc -mcpu=sifive-u54 -O3 -fomit-frame-pointer -fwrapv -fPIC -fPIE T:ref
gcc -mcpu=sifive-u54 -O -fomit-frame-pointer -fwrapv -fPIC -fPIE T:ref
gcc -mcpu=sifive-u54 -Os -fomit-frame-pointer -fwrapv -fPIC -fPIE T:ref