diff mbox

version typeinfo for 128bit types

Message ID alpine.DEB.2.02.1404222154370.17009@stedding.saclay.inria.fr
State New
Headers show

Commit Message

Marc Glisse April 22, 2014, 8:06 p.m. UTC
Hello,

as written in the PR, my patch seems wrong for platforms like powerpc that 
already had the __float128 typeinfo for long double with a different 
version. The following patch regtested fine on x86_64, and a hackish 
cross-build shows that float128.ver is ignored on powerpc (good).

2014-04-23  Marc Glisse  <marc.glisse@inria.fr>

 	PR libstdc++/43622
 	* config/abi/pre/float128.ver: New file.
 	* config/abi/pre/gnu.ver (CXXABI_1.3.9): Move __float128 typeinfo to
 	the new file.
 	* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.
 	* configure.ac: Use float128.ver when relevant.
 	* configure: Regenerate.

Comments

Michael Meissner April 22, 2014, 8:26 p.m. UTC | #1
On Tue, Apr 22, 2014 at 10:06:19PM +0200, Marc Glisse wrote:
> Hello,
> 
> as written in the PR, my patch seems wrong for platforms like
> powerpc that already had the __float128 typeinfo for long double
> with a different version. The following patch regtested fine on
> x86_64, and a hackish cross-build shows that float128.ver is ignored
> on powerpc (good).
> 
> 2014-04-23  Marc Glisse  <marc.glisse@inria.fr>
> 
> 	PR libstdc++/43622
> 	* config/abi/pre/float128.ver: New file.
> 	* config/abi/pre/gnu.ver (CXXABI_1.3.9): Move __float128 typeinfo to
> 	the new file.
> 	* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.
> 	* configure.ac: Use float128.ver when relevant.
> 	* configure: Regenerate.

Note, I hope to restart work to add __float128 as IEEE 128-bit floating point
in the PowerPC shortly.  I had done about 1/2 of the work in a sandbox, and I
needed to put it aside to look at other issues, and it has bubbled up to be
high on my list of priorities.
Jakub Jelinek April 22, 2014, 8:29 p.m. UTC | #2
On Tue, Apr 22, 2014 at 04:26:23PM -0400, Michael Meissner wrote:
> On Tue, Apr 22, 2014 at 10:06:19PM +0200, Marc Glisse wrote:
> > Hello,
> > 
> > as written in the PR, my patch seems wrong for platforms like
> > powerpc that already had the __float128 typeinfo for long double
> > with a different version. The following patch regtested fine on
> > x86_64, and a hackish cross-build shows that float128.ver is ignored
> > on powerpc (good).
> > 
> > 2014-04-23  Marc Glisse  <marc.glisse@inria.fr>
> > 
> > 	PR libstdc++/43622
> > 	* config/abi/pre/float128.ver: New file.
> > 	* config/abi/pre/gnu.ver (CXXABI_1.3.9): Move __float128 typeinfo to
> > 	the new file.
> > 	* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.
> > 	* configure.ac: Use float128.ver when relevant.
> > 	* configure: Regenerate.
> 
> Note, I hope to restart work to add __float128 as IEEE 128-bit floating point
> in the PowerPC shortly.  I had done about 1/2 of the work in a sandbox, and I
> needed to put it aside to look at other issues, and it has bubbled up to be
> high on my list of priorities.

But then the question is what letter to use for the mangling of it, when
g is already used for the IBM "double double" long double on PowerPC.

	Jakub
Michael Meissner April 22, 2014, 9:35 p.m. UTC | #3
On Tue, Apr 22, 2014 at 10:29:55PM +0200, Jakub Jelinek wrote:
> On Tue, Apr 22, 2014 at 04:26:23PM -0400, Michael Meissner wrote:
> > On Tue, Apr 22, 2014 at 10:06:19PM +0200, Marc Glisse wrote:
> > > Hello,
> > > 
> > > as written in the PR, my patch seems wrong for platforms like
> > > powerpc that already had the __float128 typeinfo for long double
> > > with a different version. The following patch regtested fine on
> > > x86_64, and a hackish cross-build shows that float128.ver is ignored
> > > on powerpc (good).
> > > 
> > > 2014-04-23  Marc Glisse  <marc.glisse@inria.fr>
> > > 
> > > 	PR libstdc++/43622
> > > 	* config/abi/pre/float128.ver: New file.
> > > 	* config/abi/pre/gnu.ver (CXXABI_1.3.9): Move __float128 typeinfo to
> > > 	the new file.
> > > 	* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.
> > > 	* configure.ac: Use float128.ver when relevant.
> > > 	* configure: Regenerate.
> > 
> > Note, I hope to restart work to add __float128 as IEEE 128-bit floating point
> > in the PowerPC shortly.  I had done about 1/2 of the work in a sandbox, and I
> > needed to put it aside to look at other issues, and it has bubbled up to be
> > high on my list of priorities.
> 
> But then the question is what letter to use for the mangling of it, when
> g is already used for the IBM "double double" long double on PowerPC.

Right now, I am adding __float128 as a completely separate type to be IEEE
128-bit floating point.  At the moment, it is just baby steps, since we need
the compiler to have some type, to get the library work started.  It would have
been nice if I had started the work early enough to go into the new little
endian ABI.

Ideally in the future we would make long double map to __float128, so I added
another type __ibm128 to give the IBM double double format.  I hadn't gotten to
the point of thinking about mangling.  I suspect we will need to add a way to
use something else if 'g' was already taken.
diff mbox

Patch

Index: libstdc++-v3/config/abi/post/x86_64-linux-gnu/baseline_symbols.txt
===================================================================
--- libstdc++-v3/config/abi/post/x86_64-linux-gnu/baseline_symbols.txt	(revision 209658)
+++ libstdc++-v3/config/abi/post/x86_64-linux-gnu/baseline_symbols.txt	(working copy)
@@ -2514,20 +2514,21 @@  FUNC:atomic_flag_test_and_set_explicit@@
 OBJECT:0:CXXABI_1.3
 OBJECT:0:CXXABI_1.3.1
 OBJECT:0:CXXABI_1.3.2
 OBJECT:0:CXXABI_1.3.3
 OBJECT:0:CXXABI_1.3.4
 OBJECT:0:CXXABI_1.3.5
 OBJECT:0:CXXABI_1.3.6
 OBJECT:0:CXXABI_1.3.7
 OBJECT:0:CXXABI_1.3.8
 OBJECT:0:CXXABI_1.3.9
+OBJECT:0:CXXABI_FLOAT128_1.3.9
 OBJECT:0:CXXABI_TM_1
 OBJECT:0:GLIBCXX_3.4
 OBJECT:0:GLIBCXX_3.4.1
 OBJECT:0:GLIBCXX_3.4.10
 OBJECT:0:GLIBCXX_3.4.11
 OBJECT:0:GLIBCXX_3.4.12
 OBJECT:0:GLIBCXX_3.4.13
 OBJECT:0:GLIBCXX_3.4.14
 OBJECT:0:GLIBCXX_3.4.15
 OBJECT:0:GLIBCXX_3.4.16
@@ -2618,21 +2619,21 @@  OBJECT:16:_ZTISt16nested_exception@@CXXA
 OBJECT:16:_ZTISt8ios_base@@GLIBCXX_3.4
 OBJECT:16:_ZTISt9exception@@GLIBCXX_3.4
 OBJECT:16:_ZTISt9time_base@@GLIBCXX_3.4
 OBJECT:16:_ZTISt9type_info@@GLIBCXX_3.4
 OBJECT:16:_ZTIa@@CXXABI_1.3
 OBJECT:16:_ZTIb@@CXXABI_1.3
 OBJECT:16:_ZTIc@@CXXABI_1.3
 OBJECT:16:_ZTId@@CXXABI_1.3
 OBJECT:16:_ZTIe@@CXXABI_1.3
 OBJECT:16:_ZTIf@@CXXABI_1.3
-OBJECT:16:_ZTIg@@CXXABI_1.3.9
+OBJECT:16:_ZTIg@@CXXABI_FLOAT128_1.3.9
 OBJECT:16:_ZTIh@@CXXABI_1.3
 OBJECT:16:_ZTIi@@CXXABI_1.3
 OBJECT:16:_ZTIj@@CXXABI_1.3
 OBJECT:16:_ZTIl@@CXXABI_1.3
 OBJECT:16:_ZTIm@@CXXABI_1.3
 OBJECT:16:_ZTIn@@CXXABI_1.3.5
 OBJECT:16:_ZTIo@@CXXABI_1.3.5
 OBJECT:16:_ZTIs@@CXXABI_1.3
 OBJECT:16:_ZTIt@@CXXABI_1.3
 OBJECT:16:_ZTIv@@CXXABI_1.3
@@ -3119,21 +3120,21 @@  OBJECT:2:_ZNSt10ctype_base5printE@@GLIBC
 OBJECT:2:_ZNSt10ctype_base5punctE@@GLIBCXX_3.4
 OBJECT:2:_ZNSt10ctype_base5spaceE@@GLIBCXX_3.4
 OBJECT:2:_ZNSt10ctype_base5upperE@@GLIBCXX_3.4
 OBJECT:2:_ZNSt10ctype_base6xdigitE@@GLIBCXX_3.4
 OBJECT:2:_ZTSa@@CXXABI_1.3
 OBJECT:2:_ZTSb@@CXXABI_1.3
 OBJECT:2:_ZTSc@@CXXABI_1.3
 OBJECT:2:_ZTSd@@CXXABI_1.3
 OBJECT:2:_ZTSe@@CXXABI_1.3
 OBJECT:2:_ZTSf@@CXXABI_1.3
-OBJECT:2:_ZTSg@@CXXABI_1.3.9
+OBJECT:2:_ZTSg@@CXXABI_FLOAT128_1.3.9
 OBJECT:2:_ZTS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XABI_1.3
 OBJECT:32:_ZTIPKy@@CXXABI_1.3
 OBJECT:32:_ZTIPa@@CXXABI_1.3
 OBJECT:32:_ZTIPb@@CXXABI_1.3
 OBJECT:32:_ZTIPc@@CXXABI_1.3
 OBJECT:32:_ZTIPd@@CXXABI_1.3
 OBJECT:32:_ZTIPe@@CXXABI_1.3
 OBJECT:32:_ZTIPf@@CXXABI_1.3
-OBJECT:32:_ZTIPg@@CXXABI_1.3.9
+OBJECT:32:_ZTIPg@@CXXABI_FLOAT128_1.3.9
 OBJECT:32:_ZTIPh@@CXXABI_1.3
 OBJECT:32:_ZTIPi@@CXXABI_1.3
 OBJECT:32:_ZTIPj@@CXXABI_1.3
 OBJECT:32:_ZTIPl@@CXXABI_1.3
 OBJECT:32:_ZTIPm@@CXXABI_1.3
 OBJECT:32:_ZTIPn@@CXXABI_1.3.5
 OBJECT:32:_ZTIPo@@CXXABI_1.3.5
 OBJECT:32:_ZTIPs@@CXXABI_1.3
 OBJECT:32:_ZTIPt@@CXXABI_1.3
 OBJECT:32:_ZTIPv@@CXXABI_1.3
@@ -3228,21 +3229,21 @@  OBJECT:39:_ZTSSt13basic_filebufIwSt11cha
 OBJECT:39:_ZTSSt13basic_fstreamIcSt11char_traitsIcEE@@GLIBCXX_3.4
 OBJECT:39:_ZTSSt13basic_fstreamIwSt11char_traitsIwEE@@GLIBCXX_3.4
 OBJECT:39:_ZTSSt13basic_istreamIwSt11char_traitsIwEE@@GLIBCXX_3.4
 OBJECT:39:_ZTSSt13basic_ostreamIwSt11char_traitsIwEE@@GLIBCXX_3.4
 OBJECT:3:_ZTSPa@@CXXABI_1.3
 OBJECT:3:_ZTSPb@@CXXABI_1.3
 OBJECT:3:_ZTSPc@@CXXABI_1.3
 OBJECT:3:_ZTSPd@@CXXABI_1.3
 OBJECT:3:_ZTSPe@@CXXABI_1.3
 OBJECT:3:_ZTSPf@@CXXABI_1.3
-OBJECT:3:_ZTSPg@@CXXABI_1.3.9
+OBJECT:3:_ZTSP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3
 OBJECT:4:_ZTSPKv@@CXXABI_1.3
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_1.3.9 {
+
+    # typeinfo and typeinfo name for __float128
+    _ZT[IS]g;
+    _ZT[IS]Pg;
+    _ZT[IS]PKg;
+
+};
Index: libstdc++-v3/config/abi/pre/gnu.ver
===================================================================
--- libstdc++-v3/config/abi/pre/gnu.ver	(revision 209658)
+++ libstdc++-v3/config/abi/pre/gnu.ver	(working copy)
@@ -1579,29 +1579,24 @@  CXXABI_1.3.8 {
     _Z16__VLTRegisterSet*;
     _Z21__VLTRegisterSetDebug*;
     _Z24__VLTVerifyVtablePointer*;
     _Z29__VLTVerifyVtablePointerDebug*;
     __VLTChangePermission;
 
 } CXXABI_1.3.7;
 
 CXXABI_1.3.9 {
 
-    # typeinfo name for __int128, unsigned __int128 and __float128
-    _ZTS[gno];
-    _ZTSP[gno];
-    _ZTSPK[gno];
-
-    # typeinfo for __float128
-    _ZTIg;
-    _ZTIPg;
-    _ZTIPKg;
+    # typeinfo name for __int128 and unsigned __int128
+    _ZTS[no];
+    _ZTSP[no];
+    _ZTSPK[no];
 
 } CXXABI_1.3.8;
 
 # Symbols in the support library (libsupc++) supporting transactional memory.
 CXXABI_TM_1 {
 
   global:
     __cxa_tm_cleanup;
 
 };
Index: libstdc++-v3/configure
===================================================================
--- libstdc++-v3/configure	(revision 209658)
+++ libstdc++-v3/configure	(working copy)
@@ -15698,20 +15698,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 209658)
+++ 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])