public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
To: Raoni Fassina Firmino <raoni@linux.ibm.com>, libc-alpha@sourceware.org
Cc: rzinsly@linux.ibm.com, anton@ozlabs.org
Subject: Re: [PATCH v2] powerpc64le: Optimize memset for POWER10
Date: Fri, 30 Apr 2021 18:15:22 -0300	[thread overview]
Message-ID: <87eeermq39.fsf@linux.ibm.com> (raw)
In-Reply-To: <20210429234542.aeer5ncryowx34gs@work-tp>

Raoni Fassina Firmino via Libc-alpha <libc-alpha@sourceware.org> writes:

> This implementation is based on __memset_power8 and integrates a lot
> of suggestions from Anton Blanchard.
>
> The biggest difference is that it makes extensive use of stxvl to
> alignment and tail code to avoid branches and small stores.  It has
> three main execution paths:
>
> a) "Short lengths" for lengths up to 64 bytes, avoiding as many
>    branches as possible.
>
> b) "General case" for larger lengths, it has an alignment section
>    using stxvl to avoid branches, a 128 bytes loop and then a tail
>    code, again using stxvl with few branches.
>
> c) "Zeroing cache blocks" for lengths from 256 bytes upwards and set
>    value being zero.  It is mostly the __memset_power8 code but the
>    alignment phase was simplified because, at this point, address is
>    already 16-bytes aligned and also changed to use vector stores.
>    The tail code was also simplified to reuse the general case tail.
>
> All unaligned stores use stxvl instructions that do not generate
> alignment interrupts on POWER10, making it safe to use on
> caching-inhibited memory.
>
> On average, this implementation provides something around 30%
> improvement when compared to __memset_power8.

LGTM.
Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>

Pushed as 23fdf8178cce3c2ec320dd5eca8b544245bcaef0.

Thanks!

-- 
Tulio Magno

      parent reply	other threads:[~2021-04-30 21:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29 23:45 Raoni Fassina Firmino
2021-04-30  4:52 ` Florian Weimer
2021-04-30 12:16   ` Raoni Fassina Firmino
2021-04-30 12:21     ` Florian Weimer
2021-04-30 12:23       ` Florian Weimer
2021-04-30 13:02 ` Matheus Castanho
2021-04-30 21:15 ` Tulio Magno Quites Machado Filho [this message]

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=87eeermq39.fsf@linux.ibm.com \
    --to=tuliom@linux.ibm.com \
    --cc=anton@ozlabs.org \
    --cc=libc-alpha@sourceware.org \
    --cc=raoni@linux.ibm.com \
    --cc=rzinsly@linux.ibm.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).