tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: compiler_rt missing support for 80-bit floats?



Joerg Sonnenberger <joerg%britannica.bec.de@localhost> writes:

> On Tue, Nov 11, 2014 at 12:25:19PM +0100, Aymeric Vincent wrote:
>> This function truncates a 128bit float to 80 bits. Digging around, I
>
> Where and how do you create such a cast?

Libboost is doing it when compiling libuhd. Here is an excerpt of
"objdump -Crd lib/libuhd.so.003.008" pinpointing the probable
responsible template in the boost headers. If you want to reproduce it
yourself, you can get a libuhd tarball here:
https://github.com/EttusResearch/uhd/releases/tag/release_003_008_000
and you'll need the patch below to reach the linking phase.

0000000000559daf <long double const boost::math::tools::make_big_value<long double>(__float128, char const*, mpl_::bool_<true> const&, mpl_::bool_<false> const&)>:
  559daf:       55                      push   %rbp
  559db0:       48 89 e5                mov    %rsp,%rbp
  559db3:       48 83 ec 30             sub    $0x30,%rsp
  559db7:       66 0f 7f 45 f0          movdqa %xmm0,-0x10(%rbp)
  559dbc:       48 89 7d e8             mov    %rdi,-0x18(%rbp)
  559dc0:       48 89 75 e0             mov    %rsi,-0x20(%rbp)
  559dc4:       48 89 55 d8             mov    %rdx,-0x28(%rbp)
  559dc8:       66 0f 6f 45 f0          movdqa -0x10(%rbp),%xmm0
  559dcd:       e8 ee 78 c2 ff          callq  1816c0 <__trunctfxf2@plt>
  559dd2:       c9                      leaveq 
  559dd3:       c3                      retq   

It does obviously involve __float128, as Dennis pointed out.

 Aymeric

--- orig/uhd-release_003_008_000/host/include/uhd/transport/nirio/nirio_driver_iface.h	2014-10-27 21:59:27.000000000 +0100
+++ uhd-release_003_008_000/host/include/uhd/transport/nirio/nirio_driver_iface.h	2014-11-12 21:07:30.000000000 +0100
@@ -28,7 +28,7 @@
     #pragma warning(disable:4201)  // nonstandard extension used : nameless struct/union
         #include <WinIoCtl.h>
     #pragma warning(default:4201)
-#elif !defined(UHD_PLATFORM_LINUX)
+#elif defined(UHD_PLATFORM_MACOS)
     #include <IOKit/IOKitLib.h>
 #endif
 
@@ -77,7 +77,7 @@
 
 
 //Device handle definition
-#if defined(UHD_PLATFORM_LINUX)
+#if defined(UHD_PLATFORM_LINUX) || defined(UHD_PLATFORM_BSD)
     typedef int rio_dev_handle_t;
 #elif defined(UHD_PLATFORM_WIN32)
     typedef HANDLE rio_dev_handle_t;
@@ -87,7 +87,7 @@
 static const rio_dev_handle_t INVALID_RIO_HANDLE = ((rio_dev_handle_t)-1);
 
 //Memory mapping container definition
-#if defined(UHD_PLATFORM_LINUX)
+#if defined(UHD_PLATFORM_LINUX) || defined(UHD_PLATFORM_BSD)
     struct rio_mmap_t {
         rio_mmap_t() : addr(NULL), size(0) {}
         void *addr;


Home | Main Index | Thread Index | Old Index