aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/verifier
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2019-10-03 01:45:11 +0200
committerAlexei Starovoitov <ast@kernel.org>2019-10-04 12:26:51 -0700
commit38f51c07054ff4796e473dba3bff2e648378002c (patch)
treece408174555426e21490d6c86c7d32fb1a444d8e /tools/testing/selftests/bpf/verifier
parentselftests/bpf: Correct path to include msg + path (diff)
downloadlinux-dev-38f51c07054ff4796e473dba3bff2e648378002c.tar.xz
linux-dev-38f51c07054ff4796e473dba3bff2e648378002c.zip
bpf, x86: Small optimization in comparing against imm0
Replace 'cmp reg, 0' with 'test reg, reg' for comparisons against zero. Saves 1 byte of instruction encoding per occurrence. The flag results of test 'reg, reg' are identical to 'cmp reg, 0' in all cases except for AF which we don't use/care about. In terms of macro-fusibility in combination with a subsequent conditional jump instruction, both have the same properties for the jumps used in the JIT translation. For example, same JITed Cilium program can shrink a bit from e.g. 12,455 to 12,317 bytes as tests with 0 are used quite frequently. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Song Liu <songliubraving@fb.com> Acked-by: John Fastabend <john.fastabend@gmail.com>
Diffstat (limited to 'tools/testing/selftests/bpf/verifier')
0 files changed, 0 insertions, 0 deletions