Bug 91638 - powerpc -mlong-double-NN (documentation) issues
Summary: powerpc -mlong-double-NN (documentation) issues
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: documentation
Depends on:
Blocks:
 
Reported: 2019-09-02 14:15 UTC by Segher Boessenkool
Modified: 2020-03-09 17:05 UTC (History)
2 users (show)

See Also:
Host:
Target: powerpc
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-01-29 00:00:00


Attachments
patch to update -mlong-double-NN description (616 bytes, patch)
2020-03-05 19:04 UTC, Carl Love
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Segher Boessenkool 2019-09-02 14:15:30 UTC
The -mlong-double-64 and -mlong-double-128 command line options aren't
documented.

The -Q --help=target output shows
  -mlong-double-[64,128]                127
which is a bit confusing (it only allows setting it to 64 and 128; 127
and 129 have an internal meaning, but the user shouldn't see it, ideally).
Comment 1 Martin Liška 2020-01-29 11:37:59 UTC
I see a documentation:

$ powerpc64le-suse-linux-gcc --help=target | grep long-do
  -mlong-double-[64,128]      Specify size of long double.
Comment 2 Segher Boessenkool 2020-02-06 18:42:21 UTC
That isn't documentation.
Comment 3 Carl Love 2020-03-05 19:02:30 UTC
I have looked at what -mlong-double-64 and -mlong-double-128 do.  

The -mlong-double-64 tells GCC to use the 64-bit IEEE floating point format.

The -mlong-double-128 tells GCC to use 128-bit floating point format.  On ppc64, there are actually two 128-bit floating point formats that are supported.  So it looks to me like the user should also specify either -mabi=ieeelongdouble to get the 128-bit IEEE floating point format or -mabi=ibmlongdouble to get the IBM 128-bit floating point format.  

I created a patch that updates the output of the gcc --target-help  command to print the following:

  -mlong-double-              Use -mlong-double-64 for 64-bit IEEE floating
                              point format. Use -mlong-double-128 and
                              -mabi=ieeelongdouble for 128-bit IEEE floating
                              point format. Use -mlong-double-128 and
                              -mabi=ibmlongdouble for 128-bit IBM floating
                              point format.

Please let me know if this description is accurate and better.  Suggestions on improvements are always welcome.
Comment 4 Carl Love 2020-03-05 19:04:19 UTC
Created attachment 47982 [details]
patch to update -mlong-double-NN description

Attached the proposed patch so I will not lose it.
Comment 5 Segher Boessenkool 2020-03-05 23:14:11 UTC
Yeah, not sure.  A user can just do `-mlong-double-128`, and will get whichever
128-bit format is the default.  That is the "old" way, when we only had the
ibm128 format, and it will be the new way too, when ibm128 has become a bad
dream and everything uses ieee128.

Maybe just something like

Use -mlong-double-128 for an 128-bit floating point format (either IEEE or IBM)?
Comment 6 Carl Love 2020-03-06 16:34:25 UTC
Yea, I like that a bit better.  It is a bit shorter, mine was a bit verbose.

I updated the patch to print:

  -mlong-double-              Use -mlong-double-64 for 64-bit IEEE floating
                              point format. Use -mlong-double-128 for 128-bit
                              floating point format (either IEEE or IBM).

I will post the patch to the mailing list for review/acceptance on mainline.
Comment 7 Carl Love 2020-03-09 16:59:16 UTC
Patch approved by Segher with a few minor fixes to the patch.

Patch committed to mainline

commit 9439378f7a08cf9c8f524c9f3758a37d804ac106
Author: Carl Love <cel@us.ibm.com>
Date:   Thu Mar 5 12:52:35 2020 -0600

    rs6000: Fix -mlong-double documentation
    
    gcc/ChangeLog
    
    2020-03-09  Carl Love  <cel@us.ibm.com>
    
        * config/rs6000/rs6000.opt: Update the description of the
        command line option.
Comment 8 Bill Schmidt 2020-03-09 17:05:33 UTC
Work is complete.