public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Szabolcs Nagy <szabolcs.nagy@arm.com>, libc-alpha@sourceware.org
Cc: nd@arm.com
Subject: Re: [PATCH 00/10] Optimized math routines
Date: Mon, 09 Jul 2018 18:20:00 -0000	[thread overview]
Message-ID: <9a3a104d-a7e9-4733-0583-a4f5f2c73619@linaro.org> (raw)
In-Reply-To: <eb50780d-d2da-1b40-5923-2cf27caf1ef2@arm.com>



On 09/07/2018 12:41, Szabolcs Nagy wrote:
> On 09/07/18 15:26, Adhemerval Zanella wrote:
>> On 09/07/2018 10:34, Szabolcs Nagy wrote:
>>> On 09/07/18 14:09, Adhemerval Zanella wrote:
>>>> On 09/07/2018 09:15, Szabolcs Nagy wrote:
>>>>> built and tested on a power8 machine now, glibc math
>>>>> tests pass (except for an unrelated fmal failure),
>>>>> benchmark improvements are consistent with aarch64/x86_64,
>>>>> but it was a shared access machine so i won't post exact
>>>>> numbers, sincosf improved a bit too, sinf/cosf didn't
>>>>> (apparently powerpc has its own implementation).
>>>>
>>>> PowerPC sinf/cosf uses the same algorithm used on x86, I presume
>>>> it would be a gain to generic implementation as well.
>>>>
>>>
>>> you mean the new implementation would be better or the
>>> target specific one?
>>>
>>> new implementation has better latency on this particular
>>> powerpc machine than the target specific code, but
>>> throughput is worse sometimes (using the default 0
>>> setting for PREFER_FLOAT_COMPARISON).
>>
>> I did not measure, but I would expect.  PowerPC uses an different
>> implementation for generic code (s_sinf-ppc64.c) so comparing against
>> it maybe misleading (since it use the old implementation still).
>>
> 
> i'm comparing two glibc builds, they both still use the
> same (old) code for sinf/cosf so there is nothing misleading.

I meant comparing the generic s_sinf against powerpc's one (since
default ifunc selection for powerpc is not the generic is not
sysdeps/ieee754/flt-32/s_sinf.c). But indeed this is not for
this case, sorry for the noise.

> 
> the sincosf code is generic though and the new implementation
> does show some speedup.
> 
>> I am not sure which compiler you used for evaluation, but at least
>> Ubuntu 16.04 one (gcc 5.4) does not use POWER8 ISA as default and
>> even with -mcpu=power8 it generates subpar code.  I will try to
>> check with a GCC 7.1 (but as for your environment, I am using
>> a shared machine, although it I think I might get slight better
>> results because it uses a micro-partition).
>>
> 
> i built a gcc 7.3.0 toolchain, the host toolchain would
> not be able to build glibc (gcc-4.8), same for the host
> make (3.82). (it's a gcc build farm machine)

Using glibc benchmarks, I also see better results with power8 
implementation:

s_sinf-power8:

  "sinf": {
   "": {
    "duration": 5.12725e+09,
    "iterations": 7.03494e+08,
    "max": 983.08,
    "min": 6.06,
    "mean": 7.28827
   }
  }


s_sinf-ppc64:

  "sinf": {
   "": {
    "duration": 5.13064e+09,
    "iterations": 1.86048e+08,
    "max": 1032.52,
    "min": 8.035,
    "mean": 27.577
   }
  }

generic s_sinf:

  "sinf": {
   "": {
    "duration": 5.12404e+09,
    "iterations": 6.74424e+08,
    "max": 515.97,
    "min": 6.089,
    "mean": 7.59765
   }
  }

One remark is I think we can get rid of generic powerpc sinf
(sysdeps/powerpc/fpu/s_sinf.c) and use generic implementation
instead.

> 
>> For PREFER_FLOAT_COMPARISON, do we use this on glibc? I think
>> it is only enabled on optimized-routines, isn't it?
> 
> it is disabled by default, it is there so targets can enable
> it if float compares are faster than using the representation,
> currently disabled everywhere in glibc.
> (i don't want to change that setting now, that case can
> be tweaked later)

  reply	other threads:[~2018-07-09 18:20 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-06  8:49 Szabolcs Nagy
2018-07-06  8:57 ` [PATCH 01/10] Clean up converttoint handling and document the semantics Szabolcs Nagy
2018-08-07 19:52   ` Joseph Myers
2018-07-06  8:57 ` [PATCH 02/10] Improve performance of sincosf Szabolcs Nagy
2018-07-11 13:22   ` Szabolcs Nagy
2018-08-07 20:11     ` Joseph Myers
2018-08-10 12:12       ` Wilco Dijkstra
2018-08-10 16:04         ` Joseph Myers
2018-07-06  8:59 ` [PATCH 03/10] Improve performance of sinf and cosf Szabolcs Nagy
2018-08-13 19:46   ` Joseph Myers
2018-08-14 19:41     ` Joseph Myers
2018-08-15 13:11       ` Wilco Dijkstra
2018-07-06  9:02 ` [PATCH 04/10] Add new exp and exp2 implementations Szabolcs Nagy
2018-08-22 19:55   ` Joseph Myers
2018-09-05 15:26     ` Szabolcs Nagy
2018-07-06  9:04 ` [PATCH 05/10] aarch64: update libm-test-ulps Szabolcs Nagy
2018-08-24 17:09   ` Joseph Myers
2018-07-06  9:05 ` [PATCH 06/10] arm: " Szabolcs Nagy
2018-07-06  9:06 ` [PATCH 07/10] x86_64: " Szabolcs Nagy
2018-07-06  9:08 ` [PATCH 08/10] Add new log implementation Szabolcs Nagy
2018-08-24 17:19   ` Joseph Myers
2018-07-06  9:09 ` [PATCH 09/10] Add new log2 implementation Szabolcs Nagy
2018-07-06  9:10 ` [PATCH 10/10] Add new pow implementation Szabolcs Nagy
2018-07-11 13:24   ` Szabolcs Nagy
2018-07-06 12:43 ` [PATCH 00/10] Optimized math routines Carlos O'Donell
2018-07-06 15:46   ` Szabolcs Nagy
2018-07-06 16:27     ` Carlos O'Donell
2018-07-06 17:17       ` Szabolcs Nagy
2018-07-09 12:15         ` Szabolcs Nagy
2018-07-09 13:09           ` Adhemerval Zanella
2018-07-09 13:35             ` Szabolcs Nagy
2018-07-09 14:27               ` Adhemerval Zanella
2018-07-09 15:41                 ` Szabolcs Nagy
2018-07-09 18:20                   ` Adhemerval Zanella [this message]
2018-07-17 21:59         ` Joseph Myers
2018-07-18  0:07           ` Carlos O'Donell
2018-07-11 13:39       ` Szabolcs Nagy
2018-07-11 14:19 ` [PATCH] powerpc: update libm-test-ulps Szabolcs Nagy
2018-07-12 15:52 ` [PATCH] update libm-test-ulps for new exp Szabolcs Nagy
2018-07-18 17:25   ` Joseph Myers
2018-07-19  9:15     ` Szabolcs Nagy
2018-07-19 17:03       ` Joseph Myers
2018-07-19 17:15         ` Wilco Dijkstra
2018-07-19 17:23           ` Joseph Myers
2018-08-07 11:03 ` [PATCH 00/10] Optimized math routines Szabolcs Nagy

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=9a3a104d-a7e9-4733-0583-a4f5f2c73619@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    --cc=nd@arm.com \
    --cc=szabolcs.nagy@arm.com \
    /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).