]> git.baikalelectronics.ru Git - kernel.git/commit
bpf, x64: save several bytes when mul dest is r0/r3 anyway
authorDaniel Borkmann <daniel@iogearbox.net>
Sat, 24 Feb 2018 00:08:00 +0000 (01:08 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 24 Feb 2018 06:50:00 +0000 (22:50 -0800)
commitef8a352ca648ac666fb3ed46e6a9a61c27305587
tree3d168b1decd203600c39c67ba730eabb7178e829
parentc14d13dd10d591173b49ae356a85988bf6b261f6
bpf, x64: save several bytes when mul dest is r0/r3 anyway

Instead of unconditionally performing push/pop on rax/rdx
in case of multiplication, we can save a few bytes in case
of dest register being either BPF r0 (rax) or r3 (rdx)
since the result is written in there anyway.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
arch/x86/net/bpf_jit_comp.c