diff options
| author | Luke Nelson <[email protected]> | 2020-05-01 02:02:10 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2020-05-04 15:04:42 +0000 |
| commit | c648c9c7429e979ca081359f39b6902aed92d490 (patch) | |
| tree | 86f5d9bfc42c012d4553fdfe6a79aebb228c6584 /tools/testing/selftests/bpf/prog_tests/queue_stack_map.c | |
| parent | bpf, arm: Optimize ALU64 ARSH X using orrpl conditional instruction (diff) | |
| download | kernel-c648c9c7429e979ca081359f39b6902aed92d490.tar.gz kernel-c648c9c7429e979ca081359f39b6902aed92d490.zip | |
bpf, arm: Optimize ALU ARSH K using asr immediate instruction
This patch adds an optimization that uses the asr immediate instruction
for BPF_ALU BPF_ARSH BPF_K, rather than loading the immediate to
a temporary register. This is similar to existing code for handling
BPF_ALU BPF_{LSH,RSH} BPF_K. This optimization saves two instructions
and is more consistent with LSH and RSH.
Example of the code generated for BPF_ALU32_IMM(BPF_ARSH, BPF_REG_0, 5)
before the optimization:
2c: mov r8, #5
30: mov r9, #0
34: asr r0, r0, r8
and after optimization:
2c: asr r0, r0, #5
Tested on QEMU using lib/test_bpf and test_verifier.
Co-developed-by: Xi Wang <[email protected]>
Signed-off-by: Xi Wang <[email protected]>
Signed-off-by: Luke Nelson <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/queue_stack_map.c')
0 files changed, 0 insertions, 0 deletions
