On Mon, Dec 16, 2019 at 8:29 PM Martin Maechler
<maech...@stat.math.ethz.ch> wrote:
>
> Thank you, Dirk, for keeping me in the loop.  I'm happy if you test to
> see if the change works.
>
> As a matter of fact, I think a slightly different patch should be used
> rather than the one proposed.
> Given what I've learned in the meantime, I think I'd  rather use
>
> Index: src/main/arithmetic.c
> ===================================================================
> --- src/main/arithmetic.c    (Revision 77566)
> +++ src/main/arithmetic.c    (Arbeitskopie)
> @@ -176,8 +176,12 @@
>  #endif
>  }
>
> +
>  #if HAVE_LONG_DOUBLE && (SIZEOF_LONG_DOUBLE > SIZEOF_DOUBLE)
> -static LDOUBLE q_1_eps = 1 / LDBL_EPSILON;
> +# ifndef __PPC64__
> +static // PowerPC 64 (when gcc has -mlong-double-128) breaks when
> 'static' (gcc bug, there)
> +# endif
> +       LDOUBLE q_1_eps = 1 / LDBL_EPSILON;
>  #else
>  static double  q_1_eps = 1 / DBL_EPSILON;
>  #endif
>
>
> which would keep PowerPC 64 to use the high precision epsilon here,
> rather than the one to use when there is no long double present.
> Martin

Oops, no!
Tomas the expert has explained me why that would not be good enough,
instead recommending a macro  (which would be "constant folded" i.e.,
computed at compile time were available);
If I conditionalize that .. in order to be back compatible outside of
PPC_64,  I'd get

Index: src/main/arithmetic.c
===================================================================
--- src/main/arithmetic.c    (Revision 77583)
+++ src/main/arithmetic.c    (Arbeitskopie)
@@ -176,8 +176,14 @@
 #endif
 }

+
 #if HAVE_LONG_DOUBLE && (SIZEOF_LONG_DOUBLE > SIZEOF_DOUBLE)
+# ifdef __PPC64__
+ // PowerPC 64 (when gcc has -mlong-double-128) breaks here ...
+#  define q_1_eps (1 / LDBL_EPSILON)
+# else
 static LDOUBLE q_1_eps = 1 / LDBL_EPSILON;
+# endif
 #else
 static double  q_1_eps = 1 / DBL_EPSILON;
 #endif

-------------
The above may work correctly  (I tried a version where I replaced
__PPC64__  by  1    such as to test with the gcc 9.2 (on my
architecture).
I'd be glad if you could confirm for  powerPC 64 ..
then I think we could commit it.

Martin

Reply via email to