bpf,x64: Use BMI2 for shifts
Status from this message: This series was applied to bpf/bpf-next.git (master)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest3 patches 0 repliesApplied 3/3
- v43 patches 3 repliesSuperseded
- v33 patches 0 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 2 patches | 3 replies | Superseded | |
| v1 | 1 patch | 1 reply | Superseded |
Changes in v5 from the cover letter
- More comments regarding instruction encoding
Patches in v5 All 3 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | bpf,x64: avoid unnecessary instructions when shift dest is ecxarch/ | +15 | 0 replies | Applied |
| 2/3 | bpf,x64: use shrx/sarx/shlx when availablearch/ | +81 | 0 replies | Applied |
| 3/3 | bpf: add selftests for lsh, rsh, arsh with reg operandtools/ | +24 | 0 replies | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.
Cover letter [PATCH bpf-next v5 0/3] bpf,x64: Use BMI2 for shifts
With baseline x64 instruction set, shift count can only be an immediate or in %cl. The implicit dependency on %cl makes it necessary to shuffle registers around and/or add push/pop operations.
BMI2 provides shift instructions that can use any general register as the shift count, saving us instructions and a few bytes in most cases.
Suboptimal codegen when %ecx is source and/or destination is also addressed and unnecessary instructions are removed.
test_progs: Summary: 267/1340 PASSED, 25 SKIPPED, 0 FAILED
test_progs-no_alu32: Summary: 267/1333 PASSED, 26 SKIPPED, 0 FAILEDtest_verifier: Summary: 1367 PASSED, 636 SKIPPED, 0 FAILED (same result
with or without BMI2)test_maps: OK, 0 SKIPPEDlib/test_bpf:
test_bpf: Summary: 1026 PASSED, 0 FAILED, [1014/1014 JIT'ed]
test_bpf: test_tail_calls: Summary: 10 PASSED, 0 FAILED, [10/10 JIT'ed]
test_bpf: test_skb_segment: Summary: 2 PASSED, 0 FAILED
---
v4 -> v5:
- More comments regarding instruction encoding
v3 -> v4:
- Fixed a regression when BMI2 isn't available
Jie Meng (3):
bpf,x64: avoid unnecessary instructions when shift dest is ecx bpf,x64: use shrx/sarx/shlx when available
bpf: add selftests for lsh, rsh, arsh with reg operand
arch/x86/net/bpf_jit_comp.c | 106 ++++++++++++++++++--- tools/testing/selftests/bpf/verifier/jit.c | 24 +++++ 2 files changed, 118 insertions(+), 12 deletions(-)
Signature · 1 line
2.30.2