[Arm-dev] Raspberry Pi 3 and Aarch64 image?

Jeffrey Walton noloader at gmail.com
Thu Jul 28 12:03:57 UTC 2016


> This program below compiles and executes successfully. It does not
> generate an "illegal instruction" like I thought would happen.
>
> $ 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;
> }
>
> $ gcc -g3 -O0 -march=armv7-a -mfpu=neon test.cc -o test.exe
> $ ./test.exe
> $
>

All that silliness was not needed. All that was needed was:

   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


More information about the Arm-dev mailing list