linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Christophe Leroy <christophe.leroy@c-s.fr>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	segher@kernel.crashing.org
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/3] powerpc: rewrite LOAD_REG_IMMEDIATE() as an intelligent macro
Date: Wed, 28 Aug 2019 14:24:49 +1000 (AEST)	[thread overview]
Message-ID: <46JCM570Xkz9sP6@ozlabs.org> (raw)
In-Reply-To: <d60ce8dd3a383c7adbfc322bf1d53d81724a6000.1566311636.git.christophe.leroy@c-s.fr>

On Tue, 2019-08-20 at 14:34:12 UTC, Christophe Leroy wrote:
> Today LOAD_REG_IMMEDIATE() is a basic #define which loads all
> parts on a value into a register, including the parts that are NUL.
> 
> This means always 2 instructions on PPC32 and always 5 instructions
> on PPC64. And those instructions cannot run in parallele as they are
> updating the same register.
> 
> Ex: LOAD_REG_IMMEDIATE(r1,THREAD_SIZE) in head_64.S results in:
> 
> 3c 20 00 00     lis     r1,0
> 60 21 00 00     ori     r1,r1,0
> 78 21 07 c6     rldicr  r1,r1,32,31
> 64 21 00 00     oris    r1,r1,0
> 60 21 40 00     ori     r1,r1,16384
> 
> Rewrite LOAD_REG_IMMEDIATE() with GAS macro in order to skip
> the parts that are NUL.
> 
> Rename existing LOAD_REG_IMMEDIATE() as LOAD_REG_IMMEDIATE_SYM()
> and use that one for loading value of symbols which are not known
> at compile time.
> 
> Now LOAD_REG_IMMEDIATE(r1,THREAD_SIZE) in head_64.S results in:
> 
> 38 20 40 00     li      r1,16384
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/c691b4b83b6a348f7b9d13c36916e73c2e1d85e4

cheers

      parent reply	other threads:[~2019-08-28  4:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 14:34 [PATCH v4 1/3] powerpc: rewrite LOAD_REG_IMMEDIATE() as an intelligent macro Christophe Leroy
2019-08-20 14:34 ` [PATCH v4 2/3] powerpc/32: replace LOAD_MSR_KERNEL() by LOAD_REG_IMMEDIATE() Christophe Leroy
2019-08-20 14:34 ` [PATCH v4 3/3] powerpc/64: optimise LOAD_REG_IMMEDIATE_SYM() Christophe Leroy
2019-08-28  4:24 ` Michael Ellerman [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=46JCM570Xkz9sP6@ozlabs.org \
    --to=patch-notifications@ellerman.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=christophe.leroy@c-s.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    --cc=segher@kernel.crashing.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).