hi! On Wed, Jul 07, 2021 at 03:58:37PM -0400, Michael Meissner wrote: > +/* We force the long double type to be IBM 128-bit because the > CONVERT_TO_PINF
There is no "forcing" here. "We use ..." or "We require ..." is fine. "Force" suggests something tries to prevent you. "Override" is worse. What is overridden, who's decision is overridden? > +# Check if we can explicitly override the long double format to use the IBM > +# 128-bit extended double format, and GLIBC supports doing this override by > +# switching the sprintf to handle IBM 128-bit long double. > + > +proc add_options_for_ppc_long_double_override_ibm128 { flags } { So this name does not say what it does at all (it does not say anything about glibc). > + if { [istarget powerpc*-*-*] } { > + return "$flags -mlong-double-128 -Wno-psabi -mabi=ibmlongdouble" > + } > + return "$flags" > +} (And neither does this code. The comment is for the *next* function!) > +proc check_effective_target_ppc_long_double_override_ibm128 { } { So this returns false if your libc does not handle printf for your selected long double type. That is problematic, the name does not suggest anything like that. > + return [check_runtime_nocache ppc_long_double_override_ibm128 { > + #include <string.h> > + #include <stdio.h> > + volatile __ibm128 a = (__ibm128) 3.0; > + volatile long double one = 1.0L; > + volatile long double two = 2.0L; > + volatile long double b; > + char buffer[20]; > + int main() > + { > + #if !defined(_ARCH_PPC) || !defined(__LONG_DOUBLE_IBM128__) > + return 1; This is only ever called for Power. Remove the first part please. When can the second part trigger? > + #else > + b = one + two; > + if (memcmp ((void *)&a, (void *)&b, sizeof (long double)) != 0) > + return 1; > + sprintf (buffer, "%lg", b); > + return strcmp (buffer, "3") != 0; > + #endif > + } > + } [add_options_for_ppc_long_double_override_ibm128 ""]] > +} Those casts are useless btw, don't do that. And that sizeof *has* to be 16, and so does that of __ibm128, so just write 16 please. Many more of the same... Use something like the stuff starting at foreach { armfunc armflag armdefs } { (for arm) in target-supports.exp? Segher