From: Jean-Philippe Brucker <jean-philippe@linaro.org>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Song Liu <songliubraving@fb.com>,
Daniel Borkmann <daniel@iogearbox.net>,
Jakov Petrina <jakov.petrina@sartura.hr>,
john fastabend <john.fastabend@gmail.com>,
Alexei Starovoitov <ast@kernel.org>,
KP Singh <kpsingh@chromium.org>, Yonghong Song <yhs@fb.com>,
bpf <bpf@vger.kernel.org>, Andrii Nakryiko <andriin@fb.com>,
Martin Lau <kafai@fb.com>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH bpf] libbpf: Handle GCC built-in types for Arm NEON
Date: Wed, 12 Aug 2020 16:37:46 +0200 [thread overview]
Message-ID: <20200812143746.GB3112830@myrica> (raw)
In-Reply-To: <CAEf4Bza_Fchmy7sKT4=3Vs6wopk+yZU7g9o86CJNzeH4DY1c2A@mail.gmail.com>
On Tue, Aug 11, 2020 at 08:30:06PM -0700, Andrii Nakryiko wrote:
[...]
> > + /*
> > + * GCC emits typedefs to its internal __PolyXX_t types when compiling
> > + * Arm SIMD intrinsics. Alias them to the same standard types as Clang.
> > + */
> > + { "__Poly8_t", "unsigned char" },
> > + { "__Poly16_t", "unsigned short" },
> > + { "__Poly64_t", "unsigned long" },
>
> In the diff ([0]) that Daniel referenced, seems like they are adding
> poly64_t to ARM32. What prevents GCC from doing that (or maybe they've
> already done that). So instead of making unreliable assumptions, let's
> define it as "unsigned long long" instead?
Agreed. When writing this I had an older version of the ACLE doc
referenced in [0] and wanted to be consistent with the older clang
typedefs.
Thanks,
Jean
>
> [0] https://reviews.llvm.org/D79711
>
> > + { "__Poly128_t", "unsigned __int128" },
> > +};
> > +
> > +static void btf_dump_emit_int_def(struct btf_dump *d, __u32 id,
> > + const struct btf_type *t)
> > +{
> > + const char *name = btf_dump_type_name(d, id);
> > + int i;
> > +
> > + for (i = 0; i < ARRAY_SIZE(builtin_types); i++) {
> > + if (strcmp(name, builtin_types[i][0]) == 0) {
> > + btf_dump_printf(d, "typedef %s %s;\n\n",
> > + builtin_types[i][1], name);
> > + break;
> > + }
> > + }
> > +}
> > +
> > static void btf_dump_emit_enum_fwd(struct btf_dump *d, __u32 id,
> > const struct btf_type *t)
> > {
> > --
> > 2.27.0
> >
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2020-08-12 14:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-10 12:28 [PATCH bpf] libbpf: Handle GCC built-in types for Arm NEON Jean-Philippe Brucker
2020-08-11 14:10 ` Daniel Borkmann
2020-08-11 15:04 ` Jean-Philippe Brucker
2020-08-12 3:30 ` Andrii Nakryiko
2020-08-12 14:37 ` Jean-Philippe Brucker [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200812143746.GB3112830@myrica \
--to=jean-philippe@linaro.org \
--cc=andrii.nakryiko@gmail.com \
--cc=andriin@fb.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=jakov.petrina@sartura.hr \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@chromium.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox