public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
To: libc-alpha@sourceware.org
Subject: Re: [PATCHv2] powerpc: POWER8 memcpy optimization for cached memory
Date: Sun, 10 Dec 2017 07:11:00 -0000	[thread overview]
Message-ID: <c1c65d6c-51cb-2be4-b292-cbad462e7983@linux.vnet.ibm.com> (raw)
In-Reply-To: <20171208194020.5005-1-tuliom@linux.vnet.ibm.com>



On 12/09/2017 01:10 AM, Tulio Magno Quites Machado Filho wrote:
> From: Adhemerval Zanella<azanella@linux.vnet.ibm.com>
> 
> I made the changes I requested, updated copyright entries, added a
> manual entry and fixed a build issue on powerpc64.
> 
> --- 8< ---
> 
> On POWER8, unaligned memory accesses to cached memory has little impact
> on performance as opposed to its ancestors.
> 
> It is disabled by default and will only be available when the tunable
> glibc.tune.cached_memopt is set to 1.
> 
>                   __memcpy_power8_cached      __memcpy_power7
> ============================================================
>      max-size=4096:     33325.70 ( 12.65%)        38153.00
>      max-size=8192:     32878.20 ( 11.17%)        37012.30
>     max-size=16384:     33782.20 ( 11.61%)        38219.20
>     max-size=32768:     33296.20 ( 11.30%)        37538.30
>     max-size=65536:     33765.60 ( 10.53%)        37738.40
> 
> 2017-12-08  Adhemerval Zanella<azanella@linux.vnet.ibm.com>
> 	    Tulio Magno Quites Machado Filho<tuliom@linux.vnet.ibm.com>
> 
> 	* manual/tunables.texi (Hardware Capability Tunables): Document
> 	glibc.tune.cached_memopt.
> 	* sysdeps/powerpc/cpu-features.c: New file.
> 	* sysdeps/powerpc/cpu-features.h: New file.
> 	* sysdeps/powerpc/dl-procinfo.c [!IS_IN(ldconfig)]: Add
> 	_dl_powerpc_cpu_features.
> 	* sysdeps/powerpc/dl-tunables.list: New file.
> 	* sysdeps/powerpc/ldsodefs.h: Include cpu-features.h.
> 	* sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h: .

Comment missing.
> 	* sysdeps/powerpc/powerpc64/dl-machine.h (INIT_ARCH): Initialize
> 	use_aligned_memopt.

Should this be moved to init-arch.h? (also use_cached_memopt)
> 	* sysdeps/powerpc/powerpc64/multiarch/Makefile (sysdep_routines):
> 	Add memcpy-power8-cached.
> 	* sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: Add
> 	__memcpy_power8_cached.
> 	* sysdeps/powerpc/powerpc64/multiarch/memcpy.c: Likewise.
> 	* sysdeps/powerpc/powerpc64/multiarch/memcpy-power8-cached.S:
> 	New file.
> ---
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy-power8-cached.S b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power8-cached.S
> new file mode 100644
> index 0000000..e5b6f25
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy-power8-cached.S
> @@ -0,0 +1,179 @@
> +	stxvd2x	v0,r0,r3
> +L(dst_is_align_16):
> +	cmpldi	cr7,r5,127
> +	ble	cr7,L(tail_copy)
> +	addi	r8,r5,-128
> +	mr	r9,r12
> +	rldicr	r8,r8,0,56
> +	li	r11,16
> +	srdi	r10,r8,7
> +	addi	r0,r8,128
> +	addi	r10,r10,1

Can we directly do
	rldicr  r0, r5, 0, 56
	srdi    r10,r5,7
instead of this sequence?
79         addi    r8,r5,-128
81         rldicr  r8,r8,0,56
83         srdi    r10,r8,7
84         addi    r0,r8,128
85         addi    r10,r10,1

> +	li	r6,32
> +	mtctr	r10
> +	li	r7,48
> +
> +	/* Main loop, copy 128 bytes each time.  */

LGTM.

Reviewed-by: Rajalakshmi Srinivasaraghavan  <raji@linux.vnet.ibm.com>


-- 
Thanks
Rajalakshmi S

  parent reply	other threads:[~2017-12-10  7:11 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18  5:13 [PATCH] powerpc: Use aligned stores in memset Rajalakshmi Srinivasaraghavan
2017-08-18  6:21 ` Florian Weimer
2017-08-18  6:51   ` Rajalakshmi Srinivasaraghavan
2017-08-18  9:10     ` Florian Weimer
2017-08-18 12:13       ` Adhemerval Zanella
2017-09-12 10:30       ` Florian Weimer
2017-09-12 12:18         ` Zack Weinberg
2017-09-12 13:57           ` Steven Munroe
2017-09-12 14:37           ` Joseph Myers
2017-09-12 15:06             ` Zack Weinberg
2017-09-12 17:09           ` Florian Weimer
2017-09-12 13:38         ` Steven Munroe
2017-09-12 14:08           ` Florian Weimer
2017-09-12 14:16             ` Steven Munroe
2017-09-12 17:04               ` Florian Weimer
2017-09-12 19:21                 ` Steven Munroe
2017-09-12 19:45                   ` Florian Weimer
2017-09-12 20:25                     ` Steven Munroe
2017-09-13 13:12         ` Tulio Magno Quites Machado Filho
2017-09-18 13:54           ` Florian Weimer
2017-10-03 18:29             ` Adhemerval Zanella
2017-10-05 12:13               ` Rajalakshmi Srinivasaraghavan
2017-11-08 18:52               ` Tulio Magno Quites Machado Filho
2017-12-08 19:52                 ` [PATCHv2] powerpc: POWER8 memcpy optimization for cached memory Tulio Magno Quites Machado Filho
2017-12-08 20:06                   ` Florian Weimer
2017-12-11 12:44                     ` Tulio Magno Quites Machado Filho
2017-12-11 20:09                       ` Adhemerval Zanella
2017-12-10  7:11                   ` Rajalakshmi Srinivasaraghavan [this message]
2017-12-11 19:48                     ` Tulio Magno Quites Machado Filho
2017-08-18  6:25 ` [PATCH] powerpc: Use aligned stores in memset Andrew Pinski
2017-08-21  2:20 ` Tulio Magno Quites Machado Filho

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=c1c65d6c-51cb-2be4-b292-cbad462e7983@linux.vnet.ibm.com \
    --to=raji@linux.vnet.ibm.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).