Re: [PATCH bpf] libbpf: Handle GCC built-in types for Arm NEON
From: Jean-Philippe Brucker <hidden>
Date: 2020-08-12 14:38:05
Also in:
bpf
On Tue, Aug 11, 2020 at 08:30:06PM -0700, Andrii Nakryiko wrote: [...]
quoted
+ /* + * 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/D79711quoted
+ { "__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