* [PATCH net-next] x86 bpf_jit: support BPF_S_ANC_ALU_XOR_X instruction
@ 2012-06-05 7:26 Eric Dumazet
2012-06-06 16:44 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2012-06-05 7:26 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Jiri Pirko
From: Eric Dumazet <edumazet@google.com>
commit ffe06c17afbb (filter: add XOR operation) added generic support
for XOR operation.
This patch implements the XOR instruction in x86 jit.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jiri Pirko <jpirko@redhat.com>
---
arch/x86/net/bpf_jit_comp.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 0597f95..2cf6ce3 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -309,6 +309,10 @@ void bpf_jit_compile(struct sk_filter *fp)
else
EMIT1_off32(0x0d, K); /* or imm32,%eax */
break;
+ case BPF_S_ANC_ALU_XOR_X: /* A ^= X; */
+ seen |= SEEN_XREG;
+ EMIT2(0x31, 0xd8); /* xor %ebx,%eax */
+ break;
case BPF_S_ALU_LSH_X: /* A <<= X; */
seen |= SEEN_XREG;
EMIT4(0x89, 0xd9, 0xd3, 0xe0); /* mov %ebx,%ecx; shl %cl,%eax */
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] x86 bpf_jit: support BPF_S_ANC_ALU_XOR_X instruction
2012-06-05 7:26 [PATCH net-next] x86 bpf_jit: support BPF_S_ANC_ALU_XOR_X instruction Eric Dumazet
@ 2012-06-06 16:44 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-06-06 16:44 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, jpirko, mgherzan, matt
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 05 Jun 2012 09:26:30 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> commit ffe06c17afbb (filter: add XOR operation) added generic support
> for XOR operation.
>
> This patch implements the XOR instruction in x86 jit.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Jiri Pirko <jpirko@redhat.com>
Applied, thanks Eric. I'll take care of Sparc.
ARM and POWERPC folks, this is just a reminder for you guys
to do this too. Adding support for XOR to your JITs ought to
be quite trivial.
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-06 16:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-05 7:26 [PATCH net-next] x86 bpf_jit: support BPF_S_ANC_ALU_XOR_X instruction Eric Dumazet
2012-06-06 16:44 ` David Miller
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).