From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id C9E573858D37 for ; Wed, 1 Feb 2023 10:27:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C9E573858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675247226; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=IYRPwSWangnVBcXLpOO5EbrboxLd7HU7vAigSYEUfLk=; b=hpeJOnq01sbxZVCKeehgV1EeCgAj3Ff4UXYScjEGAezppSGrtkRTzVKpLxeKqaaHHB+PrZ ru/x1sSs9CeELZfYW2H0+mT1vOFzWQGctYK/X372NV/zYLL0lwHjGa0Bz3Odrm9AsfH8NJ UdWZFSTy7D86gpFzXM23p+ZRiDWopOc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-551-GFO-npFBNJOS_ACv_CdxQg-1; Wed, 01 Feb 2023 05:27:05 -0500 X-MC-Unique: GFO-npFBNJOS_ACv_CdxQg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A99E9800B30; Wed, 1 Feb 2023 10:27:04 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6A06240C1255; Wed, 1 Feb 2023 10:27:04 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 311AR1pY3214570 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 1 Feb 2023 11:27:02 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 311AR0r63214569; Wed, 1 Feb 2023 11:27:00 +0100 Date: Wed, 1 Feb 2023 11:27:00 +0100 From: Jakub Jelinek To: Richard Sandiford , Richard Earnshaw , Kyrylo Tkachov Cc: gcc-patches@gcc.gnu.org Subject: AArch64 bfloat16 mangling Message-ID: Reply-To: Jakub Jelinek References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi! On Mon, Jan 30, 2023 at 11:07:23PM +0000, Richard Sandiford wrote: > Jakub Jelinek 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