summaryrefslogtreecommitdiffstats
path: root/arch/arm/net/bpf_jit_32.h
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2018-07-11 10:32:12 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2018-07-12 20:45:23 +0200
commit828e2b90e8e9b5bd844a25f22ceeb8df4dd18b07 (patch)
treec487a6b61c89ce646578cad5950403c945517a46 /arch/arm/net/bpf_jit_32.h
parent1ca3b17b777c4136f9dba0195e13502c445f4ade (diff)
downloadlinux-0-day-828e2b90e8e9b5bd844a25f22ceeb8df4dd18b07.tar.gz
linux-0-day-828e2b90e8e9b5bd844a25f22ceeb8df4dd18b07.tar.xz
ARM: net: bpf: use immediate forms of instructions where possible
Rather than moving constants to a register and then using them in a subsequent instruction, use them directly in the desired instruction cutting out the "middle" register. This removes two instructions from the tail call code path. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'arch/arm/net/bpf_jit_32.h')
-rw-r--r--arch/arm/net/bpf_jit_32.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm/net/bpf_jit_32.h b/arch/arm/net/bpf_jit_32.h
index c55bc39d3e224..dee8a76fb0bcb 100644
--- a/arch/arm/net/bpf_jit_32.h
+++ b/arch/arm/net/bpf_jit_32.h
@@ -78,6 +78,7 @@
#define ARM_INST_EOR_I 0x02200000
#define ARM_INST_LDST__U 0x00800000
+#define ARM_INST_LDST__IMM12 0x00000fff
#define ARM_INST_LDRB_I 0x05500000
#define ARM_INST_LDRB_R 0x07d00000
#define ARM_INST_LDRH_I 0x015000b0