linux-snps-arc.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Liebler <stli@linux.ibm.com>
To: Vineet Gupta <Vineet.Gupta1@synopsys.com>,
	"libc-alpha@sourceware.org" <libc-alpha@sourceware.org>
Cc: arcml <linux-snps-arc@lists.infradead.org>
Subject: Re: [PATCH v2 2/4] iee754: provide gcc builtins based generic fma functions
Date: Wed, 3 Jun 2020 08:29:02 +0200	[thread overview]
Message-ID: <d2af88d7-6ae5-013a-4b00-4458e788a38d@linux.ibm.com> (raw)
In-Reply-To: <c9bc348f-0441-2f0c-7336-b541f7d1e6f9@synopsys.com>

On 6/2/20 7:13 PM, Vineet Gupta wrote:
> On 6/2/20 5:51 AM, Stefan Liebler via Libc-alpha wrote:
>>  #endif /* math-use-builtins.h */
>> Please also update the current architecture specific math-use-builtins.h
>> file: sysdeps/s390/fpu/math-use-builtins.h
>> Otherwise it will break build on s390x.
> 
> Done.
> 
>>> diff --git a/sysdeps/ieee754/dbl-64/s_fma.c b/sysdeps/ieee754/dbl-64/s_fma.c
>>> index 876df6e78bdc..9dc5b132b9ee 100644
>>> --- a/sysdeps/ieee754/dbl-64/s_fma.c
>>> +++ b/sysdeps/ieee754/dbl-64/s_fma.c
>>> @@ -25,6 +25,7 @@
>>>  #include <fenv_private.h>
>>>  #include <libm-alias-double.h>
>>>  #include <tininess.h>
>>> +#include <math-use-builtins.h>
>>>
>>>  /* This implementation uses rounding to odd to avoid problems with
>>>     double rounding.  See a paper by Boldo and Melquiond:
>>> @@ -33,6 +34,10 @@
>>>  double
>>>  __fma (double x, double y, double z)
>>>  {
>>> +#if USE_FMA_BUILTIN
>>> +  return __builtin_fma (x, y, z);
>>
>> Architectures which have support for ldbl-128 will use the file
>> sysdeps/ieee754/ldbl-128/s_fma.c instead of
>> sysdeps/ieee754/dbl-64/s_fma.c. Should this file also be adjusted in
>> order to use the builtin if USE_FMA_BUILTIN is set to one?
> 
> Right.
> 
> I used commit f82996f815 "Use GCC builtins for round functions if desired" as
> starting point for my change. And seems it was not an ideal reference :-) as round
> has far fewer instances than fma. Indeed fma is present in ldbl-128 and dbl-64 so
> needs updating in both.
> 
> But just to be sure s390 is currently not using the newly introduced builtins so
> I'll keep them as follows.
> 
> #define USE_SQRT_BUILTIN 0
> #define USE_SQRTF_BUILTIN 0
> 
> #define USE_FMA_BUILTIN 0
> #define USE_FMAF_BUILTIN 0
> #define USE_FMAL_BUILTIN 0
> #define USE_FMAF128_BUILTIN 0
> 
Yes. Those should be disabled for now in order to not break anything. As
soon as you've committed your patches, I'll have a look if I can
activate some of them and remove s390 specific implementations. But I
first have to check with the gcc guys, if the builtins are always
expanded correctly in various gcc versions.

Thanks.
Stefan
> -Vineet
> 


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

  parent reply	other threads:[~2020-06-03  6:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02  0:35 [PATCH v2 0/4] Enable generic math code for more arches Vineet Gupta
2020-06-02  0:35 ` [PATCH v2 1/4] iee754: provide gcc builtins based generic sqrt functions Vineet Gupta
     [not found]   ` <5d912d39-f017-31fa-990b-e1c1b735e1ff@linux.ibm.com>
2020-06-02 16:54     ` Vineet Gupta
2020-06-02 17:17   ` Adhemerval Zanella
2020-06-02  0:35 ` [PATCH v2 2/4] iee754: provide gcc builtins based generic fma functions Vineet Gupta
     [not found]   ` <34fc6c13-65e6-dcbb-42b1-1ba9f56b4dfd@linux.ibm.com>
2020-06-02 17:13     ` Vineet Gupta
     [not found]       ` <d6813e17-3847-7fd2-45e8-23576b62061d@linaro.org>
2020-06-03  0:20         ` Vineet Gupta
2020-06-03  6:29       ` Stefan Liebler [this message]
2020-06-02 17:28   ` Adhemerval Zanella
2020-06-02  0:35 ` [PATCH v2 3/4] aarch/fpu: use generic builtins based math functions Vineet Gupta
2020-06-02 17:31   ` Adhemerval Zanella
2020-06-02 19:14     ` Vineet Gupta
2020-06-02  0:35 ` [PATCH v2 4/4] powerpc/fpu: use generic fma functions Vineet Gupta

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=d2af88d7-6ae5-013a-4b00-4458e788a38d@linux.ibm.com \
    --to=stli@linux.ibm.com \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=libc-alpha@sourceware.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 NNTP newsgroup(s).