On Wed, 18 Nov 2020 00:20:38 +0000
Stuart Henderson <[email protected]> wrote:

> I've updated it (and fixed up deps). I've run the test suite on aarch64,
> amd64, i386 with no problems, it seems to have fairly good cross-arch
> compatibility but wouldn't hurt to get reports from other archs if anyone
> with those systems has time.

cryptopp has wrong powerpc* simd code; "make test" crashed on macppc.
"make build" failed on powerpc64.

On macppc, "./cryptest.exe v" got "Illegal instruction (core dumped)"
from a SIGILL in ppc_power7.cpp CPU_ProbePower7().  This file is built
with -mcpu=power7 -maltivec and the code tries to handle SIGILL:

bool CPU_ProbePower7()
{
    ...
    volatile SigHandler oldHandler = signal(SIGILL, SigIllHandler);
    ...
    signal(SIGILL, oldHandler);
    return result;
}

It crashed because clang put an "isel" after the second signal call,
and macppc hardware is older than power7.

(gdb) disas                                                                     
Dump of assembler code for function _ZN8CryptoPP15CPU_ProbePower7Ev:
...
   0x0cdcfd6c <+92>:    bl      0xce929fc <00008000.got2.plt_pic32.signal>
...
   0x0cdcfe38 <+296>:   bl      0xce929fc <00008000.got2.plt_pic32.signal>
...
=> 0x0cdcfe50 <+320>:   isel    r3,r3,r29,20
...

My powerpc64 has a POWER9, but "make build" failed, perhaps because
of confusion between unsigned long and unsigned long long for a 64-bit
integer.  I copied the first error below.  Later, if I find time, I
might try to send bug report to upstream.    --George


c++ -O2 -pipe -fPIC -Wno-unused -DNDEBUG -DCRYPTOPP_DISABLE_MIXED_ASM -mcpu=powe
r8 -maltivec -c gcm_simd.cpp
gcm_simd.cpp:190:29: error: no matching function for call to 'VecLoad'
        const uint64x2_p a1=VecLoad(wa1), b1=VecLoad(wb1);
                            ^~~~~~~
./ppc_simd.h:253:19: note: candidate function not viable: no known conversion
      from 'const uint64_t [2]' to 'const CryptoPP::byte *' (aka
      'const unsigned char *') for 1st argument
inline uint32x4_p VecLoad(const byte src[16])
                  ^
./ppc_simd.h:308:19: note: candidate function not viable: no known conversion
      from 'const uint64_t [2]' to 'const CryptoPP::word32 *' (aka
      'const unsigned int *') for 1st argument
inline uint32x4_p VecLoad(const word32 src[4])
                  ^
/ppc_simd.h:346:19: note: candidate function not viable: no known conversion
      from 'const uint64_t [2]' to 'const CryptoPP::word64 *' (aka
      'const unsigned long *') for 1st argument
inline uint64x2_p VecLoad(const word64 src[2])
                  ^
./ppc_simd.h:281:19: note: candidate function not viable: requires 2 arguments,
      but 1 was provided
inline uint32x4_p VecLoad(int off, const byte src[16])
                  ^
./ppc_simd.h:326:19: note: candidate function not viable: requires 2 arguments,
      but 1 was provided
inline uint32x4_p VecLoad(int off, const word32 src[4])
                  ^
./ppc_simd.h:365:19: note: candidate function not viable: requires 2 arguments,
      but 1 was provided
inline uint64x2_p VecLoad(int off, const word64 src[2])
                  ^

Reply via email to