OSDN Git Service

powerpc/bpf/32: Optimise some particular const operations
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Wed, 1 Feb 2023 10:04:29 +0000 (11:04 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 10 Feb 2023 11:17:35 +0000 (22:17 +1100)
commit8616045fe785229b53a24b8698631826298d1500
treee1eefbcc1a52c62d72f01318bf955e8034d17b6a
parentd3921cbb6cd663193cecf04f0b170a30c6d0e390
powerpc/bpf/32: Optimise some particular const operations

Simplify multiplications and divisions with constants when the
constant is 1 or -1.

When the constant is a power of 2, replace them by bit shits.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/e53b1f4a4150ec6cabcaeeef82bf9c361b5f9204.1675245773.git.christophe.leroy@csgroup.eu
arch/powerpc/net/bpf_jit_comp32.c