unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Vineet Gupta via Libc-alpha <libc-alpha@sourceware.org>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	"libc-alpha@sourceware.org" <libc-alpha@sourceware.org>
Cc: "linux-snps-arc@lists.infradead.org"
	<linux-snps-arc@lists.infradead.org>
Subject: Re: [PATCH 4/5] aarch/fpu: use generic sqrt, fma functions
Date: Mon, 1 Jun 2020 21:44:39 +0000	[thread overview]
Message-ID: <e6b5ba39-dfd4-abe3-5743-ae1bf1b8e9a9@synopsys.com> (raw)
In-Reply-To: <c20755dc-bd3c-2ef6-c0ce-665529a62243@linaro.org>

On 6/1/20 9:38 AM, Adhemerval Zanella via Libc-alpha wrote:
> 
> 
> On 29/05/2020 23:00, Vineet Gupta wrote:
>> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
> 
> LGTM, some comments below.
> 
>> -#include <math_private.h>
>> -#include <libm-alias-finite.h>
>> -
>> -double
>> -__ieee754_sqrt (double d)
>> -{
>> -  return __builtin_sqrt (d);
>> -}
>> -libm_alias_finite (__ieee754_sqrt, __sqrt)
> 
> Ok.

How is one to test aarch64 port with hard-float. build-many-glibc doesn't have a
hf variant and hacking one didn't do the right thing either.

>> diff --git a/sysdeps/aarch64/fpu/math-use-builtins.h b/sysdeps/aarch64/fpu/math-use-builtins.h
>> new file mode 100644
>> index 000000000000..52f0a0dad6dd
>> --- /dev/null
>> +++ b/sysdeps/aarch64/fpu/math-use-builtins.h
>> @@ -0,0 +1,70 @@
>> +/* Using math gcc builtins instead of generic implementation.  aarch64 version.
>> +   Copyright (C) 2019-2020 Free Software Foundation, Inc.
> 
> I think it should be just 2020 here.

Fixed.

>> +
>> +/* Define these macros to 1 to use __builtin_xyz instead of the
>> +   generic implementation.  */
>> +#define USE_NEARBYINT_BUILTIN 0
>> +#define USE_NEARBYINTF_BUILTIN 0
>> +#define USE_NEARBYINTL_BUILTIN 0
>> +#define USE_NEARBYINTF128_BUILTIN 0
> 
> Since we are adding this new file for aarch64, we could also enable it fo
> nearbyint{f} and remove sysdeps/aarch64/fpu/s_nearbyint{f}.c as well.

OK, but only

+#define USE_NEARBYINT_BUILTIN 1
+#define USE_NEARBYINTF_BUILTIN 1

The other 2 are not defined currently. If they are, then I prefer they be enabled
as a separate commit for bisectability.


>> +#define USE_RINT_BUILTIN 0
>> +#define USE_RINTF_BUILTIN 0
>> +#define USE_RINTL_BUILTIN 0
>> +#define USE_RINTF128_BUILTIN 0
> 
> Ditto.

OK and again only RINT and RINTF.
Also I don't understand one thing. Both the generic and aarch64 code have this

float
__rintf (float x)
...
libm_alias_float (__rint, rint)

The alias arg 1 __rint seems to lack suffix 'f' ?


>> +
>> +#define USE_FLOOR_BUILTIN 0
>> +#define USE_FLOORF_BUILTIN 0

Again FLOOR, FLOORF only

>> +#define USE_FLOORL_BUILTIN 0
>> +#define USE_FLOORF128_BUILTIN 0
> 
> Ditto.

Ditto


>> +
>> +#define USE_CEIL_BUILTIN 0
>> +#define USE_CEILF_BUILTIN 0
>> +#define USE_CEILL_BUILTIN 0
>> +#define USE_CEILF128_BUILTIN 0
> 
> Ditto.

Ditto

> 
>> +
>> +#define USE_TRUNC_BUILTIN 0
>> +#define USE_TRUNCF_BUILTIN 0
>> +#define USE_TRUNCL_BUILTIN 0
>> +#define USE_TRUNCF128_BUILTIN 0
> 
> Ditto.

Ditto

>> +
>> +#define USE_ROUND_BUILTIN 0
>> +#define USE_ROUNDF_BUILTIN 0
>> +#define USE_ROUNDL_BUILTIN 0
>> +#define USE_ROUNDF128_BUILTIN 0
> 
> Ditto.

Ditto

>> +
>> +#define USE_COPYSIGNL_BUILTIN 1
>> +#if __GNUC_PREREQ (7, 0)
>> +# define USE_COPYSIGNF128_BUILTIN 1
>> +#else
>> +# define USE_COPYSIGNF128_BUILTIN 0
>> +#endif
>> +
> 
> It should be described in commit message as well (although generated
> instruction are essentially the same).

Well this one is even more special as it was already using the same code, except
that the math-use-builtins.h was generic vs. aarch64 specific one.

Thx
-Vineet

  reply	other threads:[~2020-06-01 21:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30  2:00 [PATCH 0/5] use gcc builtins for sqrt and fma functions Vineet Gupta via Libc-alpha
2020-05-30  2:00 ` [PATCH 1/5] ARC/dl-runtime helper macros Vineet Gupta via Libc-alpha
2020-05-30  2:17   ` Vineet Gupta via Libc-alpha
2020-05-30  2:00 ` [PATCH 2/5] iee754: prvoide gcc builtins based generic sqrt functions Vineet Gupta via Libc-alpha
2020-06-01 14:13   ` Adhemerval Zanella via Libc-alpha
2020-06-01 14:42     ` Adhemerval Zanella via Libc-alpha
2020-06-01 18:12       ` Vineet Gupta via Libc-alpha
2020-06-01 18:32         ` Adhemerval Zanella via Libc-alpha
2020-06-01 14:18   ` Florian Weimer
2020-06-01 18:12     ` Vineet Gupta via Libc-alpha
2020-05-30  2:00 ` [PATCH 3/5] iee754: prvoide gcc builtins based generic fma functions Vineet Gupta via Libc-alpha
2020-06-01 14:20   ` Adhemerval Zanella via Libc-alpha
2020-06-01 16:13   ` Florian Weimer
2020-05-30  2:00 ` [PATCH 4/5] aarch/fpu: use generic sqrt, " Vineet Gupta via Libc-alpha
2020-06-01 16:38   ` Adhemerval Zanella via Libc-alpha
2020-06-01 21:44     ` Vineet Gupta via Libc-alpha [this message]
2020-06-01 22:08       ` Ramana Radhakrishnan via Libc-alpha
2020-06-02 18:12       ` Joseph Myers
2020-05-30  2:00 ` [PATCH 5/5] powerpc/fpu: use generic " Vineet Gupta via Libc-alpha
2020-06-01 17:10   ` Adhemerval Zanella via Libc-alpha

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=e6b5ba39-dfd4-abe3-5743-ae1bf1b8e9a9@synopsys.com \
    --to=libc-alpha@sourceware.org \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=linux-snps-arc@lists.infradead.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).