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

2023-11-14 Thread gaius at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

--- Comment #12 from Gaius Mulley  ---
Many thanks for the feedback and testing - I'll rework the patch and post it to
gcc-patches as suggested.

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

2023-11-09 Thread tkoenig at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

Thomas Koenig  changed:

   What|Removed |Added

 CC||tkoenig at gcc dot gnu.org

--- Comment #11 from Thomas Koenig  ---
A remark - gfortran handles 128-bit reals on POWER as well, it might be a good
idea to look into libgfortran's configure scripts.

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

2023-11-08 Thread tschwinge at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

--- Comment #10 from Thomas Schwinge  ---
In addition to what Maciej said (..., and similarly, I don't have any proper
knowledge about PowerPC details):

(In reply to Gaius Mulley from comment #6)
> Created attachment 56522 [details]
> Proposed fix v5

Thanks for looking into this!

> Here is the latest patch which [...] 96
> failures on gcc135.  [...]

With no special 'configure' flags, I'm seeing (presumably) those, too.

I noticed in 'build-gcc/gcc/m2/config-make' (generated from
'gcc/m2/config-make.in'):

# Does the target have -mabi=ieeelongdouble support in libm?  (yes/no).
HAVE_TARGET_LONG_DOUBLE_IEEE = @have_target_long_double_ieee@

..., so missing 'AC_SUBST' or similar -- but is that actually unused?

I further noticed the following delta when regenerating 'libgm2/configure':

 case "$target" in
powerpc*-*-linux*)
- LONG_DOUBLE_COMPAT_FLAGS="$LONG_DOUBLE_COMPAT_FLAGS
-mno-gnu-attribute"
  # Check for IEEE128 support in libm:


(In reply to Gaius Mulley from comment #8)
> Here is the same patch as v5 but generated using git diff -w.

Please don't include unrelated changes (here: whitespace cleanup); handle that
separately (if you must).  ;-)

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

2023-11-08 Thread macro at orcam dot me.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

--- Comment #9 from Maciej W. Rozycki  ---
Hmm, the host check for `__frexpieee128' in gcc/ will surely not do
what's intended: even if the host is `powerpc*-*-linux*', the target
will often be something else and vice versa (libgm2's host is GCC's
target).

I think there is no way to verify target C library features in gcc/
at `configure' time, because at this point we may not yet have a target
compiler.  I haven't dealt with such a situation before, but AFAICS
people have used GCC_GLIBC_VERSION_GTE_IFELSE to explicitly check for
the glibc version required instead.  There's a relevant case for
TARGET_DEFAULT_LONG_DOUBLE_128 you can use as an example.

I'm not sure if such a check is needed though, unless perhaps for
sanity, as you only define TARGET_LIBM_PROVIDES_LONG_DOUBLE_IEEE128 if
--with-long-double-format=ieee has been explicitly given.

Also ISTM you can omit the target check for `powerpc64le-*-linux*' here
keeping $with_long_double_format=ieee check only and get support for the
relevant `powerpc64-*-linux*' targets too, as -with-long-double-format=
will already have verified correct usage.

Finally you may or may not have to check for $gcc_cv_target_ldbl128
equal to "yes" too, in case someone has used --without-long-double-128
(I'm not sure what the consequences would be, but it has caught my
attention, so please double-check).

Overall please refer to someone more familiar with POWER GCC targets as
I can only comment based on what I can see in the scripts and my general
experience.  The best course of action might be submitting the patch to
gcc-patches for review, cc-ing RS6000 port maintainers, as the most
relevant people may not be reading this bug report.

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

2023-11-07 Thread gaius at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

--- Comment #8 from Gaius Mulley  ---
Created attachment 56524
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56524=edit
Proposed fix v5 (git diff -w)

Here is the same patch as v5 but generated using git diff -w.

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

2023-11-07 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

 Status|NEW |ASSIGNED

--- Comment #7 from Gaius Mulley  ---
Adding another patch using git diff -w to reduce patch clutter for review.

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

2023-11-07 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 #56508|0   |1
is obsolete||

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

Many thanks for the hint about the __frexpieee128 libm test.

Here is the latest patch which passes all tests on gcc120 and has 96 failures
on gcc135.  It was configured with --with-long-double-format=ieee on gcc120.

It has separate checks (or switch) for host and target long double 128 support.

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

2023-11-04 Thread macro at orcam dot me.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

--- Comment #5 from Maciej W. Rozycki  ---
Hmm, this seems awkward to me.  It won't work AFAICT with the usual
native bootstrap environment, where you just run:

$ /path/to/configure && make bootstrap

and it won't work where you have an old version of glibc installed
and build with:

$ /path/to/configure --with-cpu=power10 && make bootstrap

either.  Shouldn't this just use the same check that libstdc++ does?
See the piece starting with:

# Check for IEEE128 support in libm.

in libstdc++-v3/configure.ac.  Maybe you just need to check for the
presence of `__frexpieee128' and ignore the rest, as you don't seem
to be willing to provide support for the IBM long double format in
libgm2, or do you?

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

2023-11-04 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

 CC||gaius at gcc dot gnu.org

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

Here is a proposed patch which detects whether the target_cpu is power10 and
target is ppc64le.  I've seen it build successfully on gcc135 (without
bootstrap) and bootstrap on gcc120  (I'm currently running a bootstrap on
gcc135).

I'm unsure whether these libgm2/configure.ac and gcc/m2/configure.ac tests are
sufficient - and suspect more combinations should be checked (ie the shell case
statements might need expanding).

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

2023-11-01 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

--- Comment #3 from Eric Gallager  ---
(In reply to Thomas Schwinge from comment #2)
> While you (Gaius) here report test failure, similar to what Maciej had
> reported in PR112091 "rs6000: redefinition of 'constexpr long double
> std::abs(long double)', while building libgm2", I can't even build libgm2
> anymore.
> 
> Similar had reported Eric (CCed here) on GCC IRC, 2023-10-20:
> 
>  ok now this is an error I haven't seen before
> 
> /home/egallager/gcc/.cfarm135_build.build/powerpc64le-unknown-linux-gnu/
> libstdc++-v3/include/bits/std_abs.h:137:3: error: redefinition of 'constexpr
> long double std::abs(long double)'
>  seen on cfarm135
>  I think I remember something about __float128 being weird
> on certain powerpc systems? Is there a configure flag that affects it?
>  I'll open a bug about it...
>  although actually wait... I'm not quite sure the
> component, though... it's an error from a libstdc++ header, but it shows up
> while building KeyBoardLEDs.lo for libm2cor in libgm2, but only for a
> specific target...

Ah, thanks for the cc! I'd meant to look further into this, but got distracted
by other things...

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

2023-10-31 Thread tschwinge at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

Thomas Schwinge  changed:

   What|Removed |Added

   Keywords||build
 CC||egallager at gcc dot gnu.org,
   ||tschwinge at gcc dot gnu.org
   Last reconfirmed||2023-10-31
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #2 from Thomas Schwinge  ---
While you (Gaius) here report test failure, similar to what Maciej had reported
in PR112091 "rs6000: redefinition of 'constexpr long double std::abs(long
double)', while building libgm2", I can't even build libgm2 anymore.

Similar had reported Eric (CCed here) on GCC IRC, 2023-10-20:

 ok now this is an error I haven't seen before

/home/egallager/gcc/.cfarm135_build.build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/bits/std_abs.h:137:3:
error: redefinition of 'constexpr long double std::abs(long double)'
 seen on cfarm135
 I think I remember something about __float128 being weird on
certain powerpc systems? Is there a configure flag that affects it?
 I'll open a bug about it...
 although actually wait... I'm not quite sure the component,
though... it's an error from a libstdc++ header, but it shows up while building
KeyBoardLEDs.lo for libm2cor in libgm2, but only for a specific target...

For example, I've got on powerpc64le-unknown-linux-gnu on indeed old Ubuntu
14.04 "trusty":

+#define M2C_LONGREAL_FLOAT128 1
+#define M2C_LONGREAL_PPC64LE 1

..., and this fails to build as follows:

libtool: compile:  [...]/build-gcc/./gcc/xg++ -B[...]/build-gcc/./gcc/
-nostdinc++ -nostdinc++
-I[...]/build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/powerpc64le-unknown-linux-gnu
-I[...]/build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/include
-I[...]/source-gcc/libstdc++-v3/libsupc++
-I[...]/source-gcc/libstdc++-v3/include/backward
-I[...]/source-gcc/libstdc++-v3/testsuite/util
-L[...]/build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/src
-L[...]/build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/src/.libs
-L[...]/build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-B/powerpc64le-unknown-linux-gnu/bin/ -B/powerpc64le-unknown-linux-gnu/lib/
-isystem /powerpc64le-unknown-linux-gnu/include -isystem
/powerpc64le-unknown-linux-gnu/sys-include -c
-I[...]/source-gcc/libgm2/libm2cor -g -O2 -D_GNU_SOURCE -g -O2 -I. -I..
-I[...]/source-gcc/gcc/m2/gm2-libs -I[...]/source-gcc/gcc/m2/gm2-libs-iso
-DBUILD_GM2_LIBS -I[...]/source-gcc/libgm2/libm2cor/../
-I[...]/source-gcc/libgm2/libm2cor/../libm2iso -mabi=ieeelongdouble
[...]/source-gcc/libgm2/libm2cor/KeyBoardLEDs.cc  -fPIC -DPIC -o
.libs/KeyBoardLEDs.o
cc1plus: warning: Using IEEE extended precision ‘long double’ [-Wpsabi]
In file included from
[...]/build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/cstdlib:81,
 from
[...]/build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/stdlib.h:36,
 from [...]/source-gcc/libgm2/libm2cor/KeyBoardLEDs.cc:43:
   
[...]/build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/bits/std_abs.h:137:3:
error: redefinition of ‘constexpr long double std::abs(long double)’
  137 |   abs(__float128 __x)
  |   ^~~
   
[...]/build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/bits/std_abs.h:79:3:
note: ‘constexpr long double std::abs(long double)’ previously defined here
   79 |   abs(long double __x)
  |   ^~~
make[5]: *** [KeyBoardLEDs.lo] Error 1

[...]

libtool: compile:  [...]/build-gcc/./gcc/xg++ -B[...]/build-gcc/./gcc/
-nostdinc++ -nostdinc++
-I[...]/build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/powerpc64le-unknown-linux-gnu
-I[...]/build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/include
-I[...]/source-gcc/libstdc++-v3/libsupc++
-I[...]/source-gcc/libstdc++-v3/include/backward
-I[...]/source-gcc/libstdc++-v3/testsuite/util
-L[...]/build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/src
-L[...]/build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/src/.libs
-L[...]/build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-B/powerpc64le-unknown-linux-gnu/bin/ -B/powerpc64le-unknown-linux-gnu/lib/
-isystem /powerpc64le-unknown-linux-gnu/include -isystem
/powerpc64le-unknown-linux-gnu/sys-include -c
-I[...]/source-gcc/libgm2/libm2pim -g -O2 -D_GNU_SOURCE -g -O2 -I. -I..
-I[...]/source-gcc/gcc/m2/gm2-libs -I[...]/source-gcc/gcc/m2/gm2-libs-iso
-DBUILD_GM2_LIBS -I[...]/source-gcc/libgm2/libm2pim/../
-I[...]/source-gcc/libgm2/libm2pim/../libm2iso -mabi=ieeelongdouble
[...]/source-gcc/libgm2/libm2pim/wrapc.cc  -fPIC -DPIC -o .libs/wrapc.o
cc1plus: warning: Using IEEE extended precision ‘long double’ [-Wpsabi]

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

2023-10-25 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111956

Andrew Pinski  changed:

   What|Removed |Added

 CC||macro at orcam dot me.uk

--- Comment #1 from Andrew Pinski  ---
*** Bug 112091 has been marked as a duplicate of this bug. ***