https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
On powerpc64le-linux with -O2 -nostdinc -mlong-double-128 -mabi=ieeelongdouble
int main() { __builtin_printf("%.20Lg \n",__builtin_sqrtl(2.0L)); }
we also emit on the trunk:
        .long   325511829
        .long   -922176773
        .long   -429395012
        .long   1073703433
And similarly for:
long double foo (long double x) { return __builtin_hypotl (x, x); }
with -O2 -nostdinc -mlong-double-128 -mabi=ieeelongdouble -ffast-math where we
optimize the hypotl to fabs(x) * M_PI2l (dconst_sqrt2) it is the same constant.
const REAL_VALUE_TYPE *
dconst_sqrt2_ptr (void)
{
  static REAL_VALUE_TYPE value;

  /* Initialize mathematical constants for constant folding builtins.
     These constants need to be given to at least 160 bits precision.  */
  if (value.cl == rvc_zero)
    {
      mpfr_t m;
      mpfr_init2 (m, SIGNIFICAND_BITS);
      mpfr_sqrt_ui (m, 2, MPFR_RNDN);
      real_from_mpfr (&value, m, NULL_TREE, MPFR_RNDN);
      mpfr_clear (m);
    }
  return &value;
}

Reply via email to