This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ARM/AAarch64: NEON intrinsics in the kernel
- From: Ard Biesheuvel <ard dot biesheuvel at linaro dot org>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: gcc at gcc dot gnu dot org, Christophe Lyon <christophe dot lyon at linaro dot org>, Matthew Gretton-Dann <matthew dot gretton-dann at linaro dot org>, richard dot earnshaw at arm dot com, ramana dot radhakrishnan at arm dot com, marcus dot shawcroft at arm dot com
- Date: Tue, 21 May 2013 18:37:47 +0200
- Subject: Re: ARM/AAarch64: NEON intrinsics in the kernel
- References: <CAKv+Gu-FaFnODdcVtdtrVsoJmE95vgdvcicRQ7N9_MvKuFXd8w at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1305211620060 dot 1971 at digraph dot polyomino dot org dot uk>
On 21 May 2013 18:22, Joseph S. Myers <joseph@codesourcery.com> wrote:
> On Tue, 21 May 2013, Ard Biesheuvel wrote:
>
>> I am currently exploring various ways of using NEON instructions in
>> kernel mode. One of the ways of doing so is using NEON intrinsics,
>> which we would like to support in the kernel, but unfortunately, at
>> the moment we can't because the support header arm_neon.h assumes C99
>> conformance and includes <stdint.h>. The kernel does not supply that
>> header.
>
> GCC, however, does, and for Linux targets it installs stdint-wrap.h which
> for freestanding builds includes stdint-gcc.h rather than depending on the
> C library to provide the header. So as long as the kernel build uses
> -ffreestanding, it should not matter that the kernel doesn't have its own
> stdint.h.
>
I am aware of that. However, depending on whether your GCC was built
to target bare metal or glibc, the definition for uintptr_t that you
get as a bonus from including stdint-gcc.h (a type which arm_neon.h
itself does not require) conflicts with the one that the kernel
defines. (bare metal and the kernel both use unsigned long, whereas
glibc uses unsigned int) As it is quite customary to use a glibc
targeted GCC to build the kernel, I would like to avoid being the one
to introduce the restriction that only bare metal compilers can build
the kernel. (Note that the kernel does not define -ffreestanding by
default, although it mostly compiles fine with it)
--
Ard.