public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Cc: 'GNU C Library' <libc-alpha@sourceware.org>
Subject: Re: [PATCH v2 8/9] i386: Move hypot implementation to C
Date: Mon, 1 Nov 2021 14:09:17 -0300	[thread overview]
Message-ID: <1affd093-a875-af32-d0c8-3cca0d5b7b17@linaro.org> (raw)
In-Reply-To: <VE1PR08MB55995F3FEA12658DFBF2A11D83869@VE1PR08MB5599.eurprd08.prod.outlook.com>



On 28/10/2021 10:43, Wilco Dijkstra wrote:
> Hi Adhemerval,
> 
> +double
> +__ieee754_hypot (double x, double y)
> +{
> +  if ((isinf (x) || isinf (y))
> +      && !issignaling (x) && !issignaling (y))
> +    return INFINITY;
> +  if (isnan (x) || isnan (y))
> +    return x + y;
> +
> +  long double lx = x;
> +  long double ly = y;
> +  double r = math_narrow_eval (sqrtl (lx * lx + ly * ly));
> +  math_check_force_underflow_nonneg (r);
> +  return r;
> +}
> 
> This looks very generic, so wouldn't it be possible to move to
> sysdeps/ieee754/ldbl-96?

I am not sure this does make sense since ldbl-96 only contains
symbols related to 'long double' and adding symbols for other
floating point types is not the best code organization imho.

Another reason is it really dependable of the underlying hardware,
since 'long double' might be implemented with software emulation
and using float/double operation might yield better performance.

  reply	other threads:[~2021-11-01 17:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28 13:43 Wilco Dijkstra
2021-11-01 17:09 ` Adhemerval Zanella [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-10-25 11:57 [PATCH v2 0/9] Improve hypot() Adhemerval Zanella
2021-10-25 11:57 ` [PATCH v2 8/9] i386: Move hypot implementation to C Adhemerval Zanella
2021-10-25 17:10   ` Joseph Myers
2021-11-01 17:23     ` Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1affd093-a875-af32-d0c8-3cca0d5b7b17@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).