Implementation notes: riscv64, riscvunleashed000, crypto_aead/pi16cipher128v2

Computer: riscvunleashed000
Microarchitecture: riscv64; U54 (sifive,u54-mc)
Architecture: riscv64
CPU ID: unknown CPU ID
SUPERCOP version: 20240107
Operation: crypto_aead
Primitive: pi16cipher128v2
TimeObject sizeTest sizeImplementationCompilerBenchmark dateSUPERCOP version
16092637523 8 018855 792 848T:ref3clang_-march=rv64imafdc_-mtune=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
16095467523 8 018855 792 848T:ref3clang_-mcpu=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
16579569757 8 020963 784 848T:ref2clang_-mcpu=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
16579869757 8 020963 784 848T:ref2clang_-march=rv64imafdc_-mtune=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
19206869431 8 020209 784 848T:ref2clang_-march=rv64imafdc_-mtune=native_-O2_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
19213099431 8 020209 784 848T:ref2clang_-march=rv64imafdc_-mtune=native_-O_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
19265128021 8 018905 792 848T:ref3clang_-march=rv64imafdc_-mtune=native_-O_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
19287618021 8 018905 792 848T:ref3clang_-march=rv64imafdc_-mtune=native_-O2_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
199655757937 8 068251 792 848T:goptvgcc_-mcpu=sifive-u54_-O3_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
25189753647 8 012831 784 841T:ref3clang_-march=rv64imafdc_-mtune=native_-Os_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2024011720231222
264328118967 8 027315 792 848T:goptvgcc_-mcpu=sifive-u54_-O_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
27649814015 8 012507 792 848T:ref3gcc_-mcpu=sifive-u54_-O_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
28401129611 8 017245 776 848T:goptvgcc_-mcpu=sifive-u54_-Os_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
28628473795 8 011765 776 848T:ref3gcc_-mcpu=sifive-u54_-Os_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
29621965395 8 014121 792 848T:ref3gcc_-mcpu=sifive-u54_-O2_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
29716549171 8 019553 792 848T:ref3gcc_-mcpu=sifive-u54_-O3_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
336654823789 8 032385 792 848T:goptvgcc_-mcpu=sifive-u54_-O2_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
69608845095 8 013719 792 848T:ref2gcc_-mcpu=sifive-u54_-O2_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
81957504001 8 011917 776 848T:ref2gcc_-mcpu=sifive-u54_-Os_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
90833984171 8 012613 792 848T:ref2gcc_-mcpu=sifive-u54_-O_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2024011720231222
93083093943 8 012981 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:286:6: error: cannot convert between scalar type 'int' and vector type 'vchunk_t' (vector of 4 'word_t' values) as implicit conversion would cause truncation
pi-cipher.c: n_t += __builtin_shuffle(y, g_mask);
pi-cipher.c: ^
pi-cipher.c: pi-cipher.c:287:6: error: cannot convert between scalar type 'int' and vector type 'vchunk_t' (vector of 4 'word_t' values) as implicit conversion would cause truncation
pi-cipher.c: n_t += __builtin_shuffle(y, n_mask);
pi-cipher.c: ^
pi-cipher.c: pi-cipher.c:290:6: error: cannot convert between scalar type 'int' and vector type 'vchunk_t' (vector of 4 'word_t' values) as implicit conversion would cause truncation
pi-cipher.c: n_t ^= __builtin_shuffle(n_t, n_x_1) ^ __builtin_shuffle(n_t, n_x_2);
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:305:6: error: cannot convert between scalar type 'int' and vector type 'vchunk_t' (vector of 4 'word_t' values) as implicit conversion would cause truncation
pi-cipher.c: m_t += __builtin_shuffle(x, g_mask);
pi-cipher.c: ^
pi-cipher.c: pi-cipher.c:306:6: error: cannot convert between scalar type 'int' and vector type 'vchunk_t' (vector of 4 'word_t' values) as implicit conversion would cause truncation
pi-cipher.c: m_t += __builtin_shuffle(x, m_mask);
pi-cipher.c: ^
pi-cipher.c: pi-cipher.c:309:6: error: cannot convert between scalar type 'int' and vector type 'vchunk_t' (vector of 4 'word_t' values) as implicit conversion would cause truncation
pi-cipher.c: m_t ^= __builtin_shuffle(m_t, m_x_1) ^ __builtin_shuffle(m_t, m_x_2);
pi-cipher.c: ^
pi-cipher.c: pi-cipher.c:354:9: error: use of unknown builtin '__builtin_shuffle' [-Wimplicit-function-declaration]
pi-cipher.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: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 'pi16_init':
pi-cipher.c: pi-cipher.c:842:5: warning: 'pi' accessing 32 bytes in a region of size 8 [-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 'short 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