[Bug modula2/111956] [14 Regression] Many powerpc platforms do _not_ have support for IEEE754 long double

2024-01-18 Thread gaius at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

Gaius Mulley  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #22 from Gaius Mulley  ---
Closing now that the patch has been applied.

Also acknowledging that this fix doesn't solve the libm2 ABI compatibility.
I suspect a new PR should be opened for the ABI issue - maybe referring back
here.
But closing this PR as the regression has gone.

[Bug modula2/111956] [14 Regression] Many powerpc platforms do _not_ have support for IEEE754 long double

2024-01-18 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

--- Comment #21 from GCC Commits  ---
The master branch has been updated by Gaius Mulley :

https://gcc.gnu.org/g:f2872e00f61a5a333fa22e651d37d3b2035ac41f

commit r14-8227-gf2872e00f61a5a333fa22e651d37d3b2035ac41f
Author: Gaius Mulley 
Date:   Thu Jan 18 13:06:30 2024 +

PR modula2/111956 Many powerpc platforms do _not_ have support for IEEE754

This patch corrects commit
r14-4149-g81d5ca0b9b8431f1bd7a5ec8a2c94f04bb0cf032 which assummed
all powerpc platforms would have IEEE754 long double.  The patch
ensures that cc1gm2 obtains the default IEEE754 long double availability
from the configure generated tm_defines.  The user command
line switches -mabi=ibmlongdouble and -mabi=ieeelongdouble are implemented
to override the configuration defaults.

Bootstrapped on power8 and power9 machines.

gcc/m2/ChangeLog:

PR modula2/111956
* Make-lang.in (host_mc_longreal): Remove.
* configure: Regenerate.
* configure.ac (M2C_LONGREAL_FLOAT128): Remove.
(M2C_LONGREAL_PPC64LE): Remove.
* gm2-compiler/M2Options.def (SetIBMLongDouble): New procedure.
(GetIBMLongDouble): New procedure function.
(SetIEEELongDouble): New procedure.
(GetIEEELongDouble): New procedure function.
* gm2-compiler/M2Options.mod (SetIBMLongDouble): New procedure.
(GetIBMLongDouble): New procedure function.
(SetIEEELongDouble): New procedure.
(GetIEEELongDouble): New procedure function.
(InitializeLongDoubleFlags): New procedure called during
module block initialization.
* gm2-gcc/m2configure.cc: Remove duplicate includes.
(m2configure_M2CLongRealFloat128): Remove.
(m2configure_M2CLongRealIBM128): Remove.
(m2configure_M2CLongRealLongDouble): Remove.
(m2configure_M2CLongRealLongDoublePPC64LE): Remove.
(m2configure_TargetIEEEQuadDefault): New function.
* gm2-gcc/m2configure.def (M2CLongRealFloat128): Remove.
(M2CLongRealIBM128): Remove.
(M2CLongRealLongDouble): Remove.
(M2CLongRealLongDoublePPC64LE): Remove.
(TargetIEEEQuadDefault): New function.
* gm2-gcc/m2configure.h (m2configure_M2CLongRealFloat128): Remove.
(m2configure_M2CLongRealIBM128): Remove.
(m2configure_M2CLongRealLongDouble): Remove.
(m2configure_M2CLongRealLongDoublePPC64LE): Remove.
(m2configure_TargetIEEEQuadDefault): New function.
* gm2-gcc/m2options.h (M2Options_SetIBMLongDouble): New prototype.
(M2Options_GetIBMLongDouble): New prototype.
(M2Options_SetIEEELongDouble): New prototype.
(M2Options_GetIEEELongDouble): New prototype.
* gm2-gcc/m2type.cc (build_m2_long_real_node): Re-implement using
results of M2Options_GetIBMLongDouble and
M2Options_GetIEEELongDouble.
* gm2-lang.cc (gm2_langhook_handle_option): Add case
OPT_mabi_ibmlongdouble and call M2Options_SetIBMLongDouble.
Add case OPT_mabi_ieeelongdouble and call
M2Options_SetIEEELongDouble.
* gm2config.aci.in: Regenerate.
* gm2spec.cc (lang_specific_driver): Remove block defined by
M2C_LONGREAL_PPC64LE.
Remove case OPT_mabi_ibmlongdouble.
Remove case OPT_mabi_ieeelongdouble.

libgm2/ChangeLog:

PR modula2/111956
* Makefile.am (TARGET_LONGDOUBLE_ABI): Remove.
* Makefile.in: Regenerate.
* libm2cor/Makefile.am (TARGET_LONGDOUBLE_ABI): Remove.
* libm2cor/Makefile.in: Regenerate.
* libm2iso/Makefile.am (TARGET_LONGDOUBLE_ABI): Remove.
* libm2iso/Makefile.in: Regenerate.
* libm2log/Makefile.am (TARGET_LONGDOUBLE_ABI): Remove.
* libm2log/Makefile.in: Regenerate.
* libm2min/Makefile.am (TARGET_LONGDOUBLE_ABI): Remove.
* libm2min/Makefile.in: Regenerate.
* libm2pim/Makefile.am (TARGET_LONGDOUBLE_ABI): Remove.
* libm2pim/Makefile.in: Regenerate.

Signed-off-by: Gaius Mulley 

[Bug modula2/111956] [14 Regression] Many powerpc platforms do _not_ have support for IEEE754 long double

2024-01-17 Thread gaius at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

--- Comment #20 from Gaius Mulley  ---
Created attachment 57123
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57123=edit
ChangeLog for proposed fix

For completeness here is the changelog.

[Bug modula2/111956] [14 Regression] Many powerpc platforms do _not_ have support for IEEE754 long double

2024-01-17 Thread gaius at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

Gaius Mulley  changed:

   What|Removed |Added

  Attachment #56522|0   |1
is obsolete||
  Attachment #56524|0   |1
is obsolete||
  Attachment #57110|0   |1
is obsolete||

--- Comment #19 from Gaius Mulley  ---
Created attachment 57122
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57122=edit
Proposed fix

Here is the proposed fix - which in addition to the previous work in progress
patch implements -mabi= options.   Many thanks for all the hints.  I'll post it
to gcc patches as suggested above.

Seen it bootstrap on:

power8 
==

# of expected passes12974
# of unexpected failures18

power9
==

# of expected passes12992

x86_64
==

# of expected passes12992

[Bug modula2/111956] [14 Regression] Many powerpc platforms do _not_ have support for IEEE754 long double

2024-01-16 Thread gaius at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

--- Comment #18 from Gaius Mulley  ---
Created attachment 57110
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57110=edit
Work in progress fix

Many thanks for the config.gcc hints!  It now builds on gcc120 and gcc135 with
the work in progress patch.

Currently it lacks the -mabi= handling in gm2spec.cc, I've not revisited this
file yet and so any #ifdef M2C_LONGREAL (is now always) undefined.

However cc1gm2 uses the config.gcc and tm_defines and a summary of results on
gcc120:

=== gm2 Summary ===

# of expected passes12962
# of unexpected failures24
# of unresolved testcases   6

and on gcc135:

=== gm2 Summary ===

# of expected passes12974
# of unexpected failures18

I think the -mabi= should just override the default settings - and hopefully
the results will improve.

[Bug modula2/111956] [14 Regression] Many powerpc platforms do _not_ have support for IEEE754 long double

2024-01-16 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

--- Comment #17 from Richard Biener  ---
Note that the default C long double is what is controlled by
--with-long-double-128 and --with-long-double-format, those configs do not tell
you
whether using __ieee128 with -mabi=ieeelongdouble will work.

[Bug modula2/111956] [14 Regression] Many powerpc platforms do _not_ have support for IEEE754 long double

2024-01-16 Thread gaiusmod2 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

--- Comment #16 from gaiusmod2 at gmail dot com ---
"rguenth at gcc dot gnu.org"  writes:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956
>
> --- Comment #15 from Richard Biener  ---
> (In reply to Gaius Mulley from comment #14)
>> Ah apologies, is it best that I revert:
>> 
>> https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;
>> h=81d5ca0b9b8431f1bd7a5ec8a2c94f04bb0cf032
>> 
>> happy to do this in the morning.
>
> I think it might be better to define 
> M2C_LONGREAL_FLOAT128/M2C_LONGREAL_PPC64LE
> (whatever they exactly indicate) in terms of the existing
>
> --with-long-double-128
> --with-long-double-format
>
> aka the TARGET_DEFAULT_LONG_DOUBLE_128 that's put into the config plus
> with_long_double_format (I think that causes TARGET_IEEEQUAD_DEFAULT
> to be defined to 1/0, but only for ppc, via config.gcc and
> tm_defines).

yes thanks for the hints this sounds good.  I'll pursue this line for a fix.

> I can't say whether it's better to revert or disable/fix as I can't say
> how this for example affects the M2 ABI (like if there was any 'long double'
> before this change and what effective type this used).

Prior to the patch it used the default C long double type but many of
the intrinsic functions were broken.  Currently with the patch gcc120
has no regression test failures and gcc135 (yesterday with manual
configure intervention) was at 96 failures in the m2 testsuite.

I suspect configure confusion and hence using
TARGET_DEFAULT_LONG_DOUBLE_128 and TARGET_IEEEQUAD_DEFAULT should
resolve it.

[Bug modula2/111956] [14 Regression] Many powerpc platforms do _not_ have support for IEEE754 long double

2024-01-15 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

--- Comment #15 from Richard Biener  ---
(In reply to Gaius Mulley from comment #14)
> Ah apologies, is it best that I revert:
> 
> https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;
> h=81d5ca0b9b8431f1bd7a5ec8a2c94f04bb0cf032
> 
> happy to do this in the morning.

I think it might be better to define M2C_LONGREAL_FLOAT128/M2C_LONGREAL_PPC64LE
(whatever they exactly indicate) in terms of the existing

--with-long-double-128
--with-long-double-format

aka the TARGET_DEFAULT_LONG_DOUBLE_128 that's put into the config plus
with_long_double_format (I think that causes TARGET_IEEEQUAD_DEFAULT
to be defined to 1/0, but only for ppc, via config.gcc and tm_defines).

I can't say whether it's better to revert or disable/fix as I can't say
how this for example affects the M2 ABI (like if there was any 'long double'
before this change and what effective type this used).

[Bug modula2/111956] [14 Regression] Many powerpc platforms do _not_ have support for IEEE754 long double

2024-01-15 Thread gaius at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

--- Comment #14 from Gaius Mulley  ---
Ah apologies, is it best that I revert:

https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=81d5ca0b9b8431f1bd7a5ec8a2c94f04bb0cf032

happy to do this in the morning.

[Bug modula2/111956] [14 Regression] Many powerpc platforms do _not_ have support for IEEE754 long double

2024-01-14 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |14.0
 CC||rguenth at gcc dot gnu.org
 Target||powerpc*-*-*
Summary|Many powerpc platforms do   |[14 Regression] Many
   |_not_ have support for  |powerpc platforms do _not_
   |IEEE754 long double |have support for IEEE754
   ||long double

--- Comment #13 from Richard Biener  ---
It's a regression btw, GCC 13 was fine with this configuration.  I'm also
seeing this.