Implementation notes: amd64, rumba5, crypto_dh/gls254

Computer: rumba5
Microarchitecture: amd64; Zen (800f11)
Architecture: amd64
CPU ID: AuthenticAMD-00800f11-178bfbff
SUPERCOP version: 20240107
Operation: crypto_dh
Primitive: gls254
TimeObject sizeTest sizeImplementationCompilerBenchmark dateSUPERCOP version
17090440438 196608 063267 197468 1760T:optclang_-march=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023121320231212
17119140438 196608 062891 197468 1760T:optclang_-march=native_-O2_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023121320231212
17223240678 196608 060075 197468 1728T:optclang_-march=native_-O_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023121320231212
180987129496 16 0151978 884 1760T:refclang_-march=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023121320231212
18389221986 196608 042125 197460 1792T:optclang_-march=native_-Os_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023121320231212
184414125184 16 0147354 884 1760T:refclang_-march=native_-O2_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023121320231212
185968124328 16 0143426 884 1728T:refclang_-march=native_-O_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023121320231212
18706422272 196608 044253 197428 1792T:optgcc_-march=native_-mtune=native_-O3_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023121320231212
19093922288 196608 043037 197428 1792T:optgcc_-march=native_-mtune=native_-O2_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023121320231212
19650124913 98336 047340 99164 1792T:refgcc_-march=native_-mtune=native_-O3_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023121320231212
198654145133 0 0167315 852 1760T:protclang_-march=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023121320231212
199196142437 0 0164291 852 1760T:protclang_-march=native_-O2_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023121320231212
199605113235 16 0133372 876 1792T:refclang_-march=native_-Os_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023121320231212
20339414617 98336 035780 99164 1792T:refgcc_-march=native_-mtune=native_-O2_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023121320231212
206371141117 0 0159915 852 1728T:protclang_-march=native_-O_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023121320231212
21096519270 196608 038333 197420 1760T:optgcc_-march=native_-mtune=native_-Os_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023121320231212
21126813507 98336 033772 99164 1792T:refgcc_-march=native_-mtune=native_-O_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023121320231212
21756121863 196608 042029 197428 1792T:optgcc_-march=native_-mtune=native_-O_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023121320231212
230559120554 0 0140421 844 1792T:protclang_-march=native_-Os_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023121320231212
23155333568 98304 055957 99124 1792T:protgcc_-march=native_-mtune=native_-O3_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023121320231212
25220115667 98304 035925 99124 1792T:protgcc_-march=native_-mtune=native_-O_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023121320231212
25332016564 98304 037685 99124 1792T:protgcc_-march=native_-mtune=native_-O2_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023121320231212

Test failure

Implementation: T:prot
Security model: timingleaks
Compiler: gcc -march=native -mtune=native -Os -fomit-frame-pointer -fwrapv -fPIC -fPIE
error 111

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

Compiler output

Implementation: T:opt
Security model: timingleaks
Compiler: clang -mcpu=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
dh.c: In file included from dh.c:10:
dh.c: ./ffa.h:94:5: error: '__builtin_ia32_pclmulqdq128' needs target feature pclmul
dh.c: low_kts_stp(op00,op10,k00,k02,op01,op11,r00,r01,r02,0x00); /* a0xb0 */
dh.c: ^
dh.c: ./ffa.h:62:11: note: expanded from macro 'low_kts_stp'
dh.c: re0 = _mm_clmulepi64_si128(op0, op1, ord);\
dh.c: ^
dh.c: /usr/lib/llvm-14/lib/clang/14.0.0/include/__wmmintrin_pclmul.h:45:13: note: expanded from macro '_mm_clmulepi64_si128'
dh.c: ((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(X), \
dh.c: ^
dh.c: In file included from dh.c:10:
dh.c: ./ffa.h:94:5: error: '__builtin_ia32_pclmulqdq128' needs target feature pclmul
dh.c: ./ffa.h:63:11: note: expanded from macro 'low_kts_stp'
dh.c: re1 = _mm_clmulepi64_si128(op2, op3, ord);\
dh.c: ^
dh.c: /usr/lib/llvm-14/lib/clang/14.0.0/include/__wmmintrin_pclmul.h:45:13: note: expanded from macro '_mm_clmulepi64_si128'
dh.c: ((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(X), \
dh.c: ^
dh.c: In file included from dh.c:10:
dh.c: ./ffa.h:94:5: error: '__builtin_ia32_pclmulqdq128' needs target feature pclmul
dh.c: ./ffa.h:64:11: note: expanded from macro 'low_kts_stp'
dh.c: re2 = _mm_clmulepi64_si128(op4, op5, ord);\
dh.c: ^
dh.c: /usr/lib/llvm-14/lib/clang/14.0.0/include/__wmmintrin_pclmul.h:45:13: note: expanded from macro '_mm_clmulepi64_si128'
dh.c: ((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(X), \
dh.c: ...

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

Compiler output

Implementation: T:prot
Security model: timingleaks
Compiler: clang -march=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
dh.c: In file included from dh.c:9:
dh.c: ./scmul.incl:273:17: warning: implicit declaration of function 'types_cond_copy2' is invalid in C99 [-Wimplicit-function-declaration]
dh.c: types_cond_copy2(tab0, tab4, tabx, n1, n2);
dh.c: ^
dh.c: ./scmul.incl:284:9: warning: implicit declaration of function 'types_cond_copy' is invalid in C99 [-Wimplicit-function-declaration]
dh.c: types_cond_copy(QX, tab0, o1);
dh.c: ^
dh.c: 2 warnings generated.

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

Compiler output

Implementation: T:prot
Security model: timingleaks
Compiler: clang -mcpu=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
dh.c: In file included from dh.c:7:
dh.c: ./low.incl:26:2: error: '__builtin_ia32_pclmulqdq128' needs target feature pclmul
dh.c: MUL4(m1, m0, ma, mb);
dh.c: ^
dh.c: ./gls254.h:155:7: note: expanded from macro 'MUL4'
dh.c: r0 = _mm_clmulepi64_si128(ma, mb, 0x00);\
dh.c: ^
dh.c: /usr/lib/llvm-14/lib/clang/14.0.0/include/__wmmintrin_pclmul.h:45:13: note: expanded from macro '_mm_clmulepi64_si128'
dh.c: ((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(X), \
dh.c: ^
dh.c: In file included from dh.c:7:
dh.c: ./low.incl:26:2: error: '__builtin_ia32_pclmulqdq128' needs target feature pclmul
dh.c: ./gls254.h:156:7: note: expanded from macro 'MUL4'
dh.c: r1 = _mm_clmulepi64_si128(ma, mb, 0x11);\
dh.c: ^
dh.c: /usr/lib/llvm-14/lib/clang/14.0.0/include/__wmmintrin_pclmul.h:45:13: note: expanded from macro '_mm_clmulepi64_si128'
dh.c: ((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(X), \
dh.c: ^
dh.c: In file included from dh.c:7:
dh.c: ./low.incl:26:2: error: '__builtin_ia32_pclmulqdq128' needs target feature pclmul
dh.c: ./gls254.h:157:7: note: expanded from macro 'MUL4'
dh.c: t0 = _mm_clmulepi64_si128(t0, t0, 0x10);\
dh.c: ^
dh.c: /usr/lib/llvm-14/lib/clang/14.0.0/include/__wmmintrin_pclmul.h:45:13: note: expanded from macro '_mm_clmulepi64_si128'
dh.c: ((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(X), \
dh.c: ...

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

Compiler output

Implementation: T:prot
Security model: timingleaks
Compiler: gcc -march=native -mtune=native -O2 -fomit-frame-pointer -fwrapv -fPIC -fPIE
dh.c: In file included from dh.c:9:
dh.c: scmul.incl: In function 'scmul_rand_wreg':
dh.c: scmul.incl:273:17: warning: implicit declaration of function 'types_cond_copy2'; did you mean 'types_copy'? [-Wimplicit-function-declaration]
dh.c: 273 | types_cond_copy2(tab0, tab4, tabx, n1, n2);
dh.c: | ^~~~~~~~~~~~~~~~
dh.c: | types_copy
dh.c: scmul.incl:284:9: warning: implicit declaration of function 'types_cond_copy'; did you mean 'types_copy'? [-Wimplicit-function-declaration]
dh.c: 284 | types_cond_copy(QX, tab0, o1);
dh.c: | ^~~~~~~~~~~~~~~
dh.c: | types_copy

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

Compiler output

Implementation: T:ref
Security model: timingleaks
Compiler: clang -march=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
dh.c: In file included from dh.c:9:
dh.c: ./scmul.incl:204:14: warning: & has lower precedence than ==; == will be evaluated first [-Wparentheses]
dh.c: if (num[0] & 0x1 == 1) {
dh.c: ^~~~~~~~~~
dh.c: ./scmul.incl:204:14: note: place parentheses around the '==' expression to silence this warning
dh.c: if (num[0] & 0x1 == 1) {
dh.c: ^
dh.c: ( )
dh.c: ./scmul.incl:204:14: note: place parentheses around the & expression to evaluate it first
dh.c: if (num[0] & 0x1 == 1) {
dh.c: ^
dh.c: ( )
dh.c: 1 warning generated.

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

Compiler output

Implementation: T:ref
Security model: timingleaks
Compiler: clang -mcpu=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
dh.c: In file included from dh.c:6:
dh.c: ./curves.incl:53:2: error: '__builtin_ia32_aeskeygenassist128' needs target feature aes
dh.c: STEP(k, t, tmp, 16*1, 0x01);
dh.c: ^
dh.c: ./gls254.h:272:6: note: expanded from macro 'STEP'
dh.c: t = _mm_aeskeygenassist_si128(k, rcon);\
dh.c: ^
dh.c: /usr/lib/llvm-14/lib/clang/14.0.0/include/__wmmintrin_aes.h:136:13: note: expanded from macro '_mm_aeskeygenassist_si128'
dh.c: ((__m128i)__builtin_ia32_aeskeygenassist128((__v2di)(__m128i)(C), (int)(R)))
dh.c: ^
dh.c: In file included from dh.c:6:
dh.c: ./curves.incl:54:2: error: '__builtin_ia32_aeskeygenassist128' needs target feature aes
dh.c: STEP(k, t, tmp, 16*2, 0x02);
dh.c: ^
dh.c: ./gls254.h:272:6: note: expanded from macro 'STEP'
dh.c: t = _mm_aeskeygenassist_si128(k, rcon);\
dh.c: ^
dh.c: /usr/lib/llvm-14/lib/clang/14.0.0/include/__wmmintrin_aes.h:136:13: note: expanded from macro '_mm_aeskeygenassist_si128'
dh.c: ((__m128i)__builtin_ia32_aeskeygenassist128((__v2di)(__m128i)(C), (int)(R)))
dh.c: ^
dh.c: In file included from dh.c:6:
dh.c: ./curves.incl:55:2: error: '__builtin_ia32_aeskeygenassist128' needs target feature aes
dh.c: STEP(k, t, tmp, 16*3, 0x04);
dh.c: ^
dh.c: ./gls254.h:272:6: note: expanded from macro 'STEP'
dh.c: ...

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