diff mbox

Doc update to mention MPFR (Re: [RFC][00/19] Target FP: Precise target floating-point emulation)

Message ID 20171120134413.0F07CD802C3@oc3748833570.ibm.com
State New
Headers show

Commit Message

Ulrich Weigand Nov. 20, 2017, 1:44 p.m. UTC
Eli Zaretskii wrote:
> > Date: Thu, 16 Nov 2017 20:05:59 +0100 (CET)
> > From: "Ulrich Weigand" <uweigand@de.ibm.com>
> > Cc: eliz@gnu.org (Eli Zaretskii), gdb-patches@sourceware.org
> > 
> > I've just posted an updated set of patches that implements the
> > suggestion to use host FP if the format matches, and MPFR if not.
> > To keep code complexity down, this is done by encapsulating the
> > operations in an abstract base class with multiple implementations.
> > https://sourceware.org/ml/gdb-patches/2017-11/msg00323.html
> > https://sourceware.org/ml/gdb-patches/2017-11/msg00324.html
> > 
> > Does this address your concerns?
> 
> Yes, thank you very much.

Thanks for confirming!

I just noticed that I forgot to update the docs to mention MPFR.
The following patch adds this to README and gdb.texinfo in the
same places where libexpat is mentioned.  It also add a brief
mention to NEWS.

Is this OK?

Thanks,
Ulrich


gdb/ChangeLog:

	* NEWS: Document use of GNU MPFR.
	* README: Likewise.
	* doc/gdb.texinfo: Likewise

Comments

Eli Zaretskii Nov. 20, 2017, 5:23 p.m. UTC | #1
> Date: Mon, 20 Nov 2017 14:44:12 +0100 (CET)
> From: "Ulrich Weigand" <uweigand@de.ibm.com>
> Cc: brobecker@adacore.com, gdb-patches@sourceware.org
> 
> --- binutils-gdb.orig/gdb/NEWS
> +++ binutils-gdb/gdb/NEWS
> @@ -3,6 +3,10 @@
>  
>  *** Changes since GDB 8.0
>  
> +* GDB now uses the GNU MPFR library, if available, to emulate target
> +  floating-point arithmetic during expression evaluation when the target
> +  uses different floating-point formats than the host.
> +

This part is OK.

> +   GDB uses GNU MPFR, a library for multiple-precision floating-point
> +computation with correct rounding, to emulate target floating-point
> +arithmetic during expression evaluation when the target uses different
> +floating-point formats than the host.  MPFR will be linked in if it is
> +available at build time.  At least version 3.1 of GNU MPFR is required.
> +If GNU MPFR it is not available, GDB will fall back to using host
> +floating-point arithmetic.  The latest version of GNU MPFR should be
> +available from `http://www.mpfr.org´.
                                      ^
Some non-ASCII character sneaked in here.

> +`--with-mpfr'
> +     Build GDB with the GNU MPFR library.  (Done by default if
> +     GNU MPFR is installed and found at configure time.)  This library
> +     is used to emulate target floating-point arithmetic during expression
> +     evaluation when the target uses different floating-point formats than
> +     the host. At least version 3.1 of GNU MPFR is required.  If GNU MPFR

I would drop the reference to minimum supported MPFR version here: it
tends to become outdated as time goes by, and I believe the configure
script includes the necessary tests for what we need from MPFR, and
will reject versions that don't fit the bill.

(It is okay to have the version mentioned in NEWS, as that is a
one-time announcement.)

Also, please make sure there are 2 spaces between sentences.

> +@item MPFR
> +@anchor{MPFR}
> +@value{GDBN} can use the GNU MPFR multiple-precision floating-point
> +library.  This library may be included with your operating system
> +distribution; if it is not, you can get the latest version from
> +@url{http://www.mpfr.org}.  At least version 3.1 of GNU MPFR is
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Same here.

> +formats than the host.  If GNU MPFR it is not available, GDB will
                                                            ^^^
@value{GDBN}

The changes are okay with those gotchas fixed.

Thanks.
diff mbox

Patch

Index: binutils-gdb/gdb/NEWS
===================================================================
--- binutils-gdb.orig/gdb/NEWS
+++ binutils-gdb/gdb/NEWS
@@ -3,6 +3,10 @@ 
 
 *** Changes since GDB 8.0
 
+* GDB now uses the GNU MPFR library, if available, to emulate target
+  floating-point arithmetic during expression evaluation when the target
+  uses different floating-point formats than the host.
+
 * GDB now supports access to the guarded-storage-control registers and the
   software-based guarded-storage broadcast control registers on IBM z14.
 
Index: binutils-gdb/gdb/README
===================================================================
--- binutils-gdb.orig/gdb/README
+++ binutils-gdb/gdb/README
@@ -89,6 +89,15 @@  features.  Expat will be linked in if it
 those features will be disabled.  The latest version of Expat should be
 available from `http://expat.sourceforge.net'.
 
+   GDB uses GNU MPFR, a library for multiple-precision floating-point
+computation with correct rounding, to emulate target floating-point
+arithmetic during expression evaluation when the target uses different
+floating-point formats than the host.  MPFR will be linked in if it is
+available at build time.  At least version 3.1 of GNU MPFR is required.
+If GNU MPFR it is not available, GDB will fall back to using host
+floating-point arithmetic.  The latest version of GNU MPFR should be
+available from `http://www.mpfr.org´.
+
    GDB can be used as a cross-debugger, running on a machine of one
 type while debugging a program running on a machine of another type.
 See below.
@@ -475,6 +484,16 @@  prefer; but you may abbreviate option na
      have libexpat installed, you can  get the latest version from
      http://expat.sourceforge.net.
 
+`--with-mpfr'
+     Build GDB with the GNU MPFR library.  (Done by default if
+     GNU MPFR is installed and found at configure time.)  This library
+     is used to emulate target floating-point arithmetic during expression
+     evaluation when the target uses different floating-point formats than
+     the host. At least version 3.1 of GNU MPFR is required.  If GNU MPFR
+     is not available, GDB will fall back to using host floating-point
+     arithmetic.  If your host does not have GNU MPFR installed, you can
+     get the latest version from http://www.mpfr.org.
+
 `--with-python[=PATH]'
      Build GDB with Python scripting support.  (Done by default if
      libpython is present and found at configure time.)  Python makes
Index: binutils-gdb/gdb/doc/gdb.texinfo
===================================================================
--- binutils-gdb.orig/gdb/doc/gdb.texinfo
+++ binutils-gdb/gdb/doc/gdb.texinfo
@@ -34270,6 +34270,22 @@  Branch trace (@pxref{Branch Trace Format
 @pxref{Branch Trace Configuration Format})
 @end itemize
 
+@item MPFR
+@anchor{MPFR}
+@value{GDBN} can use the GNU MPFR multiple-precision floating-point
+library.  This library may be included with your operating system
+distribution; if it is not, you can get the latest version from
+@url{http://www.mpfr.org}.  At least version 3.1 of GNU MPFR is
+required.  The @file{configure} script will search for this library
+in several standard locations; if it is installed in an unusual path,
+you can use the @option{--with-libmpfr-prefix} option to specify
+its location.
+
+GNU MPFR is used to emulate target floating-point arithmetic during
+expression evaluation when the target uses different floating-point
+formats than the host.  If GNU MPFR it is not available, GDB will
+fall back to using host floating-point arithmetic.
+
 @item zlib
 @cindex compressed debug sections 
 @value{GDBN} will use the @samp{zlib} library, if available, to read