Hi!
On Mon, Jan 30, 2023 at 11:07:23PM +0000, Richard Sandiford wrote:
> Jakub Jelinek <[email protected]> writes:
> > https://gcc.gnu.org/pipermail/gcc-patches/2022-November/605965.html
> > - ABI - aarch64: Add bfloat16_t support for aarch64 (enabling it in GCC 14
> > will be harder)
>
> Sorry for the delay on this. There's still an ongoing debate about
> whether to keep the current AArch64 mangling or switch to the new one.
If it helps, I'll try to repeat the options I see:
1) don't do anything right now; problem is if it is done later (GCC 14+),
libstdc++ would need to conditionalize the std::bfloat16_t RTTI symbols,
have them in one symbol version for x86 and in another for aarch64
2) similarly to x86 __bf16 would be the underlying type for std::bfloat16_t
where the latter needs to act as usable extended floating point type with
all arithmetics, mangling is DF16b which is how std::bfloat16_t should
mangle according to the Itanitum ABI pull request; decltype (0.0bf16) is
__bf16; disadvantage is that existing code using __bf16 in argument
passing and templates changes mangling
3) keep __bf16 as is with its u6__bf16 mangling and use for std::bfloat16_t
a distinct type (the latter would be the bfloat16_type_node);
decltype (0.0bf16) would be that new type which would mangle DF16b and
would allow arithmetics/casts etc. How exactly would the new type be
named is up to you (__bfloat16_t, __bfloat16, __std_bfloat16_t,
whatever else); in theory it could be created without a user accessible
name as well; libstdc++ only uses decltype (0.0bf16) to get at it
4) like 3), including keeping the mangling of __bf16 as u6__bf16, but
make also __bf16 a usable arithmetic type, not just a storage only type;
for C++ FE it would be simply another non-standard type like say
__float128 is on x86
5) like 2), but make the mangling of __bf16 depend on flag_abi_version;
flag_abi_version >= 18 (aka GCC 13+ ABI) mangles it as DF16b,
flag_abi_version < 18 mangles it as u6__bf16; the default for
-fabi-compat-version= is I think GCC 8 ABI compatibility, so GCC normally
emits mangling aliases, so say void foo (std::bfloat16_t) {} would
mangle as _Z3fooDF16b and for a few years there would be
an alias _Z3foou6__bf16 to it
Of course, it is possible I've missed some options.
Jakub