[PATCH] gfortran -- Map REAL128 to REAL kind type with widest precision

Jerry DeLisle jvdelisle@charter.net
Fri Feb 10 01:40:00 GMT 2017


On 02/09/2017 12:40 PM, Janne Blomqvist wrote:
> On Thu, Feb 9, 2017 at 8:33 PM, Steve Kargl
> <sgk@troutmask.apl.washington.edu> wrote:
>> On Thu, Feb 09, 2017 at 12:10:02PM +0200, Janne Blomqvist wrote:
>>>
>>> That being said, I think even with Steve's patch, it's not guaranteed
>>> to give you IEEE 754-2008 binary128. E.g. on IBM POWER targets,
>>> depending on the ABI you may get an IBM extended double (double-double
>>> or __ibm128) format. Although if IEEE binary128 is also available,
>>> with Steve's patch you should get that one has it has more precision
>>> that __ibm128.
>>
>> I do not have to a IBM POWER system, so cannot easily check the
>> effect of my patch.
>
> Well, me neither. (And as I haven't heard back from Laurent Guerby
> wrt. access to the GCC compile farm, my charlen->size_t patch is
> stuck, and most likely won't make it to GCC 7. Gah!)

I found the AIX machine, but it is missing quite a few prerequisites so I have 
to build them myself. And trying to get that done I am not being very successful.

>
>>  I, however, suspect that it has no effect,
>> because IBM POWER probably only supports REAL(4), REAL(8), and
>> REAL(16).  REAL(16) can have either double-double or IEEE-754
>> semantics, but not both.
>
> Hmm, I think you're right.  Per
> https://gcc.gnu.org/wiki/Ieee128PowerPC it seems that powerpc defines
> IFmode and KFmode in addition to TFmode, where TFmode is an alias to
> IFmode or KFmode where the choice depends on various compile options,
> ABI defaults etc. And further, in trans-types.c:gfc_init_kinds we use
> TFmode only if we also use libquadmath (if TFmode is different from
> long double). So I guess on POWER REAL(16) will be whatever the C long
> double type maps to.
>

I do have such access, so will check it. At least on gcc112 I have the build 
working.

>>>>>  - Is this appropriate for stage 4?

If all agree its the right thing, then by all means, do it in stage 4. Gfortran 
is not considered release critical, so we have the flexibility. Once trunk is 
frozen, then hold for release manager approval.

Jerry



More information about the Fortran mailing list