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

Jeffrey Walton noloader at gmail.com
Wed Jul 27 23:25:17 UTC 2016


On Wed, Jul 27, 2016 at 11:51 AM, Jim Perrin <jperrin at centos.org> wrote:
>
>
> On 07/27/2016 10:15 AM, Karanbir Singh wrote:
>
>> then do we need from there to get a CentOS userspace in as well ?
>
>
> Unsure, but they're cheap so I ordered one this morning to play around
> and test. Hopefully it arrives before I start traveling next week.

Raspberry Pi provides an ARMv7 HF image, but the processor can consume
ARMv8. GCC cannot create ARMv8 programs for it because its configured
as armhf.

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
$

Related, checkout this odd-ness:

$ gcc -g3 -O0 -march=armv8-a+crc test.cc -o test.exe
< lots of error, requires NEON >

$ gcc -g3 -O0 -march=armv8-a+crc -mfpu=neon test.cc -o test.exe
$

So, we can actually enable CRC extensions by using armv8-a+crc. But we
can't enable other extensions:

$ gcc -g3 -O0 -march=armv8-a+crc+crypto -mfpu=neon test.cc -o test.exe
gcc: error: unrecognized argument in option ‘-march=armv8-a+crc+crypto’

I'm trying to get some feedback on ARM options from the GCC folks at
http://gcc.gnu.org/ml/gcc-help/2016-07/msg00067.html.

Jeff


More information about the Arm-dev mailing list