]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
nfp: bpf: optimize mov64 a little
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 23 Oct 2017 18:58:14 +0000 (11:58 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Oct 2017 08:38:37 +0000 (17:38 +0900)
commit9f16c8abcd79fc31a74d3af64f085a009c9d4b5a
treed022dc299e72425908879b4373be6fde515f471f
parentb14157eeed4eff2b293e0ca7738f6a3dbfff51cc
nfp: bpf: optimize mov64 a little

Loading 64bit constants require up to 4 load immediates, since
we can only load 16 bits at a time.  If the 32bit halves of
the 64bit constant are the same, however, we can save a cycle
by doing a register move instead of two loads of 16 bits.

Note that we don't optimize the normal ALU64 load because even
though it's a 64 bit load the upper half of the register is
a coming from sign extension so we can load it in one cycle
anyway.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/bpf/jit.c