[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Broadcom BCM2709, ARMv8, and missing CPU features



> Using '.byte' below rather than '.inst' or '.inst.w' is another can of worms...
>
> $ gcc -g3 -O0 -march=armv7-a -mfpu=neon test.cc -o test.exe
> $ ./test.exe
> $
>
> $ cat test.cc
> #include <arm_neon.h>
> int main(int argc, char* argv[])
> {
>   __asm__ __volatile__
>   (
>     ".code 32"
>
>     // CRC using word
>     ".byte 0x1a, 0xc1, 0x58, 0x00;\n"
>     // CRC using half word
>     ".byte 0x1a, 0xc1, 0x54, 0x00;\n"
>     // CRC using byte
>     ".byte 0x1a, 0xc1, 0x50, 0x00;\n"
>     // PMULL
>     ".byte 0x0e, 0xe1, 0xe0, 0x00;\n"
>     // PMULL2
>     ".byte 0x4e, 0xe1, 0xe0, 0x00;\n"
>     // AES (aese)
>     ".byte 0x4e, 0x28, 0x48, 0x20;\n"
>     // AES (aesd)
>     ".byte 0x4e, 0x28, 0x58, 0x20;\n"
>     // SHA1 (sha1c)
>     ".byte 0x5e, 0x02, 0x00, 0x20;\n"
>     // SHA1 (sha1m)
>     ".byte 0x5e, 0x02, 0x20, 0x20;\n"
>     // SHA1 (sha1p)
>     ".byte 0x5e, 0x02, 0x30, 0x20;\n"
>       :
>       :
>       : "cc", "d0", "d1", "d2", "q0", "q1", "q2"
>   );
>
>   return 0;
> }

All that silliness was not needed. All that was needed was (and maybe
a float ABI flag):

   gcc -march=armv8-a+crc -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 ...

I can't believe I could not piece that together from the man pages....
(Thanks to the GCC and SO folks).

Jeff


Reply to: