]> granicus.if.org Git - llvm/commit
[BPF] add code-gen support for JMP32 instructions
authorJiong Wang <jiwang@tilera.com>
Thu, 7 Feb 2019 10:43:09 +0000 (10:43 +0000)
committerJiong Wang <jiwang@tilera.com>
Thu, 7 Feb 2019 10:43:09 +0000 (10:43 +0000)
commit90ccb6a749e634a7cd6b14d3b65835b62a07d42f
tree4c567b28bc20c6f5e3aed9640be24b45ed05f4b5
parenta5defd33eab2139cfd42a48576b25b26e26f80cf
[BPF] add code-gen support for JMP32 instructions

JMP32 instructions has been added to eBPF ISA. They are 32-bit variants of
existing BPF conditional jump instructions, but the comparison happens on
low 32-bit sub-register only, therefore some unnecessary extensions could
be saved.

JMP32 instructions will only be available for -mcpu=v3. Host probe hook has
been updated accordingly.

JMP32 instructions will only be enabled in code-gen when -mattr=+alu32
enabled, meaning compiling the program using sub-register mode.

For JMP32 encoding, it is a new instruction class, and is using the
reserved eBPF class number 0x6.

This patch has been tested by compiling and running kernel bpf selftests
with JMP32 enabled.

Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353384 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Host.cpp
lib/Target/BPF/BPF.td
lib/Target/BPF/BPFISelLowering.cpp
lib/Target/BPF/BPFISelLowering.h
lib/Target/BPF/BPFInstrFormats.td
lib/Target/BPF/BPFInstrInfo.td
lib/Target/BPF/BPFSubtarget.cpp
lib/Target/BPF/BPFSubtarget.h
lib/Target/BPF/Disassembler/BPFDisassembler.cpp
test/MC/BPF/insn-unit-32.s