Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1542019
| From | Anju T Sudhakar <anju@linux.vnet.ibm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH V2 1/4] powerpc: asm/ppc-opcode.h: introduce __PPC_SH64() |
| Date | 2016-12-14 17:20 +0100 |
| Message-ID | <sOkrD-9J-29@gated-at.bofh.it> (permalink) |
| References | <sOkrD-9J-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> Introduce __PPC_SH64() as a 64-bit variant to encode shift field in some of the shift and rotate instructions operating on double-words. Convert some of the BPF instruction macros to use the same. Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> --- arch/powerpc/include/asm/ppc-opcode.h | 1 + arch/powerpc/net/bpf_jit.h | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h index 0132831..630127b 100644 --- a/arch/powerpc/include/asm/ppc-opcode.h +++ b/arch/powerpc/include/asm/ppc-opcode.h @@ -306,6 +306,7 @@ #define __PPC_WC(w) (((w) & 0x3) << 21) #define __PPC_WS(w) (((w) & 0x1f) << 11) #define __PPC_SH(s) __PPC_WS(s) +#define __PPC_SH64(s) (__PPC_SH(s) | (((s) & 0x20) >> 4)) #define __PPC_MB(s) (((s) & 0x1f) << 6) #define __PPC_ME(s) (((s) & 0x1f) << 1) #define __PPC_MB64(s) (__PPC_MB(s) | ((s) & 0x20)) diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h index 89f7007..30cf03f 100644 --- a/arch/powerpc/net/bpf_jit.h +++ b/arch/powerpc/net/bpf_jit.h @@ -157,8 +157,7 @@ #define PPC_SRAD(d, a, s) EMIT(PPC_INST_SRAD | ___PPC_RA(d) | \ ___PPC_RS(a) | ___PPC_RB(s)) #define PPC_SRADI(d, a, i) EMIT(PPC_INST_SRADI | ___PPC_RA(d) | \ - ___PPC_RS(a) | __PPC_SH(i) | \ - (((i) & 0x20) >> 4)) + ___PPC_RS(a) | __PPC_SH64(i)) #define PPC_RLWINM(d, a, i, mb, me) EMIT(PPC_INST_RLWINM | ___PPC_RA(d) | \ ___PPC_RS(a) | __PPC_SH(i) | \ __PPC_MB(mb) | __PPC_ME(me)) @@ -166,11 +165,11 @@ ___PPC_RS(a) | __PPC_SH(i) | \ __PPC_MB(mb) | __PPC_ME(me)) #define PPC_RLDICL(d, a, i, mb) EMIT(PPC_INST_RLDICL | ___PPC_RA(d) | \ - ___PPC_RS(a) | __PPC_SH(i) | \ - __PPC_MB64(mb) | (((i) & 0x20) >> 4)) + ___PPC_RS(a) | __PPC_SH64(i) | \ + __PPC_MB64(mb)) #define PPC_RLDICR(d, a, i, me) EMIT(PPC_INST_RLDICR | ___PPC_RA(d) | \ - ___PPC_RS(a) | __PPC_SH(i) | \ - __PPC_ME64(me) | (((i) & 0x20) >> 4)) + ___PPC_RS(a) | __PPC_SH64(i) | \ + __PPC_ME64(me)) /* slwi = rlwinm Rx, Ry, n, 0, 31-n */ #define PPC_SLWI(d, a, i) PPC_RLWINM(d, a, i, 0, 31-(i)) -- 2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH V2 0/4] OPTPROBES for powerpc Anju T Sudhakar <anju@linux.vnet.ibm.com> - 2016-12-14 17:20 +0100
[PATCH V2 3/4] arch/powerpc: Implement Optprobes Anju T Sudhakar <anju@linux.vnet.ibm.com> - 2016-12-14 17:20 +0100
Re: [PATCH V2 3/4] arch/powerpc: Implement Optprobes Masami Hiramatsu <mhiramat@kernel.org> - 2016-12-16 15:10 +0100
Re: [PATCH V2 3/4] arch/powerpc: Implement Optprobes Anju T Sudhakar <anju@linux.vnet.ibm.com> - 2016-12-16 19:00 +0100
[PATCH V2 4/4] arch/powerpc: Optimize kprobe in kretprobe_trampoline Anju T Sudhakar <anju@linux.vnet.ibm.com> - 2016-12-14 17:20 +0100
Re: [PATCH V2 4/4] arch/powerpc: Optimize kprobe in kretprobe_trampoline Masami Hiramatsu <mhiramat@kernel.org> - 2016-12-16 15:10 +0100
[PATCH V2 1/4] powerpc: asm/ppc-opcode.h: introduce __PPC_SH64() Anju T Sudhakar <anju@linux.vnet.ibm.com> - 2016-12-14 17:20 +0100
[PATCH V2 2/4] powerpc: add helper to check if offset is within rel branch range Anju T Sudhakar <anju@linux.vnet.ibm.com> - 2016-12-14 17:20 +0100
Re: [PATCH V2 2/4] powerpc: add helper to check if offset is within rel branch range Masami Hiramatsu <mhiramat@kernel.org> - 2016-12-16 13:00 +0100
Re: [PATCH V2 2/4] powerpc: add helper to check if offset is within rel branch range Anju T Sudhakar <anju@linux.vnet.ibm.com> - 2016-12-16 17:40 +0100
Re: [PATCH V2 0/4] OPTPROBES for powerpc Balbir Singh <bsingharora@gmail.com> - 2016-12-16 16:00 +0100
Re: [PATCH V2 0/4] OPTPROBES for powerpc "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2016-12-16 18:30 +0100
csiph-web