From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id A9858383542E for ; Fri, 12 Mar 2021 10:06:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A9858383542E Received: by mail-wr1-x434.google.com with SMTP id v11so1431779wro.7 for ; Fri, 12 Mar 2021 02:06:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PENhpaaqFHLeTYZbyzPWPl8cYSYfUWFA2Df5GObhBIc=; b=H+qVUAeCCRFozgvRoPaVLH5qEaRqL+41AEJhyvT8tmbvfHlD12q3GYr9JKjDDMIh+X m+QYmVnRR2I2UZ5U39wmqTCqdrC5KeTUcPMuzdshIeC/hN72hLnkiZlORJ23v8n4VlRg Mm2UsscgdN6nLVUPJewHvBMWdDBWOSdf9RhabAbD1MfWLmFdDJrguNQB+ABR83CNSYtv pWMAyx+nNgLg95mSBQ2KC1t2LbTSJeXSCYdjGDOFX0wex9IwHCdfTPDD+KrAjCWErSz2 TVONgbSoKSW46Nekdi8R/Qu1vsgTC7+WUM5oBSybOUWNBCrwz834ppioWrwg9UUbQiVO e9vQ== X-Gm-Message-State: AOAM533Te2JYWNFSMlHtpDgSnU/UyVip+gXUPv2Z7SXBcZhmHOdCjFeW olN3rrsX+WT0S9C0RqUj7r7cYQzdk3g9oruUBlGTsv+e X-Google-Smtp-Source: ABdhPJxvLCDKsa8vgh0k/TlIbs+WalDtRmvRObiMtvB3WXJ+/lMeZjgyxc9JrHdI6HG4juHpYtixRKCC/8LFjVkbDDo= X-Received: by 2002:adf:e38f:: with SMTP id e15mr12653843wrm.321.1615543588856; Fri, 12 Mar 2021 02:06:28 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Fri, 12 Mar 2021 10:06:17 +0000 Message-ID: Subject: Re: [RFC] Appropriate portable data type for IEEE half-precision on C/C++ To: Kito Cheng Cc: GCC Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Mar 2021 10:06:31 -0000 On Fri, 12 Mar 2021 at 09:58, Kito Cheng wrote: > > Hi Jonathan: > > > I would forget about the decimal types. I thought you were just > > talking about _Float16? > > > > You will need to decide on a mangling for it in C++, which should be > > co-ordinated with other compilers that are likely to support the type. > > You could mangle it as "u8_Float16" which is in the namespace reserved > > for vendor-extensions but if you wanted to assign a new shorter, > > non-extension then it should be discussed at > > https://github.com/itanium-cxx-abi/cxx-abi/issues (which will need to > > happen anyway if std::float16 is expected to go into the C++ > > standard). > > > > Are you planning to support this in Clang too? > > clang already supports _Float16 on C++ for a while, but only very few targets, > ARM, AArch64, SPIR and AMDGPU. > > > That's documented at > > http://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-builtin > > Seems like it is already defined for _FloatN types, and clang already > follow that. > > ::= DF _ # ISO/IEC TS 18661 binary floating point type _FloatN (N bits) > > Thank you, Jonathan, I'll start to add that to C++ :) Oh good, that makes it easy then!