From patchwork Tue Dec 13 09:40:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 32727 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp14966wrn; Tue, 13 Dec 2022 01:41:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf7dBECWMGKhDXFmrr5gY8D43alLJizKEiU5l0cXT7/84iGTFHMteUd1h8FWsMdkLuDAd1zh X-Received: by 2002:a17:906:6554:b0:78d:f457:104f with SMTP id u20-20020a170906655400b0078df457104fmr16241678ejn.12.1670924502450; Tue, 13 Dec 2022 01:41:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670924502; cv=none; d=google.com; s=arc-20160816; b=bwWXuNn+Qd3MXtMorq5VKiMuMAZTLCWZnvN8NHNv1X1AiSYjA7gTe6hTD+9BR/DgtC H0xNzmlVC7Ys87G+oKLQ6zbFi4rBMcJOOKd9x+wIxrPmMdYiYNqDSgBbzQ7nNczlFH/I dyGKI+YvnbQvQWEH3ZxzMQyPr2+r8G4+6SfnLHE1V+8pOON16LeKmV5iuPuI1wZD0Fqz Cikfz8NBW7iK0C27FTEI5rdor2p2AC6EKux9wHzJj3mAGNWjpH6w5Wsna0KYF93KzqCk wm5NZEtq/fTNICoClQUDeMqhcpZr4A18CO/19iDJmQDLKIXcd/pmdpUf0R8x6EbFA2IX 44Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:cc:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=JNplJ1LvmbXXgVLb4b9H6EUeGMZZpq4VpaMjLGbqnJg=; b=LNhwe2XS6B9hRWMCiyVFbfhtuaWL7vDwv7yXk6OiA4Q7U3Ne2e+FhVic3zoOY4DmJw ajR83uum5smPblsZO0iPvmE7IPBZgG/fhai/2qC1rWwgu4oATvQA4JKY8ScN0OxhKe81 84/G5Y9GVrWy+RrfnXemJPDztZVo7zAcLpjHIyHR7PbzjGLJydImZEhLH/GxztvPn5H/ vJbB0nVwVXJT2uqeMNz3Y3g6XG2dqB0NNX0aU+1KGkh1YyeXDLfD7nIEsWW/2fRu2DX4 kM6DFVi6qzSJpBdpSX0jdNu4uLYzFrCrJjlT8LDM5qi+6lnkM/bJkTG/cBnmKWoZsFHM Rr1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="aT/PqaMV"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id sh30-20020a1709076e9e00b00780ec98afafsi7372064ejc.113.2022.12.13.01.41.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Dec 2022 01:41:42 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="aT/PqaMV"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3FDEC384011A for ; Tue, 13 Dec 2022 09:41:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3FDEC384011A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670924494; bh=JNplJ1LvmbXXgVLb4b9H6EUeGMZZpq4VpaMjLGbqnJg=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=aT/PqaMV70OjA1o4v5YT1HPk27ZhnUym+OTmGvEpOxECIaqlt7gkYiRQB1mxZmlZY afz1IP9UFJI+Jo8LvmhUNRAaHAwgc2T5uvvgColfHQWW67dLu9wWCt5cIag4dkF49m WLmIigXfF342TudClBvtZdCCU6viIN0n+ylvdhc8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 8753E38715B6 for ; Tue, 13 Dec 2022 09:40:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8753E38715B6 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-450-dD6WInA9Ni6PQQ5JhPed5A-1; Tue, 13 Dec 2022 04:40:46 -0500 X-MC-Unique: dD6WInA9Ni6PQQ5JhPed5A-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DEDFC29AA3B6; Tue, 13 Dec 2022 09:40:45 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.195.114]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 908C6492C18; Tue, 13 Dec 2022 09:40:45 +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 2BD9eftj1939371 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 13 Dec 2022 10:40:41 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 2BD9eeQ61939370; Tue, 13 Dec 2022 10:40:40 +0100 Date: Tue, 13 Dec 2022 10:40:40 +0100 To: Jason Merrill , Jonathan Wakely Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: [PATCH] c++, libstdc++: Add typeinfo for _Float{16,32,64,128,32x,64x} and __bf16 types [PR108075] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752091330638227385?= X-GMAIL-MSGID: =?utf-8?q?1752091330638227385?= Hi! The following patch adds typeinfos for the extended floating point types and _Float{32,64}x. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2022-12-13 Jakub Jelinek PR libstdc++/108075 gcc/cp/ * rtti.cc (emit_support_tinfos): Add pointers to {bfloat16,float{16,32,64,128,32x,64x,128x}}_type_node to fundamentals array. gcc/testsuite/ * g++.dg/cpp23/ext-floating13.C: New test. libstdc++-v3/ * config/abi/pre/gnu.ver (CXXABI_1.3.14): Export _ZTIDF[0-9]*[_bx], _ZTIPDF[0-9]*[_bx] and _ZTIPKDF[0-9]*[_bx]. * testsuite/util/testsuite_abi.cc (check_version): Handle CXXABI_1.3.14. Jakub --- gcc/cp/rtti.cc.jj 2022-10-17 12:29:33.519016406 +0200 +++ gcc/cp/rtti.cc 2022-12-12 15:23:48.244190755 +0100 @@ -1603,7 +1603,9 @@ emit_support_tinfos (void) &long_long_integer_type_node, &long_long_unsigned_type_node, &float_type_node, &double_type_node, &long_double_type_node, &dfloat32_type_node, &dfloat64_type_node, &dfloat128_type_node, - &nullptr_type_node, + &bfloat16_type_node, &float16_type_node, &float32_type_node, + &float64_type_node, &float128_type_node, &float32x_type_node, + &float64x_type_node, &float128x_type_node, &nullptr_type_node, 0 }; int ix; --- gcc/testsuite/g++.dg/cpp23/ext-floating13.C.jj 2022-12-12 15:38:51.357009408 +0100 +++ gcc/testsuite/g++.dg/cpp23/ext-floating13.C 2022-12-12 15:39:04.568816597 +0100 @@ -0,0 +1,35 @@ +// P1467R9 - Extended floating-point types and standard names. +// { dg-do link { target c++23 } } +// { dg-options "" } + +#include + +#ifdef __STDCPP_FLOAT16_T__ +const std::type_info &a = typeid(decltype(0.0f16)); +#endif +#ifdef __STDCPP_BFLOAT16_T__ +const std::type_info &b = typeid(decltype(0.0bf16)); +#endif +#ifdef __STDCPP_FLOAT32_T__ +const std::type_info &c = typeid(decltype(0.0f32)); +#endif +#ifdef __STDCPP_FLOAT64_T__ +const std::type_info &d = typeid(decltype(0.0f64)); +#endif +#ifdef __STDCPP_FLOAT128_T__ +const std::type_info &e = typeid(decltype(0.0f128)); +#endif +#ifdef __FLT32X_MAX__ +const std::type_info &f = typeid(decltype(0.0f32x)); +#endif +#ifdef __FLT64X_MAX__ +const std::type_info &g = typeid(decltype(0.0f64x)); +#endif +#ifdef __FLT128X_MAX__ +const std::type_info &h = typeid(decltype(0.0f128x)); +#endif + +int +main () +{ +} --- libstdc++-v3/config/abi/pre/gnu.ver.jj 2022-11-11 08:15:45.646183974 +0100 +++ libstdc++-v3/config/abi/pre/gnu.ver 2022-12-12 15:34:08.178142084 +0100 @@ -2794,6 +2794,16 @@ CXXABI_1.3.13 { } CXXABI_1.3.12; +CXXABI_1.3.14 { + + # typeinfo for _Float{16,32,64,128,32x,64x,128x} and + # __bf16 + _ZTIDF[0-9]*[_bx]; + _ZTIPDF[0-9]*[_bx]; + _ZTIPKDF[0-9]*[_bx]; + +} CXXABI_1.3.13; + # Symbols in the support library (libsupc++) supporting transactional memory. CXXABI_TM_1 { --- libstdc++-v3/testsuite/util/testsuite_abi.cc.jj 2022-09-12 11:30:14.224870022 +0200 +++ libstdc++-v3/testsuite/util/testsuite_abi.cc 2022-12-12 15:46:41.036156477 +0100 @@ -230,6 +230,7 @@ check_version(symbol& test, bool added) known_versions.push_back("CXXABI_1.3.11"); known_versions.push_back("CXXABI_1.3.12"); known_versions.push_back("CXXABI_1.3.13"); + known_versions.push_back("CXXABI_1.3.14"); known_versions.push_back("CXXABI_IEEE128_1.3.13"); known_versions.push_back("CXXABI_TM_1"); known_versions.push_back("CXXABI_FLOAT128"); @@ -251,7 +252,7 @@ check_version(symbol& test, bool added) bool latestp = (test.version_name == "GLIBCXX_3.4.31" // XXX remove next line when baselines have been regenerated. || test.version_name == "GLIBCXX_IEEE128_3.4.30" - || test.version_name == "CXXABI_1.3.13" + || test.version_name == "CXXABI_1.3.14" || test.version_name == "CXXABI_FLOAT128" || test.version_name == "CXXABI_TM_1"); if (added && !latestp)