Implementation notes: riscv64, riscvunleashed000, crypto_aead/pi64cipher128v2

Computer: riscvunleashed000
Microarchitecture: riscv64; U54 (sifive,u54-mc)
Architecture: riscv64
CPU ID: unknown CPU ID
SUPERCOP version: 20240107
Operation: crypto_aead
Primitive: pi64cipher128v2
TimeObject sizeTest sizeImplementationCompilerBenchmark dateSUPERCOP version
3400716495 8 017795 792 848T:ref3clang_-march=rv64imafdc_-mtune=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
3400996495 8 017795 792 848T:ref3clang_-mcpu=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
34872524147 8 032583 792 848T:goptvgcc_-mcpu=sifive-u54_-O_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
3822067323 8 018363 784 848T:ref2clang_-march=rv64imafdc_-mtune=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
3826717323 8 018363 784 848T:ref2clang_-mcpu=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
4280816073 8 016949 792 848T:ref3clang_-march=rv64imafdc_-mtune=native_-O2_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
4280886073 8 016949 792 848T:ref3clang_-march=rv64imafdc_-mtune=native_-O_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
4752177063 8 017699 784 848T:ref2clang_-march=rv64imafdc_-mtune=native_-O2_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
4752177063 8 017699 784 848T:ref2clang_-march=rv64imafdc_-mtune=native_-O_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
5609016763 8 017147 792 848T:ref3gcc_-mcpu=sifive-u54_-O3_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
5637205257 8 013977 792 848T:ref3gcc_-mcpu=sifive-u54_-O2_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
57880335309 8 043971 792 848T:goptvgcc_-mcpu=sifive-u54_-O2_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
5946384107 8 012615 792 848T:ref3gcc_-mcpu=sifive-u54_-O_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
62759327613 8 037891 792 848T:goptvgcc_-mcpu=sifive-u54_-O3_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
6806213881 8 011871 776 848T:ref3gcc_-mcpu=sifive-u54_-Os_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
7059218871 8 016437 776 848T:goptvgcc_-mcpu=sifive-u54_-Os_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
7964124045 8 013223 784 841T:ref3clang_-march=rv64imafdc_-mtune=native_-Os_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
17318735353 8 013971 792 848T:ref2gcc_-mcpu=sifive-u54_-O2_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
19785544343 8 012247 776 848T:ref2gcc_-mcpu=sifive-u54_-Os_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
21140124585 8 013011 792 848T:ref2gcc_-mcpu=sifive-u54_-O_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
21724304155 8 013163 776 841T:ref2clang_-march=rv64imafdc_-mtune=native_-Os_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222

Test failure

Implementation: T:optimized_nonSSE
Security model: timingleaks
Compiler: clang -march=rv64imafdc -mtune=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
error 111
crypto_aead_encrypt returns more than crypto_aead_ABYTES extra bytes

Number of similar (compiler,implementation) pairs: 18, namely:
CompilerImplementations
clang -march=rv64imafdc -mtune=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:optimized_nonSSE
clang -march=rv64imafdc -mtune=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:optimized_nonSSE
clang -march=rv64imafdc -mtune=native -O -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:optimized_nonSSE
clang -march=rv64imafdc -mtune=native -Os -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:optimized_nonSSE
clang -mcpu=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:optimized_nonSSE
gcc -mcpu=sifive-u54 -O2 -fomit-frame-pointer -fwrapv -fPIC -fPIE T:optimized_nonSSE
gcc -mcpu=sifive-u54 -O3 -fomit-frame-pointer -fwrapv -fPIC -fPIE T:optimized_nonSSE
gcc -mcpu=sifive-u54 -O -fomit-frame-pointer -fwrapv -fPIC -fPIE T:optimized_nonSSE
gcc -mcpu=sifive-u54 -Os -fomit-frame-pointer -fwrapv -fPIC -fPIE T:optimized_nonSSE
clang -march=rv64imafdc -mtune=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:ref
clang -march=rv64imafdc -mtune=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:ref
clang -march=rv64imafdc -mtune=native -O -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:ref
clang -march=rv64imafdc -mtune=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
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

Compiler output

Implementation: T:goptv
Security model: timingleaks
Compiler: clang -march=rv64imafdc -mtune=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
pi-cipher.c: pi-cipher.c:286:9: error: use of unknown builtin '__builtin_shuffle' [-Wimplicit-function-declaration]
pi-cipher.c: n_t += __builtin_shuffle(y, g_mask);
pi-cipher.c: ^
pi-cipher.c: pi-cipher.c:305:9: error: use of unknown builtin '__builtin_shuffle' [-Wimplicit-function-declaration]
pi-cipher.c: m_t += __builtin_shuffle(x, g_mask);
pi-cipher.c: ^
pi-cipher.c: pi-cipher.c:354:9: error: use of unknown builtin '__builtin_shuffle' [-Wimplicit-function-declaration]
pi-cipher.c: m_t += __builtin_shuffle(x, g_mask);
pi-cipher.c: ^
pi-cipher.c: 3 errors generated.

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

Compiler output

Implementation: T:goptv
Security model: timingleaks
Compiler: gcc -mcpu=sifive-u54 -O3 -fomit-frame-pointer -fwrapv -fPIC -fPIE
pi-cipher.c: pi-cipher.c: In function 'pi64_init':
pi-cipher.c: pi-cipher.c:842:5: warning: 'pi' accessing 128 bytes in a region of size 32 [-Wstringop-overflow=]
pi-cipher.c: 842 | pi(ctx->cis);
pi-cipher.c: | ^~~~~~~~~~~~
pi-cipher.c: pi-cipher.c:842:5: note: referencing argument 1 of type 'word_t (*)[4]' {aka 'long unsigned int (*)[4]'}
pi-cipher.c: pi-cipher.c:649:13: note: in a call to function 'pi'
pi-cipher.c: 649 | static void pi(
pi-cipher.c: | ^~

Number of similar (compiler,implementation) pairs: 1, namely:
CompilerImplementations
gcc -mcpu=sifive-u54 -O3 -fomit-frame-pointer -fwrapv -fPIC -fPIE T:goptv

Compiler output

Implementation: T:ref2
Security model: timingleaks
Compiler: gcc -mcpu=sifive-u54 -O2 -fomit-frame-pointer -fwrapv -fPIC -fPIE
pi-cipher.c: In function 'mu',
pi-cipher.c: inlined from 'ast' at pi-cipher.c:257:5:
pi-cipher.c: pi-cipher.c:226:5: warning: 'phi' reading 8 bytes from a region of size 4 [-Wstringop-overread]
pi-cipher.c: 226 | phi(t, x, mu_const, mu_v_const, mu_rot_const);
pi-cipher.c: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pi-cipher.c: pi-cipher.c: In function 'ast':
pi-cipher.c: pi-cipher.c:226:5: note: referencing argument 4 of type 'const uint8_t *' {aka 'const unsigned char *'}
pi-cipher.c: pi-cipher.c:175:13: note: in a call to function 'phi'
pi-cipher.c: 175 | static void phi(
pi-cipher.c: | ^~~
pi-cipher.c: In function 'ny',
pi-cipher.c: inlined from 'ast' at pi-cipher.c:258:5:
pi-cipher.c: pi-cipher.c:237:5: warning: 'phi' reading 8 bytes from a region of size 4 [-Wstringop-overread]
pi-cipher.c: 237 | phi(dest, x, ny_const, ny_v_const, ny_rot_const);
pi-cipher.c: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pi-cipher.c: pi-cipher.c: In function 'ast':
pi-cipher.c: pi-cipher.c:237:5: note: referencing argument 4 of type 'const uint8_t *' {aka 'const unsigned char *'}
pi-cipher.c: pi-cipher.c:175:13: note: in a call to function 'phi'
pi-cipher.c: 175 | static void phi(
pi-cipher.c: | ^~~

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

Compiler output

Implementation: T:ref2
Security model: timingleaks
Compiler: gcc -mcpu=sifive-u54 -O3 -fomit-frame-pointer -fwrapv -fPIC -fPIE
pi-cipher.c: In function 'mu',
pi-cipher.c: inlined from 'ast' at pi-cipher.c:257:5,
pi-cipher.c: inlined from 'e1' at pi-cipher.c:271:9,
pi-cipher.c: inlined from 'pi' at pi-cipher.c:305:9:
pi-cipher.c: pi-cipher.c:226:5: warning: 'phi' reading 8 bytes from a region of size 4 [-Wstringop-overread]
pi-cipher.c: 226 | phi(t, x, mu_const, mu_v_const, mu_rot_const);
pi-cipher.c: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pi-cipher.c: pi-cipher.c: In function 'pi':
pi-cipher.c: pi-cipher.c:226:5: note: referencing argument 4 of type 'const uint8_t *' {aka 'const unsigned char *'}
pi-cipher.c: pi-cipher.c:175:13: note: in a call to function 'phi'
pi-cipher.c: 175 | static void phi(
pi-cipher.c: | ^~~
pi-cipher.c: In function 'ny',
pi-cipher.c: inlined from 'ast' at pi-cipher.c:258:5,
pi-cipher.c: inlined from 'e1' at pi-cipher.c:271:9,
pi-cipher.c: inlined from 'pi' at pi-cipher.c:305:9:
pi-cipher.c: pi-cipher.c:237:5: warning: 'phi' reading 8 bytes from a region of size 4 [-Wstringop-overread]
pi-cipher.c: 237 | phi(dest, x, ny_const, ny_v_const, ny_rot_const);
pi-cipher.c: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pi-cipher.c: pi-cipher.c: In function 'pi':
pi-cipher.c: pi-cipher.c:237:5: note: referencing argument 4 of type 'const uint8_t *' {aka 'const unsigned char *'}
pi-cipher.c: pi-cipher.c:175:13: note: in a call to function 'phi'
pi-cipher.c: 175 | static void phi(
pi-cipher.c: | ^~~
pi-cipher.c: In function 'mu',
pi-cipher.c: ...

Number of similar (compiler,implementation) pairs: 1, namely:
CompilerImplementations
gcc -mcpu=sifive-u54 -O3 -fomit-frame-pointer -fwrapv -fPIC -fPIE T:ref2