This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: __float128 and _Float128 compatibility from ABI point of view


On 2018-03-02 10:20:41 +1100, sisyphus1@optusnet.com.au wrote:
> -----Original Message----- From: Vincent Lefevre
> Sent: Friday, February 23, 2018 1:08 AM
> To: gcc-help@gcc.gnu.org
> Subject: __float128 and _Float128 compatibility from ABI point of view
> 
> > For the next MPFR major release (4.1.0), we plan to change __float128 to
> > _Float128 (with a fallback to __float128 when necessary):
> 
> With current svn (rev 12452), how do I determine which of the two
> types was used ?

You can either see the tests in config.log or check whether there is
-D_Float128=__float128 in DEFS (or an equivalent #define in config.h
if you have such a file).

> Also, tfma.exe is failing on x64 builds of rev 12452 on Windows (gcc-7.2.0):
> 
> #########################
> tfma.c:592: MPFR assertion failed: inex < 0
> 
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
> #########################
> 
> This can be addressed by replacing:
> 
> mpfr_set_ui (x, (1UL << (GMP_NUMB_BITS / 2)) + 1, MPFR_RNDN);
> mpfr_set_ui (y, (1UL << (GMP_NUMB_BITS / 2)) - 1, MPFR_RNDN);

Thanks. This is obviously wrong. Unfortunately I didn't have the time
to check all the numerous commits.

> with, for example:
> 
> mpfr_set_ui (x, 1, MPFR_RNDN);
> mpfr_set_ui (y, 1, MPFR_RNDN);
> mpfr_mul_2exp(x, x, GMP_NUMB_BITS / 2, MPFR_RNDN);
> mpfr_mul_2exp(y, y, GMP_NUMB_BITS / 2, MPFR_RNDN);
> mpfr_add_ui(x, x, 1, MPFR_RNDN);
> mpfr_add_si(y, y, -1, MPFR_RNDN);

I've changed it to:

  mpfr_set_ui_2exp (x, 1, GMP_NUMB_BITS / 2, MPFR_RNDN);
  mpfr_sub_ui (y, x, 1, MPFR_RNDN);
  mpfr_add_ui (x, x, 1, MPFR_RNDN);

> The problem is that, with Windows x64 builds, unsigned long is only
> 32 bits and GMP_NUMB_BITS is 64.

This is a configuration not yet tested on my side (I currently use
the 32-bit wine, but I suppose that I could use wine64 in a similar
way).

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]