All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Balamuruhan S <bala24@linux.ibm.com>, mpe@ellerman.id.au
Cc: ravi.bangoria@linux.ibm.com, jniethe5@gmail.com,
	paulus@samba.org, sandipan@linux.ibm.com,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [RFC PATCH v2 4/7] powerpc/ppc-opcode: consolidate powerpc instructions from bpf_jit.h
Date: Tue, 28 Apr 2020 21:49:22 +0530	[thread overview]
Message-ID: <1588090693.amos3csf0f.naveen@linux.ibm.com> (raw)
In-Reply-To: <20200424070853.443969-5-bala24@linux.ibm.com>

Balamuruhan S wrote:
> move macro definitions of powerpc instructions from bpf_jit.h to ppc-opcode.h
> and adopt the users of the macros accordingly. `PPC_MR()` is defined twice in
> bpf_jit.h, remove the duplicate one.
> 
> Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>
> ---
>  arch/powerpc/include/asm/ppc-opcode.h | 139 +++++++++++++
>  arch/powerpc/net/bpf_jit.h            | 166 ++-------------
>  arch/powerpc/net/bpf_jit32.h          |  24 +--
>  arch/powerpc/net/bpf_jit64.h          |  12 +-
>  arch/powerpc/net/bpf_jit_comp.c       | 132 ++++++------
>  arch/powerpc/net/bpf_jit_comp64.c     | 278 +++++++++++++-------------
>  6 files changed, 378 insertions(+), 373 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
> index 2ae0afc5c2bb..6b9a891884be 100644
> --- a/arch/powerpc/include/asm/ppc-opcode.h
> +++ b/arch/powerpc/include/asm/ppc-opcode.h
> @@ -79,6 +79,16 @@
>  #define IMM_L(i)               ((uintptr_t)(i) & 0xffff)
>  #define IMM_DS(i)              ((uintptr_t)(i) & 0xfffc)
> 
> +/*
> + * 16-bit immediate helper macros: HA() is for use with sign-extending instrs
> + * (e.g. LD, ADDI).  If the bottom 16 bits is "-ve", add another bit into the
> + * top half to negate the effect (i.e. 0xffff + 1 = 0x(1)0000).
> + */
> +#define IMM_H(i)                ((uintptr_t)(i)>>16)
> +#define IMM_HA(i)               (((uintptr_t)(i)>>16) +                       \
> +					(((uintptr_t)(i) & 0x8000) >> 15))
> +

Not needed for this patch series, but at some point, we should move over 
to using the PPC_LO(), PPC_HI() and PPC_HA() macros that are defined 
later in this file.


- Naveen


  reply	other threads:[~2020-04-28 16:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24  7:08 [RFC PATCH v2 0/7] consolidate PowerPC instruction encoding macros Balamuruhan S
2020-04-24  7:08 ` [RFC PATCH v2 1/7] powerpc/ppc-opcode: introduce PPC_RAW_* macros for base instruction encoding Balamuruhan S
2020-04-24  7:08 ` [RFC PATCH v2 2/7] powerpc/ppc-opcode: move ppc instruction encoding from test_emulate_step Balamuruhan S
2020-04-24  7:08 ` [RFC PATCH v2 3/7] powerpc/bpf_jit: reuse instruction macros from ppc-opcode.h Balamuruhan S
2020-04-24  7:08 ` [RFC PATCH v2 4/7] powerpc/ppc-opcode: consolidate powerpc instructions from bpf_jit.h Balamuruhan S
2020-04-28 16:19   ` Naveen N. Rao [this message]
2020-04-24  7:08 ` [RFC PATCH v2 5/7] powerpc/ppc-opcode: reuse raw instruction macros to stringify Balamuruhan S
2020-04-24  7:08 ` [RFC PATCH v2 6/7] powerpc/ppc-opcode: fold PPC_INST_* macros into PPC_RAW_* macros Balamuruhan S
2020-04-24  7:08 ` [RFC PATCH v2 7/7] powerpc/selftest: reuse ppc-opcode macros to avoid redundancy Balamuruhan S
2020-04-28 16:14   ` Naveen N. Rao
2020-04-29 10:06   ` Michael Ellerman
2020-04-29 14:17     ` Naveen N. Rao
2020-04-30  2:41       ` Michael Ellerman
2020-04-30 11:57         ` Naveen N. Rao
2020-05-26  7:45           ` Balamuruhan S
2020-04-28 16:15 ` [RFC PATCH v2 0/7] consolidate PowerPC instruction encoding macros Naveen N. Rao

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=1588090693.amos3csf0f.naveen@linux.ibm.com \
    --to=naveen.n.rao@linux.vnet.ibm.com \
    --cc=bala24@linux.ibm.com \
    --cc=jniethe5@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=ravi.bangoria@linux.ibm.com \
    --cc=sandipan@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.