From patchwork Sun Nov 9 00:41:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Glisse X-Patchwork-Id: 408502 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BD0C71400B7 for ; Sun, 9 Nov 2014 11:41:23 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=HXt4EQn4BeFB0jG6+ehzharXb3/2a67pC5Ia8Wnl/YL30/bYuC ceYuLA9uI2pKq9cyHSJIWVIbibid6IjeJbwYeOuM1IvR2Qr2j0+Kt681AwL/zdfX w464TwuV4sLlaO96LeLcnn+OH/s9ky7YlsuDoXvahg0jcTUG3RyEM2WSA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=K3Xb7jvhqYcmlmS2856ut+I16f4=; b=Sqx72EsFjDlrevZ5KRCY PuSKBerz8Y5BTpR2q2uQDc1fQENpOSuB3CTRuu4iux+QHAJKrZ4609kDHOaacl76 Y+c3Ym1dIPw293G93146LzWJZQR0P3zXirRfBtlV6Bof0vLc3/bi/yHglkK3fmTT ZqHVagODRqs4bm09cVU3cDE= Received: (qmail 15337 invoked by alias); 9 Nov 2014 00:41:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 15312 invoked by uid 89); 9 Nov 2014 00:41:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, URIBL_BLACK autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail3-relais-sop.national.inria.fr Received: from mail3-relais-sop.national.inria.fr (HELO mail3-relais-sop.national.inria.fr) (192.134.164.104) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Sun, 09 Nov 2014 00:41:14 +0000 Received: from stedding.saclay.inria.fr (HELO stedding) ([193.55.250.194]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES128-SHA; 09 Nov 2014 01:41:10 +0100 Received: from glisse (helo=localhost) by stedding with local-esmtp (Exim 4.84) (envelope-from ) id 1XnGZ4-0003Kh-2v; Sun, 09 Nov 2014 01:41:10 +0100 Date: Sun, 9 Nov 2014 01:41:10 +0100 (CET) From: Marc Glisse To: libstdc++@gcc.gnu.org cc: gcc-patches@gcc.gnu.org Subject: __float128 typeinfo Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Hello, I am digging out https://gcc.gnu.org/ml/gcc-patches/2014-06/msg00637.html It isn't completely clear if the libstdc++ part was accepted or not. I won't commit immediately (waiting on another patch), but I'd like to be ready. The front-end part is included for reference, both versions were approved, I'll use the first one if arm vectors are reworked in the same way as aarch64 before the end of stage 1, and the other one if for some reason it gets delayed. 2014-11-10 Marc Glisse PR libstdc++/43622 gcc/cp/ * rtti.c (emit_support_tinfos): Handle __float128. libstdc++-v3/ * config/abi/pre/float128.ver: New file. * configure.ac: Use float128.ver when relevant. * configure: Regenerate. * testsuite/util/testsuite_abi.cc (check_version): Accept new CXXABI_FLOAT128 version. Index: gcc/cp/rtti.c =================================================================== --- gcc/cp/rtti.c (revision 217249) +++ gcc/cp/rtti.c (working copy) @@ -1540,20 +1540,35 @@ emit_support_tinfos (void) return; doing_runtime = 1; for (ix = 0; fundamentals[ix]; ix++) emit_support_tinfo_1 (*fundamentals[ix]); for (ix = 0; ix < NUM_INT_N_ENTS; ix ++) if (int_n_enabled_p[ix]) { emit_support_tinfo_1 (int_n_trees[ix].signed_type); emit_support_tinfo_1 (int_n_trees[ix].unsigned_type); } +#if 1 + for (tree t = registered_builtin_types; t; t = TREE_CHAIN (t)) + emit_support_tinfo_1 (TREE_VALUE (t)); +#else + /* Search for an extra floating point type like __float128. */ + for (enum machine_mode mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); + mode != VOIDmode; + mode = GET_MODE_WIDER_MODE (mode)) + { + tree type = c_common_type_for_mode (mode, false); + if (type && type != float_type_node && type != double_type_node + && type != long_double_type_node) + emit_support_tinfo_1 (type); + } +#endif } /* Finish a type info decl. DECL_PTR is a pointer to an unemitted tinfo decl. Determine whether it needs emitting, and if so generate the initializer. */ bool emit_tinfo_decl (tree decl) { tree type = TREE_TYPE (DECL_NAME (decl)); Index: libstdc++-v3/config/abi/pre/float128.ver =================================================================== --- libstdc++-v3/config/abi/pre/float128.ver (revision 0) +++ libstdc++-v3/config/abi/pre/float128.ver (working copy) @@ -0,0 +1,10 @@ +# Appended to version file. + +CXXABI_FLOAT128 { + + # typeinfo and typeinfo name for __float128 + _ZT[IS]g; + _ZT[IS]Pg; + _ZT[IS]PKg; + +}; Index: libstdc++-v3/configure =================================================================== --- libstdc++-v3/configure (revision 217249) +++ libstdc++-v3/configure (working copy) @@ -15703,20 +15703,23 @@ $as_echo "#define _GLIBCXX_USE_FLOAT128 $as_echo "$enable_float128" >&6; } rm -f conftest* ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test "$enable_float128" = yes; then + port_specific_symbol_files="$port_specific_symbol_files \$(top_srcdir)/config/abi/pre/float128.ver" +fi # Checks for compiler support that doesn't require linking. # All these tests are for C++; save the language and the compiler flags. # The CXXFLAGS thing is suspicious, but based on similar bits previously # found in GLIBCXX_CONFIGURE. ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' Index: libstdc++-v3/configure.ac =================================================================== --- libstdc++-v3/configure.ac (revision 217249) +++ libstdc++-v3/configure.ac (working copy) @@ -146,20 +146,23 @@ GLIBCXX_ENABLE_HOSTED # Enable descriptive messages to standard output on termination. GLIBCXX_ENABLE_VERBOSE # Enable compiler support that doesn't require linking. GLIBCXX_ENABLE_SJLJ_EXCEPTIONS GLIBCXX_ENABLE_PCH($is_hosted) GLIBCXX_ENABLE_THREADS GLIBCXX_ENABLE_ATOMIC_BUILTINS GLIBCXX_ENABLE_DECIMAL_FLOAT GLIBCXX_ENABLE_INT128_FLOAT128 +if test "$enable_float128" = yes; then + port_specific_symbol_files="$port_specific_symbol_files \$(top_srcdir)/config/abi/pre/float128.ver" +fi # Checks for compiler support that doesn't require linking. GLIBCXX_CHECK_COMPILER_FEATURES # Enable all the variable C++ runtime options that don't require linking. GLIBCXX_ENABLE_CSTDIO GLIBCXX_ENABLE_CLOCALE GLIBCXX_ENABLE_ALLOCATOR GLIBCXX_ENABLE_CHEADERS($c_model) dnl c_model from configure.host GLIBCXX_ENABLE_LONG_LONG([yes]) Index: libstdc++-v3/testsuite/util/testsuite_abi.cc =================================================================== --- libstdc++-v3/testsuite/util/testsuite_abi.cc (revision 217249) +++ libstdc++-v3/testsuite/util/testsuite_abi.cc (working copy) @@ -206,47 +206,50 @@ check_version(symbol& test, bool added) known_versions.push_back("CXXABI_1.3.1"); known_versions.push_back("CXXABI_1.3.2"); known_versions.push_back("CXXABI_1.3.3"); known_versions.push_back("CXXABI_1.3.4"); known_versions.push_back("CXXABI_1.3.5"); known_versions.push_back("CXXABI_1.3.6"); known_versions.push_back("CXXABI_1.3.7"); known_versions.push_back("CXXABI_1.3.8"); known_versions.push_back("CXXABI_1.3.9"); known_versions.push_back("CXXABI_TM_1"); + known_versions.push_back("CXXABI_FLOAT128"); } compat_list::iterator begin = known_versions.begin(); compat_list::iterator end = known_versions.end(); // Check for compatible version. if (test.version_name.size()) { compat_list::iterator it1 = find(begin, end, test.version_name); compat_list::iterator it2 = find(begin, end, test.name); if (it1 != end) test.version_status = symbol::compatible; else test.version_status = symbol::incompatible; // Check that added symbols are added in the latest pre-release version. bool latestp = (test.version_name == "GLIBCXX_3.4.21" || test.version_name == "CXXABI_1.3.9" + || test.version_name == "CXXABI_FLOAT128" || test.version_name == "CXXABI_TM_1"); if (added && !latestp) test.version_status = symbol::incompatible; // Check that long double compatibility symbols demangled as - // __float128 are put into some _LDBL_ version name. + // __float128 and regular __float128 symbols are put into some _LDBL_ + // or _FLOAT128 version name. if (added && test.demangled_name.find("__float128") != std::string::npos) { - // Has to be in _LDBL_ version name. - if (test.version_name.find("_LDBL_") == std::string::npos) + if (test.version_name.find("_LDBL_") == std::string::npos + && test.version_name.find("_FLOAT128") == std::string::npos) test.version_status = symbol::incompatible; } // Check for weak label. if (it1 == end && it2 == end) test.version_status = symbol::incompatible; // Check that // GLIBCXX_3.4 // GLIBCXX_3.4.5