HomePhabricator

bpf: add new insns for bswap_to_le and negation

Description

bpf: add new insns for bswap_to_le and negation

This patch adds new insn, "reg = be16/be32/be64 reg",
for bswap to little endian for big-endian target (bpfeb).
It also adds new insn for negation "reg = -reg".

Currently, for source code, e.g.,

b = -a

LLVM still prefers to generate:

b = 0 - a

But "reg = -reg" format can be used in assembly code.

Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>

Details

Committed
yhsSep 27 2017, 7:46 PM
Parents
rL314375: Use a BumpPtrAllocator for Loop objects
Branches
Unknown
Tags
Unknown