public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r13-4722] c++, libstdc++: Add typeinfo for _Float{16, 32, 64, 128, 32x, 64x} and __bf16 types [PR108075]
Date: Thu, 15 Dec 2022 16:04:03 +0000 (GMT)	[thread overview]
Message-ID: <20221215160403.A8BE13894C09@sourceware.org> (raw)

https://gcc.gnu.org/g:3f101e32e2fb616633722fb552779f537e9a9891

commit r13-4722-g3f101e32e2fb616633722fb552779f537e9a9891
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Dec 15 17:02:55 2022 +0100

    c++, libstdc++: Add typeinfo for _Float{16,32,64,128,32x,64x} and __bf16 types [PR108075]
    
    The following patch adds typeinfos for the extended floating point
    types and _Float{32,64}x.
    
    2022-12-15  Jakub Jelinek  <jakub@redhat.com>
    
            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.

Diff:
---
 gcc/cp/rtti.cc                               |  4 +++-
 gcc/testsuite/g++.dg/cpp23/ext-floating13.C  | 35 ++++++++++++++++++++++++++++
 libstdc++-v3/config/abi/pre/gnu.ver          | 10 ++++++++
 libstdc++-v3/testsuite/util/testsuite_abi.cc |  3 ++-
 4 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/gcc/cp/rtti.cc b/gcc/cp/rtti.cc
index a85c7b56409..c2cf78d1c09 100644
--- a/gcc/cp/rtti.cc
+++ b/gcc/cp/rtti.cc
@@ -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;
diff --git a/gcc/testsuite/g++.dg/cpp23/ext-floating13.C b/gcc/testsuite/g++.dg/cpp23/ext-floating13.C
new file mode 100644
index 00000000000..fd36c50ceae
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp23/ext-floating13.C
@@ -0,0 +1,35 @@
+// P1467R9 - Extended floating-point types and standard names.
+// { dg-do link { target c++23 } }
+// { dg-options "" }
+
+#include <typeinfo>
+
+#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 ()
+{
+}
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index 225d6dc482b..667cc4dfca4 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -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 {
 
diff --git a/libstdc++-v3/testsuite/util/testsuite_abi.cc b/libstdc++-v3/testsuite/util/testsuite_abi.cc
index 09bd00ecc73..27616f5987e 100644
--- a/libstdc++-v3/testsuite/util/testsuite_abi.cc
+++ b/libstdc++-v3/testsuite/util/testsuite_abi.cc
@@ -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)

                 reply	other threads:[~2022-12-15 16:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20221215160403.A8BE13894C09@sourceware.org \
    --to=jakub@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /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).