diff options
author | Eric Dumazet <edumazet@google.com> | 2012-06-04 17:26:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-06 12:42:44 -0400 |
commit | 4bfaddf15bac7afa7048d105864dab65c5d1f9e7 (patch) | |
tree | e545e7e21fc521c7f81230476747b32557f7be73 /arch | |
parent | c2fd03a0115a244c5f622453b2b1f038ed5700a6 (diff) |
x86 bpf_jit: support BPF_S_ANC_ALU_XOR_X instruction
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/net/bpf_jit_comp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index 0597f95b6da6..33643a8bcbbb 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) | |||
309 | else | 309 | else |
310 | EMIT1_off32(0x0d, K); /* or imm32,%eax */ | 310 | EMIT1_off32(0x0d, K); /* or imm32,%eax */ |
311 | break; | 311 | break; |
312 | case BPF_S_ANC_ALU_XOR_X: /* A ^= X; */ | ||
313 | seen |= SEEN_XREG; | ||
314 | EMIT2(0x31, 0xd8); /* xor %ebx,%eax */ | ||
315 | break; | ||
312 | case BPF_S_ALU_LSH_X: /* A <<= X; */ | 316 | case BPF_S_ALU_LSH_X: /* A <<= X; */ |
313 | seen |= SEEN_XREG; | 317 | seen |= SEEN_XREG; |
314 | EMIT4(0x89, 0xd9, 0xd3, 0xe0); /* mov %ebx,%ecx; shl %cl,%eax */ | 318 | EMIT4(0x89, 0xd9, 0xd3, 0xe0); /* mov %ebx,%ecx; shl %cl,%eax */ |