public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Sandiford <richard.sandiford@arm.com>,
	Richard Earnshaw <richard.earnshaw@arm.com>,
	Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Cc: gcc-patches@gcc.gnu.org
Subject: AArch64 bfloat16 mangling
Date: Wed, 1 Feb 2023 11:27:00 +0100	[thread overview]
Message-ID: <Y9o+dJnVhavp+Edg@tucnak> (raw)
In-Reply-To: <mptwn53hb9w.fsf@arm.com>

Hi!

On Mon, Jan 30, 2023 at 11:07:23PM +0000, Richard Sandiford wrote:
> Jakub Jelinek <jakub@redhat.com> 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


  reply	other threads:[~2023-02-01 10:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30  9:50 Patch ping Jakub Jelinek
2023-01-30 23:07 ` Richard Sandiford
2023-02-01 10:27   ` Jakub Jelinek [this message]
2023-03-09 17:14     ` AArch64 bfloat16 mangling Richard Sandiford
2023-03-10  8:37       ` Jakub Jelinek
2023-03-10  8:43         ` Richard Sandiford
2023-03-10 11:30           ` Jakub Jelinek
2023-03-10 11:50             ` Richard Sandiford
2023-03-10 15:35               ` Jakub Jelinek
2023-03-10 16:25                 ` Richard Sandiford

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=Y9o+dJnVhavp+Edg@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kyrylo.tkachov@arm.com \
    --cc=richard.earnshaw@arm.com \
    --cc=richard.sandiford@arm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).