This is an archive of the discontinued LLVM Phabricator instance.

[Solaris] __float128 is supported on Solaris/x86
ClosedPublic

Authored by ro on Dec 14 2017, 7:42 AM.

Details

Summary

When rebasing https://reviews.llvm.org/D40898 with GCC 5.4 on Solaris 11.4, I ran
into a few instances of

In file included from /vol/llvm/src/compiler-rt/local/test/asan/TestCases/Posix/asan-symbolize-sanity-test.cc:19:
In file included from /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/../../../../include/c++/5.4.0/string:40:
In file included from /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/../../../../include/c++/5.4.0/bits/char_traits.h:39:
In file included from /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/../../../../include/c++/5.4.0/bits/stl_algobase.h:64:
In file included from /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/../../../../include/c++/5.4.0/bits/stl_pair.h:59:
In file included from /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/../../../../include/c++/5.4.0/bits/move.h:57:
/usr/gcc/5/lib/gcc/x86_64-pc-solaris2.11/5.4.0/../../../../include/c++/5.4.0/type_traits:311:39: error: __float128 is not supported on this target

struct __is_floating_point_helper<__float128>
                                  ^

during make check-all. The line above is inside

#if !defined(STRICT_ANSI) && defined(_GLIBCXX_USE_FLOAT128)

template<>
  struct __is_floating_point_helper<__float128>
  : public true_type { };

#endif

While the libstdc++ header indicates support for __float128, clang does not, but
should. The following patch implements this and fixed those errors.

Diff Detail

Repository
rC Clang

Event Timeline

ro created this revision.Dec 14 2017, 7:42 AM
ro added a comment.Dec 14 2017, 7:43 AM

I forgot: this patch is on top of https://reviews.llvm.org/D35755.

Mechanically, the code change looks fine, but I can't comment on whether this is a correct change for Solaris, or whether the type provided by __float128 would use the right floating-point representation. You will also need to provide a test for this change.

ro added a comment.Dec 18 2017, 6:27 AM

Mechanically, the code change looks fine, but I can't comment on whether this is a correct change for Solaris, or whether the type provided by __float128 would use the right floating-point representation. You will also need to provide a test for this change.

The representation of __float128 is the same on all x86 targets AFAICT (that's certainly how this is done in GCC).

I've looked at the tests currently testing __float128 and except for one (to be enabled in a moment) already pass with this patch.

ro updated this revision to Diff 127348.Dec 18 2017, 6:28 AM

Enables test/CodeGenCXX/float128-declarations.cpp on Solaris/x86, too.

ro added a comment.Jan 13 2018, 6:37 AM

I believe there's nothing more left for me here. Is the patch ok now?

Thanks.

Rainer

@fedor.sergeev Can you review this for correctness? Thanks!

This revision is now accepted and ready to land.Mar 23 2018, 9:56 AM
This revision was automatically updated to reflect the committed changes.

Does it work for you for 32-bit? @joerg opposed adoption of 32-bit version as it seemed to be unimplemented..

Things are different for a libgcc-based toolchain and a compiler-rt based toolchain.