public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Simon Guo <wei.guo.simon@gmail•com>
To: Segher Boessenkool <segher@kernel•crashing.org>
Cc: linuxppc-dev@lists•ozlabs.org,
	"Naveen N.  Rao" <naveen.n.rao@linux•vnet.ibm.com>,
	Cyril Bur <cyrilbur@gmail•com>
Subject: Re: [PATCH v6 2/4] powerpc/64: enhance memcmp() with VMX instruction for long bytes comparision
Date: Wed, 6 Jun 2018 14:42:27 +0800	[thread overview]
Message-ID: <20180606064227.GB7342@simonLocalRHEL7.x64> (raw)
In-Reply-To: <20180530090321.GE5951@simonLocalRHEL7.x64>

Hi segher,
On Wed, May 30, 2018 at 05:03:21PM +0800, Simon Guo wrote:
> On Wed, May 30, 2018 at 03:35:40AM -0500, Segher Boessenkool wrote:
> > On Wed, May 30, 2018 at 04:14:02PM +0800, Simon Guo wrote:
> > > Hi Segher,
> > > On Mon, May 28, 2018 at 06:05:59AM -0500, Segher Boessenkool wrote:
> > > > On Fri, May 25, 2018 at 12:07:34PM +0800, wei.guo.simon@gmail•com wrote:
> > > > > +	/* save and restore cr0 */
> > > > > +	mfocrf  r5,64
> > > > > +	EXIT_VMX_OPS
> > > > > +	mtocrf	64,r5
> > > > > +	b	.LcmpAB_lightweight
> > > > 
> > > > That's cr1, not cr0.  You can use mcrf instead, it is cheaper (esp. if
> > > > you have it in a non-volatile CR field before so you need only one, if any).
> > > > 
> > > You are right :) How about using mtcr/mfcr instead, I think they are
> > > fast as well and more readable.
> > 
> > Those are much worse than m[ft]ocrf.
> > 
> > You probably should just shuffle things around so that EXIT_VMX_OPS
> > does not clobber the CR field you need to keep.
> Let me use mcrf then :)

I now felt unformatable to use mcrf like:
mcrf    7,0

since I cannot 100% confident that compiler will not use CR7 or other
CR# in exit_vmx_ops().

Can we switch back to mfocrf/mtocrf with correct CR0 value?
       mfocrf  r5,128
        ...
       mtocrf  128,r5

Thanks,
- Simon

  reply	other threads:[~2018-06-06  6:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25  4:07 [PATCH v6 0/4] powerpc/64: memcmp() optimization wei.guo.simon
2018-05-25  4:07 ` [PATCH v6 1/4] powerpc/64: Align bytes before fall back to .Lshort in powerpc64 memcmp() wei.guo.simon
2018-05-28 10:35   ` Segher Boessenkool
2018-05-30  8:11     ` Simon Guo
2018-05-30  8:27       ` Segher Boessenkool
2018-05-30  9:02         ` Simon Guo
2018-05-25  4:07 ` [PATCH v6 2/4] powerpc/64: enhance memcmp() with VMX instruction for long bytes comparision wei.guo.simon
2018-05-28 11:05   ` Segher Boessenkool
2018-05-30  8:14     ` Simon Guo
2018-05-30  8:35       ` Segher Boessenkool
2018-05-30  9:03         ` Simon Guo
2018-06-06  6:42           ` Simon Guo [this message]
2018-06-06 20:00             ` Segher Boessenkool
2018-05-28 11:59   ` Michael Ellerman
2018-05-30  8:15     ` Simon Guo
2018-05-25  4:07 ` [PATCH v6 3/4] powerpc/64: add 32 bytes prechecking before using VMX optimization on memcmp() wei.guo.simon
2018-05-25  4:07 ` [PATCH v6 4/4] powerpc:selftest update memcmp_64 selftest for VMX implementation wei.guo.simon

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=20180606064227.GB7342@simonLocalRHEL7.x64 \
    --to=wei.guo.simon@gmail$(echo .)com \
    --cc=cyrilbur@gmail$(echo .)com \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=naveen.n.rao@linux$(echo .)vnet.ibm.com \
    --cc=segher@kernel$(echo .)crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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